@syncfusion/ej2-richtexteditor 20.2.43 → 20.2.44

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.
Files changed (42) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  3. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-richtexteditor.es2015.js +114 -34
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +114 -34
  7. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  8. package/dist/global/ej2-richtexteditor.min.js +2 -2
  9. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +8 -8
  12. package/src/editor-manager/plugin/lists.d.ts +3 -0
  13. package/src/editor-manager/plugin/lists.js +29 -0
  14. package/src/rich-text-editor/actions/base-toolbar.d.ts +6 -1
  15. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +6 -1
  16. package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
  17. package/src/rich-text-editor/actions/enter-key.js +7 -1
  18. package/src/rich-text-editor/actions/full-screen.d.ts +1 -0
  19. package/src/rich-text-editor/actions/full-screen.js +5 -0
  20. package/src/rich-text-editor/actions/markdown-editor.d.ts +1 -0
  21. package/src/rich-text-editor/actions/markdown-editor.js +6 -0
  22. package/src/rich-text-editor/actions/quick-toolbar.d.ts +1 -0
  23. package/src/rich-text-editor/actions/quick-toolbar.js +5 -0
  24. package/src/rich-text-editor/actions/toolbar-action.d.ts +6 -1
  25. package/src/rich-text-editor/actions/toolbar.d.ts +1 -0
  26. package/src/rich-text-editor/actions/toolbar.js +8 -0
  27. package/src/rich-text-editor/base/constant.d.ts +5 -0
  28. package/src/rich-text-editor/base/constant.js +5 -0
  29. package/src/rich-text-editor/base/rich-text-editor.js +7 -12
  30. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +3 -0
  31. package/src/rich-text-editor/renderer/dialog-renderer.js +18 -0
  32. package/src/rich-text-editor/renderer/image-module.d.ts +1 -8
  33. package/src/rich-text-editor/renderer/image-module.js +9 -9
  34. package/src/rich-text-editor/renderer/link-module.d.ts +1 -8
  35. package/src/rich-text-editor/renderer/link-module.js +2 -7
  36. package/src/rich-text-editor/renderer/render.d.ts +1 -6
  37. package/src/rich-text-editor/renderer/render.js +2 -5
  38. package/src/rich-text-editor/renderer/table-module.d.ts +1 -0
  39. package/src/rich-text-editor/renderer/table-module.js +5 -0
  40. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +6 -1
  41. package/src/rich-text-editor/renderer/view-source.d.ts +1 -0
  42. package/src/rich-text-editor/renderer/view-source.js +5 -0
@@ -444,6 +444,11 @@ const checkUndo = 'checkUndoStack';
444
444
  * @deprecated
445
445
  */
446
446
  const readOnlyMode = 'readOnlyMode';
