@syncfusion/ej2-richtexteditor 20.2.40 → 20.2.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +20 -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 +121 -35
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +121 -35
  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 +12 -12
  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 +12 -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/toolbar-renderer.js +2 -1
  42. package/src/rich-text-editor/renderer/view-source.d.ts +1 -0
  43. 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
@@ -3079,10 +3084,11 @@ class ToolbarRenderer {
3079
3084
  proxy.parent.notify(selectionRestore, {});
3080
3085
  range = proxy.parent.formatter.editorManager.nodeSelection.getRange(proxy.parent.contentModule.getDocument());
3081
3086
  const parentNode = range.startContainer.parentNode;
3087
+ const closestElement = closest(range.startContainer.parentNode, 'table');
3082
3088
  if ((range.startContainer.nodeName === 'TD' || range.startContainer.nodeName === 'TH' ||
3083
3089
  (closest(range.startContainer.parentNode, 'td,th')) ||
3084
3090
  (proxy.parent.iframeSettings.enable && !hasClass(parentNode.ownerDocument.querySelector('body'), 'e-lib')))
3085
- && range.collapsed && args.subCommand === 'BackgroundColor') {
3091
+ && range.collapsed && args.subCommand === 'BackgroundColor' && closest(closestElement, '.' + CLS_RTE)) {
3086
3092
  proxy.parent.notify(tableColorPickerChanged, {
3087
3093
  item: { command: args.command, subCommand: args.subCommand,
3088
3094
  value: colorpickerValue }
@@ -4656,6 +4662,12 @@ class Toolbar$2 {
4656
4662
  }
4657
4663
  }
4658
4664
  }
4665
+ moduleDestroy() {
4666
+ this.parent = null;
4667
+ this.baseToolbar.parent = null;
4668
+ this.toolbarActionModule.parent = null;
4669
+ this.dropDownModule.parent = null;
4670
+ }
4659
4671
  scrollHandler(e) {
4660
4672
  if (!this.parent.inlineMode.enable) {
4661
4673
  if (this.parent.toolbarSettings.enableFloating && this.getDOMVisibility(this.tbElement)) {
@@ -4757,6 +4769,7 @@ class Toolbar$2 {
4757
4769
  this.parent.on(mouseDown, this.mouseDownHandler, this);
4758
4770
  this.parent.on(sourceCodeMouseDown, this.mouseDownHandler, this);
4759
4771
  this.parent.on(bindCssClass, this.setCssClass, this);
4772
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
4760
4773
  if (!this.parent.inlineMode.enable && !isIDevice()) {
4761
4774
  this.parent.on(toolbarClick, this.toolbarClickHandler, this);
4762
4775
  }
@@ -4781,6 +4794,7 @@ class Toolbar$2 {
4781
4794
  this.parent.off(mouseDown, this.mouseDownHandler);
4782
4795
  this.parent.off(sourceCodeMouseDown, this.mouseDownHandler);
4783
4796
  this.parent.off(bindCssClass, this.setCssClass);
4797
+ this.parent.off(moduleDestroy, this.moduleDestroy);
4784
4798
  if (!this.parent.inlineMode.enable && !isIDevice()) {
4785
4799
  this.parent.off(toolbarClick, this.toolbarClickHandler);
4786
4800
  }
@@ -6061,6 +6075,9 @@ class QuickToolbar {
6061
6075
  }
6062
6076
  this.removeEventListener();
6063
6077
  }
6078
+ moduleDestroy() {
6079
+ this.parent = null;
6080
+ }
6064
6081
  wireInlineQTBarEvents() {
6065
6082
  this.parent.on(mouseUp, this.mouseUpHandler, this);
6066
6083
  this.parent.on(mouseDown, this.inlineQTBarMouseDownHandler, this);
@@ -6116,6 +6133,7 @@ class QuickToolbar {
6116
6133
  this.parent.on(keyDown, this.onKeyDown, this);
6117
6134
  this.parent.on(rtlMode, this.setRtl, this);
6118
6135
  this.parent.on(bindCssClass, this.setCssClass, this);
6136
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
6119
6137
  }
6120
6138
  onKeyDown(e) {
6121
6139
  const args = e.args;
@@ -6185,6 +6203,7 @@ class QuickToolbar {
6185
6203
  this.parent.off(keyDown, this.onKeyDown);
6186
6204
  this.parent.off(rtlMode, this.setRtl);
6187
6205
  this.parent.off(bindCssClass, this.setCssClass);
6206
+ this.parent.off(moduleDestroy, this.moduleDestroy);
6188
6207
  }
6189
6208
  /**
6190
6209
  * Called internally if any of the property value changed.
@@ -9271,6 +9290,10 @@ class MarkdownEditor {
9271
9290
  destroy() {
9272
9291
  this.removeEventListener();
9273
9292
  }
9293
+ moduleDestroy() {
9294
+ this.parent = null;
9295
+ this.toolbarUpdate.parent = null;
9296
+ }
9274
9297
  addEventListener() {
9275
9298
  if (this.parent.isDestroyed) {
9276
9299
  return;
@@ -9286,6 +9309,7 @@ class MarkdownEditor {
9286
9309
  this.parent.on(selectionSave, this.onSelectionSave, this);
9287
9310
  this.parent.on(selectionRestore, this.onSelectionRestore, this);
9288
9311
  this.parent.on(readOnlyMode, this.updateReadOnly, this);
9312
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
9289
9313
  }
9290
9314
  updateReadOnly() {
9291
9315
  if (this.parent.readonly) {
@@ -9357,6 +9381,7 @@ class MarkdownEditor {
9357
9381
  this.parent.off(selectionSave, this.onSelectionSave);
9358
9382
  this.parent.off(selectionRestore, this.onSelectionRestore);
9359
9383
  this.parent.off(readOnlyMode, this.updateReadOnly);
9384
+ this.parent.off(moduleDestroy, this.moduleDestroy);
9360
9385
  }
9361
9386
  render() {
9362
9387
  this.contentRenderer = this.renderFactory.getRenderer(RenderType.Content);
@@ -10748,6 +10773,7 @@ class Lists {
10748
10773
  addEventListener() {
10749
10774
  this.parent.observer.on(LIST_TYPE, this.applyListsHandler, this);
10750
10775
  this.parent.observer.on(KEY_DOWN_HANDLER, this.keyDownHandler, this);
10776
+ this.parent.observer.on(KEY_UP_HANDLER, this.onKeyUp, this);
10751
10777
  this.parent.observer.on(SPACE_ACTION, this.spaceKeyAction, this);
10752
10778
  }
10753
10779
  testList(elem) {
@@ -10900,6 +10926,7 @@ class Lists {
10900
10926
  }
10901
10927
  }
10902
10928
  this.removeList(range, e);
10929
+ this.firstListBackSpace(range, e);
10903
10930
  }
10904
10931
  removeList(range, e) {
10905
10932
  let startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
@@ -10925,6 +10952,33 @@ class Lists {
10925
10952
  e.event.preventDefault();
10926
10953
  }
10927
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
+ }
10928
10982
  keyDownHandler(e) {
10929
10983
  if (e.event.which === 13) {
10930
10984
  this.enterList(e);
@@ -19694,10 +19748,12 @@ class FullScreen {
19694
19748
  addEventListener() {
19695
19749
  this.parent.on(keyDown, this.onKeyDown, this);
19696
19750
  this.parent.on(destroy, this.destroy, this);
19751
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19697
19752
  }
19698
19753
  removeEventListener() {
19699
19754
  this.parent.off(keyDown, this.onKeyDown);
19700
19755
  this.parent.off(destroy, this.destroy);
19756
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19701
19757
  }
19702
19758
  /**
19703
19759
  * destroy method
@@ -19716,6 +19772,9 @@ class FullScreen {
19716
19772
  }
19717
19773
  this.removeEventListener();
19718
19774
  }
19775
+ moduleDestroy() {
19776
+ this.parent = null;
19777
+ }
19719
19778
  }
19720
19779
 
19721
19780
  /**
@@ -19829,11 +19888,6 @@ class Render {
19829
19888
  destroy() {
19830
19889
  this.removeEventListener();
19831
19890
  }
19832
- /**
19833
- * Clears the Render Module.
19834
- *
19835
- * @returns {void}
19836
- */
19837
19891
  moduleDestroy() {
19838
19892
  this.parent = null;
19839
19893
  }
@@ -19843,6 +19897,7 @@ class Render {
19843
19897
  }
19844
19898
  this.parent.on(modelChanged, this.refresh, this);
19845
19899
  this.parent.on(keyUp, this.keyUp, this);
19900
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19846
19901
  }
19847
19902
  removeEventListener() {
19848
19903
  if (this.parent.isDestroyed) {
@@ -19850,6 +19905,7 @@ class Render {
19850
19905
  }
19851
19906
  this.parent.off(modelChanged, this.refresh);
19852
19907
  this.parent.off(keyUp, this.keyUp);
19908
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19853
19909
  }
19854
19910
  keyUp(e) {
19855
19911
  if (this.parent.editorMode === 'HTML') {
@@ -19910,6 +19966,7 @@ class Link {
19910
19966
  this.parent.on(editAreaClick, this.editAreaClickHandler, this);
19911
19967
  this.parent.on(bindCssClass, this.setCssClass, this);
19912
19968
  this.parent.on(destroy, this.destroy, this);
19969
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19913
19970
  }
19914
19971
  onToolbarAction(args) {
19915
19972
  const item = args.args.item;
@@ -19943,6 +20000,7 @@ class Link {
19943
20000
  this.parent.off(editAreaClick, this.editAreaClickHandler);
19944
20001
  this.parent.off(bindCssClass, this.setCssClass);
19945
20002
  this.parent.off(destroy, this.destroy);
20003
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19946
20004
  }
19947
20005
  onIframeMouseDown() {
19948
20006
  if (this.dialogObj) {
@@ -20392,13 +20450,6 @@ class Link {
20392
20450
  destroy() {
20393
20451
  this.removeEventListener();
20394
20452
  }
20395
- /**
20396
- * Clears the Link Module.
20397
- *
20398
- * @returns {void}
20399
- * @hidden
20400
- * @deprecated
20401
- */
20402
20453
  moduleDestroy() {
20403
20454
  this.parent = null;
20404
20455
  }
@@ -20456,6 +20507,7 @@ class Image {
20456
20507
  this.parent.on(paste, this.imagePaste, this);
20457
20508
  this.parent.on(bindCssClass, this.setCssClass, this);
20458
20509
  this.parent.on(destroy, this.removeEventListener, this);
20510
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
20459
20511
  }
20460
20512
  removeEventListener() {
20461
20513
  if (this.parent.isDestroyed) {
@@ -20483,6 +20535,7 @@ class Image {
20483
20535
  this.parent.off(paste, this.imagePaste);
20484
20536
  this.parent.off(bindCssClass, this.setCssClass);
20485
20537
  this.parent.off(destroy, this.removeEventListener);
20538
+ this.parent.off(moduleDestroy, this.moduleDestroy);
20486
20539
  const dropElement = this.parent.iframeSettings.enable ? this.parent.inputElement.ownerDocument
20487
20540
  : this.parent.inputElement;
20488
20541
  dropElement.removeEventListener('drop', this.dragDrop.bind(this), true);
@@ -20855,6 +20908,10 @@ class Image {
20855
20908
  if (this.imgEle.offsetWidth >= this.parent.getInsertImgMaxWidth()) {
20856
20909
  this.imgEle.style.maxHeight = this.imgEle.offsetHeight + 'px';
20857
20910
  }
20911
+ else if (isNullOrUndefined(this.parent.insertImageSettings.maxHeight)) {
20912
+ this.imgEle.style.maxHeight = '';
20913
+ }
20914
+ this.imgEle.style.maxWidth = this.parent.getInsertImgMaxWidth() + 'px';
20858
20915
  const pageX = this.getPointX(e);
20859
20916
  const pageY = this.getPointY(e);
20860
20917
  const mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
@@ -21804,6 +21861,9 @@ class Image {
21804
21861
  if (target.nodeName === 'IMG') {
21805
21862
  this.imgEle = target;
21806
21863
  }
21864
+ if (!this.parent) {
21865
+ return;
21866
+ }
21807
21867
  if (target.nodeName !== '#document') {
21808
21868
  this.parent.currentTarget = e.target;
21809
21869
  }
@@ -22681,15 +22741,6 @@ class Image {
22681
22741
  this.prevSelectedImgEle = undefined;
22682
22742
  this.removeEventListener();
22683
22743
  }
22684
- /* eslint-disable */
22685
- /**
22686
- * Clears the ImageModule.
22687
- *
22688
- * @returns {void}
22689
- * @hidden
22690
- * @deprecated
22691
- */
22692
- /* eslint-enable */
22693
22744
  moduleDestroy() {
22694
22745
  this.parent = null;
22695
22746
  }
@@ -22728,6 +22779,7 @@ class ViewSource {
22728
22779
  this.parent.on(initialEnd, this.onInitialEnd, this);
22729
22780
  this.parent.on(updateSource, this.updateSourceCode, this);
22730
22781
  this.parent.on(destroy, this.destroy, this);
22782
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
22731
22783
  }
22732
22784
  onInitialEnd() {
22733
22785
  this.parent.formatter.editorManager.observer.on(KEY_DOWN_HANDLER, this.onKeyDown, this);
@@ -22738,6 +22790,7 @@ class ViewSource {
22738
22790
  this.parent.off(updateSource, this.updateSourceCode);
22739
22791
  this.parent.off(initialEnd, this.onInitialEnd);
22740
22792
  this.parent.off(destroy, this.destroy);
22793
+ this.parent.off(moduleDestroy, this.moduleDestroy);
22741
22794
  this.parent.formatter.editorManager.observer.off(KEY_DOWN_HANDLER, this.onKeyDown);
22742
22795
  }
22743
22796
  getSourceCode() {
@@ -22961,6 +23014,9 @@ class ViewSource {
22961
23014
  destroy() {
22962
23015
  this.removeEventListener();
22963
23016
  }
23017
+ moduleDestroy() {
23018
+ this.parent = null;
23019
+ }
22964
23020
  }
22965
23021
 
22966
23022
  /**
@@ -22999,6 +23055,7 @@ class Table {
22999
23055
  this.parent.on(mouseUp, this.selectionTable, this);
23000
23056
  this.parent.on(bindCssClass, this.setCssClass, this);
23001
23057
  this.parent.on(destroy, this.destroy, this);
23058
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
23002
23059
  }
23003
23060
  removeEventListener() {
23004
23061
  if (this.parent.isDestroyed) {
@@ -23020,6 +23077,7 @@ class Table {
23020
23077
  this.parent.off(mouseUp, this.selectionTable);
23021
23078
  this.parent.off(bindCssClass, this.setCssClass);
23022
23079
  this.parent.off(destroy, this.destroy);
23080
+ this.parent.off(moduleDestroy, this.moduleDestroy);
23023
23081
  }
23024
23082
  updateCss(currentObj, e) {
23025
23083
  if (currentObj && e.cssClass) {
@@ -24310,6 +24368,9 @@ class Table {
24310
24368
  destroy() {
24311
24369
  this.removeEventListener();
24312
24370
  }
24371
+ moduleDestroy() {
24372
+ this.parent = null;
24373
+ }
24313
24374
  /**
24314
24375
  * For internal use only - Get the module name.
24315
24376
  *
@@ -24326,6 +24387,21 @@ class Table {
24326
24387
  class DialogRenderer {
24327
24388
  constructor(parent) {
24328
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);
24329
24405
  }
24330
24406
  /**
24331
24407
  * dialog render method
@@ -24379,6 +24455,9 @@ class DialogRenderer {
24379
24455
  close(args) {
24380
24456
  this.parent.trigger(dialogClose, args);
24381
24457
  }
24458
+ moduleDestroy() {
24459
+ this.parent = null;
24460
+ }
24382
24461
  }
24383
24462
 
24384
24463
  /**
@@ -24910,13 +24989,18 @@ class EnterKeyAction {
24910
24989
  addEventListener() {
24911
24990
  this.parent.on(enterHandler, this.enterHandler, this);
24912
24991
  this.parent.on(destroy, this.destroy, this);
24992
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
24913
24993
  }
24914
24994
  destroy() {
24915
24995
  this.removeEventListener();
24916
24996
  }
24997
+ moduleDestroy() {
24998
+ this.parent = null;
24999
+ }
24917
25000
  removeEventListener() {
24918
25001
  this.parent.off(enterHandler, this.enterHandler);
24919
25002
  this.parent.off(destroy, this.destroy);
25003
+ this.parent.off(moduleDestroy, this.moduleDestroy);
24920
25004
  }
24921
25005
  getRangeNode() {
24922
25006
  this.range = this.parent.getRange();
@@ -25033,7 +25117,8 @@ class EnterKeyAction {
25033
25117
  isNearBlockLengthZero = false;
25034
25118
  }
25035
25119
  else {
25036
- if (nearBlockNode.textContent.trim().length !== 0) {
25120
+ if (nearBlockNode.textContent.trim().length !== 0 ||
25121
+ nearBlockNode.childNodes[0].nodeName === 'IMG') {
25037
25122
  newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
25038
25123
  isNearBlockLengthZero = false;
25039
25124
  }
@@ -25685,6 +25770,7 @@ let RichTextEditor = class RichTextEditor extends Component {
25685
25770
  const currentEndContainer = range.endContainer;
25686
25771
  const currentStartOffset = range.startOffset;
25687
25772
  const isSameContainer = currentStartContainer === currentEndContainer ? true : false;
25773
+ const currentEndOffset = currentEndContainer.textContent.length;
25688
25774
  const endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
25689
25775
  range.endContainer;
25690
25776
  const closestLI = closest(endNode, 'LI');
@@ -25700,7 +25786,7 @@ let RichTextEditor = class RichTextEditor extends Component {
25700
25786
  while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
25701
25787
  currentLastElem = currentLastElem.lastChild;
25702
25788
  }
25703
- 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));
25704
25790
  }
25705
25791
  }
25706
25792
  /**
@@ -26042,15 +26128,7 @@ let RichTextEditor = class RichTextEditor extends Component {
26042
26128
  if (!isNullOrUndefined(this.toolbarModule)) {
26043
26129
  this.toolbarModule.destroy();
26044
26130
  }
26045
- if (!isNullOrUndefined(this.imageModule)) {
26046
- this.imageModule.moduleDestroy();
26047
- }
26048
- if (!isNullOrUndefined(this.linkModule)) {
26049
- this.linkModule.moduleDestroy();
26050
- }
26051
- if (!isNullOrUndefined(this.renderModule)) {
26052
- this.renderModule.moduleDestroy();
26053
- }
26131
+ this.notify(moduleDestroy, {});
26054
26132
  return;
26055
26133
  }
26056
26134
  this.notify(destroy, {});
@@ -27284,7 +27362,10 @@ let RichTextEditor = class RichTextEditor extends Component {
27284
27362
  restrict(e) {
27285
27363
  if (this.maxLength >= 0) {
27286
27364
  const element = this.editorMode === 'Markdown' ? this.contentModule.getText() :
27287
- e.currentTarget.textContent;
27365
+ (e && e.currentTarget.textContent);
27366
+ if (!element) {
27367
+ return;
27368
+ }
27288
27369
  const array = [8, 16, 17, 37, 38, 39, 40, 46, 65];
27289
27370
  let arrayKey;
27290
27371
  for (let i = 0; i <= array.length - 1; i++) {
@@ -27339,6 +27420,11 @@ let RichTextEditor = class RichTextEditor extends Component {
27339
27420
  case 'cut':
27340
27421
  this.onCut();
27341
27422
  break;
27423
+ case 'tab':
27424
+ if (this.iframeSettings.enable) {
27425
+ this.isBlur = true;
27426
+ }
27427
+ break;
27342
27428
  }
27343
27429
  if (e.callBack && (e.event.action === 'copy' || e.event.action === 'cut' || e.event.action === 'delete')) {
27344
27430
  e.callBack({
@@ -27655,5 +27741,5 @@ RichTextEditor = __decorate$1([
27655
27741
  * Rich Text Editor component exported items
27656
27742
  */
27657
27743
 
27658
- 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 };
27659
27745
  //# sourceMappingURL=ej2-richtexteditor.es2015.js.map