@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
package/dist/view/filler.d.ts
DELETED
|
@@ -1,115 +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 View from './view.js';
|
|
10
|
-
/**
|
|
11
|
-
* Set of utilities related to handling block and inline fillers.
|
|
12
|
-
*
|
|
13
|
-
* Browsers do not allow to put caret in elements which does not have height. Because of it, we need to fill all
|
|
14
|
-
* empty elements which should be selectable with elements or characters called "fillers". Unfortunately there is no one
|
|
15
|
-
* universal filler, this is why two types are uses:
|
|
16
|
-
*
|
|
17
|
-
* * Block filler is an element which fill block elements, like `<p>`. CKEditor uses `<br>` as a block filler during the editing,
|
|
18
|
-
* as browsers do natively. So instead of an empty `<p>` there will be `<p><br></p>`. The advantage of block filler is that
|
|
19
|
-
* it is transparent for the selection, so when the caret is before the `<br>` and user presses right arrow he will be
|
|
20
|
-
* moved to the next paragraph, not after the `<br>`. The disadvantage is that it breaks a block, so it can not be used
|
|
21
|
-
* in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `<br>` filler} can be replaced with any other
|
|
22
|
-
* character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space} or
|
|
23
|
-
* {@link module:engine/view/filler~MARKED_NBSP_FILLER marked non-breaking space}.
|
|
24
|
-
*
|
|
25
|
-
* * Inline filler is a filler which does not break a line of text, so it can be used inside the text, for instance in the empty
|
|
26
|
-
* `<b>` surrendered by text: `foo<b></b>bar`, if we want to put the caret there. CKEditor uses a sequence of the zero-width
|
|
27
|
-
* spaces as an {@link module:engine/view/filler~INLINE_FILLER inline filler} having the predetermined
|
|
28
|
-
* {@link module:engine/view/filler~INLINE_FILLER_LENGTH length}. A sequence is used, instead of a single character to
|
|
29
|
-
* avoid treating random zero-width spaces as the inline filler. Disadvantage of the inline filler is that it is not
|
|
30
|
-
* transparent for the selection. The arrow key moves the caret between zero-width spaces characters, so the additional
|
|
31
|
-
* code is needed to handle the caret.
|
|
32
|
-
*
|
|
33
|
-
* Both inline and block fillers are handled by the {@link module:engine/view/renderer~Renderer renderer} and are not present in the
|
|
34
|
-
* view.
|
|
35
|
-
*
|
|
36
|
-
* @module engine/view/filler
|
|
37
|
-
*/
|
|
38
|
-
/**
|
|
39
|
-
* Non-breaking space filler creator. This function creates the ` ` text node.
|
|
40
|
-
* It defines how the filler is created.
|
|
41
|
-
*
|
|
42
|
-
* @see module:engine/view/filler~MARKED_NBSP_FILLER
|
|
43
|
-
* @see module:engine/view/filler~BR_FILLER
|
|
44
|
-
*/
|
|
45
|
-
export declare const NBSP_FILLER: (domDocument: Document) => Text;
|
|
46
|
-
/**
|
|
47
|
-
* Marked non-breaking space filler creator. This function creates the `<span data-cke-filler="true"> </span>` element.
|
|
48
|
-
* It defines how the filler is created.
|
|
49
|
-
*
|
|
50
|
-
* @see module:engine/view/filler~NBSP_FILLER
|
|
51
|
-
* @see module:engine/view/filler~BR_FILLER
|
|
52
|
-
*/
|
|
53
|
-
export declare const MARKED_NBSP_FILLER: (domDocument: Document) => HTMLSpanElement;
|
|
54
|
-
/**
|
|
55
|
-
* `<br>` filler creator. This function creates the `<br data-cke-filler="true">` element.
|
|
56
|
-
* It defines how the filler is created.
|
|
57
|
-
*
|
|
58
|
-
* @see module:engine/view/filler~NBSP_FILLER
|
|
59
|
-
* @see module:engine/view/filler~MARKED_NBSP_FILLER
|
|
60
|
-
*/
|
|
61
|
-
export declare const BR_FILLER: (domDocument: Document) => HTMLBRElement;
|
|
62
|
-
/**
|
|
63
|
-
* Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.
|
|
64
|
-
*/
|
|
65
|
-
export declare const INLINE_FILLER_LENGTH = 7;
|
|
66
|
-
/**
|
|
67
|
-
* Inline filler which is a sequence of the word joiners.
|
|
68
|
-
*/
|
|
69
|
-
export declare const INLINE_FILLER: string;
|
|
70
|
-
/**
|
|
71
|
-
* Checks if the node is a text node which starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
|
|
72
|
-
*
|
|
73
|
-
* ```ts
|
|
74
|
-
* startsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true
|
|
75
|
-
* startsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true
|
|
76
|
-
* startsWithFiller( document.createTextNode( 'foo' ) ); // false
|
|
77
|
-
* startsWithFiller( document.createElement( 'p' ) ); // false
|
|
78
|
-
* ```
|
|
79
|
-
*
|
|
80
|
-
* @param domNode DOM node.
|
|
81
|
-
* @returns True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
|
|
82
|
-
*/
|
|
83
|
-
export declare function startsWithFiller(domNode: Node | string): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
|
|
86
|
-
*
|
|
87
|
-
* ```ts
|
|
88
|
-
* isInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true
|
|
89
|
-
* isInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* @param domText DOM text node.
|
|
93
|
-
* @returns True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.
|
|
94
|
-
*/
|
|
95
|
-
export declare function isInlineFiller(domText: Text): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Get string data from the text node, removing an {@link module:engine/view/filler~INLINE_FILLER inline filler} from it,
|
|
98
|
-
* if text node contains it.
|
|
99
|
-
*
|
|
100
|
-
* ```ts
|
|
101
|
-
* getDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true
|
|
102
|
-
* getDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true
|
|
103
|
-
* ```
|
|
104
|
-
*
|
|
105
|
-
* @param domText DOM text node, possible with inline filler.
|
|
106
|
-
* @returns Data without filler.
|
|
107
|
-
*/
|
|
108
|
-
export declare function getDataWithoutFiller(domText: Text | string): string;
|
|
109
|
-
/**
|
|
110
|
-
* Assign key observer which move cursor from the end of the inline filler to the beginning of it when
|
|
111
|
-
* the left arrow is pressed, so the filler does not break navigation.
|
|
112
|
-
*
|
|
113
|
-
* @param view View controller instance we should inject quirks handling on.
|
|
114
|
-
*/
|
|
115
|
-
export declare function injectQuirksHandling(view: View): void;
|
package/dist/view/item.d.ts
DELETED
|
@@ -1,18 +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 Node from './node.js';
|
|
10
|
-
import type TextProxy from './textproxy.js';
|
|
11
|
-
/**
|
|
12
|
-
* @module engine/view/item
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Item is a {@link module:engine/view/node~Node Node} or {@link module:engine/view/textproxy~TextProxy TextProxy}.
|
|
16
|
-
*/
|
|
17
|
-
type Item = Node | TextProxy;
|
|
18
|
-
export default Item;
|
package/dist/view/matcher.d.ts
DELETED
|
@@ -1,490 +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/matcher
|
|
11
|
-
*/
|
|
12
|
-
import type Element from './element.js';
|
|
13
|
-
/**
|
|
14
|
-
* View matcher class.
|
|
15
|
-
* Instance of this class can be used to find {@link module:engine/view/element~Element elements} that match given pattern.
|
|
16
|
-
*/
|
|
17
|
-
export default class Matcher {
|
|
18
|
-
private readonly _patterns;
|
|
19
|
-
/**
|
|
20
|
-
* Creates new instance of Matcher.
|
|
21
|
-
*
|
|
22
|
-
* @param pattern Match patterns. See {@link module:engine/view/matcher~Matcher#add add method} for more information.
|
|
23
|
-
*/
|
|
24
|
-
constructor(...pattern: Array<MatcherPattern>);
|
|
25
|
-
/**
|
|
26
|
-
* Adds pattern or patterns to matcher instance.
|
|
27
|
-
*
|
|
28
|
-
* ```ts
|
|
29
|
-
* // String.
|
|
30
|
-
* matcher.add( 'div' );
|
|
31
|
-
*
|
|
32
|
-
* // Regular expression.
|
|
33
|
-
* matcher.add( /^\w/ );
|
|
34
|
-
*
|
|
35
|
-
* // Single class.
|
|
36
|
-
* matcher.add( {
|
|
37
|
-
* classes: 'foobar'
|
|
38
|
-
* } );
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* See {@link module:engine/view/matcher~MatcherPattern} for more examples.
|
|
42
|
-
*
|
|
43
|
-
* Multiple patterns can be added in one call:
|
|
44
|
-
*
|
|
45
|
-
* ```ts
|
|
46
|
-
* matcher.add( 'div', { classes: 'foobar' } );
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* @param pattern Object describing pattern details. If string or regular expression
|
|
50
|
-
* is provided it will be used to match element's name. Pattern can be also provided in a form
|
|
51
|
-
* of a function - then this function will be called with each {@link module:engine/view/element~Element element} as a parameter.
|
|
52
|
-
* Function's return value will be stored under `match` key of the object returned from
|
|
53
|
-
* {@link module:engine/view/matcher~Matcher#match match} or {@link module:engine/view/matcher~Matcher#matchAll matchAll} methods.
|
|
54
|
-
*/
|
|
55
|
-
add(...pattern: Array<MatcherPattern>): void;
|
|
56
|
-
/**
|
|
57
|
-
* Matches elements for currently stored patterns. Returns match information about first found
|
|
58
|
-
* {@link module:engine/view/element~Element element}, otherwise returns `null`.
|
|
59
|
-
*
|
|
60
|
-
* Example of returned object:
|
|
61
|
-
*
|
|
62
|
-
* ```ts
|
|
63
|
-
* {
|
|
64
|
-
* element: <instance of found element>,
|
|
65
|
-
* pattern: <pattern used to match found element>,
|
|
66
|
-
* match: {
|
|
67
|
-
* name: true,
|
|
68
|
-
* attributes: [ 'title', 'href' ],
|
|
69
|
-
* classes: [ 'foo' ],
|
|
70
|
-
* styles: [ 'color', 'position' ]
|
|
71
|
-
* }
|
|
72
|
-
* }
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
* @see module:engine/view/matcher~Matcher#add
|
|
76
|
-
* @see module:engine/view/matcher~Matcher#matchAll
|
|
77
|
-
* @param element View element to match against stored patterns.
|
|
78
|
-
*/
|
|
79
|
-
match(...element: Array<Element>): MatchResult | null;
|
|
80
|
-
/**
|
|
81
|
-
* Matches elements for currently stored patterns. Returns array of match information with all found
|
|
82
|
-
* {@link module:engine/view/element~Element elements}. If no element is found - returns `null`.
|
|
83
|
-
*
|
|
84
|
-
* @see module:engine/view/matcher~Matcher#add
|
|
85
|
-
* @see module:engine/view/matcher~Matcher#match
|
|
86
|
-
* @param element View element to match against stored patterns.
|
|
87
|
-
* @returns Array with match information about found elements or `null`. For more information
|
|
88
|
-
* see {@link module:engine/view/matcher~Matcher#match match method} description.
|
|
89
|
-
*/
|
|
90
|
-
matchAll(...element: Array<Element>): Array<MatchResult> | null;
|
|
91
|
-
/**
|
|
92
|
-
* Returns the name of the element to match if there is exactly one pattern added to the matcher instance
|
|
93
|
-
* and it matches element name defined by `string` (not `RegExp`). Otherwise, returns `null`.
|
|
94
|
-
*
|
|
95
|
-
* @returns Element name trying to match.
|
|
96
|
-
*/
|
|
97
|
-
getElementName(): string | null;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* An entity that is a valid pattern recognized by a matcher. `MatcherPattern` is used by {@link ~Matcher} to recognize
|
|
101
|
-
* if a view element fits in a group of view elements described by the pattern.
|
|
102
|
-
*
|
|
103
|
-
* `MatcherPattern` can be given as a `String`, a `RegExp`, an `Object` or a `Function`.
|
|
104
|
-
*
|
|
105
|
-
* If `MatcherPattern` is given as a `String` or `RegExp`, it will match any view element that has a matching name:
|
|
106
|
-
*
|
|
107
|
-
* ```ts
|
|
108
|
-
* // Match any element with name equal to 'div'.
|
|
109
|
-
* const pattern = 'div';
|
|
110
|
-
*
|
|
111
|
-
* // Match any element which name starts on 'p'.
|
|
112
|
-
* const pattern = /^p/;
|
|
113
|
-
* ```
|
|
114
|
-
*
|
|
115
|
-
* If `MatcherPattern` is given as an `Object`, all the object's properties will be matched with view element properties.
|
|
116
|
-
* If the view element does not meet all of the object's pattern properties, the match will not happen.
|
|
117
|
-
* Available `Object` matching properties:
|
|
118
|
-
*
|
|
119
|
-
* Matching view element:
|
|
120
|
-
*
|
|
121
|
-
* ```ts
|
|
122
|
-
* // Match view element's name using String:
|
|
123
|
-
* const pattern = { name: 'p' };
|
|
124
|
-
*
|
|
125
|
-
* // or by providing RegExp:
|
|
126
|
-
* const pattern = { name: /^(ul|ol)$/ };
|
|
127
|
-
*
|
|
128
|
-
* // The name can also be skipped to match any view element with matching attributes:
|
|
129
|
-
* const pattern = {
|
|
130
|
-
* attributes: {
|
|
131
|
-
* 'title': true
|
|
132
|
-
* }
|
|
133
|
-
* };
|
|
134
|
-
* ```
|
|
135
|
-
*
|
|
136
|
-
* Matching view element attributes:
|
|
137
|
-
*
|
|
138
|
-
* ```ts
|
|
139
|
-
* // Match view element with any attribute value.
|
|
140
|
-
* const pattern = {
|
|
141
|
-
* name: 'p',
|
|
142
|
-
* attributes: true
|
|
143
|
-
* };
|
|
144
|
-
*
|
|
145
|
-
* // Match view element which has matching attributes (String).
|
|
146
|
-
* const pattern = {
|
|
147
|
-
* name: 'figure',
|
|
148
|
-
* attributes: 'title' // Match title attribute (can be empty).
|
|
149
|
-
* };
|
|
150
|
-
*
|
|
151
|
-
* // Match view element which has matching attributes (RegExp).
|
|
152
|
-
* const pattern = {
|
|
153
|
-
* name: 'figure',
|
|
154
|
-
* attributes: /^data-.*$/ // Match attributes starting with `data-` e.g. `data-foo` with any value (can be empty).
|
|
155
|
-
* };
|
|
156
|
-
*
|
|
157
|
-
* // Match view element which has matching attributes (Object).
|
|
158
|
-
* const pattern = {
|
|
159
|
-
* name: 'figure',
|
|
160
|
-
* attributes: {
|
|
161
|
-
* title: 'foobar', // Match `title` attribute with 'foobar' value.
|
|
162
|
-
* alt: true, // Match `alt` attribute with any value (can be empty).
|
|
163
|
-
* 'data-type': /^(jpg|png)$/ // Match `data-type` attribute with `jpg` or `png` value.
|
|
164
|
-
* }
|
|
165
|
-
* };
|
|
166
|
-
*
|
|
167
|
-
* // Match view element which has matching attributes (Array).
|
|
168
|
-
* const pattern = {
|
|
169
|
-
* name: 'figure',
|
|
170
|
-
* attributes: [
|
|
171
|
-
* 'title', // Match `title` attribute (can be empty).
|
|
172
|
-
* /^data-*$/ // Match attributes starting with `data-` e.g. `data-foo` with any value (can be empty).
|
|
173
|
-
* ]
|
|
174
|
-
* };
|
|
175
|
-
*
|
|
176
|
-
* // Match view element which has matching attributes (key-value pairs).
|
|
177
|
-
* const pattern = {
|
|
178
|
-
* name: 'input',
|
|
179
|
-
* attributes: [
|
|
180
|
-
* {
|
|
181
|
-
* key: 'type', // Match `type` as an attribute key.
|
|
182
|
-
* value: /^(text|number|date)$/ // Match `text`, `number` or `date` values.
|
|
183
|
-
* },
|
|
184
|
-
* {
|
|
185
|
-
* key: /^data-.*$/, // Match attributes starting with `data-` e.g. `data-foo`.
|
|
186
|
-
* value: true // Match any value (can be empty).
|
|
187
|
-
* }
|
|
188
|
-
* ]
|
|
189
|
-
* };
|
|
190
|
-
* ```
|
|
191
|
-
*
|
|
192
|
-
* Matching view element styles:
|
|
193
|
-
*
|
|
194
|
-
* ```ts
|
|
195
|
-
* // Match view element with any style.
|
|
196
|
-
* const pattern = {
|
|
197
|
-
* name: 'p',
|
|
198
|
-
* styles: true
|
|
199
|
-
* };
|
|
200
|
-
*
|
|
201
|
-
* // Match view element which has matching styles (String).
|
|
202
|
-
* const pattern = {
|
|
203
|
-
* name: 'p',
|
|
204
|
-
* styles: 'color' // Match attributes with `color` style.
|
|
205
|
-
* };
|
|
206
|
-
*
|
|
207
|
-
* // Match view element which has matching styles (RegExp).
|
|
208
|
-
* const pattern = {
|
|
209
|
-
* name: 'p',
|
|
210
|
-
* styles: /^border.*$/ // Match view element with any border style.
|
|
211
|
-
* };
|
|
212
|
-
*
|
|
213
|
-
* // Match view element which has matching styles (Object).
|
|
214
|
-
* const pattern = {
|
|
215
|
-
* name: 'p',
|
|
216
|
-
* styles: {
|
|
217
|
-
* color: /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/, // Match `color` in RGB format only.
|
|
218
|
-
* 'font-weight': 600, // Match `font-weight` only if it's `600`.
|
|
219
|
-
* 'text-decoration': true // Match any text decoration.
|
|
220
|
-
* }
|
|
221
|
-
* };
|
|
222
|
-
*
|
|
223
|
-
* // Match view element which has matching styles (Array).
|
|
224
|
-
* const pattern = {
|
|
225
|
-
* name: 'p',
|
|
226
|
-
* styles: [
|
|
227
|
-
* 'color', // Match `color` with any value.
|
|
228
|
-
* /^border.*$/ // Match all border properties.
|
|
229
|
-
* ]
|
|
230
|
-
* };
|
|
231
|
-
*
|
|
232
|
-
* // Match view element which has matching styles (key-value pairs).
|
|
233
|
-
* const pattern = {
|
|
234
|
-
* name: 'p',
|
|
235
|
-
* styles: [
|
|
236
|
-
* {
|
|
237
|
-
* key: 'color', // Match `color` as an property key.
|
|
238
|
-
* value: /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/ // Match RGB format only.
|
|
239
|
-
* },
|
|
240
|
-
* {
|
|
241
|
-
* key: /^border.*$/, // Match any border style.
|
|
242
|
-
* value: true // Match any value.
|
|
243
|
-
* }
|
|
244
|
-
* ]
|
|
245
|
-
* };
|
|
246
|
-
* ```
|
|
247
|
-
*
|
|
248
|
-
* Matching view element classes:
|
|
249
|
-
*
|
|
250
|
-
* ```ts
|
|
251
|
-
* // Match view element with any class.
|
|
252
|
-
* const pattern = {
|
|
253
|
-
* name: 'p',
|
|
254
|
-
* classes: true
|
|
255
|
-
* };
|
|
256
|
-
*
|
|
257
|
-
* // Match view element which has matching class (String).
|
|
258
|
-
* const pattern = {
|
|
259
|
-
* name: 'p',
|
|
260
|
-
* classes: 'highlighted' // Match `highlighted` class.
|
|
261
|
-
* };
|
|
262
|
-
*
|
|
263
|
-
* // Match view element which has matching classes (RegExp).
|
|
264
|
-
* const pattern = {
|
|
265
|
-
* name: 'figure',
|
|
266
|
-
* classes: /^image-side-(left|right)$/ // Match `image-side-left` or `image-side-right` class.
|
|
267
|
-
* };
|
|
268
|
-
*
|
|
269
|
-
* // Match view element which has matching classes (Object).
|
|
270
|
-
* const pattern = {
|
|
271
|
-
* name: 'p',
|
|
272
|
-
* classes: {
|
|
273
|
-
* highlighted: true, // Match `highlighted` class.
|
|
274
|
-
* marker: true // Match `marker` class.
|
|
275
|
-
* }
|
|
276
|
-
* };
|
|
277
|
-
*
|
|
278
|
-
* // Match view element which has matching classes (Array).
|
|
279
|
-
* const pattern = {
|
|
280
|
-
* name: 'figure',
|
|
281
|
-
* classes: [
|
|
282
|
-
* 'image', // Match `image` class.
|
|
283
|
-
* /^image-side-(left|right)$/ // Match `image-side-left` or `image-side-right` class.
|
|
284
|
-
* ]
|
|
285
|
-
* };
|
|
286
|
-
*
|
|
287
|
-
* // Match view element which has matching classes (key-value pairs).
|
|
288
|
-
* const pattern = {
|
|
289
|
-
* name: 'figure',
|
|
290
|
-
* classes: [
|
|
291
|
-
* {
|
|
292
|
-
* key: 'image', // Match `image` class.
|
|
293
|
-
* value: true
|
|
294
|
-
* },
|
|
295
|
-
* {
|
|
296
|
-
* key: /^image-side-(left|right)$/, // Match `image-side-left` or `image-side-right` class.
|
|
297
|
-
* value: true
|
|
298
|
-
* }
|
|
299
|
-
* ]
|
|
300
|
-
* };
|
|
301
|
-
* ```
|
|
302
|
-
*
|
|
303
|
-
* Pattern can combine multiple properties allowing for more complex view element matching:
|
|
304
|
-
*
|
|
305
|
-
* ```ts
|
|
306
|
-
* const pattern = {
|
|
307
|
-
* name: 'span',
|
|
308
|
-
* attributes: [ 'title' ],
|
|
309
|
-
* styles: {
|
|
310
|
-
* 'font-weight': 'bold'
|
|
311
|
-
* },
|
|
312
|
-
* classes: 'highlighted'
|
|
313
|
-
* };
|
|
314
|
-
* ```
|
|
315
|
-
*
|
|
316
|
-
* If `MatcherPattern` is given as a `Function`, the function takes a view element as a first and only parameter and
|
|
317
|
-
* the function should decide whether that element matches. If so, it should return what part of the view element has been matched.
|
|
318
|
-
* Otherwise, the function should return `null`. The returned result will be included in `match` property of the object
|
|
319
|
-
* returned by {@link ~Matcher#match} call.
|
|
320
|
-
*
|
|
321
|
-
* ```ts
|
|
322
|
-
* // Match an empty <div> element.
|
|
323
|
-
* const pattern = element => {
|
|
324
|
-
* if ( element.name == 'div' && element.childCount > 0 ) {
|
|
325
|
-
* // Return which part of the element was matched.
|
|
326
|
-
* return { name: true };
|
|
327
|
-
* }
|
|
328
|
-
*
|
|
329
|
-
* return null;
|
|
330
|
-
* };
|
|
331
|
-
*
|
|
332
|
-
* // Match a <p> element with big font ("heading-like" element).
|
|
333
|
-
* const pattern = element => {
|
|
334
|
-
* if ( element.name == 'p' ) {
|
|
335
|
-
* const fontSize = element.getStyle( 'font-size' );
|
|
336
|
-
* const size = fontSize.match( /(\d+)/px );
|
|
337
|
-
*
|
|
338
|
-
* if ( size && Number( size[ 1 ] ) > 26 ) {
|
|
339
|
-
* return { name: true, attributes: [ 'font-size' ] };
|
|
340
|
-
* }
|
|
341
|
-
* }
|
|
342
|
-
*
|
|
343
|
-
* return null;
|
|
344
|
-
* };
|
|
345
|
-
* ```
|
|
346
|
-
*
|
|
347
|
-
* `MatcherPattern` is defined in a way that it is a superset of {@link module:engine/view/elementdefinition~ElementDefinition},
|
|
348
|
-
* that is, every `ElementDefinition` also can be used as a `MatcherPattern`.
|
|
349
|
-
*/
|
|
350
|
-
export type MatcherPattern = string | RegExp | MatcherFunctionPattern | MatcherObjectPattern;
|
|
351
|
-
/**
|
|
352
|
-
* A function describing `MatcherPattern`. See {@link ~MatcherPattern} for examples and other options.
|
|
353
|
-
*/
|
|
354
|
-
export type MatcherFunctionPattern = (element: Element) => Match | null;
|
|
355
|
-
/**
|
|
356
|
-
* An object describing `MatcherPattern`. See {@link ~MatcherPattern} for examples and other options.
|
|
357
|
-
*/
|
|
358
|
-
export interface MatcherObjectPattern {
|
|
359
|
-
/**
|
|
360
|
-
* View element name to match.
|
|
361
|
-
*/
|
|
362
|
-
name?: string | RegExp;
|
|
363
|
-
key?: string;
|
|
364
|
-
/**
|
|
365
|
-
* View element's classes to match.
|
|
366
|
-
*/
|
|
367
|
-
classes?: ClassPatterns;
|
|
368
|
-
/**
|
|
369
|
-
* View element's styles to match.
|
|
370
|
-
*/
|
|
371
|
-
styles?: StylePatterns;
|
|
372
|
-
/**
|
|
373
|
-
* View element's attributes to match.
|
|
374
|
-
*/
|
|
375
|
-
attributes?: AttributePatterns;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* An object representing matched element parts.
|
|
379
|
-
*/
|
|
380
|
-
export interface Match {
|
|
381
|
-
/**
|
|
382
|
-
* True if name of the element was matched.
|
|
383
|
-
*/
|
|
384
|
-
name?: boolean;
|
|
385
|
-
/**
|
|
386
|
-
* Array with matched attribute names.
|
|
387
|
-
*/
|
|
388
|
-
attributes?: Array<string>;
|
|
389
|
-
/**
|
|
390
|
-
* Array with matched class names.
|
|
391
|
-
*/
|
|
392
|
-
classes?: Array<string>;
|
|
393
|
-
/**
|
|
394
|
-
* Array with matched style names.
|
|
395
|
-
*/
|
|
396
|
-
styles?: Array<string>;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* The result of {@link ~Matcher#match}.
|
|
400
|
-
*/
|
|
401
|
-
export interface MatchResult {
|
|
402
|
-
/**
|
|
403
|
-
* Matched view element.
|
|
404
|
-
*/
|
|
405
|
-
element: Element;
|
|
406
|
-
/**
|
|
407
|
-
* Pattern that was used to find matched element.
|
|
408
|
-
*/
|
|
409
|
-
pattern: MatcherFunctionPattern | MatcherObjectPattern;
|
|
410
|
-
/**
|
|
411
|
-
* An object representing matched element parts.
|
|
412
|
-
*/
|
|
413
|
-
match: Match;
|
|
414
|
-
}
|
|
415
|
-
export type PropertyPatterns<ValuePattern = string | RegExp> = true | string | RegExp | Record<string, true | ValuePattern> | Array<string | RegExp | {
|
|
416
|
-
key: string | RegExp;
|
|
417
|
-
value: true | ValuePattern;
|
|
418
|
-
}>;
|
|
419
|
-
export type AttributePatterns = PropertyPatterns;
|
|
420
|
-
export type StylePatterns = PropertyPatterns;
|
|
421
|
-
export type ClassPatterns = PropertyPatterns<never>;
|
|
422
|
-
/**
|
|
423
|
-
* The key-value matcher pattern is missing key or value. Both must be present.
|
|
424
|
-
* Refer the documentation: {@link module:engine/view/matcher~MatcherPattern}.
|
|
425
|
-
*
|
|
426
|
-
* @param pattern Pattern with missing properties.
|
|
427
|
-
* @error matcher-pattern-missing-key-or-value
|
|
428
|
-
*/
|
|
429
|
-
/**
|
|
430
|
-
* The key-value matcher pattern for `attributes` option is using deprecated `style` key.
|
|
431
|
-
*
|
|
432
|
-
* Use `styles` matcher pattern option instead:
|
|
433
|
-
*
|
|
434
|
-
* ```ts
|
|
435
|
-
* // Instead of:
|
|
436
|
-
* const pattern = {
|
|
437
|
-
* attributes: {
|
|
438
|
-
* key1: 'value1',
|
|
439
|
-
* key2: 'value2',
|
|
440
|
-
* style: /^border.*$/
|
|
441
|
-
* }
|
|
442
|
-
* }
|
|
443
|
-
*
|
|
444
|
-
* // Use:
|
|
445
|
-
* const pattern = {
|
|
446
|
-
* attributes: {
|
|
447
|
-
* key1: 'value1',
|
|
448
|
-
* key2: 'value2'
|
|
449
|
-
* },
|
|
450
|
-
* styles: /^border.*$/
|
|
451
|
-
* }
|
|
452
|
-
* ```
|
|
453
|
-
*
|
|
454
|
-
* Refer to the {@glink updating/guides/update-to-29##update-to-ckeditor-5-v2910 Migration to v29.1.0} guide
|
|
455
|
-
* and {@link module:engine/view/matcher~MatcherPattern} documentation.
|
|
456
|
-
*
|
|
457
|
-
* @param pattern Pattern with missing properties.
|
|
458
|
-
* @error matcher-pattern-deprecated-attributes-style-key
|
|
459
|
-
*/
|
|
460
|
-
/**
|
|
461
|
-
* The key-value matcher pattern for `attributes` option is using deprecated `class` key.
|
|
462
|
-
*
|
|
463
|
-
* Use `classes` matcher pattern option instead:
|
|
464
|
-
*
|
|
465
|
-
* ```ts
|
|
466
|
-
* // Instead of:
|
|
467
|
-
* const pattern = {
|
|
468
|
-
* attributes: {
|
|
469
|
-
* key1: 'value1',
|
|
470
|
-
* key2: 'value2',
|
|
471
|
-
* class: 'foobar'
|
|
472
|
-
* }
|
|
473
|
-
* }
|
|
474
|
-
*
|
|
475
|
-
* // Use:
|
|
476
|
-
* const pattern = {
|
|
477
|
-
* attributes: {
|
|
478
|
-
* key1: 'value1',
|
|
479
|
-
* key2: 'value2'
|
|
480
|
-
* },
|
|
481
|
-
* classes: 'foobar'
|
|
482
|
-
* }
|
|
483
|
-
* ```
|
|
484
|
-
*
|
|
485
|
-
* Refer to the {@glink updating/guides/update-to-29##update-to-ckeditor-5-v2910 Migration to v29.1.0} guide
|
|
486
|
-
* and the {@link module:engine/view/matcher~MatcherPattern} documentation.
|
|
487
|
-
*
|
|
488
|
-
* @param pattern Pattern with missing properties.
|
|
489
|
-
* @error matcher-pattern-deprecated-attributes-class-key
|
|
490
|
-
*/
|