@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,19 +5,19 @@
5
5
  /**
6
6
  * @module engine/conversion/modelconsumable
7
7
  */
8
- import TextProxy from '../model/textproxy.js';
9
- import type Item from '../model/item.js';
10
- import type Selection from '../model/selection.js';
11
- import type DocumentSelection from '../model/documentselection.js';
12
- import type Range from '../model/range.js';
8
+ import { ModelTextProxy } from '../model/textproxy.js';
9
+ import { type ModelItem } from '../model/item.js';
10
+ import { type ModelSelection } from '../model/selection.js';
11
+ import { type ModelDocumentSelection } from '../model/documentselection.js';
12
+ import { type ModelRange } from '../model/range.js';
13
13
  /**
14
- * Manages a list of consumable values for the {@link module:engine/model/item~Item model items}.
14
+ * Manages a list of consumable values for the {@link module:engine/model/item~ModelItem model items}.
15
15
  *
16
16
  * Consumables are various aspects of the model. A model item can be broken down into separate, single properties that might be
17
17
  * taken into consideration when converting that item.
18
18
  *
19
19
  * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing the changed
20
- * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down
20
+ * parts of {@link module:engine/model/document~ModelDocument the document}. The added / changed / removed model items are broken down
21
21
  * into singular properties (the item itself and its attributes). All those parts are saved in `ModelConsumable`. Then,
22
22
  * during conversion, when the given part of a model item is converted (i.e. the view element has been inserted into the view,
23
23
  * but without attributes), the consumable value is removed from `ModelConsumable`.
@@ -90,18 +90,18 @@ import type Range from '../model/range.js';
90
90
  * } );
91
91
  * ```
92
92
  */
