@ckeditor/ckeditor5-engine 45.2.1 → 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
package/src/view/document.js
CHANGED
|
@@ -5,26 +5,26 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/document
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import BubblingEmitterMixin from './observer/bubblingemittermixin.js';
|
|
8
|
+
import { ViewDocumentSelection } from './documentselection.js';
|
|
9
|
+
import { BubblingEmitterMixin } from './observer/bubblingemittermixin.js';
|
|
10
10
|
import { Collection, ObservableMixin } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
// @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );
|
|
12
12
|
/**
|
|
13
13
|
* Document class creates an abstract layer over the content editable area, contains a tree of view elements and
|
|
14
|
-
* {@link module:engine/view/documentselection~
|
|
14
|
+
* {@link module:engine/view/documentselection~ViewDocumentSelection view selection} associated with this document.
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export class ViewDocument extends /* #__PURE__ */ BubblingEmitterMixin(/* #__PURE__ */ ObservableMixin()) {
|
|
17
17
|
/**
|
|
18
18
|
* Selection done on this document.
|
|
19
19
|
*/
|
|
20
20
|
selection;
|
|
21
21
|
/**
|
|
22
|
-
* Roots of the view tree. Collection of the {@link module:engine/view/element~
|
|
22
|
+
* Roots of the view tree. Collection of the {@link module:engine/view/element~ViewElement view elements}.
|
|
23
23
|
*
|
|
24
|
-
* View roots are created as a result of binding between {@link module:engine/view/document~
|
|
25
|
-
* {@link module:engine/model/document~
|
|
24
|
+
* View roots are created as a result of binding between {@link module:engine/view/document~ViewDocument#roots} and
|
|
25
|
+
* {@link module:engine/model/document~ModelDocument#roots} and this is handled by
|
|
26
26
|
* {@link module:engine/controller/editingcontroller~EditingController}, so to create view root we need to create
|
|
27
|
-
* model root using {@link module:engine/model/document~
|
|
27
|
+
* model root using {@link module:engine/model/document~ModelDocument#createRoot}.
|
|
28
28
|
*/
|
|
29
29
|
roots;
|
|
30
30
|
/**
|
|
@@ -42,7 +42,7 @@ export default class Document extends /* #__PURE__ */ BubblingEmitterMixin(/* #_
|
|
|
42
42
|
*/
|
|
43
43
|
constructor(stylesProcessor) {
|
|
44
44
|
super();
|
|
45
|
-
this.selection = new
|
|
45
|
+
this.selection = new ViewDocumentSelection();
|
|
46
46
|
this.roots = new Collection({ idProperty: 'rootName' });
|
|
47
47
|
this.stylesProcessor = stylesProcessor;
|
|
48
48
|
this.set('isReadOnly', false);
|
|
@@ -51,7 +51,7 @@ export default class Document extends /* #__PURE__ */ BubblingEmitterMixin(/* #_
|
|
|
51
51
|
this.set('isComposing', false);
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Gets a {@link module:engine/view/document~
|
|
54
|
+
* Gets a {@link module:engine/view/document~ViewDocument#roots view root element} with the specified name. If the name is not
|
|
55
55
|
* specific "main" root is returned.
|
|
56
56
|
*
|
|
57
57
|
* @param name Name of the root.
|
|
@@ -65,7 +65,7 @@ export default class Document extends /* #__PURE__ */ BubblingEmitterMixin(/* #_
|
|
|
65
65
|
* to the DOM.
|
|
66
66
|
*
|
|
67
67
|
* Post-fixers are executed right after all changes from the outermost change block were applied but
|
|
68
|
-
* before the {@link module:engine/view/view~
|
|
68
|
+
* before the {@link module:engine/view/view~EditingView#event:render render event} is fired. If a post-fixer callback made
|
|
69
69
|
* a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
|
|
70
70
|
* not be fixed in the new document tree state.
|
|
71
71
|
*
|
|
@@ -75,7 +75,7 @@ export default class Document extends /* #__PURE__ */ BubblingEmitterMixin(/* #_
|
|
|
75
75
|
* The types of changes which should be safe:
|
|
76
76
|
*
|
|
77
77
|
* * adding or removing attribute from elements,
|
|
78
|
-
* * changes inside of {@link module:engine/view/uielement~
|
|
78
|
+
* * changes inside of {@link module:engine/view/uielement~ViewUIElement UI elements},
|
|
79
79
|
* * {@link module:engine/controller/editingcontroller~EditingController#reconvertItem marking some of the model elements to be
|
|
80
80
|
* re-converted}.
|
|
81
81
|
*
|
|
@@ -84,7 +84,7 @@ export default class Document extends /* #__PURE__ */ BubblingEmitterMixin(/* #_
|
|
|
84
84
|
* * you should not add or remove nor wrap or unwrap any view elements,
|
|
85
85
|
* * you should not change the editor data model in a view post-fixer.
|
|
86
86
|
*
|
|
87
|
-
* As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~
|
|
87
|
+
* As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~ViewDowncastWriter downcast writer}.
|
|
88
88
|
*
|
|
89
89
|
* Typically, a post-fixer will look like this:
|
|
90
90
|
*
|
|
@@ -105,10 +105,10 @@ export default class Document extends /* #__PURE__ */ BubblingEmitterMixin(/* #_
|
|
|
105
105
|
* That is because adding a post-fixer does not execute it.
|
|
106
106
|
* The post-fixer will be executed as soon as any change in the document needs to cause its rendering.
|
|
107
107
|
* If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling
|
|
108
|
-
* {@link module:engine/view/view~
|
|
108
|
+
* {@link module:engine/view/view~EditingView#forceRender `view.forceRender()`}.
|
|
109
109
|
*
|
|
110
110
|
* If you need to register a callback which is executed when DOM elements are already updated,
|
|
111
|
-
* use {@link module:engine/view/view~
|
|
111
|
+
* use {@link module:engine/view/view~EditingView#event:render render event}.
|
|
112
112
|
*/
|
|
113
113
|
registerPostFixer(postFixer) {
|
|
114
114
|
this._postFixers.add(postFixer);
|
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/documentfragment
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import type {
|
|
10
|
-
import type
|
|
11
|
-
import type
|
|
12
|
-
declare const
|
|
8
|
+
import { ViewTypeCheckable } from './typecheckable.js';
|
|
9
|
+
import type { ViewDocument, ViewDocumentChangeType } from './document.js';
|
|
10
|
+
import { type ViewItem } from './item.js';
|
|
11
|
+
import { type ViewNode } from './node.js';
|
|
12
|
+
declare const ViewDocumentFragment_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof ViewTypeCheckable, import("@ckeditor/ckeditor5-utils").Emitter>;
|
|
13
13
|
/**
|
|
14
14
|
* Document fragment.
|
|
15
15
|
*
|
|
16
16
|
* To create a new document fragment instance use the
|
|
17
|
-
* {@link module:engine/view/upcastwriter~
|
|
17
|
+
* {@link module:engine/view/upcastwriter~ViewUpcastWriter#createDocumentFragment `ViewUpcastWriter#createDocumentFragment()`}
|
|
18
18
|
* method.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export declare class ViewDocumentFragment extends /* #__PURE__ */ ViewDocumentFragment_base implements Iterable<ViewNode> {
|
|
21
21
|
/**
|
|
22
22
|
* The document to which this document fragment belongs.
|
|
23
23
|
*/
|
|
24
|
-
readonly document:
|
|
24
|
+
readonly document: ViewDocument;
|
|
25
25
|
/**
|
|
26
26
|
* Array of child nodes.
|
|
27
27
|
*/
|
|
@@ -38,13 +38,13 @@ export default class DocumentFragment extends /* #__PURE__ */ DocumentFragment_b
|
|
|
38
38
|
* @param document The document to which this document fragment belongs.
|
|
39
39
|
* @param children A list of nodes to be inserted into the created document fragment.
|
|
40
40
|
*/
|
|
41
|
-
constructor(document:
|
|
41
|
+
constructor(document: ViewDocument, children?: ViewNode | Iterable<ViewNode>);
|
|
42
42
|
/**
|
|
43
43
|
* Iterable interface.
|
|
44
44
|
*
|
|
45
45
|
* Iterates over nodes added to this document fragment.
|
|
46
46
|
*/
|
|
47
|
-
[Symbol.iterator](): Iterator<
|
|
47
|
+
[Symbol.iterator](): Iterator<ViewNode>;
|
|
48
48
|
/**
|
|
49
49
|
* Number of child nodes in this document fragment.
|
|
50
50
|
*/
|
|
@@ -79,34 +79,34 @@ export default class DocumentFragment extends /* #__PURE__ */ DocumentFragment_b
|
|
|
79
79
|
*/
|
|
80
80
|
getCustomProperties(): Iterable<[string | symbol, unknown]>;
|
|
81
81
|
/**
|
|
82
|
-
* {@link module:engine/view/documentfragment~
|
|
82
|
+
* {@link module:engine/view/documentfragment~ViewDocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end
|
|
83
83
|
* and sets the parent of these nodes to this fragment.
|
|
84
84
|
*
|
|
85
85
|
* @internal
|
|
86
86
|
* @param items Items to be inserted.
|
|
87
87
|
* @returns Number of appended nodes.
|
|
88
88
|
*/
|
|
89
|
-
_appendChild(items:
|
|
89
|
+
_appendChild(items: ViewItem | string | Iterable<ViewItem | string>): number;
|
|
90
90
|
/**
|
|
91
91
|
* Gets child at the given index.
|
|
92
92
|
*
|
|
93
93
|
* @param index Index of child.
|
|
94
94
|
* @returns Child node.
|
|
95
95
|
*/
|
|
96
|
-
getChild(index: number):
|
|
96
|
+
getChild(index: number): ViewNode;
|
|
97
97
|
/**
|
|
98
98
|
* Gets index of the given child node. Returns `-1` if child node is not found.
|
|
99
99
|
*
|
|
100
100
|
* @param node Child node.
|
|
101
101
|
* @returns Index of the child node.
|
|
102
102
|
*/
|
|
103
|
-
getChildIndex(node:
|
|
103
|
+
getChildIndex(node: ViewNode): number;
|
|
104
104
|
/**
|
|
105
105
|
* Gets child nodes iterator.
|
|
106
106
|
*
|
|
107
107
|
* @returns Child nodes iterator.
|
|
108
108
|
*/
|
|
109
|
-
getChildren(): IterableIterator<
|
|
109
|
+
getChildren(): IterableIterator<ViewNode>;
|
|
110
110
|
/**
|
|
111
111
|
* Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
|
|
112
112
|
* this fragment.
|
|
@@ -116,7 +116,7 @@ export default class DocumentFragment extends /* #__PURE__ */ DocumentFragment_b
|
|
|
116
116
|
* @param items Items to be inserted.
|
|
117
117
|
* @returns Number of inserted nodes.
|
|
118
118
|
*/
|
|
119
|
-
_insertChild(index: number, items:
|
|
119
|
+
_insertChild(index: number, items: ViewItem | string | Iterable<ViewItem | string>): number;
|
|
120
120
|
/**
|
|
121
121
|
* Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
|
|
122
122
|
*
|
|
@@ -125,28 +125,28 @@ export default class DocumentFragment extends /* #__PURE__ */ DocumentFragment_b
|
|
|
125
125
|
* @param howMany Number of nodes to remove.
|
|
126
126
|
* @returns The array of removed nodes.
|
|
127
127
|
*/
|
|
128
|
-
_removeChildren(index: number, howMany?: number): Array<
|
|
128
|
+
_removeChildren(index: number, howMany?: number): Array<ViewNode>;
|
|
129
129
|
/**
|
|
130
130
|
* @internal
|
|
131
131
|
* @param type Type of the change.
|
|
132
132
|
* @param node Changed node.
|
|
133
133
|
* @param data Additional data.
|
|
134
|
-
* @fires module:engine/view/node~
|
|
134
|
+
* @fires module:engine/view/node~ViewNode#event:change
|
|
135
135
|
*/
|
|
136
|
-
_fireChange(type:
|
|
136
|
+
_fireChange(type: ViewDocumentChangeType, node: ViewNode | ViewDocumentFragment, data?: {
|
|
137
137
|
index: number;
|
|
138
138
|
}): void;
|
|
139
139
|
/**
|
|
140
140
|
* Sets a custom property. They can be used to add special data to elements.
|
|
141
141
|
*
|
|
142
|
-
* @see module:engine/view/downcastwriter~
|
|
142
|
+
* @see module:engine/view/downcastwriter~ViewDowncastWriter#setCustomProperty
|
|
143
143
|
* @internal
|
|
144
144
|
*/
|
|
145
145
|
_setCustomProperty(key: string | symbol, value: unknown): void;
|
|
146
146
|
/**
|
|
147
147
|
* Removes the custom property stored under the given key.
|
|
148
148
|
*
|
|
149
|
-
* @see module:engine/view/downcastwriter~
|
|
149
|
+
* @see module:engine/view/downcastwriter~ViewDowncastWriter#removeCustomProperty
|
|
150
150
|
* @internal
|
|
151
151
|
* @returns Returns true if property was removed.
|
|
152
152
|
*/
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/documentfragment
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
8
|
+
import { ViewTypeCheckable } from './typecheckable.js';
|
|
9
|
+
import { ViewText } from './text.js';
|
|
10
|
+
import { ViewTextProxy } from './textproxy.js';
|
|
11
11
|
import { EmitterMixin, isIterable } from '@ckeditor/ckeditor5-utils';
|
|
12
12
|
/**
|
|
13
13
|
* Document fragment.
|
|
14
14
|
*
|
|
15
15
|
* To create a new document fragment instance use the
|
|
16
|
-
* {@link module:engine/view/upcastwriter~
|
|
16
|
+
* {@link module:engine/view/upcastwriter~ViewUpcastWriter#createDocumentFragment `ViewUpcastWriter#createDocumentFragment()`}
|
|
17
17
|
* method.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export class ViewDocumentFragment extends /* #__PURE__ */ EmitterMixin(ViewTypeCheckable) {
|
|
20
20
|
/**
|
|
21
21
|
* The document to which this document fragment belongs.
|
|
22
22
|
*/
|
|
@@ -102,7 +102,7 @@ export default class DocumentFragment extends /* #__PURE__ */ EmitterMixin(TypeC
|
|
|
102
102
|
yield* this._customProperties.entries();
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
|
-
* {@link module:engine/view/documentfragment~
|
|
105
|
+
* {@link module:engine/view/documentfragment~ViewDocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end
|
|
106
106
|
* and sets the parent of these nodes to this fragment.
|
|
107
107
|
*
|
|
108
108
|
* @internal
|
|
@@ -183,7 +183,7 @@ export default class DocumentFragment extends /* #__PURE__ */ EmitterMixin(TypeC
|
|
|
183
183
|
* @param type Type of the change.
|
|
184
184
|
* @param node Changed node.
|
|
185
185
|
* @param data Additional data.
|
|
186
|
-
* @fires module:engine/view/node~
|
|
186
|
+
* @fires module:engine/view/node~ViewNode#event:change
|
|
187
187
|
*/
|
|
188
188
|
_fireChange(type, node, data) {
|
|
189
189
|
this.fire(`change:${type}`, node, data);
|
|
@@ -191,7 +191,7 @@ export default class DocumentFragment extends /* #__PURE__ */ EmitterMixin(TypeC
|
|
|
191
191
|
/**
|
|
192
192
|
* Sets a custom property. They can be used to add special data to elements.
|
|
193
193
|
*
|
|
194
|
-
* @see module:engine/view/downcastwriter~
|
|
194
|
+
* @see module:engine/view/downcastwriter~ViewDowncastWriter#setCustomProperty
|
|
195
195
|
* @internal
|
|
196
196
|
*/
|
|
197
197
|
_setCustomProperty(key, value) {
|
|
@@ -200,7 +200,7 @@ export default class DocumentFragment extends /* #__PURE__ */ EmitterMixin(TypeC
|
|
|
200
200
|
/**
|
|
201
201
|
* Removes the custom property stored under the given key.
|
|
202
202
|
*
|
|
203
|
-
* @see module:engine/view/downcastwriter~
|
|
203
|
+
* @see module:engine/view/downcastwriter~ViewDowncastWriter#removeCustomProperty
|
|
204
204
|
* @internal
|
|
205
205
|
* @returns Returns true if property was removed.
|
|
206
206
|
*/
|
|
@@ -210,7 +210,7 @@ export default class DocumentFragment extends /* #__PURE__ */ EmitterMixin(TypeC
|
|
|
210
210
|
}
|
|
211
211
|
// The magic of type inference using `is` method is centralized in `TypeCheckable` class.
|
|
212
212
|
// Proper overload would interfere with that.
|
|
213
|
-
|
|
213
|
+
ViewDocumentFragment.prototype.is = function (type) {
|
|
214
214
|
return type === 'documentFragment' || type === 'view:documentFragment';
|
|
215
215
|
};
|
|
216
216
|
/**
|
|
@@ -219,7 +219,7 @@ DocumentFragment.prototype.is = function (type) {
|
|
|
219
219
|
function normalize(document, nodes) {
|
|
220
220
|
// Separate condition because string is iterable.
|
|
221
221
|
if (typeof nodes == 'string') {
|
|
222
|
-
return [new
|
|
222
|
+
return [new ViewText(document, nodes)];
|
|
223
223
|
}
|
|
224
224
|
if (!isIterable(nodes)) {
|
|
225
225
|
nodes = [nodes];
|
|
@@ -228,10 +228,10 @@ function normalize(document, nodes) {
|
|
|
228
228
|
return Array.from(nodes)
|
|
229
229
|
.map(node => {
|
|
230
230
|
if (typeof node == 'string') {
|
|
231
|
-
return new
|
|
231
|
+
return new ViewText(document, node);
|
|
232
232
|
}
|
|
233
|
-
if (node instanceof
|
|
234
|
-
return new
|
|
233
|
+
if (node instanceof ViewTextProxy) {
|
|
234
|
+
return new ViewText(document, node.data);
|
|
235
235
|
}
|
|
236
236
|
return node;
|
|
237
237
|
});
|
|
@@ -5,52 +5,52 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/documentselection
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import type
|
|
11
|
-
import type
|
|
12
|
-
import type
|
|
13
|
-
import type
|
|
14
|
-
import type {
|
|
15
|
-
import type
|
|
16
|
-
declare const
|
|
8
|
+
import { ViewTypeCheckable } from './typecheckable.js';
|
|
9
|
+
import { ViewSelection, type ViewPlaceOrOffset, type ViewSelectable, type ViewSelectionOptions, type ViewSelectionChangeEvent } from './selection.js';
|
|
10
|
+
import { type ViewEditableElement } from './editableelement.js';
|
|
11
|
+
import { type ViewElement } from './element.js';
|
|
12
|
+
import { type ViewNode } from './node.js';
|
|
13
|
+
import { type ViewItem } from './item.js';
|
|
14
|
+
import type { ViewPosition, ViewPositionOffset } from './position.js';
|
|
15
|
+
import { type ViewRange } from './range.js';
|
|
16
|
+
declare const ViewDocumentSelection_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof ViewTypeCheckable, import("@ckeditor/ckeditor5-utils").Emitter>;
|
|
17
17
|
/**
|
|
18
18
|
* Class representing the document selection in the view.
|
|
19
19
|
*
|
|
20
|
-
* Its instance is available in {@link module:engine/view/document~
|
|
20
|
+
* Its instance is available in {@link module:engine/view/document~ViewDocument#selection `Document#selection`}.
|
|
21
21
|
*
|
|
22
|
-
* It is similar to {@link module:engine/view/selection~
|
|
22
|
+
* It is similar to {@link module:engine/view/selection~ViewSelection} but
|
|
23
23
|
* it has a read-only API and can be modified only by the writer available in
|
|
24
|
-
* the {@link module:engine/view/view~
|
|
25
|
-
* (so via {@link module:engine/view/downcastwriter~
|
|
24
|
+
* the {@link module:engine/view/view~EditingView#change `View#change()`} block
|
|
25
|
+
* (so via {@link module:engine/view/downcastwriter~ViewDowncastWriter#setSelection `ViewDowncastWriter#setSelection()`}).
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export declare class ViewDocumentSelection extends /* #__PURE__ */ ViewDocumentSelection_base {
|
|
28
28
|
/**
|
|
29
|
-
* Selection is used internally (`
|
|
29
|
+
* Selection is used internally (`ViewDocumentSelection` is a proxy to that selection).
|
|
30
30
|
*/
|
|
31
31
|
private readonly _selection;
|
|
32
32
|
/**
|
|
33
|
-
* Creates new
|
|
33
|
+
* Creates new ViewDocumentSelection instance.
|
|
34
34
|
*
|
|
35
35
|
* ```ts
|
|
36
36
|
* // Creates collapsed selection at the position of given item and offset.
|
|
37
37
|
* const paragraph = writer.createContainerElement( 'paragraph' );
|
|
38
|
-
* const selection = new
|
|
38
|
+
* const selection = new ViewDocumentSelection( paragraph, offset );
|
|
39
39
|
*
|
|
40
|
-
* // Creates a range inside an {@link module:engine/view/element~
|
|
40
|
+
* // Creates a range inside an {@link module:engine/view/element~ViewElement element} which starts before the
|
|
41
41
|
* // first child of that element and ends after the last child of that element.
|
|
42
|
-
* const selection = new
|
|
42
|
+
* const selection = new ViewDocumentSelection( paragraph, 'in' );
|
|
43
43
|
*
|
|
44
|
-
* // Creates a range on an {@link module:engine/view/item~
|
|
44
|
+
* // Creates a range on an {@link module:engine/view/item~ViewItem item} which starts before the item and ends
|
|
45
45
|
* // just after the item.
|
|
46
|
-
* const selection = new
|
|
46
|
+
* const selection = new ViewDocumentSelection( paragraph, 'on' );
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
49
|
* `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
|
|
50
50
|
*
|
|
51
51
|
* ```ts
|
|
52
52
|
* // Creates backward selection.
|
|
53
|
-
* const selection = new
|
|
53
|
+
* const selection = new ViewDocumentSelection( element, 'in', { backward: true } );
|
|
54
54
|
* ```
|
|
55
55
|
*
|
|
56
56
|
* Fake selection does not render as browser native selection over selected elements and is hidden to the user.
|
|
@@ -62,43 +62,43 @@ export default class DocumentSelection extends /* #__PURE__ */ DocumentSelection
|
|
|
62
62
|
*
|
|
63
63
|
* ```ts
|
|
64
64
|
* // Creates fake selection with label.
|
|
65
|
-
* const selection = new
|
|
65
|
+
* const selection = new ViewDocumentSelection( element, 'in', { fake: true, label: 'foo' } );
|
|
66
66
|
* ```
|
|
67
67
|
*
|
|
68
68
|
* See also: {@link #constructor:SELECTABLE `constructor( selectable, options )`}.
|
|
69
69
|
*
|
|
70
70
|
* @label NODE_OFFSET
|
|
71
71
|
*/
|
|
72
|
-
constructor(selectable:
|
|
72
|
+
constructor(selectable: ViewNode, placeOrOffset: ViewPlaceOrOffset, options?: ViewSelectionOptions);
|
|
73
73
|
/**
|
|
74
|
-
* Creates new
|
|
74
|
+
* Creates new ViewDocumentSelection instance.
|
|
75
75
|
*
|
|
76
76
|
* ```ts
|
|
77
77
|
* // Creates empty selection without ranges.
|
|
78
|
-
* const selection = new
|
|
78
|
+
* const selection = new ViewDocumentSelection();
|
|
79
79
|
*
|
|
80
80
|
* // Creates selection at the given range.
|
|
81
81
|
* const range = writer.createRange( start, end );
|
|
82
|
-
* const selection = new
|
|
82
|
+
* const selection = new ViewDocumentSelection( range );
|
|
83
83
|
*
|
|
84
84
|
* // Creates selection at the given ranges
|
|
85
85
|
* const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
|
|
86
|
-
* const selection = new
|
|
86
|
+
* const selection = new ViewDocumentSelection( ranges );
|
|
87
87
|
*
|
|
88
88
|
* // Creates selection from the other selection.
|
|
89
89
|
* const otherSelection = writer.createSelection();
|
|
90
|
-
* const selection = new
|
|
90
|
+
* const selection = new ViewDocumentSelection( otherSelection );
|
|
91
91
|
*
|
|
92
92
|
* // Creates selection at the given position.
|
|
93
93
|
* const position = writer.createPositionAt( root, offset );
|
|
94
|
-
* const selection = new
|
|
94
|
+
* const selection = new ViewDocumentSelection( position );
|
|
95
95
|
* ```
|
|
96
96
|
*
|
|
97
97
|
* `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
|
|
98
98
|
*
|
|
99
99
|
* ```ts
|
|
100
100
|
* // Creates backward selection.
|
|
101
|
-
* const selection = new
|
|
101
|
+
* const selection = new ViewDocumentSelection( range, { backward: true } );
|
|
102
102
|
* ```
|
|
103
103
|
*
|
|
104
104
|
* Fake selection does not render as browser native selection over selected elements and is hidden to the user.
|
|
@@ -110,14 +110,14 @@ export default class DocumentSelection extends /* #__PURE__ */ DocumentSelection
|
|
|
110
110
|
*
|
|
111
111
|
* ```ts
|
|
112
112
|
* // Creates fake selection with label.
|
|
113
|
-
* const selection = new
|
|
113
|
+
* const selection = new ViewDocumentSelection( range, { fake: true, label: 'foo' } );
|
|
114
114
|
* ```
|
|
115
115
|
*
|
|
116
116
|
* See also: {@link #constructor:NODE_OFFSET `constructor( node, placeOrOffset, options )`}.
|
|
117
117
|
*
|
|
118
118
|
* @label SELECTABLE
|
|
119
119
|
*/
|
|
120
|
-
constructor(selectable?: Exclude<
|
|
120
|
+
constructor(selectable?: Exclude<ViewSelectable, ViewNode>, options?: ViewSelectionOptions);
|
|
121
121
|
/**
|
|
122
122
|
* Returns true if selection instance is marked as `fake`.
|
|
123
123
|
*
|
|
@@ -138,13 +138,13 @@ export default class DocumentSelection extends /* #__PURE__ */ DocumentSelection
|
|
|
138
138
|
*
|
|
139
139
|
* @see #focus
|
|
140
140
|
*/
|
|
141
|
-
get anchor():
|
|
141
|
+
get anchor(): ViewPosition | null;
|
|
142
142
|
/**
|
|
143
143
|
* Selection focus. Focus is a position where the selection ends.
|
|
144
144
|
*
|
|
145
145
|
* @see #anchor
|
|
146
146
|
*/
|
|
147
|
-
get focus():
|
|
147
|
+
get focus(): ViewPosition | null;
|
|
148
148
|
/**
|
|
149
149
|
* Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
|
|
150
150
|
* collapsed.
|
|
@@ -159,51 +159,52 @@ export default class DocumentSelection extends /* #__PURE__ */ DocumentSelection
|
|
|
159
159
|
*/
|
|
160
160
|
get isBackward(): boolean;
|
|
161
161
|
/**
|
|
162
|
-
* {@link module:engine/view/editableelement~
|
|
162
|
+
* {@link module:engine/view/editableelement~ViewEditableElement ViewEditableElement} instance that contains this selection, or `null`
|
|
163
163
|
* if the selection is not inside an editable element.
|
|
164
164
|
*/
|
|
165
|
-
get editableElement():
|
|
165
|
+
get editableElement(): ViewEditableElement | null;
|
|
166
166
|
/**
|
|
167
|
-
* Used for the compatibility with the {@link module:engine/view/selection~
|
|
167
|
+
* Used for the compatibility with the {@link module:engine/view/selection~ViewSelection#isEqual} method.
|
|
168
168
|
*
|
|
169
169
|
* @internal
|
|
170
170
|
*/
|
|
171
|
-
get _ranges(): Array<
|
|
171
|
+
get _ranges(): Array<ViewRange>;
|
|
172
172
|
/**
|
|
173
173
|
* Returns an iterable that contains copies of all ranges added to the selection.
|
|
174
174
|
*/
|
|
175
|
-
getRanges(): IterableIterator<
|
|
175
|
+
getRanges(): IterableIterator<ViewRange>;
|
|
176
176
|
/**
|
|
177
177
|
* Returns copy of the first range in the selection. First range is the one which
|
|
178
|
-
* {@link module:engine/view/range~
|
|
178
|
+
* {@link module:engine/view/range~ViewRange#start start} position
|
|
179
|
+
* {@link module:engine/view/position~ViewPosition#isBefore is before} start
|
|
179
180
|
* position of all other ranges (not to confuse with the first range added to the selection).
|
|
180
181
|
* Returns `null` if no ranges are added to selection.
|
|
181
182
|
*/
|
|
182
|
-
getFirstRange():
|
|
183
|
+
getFirstRange(): ViewRange | null;
|
|
183
184
|
/**
|
|
184
|
-
* Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~
|
|
185
|
-
* position {@link module:engine/view/position~
|
|
185
|
+
* Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~ViewRange#end end}
|
|
186
|
+
* position {@link module:engine/view/position~ViewPosition#isAfter is after} end position of all other ranges (not to confuse
|
|
186
187
|
* with the last range added to the selection). Returns `null` if no ranges are added to selection.
|
|
187
188
|
*/
|
|
188
|
-
getLastRange():
|
|
189
|
+
getLastRange(): ViewRange | null;
|
|
189
190
|
/**
|
|
190
191
|
* Returns copy of the first position in the selection. First position is the position that
|
|
191
|
-
* {@link module:engine/view/position~
|
|
192
|
+
* {@link module:engine/view/position~ViewPosition#isBefore is before} any other position in the selection ranges.
|
|
192
193
|
* Returns `null` if no ranges are added to selection.
|
|
193
194
|
*/
|
|
194
|
-
getFirstPosition():
|
|
195
|
+
getFirstPosition(): ViewPosition | null;
|
|
195
196
|
/**
|
|
196
197
|
* Returns copy of the last position in the selection. Last position is the position that
|
|
197
|
-
* {@link module:engine/view/position~
|
|
198
|
+
* {@link module:engine/view/position~ViewPosition#isAfter is after} any other position in the selection ranges.
|
|
198
199
|
* Returns `null` if no ranges are added to selection.
|
|
199
200
|
*/
|
|
200
|
-
getLastPosition():
|
|
201
|
+
getLastPosition(): ViewPosition | null;
|
|
201
202
|
/**
|
|
202
|
-
* Returns the selected element. {@link module:engine/view/element~
|
|
203
|
+
* Returns the selected element. {@link module:engine/view/element~ViewElement Element} is considered as selected if there is only
|
|
203
204
|
* one range in the selection, and that range contains exactly one element.
|
|
204
205
|
* Returns `null` if there is no selected element.
|
|
205
206
|
*/
|
|
206
|
-
getSelectedElement():
|
|
207
|
+
getSelectedElement(): ViewElement | null;
|
|
207
208
|
/**
|
|
208
209
|
* Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
|
|
209
210
|
* same number of ranges and all ranges from one selection equal to a range from other selection.
|
|
@@ -211,19 +212,19 @@ export default class DocumentSelection extends /* #__PURE__ */ DocumentSelection
|
|
|
211
212
|
* @param otherSelection Selection to compare with.
|
|
212
213
|
* @returns `true` if selections are equal, `false` otherwise.
|
|
213
214
|
*/
|
|
214
|
-
isEqual(otherSelection:
|
|
215
|
+
isEqual(otherSelection: ViewSelection | ViewDocumentSelection): boolean;
|
|
215
216
|
/**
|
|
216
217
|
* Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
|
|
217
|
-
* number of ranges, and all {@link module:engine/view/range~
|
|
218
|
+
* number of ranges, and all {@link module:engine/view/range~ViewRange#getTrimmed trimmed} ranges from one selection are
|
|
218
219
|
* equal to any trimmed range from other selection.
|
|
219
220
|
*
|
|
220
221
|
* @param otherSelection Selection to compare with.
|
|
221
222
|
* @returns `true` if selections are similar, `false` otherwise.
|
|
222
223
|
*/
|
|
223
|
-
isSimilar(otherSelection:
|
|
224
|
+
isSimilar(otherSelection: ViewSelection | ViewDocumentSelection): boolean;
|
|
224
225
|
/**
|
|
225
226
|
* Sets this selection's ranges and direction to the specified location based on the given
|
|
226
|
-
* {@link module:engine/view/selection~
|
|
227
|
+
* {@link module:engine/view/selection~ViewSelectable selectable}.
|
|
227
228
|
*
|
|
228
229
|
* ```ts
|
|
229
230
|
* // Sets selection to the given range.
|
|
@@ -246,14 +247,14 @@ export default class DocumentSelection extends /* #__PURE__ */ DocumentSelection
|
|
|
246
247
|
* documentSelection._setTo( paragraph, offset );
|
|
247
248
|
* ```
|
|
248
249
|
*
|
|
249
|
-
* Creates a range inside an {@link module:engine/view/element~
|
|
250
|
+
* Creates a range inside an {@link module:engine/view/element~ViewElement element} which starts before the first child of
|
|
250
251
|
* that element and ends after the last child of that element.
|
|
251
252
|
*
|
|
252
253
|
* ```ts
|
|
253
254
|
* documentSelection._setTo( paragraph, 'in' );
|
|
254
255
|
* ```
|
|
255
256
|
*
|
|
256
|
-
* Creates a range on an {@link module:engine/view/item~
|
|
257
|
+
* Creates a range on an {@link module:engine/view/item~ViewItem item} which starts before the item and ends just after the item.
|
|
257
258
|
*
|
|
258
259
|
* ```ts
|
|
259
260
|
* documentSelection._setTo( paragraph, 'on' );
|
|
@@ -284,23 +285,24 @@ export default class DocumentSelection extends /* #__PURE__ */ DocumentSelection
|
|
|
284
285
|
* @internal
|
|
285
286
|
* @fires change
|
|
286
287
|
*/
|
|
287
|
-
_setTo(...args: Parameters<
|
|
288
|
+
_setTo(...args: Parameters<ViewSelection['setTo']>): void;
|
|
288
289
|
/**
|
|
289
290
|
* Moves {@link #focus} to the specified location.
|
|
290
291
|
*
|
|
291
|
-
* The location can be specified in the same form as
|
|
292
|
+
* The location can be specified in the same form as
|
|
293
|
+
* {@link module:engine/view/view~EditingView#createPositionAt view.createPositionAt()}
|
|
292
294
|
* parameters.
|
|
293
295
|
*
|
|
294
296
|
* @internal
|
|
295
297
|
* @fires change
|
|
296
|
-
* @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~
|
|
298
|
+
* @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~ViewItem view item}.
|
|
297
299
|
*/
|
|
298
|
-
_setFocus(itemOrPosition:
|
|
300
|
+
_setFocus(itemOrPosition: ViewItem | ViewPosition, offset?: ViewPositionOffset): void;
|
|
299
301
|
}
|
|
300
302
|
/**
|
|
301
|
-
* Fired whenever selection ranges are changed through {@link ~
|
|
303
|
+
* Fired whenever selection ranges are changed through {@link ~ViewDocumentSelection Selection API}.
|
|
302
304
|
*
|
|
303
|
-
* @eventName ~
|
|
305
|
+
* @eventName ~ViewDocumentSelection#change
|
|
304
306
|
*/
|
|
305
307
|
export type ViewDocumentSelectionChangeEvent = ViewSelectionChangeEvent;
|
|
306
308
|
export {};
|