@ckeditor/ckeditor5-engine 44.1.0 → 44.2.0-alpha.1
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
package/dist/view/node.d.ts
DELETED
|
@@ -1,166 +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/node
|
|
11
|
-
*/
|
|
12
|
-
import TypeCheckable from './typecheckable.js';
|
|
13
|
-
import type { default as Document, ChangeType } from './document.js';
|
|
14
|
-
import type DocumentFragment from './documentfragment.js';
|
|
15
|
-
import type Element from './element.js';
|
|
16
|
-
declare const Node_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof TypeCheckable, import("@ckeditor/ckeditor5-utils").Emitter>;
|
|
17
|
-
/**
|
|
18
|
-
* Abstract view node class.
|
|
19
|
-
*
|
|
20
|
-
* This is an abstract class. Its constructor should not be used directly.
|
|
21
|
-
* Use the {@link module:engine/view/downcastwriter~DowncastWriter} or {@link module:engine/view/upcastwriter~UpcastWriter}
|
|
22
|
-
* to create new instances of view nodes.
|
|
23
|
-
*/
|
|
24
|
-
export default abstract class Node extends /* #__PURE__ */ Node_base {
|
|
25
|
-
/**
|
|
26
|
-
* The document instance to which this node belongs.
|
|
27
|
-
*/
|
|
28
|
-
readonly document: Document;
|
|
29
|
-
/**
|
|
30
|
-
* Parent element. Null by default. Set by {@link module:engine/view/element~Element#_insertChild}.
|
|
31
|
-
*/
|
|
32
|
-
readonly parent: Element | DocumentFragment | null;
|
|
33
|
-
/**
|
|
34
|
-
* Creates a tree view node.
|
|
35
|
-
*
|
|
36
|
-
* @param document The document instance to which this node belongs.
|
|
37
|
-
*/
|
|
38
|
-
protected constructor(document: Document);
|
|
39
|
-
/**
|
|
40
|
-
* Index of the node in the parent element or null if the node has no parent.
|
|
41
|
-
*
|
|
42
|
-
* Accessing this property throws an error if this node's parent element does not contain it.
|
|
43
|
-
* This means that view tree got broken.
|
|
44
|
-
*/
|
|
45
|
-
get index(): number | null;
|
|
46
|
-
/**
|
|
47
|
-
* Node's next sibling, or `null` if it is the last child.
|
|
48
|
-
*/
|
|
49
|
-
get nextSibling(): Node | null;
|
|
50
|
-
/**
|
|
51
|
-
* Node's previous sibling, or `null` if it is the first child.
|
|
52
|
-
*/
|
|
53
|
-
get previousSibling(): Node | null;
|
|
54
|
-
/**
|
|
55
|
-
* Top-most ancestor of the node. If the node has no parent it is the root itself.
|
|
56
|
-
*/
|
|
57
|
-
get root(): Element | DocumentFragment;
|
|
58
|
-
/**
|
|
59
|
-
* Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).
|
|
60
|
-
*/
|
|
61
|
-
isAttached(): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Gets a path to the node. The path is an array containing indices of consecutive ancestors of this node,
|
|
64
|
-
* beginning from {@link module:engine/view/node~Node#root root}, down to this node's index.
|
|
65
|
-
*
|
|
66
|
-
* ```ts
|
|
67
|
-
* const abc = downcastWriter.createText( 'abc' );
|
|
68
|
-
* const foo = downcastWriter.createText( 'foo' );
|
|
69
|
-
* const h1 = downcastWriter.createElement( 'h1', null, downcastWriter.createText( 'header' ) );
|
|
70
|
-
* const p = downcastWriter.createElement( 'p', null, [ abc, foo ] );
|
|
71
|
-
* const div = downcastWriter.createElement( 'div', null, [ h1, p ] );
|
|
72
|
-
* foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.
|
|
73
|
-
* h1.getPath(); // Returns [ 0 ].
|
|
74
|
-
* div.getPath(); // Returns [].
|
|
75
|
-
* ```
|
|
76
|
-
*
|
|
77
|
-
* @returns The path.
|
|
78
|
-
*/
|
|
79
|
-
getPath(): Array<number>;
|
|
80
|
-
/**
|
|
81
|
-
* Returns ancestors array of this node.
|
|
82
|
-
*
|
|
83
|
-
* @param options Options object.
|
|
84
|
-
* @param options.includeSelf When set to `true` this node will be also included in parent's array.
|
|
85
|
-
* @param options.parentFirst When set to `true`, array will be sorted from node's parent to root element,
|
|
86
|
-
* otherwise root element will be the first item in the array.
|
|
87
|
-
* @returns Array with ancestors.
|
|
88
|
-
*/
|
|
89
|
-
getAncestors(options?: {
|
|
90
|
-
includeSelf?: boolean;
|
|
91
|
-
parentFirst?: boolean;
|
|
92
|
-
}): Array<Node | DocumentFragment>;
|
|
93
|
-
/**
|
|
94
|
-
* Returns a {@link module:engine/view/element~Element} or {@link module:engine/view/documentfragment~DocumentFragment}
|
|
95
|
-
* which is a common ancestor of both nodes.
|
|
96
|
-
*
|
|
97
|
-
* @param node The second node.
|
|
98
|
-
* @param options Options object.
|
|
99
|
-
* @param options.includeSelf When set to `true` both nodes will be considered "ancestors" too.
|
|
100
|
-
* Which means that if e.g. node A is inside B, then their common ancestor will be B.
|
|
101
|
-
*/
|
|
102
|
-
getCommonAncestor(node: Node, options?: {
|
|
103
|
-
includeSelf?: boolean;
|
|
104
|
-
}): Element | DocumentFragment | null;
|
|
105
|
-
/**
|
|
106
|
-
* Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,
|
|
107
|
-
* in different {@link module:engine/view/documentfragment~DocumentFragment}s).
|
|
108
|
-
*
|
|
109
|
-
* @param node Node to compare with.
|
|
110
|
-
*/
|
|
111
|
-
isBefore(node: Node): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,
|
|
114
|
-
* in different {@link module:engine/view/documentfragment~DocumentFragment}s).
|
|
115
|
-
*
|
|
116
|
-
* @param node Node to compare with.
|
|
117
|
-
*/
|
|
118
|
-
isAfter(node: Node): boolean;
|
|
119
|
-
/**
|
|
120
|
-
* Removes node from parent.
|
|
121
|
-
*
|
|
122
|
-
* @internal
|
|
123
|
-
*/
|
|
124
|
-
_remove(): void;
|
|
125
|
-
/**
|
|
126
|
-
* @internal
|
|
127
|
-
* @param type Type of the change.
|
|
128
|
-
* @param node Changed node.
|
|
129
|
-
* @fires change
|
|
130
|
-
*/
|
|
131
|
-
_fireChange(type: ChangeType, node: Node): void;
|
|
132
|
-
/**
|
|
133
|
-
* Custom toJSON method to solve child-parent circular dependencies.
|
|
134
|
-
*
|
|
135
|
-
* @returns Clone of this object with the parent property removed.
|
|
136
|
-
*/
|
|
137
|
-
toJSON(): unknown;
|
|
138
|
-
/**
|
|
139
|
-
* Clones this node.
|
|
140
|
-
*
|
|
141
|
-
* @internal
|
|
142
|
-
* @returns Clone of this node.
|
|
143
|
-
*/
|
|
144
|
-
abstract _clone(deep?: boolean): Node;
|
|
145
|
-
/**
|
|
146
|
-
* Checks if provided node is similar to this node.
|
|
147
|
-
*
|
|
148
|
-
* @returns True if nodes are similar.
|
|
149
|
-
*/
|
|
150
|
-
abstract isSimilar(other: Node): boolean;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Fired when list of {@link module:engine/view/element~Element elements} children, attributes or data changes.
|
|
154
|
-
*
|
|
155
|
-
* Change event is bubbled – it is fired on all ancestors.
|
|
156
|
-
*
|
|
157
|
-
* @eventName ~Node#change
|
|
158
|
-
* @eventName ~Node#change:children
|
|
159
|
-
* @eventName ~Node#change:attributes
|
|
160
|
-
* @eventName ~Node#change:text
|
|
161
|
-
*/
|
|
162
|
-
export type ViewNodeChangeEvent = {
|
|
163
|
-
name: 'change' | `change:${ChangeType}`;
|
|
164
|
-
args: [changedNode: Node];
|
|
165
|
-
};
|
|
166
|
-
export {};
|
|
@@ -1,49 +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/observer/arrowkeysobserver
|
|
11
|
-
*/
|
|
12
|
-
import Observer from './observer.js';
|
|
13
|
-
import type View from '../view.js';
|
|
14
|
-
import type { KeyEventData } from './keyobserver.js';
|
|
15
|
-
import type { BubblingEvent } from './bubblingemittermixin.js';
|
|
16
|
-
/**
|
|
17
|
-
* Arrow keys observer introduces the {@link module:engine/view/document~Document#event:arrowKey `Document#arrowKey`} event.
|
|
18
|
-
*
|
|
19
|
-
* Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
|
|
20
|
-
*/
|
|
21
|
-
export default class ArrowKeysObserver extends Observer {
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
constructor(view: View);
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
observe(): void;
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
stopObserving(): void;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Event fired when the user presses an arrow keys.
|
|
37
|
-
*
|
|
38
|
-
* Introduced by {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.
|
|
39
|
-
*
|
|
40
|
-
* Note that because {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver} is attached by the
|
|
41
|
-
* {@link module:engine/view/view~View} this event is available by default.
|
|
42
|
-
*
|
|
43
|
-
* @eventName module:engine/view/document~Document#arrowKey
|
|
44
|
-
* @param data
|
|
45
|
-
*/
|
|
46
|
-
export type ViewDocumentArrowKeyEvent = BubblingEvent<{
|
|
47
|
-
name: 'arrowKey';
|
|
48
|
-
args: [data: KeyEventData];
|
|
49
|
-
}>;
|
|
@@ -1,170 +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/observer/bubblingemittermixin
|
|
11
|
-
*/
|
|
12
|
-
import { type ArrayOrItem, type Emitter, type BaseEvent, type CallbackOptions, type Constructor, type Mixed } from '@ckeditor/ckeditor5-utils';
|
|
13
|
-
import BubblingEventInfo from './bubblingeventinfo.js';
|
|
14
|
-
import type Node from '../node.js';
|
|
15
|
-
/**
|
|
16
|
-
* Bubbling emitter mixin for the view document as described in the {@link ~BubblingEmitter} interface.
|
|
17
|
-
*
|
|
18
|
-
* This function creates a class that inherits from the provided `base` and implements `Emitter` interface.
|
|
19
|
-
* The base class must implement {@link module:utils/emittermixin~Emitter} interface.
|
|
20
|
-
*
|
|
21
|
-
* ```ts
|
|
22
|
-
* class BaseClass extends EmitterMixin() {
|
|
23
|
-
* // ...
|
|
24
|
-
* }
|
|
25
|
-
*
|
|
26
|
-
* class MyClass extends BubblingEmitterMixin( BaseClass ) {
|
|
27
|
-
* // This class derives from `BaseClass` and implements the `BubblingEmitter` interface.
|
|
28
|
-
* }
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export default function BubblingEmitterMixin<Base extends Constructor<Emitter>>(base: Base): Mixed<Base, BubblingEmitter>;
|
|
32
|
-
/**
|
|
33
|
-
* Bubbling emitter for the view document.
|
|
34
|
-
*
|
|
35
|
-
* Bubbling emitter is triggering events in the context of specified {@link module:engine/view/element~Element view element} name,
|
|
36
|
-
* predefined `'$text'`, `'$root'`, `'$document'` and `'$capture'` contexts, and context matchers provided as a function.
|
|
37
|
-
*
|
|
38
|
-
* Before bubbling starts, listeners for `'$capture'` context are triggered. Then the bubbling starts from the deeper selection
|
|
39
|
-
* position (by firing event on the `'$text'` context) and propagates the view document tree up to the `'$root'` and finally
|
|
40
|
-
* the listeners at `'$document'` context are fired (this is the default context).
|
|
41
|
-
*
|
|
42
|
-
* Examples:
|
|
43
|
-
*
|
|
44
|
-
* ```ts
|
|
45
|
-
* // Listeners registered in the context of the view element names:
|
|
46
|
-
* this.listenTo( viewDocument, 'enter', ( evt, data ) => {
|
|
47
|
-
* // ...
|
|
48
|
-
* }, { context: 'blockquote' } );
|
|
49
|
-
*
|
|
50
|
-
* this.listenTo( viewDocument, 'enter', ( evt, data ) => {
|
|
51
|
-
* // ...
|
|
52
|
-
* }, { context: 'li' } );
|
|
53
|
-
*
|
|
54
|
-
* // Listeners registered in the context of the '$text' and '$root' nodes.
|
|
55
|
-
* this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
|
|
56
|
-
* // ...
|
|
57
|
-
* }, { context: '$text', priority: 'high' } );
|
|
58
|
-
*
|
|
59
|
-
* this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
|
|
60
|
-
* // ...
|
|
61
|
-
* }, { context: '$root' } );
|
|
62
|
-
*
|
|
63
|
-
* // Listeners registered in the context of custom callback function.
|
|
64
|
-
* this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
|
|
65
|
-
* // ...
|
|
66
|
-
* }, { context: isWidget } );
|
|
67
|
-
*
|
|
68
|
-
* this.listenTo( view.document, 'arrowKey', ( evt, data ) => {
|
|
69
|
-
* // ...
|
|
70
|
-
* }, { context: isWidget, priority: 'high' } );
|
|
71
|
-
* ```
|
|
72
|
-
*
|
|
73
|
-
* Example flow for selection in text:
|
|
74
|
-
*
|
|
75
|
-
* ```xml
|
|
76
|
-
* <blockquote><p>Foo[]bar</p></blockquote>
|
|
77
|
-
* ```
|
|
78
|
-
*
|
|
79
|
-
* Fired events on contexts:
|
|
80
|
-
* 1. `'$capture'`
|
|
81
|
-
* 2. `'$text'`
|
|
82
|
-
* 3. `'p'`
|
|
83
|
-
* 4. `'blockquote'`
|
|
84
|
-
* 5. `'$root'`
|
|
85
|
-
* 6. `'$document'`
|
|
86
|
-
*
|
|
87
|
-
* Example flow for selection on element (i.e., Widget):
|
|
88
|
-
*
|
|
89
|
-
* ```xml
|
|
90
|
-
* <blockquote><p>Foo[<widget/>]bar</p></blockquote>
|
|
91
|
-
* ```
|
|
92
|
-
*
|
|
93
|
-
* Fired events on contexts:
|
|
94
|
-
* 1. `'$capture'`
|
|
95
|
-
* 2. *widget* (custom matcher)
|
|
96
|
-
* 3. `'p'`
|
|
97
|
-
* 4. `'blockquote'`
|
|
98
|
-
* 5. `'$root'`
|
|
99
|
-
* 6. `'$document'`
|
|
100
|
-
*
|
|
101
|
-
* There could be multiple listeners registered for the same context and at different priority levels:
|
|
102
|
-
*
|
|
103
|
-
* ```html
|
|
104
|
-
* <p>Foo[]bar</p>
|
|
105
|
-
* ```
|
|
106
|
-
*
|
|
107
|
-
* 1. `'$capture'` at priorities:
|
|
108
|
-
* 1. `'highest'`
|
|
109
|
-
* 2. `'high'`
|
|
110
|
-
* 3. `'normal'`
|
|
111
|
-
* 4. `'low'`
|
|
112
|
-
* 5. `'lowest'`
|
|
113
|
-
* 2. `'$text'` at priorities:
|
|
114
|
-
* 1. `'highest'`
|
|
115
|
-
* 2. `'high'`
|
|
116
|
-
* 3. `'normal'`
|
|
117
|
-
* 4. `'low'`
|
|
118
|
-
* 5. `'lowest'`
|
|
119
|
-
* 3. `'p'` at priorities:
|
|
120
|
-
* 1. `'highest'`
|
|
121
|
-
* 2. `'high'`
|
|
122
|
-
* 3. `'normal'`
|
|
123
|
-
* 4. `'low'`
|
|
124
|
-
* 5. `'lowest'`
|
|
125
|
-
* 4. `'$root'` at priorities:
|
|
126
|
-
* 1. `'highest'`
|
|
127
|
-
* 2. `'high'`
|
|
128
|
-
* 3. `'normal'`
|
|
129
|
-
* 4. `'low'`
|
|
130
|
-
* 5. `'lowest'`
|
|
131
|
-
* 5. `'$document'` at priorities:
|
|
132
|
-
* 1. `'highest'`
|
|
133
|
-
* 2. `'high'`
|
|
134
|
-
* 3. `'normal'`
|
|
135
|
-
* 4. `'low'`
|
|
136
|
-
* 5. `'lowest'`
|
|
137
|
-
*/
|
|
138
|
-
export type BubblingEmitter = Emitter;
|
|
139
|
-
/**
|
|
140
|
-
* A context matcher function.
|
|
141
|
-
*
|
|
142
|
-
* Should return true for nodes that that match the custom context.
|
|
143
|
-
*/
|
|
144
|
-
export type BubblingEventContextFunction = (node: Node) => boolean;
|
|
145
|
-
/**
|
|
146
|
-
* Helper type that allows describing bubbling event. Extends `TEvent` so that:
|
|
147
|
-
*
|
|
148
|
-
* * the event is called with {@link module:engine/view/observer/bubblingeventinfo~BubblingEventInfo}`
|
|
149
|
-
* instead of {@link module:utils/eventinfo~EventInfo}, and
|
|
150
|
-
* * {@link ~BubblingCallbackOptions} can be specified as additional options.
|
|
151
|
-
*
|
|
152
|
-
* @typeParam TEvent The event description to extend.
|
|
153
|
-
*/
|
|
154
|
-
export type BubblingEvent<TEvent extends BaseEvent> = TEvent & {
|
|
155
|
-
eventInfo: BubblingEventInfo<TEvent['name'], (TEvent extends {
|
|
156
|
-
return: infer TReturn;
|
|
157
|
-
} ? TReturn : unknown)>;
|
|
158
|
-
callbackOptions: BubblingCallbackOptions;
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* Additional options for registering a callback.
|
|
162
|
-
*/
|
|
163
|
-
export interface BubblingCallbackOptions extends CallbackOptions {
|
|
164
|
-
/**
|
|
165
|
-
* Specifies the context in which the event should be triggered to call the callback.
|
|
166
|
-
*
|
|
167
|
-
* @see ~BubblingEmitter
|
|
168
|
-
*/
|
|
169
|
-
context?: ArrayOrItem<string | BubblingEventContextFunction>;
|
|
170
|
-
}
|
|
@@ -1,51 +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/observer/bubblingeventinfo
|
|
11
|
-
*/
|
|
12
|
-
import { EventInfo } from '@ckeditor/ckeditor5-utils';
|
|
13
|
-
import type Document from '../document.js';
|
|
14
|
-
import type Node from '../node.js';
|
|
15
|
-
import type Range from '../range.js';
|
|
16
|
-
/**
|
|
17
|
-
* The event object passed to bubbling event callbacks. It is used to provide information about the event as well as a tool to
|
|
18
|
-
* manipulate it.
|
|
19
|
-
*/
|
|
20
|
-
export default class BubblingEventInfo<TName extends string = string, TReturn = unknown> extends EventInfo<TName, TReturn> {
|
|
21
|
-
/**
|
|
22
|
-
* The view range that the bubbling should start from.
|
|
23
|
-
*/
|
|
24
|
-
readonly startRange: Range;
|
|
25
|
-
/**
|
|
26
|
-
* The current event phase.
|
|
27
|
-
*/
|
|
28
|
-
private _eventPhase;
|
|
29
|
-
/**
|
|
30
|
-
* The current bubbling target.
|
|
31
|
-
*/
|
|
32
|
-
private _currentTarget;
|
|
33
|
-
/**
|
|
34
|
-
* @param source The emitter.
|
|
35
|
-
* @param name The event name.
|
|
36
|
-
* @param startRange The view range that the bubbling should start from.
|
|
37
|
-
*/
|
|
38
|
-
constructor(source: object, name: TName, startRange: Range);
|
|
39
|
-
/**
|
|
40
|
-
* The current event phase.
|
|
41
|
-
*/
|
|
42
|
-
get eventPhase(): EventPhase;
|
|
43
|
-
/**
|
|
44
|
-
* The current bubbling target.
|
|
45
|
-
*/
|
|
46
|
-
get currentTarget(): Document | Node | null;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The phase the event is in.
|
|
50
|
-
*/
|
|
51
|
-
export type EventPhase = 'none' | 'capturing' | 'atTarget' | 'bubbling';
|
|
@@ -1,47 +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/observer/clickobserver
|
|
11
|
-
*/
|
|
12
|
-
import DomEventObserver from './domeventobserver.js';
|
|
13
|
-
import type DomEventData from './domeventdata.js';
|
|
14
|
-
import type { BubblingEvent } from './bubblingemittermixin.js';
|
|
15
|
-
/**
|
|
16
|
-
* {@link module:engine/view/document~Document#event:click Click} event observer.
|
|
17
|
-
*
|
|
18
|
-
* Note that this observer is not available by default. To make it available it needs to be added to
|
|
19
|
-
* {@link module:engine/view/view~View view controller} by a {@link module:engine/view/view~View#addObserver} method.
|
|
20
|
-
*/
|
|
21
|
-
export default class ClickObserver extends DomEventObserver<'click'> {
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
readonly domEventType: "click";
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
onDomEvent(domEvent: MouseEvent): void;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Fired when one of the editables has been clicked.
|
|
33
|
-
*
|
|
34
|
-
* Introduced by {@link module:engine/view/observer/clickobserver~ClickObserver}.
|
|
35
|
-
*
|
|
36
|
-
* Note that this event is not available by default. To make it available
|
|
37
|
-
* {@link module:engine/view/observer/clickobserver~ClickObserver} needs to be added
|
|
38
|
-
* to {@link module:engine/view/view~View} by a {@link module:engine/view/view~View#addObserver} method.
|
|
39
|
-
*
|
|
40
|
-
* @see module:engine/view/observer/clickobserver~ClickObserver
|
|
41
|
-
* @eventName module:engine/view/document~Document#click
|
|
42
|
-
* @param data Event data.
|
|
43
|
-
*/
|
|
44
|
-
export type ViewDocumentClickEvent = BubblingEvent<{
|
|
45
|
-
name: 'click';
|
|
46
|
-
args: [data: DomEventData<MouseEvent>];
|
|
47
|
-
}>;
|
|
@@ -1,86 +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/observer/compositionobserver
|
|
11
|
-
*/
|
|
12
|
-
import DomEventObserver from './domeventobserver.js';
|
|
13
|
-
import type View from '../view.js';
|
|
14
|
-
import type DomEventData from './domeventdata.js';
|
|
15
|
-
/**
|
|
16
|
-
* {@link module:engine/view/document~Document#event:compositionstart Compositionstart},
|
|
17
|
-
* {@link module:engine/view/document~Document#event:compositionupdate compositionupdate} and
|
|
18
|
-
* {@link module:engine/view/document~Document#event:compositionend compositionend} events observer.
|
|
19
|
-
*
|
|
20
|
-
* Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
|
|
21
|
-
*/
|
|
22
|
-
export default class CompositionObserver extends DomEventObserver<'compositionstart' | 'compositionupdate' | 'compositionend'> {
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
readonly domEventType: readonly ["compositionstart", "compositionupdate", "compositionend"];
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
constructor(view: View);
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
onDomEvent(domEvent: CompositionEvent): void;
|
|
35
|
-
}
|
|
36
|
-
export interface CompositionEventData extends DomEventData<CompositionEvent> {
|
|
37
|
-
data: string | null;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Fired when composition starts inside one of the editables.
|
|
41
|
-
*
|
|
42
|
-
* Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
|
|
43
|
-
*
|
|
44
|
-
* Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
|
|
45
|
-
* {@link module:engine/view/view~View} this event is available by default.
|
|
46
|
-
*
|
|
47
|
-
* @see module:engine/view/observer/compositionobserver~CompositionObserver
|
|
48
|
-
* @eventName module:engine/view/document~Document#compositionstart
|
|
49
|
-
* @param data Event data.
|
|
50
|
-
*/
|
|
51
|
-
export type ViewDocumentCompositionStartEvent = {
|
|
52
|
-
name: 'compositionstart';
|
|
53
|
-
args: [data: CompositionEventData];
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Fired when composition is updated inside one of the editables.
|
|
57
|
-
*
|
|
58
|
-
* Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
|
|
59
|
-
*
|
|
60
|
-
* Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
|
|
61
|
-
* {@link module:engine/view/view~View} this event is available by default.
|
|
62
|
-
*
|
|
63
|
-
* @see module:engine/view/observer/compositionobserver~CompositionObserver
|
|
64
|
-
* @eventName module:engine/view/document~Document#compositionupdate
|
|
65
|
-
* @param data Event data.
|
|
66
|
-
*/
|
|
67
|
-
export type ViewDocumentCompositionUpdateEvent = {
|
|
68
|
-
name: 'compositionupdate';
|
|
69
|
-
args: [data: CompositionEventData];
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Fired when composition ends inside one of the editables.
|
|
73
|
-
*
|
|
74
|
-
* Introduced by {@link module:engine/view/observer/compositionobserver~CompositionObserver}.
|
|
75
|
-
*
|
|
76
|
-
* Note that because {@link module:engine/view/observer/compositionobserver~CompositionObserver} is attached by the
|
|
77
|
-
* {@link module:engine/view/view~View} this event is available by default.
|
|
78
|
-
*
|
|
79
|
-
* @see module:engine/view/observer/compositionobserver~CompositionObserver
|
|
80
|
-
* @eventName module:engine/view/document~Document#compositionend
|
|
81
|
-
* @param data Event data.
|
|
82
|
-
*/
|
|
83
|
-
export type ViewDocumentCompositionEndEvent = {
|
|
84
|
-
name: 'compositionend';
|
|
85
|
-
args: [data: CompositionEventData];
|
|
86
|
-
};
|
|
@@ -1,54 +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
|
-
import type Document from '../document.js';
|
|
10
|
-
import type Element from '../element.js';
|
|
11
|
-
import type View from '../view.js';
|
|
12
|
-
/**
|
|
13
|
-
* Information about a DOM event in context of the {@link module:engine/view/document~Document}.
|
|
14
|
-
* It wraps the native event, which usually should not be used as the wrapper contains
|
|
15
|
-
* additional data (like key code for keyboard events).
|
|
16
|
-
*
|
|
17
|
-
* @typeParam TEvent The type of DOM Event that this class represents.
|
|
18
|
-
*/
|
|
19
|
-
export default class DomEventData<TEvent extends Event = Event> {
|
|
20
|
-
/**
|
|
21
|
-
* Instance of the view controller.
|
|
22
|
-
*/
|
|
23
|
-
readonly view: View;
|
|
24
|
-
/**
|
|
25
|
-
* The instance of the document.
|
|
26
|
-
*/
|
|
27
|
-
readonly document: Document;
|
|
28
|
-
/**
|
|
29
|
-
* The DOM event.
|
|
30
|
-
*/
|
|
31
|
-
readonly domEvent: TEvent;
|
|
32
|
-
/**
|
|
33
|
-
* The DOM target.
|
|
34
|
-
*/
|
|
35
|
-
readonly domTarget: HTMLElement;
|
|
36
|
-
/**
|
|
37
|
-
* @param view The instance of the view controller.
|
|
38
|
-
* @param domEvent The DOM event.
|
|
39
|
-
* @param additionalData Additional properties that the instance should contain.
|
|
40
|
-
*/
|
|
41
|
-
constructor(view: View, domEvent: TEvent, additionalData?: object);
|
|
42
|
-
/**
|
|
43
|
-
* The tree view element representing the target.
|
|
44
|
-
*/
|
|
45
|
-
get target(): Element;
|
|
46
|
-
/**
|
|
47
|
-
* Prevents the native's event default action.
|
|
48
|
-
*/
|
|
49
|
-
preventDefault(): void;
|
|
50
|
-
/**
|
|
51
|
-
* Stops native event propagation.
|
|
52
|
-
*/
|
|
53
|
-
stopPropagation(): void;
|
|
54
|
-
}
|