@ckeditor/ckeditor5-engine 35.0.1 → 35.2.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.
- package/CHANGELOG.md +4 -4
- package/package.json +30 -24
- package/src/controller/datacontroller.js +467 -561
- package/src/controller/editingcontroller.js +168 -204
- package/src/conversion/conversion.js +541 -565
- package/src/conversion/conversionhelpers.js +24 -28
- package/src/conversion/downcastdispatcher.js +457 -686
- package/src/conversion/downcasthelpers.js +1583 -1965
- package/src/conversion/mapper.js +518 -707
- package/src/conversion/modelconsumable.js +240 -283
- package/src/conversion/upcastdispatcher.js +372 -718
- package/src/conversion/upcasthelpers.js +707 -818
- package/src/conversion/viewconsumable.js +524 -581
- package/src/dataprocessor/basichtmlwriter.js +12 -16
- package/src/dataprocessor/dataprocessor.js +5 -0
- package/src/dataprocessor/htmldataprocessor.js +100 -116
- package/src/dataprocessor/htmlwriter.js +1 -18
- package/src/dataprocessor/xmldataprocessor.js +116 -137
- package/src/dev-utils/model.js +260 -352
- package/src/dev-utils/operationreplayer.js +106 -126
- package/src/dev-utils/utils.js +34 -51
- package/src/dev-utils/view.js +632 -753
- package/src/index.js +0 -11
- package/src/model/batch.js +111 -127
- package/src/model/differ.js +988 -1233
- package/src/model/document.js +340 -449
- package/src/model/documentfragment.js +327 -364
- package/src/model/documentselection.js +996 -1189
- package/src/model/element.js +306 -410
- package/src/model/history.js +224 -262
- package/src/model/item.js +5 -0
- package/src/model/liveposition.js +84 -145
- package/src/model/liverange.js +108 -185
- package/src/model/markercollection.js +379 -480
- package/src/model/model.js +883 -1034
- package/src/model/node.js +419 -463
- package/src/model/nodelist.js +176 -201
- package/src/model/operation/attributeoperation.js +153 -182
- package/src/model/operation/detachoperation.js +64 -83
- package/src/model/operation/insertoperation.js +135 -166
- package/src/model/operation/markeroperation.js +114 -140
- package/src/model/operation/mergeoperation.js +163 -191
- package/src/model/operation/moveoperation.js +157 -187
- package/src/model/operation/nooperation.js +28 -38
- package/src/model/operation/operation.js +106 -125
- package/src/model/operation/operationfactory.js +30 -34
- package/src/model/operation/renameoperation.js +109 -135
- package/src/model/operation/rootattributeoperation.js +155 -188
- package/src/model/operation/splitoperation.js +196 -232
- package/src/model/operation/transform.js +1833 -2204
- package/src/model/operation/utils.js +140 -204
- package/src/model/position.js +980 -1053
- package/src/model/range.js +910 -1028
- package/src/model/rootelement.js +77 -97
- package/src/model/schema.js +1189 -1835
- package/src/model/selection.js +745 -862
- package/src/model/text.js +90 -114
- package/src/model/textproxy.js +204 -240
- package/src/model/treewalker.js +316 -397
- package/src/model/typecheckable.js +16 -0
- package/src/model/utils/autoparagraphing.js +32 -44
- package/src/model/utils/deletecontent.js +334 -418
- package/src/model/utils/findoptimalinsertionrange.js +25 -36
- package/src/model/utils/getselectedcontent.js +96 -118
- package/src/model/utils/insertcontent.js +757 -773
- package/src/model/utils/insertobject.js +96 -119
- package/src/model/utils/modifyselection.js +120 -158
- package/src/model/utils/selection-post-fixer.js +153 -201
- package/src/model/writer.js +1305 -1474
- package/src/view/attributeelement.js +189 -225
- package/src/view/containerelement.js +75 -85
- package/src/view/document.js +172 -215
- package/src/view/documentfragment.js +200 -249
- package/src/view/documentselection.js +338 -367
- package/src/view/domconverter.js +1370 -1617
- package/src/view/downcastwriter.js +1747 -2076
- package/src/view/editableelement.js +81 -97
- package/src/view/element.js +739 -890
- package/src/view/elementdefinition.js +5 -0
- package/src/view/emptyelement.js +82 -92
- package/src/view/filler.js +35 -50
- package/src/view/item.js +5 -0
- package/src/view/matcher.js +260 -559
- package/src/view/node.js +274 -360
- package/src/view/observer/arrowkeysobserver.js +19 -28
- package/src/view/observer/bubblingemittermixin.js +120 -263
- package/src/view/observer/bubblingeventinfo.js +47 -55
- package/src/view/observer/clickobserver.js +7 -13
- package/src/view/observer/compositionobserver.js +14 -24
- package/src/view/observer/domeventdata.js +57 -67
- package/src/view/observer/domeventobserver.js +40 -64
- package/src/view/observer/fakeselectionobserver.js +81 -96
- package/src/view/observer/focusobserver.js +45 -61
- package/src/view/observer/inputobserver.js +7 -13
- package/src/view/observer/keyobserver.js +17 -27
- package/src/view/observer/mouseobserver.js +7 -14
- package/src/view/observer/mutationobserver.js +220 -315
- package/src/view/observer/observer.js +81 -102
- package/src/view/observer/selectionobserver.js +199 -246
- package/src/view/observer/tabobserver.js +23 -36
- package/src/view/placeholder.js +128 -173
- package/src/view/position.js +350 -401
- package/src/view/range.js +453 -513
- package/src/view/rawelement.js +85 -112
- package/src/view/renderer.js +874 -1018
- package/src/view/rooteditableelement.js +80 -90
- package/src/view/selection.js +608 -689
- package/src/view/styles/background.js +43 -44
- package/src/view/styles/border.js +220 -276
- package/src/view/styles/margin.js +8 -17
- package/src/view/styles/padding.js +8 -16
- package/src/view/styles/utils.js +127 -160
- package/src/view/stylesmap.js +728 -905
- package/src/view/text.js +102 -126
- package/src/view/textproxy.js +144 -170
- package/src/view/treewalker.js +383 -479
- package/src/view/typecheckable.js +19 -0
- package/src/view/uielement.js +166 -187
- package/src/view/upcastwriter.js +395 -449
- package/src/view/view.js +569 -664
- package/src/dataprocessor/dataprocessor.jsdoc +0 -64
- package/src/model/item.jsdoc +0 -14
- package/src/view/elementdefinition.jsdoc +0 -59
- package/src/view/item.jsdoc +0 -14
|
@@ -2,20 +2,16 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module engine/model/operation/moveoperation
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
import Operation from './operation';
|
|
11
9
|
import Position from '../position';
|
|
12
10
|
import Range from '../range';
|
|
13
11
|
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
|
|
14
12
|
import compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';
|
|
15
13
|
import { _move } from './utils';
|
|
16
|
-
|
|
17
14
|
// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;
|
|
18
|
-
|
|
19
15
|
/**
|
|
20
16
|
* Operation to move a range of {@link module:engine/model/item~Item model items}
|
|
21
17
|
* to given {@link module:engine/model/position~Position target position}.
|
|
@@ -23,187 +19,161 @@ import { _move } from './utils';
|
|
|
23
19
|
* @extends module:engine/model/operation/operation~Operation
|
|
24
20
|
*/
|
|
25
21
|
export default class MoveOperation extends Operation {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* @inheritDoc
|
|
185
|
-
*/
|
|
186
|
-
static get className() {
|
|
187
|
-
return 'MoveOperation';
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Creates `MoveOperation` object from deserilized object, i.e. from parsed JSON string.
|
|
192
|
-
*
|
|
193
|
-
* @param {Object} json Deserialized JSON object.
|
|
194
|
-
* @param {module:engine/model/document~Document} document Document on which this operation will be applied.
|
|
195
|
-
* @returns {module:engine/model/operation/moveoperation~MoveOperation}
|
|
196
|
-
*/
|
|
197
|
-
static fromJSON( json, document ) {
|
|
198
|
-
const sourcePosition = Position.fromJSON( json.sourcePosition, document );
|
|
199
|
-
const targetPosition = Position.fromJSON( json.targetPosition, document );
|
|
200
|
-
|
|
201
|
-
return new this( sourcePosition, json.howMany, targetPosition, json.baseVersion );
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// @if CK_DEBUG_ENGINE // toString() {
|
|
205
|
-
// @if CK_DEBUG_ENGINE // const range = ModelRange._createFromPositionAndShift( this.sourcePosition, this.howMany );
|
|
206
|
-
|
|
207
|
-
// @if CK_DEBUG_ENGINE // return `MoveOperation( ${ this.baseVersion } ): ${ range } -> ${ this.targetPosition }`;
|
|
208
|
-
// @if CK_DEBUG_ENGINE // }
|
|
22
|
+
/**
|
|
23
|
+
* Creates a move operation.
|
|
24
|
+
*
|
|
25
|
+
* @param {module:engine/model/position~Position} sourcePosition
|
|
26
|
+
* Position before the first {@link module:engine/model/item~Item model item} to move.
|
|
27
|
+
* @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at
|
|
28
|
+
* `sourcePosition` with offset shifted by `howMany`.
|
|
29
|
+
* @param {module:engine/model/position~Position} targetPosition Position at which moved nodes will be inserted.
|
|
30
|
+
* @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation
|
|
31
|
+
* can be applied or `null` if the operation operates on detached (non-document) tree.
|
|
32
|
+
*/
|
|
33
|
+
constructor(sourcePosition, howMany, targetPosition, baseVersion) {
|
|
34
|
+
super(baseVersion);
|
|
35
|
+
/**
|
|
36
|
+
* Position before the first {@link module:engine/model/item~Item model item} to move.
|
|
37
|
+
*
|
|
38
|
+
* @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#sourcePosition
|
|
39
|
+
*/
|
|
40
|
+
this.sourcePosition = sourcePosition.clone();
|
|
41
|
+
// `'toNext'` because `sourcePosition` is a bit like a start of the moved range.
|
|
42
|
+
this.sourcePosition.stickiness = 'toNext';
|
|
43
|
+
/**
|
|
44
|
+
* Offset size of moved range.
|
|
45
|
+
*
|
|
46
|
+
* @member {Number} module:engine/model/operation/moveoperation~MoveOperation#howMany
|
|
47
|
+
*/
|
|
48
|
+
this.howMany = howMany;
|
|
49
|
+
/**
|
|
50
|
+
* Position at which moved nodes will be inserted.
|
|
51
|
+
*
|
|
52
|
+
* @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#targetPosition
|
|
53
|
+
*/
|
|
54
|
+
this.targetPosition = targetPosition.clone();
|
|
55
|
+
this.targetPosition.stickiness = 'toNone';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* @inheritDoc
|
|
59
|
+
*/
|
|
60
|
+
get type() {
|
|
61
|
+
if (this.targetPosition.root.rootName == '$graveyard') {
|
|
62
|
+
return 'remove';
|
|
63
|
+
}
|
|
64
|
+
else if (this.sourcePosition.root.rootName == '$graveyard') {
|
|
65
|
+
return 'reinsert';
|
|
66
|
+
}
|
|
67
|
+
return 'move';
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates and returns an operation that has the same parameters as this operation.
|
|
71
|
+
*
|
|
72
|
+
* @returns {module:engine/model/operation/moveoperation~MoveOperation} Clone of this operation.
|
|
73
|
+
*/
|
|
74
|
+
clone() {
|
|
75
|
+
return new MoveOperation(this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns the start position of the moved range after it got moved. This may be different than
|
|
79
|
+
* {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved
|
|
80
|
+
* inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}
|
|
81
|
+
* is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.
|
|
82
|
+
*
|
|
83
|
+
* vv vv
|
|
84
|
+
* abcdefg ===> adefbcg
|
|
85
|
+
* ^ ^
|
|
86
|
+
* targetPos movedRangeStart
|
|
87
|
+
* offset 6 offset 4
|
|
88
|
+
*
|
|
89
|
+
* @returns {module:engine/model/position~Position}
|
|
90
|
+
*/
|
|
91
|
+
getMovedRangeStart() {
|
|
92
|
+
return this.targetPosition._getTransformedByDeletion(this.sourcePosition, this.howMany);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
|
|
96
|
+
*
|
|
97
|
+
* @returns {module:engine/model/operation/moveoperation~MoveOperation}
|
|
98
|
+
*/
|
|
99
|
+
getReversed() {
|
|
100
|
+
const newTargetPosition = this.sourcePosition._getTransformedByInsertion(this.targetPosition, this.howMany);
|
|
101
|
+
return new MoveOperation(this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @inheritDoc
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
_validate() {
|
|
108
|
+
const sourceElement = this.sourcePosition.parent;
|
|
109
|
+
const targetElement = this.targetPosition.parent;
|
|
110
|
+
const sourceOffset = this.sourcePosition.offset;
|
|
111
|
+
const targetOffset = this.targetPosition.offset;
|
|
112
|
+
// Validate whether move operation has correct parameters.
|
|
113
|
+
// Validation is pretty complex but move operation is one of the core ways to manipulate the document state.
|
|
114
|
+
// We expect that many errors might be connected with one of scenarios described below.
|
|
115
|
+
if (sourceOffset + this.howMany > sourceElement.maxOffset) {
|
|
116
|
+
/**
|
|
117
|
+
* The nodes which should be moved do not exist.
|
|
118
|
+
*
|
|
119
|
+
* @error move-operation-nodes-do-not-exist
|
|
120
|
+
*/
|
|
121
|
+
throw new CKEditorError('move-operation-nodes-do-not-exist', this);
|
|
122
|
+
}
|
|
123
|
+
else if (sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany) {
|
|
124
|
+
/**
|
|
125
|
+
* Trying to move a range of nodes into the middle of that range.
|
|
126
|
+
*
|
|
127
|
+
* @error move-operation-range-into-itself
|
|
128
|
+
*/
|
|
129
|
+
throw new CKEditorError('move-operation-range-into-itself', this);
|
|
130
|
+
}
|
|
131
|
+
else if (this.sourcePosition.root == this.targetPosition.root) {
|
|
132
|
+
if (compareArrays(this.sourcePosition.getParentPath(), this.targetPosition.getParentPath()) == 'prefix') {
|
|
133
|
+
const i = this.sourcePosition.path.length - 1;
|
|
134
|
+
if (this.targetPosition.path[i] >= sourceOffset && this.targetPosition.path[i] < sourceOffset + this.howMany) {
|
|
135
|
+
/**
|
|
136
|
+
* Trying to move a range of nodes into one of nodes from that range.
|
|
137
|
+
*
|
|
138
|
+
* @error move-operation-node-into-itself
|
|
139
|
+
*/
|
|
140
|
+
throw new CKEditorError('move-operation-node-into-itself', this);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @inheritDoc
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
149
|
+
_execute() {
|
|
150
|
+
_move(Range._createFromPositionAndShift(this.sourcePosition, this.howMany), this.targetPosition);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* @inheritDoc
|
|
154
|
+
*/
|
|
155
|
+
toJSON() {
|
|
156
|
+
const json = super.toJSON();
|
|
157
|
+
json.sourcePosition = this.sourcePosition.toJSON();
|
|
158
|
+
json.targetPosition = this.targetPosition.toJSON();
|
|
159
|
+
return json;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @inheritDoc
|
|
163
|
+
*/
|
|
164
|
+
static get className() {
|
|
165
|
+
return 'MoveOperation';
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Creates `MoveOperation` object from deserilized object, i.e. from parsed JSON string.
|
|
169
|
+
*
|
|
170
|
+
* @param {Object} json Deserialized JSON object.
|
|
171
|
+
* @param {module:engine/model/document~Document} document Document on which this operation will be applied.
|
|
172
|
+
* @returns {module:engine/model/operation/moveoperation~MoveOperation}
|
|
173
|
+
*/
|
|
174
|
+
static fromJSON(json, document) {
|
|
175
|
+
const sourcePosition = Position.fromJSON(json.sourcePosition, document);
|
|
176
|
+
const targetPosition = Position.fromJSON(json.targetPosition, document);
|
|
177
|
+
return new this(sourcePosition, json.howMany, targetPosition, json.baseVersion);
|
|
178
|
+
}
|
|
209
179
|
}
|
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module engine/model/operation/nooperation
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
import Operation from './operation';
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* Operation which is doing nothing ("empty operation", "do-nothing operation", "noop"). This is an operation,
|
|
14
11
|
* which when executed does not change the tree model. It still has some parameters defined for transformation purposes.
|
|
@@ -20,39 +17,32 @@ import Operation from './operation';
|
|
|
20
17
|
* @extends module:engine/model/operation/operation~Operation
|
|
21
18
|
*/
|
|
22
19
|
export default class NoOperation extends Operation {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
static get className() {
|
|
52
|
-
return 'NoOperation';
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// @if CK_DEBUG_ENGINE // toString() {
|
|
56
|
-
// @if CK_DEBUG_ENGINE // return `NoOperation( ${ this.baseVersion } )`;
|
|
57
|
-
// @if CK_DEBUG_ENGINE // }
|
|
20
|
+
get type() {
|
|
21
|
+
return 'noop';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Creates and returns an operation that has the same parameters as this operation.
|
|
25
|
+
*
|
|
26
|
+
* @returns {module:engine/model/operation/nooperation~NoOperation} Clone of this operation.
|
|
27
|
+
*/
|
|
28
|
+
clone() {
|
|
29
|
+
return new NoOperation(this.baseVersion);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.
|
|
33
|
+
*
|
|
34
|
+
* @returns {module:engine/model/operation/nooperation~NoOperation}
|
|
35
|
+
*/
|
|
36
|
+
getReversed() {
|
|
37
|
+
return new NoOperation(this.baseVersion + 1);
|
|
38
|
+
}
|
|
39
|
+
/** @internal */
|
|
40
|
+
_execute() {
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
static get className() {
|
|
46
|
+
return 'NoOperation';
|
|
47
|
+
}
|
|
58
48
|
}
|