@ckeditor/ckeditor5-engine 44.1.0-alpha.5 → 44.2.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/LICENSE.md +1 -1
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +4 -4
- package/dist/index.css.map +1 -1
- package/dist/index.js +646 -77
- package/dist/index.js.map +1 -1
- package/package.json +23 -3
- package/src/controller/datacontroller.d.ts +1 -1
- package/src/controller/datacontroller.js +1 -1
- package/src/controller/editingcontroller.d.ts +1 -1
- package/src/controller/editingcontroller.js +1 -1
- package/src/conversion/conversion.d.ts +1 -1
- package/src/conversion/conversion.js +1 -1
- package/src/conversion/conversionhelpers.d.ts +1 -1
- package/src/conversion/conversionhelpers.js +1 -1
- package/src/conversion/downcastdispatcher.d.ts +1 -1
- package/src/conversion/downcastdispatcher.js +1 -1
- package/src/conversion/downcasthelpers.d.ts +1 -1
- package/src/conversion/downcasthelpers.js +1 -1
- package/src/conversion/mapper.d.ts +249 -20
- package/src/conversion/mapper.js +524 -38
- package/src/conversion/modelconsumable.d.ts +1 -1
- package/src/conversion/modelconsumable.js +1 -1
- package/src/conversion/upcastdispatcher.d.ts +1 -1
- package/src/conversion/upcastdispatcher.js +1 -1
- package/src/conversion/upcasthelpers.d.ts +1 -1
- package/src/conversion/upcasthelpers.js +1 -1
- package/src/conversion/viewconsumable.d.ts +1 -1
- package/src/conversion/viewconsumable.js +1 -1
- package/src/dataprocessor/basichtmlwriter.d.ts +1 -1
- package/src/dataprocessor/basichtmlwriter.js +1 -1
- package/src/dataprocessor/dataprocessor.d.ts +1 -1
- package/src/dataprocessor/dataprocessor.js +1 -1
- package/src/dataprocessor/htmldataprocessor.d.ts +1 -1
- package/src/dataprocessor/htmldataprocessor.js +1 -1
- package/src/dataprocessor/htmlwriter.d.ts +1 -1
- package/src/dataprocessor/htmlwriter.js +1 -1
- package/src/dataprocessor/xmldataprocessor.d.ts +1 -1
- package/src/dataprocessor/xmldataprocessor.js +1 -1
- package/src/dev-utils/model.d.ts +1 -1
- package/src/dev-utils/model.js +1 -1
- package/src/dev-utils/operationreplayer.d.ts +1 -1
- package/src/dev-utils/operationreplayer.js +1 -1
- package/src/dev-utils/utils.d.ts +1 -1
- package/src/dev-utils/utils.js +1 -1
- package/src/dev-utils/view.d.ts +1 -1
- package/src/dev-utils/view.js +1 -1
- package/src/index.d.ts +4 -2
- package/src/index.js +2 -1
- package/src/model/batch.d.ts +1 -1
- package/src/model/batch.js +7 -3
- package/src/model/differ.d.ts +1 -1
- package/src/model/differ.js +1 -1
- package/src/model/document.d.ts +1 -1
- package/src/model/document.js +1 -1
- package/src/model/documentfragment.d.ts +1 -1
- package/src/model/documentfragment.js +1 -1
- package/src/model/documentselection.d.ts +1 -1
- package/src/model/documentselection.js +1 -1
- package/src/model/element.d.ts +1 -1
- package/src/model/element.js +1 -1
- package/src/model/history.d.ts +1 -1
- package/src/model/history.js +1 -1
- package/src/model/item.d.ts +1 -1
- package/src/model/item.js +1 -1
- package/src/model/liveposition.d.ts +1 -1
- package/src/model/liveposition.js +1 -1
- package/src/model/liverange.d.ts +1 -1
- package/src/model/liverange.js +1 -1
- package/src/model/markercollection.d.ts +1 -1
- package/src/model/markercollection.js +1 -1
- package/src/model/model.d.ts +1 -1
- package/src/model/model.js +1 -1
- package/src/model/node.d.ts +1 -1
- package/src/model/node.js +1 -1
- package/src/model/nodelist.d.ts +1 -1
- package/src/model/nodelist.js +1 -1
- package/src/model/operation/attributeoperation.d.ts +1 -1
- package/src/model/operation/attributeoperation.js +1 -1
- package/src/model/operation/detachoperation.d.ts +1 -1
- package/src/model/operation/detachoperation.js +1 -1
- package/src/model/operation/insertoperation.d.ts +1 -1
- package/src/model/operation/insertoperation.js +1 -1
- package/src/model/operation/markeroperation.d.ts +1 -1
- package/src/model/operation/markeroperation.js +1 -1
- package/src/model/operation/mergeoperation.d.ts +1 -1
- package/src/model/operation/mergeoperation.js +1 -1
- package/src/model/operation/moveoperation.d.ts +1 -1
- package/src/model/operation/moveoperation.js +1 -1
- package/src/model/operation/nooperation.d.ts +1 -1
- package/src/model/operation/nooperation.js +1 -1
- package/src/model/operation/operation.d.ts +4 -1
- package/src/model/operation/operation.js +2 -2
- package/src/model/operation/operationfactory.d.ts +1 -1
- package/src/model/operation/operationfactory.js +1 -1
- package/src/model/operation/renameoperation.d.ts +1 -1
- package/src/model/operation/renameoperation.js +1 -1
- package/src/model/operation/rootattributeoperation.d.ts +1 -1
- package/src/model/operation/rootattributeoperation.js +1 -1
- package/src/model/operation/rootoperation.d.ts +1 -1
- package/src/model/operation/rootoperation.js +1 -1
- package/src/model/operation/splitoperation.d.ts +1 -1
- package/src/model/operation/splitoperation.js +1 -1
- package/src/model/operation/transform.d.ts +1 -1
- package/src/model/operation/transform.js +1 -1
- package/src/model/operation/utils.d.ts +1 -1
- package/src/model/operation/utils.js +1 -1
- package/src/model/position.d.ts +1 -1
- package/src/model/position.js +1 -1
- package/src/model/range.d.ts +1 -1
- package/src/model/range.js +1 -1
- package/src/model/rootelement.d.ts +1 -1
- package/src/model/rootelement.js +1 -1
- package/src/model/schema.d.ts +1 -1
- package/src/model/schema.js +1 -1
- package/src/model/selection.d.ts +1 -1
- package/src/model/selection.js +9 -2
- package/src/model/text.d.ts +1 -1
- package/src/model/text.js +1 -1
- package/src/model/textproxy.d.ts +1 -1
- package/src/model/textproxy.js +1 -1
- package/src/model/treewalker.d.ts +17 -1
- package/src/model/treewalker.js +26 -1
- package/src/model/typecheckable.d.ts +1 -1
- package/src/model/typecheckable.js +1 -1
- package/src/model/utils/autoparagraphing.d.ts +1 -1
- package/src/model/utils/autoparagraphing.js +1 -1
- package/src/model/utils/deletecontent.d.ts +1 -1
- package/src/model/utils/deletecontent.js +1 -1
- package/src/model/utils/getselectedcontent.d.ts +1 -1
- package/src/model/utils/getselectedcontent.js +1 -1
- package/src/model/utils/insertcontent.d.ts +1 -1
- package/src/model/utils/insertcontent.js +1 -1
- package/src/model/utils/insertobject.d.ts +1 -1
- package/src/model/utils/insertobject.js +1 -1
- package/src/model/utils/modifyselection.d.ts +1 -1
- package/src/model/utils/modifyselection.js +1 -1
- package/src/model/utils/selection-post-fixer.d.ts +1 -1
- package/src/model/utils/selection-post-fixer.js +1 -1
- package/src/model/writer.d.ts +1 -1
- package/src/model/writer.js +1 -1
- package/src/view/attributeelement.d.ts +1 -1
- package/src/view/attributeelement.js +1 -1
- package/src/view/containerelement.d.ts +1 -1
- package/src/view/containerelement.js +1 -1
- package/src/view/datatransfer.d.ts +1 -1
- package/src/view/datatransfer.js +1 -1
- package/src/view/document.d.ts +1 -1
- package/src/view/document.js +1 -1
- package/src/view/documentfragment.d.ts +6 -4
- package/src/view/documentfragment.js +7 -7
- package/src/view/documentselection.d.ts +1 -1
- package/src/view/documentselection.js +1 -1
- package/src/view/domconverter.d.ts +1 -1
- package/src/view/domconverter.js +1 -1
- package/src/view/downcastwriter.d.ts +1 -1
- package/src/view/downcastwriter.js +1 -1
- package/src/view/editableelement.d.ts +1 -1
- package/src/view/editableelement.js +1 -1
- package/src/view/element.d.ts +1 -1
- package/src/view/element.js +3 -3
- package/src/view/elementdefinition.d.ts +1 -1
- package/src/view/elementdefinition.js +1 -1
- package/src/view/emptyelement.d.ts +1 -1
- package/src/view/emptyelement.js +1 -1
- package/src/view/filler.d.ts +1 -1
- package/src/view/filler.js +1 -1
- package/src/view/item.d.ts +1 -1
- package/src/view/item.js +1 -1
- package/src/view/matcher.d.ts +1 -1
- package/src/view/matcher.js +1 -1
- package/src/view/node.d.ts +13 -4
- package/src/view/node.js +5 -4
- package/src/view/observer/arrowkeysobserver.d.ts +1 -1
- package/src/view/observer/arrowkeysobserver.js +1 -1
- package/src/view/observer/bubblingemittermixin.d.ts +1 -1
- package/src/view/observer/bubblingemittermixin.js +1 -1
- package/src/view/observer/bubblingeventinfo.d.ts +1 -1
- package/src/view/observer/bubblingeventinfo.js +1 -1
- package/src/view/observer/clickobserver.d.ts +1 -1
- package/src/view/observer/clickobserver.js +1 -1
- package/src/view/observer/compositionobserver.d.ts +1 -1
- package/src/view/observer/compositionobserver.js +1 -1
- package/src/view/observer/domeventdata.d.ts +1 -1
- package/src/view/observer/domeventdata.js +1 -1
- package/src/view/observer/domeventobserver.d.ts +1 -1
- package/src/view/observer/domeventobserver.js +1 -1
- package/src/view/observer/fakeselectionobserver.d.ts +1 -1
- package/src/view/observer/fakeselectionobserver.js +1 -1
- package/src/view/observer/focusobserver.d.ts +1 -1
- package/src/view/observer/focusobserver.js +1 -1
- package/src/view/observer/inputobserver.d.ts +1 -1
- package/src/view/observer/inputobserver.js +1 -1
- package/src/view/observer/keyobserver.d.ts +1 -1
- package/src/view/observer/keyobserver.js +1 -1
- package/src/view/observer/mouseobserver.d.ts +1 -1
- package/src/view/observer/mouseobserver.js +1 -1
- package/src/view/observer/mutationobserver.d.ts +1 -1
- package/src/view/observer/mutationobserver.js +1 -1
- package/src/view/observer/observer.d.ts +1 -1
- package/src/view/observer/observer.js +1 -1
- package/src/view/observer/selectionobserver.d.ts +1 -1
- package/src/view/observer/selectionobserver.js +1 -1
- package/src/view/observer/tabobserver.d.ts +1 -1
- package/src/view/observer/tabobserver.js +1 -1
- package/src/view/observer/touchobserver.d.ts +73 -0
- package/src/view/observer/touchobserver.js +29 -0
- package/src/view/placeholder.d.ts +1 -1
- package/src/view/placeholder.js +23 -17
- package/src/view/position.d.ts +1 -1
- package/src/view/position.js +1 -1
- package/src/view/range.d.ts +1 -1
- package/src/view/range.js +1 -1
- package/src/view/rawelement.d.ts +1 -1
- package/src/view/rawelement.js +1 -1
- package/src/view/renderer.d.ts +1 -1
- package/src/view/renderer.js +1 -1
- package/src/view/rooteditableelement.d.ts +1 -1
- package/src/view/rooteditableelement.js +1 -1
- package/src/view/selection.d.ts +1 -1
- package/src/view/selection.js +1 -1
- package/src/view/styles/background.d.ts +1 -1
- package/src/view/styles/background.js +1 -1
- package/src/view/styles/border.d.ts +1 -1
- package/src/view/styles/border.js +1 -1
- package/src/view/styles/margin.d.ts +1 -1
- package/src/view/styles/margin.js +1 -1
- package/src/view/styles/padding.d.ts +1 -1
- package/src/view/styles/padding.js +1 -1
- package/src/view/styles/utils.d.ts +1 -1
- package/src/view/styles/utils.js +1 -1
- package/src/view/stylesmap.d.ts +1 -1
- package/src/view/stylesmap.js +1 -1
- package/src/view/text.d.ts +1 -1
- package/src/view/text.js +1 -1
- package/src/view/textproxy.d.ts +1 -1
- package/src/view/textproxy.js +1 -1
- package/src/view/treewalker.d.ts +17 -1
- package/src/view/treewalker.js +25 -1
- package/src/view/typecheckable.d.ts +1 -1
- package/src/view/typecheckable.js +1 -1
- package/src/view/uielement.d.ts +1 -1
- package/src/view/uielement.js +1 -1
- package/src/view/upcastwriter.d.ts +1 -1
- package/src/view/upcastwriter.js +1 -1
- package/src/view/view.d.ts +1 -1
- package/src/view/view.js +1 -1
- package/theme/placeholder.css +1 -1
- package/theme/renderer.css +1 -1
- package/dist/controller/datacontroller.d.ts +0 -339
- package/dist/controller/editingcontroller.d.ts +0 -102
- package/dist/conversion/conversion.d.ts +0 -482
- package/dist/conversion/conversionhelpers.d.ts +0 -30
- package/dist/conversion/downcastdispatcher.d.ts +0 -566
- package/dist/conversion/downcasthelpers.d.ts +0 -1194
- package/dist/conversion/mapper.d.ts +0 -507
- package/dist/conversion/modelconsumable.d.ts +0 -205
- package/dist/conversion/upcastdispatcher.d.ts +0 -496
- package/dist/conversion/upcasthelpers.d.ts +0 -503
- package/dist/conversion/viewconsumable.d.ts +0 -373
- package/dist/dataprocessor/basichtmlwriter.d.ts +0 -22
- package/dist/dataprocessor/dataprocessor.d.ts +0 -65
- package/dist/dataprocessor/htmldataprocessor.d.ts +0 -80
- package/dist/dataprocessor/htmlwriter.d.ts +0 -20
- package/dist/dataprocessor/xmldataprocessor.d.ts +0 -94
- package/dist/dev-utils/model.d.ts +0 -130
- package/dist/dev-utils/operationreplayer.d.ts +0 -55
- package/dist/dev-utils/utils.d.ts +0 -41
- package/dist/dev-utils/view.d.ts +0 -324
- package/dist/index.d.ts +0 -122
- package/dist/model/batch.d.ts +0 -110
- package/dist/model/differ.d.ts +0 -511
- package/dist/model/document.d.ts +0 -278
- package/dist/model/documentfragment.d.ts +0 -223
- package/dist/model/documentselection.d.ts +0 -424
- package/dist/model/element.d.ts +0 -191
- package/dist/model/history.d.ts +0 -118
- package/dist/model/item.d.ts +0 -18
- package/dist/model/liveposition.d.ts +0 -81
- package/dist/model/liverange.d.ts +0 -106
- package/dist/model/markercollection.d.ts +0 -339
- package/dist/model/model.d.ts +0 -923
- package/dist/model/node.d.ts +0 -262
- package/dist/model/nodelist.d.ts +0 -119
- package/dist/model/operation/attributeoperation.d.ts +0 -107
- package/dist/model/operation/detachoperation.d.ts +0 -64
- package/dist/model/operation/insertoperation.d.ts +0 -94
- package/dist/model/operation/markeroperation.d.ts +0 -95
- package/dist/model/operation/mergeoperation.d.ts +0 -104
- package/dist/model/operation/moveoperation.d.ts +0 -100
- package/dist/model/operation/nooperation.d.ts +0 -42
- package/dist/model/operation/operation.d.ts +0 -100
- package/dist/model/operation/operationfactory.d.ts +0 -22
- package/dist/model/operation/renameoperation.d.ts +0 -87
- package/dist/model/operation/rootattributeoperation.d.ts +0 -102
- package/dist/model/operation/rootoperation.d.ts +0 -80
- package/dist/model/operation/splitoperation.d.ts +0 -113
- package/dist/model/operation/transform.d.ts +0 -104
- package/dist/model/operation/utils.d.ts +0 -75
- package/dist/model/position.d.ts +0 -549
- package/dist/model/range.d.ts +0 -462
- package/dist/model/rootelement.d.ts +0 -64
- package/dist/model/schema.d.ts +0 -1334
- package/dist/model/selection.d.ts +0 -486
- package/dist/model/text.d.ts +0 -70
- package/dist/model/textproxy.d.ts +0 -148
- package/dist/model/treewalker.d.ts +0 -190
- package/dist/model/typecheckable.d.ts +0 -289
- package/dist/model/utils/autoparagraphing.d.ts +0 -41
- package/dist/model/utils/deletecontent.d.ts +0 -62
- package/dist/model/utils/getselectedcontent.d.ts +0 -34
- package/dist/model/utils/insertcontent.d.ts +0 -50
- package/dist/model/utils/insertobject.d.ts +0 -51
- package/dist/model/utils/modifyselection.d.ts +0 -52
- package/dist/model/utils/selection-post-fixer.d.ts +0 -78
- package/dist/model/writer.d.ts +0 -855
- package/dist/view/attributeelement.d.ts +0 -112
- package/dist/view/containerelement.d.ts +0 -53
- package/dist/view/datatransfer.d.ts +0 -83
- package/dist/view/document.d.ts +0 -188
- package/dist/view/documentfragment.d.ts +0 -157
- package/dist/view/documentselection.d.ts +0 -310
- package/dist/view/domconverter.d.ts +0 -665
- package/dist/view/downcastwriter.d.ts +0 -1000
- package/dist/view/editableelement.d.ts +0 -66
- package/dist/view/element.d.ts +0 -472
- package/dist/view/elementdefinition.d.ts +0 -91
- package/dist/view/emptyelement.d.ts +0 -45
- package/dist/view/filler.d.ts +0 -115
- package/dist/view/item.d.ts +0 -18
- package/dist/view/matcher.d.ts +0 -490
- package/dist/view/node.d.ts +0 -166
- package/dist/view/observer/arrowkeysobserver.d.ts +0 -49
- package/dist/view/observer/bubblingemittermixin.d.ts +0 -170
- package/dist/view/observer/bubblingeventinfo.d.ts +0 -51
- package/dist/view/observer/clickobserver.d.ts +0 -47
- package/dist/view/observer/compositionobserver.d.ts +0 -86
- package/dist/view/observer/domeventdata.d.ts +0 -54
- package/dist/view/observer/domeventobserver.d.ts +0 -82
- package/dist/view/observer/fakeselectionobserver.d.ts +0 -51
- package/dist/view/observer/focusobserver.d.ts +0 -98
- package/dist/view/observer/inputobserver.d.ts +0 -90
- package/dist/view/observer/keyobserver.d.ts +0 -70
- package/dist/view/observer/mouseobserver.d.ts +0 -93
- package/dist/view/observer/mutationobserver.d.ts +0 -119
- package/dist/view/observer/observer.d.ts +0 -93
- package/dist/view/observer/selectionobserver.d.ts +0 -151
- package/dist/view/observer/tabobserver.d.ts +0 -50
- package/dist/view/placeholder.d.ts +0 -100
- package/dist/view/position.d.ts +0 -192
- package/dist/view/range.d.ts +0 -283
- package/dist/view/rawelement.d.ts +0 -77
- package/dist/view/renderer.d.ts +0 -281
- package/dist/view/rooteditableelement.d.ts +0 -45
- package/dist/view/selection.d.ts +0 -379
- package/dist/view/styles/background.d.ts +0 -37
- package/dist/view/styles/border.d.ts +0 -47
- package/dist/view/styles/margin.d.ts +0 -33
- package/dist/view/styles/padding.d.ts +0 -33
- package/dist/view/styles/utils.d.ts +0 -97
- package/dist/view/stylesmap.d.ts +0 -685
- package/dist/view/text.d.ts +0 -78
- package/dist/view/textproxy.d.ts +0 -101
- package/dist/view/treewalker.d.ts +0 -199
- package/dist/view/typecheckable.d.ts +0 -452
- package/dist/view/uielement.d.ts +0 -100
- package/dist/view/upcastwriter.d.ts +0 -421
- package/dist/view/view.d.ts +0 -488
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module engine/view/attributeelement
|
|
11
|
-
*/
|
|
12
|
-
import Element, { type ElementAttributes } from './element.js';
|
|
13
|
-
import type Document from './document.js';
|
|
14
|
-
import type Node from './node.js';
|
|
15
|
-
/**
|
|
16
|
-
* Attribute elements are used to represent formatting elements in the view (think – `<b>`, `<span style="font-size: 2em">`, etc.).
|
|
17
|
-
* Most often they are created when downcasting model text attributes.
|
|
18
|
-
*
|
|
19
|
-
* Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
|
|
20
|
-
* types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
|
|
21
|
-
* {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
|
|
22
|
-
*
|
|
23
|
-
* To create a new attribute element instance use the
|
|
24
|
-
* {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.
|
|
25
|
-
*/
|
|
26
|
-
export default class AttributeElement extends Element {
|
|
27
|
-
static readonly DEFAULT_PRIORITY: number;
|
|
28
|
-
/**
|
|
29
|
-
* Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
|
|
30
|
-
*
|
|
31
|
-
* @internal
|
|
32
|
-
* @readonly
|
|
33
|
-
*/
|
|
34
|
-
_priority: number;
|
|
35
|
-
/**
|
|
36
|
-
* Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
|
|
37
|
-
* and then two elements are considered similar if, and only if they have the same `_id`.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
|
-
* @readonly
|
|
41
|
-
*/
|
|
42
|
-
_id: string | number | null;
|
|
43
|
-
/**
|
|
44
|
-
* Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}
|
|
45
|
-
* and still exist in the view tree.
|
|
46
|
-
*
|
|
47
|
-
* This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.
|
|
48
|
-
*/
|
|
49
|
-
private readonly _clonesGroup;
|
|
50
|
-
/**
|
|
51
|
-
* Creates an attribute element.
|
|
52
|
-
*
|
|
53
|
-
* @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement
|
|
54
|
-
* @see module:engine/view/element~Element
|
|
55
|
-
* @protected
|
|
56
|
-
* @param document The document instance to which this element belongs.
|
|
57
|
-
* @param name Node name.
|
|
58
|
-
* @param attrs Collection of attributes.
|
|
59
|
-
* @param children A list of nodes to be inserted into created element.
|
|
60
|
-
*/
|
|
61
|
-
constructor(document: Document, name: string, attrs?: ElementAttributes, children?: Node | Iterable<Node>);
|
|
62
|
-
/**
|
|
63
|
-
* Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.
|
|
64
|
-
*/
|
|
65
|
-
get priority(): number;
|
|
66
|
-
/**
|
|
67
|
-
* Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},
|
|
68
|
-
* and then two elements are considered similar if, and only if they have the same `id`.
|
|
69
|
-
*/
|
|
70
|
-
get id(): string | number | null;
|
|
71
|
-
/**
|
|
72
|
-
* Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the
|
|
73
|
-
* same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).
|
|
74
|
-
*
|
|
75
|
-
* Note: If this element has been removed from the tree, returned set will not include it.
|
|
76
|
-
*
|
|
77
|
-
* Throws {@link module:utils/ckeditorerror~CKEditorError attribute-element-get-elements-with-same-id-no-id}
|
|
78
|
-
* if this element has no `id`.
|
|
79
|
-
*
|
|
80
|
-
* @returns Set containing all the attribute elements
|
|
81
|
-
* with the same `id` that were added and not removed from the view tree.
|
|
82
|
-
*/
|
|
83
|
-
getElementsWithSameId(): Set<AttributeElement>;
|
|
84
|
-
/**
|
|
85
|
-
* Checks if this element is similar to other element.
|
|
86
|
-
*
|
|
87
|
-
* If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements
|
|
88
|
-
* should have the same name, attributes and priority to be considered as similar. Two similar elements can contain
|
|
89
|
-
* different set of children nodes.
|
|
90
|
-
*
|
|
91
|
-
* If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both
|
|
92
|
-
* elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be
|
|
93
|
-
* considered similar.
|
|
94
|
-
*
|
|
95
|
-
* Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:
|
|
96
|
-
*
|
|
97
|
-
* * two following similar elements can be merged together into one, longer element,
|
|
98
|
-
* * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to
|
|
99
|
-
* decide whether processed element should be unwrapped,
|
|
100
|
-
* * etc.
|
|
101
|
-
*/
|
|
102
|
-
isSimilar(otherElement: Element): boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Clones provided element with priority.
|
|
105
|
-
*
|
|
106
|
-
* @internal
|
|
107
|
-
* @param deep If set to `true` clones element and all its children recursively. When set to `false`,
|
|
108
|
-
* element will be cloned without any children.
|
|
109
|
-
* @returns Clone of this element.
|
|
110
|
-
*/
|
|
111
|
-
_clone(deep?: boolean): this;
|
|
112
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module engine/view/containerelement
|
|
11
|
-
*/
|
|
12
|
-
import Element, { type ElementAttributes } from './element.js';
|
|
13
|
-
import type Document from './document.js';
|
|
14
|
-
import type Node from './node.js';
|
|
15
|
-
/**
|
|
16
|
-
* Containers are elements which define document structure. They define boundaries for
|
|
17
|
-
* {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.
|
|
18
|
-
*
|
|
19
|
-
* Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various
|
|
20
|
-
* types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},
|
|
21
|
-
* {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.
|
|
22
|
-
*
|
|
23
|
-
* The container element should be your default choice when writing a converter, unless:
|
|
24
|
-
*
|
|
25
|
-
* * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),
|
|
26
|
-
* * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),
|
|
27
|
-
* * this is a root element,
|
|
28
|
-
* * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).
|
|
29
|
-
*
|
|
30
|
-
* To create a new container element instance use the
|
|
31
|
-
* {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}
|
|
32
|
-
* method.
|
|
33
|
-
*/
|
|
34
|
-
export default class ContainerElement extends Element {
|
|
35
|
-
/**
|
|
36
|
-
* Creates a container element.
|
|
37
|
-
*
|
|
38
|
-
* @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement
|
|
39
|
-
* @see module:engine/view/element~Element
|
|
40
|
-
* @internal
|
|
41
|
-
* @param document The document instance to which this element belongs.
|
|
42
|
-
* @param name Node name.
|
|
43
|
-
* @param attrs Collection of attributes.
|
|
44
|
-
* @param children A list of nodes to be inserted into created element.
|
|
45
|
-
*/
|
|
46
|
-
constructor(document: Document, name: string, attrs?: ElementAttributes, children?: Node | Iterable<Node>);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.
|
|
50
|
-
*
|
|
51
|
-
* @returns Block filler offset or `null` if block filler is not needed.
|
|
52
|
-
*/
|
|
53
|
-
export declare function getFillerOffset(this: ContainerElement): number | null;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module engine/view/datatransfer
|
|
11
|
-
*/
|
|
12
|
-
type DomDataTransfer = globalThis.DataTransfer;
|
|
13
|
-
/**
|
|
14
|
-
* A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
|
|
15
|
-
*/
|
|
16
|
-
export default class DataTransfer {
|
|
17
|
-
/**
|
|
18
|
-
* The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
|
|
19
|
-
*/
|
|
20
|
-
private _files;
|
|
21
|
-
/**
|
|
22
|
-
* The native DataTransfer object.
|
|
23
|
-
*/
|
|
24
|
-
private _native;
|
|
25
|
-
/**
|
|
26
|
-
* @param nativeDataTransfer The native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.
|
|
27
|
-
* @param options.cacheFiles Whether `files` list should be initialized in the constructor.
|
|
28
|
-
*/
|
|
29
|
-
constructor(nativeDataTransfer: DomDataTransfer, options?: {
|
|
30
|
-
cacheFiles?: boolean;
|
|
31
|
-
});
|
|
32
|
-
/**
|
|
33
|
-
* The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.
|
|
34
|
-
*/
|
|
35
|
-
get files(): Array<File>;
|
|
36
|
-
/**
|
|
37
|
-
* Returns an array of available native content types.
|
|
38
|
-
*/
|
|
39
|
-
get types(): ReadonlyArray<string>;
|
|
40
|
-
/**
|
|
41
|
-
* Gets the data from the data transfer by its MIME type.
|
|
42
|
-
*
|
|
43
|
-
* ```ts
|
|
44
|
-
* dataTransfer.getData( 'text/plain' );
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @param type The MIME type. E.g. `text/html` or `text/plain`.
|
|
48
|
-
*/
|
|
49
|
-
getData(type: string): string;
|
|
50
|
-
/**
|
|
51
|
-
* Sets the data in the data transfer.
|
|
52
|
-
*
|
|
53
|
-
* @param type The MIME type. E.g. `text/html` or `text/plain`.
|
|
54
|
-
*/
|
|
55
|
-
setData(type: string, data: string): void;
|
|
56
|
-
/**
|
|
57
|
-
* The effect that is allowed for a drag operation.
|
|
58
|
-
*/
|
|
59
|
-
set effectAllowed(value: EffectAllowed);
|
|
60
|
-
get effectAllowed(): EffectAllowed;
|
|
61
|
-
/**
|
|
62
|
-
* The actual drop effect.
|
|
63
|
-
*/
|
|
64
|
-
set dropEffect(value: DropEffect);
|
|
65
|
-
get dropEffect(): DropEffect;
|
|
66
|
-
/**
|
|
67
|
-
* Set a preview image of the dragged content.
|
|
68
|
-
*/
|
|
69
|
-
setDragImage(image: Element, x: number, y: number): void;
|
|
70
|
-
/**
|
|
71
|
-
* Whether the dragging operation was canceled.
|
|
72
|
-
*/
|
|
73
|
-
get isCanceled(): boolean;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* The effect that is allowed for a drag operation.
|
|
77
|
-
*/
|
|
78
|
-
export type EffectAllowed = DomDataTransfer['effectAllowed'];
|
|
79
|
-
/**
|
|
80
|
-
* The actual drop effect.
|
|
81
|
-
*/
|
|
82
|
-
export type DropEffect = DomDataTransfer['dropEffect'];
|
|
83
|
-
export {};
|
package/dist/view/document.d.ts
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module engine/view/document
|
|
11
|
-
*/
|
|
12
|
-
import DocumentSelection from './documentselection.js';
|
|
13
|
-
import { Collection } from '@ckeditor/ckeditor5-utils';
|
|
14
|
-
import type { StylesProcessor } from './stylesmap.js';
|
|
15
|
-
import type RootEditableElement from './rooteditableelement.js';
|
|
16
|
-
import type DowncastWriter from './downcastwriter.js';
|
|
17
|
-
declare const Document_base: import("@ckeditor/ckeditor5-utils").Mixed<{
|
|
18
|
-
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
19
|
-
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
20
|
-
}, import("@ckeditor/ckeditor5-utils").Emitter>;
|
|
21
|
-
/**
|
|
22
|
-
* Document class creates an abstract layer over the content editable area, contains a tree of view elements and
|
|
23
|
-
* {@link module:engine/view/documentselection~DocumentSelection view selection} associated with this document.
|
|
24
|
-
*/
|
|
25
|
-
export default class Document extends /* #__PURE__ */ Document_base {
|
|
26
|
-
/**
|
|
27
|
-
* Selection done on this document.
|
|
28
|
-
*/
|
|
29
|
-
readonly selection: DocumentSelection;
|
|
30
|
-
/**
|
|
31
|
-
* Roots of the view tree. Collection of the {@link module:engine/view/element~Element view elements}.
|
|
32
|
-
*
|
|
33
|
-
* View roots are created as a result of binding between {@link module:engine/view/document~Document#roots} and
|
|
34
|
-
* {@link module:engine/model/document~Document#roots} and this is handled by
|
|
35
|
-
* {@link module:engine/controller/editingcontroller~EditingController}, so to create view root we need to create
|
|
36
|
-
* model root using {@link module:engine/model/document~Document#createRoot}.
|
|
37
|
-
*/
|
|
38
|
-
readonly roots: Collection<RootEditableElement>;
|
|
39
|
-
/**
|
|
40
|
-
* The styles processor instance used by this document when normalizing styles.
|
|
41
|
-
*/
|
|
42
|
-
readonly stylesProcessor: StylesProcessor;
|
|
43
|
-
/**
|
|
44
|
-
* Defines whether document is in read-only mode.
|
|
45
|
-
*
|
|
46
|
-
* When document is read-ony then all roots are read-only as well and caret placed inside this root is hidden.
|
|
47
|
-
*
|
|
48
|
-
* @observable
|
|
49
|
-
*/
|
|
50
|
-
isReadOnly: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* True if document is focused.
|
|
53
|
-
*
|
|
54
|
-
* This property is updated by the {@link module:engine/view/observer/focusobserver~FocusObserver}.
|
|
55
|
-
* If the {@link module:engine/view/observer/focusobserver~FocusObserver} is disabled this property will not change.
|
|
56
|
-
*
|
|
57
|
-
* @readonly
|
|
58
|
-
* @observable
|
|
59
|
-
*/
|
|
60
|
-
isFocused: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* `true` while the user is making a selection in the document (e.g. holding the mouse button and moving the cursor).
|
|
63
|
-
* When they stop selecting, the property goes back to `false`.
|
|
64
|
-
*
|
|
65
|
-
* This property is updated by the {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
|
|
66
|
-
*
|
|
67
|
-
* @readonly
|
|
68
|
-
* @observable
|
|
69
|
-
*/
|
|
70
|
-
isSelecting: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* True if composition is in progress inside the document.
|
|
73
|
-
*
|
|
74
|
-
* This property is updated by the {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
|
|
75
|
-
* If the {@link module:engine/view/observer/compositionobserver~CompositionObserver} is disabled this property will not change.
|
|
76
|
-
*
|
|
77
|
-
* @readonly
|
|
78
|
-
* @observable
|
|
79
|
-
*/
|
|
80
|
-
isComposing: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* Post-fixer callbacks registered to the view document.
|
|
83
|
-
*/
|
|
84
|
-
private readonly _postFixers;
|
|
85
|
-
/**
|
|
86
|
-
* Creates a Document instance.
|
|
87
|
-
*
|
|
88
|
-
* @param stylesProcessor The styles processor instance.
|
|
89
|
-
*/
|
|
90
|
-
constructor(stylesProcessor: StylesProcessor);
|
|
91
|
-
/**
|
|
92
|
-
* Gets a {@link module:engine/view/document~Document#roots view root element} with the specified name. If the name is not
|
|
93
|
-
* specific "main" root is returned.
|
|
94
|
-
*
|
|
95
|
-
* @param name Name of the root.
|
|
96
|
-
* @returns The view root element with the specified name or null when there is no root of given name.
|
|
97
|
-
*/
|
|
98
|
-
getRoot(name?: string): RootEditableElement | null;
|
|
99
|
-
/**
|
|
100
|
-
* Allows registering post-fixer callbacks. A post-fixers mechanism allows to update the view tree just before it is rendered
|
|
101
|
-
* to the DOM.
|
|
102
|
-
*
|
|
103
|
-
* Post-fixers are executed right after all changes from the outermost change block were applied but
|
|
104
|
-
* before the {@link module:engine/view/view~View#event:render render event} is fired. If a post-fixer callback made
|
|
105
|
-
* a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should
|
|
106
|
-
* not be fixed in the new document tree state.
|
|
107
|
-
*
|
|
108
|
-
* View post-fixers are useful when you want to apply some fixes whenever the view structure changes. Keep in mind that
|
|
109
|
-
* changes executed in a view post-fixer should not break model-view mapping.
|
|
110
|
-
*
|
|
111
|
-
* The types of changes which should be safe:
|
|
112
|
-
*
|
|
113
|
-
* * adding or removing attribute from elements,
|
|
114
|
-
* * changes inside of {@link module:engine/view/uielement~UIElement UI elements},
|
|
115
|
-
* * {@link module:engine/controller/editingcontroller~EditingController#reconvertItem marking some of the model elements to be
|
|
116
|
-
* re-converted}.
|
|
117
|
-
*
|
|
118
|
-
* Try to avoid changes which touch view structure:
|
|
119
|
-
*
|
|
120
|
-
* * you should not add or remove nor wrap or unwrap any view elements,
|
|
121
|
-
* * you should not change the editor data model in a view post-fixer.
|
|
122
|
-
*
|
|
123
|
-
* As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.
|
|
124
|
-
*
|
|
125
|
-
* Typically, a post-fixer will look like this:
|
|
126
|
-
*
|
|
127
|
-
* ```ts
|
|
128
|
-
* editor.editing.view.document.registerPostFixer( writer => {
|
|
129
|
-
* if ( checkSomeCondition() ) {
|
|
130
|
-
* writer.doSomething();
|
|
131
|
-
*
|
|
132
|
-
* // Let other post-fixers know that something changed.
|
|
133
|
-
* return true;
|
|
134
|
-
* }
|
|
135
|
-
*
|
|
136
|
-
* return false;
|
|
137
|
-
* } );
|
|
138
|
-
* ```
|
|
139
|
-
*
|
|
140
|
-
* Note that nothing happens right after you register a post-fixer (e.g. execute such a code in the console).
|
|
141
|
-
* That is because adding a post-fixer does not execute it.
|
|
142
|
-
* The post-fixer will be executed as soon as any change in the document needs to cause its rendering.
|
|
143
|
-
* If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling
|
|
144
|
-
* {@link module:engine/view/view~View#forceRender `view.forceRender()`}.
|
|
145
|
-
*
|
|
146
|
-
* If you need to register a callback which is executed when DOM elements are already updated,
|
|
147
|
-
* use {@link module:engine/view/view~View#event:render render event}.
|
|
148
|
-
*/
|
|
149
|
-
registerPostFixer(postFixer: ViewDocumentPostFixer): void;
|
|
150
|
-
/**
|
|
151
|
-
* Destroys this instance. Makes sure that all observers are destroyed and listeners removed.
|
|
152
|
-
*/
|
|
153
|
-
destroy(): void;
|
|
154
|
-
/**
|
|
155
|
-
* Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.
|
|
156
|
-
*
|
|
157
|
-
* @internal
|
|
158
|
-
*/
|
|
159
|
-
_callPostFixers(writer: DowncastWriter): void;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Document PostFixer.
|
|
163
|
-
*
|
|
164
|
-
* @see module:engine/view/document~Document#registerPostFixer
|
|
165
|
-
*/
|
|
166
|
-
export type ViewDocumentPostFixer = (writer: DowncastWriter) => boolean;
|
|
167
|
-
/**
|
|
168
|
-
* Enum representing type of the change.
|
|
169
|
-
*
|
|
170
|
-
* Possible values:
|
|
171
|
-
*
|
|
172
|
-
* * `children` - for child list changes,
|
|
173
|
-
* * `attributes` - for element attributes changes,
|
|
174
|
-
* * `text` - for text nodes changes.
|
|
175
|
-
*/
|
|
176
|
-
export type ChangeType = 'children' | 'attributes' | 'text';
|
|
177
|
-
/**
|
|
178
|
-
* Event fired whenever document content layout changes. It is fired whenever content is
|
|
179
|
-
* {@link module:engine/view/view~View#event:render rendered}, but should be also fired by observers in case of
|
|
180
|
-
* other actions which may change layout, for instance when image loads.
|
|
181
|
-
*
|
|
182
|
-
* @eventName ~Document#layoutChanged
|
|
183
|
-
*/
|
|
184
|
-
export type ViewDocumentLayoutChangedEvent = {
|
|
185
|
-
name: 'layoutChanged';
|
|
186
|
-
args: [];
|
|
187
|
-
};
|
|
188
|
-
export {};
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module engine/view/documentfragment
|
|
11
|
-
*/
|
|
12
|
-
import TypeCheckable from './typecheckable.js';
|
|
13
|
-
import type { default as Document, ChangeType } from './document.js';
|
|
14
|
-
import type Item from './item.js';
|
|
15
|
-
import type Node from './node.js';
|
|
16
|
-
declare const DocumentFragment_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof TypeCheckable, import("@ckeditor/ckeditor5-utils").Emitter>;
|
|
17
|
-
/**
|
|
18
|
-
* Document fragment.
|
|
19
|
-
*
|
|
20
|
-
* To create a new document fragment instance use the
|
|
21
|
-
* {@link module:engine/view/upcastwriter~UpcastWriter#createDocumentFragment `UpcastWriter#createDocumentFragment()`}
|
|
22
|
-
* method.
|
|
23
|
-
*/
|
|
24
|
-
export default class DocumentFragment extends /* #__PURE__ */ DocumentFragment_base implements Iterable<Node> {
|
|
25
|
-
/**
|
|
26
|
-
* The document to which this document fragment belongs.
|
|
27
|
-
*/
|
|
28
|
-
readonly document: Document;
|
|
29
|
-
/**
|
|
30
|
-
* Array of child nodes.
|
|
31
|
-
*/
|
|
32
|
-
private readonly _children;
|
|
33
|
-
/**
|
|
34
|
-
* Map of custom properties.
|
|
35
|
-
* Custom properties can be added to document fragment instance.
|
|
36
|
-
*/
|
|
37
|
-
private readonly _customProperties;
|
|
38
|
-
/**
|
|
39
|
-
* Creates new DocumentFragment instance.
|
|
40
|
-
*
|
|
41
|
-
* @internal
|
|
42
|
-
* @param document The document to which this document fragment belongs.
|
|
43
|
-
* @param children A list of nodes to be inserted into the created document fragment.
|
|
44
|
-
*/
|
|
45
|
-
constructor(document: Document, children?: Node | Iterable<Node>);
|
|
46
|
-
/**
|
|
47
|
-
* Iterable interface.
|
|
48
|
-
*
|
|
49
|
-
* Iterates over nodes added to this document fragment.
|
|
50
|
-
*/
|
|
51
|
-
[Symbol.iterator](): Iterator<Node>;
|
|
52
|
-
/**
|
|
53
|
-
* Number of child nodes in this document fragment.
|
|
54
|
-
*/
|
|
55
|
-
get childCount(): number;
|
|
56
|
-
/**
|
|
57
|
-
* Is `true` if there are no nodes inside this document fragment, `false` otherwise.
|
|
58
|
-
*/
|
|
59
|
-
get isEmpty(): boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.
|
|
62
|
-
*/
|
|
63
|
-
get root(): this;
|
|
64
|
-
/**
|
|
65
|
-
* Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.
|
|
66
|
-
*/
|
|
67
|
-
get parent(): null;
|
|
68
|
-
/**
|
|
69
|
-
* Artificial element name. Returns `undefined`. Added for compatibility reasons.
|
|
70
|
-
*/
|
|
71
|
-
get name(): undefined;
|
|
72
|
-
/**
|
|
73
|
-
* Artificial element getFillerOffset. Returns `undefined`. Added for compatibility reasons.
|
|
74
|
-
*/
|
|
75
|
-
get getFillerOffset(): undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Returns the custom property value for the given key.
|
|
78
|
-
*/
|
|
79
|
-
getCustomProperty(key: string | symbol): unknown;
|
|
80
|
-
/**
|
|
81
|
-
* Returns an iterator which iterates over this document fragment's custom properties.
|
|
82
|
-
* Iterator provides `[ key, value ]` pairs for each stored property.
|
|
83
|
-
*/
|
|
84
|
-
getCustomProperties(): Iterable<[string | symbol, unknown]>;
|
|
85
|
-
/**
|
|
86
|
-
* {@link module:engine/view/documentfragment~DocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end
|
|
87
|
-
* and sets the parent of these nodes to this fragment.
|
|
88
|
-
*
|
|
89
|
-
* @internal
|
|
90
|
-
* @param items Items to be inserted.
|
|
91
|
-
* @returns Number of appended nodes.
|
|
92
|
-
*/
|
|
93
|
-
_appendChild(items: Item | string | Iterable<Item | string>): number;
|
|
94
|
-
/**
|
|
95
|
-
* Gets child at the given index.
|
|
96
|
-
*
|
|
97
|
-
* @param index Index of child.
|
|
98
|
-
* @returns Child node.
|
|
99
|
-
*/
|
|
100
|
-
getChild(index: number): Node;
|
|
101
|
-
/**
|
|
102
|
-
* Gets index of the given child node. Returns `-1` if child node is not found.
|
|
103
|
-
*
|
|
104
|
-
* @param node Child node.
|
|
105
|
-
* @returns Index of the child node.
|
|
106
|
-
*/
|
|
107
|
-
getChildIndex(node: Node): number;
|
|
108
|
-
/**
|
|
109
|
-
* Gets child nodes iterator.
|
|
110
|
-
*
|
|
111
|
-
* @returns Child nodes iterator.
|
|
112
|
-
*/
|
|
113
|
-
getChildren(): IterableIterator<Node>;
|
|
114
|
-
/**
|
|
115
|
-
* Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to
|
|
116
|
-
* this fragment.
|
|
117
|
-
*
|
|
118
|
-
* @internal
|
|
119
|
-
* @param index Position where nodes should be inserted.
|
|
120
|
-
* @param items Items to be inserted.
|
|
121
|
-
* @returns Number of inserted nodes.
|
|
122
|
-
*/
|
|
123
|
-
_insertChild(index: number, items: Item | string | Iterable<Item | string>): number;
|
|
124
|
-
/**
|
|
125
|
-
* Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.
|
|
126
|
-
*
|
|
127
|
-
* @internal
|
|
128
|
-
* @param index Number of the first node to remove.
|
|
129
|
-
* @param howMany Number of nodes to remove.
|
|
130
|
-
* @returns The array of removed nodes.
|
|
131
|
-
*/
|
|
132
|
-
_removeChildren(index: number, howMany?: number): Array<Node>;
|
|
133
|
-
/**
|
|
134
|
-
* Fires `change` event with given type of the change.
|
|
135
|
-
*
|
|
136
|
-
* @internal
|
|
137
|
-
* @param type Type of the change.
|
|
138
|
-
* @param node Changed node.
|
|
139
|
-
*/
|
|
140
|
-
_fireChange(type: ChangeType, node: Node | DocumentFragment): void;
|
|
141
|
-
/**
|
|
142
|
-
* Sets a custom property. They can be used to add special data to elements.
|
|
143
|
-
*
|
|
144
|
-
* @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty
|
|
145
|
-
* @internal
|
|
146
|
-
*/
|
|
147
|
-
_setCustomProperty(key: string | symbol, value: unknown): void;
|
|
148
|
-
/**
|
|
149
|
-
* Removes the custom property stored under the given key.
|
|
150
|
-
*
|
|
151
|
-
* @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty
|
|
152
|
-
* @internal
|
|
153
|
-
* @returns Returns true if property was removed.
|
|
154
|
-
*/
|
|
155
|
-
_removeCustomProperty(key: string | symbol): boolean;
|
|
156
|
-
}
|
|
157
|
-
export {};
|