@ckeditor/ckeditor5-engine 45.2.1-alpha.9 → 46.0.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 (241) hide show
  1. package/dist/index.js +2563 -2257
  2. package/dist/index.js.map +1 -1
  3. package/package.json +3 -3
  4. package/src/controller/datacontroller.d.ts +33 -32
  5. package/src/controller/datacontroller.js +29 -28
  6. package/src/controller/editingcontroller.d.ts +8 -8
  7. package/src/controller/editingcontroller.js +10 -10
  8. package/src/conversion/conversion.d.ts +18 -19
  9. package/src/conversion/conversion.js +4 -4
  10. package/src/conversion/conversionhelpers.d.ts +1 -1
  11. package/src/conversion/conversionhelpers.js +1 -1
  12. package/src/conversion/downcastdispatcher.d.ts +63 -69
  13. package/src/conversion/downcastdispatcher.js +16 -16
  14. package/src/conversion/downcasthelpers.d.ts +94 -83
  15. package/src/conversion/downcasthelpers.js +63 -53
  16. package/src/conversion/mapper.d.ts +27 -27
  17. package/src/conversion/mapper.js +15 -15
  18. package/src/conversion/modelconsumable.d.ts +26 -26
  19. package/src/conversion/modelconsumable.js +23 -23
  20. package/src/conversion/upcastdispatcher.d.ts +33 -32
  21. package/src/conversion/upcastdispatcher.js +19 -19
  22. package/src/conversion/upcasthelpers.d.ts +46 -38
  23. package/src/conversion/upcasthelpers.js +33 -24
  24. package/src/conversion/viewconsumable.d.ts +50 -45
  25. package/src/conversion/viewconsumable.js +32 -27
  26. package/src/dataprocessor/basichtmlwriter.d.ts +4 -2
  27. package/src/dataprocessor/basichtmlwriter.js +3 -1
  28. package/src/dataprocessor/dataprocessor.d.ts +7 -6
  29. package/src/dataprocessor/htmldataprocessor.d.ts +10 -10
  30. package/src/dataprocessor/htmldataprocessor.js +6 -6
  31. package/src/dataprocessor/htmlwriter.d.ts +1 -1
  32. package/src/dataprocessor/xmldataprocessor.d.ts +10 -10
  33. package/src/dataprocessor/xmldataprocessor.js +6 -6
  34. package/src/dev-utils/model.d.ts +25 -26
  35. package/src/dev-utils/model.js +35 -36
  36. package/src/dev-utils/operationreplayer.d.ts +5 -3
  37. package/src/dev-utils/operationreplayer.js +4 -2
  38. package/src/dev-utils/utils.d.ts +8 -0
  39. package/src/dev-utils/utils.js +8 -0
  40. package/src/dev-utils/view.d.ts +66 -63
  41. package/src/dev-utils/view.js +144 -134
  42. package/src/index.d.ts +135 -106
  43. package/src/index.js +120 -71
  44. package/src/legacyerrors.d.ts +5 -0
  45. package/src/legacyerrors.js +17 -0
  46. package/src/model/batch.d.ts +2 -15
  47. package/src/model/batch.js +1 -23
  48. package/src/model/differ.d.ts +54 -31
  49. package/src/model/differ.js +15 -15
  50. package/src/model/document.d.ts +31 -31
  51. package/src/model/document.js +13 -13
  52. package/src/model/documentfragment.d.ts +45 -45
  53. package/src/model/documentfragment.js +40 -40
  54. package/src/model/documentselection.d.ts +92 -92
  55. package/src/model/documentselection.js +71 -70
  56. package/src/model/element.d.ts +31 -31
  57. package/src/model/element.js +29 -29
  58. package/src/model/history.d.ts +3 -3
  59. package/src/model/history.js +2 -2
  60. package/src/model/item.d.ts +4 -5
  61. package/src/model/liveposition.d.ts +31 -31
  62. package/src/model/liveposition.js +18 -18
  63. package/src/model/liverange.d.ts +42 -38
  64. package/src/model/liverange.js +17 -16
  65. package/src/model/markercollection.d.ts +41 -40
  66. package/src/model/markercollection.js +22 -20
  67. package/src/model/model.d.ts +82 -81
  68. package/src/model/model.js +54 -54
  69. package/src/model/node.d.ts +48 -48
  70. package/src/model/node.js +31 -31
  71. package/src/model/nodelist.d.ts +17 -17
  72. package/src/model/nodelist.js +11 -11
  73. package/src/model/operation/attributeoperation.d.ts +10 -10
  74. package/src/model/operation/attributeoperation.js +7 -7
  75. package/src/model/operation/detachoperation.d.ts +11 -9
  76. package/src/model/operation/detachoperation.js +8 -6
  77. package/src/model/operation/insertoperation.d.ts +13 -13
  78. package/src/model/operation/insertoperation.js +15 -15
  79. package/src/model/operation/markeroperation.d.ts +12 -12
  80. package/src/model/operation/markeroperation.js +5 -5
  81. package/src/model/operation/mergeoperation.d.ts +16 -16
  82. package/src/model/operation/mergeoperation.js +18 -18
  83. package/src/model/operation/moveoperation.d.ts +16 -16
  84. package/src/model/operation/moveoperation.js +18 -15
  85. package/src/model/operation/nooperation.d.ts +4 -4
  86. package/src/model/operation/nooperation.js +2 -2
  87. package/src/model/operation/operation.d.ts +10 -10
  88. package/src/model/operation/operation.js +5 -5
  89. package/src/model/operation/operationfactory.d.ts +4 -4
  90. package/src/model/operation/operationfactory.js +12 -12
  91. package/src/model/operation/renameoperation.d.ts +10 -10
  92. package/src/model/operation/renameoperation.js +7 -7
  93. package/src/model/operation/rootattributeoperation.d.ts +12 -12
  94. package/src/model/operation/rootattributeoperation.js +8 -8
  95. package/src/model/operation/rootoperation.d.ts +8 -8
  96. package/src/model/operation/rootoperation.js +3 -3
  97. package/src/model/operation/splitoperation.d.ts +17 -17
  98. package/src/model/operation/splitoperation.js +19 -19
  99. package/src/model/operation/transform.d.ts +11 -8
  100. package/src/model/operation/transform.js +66 -49
  101. package/src/model/operation/utils.d.ts +24 -23
  102. package/src/model/operation/utils.js +20 -20
  103. package/src/model/position.d.ts +101 -97
  104. package/src/model/position.js +69 -64
  105. package/src/model/range.d.ts +90 -90
  106. package/src/model/range.js +87 -87
  107. package/src/model/rootelement.d.ts +11 -11
  108. package/src/model/rootelement.js +9 -9
  109. package/src/model/schema.d.ts +158 -154
  110. package/src/model/schema.js +93 -90
  111. package/src/model/selection.d.ts +73 -73
  112. package/src/model/selection.js +62 -62
  113. package/src/model/text.d.ts +11 -10
  114. package/src/model/text.js +11 -10
  115. package/src/model/textproxy.d.ts +39 -38
  116. package/src/model/textproxy.js +31 -30
  117. package/src/model/treewalker.d.ts +37 -37
  118. package/src/model/treewalker.js +14 -14
  119. package/src/model/typecheckable.d.ts +45 -45
  120. package/src/model/typecheckable.js +1 -1
  121. package/src/model/utils/autoparagraphing.d.ts +7 -7
  122. package/src/model/utils/deletecontent.d.ts +7 -5
  123. package/src/model/utils/deletecontent.js +13 -11
  124. package/src/model/utils/getselectedcontent.d.ts +6 -5
  125. package/src/model/utils/getselectedcontent.js +2 -1
  126. package/src/model/utils/insertcontent.d.ts +9 -8
  127. package/src/model/utils/insertcontent.js +41 -40
  128. package/src/model/utils/insertobject.d.ts +9 -9
  129. package/src/model/utils/insertobject.js +4 -4
  130. package/src/model/utils/modifyselection.d.ts +5 -4
  131. package/src/model/utils/modifyselection.js +12 -11
  132. package/src/model/utils/selection-post-fixer.d.ts +12 -8
  133. package/src/model/utils/selection-post-fixer.js +15 -11
  134. package/src/model/writer.d.ts +102 -101
  135. package/src/model/writer.js +99 -98
  136. package/src/view/attributeelement.d.ts +29 -29
  137. package/src/view/attributeelement.js +25 -25
  138. package/src/view/containerelement.d.ts +16 -15
  139. package/src/view/containerelement.js +15 -14
  140. package/src/view/datatransfer.d.ts +7 -7
  141. package/src/view/datatransfer.js +1 -1
  142. package/src/view/document.d.ts +25 -25
  143. package/src/view/document.js +15 -15
  144. package/src/view/documentfragment.d.ts +21 -21
  145. package/src/view/documentfragment.js +14 -14
  146. package/src/view/documentselection.d.ts +65 -63
  147. package/src/view/documentselection.js +27 -25
  148. package/src/view/domconverter.d.ts +94 -89
  149. package/src/view/domconverter.js +78 -73
  150. package/src/view/downcastwriter.d.ts +185 -181
  151. package/src/view/downcastwriter.js +222 -210
  152. package/src/view/editableelement.d.ts +13 -13
  153. package/src/view/editableelement.js +8 -8
  154. package/src/view/element.d.ts +75 -74
  155. package/src/view/element.js +58 -58
  156. package/src/view/elementdefinition.d.ts +3 -4
  157. package/src/view/emptyelement.d.ts +13 -13
  158. package/src/view/emptyelement.js +13 -13
  159. package/src/view/filler.d.ts +14 -3
  160. package/src/view/filler.js +12 -1
  161. package/src/view/item.d.ts +4 -5
  162. package/src/view/matcher.d.ts +22 -19
  163. package/src/view/matcher.js +6 -6
  164. package/src/view/node.d.ts +33 -33
  165. package/src/view/node.js +9 -9
  166. package/src/view/observer/arrowkeysobserver.d.ts +10 -10
  167. package/src/view/observer/arrowkeysobserver.js +5 -5
  168. package/src/view/observer/bubblingemittermixin.d.ts +5 -5
  169. package/src/view/observer/bubblingemittermixin.js +2 -9
  170. package/src/view/observer/bubblingeventinfo.d.ts +9 -9
  171. package/src/view/observer/bubblingeventinfo.js +1 -1
  172. package/src/view/observer/clickobserver.d.ts +8 -8
  173. package/src/view/observer/clickobserver.js +4 -4
  174. package/src/view/observer/compositionobserver.d.ts +19 -19
  175. package/src/view/observer/compositionobserver.js +6 -6
  176. package/src/view/observer/domeventdata.d.ts +9 -9
  177. package/src/view/observer/domeventdata.js +2 -2
  178. package/src/view/observer/domeventobserver.d.ts +3 -3
  179. package/src/view/observer/domeventobserver.js +5 -5
  180. package/src/view/observer/fakeselectionobserver.d.ts +9 -9
  181. package/src/view/observer/fakeselectionobserver.js +8 -8
  182. package/src/view/observer/focusobserver.d.ts +16 -16
  183. package/src/view/observer/focusobserver.js +7 -7
  184. package/src/view/observer/inputobserver.d.ts +18 -18
  185. package/src/view/observer/inputobserver.js +5 -5
  186. package/src/view/observer/keyobserver.d.ts +11 -11
  187. package/src/view/observer/keyobserver.js +3 -3
  188. package/src/view/observer/mouseobserver.d.ts +16 -16
  189. package/src/view/observer/mouseobserver.js +3 -3
  190. package/src/view/observer/mutationobserver.d.ts +21 -21
  191. package/src/view/observer/mutationobserver.js +7 -7
  192. package/src/view/observer/observer.d.ts +12 -12
  193. package/src/view/observer/observer.js +6 -6
  194. package/src/view/observer/selectionobserver.d.ts +33 -33
  195. package/src/view/observer/selectionobserver.js +14 -14
  196. package/src/view/observer/tabobserver.d.ts +10 -10
  197. package/src/view/observer/tabobserver.js +5 -5
  198. package/src/view/observer/touchobserver.d.ts +13 -13
  199. package/src/view/observer/touchobserver.js +3 -3
  200. package/src/view/placeholder.d.ts +21 -21
  201. package/src/view/placeholder.js +23 -23
  202. package/src/view/position.d.ts +49 -49
  203. package/src/view/position.js +42 -42
  204. package/src/view/range.d.ts +76 -74
  205. package/src/view/range.js +67 -65
  206. package/src/view/rawelement.d.ts +19 -19
  207. package/src/view/rawelement.js +16 -16
  208. package/src/view/renderer.d.ts +14 -14
  209. package/src/view/renderer.js +7 -7
  210. package/src/view/rooteditableelement.d.ts +8 -7
  211. package/src/view/rooteditableelement.js +7 -6
  212. package/src/view/selection.d.ts +66 -64
  213. package/src/view/selection.js +50 -48
  214. package/src/view/styles/background.d.ts +2 -2
  215. package/src/view/styles/background.js +9 -9
  216. package/src/view/styles/border.d.ts +2 -2
  217. package/src/view/styles/border.js +13 -13
  218. package/src/view/styles/margin.d.ts +2 -2
  219. package/src/view/styles/margin.js +5 -5
  220. package/src/view/styles/padding.d.ts +2 -2
  221. package/src/view/styles/padding.js +5 -5
  222. package/src/view/styles/utils.d.ts +24 -24
  223. package/src/view/styles/utils.js +25 -25
  224. package/src/view/stylesmap.d.ts +28 -32
  225. package/src/view/stylesmap.js +52 -39
  226. package/src/view/text.d.ts +11 -11
  227. package/src/view/text.js +10 -10
  228. package/src/view/textproxy.d.ts +33 -32
  229. package/src/view/textproxy.js +23 -22
  230. package/src/view/tokenlist.d.ts +14 -14
  231. package/src/view/tokenlist.js +10 -10
  232. package/src/view/treewalker.d.ts +42 -40
  233. package/src/view/treewalker.js +36 -35
  234. package/src/view/typecheckable.d.ts +76 -75
  235. package/src/view/typecheckable.js +1 -1
  236. package/src/view/uielement.d.ts +22 -21
  237. package/src/view/uielement.js +17 -16
  238. package/src/view/upcastwriter.d.ts +70 -70
  239. package/src/view/upcastwriter.js +42 -42
  240. package/src/view/view.d.ts +70 -69
  241. package/src/view/view.js +56 -55
