@syncfusion/ej2-richtexteditor 24.1.41 → 24.1.45

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.
@@ -16372,8 +16372,7 @@ class SelectionCommands {
16372
16372
  cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
16373
16373
  cursorNodes[0].innerHTML = '';
16374
16374
  }
16375
- if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' ||
16376
- cursorNodes[0].nextSibling.nodeName === 'BR')) {
16375
+ if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (isNullOrUndefined(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
16377
16376
  detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
16378
16377
  }
16379
16378
  cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
@@ -18800,7 +18799,8 @@ class ToolbarStatus {
18800
18799
  // eslint-disable-next-line
18801
18800
  const pattern = new RegExp(name, 'i');
18802
18801
  if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
18803
- (value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
18802
+ (value.split(',')[0] && !isNullOrUndefined(value.split(',')[0].trim().match(pattern)) &&
18803
+ value.split(',')[0].trim() === value.split(',')[0].trim().match(pattern)[0])) {
18804
18804
  index = pos;
18805
18805
  }
18806
18806
  }) && (index !== null)))) {
@@ -21283,8 +21283,11 @@ class PasteCleanup {
21283
21283
  tempDivElem.innerHTML = value;
21284
21284
  const isValueNotEmpty = tempDivElem.textContent !== '' || !isNullOrUndefined(tempDivElem.querySelector('img')) ||
21285
21285
  !isNullOrUndefined(tempDivElem.querySelector('table'));
21286
- this.parent.trigger(cleanupResizeElements, { value: value }, (args) => {
21287
- value = args.value;
21286
+ this.parent.notify(cleanupResizeElements, {
21287
+ value: value,
21288
+ callBack: (currentValue) => {
21289
+ value = currentValue;
21290
+ }
21288
21291
  });
21289
21292
  if (this.parent.pasteCleanupSettings.prompt) {
21290
21293
  if (isValueNotEmpty) {
@@ -34216,7 +34219,7 @@ let RichTextEditor = class RichTextEditor extends Component {
34216
34219
  }
34217
34220
  cleanupResizeElements(args) {
34218
34221
  const value = this.removeResizeElement(args.value);
34219
- return value;
34222
+ args.callBack(value);
34220
34223
  }
34221
34224
  removeResizeElement(value) {
34222
34225
  let valueElementWrapper = document.createElement("div");
@@ -34477,6 +34480,7 @@ let RichTextEditor = class RichTextEditor extends Component {
34477
34480
  }
34478
34481
  EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
34479
34482
  EventHandler.add(this.inputElement, 'paste', this.onPaste, this);
34483
+ EventHandler.add(this.inputElement, 'content-changed', this.contentChanged, this);
34480
34484
  EventHandler.add(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30), this);
34481
34485
  EventHandler.add(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler, this);
34482
34486
  this.wireContextEvent();
@@ -34539,6 +34543,7 @@ let RichTextEditor = class RichTextEditor extends Component {
34539
34543
  }
34540
34544
  EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
34541
34545
  EventHandler.remove(this.inputElement, 'paste', this.onPaste);
34546
+ EventHandler.remove(this.inputElement, 'content-changed', this.contentChanged);
34542
34547
  EventHandler.remove(this.inputElement, Browser.touchEndEvent, debounce(this.mouseUp, 30));
34543
34548
  EventHandler.remove(this.inputElement, Browser.touchStartEvent, this.mouseDownHandler);
34544
34549
  this.unWireContextEvent();