@syncfusion/ej2-richtexteditor 26.2.7 → 26.2.8

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.
@@ -5439,6 +5439,7 @@ var ToolbarRenderer = /** @__PURE__ @class */ (function () {
5439
5439
  openDelay: 400,
5440
5440
  opensOn: 'Hover',
5441
5441
  beforeRender: this.tooltipBeforeRender.bind(this),
5442
+ beforeOpen: this.tooltipBeforeOpen.bind(this),
5442
5443
  cssClass: this.parent.getCssClass(),
5443
5444
  windowCollision: true,
5444
5445
  position: 'BottomCenter'
@@ -6822,6 +6823,7 @@ var Image$1 = /** @__PURE__ @class */ (function () {
6822
6823
  if (this.parent.insertImageSettings.resize) {
6823
6824
  EventHandler.remove(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.resizeStart);
6824
6825
  this.parent.element.ownerDocument.removeEventListener('mousedown', this.docClick, true);
6826
+ this.docClick = null;
6825
6827
  EventHandler.remove(this.contentModule.getEditPanel(), 'cut', this.onCutHandler);
6826
6828
  EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
6827
6829
  }
@@ -9188,6 +9190,7 @@ var Audio = /** @__PURE__ @class */ (function () {
9188
9190
  EventHandler.remove(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.touchStart);
9189
9191
  EventHandler.remove(this.contentModule.getEditPanel(), Browser.touchEndEvent, this.audioClick);
9190
9192
  this.parent.element.ownerDocument.removeEventListener('mousedown', this.docClick, true);
9193
+ this.docClick = null;
9191
9194
  }
9192
9195
  };
9193
9196
  Audio.prototype.afterRender = function () {
@@ -10090,6 +10093,7 @@ var Video = /** @__PURE__ @class */ (function () {
10090
10093
  if (this.parent.insertVideoSettings.resize) {
10091
10094
  EventHandler.remove(this.parent.contentModule.getEditPanel(), Browser.touchStartEvent, this.resizeStart);
10092
10095
  this.parent.element.ownerDocument.removeEventListener('mousedown', this.docClick, true);
10096
+ this.docClick = null;
10093
10097
  EventHandler.remove(this.contentModule.getEditPanel(), 'cut', this.onCutHandler);
10094
10098
  EventHandler.remove(this.contentModule.getDocument(), Browser.touchMoveEvent, this.resizing);
10095
10099
  }
@@ -21994,7 +21998,9 @@ var Lists = /** @__PURE__ @class */ (function () {
21994
21998
  && (!isNullOrUndefined(closest(startNode, 'ul')) || !isNullOrUndefined(closest(startNode, 'ol')))
21995
21999
  && (!isNullOrUndefined(closest(endNode, 'ul')) || !isNullOrUndefined(closest(endNode, 'ol')))
21996
22000
  && ((commonAncestor.lastElementChild === closest(endNode, 'li') && commonAncestor.lastChild !== endNode)) && !range.collapsed) {
21997
- detach(commonAncestor);
22001
+ if (this.areAllListItemsSelected(commonAncestor, range)) {
22002
+ detach(commonAncestor);
22003
+ }
21998
22004
  }
21999
22005
  this.removeList(range, e);
22000
22006
  }
@@ -22665,6 +22671,18 @@ var Lists = /** @__PURE__ @class */ (function () {
22665
22671
  this.domNode = null;
22666
22672
  }
22667
22673
  };
22674
+ Lists.prototype.areAllListItemsSelected = function (list, range) {
22675
+ var listItems = list.querySelectorAll('li');
22676
+ for (var i = 0; i < listItems.length; i++) {
22677
+ var listItem = listItems[i];
22678
+ var listItemRange = this.parent.currentDocument.createRange();
22679
+ listItemRange.selectNodeContents(listItem);
22680
+ if (!range.intersectsNode(listItem)) {
22681
+ return false;
22682
+ }
22683
+ }
22684
+ return true;
22685
+ };
22668
22686
  return Lists;
22669
22687
  }());
22670
22688
 
@@ -23667,7 +23685,6 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
23667
23685
  return null;
23668
23686
  };
23669
23687
  InsertHtml.pasteInsertHTML = function (nodes, node, range, nodeSelection, nodeCutter, docElement, isCollapsed, closestParentNode, editNode, enterAction) {
23670
- var _this = this;
23671
23688
  var isCursor = range.startOffset === range.endOffset &&
23672
23689
  range.startContainer === range.endContainer;
23673
23690
  if (isCursor && range.startContainer === editNode && editNode.textContent === '') {
@@ -23746,6 +23763,9 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
23746
23763
  var rangeElement = closest(nearestAnchor, 'span');
23747
23764
  rangeElement.appendChild(tempSpan);
23748
23765
  }
23766
+ else if (nodes[0].nodeName === '#text' && nodes[0].nodeValue.includes('\u200B') && !isNullOrUndefined(nodes[0].parentElement) && !isNullOrUndefined(nodes[0].parentElement.previousElementSibling) && nodes[0].parentElement.previousElementSibling.classList.contains('e-mention-chip')) {
23767
+ range.startContainer.parentElement.insertAdjacentElement('afterend', tempSpan);
23768
+ }
23749
23769
  else {
23750
23770
  range.insertNode(tempSpan);
23751
23771
  }
@@ -23834,17 +23854,7 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
23834
23854
  else {
23835
23855
  this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
23836
23856
  }
23837
- var spanAligns = editNode.querySelectorAll('span[style*="text-align"]');
23838
- if (spanAligns.length > 0) {
23839
- spanAligns.forEach(function (spanAlign) {
23840
- if (!isNullOrUndefined(spanAlign)) {
23841
- var blockAlign = _this.getImmediateBlockNode(spanAlign, null);
23842
- if (blockAlign && blockAlign.textContent.trim() === spanAlign.textContent.trim()) {
23843
- blockAlign.style.textAlign = spanAlign.style.textAlign;
23844
- }
23845
- }
23846
- });
23847
- }
23857
+ this.alignCheck(editNode);
23848
23858
  };
23849
23859
  InsertHtml.placeCursorEnd = function (lastSelectionNode, node, nodeSelection, docElement, editNode) {
23850
23860
  lastSelectionNode = lastSelectionNode.nodeName === 'BR' ? (isNullOrUndefined(lastSelectionNode.previousSibling) ? lastSelectionNode.parentNode
@@ -24084,6 +24094,27 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
24084
24094
  }
24085
24095
  insertNode.classList.add('ignore-table');
24086
24096
  };
24097
+ InsertHtml.alignCheck = function (editNode) {
24098
+ var spanAligns = editNode.querySelectorAll('span[style*="text-align"]');
24099
+ for (var i = 0; i < spanAligns.length; i++) {
24100
+ var spanAlign = spanAligns[i];
24101
+ if (spanAlign) {
24102
+ var blockAlign = this.getImmediateBlockNode(spanAlign, null);
24103
+ if (blockAlign) {
24104
+ var totalSpanText = '';
24105
+ for (var j = 0; j < spanAligns.length; j++) {
24106
+ var span = spanAligns[j];
24107
+ if (blockAlign.contains(span)) {
24108
+ totalSpanText += span.textContent;
24109
+ }
24110
+ }
24111
+ if (blockAlign.textContent.trim() === totalSpanText.trim()) {
24112
+ blockAlign.style.textAlign = spanAlign.style.textAlign;
24113
+ }
24114
+ }
24115
+ }
24116
+ }
24117
+ };
24087
24118
  /**
24088
24119
  * Insert method
24089
24120
  *
@@ -36291,8 +36322,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
36291
36322
  */
36292
36323
  RichTextEditor.prototype.preRender = function () {
36293
36324
  this.initializeValue();
36294
- this.onBlurHandler = this.blurHandler.bind(this);
36295
- this.onFocusHandler = this.focusHandler.bind(this);
36296
36325
  this.clickPoints = { clientX: 0, clientY: 0 };
36297
36326
  this.initialValue = this.value;
36298
36327
  this.serviceLocator = new ServiceLocator;
@@ -36932,7 +36961,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
36932
36961
  this.inputElement.innerHTML = this.enterKey !== 'BR' ? '<' + this.enterKey + '><br></' + this.enterKey + '>' : '<br>';
36933
36962
  this.isSelectAll = false;
36934
36963
  }
36935
- if (selection.rangeCount > 0) {
36964
+ if (selection.rangeCount > 0 && this.contentModule.getDocument().activeElement.tagName !== 'INPUT' && this.inputElement.contains(this.contentModule.getDocument().activeElement)) {
36936
36965
  selection.removeAllRanges();
36937
36966
  selection.addRange(currentRange);
36938
36967
  }
@@ -38542,6 +38571,9 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
38542
38571
  }
38543
38572
  };
38544
38573
  RichTextEditor.prototype.wireEvents = function () {
38574
+ this.onResizeHandler = this.resizeHandler.bind(this);
38575
+ this.onBlurHandler = this.blurHandler.bind(this);
38576
+ this.onFocusHandler = this.focusHandler.bind(this);
38545
38577
  this.element.addEventListener('focusin', this.onFocusHandler, true);
38546
38578
  this.element.addEventListener('focusout', this.onBlurHandler, true);
38547
38579
  this.on(contentChanged, this.contentChanged, this);
@@ -38597,7 +38629,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
38597
38629
  EventHandler.add(this.inputElement, 'input', this.inputHandler, this);
38598
38630
  this.wireContextEvent();
38599
38631
  this.formatter.editorManager.observer.on(KEY_DOWN_HANDLER, this.editorKeyDown, this);
38600
- this.onResizeHandler = this.resizeHandler.bind(this);
38601
38632
  this.element.ownerDocument.defaultView.addEventListener('resize', this.onResizeHandler, true);
38602
38633
  if (this.iframeSettings.enable) {
38603
38634
  EventHandler.add(this.inputElement, 'focusin', this.focusHandler, this);