@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
package/src/view/view.js
CHANGED
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module engine/view/view
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import KeyObserver from './observer/keyobserver.js';
|
|
16
|
-
import FakeSelectionObserver from './observer/fakeselectionobserver.js';
|
|
17
|
-
import MutationObserver from './observer/mutationobserver.js';
|
|
18
|
-
import SelectionObserver from './observer/selectionobserver.js';
|
|
19
|
-
import FocusObserver from './observer/focusobserver.js';
|
|
20
|
-
import CompositionObserver from './observer/compositionobserver.js';
|
|
21
|
-
import InputObserver from './observer/inputobserver.js';
|
|
22
|
-
import ArrowKeysObserver from './observer/arrowkeysobserver.js';
|
|
23
|
-
import TabObserver from './observer/tabobserver.js';
|
|
8
|
+
import { ViewDocument } from './document.js';
|
|
9
|
+
import { ViewDowncastWriter } from './downcastwriter.js';
|
|
10
|
+
import { ViewRenderer } from './renderer.js';
|
|
11
|
+
import { ViewDomConverter } from './domconverter.js';
|
|
12
|
+
import { ViewPosition } from './position.js';
|
|
13
|
+
import { ViewRange } from './range.js';
|
|
14
|
+
import { ViewSelection } from './selection.js';
|
|
15
|
+
import { KeyObserver } from './observer/keyobserver.js';
|
|
16
|
+
import { FakeSelectionObserver } from './observer/fakeselectionobserver.js';
|
|
17
|
+
import { MutationObserver } from './observer/mutationobserver.js';
|
|
18
|
+
import { SelectionObserver } from './observer/selectionobserver.js';
|
|
19
|
+
import { FocusObserver } from './observer/focusobserver.js';
|
|
20
|
+
import { CompositionObserver } from './observer/compositionobserver.js';
|
|
21
|
+
import { InputObserver } from './observer/inputobserver.js';
|
|
22
|
+
import { ArrowKeysObserver } from './observer/arrowkeysobserver.js';
|
|
23
|
+
import { TabObserver } from './observer/tabobserver.js';
|
|
24
24
|
import { CKEditorError, env, ObservableMixin, scrollViewportToShowTarget } from '@ckeditor/ckeditor5-utils';
|
|
25
25
|
import { injectUiElementHandling } from './uielement.js';
|
|
26
26
|
import { injectQuirksHandling } from './filler.js';
|
|
@@ -30,8 +30,8 @@ import { cloneDeep } from 'es-toolkit/compat';
|
|
|
30
30
|
* abstraction over the DOM structure and events and hide all browsers quirks.
|
|
31
31
|
*
|
|
32
32
|
* View controller renders view document to DOM whenever view structure changes. To determine when view can be rendered,
|
|
33
|
-
* all changes need to be done using the {@link module:engine/view/view~
|
|
34
|
-
* {@link module:engine/view/downcastwriter~
|
|
33
|
+
* all changes need to be done using the {@link module:engine/view/view~EditingView#change} method, using
|
|
34
|
+
* {@link module:engine/view/downcastwriter~ViewDowncastWriter}:
|
|
35
35
|
*
|
|
36
36
|
* ```ts
|
|
37
37
|
* view.change( writer => {
|
|
@@ -40,7 +40,7 @@ import { cloneDeep } from 'es-toolkit/compat';
|
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* View controller also register {@link module:engine/view/observer/observer~Observer observers} which observes changes
|
|
43
|
-
* on DOM and fire events on the {@link module:engine/view/document~
|
|
43
|
+
* on DOM and fire events on the {@link module:engine/view/document~ViewDocument Document}.
|
|
44
44
|
* Note that the following observers are added by the class constructor and are always available:
|
|
45
45
|
*
|
|
46
46
|
* * {@link module:engine/view/observer/selectionobserver~SelectionObserver},
|
|
@@ -52,19 +52,20 @@ import { cloneDeep } from 'es-toolkit/compat';
|
|
|
52
52
|
* * {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.
|
|
53
53
|
* * {@link module:engine/view/observer/tabobserver~TabObserver}.
|
|
54
54
|
*
|
|
55
|
-
* This class also {@link module:engine/view/view~
|
|
55
|
+
* This class also {@link module:engine/view/view~EditingView#attachDomRoot binds the DOM and the view elements}.
|
|
56
56
|
*
|
|
57
57
|
* If you do not need full a DOM - view management, and only want to transform a tree of view elements to a tree of DOM
|
|
58
|
-
* elements you do not need this controller. You can use the {@link module:engine/view/domconverter~
|
|
58
|
+
* elements you do not need this controller. You can use the {@link module:engine/view/domconverter~ViewDomConverter ViewDomConverter}
|
|
59
|
+
* instead.
|
|
59
60
|
*/
|
|
60
|
-
export
|
|
61
|
+
export class EditingView extends /* #__PURE__ */ ObservableMixin() {
|
|
61
62
|
/**
|
|
62
|
-
* Instance of the {@link module:engine/view/document~
|
|
63
|
+
* Instance of the {@link module:engine/view/document~ViewDocument} associated with this view controller.
|
|
63
64
|
*/
|
|
64
65
|
document;
|
|
65
66
|
/**
|
|
66
|
-
* Instance of the {@link module:engine/view/domconverter~
|
|
67
|
-
* {@link module:engine/view/view~
|
|
67
|
+
* Instance of the {@link module:engine/view/domconverter~ViewDomConverter domConverter} used by
|
|
68
|
+
* {@link module:engine/view/view~EditingView#_renderer renderer}
|
|
68
69
|
* and {@link module:engine/view/observer/observer~Observer observers}.
|
|
69
70
|
*/
|
|
70
71
|
domConverter;
|
|
@@ -73,13 +74,13 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
73
74
|
*/
|
|
74
75
|
domRoots = new Map();
|
|
75
76
|
/**
|
|
76
|
-
* Instance of the {@link module:engine/view/renderer~
|
|
77
|
+
* Instance of the {@link module:engine/view/renderer~ViewRenderer renderer}.
|
|
77
78
|
*/
|
|
78
79
|
_renderer;
|
|
79
80
|
/**
|
|
80
81
|
* A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element
|
|
81
|
-
* is {@link module:engine/view/view~
|
|
82
|
-
* the view is destroyed ({@link module:engine/view/view~
|
|
82
|
+
* is {@link module:engine/view/view~EditingView#attachDomRoot attached} to the view so later on, when
|
|
83
|
+
* the view is destroyed ({@link module:engine/view/view~EditingView#detachDomRoot}), they can be easily restored.
|
|
83
84
|
* This way, the DOM element can go back to the (clean) state as if the editing view never used it.
|
|
84
85
|
*/
|
|
85
86
|
_initialDomRootAttributes = new WeakMap();
|
|
@@ -88,7 +89,7 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
88
89
|
*/
|
|
89
90
|
_observers = new Map();
|
|
90
91
|
/**
|
|
91
|
-
*
|
|
92
|
+
* ViewDowncastWriter instance used in {@link #change change method} callbacks.
|
|
92
93
|
*/
|
|
93
94
|
_writer;
|
|
94
95
|
/**
|
|
@@ -113,16 +114,16 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
113
114
|
*/
|
|
114
115
|
constructor(stylesProcessor) {
|
|
115
116
|
super();
|
|
116
|
-
this.document = new
|
|
117
|
-
this.domConverter = new
|
|
117
|
+
this.document = new ViewDocument(stylesProcessor);
|
|
118
|
+
this.domConverter = new ViewDomConverter(this.document);
|
|
118
119
|
this.set('isRenderingInProgress', false);
|
|
119
120
|
this.set('hasDomSelection', false);
|
|
120
|
-
this._renderer = new
|
|
121
|
+
this._renderer = new ViewRenderer(this.domConverter, this.document.selection);
|
|
121
122
|
this._renderer.bind('isFocused', 'isSelecting', 'isComposing')
|
|
122
123
|
.to(this.document, 'isFocused', 'isSelecting', 'isComposing');
|
|
123
|
-
this._writer = new
|
|
124
|
+
this._writer = new ViewDowncastWriter(this.document);
|
|
124
125
|
// Add default observers.
|
|
125
|
-
// Make sure that this list matches
|
|
126
|
+
// Make sure that this list matches AlwaysRegisteredViewObservers type.
|
|
126
127
|
this.addObserver(MutationObserver);
|
|
127
128
|
this.addObserver(FocusObserver);
|
|
128
129
|
this.addObserver(SelectionObserver);
|
|
@@ -174,7 +175,7 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
174
175
|
}
|
|
175
176
|
/**
|
|
176
177
|
* Attaches a DOM root element to the view element and enable all observers on that element.
|
|
177
|
-
* Also {@link module:engine/view/renderer~
|
|
178
|
+
* Also {@link module:engine/view/renderer~ViewRenderer#markToSync mark element} to be synchronized
|
|
178
179
|
* with the view what means that all child nodes will be removed and replaced with content of the view root.
|
|
179
180
|
*
|
|
180
181
|
* This method also will change view element name as the same as tag name of given dom root.
|
|
@@ -369,7 +370,7 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
369
370
|
scrollViewportToShowTarget(options);
|
|
370
371
|
}
|
|
371
372
|
/**
|
|
372
|
-
* It will focus DOM element representing {@link module:engine/view/editableelement~
|
|
373
|
+
* It will focus DOM element representing {@link module:engine/view/editableelement~ViewEditableElement ViewEditableElement}
|
|
373
374
|
* that is currently having selection inside.
|
|
374
375
|
*/
|
|
375
376
|
focus() {
|
|
@@ -411,7 +412,7 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
411
412
|
* ```
|
|
412
413
|
*
|
|
413
414
|
* When the outermost change block is done and rendering to the DOM is over the
|
|
414
|
-
* {@link module:engine/view/view~
|
|
415
|
+
* {@link module:engine/view/view~EditingView#event:render `View#render`} event is fired.
|
|
415
416
|
*
|
|
416
417
|
* This method throws a `applying-view-changes-on-rendering` error when
|
|
417
418
|
* the change block is used after rendering to the DOM has started.
|
|
@@ -426,10 +427,10 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
426
427
|
* cause some unexpected behaviour and inconsistency between the DOM and the view.
|
|
427
428
|
* This may be caused by:
|
|
428
429
|
*
|
|
429
|
-
* * calling {@link module:engine/view/view~
|
|
430
|
-
* process,
|
|
431
|
-
* * calling {@link module:engine/view/view~
|
|
432
|
-
*
|
|
430
|
+
* * calling {@link module:engine/view/view~EditingView#change} or {@link module:engine/view/view~EditingView#forceRender}
|
|
431
|
+
* during rendering process,
|
|
432
|
+
* * calling {@link module:engine/view/view~EditingView#change} or {@link module:engine/view/view~EditingView#forceRender}
|
|
433
|
+
* inside of {@link module:engine/view/document~ViewDocument#registerPostFixer post-fixer function}.
|
|
433
434
|
*
|
|
434
435
|
* @error cannot-change-view-tree
|
|
435
436
|
*/
|
|
@@ -463,7 +464,7 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
463
464
|
}
|
|
464
465
|
}
|
|
465
466
|
/**
|
|
466
|
-
* Forces rendering {@link module:engine/view/document~
|
|
467
|
+
* Forces rendering {@link module:engine/view/document~ViewDocument view document} to DOM. If any view changes are
|
|
467
468
|
* currently in progress, rendering will start after all {@link #change change blocks} are processed.
|
|
468
469
|
*
|
|
469
470
|
* Note that this method is dedicated for special cases. All view changes should be wrapped in the {@link #change}
|
|
@@ -490,20 +491,20 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
490
491
|
/**
|
|
491
492
|
* Creates position at the given location. The location can be specified as:
|
|
492
493
|
*
|
|
493
|
-
* * a {@link module:engine/view/position~
|
|
494
|
+
* * a {@link module:engine/view/position~ViewPosition position},
|
|
494
495
|
* * parent element and offset (offset defaults to `0`),
|
|
495
496
|
* * parent element and `'end'` (sets position at the end of that element),
|
|
496
|
-
* * {@link module:engine/view/item~
|
|
497
|
+
* * {@link module:engine/view/item~ViewItem view item} and `'before'` or `'after'` (sets position before or after given view item).
|
|
497
498
|
*
|
|
498
499
|
* This method is a shortcut to other constructors such as:
|
|
499
500
|
*
|
|
500
501
|
* * {@link #createPositionBefore},
|
|
501
502
|
* * {@link #createPositionAfter},
|
|
502
503
|
*
|
|
503
|
-
* @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~
|
|
504
|
+
* @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~ViewItem view item}.
|
|
504
505
|
*/
|
|
505
506
|
createPositionAt(itemOrPosition, offset) {
|
|
506
|
-
return
|
|
507
|
+
return ViewPosition._createAt(itemOrPosition, offset);
|
|
507
508
|
}
|
|
508
509
|
/**
|
|
509
510
|
* Creates a new position after given view item.
|
|
@@ -511,7 +512,7 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
511
512
|
* @param item View item after which the position should be located.
|
|
512
513
|
*/
|
|
513
514
|
createPositionAfter(item) {
|
|
514
|
-
return
|
|
515
|
+
return ViewPosition._createAfter(item);
|
|
515
516
|
}
|
|
516
517
|
/**
|
|
517
518
|
* Creates a new position before given view item.
|
|
@@ -519,36 +520,36 @@ export default class View extends /* #__PURE__ */ ObservableMixin() {
|
|
|
519
520
|
* @param item View item before which the position should be located.
|
|
520
521
|
*/
|
|
521
522
|
createPositionBefore(item) {
|
|
522
|
-
return
|
|
523
|
+
return ViewPosition._createBefore(item);
|
|
523
524
|
}
|
|
524
525
|
/**
|
|
525
526
|
* Creates a range spanning from `start` position to `end` position.
|
|
526
527
|
*
|
|
527
|
-
* **Note:** This factory method creates it's own {@link module:engine/view/position~
|
|
528
|
+
* **Note:** This factory method creates it's own {@link module:engine/view/position~ViewPosition} instances basing on passed values.
|
|
528
529
|
*
|
|
529
530
|
* @param start Start position.
|
|
530
531
|
* @param end End position. If not set, range will be collapsed at `start` position.
|
|
531
532
|
*/
|
|
532
533
|
createRange(start, end) {
|
|
533
|
-
return new
|
|
534
|
+
return new ViewRange(start, end);
|
|
534
535
|
}
|
|
535
536
|
/**
|
|
536
|
-
* Creates a range that starts before given {@link module:engine/view/item~
|
|
537
|
+
* Creates a range that starts before given {@link module:engine/view/item~ViewItem view item} and ends after it.
|
|
537
538
|
*/
|
|
538
539
|
createRangeOn(item) {
|
|
539
|
-
return
|
|
540
|
+
return ViewRange._createOn(item);
|
|
540
541
|
}
|
|
541
542
|
/**
|
|
542
|
-
* Creates a range inside an {@link module:engine/view/element~
|
|
543
|
+
* Creates a range inside an {@link module:engine/view/element~ViewElement element} which starts before the first child of
|
|
543
544
|
* that element and ends after the last child of that element.
|
|
544
545
|
*
|
|
545
546
|
* @param element Element which is a parent for the range.
|
|
546
547
|
*/
|
|
547
548
|
createRangeIn(element) {
|
|
548
|
-
return
|
|
549
|
+
return ViewRange._createIn(element);
|
|
549
550
|
}
|
|
550
551
|
createSelection(...args) {
|
|
551
|
-
return new
|
|
552
|
+
return new ViewSelection(...args);
|
|
552
553
|
}
|
|
553
554
|
/**
|
|
554
555
|
* Disables or enables rendering. If the flag is set to `true` then the rendering will be disabled.
|