@ckeditor/ckeditor5-engine 36.0.0 → 37.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 (201) hide show
  1. package/README.md +1 -1
  2. package/package.json +24 -23
  3. package/src/controller/datacontroller.d.ts +331 -0
  4. package/src/controller/datacontroller.js +62 -109
  5. package/src/controller/editingcontroller.d.ts +98 -0
  6. package/src/controller/editingcontroller.js +22 -46
  7. package/src/conversion/conversion.d.ts +476 -0
  8. package/src/conversion/conversion.js +328 -347
  9. package/src/conversion/conversionhelpers.d.ts +26 -0
  10. package/src/conversion/conversionhelpers.js +1 -5
  11. package/src/conversion/downcastdispatcher.d.ts +547 -0
  12. package/src/conversion/downcastdispatcher.js +74 -152
  13. package/src/conversion/downcasthelpers.d.ts +1226 -0
  14. package/src/conversion/downcasthelpers.js +843 -762
  15. package/src/conversion/mapper.d.ts +499 -0
  16. package/src/conversion/mapper.js +84 -99
  17. package/src/conversion/modelconsumable.d.ts +201 -0
  18. package/src/conversion/modelconsumable.js +96 -99
  19. package/src/conversion/upcastdispatcher.d.ts +492 -0
  20. package/src/conversion/upcastdispatcher.js +73 -100
  21. package/src/conversion/upcasthelpers.d.ts +499 -0
  22. package/src/conversion/upcasthelpers.js +406 -373
  23. package/src/conversion/viewconsumable.d.ts +177 -0
  24. package/src/conversion/viewconsumable.js +157 -162
  25. package/src/dataprocessor/basichtmlwriter.d.ts +18 -0
  26. package/src/dataprocessor/basichtmlwriter.js +0 -9
  27. package/src/dataprocessor/dataprocessor.d.ts +61 -0
  28. package/src/dataprocessor/htmldataprocessor.d.ts +76 -0
  29. package/src/dataprocessor/htmldataprocessor.js +6 -28
  30. package/src/dataprocessor/htmlwriter.d.ts +16 -0
  31. package/src/dataprocessor/xmldataprocessor.d.ts +90 -0
  32. package/src/dataprocessor/xmldataprocessor.js +8 -40
  33. package/src/dev-utils/model.d.ts +124 -0
  34. package/src/dev-utils/model.js +41 -38
  35. package/src/dev-utils/operationreplayer.d.ts +51 -0
  36. package/src/dev-utils/operationreplayer.js +6 -14
  37. package/src/dev-utils/utils.d.ts +37 -0
  38. package/src/dev-utils/utils.js +5 -18
  39. package/src/dev-utils/view.d.ts +319 -0
  40. package/src/dev-utils/view.js +205 -226
  41. package/src/index.d.ts +105 -0
  42. package/src/index.js +1 -0
  43. package/src/model/batch.d.ts +106 -0
  44. package/src/model/differ.d.ts +329 -0
  45. package/src/model/document.d.ts +245 -0
  46. package/src/model/document.js +1 -1
  47. package/src/model/documentfragment.d.ts +196 -0
  48. package/src/model/documentfragment.js +2 -2
  49. package/src/model/documentselection.d.ts +420 -0
  50. package/src/model/element.d.ts +165 -0
  51. package/src/model/history.d.ts +114 -0
  52. package/src/model/item.d.ts +14 -0
  53. package/src/model/liveposition.d.ts +77 -0
  54. package/src/model/liverange.d.ts +102 -0
  55. package/src/model/markercollection.d.ts +335 -0
  56. package/src/model/model.d.ts +812 -0
  57. package/src/model/model.js +59 -30
  58. package/src/model/node.d.ts +256 -0
  59. package/src/model/nodelist.d.ts +91 -0
  60. package/src/model/operation/attributeoperation.d.ts +98 -0
  61. package/src/model/operation/detachoperation.d.ts +55 -0
  62. package/src/model/operation/insertoperation.d.ts +85 -0
  63. package/src/model/operation/markeroperation.d.ts +86 -0
  64. package/src/model/operation/mergeoperation.d.ts +95 -0
  65. package/src/model/operation/moveoperation.d.ts +91 -0
  66. package/src/model/operation/nooperation.d.ts +33 -0
  67. package/src/model/operation/operation.d.ts +89 -0
  68. package/src/model/operation/operationfactory.d.ts +18 -0
  69. package/src/model/operation/renameoperation.d.ts +78 -0
  70. package/src/model/operation/rootattributeoperation.d.ts +97 -0
  71. package/src/model/operation/rootattributeoperation.js +1 -1
  72. package/src/model/operation/splitoperation.d.ts +104 -0
  73. package/src/model/operation/transform.d.ts +100 -0
  74. package/src/model/operation/utils.d.ts +71 -0
  75. package/src/model/position.d.ts +539 -0
  76. package/src/model/position.js +1 -1
  77. package/src/model/range.d.ts +458 -0
  78. package/src/model/range.js +1 -1
  79. package/src/model/rootelement.d.ts +40 -0
  80. package/src/model/schema.d.ts +1176 -0
  81. package/src/model/schema.js +15 -15
  82. package/src/model/selection.d.ts +472 -0
  83. package/src/model/text.d.ts +66 -0
  84. package/src/model/text.js +0 -2
  85. package/src/model/textproxy.d.ts +144 -0
  86. package/src/model/treewalker.d.ts +186 -0
  87. package/src/model/treewalker.js +19 -10
  88. package/src/model/typecheckable.d.ts +255 -0
  89. package/src/model/utils/autoparagraphing.d.ts +37 -0
  90. package/src/model/utils/deletecontent.d.ts +58 -0
  91. package/src/model/utils/findoptimalinsertionrange.d.ts +32 -0
  92. package/src/model/utils/getselectedcontent.d.ts +30 -0
  93. package/src/model/utils/insertcontent.d.ts +46 -0
  94. package/src/model/utils/insertcontent.js +2 -12
  95. package/src/model/utils/insertobject.d.ts +44 -0
  96. package/src/model/utils/insertobject.js +3 -14
  97. package/src/model/utils/modifyselection.d.ts +48 -0
  98. package/src/model/utils/selection-post-fixer.d.ts +65 -0
  99. package/src/model/writer.d.ts +726 -0
  100. package/src/model/writer.js +6 -4
  101. package/src/view/attributeelement.d.ts +108 -0
  102. package/src/view/attributeelement.js +25 -69
  103. package/src/view/containerelement.d.ts +49 -0
  104. package/src/view/containerelement.js +10 -43
  105. package/src/view/datatransfer.d.ts +75 -0
  106. package/src/view/datatransfer.js +24 -27
  107. package/src/view/document.d.ts +184 -0
  108. package/src/view/document.js +15 -84
  109. package/src/view/documentfragment.d.ts +150 -0
  110. package/src/view/documentfragment.js +40 -81
  111. package/src/view/documentselection.d.ts +219 -0
  112. package/src/view/documentselection.js +75 -121
  113. package/src/view/domconverter.d.ts +620 -0
  114. package/src/view/domconverter.js +159 -276
  115. package/src/view/downcastwriter.d.ts +804 -0
  116. package/src/view/downcastwriter.js +336 -380
  117. package/src/view/editableelement.d.ts +52 -0
  118. package/src/view/editableelement.js +9 -49
  119. package/src/view/element.d.ts +466 -0
  120. package/src/view/element.js +150 -222
  121. package/src/view/elementdefinition.d.ts +87 -0
  122. package/src/view/emptyelement.d.ts +41 -0
  123. package/src/view/emptyelement.js +11 -44
  124. package/src/view/filler.d.ts +111 -0
  125. package/src/view/filler.js +24 -21
  126. package/src/view/item.d.ts +14 -0
  127. package/src/view/matcher.d.ts +486 -0
  128. package/src/view/matcher.js +247 -218
  129. package/src/view/node.d.ts +160 -0
  130. package/src/view/node.js +26 -100
  131. package/src/view/observer/arrowkeysobserver.d.ts +41 -0
  132. package/src/view/observer/arrowkeysobserver.js +0 -13
  133. package/src/view/observer/bubblingemittermixin.d.ts +166 -0
  134. package/src/view/observer/bubblingemittermixin.js +36 -25
  135. package/src/view/observer/bubblingeventinfo.d.ts +47 -0
  136. package/src/view/observer/bubblingeventinfo.js +3 -29
  137. package/src/view/observer/clickobserver.d.ts +43 -0
  138. package/src/view/observer/clickobserver.js +9 -19
  139. package/src/view/observer/compositionobserver.d.ts +82 -0
  140. package/src/view/observer/compositionobserver.js +13 -42
  141. package/src/view/observer/domeventdata.d.ts +50 -0
  142. package/src/view/observer/domeventdata.js +5 -30
  143. package/src/view/observer/domeventobserver.d.ts +69 -0
  144. package/src/view/observer/domeventobserver.js +19 -21
  145. package/src/view/observer/fakeselectionobserver.d.ts +46 -0
  146. package/src/view/observer/fakeselectionobserver.js +2 -15
  147. package/src/view/observer/focusobserver.d.ts +82 -0
  148. package/src/view/observer/focusobserver.js +14 -40
  149. package/src/view/observer/inputobserver.d.ts +86 -0
  150. package/src/view/observer/inputobserver.js +18 -64
  151. package/src/view/observer/keyobserver.d.ts +67 -0
  152. package/src/view/observer/keyobserver.js +8 -42
  153. package/src/view/observer/mouseobserver.d.ts +89 -0
  154. package/src/view/observer/mouseobserver.js +8 -28
  155. package/src/view/observer/mutationobserver.d.ts +82 -0
  156. package/src/view/observer/mutationobserver.js +7 -37
  157. package/src/view/observer/observer.d.ts +84 -0
  158. package/src/view/observer/observer.js +12 -25
  159. package/src/view/observer/selectionobserver.d.ts +143 -0
  160. package/src/view/observer/selectionobserver.js +9 -99
  161. package/src/view/observer/tabobserver.d.ts +42 -0
  162. package/src/view/observer/tabobserver.js +0 -14
  163. package/src/view/placeholder.d.ts +85 -0
  164. package/src/view/placeholder.js +26 -43
  165. package/src/view/position.d.ts +189 -0
  166. package/src/view/position.js +36 -83
  167. package/src/view/range.d.ts +279 -0
  168. package/src/view/range.js +79 -122
  169. package/src/view/rawelement.d.ts +73 -0
  170. package/src/view/rawelement.js +34 -48
  171. package/src/view/renderer.d.ts +265 -0
  172. package/src/view/renderer.js +105 -193
  173. package/src/view/rooteditableelement.d.ts +41 -0
  174. package/src/view/rooteditableelement.js +12 -40
  175. package/src/view/selection.d.ts +375 -0
  176. package/src/view/selection.js +79 -153
  177. package/src/view/styles/background.d.ts +33 -0
  178. package/src/view/styles/background.js +14 -12
  179. package/src/view/styles/border.d.ts +43 -0
  180. package/src/view/styles/border.js +58 -48
  181. package/src/view/styles/margin.d.ts +29 -0
  182. package/src/view/styles/margin.js +13 -11
  183. package/src/view/styles/padding.d.ts +29 -0
  184. package/src/view/styles/padding.js +13 -11
  185. package/src/view/styles/utils.d.ts +93 -0
  186. package/src/view/styles/utils.js +22 -48
  187. package/src/view/stylesmap.d.ts +675 -0
  188. package/src/view/stylesmap.js +249 -244
  189. package/src/view/text.d.ts +74 -0
  190. package/src/view/text.js +16 -46
  191. package/src/view/textproxy.d.ts +97 -0
  192. package/src/view/textproxy.js +10 -59
  193. package/src/view/treewalker.d.ts +195 -0
  194. package/src/view/treewalker.js +43 -106
  195. package/src/view/typecheckable.d.ts +401 -0
  196. package/src/view/uielement.d.ts +96 -0
  197. package/src/view/uielement.js +28 -62
  198. package/src/view/upcastwriter.d.ts +328 -0
  199. package/src/view/upcastwriter.js +124 -134
  200. package/src/view/view.d.ts +327 -0
  201. package/src/view/view.js +79 -150
