@ckeditor/ckeditor5-engine 47.7.1 → 47.7.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-engine",
3
- "version": "47.7.1",
3
+ "version": "47.7.2",
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": "47.7.1",
27
+ "@ckeditor/ckeditor5-utils": "47.7.2",
28
28
  "es-toolkit": "1.39.5"
29
29
  },
30
30
  "author": "CKSource (http://cksource.com/)",
@@ -1332,7 +1332,8 @@ function changeAttribute(attributeCreator) {
1332
1332
  const viewElement = conversionApi.mapper.toViewElement(data.item);
1333
1333
  const viewWriter = conversionApi.writer;
1334
1334
  // If model item cannot be mapped to a view element, it means item is not an `Element` instance but a `ModelTextProxy` node.
1335
- // Only elements can have attributes in a view so do not proceed for anything else (#1587).
1335
+ // Only elements can have attributes in a view so do not proceed for anything else.
1336
+ // See https://github.com/ckeditor/ckeditor5-engine/issues/1587.
1336
1337
  if (!viewElement) {
1337
1338
  /**
1338
1339
  * This error occurs when a {@link module:engine/model/textproxy~ModelTextProxy text node's} attribute is to be downcasted
@@ -914,7 +914,7 @@ function setAttributeOn(modelRange, modelAttribute, shallow, conversionApi) {
914
914
  continue;
915
915
  }
916
916
  // Mark the node as consumed even if the attribute will not be updated because it's in a valid context (schema)
917
- // and would be converted if the attribute wouldn't be present. See #8921.
917
+ // and would be converted if the attribute wouldn't be present. See https://github.com/ckeditor/ckeditor5/issues/8921.
918
918
  result = true;
919
919
  // Do not override the attribute if it's already present.
920
920
  if (node.hasAttribute(modelAttribute.key)) {
@@ -284,7 +284,7 @@ export class ModelElement extends ModelNode {
284
284
  ModelElement.prototype.is = function (type, name) {
285
285
  if (!name) {
286
286
  return type === 'element' || type === 'model:element' ||
287
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
287
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
288
288
  type === 'node' || type === 'model:node';
289
289
  }
290
290
  return name === this.name && (type === 'element' || type === 'model:element');
@@ -63,7 +63,7 @@ export class ModelLivePosition extends /* #__PURE__ */ EmitterMixin(ModelPositio
63
63
  // Proper overload would interfere with that.
64
64
  ModelLivePosition.prototype.is = function (type) {
65
65
  return type === 'livePosition' || type === 'model:livePosition' ||
66
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
66
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
67
67
  type == 'position' || type === 'model:position';
68
68
  };
69
69
  /**
@@ -51,7 +51,7 @@ export class ModelLiveRange extends /* #__PURE__ */ EmitterMixin(ModelRange) {
51
51
  // Proper overload would interfere with that.
52
52
  ModelLiveRange.prototype.is = function (type) {
53
53
  return type === 'liveRange' || type === 'model:liveRange' ||
54
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
54
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
55
55
  type == 'range' || type === 'model:range';
56
56
  };
57
57
  /**
@@ -185,7 +185,8 @@ export class ModelPosition extends ModelTypeCheckable {
185
185
  * Node directly after this position. Returns `null` if this position is at the end of its parent, or if it is in a text node.
186
186
  */
187
187
  get nodeAfter() {
188
- // Cache the parent and reuse for performance reasons. See #6579 and #6582.
188
+ // Cache the parent and reuse for performance reasons.
189
+ // See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.
189
190
  const parent = this.parent;
190
191
  return getNodeAfterPosition(this, parent, getTextNodeAtPosition(this, parent));
191
192
  }
@@ -193,7 +194,8 @@ export class ModelPosition extends ModelTypeCheckable {
193
194
  * Node directly before this position. Returns `null` if this position is at the start of its parent, or if it is in a text node.
194
195
  */
195
196
  get nodeBefore() {
196
- // Cache the parent and reuse for performance reasons. See #6579 and #6582.
197
+ // Cache the parent and reuse for performance reasons.
198
+ // See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.
197
199
  const parent = this.parent;
198
200
  return getNodeBeforePosition(this, parent, getTextNodeAtPosition(this, parent));
199
201
  }
@@ -72,11 +72,11 @@ export class ModelRootElement extends ModelElement {
72
72
  ModelRootElement.prototype.is = function (type, name) {
73
73
  if (!name) {
74
74
  return type === 'rootElement' || type === 'model:rootElement' ||
75
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
75
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
76
76
  type === 'element' || type === 'model:element' ||
77
77
  type === 'node' || type === 'model:node';
78
78
  }
79
79
  return name === this.name && (type === 'rootElement' || type === 'model:rootElement' ||
80
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
80
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
81
81
  type === 'element' || type === 'model:element');
82
82
  };
package/src/model/text.js CHANGED
@@ -87,6 +87,6 @@ ModelText.prototype.is = function (type) {
87
87
  return type === '$text' || type === 'model:$text' ||
88
88
  // This are legacy values kept for backward compatibility.
89
89
  type === 'text' || type === 'model:text' ||
90
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
90
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
91
91
  type === 'node' || type === 'model:node';
92
92
  };
@@ -193,7 +193,8 @@ export class ModelTreeWalker {
193
193
  return { done: true, value: undefined };
194
194
  }
195
195
  // Get node just after the current position.
196
- // Use a highly optimized version instead of checking the text node first and then getting the node after. See #6582.
196
+ // Use a highly optimized version instead of checking the text node first and then getting the node after.
197
+ // See https://github.com/ckeditor/ckeditor5/issues/6582.
197
198
  const textNodeAtPosition = getTextNodeAtPosition(position, parent);
198
199
  const node = textNodeAtPosition || getNodeAfterPosition(position, parent, textNodeAtPosition);
199
200
  if (node && node.is('model:element')) {
@@ -256,7 +257,8 @@ export class ModelTreeWalker {
256
257
  return { done: true, value: undefined };
257
258
  }
258
259
  // Get node just before the current position.
259
- // Use a highly optimized version instead of checking the text node first and then getting the node before. See #6582.
260
+ // Use a highly optimized version instead of checking the text node first and then getting the node before.
261
+ // See https://github.com/ckeditor/ckeditor5/issues/6582.
260
262
  const positionParent = position.parent;
261
263
  const textNodeAtPosition = getTextNodeAtPosition(position, positionParent);
262
264
  const node = textNodeAtPosition || getNodeBeforePosition(position, positionParent, textNodeAtPosition);
@@ -178,13 +178,13 @@ export class ViewAttributeElement extends ViewElement {
178
178
  ViewAttributeElement.prototype.is = function (type, name) {
179
179
  if (!name) {
180
180
  return type === 'attributeElement' || type === 'view:attributeElement' ||
181
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
181
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
182
182
  type === 'element' || type === 'view:element' ||
183
183
  type === 'node' || type === 'view:node';
184
184
  }
185
185
  else {
186
186
  return name === this.name && (type === 'attributeElement' || type === 'view:attributeElement' ||
187
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
187
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
188
188
  type === 'element' || type === 'view:element');
189
189
  }
190
190
  };
@@ -58,13 +58,13 @@ export class ViewContainerElement extends ViewElement {
58
58
  ViewContainerElement.prototype.is = function (type, name) {
59
59
  if (!name) {
60
60
  return type === 'containerElement' || type === 'view:containerElement' ||
61
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
61
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
62
62
  type === 'element' || type === 'view:element' ||
63
63
  type === 'node' || type === 'view:node';
64
64
  }
65
65
  else {
66
66
  return name === this.name && (type === 'containerElement' || type === 'view:containerElement' ||
67
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
67
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
68
68
  type === 'element' || type === 'view:element');
69
69
  }
70
70
  };
@@ -76,7 +76,8 @@ ViewContainerElement.prototype.is = function (type, name) {
76
76
  export function getViewFillerOffset() {
77
77
  const children = [...this.getChildren()];
78
78
  const lastChild = children[this.childCount - 1];
79
- // Block filler is required after a `<br>` if it's the last element in its container. See #1422.
79
+ // Block filler is required after a `<br>` if it's the last element in its container.
80
+ // See https://github.com/ckeditor/ckeditor5-engine/issues/1422.
80
81
  if (lastChild && lastChild.is('element', 'br')) {
81
82
  return this.childCount;
82
83
  }
@@ -305,7 +305,7 @@ export class ViewDomConverter {
305
305
  domElement = this._domDocument.createComment(viewElementOrFragment.getCustomProperty('$rawContent'));
306
306
  }
307
307
  else {
308
- // UIElement has its own render() method (see #799).
308
+ // UIElement has its own render() method (see https://github.com/ckeditor/ckeditor5/issues/799).
309
309
  domElement = viewElementOrFragment.render(this._domDocument, this);
310
310
  }
311
311
  if (options.bind) {
@@ -1219,7 +1219,8 @@ export class ViewDomConverter {
1219
1219
  // Change all consecutive whitespace characters (from the [ \n\t\r] set –
1220
1220
  // see https://github.com/ckeditor/ckeditor5-engine/issues/822#issuecomment-311670249) to a single space character.
1221
1221
  // That's how multiple whitespaces are treated when rendered, so we normalize those whitespaces.
1222
- // We're replacing 1+ (and not 2+) to also normalize singular \n\t\r characters (#822).
1222
+ // We're replacing 1+ (and not 2+) to also normalize singular \n\t\r characters.
1223
+ // See https://github.com/ckeditor/ckeditor5/issues/822.
1223
1224
  data = node.data.replace(/[ \n\t\r]{1,}/g, ' ');
1224
1225
  nodeEndsWithSpace = /[^\S\u00A0]/.test(data.charAt(data.length - 1));
1225
1226
  const prevNode = i > 0 ? inlineNodes[i - 1] : null;
@@ -1241,7 +1242,8 @@ export class ViewDomConverter {
1241
1242
  // At the beginning and end of a block element, Firefox inserts normal space + <br> instead of non-breaking space.
1242
1243
  // This means that the text node starts/end with normal space instead of non-breaking space.
1243
1244
  // This causes a problem because the normal space would be removed in `.replace` calls above. To prevent that,
1244
- // the inline filler is removed only after the data is initially processed (by the `.replace` above). See ckeditor5#692.
1245
+ // the inline filler is removed only after the data is initially processed (by the `.replace` above).
1246
+ // See https://github.com/ckeditor/ckeditor5/issues/692.
1245
1247
  data = getDataWithoutFiller(data);
1246
1248
  // Block filler handling.
1247
1249
  if (this.blockFillerMode != 'br' && node.parent) {
@@ -60,14 +60,14 @@ export class ViewEditableElement extends /* #__PURE__ */ ObservableMixin(ViewCon
60
60
  ViewEditableElement.prototype.is = function (type, name) {
61
61
  if (!name) {
62
62
  return type === 'editableElement' || type === 'view:editableElement' ||
63
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
63
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
64
64
  type === 'containerElement' || type === 'view:containerElement' ||
65
65
  type === 'element' || type === 'view:element' ||
66
66
  type === 'node' || type === 'view:node';
67
67
  }
68
68
  else {
69
69
  return name === this.name && (type === 'editableElement' || type === 'view:editableElement' ||
70
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
70
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
71
71
  type === 'containerElement' || type === 'view:containerElement' ||
72
72
  type === 'element' || type === 'view:element');
73
73
  }
@@ -1007,7 +1007,7 @@ export class ViewElement extends ViewNode {
1007
1007
  ViewElement.prototype.is = function (type, name) {
1008
1008
  if (!name) {
1009
1009
  return type === 'element' || type === 'view:element' ||
1010
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
1010
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
1011
1011
  type === 'node' || type === 'view:node';
1012
1012
  }
1013
1013
  else {
@@ -66,7 +66,7 @@ export class ViewEmptyElement extends ViewElement {
66
66
  ViewEmptyElement.prototype.is = function (type, name) {
67
67
  if (!name) {
68
68
  return type === 'emptyElement' || type === 'view:emptyElement' ||
69
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
69
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
70
70
  type === 'element' || type === 'view:element' ||
71
71
  type === 'node' || type === 'view:node';
72
72
  }
@@ -168,7 +168,8 @@ export class MutationObserver extends Observer {
168
168
  mutations.push({ type: 'children', node: viewElement });
169
169
  }
170
170
  }
171
- // In case only non-relevant mutations were recorded it skips the event and force render (#5600).
171
+ // In case only non-relevant mutations were recorded it skips the event and force render.
172
+ // See https://github.com/ckeditor/ckeditor5/issues/5600.
172
173
  if (mutations.length) {
173
174
  // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {
174
175
  // @if CK_DEBUG_TYPING // _debouncedLine();
@@ -251,7 +251,7 @@ export class SelectionObserver extends Observer {
251
251
  if (this.selection.isEqual(newViewSelection) && this.domConverter.isDomSelectionCorrect(domSelection)) {
252
252
  return;
253
253
  }
254
- // Ensure we are not in the infinite loop (#400).
254
+ // Ensure we are not in the infinite loop (https://github.com/ckeditor/ckeditor5-engine/issues/400).
255
255
  // This counter is reset each second. 60 selection changes in 1 second is enough high number
256
256
  // to be very difficult (impossible) to achieve using just keyboard keys (during normal editor use).
257
257
  if (++this._loopbackCounter > 60) {
@@ -97,7 +97,7 @@ export class ViewRawElement extends ViewElement {
97
97
  ViewRawElement.prototype.is = function (type, name) {
98
98
  if (!name) {
99
99
  return type === 'rawElement' || type === 'view:rawElement' ||
100
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
100
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
101
101
  type === this.name || type === 'view:' + this.name ||
102
102
  type === 'element' || type === 'view:element' ||
103
103
  type === 'node' || type === 'view:node';
@@ -276,7 +276,8 @@ export class ViewRenderer extends /* #__PURE__ */ ObservableMixin() {
276
276
  const insertIndex = counter.equal + counter.insert;
277
277
  const deleteIndex = counter.equal + counter.delete;
278
278
  const viewChild = viewElement.getChild(insertIndex);
279
- // UIElement and RawElement are special cases. Their children are not stored in a view (#799)
279
+ // UIElement and RawElement are special cases. Their children are not stored in a view.
280
+ // See https://github.com/ckeditor/ckeditor5/issues/799.
280
281
  // so we cannot use them with replacing flow (since they use view children during rendering
281
282
  // which will always result in rendering empty elements).
282
283
  if (viewChild && !viewChild.is('uiElement') && !viewChild.is('rawElement')) {
@@ -306,12 +307,13 @@ export class ViewRenderer extends /* #__PURE__ */ ObservableMixin() {
306
307
  // Because we replace new view element mapping with the existing one, the corresponding DOM element
307
308
  // will not be rerendered. The new view element may have different attributes than the previous one.
308
309
  // Since its corresponding DOM element will not be rerendered, new attributes will not be added
309
- // to the DOM, so we need to mark it here to make sure its attributes gets updated. See #1427 for more
310
- // detailed case study.
310
+ // to the DOM, so we need to mark it here to make sure its attributes gets updated.
311
+ // See https://github.com/ckeditor/ckeditor5-engine/issues/1427 for more detailed case study.
311
312
  // Also there are cases where replaced element is removed from the view structure and then has
312
313
  // its attributes changed or removed. In such cases the element will not be present in `markedAttributes`
313
314
  // and also may be the same (`element.isSimilar()`) as the reused element not having its attributes updated.
314
- // To prevent such situations we always mark reused element to have its attributes rerenderd (#1560).
315
+ // To prevent such situations we always mark reused element to have its attributes rerenderd.
316
+ // See https://github.com/ckeditor/ckeditor5-engine/issues/1560.
315
317
  this.markedAttributes.add(viewElement);
316
318
  }
317
319
  /**
@@ -610,7 +612,8 @@ export class ViewRenderer extends /* #__PURE__ */ ObservableMixin() {
610
612
  i++;
611
613
  }
612
614
  else if (action === 'equal') {
613
- // Force updating text nodes inside elements which did not change and do not need to be re-rendered (#1125).
615
+ // Force updating text nodes inside elements which did not change and do not need to be re-rendered.
616
+ // See https://github.com/ckeditor/ckeditor5-engine/issues/1125.
614
617
  // Do it here (not in the loop above) because only after insertions the `i` index is correct.
615
618
  this._markDescendantTextToSync(this.domConverter.domToView(expectedDomChildren[i]));
616
619
  i++;
@@ -62,7 +62,7 @@ export class ViewRootEditableElement extends ViewEditableElement {
62
62
  ViewRootEditableElement.prototype.is = function (type, name) {
63
63
  if (!name) {
64
64
  return type === 'rootElement' || type === 'view:rootElement' ||
65
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
65
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
66
66
  type === 'editableElement' || type === 'view:editableElement' ||
67
67
  type === 'containerElement' || type === 'view:containerElement' ||
68
68
  type === 'element' || type === 'view:element' ||
@@ -70,7 +70,7 @@ ViewRootEditableElement.prototype.is = function (type, name) {
70
70
  }
71
71
  else {
72
72
  return name === this.name && (type === 'rootElement' || type === 'view:rootElement' ||
73
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
73
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
74
74
  type === 'editableElement' || type === 'view:editableElement' ||
75
75
  type === 'containerElement' || type === 'view:containerElement' ||
76
76
  type === 'element' || type === 'view:element');
package/src/view/text.js CHANGED
@@ -105,6 +105,6 @@ ViewText.prototype.is = function (type) {
105
105
  return type === '$text' || type === 'view:$text' ||
106
106
  // This are legacy values kept for backward compatibility.
107
107
  type === 'text' || type === 'view:text' ||
108
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
108
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
109
109
  type === 'node' || type === 'view:node';
110
110
  };
@@ -116,7 +116,7 @@ export class ViewUIElement extends ViewElement {
116
116
  ViewUIElement.prototype.is = function (type, name) {
117
117
  if (!name) {
118
118
  return type === 'uiElement' || type === 'view:uiElement' ||
119
- // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
119
+ // From super.is(). This is highly utilised method and cannot call super. See https://github.com/ckeditor/ckeditor5/issues/6529.
120
120
  type === 'element' || type === 'view:element' ||
121
121
  type === 'node' || type === 'view:node';
122
122
  }
@@ -3,7 +3,7 @@
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
 
6
- /* See ckeditor/ckeditor5#936. */
6
+ /* See https://github.com/ckeditor/ckeditor5/issues/936. */
7
7
  .ck.ck-placeholder,
8
8
  .ck .ck-placeholder {
9
9
  position: relative;
@@ -14,12 +14,12 @@
14
14
  right: 0;
15
15
  content: attr(data-placeholder);
16
16
 
17
- /* See ckeditor/ckeditor5#469. */
17
+ /* See https://github.com/ckeditor/ckeditor5/issues/469. */
18
18
  pointer-events: none;
19
19
  }
20
20
  }
21
21
 
22
- /* See ckeditor/ckeditor5#1987. */
22
+ /* See https://github.com/ckeditor/ckeditor5/issues/1987. */
23
23
  .ck.ck-read-only .ck-placeholder {
24
24
  &::before {
25
25
  display: none;