@syncfusion/ej2-richtexteditor 26.1.41 → 26.1.42

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.
@@ -1,4 +1,4 @@
1
- import { isNullOrUndefined, Browser, addClass, removeClass, selectAll as selectAll$1, createElement, detach, SanitizeHtmlHelper, extend, EventHandler, closest, getInstance, formatUnit, select, Ajax, Property, Event, NotifyPropertyChanges, Base, KeyboardEvents as KeyboardEvents$1, setStyleAttribute, getUniqueID, append, debounce, Observer, prepend, attributes, getComponent, getEnumValue, ChildProperty, Complex, remove, print, L10n, compile, Touch, Component } from '@syncfusion/ej2-base';
1
+ import { isNullOrUndefined, Browser, addClass, removeClass, selectAll as selectAll$1, createElement, detach, SanitizeHtmlHelper, extend, EventHandler, closest, getInstance, formatUnit, select, Ajax, Property, Event, NotifyPropertyChanges, Base, KeyboardEvents as KeyboardEvents$1, setStyleAttribute, getUniqueID, append, debounce, Observer, prepend, attributes, getComponent, getEnumValue, ChildProperty, Complex, print, L10n, compile, Touch, Component } from '@syncfusion/ej2-base';
2
2
  import { Toolbar as Toolbar$1 } from '@syncfusion/ej2-navigations';
3
3
  import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
4
4
  import { Tooltip, Popup, Dialog, isCollide, getScrollableParent } from '@syncfusion/ej2-popups';
@@ -20092,13 +20092,11 @@ var MarkdownParser = /** @__PURE__ @class */ (function () {
20092
20092
  this.observer.on(KEY_DOWN, this.editorKeyDown, this);
20093
20093
  this.observer.on(KEY_UP, this.editorKeyUp, this);
20094
20094
  this.observer.on(MODEL_CHANGED, this.onPropertyChanged, this);
20095
- this.observer.on(INTERNAL_DESTROY, this.destroy, this);
20096
20095
  };
20097
20096
  MarkdownParser.prototype.unwireEvents = function () {
20098
20097
  this.observer.off(KEY_DOWN, this.editorKeyDown);
20099
20098
  this.observer.off(KEY_UP, this.editorKeyUp);
20100
20099
  this.observer.off(MODEL_CHANGED, this.onPropertyChanged);
20101
- this.observer.off(INTERNAL_DESTROY, this.destroy);
20102
20100
  };
20103
20101
  MarkdownParser.prototype.onPropertyChanged = function (props) {
20104
20102
  this.observer.notify(MODEL_CHANGED_PLUGIN, props);
@@ -20161,6 +20159,7 @@ var MarkdownParser = /** @__PURE__ @class */ (function () {
20161
20159
  }
20162
20160
  };
20163
20161
  MarkdownParser.prototype.destroy = function () {
20162
+ this.observer.notify(INTERNAL_DESTROY, {});
20164
20163
  this.unwireEvents();
20165
20164
  };
20166
20165
  return MarkdownParser;
@@ -30948,7 +30947,9 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
30948
30947
  focusNode = currentChildNode[0];
30949
30948
  }
30950
30949
  }
30951
- this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusNode, pointer);
30950
+ if (range.startContainer !== focusNode) {
30951
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusNode, pointer);
30952
+ }
30952
30953
  }
30953
30954
  var currentElem = this.parent.inputElement.querySelector('.currentStartMark');
30954
30955
  if (!isNullOrUndefined(currentElem)) {
@@ -31272,6 +31273,7 @@ var HtmlEditor = /** @__PURE__ @class */ (function () {
31272
31273
  }
31273
31274
  else if (brNode) {
31274
31275
  detach(brNode);
31276
+ e.args.preventDefault();
31275
31277
  }
31276
31278
  if (!isNullOrUndefined(this.deleteRangeElement) && (this.deleteOldRangeElement.tagName !== 'OL' && this.deleteOldRangeElement.tagName !== 'UL')
31277
31279
  && this.deleteOldRangeElement !== this.deleteRangeElement) {
@@ -36163,6 +36165,7 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
36163
36165
  function RichTextEditor(options, element) {
36164
36166
  var _this = _super.call(this, options, element) || this;
36165
36167
  _this.needsID = true;
36168
+ _this.isSelectAll = false;
36166
36169
  return _this;
36167
36170
  }
36168
36171
  /**
@@ -36895,6 +36898,15 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
36895
36898
  if (!isNullOrUndefined(this.placeholder)) {
36896
36899
  this.setPlaceHolder();
36897
36900
  }
36901
+ if (!isNullOrUndefined(e) && !isNullOrUndefined(e.code) && (e.code === 'Backspace' || e.code === 'Delete')) {
36902
+ var range = this.contentModule.getDocument().getSelection().getRangeAt(0);
36903
+ var div = document.createElement('div');
36904
+ div.appendChild(range.cloneContents());
36905
+ var selectedHTML = div.innerHTML;
36906
+ if (selectedHTML === this.inputElement.innerHTML) {
36907
+ this.isSelectAll = true;
36908
+ }
36909
+ }
36898
36910
  };
36899
36911
  RichTextEditor.prototype.keyUp = function (e) {
36900
36912
  if (this.editorMode === 'HTML') {
@@ -36904,6 +36916,10 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
36904
36916
  var currentRange = this.getRange();
36905
36917
  var selection = this.iframeSettings.enable ? this.contentModule.getPanel().ownerDocument.getSelection() :
36906
36918
  this.contentModule.getDocument().getSelection();
36919
+ if (this.isSelectAll) {
36920
+ this.inputElement.innerHTML = this.enterKey !== 'BR' ? '<' + this.enterKey + '><br></' + this.enterKey + '>' : '<br>';
36921
+ this.isSelectAll = false;
36922
+ }
36907
36923
  if (selection.rangeCount > 0) {
36908
36924
  selection.removeAllRanges();
36909
36925
  selection.addRange(currentRange);
@@ -37199,7 +37215,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
37199
37215
  removeClass([this.element], CLS_RTE_HIDDEN);
37200
37216
  }
37201
37217
  else {
37202
- remove(this.inputElement);
37203
37218
  if (this.originalElement.innerHTML.trim() !== '') {
37204
37219
  this.element.innerHTML = this.originalElement.innerHTML.trim();
37205
37220
  this.setProperties({ value: (!isNullOrUndefined(this.initialValue) ? this.initialValue : null) }, true);
@@ -37223,9 +37238,6 @@ var RichTextEditor = /** @__PURE__ @class */ (function (_super) {
37223
37238
  }
37224
37239
  }
37225
37240
  }
37226
- if (this.inputElement) {
37227
- this.inputElement = null;
37228
- }
37229
37241
  if (this.rootContainer) {
37230
37242
  this.rootContainer = null;
37231
37243
  }