@@ -0,0 +1,97 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module engine/model/operation/rootattributeoperation
7
+ */
8
+ import Operation from './operation';
9
+ import type Document from '../document';
10
+ import type RootElement from '../rootelement';
11
+ /**
12
+ * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.
13
+ *
14
+ * This operation is needed, because root elements can't be changed through
15
+ * {@link module:engine/model/operation/attributeoperation~AttributeOperation}.
16
+ * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}
17
+ * requires a range to change and root element can't
18
+ * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.
19
+ * {@link module:engine/model/position~Position} can't be created before a root element.
20
+ */
21
+ export default class RootAttributeOperation extends Operation {
22
+ /**
23
+ * Root element to change.
24
+ *
25
+ * @readonly
26
+ */
27
+ root: RootElement;
28
+ /**
29
+ * Key of an attribute to change or remove.
30
+ *
31
+ * @readonly
32
+ */
33
+ key: string;
34
+ /**
35
+ * Old value of the attribute with given key or `null` if adding a new attribute.
36
+ *
37
+ * @readonly
38
+ */
39
+ oldValue: unknown;
40
+ /**
41
+ * New value to set for the attribute. If `null`, then the operation just removes the attribute.
42
+ *
43
+ * @readonly
44
+ */
45
+ newValue: unknown;
46
+ /**
47
+ * Creates an operation that changes, removes or adds attributes on root element.
48
+ *
49
+ * @see module:engine/model/operation/attributeoperation~AttributeOperation
50
+ * @param root Root element to change.
51
+ * @param key Key of an attribute to change or remove.
52
+ * @param oldValue Old value of the attribute with given key or `null` if adding a new attribute.
53
+ * @param newValue New value to set for the attribute. If `null`, then the operation just removes the attribute.
54
+ * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation
55
+ * can be applied or `null` if the operation operates on detached (non-document) tree.
56
+ */
57
+ constructor(root: RootElement, key: string, oldValue: unknown, newValue: unknown, baseVersion: number | null);
58
+ /**
59
+ * @inheritDoc
60
+ */
61
+ get type(): 'addRootAttribute' | 'removeRootAttribute' | 'changeRootAttribute';
62
+ /**
63
+ * Creates and returns an operation that has the same parameters as this operation.
64
+ *
65
+ * @returns Clone of this operation.
66
+ */
67
+ clone(): RootAttributeOperation;
68
+ /**
69
+ * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
70
+ */
71
+ getReversed(): Operation;
72
+ /**
73
+ * @inheritDoc
74
+ * @internal
75
+ */
76
+ _validate(): void;
77
+ /**
78
+ * @inheritDoc
79
+ * @internal
80
+ */
81
+ _execute(): void;
82
+ /**
83
+ * @inheritDoc
84
+ */
85
+ toJSON(): unknown;
86
+ /**
87
+ * @inheritDoc
88
+ */
89
+ static get className(): string;
90
+ /**
91
+ * Creates RootAttributeOperation object from deserilized object, i.e. from parsed JSON string.
92
+ *
93
+ * @param json Deserialized JSON object.
94
+ * @param document Document on which this operation will be applied.
95
+ */
96
+ static fromJSON(json: any, document: Document): RootAttributeOperation;
97
+ }
@@ -11,7 +11,7 @@ import { CKEditorError } from '@ckeditor/ckeditor5-utils';
11
11
  * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.
