@syncfusion/ej2-richtexteditor 20.2.43 → 20.2.46

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 +22 -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 -37
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +121 -37
  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 +12 -3
  18. package/src/rich-text-editor/actions/full-screen.d.ts +1 -0
  19. package/src/rich-text-editor/actions/full-screen.js +6 -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 +8 -13
  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);
@@ -19611,6 +19664,7 @@ class FullScreen {
19611
19664
  baseToolbar: this.parent.getBaseToolbarObject()
19612
19665
  });
19613
19666
  }
19667
+ this.parent.refreshUI();
19614
19668
  this.parent.trigger(actionComplete, { requestType: 'Maximize', targetItem: 'Maximize', args: event });
19615
19669
  }
19616
19670
  });
@@ -19695,10 +19749,12 @@ class FullScreen {
19695
19749
  addEventListener() {
19696
19750
  this.parent.on(keyDown, this.onKeyDown, this);
19697
19751
  this.parent.on(destroy, this.destroy, this);
19752
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19698
19753
  }
19699
19754
  removeEventListener() {
19700
19755
  this.parent.off(keyDown, this.onKeyDown);
19701
19756
  this.parent.off(destroy, this.destroy);
19757
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19702
19758
  }
19703
19759
  /**
19704
19760
  * destroy method
@@ -19717,6 +19773,9 @@ class FullScreen {
19717
19773
  }
19718
19774
  this.removeEventListener();
19719
19775
  }
19776
+ moduleDestroy() {
19777
+ this.parent = null;
19778
+ }
19720
19779
  }
19721
19780
 
19722
19781
  /**
@@ -19830,11 +19889,6 @@ class Render {
19830
19889
  destroy() {
19831
19890
  this.removeEventListener();
19832
19891
  }
19833
- /**
19834
- * Clears the Render Module.
19835
- *
19836
- * @returns {void}
19837
- */
19838
19892
  moduleDestroy() {
19839
19893
  this.parent = null;
19840
19894
  }
@@ -19844,6 +19898,7 @@ class Render {
19844
19898
  }
19845
19899
  this.parent.on(modelChanged, this.refresh, this);
19846
19900
  this.parent.on(keyUp, this.keyUp, this);
19901
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19847
19902
  }
