@ckeditor/ckeditor5-engine 44.1.0-alpha.5 → 44.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +4 -4
- package/dist/index.css.map +1 -1
- package/dist/index.js +646 -77
- package/dist/index.js.map +1 -1
- package/package.json +23 -3
- package/src/controller/datacontroller.d.ts +1 -1
- package/src/controller/datacontroller.js +1 -1
- package/src/controller/editingcontroller.d.ts +1 -1
- package/src/controller/editingcontroller.js +1 -1
- package/src/conversion/conversion.d.ts +1 -1
- package/src/conversion/conversion.js +1 -1
- package/src/conversion/conversionhelpers.d.ts +1 -1
- package/src/conversion/conversionhelpers.js +1 -1
- package/src/conversion/downcastdispatcher.d.ts +1 -1
- package/src/conversion/downcastdispatcher.js +1 -1
- package/src/conversion/downcasthelpers.d.ts +1 -1
- package/src/conversion/downcasthelpers.js +1 -1
- package/src/conversion/mapper.d.ts +249 -20
- package/src/conversion/mapper.js +524 -38
- package/src/conversion/modelconsumable.d.ts +1 -1
- package/src/conversion/modelconsumable.js +1 -1
- package/src/conversion/upcastdispatcher.d.ts +1 -1
- package/src/conversion/upcastdispatcher.js +1 -1
- package/src/conversion/upcasthelpers.d.ts +1 -1
- package/src/conversion/upcasthelpers.js +1 -1
- package/src/conversion/viewconsumable.d.ts +1 -1
- package/src/conversion/viewconsumable.js +1 -1
- package/src/dataprocessor/basichtmlwriter.d.ts +1 -1
- package/src/dataprocessor/basichtmlwriter.js +1 -1
- package/src/dataprocessor/dataprocessor.d.ts +1 -1
- package/src/dataprocessor/dataprocessor.js +1 -1
- package/src/dataprocessor/htmldataprocessor.d.ts +1 -1
- package/src/dataprocessor/htmldataprocessor.js +1 -1
- package/src/dataprocessor/htmlwriter.d.ts +1 -1
- package/src/dataprocessor/htmlwriter.js +1 -1
- package/src/dataprocessor/xmldataprocessor.d.ts +1 -1
- package/src/dataprocessor/xmldataprocessor.js +1 -1
- package/src/dev-utils/model.d.ts +1 -1
- package/src/dev-utils/model.js +1 -1
- package/src/dev-utils/operationreplayer.d.ts +1 -1
- package/src/dev-utils/operationreplayer.js +1 -1
- package/src/dev-utils/utils.d.ts +1 -1
- package/src/dev-utils/utils.js +1 -1
- package/src/dev-utils/view.d.ts +1 -1
- package/src/dev-utils/view.js +1 -1
- package/src/index.d.ts +4 -2
- package/src/index.js +2 -1
- package/src/model/batch.d.ts +1 -1
- package/src/model/batch.js +7 -3
- package/src/model/differ.d.ts +1 -1
- package/src/model/differ.js +1 -1
- package/src/model/document.d.ts +1 -1
- package/src/model/document.js +1 -1
- package/src/model/documentfragment.d.ts +1 -1
- package/src/model/documentfragment.js +1 -1
- package/src/model/documentselection.d.ts +1 -1
- package/src/model/documentselection.js +1 -1
- package/src/model/element.d.ts +1 -1
- package/src/model/element.js +1 -1
- package/src/model/history.d.ts +1 -1
- package/src/model/history.js +1 -1
- package/src/model/item.d.ts +1 -1
- package/src/model/item.js +1 -1
- package/src/model/liveposition.d.ts +1 -1
- package/src/model/liveposition.js +1 -1
- package/src/model/liverange.d.ts +1 -1
- package/src/model/liverange.js +1 -1
- package/src/model/markercollection.d.ts +1 -1
- package/src/model/markercollection.js +1 -1
- package/src/model/model.d.ts +1 -1
- package/src/model/model.js +1 -1
- package/src/model/node.d.ts +1 -1
- package/src/model/node.js +1 -1
- package/src/model/nodelist.d.ts +1 -1
- package/src/model/nodelist.js +1 -1
- package/src/model/operation/attributeoperation.d.ts +1 -1
- package/src/model/operation/attributeoperation.js +1 -1
- package/src/model/operation/detachoperation.d.ts +1 -1
- package/src/model/operation/detachoperation.js +1 -1
- package/src/model/operation/insertoperation.d.ts +1 -1
- package/src/model/operation/insertoperation.js +1 -1
- package/src/model/operation/markeroperation.d.ts +1 -1
- package/src/model/operation/markeroperation.js +1 -1
- package/src/model/operation/mergeoperation.d.ts +1 -1
- package/src/model/operation/mergeoperation.js +1 -1
- package/src/model/operation/moveoperation.d.ts +1 -1
- package/src/model/operation/moveoperation.js +1 -1
- package/src/model/operation/nooperation.d.ts +1 -1
- package/src/model/operation/nooperation.js +1 -1
- package/src/model/operation/operation.d.ts +4 -1
- package/src/model/operation/operation.js +2 -2
- package/src/model/operation/operationfactory.d.ts +1 -1
- package/src/model/operation/operationfactory.js +1 -1
- package/src/model/operation/renameoperation.d.ts +1 -1
- package/src/model/operation/renameoperation.js +1 -1
- package/src/model/operation/rootattributeoperation.d.ts +1 -1
- package/src/model/operation/rootattributeoperation.js +1 -1
- package/src/model/operation/rootoperation.d.ts +1 -1
- package/src/model/operation/rootoperation.js +1 -1
- package/src/model/operation/splitoperation.d.ts +1 -1
- package/src/model/operation/splitoperation.js +1 -1
- package/src/model/operation/transform.d.ts +1 -1
- package/src/model/operation/transform.js +1 -1
- package/src/model/operation/utils.d.ts +1 -1
- package/src/model/operation/utils.js +1 -1
- package/src/model/position.d.ts +1 -1
- package/src/model/position.js +1 -1
- package/src/model/range.d.ts +1 -1
- package/src/model/range.js +1 -1
- package/src/model/rootelement.d.ts +1 -1
- package/src/model/rootelement.js +1 -1
- package/src/model/schema.d.ts +1 -1
- package/src/model/schema.js +1 -1
- package/src/model/selection.d.ts +1 -1
- package/src/model/selection.js +9 -2
- package/src/model/text.d.ts +1 -1
- package/src/model/text.js +1 -1
- package/src/model/textproxy.d.ts +1 -1
- package/src/model/textproxy.js +1 -1
- package/src/model/treewalker.d.ts +17 -1
- package/src/model/treewalker.js +26 -1
- package/src/model/typecheckable.d.ts +1 -1
- package/src/model/typecheckable.js +1 -1
- package/src/model/utils/autoparagraphing.d.ts +1 -1
- package/src/model/utils/autoparagraphing.js +1 -1
- package/src/model/utils/deletecontent.d.ts +1 -1
- package/src/model/utils/deletecontent.js +1 -1
- package/src/model/utils/getselectedcontent.d.ts +1 -1
- package/src/model/utils/getselectedcontent.js +1 -1
- package/src/model/utils/insertcontent.d.ts +1 -1
- package/src/model/utils/insertcontent.js +1 -1
- package/src/model/utils/insertobject.d.ts +1 -1
- package/src/model/utils/insertobject.js +1 -1
- package/src/model/utils/modifyselection.d.ts +1 -1
- package/src/model/utils/modifyselection.js +1 -1
- package/src/model/utils/selection-post-fixer.d.ts +1 -1
- package/src/model/utils/selection-post-fixer.js +1 -1
- package/src/model/writer.d.ts +1 -1
- package/src/model/writer.js +1 -1
- package/src/view/attributeelement.d.ts +1 -1
- package/src/view/attributeelement.js +1 -1
- package/src/view/containerelement.d.ts +1 -1
- package/src/view/containerelement.js +1 -1
- package/src/view/datatransfer.d.ts +1 -1
- package/src/view/datatransfer.js +1 -1
- package/src/view/document.d.ts +1 -1
- package/src/view/document.js +1 -1
- package/src/view/documentfragment.d.ts +6 -4
- package/src/view/documentfragment.js +7 -7
- package/src/view/documentselection.d.ts +1 -1
- package/src/view/documentselection.js +1 -1
- package/src/view/domconverter.d.ts +1 -1
- package/src/view/domconverter.js +1 -1
- package/src/view/downcastwriter.d.ts +1 -1
- package/src/view/downcastwriter.js +1 -1
- package/src/view/editableelement.d.ts +1 -1
- package/src/view/editableelement.js +1 -1
- package/src/view/element.d.ts +1 -1
- package/src/view/element.js +3 -3
- package/src/view/elementdefinition.d.ts +1 -1
- package/src/view/elementdefinition.js +1 -1
- package/src/view/emptyelement.d.ts +1 -1
- package/src/view/emptyelement.js +1 -1
- package/src/view/filler.d.ts +1 -1
- package/src/view/filler.js +1 -1
- package/src/view/item.d.ts +1 -1
- package/src/view/item.js +1 -1
- package/src/view/matcher.d.ts +1 -1
- package/src/view/matcher.js +1 -1
- package/src/view/node.d.ts +13 -4
- package/src/view/node.js +5 -4
- package/src/view/observer/arrowkeysobserver.d.ts +1 -1
- package/src/view/observer/arrowkeysobserver.js +1 -1
- package/src/view/observer/bubblingemittermixin.d.ts +1 -1
- package/src/view/observer/bubblingemittermixin.js +1 -1
- package/src/view/observer/bubblingeventinfo.d.ts +1 -1
- package/src/view/observer/bubblingeventinfo.js +1 -1
- package/src/view/observer/clickobserver.d.ts +1 -1
- package/src/view/observer/clickobserver.js +1 -1
- package/src/view/observer/compositionobserver.d.ts +1 -1
- package/src/view/observer/compositionobserver.js +1 -1
- package/src/view/observer/domeventdata.d.ts +1 -1
- package/src/view/observer/domeventdata.js +1 -1
- package/src/view/observer/domeventobserver.d.ts +1 -1
- package/src/view/observer/domeventobserver.js +1 -1
- package/src/view/observer/fakeselectionobserver.d.ts +1 -1
- package/src/view/observer/fakeselectionobserver.js +1 -1
- package/src/view/observer/focusobserver.d.ts +1 -1
- package/src/view/observer/focusobserver.js +1 -1
- package/src/view/observer/inputobserver.d.ts +1 -1
- package/src/view/observer/inputobserver.js +1 -1
- package/src/view/observer/keyobserver.d.ts +1 -1
- package/src/view/observer/keyobserver.js +1 -1
- package/src/view/observer/mouseobserver.d.ts +1 -1
- package/src/view/observer/mouseobserver.js +1 -1
- package/src/view/observer/mutationobserver.d.ts +1 -1
- package/src/view/observer/mutationobserver.js +1 -1
- package/src/view/observer/observer.d.ts +1 -1
- package/src/view/observer/observer.js +1 -1
- package/src/view/observer/selectionobserver.d.ts +1 -1
- package/src/view/observer/selectionobserver.js +1 -1
- package/src/view/observer/tabobserver.d.ts +1 -1
- package/src/view/observer/tabobserver.js +1 -1
- package/src/view/observer/touchobserver.d.ts +73 -0
- package/src/view/observer/touchobserver.js +29 -0
- package/src/view/placeholder.d.ts +1 -1
- package/src/view/placeholder.js +23 -17
- package/src/view/position.d.ts +1 -1
- package/src/view/position.js +1 -1
- package/src/view/range.d.ts +1 -1
- package/src/view/range.js +1 -1
- package/src/view/rawelement.d.ts +1 -1
- package/src/view/rawelement.js +1 -1
- package/src/view/renderer.d.ts +1 -1
- package/src/view/renderer.js +1 -1
- package/src/view/rooteditableelement.d.ts +1 -1
- package/src/view/rooteditableelement.js +1 -1
- package/src/view/selection.d.ts +1 -1
- package/src/view/selection.js +1 -1
- package/src/view/styles/background.d.ts +1 -1
- package/src/view/styles/background.js +1 -1
- package/src/view/styles/border.d.ts +1 -1
- package/src/view/styles/border.js +1 -1
- package/src/view/styles/margin.d.ts +1 -1
- package/src/view/styles/margin.js +1 -1
- package/src/view/styles/padding.d.ts +1 -1
- package/src/view/styles/padding.js +1 -1
- package/src/view/styles/utils.d.ts +1 -1
- package/src/view/styles/utils.js +1 -1
- package/src/view/stylesmap.d.ts +1 -1
- package/src/view/stylesmap.js +1 -1
- package/src/view/text.d.ts +1 -1
- package/src/view/text.js +1 -1
- package/src/view/textproxy.d.ts +1 -1
- package/src/view/textproxy.js +1 -1
- package/src/view/treewalker.d.ts +17 -1
- package/src/view/treewalker.js +25 -1
- package/src/view/typecheckable.d.ts +1 -1
- package/src/view/typecheckable.js +1 -1
- package/src/view/uielement.d.ts +1 -1
- package/src/view/uielement.js +1 -1
- package/src/view/upcastwriter.d.ts +1 -1
- package/src/view/upcastwriter.js +1 -1
- package/src/view/view.d.ts +1 -1
- package/src/view/view.js +1 -1
- package/theme/placeholder.css +1 -1
- package/theme/renderer.css +1 -1
- package/dist/controller/datacontroller.d.ts +0 -339
- package/dist/controller/editingcontroller.d.ts +0 -102
- package/dist/conversion/conversion.d.ts +0 -482
- package/dist/conversion/conversionhelpers.d.ts +0 -30
- package/dist/conversion/downcastdispatcher.d.ts +0 -566
- package/dist/conversion/downcasthelpers.d.ts +0 -1194
- package/dist/conversion/mapper.d.ts +0 -507
- package/dist/conversion/modelconsumable.d.ts +0 -205
- package/dist/conversion/upcastdispatcher.d.ts +0 -496
- package/dist/conversion/upcasthelpers.d.ts +0 -503
- package/dist/conversion/viewconsumable.d.ts +0 -373
- package/dist/dataprocessor/basichtmlwriter.d.ts +0 -22
- package/dist/dataprocessor/dataprocessor.d.ts +0 -65
- package/dist/dataprocessor/htmldataprocessor.d.ts +0 -80
- package/dist/dataprocessor/htmlwriter.d.ts +0 -20
- package/dist/dataprocessor/xmldataprocessor.d.ts +0 -94
- package/dist/dev-utils/model.d.ts +0 -130
- package/dist/dev-utils/operationreplayer.d.ts +0 -55
- package/dist/dev-utils/utils.d.ts +0 -41
- package/dist/dev-utils/view.d.ts +0 -324
- package/dist/index.d.ts +0 -122
- package/dist/model/batch.d.ts +0 -110
- package/dist/model/differ.d.ts +0 -511
- package/dist/model/document.d.ts +0 -278
- package/dist/model/documentfragment.d.ts +0 -223
- package/dist/model/documentselection.d.ts +0 -424
- package/dist/model/element.d.ts +0 -191
- package/dist/model/history.d.ts +0 -118
- package/dist/model/item.d.ts +0 -18
- package/dist/model/liveposition.d.ts +0 -81
- package/dist/model/liverange.d.ts +0 -106
- package/dist/model/markercollection.d.ts +0 -339
- package/dist/model/model.d.ts +0 -923
- package/dist/model/node.d.ts +0 -262
- package/dist/model/nodelist.d.ts +0 -119
- package/dist/model/operation/attributeoperation.d.ts +0 -107
- package/dist/model/operation/detachoperation.d.ts +0 -64
- package/dist/model/operation/insertoperation.d.ts +0 -94
- package/dist/model/operation/markeroperation.d.ts +0 -95
- package/dist/model/operation/mergeoperation.d.ts +0 -104
- package/dist/model/operation/moveoperation.d.ts +0 -100
- package/dist/model/operation/nooperation.d.ts +0 -42
- package/dist/model/operation/operation.d.ts +0 -100
- package/dist/model/operation/operationfactory.d.ts +0 -22
- package/dist/model/operation/renameoperation.d.ts +0 -87
- package/dist/model/operation/rootattributeoperation.d.ts +0 -102
- package/dist/model/operation/rootoperation.d.ts +0 -80
- package/dist/model/operation/splitoperation.d.ts +0 -113
- package/dist/model/operation/transform.d.ts +0 -104
- package/dist/model/operation/utils.d.ts +0 -75
- package/dist/model/position.d.ts +0 -549
- package/dist/model/range.d.ts +0 -462
- package/dist/model/rootelement.d.ts +0 -64
- package/dist/model/schema.d.ts +0 -1334
- package/dist/model/selection.d.ts +0 -486
- package/dist/model/text.d.ts +0 -70
- package/dist/model/textproxy.d.ts +0 -148
- package/dist/model/treewalker.d.ts +0 -190
- package/dist/model/typecheckable.d.ts +0 -289
- package/dist/model/utils/autoparagraphing.d.ts +0 -41
- package/dist/model/utils/deletecontent.d.ts +0 -62
- package/dist/model/utils/getselectedcontent.d.ts +0 -34
- package/dist/model/utils/insertcontent.d.ts +0 -50
- package/dist/model/utils/insertobject.d.ts +0 -51
- package/dist/model/utils/modifyselection.d.ts +0 -52
- package/dist/model/utils/selection-post-fixer.d.ts +0 -78
- package/dist/model/writer.d.ts +0 -855
- package/dist/view/attributeelement.d.ts +0 -112
- package/dist/view/containerelement.d.ts +0 -53
- package/dist/view/datatransfer.d.ts +0 -83
- package/dist/view/document.d.ts +0 -188
- package/dist/view/documentfragment.d.ts +0 -157
- package/dist/view/documentselection.d.ts +0 -310
- package/dist/view/domconverter.d.ts +0 -665
- package/dist/view/downcastwriter.d.ts +0 -1000
- package/dist/view/editableelement.d.ts +0 -66
- package/dist/view/element.d.ts +0 -472
- package/dist/view/elementdefinition.d.ts +0 -91
- package/dist/view/emptyelement.d.ts +0 -45
- package/dist/view/filler.d.ts +0 -115
- package/dist/view/item.d.ts +0 -18
- package/dist/view/matcher.d.ts +0 -490
- package/dist/view/node.d.ts +0 -166
- package/dist/view/observer/arrowkeysobserver.d.ts +0 -49
- package/dist/view/observer/bubblingemittermixin.d.ts +0 -170
- package/dist/view/observer/bubblingeventinfo.d.ts +0 -51
- package/dist/view/observer/clickobserver.d.ts +0 -47
- package/dist/view/observer/compositionobserver.d.ts +0 -86
- package/dist/view/observer/domeventdata.d.ts +0 -54
- package/dist/view/observer/domeventobserver.d.ts +0 -82
- package/dist/view/observer/fakeselectionobserver.d.ts +0 -51
- package/dist/view/observer/focusobserver.d.ts +0 -98
- package/dist/view/observer/inputobserver.d.ts +0 -90
- package/dist/view/observer/keyobserver.d.ts +0 -70
- package/dist/view/observer/mouseobserver.d.ts +0 -93
- package/dist/view/observer/mutationobserver.d.ts +0 -119
- package/dist/view/observer/observer.d.ts +0 -93
- package/dist/view/observer/selectionobserver.d.ts +0 -151
- package/dist/view/observer/tabobserver.d.ts +0 -50
- package/dist/view/placeholder.d.ts +0 -100
- package/dist/view/position.d.ts +0 -192
- package/dist/view/range.d.ts +0 -283
- package/dist/view/rawelement.d.ts +0 -77
- package/dist/view/renderer.d.ts +0 -281
- package/dist/view/rooteditableelement.d.ts +0 -45
- package/dist/view/selection.d.ts +0 -379
- package/dist/view/styles/background.d.ts +0 -37
- package/dist/view/styles/border.d.ts +0 -47
- package/dist/view/styles/margin.d.ts +0 -33
- package/dist/view/styles/padding.d.ts +0 -33
- package/dist/view/styles/utils.d.ts +0 -97
- package/dist/view/stylesmap.d.ts +0 -685
- package/dist/view/text.d.ts +0 -78
- package/dist/view/textproxy.d.ts +0 -101
- package/dist/view/treewalker.d.ts +0 -199
- package/dist/view/typecheckable.d.ts +0 -452
- package/dist/view/uielement.d.ts +0 -100
- package/dist/view/upcastwriter.d.ts +0 -421
- package/dist/view/view.d.ts +0 -488
|
@@ -1,62 +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/model/utils/deletecontent
|
|
11
|
-
*/
|
|
12
|
-
import DocumentSelection from '../documentselection.js';
|
|
13
|
-
import type Model from '../model.js';
|
|
14
|
-
import type Selection from '../selection.js';
|
|
15
|
-
/**
|
|
16
|
-
* Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
|
|
17
|
-
*
|
|
18
|
-
* **Note:** Use {@link module:engine/model/model~Model#deleteContent} instead of this function.
|
|
19
|
-
* This function is only exposed to be reusable in algorithms
|
|
20
|
-
* which change the {@link module:engine/model/model~Model#deleteContent}
|
|
21
|
-
* method's behavior.
|
|
22
|
-
*
|
|
23
|
-
* @param model The model in context of which the insertion should be performed.
|
|
24
|
-
* @param selection Selection of which the content should be deleted.
|
|
25
|
-
* @param options.leaveUnmerged Whether to merge elements after removing the content of the selection.
|
|
26
|
-
*
|
|
27
|
-
* For example `<heading>x[x</heading><paragraph>y]y</paragraph>` will become:
|
|
28
|
-
*
|
|
29
|
-
* * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)
|
|
30
|
-
* * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).
|
|
31
|
-
*
|
|
32
|
-
* Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}
|
|
33
|
-
* elements will not be merged.
|
|
34
|
-
*
|
|
35
|
-
* @param options.doNotResetEntireContent Whether to skip replacing the entire content with a
|
|
36
|
-
* paragraph when the entire content was selected.
|
|
37
|
-
*
|
|
38
|
-
* For example `<heading>[x</heading><paragraph>y]</paragraph>` will become:
|
|
39
|
-
*
|
|
40
|
-
* * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)
|
|
41
|
-
* * `<heading>^</heading>` with enabled (`doNotResetEntireContent == true`).
|
|
42
|
-
*
|
|
43
|
-
* @param options.doNotAutoparagraph Whether to create a paragraph if after content deletion selection is moved
|
|
44
|
-
* to a place where text cannot be inserted.
|
|
45
|
-
*
|
|
46
|
-
* For example `<paragraph>x</paragraph>[<imageBlock src="foo.jpg"></imageBlock>]` will become:
|
|
47
|
-
*
|
|
48
|
-
* * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)
|
|
49
|
-
* * `<paragraph>x</paragraph>[]` with the option enabled (`doNotAutoparagraph == true`).
|
|
50
|
-
*
|
|
51
|
-
* If you use this option you need to make sure to handle invalid selections yourself or leave
|
|
52
|
-
* them to the selection post-fixer (may not always work).
|
|
53
|
-
*
|
|
54
|
-
* **Note:** If there is no valid position for the selection, the paragraph will always be created:
|
|
55
|
-
*
|
|
56
|
-
* `[<imageBlock src="foo.jpg"></imageBlock>]` -> `<paragraph>[]</paragraph>`.
|
|
57
|
-
*/
|
|
58
|
-
export default function deleteContent(model: Model, selection: Selection | DocumentSelection, options?: {
|
|
59
|
-
leaveUnmerged?: boolean;
|
|
60
|
-
doNotResetEntireContent?: boolean;
|
|
61
|
-
doNotAutoparagraph?: boolean;
|
|
62
|
-
}): void;
|
|
@@ -1,34 +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 DocumentFragment from '../documentfragment.js';
|
|
10
|
-
import type DocumentSelection from '../documentselection.js';
|
|
11
|
-
import type Model from '../model.js';
|
|
12
|
-
import type Selection from '../selection.js';
|
|
13
|
-
/**
|
|
14
|
-
* @module engine/model/utils/getselectedcontent
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Gets a clone of the selected content.
|
|
18
|
-
*
|
|
19
|
-
* For example, for the following selection:
|
|
20
|
-
*
|
|
21
|
-
* ```html
|
|
22
|
-
* <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* It will return a document fragment with such a content:
|
|
26
|
-
*
|
|
27
|
-
* ```html
|
|
28
|
-
* <quote><h>st</h></quote><p>se</p>
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @param model The model in context of which the selection modification should be performed.
|
|
32
|
-
* @param selection The selection of which content will be returned.
|
|
33
|
-
*/
|
|
34
|
-
export default function getSelectedContent(model: Model, selection: Selection | DocumentSelection): DocumentFragment;
|
|
@@ -1,50 +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/model/utils/insertcontent
|
|
11
|
-
*/
|
|
12
|
-
import DocumentSelection from '../documentselection.js';
|
|
13
|
-
import Range from '../range.js';
|
|
14
|
-
import type DocumentFragment from '../documentfragment.js';
|
|
15
|
-
import type Item from '../item.js';
|
|
16
|
-
import type Model from '../model.js';
|
|
17
|
-
import type Selection from '../selection.js';
|
|
18
|
-
/**
|
|
19
|
-
* Inserts content into the editor (specified selection) as one would expect the paste functionality to work.
|
|
20
|
-
*
|
|
21
|
-
* It takes care of removing the selected content, splitting elements (if needed), inserting elements and merging elements appropriately.
|
|
22
|
-
*
|
|
23
|
-
* Some examples:
|
|
24
|
-
*
|
|
25
|
-
* ```html
|
|
26
|
-
* <p>x^</p> + <p>y</p> => <p>x</p><p>y</p> => <p>xy[]</p>
|
|
27
|
-
* <p>x^y</p> + <p>z</p> => <p>x</p>^<p>y</p> + <p>z</p> => <p>x</p><p>z</p><p>y</p> => <p>xz[]y</p>
|
|
28
|
-
* <p>x^y</p> + <img /> => <p>x</p>^<p>y</p> + <img /> => <p>x</p><img /><p>y</p>
|
|
29
|
-
* <p>x</p><p>^</p><p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p> (no merging)
|
|
30
|
-
* <p>x</p>[<img />]<p>z</p> + <p>y</p> => <p>x</p>^<p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p>
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified
|
|
34
|
-
* to the insertion selection (equal to a range to be selected after insertion).
|
|
35
|
-
*
|
|
36
|
-
* If `selectable` is not passed, the content will be inserted using the current selection of the model document.
|
|
37
|
-
*
|
|
38
|
-
* **Note:** Use {@link module:engine/model/model~Model#insertContent} instead of this function.
|
|
39
|
-
* This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertContent}
|
|
40
|
-
* method's behavior.
|
|
41
|
-
*
|
|
42
|
-
* @param model The model in context of which the insertion should be performed.
|
|
43
|
-
* @param content The content to insert.
|
|
44
|
-
* @param selectable Selection into which the content should be inserted.
|
|
45
|
-
* @param placeOrOffset Sets place or offset of the selection.
|
|
46
|
-
* @returns Range which contains all the performed changes. This is a range that, if removed,
|
|
47
|
-
* would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
|
|
48
|
-
* at the insertion position.
|
|
49
|
-
*/
|
|
50
|
-
export default function insertContent(model: Model, content: Item | DocumentFragment, selectable?: Selection | DocumentSelection): Range;
|
|
@@ -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/model/utils/insertobject
|
|
11
|
-
*/
|
|
12
|
-
import type DocumentSelection from '../documentselection.js';
|
|
13
|
-
import type Selection from '../selection.js';
|
|
14
|
-
import type Element from '../element.js';
|
|
15
|
-
import type Model from '../model.js';
|
|
16
|
-
import type Range from '../range.js';
|
|
17
|
-
/**
|
|
18
|
-
* Inserts an {@glink framework/deep-dive/schema#object-elements object element} at a specific position in the editor content.
|
|
19
|
-
*
|
|
20
|
-
* **Note:** Use {@link module:engine/model/model~Model#insertObject} instead of this function.
|
|
21
|
-
* This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertObject}
|
|
22
|
-
* method's behavior.
|
|
23
|
-
*
|
|
24
|
-
* **Note**: For more documentation and examples, see {@link module:engine/model/model~Model#insertObject}.
|
|
25
|
-
*
|
|
26
|
-
* @param model The model in context of which the insertion should be performed.
|
|
27
|
-
* @param object An object to be inserted into the model document.
|
|
28
|
-
* @param selectable A selectable where the content should be inserted. If not specified, the current
|
|
29
|
-
* {@link module:engine/model/document~Document#selection document selection} will be used instead.
|
|
30
|
-
* @param placeOrOffset Specifies the exact place or offset for the insertion to take place, relative to `selectable`.
|
|
31
|
-
* @param options Additional options.
|
|
32
|
-
* @param options.findOptimalPosition An option that, when set, adjusts the insertion position (relative to
|
|
33
|
-
* `selectable` and `placeOrOffset`) so that the content of `selectable` is not split upon insertion (a.k.a. non-destructive insertion).
|
|
34
|
-
* * When `'auto'`, the algorithm will decide whether to insert the object before or after `selectable` to avoid content splitting.
|
|
35
|
-
* * When `'before'`, the closest position before `selectable` will be used that will not result in content splitting.
|
|
36
|
-
* * When `'after'`, the closest position after `selectable` will be used that will not result in content splitting.
|
|
37
|
-
*
|
|
38
|
-
* Note that this option works only for block objects. Inline objects are inserted into text and do not split blocks.
|
|
39
|
-
* @param options.setSelection An option that, when set, moves the
|
|
40
|
-
* {@link module:engine/model/document~Document#selection document selection} after inserting the object.
|
|
41
|
-
* * When `'on'`, the document selection will be set on the inserted object.
|
|
42
|
-
* * When `'after'`, the document selection will move to the closest text node after the inserted object. If there is no
|
|
43
|
-
* such text node, a paragraph will be created and the document selection will be moved inside it.
|
|
44
|
-
* @returns A range which contains all the performed changes. This is a range that, if removed,
|
|
45
|
-
* would return the model to the state before the insertion. If no changes were preformed by `insertObject()`, returns a range collapsed
|
|
46
|
-
* at the insertion position.
|
|
47
|
-
*/
|
|
48
|
-
export default function insertObject(model: Model, object: Element, selectable?: Selection | DocumentSelection | null, options?: {
|
|
49
|
-
findOptimalPosition?: 'auto' | 'before' | 'after';
|
|
50
|
-
setSelection?: 'on' | 'after';
|
|
51
|
-
}): Range;
|
|
@@ -1,52 +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/model/utils/modifyselection
|
|
11
|
-
*/
|
|
12
|
-
import DocumentSelection from '../documentselection.js';
|
|
13
|
-
import type Model from '../model.js';
|
|
14
|
-
import type Selection from '../selection.js';
|
|
15
|
-
/**
|
|
16
|
-
* Modifies the selection. Currently, the supported modifications are:
|
|
17
|
-
*
|
|
18
|
-
* * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.
|
|
19
|
-
* Possible values for `unit` are:
|
|
20
|
-
* * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one
|
|
21
|
-
* character in `String` sense. However, unicode also defines "combing marks". These are special symbols, that combines
|
|
22
|
-
* with a symbol before it ("base character") to create one user-perceived character. For example, `q̣̇` is a normal
|
|
23
|
-
* letter `q` with two "combining marks": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending
|
|
24
|
-
* selection by one position, it is correct to include both "base character" and all of it's "combining marks". That is
|
|
25
|
-
* why `'character'` value is most natural and common method of modifying selection.
|
|
26
|
-
* * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert
|
|
27
|
-
* selection between "base character" and "combining mark", because "combining marks" have their own unicode code points.
|
|
28
|
-
* However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by
|
|
29
|
-
* two characters, called "surrogate pairs". Halves of "surrogate pairs" have a meaning only when placed next to each other.
|
|
30
|
-
* For example `𨭎` is represented in `String` by `\uD862\uDF4E`. Both `\uD862` and `\uDF4E` do not have any meaning
|
|
31
|
-
* outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection
|
|
32
|
-
* extension will include whole "surrogate pair".
|
|
33
|
-
* * `'word'` - moves selection by a whole word.
|
|
34
|
-
*
|
|
35
|
-
* **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.
|
|
36
|
-
*
|
|
37
|
-
* **Note:** Use {@link module:engine/model/model~Model#modifySelection} instead of this function.
|
|
38
|
-
* This function is only exposed to be reusable in algorithms
|
|
39
|
-
* which change the {@link module:engine/model/model~Model#modifySelection}
|
|
40
|
-
* method's behavior.
|
|
41
|
-
*
|
|
42
|
-
* @param model The model in context of which the selection modification should be performed.
|
|
43
|
-
* @param selection The selection to modify.
|
|
44
|
-
* @param options.direction The direction in which the selection should be modified. Default 'forward'.
|
|
45
|
-
* @param options.unit The unit by which selection should be modified. Default 'character'.
|
|
46
|
-
* @param options.treatEmojiAsSingleUnit Whether multi-characer emoji sequences should be handled as single unit.
|
|
47
|
-
*/
|
|
48
|
-
export default function modifySelection(model: Model, selection: Selection | DocumentSelection, options?: {
|
|
49
|
-
direction?: 'forward' | 'backward';
|
|
50
|
-
unit?: 'character' | 'codePoint' | 'word';
|
|
51
|
-
treatEmojiAsSingleUnit?: boolean;
|
|
52
|
-
}): void;
|
|
@@ -1,78 +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 Range from '../range.js';
|
|
10
|
-
import type Model from '../model.js';
|
|
11
|
-
import type Schema from '../schema.js';
|
|
12
|
-
/**
|
|
13
|
-
* Injects selection post-fixer to the model.
|
|
14
|
-
*
|
|
15
|
-
* The role of the selection post-fixer is to ensure that the selection is in a correct place
|
|
16
|
-
* after a {@link module:engine/model/model~Model#change `change()`} block was executed.
|
|
17
|
-
*
|
|
18
|
-
* The correct position means that:
|
|
19
|
-
*
|
|
20
|
-
* * All collapsed selection ranges are in a place where the {@link module:engine/model/schema~Schema}
|
|
21
|
-
* allows a `$text`.
|
|
22
|
-
* * None of the selection's non-collapsed ranges crosses a {@link module:engine/model/schema~Schema#isLimit limit element}
|
|
23
|
-
* boundary (a range must be rooted within one limit element).
|
|
24
|
-
* * Only {@link module:engine/model/schema~Schema#isSelectable selectable elements} can be selected from the outside
|
|
25
|
-
* (e.g. `[<paragraph>foo</paragraph>]` is invalid). This rule applies independently to both selection ends, so this
|
|
26
|
-
* selection is correct: `<paragraph>f[oo</paragraph><imageBlock></imageBlock>]`.
|
|
27
|
-
*
|
|
28
|
-
* If the position is not correct, the post-fixer will automatically correct it.
|
|
29
|
-
*
|
|
30
|
-
* ## Fixing a non-collapsed selection
|
|
31
|
-
*
|
|
32
|
-
* See as an example a selection that starts in a P1 element and ends inside the text of a TD element
|
|
33
|
-
* (`[` and `]` are range boundaries and `(l)` denotes an element defined as `isLimit=true`):
|
|
34
|
-
*
|
|
35
|
-
* ```
|
|
36
|
-
* root
|
|
37
|
-
* |- element P1
|
|
38
|
-
* | |- "foo" root
|
|
39
|
-
* |- element TABLE (l) P1 TABLE P2
|
|
40
|
-
* | |- element TR (l) f o[o TR TR b a r
|
|
41
|
-
* | | |- element TD (l) TD TD
|
|
42
|
-
* | | |- "aaa" a]a a b b b
|
|
43
|
-
* | |- element TR (l)
|
|
44
|
-
* | | |- element TD (l) ||
|
|
45
|
-
* | | |- "bbb" ||
|
|
46
|
-
* |- element P2 VV
|
|
47
|
-
* | |- "bar"
|
|
48
|
-
* root
|
|
49
|
-
* P1 TABLE] P2
|
|
50
|
-
* f o[o TR TR b a r
|
|
51
|
-
* TD TD
|
|
52
|
-
* a a a b b b
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* In the example above, the TABLE, TR and TD are defined as `isLimit=true` in the schema. The range which is not contained within
|
|
56
|
-
* a single limit element must be expanded to select the outermost limit element. The range end is inside the text node of the TD element.
|
|
57
|
-
* As the TD element is a child of the TR and TABLE elements, where both are defined as `isLimit=true` in the schema, the range must be
|
|
58
|
-
* expanded to select the whole TABLE element.
|
|
59
|
-
*
|
|
60
|
-
* **Note** If the selection contains multiple ranges, the method returns a minimal set of ranges that are not intersecting after expanding
|
|
61
|
-
* them to select `isLimit=true` elements.
|
|
62
|
-
*/
|
|
63
|
-
export declare function injectSelectionPostFixer(model: Model): void;
|
|
64
|
-
/**
|
|
65
|
-
* Tries fixing a range if it's incorrect.
|
|
66
|
-
*
|
|
67
|
-
* **Note:** This helper is used by the selection post-fixer and to fix the `beforeinput` target ranges.
|
|
68
|
-
*
|
|
69
|
-
* @returns Returns fixed range or null if range is valid.
|
|
70
|
-
*/
|
|
71
|
-
export declare function tryFixingRange(range: Range, schema: Schema): Range | null;
|
|
72
|
-
/**
|
|
73
|
-
* Returns a minimal non-intersecting array of ranges without duplicates.
|
|
74
|
-
*
|
|
75
|
-
* @param ranges Ranges to merge.
|
|
76
|
-
* @returns Array of unique and non-intersecting ranges.
|
|
77
|
-
*/
|
|
78
|
-
export declare function mergeIntersectingRanges(ranges: Array<Range>): Array<Range>;
|