@ckeditor/ckeditor5-engine 44.1.0 → 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,82 +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/domeventobserver
|
|
11
|
-
*/
|
|
12
|
-
import Observer from './observer.js';
|
|
13
|
-
import type { EventInfo } from '@ckeditor/ckeditor5-utils';
|
|
14
|
-
/**
|
|
15
|
-
* Base class for DOM event observers. This class handles
|
|
16
|
-
* {@link module:engine/view/observer/observer~Observer#observe adding} listeners to DOM elements,
|
|
17
|
-
* {@link module:engine/view/observer/observer~Observer#disable disabling} and
|
|
18
|
-
* {@link module:engine/view/observer/observer~Observer#enable re-enabling} events.
|
|
19
|
-
* Child class needs to define
|
|
20
|
-
* {@link module:engine/view/observer/domeventobserver~DomEventObserver#domEventType DOM event type} and
|
|
21
|
-
* {@link module:engine/view/observer/domeventobserver~DomEventObserver#onDomEvent callback}.
|
|
22
|
-
*
|
|
23
|
-
* For instance:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* class ClickObserver extends DomEventObserver<'click'> {
|
|
27
|
-
* // It can also be defined as a normal property in the constructor.
|
|
28
|
-
* get domEventType(): 'click' {
|
|
29
|
-
* return 'click';
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* onDomEvent( domEvent: MouseEvent ): void {
|
|
33
|
-
* this.fire( 'click', domEvent );
|
|
34
|
-
* }
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @typeParam EventType DOM Event type name or an union of those.
|
|
39
|
-
* @typeParam AdditionalData Additional data passed along with the event.
|
|
40
|
-
*/
|
|
41
|
-
export default abstract class DomEventObserver<EventType extends keyof HTMLElementEventMap, AdditionalData extends object = object> extends Observer {
|
|
42
|
-
/**
|
|
43
|
-
* Type of the DOM event the observer should listen to. Array of types can be defined
|
|
44
|
-
* if the observer should listen to multiple DOM events.
|
|
45
|
-
*/
|
|
46
|
-
abstract get domEventType(): EventType | ReadonlyArray<EventType>;
|
|
47
|
-
/**
|
|
48
|
-
* If set to `true` DOM events will be listened on the capturing phase.
|
|
49
|
-
* Default value is `false`.
|
|
50
|
-
*/
|
|
51
|
-
useCapture: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* If set to `true`, indicates that the function specified by listener will never call `preventDefault()`.
|
|
54
|
-
* Default value is `false`.
|
|
55
|
-
*/
|
|
56
|
-
usePassive: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Callback which should be called when the DOM event occurred. Note that the callback will not be called if
|
|
59
|
-
* observer {@link #isEnabled is not enabled}.
|
|
60
|
-
*
|
|
61
|
-
* @see #domEventType
|
|
62
|
-
*/
|
|
63
|
-
abstract onDomEvent(event: HTMLElementEventMap[EventType]): void;
|
|
64
|
-
/**
|
|
65
|
-
* @inheritDoc
|
|
66
|
-
*/
|
|
67
|
-
observe(domElement: HTMLElement): void;
|
|
68
|
-
/**
|
|
69
|
-
* @inheritDoc
|
|
70
|
-
*/
|
|
71
|
-
stopObserving(domElement: HTMLElement): void;
|
|
72
|
-
/**
|
|
73
|
-
* Calls `Document#fire()` if observer {@link #isEnabled is enabled}.
|
|
74
|
-
*
|
|
75
|
-
* @see module:utils/emittermixin~Emitter#fire
|
|
76
|
-
* @param eventType The event type (name).
|
|
77
|
-
* @param domEvent The DOM event.
|
|
78
|
-
* @param additionalData The additional data which should extend the
|
|
79
|
-
* {@link module:engine/view/observer/domeventdata~DomEventData event data} object.
|
|
80
|
-
*/
|
|
81
|
-
fire(eventType: string | EventInfo, domEvent: Event, additionalData?: AdditionalData): void;
|
|
82
|
-
}
|
|
@@ -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/fakeselectionobserver
|
|
11
|
-
*/
|
|
12
|
-
import Observer from './observer.js';
|
|
13
|
-
import type View from '../view.js';
|
|
14
|
-
/**
|
|
15
|
-
* Fake selection observer class. If view selection is fake it is placed in dummy DOM container. This observer listens
|
|
16
|
-
* on {@link module:engine/view/document~Document#event:keydown keydown} events and handles moving fake view selection to the correct place
|
|
17
|
-
* if arrow keys are pressed.
|
|
18
|
-
* Fires {@link module:engine/view/document~Document#event:selectionChange selectionChange event} simulating natural behaviour of
|
|
19
|
-
* {@link module:engine/view/observer/selectionobserver~SelectionObserver SelectionObserver}.
|
|
20
|
-
*/
|
|
21
|
-
export default class FakeSelectionObserver extends Observer {
|
|
22
|
-
/**
|
|
23
|
-
* Fires debounced event `selectionChangeDone`. It uses `lodash#debounce` method to delay function call.
|
|
24
|
-
*/
|
|
25
|
-
private readonly _fireSelectionChangeDoneDebounced;
|
|
26
|
-
/**
|
|
27
|
-
* Creates new FakeSelectionObserver instance.
|
|
28
|
-
*/
|
|
29
|
-
constructor(view: View);
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
observe(): void;
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
stopObserving(): void;
|
|
38
|
-
/**
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
destroy(): void;
|
|
42
|
-
/**
|
|
43
|
-
* Handles collapsing view selection according to given key code. If left or up key is provided - new selection will be
|
|
44
|
-
* collapsed to left. If right or down key is pressed - new selection will be collapsed to right.
|
|
45
|
-
*
|
|
46
|
-
* This method fires {@link module:engine/view/document~Document#event:selectionChange} and
|
|
47
|
-
* {@link module:engine/view/document~Document#event:selectionChangeDone} events imitating behaviour of
|
|
48
|
-
* {@link module:engine/view/observer/selectionobserver~SelectionObserver}.
|
|
49
|
-
*/
|
|
50
|
-
private _handleSelectionMove;
|
|
51
|
-
}
|
|
@@ -1,98 +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/focusobserver
|
|
11
|
-
*/
|
|
12
|
-
import DomEventObserver from './domeventobserver.js';
|
|
13
|
-
import type DomEventData from './domeventdata.js';
|
|
14
|
-
import type View from '../view.js';
|
|
15
|
-
/**
|
|
16
|
-
* {@link module:engine/view/document~Document#event:focus Focus}
|
|
17
|
-
* and {@link module:engine/view/document~Document#event:blur blur} events observer.
|
|
18
|
-
* Focus observer handle also {@link module:engine/view/rooteditableelement~RootEditableElement#isFocused isFocused} property of the
|
|
19
|
-
* {@link module:engine/view/rooteditableelement~RootEditableElement root elements}.
|
|
20
|
-
*
|
|
21
|
-
* Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
|
|
22
|
-
*/
|
|
23
|
-
export default class FocusObserver extends DomEventObserver<'focus' | 'blur'> {
|
|
24
|
-
/**
|
|
25
|
-
* Identifier of the timeout currently used by focus listener to delay rendering execution.
|
|
26
|
-
*/
|
|
27
|
-
private _renderTimeoutId;
|
|
28
|
-
/**
|
|
29
|
-
* Set to `true` if the document is in the process of setting the focus.
|
|
30
|
-
*
|
|
31
|
-
* The flag is used to indicate that setting the focus is in progress.
|
|
32
|
-
*/
|
|
33
|
-
private _isFocusChanging;
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
readonly domEventType: readonly ["focus", "blur"];
|
|
38
|
-
/**
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
constructor(view: View);
|
|
42
|
-
/**
|
|
43
|
-
* Finishes setting the document focus state.
|
|
44
|
-
*/
|
|
45
|
-
flush(): void;
|
|
46
|
-
/**
|
|
47
|
-
* @inheritDoc
|
|
48
|
-
*/
|
|
49
|
-
onDomEvent(domEvent: FocusEvent): void;
|
|
50
|
-
/**
|
|
51
|
-
* @inheritDoc
|
|
52
|
-
*/
|
|
53
|
-
destroy(): void;
|
|
54
|
-
/**
|
|
55
|
-
* The `focus` event handler.
|
|
56
|
-
*/
|
|
57
|
-
private _handleFocus;
|
|
58
|
-
/**
|
|
59
|
-
* The `blur` event handler.
|
|
60
|
-
*/
|
|
61
|
-
private _handleBlur;
|
|
62
|
-
/**
|
|
63
|
-
* Clears timeout.
|
|
64
|
-
*/
|
|
65
|
-
private _clearTimeout;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Fired when one of the editables gets focus.
|
|
69
|
-
*
|
|
70
|
-
* Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
|
|
71
|
-
*
|
|
72
|
-
* Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
|
|
73
|
-
* {@link module:engine/view/view~View} this event is available by default.
|
|
74
|
-
*
|
|
75
|
-
* @see module:engine/view/observer/focusobserver~FocusObserver
|
|
76
|
-
* @eventName module:engine/view/document~Document#focus
|
|
77
|
-
* @param data Event data.
|
|
78
|
-
*/
|
|
79
|
-
export type ViewDocumentFocusEvent = {
|
|
80
|
-
name: 'focus';
|
|
81
|
-
args: [data: DomEventData<FocusEvent>];
|
|
82
|
-
};
|
|
83
|
-
/**
|
|
84
|
-
* Fired when one of the editables loses focus.
|
|
85
|
-
*
|
|
86
|
-
* Introduced by {@link module:engine/view/observer/focusobserver~FocusObserver}.
|
|
87
|
-
*
|
|
88
|
-
* Note that because {@link module:engine/view/observer/focusobserver~FocusObserver} is attached by the
|
|
89
|
-
* {@link module:engine/view/view~View} this event is available by default.
|
|
90
|
-
*
|
|
91
|
-
* @see module:engine/view/observer/focusobserver~FocusObserver
|
|
92
|
-
* @eventName module:engine/view/document~Document#blur
|
|
93
|
-
* @param data Event data.
|
|
94
|
-
*/
|
|
95
|
-
export type ViewDocumentBlurEvent = {
|
|
96
|
-
name: 'blur';
|
|
97
|
-
args: [data: DomEventData<FocusEvent>];
|
|
98
|
-
};
|
|
@@ -1,90 +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/inputobserver
|
|
11
|
-
*/
|
|
12
|
-
import DomEventObserver from './domeventobserver.js';
|
|
13
|
-
import type DomEventData from './domeventdata.js';
|
|
14
|
-
import type ViewRange from '../range.js';
|
|
15
|
-
import DataTransfer from '../datatransfer.js';
|
|
16
|
-
/**
|
|
17
|
-
* Observer for events connected with data input.
|
|
18
|
-
*
|
|
19
|
-
* **Note**: This observer is attached by {@link module:engine/view/view~View} and available by default in all
|
|
20
|
-
* editor instances.
|
|
21
|
-
*/
|
|
22
|
-
export default class InputObserver extends DomEventObserver<'beforeinput'> {
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
readonly domEventType: "beforeinput";
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
onDomEvent(domEvent: InputEvent): void;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Fired before the web browser inputs, deletes, or formats some data.
|
|
34
|
-
*
|
|
35
|
-
* This event is introduced by {@link module:engine/view/observer/inputobserver~InputObserver} and available
|
|
36
|
-
* by default in all editor instances (attached by {@link module:engine/view/view~View}).
|
|
37
|
-
*
|
|
38
|
-
* @see module:engine/view/observer/inputobserver~InputObserver
|
|
39
|
-
* @eventName module:engine/view/document~Document#beforeinput
|
|
40
|
-
* @param data Event data containing detailed information about the event.
|
|
41
|
-
*/
|
|
42
|
-
export type ViewDocumentInputEvent = {
|
|
43
|
-
name: 'beforeinput';
|
|
44
|
-
args: [data: InputEventData];
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* The value of the {@link ~ViewDocumentInputEvent} event.
|
|
48
|
-
*/
|
|
49
|
-
export interface InputEventData extends DomEventData<InputEvent> {
|
|
50
|
-
/**
|
|
51
|
-
* The type of the input event (e.g. "insertText" or "deleteWordBackward"). Corresponds to native `InputEvent#inputType`.
|
|
52
|
-
*/
|
|
53
|
-
readonly inputType: string;
|
|
54
|
-
/**
|
|
55
|
-
* A unified text data passed along with the input event. Depending on:
|
|
56
|
-
*
|
|
57
|
-
* * the web browser and input events implementation (for instance [Level 1](https://www.w3.org/TR/input-events-1/) or
|
|
58
|
-
* [Level 2](https://www.w3.org/TR/input-events-2/)),
|
|
59
|
-
* * {@link module:engine/view/observer/inputobserver~InputEventData#inputType input type}
|
|
60
|
-
*
|
|
61
|
-
* text data is sometimes passed in the `data` and sometimes in the `dataTransfer` property.
|
|
62
|
-
*
|
|
63
|
-
* * If `InputEvent#data` was set, this property reflects its value.
|
|
64
|
-
* * If `InputEvent#data` is unavailable, this property contains the `'text/plain'` data from
|
|
65
|
-
* {@link module:engine/view/observer/inputobserver~InputEventData#dataTransfer}.
|
|
66
|
-
* * If the event ({@link module:engine/view/observer/inputobserver~InputEventData#inputType input type})
|
|
67
|
-
* provides no data whatsoever, this property is `null`.
|
|
68
|
-
*/
|
|
69
|
-
readonly data: string | null;
|
|
70
|
-
/**
|
|
71
|
-
* The data transfer instance of the input event. Corresponds to native `InputEvent#dataTransfer`.
|
|
72
|
-
*
|
|
73
|
-
* The value is `null` when no `dataTransfer` was passed along with the input event.
|
|
74
|
-
*/
|
|
75
|
-
readonly dataTransfer: DataTransfer;
|
|
76
|
-
/**
|
|
77
|
-
* A flag indicating that the `beforeinput` event was fired during composition.
|
|
78
|
-
*
|
|
79
|
-
* Corresponds to the
|
|
80
|
-
* {@link module:engine/view/document~Document#event:compositionstart},
|
|
81
|
-
* {@link module:engine/view/document~Document#event:compositionupdate},
|
|
82
|
-
* and {@link module:engine/view/document~Document#event:compositionend } trio.
|
|
83
|
-
*/
|
|
84
|
-
readonly isComposing: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* Editing {@link module:engine/view/range~Range view ranges} corresponding to DOM ranges provided by the web browser
|
|
87
|
-
* (as returned by `InputEvent#getTargetRanges()`).
|
|
88
|
-
*/
|
|
89
|
-
readonly targetRanges: Array<ViewRange>;
|
|
90
|
-
}
|
|
@@ -1,70 +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/keyobserver
|
|
11
|
-
*/
|
|
12
|
-
import DomEventObserver from './domeventobserver.js';
|
|
13
|
-
import type DomEventData from './domeventdata.js';
|
|
14
|
-
import { type KeystrokeInfo } from '@ckeditor/ckeditor5-utils';
|
|
15
|
-
/**
|
|
16
|
-
* Observer for events connected with pressing keyboard keys.
|
|
17
|
-
*
|
|
18
|
-
* Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
|
|
19
|
-
*/
|
|
20
|
-
export default class KeyObserver extends DomEventObserver<'keydown' | 'keyup', KeystrokeInfo & {
|
|
21
|
-
keystroke: number;
|
|
22
|
-
}> {
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
readonly domEventType: readonly ["keydown", "keyup"];
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
onDomEvent(domEvt: KeyboardEvent): void;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Fired when a key has been pressed.
|
|
34
|
-
*
|
|
35
|
-
* Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
|
|
36
|
-
*
|
|
37
|
-
* Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
|
|
38
|
-
* {@link module:engine/view/view~View} this event is available by default.
|
|
39
|
-
*
|
|
40
|
-
* @see module:engine/view/observer/keyobserver~KeyObserver
|
|
41
|
-
* @eventName module:engine/view/document~Document#keydown
|
|
42
|
-
*/
|
|
43
|
-
export type ViewDocumentKeyDownEvent = {
|
|
44
|
-
name: 'keydown';
|
|
45
|
-
args: [data: KeyEventData];
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Fired when a key has been released.
|
|
49
|
-
*
|
|
50
|
-
* Introduced by {@link module:engine/view/observer/keyobserver~KeyObserver}.
|
|
51
|
-
*
|
|
52
|
-
* Note that because {@link module:engine/view/observer/keyobserver~KeyObserver} is attached by the
|
|
53
|
-
* {@link module:engine/view/view~View} this event is available by default.
|
|
54
|
-
*
|
|
55
|
-
* @see module:engine/view/observer/keyobserver~KeyObserver
|
|
56
|
-
* @eventName module:engine/view/document~Document#keyup
|
|
57
|
-
*/
|
|
58
|
-
export type ViewDocumentKeyUpEvent = {
|
|
59
|
-
name: 'keyup';
|
|
60
|
-
args: [data: KeyEventData];
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* The value of both events - {@link ~ViewDocumentKeyDownEvent} and {@link ~ViewDocumentKeyUpEvent}.
|
|
64
|
-
*/
|
|
65
|
-
export interface KeyEventData extends DomEventData<KeyboardEvent>, KeystrokeInfo {
|
|
66
|
-
/**
|
|
67
|
-
* Code of the whole keystroke. See {@link module:utils/keyboard~getCode}.
|
|
68
|
-
*/
|
|
69
|
-
keystroke: number;
|
|
70
|
-
}
|
|
@@ -1,93 +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/mouseobserver
|
|
11
|
-
*/
|
|
12
|
-
import DomEventObserver from './domeventobserver.js';
|
|
13
|
-
import type DomEventData from './domeventdata.js';
|
|
14
|
-
/**
|
|
15
|
-
* Mouse events observer.
|
|
16
|
-
*
|
|
17
|
-
* Note that this observer is not available by default. To make it available it needs to be added to
|
|
18
|
-
* {@link module:engine/view/view~View} by {@link module:engine/view/view~View#addObserver} method.
|
|
19
|
-
*/
|
|
20
|
-
export default class MouseObserver extends DomEventObserver<'mousedown' | 'mouseup' | 'mouseover' | 'mouseout'> {
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
readonly domEventType: readonly ["mousedown", "mouseup", "mouseover", "mouseout"];
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
onDomEvent(domEvent: MouseEvent): void;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Fired when the mouse button is pressed down on one of the editing roots of the editor.
|
|
32
|
-
*
|
|
33
|
-
* Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
|
|
34
|
-
*
|
|
35
|
-
* Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
|
|
36
|
-
* needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
|
|
37
|
-
*
|
|
38
|
-
* @see module:engine/view/observer/mouseobserver~MouseObserver
|
|
39
|
-
* @eventName module:engine/view/document~Document#mousedown
|
|
40
|
-
* @param data The event data.
|
|
41
|
-
*/
|
|
42
|
-
export type ViewDocumentMouseDownEvent = {
|
|
43
|
-
name: 'mousedown';
|
|
44
|
-
args: [data: DomEventData<MouseEvent>];
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Fired when the mouse button is released over one of the editing roots of the editor.
|
|
48
|
-
*
|
|
49
|
-
* Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
|
|
50
|
-
*
|
|
51
|
-
* Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
|
|
52
|
-
* needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
|
|
53
|
-
*
|
|
54
|
-
* @see module:engine/view/observer/mouseobserver~MouseObserver
|
|
55
|
-
* @eventName module:engine/view/document~Document#mouseup
|
|
56
|
-
* @param data The event data.
|
|
57
|
-
*/
|
|
58
|
-
export type ViewDocumentMouseUpEvent = {
|
|
59
|
-
name: 'mouseup';
|
|
60
|
-
args: [data: DomEventData<MouseEvent>];
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Fired when the mouse is over one of the editing roots of the editor.
|
|
64
|
-
*
|
|
65
|
-
* Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
|
|
66
|
-
*
|
|
67
|
-
* Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
|
|
68
|
-
* needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
|
|
69
|
-
*
|
|
70
|
-
* @see module:engine/view/observer/mouseobserver~MouseObserver
|
|
71
|
-
* @eventName module:engine/view/document~Document#mouseover
|
|
72
|
-
* @param data The event data.
|
|
73
|
-
*/
|
|
74
|
-
export type ViewDocumentMouseOverEvent = {
|
|
75
|
-
name: 'mouseover';
|
|
76
|
-
args: [data: DomEventData<MouseEvent>];
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Fired when the mouse is moved out of the one of the editing roots of the editor.
|
|
80
|
-
*
|
|
81
|
-
* Introduced by {@link module:engine/view/observer/mouseobserver~MouseObserver}.
|
|
82
|
-
*
|
|
83
|
-
* Note that this event is not available by default. To make it available, {@link module:engine/view/observer/mouseobserver~MouseObserver}
|
|
84
|
-
* needs to be added to {@link module:engine/view/view~View} by the {@link module:engine/view/view~View#addObserver} method.
|
|
85
|
-
*
|
|
86
|
-
* @see module:engine/view/observer/mouseobserver~MouseObserver
|
|
87
|
-
* @eventName module:engine/view/document~Document#mouseout
|
|
88
|
-
* @param data The event data.
|
|
89
|
-
*/
|
|
90
|
-
export type ViewDocumentMouseOutEvent = {
|
|
91
|
-
name: 'mouseout';
|
|
92
|
-
args: [data: DomEventData<MouseEvent>];
|
|
93
|
-
};
|
|
@@ -1,119 +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/mutationobserver
|
|
11
|
-
*/
|
|
12
|
-
import Observer from './observer.js';
|
|
13
|
-
import type DomConverter from '../domconverter.js';
|
|
14
|
-
import type View from '../view.js';
|
|
15
|
-
import type ViewNode from '../node.js';
|
|
16
|
-
import type { ChangeType } from '../document.js';
|
|
17
|
-
/**
|
|
18
|
-
* Mutation observer's role is to watch for any DOM changes inside the editor that weren't
|
|
19
|
-
* done by the editor's {@link module:engine/view/renderer~Renderer} itself and reverting these changes.
|
|
20
|
-
*
|
|
21
|
-
* It does this by observing all mutations in the DOM, marking related view elements as changed and calling
|
|
22
|
-
* {@link module:engine/view/renderer~Renderer#render}. Because all mutated nodes are marked as
|
|
23
|
-
* "to be rendered" and the {@link module:engine/view/renderer~Renderer#render `render()`} method is called,
|
|
24
|
-
* all changes are reverted in the DOM (the DOM is synced with the editor's view structure).
|
|
25
|
-
*
|
|
26
|
-
* Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.
|
|
27
|
-
*/
|
|
28
|
-
export default class MutationObserver extends Observer {
|
|
29
|
-
/**
|
|
30
|
-
* Reference to the {@link module:engine/view/view~View#domConverter}.
|
|
31
|
-
*/
|
|
32
|
-
readonly domConverter: DomConverter;
|
|
33
|
-
/**
|
|
34
|
-
* Native mutation observer config.
|
|
35
|
-
*/
|
|
36
|
-
private readonly _config;
|
|
37
|
-
/**
|
|
38
|
-
* Observed DOM elements.
|
|
39
|
-
*/
|
|
40
|
-
private readonly _domElements;
|
|
41
|
-
/**
|
|
42
|
-
* Native mutation observer.
|
|
43
|
-
*/
|
|
44
|
-
private _mutationObserver;
|
|
45
|
-
/**
|
|
46
|
-
* @inheritDoc
|
|
47
|
-
*/
|
|
48
|
-
constructor(view: View);
|
|
49
|
-
/**
|
|
50
|
-
* Synchronously handles mutations and empties the queue.
|
|
51
|
-
*/
|
|
52
|
-
flush(): void;
|
|
53
|
-
/**
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
observe(domElement: HTMLElement): void;
|
|
57
|
-
/**
|
|
58
|
-
* @inheritDoc
|
|
59
|
-
*/
|
|
60
|
-
stopObserving(domElement: HTMLElement): void;
|
|
61
|
-
/**
|
|
62
|
-
* @inheritDoc
|
|
63
|
-
*/
|
|
64
|
-
enable(): void;
|
|
65
|
-
/**
|
|
66
|
-
* @inheritDoc
|
|
67
|
-
*/
|
|
68
|
-
disable(): void;
|
|
69
|
-
/**
|
|
70
|
-
* @inheritDoc
|
|
71
|
-
*/
|
|
72
|
-
destroy(): void;
|
|
73
|
-
/**
|
|
74
|
-
* Handles mutations. Mark view elements to sync and call render.
|
|
75
|
-
*
|
|
76
|
-
* @param domMutations Array of native mutations.
|
|
77
|
-
*/
|
|
78
|
-
private _onMutations;
|
|
79
|
-
/**
|
|
80
|
-
* Checks if mutation was generated by the browser inserting bogus br on the end of the block element.
|
|
81
|
-
* Such mutations are generated while pressing space or performing native spellchecker correction
|
|
82
|
-
* on the end of the block element in Firefox browser.
|
|
83
|
-
*
|
|
84
|
-
* @param mutation Native mutation object.
|
|
85
|
-
*/
|
|
86
|
-
private _isBogusBrMutation;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Event fired on DOM mutations detected.
|
|
90
|
-
*
|
|
91
|
-
* This event is introduced by {@link module:engine/view/observer/mutationobserver~MutationObserver} and available
|
|
92
|
-
* by default in all editor instances (attached by {@link module:engine/view/view~View}).
|
|
93
|
-
*
|
|
94
|
-
* @eventName module:engine/view/document~Document#mutations
|
|
95
|
-
* @param data Event data containing detailed information about the event.
|
|
96
|
-
*/
|
|
97
|
-
export type ViewDocumentMutationsEvent = {
|
|
98
|
-
name: 'mutations';
|
|
99
|
-
args: [data: MutationsEventData];
|
|
100
|
-
};
|
|
101
|
-
/**
|
|
102
|
-
* The value of {@link ~ViewDocumentMutationsEvent}.
|
|
103
|
-
*/
|
|
104
|
-
export type MutationsEventData = {
|
|
105
|
-
mutations: Array<MutationData>;
|
|
106
|
-
};
|
|
107
|
-
/**
|
|
108
|
-
* A single entry in {@link ~MutationsEventData} mutations array.
|
|
109
|
-
*/
|
|
110
|
-
export type MutationData = {
|
|
111
|
-
/**
|
|
112
|
-
* Type of mutation detected.
|
|
113
|
-
*/
|
|
114
|
-
type: ChangeType;
|
|
115
|
-
/**
|
|
116
|
-
* The view node related to the detected mutation.
|
|
117
|
-
*/
|
|
118
|
-
node: ViewNode;
|
|
119
|
-
};
|