19848
19903
  removeEventListener() {
19849
19904
  if (this.parent.isDestroyed) {
@@ -19851,6 +19906,7 @@ class Render {
19851
19906
  }
19852
19907
  this.parent.off(modelChanged, this.refresh);
19853
19908
  this.parent.off(keyUp, this.keyUp);
19909
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19854
19910
  }
19855
19911
  keyUp(e) {
19856
19912
  if (this.parent.editorMode === 'HTML') {
@@ -19911,6 +19967,7 @@ class Link {
19911
19967
  this.parent.on(editAreaClick, this.editAreaClickHandler, this);
19912
19968
  this.parent.on(bindCssClass, this.setCssClass, this);
19913
19969
  this.parent.on(destroy, this.destroy, this);
19970
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
19914
19971
  }
19915
19972
  onToolbarAction(args) {
19916
19973
  const item = args.args.item;
@@ -19944,6 +20001,7 @@ class Link {
19944
20001
  this.parent.off(editAreaClick, this.editAreaClickHandler);
19945
20002
  this.parent.off(bindCssClass, this.setCssClass);
19946
20003
  this.parent.off(destroy, this.destroy);
20004
+ this.parent.off(moduleDestroy, this.moduleDestroy);
19947
20005
  }
19948
20006
  onIframeMouseDown() {
19949
20007
  if (this.dialogObj) {
@@ -20393,13 +20451,6 @@ class Link {
20393
20451
  destroy() {
20394
20452
  this.removeEventListener();
20395
20453
  }
20396
- /**
20397
- * Clears the Link Module.
20398
- *
20399
- * @returns {void}
20400
- * @hidden
20401
- * @deprecated
20402
- */
20403
20454
  moduleDestroy() {
20404
20455
  this.parent = null;
20405
20456
  }
@@ -20457,6 +20508,7 @@ class Image {
20457
20508
  this.parent.on(paste, this.imagePaste, this);
20458
20509
  this.parent.on(bindCssClass, this.setCssClass, this);
20459
20510
  this.parent.on(destroy, this.removeEventListener, this);
20511
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
20460
20512
  }
20461
20513
  removeEventListener() {
20462
20514
  if (this.parent.isDestroyed) {
@@ -20484,6 +20536,7 @@ class Image {
20484
20536
  this.parent.off(paste, this.imagePaste);
20485
20537
  this.parent.off(bindCssClass, this.setCssClass);
20486
20538
  this.parent.off(destroy, this.removeEventListener);
20539
+ this.parent.off(moduleDestroy, this.moduleDestroy);
20487
20540
  const dropElement = this.parent.iframeSettings.enable ? this.parent.inputElement.ownerDocument
20488
20541
  : this.parent.inputElement;
20489
20542
  dropElement.removeEventListener('drop', this.dragDrop.bind(this), true);
@@ -20856,6 +20909,10 @@ class Image {
20856
20909
  if (this.imgEle.offsetWidth >= this.parent.getInsertImgMaxWidth()) {
20857
20910
  this.imgEle.style.maxHeight = this.imgEle.offsetHeight + 'px';
20858
20911
  }
20912
+ else if (isNullOrUndefined(this.parent.insertImageSettings.maxHeight)) {
20913
+ this.imgEle.style.maxHeight = '';
20914
+ }
20915
+ this.imgEle.style.maxWidth = this.parent.getInsertImgMaxWidth() + 'px';
20859
20916
  const pageX = this.getPointX(e);
20860
20917
  const pageY = this.getPointY(e);
20861
20918
  const mouseX = (this.resizeBtnStat.botLeft || this.resizeBtnStat.topLeft) ? -(pageX - this.pageX) : (pageX - this.pageX);
@@ -21805,6 +21862,9 @@ class Image {
21805
21862
  if (target.nodeName === 'IMG') {
21806
21863
  this.imgEle = target;
21807
21864
  }
21865
+ if (!this.parent) {
21866
+ return;
21867
+ }
21808
21868
  if (target.nodeName !== '#document') {
21809
21869
  this.parent.currentTarget = e.target;
21810
21870
  }
@@ -22682,15 +22742,6 @@ class Image {
22682
22742
  this.prevSelectedImgEle = undefined;
22683
22743
  this.removeEventListener();
22684
22744
  }
22685
- /* eslint-disable */
22686
- /**
22687
- * Clears the ImageModule.
22688
- *
22689
- * @returns {void}
22690
- * @hidden
22691
- * @deprecated
22692
- */
22693
- /* eslint-enable */
22694
22745
  moduleDestroy() {
22695
22746
  this.parent = null;
22696
22747
  }
@@ -22729,6 +22780,7 @@ class ViewSource {
22729
22780
  this.parent.on(initialEnd, this.onInitialEnd, this);
22730
22781
  this.parent.on(updateSource, this.updateSourceCode, this);
22731
22782
  this.parent.on(destroy, this.destroy, this);
22783
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
22732
22784
  }
22733
22785
  onInitialEnd() {
22734
22786
  this.parent.formatter.editorManager.observer.on(KEY_DOWN_HANDLER, this.onKeyDown, this);
@@ -22739,6 +22791,7 @@ class ViewSource {
22739
22791
  this.parent.off(updateSource, this.updateSourceCode);
22740
22792
  this.parent.off(initialEnd, this.onInitialEnd);
22741
22793
  this.parent.off(destroy, this.destroy);
22794
+ this.parent.off(moduleDestroy, this.moduleDestroy);
22742
22795
  this.parent.formatter.editorManager.observer.off(KEY_DOWN_HANDLER, this.onKeyDown);
22743
22796
  }
22744
22797
  getSourceCode() {
@@ -22962,6 +23015,9 @@ class ViewSource {
22962
23015
  destroy() {
22963
23016
  this.removeEventListener();
22964
23017
  }
23018
+ moduleDestroy() {
23019
+ this.parent = null;
23020
+ }
22965
23021
  }
22966
23022
 
22967
23023
  /**
@@ -23000,6 +23056,7 @@ class Table {
23000
23056
  this.parent.on(mouseUp, this.selectionTable, this);
23001
23057
  this.parent.on(bindCssClass, this.setCssClass, this);
23002
23058
  this.parent.on(destroy, this.destroy, this);
23059
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
23003
23060
  }
23004
23061
  removeEventListener() {
23005
23062
  if (this.parent.isDestroyed) {
@@ -23021,6 +23078,7 @@ class Table {
23021
23078
  this.parent.off(mouseUp, this.selectionTable);
23022
23079
  this.parent.off(bindCssClass, this.setCssClass);
23023
23080
  this.parent.off(destroy, this.destroy);
23081
+ this.parent.off(moduleDestroy, this.moduleDestroy);
23024
23082
  }
23025
23083
  updateCss(currentObj, e) {
23026
23084
  if (currentObj && e.cssClass) {
@@ -24311,6 +24369,9 @@ class Table {
24311
24369
  destroy() {
24312
24370
  this.removeEventListener();
24313
24371
  }
24372
+ moduleDestroy() {
24373
+ this.parent = null;
24374
+ }
24314
24375
  /**
24315
24376
  * For internal use only - Get the module name.
24316
24377
  *
@@ -24327,6 +24388,21 @@ class Table {
24327
24388
  class DialogRenderer {
24328
24389
  constructor(parent) {
24329
24390
  this.parent = parent;
24391
+ this.addEventListener();
24392
+ }
24393
+ addEventListener() {
24394
+ if (this.parent.isDestroyed) {
24395
+ return;
24396
+ }
24397
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
24398
+ this.parent.on(destroy, this.removeEventListener, this);
24399
+ }
24400
+ removeEventListener() {
24401
+ if (this.parent.isDestroyed) {
24402
+ return;
24403
+ }
24404
+ this.parent.off(destroy, this.removeEventListener);
24405
+ this.parent.off(moduleDestroy, this.moduleDestroy);
24330
24406
  }
24331
24407
  /**
24332
24408
  * dialog render method
@@ -24380,6 +24456,9 @@ class DialogRenderer {
24380
24456
  close(args) {
24381
24457
  this.parent.trigger(dialogClose, args);
24382
24458
  }
24459
+ moduleDestroy() {
24460
+ this.parent = null;
24461
+ }
24383
24462
  }
24384
24463
 
24385
24464
  /**
@@ -24911,13 +24990,18 @@ class EnterKeyAction {
24911
24990
  addEventListener() {
24912
24991
  this.parent.on(enterHandler, this.enterHandler, this);
24913
24992
  this.parent.on(destroy, this.destroy, this);
24993
+ this.parent.on(moduleDestroy, this.moduleDestroy, this);
24914
24994
  }
24915
24995
  destroy() {
24916
24996
  this.removeEventListener();
24917
24997
  }
24998
+ moduleDestroy() {
24999
+ this.parent = null;
25000
+ }
24918
25001
  removeEventListener() {
24919
25002
  this.parent.off(enterHandler, this.enterHandler);
24920
25003
  this.parent.off(destroy, this.destroy);
25004
+ this.parent.off(moduleDestroy, this.moduleDestroy);
24921
25005
  }
24922
25006
  getRangeNode() {
24923
25007
  this.range = this.parent.getRange();
@@ -24937,7 +25021,7 @@ class EnterKeyAction {
24937
25021
  blockElement = curElement;
24938
25022
  curElement = curElement.parentElement;
24939
25023
  }
24940
- isTableEnter = blockElement.tagName === 'TD' ? false : true;
25024
+ isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
24941
25025
  }
24942
25026
  if (e.args.which === 13 && e.args.code === 'Enter') {
24943
25027
  if (isNullOrUndefined(this.startNode.closest('LI')) && isNullOrUndefined(this.endNode.closest('LI')) && isTableEnter &&
@@ -25023,7 +25107,10 @@ class EnterKeyAction {
25023
25107
  isFocusedFirst = true;
25024
25108
  }
25025
25109
  this.removeBRElement(nearBlockNode);
25026
- if (((this.range.startOffset === 0 && this.range.endOffset === 0) || isFocusedFirst) &&
25110
+ const fireFoxEnterAtMiddle = Browser.userAgent.indexOf('Firefox') != -1 && this.range.startOffset === 0 && this.range.startContainer === this.range.endContainer &&
25111
+ this.range.startContainer.nodeName === '#text' && !this.parent.formatter.editorManager.domNode.isBlockNode(this.range.startContainer.previousSibling) &&
25112
+ this.range.startContainer.parentElement === this.range.startContainer.previousSibling.parentElement;
25113
+ if (!fireFoxEnterAtMiddle && ((this.range.startOffset === 0 && this.range.endOffset === 0) || isFocusedFirst) &&
25027
25114
  !(!isNullOrUndefined(this.range.startContainer.previousSibling) &&
25028
25115
  (this.range.startContainer.previousSibling.nodeName === 'IMG' || this.range.startContainer.previousSibling.nodeName === 'BR'))) {
25029
25116
  let isNearBlockLengthZero;
@@ -25034,7 +25121,8 @@ class EnterKeyAction {
25034
25121
  isNearBlockLengthZero = false;
25035
25122
  }
25036
25123
  else {
25037
- if (nearBlockNode.textContent.trim().length !== 0) {
25124
+ if (nearBlockNode.textContent.trim().length !== 0 ||
25125
+ nearBlockNode.childNodes[0].nodeName === 'IMG') {
25038
25126
  newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
25039
25127
  isNearBlockLengthZero = false;
25040
25128
  }
@@ -25686,6 +25774,7 @@ let RichTextEditor = class RichTextEditor extends Component {
25686
25774
  const currentEndContainer = range.endContainer;
25687
25775
  const currentStartOffset = range.startOffset;
25688
25776
  const isSameContainer = currentStartContainer === currentEndContainer ? true : false;
25777
+ const currentEndOffset = currentEndContainer.textContent.length;
25689
25778
  const endNode = range.endContainer.nodeName === '#text' ? range.endContainer.parentElement :
25690
25779
  range.endContainer;
25691
25780
  const closestLI = closest(endNode, 'LI');
@@ -25701,7 +25790,7 @@ let RichTextEditor = class RichTextEditor extends Component {
25701
25790
  while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
25702
25791
  currentLastElem = currentLastElem.lastChild;
25703
25792
  }
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));
25793
+ 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
25794
  }
25706
25795
  }
25707
25796
  /**
@@ -26043,15 +26132,7 @@ let RichTextEditor = class RichTextEditor extends Component {
26043
26132
  if (!isNullOrUndefined(this.toolbarModule)) {
26044
26133
  this.toolbarModule.destroy();
26045
26134
  }
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
- }
26135
+ this.notify(moduleDestroy, {});
26055
26136
  return;
26056
26137
  }
26057
26138
  this.notify(destroy, {});
@@ -26394,7 +26475,7 @@ let RichTextEditor = class RichTextEditor extends Component {
26394
26475
  if (this.valueContainer) {
26395
26476
  this.valueContainer.value = (this.enableHtmlEncode) ? this.value : value;
26396
26477
  }
26397
- if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.trim() !== value.trim()) {
26478
+ if (this.editorMode === 'HTML' && this.inputElement && this.inputElement.innerHTML.replace('&', '&').trim() !== value.trim()) {
26398
26479
  this.inputElement.innerHTML = value;
26399
26480
  }
26400
26481
  else if (this.editorMode === 'Markdown' && this.inputElement
@@ -27285,7 +27366,10 @@ let RichTextEditor = class RichTextEditor extends Component {
27285
27366
  restrict(e) {
27286
27367
  if (this.maxLength >= 0) {
27287
27368
  const element = this.editorMode === 'Markdown' ? this.contentModule.getText() :
27288
- e.currentTarget.textContent;
27369
+ (e && e.currentTarget.textContent);
27370
+ if (!element) {
27371
+ return;
27372
+ }
27289
27373
  const array = [8, 16, 17, 37, 38, 39, 40, 46, 65];
27290
27374
  let arrayKey;
27291
27375
  for (let i = 0; i <= array.length - 1; i++) {
@@ -27661,5 +27745,5 @@ RichTextEditor = __decorate$1([
27661
27745
  * Rich Text Editor component exported items
27662
27746
  */
27663
27747
 
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 };
27748
+ 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
27749
  //# sourceMappingURL=ej2-richtexteditor.es2015.js.map