@ckeditor/ckeditor5-engine 48.2.0-alpha.7 → 48.3.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/controller/datacontroller.d.ts +329 -328
- package/dist/controller/editingcontroller.d.ts +95 -94
- package/dist/conversion/comparemarkers.d.ts +45 -45
- package/dist/conversion/conversion.d.ts +474 -474
- package/dist/conversion/conversionhelpers.d.ts +21 -21
- package/dist/conversion/downcastdispatcher.d.ts +539 -538
- package/dist/conversion/downcasthelpers.d.ts +1129 -1129
- package/dist/conversion/mapper.d.ts +692 -697
- package/dist/conversion/modelconsumable.d.ts +196 -196
- package/dist/conversion/upcastdispatcher.d.ts +483 -482
- package/dist/conversion/upcasthelpers.d.ts +491 -491
- package/dist/conversion/viewconsumable.d.ts +330 -330
- package/dist/dataprocessor/basichtmlwriter.d.ts +15 -15
- package/dist/dataprocessor/dataprocessor.d.ts +57 -57
- package/dist/dataprocessor/htmldataprocessor.d.ts +72 -72
- package/dist/dataprocessor/htmlwriter.d.ts +11 -11
- package/dist/dataprocessor/xmldataprocessor.d.ts +86 -86
- package/dist/dev-utils/model.d.ts +128 -123
- package/dist/dev-utils/operationreplayer.d.ts +49 -49
- package/dist/dev-utils/utils.d.ts +33 -33
- package/dist/dev-utils/view.d.ts +314 -309
- package/dist/engineconfig.d.ts +39 -39
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +150 -150
- package/dist/index.js +34026 -40107
- package/dist/index.js.map +1 -1
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/model/batch.d.ts +86 -86
- package/dist/model/differ.d.ts +504 -504
- package/dist/model/document.d.ts +265 -268
- package/dist/model/documentfragment.d.ts +214 -214
- package/dist/model/documentselection.d.ts +406 -410
- package/dist/model/element.d.ts +182 -182
- package/dist/model/history.d.ts +109 -109
- package/dist/model/item.d.ts +9 -9
- package/dist/model/liveposition.d.ts +70 -69
- package/dist/model/liverange.d.ts +93 -92
- package/dist/model/markercollection.d.ts +317 -324
- package/dist/model/model.d.ts +889 -909
- package/dist/model/node.d.ts +254 -254
- package/dist/model/nodelist.d.ts +110 -110
- package/dist/model/operation/attributeoperation.d.ts +98 -98
- package/dist/model/operation/detachoperation.d.ts +57 -57
- package/dist/model/operation/insertoperation.d.ts +85 -85
- package/dist/model/operation/markeroperation.d.ts +87 -87
- package/dist/model/operation/mergeoperation.d.ts +95 -95
- package/dist/model/operation/moveoperation.d.ts +97 -97
- package/dist/model/operation/nooperation.d.ts +33 -33
- package/dist/model/operation/operation.d.ts +94 -94
- package/dist/model/operation/operationfactory.d.ts +14 -14
- package/dist/model/operation/renameoperation.d.ts +78 -78
- package/dist/model/operation/rootattributeoperation.d.ts +93 -93
- package/dist/model/operation/rootoperation.d.ts +71 -71
- package/dist/model/operation/splitoperation.d.ts +104 -104
- package/dist/model/operation/transform.d.ts +91 -91
- package/dist/model/operation/utils.d.ts +58 -58
- package/dist/model/position.d.ts +535 -535
- package/dist/model/range.d.ts +458 -453
- package/dist/model/rootelement.d.ts +55 -55
- package/dist/model/schema.d.ts +1325 -1327
- package/dist/model/selection.d.ts +452 -471
- package/dist/model/text.d.ts +62 -62
- package/dist/model/textproxy.d.ts +140 -140
- package/dist/model/treewalker.d.ts +190 -190
- package/dist/model/typecheckable.d.ts +281 -281
- package/dist/model/utils/autoparagraphing.d.ts +29 -29
- package/dist/model/utils/deletecontent.d.ts +68 -68
- package/dist/model/utils/getselectedcontent.d.ts +27 -27
- package/dist/model/utils/insertcontent.d.ts +42 -42
- package/dist/model/utils/insertobject.d.ts +41 -41
- package/dist/model/utils/modifyselection.d.ts +44 -44
- package/dist/model/utils/selection-post-fixer.d.ts +71 -71
- package/dist/model/writer.d.ts +854 -854
- package/dist/view/attributeelement.d.ts +123 -123
- package/dist/view/containerelement.d.ts +49 -49
- package/dist/view/datatransfer.d.ts +70 -70
- package/dist/view/document.d.ts +175 -177
- package/dist/view/documentfragment.d.ts +158 -157
- package/dist/view/documentselection.d.ts +308 -307
- package/dist/view/domconverter.d.ts +612 -657
- package/dist/view/downcastwriter.d.ts +1006 -1006
- package/dist/view/editableelement.d.ts +64 -63
- package/dist/view/element.d.ts +754 -754
- package/dist/view/elementdefinition.d.ts +79 -79
- package/dist/view/emptyelement.d.ts +42 -42
- package/dist/view/filler.d.ts +75 -75
- package/dist/view/item.d.ts +9 -9
- package/dist/view/matcher.d.ts +412 -487
- package/dist/view/node.d.ts +164 -163
- package/dist/view/observer/arrowkeysobserver.d.ts +37 -37
- package/dist/view/observer/bubblingemittermixin.d.ts +163 -153
- package/dist/view/observer/bubblingeventinfo.d.ts +45 -42
- package/dist/view/observer/clickobserver.d.ts +36 -36
- package/dist/view/observer/compositionobserver.d.ts +67 -67
- package/dist/view/observer/domeventdata.d.ts +46 -46
- package/dist/view/observer/domeventobserver.d.ts +77 -74
- package/dist/view/observer/fakeselectionobserver.d.ts +42 -42
- package/dist/view/observer/focusobserver.d.ts +84 -84
- package/dist/view/observer/inputobserver.d.ts +76 -76
- package/dist/view/observer/keyobserver.d.ts +53 -53
- package/dist/view/observer/mouseobserver.d.ts +73 -73
- package/dist/view/observer/mutationobserver.d.ts +101 -101
- package/dist/view/observer/observer.d.ts +84 -83
- package/dist/view/observer/pointerobserver.d.ts +63 -63
- package/dist/view/observer/selectionobserver.d.ts +136 -136
- package/dist/view/observer/tabobserver.d.ts +38 -38
- package/dist/view/observer/touchobserver.d.ts +60 -60
- package/dist/view/placeholder.d.ts +80 -80
- package/dist/view/position.d.ts +187 -187
- package/dist/view/range.d.ts +282 -282
- package/dist/view/rawelement.d.ts +72 -72
- package/dist/view/renderer.d.ts +270 -272
- package/dist/view/rooteditableelement.d.ts +43 -43
- package/dist/view/selection.d.ts +356 -369
- package/dist/view/styles/background.d.ts +15 -15
- package/dist/view/styles/border.d.ts +27 -27
- package/dist/view/styles/margin.d.ts +12 -12
- package/dist/view/styles/padding.d.ts +12 -12
- package/dist/view/styles/utils.d.ts +72 -72
- package/dist/view/stylesmap.d.ts +715 -715
- package/dist/view/text.d.ts +75 -75
- package/dist/view/textproxy.d.ts +92 -92
- package/dist/view/tokenlist.d.ts +104 -104
- package/dist/view/treewalker.d.ts +201 -201
- package/dist/view/typecheckable.d.ts +445 -445
- package/dist/view/uielement.d.ts +93 -93
- package/dist/view/upcastwriter.d.ts +412 -412
- package/dist/view/view.d.ts +466 -469
- package/package.json +2 -2
package/dist/view/renderer.d.ts
CHANGED
|
@@ -1,277 +1,275 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type
|
|
6
|
-
import {
|
|
7
|
-
import { type
|
|
8
|
-
import { type
|
|
9
|
-
import { type
|
|
10
|
-
import
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
import { type ObservableMixinConstructor } from "@ckeditor/ckeditor5-utils";
|
|
6
|
+
import type { ViewDocumentChangeType } from "./document.js";
|
|
7
|
+
import { type ViewDocumentSelection } from "./documentselection.js";
|
|
8
|
+
import { type ViewDomConverter } from "./domconverter.js";
|
|
9
|
+
import { type ViewElement } from "./element.js";
|
|
10
|
+
import { type ViewNode } from "./node.js";
|
|
11
|
+
import "../../theme/renderer.css";
|
|
11
12
|
type DomDocument = globalThis.Document;
|
|
12
|
-
declare const
|
|
13
|
-
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
14
|
-
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
15
|
-
};
|
|
13
|
+
declare const ViewRendererBase: ObservableMixinConstructor;
|
|
16
14
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export declare class ViewRenderer extends
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
15
|
+
* Renderer is responsible for updating the DOM structure and the DOM selection based on
|
|
16
|
+
* the {@link module:engine/view/renderer~ViewRenderer#markToSync information about updated view nodes}.
|
|
17
|
+
* In other words, it renders the view to the DOM.
|
|
18
|
+
*
|
|
19
|
+
* Its main responsibility is to make only the necessary, minimal changes to the DOM. However, unlike in many
|
|
20
|
+
* virtual DOM implementations, the primary reason for doing minimal changes is not the performance but ensuring
|
|
21
|
+
* that native editing features such as text composition, autocompletion, spell checking, selection's x-index are
|
|
22
|
+
* affected as little as possible.
|
|
23
|
+
*
|
|
24
|
+
* Renderer uses {@link module:engine/view/domconverter~ViewDomConverter} to transform view nodes and positions
|
|
25
|
+
* to and from the DOM.
|
|
26
|
+
*/
|
|
27
|
+
export declare class ViewRenderer extends ViewRendererBase {
|
|
28
|
+
/**
|
|
29
|
+
* Set of DOM Documents instances.
|
|
30
|
+
*/
|
|
31
|
+
readonly domDocuments: Set<DomDocument>;
|
|
32
|
+
/**
|
|
33
|
+
* Converter instance.
|
|
34
|
+
*/
|
|
35
|
+
readonly domConverter: ViewDomConverter;
|
|
36
|
+
/**
|
|
37
|
+
* Set of nodes which attributes changed and may need to be rendered.
|
|
38
|
+
*/
|
|
39
|
+
readonly markedAttributes: Set<ViewElement>;
|
|
40
|
+
/**
|
|
41
|
+
* Set of elements which child lists changed and may need to be rendered.
|
|
42
|
+
*/
|
|
43
|
+
readonly markedChildren: Set<ViewElement>;
|
|
44
|
+
/**
|
|
45
|
+
* Set of text nodes which text data changed and may need to be rendered.
|
|
46
|
+
*/
|
|
47
|
+
readonly markedTexts: Set<ViewNode>;
|
|
48
|
+
/**
|
|
49
|
+
* View selection. Renderer updates DOM selection based on the view selection.
|
|
50
|
+
*/
|
|
51
|
+
readonly selection: ViewDocumentSelection;
|
|
52
|
+
/**
|
|
53
|
+
* Indicates if the view document is focused and selection can be rendered. Selection will not be rendered if
|
|
54
|
+
* this is set to `false`.
|
|
55
|
+
*
|
|
56
|
+
* @observable
|
|
57
|
+
*/
|
|
58
|
+
readonly isFocused: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Indicates whether the user is making a selection in the document (e.g. holding the mouse button and moving the cursor).
|
|
61
|
+
* When they stop selecting, the property goes back to `false`.
|
|
62
|
+
*
|
|
63
|
+
* Note: In some browsers, the renderer will stop rendering the selection and inline fillers while the user is making
|
|
64
|
+
* a selection to avoid glitches in DOM selection
|
|
65
|
+
* (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).
|
|
66
|
+
*
|
|
67
|
+
* @observable
|
|
68
|
+
*/
|
|
69
|
+
readonly isSelecting: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* True if composition is in progress inside the document.
|
|
72
|
+
*
|
|
73
|
+
* This property is bound to the {@link module:engine/view/document~ViewDocument#isComposing `Document#isComposing`} property.
|
|
74
|
+
*
|
|
75
|
+
* @observable
|
|
76
|
+
*/
|
|
77
|
+
readonly isComposing: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The text node in which the inline filler was rendered.
|
|
80
|
+
*/
|
|
81
|
+
private _inlineFiller;
|
|
82
|
+
/**
|
|
83
|
+
* DOM element containing fake selection.
|
|
84
|
+
*/
|
|
85
|
+
private _fakeSelectionContainer;
|
|
86
|
+
/**
|
|
87
|
+
* Creates a renderer instance.
|
|
88
|
+
*
|
|
89
|
+
* @param domConverter Converter instance.
|
|
90
|
+
* @param selection View selection.
|
|
91
|
+
*/
|
|
92
|
+
constructor(domConverter: ViewDomConverter, selection: ViewDocumentSelection);
|
|
93
|
+
/**
|
|
94
|
+
* Marks a view node to be updated in the DOM by {@link #render `render()`}.
|
|
95
|
+
*
|
|
96
|
+
* Note that only view nodes whose parents have corresponding DOM elements need to be marked to be synchronized.
|
|
97
|
+
*
|
|
98
|
+
* @see #markedAttributes
|
|
99
|
+
* @see #markedChildren
|
|
100
|
+
* @see #markedTexts
|
|
101
|
+
*
|
|
102
|
+
* @param type Type of the change.
|
|
103
|
+
* @param node ViewNode to be marked.
|
|
104
|
+
*/
|
|
105
|
+
markToSync(type: ViewDocumentChangeType, node: ViewNode): void;
|
|
106
|
+
/**
|
|
107
|
+
* Renders all buffered changes ({@link #markedAttributes}, {@link #markedChildren} and {@link #markedTexts}) and
|
|
108
|
+
* the current view selection (if needed) to the DOM by applying a minimal set of changes to it.
|
|
109
|
+
*
|
|
110
|
+
* Renderer tries not to break the text composition (e.g. IME) and x-index of the selection,
|
|
111
|
+
* so it does as little as it is needed to update the DOM.
|
|
112
|
+
*
|
|
113
|
+
* Renderer also handles {@link module:engine/view/filler fillers}. Especially, it checks if the inline filler is needed
|
|
114
|
+
* at the selection position and adds or removes it. To prevent breaking text composition inline filler will not be
|
|
115
|
+
* removed as long as the selection is in the text node which needed it at first.
|
|
116
|
+
*/
|
|
117
|
+
render(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Updates mappings of view element's children.
|
|
120
|
+
*
|
|
121
|
+
* Children that were replaced in the view structure by similar elements (same tag name) are treated as 'replaced'.
|
|
122
|
+
* This means that their mappings can be updated so the new view elements are mapped to the existing DOM elements.
|
|
123
|
+
* Thanks to that these elements do not need to be re-rendered completely.
|
|
124
|
+
*
|
|
125
|
+
* @param viewElement The view element whose children mappings will be updated.
|
|
126
|
+
*/
|
|
127
|
+
private _updateChildrenMappings;
|
|
128
|
+
/**
|
|
129
|
+
* Updates mappings of a given view element.
|
|
130
|
+
*
|
|
131
|
+
* @param viewElement The view element whose mappings will be updated.
|
|
132
|
+
* @param domElement The DOM element representing the given view element.
|
|
133
|
+
*/
|
|
134
|
+
private _updateElementMappings;
|
|
135
|
+
/**
|
|
136
|
+
* Gets the position of the inline filler based on the current selection.
|
|
137
|
+
* Here, we assume that we know that the filler is needed and
|
|
138
|
+
* {@link #_isSelectionInInlineFiller is at the selection position}, and, since it is needed,
|
|
139
|
+
* it is somewhere at the selection position.
|
|
140
|
+
*
|
|
141
|
+
* Note: The filler position cannot be restored based on the filler's DOM text node, because
|
|
142
|
+
* when this method is called (before rendering), the bindings will often be broken. View-to-DOM
|
|
143
|
+
* bindings are only dependable after rendering.
|
|
144
|
+
*/
|
|
145
|
+
private _getInlineFillerPosition;
|
|
146
|
+
/**
|
|
147
|
+
* Returns `true` if the selection has not left the inline filler's text node.
|
|
148
|
+
* If it is `true`, it means that the filler had been added for a reason and the selection did not
|
|
149
|
+
* leave the filler's text node. For example, the user can be in the middle of a composition so it should not be touched.
|
|
150
|
+
*
|
|
151
|
+
* @returns `true` if the inline filler and selection are in the same place.
|
|
152
|
+
*/
|
|
153
|
+
private _isSelectionInInlineFiller;
|
|
154
|
+
/**
|
|
155
|
+
* Removes the inline filler.
|
|
156
|
+
*/
|
|
157
|
+
private _removeInlineFiller;
|
|
158
|
+
/**
|
|
159
|
+
* Checks if the inline {@link module:engine/view/filler filler} should be added.
|
|
160
|
+
*
|
|
161
|
+
* @returns `true` if the inline filler should be added.
|
|
162
|
+
*/
|
|
163
|
+
private _needsInlineFillerAtSelection;
|
|
164
|
+
/**
|
|
165
|
+
* Checks if text needs to be updated and possibly updates it.
|
|
166
|
+
*
|
|
167
|
+
* @param viewText View text to update.
|
|
168
|
+
* @param options.inlineFillerPosition The position where the inline filler should be rendered.
|
|
169
|
+
*/
|
|
170
|
+
private _updateText;
|
|
171
|
+
/**
|
|
172
|
+
* Checks if attribute list needs to be updated and possibly updates it.
|
|
173
|
+
*
|
|
174
|
+
* @param viewElement The view element to update.
|
|
175
|
+
*/
|
|
176
|
+
private _updateAttrs;
|
|
177
|
+
/**
|
|
178
|
+
* Checks if elements child list needs to be updated and possibly updates it.
|
|
179
|
+
*
|
|
180
|
+
* Note that on Android, to reduce the risk of composition breaks, it tries to update data of an existing
|
|
181
|
+
* child text nodes instead of replacing them completely.
|
|
182
|
+
*
|
|
183
|
+
* @param viewElement View element to update.
|
|
184
|
+
* @param options.inlineFillerPosition The position where the inline filler should be rendered.
|
|
185
|
+
*/
|
|
186
|
+
private _updateChildren;
|
|
187
|
+
/**
|
|
188
|
+
* Shorthand for diffing two arrays or node lists of DOM nodes.
|
|
189
|
+
*
|
|
190
|
+
* @param actualDomChildren Actual DOM children
|
|
191
|
+
* @param expectedDomChildren Expected DOM children.
|
|
192
|
+
* @returns The list of actions based on the {@link module:utils/diff~diff} function.
|
|
193
|
+
*/
|
|
194
|
+
private _diffNodeLists;
|
|
195
|
+
/**
|
|
196
|
+
* Finds DOM nodes that were replaced with the similar nodes (same tag name) in the view. All nodes are compared
|
|
197
|
+
* within one `insert`/`delete` action group, for example:
|
|
198
|
+
*
|
|
199
|
+
* ```
|
|
200
|
+
* Actual DOM: <p><b>Foo</b>Bar<i>Baz</i><b>Bax</b></p>
|
|
201
|
+
* Expected DOM: <p>Bar<b>123</b><i>Baz</i><b>456</b></p>
|
|
202
|
+
* Input actions: [ insert, insert, delete, delete, equal, insert, delete ]
|
|
203
|
+
* Output actions: [ insert, replace, delete, equal, replace ]
|
|
204
|
+
* ```
|
|
205
|
+
*
|
|
206
|
+
* @param actions Actions array which is a result of the {@link module:utils/diff~diff} function.
|
|
207
|
+
* @param actualDom Actual DOM children
|
|
208
|
+
* @param expectedDom Expected DOM children.
|
|
209
|
+
* @param comparator A comparator function that should return `true` if the given node should be reused
|
|
210
|
+
* (either by the update of a text node data or an element children list for similar elements).
|
|
211
|
+
* @returns Actions array modified with the `update` actions.
|
|
212
|
+
*/
|
|
213
|
+
private _findUpdateActions;
|
|
214
|
+
/**
|
|
215
|
+
* Checks if text needs to be updated and possibly updates it by removing and inserting only parts
|
|
216
|
+
* of the data from the existing text node to reduce impact on the IME composition.
|
|
217
|
+
*
|
|
218
|
+
* @param domText DOM text node to update.
|
|
219
|
+
* @param expectedText The expected data of a text node.
|
|
220
|
+
*/
|
|
221
|
+
private _updateTextNode;
|
|
222
|
+
/**
|
|
223
|
+
* Part of the `_updateTextNode` method extracted for easier testing.
|
|
224
|
+
*/
|
|
225
|
+
private _updateTextNodeInternal;
|
|
226
|
+
/**
|
|
227
|
+
* Marks text nodes to be synchronized.
|
|
228
|
+
*
|
|
229
|
+
* If a text node is passed, it will be marked. If an element is passed, all descendant text nodes inside it will be marked.
|
|
230
|
+
*
|
|
231
|
+
* @param viewNode View node to sync.
|
|
232
|
+
*/
|
|
233
|
+
private _markDescendantTextToSync;
|
|
234
|
+
/**
|
|
235
|
+
* Checks if the selection needs to be updated and possibly updates it.
|
|
236
|
+
*/
|
|
237
|
+
private _updateSelection;
|
|
238
|
+
/**
|
|
239
|
+
* Updates the fake selection.
|
|
240
|
+
*
|
|
241
|
+
* @param domEditable A valid DOM editable where the fake selection container should be added.
|
|
242
|
+
*/
|
|
243
|
+
private _updateFakeSelection;
|
|
244
|
+
/**
|
|
245
|
+
* Updates the DOM selection.
|
|
246
|
+
*
|
|
247
|
+
* @param domEditable A valid DOM editable where the DOM selection should be rendered.
|
|
248
|
+
*/
|
|
249
|
+
private _updateDomSelection;
|
|
250
|
+
/**
|
|
251
|
+
* Checks whether a given DOM selection needs to be updated.
|
|
252
|
+
*
|
|
253
|
+
* @param domSelection The DOM selection to check.
|
|
254
|
+
*/
|
|
255
|
+
private _domSelectionNeedsUpdate;
|
|
256
|
+
/**
|
|
257
|
+
* Checks whether the fake selection needs to be updated.
|
|
258
|
+
*
|
|
259
|
+
* @param domEditable A valid DOM editable where a new fake selection container should be added.
|
|
260
|
+
*/
|
|
261
|
+
private _fakeSelectionNeedsUpdate;
|
|
262
|
+
/**
|
|
263
|
+
* Removes the DOM selection.
|
|
264
|
+
*/
|
|
265
|
+
private _removeDomSelection;
|
|
266
|
+
/**
|
|
267
|
+
* Removes the fake selection.
|
|
268
|
+
*/
|
|
269
|
+
private _removeFakeSelection;
|
|
270
|
+
/**
|
|
271
|
+
* Checks if focus needs to be updated and possibly updates it.
|
|
272
|
+
*/
|
|
273
|
+
private _updateFocus;
|
|
276
274
|
}
|
|
277
275
|
export {};
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { ViewEditableElement } from
|
|
9
|
-
import { type ViewDocument } from
|
|
6
|
+
* @module engine/view/rooteditableelement
|
|
7
|
+
*/
|
|
8
|
+
import { ViewEditableElement } from "./editableelement.js";
|
|
9
|
+
import { type ViewDocument } from "./document.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
* Class representing a single root in the data view. A root can be either
|
|
12
|
+
* {@link ~ViewRootEditableElement#isReadOnly editable or read-only},
|
|
13
|
+
* but in both cases it is called "an editable". Roots can contain other {@link module:engine/view/editableelement~ViewEditableElement
|
|
14
|
+
* editable elements} making them "nested editables".
|
|
15
|
+
*/
|
|
16
16
|
export declare class ViewRootEditableElement extends ViewEditableElement {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Creates root editable element.
|
|
19
|
+
*
|
|
20
|
+
* @param document The document instance to which this element belongs.
|
|
21
|
+
* @param name Node name.
|
|
22
|
+
*/
|
|
23
|
+
constructor(document: ViewDocument, name: string);
|
|
24
|
+
/**
|
|
25
|
+
* Name of this root inside {@link module:engine/view/document~ViewDocument} that is an owner of this root. If no
|
|
26
|
+
* other name is set, `main` name is used.
|
|
27
|
+
*
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
get rootName(): string;
|
|
31
|
+
set rootName(rootName: string);
|
|
32
|
+
/**
|
|
33
|
+
* Converts `ViewRootEditableElement` instance to string and returns it.
|
|
34
|
+
*
|
|
35
|
+
* @returns `ViewRootEditableElement` instance converted to string.
|
|
36
|
+
*/
|
|
37
|
+
override toJSON(): unknown;
|
|
38
|
+
/**
|
|
39
|
+
* Overrides old element name and sets new one.
|
|
40
|
+
* This is needed because view roots are created before they are attached to the DOM.
|
|
41
|
+
* The name of the root element is temporary at this stage. It has to be changed when the
|
|
42
|
+
* view root element is attached to the DOM element.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
* @param name The new name of element.
|
|
46
|
+
*/
|
|
47
|
+
set _name(name: string);
|
|
48
48
|
}
|