12
12
  *
13
13
  * This operation is needed, because root elements can't be changed through
14
- * @link module:engine/model/operation/attributeoperation~AttributeOperation}.
14
+ * {@link module:engine/model/operation/attributeoperation~AttributeOperation}.
15
15
  * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}
16
16
  * requires a range to change and root element can't
17
17
  * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.
@@ -0,0 +1,104 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module engine/model/operation/splitoperation
7
+ */
8
+ import Operation from './operation';
9
+ import Position from '../position';
10
+ import Range from '../range';
11
+ import type Document from '../document';
12
+ /**
13
+ * Operation to split {@link module:engine/model/element~Element an element} at given
14
+ * {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,
15
+ * both containing a part of the element's original content.
16
+ */
17
+ export default class SplitOperation extends Operation {
18
+ /**
19
+ * Position at which an element should be split.
20
+ */
21
+ splitPosition: Position;
22
+ /**
23
+ * Total offset size of elements that are in the split element after `position`.
24
+ */
25
+ howMany: number;
26
+ /**
27
+ * Position at which the clone of split element (or element from graveyard) will be inserted.
28
+ */
29
+ insertionPosition: Position;
30
+ /**
31
+ * Position in the graveyard root before the element which should be used as a parent of the nodes after `position`.
32
+ * If it is not set, a copy of the the `position` parent will be used.
33
+ *
34
+ * The default behavior is to clone the split element. Element from graveyard is used during undo.
35
+ */
36
+ graveyardPosition: Position | null;
37
+ /**
38
+ * Creates a split operation.
39
+ *
40
+ * @param splitPosition Position at which an element should be split.
41
+ * @param howMany Total offset size of elements that are in the split element after `position`.
42
+ * @param insertionPosition Position at which the clone of split element (or element from graveyard) will be inserted.
43
+ * @param graveyardPosition Position in the graveyard root before the element which
44
+ * should be used as a parent of the nodes after `position`. If it is not set, a copy of the the `position` parent will be used.
45
+ * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation
46
+ * can be applied or `null` if the operation operates on detached (non-document) tree.
47
+ */
48
+ constructor(splitPosition: Position, howMany: number, insertionPosition: Position, graveyardPosition: Position | null, baseVersion: number | null);
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ get type(): 'split';
53
+ /**
54
+ * Position inside the new clone of a split element.
55
+ *
56
+ * This is a position where nodes that are after the split position will be moved to.
57
+ */
58
+ get moveTargetPosition(): Position;
59
+ /**
60
+ * Artificial range that contains all the nodes from the split element that will be moved to the new element.
61
+ * The range starts at {@link ~#splitPosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
62
+ */
63
+ get movedRange(): Range;
64
+ /**
65
+ * Creates and returns an operation that has the same parameters as this operation.
66
+ *
67
+ * @returns Clone of this operation.
68
+ */
69
+ clone(): SplitOperation;
70
+ /**
71
+ * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
72
+ */
73
+ getReversed(): Operation;
74
+ /**
75
+ * @inheritDoc
76
+ * @internal
77
+ */
78
+ _validate(): void;
79
+ /**
80
+ * @inheritDoc
81
+ * @internal
82
+ */
83
+ _execute(): void;
84
+ /**
85
+ * @inheritDoc
86
+ */
87
+ toJSON(): unknown;
88
+ /**
89
+ * @inheritDoc
90
+ */
91
+ static get className(): string;
92
+ /**
93
+ * Helper function that returns a default insertion position basing on given `splitPosition`. The default insertion
94
+ * position is after the split element.
95
+ */
96
+ static getInsertionPosition(splitPosition: Position): Position;
97
+ /**
98
+ * Creates `SplitOperation` object from deserilized object, i.e. from parsed JSON string.
99
+ *
100
+ * @param json Deserialized JSON object.
101
+ * @param document Document on which this operation will be applied.
102
+ */
103
+ static fromJSON(json: any, document: Document): SplitOperation;
104
+ }
@@ -0,0 +1,100 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type Operation from './operation';
6
+ import type Document from '../document';
7
+ /**
8
+ * Transforms operation `a` by operation `b`.
9
+ *
10
+ * @param a Operation to be transformed.
11
+ * @param b Operation to transform by.
12
+ * @param context Transformation context for this transformation.
13
+ * @returns Transformation result.
14
+ */
15
+ export declare function transform(a: Operation, b: Operation, context?: TransformationContext): Array<Operation>;
16
+ /**
17
+ * Performs a transformation of two sets of operations - `operationsA` and `operationsB`. The transformation is two-way -
18
+ * both transformed `operationsA` and transformed `operationsB` are returned.
19
+ *
20
+ * Note, that the first operation in each set should base on the same document state (
21
+ * {@link module:engine/model/document~Document#version document version}).
22
+ *
23
+ * It is assumed that `operationsA` are "more important" during conflict resolution between two operations.
24
+ *
25
+ * New copies of both passed arrays and operations inside them are returned. Passed arguments are not altered.
26
+ *
27
+ * Base versions of the transformed operations sets are updated accordingly. For example, assume that base versions are `4`
28
+ * and there are `3` operations in `operationsA` and `5` operations in `operationsB`. Then:
29
+ *
30
+ * * transformed `operationsA` will start from base version `9` (`4` base version + `5` operations B),
31
+ * * transformed `operationsB` will start from base version `7` (`4` base version + `3` operations A).
32
+ *
33
+ * If no operation was broken into two during transformation, then both sets will end up with an operation that bases on version `11`:
34
+ *
35
+ * * transformed `operationsA` start from `9` and there are `3` of them, so the last will have `baseVersion` equal to `11`,
36
+ * * transformed `operationsB` start from `7` and there are `5` of them, so the last will have `baseVersion` equal to `11`.
37
+ *
38
+ * @param operationsA
39
+ * @param operationsB
40
+ * @param options Additional transformation options.
41
+ * @param options.document Document which the operations change.
42
+ * @param options.useRelations Whether during transformation relations should be used (used during undo for better conflict resolution).
43
+ * @param options.padWithNoOps Whether additional {@link module:engine/model/operation/nooperation~NoOperation}s
44
+ * should be added to the transformation results to force the same last base version for both transformed sets (in case
45
+ * if some operations got broken into multiple operations during transformation).
46
+ * @param options.forceWeakRemove If set to `false`, remove operation will be always stronger than move operation,
47
+ * so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.
48
+ * @returns Transformation result.
49
+ */
50
+ export declare function transformSets(operationsA: Array<Operation>, operationsB: Array<Operation>, options: {
51
+ document: Document;
52
+ useRelations?: boolean;
53
+ padWithNoOps?: boolean;
54
+ forceWeakRemove?: boolean;
55
+ }): TransformSetsResult;
56
+ /**
57
+ * The result of {@link module:engine/model/operation/transform~transformSets}.
58
+ */
59
+ export interface TransformSetsResult {
60
+ /**
61
+ * Transformed `operationsA`.
62
+ */
63
+ operationsA: Array<Operation>;
64
+ /**
65
+ * Transformed `operationsB`.
66
+ */
67
+ operationsB: Array<Operation>;
68
+ /**
69
+ * A map that links transformed operations to original operations. The keys are the transformed
70
+ * operations and the values are the original operations from the input (`operationsA` and `operationsB`).
71
+ */
72
+ originalOperations: Map<Operation, Operation>;
73
+ }
74
+ /**
75
+ * Holds additional contextual information about a transformed pair of operations (`a` and `b`). Those information
76
+ * can be used for better conflict resolving.
77
+ */
78
+ export type TransformationContext = {
79
+ /**
80
+ * Whether `a` is strong operation in this transformation, or weak.
81
+ */
82
+ aIsStrong?: boolean;
83
+ /**
84
+ * Whether `a` operation was undone.
85
+ */
86
+ aWasUndone?: boolean;
87
+ /**
88
+ * Whether `b` operation was undone.
89
+ */
90
+ bWasUndone?: boolean;
91
+ /**
92
+ * The relation between `a` operation and an operation undone by `b` operation.
93
+ */
94
+ abRelation?: any;
95
+ /**
96
+ * The relation between `b` operation and an operation undone by `a` operation.
97
+ */
98
+ baRelation?: any;
99
+ forceWeakRemove?: boolean;
100
+ };
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module engine/model/operation/utils
7
+ */
8
+ import Node from '../node';
9
+ import Range from '../range';
10
+ import type DocumentFragment from '../documentfragment';
11
+ import type Item from '../item';
12
+ import type NodeList from '../nodelist';
13
+ import type Position from '../position';
14
+ /**
15
+ * Inserts given nodes at given position.
16
+ *
17
+ * @internal
18
+ * @param position Position at which nodes should be inserted.
19
+ * @param normalizedNodes Nodes to insert.
20
+ * @returns Range spanning over inserted elements.
21
+ */
22
+ export declare function _insert(position: Position, nodes: NodeSet): Range;
23
+ /**
24
+ * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
25
+ *
26
+ * @internal
27
+ * @param range Range containing nodes to remove.
28
+ */
29
+ export declare function _remove(this: any, range: Range): Array<Node>;
30
+ /**
31
+ * Moves nodes in given range to given target position. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.
32
+ *
33
+ * @internal
34
+ * @param sourceRange Range containing nodes to move.
35
+ * @param targetPosition Position to which nodes should be moved.
36
+ * @returns Range containing moved nodes.
37
+ */
38
+ export declare function _move(this: any, sourceRange: Range, targetPosition: Position): Range;
39
+ /**
40
+ * Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.
41
+ *
42
+ * @internal
43
+ * @param range Range containing nodes that should have the attribute set. Must be a flat range.
44
+ * @param key Key of attribute to set.
45
+ * @param value Attribute value.
46
+ */
47
+ export declare function _setAttribute(range: Range, key: string, value: unknown): void;
48
+ /**
49
+ * Normalizes given object or an array of objects to an array of {@link module:engine/model/node~Node nodes}. See
50
+ * {@link module:engine/model/node~NodeSet NodeSet} for details on how normalization is performed.
51
+ *
52
+ * @internal
53
+ * @param nodes Objects to normalize.
54
+ * @returns Normalized nodes.
55
+ */
56
+ export declare function _normalizeNodes(nodes: NodeSet): Array<Node>;
57
+ /**
58
+ * Value that can be normalized to an array of {@link module:engine/model/node~Node nodes}.
59
+ *
60
+ * Non-arrays are normalized as follows:
61
+ * * {@link module:engine/model/node~Node Node} is left as is,
62
+ * * {@link module:engine/model/textproxy~TextProxy TextProxy} and `string` are normalized to {@link module:engine/model/text~Text Text},
63
+ * * {@link module:engine/model/nodelist~NodeList NodeList} is normalized to an array containing all nodes that are in that node list,
64
+ * * {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment} is normalized to an array containing all of it's
65
+ * * children.
66
+ *
67
+ * Arrays are processed item by item like non-array values and flattened to one array. Normalization always results in
68
+ * a flat array of {@link module:engine/model/node~Node nodes}. Consecutive text nodes (or items normalized to text nodes) will be
69
+ * merged if they have same attributes.
70
+ */
71
+ export type NodeSet = Item | string | NodeList | DocumentFragment | Iterable<Item | string | NodeList | DocumentFragment>;