@@ -5,14 +5,14 @@
5
5
  /**
6
6
  * @module engine/view/observer/keyobserver
7
7
  */
8
- import DomEventObserver from './domeventobserver.js';
8
+ import { DomEventObserver } from './domeventobserver.js';
9
9
  import { getCode } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
11
  * Observer for events connected with pressing keyboard keys.
12
12
  *
13
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
13
+ * Note that this observer is attached by the {@link module:engine/view/view~EditingView} and is available by default.
14
14
  */
15
- export default class KeyObserver extends DomEventObserver {
15
+ export class KeyObserver extends DomEventObserver {
16
16
  /**
17
17
  * @inheritDoc
18
18
  */
@@ -5,15 +5,15 @@
5
5
  /**
6
6
  * @module engine/view/observer/mouseobserver
7
7
  */
8
- import DomEventObserver from './domeventobserver.js';
9
- import type DomEventData from './domeventdata.js';
8
+ import { DomEventObserver } from './domeventobserver.js';
9
+ import { type ViewDocumentDomEventData } from './domeventdata.js';
10
10
  /**
11
11
  * Mouse events observer.
12
12
  *
13
13
  * Note that this observer is not available by default. To make it available it needs to be added to
14
- * {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.
14
+ * {@link module:engine/view/view~EditingView} by {@link module:engine/view/view~EditingView#addObserver} method.
15
15
  */
16
- export default class MouseObserver extends DomEventObserver<'mousedown' | 'mouseup' | 'mouseover' | 'mouseout'> {
16
+ export declare class MouseObserver extends DomEventObserver<'mousedown' | 'mouseup' | 'mouseover' | 'mouseout'> {
17
17
  /**
18
18
  * @inheritDoc
19
19
  */
@@ -29,15 +29,15 @@ export default class MouseObserver extends DomEventObserver<'mousedown' | 'mouse
29
29
  * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
30
30
  *
31
31
  * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
32
- * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
32
+ * needs to be added to {@link module:engine/view/view~EditingView} by the {@link module:engine/view/view~EditingView#addObserver} method.
33
33
  *
34
34
  * @see module:engine/view/observer/mouseobserver~MouseObserver
35
- * @eventName module:engine/view/document~Document#mousedown
35
+ * @eventName module:engine/view/document~ViewDocument#mousedown
36
36
  * @param data The event data.
37
37
  */
38
38
  export type ViewDocumentMouseDownEvent = {
39
39
  name: 'mousedown';
40
- args: [data: DomEventData<MouseEvent>];
40
+ args: [data: ViewDocumentDomEventData<MouseEvent>];
41
41
  };
42
42
  /**
43
43
  * Fired when the mouse button is released over one of the editing roots of the editor.
@@ -45,15 +45,15 @@ export type ViewDocumentMouseDownEvent = {
45
45
  * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
46
46
  *
47
47
  * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
48
- * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
48
+ * needs to be added to {@link module:engine/view/view~EditingView} by the {@link module:engine/view/view~EditingView#addObserver} method.
49
49
  *
50
50
  * @see module:engine/view/observer/mouseobserver~MouseObserver
51
- * @eventName module:engine/view/document~Document#mouseup
51
+ * @eventName module:engine/view/document~ViewDocument#mouseup
52
52
  * @param data The event data.
53
53
  */
54
54
  export type ViewDocumentMouseUpEvent = {
55
55
  name: 'mouseup';
56
- args: [data: DomEventData<MouseEvent>];
56
+ args: [data: ViewDocumentDomEventData<MouseEvent>];
57
57
  };
58
58
  /**
59
59
  * Fired when the mouse is over one of the editing roots of the editor.
@@ -61,15 +61,15 @@ export type ViewDocumentMouseUpEvent = {
61
61
  * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
62
62
  *
63
63
  * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
64
- * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
64
+ * needs to be added to {@link module:engine/view/view~EditingView} by the {@link module:engine/view/view~EditingView#addObserver} method.
65
65
  *
66
66
  * @see module:engine/view/observer/mouseobserver~MouseObserver
67
- * @eventName module:engine/view/document~Document#mouseover
67
+ * @eventName module:engine/view/document~ViewDocument#mouseover
68
68
  * @param data The event data.
69
69
  */
70
70
  export type ViewDocumentMouseOverEvent = {
71
71
  name: 'mouseover';
72
- args: [data: DomEventData<MouseEvent>];
72
+ args: [data: ViewDocumentDomEventData<MouseEvent>];
73
73
  };
74
74
  /**
75
75
  * Fired when the mouse is moved out of the one of the editing roots of the editor.
@@ -77,13 +77,13 @@ export type ViewDocumentMouseOverEvent = {
77
77
  * Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
78
78
  *
79
79
  * Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
80
- * needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
80
+ * needs to be added to {@link module:engine/view/view~EditingView} by the {@link module:engine/view/view~EditingView#addObserver} method.
81
81
  *
82
82
  * @see module:engine/view/observer/mouseobserver~MouseObserver
83
- * @eventName module:engine/view/document~Document#mouseout
83
+ * @eventName module:engine/view/document~ViewDocument#mouseout
84
84
  * @param data The event data.
85
85
  */
86
86
  export type ViewDocumentMouseOutEvent = {
87
87
  name: 'mouseout';
88
- args: [data: DomEventData<MouseEvent>];
88
+ args: [data: ViewDocumentDomEventData<MouseEvent>];
89
89
  };
@@ -5,14 +5,14 @@
5
5
  /**
6
6
  * @module engine/view/observer/mouseobserver
7
7
  */
8
- import DomEventObserver from './domeventobserver.js';
8
+ import { DomEventObserver } from './domeventobserver.js';
9
9
  /**
10
10
  * Mouse events observer.
11
11
  *
12
12
  * Note that this observer is not available by default. To make it available it needs to be added to
13
- * {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.
13
+ * {@link module:engine/view/view~EditingView} by {@link module:engine/view/view~EditingView#addObserver} method.
14
14
  */
15
- export default class MouseObserver extends DomEventObserver {
15
+ export class MouseObserver extends DomEventObserver {
16
16
  /**
17
17
  * @inheritDoc
18
18
  */
@@ -5,27 +5,27 @@
5
5
  /**
6
6
  * @module engine/view/observer/mutationobserver
7
7
  */
8
- import Observer from './observer.js';
9
- import type DomConverter from '../domconverter.js';
10
- import type View from '../view.js';
11
- import type ViewNode from '../node.js';
12
- import type { ChangeType } from '../document.js';
8
+ import { Observer } from './observer.js';
9
+ import { type ViewDomConverter } from '../domconverter.js';
10
+ import { type EditingView } from '../view.js';
11
+ import { type ViewNode } from '../node.js';
12
+ import type { ViewDocumentChangeType } from '../document.js';
13
13
  /**
14
14
  * Mutation observer's role is to watch for any DOM changes inside the editor that weren't
15
- * done by the editor's {@link module:engine/view/renderer~Renderer} itself and reverting these changes.
15
+ * done by the editor's {@link module:engine/view/renderer~ViewRenderer} itself and reverting these changes.
16
16
  *
17
17
  * It does this by observing all mutations in the DOM, marking related view elements as changed and calling
18
- * {@link module:engine/view/renderer~Renderer#render}. Because all mutated nodes are marked as
19
- * "to be rendered" and the {@link module:engine/view/renderer~Renderer#render `render()`} method is called,
18
+ * {@link module:engine/view/renderer~ViewRenderer#render}. Because all mutated nodes are marked as
19
+ * "to be rendered" and the {@link module:engine/view/renderer~ViewRenderer#render `render()`} method is called,
20
20
  * all changes are reverted in the DOM (the DOM is synced with the editor's view structure).
21
21
  *
22
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
22
+ * Note that this observer is attached by the {@link module:engine/view/view~EditingView} and is available by default.
23
23
  */
24
- export default class MutationObserver extends Observer {
24
+ export declare class MutationObserver extends Observer {
25
25
  /**
26
- * Reference to the {@link module:engine/view/view~View#domConverter}.
26
+ * Reference to the {@link module:engine/view/view~EditingView#domConverter}.
27
27
  */
28
- readonly domConverter: DomConverter;
28
+ readonly domConverter: ViewDomConverter;
29
29
  /**
30
30
  * Native mutation observer config.
31
31
  */
@@ -41,7 +41,7 @@ export default class MutationObserver extends Observer {
41
41
  /**
42
42
  * @inheritDoc
43
43
  */
44
- constructor(view: View);
44
+ constructor(view: EditingView);
45
45
  /**
46
46
  * Synchronously handles mutations and empties the queue.
47
47
  */
@@ -85,29 +85,29 @@ export default class MutationObserver extends Observer {
85
85
  * Event fired on DOM mutations detected.
86
86
  *
87
87
  * This event is introduced by {@link module:engine/view/observer/mutationobserver~MutationObserver} and available
88
- * by default in all editor instances (attached by {@link module:engine/view/view~View}).
88
+ * by default in all editor instances (attached by {@link module:engine/view/view~EditingView}).
89
89
  *
90
- * @eventName module:engine/view/document~Document#mutations
90
+ * @eventName module:engine/view/document~ViewDocument#mutations
91
91
  * @param data Event data containing detailed information about the event.
92
92
  */
93
93
  export type ViewDocumentMutationsEvent = {
94
94
  name: 'mutations';
95
- args: [data: MutationsEventData];
95
+ args: [data: ViewDocumentMutationEventData];
96
96
  };
97
97
  /**
98
98
  * The value of {@link ~ViewDocumentMutationsEvent}.
99
99
  */
100
- export type MutationsEventData = {
101
- mutations: Array<MutationData>;
100
+ export type ViewDocumentMutationEventData = {
101
+ mutations: Array<ObserverMutationData>;
102
102
  };
103
103
  /**
104
- * A single entry in {@link ~MutationsEventData} mutations array.
104
+ * A single entry in {@link ~ViewDocumentMutationEventData} mutations array.
105
105
  */
106
- export type MutationData = {
106
+ export type ObserverMutationData = {
107
107
  /**
108
108
  * Type of mutation detected.
109
109
  */
110
- type: ChangeType;
110
+ type: ViewDocumentChangeType;
111
111
  /**
112
112
  * The view node related to the detected mutation.
113
113
  */
@@ -5,24 +5,24 @@
5
5
  /**
6
6
  * @module engine/view/observer/mutationobserver
7
7
  */
8
- import Observer from './observer.js';
8
+ import { Observer } from './observer.js';
9
9
  import { startsWithFiller } from '../filler.js';
10
10
  import { isEqualWith } from 'es-toolkit/compat';
11
11
  // @if CK_DEBUG_TYPING // const { _debouncedLine, _buildLogMessage } = require( '../../dev-utils/utils.js' );
12
12
  /**
13
13
  * Mutation observer's role is to watch for any DOM changes inside the editor that weren't
14
- * done by the editor's {@link module:engine/view/renderer~Renderer} itself and reverting these changes.
14
+ * done by the editor's {@link module:engine/view/renderer~ViewRenderer} itself and reverting these changes.
15
15
  *
16
16
  * It does this by observing all mutations in the DOM, marking related view elements as changed and calling
17
- * {@link module:engine/view/renderer~Renderer#render}. Because all mutated nodes are marked as
18
- * "to be rendered" and the {@link module:engine/view/renderer~Renderer#render `render()`} method is called,
17
+ * {@link module:engine/view/renderer~ViewRenderer#render}. Because all mutated nodes are marked as
18
+ * "to be rendered" and the {@link module:engine/view/renderer~ViewRenderer#render `render()`} method is called,
19
19
  * all changes are reverted in the DOM (the DOM is synced with the editor's view structure).
20
20
  *
21
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
21
+ * Note that this observer is attached by the {@link module:engine/view/view~EditingView} and is available by default.
22
22
  */
23
- export default class MutationObserver extends Observer {
23
+ export class MutationObserver extends Observer {
24
24
  /**
25
- * Reference to the {@link module:engine/view/view~View#domConverter}.
25
+ * Reference to the {@link module:engine/view/view~EditingView#domConverter}.
26
26
  */
27
27
  domConverter;
28
28
  /**
@@ -2,27 +2,27 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import type Document from '../document.js';
6
- import type View from '../view.js';
5
+ import { type ViewDocument } from '../document.js';
6
+ import { type EditingView } from '../view.js';
7
7
  declare const Observer_base: {
8
8
  new (): import("@ckeditor/ckeditor5-utils").DomEmitter;
9
9
  prototype: import("@ckeditor/ckeditor5-utils").DomEmitter;
10
10
  };
11
11
  /**
12
12
  * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary
13
- * processing and fire events on the {@link module:engine/view/document~Document} objects.
13
+ * processing and fire events on the {@link module:engine/view/document~ViewDocument} objects.
14
14
  * Observers can also add features to the view, for instance by updating its status or marking elements
15
15
  * which need a refresh on DOM events.
16
16
  */
17
- export default abstract class Observer extends /* #__PURE__ */ Observer_base {
17
+ export declare abstract class Observer extends /* #__PURE__ */ Observer_base {
18
18
  /**
19
19
  * An instance of the view controller.
20
20
  */
21
- readonly view: View;
21
+ readonly view: EditingView;
22
22
  /**
23
- * A reference to the {@link module:engine/view/document~Document} object.
23
+ * A reference to the {@link module:engine/view/document~ViewDocument} object.
24
24
  */
25
- readonly document: Document;
25
+ readonly document: ViewDocument;
26
26
  /**
27
27
  * The state of the observer. If it is disabled, no events will be fired.
28
28
  */
@@ -30,14 +30,14 @@ export default abstract class Observer extends /* #__PURE__ */ Observer_base {
30
30
  /**
31
31
  * Creates an instance of the observer.
32
32
  */
33
- constructor(view: View);
33
+ constructor(view: EditingView);
34
34
  /**
35
35
  * The state of the observer. If it is disabled, no events will be fired.
36
36
  */
37
37
  get isEnabled(): boolean;
38
38
  /**
39
39
  * Enables the observer. This method is called when the observer is registered to the
40
- * {@link module:engine/view/view~View} and after {@link module:engine/view/view~View#forceRender rendering}
40
+ * {@link module:engine/view/view~EditingView} and after {@link module:engine/view/view~EditingView#forceRender rendering}
41
41
  * (all observers are {@link #disable disabled} before rendering).
42
42
  *
43
43
  * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.
@@ -48,7 +48,7 @@ export default abstract class Observer extends /* #__PURE__ */ Observer_base {
48
48
  enable(): void;
49
49
  /**
50
50
  * Disables the observer. This method is called before
51
- * {@link module:engine/view/view~View#forceRender rendering} to prevent firing events during rendering.
51
+ * {@link module:engine/view/view~EditingView#forceRender rendering} to prevent firing events during rendering.
52
52
  *
53
53
  * @see module:engine/view/observer/observer~Observer#enable
54
54
  */
@@ -62,7 +62,7 @@ export default abstract class Observer extends /* #__PURE__ */ Observer_base {
62
62
  *
63
63
  * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.
64
64
  * This attribute can be used inside the structures generated by
65
- * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events
65
+ * {@link module:engine/view/downcastwriter~ViewDowncastWriter#createUIElement `ViewDowncastWriter#createUIElement()`} to ignore events
66
66
  * fired within a UI that should be excluded from CKEditor 5's realms.
67
67
  *
68
68
  * @param domTarget The DOM event target to check (usually an element, sometimes a text node and
@@ -85,5 +85,5 @@ export default abstract class Observer extends /* #__PURE__ */ Observer_base {
85
85
  /**
86
86
  * The constructor of {@link ~Observer} subclass.
87
87
  */
88
- export type ObserverConstructor = new (view: View) => Observer;
88
+ export type ObserverConstructor = new (view: EditingView) => Observer;
89
89
  export {};
@@ -8,17 +8,17 @@
8
8
  import { DomEmitterMixin } from '@ckeditor/ckeditor5-utils';
9
9
  /**
10
10
  * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary
11
- * processing and fire events on the {@link module:engine/view/document~Document} objects.
11
+ * processing and fire events on the {@link module:engine/view/document~ViewDocument} objects.
12
12
  * Observers can also add features to the view, for instance by updating its status or marking elements
13
13
  * which need a refresh on DOM events.
14
14
  */
15
- export default class Observer extends /* #__PURE__ */ DomEmitterMixin() {
15
+ export class Observer extends /* #__PURE__ */ DomEmitterMixin() {
16
16
  /**
17
17
  * An instance of the view controller.
18
18
  */
19
19
  view;
20
20
  /**
21
- * A reference to the {@link module:engine/view/document~Document} object.
21
+ * A reference to the {@link module:engine/view/document~ViewDocument} object.
22
22
  */
23
23
  document;
24
24
  /**
@@ -41,7 +41,7 @@ export default class Observer extends /* #__PURE__ */ DomEmitterMixin() {
41
41
  }
42
42
  /**
43
43
  * Enables the observer. This method is called when the observer is registered to the
44
- * {@link module:engine/view/view~View} and after {@link module:engine/view/view~View#forceRender rendering}
44
+ * {@link module:engine/view/view~EditingView} and after {@link module:engine/view/view~EditingView#forceRender rendering}
45
45
  * (all observers are {@link #disable disabled} before rendering).
46
46
  *
47
47
  * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.
@@ -54,7 +54,7 @@ export default class Observer extends /* #__PURE__ */ DomEmitterMixin() {
54
54
  }
55
55
  /**
56
56
  * Disables the observer. This method is called before
57
- * {@link module:engine/view/view~View#forceRender rendering} to prevent firing events during rendering.
57
+ * {@link module:engine/view/view~EditingView#forceRender rendering} to prevent firing events during rendering.
58
58
  *
59
59
  * @see module:engine/view/observer/observer~Observer#enable
60
60
  */
@@ -73,7 +73,7 @@ export default class Observer extends /* #__PURE__ */ DomEmitterMixin() {
73
73
  *
74
74
  * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.
75
75
  * This attribute can be used inside the structures generated by
76
- * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events
76
+ * {@link module:engine/view/downcastwriter~ViewDowncastWriter#createUIElement `ViewDowncastWriter#createUIElement()`} to ignore events
77
77
  * fired within a UI that should be excluded from CKEditor 5's realms.
78
78
  *
79
79
  * @param domTarget The DOM event target to check (usually an element, sometimes a text node and
@@ -5,29 +5,29 @@
5
5
  /**
6
6
  * @module engine/view/observer/selectionobserver
7
7
  */
8
- import Observer from './observer.js';
9
- import MutationObserver from './mutationobserver.js';
10
- import FocusObserver from './focusobserver.js';
11
- import type View from '../view.js';
12
- import type DocumentSelection from '../documentselection.js';
13
- import type DomConverter from '../domconverter.js';
14
- import type Selection from '../selection.js';
8
+ import { Observer } from './observer.js';
9
+ import { MutationObserver } from './mutationobserver.js';
10
+ import { FocusObserver } from './focusobserver.js';
11
+ import { type EditingView } from '../view.js';
12
+ import { type ViewDocumentSelection } from '../documentselection.js';
13
+ import { type ViewDomConverter } from '../domconverter.js';
14
+ import { type ViewSelection } from '../selection.js';
15
15
  type DomSelection = globalThis.Selection;
16
16
  /**
17
17
  * Selection observer class observes selection changes in the document. If a selection changes on the document this
18
- * observer checks if the DOM selection is different from the {@link module:engine/view/document~Document#selection view selection}.
19
- * The selection observer fires {@link module:engine/view/document~Document#event:selectionChange} event only if
18
+ * observer checks if the DOM selection is different from the {@link module:engine/view/document~ViewDocument#selection view selection}.
19
+ * The selection observer fires {@link module:engine/view/document~ViewDocument#event:selectionChange} event only if
20
20
  * a selection change was the only change in the document and the DOM selection is different from the view selection.
21
21
  *
22
- * This observer also manages the {@link module:engine/view/document~Document#isSelecting} property of the view document.
22
+ * This observer also manages the {@link module:engine/view/document~ViewDocument#isSelecting} property of the view document.
23
23
  *
24
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
24
+ * Note that this observer is attached by the {@link module:engine/view/view~EditingView} and is available by default.
25
25
  */
26
- export default class SelectionObserver extends Observer {
26
+ export declare class SelectionObserver extends Observer {
27
27
  /**
28
28
  * Instance of the mutation observer. Selection observer calls
29
29
  * {@link module:engine/view/observer/mutationobserver~MutationObserver#flush} to ensure that the mutations will be handled
30
- * before the {@link module:engine/view/document~Document#event:selectionChange} event is fired.
30
+ * before the {@link module:engine/view/document~ViewDocument#event:selectionChange} event is fired.
31
31
  */
32
32
  readonly mutationObserver: MutationObserver;
33
33
  /**
@@ -36,14 +36,14 @@ export default class SelectionObserver extends Observer {
36
36
  */
37
37
  readonly focusObserver: FocusObserver;
38
38
  /**
39
- * Reference to the view {@link module:engine/view/documentselection~DocumentSelection} object used to compare
39
+ * Reference to the view {@link module:engine/view/documentselection~ViewDocumentSelection} object used to compare
40
40
  * new selection with it.
41
41
  */
42
- readonly selection: DocumentSelection;
42
+ readonly selection: ViewDocumentSelection;
43
43
  /**
44
- * Reference to the {@link module:engine/view/view~View#domConverter}.
44
+ * Reference to the {@link module:engine/view/view~EditingView#domConverter}.
45
45
  */
46
- readonly domConverter: DomConverter;
46
+ readonly domConverter: ViewDomConverter;
47
47
  /**
48
48
  * A set of documents which have added `selectionchange` listener to avoid adding a listener twice to the same
49
49
  * document.
@@ -74,7 +74,7 @@ export default class SelectionObserver extends Observer {
74
74
  * Pending selection change is recorded while selection change event is detected on non focused editable.
75
75
  */
76
76
  private _pendingSelectionChange;
77
- constructor(view: View);
77
+ constructor(view: EditingView);
78
78
  /**
79
79
  * @inheritDoc
80
80
  */
@@ -90,8 +90,8 @@ export default class SelectionObserver extends Observer {
90
90
  private _reportInfiniteLoop;
91
91
  /**
92
92
  * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if
93
- * a selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change
94
- * and {@link module:engine/view/document~Document#event:selectionChangeDone} when a selection stop changing.
93
+ * a selection changes and fires {@link module:engine/view/document~ViewDocument#event:selectionChange} event on every change
94
+ * and {@link module:engine/view/document~ViewDocument#event:selectionChangeDone} when a selection stop changing.
95
95
  *
96
96
  * @param domDocument DOM document.
97
97
  */
@@ -102,17 +102,17 @@ export default class SelectionObserver extends Observer {
102
102
  private _clearInfiniteLoop;
103
103
  }
104
104
  /**
105
- * The value of {@link ~ViewDocumentSelectionChangeEvent} and {@link ~ViewDocumentSelectionChangeDoneEvent} events.
105
+ * The value of {@link ~ViewDocumentObserverSelectionChangeEvent} and {@link ~ViewDocumentObserverSelectionChangeDoneEvent} events.
106
106
  */
107
- export type ViewDocumentSelectionEventData = {
107
+ export type ViewDocumentObserverSelectionEventData = {
108
108
  /**
109
- * Old View selection which is {@link module:engine/view/document~Document#selection}.
109
+ * Old View selection which is {@link module:engine/view/document~ViewDocument#selection}.
110
110
  */
111
- oldSelection: DocumentSelection;
111
+ oldSelection: ViewDocumentSelection;
112
112
  /**
113
113
  * New View selection which is converted DOM selection.
114
114
  */
115
- newSelection: Selection;
115
+ newSelection: ViewSelection;
116
116
  /**
117
117
  * Native DOM selection.
118
118
  */
@@ -125,14 +125,14 @@ export type ViewDocumentSelectionEventData = {
125
125
  * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
126
126
  *
127
127
  * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
128
- * {@link module:engine/view/view~View} this event is available by default.
128
+ * {@link module:engine/view/view~EditingView} this event is available by default.
129
129
  *
130
130
  * @see module:engine/view/observer/selectionobserver~SelectionObserver
131
- * @eventName module:engine/view/document~Document#selectionChange
131
+ * @eventName module:engine/view/document~ViewDocument#selectionChange
132
132
  */
133
- export type ViewDocumentSelectionChangeEvent = {
133
+ export type ViewDocumentObserverSelectionChangeEvent = {
134
134
  name: 'selectionChange';
135
- args: [ViewDocumentSelectionEventData];
135
+ args: [ViewDocumentObserverSelectionEventData];
136
136
  };
137
137
  /**
138
138
  * Fired when selection stops changing.
@@ -140,13 +140,13 @@ export type ViewDocumentSelectionChangeEvent = {
140
140
  * Introduced by {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
141
141
  *
142
142
  * Note that because {@link module:engine/view/observer/selectionobserver~SelectionObserver} is attached by the
143
- * {@link module:engine/view/view~View} this event is available by default.
143
+ * {@link module:engine/view/view~EditingView} this event is available by default.
144
144
  *
145
145
  * @see module:engine/view/observer/selectionobserver~SelectionObserver
146
- * @eventName module:engine/view/document~Document#selectionChangeDone
146
+ * @eventName module:engine/view/document~ViewDocument#selectionChangeDone
147
147
  */
148
- export type ViewDocumentSelectionChangeDoneEvent = {
148
+ export type ViewDocumentObserverSelectionChangeDoneEvent = {
149
149
  name: 'selectionChangeDone';
150
- args: [ViewDocumentSelectionEventData];
150
+ args: [ViewDocumentObserverSelectionEventData];
151
151
  };
152
152
  export {};
@@ -5,26 +5,26 @@
5
5
  /**
6
6
  * @module engine/view/observer/selectionobserver
7
7
  */
8
- import Observer from './observer.js';
9
- import MutationObserver from './mutationobserver.js';
10
- import FocusObserver from './focusobserver.js';
8
+ import { Observer } from './observer.js';
9
+ import { MutationObserver } from './mutationobserver.js';
10
+ import { FocusObserver } from './focusobserver.js';
11
11
  import { env } from '@ckeditor/ckeditor5-utils';
12
12
  import { debounce } from 'es-toolkit/compat';
13
13
  /**
14
14
  * Selection observer class observes selection changes in the document. If a selection changes on the document this
15
- * observer checks if the DOM selection is different from the {@link module:engine/view/document~Document#selection view selection}.
16
- * The selection observer fires {@link module:engine/view/document~Document#event:selectionChange} event only if
15
+ * observer checks if the DOM selection is different from the {@link module:engine/view/document~ViewDocument#selection view selection}.
16
+ * The selection observer fires {@link module:engine/view/document~ViewDocument#event:selectionChange} event only if
17
17
  * a selection change was the only change in the document and the DOM selection is different from the view selection.
18
18
  *
19
- * This observer also manages the {@link module:engine/view/document~Document#isSelecting} property of the view document.
19
+ * This observer also manages the {@link module:engine/view/document~ViewDocument#isSelecting} property of the view document.
20
20
  *
21
- * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
21
+ * Note that this observer is attached by the {@link module:engine/view/view~EditingView} and is available by default.
22
22
  */
23
- export default class SelectionObserver extends Observer {
23
+ export class SelectionObserver extends Observer {
24
24
  /**
25
25
  * Instance of the mutation observer. Selection observer calls
26
26
  * {@link module:engine/view/observer/mutationobserver~MutationObserver#flush} to ensure that the mutations will be handled
27
- * before the {@link module:engine/view/document~Document#event:selectionChange} event is fired.
27
+ * before the {@link module:engine/view/document~ViewDocument#event:selectionChange} event is fired.
28
28
  */
29
29
  mutationObserver;
30
30
  /**
@@ -33,12 +33,12 @@ export default class SelectionObserver extends Observer {
33
33
  */
34
34
  focusObserver;
35
35
  /**
36
- * Reference to the view {@link module:engine/view/documentselection~DocumentSelection} object used to compare
36
+ * Reference to the view {@link module:engine/view/documentselection~ViewDocumentSelection} object used to compare
37
37
  * new selection with it.
38
38
  */
39
39
  selection;
40
40
  /**
41
- * Reference to the {@link module:engine/view/view~View#domConverter}.
41
+ * Reference to the {@link module:engine/view/view~EditingView#domConverter}.
42
42
  */
43
43
  domConverter;
44
44
  /**
@@ -163,7 +163,7 @@ export default class SelectionObserver extends Observer {
163
163
  // using their mouse).
164
164
  this._documentIsSelectingInactivityTimeoutDebounced();
165
165
  });
166
- // Update the model DocumentSelection just after the Renderer and the SelectionObserver are locked.
166
+ // Update the model ViewDocumentSelection just after the Renderer and the SelectionObserver are locked.
167
167
  // We do this synchronously (without waiting for the `selectionchange` DOM event) as browser updates
168
168
  // the DOM selection (but not visually) to span the text that is under composition and could be replaced.
169
169
  this.listenTo(this.view.document, 'compositionstart', () => {
@@ -209,8 +209,8 @@ export default class SelectionObserver extends Observer {
209
209
  }
210
210
  /**
211
211
  * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if
212
- * a selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change
213
- * and {@link module:engine/view/document~Document#event:selectionChangeDone} when a selection stop changing.
212
+ * a selection changes and fires {@link module:engine/view/document~ViewDocument#event:selectionChange} event on every change
213
+ * and {@link module:engine/view/document~ViewDocument#event:selectionChangeDone} when a selection stop changing.
214
214
  *
215
215
  * @param domDocument DOM document.
216
216
  */
@@ -5,21 +5,21 @@
5
5
  /**
6
6
  * @module engine/view/observer/tabobserver
7
7
  */
8
- import type View from '../view.js';
9
- import Observer from './observer.js';
10
- import type { KeyEventData } from './keyobserver.js';
8
+ import { type EditingView } from '../view.js';
9
+ import { Observer } from './observer.js';
10
+ import type { ViewDocumentKeyEventData } from './keyobserver.js';
11
11
  import type { BubblingEvent } from './bubblingemittermixin.js';
12
12
  /**
13
- * Tab observer introduces the {@link module:engine/view/document~Document#event:tab `Document#tab`} event.
13
+ * Tab observer introduces the {@link module:engine/view/document~ViewDocument#event:tab `Document#tab`} event.
14
14
  *
15
15
  * Note that because {@link module:engine/view/observer/tabobserver~TabObserver} is attached by the
16
- * {@link module:engine/view/view~View}, this event is available by default.
16
+ * {@link module:engine/view/view~EditingView}, this event is available by default.
17
17
  */
18
- export default class TabObserver extends Observer {
18
+ export declare class TabObserver extends Observer {
19
19
  /**
20
20
  * @inheritDoc
21
21
  */
22
- constructor(view: View);
22
+ constructor(view: EditingView);
23
23
  /**
24
24
  * @inheritDoc
25
25
  */
@@ -35,12 +35,12 @@ export default class TabObserver extends Observer {
35
35
  * Introduced by {@link module:engine/view/observer/tabobserver~TabObserver}.
36
36
  *
37
37
  * Note that because {@link module:engine/view/observer/tabobserver~TabObserver} is attached by the
38
- * {@link module:engine/view/view~View}, this event is available by default.
38
+ * {@link module:engine/view/view~EditingView}, this event is available by default.
39
39
  *
40
- * @eventName module:engine/view/document~Document#tab
40
+ * @eventName module:engine/view/document~ViewDocument#tab
41
41
  * @param data
42
42
  */
43
43
  export type ViewDocumentTabEvent = BubblingEvent<{
44
44
  name: 'tab';
45
- args: [data: KeyEventData];
45
+ args: [data: ViewDocumentKeyEventData];
46
46
  }>;