447
+ /**
448
+ * @hidden
449
+ * @deprecated
450
+ */
451
+ const moduleDestroy = 'moduleDestroy';
447
452
  /**
448
453
  * @hidden
449
454
  * @deprecated
@@ -4657,6 +4662,12 @@ class Toolbar$2 {
4657
4662
  }
4658
4663
  }
4659
4664
  }
4665
+ moduleDestroy() {
4666
+ this.parent = null;
4667
+ this.baseToolbar.parent = null;
4668
+ this.toolbarActionModule.parent = null;
4669
+ this.dropDownModule.parent = null;
4670
+ }
4660
4671
  scrollHandler(e) {
4661
4672
  if (!this.parent.inlineMode.enable) {
4662
4673
  if (this.parent.toolbarSettings.enableFloating && this.getDOMVisibility(this.tbElement)) {
@@ -4758,6 +4769,7 @@ class Toolbar$2 {
4758
4769
  this.parent.on(mouseDown, this.mouseDownHandler, this);
4759
4770
  this.parent.on(sourceCodeMouseDown, this.mouseDownHandler, this);
4760
4771
  this.parent.on(bindCssClass, this.setCssClass, this);
4772
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
4761
4773
  if (!this.parent.inlineMode.enable && !isIDevice()) {
4762
4774
  this.parent.on(toolbarClick, this.toolbarClickHandler, this);
4763
4775
  }
@@ -4782,6 +4794,7 @@ class Toolbar$2 {
4782
4794
  this.parent.off(mouseDown, this.mouseDownHandler);
4783
4795
  this.parent.off(sourceCodeMouseDown, this.mouseDownHandler);
4784
4796
  this.parent.off(bindCssClass, this.setCssClass);
4797
+ this.parent.off(moduleDestroy, this.moduleDestroy);
4785
4798
  if (!this.parent.inlineMode.enable && !isIDevice()) {
4786
4799
  this.parent.off(toolbarClick, this.toolbarClickHandler);
4787
4800
  }
@@ -6062,6 +6075,9 @@ class QuickToolbar {
6062
6075
  }
6063
6076
  this.removeEventListener();
6064
6077
  }
6078
+ moduleDestroy() {
6079
+ this.parent = null;
6080
+ }
6065
6081
  wireInlineQTBarEvents() {
6066
6082
  this.parent.on(mouseUp, this.mouseUpHandler, this);
6067
6083
  this.parent.on(mouseDown, this.inlineQTBarMouseDownHandler, this);
@@ -6117,6 +6133,7 @@ class QuickToolbar {
6117
6133
  this.parent.on(keyDown, this.onKeyDown, this);
6118
6134
  this.parent.on(rtlMode, this.setRtl, this);
6119
6135
  this.parent.on(bindCssClass, this.setCssClass, this);
6136
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
6120
6137
  }
6121
6138
  onKeyDown(e) {
6122
6139
  const args = e.args;
@@ -6186,6 +6203,7 @@ class QuickToolbar {
6186
6203
  this.parent.off(keyDown, this.onKeyDown);
6187
6204
  this.parent.off(rtlMode, this.setRtl);
6188
6205
  this.parent.off(bindCssClass, this.setCssClass);
6206
+ this.parent.off(moduleDestroy, this.moduleDestroy);
6189
6207
  }
6190
6208
  /**
6191
6209
  * Called internally if any of the property value changed.
@@ -9272,6 +9290,10 @@ class MarkdownEditor {
9272
9290
  destroy() {
9273
9291
  this.removeEventListener();
9274
9292
  }
9293
+ moduleDestroy() {
9294
+ this.parent = null;
9295
+ this.toolbarUpdate.parent = null;
9296
+ }
9275
9297
  addEventListener() {
9276
9298
  if (this.parent.isDestroyed) {
9277
9299
  return;
@@ -9287,6 +9309,7 @@ class MarkdownEditor {
9287
9309
  this.parent.on(selectionSave, this.onSelectionSave, this);
9288
9310
  this.parent.on(selectionRestore, this.onSelectionRestore, this);
9289
9311
  this.parent.on(readOnlyMode, this.updateReadOnly, this);
9312
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
9290
9313
  }
9291
9314
  updateReadOnly() {
9292
9315
  if (this.parent.readonly) {
@@ -9358,6 +9381,7 @@ class MarkdownEditor {
9358
9381
  this.parent.off(selectionSave, this.onSelectionSave);
9359
9382
  this.parent.off(selectionRestore, this.onSelectionRestore);
9360
9383
  this.parent.off(readOnlyMode, this.updateReadOnly);
9384
+ this.parent.off(moduleDestroy, this.moduleDestroy);
9361
9385
  }
9362
9386
  render() {
9363
9387
  this.contentRenderer = this.renderFactory.getRenderer(RenderType.Content);
@@ -10749,6 +10773,7 @@ class Lists {
10749
10773
  addEventListener() {
10750
10774
  this.parent.observer.on(LIST_TYPE, this.applyListsHandler, this);
10751
10775
  this.parent.observer.on(KEY_DOWN_HANDLER, this.keyDownHandler, this);
10776
+ this.parent.observer.on(KEY_UP_HANDLER, this.onKeyUp, this);
10752
10777
  this.parent.observer.on(SPACE_ACTION, this.spaceKeyAction, this);
10753
10778
  }
10754
10779
  testList(elem) {
@@ -10901,6 +10926,7 @@ class Lists {
10901
10926
  }
10902
10927
  }
10903
10928
  this.removeList(range, e);
10929
+ this.firstListBackSpace(range, e);
10904
10930
  }
10905
10931
  removeList(range, e) {
10906
10932
  let startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
@@ -10926,6 +10952,33 @@ class Lists {
10926
10952
  e.event.preventDefault();
10927
10953
  }
10928
10954
  }
10955
+ onKeyUp() {
10956
+ if (!isNullOrUndefined(this.commonLIParent) && !isNullOrUndefined(this.commonLIParent.querySelector('.removeList'))) {
10957
+ let currentLIElem = this.commonLIParent.querySelector('.removeList');
10958
+ while (!isNullOrUndefined(currentLIElem.firstChild)) {
10959
+ this.parent.domNode.insertAfter(currentLIElem.firstChild, currentLIElem);
10960
+ }
10961
+ detach(currentLIElem);
10962
+ }
10963
+ }
10964
+ firstListBackSpace(range, e) {
10965
+ let startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
10966
+ if (!isNullOrUndefined(startNode.closest('OL'))) {
10967
+ this.commonLIParent = startNode.closest('OL');
10968
+ }
10969
+ else if (!isNullOrUndefined(startNode.closest('UL'))) {
10970
+ this.commonLIParent = startNode.closest('UL');
10971
+ }
10972
+ if (startNode.nodeName === 'LI' && range.startOffset === 0 && range.endOffset === 0 &&
10973
+ isNullOrUndefined(startNode.previousSibling) && !isNullOrUndefined(this.commonLIParent) && isNullOrUndefined(this.commonLIParent.previousSibling) &&
10974
+ (isNullOrUndefined(this.commonLIParent.parentElement.closest('OL')) && isNullOrUndefined(this.commonLIParent.parentElement.closest('UL')) &&
10975
+ isNullOrUndefined(this.commonLIParent.parentElement.closest('LI')))) {
10976
+ let currentElem = createElement('P');
10977
+ currentElem.innerHTML = '​';
10978
+ startNode.classList.add('removeList');
10979
+ this.commonLIParent.parentElement.insertBefore(currentElem, this.commonLIParent);
10980
+ }
10981
+ }
10929
10982
  keyDownHandler(e) {
10930
10983
  if (e.event.which === 13) {
10931
10984
  this.enterList(e);
@@ -19695,10 +19748,12 @@ class FullScreen {
19695
19748
  addEventListener() {
19696
19749
  this.parent.on(keyDown, this.onKeyDown, this);
19697
19750
  this.parent.on(destroy, this.destroy, this);
19751
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19698
19752
  }
19699
19753
  removeEventListener() {
19700
19754
  this.parent.off(keyDown, this.onKeyDown);
19701
19755
  this.parent.off(destroy, this.destroy);
19756
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19702
19757
  }
19703
19758
  /**
19704
19759
  * destroy method
@@ -19717,6 +19772,9 @@ class FullScreen {
19717
19772
  }
19718
19773
  this.removeEventListener();
19719
19774
  }
19775
+ moduleDestroy() {
19776
+ this.parent = null;
19777
+ }
19720
19778
  }
19721
19779
 
19722
19780
  /**
@@ -19830,11 +19888,6 @@ class Render {
19830
19888
  destroy() {
19831
19889
  this.removeEventListener();
19832
19890
  }
19833
- /**
19834
- * Clears the Render Module.
19835
- *
19836
- * @returns {void}
19837
- */
19838
19891
  moduleDestroy() {
19839
19892
  this.parent = null;
19840
19893
  }
