@ckeditor/ckeditor5-engine 44.1.0-alpha.5 → 44.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +4 -4
- package/dist/index.css.map +1 -1
- package/dist/index.js +646 -77
- package/dist/index.js.map +1 -1
- package/package.json +23 -3
- package/src/controller/datacontroller.d.ts +1 -1
- package/src/controller/datacontroller.js +1 -1
- package/src/controller/editingcontroller.d.ts +1 -1
- package/src/controller/editingcontroller.js +1 -1
- package/src/conversion/conversion.d.ts +1 -1
- package/src/conversion/conversion.js +1 -1
- package/src/conversion/conversionhelpers.d.ts +1 -1
- package/src/conversion/conversionhelpers.js +1 -1
- package/src/conversion/downcastdispatcher.d.ts +1 -1
- package/src/conversion/downcastdispatcher.js +1 -1
- package/src/conversion/downcasthelpers.d.ts +1 -1
- package/src/conversion/downcasthelpers.js +1 -1
- package/src/conversion/mapper.d.ts +249 -20
- package/src/conversion/mapper.js +524 -38
- package/src/conversion/modelconsumable.d.ts +1 -1
- package/src/conversion/modelconsumable.js +1 -1
- package/src/conversion/upcastdispatcher.d.ts +1 -1
- package/src/conversion/upcastdispatcher.js +1 -1
- package/src/conversion/upcasthelpers.d.ts +1 -1
- package/src/conversion/upcasthelpers.js +1 -1
- package/src/conversion/viewconsumable.d.ts +1 -1
- package/src/conversion/viewconsumable.js +1 -1
- package/src/dataprocessor/basichtmlwriter.d.ts +1 -1
- package/src/dataprocessor/basichtmlwriter.js +1 -1
- package/src/dataprocessor/dataprocessor.d.ts +1 -1
- package/src/dataprocessor/dataprocessor.js +1 -1
- package/src/dataprocessor/htmldataprocessor.d.ts +1 -1
- package/src/dataprocessor/htmldataprocessor.js +1 -1
- package/src/dataprocessor/htmlwriter.d.ts +1 -1
- package/src/dataprocessor/htmlwriter.js +1 -1
- package/src/dataprocessor/xmldataprocessor.d.ts +1 -1
- package/src/dataprocessor/xmldataprocessor.js +1 -1
- package/src/dev-utils/model.d.ts +1 -1
- package/src/dev-utils/model.js +1 -1
- package/src/dev-utils/operationreplayer.d.ts +1 -1
- package/src/dev-utils/operationreplayer.js +1 -1
- package/src/dev-utils/utils.d.ts +1 -1
- package/src/dev-utils/utils.js +1 -1
- package/src/dev-utils/view.d.ts +1 -1
- package/src/dev-utils/view.js +1 -1
- package/src/index.d.ts +4 -2
- package/src/index.js +2 -1
- package/src/model/batch.d.ts +1 -1
- package/src/model/batch.js +7 -3
- package/src/model/differ.d.ts +1 -1
- package/src/model/differ.js +1 -1
- package/src/model/document.d.ts +1 -1
- package/src/model/document.js +1 -1
- package/src/model/documentfragment.d.ts +1 -1
- package/src/model/documentfragment.js +1 -1
- package/src/model/documentselection.d.ts +1 -1
- package/src/model/documentselection.js +1 -1
- package/src/model/element.d.ts +1 -1
- package/src/model/element.js +1 -1
- package/src/model/history.d.ts +1 -1
- package/src/model/history.js +1 -1
- package/src/model/item.d.ts +1 -1
- package/src/model/item.js +1 -1
- package/src/model/liveposition.d.ts +1 -1
- package/src/model/liveposition.js +1 -1
- package/src/model/liverange.d.ts +1 -1
- package/src/model/liverange.js +1 -1
- package/src/model/markercollection.d.ts +1 -1
- package/src/model/markercollection.js +1 -1
- package/src/model/model.d.ts +1 -1
- package/src/model/model.js +1 -1
- package/src/model/node.d.ts +1 -1
- package/src/model/node.js +1 -1
- package/src/model/nodelist.d.ts +1 -1
- package/src/model/nodelist.js +1 -1
- package/src/model/operation/attributeoperation.d.ts +1 -1
- package/src/model/operation/attributeoperation.js +1 -1
- package/src/model/operation/detachoperation.d.ts +1 -1
- package/src/model/operation/detachoperation.js +1 -1
- package/src/model/operation/insertoperation.d.ts +1 -1
- package/src/model/operation/insertoperation.js +1 -1
- package/src/model/operation/markeroperation.d.ts +1 -1
- package/src/model/operation/markeroperation.js +1 -1
- package/src/model/operation/mergeoperation.d.ts +1 -1
- package/src/model/operation/mergeoperation.js +1 -1
- package/src/model/operation/moveoperation.d.ts +1 -1
- package/src/model/operation/moveoperation.js +1 -1
- package/src/model/operation/nooperation.d.ts +1 -1
- package/src/model/operation/nooperation.js +1 -1
- package/src/model/operation/operation.d.ts +4 -1
- package/src/model/operation/operation.js +2 -2
- package/src/model/operation/operationfactory.d.ts +1 -1
- package/src/model/operation/operationfactory.js +1 -1
- package/src/model/operation/renameoperation.d.ts +1 -1
- package/src/model/operation/renameoperation.js +1 -1
- package/src/model/operation/rootattributeoperation.d.ts +1 -1
- package/src/model/operation/rootattributeoperation.js +1 -1
- package/src/model/operation/rootoperation.d.ts +1 -1
- package/src/model/operation/rootoperation.js +1 -1
- package/src/model/operation/splitoperation.d.ts +1 -1
- package/src/model/operation/splitoperation.js +1 -1
- package/src/model/operation/transform.d.ts +1 -1
- package/src/model/operation/transform.js +1 -1
- package/src/model/operation/utils.d.ts +1 -1
- package/src/model/operation/utils.js +1 -1
- package/src/model/position.d.ts +1 -1
- package/src/model/position.js +1 -1
- package/src/model/range.d.ts +1 -1
- package/src/model/range.js +1 -1
- package/src/model/rootelement.d.ts +1 -1
- package/src/model/rootelement.js +1 -1
- package/src/model/schema.d.ts +1 -1
- package/src/model/schema.js +1 -1
- package/src/model/selection.d.ts +1 -1
- package/src/model/selection.js +9 -2
- package/src/model/text.d.ts +1 -1
- package/src/model/text.js +1 -1
- package/src/model/textproxy.d.ts +1 -1
- package/src/model/textproxy.js +1 -1
- package/src/model/treewalker.d.ts +17 -1
- package/src/model/treewalker.js +26 -1
- package/src/model/typecheckable.d.ts +1 -1
- package/src/model/typecheckable.js +1 -1
- package/src/model/utils/autoparagraphing.d.ts +1 -1
- package/src/model/utils/autoparagraphing.js +1 -1
- package/src/model/utils/deletecontent.d.ts +1 -1
- package/src/model/utils/deletecontent.js +1 -1
- package/src/model/utils/getselectedcontent.d.ts +1 -1
- package/src/model/utils/getselectedcontent.js +1 -1
- package/src/model/utils/insertcontent.d.ts +1 -1
- package/src/model/utils/insertcontent.js +1 -1
- package/src/model/utils/insertobject.d.ts +1 -1
- package/src/model/utils/insertobject.js +1 -1
- package/src/model/utils/modifyselection.d.ts +1 -1
- package/src/model/utils/modifyselection.js +1 -1
- package/src/model/utils/selection-post-fixer.d.ts +1 -1
- package/src/model/utils/selection-post-fixer.js +1 -1
- package/src/model/writer.d.ts +1 -1
- package/src/model/writer.js +1 -1
- package/src/view/attributeelement.d.ts +1 -1
- package/src/view/attributeelement.js +1 -1
- package/src/view/containerelement.d.ts +1 -1
- package/src/view/containerelement.js +1 -1
- package/src/view/datatransfer.d.ts +1 -1
- package/src/view/datatransfer.js +1 -1
- package/src/view/document.d.ts +1 -1
- package/src/view/document.js +1 -1
- package/src/view/documentfragment.d.ts +6 -4
- package/src/view/documentfragment.js +7 -7
- package/src/view/documentselection.d.ts +1 -1
- package/src/view/documentselection.js +1 -1
- package/src/view/domconverter.d.ts +1 -1
- package/src/view/domconverter.js +1 -1
- package/src/view/downcastwriter.d.ts +1 -1
- package/src/view/downcastwriter.js +1 -1
- package/src/view/editableelement.d.ts +1 -1
- package/src/view/editableelement.js +1 -1
- package/src/view/element.d.ts +1 -1
- package/src/view/element.js +3 -3
- package/src/view/elementdefinition.d.ts +1 -1
- package/src/view/elementdefinition.js +1 -1
- package/src/view/emptyelement.d.ts +1 -1
- package/src/view/emptyelement.js +1 -1
- package/src/view/filler.d.ts +1 -1
- package/src/view/filler.js +1 -1
- package/src/view/item.d.ts +1 -1
- package/src/view/item.js +1 -1
- package/src/view/matcher.d.ts +1 -1
- package/src/view/matcher.js +1 -1
- package/src/view/node.d.ts +13 -4
- package/src/view/node.js +5 -4
- package/src/view/observer/arrowkeysobserver.d.ts +1 -1
- package/src/view/observer/arrowkeysobserver.js +1 -1
- package/src/view/observer/bubblingemittermixin.d.ts +1 -1
- package/src/view/observer/bubblingemittermixin.js +1 -1
- package/src/view/observer/bubblingeventinfo.d.ts +1 -1
- package/src/view/observer/bubblingeventinfo.js +1 -1
- package/src/view/observer/clickobserver.d.ts +1 -1
- package/src/view/observer/clickobserver.js +1 -1
- package/src/view/observer/compositionobserver.d.ts +1 -1
- package/src/view/observer/compositionobserver.js +1 -1
- package/src/view/observer/domeventdata.d.ts +1 -1
- package/src/view/observer/domeventdata.js +1 -1
- package/src/view/observer/domeventobserver.d.ts +1 -1
- package/src/view/observer/domeventobserver.js +1 -1
- package/src/view/observer/fakeselectionobserver.d.ts +1 -1
- package/src/view/observer/fakeselectionobserver.js +1 -1
- package/src/view/observer/focusobserver.d.ts +1 -1
- package/src/view/observer/focusobserver.js +1 -1
- package/src/view/observer/inputobserver.d.ts +1 -1
- package/src/view/observer/inputobserver.js +1 -1
- package/src/view/observer/keyobserver.d.ts +1 -1
- package/src/view/observer/keyobserver.js +1 -1
- package/src/view/observer/mouseobserver.d.ts +1 -1
- package/src/view/observer/mouseobserver.js +1 -1
- package/src/view/observer/mutationobserver.d.ts +1 -1
- package/src/view/observer/mutationobserver.js +1 -1
- package/src/view/observer/observer.d.ts +1 -1
- package/src/view/observer/observer.js +1 -1
- package/src/view/observer/selectionobserver.d.ts +1 -1
- package/src/view/observer/selectionobserver.js +1 -1
- package/src/view/observer/tabobserver.d.ts +1 -1
- package/src/view/observer/tabobserver.js +1 -1
- package/src/view/observer/touchobserver.d.ts +73 -0
- package/src/view/observer/touchobserver.js +29 -0
- package/src/view/placeholder.d.ts +1 -1
- package/src/view/placeholder.js +23 -17
- package/src/view/position.d.ts +1 -1
- package/src/view/position.js +1 -1
- package/src/view/range.d.ts +1 -1
- package/src/view/range.js +1 -1
- package/src/view/rawelement.d.ts +1 -1
- package/src/view/rawelement.js +1 -1
- package/src/view/renderer.d.ts +1 -1
- package/src/view/renderer.js +1 -1
- package/src/view/rooteditableelement.d.ts +1 -1
- package/src/view/rooteditableelement.js +1 -1
- package/src/view/selection.d.ts +1 -1
- package/src/view/selection.js +1 -1
- package/src/view/styles/background.d.ts +1 -1
- package/src/view/styles/background.js +1 -1
- package/src/view/styles/border.d.ts +1 -1
- package/src/view/styles/border.js +1 -1
- package/src/view/styles/margin.d.ts +1 -1
- package/src/view/styles/margin.js +1 -1
- package/src/view/styles/padding.d.ts +1 -1
- package/src/view/styles/padding.js +1 -1
- package/src/view/styles/utils.d.ts +1 -1
- package/src/view/styles/utils.js +1 -1
- package/src/view/stylesmap.d.ts +1 -1
- package/src/view/stylesmap.js +1 -1
- package/src/view/text.d.ts +1 -1
- package/src/view/text.js +1 -1
- package/src/view/textproxy.d.ts +1 -1
- package/src/view/textproxy.js +1 -1
- package/src/view/treewalker.d.ts +17 -1
- package/src/view/treewalker.js +25 -1
- package/src/view/typecheckable.d.ts +1 -1
- package/src/view/typecheckable.js +1 -1
- package/src/view/uielement.d.ts +1 -1
- package/src/view/uielement.js +1 -1
- package/src/view/upcastwriter.d.ts +1 -1
- package/src/view/upcastwriter.js +1 -1
- package/src/view/view.d.ts +1 -1
- package/src/view/view.js +1 -1
- package/theme/placeholder.css +1 -1
- package/theme/renderer.css +1 -1
- package/dist/controller/datacontroller.d.ts +0 -339
- package/dist/controller/editingcontroller.d.ts +0 -102
- package/dist/conversion/conversion.d.ts +0 -482
- package/dist/conversion/conversionhelpers.d.ts +0 -30
- package/dist/conversion/downcastdispatcher.d.ts +0 -566
- package/dist/conversion/downcasthelpers.d.ts +0 -1194
- package/dist/conversion/mapper.d.ts +0 -507
- package/dist/conversion/modelconsumable.d.ts +0 -205
- package/dist/conversion/upcastdispatcher.d.ts +0 -496
- package/dist/conversion/upcasthelpers.d.ts +0 -503
- package/dist/conversion/viewconsumable.d.ts +0 -373
- package/dist/dataprocessor/basichtmlwriter.d.ts +0 -22
- package/dist/dataprocessor/dataprocessor.d.ts +0 -65
- package/dist/dataprocessor/htmldataprocessor.d.ts +0 -80
- package/dist/dataprocessor/htmlwriter.d.ts +0 -20
- package/dist/dataprocessor/xmldataprocessor.d.ts +0 -94
- package/dist/dev-utils/model.d.ts +0 -130
- package/dist/dev-utils/operationreplayer.d.ts +0 -55
- package/dist/dev-utils/utils.d.ts +0 -41
- package/dist/dev-utils/view.d.ts +0 -324
- package/dist/index.d.ts +0 -122
- package/dist/model/batch.d.ts +0 -110
- package/dist/model/differ.d.ts +0 -511
- package/dist/model/document.d.ts +0 -278
- package/dist/model/documentfragment.d.ts +0 -223
- package/dist/model/documentselection.d.ts +0 -424
- package/dist/model/element.d.ts +0 -191
- package/dist/model/history.d.ts +0 -118
- package/dist/model/item.d.ts +0 -18
- package/dist/model/liveposition.d.ts +0 -81
- package/dist/model/liverange.d.ts +0 -106
- package/dist/model/markercollection.d.ts +0 -339
- package/dist/model/model.d.ts +0 -923
- package/dist/model/node.d.ts +0 -262
- package/dist/model/nodelist.d.ts +0 -119
- package/dist/model/operation/attributeoperation.d.ts +0 -107
- package/dist/model/operation/detachoperation.d.ts +0 -64
- package/dist/model/operation/insertoperation.d.ts +0 -94
- package/dist/model/operation/markeroperation.d.ts +0 -95
- package/dist/model/operation/mergeoperation.d.ts +0 -104
- package/dist/model/operation/moveoperation.d.ts +0 -100
- package/dist/model/operation/nooperation.d.ts +0 -42
- package/dist/model/operation/operation.d.ts +0 -100
- package/dist/model/operation/operationfactory.d.ts +0 -22
- package/dist/model/operation/renameoperation.d.ts +0 -87
- package/dist/model/operation/rootattributeoperation.d.ts +0 -102
- package/dist/model/operation/rootoperation.d.ts +0 -80
- package/dist/model/operation/splitoperation.d.ts +0 -113
- package/dist/model/operation/transform.d.ts +0 -104
- package/dist/model/operation/utils.d.ts +0 -75
- package/dist/model/position.d.ts +0 -549
- package/dist/model/range.d.ts +0 -462
- package/dist/model/rootelement.d.ts +0 -64
- package/dist/model/schema.d.ts +0 -1334
- package/dist/model/selection.d.ts +0 -486
- package/dist/model/text.d.ts +0 -70
- package/dist/model/textproxy.d.ts +0 -148
- package/dist/model/treewalker.d.ts +0 -190
- package/dist/model/typecheckable.d.ts +0 -289
- package/dist/model/utils/autoparagraphing.d.ts +0 -41
- package/dist/model/utils/deletecontent.d.ts +0 -62
- package/dist/model/utils/getselectedcontent.d.ts +0 -34
- package/dist/model/utils/insertcontent.d.ts +0 -50
- package/dist/model/utils/insertobject.d.ts +0 -51
- package/dist/model/utils/modifyselection.d.ts +0 -52
- package/dist/model/utils/selection-post-fixer.d.ts +0 -78
- package/dist/model/writer.d.ts +0 -855
- package/dist/view/attributeelement.d.ts +0 -112
- package/dist/view/containerelement.d.ts +0 -53
- package/dist/view/datatransfer.d.ts +0 -83
- package/dist/view/document.d.ts +0 -188
- package/dist/view/documentfragment.d.ts +0 -157
- package/dist/view/documentselection.d.ts +0 -310
- package/dist/view/domconverter.d.ts +0 -665
- package/dist/view/downcastwriter.d.ts +0 -1000
- package/dist/view/editableelement.d.ts +0 -66
- package/dist/view/element.d.ts +0 -472
- package/dist/view/elementdefinition.d.ts +0 -91
- package/dist/view/emptyelement.d.ts +0 -45
- package/dist/view/filler.d.ts +0 -115
- package/dist/view/item.d.ts +0 -18
- package/dist/view/matcher.d.ts +0 -490
- package/dist/view/node.d.ts +0 -166
- package/dist/view/observer/arrowkeysobserver.d.ts +0 -49
- package/dist/view/observer/bubblingemittermixin.d.ts +0 -170
- package/dist/view/observer/bubblingeventinfo.d.ts +0 -51
- package/dist/view/observer/clickobserver.d.ts +0 -47
- package/dist/view/observer/compositionobserver.d.ts +0 -86
- package/dist/view/observer/domeventdata.d.ts +0 -54
- package/dist/view/observer/domeventobserver.d.ts +0 -82
- package/dist/view/observer/fakeselectionobserver.d.ts +0 -51
- package/dist/view/observer/focusobserver.d.ts +0 -98
- package/dist/view/observer/inputobserver.d.ts +0 -90
- package/dist/view/observer/keyobserver.d.ts +0 -70
- package/dist/view/observer/mouseobserver.d.ts +0 -93
- package/dist/view/observer/mutationobserver.d.ts +0 -119
- package/dist/view/observer/observer.d.ts +0 -93
- package/dist/view/observer/selectionobserver.d.ts +0 -151
- package/dist/view/observer/tabobserver.d.ts +0 -50
- package/dist/view/placeholder.d.ts +0 -100
- package/dist/view/position.d.ts +0 -192
- package/dist/view/range.d.ts +0 -283
- package/dist/view/rawelement.d.ts +0 -77
- package/dist/view/renderer.d.ts +0 -281
- package/dist/view/rooteditableelement.d.ts +0 -45
- package/dist/view/selection.d.ts +0 -379
- package/dist/view/styles/background.d.ts +0 -37
- package/dist/view/styles/border.d.ts +0 -47
- package/dist/view/styles/margin.d.ts +0 -33
- package/dist/view/styles/padding.d.ts +0 -33
- package/dist/view/styles/utils.d.ts +0 -97
- package/dist/view/stylesmap.d.ts +0 -685
- package/dist/view/text.d.ts +0 -78
- package/dist/view/textproxy.d.ts +0 -101
- package/dist/view/treewalker.d.ts +0 -199
- package/dist/view/typecheckable.d.ts +0 -452
- package/dist/view/uielement.d.ts +0 -100
- package/dist/view/upcastwriter.d.ts +0 -421
- package/dist/view/view.d.ts +0 -488
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-engine",
|
|
3
|
-
"version": "44.
|
|
3
|
+
"version": "44.2.0-alpha.0",
|
|
4
4
|
"description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wysiwyg",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"type": "module",
|
|
25
25
|
"main": "src/index.js",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ckeditor/ckeditor5-utils": "44.
|
|
27
|
+
"@ckeditor/ckeditor5-utils": "44.2.0-alpha.0",
|
|
28
28
|
"lodash-es": "4.17.21"
|
|
29
29
|
},
|
|
30
30
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -45,5 +45,25 @@
|
|
|
45
45
|
"ckeditor5-metadata.json",
|
|
46
46
|
"CHANGELOG.md"
|
|
47
47
|
],
|
|
48
|
-
"types": "src/index.d.ts"
|
|
48
|
+
"types": "src/index.d.ts",
|
|
49
|
+
"exports": {
|
|
50
|
+
".": {
|
|
51
|
+
"types": "./src/index.d.ts",
|
|
52
|
+
"import": "./src/index.js",
|
|
53
|
+
"default": "./src/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./dist/*": {
|
|
56
|
+
"types": "./src/index.d.ts",
|
|
57
|
+
"import": "./dist/*",
|
|
58
|
+
"default": "./dist/*"
|
|
59
|
+
},
|
|
60
|
+
"./src/*": {
|
|
61
|
+
"types": "./src/*.d.ts",
|
|
62
|
+
"import": "./src/*",
|
|
63
|
+
"default": "./src/*"
|
|
64
|
+
},
|
|
65
|
+
"./theme/*": "./theme/*",
|
|
66
|
+
"./ckeditor5-metadata.json": "./ckeditor5-metadata.json",
|
|
67
|
+
"./package.json": "./package.json"
|
|
68
|
+
}
|
|
49
69
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
import Mapper from '../conversion/mapper.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
import View from '../view/view.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -13,7 +13,7 @@ import type ViewDocumentFragment from '../view/documentfragment.js';
|
|
|
13
13
|
import type ViewElement from '../view/element.js';
|
|
14
14
|
import type ModelElement from '../model/element.js';
|
|
15
15
|
import type ModelDocumentFragment from '../model/documentfragment.js';
|
|
16
|
-
import type ViewNode from '../view/node.js';
|
|
16
|
+
import type { default as ViewNode } from '../view/node.js';
|
|
17
17
|
declare const Mapper_base: {
|
|
18
18
|
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
|
19
19
|
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
|
@@ -73,6 +73,10 @@ export default class Mapper extends /* #__PURE__ */ Mapper_base {
|
|
|
73
73
|
* has been removed, moved or renamed).
|
|
74
74
|
*/
|
|
75
75
|
private _unboundMarkerNames;
|
|
76
|
+
/**
|
|
77
|
+
* Manages dynamic cache for the `Mapper` to improve the performance.
|
|
78
|
+
*/
|
|
79
|
+
private _cache;
|
|
76
80
|
/**
|
|
77
81
|
* Creates an instance of the mapper.
|
|
78
82
|
*/
|
|
@@ -224,6 +228,10 @@ export default class Mapper extends /* #__PURE__ */ Mapper_base {
|
|
|
224
228
|
*/
|
|
225
229
|
markerNameToElements(name: string): Set<ViewElement> | null;
|
|
226
230
|
/**
|
|
231
|
+
* **This method is deprecated and will be removed in one of the future CKEditor 5 releases.**
|
|
232
|
+
*
|
|
233
|
+
* **Using this method will turn off `Mapper` caching system and may degrade performance when operating on bigger documents.**
|
|
234
|
+
*
|
|
227
235
|
* Registers a callback that evaluates the length in the model of a view element with the given name.
|
|
228
236
|
*
|
|
229
237
|
* The callback is fired with one argument, which is a view element instance. The callback is expected to return
|
|
@@ -253,6 +261,7 @@ export default class Mapper extends /* #__PURE__ */ Mapper_base {
|
|
|
253
261
|
*
|
|
254
262
|
* @param viewElementName Name of view element for which callback is registered.
|
|
255
263
|
* @param lengthCallback Function return a length of view element instance in model.
|
|
264
|
+
* @deprecated
|
|
256
265
|
*/
|
|
257
266
|
registerViewToModelLength(viewElementName: string, lengthCallback: (element: ViewElement) => number): void;
|
|
258
267
|
/**
|
|
@@ -310,32 +319,44 @@ export default class Mapper extends /* #__PURE__ */ Mapper_base {
|
|
|
310
319
|
*/
|
|
311
320
|
getModelLength(viewNode: ViewNode | ViewDocumentFragment): number;
|
|
312
321
|
/**
|
|
313
|
-
* Finds the position in
|
|
322
|
+
* Finds the position in a view element or view document fragment node (or in its children) with the expected model offset.
|
|
314
323
|
*
|
|
315
|
-
*
|
|
324
|
+
* If the passed `viewContainer` is bound to model, `Mapper` will use caching mechanism to improve performance.
|
|
316
325
|
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
326
|
+
* @param viewContainer Tree view element in which we are looking for the position.
|
|
327
|
+
* @param modelOffset Expected offset.
|
|
328
|
+
* @returns Found position.
|
|
329
|
+
*/
|
|
330
|
+
findPositionIn(viewContainer: ViewElement | ViewDocumentFragment, modelOffset: number): ViewPosition;
|
|
331
|
+
/**
|
|
332
|
+
* Performs most of the logic for `Mapper#findPositionIn()`.
|
|
319
333
|
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
* <p>fo|<b>bar</b>bom</p> -> expected offset: 4, actual offset: 2
|
|
323
|
-
* <p>fo<b>bar</b>|bom</p> -> expected offset: 4, actual offset: 5 -> we are too far
|
|
334
|
+
* It allows to start looking for the requested model offset from a given starting position, to enable caching. Using the cache,
|
|
335
|
+
* you can set the starting point and skip all the calculations that were already previously done.
|
|
324
336
|
*
|
|
325
|
-
*
|
|
326
|
-
* <p>fo<b>|bar</b>bom</p> -> expected offset: 2, actual offset: 0
|
|
327
|
-
* <p>fo<b>bar|</b>bom</p> -> expected offset: 2, actual offset: 3 -> we are too far
|
|
337
|
+
* This method uses recursion to find positions inside deep structures. Example:
|
|
328
338
|
*
|
|
329
|
-
* findPositionIn( bar, 2 - ( 3 - 3 ) ):
|
|
330
|
-
* We are in the text node so we can simple find the offset.
|
|
331
|
-
* <p>fo<b>ba|r</b>bom</p> -> expected offset: 2, actual offset: 2 -> position found
|
|
332
339
|
* ```
|
|
340
|
+
* <p>fo<b>bar</b>bom</p> -> target offset: 4
|
|
341
|
+
* <p>|fo<b>bar</b>bom</p> -> target offset: 4, traversed offset: 0
|
|
342
|
+
* <p>fo|<b>bar</b>bom</p> -> target offset: 4, traversed offset: 2
|
|
343
|
+
* <p>fo<b>bar</b>|bom</p> -> target offset: 4, traversed offset: 5 -> we are too far, look recursively in <b>.
|
|
333
344
|
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
345
|
+
* <p>fo<b>|bar</b>bom</p> -> target offset: 4, traversed offset: 2
|
|
346
|
+
* <p>fo<b>bar|</b>bom</p> -> target offset: 4, traversed offset: 5 -> we are too far, look inside "bar".
|
|
347
|
+
*
|
|
348
|
+
* <p>fo<b>ba|r</b>bom</p> -> target offset: 4, traversed offset: 2 -> position is inside text node at offset 4-2 = 2.
|
|
349
|
+
* ```
|
|
350
|
+
*
|
|
351
|
+
* @param startViewPosition View position to start looking from.
|
|
352
|
+
* @param startModelOffset Model offset related to `startViewPosition`.
|
|
353
|
+
* @param targetModelOffset Target model offset to find.
|
|
354
|
+
* @param viewContainer Mapped ancestor of `startViewPosition`. `startModelOffset` is the offset inside a model element or model
|
|
355
|
+
* document fragment mapped to `viewContainer`.
|
|
356
|
+
* @param useCache Whether `Mapper` should cache positions while traversing the view tree looking for `expectedModelOffset`.
|
|
357
|
+
* @returns View position mapped to `targetModelOffset`.
|
|
337
358
|
*/
|
|
338
|
-
|
|
359
|
+
private _findPositionStartingFrom;
|
|
339
360
|
/**
|
|
340
361
|
* Because we prefer positions in the text nodes over positions next to text nodes, if the view position was next to a text node,
|
|
341
362
|
* it moves it into the text node instead.
|
|
@@ -351,6 +372,197 @@ export default class Mapper extends /* #__PURE__ */ Mapper_base {
|
|
|
351
372
|
*/
|
|
352
373
|
private _moveViewPositionToTextNode;
|
|
353
374
|
}
|
|
375
|
+
declare const MapperCache_base: {
|
|
376
|
+
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
|
377
|
+
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* Cache mechanism for {@link module:engine/conversion/mapper~Mapper Mapper}.
|
|
381
|
+
*
|
|
382
|
+
* `MapperCache` improves performance for model-to-view position mapping, which is the main `Mapper` task. Asking for a mapping is much
|
|
383
|
+
* more frequent than actually performing changes, and even if the change happens, we can still partially keep the cache. This makes
|
|
384
|
+
* caching a useful strategy for `Mapper`.
|
|
385
|
+
*
|
|
386
|
+
* `MapperCache` will store some data for view elements or view document fragments that are mapped by the `Mapper`. These view items
|
|
387
|
+
* are "tracked" by the `MapperCache`. For such view items, we will keep entries of model offsets inside their mapped counterpart. For
|
|
388
|
+
* the cached model offsets, we will keep a view position that is inside the tracked item. This allows us to either get the mapping
|
|
389
|
+
* instantly, or at least in less steps than when calculating it from the beginning.
|
|
390
|
+
*
|
|
391
|
+
* Important problem related to caching is invalidating the cache. The cache must be invalidated each time the tracked view item changes.
|
|
392
|
+
* Additionally, we should invalidate as small part of the cache as possible. Since all the logic is encapsulated inside `MapperCache`,
|
|
393
|
+
* the `MapperCache` listens to view items {@link module:engine/view/node~ViewNodeChangeEvent `change` event} and reacts to it.
|
|
394
|
+
* Then, it invalidates just the part of the cache that is "after" the changed part of the view.
|
|
395
|
+
*
|
|
396
|
+
* As mentioned, `MapperCache` currently is used only for model-to-view position mapping as it was much bigger problem than view-to-model
|
|
397
|
+
* mapping. However, it should be possible to use it also for view-to-model.
|
|
398
|
+
*
|
|
399
|
+
* The main assumptions regarding `MapperCache` are:
|
|
400
|
+
*
|
|
401
|
+
* * it is an internal tool, used by `Mapper`, transparent to the outside (no additional effort when developing a plugin or a converter),
|
|
402
|
+
* * it stores all the necessary data internally, which makes it easier to disable or debug,
|
|
403
|
+
* * it is optimized for initial downcast process (long insertions), which is crucial for editor init and data save,
|
|
404
|
+
* * it does not save all possible positions for memory considerations, although it is a possible improvement, which may have increase
|
|
405
|
+
* performance, as well as simplify some parts of the `MapperCache` logic.
|
|
406
|
+
*
|
|
407
|
+
* @internal
|
|
408
|
+
*/
|
|
409
|
+
export declare class MapperCache extends /* #__PURE__ */ MapperCache_base {
|
|
410
|
+
/**
|
|
411
|
+
* For every view element or document fragment tracked by `MapperCache`, it holds currently cached data, or more precisely,
|
|
412
|
+
* model offset to view position mappings. See also `MappingCache` and `CacheItem`.
|
|
413
|
+
*
|
|
414
|
+
* If an item is tracked by `MapperCache` it has an entry in this structure, so this structure can be used to check which items
|
|
415
|
+
* are tracked by `MapperCache`. When an item is no longer tracked, it is removed from this structure.
|
|
416
|
+
*
|
|
417
|
+
* Although `MappingCache` and `CacheItem` structures allows for caching any model offsets and view positions, we only cache
|
|
418
|
+
* values for model offsets that are after a view node. So, in essence, positions inside text nodes are not cached. However, it takes
|
|
419
|
+
* from one to at most a few steps, to get from a cached position to a position that is inside a view text node.
|
|
420
|
+
*
|
|
421
|
+
* Additionally, only one item per `modelOffset` is cached. There can be several view nodes that "end" at the same `modelOffset`.
|
|
422
|
+
* In this case, we favour positions that are closer to the mapped item. For example
|
|
423
|
+
*
|
|
424
|
+
* * for model: `<paragraph>Some <$text bold=true italic=true>formatted</$text> text.</paragraph>`,
|
|
425
|
+
* * and view: `<p>Some <em><strong>formatted</strong></em> text.</p>`,
|
|
426
|
+
*
|
|
427
|
+
* for model offset `14` (after "d"), we store view position after `<em>` element (i.e. view position: at `<p>`, offset `2`).
|
|
428
|
+
*/
|
|
429
|
+
private _cachedMapping;
|
|
430
|
+
/**
|
|
431
|
+
* When `MapperCache` {@link ~MapperCache#save saves} view position -> model offset mapping, a `CacheItem` is inserted into certain
|
|
432
|
+
* `MappingCache#cacheList` at some index. Additionally, we store that index with the view node that is before the cached view position.
|
|
433
|
+
*
|
|
434
|
+
* This allows to quickly get a cache list item related to certain view node, and hence, for fast cache invalidation.
|
|
435
|
+
*
|
|
436
|
+
* For example, consider view: `<p>Some <strong>bold</strong> text.</p>`, where `<p>` is a view element tracked by `MapperCache`.
|
|
437
|
+
* If all `<p>` children were visited by `MapperCache`, then `<p>` cache list would have four items, related to following model offsets:
|
|
438
|
+
* `0`, `5`, `9`, `15`. Then, view node `"Some "` would have index `1`, `<strong>` index `2`, and `" text." index `3`.
|
|
439
|
+
*
|
|
440
|
+
* Note that the index related with a node is always greater than `0`. The first item in cache list is always for model offset `0`
|
|
441
|
+
* (and view offset `0`), and it is not related to any node.
|
|
442
|
+
*/
|
|
443
|
+
private _nodeToCacheListIndex;
|
|
444
|
+
/**
|
|
445
|
+
* Callback fired whenever there is a direct or indirect children change in tracked view element or tracked view document fragment.
|
|
446
|
+
*
|
|
447
|
+
* This is specified as a property to make it easier to set as an event callback and to later turn off that event.
|
|
448
|
+
*/
|
|
449
|
+
private _invalidateOnChildrenChangeCallback;
|
|
450
|
+
/**
|
|
451
|
+
* Callback fired whenever a view text node directly or indirectly inside a tracked view element or tracked view document fragment
|
|
452
|
+
* changes its text data.
|
|
453
|
+
*
|
|
454
|
+
* This is specified as a property to make it easier to set as an event callback and to later turn off that event.
|
|
455
|
+
*/
|
|
456
|
+
private _invalidateOnTextChangeCallback;
|
|
457
|
+
/**
|
|
458
|
+
* Saves cache for given view position mapping <-> model offset mapping. The view position should be after a node (i.e. it cannot
|
|
459
|
+
* be the first position inside its parent, or in other words, `viewOffset` must be greater than `0`).
|
|
460
|
+
*
|
|
461
|
+
* @param viewParent View position parent.
|
|
462
|
+
* @param viewOffset View position offset. Must be greater than `0`.
|
|
463
|
+
* @param viewContainer Tracked view position ascendant (it may be the direct parent of the view position).
|
|
464
|
+
* @param modelOffset Model offset in the model element or document fragment which is mapped to `viewContainer`.
|
|
465
|
+
*/
|
|
466
|
+
save(viewParent: ViewElement | ViewDocumentFragment, viewOffset: number, viewContainer: ViewElement | ViewDocumentFragment, modelOffset: number): void;
|
|
467
|
+
/**
|
|
468
|
+
* For given `modelOffset` inside a model element mapped to given `viewContainer`, it returns the closest saved cache item
|
|
469
|
+
* (view position and related model offset) to the requested one.
|
|
470
|
+
*
|
|
471
|
+
* It can be exactly the requested mapping, or it can be mapping that is the closest starting point to look for the requested mapping.
|
|
472
|
+
*
|
|
473
|
+
* `viewContainer` must be a view element or document fragment that is mapped by the {@link ~Mapper Mapper}.
|
|
474
|
+
*
|
|
475
|
+
* If `viewContainer` is not yet tracked by the `MapperCache`, it will be automatically tracked after calling this method.
|
|
476
|
+
*
|
|
477
|
+
* Note: this method will automatically "hoist" cached positions, i.e. it will return a position that is closest to the tracked element.
|
|
478
|
+
*
|
|
479
|
+
* For example, if `<p>` is tracked element, and `^` is cached position:
|
|
480
|
+
*
|
|
481
|
+
* ```
|
|
482
|
+
* <p>This is <strong>some <em>heavily <u>formatted</u>^</em></strong> text.</p>
|
|
483
|
+
* ```
|
|
484
|
+
*
|
|
485
|
+
* If this position would be returned, instead, a position directly in `<p>` would be returned:
|
|
486
|
+
*
|
|
487
|
+
* ```
|
|
488
|
+
* <p>This is <strong>some <em>heavily <u>formatted</u></em></strong>^ text.</p>
|
|
489
|
+
* ```
|
|
490
|
+
*
|
|
491
|
+
* Note, that `modelOffset` for both positions is the same.
|
|
492
|
+
*
|
|
493
|
+
* @param viewContainer Tracked view element or document fragment, which cache will be used.
|
|
494
|
+
* @param modelOffset Model offset in a model element or document fragment, which is mapped to `viewContainer`.
|
|
495
|
+
*/
|
|
496
|
+
getClosest(viewContainer: ViewElement | ViewDocumentFragment, modelOffset: number): CacheItem;
|
|
497
|
+
/**
|
|
498
|
+
* Moves a view position to a preferred location.
|
|
499
|
+
*
|
|
500
|
+
* The view position is moved up from a non-tracked view element as long as it remains at the end of its current parent.
|
|
501
|
+
*
|
|
502
|
+
* See example below to understand when it is important:
|
|
503
|
+
*
|
|
504
|
+
* Starting state:
|
|
505
|
+
*
|
|
506
|
+
* ```
|
|
507
|
+
* <p>This is <strong>some <em>heavily <u>formatted</u>^ piece of</em></strong> text.</p>
|
|
508
|
+
* ```
|
|
509
|
+
*
|
|
510
|
+
* Then we remove " piece of " and invalidate some cache:
|
|
511
|
+
*
|
|
512
|
+
* ```
|
|
513
|
+
* <p>This is <strong>some <em>heavily <u>formatted</u>^</em></strong> text.</p>
|
|
514
|
+
* ```
|
|
515
|
+
*
|
|
516
|
+
* Now, if we ask for model offset after letter "d" in "formatted", we should get a position in " text", but we will get in `<em>`.
|
|
517
|
+
* For this scenario, we need to hoist the position.
|
|
518
|
+
*
|
|
519
|
+
* ```
|
|
520
|
+
* <p>This is <strong>some <em>heavily <u>formatted</u></em></strong>^ text.</p>
|
|
521
|
+
* ```
|
|
522
|
+
*/
|
|
523
|
+
private _hoistViewPosition;
|
|
524
|
+
/**
|
|
525
|
+
* Starts tracking given `viewContainer`, which must be mapped to a model element or model document fragment.
|
|
526
|
+
*
|
|
527
|
+
* Note, that this method is automatically called by
|
|
528
|
+
* {@link module:engine/conversion/mapper~MapperCache#getClosest `MapperCache#getClosest()`} and there is no need to call it manually.
|
|
529
|
+
*
|
|
530
|
+
* This method initializes the cache for `viewContainer` and adds callbacks for
|
|
531
|
+
* {@link module:engine/view/node~ViewNodeChangeEvent `change` event} fired by `viewContainer`. `MapperCache` listens to `change` event
|
|
532
|
+
* on the tracked elements to invalidate the stored cache.
|
|
533
|
+
*/
|
|
534
|
+
startTracking(viewContainer: ViewElement | ViewDocumentFragment): CacheItem;
|
|
535
|
+
/**
|
|
536
|
+
* Stops tracking given `viewContainer`.
|
|
537
|
+
*
|
|
538
|
+
* It removes the cached data and stops listening to {@link module:engine/view/node~ViewNodeChangeEvent `change` event} on the
|
|
539
|
+
* `viewContainer`.
|
|
540
|
+
*/
|
|
541
|
+
stopTracking(viewContainer: ViewElement | ViewDocumentFragment): void;
|
|
542
|
+
/**
|
|
543
|
+
* Invalidates cache inside `viewParent`, starting from given `index` in that parent.
|
|
544
|
+
*/
|
|
545
|
+
private _clearCacheInsideParent;
|
|
546
|
+
/**
|
|
547
|
+
* Clears all the cache for given tracked `viewContainer`.
|
|
548
|
+
*/
|
|
549
|
+
private _clearCacheAll;
|
|
550
|
+
/**
|
|
551
|
+
* Clears all the stored cache starting before given `viewNode`. The `viewNode` can be any node that is inside a tracked view element
|
|
552
|
+
* or view document fragment.
|
|
553
|
+
*/
|
|
554
|
+
private _clearCacheStartingBefore;
|
|
555
|
+
/**
|
|
556
|
+
* Clears all the cache in the cache list related to given `viewContainer`, starting from `index` (inclusive).
|
|
557
|
+
*/
|
|
558
|
+
private _clearCacheFromIndex;
|
|
559
|
+
/**
|
|
560
|
+
* Finds a cache item in the given cache list, which `modelOffset` is closest (but smaller or equal) to given `offset`.
|
|
561
|
+
*
|
|
562
|
+
* Since `cacheList` is a sorted array, this uses binary search to retrieve the item quickly.
|
|
563
|
+
*/
|
|
564
|
+
private _findInCacheList;
|
|
565
|
+
}
|
|
354
566
|
/**
|
|
355
567
|
* Fired for each model-to-view position mapping request. The purpose of this event is to enable custom model-to-view position
|
|
356
568
|
* mapping. Callbacks added to this event take {@link module:engine/model/position~Position model position} and are expected to
|
|
@@ -500,4 +712,21 @@ export type MapperViewToModelPositionEventData = {
|
|
|
500
712
|
*/
|
|
501
713
|
viewPosition: ViewPosition;
|
|
502
714
|
};
|
|
715
|
+
/**
|
|
716
|
+
* Informs that given `viewPosition` corresponds to given `modelOffset` (with the assumption that the model offset is in a model element
|
|
717
|
+
* mapped to the `viewPosition` parent or its ancestor).
|
|
718
|
+
*
|
|
719
|
+
* For example, for model `<paragraph>Some <$text bold=true>bold</$text> text</paragraph>` and view `<p>Some <strong>bold</strong> text</p>`
|
|
720
|
+
* and assuming `<paragraph>` and `<p>` are mapped, following example `CacheItem`s are possible:
|
|
721
|
+
*
|
|
722
|
+
* * `viewPosition` = `<p>`, 1; `modelOffset` = 5
|
|
723
|
+
* * `viewPosition` = `"bold"`, 2; `modelOffset` = 7
|
|
724
|
+
* * `viewPosition` = `<strong>, 1; `modelOffset` = 9
|
|
725
|
+
* * `viewPosition` = `" text"`, 0; `modelOffset` = 9
|
|
726
|
+
* * `viewPosition` = `<p>`, 2; `modelOffset` = 9
|
|
727
|
+
*/
|
|
728
|
+
type CacheItem = {
|
|
729
|
+
viewPosition: ViewPosition;
|
|
730
|
+
modelOffset: number;
|
|
731
|
+
};
|
|
503
732
|
export {};
|