93
- export default class ModelConsumable {
93
+ export declare class ModelConsumable {
94
94
  /**
95
95
  * Contains list of consumable values.
96
96
  */
97
97
  private _consumable;
98
98
  /**
99
- * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds a parent
100
- * of that `TextProxy` and the start and end indices of that `TextProxy`. This allows identification of the `TextProxy`
101
- * instances that point to the same part of the model but are different instances. Each distinct `TextProxy`
99
+ * For each {@link module:engine/model/textproxy~ModelTextProxy} added to `ModelConsumable`, this registry holds a parent
100
+ * of that `ModelTextProxy` and the start and end indices of that `ModelTextProxy`. This allows identification of the `ModelTextProxy`
101
+ * instances that point to the same part of the model but are different instances. Each distinct `ModelTextProxy`
102
102
  * is given a unique `Symbol` which is then registered as consumable. This process is transparent for the `ModelConsumable`
103
- * API user because whenever `TextProxy` is added, tested, consumed or reverted, the internal mechanisms of
104
- * `ModelConsumable` translate `TextProxy` to that unique `Symbol`.
103
+ * API user because whenever `ModelTextProxy` is added, tested, consumed or reverted, the internal mechanisms of
104
+ * `ModelConsumable` translate `ModelTextProxy` to that unique `Symbol`.
105
105
  */
106
106
  private _textProxyRegistry;
107
107
  /**
@@ -119,7 +119,7 @@ export default class ModelConsumable {
119
119
  * @param type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.
120
120
  * Second colon and everything after will be cut. Passing event name is a safe and good practice.
121
121
  */
122
- add(item: Item | Selection | DocumentSelection | Range, type: string): void;
122
+ add(item: ModelItem | ModelSelection | ModelDocumentSelection | ModelRange, type: string): void;
123
123
  /**
124
124
  * Removes a given consumable value from a given model item.
125
125
  *
@@ -136,7 +136,7 @@ export default class ModelConsumable {
136
136
  * Second colon and everything after will be cut. Passing event name is a safe and good practice.
137
137
  * @returns `true` if consumable value was available and was consumed, `false` otherwise.
138
138
  */
139
- consume(item: Item | Selection | DocumentSelection | Range, type: string): boolean;
139
+ consume(item: ModelItem | ModelSelection | ModelDocumentSelection | ModelRange, type: string): boolean;
140
140
  /**
141
141
  * Tests whether there is a consumable value of a given type connected with a given model item.
142
142
  *
@@ -154,7 +154,7 @@ export default class ModelConsumable {
154
154
  * @returns `null` if such consumable was never added, `false` if the consumable values was
155
155
  * already consumed or `true` if it was added and not consumed yet.
156
156
  */
157
- test(item: Item | Selection | DocumentSelection | Range, type: string): boolean | null;
157
+ test(item: ModelItem | ModelSelection | ModelDocumentSelection | ModelRange, type: string): boolean | null;
158
158
  /**
159
159
  * Reverts consuming of a consumable value.
160
160
  *
@@ -171,7 +171,7 @@ export default class ModelConsumable {
171
171
  * @returns `true` if consumable has been reversed, `false` otherwise. `null` if the consumable has
172
172
  * never been added.
173
173
  */
174
- revert(item: Item | Selection | DocumentSelection | Range, type: string): boolean | null;
174
+ revert(item: ModelItem | ModelSelection | ModelDocumentSelection | ModelRange, type: string): boolean | null;
175
175
  /**
176
176
  * Verifies if all events from the specified group were consumed.
177
177
  *
@@ -179,23 +179,23 @@ export default class ModelConsumable {
179
179
  */
180
180
  verifyAllConsumed(eventGroup: string): void;
181
181
  /**
182
- * Gets a unique symbol for the passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that
183
- * have same parent, same start index and same end index will get the same symbol.
182
+ * Gets a unique symbol for the passed {@link module:engine/model/textproxy~ModelTextProxy} instance.
183
+ * All `ModelTextProxy` instances that have same parent, same start index and same end index will get the same symbol.
184
184
  *
185
- * Used internally to correctly consume `TextProxy` instances.
185
+ * Used internally to correctly consume `ModelTextProxy` instances.
186
186
  *
187
187
  * @internal
188
- * @param textProxy `TextProxy` instance to get a symbol for.
189
- * @returns Symbol representing all equal instances of `TextProxy`.
188
+ * @param textProxy `ModelTextProxy` instance to get a symbol for.
189
+ * @returns Symbol representing all equal instances of `ModelTextProxy`.
190
190
  */
191
- _getSymbolForTextProxy(textProxy: TextProxy): symbol;
191
+ _getSymbolForTextProxy(textProxy: ModelTextProxy): symbol;
192
192
  /**
193
- * Adds a symbol for the given {@link module:engine/model/textproxy~TextProxy} instance.
193
+ * Adds a symbol for the given {@link module:engine/model/textproxy~ModelTextProxy} instance.
194
194
  *
195
- * Used internally to correctly consume `TextProxy` instances.
195
+ * Used internally to correctly consume `ModelTextProxy` instances.
196
196
  *
197
197
  * @param textProxy Text proxy instance.
198
- * @returns Symbol generated for given `TextProxy`.
198
+ * @returns Symbol generated for given `ModelTextProxy`.
199
199
  */
200
200
  private _addSymbolForTextProxy;
201
201
  }
@@ -5,16 +5,16 @@
5
5
  /**
6
6
  * @module engine/conversion/modelconsumable
7
7
  */
8
- import TextProxy from '../model/textproxy.js';
8
+ import { ModelTextProxy } from '../model/textproxy.js';
9
9
  import { CKEditorError } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
- * Manages a list of consumable values for the {@link module:engine/model/item~Item model items}.
11
+ * Manages a list of consumable values for the {@link module:engine/model/item~ModelItem model items}.
12
12
  *
13
13
  * Consumables are various aspects of the model. A model item can be broken down into separate, single properties that might be
14
14
  * taken into consideration when converting that item.
15
15
  *
16
16
  * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing the changed
17
- * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down
17
+ * parts of {@link module:engine/model/document~ModelDocument the document}. The added / changed / removed model items are broken down
18
18
  * into singular properties (the item itself and its attributes). All those parts are saved in `ModelConsumable`. Then,
19
19
  * during conversion, when the given part of a model item is converted (i.e. the view element has been inserted into the view,
20
20
  * but without attributes), the consumable value is removed from `ModelConsumable`.
@@ -87,18 +87,18 @@ import { CKEditorError } from '@ckeditor/ckeditor5-utils';
87
87
  * } );
