@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,31 +5,31 @@
5
5
  /**
6
6
  * @module engine/view/attributeelement
7
7
  */
8
- import Element, { type ElementAttributes } from './element.js';
9
- import type Document from './document.js';
10
- import type Node from './node.js';
8
+ import { ViewElement, type ViewElementAttributes } from './element.js';
9
+ import { type ViewDocument } from './document.js';
10
+ import { type ViewNode } from './node.js';
11
11
  /**
12
12
  * Attribute elements are used to represent formatting elements in the view (think – `<b>`, `<span style="font-size: 2em">`, etc.).
13
13
  * Most often they are created when downcasting model text attributes.
14
14
  *
15
15
  * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
16
- * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
17
- * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
16
+ * types (container element, {@link module:engine/view/attributeelement~ViewAttributeElement attribute element},
17
+ * {@link module:engine/view/emptyelement~ViewEmptyElement empty element}, etc) when developing a feature.
18
18
  *
19
19
  * To create a new attribute element instance use the
20
- * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.
20
+ * {@link module:engine/view/downcastwriter~ViewDowncastWriter#createAttributeElement `ViewDowncastWriter#createAttributeElement()`} method.
21
21
  */
22
- export default class AttributeElement extends Element {
22
+ export declare class ViewAttributeElement extends ViewElement {
23
23
  static readonly DEFAULT_PRIORITY: number;
24
24
  /**
25
- * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
25
+ * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~ViewDowncastWriter}.
26
26
  *
27
27
  * @internal
28
28
  * @readonly
29
29
  */
30
30
  _priority: number;
31
31
  /**
32
- * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
32
+ * Element identifier. If set, it is used by {@link module:engine/view/element~ViewElement#isSimilar},
33
33
  * and then two elements are considered similar if, and only if they have the same `_id`.
34
34
  *
35
35
  * @internal
@@ -37,36 +37,36 @@ export default class AttributeElement extends Element {
37
37
  */
38
38
  _id: string | number | null;
39
39
  /**
40
- * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}
40
+ * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~ViewAttributeElement#id ids}
41
41
  * and still exist in the view tree.
42
42
  *
43
- * This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.
43
+ * This property is managed by {@link module:engine/view/downcastwriter~ViewDowncastWriter}.
44
44
  */
45
45
  private readonly _clonesGroup;
46
46
  /**
47
47
  * Creates an attribute element.
48
48
  *
49
- * @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement
50
- * @see module:engine/view/element~Element
49
+ * @see module:engine/view/downcastwriter~ViewDowncastWriter#createAttributeElement
50
+ * @see module:engine/view/element~ViewElement
51
51
  * @protected
52
52
  * @param document The document instance to which this element belongs.
53
53
  * @param name Node name.
54
54
  * @param attrs Collection of attributes.
55
55
  * @param children A list of nodes to be inserted into created element.
56
56
  */
57
- constructor(document: Document, name: string, attrs?: ElementAttributes, children?: Node | Iterable<Node>);
57
+ constructor(document: ViewDocument, name: string, attrs?: ViewElementAttributes, children?: ViewNode | Iterable<ViewNode>);
58
58
  /**
59
- * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
59
+ * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~ViewDowncastWriter}.
60
60
  */
61
61
  get priority(): number;
62
62
  /**
63
- * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
63
+ * Element identifier. If set, it is used by {@link module:engine/view/element~ViewElement#isSimilar},
64
64
  * and then two elements are considered similar if, and only if they have the same `id`.
65
65
  */
66
66
  get id(): string | number | null;
67
67
  /**
68
- * Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the
69
- * same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).
68
+ * Returns all {@link module:engine/view/attributeelement~ViewAttributeElement attribute elements} that has the
69
+ * same {@link module:engine/view/attributeelement~ViewAttributeElement#id id} and are in the view tree (were not removed).
70
70
  *
71
71
  * Note: If this element has been removed from the tree, returned set will not include it.
72
72
  *
@@ -76,26 +76,26 @@ export default class AttributeElement extends Element {
76
76
  * @returns Set containing all the attribute elements
77
77
  * with the same `id` that were added and not removed from the view tree.
78
78
  */
79
- getElementsWithSameId(): Set<AttributeElement>;
79
+ getElementsWithSameId(): Set<ViewAttributeElement>;
80
80
  /**
81
81
  * Checks if this element is similar to other element.
82
82
  *
83
- * If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements
83
+ * If none of elements has set {@link module:engine/view/attributeelement~ViewAttributeElement#id}, then both elements
84
84
  * should have the same name, attributes and priority to be considered as similar. Two similar elements can contain
85
85
  * different set of children nodes.
86
86
  *
87
- * If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both
88
- * elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be
87
+ * If at least one element has {@link module:engine/view/attributeelement~ViewAttributeElement#id} set, then both
88
+ * elements have to have the same {@link module:engine/view/attributeelement~ViewAttributeElement#id} value to be
89
89
  * considered similar.
90
90
  *
91
- * Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:
91
+ * Similarity is important for {@link module:engine/view/downcastwriter~ViewDowncastWriter}. For example:
92
92
  *
93
93
  * * two following similar elements can be merged together into one, longer element,
94
- * * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to
94
+ * * {@link module:engine/view/downcastwriter~ViewDowncastWriter#unwrap} checks similarity of passed element and processed element to
95
95
  * decide whether processed element should be unwrapped,
96
96
  * * etc.
97
97
  */
98
- isSimilar(otherElement: Element): boolean;
98
+ isSimilar(otherElement: ViewElement): boolean;
99
99
  /**
100
100
  * Clones provided element with priority.
101
101
  *
@@ -106,17 +106,17 @@ export default class AttributeElement extends Element {
106
106
  */
107
107
  _clone(deep?: boolean): this;
108
108
  /**
109
- * Used by {@link module:engine/view/element~Element#_mergeAttributesFrom} to verify if the given element can be merged without
109
+ * Used by {@link module:engine/view/element~ViewElement#_mergeAttributesFrom} to verify if the given element can be merged without
110
110
  * conflicts into this element.
111
111
  *
112
112
  * @internal
113
113
  */
114
- _canMergeAttributesFrom(otherElement: AttributeElement): boolean;
114
+ _canMergeAttributesFrom(otherElement: ViewAttributeElement): boolean;
115
115
  /**
116
- * Used by {@link module:engine/view/element~Element#_subtractAttributesOf} to verify if the given element attributes
116
+ * Used by {@link module:engine/view/element~ViewElement#_subtractAttributesOf} to verify if the given element attributes
117
117
  * can be fully subtracted from this element.
118
118
  *
119
119
  * @internal
120
120
  */
121
- _canSubtractAttributesOf(otherElement: AttributeElement): boolean;
121
+ _canSubtractAttributesOf(otherElement: ViewAttributeElement): boolean;
122
122
  }
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module engine/view/attributeelement
7
7
  */
8
- import Element from './element.js';
8
+ import { ViewElement } from './element.js';
9
9
  import { CKEditorError } from '@ckeditor/ckeditor5-utils';
10
10
  // Default attribute priority.
11
11
  const DEFAULT_PRIORITY = 10;
@@ -14,23 +14,23 @@ const DEFAULT_PRIORITY = 10;
14
14
  * Most often they are created when downcasting model text attributes.
15
15
  *
16
16
  * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
17
- * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
18
- * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
17
+ * types (container element, {@link module:engine/view/attributeelement~ViewAttributeElement attribute element},
18
+ * {@link module:engine/view/emptyelement~ViewEmptyElement empty element}, etc) when developing a feature.
19
19
  *
20
20
  * To create a new attribute element instance use the
21
- * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.
21
+ * {@link module:engine/view/downcastwriter~ViewDowncastWriter#createAttributeElement `ViewDowncastWriter#createAttributeElement()`} method.
22
22
  */
23
- class AttributeElement extends Element {
23
+ class ViewAttributeElement extends ViewElement {
24
24
  static DEFAULT_PRIORITY = DEFAULT_PRIORITY;
25
25
  /**
26
- * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
26
+ * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~ViewDowncastWriter}.
27
27
  *
28
28
  * @internal
29
29
  * @readonly
30
30
  */
31
31
  _priority = DEFAULT_PRIORITY;
32
32
  /**
33
- * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
33
+ * Element identifier. If set, it is used by {@link module:engine/view/element~ViewElement#isSimilar},
34
34
  * and then two elements are considered similar if, and only if they have the same `_id`.
35
35
  *
36
36
  * @internal
@@ -38,17 +38,17 @@ class AttributeElement extends Element {
38
38
  */
39
39
  _id = null;
40
40
  /**
41
- * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}
41
+ * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~ViewAttributeElement#id ids}
42
42
  * and still exist in the view tree.
43
43
  *
44
- * This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.
44
+ * This property is managed by {@link module:engine/view/downcastwriter~ViewDowncastWriter}.
45
45
  */
46
46
  _clonesGroup = null;
47
47
  /**
48
48
  * Creates an attribute element.
49
49
  *
50
- * @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement
51
- * @see module:engine/view/element~Element
50
+ * @see module:engine/view/downcastwriter~ViewDowncastWriter#createAttributeElement
51
+ * @see module:engine/view/element~ViewElement
52
52
  * @protected
53
53
  * @param document The document instance to which this element belongs.
54
54
  * @param name Node name.
@@ -60,21 +60,21 @@ class AttributeElement extends Element {
60
60
  this.getFillerOffset = getFillerOffset;
61
61
  }
62
62
  /**
63
- * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
63
+ * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~ViewDowncastWriter}.
64
64
  */
65
65
  get priority() {
66
66
  return this._priority;
67
67
  }
68
68
  /**
69
- * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
69
+ * Element identifier. If set, it is used by {@link module:engine/view/element~ViewElement#isSimilar},
70
70
  * and then two elements are considered similar if, and only if they have the same `id`.
71
71
  */
72
72
  get id() {
73
73
  return this._id;
74
74
  }
75
75
  /**
76
- * Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the
77
- * same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).
76
+ * Returns all {@link module:engine/view/attributeelement~ViewAttributeElement attribute elements} that has the
77
+ * same {@link module:engine/view/attributeelement~ViewAttributeElement#id id} and are in the view tree (were not removed).
78
78
  *
79
79
  * Note: If this element has been removed from the tree, returned set will not include it.
80
80
  *
@@ -98,18 +98,18 @@ class AttributeElement extends Element {
98
98
  /**
99
99
  * Checks if this element is similar to other element.
100
100
  *
101
- * If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements
101
+ * If none of elements has set {@link module:engine/view/attributeelement~ViewAttributeElement#id}, then both elements
102
102
  * should have the same name, attributes and priority to be considered as similar. Two similar elements can contain
103
103
  * different set of children nodes.
104
104
  *
105
- * If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both
106
- * elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be
105
+ * If at least one element has {@link module:engine/view/attributeelement~ViewAttributeElement#id} set, then both
106
+ * elements have to have the same {@link module:engine/view/attributeelement~ViewAttributeElement#id} value to be
107
107
  * considered similar.
108
108
  *
109
- * Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:
109
+ * Similarity is important for {@link module:engine/view/downcastwriter~ViewDowncastWriter}. For example:
110
110
  *
111
111
  * * two following similar elements can be merged together into one, longer element,
112
- * * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to
112
+ * * {@link module:engine/view/downcastwriter~ViewDowncastWriter#unwrap} checks similarity of passed element and processed element to
113
113
  * decide whether processed element should be unwrapped,
114
114
  * * etc.
115
115
  */
@@ -137,7 +137,7 @@ class AttributeElement extends Element {
137
137
  return cloned;
138
138
  }
139
139
  /**
140
- * Used by {@link module:engine/view/element~Element#_mergeAttributesFrom} to verify if the given element can be merged without
140
+ * Used by {@link module:engine/view/element~ViewElement#_mergeAttributesFrom} to verify if the given element can be merged without
141
141
  * conflicts into this element.
142
142
  *
143
143
  * @internal
@@ -150,7 +150,7 @@ class AttributeElement extends Element {
150
150
  return super._canMergeAttributesFrom(otherElement);
151
151
  }
152
152
  /**
153
- * Used by {@link module:engine/view/element~Element#_subtractAttributesOf} to verify if the given element attributes
153
+ * Used by {@link module:engine/view/element~ViewElement#_subtractAttributesOf} to verify if the given element attributes
154
154
  * can be fully subtracted from this element.
155
155
  *
156
156
  * @internal
@@ -163,10 +163,10 @@ class AttributeElement extends Element {
163
163
  return super._canSubtractAttributesOf(otherElement);
164
164
  }
165
165
  }
166
- export default AttributeElement;
166
+ export { ViewAttributeElement };
167
167
  // The magic of type inference using `is` method is centralized in `TypeCheckable` class.
168
168
  // Proper overload would interfere with that.
169
- AttributeElement.prototype.is = function (type, name) {
169
+ ViewAttributeElement.prototype.is = function (type, name) {
170
170
  if (!name) {
171
171
  return type === 'attributeElement' || type === 'view:attributeElement' ||
172
172
  // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
@@ -204,7 +204,7 @@ function getFillerOffset() {
204
204
  return this.childCount;
205
205
  }
206
206
  /**
207
- * Returns total count of children that are not {@link module:engine/view/uielement~UIElement UIElements}.
207
+ * Returns total count of children that are not {@link module:engine/view/uielement~ViewUIElement UIElements}.
208
208
  */
209
209
  function nonUiChildrenCount(element) {
210
210
  return Array.from(element.getChildren()).filter(element => !element.is('uiElement')).length;
@@ -5,45 +5,46 @@
5
5
  /**
6
6
  * @module engine/view/containerelement
7
7
  */
8
- import Element, { type ElementAttributes } from './element.js';
9
- import type Document from './document.js';
10
- import type Node from './node.js';
8
+ import { ViewElement, type ViewElementAttributes } from './element.js';
9
+ import { type ViewDocument } from './document.js';
10
+ import { type ViewNode } from './node.js';
11
11
  /**
12
12
  * Containers are elements which define document structure. They define boundaries for
13
- * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.
13
+ * {@link module:engine/view/attributeelement~ViewAttributeElement attributes}.
14
+ * They are mostly used for block elements like `<p>` or `<div>`.
14
15
  *
15
16
  * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
16
- * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
17
- * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
17
+ * types (container element, {@link module:engine/view/attributeelement~ViewAttributeElement attribute element},
18
+ * {@link module:engine/view/emptyelement~ViewEmptyElement empty element}, etc) when developing a feature.
18
19
  *
19
20
  * The container element should be your default choice when writing a converter, unless:
20
21
  *
21
- * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),
22
- * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),
22
+ * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~ViewAttributeElement}),
23
+ * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~ViewEmptyElement}),
23
24
  * * this is a root element,
24
- * * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).
25
+ * * this is a nested editable element (then use {@link module:engine/view/editableelement~ViewEditableElement}).
25
26
  *
26
27
  * To create a new container element instance use the
27
- * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}
28
+ * {@link module:engine/view/downcastwriter~ViewDowncastWriter#createContainerElement `ViewDowncastWriter#createContainerElement()`}
28
29
  * method.
29
30
  */
30
- export default class ContainerElement extends Element {
31
+ export declare class ViewContainerElement extends ViewElement {
31
32
  /**
32
33
  * Creates a container element.
33
34
  *
34
- * @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement
35
- * @see module:engine/view/element~Element
35
+ * @see module:engine/view/downcastwriter~ViewDowncastWriter#createContainerElement
36
+ * @see module:engine/view/element~ViewElement
36
37
  * @internal
37
38
  * @param document The document instance to which this element belongs.
38
39
  * @param name Node name.
39
40
  * @param attrs Collection of attributes.
40
41
  * @param children A list of nodes to be inserted into created element.
41
42
  */
42
- constructor(document: Document, name: string, attrs?: ElementAttributes, children?: Node | Iterable<Node>);
43
+ constructor(document: ViewDocument, name: string, attrs?: ViewElementAttributes, children?: ViewNode | Iterable<ViewNode>);
43
44
  }
44
45
  /**
45
46
  * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
46
47
  *
47
48
  * @returns Block filler offset or `null` if block filler is not needed.
48
49
  */
49
- export declare function getFillerOffset(this: ContainerElement): number | null;
50
+ export declare function getViewFillerOffset(this: ViewContainerElement): number | null;
@@ -5,32 +5,33 @@
5
5
  /**
6
6
  * @module engine/view/containerelement
7
7
  */
8
- import Element from './element.js';
8
+ import { ViewElement } from './element.js';
9
9
  /**
10
10
  * Containers are elements which define document structure. They define boundaries for
11
- * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.
11
+ * {@link module:engine/view/attributeelement~ViewAttributeElement attributes}.
12
+ * They are mostly used for block elements like `<p>` or `<div>`.
12
13
  *
13
14
  * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
14
- * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
15
- * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
15
+ * types (container element, {@link module:engine/view/attributeelement~ViewAttributeElement attribute element},
16
+ * {@link module:engine/view/emptyelement~ViewEmptyElement empty element}, etc) when developing a feature.
16
17
  *
17
18
  * The container element should be your default choice when writing a converter, unless:
18
19
  *
19
- * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),
20
- * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),
20
+ * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~ViewAttributeElement}),
21
+ * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~ViewEmptyElement}),
21
22
  * * this is a root element,
22
- * * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).
23
+ * * this is a nested editable element (then use {@link module:engine/view/editableelement~ViewEditableElement}).
23
24
  *
24
25
  * To create a new container element instance use the
25
- * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}
26
+ * {@link module:engine/view/downcastwriter~ViewDowncastWriter#createContainerElement `ViewDowncastWriter#createContainerElement()`}
26
27
  * method.
27
28
  */
28
- export default class ContainerElement extends Element {
29
+ export class ViewContainerElement extends ViewElement {
29
30
  /**
30
31
  * Creates a container element.
31
32
  *
32
- * @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement
33
- * @see module:engine/view/element~Element
33
+ * @see module:engine/view/downcastwriter~ViewDowncastWriter#createContainerElement
34
+ * @see module:engine/view/element~ViewElement
34
35
  * @internal
35
36
  * @param document The document instance to which this element belongs.
36
37
  * @param name Node name.
@@ -39,12 +40,12 @@ export default class ContainerElement extends Element {
39
40
  */
40
41
  constructor(document, name, attrs, children) {
41
42
  super(document, name, attrs, children);
42
- this.getFillerOffset = getFillerOffset;
43
+ this.getFillerOffset = getViewFillerOffset;
43
44
  }
44
45
  }
45
46
  // The magic of type inference using `is` method is centralized in `TypeCheckable` class.
46
47
  // Proper overload would interfere with that.
47
- ContainerElement.prototype.is = function (type, name) {
48
+ ViewContainerElement.prototype.is = function (type, name) {
48
49
  if (!name) {
49
50
  return type === 'containerElement' || type === 'view:containerElement' ||
50
51
  // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
@@ -62,7 +63,7 @@ ContainerElement.prototype.is = function (type, name) {
62
63
  *
63
64
  * @returns Block filler offset or `null` if block filler is not needed.
64
65
  */
65
- export function getFillerOffset() {
66
+ export function getViewFillerOffset() {
66
67
  const children = [...this.getChildren()];
67
68
  const lastChild = children[this.childCount - 1];
68
69
  // Block filler is required after a `<br>` if it's the last element in its container. See #1422.
@@ -9,7 +9,7 @@ type DomDataTransfer = globalThis.DataTransfer;
9
9
  /**
10
10
  * A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
11
11
  */
12
- export default class DataTransfer {
12
+ export declare class ViewDataTransfer {
13
13
  /**
14
14
  * The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
15
15
  */
@@ -52,13 +52,13 @@ export default class DataTransfer {
52
52
  /**
53
53
  * The effect that is allowed for a drag operation.
54
54
  */
55
- set effectAllowed(value: EffectAllowed);
56
- get effectAllowed(): EffectAllowed;
55
+ set effectAllowed(value: ViewEffectAllowed);
56
+ get effectAllowed(): ViewEffectAllowed;
57
57
  /**
58
58
  * The actual drop effect.
59
59
  */
60
- set dropEffect(value: DropEffect);
61
- get dropEffect(): DropEffect;
60
+ set dropEffect(value: ViewDropEffect);
61
+ get dropEffect(): ViewDropEffect;
62
62
  /**
63
63
  * Set a preview image of the dragged content.
64
64
  */
@@ -71,9 +71,9 @@ export default class DataTransfer {
71
71
  /**
72
72
  * The effect that is allowed for a drag operation.
73
73
  */
74
- export type EffectAllowed = DomDataTransfer['effectAllowed'];
74
+ export type ViewEffectAllowed = DomDataTransfer['effectAllowed'];
75
75
  /**
76
76
  * The actual drop effect.
77
77
  */
78
- export type DropEffect = DomDataTransfer['dropEffect'];
78
+ export type ViewDropEffect = DomDataTransfer['dropEffect'];
79
79
  export {};
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
7
7
  */
8
- export default class DataTransfer {
8
+ export class ViewDataTransfer {
9
9
  /**
10
10
  * The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
11
11
  */
@@ -5,33 +5,33 @@
5
5
  /**
6
6
  * @module engine/view/document
7
7
  */
8
- import DocumentSelection from './documentselection.js';
8
+ import { ViewDocumentSelection } from './documentselection.js';
9
9
  import { Collection } from '@ckeditor/ckeditor5-utils';
10
10
  import type { StylesProcessor } from './stylesmap.js';
11
- import type RootEditableElement from './rooteditableelement.js';
12
- import type DowncastWriter from './downcastwriter.js';
13
- declare const Document_base: import("@ckeditor/ckeditor5-utils").Mixed<{
11
+ import { type ViewRootEditableElement } from './rooteditableelement.js';
12
+ import { type ViewDowncastWriter } from './downcastwriter.js';
13
+ declare const ViewDocument_base: import("@ckeditor/ckeditor5-utils").Mixed<{
14
14
  new (): import("@ckeditor/ckeditor5-utils").Observable;
15
15
  prototype: import("@ckeditor/ckeditor5-utils").Observable;
16
16
  }, import("@ckeditor/ckeditor5-utils").Emitter>;
17
17
  /**
18
18
  * Document class creates an abstract layer over the content editable area, contains a tree of view elements and
19
- * {@link module:engine/view/documentselection~DocumentSelection view selection} associated with this document.
19
+ * {@link module:engine/view/documentselection~ViewDocumentSelection view selection} associated with this document.
20
20
  */
21
- export default class Document extends /* #__PURE__ */ Document_base {
21
+ export declare class ViewDocument extends /* #__PURE__ */ ViewDocument_base {
22
22
  /**
23
23
  * Selection done on this document.
24
24
  */
25
- readonly selection: DocumentSelection;
25
+ readonly selection: ViewDocumentSelection;
26
26
  /**
27
- * Roots of the view tree. Collection of the {@link module:engine/view/element~Element view elements}.
27
+ * Roots of the view tree. Collection of the {@link module:engine/view/element~ViewElement view elements}.
28
28
  *
29
- * View roots are created as a result of binding between {@link module:engine/view/document~Document#roots} and
30
- * {@link module:engine/model/document~Document#roots} and this is handled by
29
+ * View roots are created as a result of binding between {@link module:engine/view/document~ViewDocument#roots} and
30
+ * {@link module:engine/model/document~ModelDocument#roots} and this is handled by
31
31
  * {@link module:engine/controller/editingcontroller~EditingController}, so to create view root we need to create
32
- * model root using {@link module:engine/model/document~Document#createRoot}.
32
+ * model root using {@link module:engine/model/document~ModelDocument#createRoot}.
33
33
  */
34
- readonly roots: Collection<RootEditableElement>;
34
+ readonly roots: Collection<ViewRootEditableElement>;
35
35
  /**
36
36
  * The styles processor instance used by this document when normalizing styles.
37
37
  */
@@ -85,19 +85,19 @@ export default class Document extends /* #__PURE__ */ Document_base {
85
85
  */
86
86
  constructor(stylesProcessor: StylesProcessor);
87
87
  /**
88
- * Gets a {@link module:engine/view/document~Document#roots view root element} with the specified name. If the name is not
88
+ * Gets a {@link module:engine/view/document~ViewDocument#roots view root element} with the specified name. If the name is not
89
89
  * specific "main" root is returned.
90
90
  *
91
91
  * @param name Name of the root.
92
92
  * @returns The view root element with the specified name or null when there is no root of given name.
93
93
  */
94
- getRoot(name?: string): RootEditableElement | null;
94
+ getRoot(name?: string): ViewRootEditableElement | null;
95
95
  /**
96
96
  * Allows registering post-fixer callbacks. A post-fixers mechanism allows to update the view tree just before it is rendered
97
97
  * to the DOM.
98
98
  *
99
99
  * Post-fixers are executed right after all changes from the outermost change block were applied but
100
- * before the {@link module:engine/view/view~View#event:render render event} is fired. If a post-fixer callback made
100
+ * before the {@link module:engine/view/view~EditingView#event:render render event} is fired. If a post-fixer callback made
101
101
  * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
102
102
  * not be fixed in the new document tree state.
103
103
  *
@@ -107,7 +107,7 @@ export default class Document extends /* #__PURE__ */ Document_base {
107
107
  * The types of changes which should be safe:
108
108
  *
109
109
  * * adding or removing attribute from elements,
110
- * * changes inside of {@link module:engine/view/uielement~UIElement UI elements},
110
+ * * changes inside of {@link module:engine/view/uielement~ViewUIElement UI elements},
111
111
  * * {@link module:engine/controller/editingcontroller~EditingController#reconvertItem marking some of the model elements to be
112
112
  * re-converted}.
113
113
  *
@@ -116,7 +116,7 @@ export default class Document extends /* #__PURE__ */ Document_base {
116
116
  * * you should not add or remove nor wrap or unwrap any view elements,
117
117
  * * you should not change the editor data model in a view post-fixer.
118
118
  *
119
- * As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
119
+ * As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~ViewDowncastWriter downcast writer}.
120
120
  *
121
121
  * Typically, a post-fixer will look like this:
122
122
  *
@@ -137,10 +137,10 @@ export default class Document extends /* #__PURE__ */ Document_base {
137
137
  * That is because adding a post-fixer does not execute it.
138
138
  * The post-fixer will be executed as soon as any change in the document needs to cause its rendering.
139
139
  * If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling
140
- * {@link module:engine/view/view~View#forceRender `view.forceRender()`}.
140
+ * {@link module:engine/view/view~EditingView#forceRender `view.forceRender()`}.
141
141
  *
142
142
  * If you need to register a callback which is executed when DOM elements are already updated,
143
- * use {@link module:engine/view/view~View#event:render render event}.
143
+ * use {@link module:engine/view/view~EditingView#event:render render event}.
144
144
  */
145
145
  registerPostFixer(postFixer: ViewDocumentPostFixer): void;
146
146
  /**
@@ -152,14 +152,14 @@ export default class Document extends /* #__PURE__ */ Document_base {
152
152
  *
153
153
  * @internal
154
154
  */
155
- _callPostFixers(writer: DowncastWriter): void;
155
+ _callPostFixers(writer: ViewDowncastWriter): void;
156
156
  }
157
157
  /**
158
158
  * Document PostFixer.
159
159
  *
160
- * @see module:engine/view/document~Document#registerPostFixer
160
+ * @see module:engine/view/document~ViewDocument#registerPostFixer
161
161
  */
162
- export type ViewDocumentPostFixer = (writer: DowncastWriter) => boolean;
162
+ export type ViewDocumentPostFixer = (writer: ViewDowncastWriter) => boolean;
163
163
  /**
164
164
  * Enum representing type of the change.
165
165
  *
@@ -169,13 +169,13 @@ export type ViewDocumentPostFixer = (writer: DowncastWriter) => boolean;
169
169
  * * `attributes` - for element attributes changes,
170
170
  * * `text` - for text nodes changes.
171
171
  */
172
- export type ChangeType = 'children' | 'attributes' | 'text';
172
+ export type ViewDocumentChangeType = 'children' | 'attributes' | 'text';
173
173
  /**
174
174
  * Event fired whenever document content layout changes. It is fired whenever content is
175
- * {@link module:engine/view/view~View#event:render rendered}, but should be also fired by observers in case of
175
+ * {@link module:engine/view/view~EditingView#event:render rendered}, but should be also fired by observers in case of
176
176
  * other actions which may change layout, for instance when image loads.
177
177
  *
178
- * @eventName ~Document#layoutChanged
178
+ * @eventName ~ViewDocument#layoutChanged
179
179
  */
180
180
  export type ViewDocumentLayoutChangedEvent = {
181
181
  name: 'layoutChanged';