@syncfusion/ej2-richtexteditor 26.2.8 → 26.2.9

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.
@@ -26865,6 +26865,12 @@ var SelectionCommands = /** @__PURE__ @class */ (function () {
26865
26865
  if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNullOrUndefined(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
26866
26866
  detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
26867
26867
  }
26868
+ if (!isNullOrUndefined(cursorNodes[0].parentElement) && IsFormatted.inlineTags.
26869
+ indexOf((cursorNodes[0].parentElement).tagName.toLowerCase()) !== -1 && cursorNodes[0].textContent.includes('\u200B')) {
26870
+ var element = this.GetFormatNode(format, value);
26871
+ this.applyStyles(cursorNodes, 0, element);
26872
+ return cursorNodes[0];
26873
+ }
26868
26874
  cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
26869
26875
  }
26870
26876
  return cursorNode;
@@ -30935,7 +30941,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
30935
30941
  };
30936
30942
  HtmlEditor.prototype.onKeyUp = function (e) {
30937
30943
  var args = e.args;
30938
- var restrictKeys = [8, 9, 13, 16, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
30944
+ var restrictKeys = [8, 9, 13, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
30939
30945
  112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123];
30940
30946
  var range = this.parent.getRange();
30941
30947
  var regEx = new RegExp('\u200B', 'g');
@@ -30943,9 +30949,18 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
30943
30949
  range.startOffset === 1 && range.startContainer.textContent.length === 1 &&
30944
30950
  range.startContainer.textContent.charCodeAt(0) === 8203 &&
30945
30951
  range.startContainer.textContent.replace(regEx, '').length === 0;
30952
+ var isMention = false;
30953
+ if (range.startContainer === range.endContainer &&
30954
+ range.startOffset === range.endOffset && (range.startContainer !== this.parent.inputElement && range.startOffset !== 0)) {
30955
+ var mentionStartNode = range.startContainer.nodeType === 3 ?
30956
+ range.startContainer : range.startContainer.childNodes[range.startOffset - 1];
30957
+ isMention = args.keyCode === 16 &&
30958
+ mentionStartNode.textContent.charCodeAt(0) === 8203 &&
30959
+ !isNullOrUndefined(mentionStartNode.previousSibling) && mentionStartNode.previousSibling.contentEditable === 'false';
30960
+ }
30946
30961
  var pointer;
30947
30962
  var isRootParent = false;
30948
- if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey && !isEmptyNode) {
30963
+ if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey && !isEmptyNode && !isMention) {
30949
30964
  pointer = range.startOffset;
30950
30965
  var container = range.startContainer;
30951
30966
  // Check if the container is a text node and contains a zero-width space
@@ -36961,7 +36976,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
36961
36976
  this.inputElement.innerHTML = this.enterKey !== 'BR' ? '<' + this.enterKey + '><br></' + this.enterKey + '>' : '<br>';
36962
36977
  this.isSelectAll = false;
36963
36978
  }
36964
- if (selection.rangeCount > 0 && this.contentModule.getDocument().activeElement.tagName !== 'INPUT' && this.inputElement.contains(this.contentModule.getDocument().activeElement)) {
36979
+ if (selection.rangeCount > 0 && this.contentModule.getDocument().activeElement.tagName !== 'INPUT' && this.inputElement.contains(this.contentModule.getDocument().activeElement) && range.startContainer.innerHTML === '<br>' && range.startContainer.textContent === '') {
36965
36980
  selection.removeAllRanges();
36966
36981
  selection.addRange(currentRange);
36967
36982
  }
@@ -37224,6 +37239,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
37224
37239
  clearInterval(this.timeInterval);
37225
37240
  this.timeInterval = null;
37226
37241
  }
37242
+ if (!isNullOrUndefined(this.autoSaveTimeOut)) {
37243
+ clearTimeout(this.autoSaveTimeOut);
37244
+ this.autoSaveTimeOut = null;
37245
+ }
37227
37246
  if (!isNullOrUndefined(this.idleInterval)) {
37228
37247
  clearTimeout(this.idleInterval);
37229
37248
  this.idleInterval = null;
@@ -38258,7 +38277,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
38258
38277
  }
38259
38278
  this.preventDefaultResize(e);
38260
38279
  this.trigger('focus', { event: e, isInteracted: Object.keys(e).length === 0 ? false : true });
38261
- if (!isNullOrUndefined(this.saveInterval) && this.saveInterval > 0 && !this.autoSaveOnIdle) {
38280
+ if (!isNullOrUndefined(this.saveInterval) && this.saveInterval > 0 && !this.autoSaveOnIdle && isNullOrUndefined(this.timeInterval)) {
38262
38281
  this.timeInterval = setInterval(this.updateValueOnIdle.bind(this), this.saveInterval);
38263
38282
  }
38264
38283
  EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
@@ -38427,8 +38446,8 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
38427
38446
  RichTextEditor.prototype.contentChanged = function () {
38428
38447
  if (this.autoSaveOnIdle) {
38429
38448
  if (!isNullOrUndefined(this.saveInterval)) {
38430
- clearTimeout(this.timeInterval);
38431
- this.timeInterval = setTimeout(this.updateIntervalValue.bind(this), this.saveInterval);
38449
+ clearTimeout(this.autoSaveTimeOut);
38450
+ this.autoSaveTimeOut = setTimeout(this.updateIntervalValue.bind(this), this.saveInterval);
38432
38451
  }
38433
38452
  }
38434
38453
  };