88
88
  * ```
89
89
  */
90
- export default class ModelConsumable {
90
+ export class ModelConsumable {
91
91
  /**
92
92
  * Contains list of consumable values.
93
93
  */
94
94
  _consumable = new Map();
95
95
  /**
96
- * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds a parent
97
- * of that `TextProxy` and the start and end indices of that `TextProxy`. This allows identification of the `TextProxy`
98
- * instances that point to the same part of the model but are different instances. Each distinct `TextProxy`
96
+ * For each {@link module:engine/model/textproxy~ModelTextProxy} added to `ModelConsumable`, this registry holds a parent
97
+ * of that `ModelTextProxy` and the start and end indices of that `ModelTextProxy`. This allows identification of the `ModelTextProxy`
98
+ * instances that point to the same part of the model but are different instances. Each distinct `ModelTextProxy`
99
99
  * is given a unique `Symbol` which is then registered as consumable. This process is transparent for the `ModelConsumable`
100
- * API user because whenever `TextProxy` is added, tested, consumed or reverted, the internal mechanisms of
101
- * `ModelConsumable` translate `TextProxy` to that unique `Symbol`.
100
+ * API user because whenever `ModelTextProxy` is added, tested, consumed or reverted, the internal mechanisms of
101
+ * `ModelConsumable` translate `ModelTextProxy` to that unique `Symbol`.
102
102
  */
103
103
  _textProxyRegistry = new Map();
104
104
  /**
@@ -118,7 +118,7 @@ export default class ModelConsumable {
118
118
  */
119
119
  add(item, type) {
120
120
  type = _normalizeConsumableType(type);
121
- if (item instanceof TextProxy) {
121
+ if (item instanceof ModelTextProxy) {
122
122
  item = this._getSymbolForTextProxy(item);
123
123
  }
124
124
  if (!this._consumable.has(item)) {
@@ -144,7 +144,7 @@ export default class ModelConsumable {
144
144
  */
145
145
  consume(item, type) {
146
146
  type = _normalizeConsumableType(type);
147
- if (item instanceof TextProxy) {
147
+ if (item instanceof ModelTextProxy) {
148
148
  item = this._getSymbolForTextProxy(item);
149
149
  }
150
150
  if (this.test(item, type)) {
@@ -174,7 +174,7 @@ export default class ModelConsumable {
174
174
  */
175
175
  test(item, type) {
176
176
  type = _normalizeConsumableType(type);
177
- if (item instanceof TextProxy) {
177
+ if (item instanceof ModelTextProxy) {
178
178
  item = this._getSymbolForTextProxy(item);
179
179
  }
180
180
  const itemConsumables = this._consumable.get(item);
@@ -205,7 +205,7 @@ export default class ModelConsumable {
205
205
  */
206
206
  revert(item, type) {
207
207
  type = _normalizeConsumableType(type);
208
- if (item instanceof TextProxy) {
208
+ if (item instanceof ModelTextProxy) {
209
209
  item = this._getSymbolForTextProxy(item);
210
210
  }
211
211
  const test = this.test(item, type);
@@ -238,7 +238,7 @@ export default class ModelConsumable {
238
238
  }
239
239
  if (items.length) {
240
240
  /**
241
- * Some of the {@link module:engine/model/item~Item model items} were not consumed while downcasting the model to view.
241
+ * Some of the {@link module:engine/model/item~ModelItem model items} were not consumed while downcasting the model to view.
242
242
  *
243
243
  * This might be the effect of:
244
244
  *
@@ -251,20 +251,20 @@ export default class ModelConsumable {
251
251
  * attributes and child nodes.
252
252
  *
253
253
  * @error conversion-model-consumable-not-consumed
254
- * @param {Array.<module:engine/model/item~Item>} items Items that were not consumed.
254
+ * @param {Array.<module:engine/model/item~ModelItem>} items Items that were not consumed.
255
255
  */
256
256
  throw new CKEditorError('conversion-model-consumable-not-consumed', null, { items });
257
257
  }
258
258
  }
259
259
  /**
260
- * Gets a unique symbol for the passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that
261
- * have same parent, same start index and same end index will get the same symbol.
260
+ * Gets a unique symbol for the passed {@link module:engine/model/textproxy~ModelTextProxy} instance.
261
+ * All `ModelTextProxy` instances that have same parent, same start index and same end index will get the same symbol.
262
262
  *
263
- * Used internally to correctly consume `TextProxy` instances.
263
+ * Used internally to correctly consume `ModelTextProxy` instances.
264
264
  *
265
265
  * @internal
266
- * @param textProxy `TextProxy` instance to get a symbol for.
267
- * @returns Symbol representing all equal instances of `TextProxy`.
266
+ * @param textProxy `ModelTextProxy` instance to get a symbol for.
267
+ * @returns Symbol representing all equal instances of `ModelTextProxy`.
268
268
  */
269
269
  _getSymbolForTextProxy(textProxy) {
270
270
  let symbol = null;
@@ -281,12 +281,12 @@ export default class ModelConsumable {
281
281
  return symbol;
282
282
  }
283
283
  /**
284
- * Adds a symbol for the given {@link module:engine/model/textproxy~TextProxy} instance.
284
+ * Adds a symbol for the given {@link module:engine/model/textproxy~ModelTextProxy} instance.
285
285
  *
286
- * Used internally to correctly consume `TextProxy` instances.
286
+ * Used internally to correctly consume `ModelTextProxy` instances.
287
287
  *
288
288
  * @param textProxy Text proxy instance.
289
- * @returns Symbol generated for given `TextProxy`.
289
+ * @returns Symbol generated for given `ModelTextProxy`.
290
290
  */
291
291
  _addSymbolForTextProxy(textProxy) {
292
292
  const start = textProxy.startOffset;
@@ -5,40 +5,40 @@
5
5
  /**
6
6
  * @module engine/conversion/upcastdispatcher
7
7
  */
8
- import ViewConsumable from './viewconsumable.js';
9
- import ModelRange from '../model/range.js';
10
- import ModelPosition from '../model/position.js';
11
- import type ModelElement from '../model/element.js';
12
- import type ModelNode from '../model/node.js';
13
- import type ViewElement from '../view/element.js';
14
- import type ViewText from '../view/text.js';
15
- import type ViewDocumentFragment from '../view/documentfragment.js';
16
- import type ModelDocumentFragment from '../model/documentfragment.js';
17
- import type { default as Schema, SchemaContextDefinition } from '../model/schema.js';
18
- import type ModelWriter from '../model/writer.js';
19
- import type ViewItem from '../view/item.js';
8
+ import { ViewConsumable } from './viewconsumable.js';
9
+ import { ModelRange } from '../model/range.js';
10
+ import { ModelPosition } from '../model/position.js';
11
+ import { type ModelElement } from '../model/element.js';
12
+ import { type ModelNode } from '../model/node.js';
13
+ import { type ViewElement } from '../view/element.js';
14
+ import { type ViewText } from '../view/text.js';
15
+ import { type ViewDocumentFragment } from '../view/documentfragment.js';
16
+ import { type ModelDocumentFragment } from '../model/documentfragment.js';
17
+ import type { ModelSchema, ModelSchemaContextDefinition } from '../model/schema.js';
18
+ import { type ModelWriter } from '../model/writer.js';
19
+ import { type ViewItem } from '../view/item.js';
20
20
  declare const UpcastDispatcher_base: {
21
21
  new (): import("@ckeditor/ckeditor5-utils").Emitter;
22
22
  prototype: import("@ckeditor/ckeditor5-utils").Emitter;
23
23
  };
24
24
  /**
25
25
  * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of
26
- * converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or
27
- * {@link module:engine/view/element~Element view element} into a correct model structure.
26
+ * converting a given {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment} or
27
+ * {@link module:engine/view/element~ViewElement view element} into a correct model structure.
28
28
  *
29
- * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~Node view nodes}
29
+ * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~ViewNode view nodes}
30
30
  * from the converted view document fragment.
31
31
  * Special callbacks called "converters" should listen to these events in order to convert the view nodes.
32
32
  *
33
33
  * The second parameter of the callback is the `data` object with the following properties:
34
34
  *
35
- * * `data.viewItem` contains a {@link module:engine/view/node~Node view node} or a
36
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
35
+ * * `data.viewItem` contains a {@link module:engine/view/node~ViewNode view node} or a
36
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment}
37
37
  * that is converted at the moment and might be handled by the callback.
38
38
  * * `data.modelRange` is used to point to the result
39
39
  * of the current conversion (e.g. the element that is being inserted)
40
- * and is always a {@link module:engine/model/range~Range} when the conversion succeeds.
41
- * * `data.modelCursor` is a {@link module:engine/model/position~Position position} on which the converter should insert
40
+ * and is always a {@link module:engine/model/range~ModelRange} when the conversion succeeds.
41
+ * * `data.modelCursor` is a {@link module:engine/model/position~ModelPosition position} on which the converter should insert
42
42
  * the newly created items.
43
43
  *
44
44
  * The third parameter of the callback is an instance of {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi}
@@ -117,7 +117,7 @@ declare const UpcastDispatcher_base: {
117
117
  * @fires text
118
118
  * @fires documentFragment
119
119
  */
120
- export default class UpcastDispatcher extends /* #__PURE__ */ UpcastDispatcher_base {
120
+ export declare class UpcastDispatcher extends /* #__PURE__ */ UpcastDispatcher_base {
121
121
  /**
122
122
  * An interface passed by the dispatcher to the event callbacks.
123
123
  */
@@ -165,9 +165,9 @@ export default class UpcastDispatcher extends /* #__PURE__ */ UpcastDispatcher_b
165
165
  * @param context Elements will be converted according to this context.
166
166
  * @returns Model data that is the result of the conversion process
167
167
  * wrapped in `DocumentFragment`. Converted marker elements will be set as the document fragment's
168
- * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
168
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment#markers static markers map}.
169
169
  */
170
- convert(viewElement: ViewElement | ViewDocumentFragment, writer: ModelWriter, context?: SchemaContextDefinition): ModelDocumentFragment;
170
+ convert(viewElement: ViewElement | ViewDocumentFragment, writer: ModelWriter, context?: ModelSchemaContextDefinition): ModelDocumentFragment;
171
171
  /**
172
172
  * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertItem
173
173
  */
@@ -247,7 +247,7 @@ export interface UpcastConversionData<TItem extends ViewItem | ViewDocumentFragm
247
247
  modelRange: ModelRange | null;
248
248
  }
249
249
  /**
250
- * Fired when an {@link module:engine/view/element~Element} is converted.
250
+ * Fired when an {@link module:engine/view/element~ViewElement} is converted.
251
251
  *
252
252
  * `element` is a namespace event for a class of events. Names of actually called events follow the pattern of
253
253
  * `element:<elementName>` where `elementName` is the name of the converted element. This way listeners may listen to
@@ -261,14 +261,14 @@ export interface UpcastConversionData<TItem extends ViewItem | ViewDocumentFragm
261
261
  */
262
262
  export type UpcastElementEvent = UpcastEvent<'element', ViewElement>;
263
263
  /**
264
- * Fired when a {@link module:engine/view/text~Text} is converted.
264
+ * Fired when a {@link module:engine/view/text~ViewText} is converted.
265
265
  *
266
266
  * @eventName ~UpcastDispatcher#text
267
267
  * @see ~UpcastDispatcher#event:element
268
268
  */
269
269
  export type UpcastTextEvent = UpcastEvent<'text', ViewText>;
270
270
  /**
271
- * Fired when a {@link module:engine/view/documentfragment~DocumentFragment} is converted.
271
+ * Fired when a {@link module:engine/view/documentfragment~ViewDocumentFragment} is converted.
272
272
  *
273
273
  * @eventName ~UpcastDispatcher#documentFragment
274
274
  * @see ~UpcastDispatcher#event:element
@@ -288,9 +288,9 @@ export interface UpcastConversionApi {
288
288
  /**
289
289
  * The model's schema instance.
290
290
  */
291
- schema: Schema;
291
+ schema: ModelSchema;
292
292
  /**
293
- * The {@link module:engine/model/writer~Writer} instance used to manipulate the data during conversion.
293
+ * The {@link module:engine/model/writer~ModelWriter} instance used to manipulate the data during conversion.
294
294
  */
295
295
  writer: ModelWriter;
296
296
  /**
@@ -307,7 +307,7 @@ export interface UpcastConversionApi {
307
307
  *
308
308
  * Every fired event is passed (as the first parameter) an object with the `modelRange` property. Every event may set and/or
309
309
  * modify that property. When all callbacks are done, the final value of the `modelRange` property is returned by this method.
310
- * The `modelRange` must be a {@link module:engine/model/range~Range model range} or `null` (as set by default).
310
+ * The `modelRange` must be a {@link module:engine/model/range~ModelRange model range} or `null` (as set by default).
311
311
  *
312
312
  * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element
313
313
  * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text
@@ -342,7 +342,8 @@ export interface UpcastConversionApi {
342
342
  modelCursor: ModelPosition;
343
343
  };
344
344
  /**
345
- * Safely inserts an element to the document, checking the {@link module:engine/model/schema~Schema schema} to find an allowed parent
345
+ * Safely inserts an element to the document, checking the
346
+ * {@link module:engine/model/schema~ModelSchema schema} to find an allowed parent
346
347
  * for an element that you are going to insert, starting from the given position. If the current parent does not allow to insert
347
348
  * the element but one of the ancestors does, then splits the nodes to allowed parent.
348
349
  *
@@ -403,9 +404,9 @@ export interface UpcastConversionApi {
403
404
  */
404
405
  updateConversionResult(modelElement: ModelElement, data: UpcastConversionData): void;
405
406
  /**
406
- * Checks the {@link module:engine/model/schema~Schema schema} to find an allowed parent for an element that is going to be inserted
407
- * starting from the given position. If the current parent does not allow inserting an element but one of the ancestors does, the method
408
- * splits nodes to allowed parent.
407
+ * Checks the {@link module:engine/model/schema~ModelSchema schema} to find an allowed parent for an element
408
+ * that is going to be inserted starting from the given position. If the current parent does not allow
409
+ * inserting an element but one of the ancestors does, the method splits nodes to allowed parent.
409
410
  *
410
411
  * If the schema allows inserting the node in the given position, nothing is split and an object with that position is returned.
411
412
  *
@@ -5,30 +5,30 @@
5
5
  /**
6
6
  * @module engine/conversion/upcastdispatcher
7
7
  */
8
- import ViewConsumable from './viewconsumable.js';
9
- import ModelRange from '../model/range.js';
10
- import ModelPosition from '../model/position.js';
11
- import { SchemaContext } from '../model/schema.js'; // eslint-disable-line no-duplicate-imports
8
+ import { ViewConsumable } from './viewconsumable.js';
9
+ import { ModelRange } from '../model/range.js';
10
+ import { ModelPosition } from '../model/position.js';
11
+ import { ModelSchemaContext } from '../model/schema.js'; // eslint-disable-line no-duplicate-imports
12
12
  import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing.js';
13
13
  import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
14
14
  /**
15
15
  * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of
16
- * converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or
17
- * {@link module:engine/view/element~Element view element} into a correct model structure.
16
+ * converting a given {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment} or
17
+ * {@link module:engine/view/element~ViewElement view element} into a correct model structure.
18
18
  *
19
- * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~Node view nodes}
19
+ * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~ViewNode view nodes}
20
20
  * from the converted view document fragment.
21
21
  * Special callbacks called "converters" should listen to these events in order to convert the view nodes.
22
22
  *
23
23
  * The second parameter of the callback is the `data` object with the following properties:
24
24
  *
25
- * * `data.viewItem` contains a {@link module:engine/view/node~Node view node} or a
26
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}
25
+ * * `data.viewItem` contains a {@link module:engine/view/node~ViewNode view node} or a
26
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment}
27
27
  * that is converted at the moment and might be handled by the callback.
28
28
  * * `data.modelRange` is used to point to the result
29
29
  * of the current conversion (e.g. the element that is being inserted)
30
- * and is always a {@link module:engine/model/range~Range} when the conversion succeeds.
31
- * * `data.modelCursor` is a {@link module:engine/model/position~Position position} on which the converter should insert
30
+ * and is always a {@link module:engine/model/range~ModelRange} when the conversion succeeds.
31
+ * * `data.modelCursor` is a {@link module:engine/model/position~ModelPosition position} on which the converter should insert
32
32
  * the newly created items.
33
33
  *
34
34
  * The third parameter of the callback is an instance of {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi}
@@ -107,7 +107,7 @@ import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
107
107
  * @fires text
108
108
  * @fires documentFragment
109
109
  */
110
- export default class UpcastDispatcher extends /* #__PURE__ */ EmitterMixin() {
110
+ export class UpcastDispatcher extends /* #__PURE__ */ EmitterMixin() {
111
111
  /**
112
112
  * An interface passed by the dispatcher to the event callbacks.
113
113
  */
@@ -171,7 +171,7 @@ export default class UpcastDispatcher extends /* #__PURE__ */ EmitterMixin() {
171
171
  * @param context Elements will be converted according to this context.
172
172
  * @returns Model data that is the result of the conversion process
173
173
  * wrapped in `DocumentFragment`. Converted marker elements will be set as the document fragment's
174
- * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
174
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment#markers static markers map}.
175
175
  */
176
176
  convert(viewElement, writer, context = ['$root']) {
177
177
  this.fire('viewCleanup', viewElement);
@@ -231,7 +231,7 @@ export default class UpcastDispatcher extends /* #__PURE__ */ EmitterMixin() {
231
231
  /**
232
232
  * Incorrect conversion result was dropped.
233
233
  *
234
- * {@link module:engine/model/range~Range Model range} should be a conversion result.
234
+ * {@link module:engine/model/range~ModelRange Model range} should be a conversion result.
235
235
  *
236
236
  * @error view-conversion-dispatcher-incorrect-result
237
237
  */
@@ -416,7 +416,7 @@ export default class UpcastDispatcher extends /* #__PURE__ */ EmitterMixin() {
416
416
  }
417
417
  /**
418
418
  * Traverses given model item and searches elements which marks marker range. Found element is removed from
419
- * DocumentFragment but path of this element is stored in a Map which is then returned.
419
+ * ModelDocumentFragment but path of this element is stored in a Map which is then returned.
420
420
  *
421
421
  * @param modelItem Fragment of model.
422
422
  * @returns List of static markers.
@@ -426,14 +426,14 @@ function extractMarkersFromModelFragment(modelItem, writer) {
426
426
  const markers = new Map();
427
427
  // Create ModelTreeWalker.
428
428
  const range = ModelRange._createIn(modelItem).getItems();
429
- // Walk through DocumentFragment and collect marker elements.
429
+ // Walk through ModelDocumentFragment and collect marker elements.
430
430
  for (const item of range) {
431
431
  // Check if current element is a marker.
432
432
  if (item.is('element', '$marker')) {
433
433
  markerElements.add(item);
434
434
  }
435
435
  }
436
- // Walk through collected marker elements store its path and remove its from the DocumentFragment.
436
+ // Walk through collected marker elements store its path and remove its from the ModelDocumentFragment.
437
437
  for (const markerElement of markerElements) {
438
438
  const markerName = markerElement.getAttribute('data-name');
439
439
  const currentPosition = writer.createPositionBefore(markerElement);
@@ -445,7 +445,7 @@ function extractMarkersFromModelFragment(modelItem, writer) {
445
445
  else {
446
446
  markers.get(markerName).end = currentPosition.clone();
447
447
  }
448
- // Remove marker element from DocumentFragment.
448
+ // Remove marker element from ModelDocumentFragment.
449
449
  writer.remove(markerElement);
450
450
  }
451
451
  return markers;
@@ -455,7 +455,7 @@ function extractMarkersFromModelFragment(modelItem, writer) {
455
455
  */
456
456
  function createContextTree(contextDefinition, writer) {
457
457
  let position;
458
- for (const item of new SchemaContext(contextDefinition)) {
458
+ for (const item of new ModelSchemaContext(contextDefinition)) {
459
459
  const attributes = {};
460
460
  for (const key of item.getAttributeKeys()) {
461
461
  attributes[key] = item.getAttribute(key);