@ckeditor/ckeditor5-engine 45.2.1 → 46.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2563 -2257
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/controller/datacontroller.d.ts +33 -32
- package/src/controller/datacontroller.js +29 -28
- package/src/controller/editingcontroller.d.ts +8 -8
- package/src/controller/editingcontroller.js +10 -10
- package/src/conversion/conversion.d.ts +18 -19
- package/src/conversion/conversion.js +4 -4
- package/src/conversion/conversionhelpers.d.ts +1 -1
- package/src/conversion/conversionhelpers.js +1 -1
- package/src/conversion/downcastdispatcher.d.ts +63 -69
- package/src/conversion/downcastdispatcher.js +16 -16
- package/src/conversion/downcasthelpers.d.ts +94 -83
- package/src/conversion/downcasthelpers.js +63 -53
- package/src/conversion/mapper.d.ts +27 -27
- package/src/conversion/mapper.js +15 -15
- package/src/conversion/modelconsumable.d.ts +26 -26
- package/src/conversion/modelconsumable.js +23 -23
- package/src/conversion/upcastdispatcher.d.ts +33 -32
- package/src/conversion/upcastdispatcher.js +19 -19
- package/src/conversion/upcasthelpers.d.ts +46 -38
- package/src/conversion/upcasthelpers.js +33 -24
- package/src/conversion/viewconsumable.d.ts +50 -45
- package/src/conversion/viewconsumable.js +32 -27
- package/src/dataprocessor/basichtmlwriter.d.ts +4 -2
- package/src/dataprocessor/basichtmlwriter.js +3 -1
- package/src/dataprocessor/dataprocessor.d.ts +7 -6
- package/src/dataprocessor/htmldataprocessor.d.ts +10 -10
- package/src/dataprocessor/htmldataprocessor.js +6 -6
- package/src/dataprocessor/htmlwriter.d.ts +1 -1
- package/src/dataprocessor/xmldataprocessor.d.ts +10 -10
- package/src/dataprocessor/xmldataprocessor.js +6 -6
- package/src/dev-utils/model.d.ts +25 -26
- package/src/dev-utils/model.js +35 -36
- package/src/dev-utils/operationreplayer.d.ts +5 -3
- package/src/dev-utils/operationreplayer.js +4 -2
- package/src/dev-utils/utils.d.ts +8 -0
- package/src/dev-utils/utils.js +8 -0
- package/src/dev-utils/view.d.ts +66 -63
- package/src/dev-utils/view.js +144 -134
- package/src/index.d.ts +135 -106
- package/src/index.js +120 -71
- package/src/legacyerrors.d.ts +5 -0
- package/src/legacyerrors.js +17 -0
- package/src/model/batch.d.ts +2 -15
- package/src/model/batch.js +1 -23
- package/src/model/differ.d.ts +54 -31
- package/src/model/differ.js +15 -15
- package/src/model/document.d.ts +31 -31
- package/src/model/document.js +13 -13
- package/src/model/documentfragment.d.ts +45 -45
- package/src/model/documentfragment.js +40 -40
- package/src/model/documentselection.d.ts +92 -92
- package/src/model/documentselection.js +71 -70
- package/src/model/element.d.ts +31 -31
- package/src/model/element.js +29 -29
- package/src/model/history.d.ts +3 -3
- package/src/model/history.js +2 -2
- package/src/model/item.d.ts +4 -5
- package/src/model/liveposition.d.ts +31 -31
- package/src/model/liveposition.js +18 -18
- package/src/model/liverange.d.ts +42 -38
- package/src/model/liverange.js +17 -16
- package/src/model/markercollection.d.ts +41 -40
- package/src/model/markercollection.js +22 -20
- package/src/model/model.d.ts +82 -81
- package/src/model/model.js +54 -54
- package/src/model/node.d.ts +48 -48
- package/src/model/node.js +31 -31
- package/src/model/nodelist.d.ts +17 -17
- package/src/model/nodelist.js +11 -11
- package/src/model/operation/attributeoperation.d.ts +10 -10
- package/src/model/operation/attributeoperation.js +7 -7
- package/src/model/operation/detachoperation.d.ts +11 -9
- package/src/model/operation/detachoperation.js +8 -6
- package/src/model/operation/insertoperation.d.ts +13 -13
- package/src/model/operation/insertoperation.js +15 -15
- package/src/model/operation/markeroperation.d.ts +12 -12
- package/src/model/operation/markeroperation.js +5 -5
- package/src/model/operation/mergeoperation.d.ts +16 -16
- package/src/model/operation/mergeoperation.js +18 -18
- package/src/model/operation/moveoperation.d.ts +16 -16
- package/src/model/operation/moveoperation.js +18 -15
- package/src/model/operation/nooperation.d.ts +4 -4
- package/src/model/operation/nooperation.js +2 -2
- package/src/model/operation/operation.d.ts +10 -10
- package/src/model/operation/operation.js +5 -5
- package/src/model/operation/operationfactory.d.ts +4 -4
- package/src/model/operation/operationfactory.js +12 -12
- package/src/model/operation/renameoperation.d.ts +10 -10
- package/src/model/operation/renameoperation.js +7 -7
- package/src/model/operation/rootattributeoperation.d.ts +12 -12
- package/src/model/operation/rootattributeoperation.js +8 -8
- package/src/model/operation/rootoperation.d.ts +8 -8
- package/src/model/operation/rootoperation.js +3 -3
- package/src/model/operation/splitoperation.d.ts +17 -17
- package/src/model/operation/splitoperation.js +19 -19
- package/src/model/operation/transform.d.ts +11 -8
- package/src/model/operation/transform.js +66 -49
- package/src/model/operation/utils.d.ts +24 -23
- package/src/model/operation/utils.js +20 -20
- package/src/model/position.d.ts +101 -97
- package/src/model/position.js +69 -64
- package/src/model/range.d.ts +90 -90
- package/src/model/range.js +87 -87
- package/src/model/rootelement.d.ts +11 -11
- package/src/model/rootelement.js +9 -9
- package/src/model/schema.d.ts +158 -154
- package/src/model/schema.js +93 -90
- package/src/model/selection.d.ts +73 -73
- package/src/model/selection.js +62 -62
- package/src/model/text.d.ts +11 -10
- package/src/model/text.js +11 -10
- package/src/model/textproxy.d.ts +39 -38
- package/src/model/textproxy.js +31 -30
- package/src/model/treewalker.d.ts +37 -37
- package/src/model/treewalker.js +14 -14
- package/src/model/typecheckable.d.ts +45 -45
- package/src/model/typecheckable.js +1 -1
- package/src/model/utils/autoparagraphing.d.ts +7 -7
- package/src/model/utils/deletecontent.d.ts +7 -5
- package/src/model/utils/deletecontent.js +13 -11
- package/src/model/utils/getselectedcontent.d.ts +6 -5
- package/src/model/utils/getselectedcontent.js +2 -1
- package/src/model/utils/insertcontent.d.ts +9 -8
- package/src/model/utils/insertcontent.js +41 -40
- package/src/model/utils/insertobject.d.ts +9 -9
- package/src/model/utils/insertobject.js +4 -4
- package/src/model/utils/modifyselection.d.ts +5 -4
- package/src/model/utils/modifyselection.js +12 -11
- package/src/model/utils/selection-post-fixer.d.ts +12 -8
- package/src/model/utils/selection-post-fixer.js +15 -11
- package/src/model/writer.d.ts +102 -101
- package/src/model/writer.js +99 -98
- package/src/view/attributeelement.d.ts +29 -29
- package/src/view/attributeelement.js +25 -25
- package/src/view/containerelement.d.ts +16 -15
- package/src/view/containerelement.js +15 -14
- package/src/view/datatransfer.d.ts +7 -7
- package/src/view/datatransfer.js +1 -1
- package/src/view/document.d.ts +25 -25
- package/src/view/document.js +15 -15
- package/src/view/documentfragment.d.ts +21 -21
- package/src/view/documentfragment.js +14 -14
- package/src/view/documentselection.d.ts +65 -63
- package/src/view/documentselection.js +27 -25
- package/src/view/domconverter.d.ts +96 -91
- package/src/view/domconverter.js +78 -73
- package/src/view/downcastwriter.d.ts +185 -181
- package/src/view/downcastwriter.js +222 -210
- package/src/view/editableelement.d.ts +13 -13
- package/src/view/editableelement.js +8 -8
- package/src/view/element.d.ts +75 -74
- package/src/view/element.js +58 -58
- package/src/view/elementdefinition.d.ts +3 -4
- package/src/view/emptyelement.d.ts +13 -13
- package/src/view/emptyelement.js +13 -13
- package/src/view/filler.d.ts +14 -3
- package/src/view/filler.js +12 -1
- package/src/view/item.d.ts +4 -5
- package/src/view/matcher.d.ts +22 -19
- package/src/view/matcher.js +6 -6
- package/src/view/node.d.ts +33 -33
- package/src/view/node.js +9 -9
- package/src/view/observer/arrowkeysobserver.d.ts +10 -10
- package/src/view/observer/arrowkeysobserver.js +5 -5
- package/src/view/observer/bubblingemittermixin.d.ts +5 -5
- package/src/view/observer/bubblingemittermixin.js +2 -9
- package/src/view/observer/bubblingeventinfo.d.ts +9 -9
- package/src/view/observer/bubblingeventinfo.js +1 -1
- package/src/view/observer/clickobserver.d.ts +8 -8
- package/src/view/observer/clickobserver.js +4 -4
- package/src/view/observer/compositionobserver.d.ts +19 -19
- package/src/view/observer/compositionobserver.js +6 -6
- package/src/view/observer/domeventdata.d.ts +9 -9
- package/src/view/observer/domeventdata.js +2 -2
- package/src/view/observer/domeventobserver.d.ts +3 -3
- package/src/view/observer/domeventobserver.js +5 -5
- package/src/view/observer/fakeselectionobserver.d.ts +9 -9
- package/src/view/observer/fakeselectionobserver.js +8 -8
- package/src/view/observer/focusobserver.d.ts +16 -16
- package/src/view/observer/focusobserver.js +7 -7
- package/src/view/observer/inputobserver.d.ts +18 -18
- package/src/view/observer/inputobserver.js +5 -5
- package/src/view/observer/keyobserver.d.ts +11 -11
- package/src/view/observer/keyobserver.js +3 -3
- package/src/view/observer/mouseobserver.d.ts +16 -16
- package/src/view/observer/mouseobserver.js +3 -3
- package/src/view/observer/mutationobserver.d.ts +21 -21
- package/src/view/observer/mutationobserver.js +7 -7
- package/src/view/observer/observer.d.ts +12 -12
- package/src/view/observer/observer.js +6 -6
- package/src/view/observer/selectionobserver.d.ts +33 -33
- package/src/view/observer/selectionobserver.js +14 -14
- package/src/view/observer/tabobserver.d.ts +10 -10
- package/src/view/observer/tabobserver.js +5 -5
- package/src/view/observer/touchobserver.d.ts +13 -13
- package/src/view/observer/touchobserver.js +3 -3
- package/src/view/placeholder.d.ts +21 -21
- package/src/view/placeholder.js +23 -23
- package/src/view/position.d.ts +49 -49
- package/src/view/position.js +42 -42
- package/src/view/range.d.ts +76 -74
- package/src/view/range.js +67 -65
- package/src/view/rawelement.d.ts +19 -19
- package/src/view/rawelement.js +16 -16
- package/src/view/renderer.d.ts +14 -14
- package/src/view/renderer.js +7 -7
- package/src/view/rooteditableelement.d.ts +8 -7
- package/src/view/rooteditableelement.js +7 -6
- package/src/view/selection.d.ts +66 -64
- package/src/view/selection.js +50 -48
- package/src/view/styles/background.d.ts +2 -2
- package/src/view/styles/background.js +9 -9
- package/src/view/styles/border.d.ts +2 -2
- package/src/view/styles/border.js +13 -13
- package/src/view/styles/margin.d.ts +2 -2
- package/src/view/styles/margin.js +5 -5
- package/src/view/styles/padding.d.ts +2 -2
- package/src/view/styles/padding.js +5 -5
- package/src/view/styles/utils.d.ts +24 -24
- package/src/view/styles/utils.js +25 -25
- package/src/view/stylesmap.d.ts +28 -32
- package/src/view/stylesmap.js +52 -39
- package/src/view/text.d.ts +11 -11
- package/src/view/text.js +10 -10
- package/src/view/textproxy.d.ts +33 -32
- package/src/view/textproxy.js +23 -22
- package/src/view/tokenlist.d.ts +14 -14
- package/src/view/tokenlist.js +10 -10
- package/src/view/treewalker.d.ts +42 -40
- package/src/view/treewalker.js +36 -35
- package/src/view/typecheckable.d.ts +76 -75
- package/src/view/typecheckable.js +1 -1
- package/src/view/uielement.d.ts +22 -21
- package/src/view/uielement.js +17 -16
- package/src/view/upcastwriter.d.ts +70 -70
- package/src/view/upcastwriter.js +42 -42
- package/src/view/view.d.ts +70 -69
- package/src/view/view.js +56 -55
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/insertoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import MoveOperation from './moveoperation.js';
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
|
+
import { ModelPosition } from '../position.js';
|
|
10
|
+
import { ModelNodeList } from '../nodelist.js';
|
|
11
|
+
import { MoveOperation } from './moveoperation.js';
|
|
12
12
|
import { _insert, _normalizeNodes } from './utils.js';
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import { ModelText } from '../text.js';
|
|
14
|
+
import { ModelElement } from '../element.js';
|
|
15
15
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
16
16
|
/**
|
|
17
17
|
* Operation to insert one or more nodes at given position in the model.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export class InsertOperation extends Operation {
|
|
20
20
|
/**
|
|
21
21
|
* Position of insertion.
|
|
22
22
|
*
|
|
@@ -40,14 +40,14 @@ export default class InsertOperation extends Operation {
|
|
|
40
40
|
*
|
|
41
41
|
* @param position Position of insertion.
|
|
42
42
|
* @param nodes The list of nodes to be inserted.
|
|
43
|
-
* @param baseVersion Document {@link module:engine/model/document~
|
|
43
|
+
* @param baseVersion Document {@link module:engine/model/document~ModelDocument#version} on which operation
|
|
44
44
|
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
45
45
|
*/
|
|
46
46
|
constructor(position, nodes, baseVersion) {
|
|
47
47
|
super(baseVersion);
|
|
48
48
|
this.position = position.clone();
|
|
49
49
|
this.position.stickiness = 'toNone';
|
|
50
|
-
this.nodes = new
|
|
50
|
+
this.nodes = new ModelNodeList(_normalizeNodes(nodes));
|
|
51
51
|
this.shouldReceiveAttributes = false;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
@@ -72,7 +72,7 @@ export default class InsertOperation extends Operation {
|
|
|
72
72
|
* Creates and returns an operation that has the same parameters as this operation.
|
|
73
73
|
*/
|
|
74
74
|
clone() {
|
|
75
|
-
const nodes = new
|
|
75
|
+
const nodes = new ModelNodeList([...this.nodes].map(node => node._clone(true)));
|
|
76
76
|
const insert = new InsertOperation(this.position, nodes, this.baseVersion);
|
|
77
77
|
insert.shouldReceiveAttributes = this.shouldReceiveAttributes;
|
|
78
78
|
return insert;
|
|
@@ -82,7 +82,7 @@ export default class InsertOperation extends Operation {
|
|
|
82
82
|
*/
|
|
83
83
|
getReversed() {
|
|
84
84
|
const graveyard = this.position.root.document.graveyard;
|
|
85
|
-
const gyPosition = new
|
|
85
|
+
const gyPosition = new ModelPosition(graveyard, [0]);
|
|
86
86
|
return new MoveOperation(this.position, this.nodes.maxOffset, gyPosition, this.baseVersion + 1);
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
@@ -110,7 +110,7 @@ export default class InsertOperation extends Operation {
|
|
|
110
110
|
// to the operation, not modified. For example, text nodes can get merged or cropped while Elements can
|
|
111
111
|
// get children. It is important that InsertOperation has the copy of original nodes in intact state.
|
|
112
112
|
const originalNodes = this.nodes;
|
|
113
|
-
this.nodes = new
|
|
113
|
+
this.nodes = new ModelNodeList([...originalNodes].map(node => node._clone(true)));
|
|
114
114
|
_insert(this.position, originalNodes);
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
@@ -139,14 +139,14 @@ export default class InsertOperation extends Operation {
|
|
|
139
139
|
for (const child of json.nodes) {
|
|
140
140
|
if (child.name) {
|
|
141
141
|
// If child has name property, it is an Element.
|
|
142
|
-
children.push(
|
|
142
|
+
children.push(ModelElement.fromJSON(child));
|
|
143
143
|
}
|
|
144
144
|
else {
|
|
145
145
|
// Otherwise, it is a Text node.
|
|
146
|
-
children.push(
|
|
146
|
+
children.push(ModelText.fromJSON(child));
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
const insert = new InsertOperation(
|
|
149
|
+
const insert = new InsertOperation(ModelPosition.fromJSON(json.position, document), children, json.baseVersion);
|
|
150
150
|
insert.shouldReceiveAttributes = json.shouldReceiveAttributes;
|
|
151
151
|
return insert;
|
|
152
152
|
}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/markeroperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
9
|
-
import
|
|
10
|
-
import type
|
|
11
|
-
import type MarkerCollection from '../markercollection.js';
|
|
12
|
-
import type {
|
|
13
|
-
export
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
|
+
import { ModelRange } from '../range.js';
|
|
10
|
+
import { type ModelDocument } from '../document.js';
|
|
11
|
+
import { type MarkerCollection } from '../markercollection.js';
|
|
12
|
+
import type { ModelSelectable } from '../selection.js';
|
|
13
|
+
export declare class MarkerOperation extends Operation {
|
|
14
14
|
/**
|
|
15
15
|
* Marker name.
|
|
16
16
|
*
|
|
@@ -22,13 +22,13 @@ export default class MarkerOperation extends Operation {
|
|
|
22
22
|
*
|
|
23
23
|
* @readonly
|
|
24
24
|
*/
|
|
25
|
-
oldRange:
|
|
25
|
+
oldRange: ModelRange | null;
|
|
26
26
|
/**
|
|
27
27
|
* Marker range after the change.
|
|
28
28
|
*
|
|
29
29
|
* @readonly
|
|
30
30
|
*/
|
|
31
|
-
newRange:
|
|
31
|
+
newRange: ModelRange | null;
|
|
32
32
|
/**
|
|
33
33
|
* Specifies whether the marker operation affects the data produced by the data pipeline
|
|
34
34
|
* (is persisted in the editor's data).
|
|
@@ -47,10 +47,10 @@ export default class MarkerOperation extends Operation {
|
|
|
47
47
|
* @param markers Marker collection on which change should be executed.
|
|
48
48
|
* @param affectsData Specifies whether the marker operation affects the data produced by the data pipeline
|
|
49
49
|
* (is persisted in the editor's data).
|
|
50
|
-
* @param baseVersion Document {@link module:engine/model/document~
|
|
50
|
+
* @param baseVersion Document {@link module:engine/model/document~ModelDocument#version} on which operation
|
|
51
51
|
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
52
52
|
*/
|
|
53
|
-
constructor(name: string, oldRange:
|
|
53
|
+
constructor(name: string, oldRange: ModelRange | null, newRange: ModelRange | null, markers: MarkerCollection, affectsData: boolean, baseVersion: number | null);
|
|
54
54
|
/**
|
|
55
55
|
* @inheritDoc
|
|
56
56
|
*/
|
|
@@ -58,7 +58,7 @@ export default class MarkerOperation extends Operation {
|
|
|
58
58
|
/**
|
|
59
59
|
* @inheritDoc
|
|
60
60
|
*/
|
|
61
|
-
get affectedSelectable():
|
|
61
|
+
get affectedSelectable(): ModelSelectable;
|
|
62
62
|
/**
|
|
63
63
|
* Creates and returns an operation that has the same parameters as this operation.
|
|
64
64
|
*/
|
|
@@ -87,5 +87,5 @@ export default class MarkerOperation extends Operation {
|
|
|
87
87
|
* @param json Deserialized JSON object.
|
|
88
88
|
* @param document Document on which this operation will be applied.
|
|
89
89
|
*/
|
|
90
|
-
static fromJSON(json: any, document:
|
|
90
|
+
static fromJSON(json: any, document: ModelDocument): MarkerOperation;
|
|
91
91
|
}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/markeroperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
9
|
-
import
|
|
10
|
-
export
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
|
+
import { ModelRange } from '../range.js';
|
|
10
|
+
export class MarkerOperation extends Operation {
|
|
11
11
|
/**
|
|
12
12
|
* Marker name.
|
|
13
13
|
*
|
|
@@ -44,7 +44,7 @@ export default class MarkerOperation extends Operation {
|
|
|
44
44
|
* @param markers Marker collection on which change should be executed.
|
|
45
45
|
* @param affectsData Specifies whether the marker operation affects the data produced by the data pipeline
|
|
46
46
|
* (is persisted in the editor's data).
|
|
47
|
-
* @param baseVersion Document {@link module:engine/model/document~
|
|
47
|
+
* @param baseVersion Document {@link module:engine/model/document~ModelDocument#version} on which operation
|
|
48
48
|
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
49
49
|
*/
|
|
50
50
|
constructor(name, oldRange, newRange, markers, affectsData, baseVersion) {
|
|
@@ -131,6 +131,6 @@ export default class MarkerOperation extends Operation {
|
|
|
131
131
|
* @param document Document on which this operation will be applied.
|
|
132
132
|
*/
|
|
133
133
|
static fromJSON(json, document) {
|
|
134
|
-
return new MarkerOperation(json.name, json.oldRange ?
|
|
134
|
+
return new MarkerOperation(json.name, json.oldRange ? ModelRange.fromJSON(json.oldRange, document) : null, json.newRange ? ModelRange.fromJSON(json.newRange, document) : null, document.model.markers, json.affectsData, json.baseVersion);
|
|
135
135
|
}
|
|
136
136
|
}
|
|
@@ -5,24 +5,24 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/mergeoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import type
|
|
12
|
-
import type {
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
|
+
import { ModelPosition } from '../position.js';
|
|
10
|
+
import { ModelRange } from '../range.js';
|
|
11
|
+
import { type ModelDocument } from '../document.js';
|
|
12
|
+
import type { ModelSelectable } from '../selection.js';
|
|
13
13
|
/**
|
|
14
|
-
* Operation to merge two {@link module:engine/model/element~
|
|
14
|
+
* Operation to merge two {@link module:engine/model/element~ModelElement elements}.
|
|
15
15
|
*
|
|
16
16
|
* The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of
|
|
17
17
|
* {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.
|
|
18
18
|
*
|
|
19
19
|
* The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export declare class MergeOperation extends Operation {
|
|
22
22
|
/**
|
|
23
23
|
* Position inside the merged element. All nodes from that element after that position will be moved to {@link #targetPosition}.
|
|
24
24
|
*/
|
|
25
|
-
sourcePosition:
|
|
25
|
+
sourcePosition: ModelPosition;
|
|
26
26
|
/**
|
|
27
27
|
* Summary offset size of nodes which will be moved from the merged element to the new parent.
|
|
28
28
|
*/
|
|
@@ -30,11 +30,11 @@ export default class MergeOperation extends Operation {
|
|
|
30
30
|
/**
|
|
31
31
|
* Position which the nodes from the merged elements will be moved to.
|
|
32
32
|
*/
|
|
33
|
-
targetPosition:
|
|
33
|
+
targetPosition: ModelPosition;
|
|
34
34
|
/**
|
|
35
35
|
* Position in graveyard to which the merged element will be moved.
|
|
36
36
|
*/
|
|
37
|
-
graveyardPosition:
|
|
37
|
+
graveyardPosition: ModelPosition;
|
|
38
38
|
/**
|
|
39
39
|
* Creates a merge operation.
|
|
40
40
|
*
|
|
@@ -43,10 +43,10 @@ export default class MergeOperation extends Operation {
|
|
|
43
43
|
* @param howMany Summary offset size of nodes which will be moved from the merged element to the new parent.
|
|
44
44
|
* @param targetPosition Position which the nodes from the merged elements will be moved to.
|
|
45
45
|
* @param graveyardPosition Position in graveyard to which the merged element will be moved.
|
|
46
|
-
* @param baseVersion Document {@link module:engine/model/document~
|
|
46
|
+
* @param baseVersion Document {@link module:engine/model/document~ModelDocument#version} on which operation
|
|
47
47
|
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
48
48
|
*/
|
|
49
|
-
constructor(sourcePosition:
|
|
49
|
+
constructor(sourcePosition: ModelPosition, howMany: number, targetPosition: ModelPosition, graveyardPosition: ModelPosition, baseVersion: number | null);
|
|
50
50
|
/**
|
|
51
51
|
* @inheritDoc
|
|
52
52
|
*/
|
|
@@ -54,16 +54,16 @@ export default class MergeOperation extends Operation {
|
|
|
54
54
|
/**
|
|
55
55
|
* Position before the merged element (which will be deleted).
|
|
56
56
|
*/
|
|
57
|
-
get deletionPosition():
|
|
57
|
+
get deletionPosition(): ModelPosition;
|
|
58
58
|
/**
|
|
59
59
|
* Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.
|
|
60
60
|
* The range starts at {@link ~MergeOperation#sourcePosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.
|
|
61
61
|
*/
|
|
62
|
-
get movedRange():
|
|
62
|
+
get movedRange(): ModelRange;
|
|
63
63
|
/**
|
|
64
64
|
* @inheritDoc
|
|
65
65
|
*/
|
|
66
|
-
get affectedSelectable():
|
|
66
|
+
get affectedSelectable(): ModelSelectable;
|
|
67
67
|
/**
|
|
68
68
|
* Creates and returns an operation that has the same parameters as this operation.
|
|
69
69
|
*/
|
|
@@ -96,5 +96,5 @@ export default class MergeOperation extends Operation {
|
|
|
96
96
|
* @param json Deserialized JSON object.
|
|
97
97
|
* @param document Document on which this operation will be applied.
|
|
98
98
|
*/
|
|
99
|
-
static fromJSON(json: any, document:
|
|
99
|
+
static fromJSON(json: any, document: ModelDocument): MergeOperation;
|
|
100
100
|
}
|
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/mergeoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
9
|
-
import SplitOperation from './splitoperation.js';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
|
+
import { SplitOperation } from './splitoperation.js';
|
|
10
|
+
import { ModelPosition } from '../position.js';
|
|
11
|
+
import { ModelRange } from '../range.js';
|
|
12
12
|
import { _move } from './utils.js';
|
|
13
13
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
14
14
|
/**
|
|
15
|
-
* Operation to merge two {@link module:engine/model/element~
|
|
15
|
+
* Operation to merge two {@link module:engine/model/element~ModelElement elements}.
|
|
16
16
|
*
|
|
17
17
|
* The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of
|
|
18
18
|
* {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.
|
|
19
19
|
*
|
|
20
20
|
* The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export class MergeOperation extends Operation {
|
|
23
23
|
/**
|
|
24
24
|
* Position inside the merged element. All nodes from that element after that position will be moved to {@link #targetPosition}.
|
|
25
25
|
*/
|
|
@@ -44,7 +44,7 @@ export default class MergeOperation extends Operation {
|
|
|
44
44
|
* @param howMany Summary offset size of nodes which will be moved from the merged element to the new parent.
|
|
45
45
|
* @param targetPosition Position which the nodes from the merged elements will be moved to.
|
|
46
46
|
* @param graveyardPosition Position in graveyard to which the merged element will be moved.
|
|
47
|
-
* @param baseVersion Document {@link module:engine/model/document~
|
|
47
|
+
* @param baseVersion Document {@link module:engine/model/document~ModelDocument#version} on which operation
|
|
48
48
|
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
49
49
|
*/
|
|
50
50
|
constructor(sourcePosition, howMany, targetPosition, graveyardPosition, baseVersion) {
|
|
@@ -69,7 +69,7 @@ export default class MergeOperation extends Operation {
|
|
|
69
69
|
* Position before the merged element (which will be deleted).
|
|
70
70
|
*/
|
|
71
71
|
get deletionPosition() {
|
|
72
|
-
return new
|
|
72
|
+
return new ModelPosition(this.sourcePosition.root, this.sourcePosition.path.slice(0, -1));
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.
|
|
@@ -77,7 +77,7 @@ export default class MergeOperation extends Operation {
|
|
|
77
77
|
*/
|
|
78
78
|
get movedRange() {
|
|
79
79
|
const end = this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);
|
|
80
|
-
return new
|
|
80
|
+
return new ModelRange(this.sourcePosition, end);
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* @inheritDoc
|
|
@@ -85,10 +85,10 @@ export default class MergeOperation extends Operation {
|
|
|
85
85
|
get affectedSelectable() {
|
|
86
86
|
const mergedElement = this.sourcePosition.parent;
|
|
87
87
|
return [
|
|
88
|
-
|
|
88
|
+
ModelRange._createOn(mergedElement),
|
|
89
89
|
// These could be positions but `Selectable` type only supports `Iterable<Range>`.
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
ModelRange._createFromPositionAndShift(this.targetPosition, 0),
|
|
91
|
+
ModelRange._createFromPositionAndShift(this.graveyardPosition, 0)
|
|
92
92
|
];
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
@@ -106,7 +106,7 @@ export default class MergeOperation extends Operation {
|
|
|
106
106
|
// So we need to acknowledge that the merge operation happened and those positions changed a little.
|
|
107
107
|
const targetPosition = this.targetPosition._getTransformedByMergeOperation(this);
|
|
108
108
|
const path = this.sourcePosition.path.slice(0, -1);
|
|
109
|
-
const insertionPosition = new
|
|
109
|
+
const insertionPosition = new ModelPosition(this.sourcePosition.root, path)._getTransformedByMergeOperation(this);
|
|
110
110
|
return new SplitOperation(targetPosition, this.howMany, insertionPosition, this.graveyardPosition, this.baseVersion + 1);
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
@@ -148,9 +148,9 @@ export default class MergeOperation extends Operation {
|
|
|
148
148
|
*/
|
|
149
149
|
_execute() {
|
|
150
150
|
const mergedElement = this.sourcePosition.parent;
|
|
151
|
-
const sourceRange =
|
|
151
|
+
const sourceRange = ModelRange._createIn(mergedElement);
|
|
152
152
|
_move(sourceRange, this.targetPosition);
|
|
153
|
-
_move(
|
|
153
|
+
_move(ModelRange._createOn(mergedElement), this.graveyardPosition);
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* @inheritDoc
|
|
@@ -175,9 +175,9 @@ export default class MergeOperation extends Operation {
|
|
|
175
175
|
* @param document Document on which this operation will be applied.
|
|
176
176
|
*/
|
|
177
177
|
static fromJSON(json, document) {
|
|
178
|
-
const sourcePosition =
|
|
179
|
-
const targetPosition =
|
|
180
|
-
const graveyardPosition =
|
|
178
|
+
const sourcePosition = ModelPosition.fromJSON(json.sourcePosition, document);
|
|
179
|
+
const targetPosition = ModelPosition.fromJSON(json.targetPosition, document);
|
|
180
|
+
const graveyardPosition = ModelPosition.fromJSON(json.graveyardPosition, document);
|
|
181
181
|
return new this(sourcePosition, json.howMany, targetPosition, graveyardPosition, json.baseVersion);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/moveoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
9
|
-
import
|
|
10
|
-
import type {
|
|
11
|
-
import type
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
|
+
import { ModelPosition } from '../position.js';
|
|
10
|
+
import type { ModelSelectable } from '../selection.js';
|
|
11
|
+
import { type ModelDocument } from '../document.js';
|
|
12
12
|
/**
|
|
13
|
-
* Operation to move a range of {@link module:engine/model/item~
|
|
14
|
-
* to given {@link module:engine/model/position~
|
|
13
|
+
* Operation to move a range of {@link module:engine/model/item~ModelItem model items}
|
|
14
|
+
* to given {@link module:engine/model/position~ModelPosition target position}.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export declare class MoveOperation extends Operation {
|
|
17
17
|
/**
|
|
18
|
-
* Position before the first {@link module:engine/model/item~
|
|
18
|
+
* Position before the first {@link module:engine/model/item~ModelItem model item} to move.
|
|
19
19
|
*/
|
|
20
|
-
sourcePosition:
|
|
20
|
+
sourcePosition: ModelPosition;
|
|
21
21
|
/**
|
|
22
22
|
* Offset size of moved range.
|
|
23
23
|
*/
|
|
@@ -25,18 +25,18 @@ export default class MoveOperation extends Operation {
|
|
|
25
25
|
/**
|
|
26
26
|
* Position at which moved nodes will be inserted.
|
|
27
27
|
*/
|
|
28
|
-
targetPosition:
|
|
28
|
+
targetPosition: ModelPosition;
|
|
29
29
|
/**
|
|
30
30
|
* Creates a move operation.
|
|
31
31
|
*
|
|
32
|
-
* @param sourcePosition Position before the first {@link module:engine/model/item~
|
|
32
|
+
* @param sourcePosition Position before the first {@link module:engine/model/item~ModelItem model item} to move.
|
|
33
33
|
* @param howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
|
|
34
34
|
* `sourcePosition` with offset shifted by `howMany`.
|
|
35
35
|
* @param targetPosition Position at which moved nodes will be inserted.
|
|
36
|
-
* @param baseVersion Document {@link module:engine/model/document~
|
|
36
|
+
* @param baseVersion Document {@link module:engine/model/document~ModelDocument#version} on which operation
|
|
37
37
|
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
38
38
|
*/
|
|
39
|
-
constructor(sourcePosition:
|
|
39
|
+
constructor(sourcePosition: ModelPosition, howMany: number, targetPosition: ModelPosition, baseVersion: number | null);
|
|
40
40
|
/**
|
|
41
41
|
* @inheritDoc
|
|
42
42
|
*/
|
|
@@ -44,7 +44,7 @@ export default class MoveOperation extends Operation {
|
|
|
44
44
|
/**
|
|
45
45
|
* @inheritDoc
|
|
46
46
|
*/
|
|
47
|
-
get affectedSelectable():
|
|
47
|
+
get affectedSelectable(): ModelSelectable;
|
|
48
48
|
/**
|
|
49
49
|
* Creates and returns an operation that has the same parameters as this operation.
|
|
50
50
|
*/
|
|
@@ -63,7 +63,7 @@ export default class MoveOperation extends Operation {
|
|
|
63
63
|
* offset 6 offset 4
|
|
64
64
|
*```
|
|
65
65
|
*/
|
|
66
|
-
getMovedRangeStart():
|
|
66
|
+
getMovedRangeStart(): ModelPosition;
|
|
67
67
|
/**
|
|
68
68
|
* See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
|
|
69
69
|
*/
|
|
@@ -92,5 +92,5 @@ export default class MoveOperation extends Operation {
|
|
|
92
92
|
* @param json Deserialized JSON object.
|
|
93
93
|
* @param document Document on which this operation will be applied.
|
|
94
94
|
*/
|
|
95
|
-
static fromJSON(json: any, document:
|
|
95
|
+
static fromJSON(json: any, document: ModelDocument): MoveOperation;
|
|
96
96
|
}
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/moveoperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
|
+
import { ModelPosition } from '../position.js';
|
|
10
|
+
import { ModelRange } from '../range.js';
|
|
11
11
|
import { _move } from './utils.js';
|
|
12
12
|
import { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';
|
|
13
13
|
// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
|
|
14
14
|
/**
|
|
15
|
-
* Operation to move a range of {@link module:engine/model/item~
|
|
16
|
-
* to given {@link module:engine/model/position~
|
|
15
|
+
* Operation to move a range of {@link module:engine/model/item~ModelItem model items}
|
|
16
|
+
* to given {@link module:engine/model/position~ModelPosition target position}.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export class MoveOperation extends Operation {
|
|
19
19
|
/**
|
|
20
|
-
* Position before the first {@link module:engine/model/item~
|
|
20
|
+
* Position before the first {@link module:engine/model/item~ModelItem model item} to move.
|
|
21
21
|
*/
|
|
22
22
|
sourcePosition;
|
|
23
23
|
/**
|
|
@@ -31,11 +31,11 @@ export default class MoveOperation extends Operation {
|
|
|
31
31
|
/**
|
|
32
32
|
* Creates a move operation.
|
|
33
33
|
*
|
|
34
|
-
* @param sourcePosition Position before the first {@link module:engine/model/item~
|
|
34
|
+
* @param sourcePosition Position before the first {@link module:engine/model/item~ModelItem model item} to move.
|
|
35
35
|
* @param howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
|
|
36
36
|
* `sourcePosition` with offset shifted by `howMany`.
|
|
37
37
|
* @param targetPosition Position at which moved nodes will be inserted.
|
|
38
|
-
* @param baseVersion Document {@link module:engine/model/document~
|
|
38
|
+
* @param baseVersion Document {@link module:engine/model/document~ModelDocument#version} on which operation
|
|
39
39
|
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
40
40
|
*/
|
|
41
41
|
constructor(sourcePosition, howMany, targetPosition, baseVersion) {
|
|
@@ -51,7 +51,10 @@ export default class MoveOperation extends Operation {
|
|
|
51
51
|
* @inheritDoc
|
|
52
52
|
*/
|
|
53
53
|
get type() {
|
|
54
|
-
if (this.targetPosition.root.rootName ==
|
|
54
|
+
if (this.targetPosition.root.rootName == this.sourcePosition.root.rootName) {
|
|
55
|
+
return 'move';
|
|
56
|
+
}
|
|
57
|
+
else if (this.targetPosition.root.rootName == '$graveyard') {
|
|
55
58
|
return 'remove';
|
|
56
59
|
}
|
|
57
60
|
else if (this.sourcePosition.root.rootName == '$graveyard') {
|
|
@@ -64,8 +67,8 @@ export default class MoveOperation extends Operation {
|
|
|
64
67
|
*/
|
|
65
68
|
get affectedSelectable() {
|
|
66
69
|
return [
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
ModelRange._createFromPositionAndShift(this.sourcePosition, this.howMany),
|
|
71
|
+
ModelRange._createFromPositionAndShift(this.targetPosition, 0)
|
|
69
72
|
];
|
|
70
73
|
}
|
|
71
74
|
/**
|
|
@@ -145,7 +148,7 @@ export default class MoveOperation extends Operation {
|
|
|
145
148
|
* @internal
|
|
146
149
|
*/
|
|
147
150
|
_execute() {
|
|
148
|
-
_move(
|
|
151
|
+
_move(ModelRange._createFromPositionAndShift(this.sourcePosition, this.howMany), this.targetPosition);
|
|
149
152
|
}
|
|
150
153
|
/**
|
|
151
154
|
* @inheritDoc
|
|
@@ -169,8 +172,8 @@ export default class MoveOperation extends Operation {
|
|
|
169
172
|
* @param document Document on which this operation will be applied.
|
|
170
173
|
*/
|
|
171
174
|
static fromJSON(json, document) {
|
|
172
|
-
const sourcePosition =
|
|
173
|
-
const targetPosition =
|
|
175
|
+
const sourcePosition = ModelPosition.fromJSON(json.sourcePosition, document);
|
|
176
|
+
const targetPosition = ModelPosition.fromJSON(json.targetPosition, document);
|
|
174
177
|
return new this(sourcePosition, json.howMany, targetPosition, json.baseVersion);
|
|
175
178
|
}
|
|
176
179
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/nooperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
9
|
-
import type {
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
|
+
import type { ModelSelectable } from '../selection.js';
|
|
10
10
|
/**
|
|
11
11
|
* Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
|
|
12
12
|
* which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
|
|
@@ -15,12 +15,12 @@ import type { Selectable } from '../selection.js';
|
|
|
15
15
|
* {@link module:engine/model/operation/nooperation~NoOperation} it means that changes done by the transformed operation
|
|
16
16
|
* have already been applied.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export declare class NoOperation extends Operation {
|
|
19
19
|
get type(): 'noop';
|
|
20
20
|
/**
|
|
21
21
|
* @inheritDoc
|
|
22
22
|
*/
|
|
23
|
-
get affectedSelectable():
|
|
23
|
+
get affectedSelectable(): ModelSelectable;
|
|
24
24
|
/**
|
|
25
25
|
* Creates and returns an operation that has the same parameters as this operation.
|
|
26
26
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/nooperation
|
|
7
7
|
*/
|
|
8
|
-
import Operation from './operation.js';
|
|
8
|
+
import { Operation } from './operation.js';
|
|
9
9
|
/**
|
|
10
10
|
* Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
|
|
11
11
|
* which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
|
|
@@ -14,7 +14,7 @@ import Operation from './operation.js';
|
|
|
14
14
|
* {@link module:engine/model/operation/nooperation~NoOperation} it means that changes done by the transformed operation
|
|
15
15
|
* have already been applied.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export class NoOperation extends Operation {
|
|
18
18
|
get type() {
|
|
19
19
|
return 'noop';
|
|
20
20
|
}
|
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/operation/operation
|
|
7
7
|
*/
|
|
8
|
-
import type Batch from '../batch.js';
|
|
9
|
-
import type
|
|
10
|
-
import type {
|
|
8
|
+
import { type Batch } from '../batch.js';
|
|
9
|
+
import { type ModelDocument } from '../document.js';
|
|
10
|
+
import type { ModelSelectable } from '../selection.js';
|
|
11
11
|
/**
|
|
12
12
|
* Abstract base operation class.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare abstract class Operation {
|
|
15
15
|
/**
|
|
16
|
-
* {@link module:engine/model/document~
|
|
16
|
+
* {@link module:engine/model/document~ModelDocument#version} on which operation can be applied. If you try to
|
|
17
17
|
* {@link module:engine/model/model~Model#applyOperation apply} operation with different base version than the
|
|
18
|
-
* {@link module:engine/model/document~
|
|
18
|
+
* {@link module:engine/model/document~ModelDocument#version document version} the
|
|
19
19
|
* {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.
|
|
20
20
|
*/
|
|
21
21
|
baseVersion: number | null;
|
|
22
22
|
/**
|
|
23
|
-
* Defines whether operation is executed on attached or detached {@link module:engine/model/item~
|
|
23
|
+
* Defines whether operation is executed on attached or detached {@link module:engine/model/item~ModelItem items}.
|
|
24
24
|
*/
|
|
25
25
|
readonly isDocumentOperation: boolean;
|
|
26
26
|
/**
|
|
@@ -38,7 +38,7 @@ export default abstract class Operation {
|
|
|
38
38
|
/**
|
|
39
39
|
* Base operation constructor.
|
|
40
40
|
*
|
|
41
|
-
* @param baseVersion Document {@link module:engine/model/document~
|
|
41
|
+
* @param baseVersion Document {@link module:engine/model/document~ModelDocument#version} on which operation
|
|
42
42
|
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
43
43
|
*/
|
|
44
44
|
constructor(baseVersion: number | null);
|
|
@@ -47,7 +47,7 @@ export default abstract class Operation {
|
|
|
47
47
|
*
|
|
48
48
|
* The exact returned parameter differs between operation types.
|
|
49
49
|
*/
|
|
50
|
-
abstract get affectedSelectable():
|
|
50
|
+
abstract get affectedSelectable(): ModelSelectable;
|
|
51
51
|
/**
|
|
52
52
|
* Creates and returns an operation that has the same parameters as this operation.
|
|
53
53
|
*
|
|
@@ -95,5 +95,5 @@ export default abstract class Operation {
|
|
|
95
95
|
* @param json Deserialized JSON object.
|
|
96
96
|
* @param document Document on which this operation will be applied.
|
|
97
97
|
*/
|
|
98
|
-
static fromJSON(json: any, document:
|
|
98
|
+
static fromJSON(json: any, document: ModelDocument): Operation;
|
|
99
99
|
}
|