@@ -19844,6 +19897,7 @@ class Render {
19844
19897
  }
19845
19898
  this.parent.on(modelChanged, this.refresh, this);
19846
19899
  this.parent.on(keyUp, this.keyUp, this);
19900
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19847
19901
  }
19848
19902
  removeEventListener() {
19849
19903
  if (this.parent.isDestroyed) {
@@ -19851,6 +19905,7 @@ class Render {
19851
19905
  }
19852
19906
  this.parent.off(modelChanged, this.refresh);
19853
19907
  this.parent.off(keyUp, this.keyUp);
19908
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19854
19909
  }
19855
19910
  keyUp(e) {
19856
19911
  if (this.parent.editorMode === 'HTML') {
@@ -19911,6 +19966,7 @@ class Link {
19911
19966
  this.parent.on(editAreaClick, this.editAreaClickHandler, this);
19912
19967
  this.parent.on(bindCssClass, this.setCssClass, this);
19913
19968
  this.parent.on(destroy, this.destroy, this);
19969
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19914
19970
  }
19915
19971
  onToolbarAction(args) {
19916
19972
  const item = args.args.item;
@@ -19944,6 +20000,7 @@ class Link {
19944
20000
  this.parent.off(editAreaClick, this.editAreaClickHandler);
19945
20001
  this.parent.off(bindCssClass, this.setCssClass);
19946
20002
  this.parent.off(destroy, this.destroy);
20003
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19947
20004
  }
19948
20005
  onIframeMouseDown() {
19949
20006
  if (this.dialogObj) {
@@ -20393,13 +20450,6 @@ class Link {
20393
20450
  destroy() {
20394
20451
  this.removeEventListener();
20395
20452
  }
20396
- /**
20397
- * Clears the Link Module.
20398
- *
20399
- * @returns {void}
20400
- * @hidden
20401
- * @deprecated
20402
- */
20403
20453
  moduleDestroy() {
20404
20454
  this.parent = null;
20405
20455
  }
@@ -20457,6 +20507,7 @@ class Image {
20457
20507
  this.parent.on(paste, this.imagePaste, this);
20458
20508
  this.parent.on(bindCssClass, this.setCssClass, this);
20459
20509
  this.parent.on(destroy, this.removeEventListener, this);
20510
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
20460
20511
  }
20461
20512
  removeEventListener() {
20462
20513
  if (this.parent.isDestroyed) {
@@ -20484,6 +20535,7 @@ class Image {
20484
20535
  this.parent.off(paste, this.imagePaste);
20485
20536
  this.parent.off(bindCssClass, this.setCssClass);
20486
20537
  this.parent.off(destroy, this.removeEventListener);
20538
+ this.parent.off(moduleDestroy, this.moduleDestroy);
20487
20539
  const dropElement = this.parent.iframeSettings.enable ? this.parent.inputElement.ownerDocument
20488
20540
  : this.parent.inputElement;
20489
20541
  dropElement.removeEventListener('drop', this.dragDrop.bind(this), true);
@@ -20856,6 +20908,10 @@ class Image {
20856
20908
  if (this.imgEle.offsetWidth >= this.parent.getInsertImgMaxWidth()) {
20857
20909
  this.imgEle.style.maxHeight = this.imgEle.offsetHeight + 'px';
20858
20910
  }
20911
+ else if (isNullOrUndefined(this.parent.insertImageSettings.maxHeight)) {
20912
+ this.imgEle.style.maxHeight = '';
20913
+ }
20914
+ this.imgEle.style.maxWidth = this.parent.getInsertImgMaxWidth() + 'px';
20859
20915
  const pageX = this.getPointX(e);
20860
20916
  const pageY = this.getPointY(e);
20861
20917
  const mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
@@ -21805,6 +21861,9 @@ class Image {
21805
21861
  if (target.nodeName === 'IMG') {
21806
21862
  this.imgEle = target;
21807
21863
  }
21864
+ if (!this.parent) {
21865
+ return;
21866
+ }
21808
21867
  if (target.nodeName !== '#document') {
21809
21868
  this.parent.currentTarget = e.target;
21810
21869
  }
@@ -22682,15 +22741,6 @@ class Image {
22682
22741
  this.prevSelectedImgEle = undefined;
22683
22742
  this.removeEventListener();
22684
22743
  }
22685
- /* eslint-disable */
22686
- /**
22687
- * Clears the ImageModule.
22688
- *
22689
- * @returns {void}
22690
- * @hidden
22691
- * @deprecated
22692
- */
22693
- /* eslint-enable */
22694
22744
  moduleDestroy() {
22695
22745
  this.parent = null;
22696
22746
  }
@@ -22729,6 +22779,7 @@ class ViewSource {
22729
22779
  this.parent.on(initialEnd, this.onInitialEnd, this);
22730
22780
  this.parent.on(updateSource, this.updateSourceCode, this);
22731
22781
  this.parent.on(destroy, this.destroy, this);
22782
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
22732
22783
  }
22733
22784
  onInitialEnd() {
22734
22785
  this.parent.formatter.editorManager.observer.on(KEY_DOWN_HANDLER, this.onKeyDown, this);
@@ -22739,6 +22790,7 @@ class ViewSource {
22739
22790
  this.parent.off(updateSource, this.updateSourceCode);
22740
22791
  this.parent.off(initialEnd, this.onInitialEnd);
22741
22792
  this.parent.off(destroy, this.destroy);
22793
+ this.parent.off(moduleDestroy, this.moduleDestroy);
22742
22794
  this.parent.formatter.editorManager.observer.off(KEY_DOWN_HANDLER, this.onKeyDown);
22743
22795
  }
22744
22796
  getSourceCode() {
@@ -22962,6 +23014,9 @@ class ViewSource {
22962
23014
  destroy() {
22963
23015
  this.removeEventListener();
22964
23016
  }
23017
+ moduleDestroy() {
23018
+ this.parent = null;
23019
+ }
22965
23020
  }
22966
23021
 
22967
23022
  /**
@@ -23000,6 +23055,7 @@ class Table {
23000
23055
  this.parent.on(mouseUp, this.selectionTable, this);
23001
23056
  this.parent.on(bindCssClass, this.setCssClass, this);
23002
23057
  this.parent.on(destroy, this.destroy, this);
23058
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
23003
23059
  }
23004
23060
  removeEventListener() {
23005
23061
  if (this.parent.isDestroyed) {
@@ -23021,6 +23077,7 @@ class Table {
23021
23077
  this.parent.off(mouseUp, this.selectionTable);
23022
23078
  this.parent.off(bindCssClass, this.setCssClass);
23023
23079
  this.parent.off(destroy, this.destroy);
23080
+ this.parent.off(moduleDestroy, this.moduleDestroy);
23024
23081
  }
23025
23082
  updateCss(currentObj, e) {
23026
23083
  if (currentObj && e.cssClass) {
@@ -24311,6 +24368,9 @@ class Table {
24311
24368
  destroy() {
24312
24369
  this.removeEventListener();
24313
24370
  }
24371
+ moduleDestroy() {
24372
+ this.parent = null;
24373
+ }
24314
24374
  /**
24315
24375
  * For internal use only - Get the module name.
24316
24376
  *
@@ -24327,6 +24387,21 @@ class Table {
24327
24387
  class DialogRenderer {
24328
24388
  constructor(parent) {
24329
24389
  this.parent = parent;
24390
+ this.addEventListener();
24391
+ }
24392
+ addEventListener() {
24393
+ if (this.parent.isDestroyed) {
24394
+ return;
24395
+ }
24396
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
24397
+ this.parent.on(destroy, this.removeEventListener, this);
24398
+ }
24399
+ removeEventListener() {
24400
+ if (this.parent.isDestroyed) {
24401
+ return;
24402
+ }
24403
+ this.parent.off(destroy, this.removeEventListener);
24404
+ this.parent.off(moduleDestroy, this.moduleDestroy);
24330
24405
  }
24331
24406
  /**
24332
24407
  * dialog render method
@@ -24380,6 +24455,9 @@ class DialogRenderer {
24380
24455
  close(args) {
24381
24456
  this.parent.trigger(dialogClose, args);
24382
24457
  }
24458
+ moduleDestroy() {
24459
+ this.parent = null;
24460
+ }
24383
24461
  }
24384
24462
 
24385
24463
  /**
@@ -24911,13 +24989,18 @@ class EnterKeyAction {
24911
24989
  addEventListener() {
24912
24990
  this.parent.on(enterHandler, this.enterHandler, this);
24913
24991
  this.parent.on(destroy, this.destroy, this);
24992
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
24914
24993
  }
24915
24994
  destroy() {
24916
24995
  this.removeEventListener();
24917
24996
  }
24997
+ moduleDestroy() {
24998
+ this.parent = null;
24999
+ }
24918
25000
  removeEventListener() {
24919
25001
  this.parent.off(enterHandler, this.enterHandler);
24920
25002
  this.parent.off(destroy, this.destroy);
25003
+ this.parent.off(moduleDestroy, this.moduleDestroy);
24921
25004
  }
24922
25005
  getRangeNode() {
24923
25006
  this.range = this.parent.getRange();
@@ -25034,7 +25117,8 @@ class EnterKeyAction {
25034
25117
  isNearBlockLengthZero = false;
25035
25118
  }
25036
25119
  else {
25037
- if (nearBlockNode.textContent.trim().length !== 0) {
25120
+ if (nearBlockNode.textContent.trim().length !== 0 ||
25121
+ nearBlockNode.childNodes[0].nodeName === 'IMG') {
25038
25122
  newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
25039
25123
  isNearBlockLengthZero = false;
25040
25124
  }
@@ -25686,6 +25770,7 @@ let RichTextEditor = class RichTextEditor extends Component {
25686
25770
  const currentEndContainer = range.endContainer;
25687
25771
  const currentStartOffset = range.startOffset;
25688
25772
  const isSameContainer = currentStartContainer === currentEndContainer ? true : false;
25773
+ const currentEndOffset = currentEndContainer.textContent.length;
25689
25774
  const endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
25690
25775
  range.endContainer;
25691
25776
  const closestLI = closest(endNode, 'LI');
@@ -25701,7 +25786,7 @@ let RichTextEditor = class RichTextEditor extends Component {
25701
25786
  while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
25702
25787
  currentLastElem = currentLastElem.lastChild;
25703
25788
  }
25704
- this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? (currentLastElem.nodeName === 'BR' && !isNullOrUndefined(currentLastElem.previousSibling) ? currentLastElem.previousSibling : currentLastElem) : currentStartContainer, currentLastElem, currentStartOffset, (currentLastElem.nodeName === 'BR' ? 0 : currentLastElem.textContent.length));
25789
+ this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? currentStartContainer : (currentLastElem.nodeName === 'BR' && !isNullOrUndefined(currentLastElem.previousSibling) ? currentLastElem.previousSibling : currentStartContainer), currentEndContainer, currentStartOffset, (currentLastElem.nodeName === 'BR' ? 0 : currentEndOffset));
25705
25790
  }
25706
25791
  }
25707
25792
  /**
@@ -26043,15 +26128,7 @@ let RichTextEditor = class RichTextEditor extends Component {
26043
26128
  if (!isNullOrUndefined(this.toolbarModule)) {
26044
26129
  this.toolbarModule.destroy();
26045
26130
  }
26046
- if (!isNullOrUndefined(this.imageModule)) {
26047
- this.imageModule.moduleDestroy();
26048
- }
26049
- if (!isNullOrUndefined(this.linkModule)) {
26050
- this.linkModule.moduleDestroy();
26051
- }
26052
- if (!isNullOrUndefined(this.renderModule)) {
26053
- this.renderModule.moduleDestroy();
26054
- }
26131
+ this.notify(moduleDestroy, {});
26055
26132
  return;
26056
26133
  }
26057
26134
  this.notify(destroy, {});
@@ -27285,7 +27362,10 @@ let RichTextEditor = class RichTextEditor extends Component {
27285
27362
  restrict(e) {
27286
27363
  if (this.maxLength >= 0) {
27287
27364
  const element = this.editorMode === 'Markdown' ? this.contentModule.getText() :
27288
- e.currentTarget.textContent;
27365
+ (e && e.currentTarget.textContent);
27366
+ if (!element) {
27367
+ return;
27368
+ }
27289
27369
  const array = [8, 16, 17, 37, 38, 39, 40, 46, 65];
27290
27370
  let arrayKey;
27291
27371
  for (let i = 0; i <= array.length - 1; i++) {
@@ -27661,5 +27741,5 @@ RichTextEditor = __decorate$1([
27661
27741
  * Rich Text Editor component exported items
27662
27742
  */
27663
27743
 
27664
- export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, imageCaption, imageSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, mediaSelected, mediaUploading, mediaUploadSuccess, mediaUploadFailed, mediaRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeMediaUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, closeAudioDialog, showTableDialog, closeTableDialog, bindCssClass, blockEmptyNodes, inlineEmptyNodes, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_IMAGE_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION };
27744
+ export { Toolbar$2 as Toolbar, KeyboardEvents$1 as KeyboardEvents, BaseToolbar, BaseQuickToolbar, QuickToolbar, Count, ColorPickerInput, MarkdownToolbarStatus, ExecCommandCallBack, ToolbarAction, MarkdownEditor, HtmlEditor, PasteCleanup, Resize, DropDownButtons, FileManager$1 as FileManager, FullScreen, setAttributes, HtmlToolbarStatus, XhtmlValidation, HTMLFormatter, Formatter, MarkdownFormatter, ContentRender, Render, ToolbarRenderer, Link, Image, ViewSource, Table, DialogRenderer, IframeContentRender, MarkdownRender, PopupRenderer, RichTextEditor, RenderType, ToolbarType, DialogType, executeGroup, created, destroyed, load, initialLoad, contentChanged, initialEnd, iframeMouseDown, destroy, toolbarClick, toolbarRefresh, refreshBegin, toolbarUpdated, bindOnEnd, renderColorPicker, htmlToolbarClick, markdownToolbarClick, destroyColorPicker, modelChanged, keyUp, keyDown, mouseUp, toolbarCreated, toolbarRenderComplete, enableFullScreen, disableFullScreen, dropDownSelect, beforeDropDownItemRender, execCommandCallBack, imageToolbarAction, linkToolbarAction, windowResize, resizeStart, onResize, resizeStop, undo, redo, insertLink, unLink, editLink, openLink, actionBegin, actionComplete, updatedToolbarStatus, actionSuccess, updateToolbarItem, insertImage, insertCompleted, imageLeft, imageRight, imageCenter, imageBreak, imageInline, imageLink, imageAlt, imageDelete, imageCaption, imageSize, sourceCode, updateSource, toolbarOpen, beforeDropDownOpen, selectionSave, selectionRestore, expandPopupClick, count, contentFocus, contentBlur, mouseDown, sourceCodeMouseDown, editAreaClick, scroll, contentscroll, colorPickerChanged, tableColorPickerChanged, focusChange, selectAll$1 as selectAll, selectRange, getSelectedHtml, renderInlineToolbar, paste, imgModule, rtlMode, createTable, docClick, tableToolbarAction, checkUndo, readOnlyMode, moduleDestroy, pasteClean, enterHandler, beforeDialogOpen, clearDialogObj, dialogOpen, beforeDialogClose, dialogClose, beforeQuickToolbarOpen, quickToolbarOpen, quickToolbarClose, popupHide, imageSelected, imageUploading, imageUploadSuccess, imageUploadFailed, imageRemoving, mediaSelected, mediaUploading, mediaUploadSuccess, mediaUploadFailed, mediaRemoving, afterImageDelete, afterMediaDelete, drop, xhtmlValidation, beforeImageUpload, beforeMediaUpload, resizeInitialized, renderFileManager, beforeImageDrop, dynamicModule, beforePasteCleanup, afterPasteCleanup, updateTbItemsStatus, showLinkDialog, closeLinkDialog, showImageDialog, closeImageDialog, closeAudioDialog, showTableDialog, closeTableDialog, bindCssClass, blockEmptyNodes, inlineEmptyNodes, CLS_RTE, CLS_RTL, CLS_CONTENT, CLS_DISABLED, CLS_SCRIPT_SHEET, CLS_STYLE_SHEET, CLS_TOOLBAR, CLS_TB_FIXED, CLS_TB_FLOAT, CLS_TB_ABS_FLOAT, CLS_INLINE, CLS_TB_INLINE, CLS_RTE_EXPAND_TB, CLS_FULL_SCREEN, CLS_QUICK_TB, CLS_POP, CLS_TB_STATIC, CLS_QUICK_POP, CLS_QUICK_DROPDOWN, CLS_IMAGE_POP, CLS_INLINE_POP, CLS_INLINE_DROPDOWN, CLS_DROPDOWN_POPUP, CLS_DROPDOWN_ICONS, CLS_DROPDOWN_ITEMS, CLS_DROPDOWN_BTN, CLS_RTE_CONTENT, CLS_TB_ITEM, CLS_TB_EXTENDED, CLS_TB_WRAP, CLS_POPUP, CLS_SEPARATOR, CLS_MINIMIZE, CLS_MAXIMIZE, CLS_BACK, CLS_SHOW, CLS_HIDE, CLS_VISIBLE, CLS_FOCUS, CLS_RM_WHITE_SPACE, CLS_IMGRIGHT, CLS_IMGLEFT, CLS_IMGCENTER, CLS_IMGBREAK, CLS_CAPTION, CLS_RTE_CAPTION, CLS_CAPINLINE, CLS_IMGINLINE, CLS_COUNT, CLS_WARNING, CLS_ERROR, CLS_ICONS, CLS_ACTIVE, CLS_EXPAND_OPEN, CLS_RTE_ELEMENTS, CLS_TB_BTN, CLS_HR_SEPARATOR, CLS_TB_IOS_FIX, CLS_LIST_PRIMARY_CONTENT, CLS_NUMBERFORMATLIST_TB_BTN, CLS_BULLETFORMATLIST_TB_BTN, CLS_FORMATS_TB_BTN, CLS_FONT_NAME_TB_BTN, CLS_FONT_SIZE_TB_BTN, CLS_ALIGN_TB_BTN, CLS_FONT_COLOR_TARGET, CLS_BACKGROUND_COLOR_TARGET, CLS_COLOR_CONTENT, CLS_FONT_COLOR_DROPDOWN, CLS_BACKGROUND_COLOR_DROPDOWN, CLS_COLOR_PALETTE, CLS_FONT_COLOR_PICKER, CLS_BACKGROUND_COLOR_PICKER, CLS_RTE_READONLY, CLS_TABLE_SEL, CLS_TB_DASH_BOR, CLS_TB_ALT_BOR, CLS_TB_COL_RES, CLS_TB_ROW_RES, CLS_TB_BOX_RES, CLS_RTE_HIDDEN, CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT, CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT, CLS_RTE_RES_HANDLE, CLS_RTE_RES_EAST, CLS_RTE_IMAGE, CLS_RESIZE, CLS_IMG_FOCUS, CLS_RTE_DRAG_IMAGE, CLS_RTE_UPLOAD_POPUP, CLS_POPUP_OPEN, CLS_IMG_RESIZE, CLS_DROPAREA, CLS_IMG_INNER, CLS_UPLOAD_FILES, CLS_RTE_DIALOG_UPLOAD, CLS_RTE_RES_CNT, CLS_CUSTOM_TILE, CLS_NOCOLOR_ITEM, CLS_TABLE, CLS_TABLE_BORDER, CLS_RTE_TABLE_RESIZE, CLS_RTE_FIXED_TB_EXPAND, CLS_RTE_TB_ENABLED, CLS_RTE_RES_WEST, getIndex, hasClass, getDropDownValue, isIDevice, getFormattedFontSize, pageYOffset, getTooltipText, setToolbarStatus, getCollection, getTBarItemsIndex, updateUndoRedoStatus, dispatchEvent, parseHtml, getTextNodesUnder, toObjectLowerCase, getEditValue, updateTextNode, getDefaultValue, isEditableValueEmpty, decode, sanitizeHelper, convertToBlob, getLocaleFontFormat, updateDropDownFontFormatLocale, ServiceLocator, RendererFactory, EditorManager, IMAGE, TABLE, LINK, INSERT_ROW, INSERT_COLUMN, DELETEROW, DELETECOLUMN, REMOVETABLE, TABLEHEADER, TABLE_VERTICAL_ALIGN, TABLE_MERGE, TABLE_VERTICAL_SPLIT, TABLE_HORIZONTAL_SPLIT, TABLE_MOVE, ALIGNMENT_TYPE, INDENT_TYPE, DEFAULT_TAG, BLOCK_TAGS, IGNORE_BLOCK_TAGS, TABLE_BLOCK_TAGS, SELECTION_TYPE, INSERTHTML_TYPE, INSERT_TEXT_TYPE, CLEAR_TYPE, SELF_CLOSING_TAGS, CLASS_IMAGE_RIGHT, CLASS_IMAGE_LEFT, CLASS_IMAGE_CENTER, CLASS_IMAGE_BREAK, CLASS_CAPTION, CLASS_RTE_CAPTION, CLASS_CAPTION_INLINE, CLASS_IMAGE_INLINE, Lists, markerClassName, DOMNode, Alignments, Indents, Formats, LinkCommand, InsertMethods, InsertTextExec, InsertHtmlExec, InsertHtml, IsFormatted, MsWordPaste, NodeCutter, ImageCommand, SelectionCommands, SelectionBasedExec, ClearFormatExec, UndoRedoManager, TableCommand, statusCollection, ToolbarStatus, NodeSelection, MarkdownParser, LISTS_COMMAND, selectionCommand, LINK_COMMAND, CLEAR_COMMAND, MD_TABLE, INSERT_TEXT_COMMAND, ClearFormat, MDLists, MDFormats, MarkdownSelection, UndoRedoCommands, MDSelectionFormats, MDLink, MDTable, markdownFormatTags, markdownSelectionTags, markdownListsTags, htmlKeyConfig, markdownKeyConfig, pasteCleanupGroupingTags, listConversionFilters, selfClosingTags, KEY_DOWN, ACTION, FORMAT_TYPE, KEY_DOWN_HANDLER, LIST_TYPE, KEY_UP_HANDLER, KEY_UP, MODEL_CHANGED_PLUGIN, MODEL_CHANGED, MS_WORD_CLEANUP_PLUGIN, MS_WORD_CLEANUP, ON_BEGIN, SPACE_ACTION };
27665
27745
  //# sourceMappingURL=ej2-richtexteditor.es2015.js.map