@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.
- 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 +94 -89
- 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,44 +5,44 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/documentselection
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
8
|
+
import { ModelTypeCheckable } from './typecheckable.js';
|
|
9
|
+
import { ModelLiveRange } from './liverange.js';
|
|
10
|
+
import { ModelSelection } from './selection.js';
|
|
11
|
+
import { ModelText } from './text.js';
|
|
12
|
+
import { ModelTextProxy } from './textproxy.js';
|
|
13
13
|
import { CKEditorError, Collection, EmitterMixin, toMap, uid } from '@ckeditor/ckeditor5-utils';
|
|
14
14
|
const storePrefix = 'selection:';
|
|
15
15
|
/**
|
|
16
|
-
* `
|
|
17
|
-
* {@link module:engine/model/document~
|
|
18
|
-
* There can be only one instance of `
|
|
16
|
+
* `ModelDocumentSelection` is a special selection which is used as the
|
|
17
|
+
* {@link module:engine/model/document~ModelDocument#selection document's selection}.
|
|
18
|
+
* There can be only one instance of `ModelDocumentSelection` per document.
|
|
19
19
|
*
|
|
20
|
-
* Document selection can only be changed by using the {@link module:engine/model/writer~
|
|
20
|
+
* Document selection can only be changed by using the {@link module:engine/model/writer~ModelWriter} instance
|
|
21
21
|
* inside the {@link module:engine/model/model~Model#change `change()`} block, as it provides a secure way to modify model.
|
|
22
22
|
*
|
|
23
|
-
* `
|
|
23
|
+
* `ModelDocumentSelection` is automatically updated upon changes in the {@link module:engine/model/document~ModelDocument document}
|
|
24
24
|
* to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
|
|
25
25
|
*
|
|
26
|
-
* Differences between {@link module:engine/model/selection~
|
|
27
|
-
* * there is always a range in `
|
|
26
|
+
* Differences between {@link module:engine/model/selection~ModelSelection} and `ModelDocumentSelection` are:
|
|
27
|
+
* * there is always a range in `ModelDocumentSelection` - even if no ranges were added there is a "default range"
|
|
28
28
|
* present in the selection,
|
|
29
29
|
* * ranges added to this selection updates automatically when the document changes,
|
|
30
|
-
* * attributes of `
|
|
30
|
+
* * attributes of `ModelDocumentSelection` are updated automatically according to selection ranges.
|
|
31
31
|
*
|
|
32
|
-
* Since `
|
|
33
|
-
* and is updated when {@link module:engine/model/document~
|
|
34
|
-
* changes, it cannot be set on {@link module:engine/model/node~
|
|
35
|
-
* that are inside {@link module:engine/model/documentfragment~
|
|
32
|
+
* Since `ModelDocumentSelection` uses {@link module:engine/model/liverange~ModelLiveRange live ranges}
|
|
33
|
+
* and is updated when {@link module:engine/model/document~ModelDocument document}
|
|
34
|
+
* changes, it cannot be set on {@link module:engine/model/node~ModelNode nodes}
|
|
35
|
+
* that are inside {@link module:engine/model/documentfragment~ModelDocumentFragment document fragment}.
|
|
36
36
|
* If you need to represent a selection in document fragment,
|
|
37
|
-
* use {@link module:engine/model/selection~
|
|
37
|
+
* use {@link module:engine/model/selection~ModelSelection Selection class} instead.
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export class ModelDocumentSelection extends /* #__PURE__ */ EmitterMixin(ModelTypeCheckable) {
|
|
40
40
|
/**
|
|
41
|
-
* Selection used internally by that class (`
|
|
41
|
+
* Selection used internally by that class (`ModelDocumentSelection` is a proxy to that selection).
|
|
42
42
|
*/
|
|
43
43
|
_selection;
|
|
44
44
|
/**
|
|
45
|
-
* Creates an empty live selection for given {@link module:engine/model/document~
|
|
45
|
+
* Creates an empty live selection for given {@link module:engine/model/document~ModelDocument}.
|
|
46
46
|
*
|
|
47
47
|
* @param doc Document which owns this selection.
|
|
48
48
|
*/
|
|
@@ -63,8 +63,8 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
63
63
|
/**
|
|
64
64
|
* Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.
|
|
65
65
|
* Together with {@link #focus} they define the direction of selection, which is important
|
|
66
|
-
* when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~
|
|
67
|
-
* {@link module:engine/model/range~
|
|
66
|
+
* when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~ModelRange#start start} or
|
|
67
|
+
* {@link module:engine/model/range~ModelRange#end end} position of the most recently added range.
|
|
68
68
|
*
|
|
69
69
|
* Is set to `null` if there are no ranges in selection.
|
|
70
70
|
*
|
|
@@ -91,7 +91,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Describes whether `Documentselection` has own range(s) set, or if it is defaulted to
|
|
94
|
-
* {@link module:engine/model/document~
|
|
94
|
+
* {@link module:engine/model/document~ModelDocument#_getDefaultRange document's default range}.
|
|
95
95
|
*/
|
|
96
96
|
get hasOwnRange() {
|
|
97
97
|
return this._selection.hasOwnRange;
|
|
@@ -107,7 +107,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
107
107
|
return this._selection.isBackward;
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
|
-
* Describes whether the gravity is overridden (using {@link module:engine/model/writer~
|
|
110
|
+
* Describes whether the gravity is overridden (using {@link module:engine/model/writer~ModelWriter#overrideSelectionGravity}) or not.
|
|
111
111
|
*
|
|
112
112
|
* Note that the gravity remains overridden as long as will not be restored the same number of times as it was overridden.
|
|
113
113
|
*/
|
|
@@ -118,13 +118,13 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
118
118
|
* A collection of selection {@link module:engine/model/markercollection~Marker markers}.
|
|
119
119
|
* Marker is a selection marker when selection range is inside the marker range.
|
|
120
120
|
*
|
|
121
|
-
* **Note**: Only markers from {@link ~
|
|
121
|
+
* **Note**: Only markers from {@link ~ModelDocumentSelection#observeMarkers observed markers groups} are collected.
|
|
122
122
|
*/
|
|
123
123
|
get markers() {
|
|
124
124
|
return this._selection.markers;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
* Used for the compatibility with the {@link module:engine/model/selection~
|
|
127
|
+
* Used for the compatibility with the {@link module:engine/model/selection~ModelSelection#isEqual} method.
|
|
128
128
|
*
|
|
129
129
|
* @internal
|
|
130
130
|
*/
|
|
@@ -139,7 +139,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* Returns the first position in the selection.
|
|
142
|
-
* First position is the position that {@link module:engine/model/position~
|
|
142
|
+
* First position is the position that {@link module:engine/model/position~ModelPosition#isBefore is before}
|
|
143
143
|
* any other position in the selection.
|
|
144
144
|
*
|
|
145
145
|
* Returns `null` if there are no ranges in selection.
|
|
@@ -149,7 +149,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
* Returns the last position in the selection.
|
|
152
|
-
* Last position is the position that {@link module:engine/model/position~
|
|
152
|
+
* Last position is the position that {@link module:engine/model/position~ModelPosition#isAfter is after}
|
|
153
153
|
* any other position in the selection.
|
|
154
154
|
*
|
|
155
155
|
* Returns `null` if there are no ranges in selection.
|
|
@@ -159,8 +159,8 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* Returns a copy of the first range in the selection.
|
|
162
|
-
* First range is the one which {@link module:engine/model/range~
|
|
163
|
-
* {@link module:engine/model/position~
|
|
162
|
+
* First range is the one which {@link module:engine/model/range~ModelRange#start start} position
|
|
163
|
+
* {@link module:engine/model/position~ModelPosition#isBefore is before} start position of all other ranges
|
|
164
164
|
* (not to confuse with the first range added to the selection).
|
|
165
165
|
*
|
|
166
166
|
* Returns `null` if there are no ranges in selection.
|
|
@@ -170,9 +170,9 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Returns a copy of the last range in the selection.
|
|
173
|
-
* Last range is the one which {@link module:engine/model/range~
|
|
174
|
-
* {@link module:engine/model/position~
|
|
175
|
-
* recently added to the selection).
|
|
173
|
+
* Last range is the one which {@link module:engine/model/range~ModelRange#end end} position
|
|
174
|
+
* {@link module:engine/model/position~ModelPosition#isAfter is after} end position of all
|
|
175
|
+
* other ranges (not to confuse with the range most recently added to the selection).
|
|
176
176
|
*
|
|
177
177
|
* Returns `null` if there are no ranges in selection.
|
|
178
178
|
*/
|
|
@@ -180,7 +180,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
180
180
|
return this._selection.getLastRange();
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
|
-
* Gets elements of type {@link module:engine/model/schema~
|
|
183
|
+
* Gets elements of type {@link module:engine/model/schema~ModelSchema#isBlock "block"} touched by the selection.
|
|
184
184
|
*
|
|
185
185
|
* This method's result can be used for example to apply block styling to all blocks covered by this selection.
|
|
186
186
|
*
|
|
@@ -236,7 +236,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
236
236
|
return this._selection.getSelectedBlocks();
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
|
-
* Returns the selected element. {@link module:engine/model/element~
|
|
239
|
+
* Returns the selected element. {@link module:engine/model/element~ModelElement Element} is considered as selected if there is only
|
|
240
240
|
* one range in the selection, and that range contains exactly one element.
|
|
241
241
|
* Returns `null` if there is no selected element.
|
|
242
242
|
*/
|
|
@@ -245,7 +245,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
245
245
|
}
|
|
246
246
|
/**
|
|
247
247
|
* Checks whether the selection contains the entire content of the given element. This means that selection must start
|
|
248
|
-
* at a position {@link module:engine/model/position~
|
|
248
|
+
* at a position {@link module:engine/model/position~ModelPosition#isTouching touching} the element's start and ends at position
|
|
249
249
|
* touching the element's end.
|
|
250
250
|
*
|
|
251
251
|
* By default, this method will check whether the entire content of the selection's current root is selected.
|
|
@@ -302,7 +302,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
302
302
|
}
|
|
303
303
|
/**
|
|
304
304
|
* Registers a marker group prefix or a marker name to be collected in the
|
|
305
|
-
* {@link ~
|
|
305
|
+
* {@link ~ModelDocumentSelection#markers selection markers collection}.
|
|
306
306
|
*
|
|
307
307
|
* See also {@link module:engine/model/markercollection~MarkerCollection#getMarkersGroup `MarkerCollection#getMarkersGroup()`}.
|
|
308
308
|
*
|
|
@@ -312,26 +312,26 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
312
312
|
this._selection.observeMarkers(prefixOrName);
|
|
313
313
|
}
|
|
314
314
|
/**
|
|
315
|
-
* Moves {@link module:engine/model/documentselection~
|
|
316
|
-
* Should be used only within the {@link module:engine/model/writer~
|
|
315
|
+
* Moves {@link module:engine/model/documentselection~ModelDocumentSelection#focus} to the specified location.
|
|
316
|
+
* Should be used only within the {@link module:engine/model/writer~ModelWriter#setSelectionFocus} method.
|
|
317
317
|
*
|
|
318
318
|
* The location can be specified in the same form as
|
|
319
|
-
* {@link module:engine/model/writer~
|
|
319
|
+
* {@link module:engine/model/writer~ModelWriter#createPositionAt writer.createPositionAt()} parameters.
|
|
320
320
|
*
|
|
321
|
-
* @see module:engine/model/writer~
|
|
321
|
+
* @see module:engine/model/writer~ModelWriter#setSelectionFocus
|
|
322
322
|
* @internal
|
|
323
323
|
* @param offset Offset or one of the flags. Used only when
|
|
324
|
-
* first parameter is a {@link module:engine/model/item~
|
|
324
|
+
* first parameter is a {@link module:engine/model/item~ModelItem model item}.
|
|
325
325
|
*/
|
|
326
326
|
_setFocus(itemOrPosition, offset) {
|
|
327
327
|
this._selection.setFocus(itemOrPosition, offset);
|
|
328
328
|
}
|
|
329
329
|
/**
|
|
330
330
|
* Sets this selection's ranges and direction to the specified location based on the given
|
|
331
|
-
* {@link module:engine/model/selection~
|
|
332
|
-
* Should be used only within the {@link module:engine/model/writer~
|
|
331
|
+
* {@link module:engine/model/selection~ModelSelectable selectable}.
|
|
332
|
+
* Should be used only within the {@link module:engine/model/writer~ModelWriter#setSelection} method.
|
|
333
333
|
*
|
|
334
|
-
* @see module:engine/model/writer~
|
|
334
|
+
* @see module:engine/model/writer~ModelWriter#setSelection
|
|
335
335
|
* @internal
|
|
336
336
|
*/
|
|
337
337
|
_setTo(...args) {
|
|
@@ -339,9 +339,9 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
341
|
* Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.
|
|
342
|
-
* Should be used only within the {@link module:engine/model/writer~
|
|
342
|
+
* Should be used only within the {@link module:engine/model/writer~ModelWriter#setSelectionAttribute} method.
|
|
343
343
|
*
|
|
344
|
-
* @see module:engine/model/writer~
|
|
344
|
+
* @see module:engine/model/writer~ModelWriter#setSelectionAttribute
|
|
345
345
|
* @internal
|
|
346
346
|
* @param key Key of the attribute to set.
|
|
347
347
|
* @param value Attribute value.
|
|
@@ -351,11 +351,11 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
351
351
|
}
|
|
352
352
|
/**
|
|
353
353
|
* Removes an attribute with given key from the selection.
|
|
354
|
-
* If the given attribute was set on the selection, fires the {@link module:engine/model/selection~
|
|
354
|
+
* If the given attribute was set on the selection, fires the {@link module:engine/model/selection~ModelSelection#event:change:range}
|
|
355
355
|
* event with removed attribute key.
|
|
356
|
-
* Should be used only within the {@link module:engine/model/writer~
|
|
356
|
+
* Should be used only within the {@link module:engine/model/writer~ModelWriter#removeSelectionAttribute} method.
|
|
357
357
|
*
|
|
358
|
-
* @see module:engine/model/writer~
|
|
358
|
+
* @see module:engine/model/writer~ModelWriter#removeSelectionAttribute
|
|
359
359
|
* @internal
|
|
360
360
|
* @param key Key of the attribute to remove.
|
|
361
361
|
*/
|
|
@@ -380,7 +380,7 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
380
380
|
* It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry
|
|
381
381
|
* of the process.
|
|
382
382
|
*
|
|
383
|
-
* @see module:engine/model/writer~
|
|
383
|
+
* @see module:engine/model/writer~ModelWriter#overrideSelectionGravity
|
|
384
384
|
* @internal
|
|
385
385
|
* @returns The unique id which allows restoring the gravity.
|
|
386
386
|
*/
|
|
@@ -388,13 +388,13 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
388
388
|
return this._selection.overrideGravity();
|
|
389
389
|
}
|
|
390
390
|
/**
|
|
391
|
-
* Restores the {@link ~
|
|
391
|
+
* Restores the {@link ~ModelDocumentSelection#_overrideGravity overridden gravity}.
|
|
392
392
|
*
|
|
393
393
|
* Restoring the gravity is only possible using the unique identifier returned by
|
|
394
|
-
* {@link ~
|
|
394
|
+
* {@link ~ModelDocumentSelection#_overrideGravity}. Note that the gravity remains overridden as long as won't be restored
|
|
395
395
|
* the same number of times it was overridden.
|
|
396
396
|
*
|
|
397
|
-
* @see module:engine/model/writer~
|
|
397
|
+
* @see module:engine/model/writer~ModelWriter#restoreSelectionGravity
|
|
398
398
|
* @internal
|
|
399
399
|
* @param uid The unique id returned by {@link #_overrideGravity}.
|
|
400
400
|
*/
|
|
@@ -422,25 +422,26 @@ export default class DocumentSelection extends /* #__PURE__ */ EmitterMixin(Type
|
|
|
422
422
|
}
|
|
423
423
|
// The magic of type inference using `is` method is centralized in `TypeCheckable` class.
|
|
424
424
|
// Proper overload would interfere with that.
|
|
425
|
-
|
|
425
|
+
ModelDocumentSelection.prototype.is = function (type) {
|
|
426
426
|
return type === 'selection' ||
|
|
427
427
|
type == 'model:selection' ||
|
|
428
428
|
type == 'documentSelection' ||
|
|
429
429
|
type == 'model:documentSelection';
|
|
430
430
|
};
|
|
431
431
|
/**
|
|
432
|
-
* `LiveSelection` is used internally by {@link module:engine/model/documentselection~
|
|
432
|
+
* `LiveSelection` is used internally by {@link module:engine/model/documentselection~ModelDocumentSelection}
|
|
433
|
+
* and shouldn't be used directly.
|
|
433
434
|
*
|
|
434
|
-
* LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~
|
|
435
|
+
* `LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~ModelDocument document}
|
|
435
436
|
* to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.
|
|
436
437
|
*
|
|
437
|
-
* Differences between {@link module:engine/model/selection~
|
|
438
|
+
* Differences between {@link module:engine/model/selection~ModelSelection} and `LiveSelection` are:
|
|
438
439
|
* * there is always a range in `LiveSelection` - even if no ranges were added there is a "default range"
|
|
439
440
|
* present in the selection,
|
|
440
441
|
* * ranges added to this selection updates automatically when the document changes,
|
|
441
442
|
* * attributes of `LiveSelection` are updated automatically according to selection ranges.
|
|
442
443
|
*/
|
|
443
|
-
class LiveSelection extends
|
|
444
|
+
class LiveSelection extends ModelSelection {
|
|
444
445
|
/**
|
|
445
446
|
* List of selection markers.
|
|
446
447
|
* Marker is a selection marker when selection range is inside the marker range.
|
|
@@ -482,7 +483,7 @@ class LiveSelection extends Selection {
|
|
|
482
483
|
*/
|
|
483
484
|
_observedMarkers = new Set();
|
|
484
485
|
/**
|
|
485
|
-
* Creates an empty live selection for given {@link module:engine/model/document~
|
|
486
|
+
* Creates an empty live selection for given {@link module:engine/model/document~ModelDocument}.
|
|
486
487
|
*
|
|
487
488
|
* @param doc Document which owns this selection.
|
|
488
489
|
*/
|
|
@@ -536,7 +537,7 @@ class LiveSelection extends Selection {
|
|
|
536
537
|
}
|
|
537
538
|
/**
|
|
538
539
|
* Describes whether `LiveSelection` has own range(s) set, or if it is defaulted to
|
|
539
|
-
* {@link module:engine/model/document~
|
|
540
|
+
* {@link module:engine/model/document~ModelDocument#_getDefaultRange document's default range}.
|
|
540
541
|
*/
|
|
541
542
|
get hasOwnRange() {
|
|
542
543
|
return this._ranges.length > 0;
|
|
@@ -609,11 +610,11 @@ class LiveSelection extends Selection {
|
|
|
609
610
|
if (!this._overriddenGravityRegister.has(uid)) {
|
|
610
611
|
/**
|
|
611
612
|
* Restoring gravity for an unknown UID is not possible. Make sure you are using a correct
|
|
612
|
-
* UID obtained from the {@link module:engine/model/writer~
|
|
613
|
+
* UID obtained from the {@link module:engine/model/writer~ModelWriter#overrideSelectionGravity} to restore.
|
|
613
614
|
*
|
|
614
615
|
* @error document-selection-gravity-wrong-restore
|
|
615
616
|
* @param {string} uid The unique identifier returned by
|
|
616
|
-
* {@link module:engine/model/documentselection~
|
|
617
|
+
* {@link module:engine/model/documentselection~ModelDocumentSelection#_overrideGravity}.
|
|
617
618
|
*/
|
|
618
619
|
throw new CKEditorError('document-selection-gravity-wrong-restore', this, { uid });
|
|
619
620
|
}
|
|
@@ -645,11 +646,11 @@ class LiveSelection extends Selection {
|
|
|
645
646
|
for (const range of ranges) {
|
|
646
647
|
if (!this._document._validateSelectionRange(range)) {
|
|
647
648
|
/**
|
|
648
|
-
* Range from {@link module:engine/model/documentselection~
|
|
649
|
+
* Range from {@link module:engine/model/documentselection~ModelDocumentSelection document selection}
|
|
649
650
|
* starts or ends at incorrect position.
|
|
650
651
|
*
|
|
651
652
|
* @error document-selection-wrong-position
|
|
652
|
-
* @param {module:engine/model/range~
|
|
653
|
+
* @param {module:engine/model/range~ModelRange} range The invalid range.
|
|
653
654
|
*/
|
|
654
655
|
throw new CKEditorError('document-selection-wrong-position', this, { range });
|
|
655
656
|
}
|
|
@@ -657,7 +658,7 @@ class LiveSelection extends Selection {
|
|
|
657
658
|
}
|
|
658
659
|
/**
|
|
659
660
|
* Prepares given range to be added to selection. Checks if it is correct,
|
|
660
|
-
* converts it to {@link module:engine/model/liverange~
|
|
661
|
+
* converts it to {@link module:engine/model/liverange~ModelLiveRange ModelLiveRange}
|
|
661
662
|
* and sets listeners listening to the range's change event.
|
|
662
663
|
*/
|
|
663
664
|
_prepareRange(range) {
|
|
@@ -666,7 +667,7 @@ class LiveSelection extends Selection {
|
|
|
666
667
|
// @if CK_DEBUG // console.warn( 'Trying to add a Range that is in the graveyard root. Range rejected.' );
|
|
667
668
|
return;
|
|
668
669
|
}
|
|
669
|
-
const liveRange =
|
|
670
|
+
const liveRange = ModelLiveRange.fromRange(range);
|
|
670
671
|
// If selection range is moved to the graveyard remove it from the selection object.
|
|
671
672
|
// Also, save some data that can be used to restore selection later, on `Model#applyOperation` event.
|
|
672
673
|
liveRange.on('change:range', (evt, oldRange, data) => {
|
|
@@ -751,7 +752,7 @@ class LiveSelection extends Selection {
|
|
|
751
752
|
}
|
|
752
753
|
}
|
|
753
754
|
/**
|
|
754
|
-
* Updates this selection attributes according to its ranges and the {@link module:engine/model/document~
|
|
755
|
+
* Updates this selection attributes according to its ranges and the {@link module:engine/model/document~ModelDocument model document}.
|
|
755
756
|
*/
|
|
756
757
|
_updateAttributes(clearAll) {
|
|
757
758
|
const newAttributes = toMap(this._getSurroundingAttributes());
|
|
@@ -961,7 +962,7 @@ function getTextAttributes(node, schema) {
|
|
|
961
962
|
if (!node) {
|
|
962
963
|
return null;
|
|
963
964
|
}
|
|
964
|
-
if (node instanceof
|
|
965
|
+
if (node instanceof ModelTextProxy || node instanceof ModelText) {
|
|
965
966
|
return node.getAttributes();
|
|
966
967
|
}
|
|
967
968
|
if (!schema.isInline(node)) {
|
package/src/model/element.d.ts
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/model/element
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import type
|
|
8
|
+
import { ModelNode, type ModelNodeAttributes } from './node.js';
|
|
9
|
+
import { type ModelItem } from './item.js';
|
|
10
10
|
/**
|
|
11
|
-
* Model element. Type of {@link module:engine/model/node~
|
|
12
|
-
* {@link module:engine/model/element~
|
|
11
|
+
* Model element. Type of {@link module:engine/model/node~ModelNode node} that has a
|
|
12
|
+
* {@link module:engine/model/element~ModelElement#name name} and {@link module:engine/model/element~ModelElement#getChildren child nodes}.
|
|
13
13
|
*
|
|
14
|
-
* **Important**: see {@link module:engine/model/node~
|
|
14
|
+
* **Important**: see {@link module:engine/model/node~ModelNode} to read about restrictions using `Element` and `Node` API.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export declare class ModelElement extends ModelNode {
|
|
17
17
|
/**
|
|
18
18
|
* Element name.
|
|
19
19
|
*/
|
|
@@ -26,20 +26,20 @@ export default class Element extends Node {
|
|
|
26
26
|
* Creates a model element.
|
|
27
27
|
*
|
|
28
28
|
* **Note:** Constructor of this class shouldn't be used directly in the code.
|
|
29
|
-
* Use the {@link module:engine/model/writer~
|
|
29
|
+
* Use the {@link module:engine/model/writer~ModelWriter#createElement} method instead.
|
|
30
30
|
*
|
|
31
31
|
* @internal
|
|
32
32
|
* @param name Element's name.
|
|
33
33
|
* @param attrs Element's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.
|
|
34
34
|
* @param children One or more nodes to be inserted as children of created element.
|
|
35
35
|
*/
|
|
36
|
-
constructor(name: string, attrs?:
|
|
36
|
+
constructor(name: string, attrs?: ModelNodeAttributes, children?: string | ModelItem | Iterable<string | ModelItem>);
|
|
37
37
|
/**
|
|
38
38
|
* Number of this element's children.
|
|
39
39
|
*/
|
|
40
40
|
get childCount(): number;
|
|
41
41
|
/**
|
|
42
|
-
* Sum of {@link module:engine/model/node~
|
|
42
|
+
* Sum of {@link module:engine/model/node~ModelNode#offsetSize offset sizes} of all of this element's children.
|
|
43
43
|
*/
|
|
44
44
|
get maxOffset(): number;
|
|
45
45
|
/**
|
|
@@ -52,37 +52,37 @@ export default class Element extends Node {
|
|
|
52
52
|
* @param index Index in this element.
|
|
53
53
|
* @returns Child node.
|
|
54
54
|
*/
|
|
55
|
-
getChild(index: number):
|
|
55
|
+
getChild(index: number): ModelNode | null;
|
|
56
56
|
/**
|
|
57
57
|
* Gets the child at the given offset. Returns `null` if incorrect index was passed.
|
|
58
58
|
*
|
|
59
59
|
* @param offset Offset in this element.
|
|
60
60
|
* @returns Child node.
|
|
61
61
|
*/
|
|
62
|
-
getChildAtOffset(offset: number):
|
|
62
|
+
getChildAtOffset(offset: number): ModelNode | null;
|
|
63
63
|
/**
|
|
64
64
|
* Returns an iterator that iterates over all of this element's children.
|
|
65
65
|
*/
|
|
66
|
-
getChildren(): IterableIterator<
|
|
66
|
+
getChildren(): IterableIterator<ModelNode>;
|
|
67
67
|
/**
|
|
68
68
|
* Returns an index of the given child node. Returns `null` if given node is not a child of this element.
|
|
69
69
|
*
|
|
70
70
|
* @param node Child node to look for.
|
|
71
71
|
* @returns Child node's index in this element.
|
|
72
72
|
*/
|
|
73
|
-
getChildIndex(node:
|
|
73
|
+
getChildIndex(node: ModelNode): number | null;
|
|
74
74
|
/**
|
|
75
75
|
* Returns the starting offset of given child. Starting offset is equal to the sum of
|
|
76
|
-
* {@link module:engine/model/node~
|
|
76
|
+
* {@link module:engine/model/node~ModelNode#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if
|
|
77
77
|
* given node is not a child of this element.
|
|
78
78
|
*
|
|
79
79
|
* @param node Child node to look for.
|
|
80
80
|
* @returns Child node's starting offset.
|
|
81
81
|
*/
|
|
82
|
-
getChildStartOffset(node:
|
|
82
|
+
getChildStartOffset(node: ModelNode): number | null;
|
|
83
83
|
/**
|
|
84
84
|
* Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is
|
|
85
|
-
* too high, returns {@link module:engine/model/element~
|
|
85
|
+
* too high, returns {@link module:engine/model/element~ModelElement#getChildIndex index after last child}.
|
|
86
86
|
*
|
|
87
87
|
* ```ts
|
|
88
88
|
* const textNode = new Text( 'foo' );
|
|
@@ -109,7 +109,7 @@ export default class Element extends Node {
|
|
|
109
109
|
*
|
|
110
110
|
* @param relativePath Path of the node to find, relative to this element.
|
|
111
111
|
*/
|
|
112
|
-
getNodeByPath(relativePath: Array<number>):
|
|
112
|
+
getNodeByPath(relativePath: Array<number>): ModelNode;
|
|
113
113
|
/**
|
|
114
114
|
* Returns the parent element of the given name. Returns null if the element is not inside the desired parent.
|
|
115
115
|
*
|
|
@@ -119,7 +119,7 @@ export default class Element extends Node {
|
|
|
119
119
|
*/
|
|
120
120
|
findAncestor(parentName: string, options?: {
|
|
121
121
|
includeSelf?: boolean;
|
|
122
|
-
}):
|
|
122
|
+
}): ModelElement | null;
|
|
123
123
|
/**
|
|
124
124
|
* Converts `Element` instance to plain object and returns it. Takes care of converting all of this element's children.
|
|
125
125
|
*
|
|
@@ -134,39 +134,39 @@ export default class Element extends Node {
|
|
|
134
134
|
* @param deep If set to `true` clones element and all its children recursively. When set to `false`,
|
|
135
135
|
* element will be cloned without any child.
|
|
136
136
|
*/
|
|
137
|
-
_clone(deep?: boolean):
|
|
137
|
+
_clone(deep?: boolean): ModelElement;
|
|
138
138
|
/**
|
|
139
|
-
* {@link module:engine/model/element~
|
|
139
|
+
* {@link module:engine/model/element~ModelElement#_insertChild Inserts} one or more nodes at the end of this element.
|
|
140
140
|
*
|
|
141
|
-
* @see module:engine/model/writer~
|
|
141
|
+
* @see module:engine/model/writer~ModelWriter#append
|
|
142
142
|
* @internal
|
|
143
143
|
* @param nodes Nodes to be inserted.
|
|
144
144
|
*/
|
|
145
|
-
_appendChild(nodes: string |
|
|
145
|
+
_appendChild(nodes: string | ModelItem | Iterable<string | ModelItem>): void;
|
|
146
146
|
/**
|
|
147
|
-
* Inserts one or more nodes at the given index and sets {@link module:engine/model/node~
|
|
147
|
+
* Inserts one or more nodes at the given index and sets {@link module:engine/model/node~ModelNode#parent parent} of these nodes
|
|
148
148
|
* to this element.
|
|
149
149
|
*
|
|
150
|
-
* @see module:engine/model/writer~
|
|
150
|
+
* @see module:engine/model/writer~ModelWriter#insert
|
|
151
151
|
* @internal
|
|
152
152
|
* @param index Index at which nodes should be inserted.
|
|
153
153
|
* @param items Items to be inserted.
|
|
154
154
|
*/
|
|
155
|
-
_insertChild(index: number, items: string |
|
|
155
|
+
_insertChild(index: number, items: string | ModelItem | Iterable<string | ModelItem>): void;
|
|
156
156
|
/**
|
|
157
157
|
* Removes one or more nodes starting at the given index and sets
|
|
158
|
-
* {@link module:engine/model/node~
|
|
158
|
+
* {@link module:engine/model/node~ModelNode#parent parent} of these nodes to `null`.
|
|
159
159
|
*
|
|
160
|
-
* @see module:engine/model/writer~
|
|
160
|
+
* @see module:engine/model/writer~ModelWriter#remove
|
|
161
161
|
* @internal
|
|
162
162
|
* @param index Index of the first node to remove.
|
|
163
163
|
* @param howMany Number of nodes to remove.
|
|
164
164
|
* @returns Array containing removed nodes.
|
|
165
165
|
*/
|
|
166
|
-
_removeChildren(index: number, howMany?: number): Array<
|
|
166
|
+
_removeChildren(index: number, howMany?: number): Array<ModelNode>;
|
|
167
167
|
/**
|
|
168
168
|
* Removes children nodes provided as an array and sets
|
|
169
|
-
* the {@link module:engine/model/node~
|
|
169
|
+
* the {@link module:engine/model/node~ModelNode#parent parent} of these nodes to `null`.
|
|
170
170
|
*
|
|
171
171
|
* These nodes do not need to be direct siblings.
|
|
172
172
|
*
|
|
@@ -175,7 +175,7 @@ export default class Element extends Node {
|
|
|
175
175
|
* @internal
|
|
176
176
|
* @param nodes Array of nodes.
|
|
177
177
|
*/
|
|
178
|
-
_removeChildrenArray(nodes: Array<
|
|
178
|
+
_removeChildrenArray(nodes: Array<ModelNode>): void;
|
|
179
179
|
/**
|
|
180
180
|
* Creates an `Element` instance from given plain object (i.e. parsed JSON string).
|
|
181
181
|
* Converts `Element` children to proper nodes.
|
|
@@ -183,5 +183,5 @@ export default class Element extends Node {
|
|
|
183
183
|
* @param json Plain object to be converted to `Element`.
|
|
184
184
|
* @returns `Element` instance created using given plain object.
|
|
185
185
|
*/
|
|
186
|
-
static fromJSON(json: any):
|
|
186
|
+
static fromJSON(json: any): ModelElement;
|
|
187
187
|
}
|