@ckeditor/ckeditor5-engine 45.0.0 → 45.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +187 -84
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/controller/editingcontroller.js +1 -1
- package/src/conversion/conversion.d.ts +3 -0
- package/src/conversion/conversion.js +3 -0
- package/src/conversion/downcasthelpers.d.ts +2 -7
- package/src/conversion/downcasthelpers.js +8 -11
- package/src/dev-utils/utils.js +1 -0
- package/src/dev-utils/view.d.ts +1 -3
- package/src/dev-utils/view.js +1 -3
- package/src/model/documentselection.js +2 -2
- package/src/model/history.js +2 -1
- package/src/model/nodelist.js +2 -2
- package/src/model/operation/attributeoperation.js +5 -5
- package/src/model/operation/operation.d.ts +1 -1
- package/src/model/operation/operation.js +1 -1
- package/src/model/operation/rootattributeoperation.js +8 -10
- package/src/model/operation/transform.js +67 -10
- package/src/model/operation/utils.d.ts +1 -1
- package/src/model/operation/utils.js +1 -1
- package/src/model/position.js +7 -7
- package/src/model/range.d.ts +1 -1
- package/src/model/range.js +1 -1
- package/src/model/selection.js +2 -2
- package/src/model/utils/deletecontent.d.ts +13 -0
- package/src/model/utils/deletecontent.js +20 -1
- package/src/model/utils/insertcontent.d.ts +0 -1
- package/src/model/utils/insertcontent.js +2 -3
- package/src/model/utils/insertobject.d.ts +0 -1
- package/src/model/utils/insertobject.js +0 -1
- package/src/model/writer.d.ts +1 -1
- package/src/model/writer.js +2 -2
- package/src/view/domconverter.d.ts +5 -5
- package/src/view/domconverter.js +5 -5
- package/src/view/downcastwriter.d.ts +3 -2
- package/src/view/downcastwriter.js +3 -2
- package/src/view/editableelement.d.ts +1 -1
- package/src/view/editableelement.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/observer/compositionobserver.js +2 -2
- package/src/view/observer/inputobserver.js +29 -3
- package/src/view/position.js +3 -3
- package/src/view/renderer.js +8 -0
- package/src/view/textproxy.d.ts +1 -2
- package/src/view/textproxy.js +1 -2
package/dist/index.js
CHANGED
|
@@ -586,7 +586,7 @@ Text$1.prototype.is = function(type) {
|
|
|
586
586
|
*
|
|
587
587
|
* **Note:** `TextProxy` instances are created on the fly basing on the current state of parent {@link module:engine/view/text~Text}.
|
|
588
588
|
* Because of this it is highly unrecommended to store references to `TextProxy instances because they might get
|
|
589
|
-
* invalidated due to operations on Document. Also TextProxy is not a {@link module:engine/view/node~Node} so it
|
|
589
|
+
* invalidated due to operations on Document. Also TextProxy is not a {@link module:engine/view/node~Node} so it cannot be
|
|
590
590
|
* inserted as a child of {@link module:engine/view/element~Element}.
|
|
591
591
|
*
|
|
592
592
|
* `TextProxy` instances are created by {@link module:engine/view/treewalker~TreeWalker view tree walker}. You should not need to create
|
|
@@ -609,7 +609,6 @@ Text$1.prototype.is = function(type) {
|
|
|
609
609
|
* @param offsetInText Offset in {@link module:engine/view/textproxy~TextProxy#textNode text node}
|
|
610
610
|
* from which the text proxy starts.
|
|
611
611
|
* @param length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.
|
|
612
|
-
* @constructor
|
|
613
612
|
*/ constructor(textNode, offsetInText, length){
|
|
614
613
|
super();
|
|
615
614
|
this.textNode = textNode;
|
|
@@ -3731,7 +3730,7 @@ ContainerElement.prototype.is = function(type, name) {
|
|
|
3731
3730
|
* @internal
|
|
3732
3731
|
* @param document The document instance to which this element belongs.
|
|
3733
3732
|
* @param name Node name.
|
|
3734
|
-
* @param
|
|
3733
|
+
* @param attributes Collection of attributes.
|
|
3735
3734
|
* @param children A list of nodes to be inserted into created element.
|
|
3736
3735
|
*/ constructor(document, name, attributes, children){
|
|
3737
3736
|
super(document, name, attributes, children);
|
|
@@ -4435,10 +4434,10 @@ RootEditableElement.prototype.is = function(type, name) {
|
|
|
4435
4434
|
}
|
|
4436
4435
|
if (!item.parent) {
|
|
4437
4436
|
/**
|
|
4438
|
-
* You
|
|
4437
|
+
* You cannot make a position after a root.
|
|
4439
4438
|
*
|
|
4440
4439
|
* @error view-position-after-root
|
|
4441
|
-
* @param {module:engine/view/node~Node} root
|
|
4440
|
+
* @param {module:engine/view/node~Node} root A root item.
|
|
4442
4441
|
*/ throw new CKEditorError('view-position-after-root', item, {
|
|
4443
4442
|
root: item
|
|
4444
4443
|
});
|
|
@@ -4460,7 +4459,7 @@ RootEditableElement.prototype.is = function(type, name) {
|
|
|
4460
4459
|
* You cannot make a position before a root.
|
|
4461
4460
|
*
|
|
4462
4461
|
* @error view-position-before-root
|
|
4463
|
-
* @param {module:engine/view/node~Node} root
|
|
4462
|
+
* @param {module:engine/view/node~Node} root A root item.
|
|
4464
4463
|
*/ throw new CKEditorError('view-position-before-root', item, {
|
|
4465
4464
|
root: item
|
|
4466
4465
|
});
|
|
@@ -6153,7 +6152,7 @@ AttributeElement.prototype.is = function(type, name) {
|
|
|
6153
6152
|
* @internal
|
|
6154
6153
|
* @param document The document instance to which this element belongs.
|
|
6155
6154
|
* @param name Node name.
|
|
6156
|
-
* @param
|
|
6155
|
+
* @param attributes Collection of attributes.
|
|
6157
6156
|
* @param children A list of nodes to be inserted into created element.
|
|
6158
6157
|
*/ constructor(document, name, attributes, children){
|
|
6159
6158
|
super(document, name, attributes, children);
|
|
@@ -6697,7 +6696,8 @@ DocumentFragment$1.prototype.is = function(type) {
|
|
|
6697
6696
|
* The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
|
|
6698
6697
|
* parameters.
|
|
6699
6698
|
*
|
|
6700
|
-
* @param
|
|
6699
|
+
* @param itemOrPosition
|
|
6700
|
+
* @param offset Offset or one of the flags. Used only when the first parameter is a {@link module:engine/view/item~Item view item}.
|
|
6701
6701
|
*/ setSelectionFocus(itemOrPosition, offset) {
|
|
6702
6702
|
this.document.selection._setFocus(itemOrPosition, offset);
|
|
6703
6703
|
}
|
|
@@ -7504,7 +7504,7 @@ DocumentFragment$1.prototype.is = function(type) {
|
|
|
7504
7504
|
* conversionApi.writer.insert( viewPosition, viewSlot );
|
|
7505
7505
|
* ```
|
|
7506
7506
|
*
|
|
7507
|
-
* While providing a filtered slot, make sure to provide slots for all child nodes. A single node
|
|
7507
|
+
* While providing a filtered slot, make sure to provide slots for all child nodes. A single node cannot be downcasted into
|
|
7508
7508
|
* multiple slots.
|
|
7509
7509
|
*
|
|
7510
7510
|
* **Note**: You should not change the order of nodes. View elements should be in the same order as model nodes.
|
|
@@ -8136,7 +8136,7 @@ const validNodesToInsert = [
|
|
|
8136
8136
|
* * Block filler is an element which fill block elements, like `<p>`. CKEditor uses `<br>` as a block filler during the editing,
|
|
8137
8137
|
* as browsers do natively. So instead of an empty `<p>` there will be `<p><br></p>`. The advantage of block filler is that
|
|
8138
8138
|
* it is transparent for the selection, so when the caret is before the `<br>` and user presses right arrow he will be
|
|
8139
|
-
* moved to the next paragraph, not after the `<br>`. The disadvantage is that it breaks a block, so it
|
|
8139
|
+
* moved to the next paragraph, not after the `<br>`. The disadvantage is that it breaks a block, so it cannot be used
|
|
8140
8140
|
* in the middle of a line of text. The {@link module:engine/view/filler~BR_FILLER `<br>` filler} can be replaced with any other
|
|
8141
8141
|
* character in the data output, for instance {@link module:engine/view/filler~NBSP_FILLER non-breaking space} or
|
|
8142
8142
|
* {@link module:engine/view/filler~MARKED_NBSP_FILLER marked non-breaking space}.
|
|
@@ -8597,6 +8597,14 @@ const validNodesToInsert = [
|
|
|
8597
8597
|
const domFillerNode = this._inlineFiller;
|
|
8598
8598
|
// Something weird happened and the stored node doesn't contain the filler's text.
|
|
8599
8599
|
if (!startsWithFiller(domFillerNode)) {
|
|
8600
|
+
// @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {
|
|
8601
|
+
// @if CK_DEBUG_TYPING // console.log( ..._buildLogMessage( this, 'Renderer',
|
|
8602
|
+
// @if CK_DEBUG_TYPING // 'Inline filler node: ' +
|
|
8603
|
+
// @if CK_DEBUG_TYPING // `%c${ _escapeTextNodeData( domFillerNode.data ) }%c (${ domFillerNode.data.length })`,
|
|
8604
|
+
// @if CK_DEBUG_TYPING // 'color: blue',
|
|
8605
|
+
// @if CK_DEBUG_TYPING // ''
|
|
8606
|
+
// @if CK_DEBUG_TYPING // ) );
|
|
8607
|
+
// @if CK_DEBUG_TYPING // }
|
|
8600
8608
|
/**
|
|
8601
8609
|
* The inline filler node was lost. Most likely, something overwrote the filler text node
|
|
8602
8610
|
* in the DOM.
|
|
@@ -9966,7 +9974,7 @@ const UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE = 'data-ck-unsafe-element';
|
|
|
9966
9974
|
}
|
|
9967
9975
|
/**
|
|
9968
9976
|
* Converts DOM Range to view {@link module:engine/view/range~Range}.
|
|
9969
|
-
* If the start or end position
|
|
9977
|
+
* If the start or end position cannot be converted `null` is returned.
|
|
9970
9978
|
*
|
|
9971
9979
|
* @param domRange DOM range.
|
|
9972
9980
|
* @returns View range.
|
|
@@ -10246,7 +10254,7 @@ const UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE = 'data-ck-unsafe-element';
|
|
|
10246
10254
|
/**
|
|
10247
10255
|
* Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.
|
|
10248
10256
|
*
|
|
10249
|
-
* @param
|
|
10257
|
+
* @param selection Selection instance to check.
|
|
10250
10258
|
*/ isDomSelectionBackward(selection) {
|
|
10251
10259
|
if (selection.isCollapsed) {
|
|
10252
10260
|
return false;
|
|
@@ -10888,9 +10896,9 @@ const UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE = 'data-ck-unsafe-element';
|
|
|
10888
10896
|
* ```
|
|
10889
10897
|
*
|
|
10890
10898
|
* @error domconverter-unsafe-attribute-detected
|
|
10891
|
-
* @param domElement The DOM element the attribute was set on.
|
|
10892
|
-
* @param key The original name of the attribute
|
|
10893
|
-
* @param value The value of the original attribute
|
|
10899
|
+
* @param {HTMLElement} domElement The DOM element the attribute was set on.
|
|
10900
|
+
* @param {string} key The original name of the attribute
|
|
10901
|
+
* @param {string} value The value of the original attribute
|
|
10894
10902
|
*/
|
|
10895
10903
|
|
|
10896
10904
|
/**
|
|
@@ -11861,8 +11869,6 @@ function sameNodes(child1, child2) {
|
|
|
11861
11869
|
// @if CK_DEBUG_TYPING // ) );
|
|
11862
11870
|
// @if CK_DEBUG_TYPING // }
|
|
11863
11871
|
document.isComposing = true;
|
|
11864
|
-
}, {
|
|
11865
|
-
priority: 'low'
|
|
11866
11872
|
});
|
|
11867
11873
|
document.on('compositionend', ()=>{
|
|
11868
11874
|
// @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {
|
|
@@ -11872,8 +11878,6 @@ function sameNodes(child1, child2) {
|
|
|
11872
11878
|
// @if CK_DEBUG_TYPING // ) );
|
|
11873
11879
|
// @if CK_DEBUG_TYPING // }
|
|
11874
11880
|
document.isComposing = false;
|
|
11875
|
-
}, {
|
|
11876
|
-
priority: 'low'
|
|
11877
11881
|
});
|
|
11878
11882
|
}
|
|
11879
11883
|
/**
|
|
@@ -12004,7 +12008,7 @@ function getFiles(nativeDataTransfer) {
|
|
|
12004
12008
|
// @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {
|
|
12005
12009
|
// @if CK_DEBUG_TYPING // _debouncedLine();
|
|
12006
12010
|
// @if CK_DEBUG_TYPING // console.group( ..._buildLogMessage( this, 'InputObserver',
|
|
12007
|
-
// @if CK_DEBUG_TYPING // `${ domEvent.type }: ${ domEvent.inputType }
|
|
12011
|
+
// @if CK_DEBUG_TYPING // `${ domEvent.type }: ${ domEvent.inputType } - ${ domEvent.isComposing ? 'is' : 'not' } composing`,
|
|
12008
12012
|
// @if CK_DEBUG_TYPING // ) );
|
|
12009
12013
|
// @if CK_DEBUG_TYPING // }
|
|
12010
12014
|
const domTargetRanges = domEvent.getTargetRanges();
|
|
@@ -12040,6 +12044,8 @@ function getFiles(nativeDataTransfer) {
|
|
|
12040
12044
|
if (viewDocument.selection.isFake) {
|
|
12041
12045
|
// Future-proof: in case of multi-range fake selections being possible.
|
|
12042
12046
|
targetRanges = Array.from(viewDocument.selection.getRanges());
|
|
12047
|
+
// Do not allow typing inside a fake selection container, we will handle it manually.
|
|
12048
|
+
domEvent.preventDefault();
|
|
12043
12049
|
// @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {
|
|
12044
12050
|
// @if CK_DEBUG_TYPING // console.info( ..._buildLogMessage( this, 'InputObserver',
|
|
12045
12051
|
// @if CK_DEBUG_TYPING // '%cusing fake selection:',
|
|
@@ -12054,8 +12060,34 @@ function getFiles(nativeDataTransfer) {
|
|
|
12054
12060
|
// We try to fall back to collapsed range at the valid end position.
|
|
12055
12061
|
// See https://github.com/ckeditor/ckeditor5/issues/14411.
|
|
12056
12062
|
// See https://github.com/ckeditor/ckeditor5/issues/14050.
|
|
12057
|
-
|
|
12063
|
+
let viewStart = view.domConverter.domPositionToView(domRange.startContainer, domRange.startOffset);
|
|
12058
12064
|
const viewEnd = view.domConverter.domPositionToView(domRange.endContainer, domRange.endOffset);
|
|
12065
|
+
// When text replacement is enabled and browser tries to replace double space with dot, and space,
|
|
12066
|
+
// but the first space is no longer where browser put it (it was moved to an attribute element),
|
|
12067
|
+
// then we must extend the target range so it does not include a part of an inline filler.
|
|
12068
|
+
if (viewStart && startsWithFiller(domRange.startContainer) && domRange.startOffset < INLINE_FILLER_LENGTH) {
|
|
12069
|
+
// @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {
|
|
12070
|
+
// @if CK_DEBUG_TYPING // console.info( ..._buildLogMessage( this, 'InputObserver',
|
|
12071
|
+
// @if CK_DEBUG_TYPING // 'Target range starts in an inline filler - adjusting it',
|
|
12072
|
+
// @if CK_DEBUG_TYPING // ) );
|
|
12073
|
+
// @if CK_DEBUG_TYPING // }
|
|
12074
|
+
domEvent.preventDefault();
|
|
12075
|
+
let count = INLINE_FILLER_LENGTH - domRange.startOffset;
|
|
12076
|
+
viewStart = viewStart.getLastMatchingPosition((value)=>{
|
|
12077
|
+
// Ignore attribute and UI elements but stop on container elements.
|
|
12078
|
+
if (value.item.is('attributeElement') || value.item.is('uiElement')) {
|
|
12079
|
+
return true;
|
|
12080
|
+
}
|
|
12081
|
+
// Skip as many characters as inline filler was overlapped.
|
|
12082
|
+
if (value.item.is('$textProxy') && count--) {
|
|
12083
|
+
return true;
|
|
12084
|
+
}
|
|
12085
|
+
return false;
|
|
12086
|
+
}, {
|
|
12087
|
+
direction: 'backward',
|
|
12088
|
+
singleCharacters: true
|
|
12089
|
+
});
|
|
12090
|
+
}
|
|
12059
12091
|
if (viewStart) {
|
|
12060
12092
|
return view.createRange(viewStart, viewEnd);
|
|
12061
12093
|
} else if (viewEnd) {
|
|
@@ -12099,7 +12131,10 @@ function getFiles(nativeDataTransfer) {
|
|
|
12099
12131
|
}
|
|
12100
12132
|
// Normalize the insertText data that includes new-line characters.
|
|
12101
12133
|
// https://github.com/ckeditor/ckeditor5/issues/2045.
|
|
12102
|
-
if (
|
|
12134
|
+
if ([
|
|
12135
|
+
'insertText',
|
|
12136
|
+
'insertReplacementText'
|
|
12137
|
+
].includes(domEvent.inputType) && data && data.includes('\n')) {
|
|
12103
12138
|
// There might be a single new-line or double for new paragraph, but we translate
|
|
12104
12139
|
// it to paragraphs as it is our default action for enter handling.
|
|
12105
12140
|
const parts = data.split(/\n{1,2}/g);
|
|
@@ -13295,7 +13330,7 @@ function formatReturnValue(type, item, previousPosition, nextPosition, length) {
|
|
|
13295
13330
|
* Position path must be an array with at least one item.
|
|
13296
13331
|
*
|
|
13297
13332
|
* @error model-position-path-incorrect-format
|
|
13298
|
-
* @param path
|
|
13333
|
+
* @param {Array.<number>} path A path to the position.
|
|
13299
13334
|
*/ throw new CKEditorError('model-position-path-incorrect-format', root, {
|
|
13300
13335
|
path
|
|
13301
13336
|
});
|
|
@@ -13351,7 +13386,7 @@ function formatReturnValue(type, item, previousPosition, nextPosition, length) {
|
|
|
13351
13386
|
* the {@glink framework/architecture/editing-engine#indexes-and-offsets Editing engine architecture} guide.
|
|
13352
13387
|
*
|
|
13353
13388
|
* @error model-position-path-incorrect
|
|
13354
|
-
* @param position The incorrect position.
|
|
13389
|
+
* @param {module:engine/model/position~Position} position The incorrect position.
|
|
13355
13390
|
*/ throw new CKEditorError('model-position-path-incorrect', this, {
|
|
13356
13391
|
position: this
|
|
13357
13392
|
});
|
|
@@ -13975,10 +14010,10 @@ function formatReturnValue(type, item, previousPosition, nextPosition, length) {
|
|
|
13975
14010
|
*/ static _createAfter(item, stickiness) {
|
|
13976
14011
|
if (!item.parent) {
|
|
13977
14012
|
/**
|
|
13978
|
-
* You
|
|
14013
|
+
* You cannot make a position after a root element.
|
|
13979
14014
|
*
|
|
13980
14015
|
* @error model-position-after-root
|
|
13981
|
-
* @param root
|
|
14016
|
+
* @param {module:engine/model/rootelement~RootElement} root The root element..
|
|
13982
14017
|
*/ throw new CKEditorError('model-position-after-root', [
|
|
13983
14018
|
this,
|
|
13984
14019
|
item
|
|
@@ -13997,10 +14032,10 @@ function formatReturnValue(type, item, previousPosition, nextPosition, length) {
|
|
|
13997
14032
|
*/ static _createBefore(item, stickiness) {
|
|
13998
14033
|
if (!item.parent) {
|
|
13999
14034
|
/**
|
|
14000
|
-
* You
|
|
14035
|
+
* You cannot make a position before a root element.
|
|
14001
14036
|
*
|
|
14002
14037
|
* @error model-position-before-root
|
|
14003
|
-
* @param root
|
|
14038
|
+
* @param {module:engine/model/rootelement~RootElement} root The root element..
|
|
14004
14039
|
*/ throw new CKEditorError('model-position-before-root', item, {
|
|
14005
14040
|
root: item
|
|
14006
14041
|
});
|
|
@@ -14024,7 +14059,7 @@ function formatReturnValue(type, item, previousPosition, nextPosition, length) {
|
|
|
14024
14059
|
* Cannot create position for document. Root with specified name does not exist.
|
|
14025
14060
|
*
|
|
14026
14061
|
* @error model-position-fromjson-no-root
|
|
14027
|
-
* @param rootName
|
|
14062
|
+
* @param {string} rootName The root name.
|
|
14028
14063
|
*/ throw new CKEditorError('model-position-fromjson-no-root', doc, {
|
|
14029
14064
|
rootName: json.root
|
|
14030
14065
|
});
|
|
@@ -14898,7 +14933,7 @@ Position.prototype.is = function(type) {
|
|
|
14898
14933
|
* If the deleted range contains transformed range, `null` will be returned.
|
|
14899
14934
|
*
|
|
14900
14935
|
* @internal
|
|
14901
|
-
* @param
|
|
14936
|
+
* @param deletePosition Position from which nodes are removed.
|
|
14902
14937
|
* @param howMany How many nodes are removed.
|
|
14903
14938
|
* @returns Result of the transformation.
|
|
14904
14939
|
*/ _getTransformedByDeletion(deletePosition, howMany) {
|
|
@@ -17795,8 +17830,8 @@ Node$1.prototype.is = function(type) {
|
|
|
17795
17830
|
* Trying to add a range that intersects with another range in the selection.
|
|
17796
17831
|
*
|
|
17797
17832
|
* @error model-selection-range-intersects
|
|
17798
|
-
* @param addedRange Range that was added to the selection.
|
|
17799
|
-
* @param intersectingRange Range in the selection that intersects with `addedRange`.
|
|
17833
|
+
* @param {module:engine/model/range~Range} addedRange Range that was added to the selection.
|
|
17834
|
+
* @param {module:engine/model/range~Range} intersectingRange Range in the selection that intersects with `addedRange`.
|
|
17800
17835
|
*/ throw new CKEditorError('model-selection-range-intersects', [
|
|
17801
17836
|
this,
|
|
17802
17837
|
range
|
|
@@ -18696,7 +18731,7 @@ DocumentSelection.prototype.is = function(type) {
|
|
|
18696
18731
|
* UID obtained from the {@link module:engine/model/writer~Writer#overrideSelectionGravity} to restore.
|
|
18697
18732
|
*
|
|
18698
18733
|
* @error document-selection-gravity-wrong-restore
|
|
18699
|
-
* @param uid The unique identifier returned by
|
|
18734
|
+
* @param {string} uid The unique identifier returned by
|
|
18700
18735
|
* {@link module:engine/model/documentselection~DocumentSelection#_overrideGravity}.
|
|
18701
18736
|
*/ throw new CKEditorError('document-selection-gravity-wrong-restore', this, {
|
|
18702
18737
|
uid
|
|
@@ -18734,7 +18769,7 @@ DocumentSelection.prototype.is = function(type) {
|
|
|
18734
18769
|
* starts or ends at incorrect position.
|
|
18735
18770
|
*
|
|
18736
18771
|
* @error document-selection-wrong-position
|
|
18737
|
-
* @param range
|
|
18772
|
+
* @param {module:engine/model/range~Range} range The invalid range.
|
|
18738
18773
|
*/ throw new CKEditorError('document-selection-wrong-position', this, {
|
|
18739
18774
|
range
|
|
18740
18775
|
});
|
|
@@ -19189,8 +19224,8 @@ DocumentSelection.prototype.is = function(type) {
|
|
|
19189
19224
|
* Given offset cannot be found in the node list.
|
|
19190
19225
|
*
|
|
19191
19226
|
* @error model-nodelist-offset-out-of-bounds
|
|
19192
|
-
* @param offset
|
|
19193
|
-
* @param nodeList Stringified node list.
|
|
19227
|
+
* @param {number} offset The offset value.
|
|
19228
|
+
* @param {module:engine/model/nodelist~NodeList} nodeList Stringified node list.
|
|
19194
19229
|
*/ throw new CKEditorError('model-nodelist-offset-out-of-bounds', this, {
|
|
19195
19230
|
offset,
|
|
19196
19231
|
nodeList: this
|
|
@@ -19765,13 +19800,10 @@ function cloneNodes(nodes) {
|
|
|
19765
19800
|
*
|
|
19766
19801
|
* @param config Conversion configuration.
|
|
19767
19802
|
* @param config.model The description or a name of the model element to convert.
|
|
19768
|
-
* @param config.model.attributes The list of attribute names that should be consumed while creating
|
|
19769
|
-
* the view element. Note that the view will be reconverted if any of the listed attributes changes.
|
|
19770
|
-
* @param config.model.children Specifies whether the view element requires reconversion if the list
|
|
19771
|
-
* of the model child nodes changed.
|
|
19772
19803
|
* @param config.view A view element definition or a function that takes the model element and
|
|
19773
19804
|
* {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}
|
|
19774
19805
|
* as parameters and returns a view container element.
|
|
19806
|
+
* @param config.converterPriority Converter priority.
|
|
19775
19807
|
*/ elementToElement(config) {
|
|
19776
19808
|
return this.add(downcastElementToElement(config));
|
|
19777
19809
|
}
|
|
@@ -19879,12 +19911,10 @@ function cloneNodes(nodes) {
|
|
|
19879
19911
|
*
|
|
19880
19912
|
* @param config Conversion configuration.
|
|
19881
19913
|
* @param config.model The description or a name of the model element to convert.
|
|
19882
|
-
* @param config.model.name The name of the model element to convert.
|
|
19883
|
-
* @param config.model.attributes The list of attribute names that should be consumed while creating
|
|
19884
|
-
* the view structure. Note that the view will be reconverted if any of the listed attributes will change.
|
|
19885
19914
|
* @param config.view A function that takes the model element and
|
|
19886
19915
|
* {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters
|
|
19887
19916
|
* and returns a view container element with slots for model child nodes to be converted into.
|
|
19917
|
+
* @param config.converterPriority Converter priority.
|
|
19888
19918
|
*/ elementToStructure(config) {
|
|
19889
19919
|
return this.add(downcastElementToStructure(config));
|
|
19890
19920
|
}
|
|
@@ -20939,6 +20969,7 @@ function cloneNodes(nodes) {
|
|
|
20939
20969
|
* ```
|
|
20940
20970
|
*
|
|
20941
20971
|
* @error conversion-attribute-to-attribute-on-text
|
|
20972
|
+
* @param {object} data The conversion data.
|
|
20942
20973
|
*/ throw new CKEditorError('conversion-attribute-to-attribute-on-text', conversionApi.dispatcher, data);
|
|
20943
20974
|
}
|
|
20944
20975
|
// First remove the old attribute if there was one.
|
|
@@ -21189,7 +21220,7 @@ function cloneNodes(nodes) {
|
|
|
21189
21220
|
* ```
|
|
21190
21221
|
*
|
|
21191
21222
|
* @error conversion-element-to-structure-disallowed-text
|
|
21192
|
-
* @param {
|
|
21223
|
+
* @param {string} elementName The name of the element the structure is to be created for.
|
|
21193
21224
|
*/ throw new CKEditorError('conversion-element-to-structure-disallowed-text', dispatcher, {
|
|
21194
21225
|
elementName: model.name
|
|
21195
21226
|
});
|
|
@@ -21590,9 +21621,9 @@ function getFromAttributeCreator(config) {
|
|
|
21590
21621
|
};
|
|
21591
21622
|
}
|
|
21592
21623
|
/**
|
|
21593
|
-
* Creates a function that
|
|
21624
|
+
* Creates a function that creates view slots.
|
|
21594
21625
|
*
|
|
21595
|
-
* @returns Function exposed by writer as createSlot()
|
|
21626
|
+
* @returns Function exposed by the writer as `createSlot()`.
|
|
21596
21627
|
*/ function createSlotFactory(element, slotsMap, conversionApi) {
|
|
21597
21628
|
return (writer, modeOrFilter)=>{
|
|
21598
21629
|
const slot = writer.createContainerElement('$slot');
|
|
@@ -21603,9 +21634,10 @@ function getFromAttributeCreator(config) {
|
|
|
21603
21634
|
children = Array.from(element.getChildren()).filter((element)=>modeOrFilter(element));
|
|
21604
21635
|
} else {
|
|
21605
21636
|
/**
|
|
21606
|
-
* Unknown slot mode was provided to `writer.createSlot()` in downcast converter.
|
|
21637
|
+
* Unknown slot mode was provided to `writer.createSlot()` in the downcast converter.
|
|
21607
21638
|
*
|
|
21608
21639
|
* @error conversion-slot-mode-unknown
|
|
21640
|
+
* @param {never} modeOrFilter The specified mode or filter.
|
|
21609
21641
|
*/ throw new CKEditorError('conversion-slot-mode-unknown', conversionApi.dispatcher, {
|
|
21610
21642
|
modeOrFilter
|
|
21611
21643
|
});
|
|
@@ -23131,7 +23163,7 @@ function getFromAttributeCreator(config) {
|
|
|
23131
23163
|
* The marker with the provided name does not exist and cannot be reconverted.
|
|
23132
23164
|
*
|
|
23133
23165
|
* @error editingcontroller-reconvertmarker-marker-not-exist
|
|
23134
|
-
* @param {
|
|
23166
|
+
* @param {string} markerName The name of the reconverted marker.
|
|
23135
23167
|
*/ throw new CKEditorError('editingcontroller-reconvertmarker-marker-not-exist', this, {
|
|
23136
23168
|
markerName
|
|
23137
23169
|
});
|
|
@@ -26248,7 +26280,10 @@ function removeDisallowedAttributeFromNode(schema, node, writer) {
|
|
|
26248
26280
|
/**
|
|
26249
26281
|
* Creates and caches conversion helpers for given dispatchers group.
|
|
26250
26282
|
*
|
|
26283
|
+
* @param options Group name.
|
|
26251
26284
|
* @param options.name Group name.
|
|
26285
|
+
* @param options.dispatchers Dispatchers to register.
|
|
26286
|
+
* @param options.isDowncast Whether downcast group.
|
|
26252
26287
|
*/ _createConversionHelpers({ name, dispatchers, isDowncast }) {
|
|
26253
26288
|
if (this._helpers.has(name)) {
|
|
26254
26289
|
/**
|
|
@@ -26468,7 +26503,7 @@ function* _getUpcastDefinition(model, view, upcastAlso) {
|
|
|
26468
26503
|
* Creates `Operation` object from deserialized object, i.e. from parsed JSON string.
|
|
26469
26504
|
*
|
|
26470
26505
|
* @param json Deserialized JSON object.
|
|
26471
|
-
* @param
|
|
26506
|
+
* @param document Document on which this operation will be applied.
|
|
26472
26507
|
*/ static fromJSON(json, document) {
|
|
26473
26508
|
return new this(json.baseVersion);
|
|
26474
26509
|
}
|
|
@@ -26479,7 +26514,7 @@ function* _getUpcastDefinition(model, view, upcastAlso) {
|
|
|
26479
26514
|
*
|
|
26480
26515
|
* @internal
|
|
26481
26516
|
* @param position Position at which nodes should be inserted.
|
|
26482
|
-
* @param
|
|
26517
|
+
* @param nodes Nodes to insert.
|
|
26483
26518
|
* @returns Range spanning over inserted elements.
|
|
26484
26519
|
*/ function _insert(position, nodes) {
|
|
26485
26520
|
const normalizedNodes = _normalizeNodes(nodes);
|
|
@@ -27478,9 +27513,9 @@ class MarkerOperation extends Operation {
|
|
|
27478
27513
|
* Changed node has different attribute value than operation's old attribute value.
|
|
27479
27514
|
*
|
|
27480
27515
|
* @error attribute-operation-wrong-old-value
|
|
27481
|
-
* @param item
|
|
27482
|
-
* @param key
|
|
27483
|
-
* @param value
|
|
27516
|
+
* @param {module:engine/model/item~Item} root The item element.
|
|
27517
|
+
* @param {string} key The key of the attribute.
|
|
27518
|
+
* @param {never} value The value.
|
|
27484
27519
|
*/ throw new CKEditorError('attribute-operation-wrong-old-value', this, {
|
|
27485
27520
|
item,
|
|
27486
27521
|
key: this.key,
|
|
@@ -27492,8 +27527,8 @@ class MarkerOperation extends Operation {
|
|
|
27492
27527
|
* The attribute with given key already exists for the given node.
|
|
27493
27528
|
*
|
|
27494
27529
|
* @error attribute-operation-attribute-exists
|
|
27495
|
-
* @param
|
|
27496
|
-
* @param key
|
|
27530
|
+
* @param {module:engine/model/item~Item} root The item element.
|
|
27531
|
+
* @param {string} key The key of the attribute.
|
|
27497
27532
|
*/ throw new CKEditorError('attribute-operation-attribute-exists', this, {
|
|
27498
27533
|
node: item,
|
|
27499
27534
|
key: this.key
|
|
@@ -27740,9 +27775,8 @@ class MarkerOperation extends Operation {
|
|
|
27740
27775
|
* The element to change is not a root element.
|
|
27741
27776
|
*
|
|
27742
27777
|
* @error rootattribute-operation-not-a-root
|
|
27743
|
-
* @param root
|
|
27744
|
-
* @param key
|
|
27745
|
-
* @param value
|
|
27778
|
+
* @param {module:engine/model/rootelement~RootElement} root The root element.
|
|
27779
|
+
* @param {string} key The key of the attribute.
|
|
27746
27780
|
*/ throw new CKEditorError('rootattribute-operation-not-a-root', this, {
|
|
27747
27781
|
root: this.root,
|
|
27748
27782
|
key: this.key
|
|
@@ -27753,9 +27787,8 @@ class MarkerOperation extends Operation {
|
|
|
27753
27787
|
* The attribute which should be removed does not exist for the given node.
|
|
27754
27788
|
*
|
|
27755
27789
|
* @error rootattribute-operation-wrong-old-value
|
|
27756
|
-
* @param root
|
|
27757
|
-
* @param key
|
|
27758
|
-
* @param value
|
|
27790
|
+
* @param {module:engine/model/rootelement~RootElement} root The root element.
|
|
27791
|
+
* @param {string} key The key of the attribute.
|
|
27759
27792
|
*/ throw new CKEditorError('rootattribute-operation-wrong-old-value', this, {
|
|
27760
27793
|
root: this.root,
|
|
27761
27794
|
key: this.key
|
|
@@ -27766,8 +27799,8 @@ class MarkerOperation extends Operation {
|
|
|
27766
27799
|
* The attribute with given key already exists for the given node.
|
|
27767
27800
|
*
|
|
27768
27801
|
* @error rootattribute-operation-attribute-exists
|
|
27769
|
-
* @param root
|
|
27770
|
-
* @param key
|
|
27802
|
+
* @param {module:engine/model/rootelement~RootElement} root The root element.
|
|
27803
|
+
* @param {string} key The key of the attribute.
|
|
27771
27804
|
*/ throw new CKEditorError('rootattribute-operation-attribute-exists', this, {
|
|
27772
27805
|
root: this.root,
|
|
27773
27806
|
key: this.key
|
|
@@ -27804,10 +27837,10 @@ class MarkerOperation extends Operation {
|
|
|
27804
27837
|
*/ static fromJSON(json, document) {
|
|
27805
27838
|
if (!document.getRoot(json.root)) {
|
|
27806
27839
|
/**
|
|
27807
|
-
* Cannot create RootAttributeOperation for document. Root with specified name does not exist.
|
|
27840
|
+
* Cannot create RootAttributeOperation for document. Root with the specified name does not exist.
|
|
27808
27841
|
*
|
|
27809
27842
|
* @error rootattribute-operation-fromjson-no-root
|
|
27810
|
-
* @param rootName
|
|
27843
|
+
* @param {string} rootName The root name.
|
|
27811
27844
|
*/ throw new CKEditorError('rootattribute-operation-fromjson-no-root', this, {
|
|
27812
27845
|
rootName: json.root
|
|
27813
27846
|
});
|
|
@@ -28959,19 +28992,74 @@ setTransformation(MarkerOperation, SplitOperation, (a, b, context)=>{
|
|
|
28959
28992
|
}
|
|
28960
28993
|
if (a.newRange) {
|
|
28961
28994
|
if (context.abRelation) {
|
|
28995
|
+
// If we have context, it means that there was previously a merge operation which transformed this marker operation, and that
|
|
28996
|
+
// merge operation was then undone, and this split operation should reverse the marker to state before the merge operation.
|
|
28962
28997
|
const aNewRange = a.newRange._getTransformedBySplitOperation(b);
|
|
28963
|
-
if (a.newRange.start.isEqual(b.splitPosition)
|
|
28964
|
-
|
|
28965
|
-
|
|
28966
|
-
|
|
28998
|
+
if (a.newRange.start.isEqual(b.splitPosition)) {
|
|
28999
|
+
// If marker range start is same as split position, we need to decide where marker start should be placed, as there
|
|
29000
|
+
// are three possible options.
|
|
29001
|
+
//
|
|
29002
|
+
if (context.abRelation.wasStartBeforeMergedElement) {
|
|
29003
|
+
// If the marker start was initially before the merged element, move it back to that place.
|
|
29004
|
+
//
|
|
29005
|
+
// <p>Foo</p>[<p>Bar]</p> -- merge -> <p>Foo[Bar]</p> -- default split -> <p>Foo</p><p>[Bar]</p>
|
|
29006
|
+
// <p>Foo</p>[<p>Bar]</p> -- merge -> <p>Foo[Bar]</p> --- fixed split --> <p>Foo</p>[<p>Bar]</p>
|
|
29007
|
+
//
|
|
29008
|
+
a.newRange.start = Position._createAt(b.insertionPosition);
|
|
29009
|
+
} else if (context.abRelation.wasInLeftElement) {
|
|
29010
|
+
// If the marker start was initially in the "left" element, keep the start position there.
|
|
29011
|
+
//
|
|
29012
|
+
// <p>Foo[</p><p>Bar]</p> -- merge -> <p>Foo[Bar]</p> -- default split -> <p>Foo</p><p>[Bar]</p>
|
|
29013
|
+
// <p>Foo[</p><p>Bar]</p> -- merge -> <p>Foo[Bar]</p> --- fixed split --> <p>Foo[</p><p>Bar]</p>
|
|
29014
|
+
//
|
|
29015
|
+
a.newRange.start = Position._createAt(a.newRange.start);
|
|
29016
|
+
} else {
|
|
29017
|
+
// Finally, the start position must have been at the beginning of the "right" (merged) element.
|
|
29018
|
+
// In this case, move it back to the "right" element.
|
|
29019
|
+
//
|
|
29020
|
+
// Note, that this what the default transformation (`_getTransformedBySplitOperation()`) does, BUT ONLY for
|
|
29021
|
+
// a non-collapsed marker. For a collapsed marker, by default, the whole marker is kept at the split position,
|
|
29022
|
+
// which would be incorrect. This is why this case is needed, and why we don't use `aNewRange.start` here.
|
|
29023
|
+
//
|
|
29024
|
+
// <p>Foo</p><p>[]Bar</p> -- merge -> <p>Foo[]Bar</p> -- default split -> <p>Foo[]</p><p>Bar</p>
|
|
29025
|
+
// <p>Foo</p><p>[]Bar</p> -- merge -> <p>Foo[]Bar</p> --- fixed split --> <p>Foo</p><p>[]Bar</p>
|
|
29026
|
+
//
|
|
29027
|
+
a.newRange.start = Position._createAt(b.moveTargetPosition);
|
|
29028
|
+
}
|
|
28967
29029
|
} else {
|
|
29030
|
+
// If marker range start is not the same as split position, simply use the default transformation, as there is no
|
|
29031
|
+
// ambiguity in this case.
|
|
28968
29032
|
a.newRange.start = aNewRange.start;
|
|
28969
29033
|
}
|
|
28970
|
-
if (a.newRange.end.isEqual(b.splitPosition)
|
|
28971
|
-
|
|
28972
|
-
|
|
28973
|
-
|
|
29034
|
+
if (a.newRange.end.isEqual(b.splitPosition)) {
|
|
29035
|
+
// If marker range end is same as split position, we need to decide where marker end should be placed, as there
|
|
29036
|
+
// are three possible options.
|
|
29037
|
+
//
|
|
29038
|
+
if (a.newRange.end.isEqual(b.splitPosition) && context.abRelation.wasEndBeforeMergedElement) {
|
|
29039
|
+
// If the marker end was initially before the merged element, move it back to that place.
|
|
29040
|
+
//
|
|
29041
|
+
// <p>[Foo</p>]<p>Bar</p> -- merge -> <p>[Foo]Bar</p> -- default split -> <p>[Foo]</p><p>Bar</p>
|
|
29042
|
+
// <p>[Foo</p>]<p>Bar</p> -- merge -> <p>[Foo]Bar</p> --- fixed split --> <p>[Foo</p>]<p>Bar</p>
|
|
29043
|
+
//
|
|
29044
|
+
a.newRange.end = Position._createAt(b.insertionPosition);
|
|
29045
|
+
} else if (context.abRelation.wasInRightElement) {
|
|
29046
|
+
// If the marker was initially in the "right" element, keep the end position there.
|
|
29047
|
+
//
|
|
29048
|
+
// <p>[Foo</p><p>]Bar</p> -- merge -> <p>[Foo]Bar</p> -- default split -> <p>[Foo]</p><p>Bar</p>
|
|
29049
|
+
// <p>[Foo</p><p>]Bar</p> -- merge -> <p>[Foo]Bar</p> --- fixed split --> <p>[Foo</p><p>]Bar</p>
|
|
29050
|
+
//
|
|
29051
|
+
a.newRange.end = Position._createAt(b.moveTargetPosition);
|
|
29052
|
+
} else {
|
|
29053
|
+
// Finally, the end position must have been at the end of the "left" (merged) element.
|
|
29054
|
+
// In this case, keep it where it is.
|
|
29055
|
+
//
|
|
29056
|
+
// Note, that this is what the default transformation does, so we could use `aNewRange.end`, but this is more clear.
|
|
29057
|
+
//
|
|
29058
|
+
a.newRange.end = Position._createAt(a.newRange.end);
|
|
29059
|
+
}
|
|
28974
29060
|
} else {
|
|
29061
|
+
// If marker range end is not the same as split position, simply use the default transformation, as there is no
|
|
29062
|
+
// ambiguity in this case.
|
|
28975
29063
|
a.newRange.end = aNewRange.end;
|
|
28976
29064
|
}
|
|
28977
29065
|
return [
|
|
@@ -31603,7 +31691,8 @@ LivePosition.prototype.is = function(type) {
|
|
|
31603
31691
|
* Only operations with matching versions can be added to the history.
|
|
31604
31692
|
*
|
|
31605
31693
|
* @error model-document-history-addoperation-incorrect-version
|
|
31606
|
-
* @param
|
|
31694
|
+
* @param {module:engine/model/operation/operation~Operation} operation The current operation.
|
|
31695
|
+
* @param {number} historyVersion The current document history version.
|
|
31607
31696
|
*/ throw new CKEditorError('model-document-history-addoperation-incorrect-version', this, {
|
|
31608
31697
|
operation,
|
|
31609
31698
|
historyVersion: this.version
|
|
@@ -33225,7 +33314,7 @@ DocumentFragment.prototype.is = function(type) {
|
|
|
33225
33314
|
*
|
|
33226
33315
|
* Note that items can be moved only within the same tree. It means that you can move items within the same root
|
|
33227
33316
|
* (element or document fragment) or between {@link module:engine/model/document~Document#roots documents roots},
|
|
33228
|
-
* but you
|
|
33317
|
+
* but you cannot move items from document fragment to the document or from one detached element to another. Use
|
|
33229
33318
|
* {@link module:engine/model/writer~Writer#insert} in such cases.
|
|
33230
33319
|
*
|
|
33231
33320
|
* @param range Source range.
|
|
@@ -33430,7 +33519,7 @@ DocumentFragment.prototype.is = function(type) {
|
|
|
33430
33519
|
let splitElement = position.parent;
|
|
33431
33520
|
if (!splitElement.parent) {
|
|
33432
33521
|
/**
|
|
33433
|
-
* Element with no parent
|
|
33522
|
+
* Element with no parent cannot be split.
|
|
33434
33523
|
*
|
|
33435
33524
|
* @error writer-split-element-no-parent
|
|
33436
33525
|
*/ throw new CKEditorError('writer-split-element-no-parent', this);
|
|
@@ -34150,6 +34239,18 @@ DocumentFragment.prototype.is = function(type) {
|
|
|
34150
34239
|
* **Note:** If there is no valid position for the selection, the paragraph will always be created:
|
|
34151
34240
|
*
|
|
34152
34241
|
* `[<imageBlock src="foo.jpg"></imageBlock>]` -> `<paragraph>[]</paragraph>`.
|
|
34242
|
+
*
|
|
34243
|
+
* @param options.doNotFixSelection Whether given selection-to-remove should be fixed if it ends at the beginning of an element.
|
|
34244
|
+
*
|
|
34245
|
+
* By default, `deleteContent()` will fix selection before performing a deletion, so that the selection does not end at the beginning of
|
|
34246
|
+
* an element. For example, selection `<heading>[Heading</heading><paragraph>]Some text.</paragraph>` will be treated as it was
|
|
34247
|
+
* `<heading>[Heading]</heading><paragraph>Some text.</paragraph>`. As a result, the elements will not get merged.
|
|
34248
|
+
*
|
|
34249
|
+
* If selection is as in example, visually, the next element (paragraph) is not selected and it may be confusing for the user that
|
|
34250
|
+
* the elements got merged. Selection is set up like this by browsers when a user triple-clicks on some text.
|
|
34251
|
+
*
|
|
34252
|
+
* However, in some cases, it is expected to remove content exactly as selected in the selection, without any fixing. In these cases,
|
|
34253
|
+
* this flag can be set to `true`, which will prevent fixing the selection.
|
|
34153
34254
|
*/ function deleteContent(model, selection, options = {}) {
|
|
34154
34255
|
if (selection.isCollapsed) {
|
|
34155
34256
|
return;
|
|
@@ -34176,7 +34277,13 @@ DocumentFragment.prototype.is = function(type) {
|
|
|
34176
34277
|
}
|
|
34177
34278
|
}
|
|
34178
34279
|
// Get the live positions for the range adjusted to span only blocks selected from the user perspective.
|
|
34179
|
-
|
|
34280
|
+
let startPosition, endPosition;
|
|
34281
|
+
if (!options.doNotFixSelection) {
|
|
34282
|
+
[startPosition, endPosition] = getLivePositionsForSelectedBlocks(selRange);
|
|
34283
|
+
} else {
|
|
34284
|
+
startPosition = LivePosition.fromPosition(selRange.start, 'toPrevious');
|
|
34285
|
+
endPosition = LivePosition.fromPosition(selRange.end, 'toNext');
|
|
34286
|
+
}
|
|
34180
34287
|
// 2. Remove the content if there is any.
|
|
34181
34288
|
if (!startPosition.isTouching(endPosition)) {
|
|
34182
34289
|
writer.remove(writer.createRange(startPosition, endPosition));
|
|
@@ -34737,7 +34844,6 @@ function removeRangeContent(range, writer) {
|
|
|
34737
34844
|
* @param model The model in context of which the insertion should be performed.
|
|
34738
34845
|
* @param content The content to insert.
|
|
34739
34846
|
* @param selectable Selection into which the content should be inserted.
|
|
34740
|
-
* @param placeOrOffset Sets place or offset of the selection.
|
|
34741
34847
|
* @returns Range which contains all the performed changes. This is a range that, if removed,
|
|
34742
34848
|
* would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed
|
|
34743
34849
|
* at the insertion position.
|
|
@@ -35075,8 +35181,8 @@ function removeRangeContent(range, writer) {
|
|
|
35075
35181
|
* Given node cannot be inserted on the given position.
|
|
35076
35182
|
*
|
|
35077
35183
|
* @error insertcontent-wrong-position
|
|
35078
|
-
* @param node Node to insert.
|
|
35079
|
-
* @param position Position to insert the node at.
|
|
35184
|
+
* @param {module:engine/model/node~Node} node Node to insert.
|
|
35185
|
+
* @param {module:engine/model/position~Position} position Position to insert the node at.
|
|
35080
35186
|
*/ throw new CKEditorError('insertcontent-wrong-position', this, {
|
|
35081
35187
|
node,
|
|
35082
35188
|
position: this.position
|
|
@@ -35367,7 +35473,6 @@ function removeRangeContent(range, writer) {
|
|
|
35367
35473
|
* @param object An object to be inserted into the model document.
|
|
35368
35474
|
* @param selectable A selectable where the content should be inserted. If not specified, the current
|
|
35369
35475
|
* {@link module:engine/model/document~Document#selection document selection} will be used instead.
|
|
35370
|
-
* @param placeOrOffset Specifies the exact place or offset for the insertion to take place, relative to `selectable`.
|
|
35371
35476
|
* @param options Additional options.
|
|
35372
35477
|
* @param options.findOptimalPosition An option that, when set, adjusts the insertion position (relative to
|
|
35373
35478
|
* `selectable` and `placeOrOffset`) so that the content of `selectable` is not split upon insertion (a.k.a. non-destructive insertion).
|
|
@@ -37820,6 +37925,7 @@ const domConverterStub = {
|
|
|
37820
37925
|
/**
|
|
37821
37926
|
* Writes the content of the {@link module:engine/view/document~Document document} to an HTML-like string.
|
|
37822
37927
|
*
|
|
37928
|
+
* @param view The view to stringify.
|
|
37823
37929
|
* @param options.withoutSelection Whether to write the selection. When set to `true`, the selection will
|
|
37824
37930
|
* not be included in the returned string.
|
|
37825
37931
|
* @param options.rootName The name of the root from which the data should be stringified. If not provided,
|
|
@@ -37828,8 +37934,6 @@ const domConverterStub = {
|
|
|
37828
37934
|
* instead of `<p>`, `<attribute:b>` instead of `<b>` and `<empty:img>` instead of `<img>`).
|
|
37829
37935
|
* @param options.showPriority When set to `true`, the attribute element's priority will be printed
|
|
37830
37936
|
* (`<span view-priority="12">`, `<b view-priority="10">`).
|
|
37831
|
-
* @param options.showAttributeElementId When set to `true`, the attribute element's ID will be printed
|
|
37832
|
-
* (`<span id="marker:foo">`).
|
|
37833
37937
|
* @param options.renderUIElements When set to `true`, the inner content of each
|
|
37834
37938
|
* {@link module:engine/view/uielement~UIElement} will be printed.
|
|
37835
37939
|
* @param options.renderRawElements When set to `true`, the inner content of each
|
|
@@ -38122,7 +38226,6 @@ setData$1._parse = parse$1;
|
|
|
38122
38226
|
* this node will be used as the root for all parsed nodes.
|
|
38123
38227
|
* @param options.sameSelectionCharacters When set to `false`, the selection inside the text should be marked using
|
|
38124
38228
|
* `{` and `}` and the selection outside the ext using `[` and `]`. When set to `true`, both should be marked with `[` and `]` only.
|
|
38125
|
-
* @param options.stylesProcessor Styles processor.
|
|
38126
38229
|
* @returns Returns the parsed view node or an object with two fields: `view` and `selection` when selection ranges were included in the
|
|
38127
38230
|
* data to parse.
|
|
38128
38231
|
*/ function parse$1(data, options = {}) {
|