@syncfusion/ej2-richtexteditor 20.3.61 → 20.4.40

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 (101) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +4 -32
  3. package/README.md +53 -45
  4. package/dist/ej2-richtexteditor.min.js +2 -2
  5. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  6. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es2015.js +332 -187
  8. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  9. package/dist/es6/ej2-richtexteditor.es5.js +320 -174
  10. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  11. package/dist/global/ej2-richtexteditor.min.js +2 -2
  12. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +16 -16
  15. package/src/editor-manager/plugin/clearformat.js +2 -1
  16. package/src/editor-manager/plugin/dom-node.js +1 -1
  17. package/src/editor-manager/plugin/formats.js +1 -0
  18. package/src/editor-manager/plugin/image.js +1 -0
  19. package/src/editor-manager/plugin/link.js +3 -1
  20. package/src/editor-manager/plugin/lists.js +15 -7
  21. package/src/editor-manager/plugin/ms-word-clean-up.js +6 -2
  22. package/src/editor-manager/plugin/selection-commands.js +8 -41
  23. package/src/editor-manager/plugin/table.js +6 -0
  24. package/src/editor-manager/plugin/toolbar-status.js +3 -0
  25. package/src/editor-manager/plugin/video.js +2 -2
  26. package/src/markdown-parser/plugin/clearformat.js +9 -7
  27. package/src/markdown-parser/plugin/formats.js +6 -5
  28. package/src/markdown-parser/plugin/lists.js +5 -0
  29. package/src/markdown-parser/plugin/markdown-selection.js +3 -0
  30. package/src/markdown-parser/plugin/md-selection-formats.js +13 -10
  31. package/src/rich-text-editor/actions/enter-key.js +66 -15
  32. package/src/rich-text-editor/actions/file-manager.js +1 -0
  33. package/src/rich-text-editor/actions/full-screen.js +1 -0
  34. package/src/rich-text-editor/actions/html-attributes.js +8 -8
  35. package/src/rich-text-editor/actions/html-editor.js +18 -6
  36. package/src/rich-text-editor/actions/keyboard.js +4 -4
  37. package/src/rich-text-editor/actions/markdown-toolbar-status.js +2 -1
  38. package/src/rich-text-editor/actions/paste-clean-up.js +2 -1
  39. package/src/rich-text-editor/actions/toolbar.js +6 -1
  40. package/src/rich-text-editor/base/constant.d.ts +8 -8
  41. package/src/rich-text-editor/base/constant.js +8 -8
  42. package/src/rich-text-editor/base/rich-text-editor.d.ts +2 -0
  43. package/src/rich-text-editor/base/rich-text-editor.js +43 -10
  44. package/src/rich-text-editor/base/util.js +9 -9
  45. package/src/rich-text-editor/renderer/audio-module.d.ts +1 -1
  46. package/src/rich-text-editor/renderer/audio-module.js +7 -5
  47. package/src/rich-text-editor/renderer/image-module.js +10 -6
  48. package/src/rich-text-editor/renderer/link-module.js +5 -4
  49. package/src/rich-text-editor/renderer/table-module.js +19 -5
  50. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +1 -0
  51. package/src/rich-text-editor/renderer/toolbar-renderer.js +1 -0
  52. package/src/rich-text-editor/renderer/video-module.d.ts +1 -1
  53. package/src/rich-text-editor/renderer/video-module.js +13 -4
  54. package/src/rich-text-editor/services/renderer-factory.js +4 -4
  55. package/src/rich-text-editor/services/service-locator.js +4 -4
  56. package/src/selection/selection.js +2 -0
  57. package/styles/bootstrap-dark.css +12 -5
  58. package/styles/bootstrap.css +12 -5
  59. package/styles/bootstrap4.css +12 -5
  60. package/styles/bootstrap5-dark.css +12 -5
  61. package/styles/bootstrap5.css +12 -5
  62. package/styles/fabric-dark.css +12 -5
  63. package/styles/fabric.css +12 -5
  64. package/styles/fluent-dark.css +12 -5
  65. package/styles/fluent.css +12 -5
  66. package/styles/highcontrast-light.css +12 -5
  67. package/styles/highcontrast.css +12 -5
  68. package/styles/material-dark.css +12 -5
  69. package/styles/material.css +12 -5
  70. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +1 -0
  71. package/styles/rich-text-editor/_bootstrap-definition.scss +1 -0
  72. package/styles/rich-text-editor/_bootstrap4-definition.scss +1 -0
  73. package/styles/rich-text-editor/_bootstrap5-definition.scss +1 -0
  74. package/styles/rich-text-editor/_fabric-dark-definition.scss +1 -0
  75. package/styles/rich-text-editor/_fabric-definition.scss +1 -0
  76. package/styles/rich-text-editor/_fluent-definition.scss +1 -0
  77. package/styles/rich-text-editor/_fusionnew-definition.scss +1 -0
  78. package/styles/rich-text-editor/_highcontrast-definition.scss +1 -0
  79. package/styles/rich-text-editor/_highcontrast-light-definition.scss +1 -0
  80. package/styles/rich-text-editor/_material-dark-definition.scss +1 -0
  81. package/styles/rich-text-editor/_material-definition.scss +1 -0
  82. package/styles/rich-text-editor/_material3-definition.scss +1 -0
  83. package/styles/rich-text-editor/_tailwind-definition.scss +1 -0
  84. package/styles/rich-text-editor/_theme.scss +11 -6
  85. package/styles/rich-text-editor/bootstrap-dark.css +12 -5
  86. package/styles/rich-text-editor/bootstrap.css +12 -5
  87. package/styles/rich-text-editor/bootstrap4.css +12 -5
  88. package/styles/rich-text-editor/bootstrap5-dark.css +12 -5
  89. package/styles/rich-text-editor/bootstrap5.css +12 -5
  90. package/styles/rich-text-editor/fabric-dark.css +12 -5
  91. package/styles/rich-text-editor/fabric.css +12 -5
  92. package/styles/rich-text-editor/fluent-dark.css +12 -5
  93. package/styles/rich-text-editor/fluent.css +12 -5
  94. package/styles/rich-text-editor/highcontrast-light.css +12 -5
  95. package/styles/rich-text-editor/highcontrast.css +12 -5
  96. package/styles/rich-text-editor/material-dark.css +12 -5
  97. package/styles/rich-text-editor/material.css +12 -5
  98. package/styles/rich-text-editor/tailwind-dark.css +12 -5
  99. package/styles/rich-text-editor/tailwind.css +12 -5
  100. package/styles/tailwind-dark.css +12 -5
  101. package/styles/tailwind.css +12 -5
@@ -580,24 +580,24 @@ const imageRemoving = 'imageRemoving';
580
580
  */
581
581
  const fileSelected = 'fileSelected';
582
582
  /**
583
- * @hidden
584
- * @deprecated
585
- */
583
+ * @hidden
584
+ * @deprecated
585
+ */
586
586
  const fileUploading = 'fileUploading';
587
587
  /**
588
- * @hidden
589
- * @deprecated
590
- */
588
+ * @hidden
589
+ * @deprecated
590
+ */
591
591
  const fileUploadSuccess = 'fileUploadSuccess';
592
592
  /**
593
- * @hidden
594
- * @deprecated
595
- */
593
+ * @hidden
594
+ * @deprecated
595
+ */
596
596
  const fileUploadFailed = 'fileUploadFailed';
597
597
  /**
598
- * @hidden
599
- * @deprecated
600
- */
598
+ * @hidden
599
+ * @deprecated
600
+ */
601
601
  const fileRemoving = 'fileRemoving';
602
602
  /**
603
603
  * @hidden
@@ -2584,7 +2584,7 @@ function pageYOffset(e, parentElement, isIFrame) {
2584
2584
  */
2585
2585
  function getTooltipText(item, serviceLocator) {
2586
2586
  const i10n = serviceLocator.getService('rteLocale');
2587
- const itemLocale = toolsLocale[item];
2587
+ const itemLocale = toolsLocale[`${item}`];
2588
2588
  const tooltipText = i10n.getConstant(itemLocale);
2589
2589
  return tooltipText;
2590
2590
  }
@@ -2606,17 +2606,17 @@ function setToolbarStatus(e, isPopToolbar, self) {
2606
2606
  const itemStr = item && item.toLocaleLowerCase();
2607
2607
  if (item && (itemStr === key) || (item === 'UL' && key === 'unorderedlist') || (item === 'OL' && key === 'orderedlist') ||
2608
2608
  (itemStr === 'pre' && key === 'insertcode')) {
2609
- if (typeof data[key] === 'boolean') {
2610
- if (data[key] === true) {
2609
+ if (typeof data[`${key}`] === 'boolean') {
2610
+ if (data[`${key}`] === true) {
2611
2611
  addClass([e.tbElements[j]], [CLS_ACTIVE]);
2612
2612
  }
2613
2613
  else {
2614
2614
  removeClass([e.tbElements[j]], [CLS_ACTIVE]);
2615
2615
  }
2616
2616
  }
2617
- else if ((typeof data[key] === 'string' || data[key] === null) &&
2617
+ else if ((typeof data[`${key}`] === 'string' || data[`${key}`] === null) &&
2618
2618
  getIndex(key, e.parent.toolbarSettings.items) > -1) {
2619
- const value = ((data[key]) ? data[key] : '');
2619
+ const value = ((data[`${key}`]) ? data[`${key}`] : '');
2620
2620
  let result = '';
2621
2621
  switch (key) {
2622
2622
  case 'formats': {
@@ -2630,7 +2630,7 @@ function setToolbarStatus(e, isPopToolbar, self) {
2630
2630
  result = getDropDownValue(formatItems$$1, value, 'subCommand', 'text');
2631
2631
  dropDown.formatDropDown.content = ('<span style="display: inline-flex;' +
2632
2632
  'width:' + e.parent.format.width + '" >' +
2633
- '<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
2633
+ '<span class="e-rte-dropdown-btn-text' + (isNullOrUndefined(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
2634
2634
  + (isNullOrUndefined(result) ? formatContent : result) +
2635
2635
  '</span></span>');
2636
2636
  dropDown.formatDropDown.dataBind();
@@ -2660,7 +2660,7 @@ function setToolbarStatus(e, isPopToolbar, self) {
2660
2660
  e.tbElements[j].title = name;
2661
2661
  dropDown.fontNameDropDown.content = ('<span style="display: inline-flex;' +
2662
2662
  'width:' + e.parent.fontFamily.width + '" >' +
2663
- '<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
2663
+ '<span class="e-rte-dropdown-btn-text' + (isNullOrUndefined(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
2664
2664
  + name + '</span></span>');
2665
2665
  dropDown.fontNameDropDown.dataBind();
2666
2666
  break;
@@ -2676,7 +2676,7 @@ function setToolbarStatus(e, isPopToolbar, self) {
2676
2676
  result = getDropDownValue(fontSizeItems, (value === '' ? fontSizeContent.replace(/\s/g, '') : value), 'value', 'text');
2677
2677
  dropDown.fontSizeDropDown.content = ('<span style="display: inline-flex;' +
2678
2678
  'width:' + e.parent.fontSize.width + '" >' +
2679
- '<span class="e-rte-dropdown-btn-text' + ' ' + e.parent.cssClass + '">'
2679
+ '<span class="e-rte-dropdown-btn-text' + (isNullOrUndefined(e.parent.cssClass) ? '' : ' ' + e.parent.cssClass) + '">'
2680
2680
  + getFormattedFontSize(result) + '</span></span>');
2681
2681
  dropDown.fontSizeDropDown.dataBind();
2682
2682
  break;
@@ -2757,7 +2757,7 @@ function updateUndoRedoStatus(baseToolbar, undoRedoStatus) {
2757
2757
  for (const key of keys) {
2758
2758
  const target = tbItems[trgItems[i]];
2759
2759
  if (target) {
2760
- baseToolbar.toolbarObj.enableItems(target, undoRedoStatus[key]);
2760
+ baseToolbar.toolbarObj.enableItems(target, undoRedoStatus[`${key}`]);
2761
2761
  }
2762
2762
  i++;
2763
2763
  }
@@ -3308,6 +3308,7 @@ class ToolbarRenderer {
3308
3308
  * @param {IColorPickerModel} args - specifies the arguments.
3309
3309
  * @param {string} item - specifies the item.
3310
3310
  * @param {ColorPicker} colorPicker - specifies the colorpicker.
3311
+ * @param {string} defaultColor -specifies the defaultColor.
3311
3312
  * @returns {void}
3312
3313
  * @hidden
3313
3314
  * @deprecated
@@ -4304,8 +4305,8 @@ class ServiceLocator {
4304
4305
  */
4305
4306
  /* eslint-enable */
4306
4307
  register(name, type) {
4307
- if (isNullOrUndefined(this.services[name])) {
4308
- this.services[name] = type;
4308
+ if (isNullOrUndefined(this.services[`${name}`])) {
4309
+ this.services[`${name}`] = type;
4309
4310
  }
4310
4311
  }
4311
4312
  /**
@@ -4317,11 +4318,11 @@ class ServiceLocator {
4317
4318
  * @deprecated
4318
4319
  */
4319
4320
  getService(name) {
4320
- if (isNullOrUndefined(this.services[name])) {
4321
+ if (isNullOrUndefined(this.services[`${name}`])) {
4321
4322
  // eslint-disable-next-line
4322
4323
  throw `The service ${name} is not registered`;
4323
4324
  }
4324
- return this.services[name];
4325
+ return this.services[`${name}`];
4325
4326
  }
4326
4327
  }
4327
4328
 
@@ -4346,8 +4347,8 @@ class RendererFactory {
4346
4347
  */
4347
4348
  addRenderer(name, type) {
4348
4349
  const rName = getEnumValue(RenderType, name);
4349
- if (isNullOrUndefined(this.rendererMap[rName])) {
4350
- this.rendererMap[rName] = type;
4350
+ if (isNullOrUndefined(this.rendererMap[`${rName}`])) {
4351
+ this.rendererMap[`${rName}`] = type;
4351
4352
  }
4352
4353
  }
4353
4354
  /**
@@ -4360,12 +4361,12 @@ class RendererFactory {
4360
4361
  */
4361
4362
  getRenderer(name) {
4362
4363
  const rName = getEnumValue(RenderType, name);
4363
- if (isNullOrUndefined(this.rendererMap[rName])) {
4364
+ if (isNullOrUndefined(this.rendererMap[`${rName}`])) {
4364
4365
  // eslint-disable-next-line
4365
4366
  throw `The renderer ${rName} is not found`;
4366
4367
  }
4367
4368
  else {
4368
- return this.rendererMap[rName];
4369
+ return this.rendererMap[`${rName}`];
4369
4370
  }
4370
4371
  }
4371
4372
  }
@@ -4566,6 +4567,7 @@ class Toolbar$2 {
4566
4567
  this.isTransformChild = false;
4567
4568
  const transformElements = selectAll('[style*="transform"]', document);
4568
4569
  for (let i = 0; i < transformElements.length; i++) {
4570
+ // eslint-disable-next-line max-len
4569
4571
  if (!isNullOrUndefined(transformElements[i].contains) && transformElements[i].contains(this.parent.element)) {
4570
4572
  this.isTransformChild = true;
4571
4573
  break;
@@ -4736,7 +4738,10 @@ class Toolbar$2 {
4736
4738
  * @deprecated
4737
4739
  */
4738
4740
  updateItem(args) {
4739
- const item = this.tools[args.updateItem.toLocaleLowerCase()];
4741
+ let item = this.tools[args.updateItem.toLocaleLowerCase()];
4742
+ if (this.parent.locale !== 'en-US') {
4743
+ item.tooltip = getTooltipText(args.updateItem.toLocaleLowerCase(), this.locator);
4744
+ }
4740
4745
  const trgItem = this.tools[args.targetItem.toLocaleLowerCase()];
4741
4746
  const index = getTBarItemsIndex(getCollection(trgItem.subCommand), args.baseToolbar.toolbarObj.items)[0];
4742
4747
  if (!isNullOrUndefined(index)) {
@@ -5064,6 +5069,7 @@ class Toolbar$2 {
5064
5069
  this.parent.off(toolbarClick, this.toolbarClickHandler);
5065
5070
  }
5066
5071
  }
5072
+ // eslint-disable-next-line @typescript-eslint/tslint/config
5067
5073
  setCssClass(e) {
5068
5074
  if (this.toolbarObj && e.cssClass) {
5069
5075
  if (isNullOrUndefined(e.oldCssClass)) {
@@ -5232,7 +5238,7 @@ let KeyboardEvents$1 = KeyboardEvents_1 = class KeyboardEvents$$1 extends Base {
5232
5238
  const curkeyCode = e.which;
5233
5239
  const keys = Object.keys(this.keyConfigs);
5234
5240
  for (const key of keys) {
5235
- const configCollection = this.keyConfigs[key].split(',');
5241
+ const configCollection = this.keyConfigs[`${key}`].split(',');
5236
5242
  for (const rconfig of configCollection) {
5237
5243
  const rKeyObj = KeyboardEvents_1.getKeyConfigData(rconfig.trim());
5238
5244
  if (isAltKey === rKeyObj.altKey && (isCtrlKey === rKeyObj.ctrlKey || isMetaKey) &&
@@ -5303,7 +5309,7 @@ let KeyboardEvents$1 = KeyboardEvents_1 = class KeyboardEvents$$1 extends Base {
5303
5309
  */
5304
5310
  static getKeyConfigData(config) {
5305
5311
  if (config in this.configCache) {
5306
- return this.configCache[config];
5312
+ return this.configCache[`${config}`];
5307
5313
  }
5308
5314
  const keys = config.toLowerCase().split('+');
5309
5315
  const keyData = {
@@ -5318,12 +5324,12 @@ let KeyboardEvents$1 = KeyboardEvents_1 = class KeyboardEvents$$1 extends Base {
5318
5324
  else {
5319
5325
  keyData.keyCode = KeyboardEvents_1.getKeyCode(keys[keys.length - 1]);
5320
5326
  }
5321
- KeyboardEvents_1.configCache[config] = keyData;
5327
+ KeyboardEvents_1.configCache[`${config}`] = keyData;
5322
5328
  return keyData;
5323
5329
  }
5324
5330
  // Return the keycode value as string
5325
5331
  static getKeyCode(keyVal) {
5326
- return keyCode[keyVal] || keyVal.toUpperCase().charCodeAt(0);
5332
+ return keyCode[`${keyVal}`] || keyVal.toUpperCase().charCodeAt(0);
5327
5333
  }
5328
5334
  };
5329
5335
  KeyboardEvents$1.configCache = {};
@@ -6852,7 +6858,9 @@ class MarkdownSelection {
6852
6858
  let isStart = false;
6853
6859
  if (line) {
6854
6860
  const reg = line.trim() === command.trim() ?
6861
+ // eslint-disable-next-line
6855
6862
  new RegExp('^(' + this.replaceSpecialChar(command.trim()) + ')', 'gim') :
6863
+ // eslint-disable-next-line
6856
6864
  new RegExp('^(' + this.replaceSpecialChar(command) + ')', 'gim');
6857
6865
  isStart = reg.test(line.trim());
6858
6866
  }
@@ -6882,6 +6890,7 @@ class MarkdownSelection {
6882
6890
  isClear(parents, regex) {
6883
6891
  const isClear = false;
6884
6892
  for (let i = 0; i < parents.length; i++) {
6893
+ // eslint-disable-next-line
6885
6894
  if (new RegExp(regex, 'gim').test(parents[i].text)) {
6886
6895
  return true;
6887
6896
  }
@@ -7131,7 +7140,7 @@ class MarkdownToolbarStatus {
7131
7140
  }
7132
7141
  else {
7133
7142
  for (let i = 0; i < lines.length; i++) {
7134
- if (!this.selection.isStartWith(lines[i].text, this.parent.formatter.listTags[type])) {
7143
+ if (!this.selection.isStartWith(lines[i].text, this.parent.formatter.listTags[`${type}`])) {
7135
7144
  isApply = false;
7136
7145
  break;
7137
7146
  }
@@ -7191,6 +7200,7 @@ class MarkdownToolbarStatus {
7191
7200
  return text.search('\\' + cmd + '') !== -1;
7192
7201
  }
7193
7202
  multiCharRegx(cmd) {
7203
+ // eslint-disable-next-line
7194
7204
  return new RegExp('(\\' + cmd + ')', 'g');
7195
7205
  }
7196
7206
  }
@@ -7643,6 +7653,7 @@ class MDLists {
7643
7653
  const regex = this.getListRegex();
7644
7654
  this.currentAction = this.getAction(parents[0].text);
7645
7655
  for (let i = 0; i < parents.length; i++) {
7656
+ // eslint-disable-next-line max-len
7646
7657
  let prevIndex = event.event.shiftKey ? parents[i].line - 1 : parents[i].line - 1;
7647
7658
  let prevLine = this.selection.getLine(textArea, prevIndex);
7648
7659
  if (prevLine && (!event.event.shiftKey && isNotFirst || (event.event.shiftKey))) {
@@ -7690,6 +7701,7 @@ class MDLists {
7690
7701
  addedLength += tabSpaceLength;
7691
7702
  if (parents.length !== 1) {
7692
7703
  for (let j = i; j < parents.length; j++) {
7704
+ // eslint-disable-next-line max-len
7693
7705
  parents[j].start = j !== 0 ? parents[j].start + tabSpaceLength : parents[j].start;
7694
7706
  parents[j].end = parents[j].end + tabSpaceLength;
7695
7707
  }
@@ -7820,6 +7832,7 @@ class MDLists {
7820
7832
  const ol = line.split('. ')[0];
7821
7833
  // eslint-disable-next-line
7822
7834
  const currentState = /^\d+$/.test(ol.trim());
7835
+ // eslint-disable-next-line
7823
7836
  const ul = line.trim().split(new RegExp('^(' + this.selection.replaceSpecialChar(this.syntax.UL).trim() + ')'))[1];
7824
7837
  return (currentState ? 'OL' : ul ? 'UL' : 'NOTLIST');
7825
7838
  }
@@ -7979,6 +7992,7 @@ class MDLists {
7979
7992
  }
7980
7993
  appliedLine(line, prefixPattern, perfixObj, preTabSpaceLength) {
7981
7994
  const points = {};
7995
+ // eslint-disable-next-line
7982
7996
  const regex = new RegExp('^[' + this.syntax.UL.trim() + ']');
7983
7997
  const lineSplit = line.split('. ');
7984
7998
  const currentPrefix = lineSplit[0] + '. ';
@@ -8041,6 +8055,7 @@ class MDLists {
8041
8055
  regex += regex === '' ? '^(' + syntax + ')|^(' + syntax.trim() + ')' :
8042
8056
  '|^(' + syntax + ')|^(' + syntax.trim() + ')';
8043
8057
  }
8058
+ // eslint-disable-next-line
8044
8059
  return new RegExp(regex);
8045
8060
  }
8046
8061
  }
@@ -8165,6 +8180,7 @@ class MDFormats {
8165
8180
  if (configKey[j] === command) {
8166
8181
  continue;
8167
8182
  }
8183
+ // eslint-disable-next-line
8168
8184
  const regex = new RegExp('^(' + this.selection.replaceSpecialChar(removeText) + ')', 'gim');
8169
8185
  if (regex.test(parents[i].text)) {
8170
8186
  parents[i].text = parents[i].text.replace(regex, '');
@@ -8207,14 +8223,14 @@ class MDFormats {
8207
8223
  !this.selection.isStartWith(lastNextText, this.syntax.pre.split('\n')[0])) {
8208
8224
  const lines = textArea.value.substring(start, end).split('\n');
8209
8225
  const lastLine = lines[lines.length - 1] === '' ? '' : '\n';
8210
- textArea.value = textArea.value.substr(0, start) + this.syntax[command] + textArea.value.substring(start, end) +
8211
- lastLine + this.syntax[command] +
8226
+ textArea.value = textArea.value.substr(0, start) + this.syntax[`${command}`] + textArea.value.substring(start, end) +
8227
+ lastLine + this.syntax[`${command}`] +
8212
8228
  textArea.value.substr(end, textArea.value.length);
8213
- start = this.selection.selectionStart + this.syntax[command].length;
8214
- end = this.selection.selectionEnd + this.syntax[command].length - 1;
8229
+ start = this.selection.selectionStart + this.syntax[`${command}`].length;
8230
+ end = this.selection.selectionEnd + this.syntax[`${command}`].length - 1;
8215
8231
  }
8216
8232
  else {
8217
- const cmd = this.syntax[command];
8233
+ const cmd = this.syntax[`${command}`];
8218
8234
  const selection = this.parent.markdownSelection.getSelectedInlinePoints(textArea);
8219
8235
  const startNo = textArea.value.substr(0, textArea.selectionStart).lastIndexOf(cmd);
8220
8236
  let endNo = textArea.value.substr(textArea.selectionEnd, textArea.selectionEnd).indexOf(cmd);
@@ -8341,9 +8357,11 @@ class MDSelectionFormats {
8341
8357
  return matchText;
8342
8358
  }
8343
8359
  multiCharRegx(cmd) {
8360
+ // eslint-disable-next-line
8344
8361
  return new RegExp('(\\' + cmd + '\\' + cmd + ')', 'g');
8345
8362
  }
8346
8363
  singleCharRegx(cmd) {
8364
+ // eslint-disable-next-line
8347
8365
  return new RegExp('(\\' + cmd + ')', 'g');
8348
8366
  }
8349
8367
  isAppliedCommand(cmd) {
@@ -8531,22 +8549,22 @@ class MDSelectionFormats {
8531
8549
  }
8532
8550
  }
8533
8551
  textReplace(text, command) {
8534
- let regx = this.singleCharRegx(this.syntax[command]);
8552
+ let regx = this.singleCharRegx(this.syntax[`${command}`]);
8535
8553
  switch (command) {
8536
8554
  case 'Bold':
8537
- regx = this.multiCharRegx(this.syntax[command].substr(0, 1));
8555
+ regx = this.multiCharRegx(this.syntax[`${command}`].substr(0, 1));
8538
8556
  text = text.replace(regx, '');
8539
8557
  break;
8540
8558
  case 'Italic':
8541
- if (!this.isBold(text, this.syntax[command].substr(0, 1))) {
8559
+ if (!this.isBold(text, this.syntax[`${command}`].substr(0, 1))) {
8542
8560
  text = text.replace(regx, '');
8543
8561
  }
8544
8562
  else {
8545
- const regxB = this.multiCharRegx(this.syntax[command].substr(0, 1));
8563
+ const regxB = this.multiCharRegx(this.syntax[`${command}`].substr(0, 1));
8546
8564
  let repText = text;
8547
8565
  repText = repText.replace(regxB, '$%@').replace(regx, '');
8548
8566
  const regxTemp = new RegExp('\\$%@', 'g');
8549
- text = repText.replace(regxTemp, this.syntax[command].substr(0, 1) + this.syntax[command].substr(0, 1));
8567
+ text = repText.replace(regxTemp, this.syntax[`${command}`].substr(0, 1) + this.syntax[`${command}`].substr(0, 1));
8550
8568
  }
8551
8569
  break;
8552
8570
  case 'StrikeThrough':
@@ -8565,23 +8583,24 @@ class MDSelectionFormats {
8565
8583
  return text;
8566
8584
  }
8567
8585
  isApplied(line, command) {
8568
- let regx = this.singleCharRegx(this.syntax[command]);
8586
+ let regx = this.singleCharRegx(this.syntax[`${command}`]);
8569
8587
  switch (command) {
8570
8588
  case 'SubScript':
8571
8589
  case 'SuperScript':
8572
- regx = this.singleCharRegx(this.syntax[command]);
8590
+ regx = this.singleCharRegx(this.syntax[`${command}`]);
8573
8591
  return regx.test(line.text);
8574
8592
  case 'Bold':
8575
8593
  case 'StrikeThrough':
8576
- regx = this.multiCharRegx(this.syntax[command].substr(0, 1));
8594
+ regx = this.multiCharRegx(this.syntax[`${command}`].substr(0, 1));
8577
8595
  return regx.test(line.text);
8578
8596
  case 'UpperCase':
8579
8597
  case 'LowerCase':
8580
- regx = new RegExp('^[' + this.syntax[command] + ']*$', 'g');
8598
+ // eslint-disable-next-line
8599
+ regx = new RegExp('^[' + this.syntax[`${command}`] + ']*$', 'g');
8581
8600
  return regx.test(line.text);
8582
8601
  case 'Italic': {
8583
8602
  let regTest;
8584
- const regxB = this.multiCharRegx(this.syntax[command].substr(0, 1));
8603
+ const regxB = this.multiCharRegx(this.syntax[`${command}`].substr(0, 1));
8585
8604
  if (regxB.test(line.text)) {
8586
8605
  let repText = line.text;
8587
8606
  repText = repText.replace(regxB, '$%#');
@@ -9234,23 +9253,25 @@ class ClearFormat {
9234
9253
  const key = keys[num];
9235
9254
  // eslint-disable-next-line
9236
9255
  if (data.hasOwnProperty(key) && data[key] !== '') {
9237
- const expString = this.replaceRegex(data[key]);
9256
+ const expString = this.replaceRegex(data[`${key}`]);
9238
9257
  let regExp;
9239
- const startExp = data[key].length;
9240
- const endExp = (data[key] === '<sup>' || data[key] === '<sub>') ? data[key].length + 1 : data[key].length;
9241
- if (data[key] === '<sup>') {
9258
+ const startExp = data[`${key}`].length;
9259
+ const endExp = (data[`${key}`] === '<sup>' || data[`${key}`] === '<sub>') ? data[`${key}`].length + 1 : data[`${key}`].length;
9260
+ if (data[`${key}`] === '<sup>') {
9242
9261
  // eslint-disable-next-line
9243
9262
  regExp = new RegExp('<sup>(.*?)<\/sup>', 'ig');
9244
9263
  }
9245
- else if (data[key] === '<sub>') {
9264
+ else if (data[`${key}`] === '<sub>') {
9246
9265
  // eslint-disable-next-line
9247
9266
  regExp = new RegExp('<sub>(.*?)<\/sub>', 'ig');
9248
9267
  }
9249
9268
  else {
9269
+ // eslint-disable-next-line
9250
9270
  regExp = new RegExp(expString + '(.*?)' + expString, 'ig');
9251
9271
  }
9252
9272
  const val = text.match(regExp);
9253
9273
  for (let index = 0; val && index < val.length && val[index] !== ''; index++) {
9274
+ // eslint-disable-next-line max-len
9254
9275
  text = text.replace(val[index], val[index].substr(startExp, val[index].length - endExp - startExp));
9255
9276
  }
9256
9277
  }
@@ -9272,8 +9293,8 @@ class ClearFormat {
9272
9293
  const key = keys[index];
9273
9294
  // eslint-disable-next-line
9274
9295
  if (data.hasOwnProperty(key) && data[key] !== '') {
9275
- if (lines[len].indexOf(data[key]) === 0) {
9276
- lines[len] = lines[len].replace(data[key], '');
9296
+ if (lines[len].indexOf(data[`${key}`]) === 0) {
9297
+ lines[len] = lines[len].replace(data[`${key}`], '');
9277
9298
  lines[len] = this.clearFormatLines([lines[len]]);
9278
9299
  }
9279
9300
  }
@@ -10056,6 +10077,7 @@ class NodeSelection {
10056
10077
  */
10057
10078
  getSelectionNodes(nodeCollection) {
10058
10079
  nodeCollection = nodeCollection.reverse();
10080
+ // eslint-disable-next-line
10059
10081
  const regEx = new RegExp(String.fromCharCode(8203), 'g');
10060
10082
  for (let index = 0; index < nodeCollection.length; index++) {
10061
10083
  if (nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === '' ||
@@ -10076,6 +10098,7 @@ class NodeSelection {
10076
10098
  */
10077
10099
  getSelectionNodesBr(nodeCollection) {
10078
10100
  nodeCollection = nodeCollection.reverse();
10101
+ // eslint-disable-next-line
10079
10102
  const regEx = new RegExp(String.fromCharCode(8203), 'g');
10080
10103
  for (let index = 0; index < nodeCollection.length; index++) {
10081
10104
  if (nodeCollection[index].nodeName !== 'BR' &&
@@ -10408,7 +10431,7 @@ class DOMNode {
10408
10431
  const orderRawAttr = Object.keys(rawAttr).sort();
10409
10432
  for (let e = 0; e < orderRawAttr.length; e++) {
10410
10433
  const attrKey = orderRawAttr[e];
10411
- let attrValue = rawAttr[attrKey];
10434
+ let attrValue = rawAttr[`${attrKey}`];
10412
10435
  /* eslint-disable */
10413
10436
  if (attrValue.indexOf("'") < 0 && attrValue.indexOf('"') >= 0) {
10414
10437
  attr += ' ' + attrKey + "='" + attrValue + "'";
@@ -11159,8 +11182,15 @@ class Lists {
11159
11182
  range.startContainer.parentElement.closest('LI');
11160
11183
  const endNode = range.endContainer.nodeName === 'LI' ? range.endContainer :
11161
11184
  range.endContainer.parentElement.closest('LI');
11185
+ // Checks for Image, Audio , Video Element inside List Element
11186
+ let hasMediaElem = false;
11187
+ if (!isNullOrUndefined(startNode)) {
11188
+ const videoElemList = startNode.querySelectorAll('.e-video-clickelem');
11189
+ const embedVideoElem = videoElemList.length > 0 && videoElemList[0].childNodes[0].nodeName === 'IFRAME';
11190
+ hasMediaElem = startNode.querySelectorAll('IMG').length > 0 || startNode.querySelectorAll('AUDIO').length > 0 || startNode.querySelectorAll('VIDEO').length > 0 || embedVideoElem;
11191
+ }
11162
11192
  if (!isNullOrUndefined(startNode) && !isNullOrUndefined(endNode) && startNode === endNode && startNode.tagName === 'LI' &&
11163
- startNode.textContent.trim() === '' && startNode.querySelectorAll('IMG').length === 0) {
11193
+ startNode.textContent.trim() === '' && !hasMediaElem) {
11164
11194
  if (startNode.innerHTML.indexOf('&nbsp;') >= 0) {
11165
11195
  return;
11166
11196
  }
@@ -11197,7 +11227,6 @@ class Lists {
11197
11227
  }
11198
11228
  }
11199
11229
  }
11200
- // eslint-disable-next-line
11201
11230
  backspaceList(e) {
11202
11231
  const range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
11203
11232
  let startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
@@ -11283,7 +11312,8 @@ class Lists {
11283
11312
  detach(currentLIElem);
11284
11313
  }
11285
11314
  }
11286
- firstListBackSpace(range, e) {
11315
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11316
+ firstListBackSpace(range, _e) {
11287
11317
  const startNode = this.parent.domNode.getSelectedNode(range.startContainer, range.startOffset);
11288
11318
  if (!isNullOrUndefined(startNode.closest('OL'))) {
11289
11319
  this.commonLIParent = startNode.closest('OL');
@@ -11546,6 +11576,7 @@ class Lists {
11546
11576
  range.startOffset]) || range.startContainer);
11547
11577
  const endNode = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) :
11548
11578
  range.endOffset] || range.endContainer);
11579
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11549
11580
  let lastSelectionNode = endNode.lastChild.nodeName === 'BR' ? (isNullOrUndefined(endNode.lastChild.previousSibling) ? endNode
11550
11581
  : endNode.lastChild.previousSibling) : endNode.lastChild;
11551
11582
  while (!isNullOrUndefined(lastSelectionNode) && lastSelectionNode.nodeName !== '#text' && lastSelectionNode.nodeName !== 'IMG' &&
@@ -11686,8 +11717,8 @@ class Lists {
11686
11717
  const openTag = '<' + type + '>';
11687
11718
  const closeTag = '</' + type + '>';
11688
11719
  const newTag = 'li' + elemAtt;
11689
- const replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ? elements[i].innerHTML :
11690
- elements[i].outerHTML);
11720
+ const replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
11721
+ elements[i].innerHTML : elements[i].outerHTML);
11691
11722
  const innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
11692
11723
  const collectionString = openTag + innerHTML + closeTag;
11693
11724
  this.domNode.replaceWith(elements[i], collectionString);
@@ -11698,8 +11729,8 @@ class Lists {
11698
11729
  const openTag = '<' + type + elemAtt + '>';
11699
11730
  const closeTag = '</' + type + '>';
11700
11731
  const newTag = 'li';
11701
- const replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ? elements[i].innerHTML :
11702
- elements[i].outerHTML);
11732
+ const replaceHTML = (elements[i].tagName.toLowerCase() === DEFAULT_TAG ?
11733
+ elements[i].innerHTML : elements[i].outerHTML);
11703
11734
  const innerHTML = this.domNode.createTagString(newTag, null, replaceHTML);
11704
11735
  const collectionString = openTag + innerHTML + closeTag;
11705
11736
  this.domNode.replaceWith(elements[i], collectionString);
@@ -12312,6 +12343,7 @@ class Formats {
12312
12343
  }
12313
12344
  }
12314
12345
  removeCodeContent(range) {
12346
+ // eslint-disable-next-line
12315
12347
  const regEx = new RegExp(String.fromCharCode(65279), 'g');
12316
12348
  if (!isNullOrUndefined(range.endContainer.textContent.match(regEx))) {
12317
12349
  const pointer = range.endContainer.textContent.charCodeAt(range.endOffset - 1) === 65279 ?
@@ -13212,7 +13244,8 @@ class LinkCommand {
13212
13244
  finalinlineNodes[j] = inlineNodes[i];
13213
13245
  }
13214
13246
  if (inlineNodes.length > 1 && i < inlineNodes.length - 1) {
13215
- if ((inlineNodes[i].parentElement === inlineNodes[i + 1].parentElement) && (inlineNodes[i] === inlineNodes[i + 1])) {
13247
+ if ((inlineNodes[i].parentElement === inlineNodes[i + 1].parentElement) &&
13248
+ (inlineNodes[i] === inlineNodes[i + 1])) {
13216
13249
  continue;
13217
13250
  }
13218
13251
  else {
@@ -13309,6 +13342,7 @@ class LinkCommand {
13309
13342
  return arr.join(' ') + ' ';
13310
13343
  }
13311
13344
  openLink(e) {
13345
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
13312
13346
  document.defaultView.open(e.item.url, e.item.target);
13313
13347
  this.callBack(e);
13314
13348
  }
@@ -13772,6 +13806,7 @@ class ImageCommand {
13772
13806
  this.callBack(e);
13773
13807
  }
13774
13808
  openImageLink(e) {
13809
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
13775
13810
  document.defaultView.open(e.item.url, e.item.target);
13776
13811
  this.callBack(e);
13777
13812
  }
@@ -14254,8 +14289,8 @@ class VideoCommand {
14254
14289
  videoElm.load();
14255
14290
  }
14256
14291
  if (Browser.userAgent.indexOf('Firefox') !== -1) {
14257
- vidElement.addEventListener('play', (args) => { this.editAreaVideoClick(e); });
14258
- vidElement.addEventListener('pause', (args) => { this.editAreaVideoClick(e); });
14292
+ vidElement.addEventListener('play', () => { this.editAreaVideoClick(e); });
14293
+ vidElement.addEventListener('pause', () => { this.editAreaVideoClick(e); });
14259
14294
  }
14260
14295
  }
14261
14296
  }
@@ -14494,6 +14529,7 @@ class TableCommand {
14494
14529
  const newRow = createElement('tr');
14495
14530
  const isHeaderSelect = this.curTable.querySelectorAll('th.e-cell-select').length > 0;
14496
14531
  for (let i = 0; i < allCells[minVal].length; i++) {
14532
+ // eslint-disable-next-line max-len
14497
14533
  if (isBelow && minVal < allCells.length - 1 && allCells[minVal][i] === allCells[minVal + 1][i] ||
14498
14534
  !isBelow && 0 < minVal && allCells[minVal][i] === allCells[minVal - 1][i]) {
14499
14535
  if (0 === i || 0 < i && allCells[minVal][i] !== allCells[minVal][i - 1]) {
@@ -14673,10 +14709,12 @@ class TableCommand {
14673
14709
  1 === rowSpanVal ? allCells[maxI][j].removeAttribute('rowspan') : allCells[maxI][j].setAttribute('rowspan', rowSpanVal.toString());
14674
14710
  }
14675
14711
  }
14712
+ // eslint-disable-next-line max-len
14676
14713
  if (maxI < allCells.length - 1 && allCells[maxI][j] === allCells[maxI + 1][j] && (0 === maxI ||
14677
14714
  allCells[maxI][j] !== allCells[maxI - 1][j])) {
14678
14715
  const element = allCells[maxI][j];
14679
14716
  let index;
14717
+ // eslint-disable-next-line max-len
14680
14718
  for (index = j; 0 < index && allCells[maxI][index] === allCells[maxI][index - 1]; index--) {
14681
14719
  if (index === 0) {
14682
14720
  this.curTable.rows[maxI + 1].prepend(element);
@@ -14889,6 +14927,7 @@ class TableCommand {
14889
14927
  for (rowValue = min; rowValue <= max; rowValue++) {
14890
14928
  // eslint-disable-next-line
14891
14929
  if (!(min < rowValue && eleArray[rowValue][0] === eleArray[rowValue - 1][0])
14930
+ // eslint-disable-next-line no-cond-assign
14892
14931
  && eleArray[rowValue][0] && 1 < (index = Math.min(parseInt(eleArray[rowValue][0].getAttribute('rowspan'), 10) ||
14893
14932
  1, max - min + 1)) && eleArray[rowValue][0] === eleArray[rowValue + 1][0]) {
14894
14933
  for (count = index - 1, colIndex = 1; colIndex < eleArray[0].length; colIndex++) {
@@ -14925,6 +14964,7 @@ class TableCommand {
14925
14964
  min < rowIndex && elements[rowIndex][colIndex] === elements[rowIndex - 1][colIndex] ||
14926
14965
  firstIndex < colIndex && elements[rowIndex][colIndex] === elements[rowIndex][colIndex - 1] ||
14927
14966
  1 < (spanCount = parseInt(elements[rowIndex][colIndex].getAttribute(attr), 10) || 1) &&
14967
+ // eslint-disable-next-line max-len
14928
14968
  (1 < spanCount - index ? elements[rowIndex][colIndex].setAttribute(attr, (spanCount - index).toString()) :
14929
14969
  elements[rowIndex][colIndex].removeAttribute(attr));
14930
14970
  }
@@ -14988,6 +15028,7 @@ class TableCommand {
14988
15028
  let colIndex;
14989
15029
  for (avgRowIndex = activeCellIndex[0] + Math.ceil(activeCellRowSpan / 2), colIndex = 0 === activeCellIndex[1] ? activeCellIndex[1]
14990
15030
  : activeCellIndex[1] - 1; 0 <= colIndex && (correspondingCells[avgRowIndex][colIndex] ===
15031
+ // eslint-disable-next-line max-len
14991
15032
  correspondingCells[avgRowIndex][colIndex - 1] || 0 < avgRowIndex && correspondingCells[avgRowIndex][colIndex]
14992
15033
  === correspondingCells[avgRowIndex - 1][colIndex]);) {
14993
15034
  colIndex--;
@@ -15525,7 +15566,7 @@ class SelectionCommands {
15525
15566
  const currentFormatNode = isFormatted.getFormattedNode(range.startContainer, format, endNode);
15526
15567
  const currentSelector = !isNullOrUndefined(currentFormatNode) ?
15527
15568
  (currentFormatNode.getAttribute('style') === null ? currentFormatNode.nodeName :
15528
- currentFormatNode.nodeName + `[style='` + currentFormatNode.getAttribute('style') + `']`) : null;
15569
+ currentFormatNode.nodeName + '[style=\'' + currentFormatNode.getAttribute('style') + '\']') : null;
15529
15570
  if (nodes.length > 0) {
15530
15571
  isCollapsed = true;
15531
15572
  range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
@@ -15534,7 +15575,9 @@ class SelectionCommands {
15534
15575
  range.startOffset > 0 && range.startContainer.parentElement.firstElementChild.tagName.toLowerCase() !== 'br') ||
15535
15576
  !isNullOrUndefined(currentFormatNode) && currentFormatNode ===
15536
15577
  (range.startContainer.parentElement.closest(currentSelector)) &&
15537
- ((range.startContainer.parentElement.closest(currentSelector)).textContent.replace(new RegExp(String.fromCharCode(8203), 'g'), '').trim().length !== 0))) {
15578
+ ((range.startContainer.parentElement.closest(currentSelector)).textContent.replace(
15579
+ // eslint-disable-next-line
15580
+ new RegExp(String.fromCharCode(8203), 'g'), '').trim().length !== 0))) {
15538
15581
  isCollapsed = true;
15539
15582
  range = nodeCutter.GetCursorRange(docElement, range, range.startContainer);
15540
15583
  nodes.push(range.startContainer);
@@ -15569,15 +15612,6 @@ class SelectionCommands {
15569
15612
  isSubSup = formatNode === null ? false : true;
15570
15613
  }
15571
15614
  }
15572
- else if (formatNode.textContent !== nodes[index].textContent && formatNode.nodeName === 'SPAN' && formatNode.style[0] === 'font-size') {
15573
- let currentParentElem = nodes[index].parentElement.textContent !== nodes[index].textContent ? nodes[index] : nodes[index].parentElement;
15574
- let isSameTextContent = true;
15575
- while (currentParentElem.textContent !== nodes[index].textContent && nodes[index].style[0] !== format && currentParentElem.nodeName === 'SPAN') {
15576
- isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
15577
- currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
15578
- }
15579
- formatNode = currentParentElem;
15580
- }
15581
15615
  if (index === 0 && formatNode === null) {
15582
15616
  isFormat = true;
15583
15617
  }
@@ -15611,6 +15645,7 @@ class SelectionCommands {
15611
15645
  if (cursorFormat) {
15612
15646
  cursorNode = cursorNodes[0];
15613
15647
  if (cursorFormat.firstChild.textContent.charCodeAt(0) === 8203 && cursorFormat.firstChild.nodeType === 3) {
15648
+ // eslint-disable-next-line
15614
15649
  const regEx = new RegExp(String.fromCharCode(8203), 'g');
15615
15650
  let emptySpaceNode;
15616
15651
  if (cursorFormat.firstChild === cursorNode) {
@@ -15621,7 +15656,6 @@ class SelectionCommands {
15621
15656
  cursorFormat.parentElement.firstChild && cursorFormat.parentElement.firstChild.nodeType === 1) ?
15622
15657
  cursorNode.textContent : cursorNode.textContent.replace(regEx, ''));
15623
15658
  emptySpaceNode = cursorNode;
15624
-
15625
15659
  }
15626
15660
  else {
15627
15661
  cursorFormat.firstChild.textContent = cursorFormat.firstChild.textContent.replace(regEx, '');
@@ -15793,7 +15827,8 @@ class SelectionCommands {
15793
15827
  }
15794
15828
  if (child.length > 0 && isFontStyle) {
15795
15829
  for (let num = 0; num < child.length; num++) {
15796
- if (child[num].nodeType !== 3 || (child[num].textContent && child[num].textContent.trim().length > 0)) {
15830
+ if (child[num].nodeType !== 3 || (child[num].textContent &&
15831
+ child[num].textContent.trim().length > 0)) {
15797
15832
  child[num] = InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
15798
15833
  if (child[num].textContent === startText) {
15799
15834
  if (num === 0) {
@@ -15869,33 +15904,7 @@ class SelectionCommands {
15869
15904
  liElement.style.textDecoration = 'inherit';
15870
15905
  }
15871
15906
  }
15872
- let enterType = isNullOrUndefined(this.enterAction) ? 'P' : this.enterAction.toString();
15873
- const currentNode = nodes[index];
15874
- let isNestedNode = !isNullOrUndefined(currentNode) && nodes[index].nodeName === '#text' && nodes[index].parentElement.nodeName !== enterType;
15875
- let currentParentElem = currentNode.parentElement.textContent !== currentNode.textContent ? currentNode : currentNode.parentElement;
15876
- if (isNestedNode) {
15877
- let isSameTextContent = true;
15878
- isNestedNode = false;
15879
- while (!isNullOrUndefined(currentParentElem) && isSameTextContent && currentParentElem.parentElement.nodeName !== enterType
15880
- && (currentParentElem.nodeName === 'SPAN' && (currentParentElem.style.textDecoration === 'line-through' || 'underline')
15881
- || currentParentElem.nodeName === 'SPAN' && (currentParentElem.style[0] === 'background-color' || 'font-family' || 'color')
15882
- || (currentParentElem.nodeName === 'EM' || 'STRONG' || 'SUB' || 'SUP'))) {
15883
- isSameTextContent = currentParentElem.textContent === currentParentElem.parentElement.textContent;
15884
- currentParentElem = !isNullOrUndefined(currentParentElem.parentElement) && isSameTextContent ? currentParentElem.parentElement : currentParentElem;
15885
- }
15886
- if (!isNullOrUndefined(currentParentElem) && currentParentElem.childNodes.length > 0) {
15887
- let nodeList = currentParentElem.querySelectorAll('span,strong,em,sub,sup');
15888
- isNestedNode = nodeList.length > 0 && isSameTextContent;
15889
- }
15890
- }
15891
- if (isNestedNode) {
15892
- let nodeList = [];
15893
- nodeList[0] = currentParentElem;
15894
- this.applyStyles(nodeList, index, element);
15895
- }
15896
- else {
15897
- nodes[index] = this.applyStyles(nodes, index, element);
15898
- }
15907
+ nodes[index] = this.applyStyles(nodes, index, element);
15899
15908
  if (format === 'fontsize') {
15900
15909
  const bg = closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
15901
15910
  if (!isNullOrUndefined(bg)) {
@@ -16305,7 +16314,8 @@ class ClearFormat$1 {
16305
16314
  this.unWrap(docElement, blockNodes, nodeCutter, nodeSelection);
16306
16315
  }
16307
16316
  else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
16308
- childNodes[index2].parentNode.nodeName.toLocaleLowerCase() === childNodes[index2].nodeName.toLocaleLowerCase()) {
16317
+ childNodes[index2].parentNode.nodeName.toLocaleLowerCase() ===
16318
+ childNodes[index2].nodeName.toLocaleLowerCase()) {
16309
16319
  InsertMethods.unwrap(childNodes[index2]);
16310
16320
  }
16311
16321
  else if (this.BLOCK_TAGS.indexOf(childNodes[index2].nodeName.toLocaleLowerCase()) > -1 &&
@@ -16819,6 +16829,7 @@ class MsWordPaste {
16819
16829
  hexConversion(rtfData) {
16820
16830
  // eslint-disable-next-line
16821
16831
  const picHead = /\{\\pict[\s\S]+?\\bliptag\-?\d+(\\blipupi\-?\d+)?(\{\\\*\\blipuid\s?[\da-fA-F]+)?[\s\}]*?/;
16832
+ // eslint-disable-next-line security/detect-non-literal-regexp
16822
16833
  const pic = new RegExp('(?:(' + picHead.source + '))([\\da-fA-F\\s]+)\\}', 'g');
16823
16834
  const fullImg = rtfData.match(pic);
16824
16835
  let imgType;
@@ -16882,7 +16893,9 @@ class MsWordPaste {
16882
16893
  removeUnwantedElements(elm) {
16883
16894
  let innerElement = elm.innerHTML;
16884
16895
  for (let i = 0; i < this.removableElements.length; i++) {
16896
+ // eslint-disable-next-line security/detect-non-literal-regexp
16885
16897
  const regExpStartElem = new RegExp('<' + this.removableElements[i] + '>', 'g');
16898
+ // eslint-disable-next-line security/detect-non-literal-regexp
16886
16899
  const regExpEndElem = new RegExp('</' + this.removableElements[i] + '>', 'g');
16887
16900
  innerElement = innerElement.replace(regExpStartElem, '');
16888
16901
  innerElement = innerElement.replace(regExpEndElem, '');
@@ -16931,7 +16944,7 @@ class MsWordPaste {
16931
16944
  const styleClassObject = !isNullOrUndefined(styles) ? this.findStyleObject(styles) : null;
16932
16945
  const keys = Object.keys(styleClassObject);
16933
16946
  let values = keys.map((key) => {
16934
- return styleClassObject[key];
16947
+ return styleClassObject[`${key}`];
16935
16948
  });
16936
16949
  values = this.removeUnwantedStyle(values, wordPasteStyleConfig);
16937
16950
  this.filterStyles(elm, wordPasteStyleConfig);
@@ -17212,7 +17225,8 @@ class MsWordPaste {
17212
17225
  for (let j = 0; j < collection[index].nestedLevel - pLevel; j++) {
17213
17226
  prevList.appendChild(temp = createElement(collection[index].listType));
17214
17227
  prevList = createElement('li');
17215
- if (j !== collection[index].nestedLevel - pLevel - 1 && collection[index].nestedLevel - pLevel > 1) {
17228
+ if (j !== collection[index].nestedLevel - pLevel - 1 &&
17229
+ collection[index].nestedLevel - pLevel > 1) {
17216
17230
  prevList.style.listStyleType = 'none';
17217
17231
  }
17218
17232
  temp.appendChild(prevList);
@@ -17619,6 +17633,7 @@ class ToolbarStatus {
17619
17633
  }
17620
17634
  }
17621
17635
  for (let index = 0; index < nodes.length; index++) {
17636
+ // eslint-disable-next-line max-len
17622
17637
  formatCollection = this.getFormatParent(docElement, formatCollection, nodes[index], targetNode, formatNode, fontSize, fontName);
17623
17638
  if ((index === 0 && formatCollection.bold) || !formatCollection.bold) {
17624
17639
  nodeCollection.bold = formatCollection.bold;
@@ -17798,12 +17813,14 @@ class ToolbarStatus {
17798
17813
  let index = null;
17799
17814
  if ((name !== null && name !== '' && name !== undefined)
17800
17815
  && (fontName === null || fontName === undefined || (fontName.filter((value, pos) => {
17816
+ // eslint-disable-next-line
17801
17817
  const pattern = new RegExp(name, 'i');
17802
17818
  if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
17803
17819
  (value.split(',')[0] && value.split(',')[0].search(pattern) > -1)) {
17804
17820
  index = pos;
17805
17821
  }
17806
17822
  }) && (index !== null)))) {
17823
+ // eslint-disable-next-line
17807
17824
  return (index !== null) ? fontName[index] : name.replace(/"/g, '');
17808
17825
  }
17809
17826
  else {
@@ -18467,7 +18484,7 @@ class HtmlEditor {
18467
18484
  }
18468
18485
  }
18469
18486
  isTableClassAdded() {
18470
- let tableElement = this.parent.inputElement.querySelectorAll('table');
18487
+ const tableElement = this.parent.inputElement.querySelectorAll('table');
18471
18488
  for (let i = 0; i < tableElement.length; i++) {
18472
18489
  if (!tableElement[i].classList.contains('e-rte-table')) {
18473
18490
  tableElement[i].classList.add('e-rte-table');
@@ -18479,36 +18496,48 @@ class HtmlEditor {
18479
18496
  const restrictKeys = [8, 9, 13, 16, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
18480
18497
  112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123];
18481
18498
  const range = this.parent.getRange();
18499
+ // eslint-disable-next-line
18482
18500
  const regEx = new RegExp(String.fromCharCode(8203), 'g');
18483
18501
  let pointer;
18484
18502
  if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
18485
18503
  pointer = range.startOffset;
18504
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
18486
18505
  range.startContainer.nodeName === '#text' ? range.startContainer.parentElement.classList.add('currentStartMark') : range.startContainer.classList.add('currentStartMark');
18487
18506
  if (range.startContainer.textContent.charCodeAt(0) === 8203) {
18488
18507
  pointer = range.startOffset === 0 ? range.startOffset : range.startOffset - 1;
18489
18508
  range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
18490
18509
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), range.startContainer, pointer);
18491
18510
  }
18492
- let previousLength = this.parent.inputElement.innerHTML.length;
18493
- let currentLength = this.parent.inputElement.innerHTML.replace(regEx, '').length;
18511
+ const previousLength = this.parent.inputElement.innerHTML.length;
18512
+ const currentLength = this.parent.inputElement.innerHTML.replace(regEx, '').length;
18513
+ let focusNode = range.startContainer;
18494
18514
  if (previousLength > currentLength) {
18495
18515
  let currentChild = this.parent.inputElement.firstChild;
18496
18516
  while (!isNullOrUndefined(currentChild) && currentChild.textContent.replace(regEx, '').trim().length > 0) {
18497
18517
  currentChild.innerHTML = currentChild.innerHTML.replace(regEx, '');
18498
18518
  currentChild = currentChild.nextElementSibling;
18499
18519
  }
18500
- if (this.parent.inputElement.querySelector('.currentStartMark').childNodes.length > 1) {
18501
- let currentChild = this.parent.inputElement.querySelector('.currentStartMark').childNodes;
18502
- for (let i = 0; i < currentChild.length; i++) {
18503
- if (currentChild[i].nodeName === '#text' && currentChild[i].textContent.length === 0) {
18504
- detach(currentChild[i]);
18520
+ const currentChildNode = this.parent.inputElement.querySelector('.currentStartMark').childNodes;
18521
+ if (currentChildNode.length > 1) {
18522
+ for (let i = 0; i < currentChildNode.length; i++) {
18523
+ if (currentChildNode[i].nodeName === '#text' && currentChildNode[i].textContent.length === 0) {
18524
+ detach(currentChildNode[i]);
18505
18525
  i--;
18506
18526
  }
18527
+ if (focusNode.textContent.replace(regEx, '') === currentChildNode[i].textContent) {
18528
+ pointer = focusNode.textContent.length > 1 ? focusNode.textContent.length - 1 : focusNode.textContent.length;
18529
+ focusNode = currentChildNode[i];
18530
+ }
18531
+ }
18532
+ }
18533
+ else if (currentChildNode.length === 1) {
18534
+ if (focusNode.textContent.replace(regEx, '') === currentChildNode[0].textContent) {
18535
+ focusNode = currentChildNode[0];
18507
18536
  }
18508
18537
  }
18509
- this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.parent.inputElement.querySelector('.currentStartMark').childNodes[0], pointer);
18538
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusNode, pointer);
18510
18539
  }
18511
- let currentElem = this.parent.inputElement.querySelector('.currentStartMark');
18540
+ const currentElem = this.parent.inputElement.querySelector('.currentStartMark');
18512
18541
  if (!isNullOrUndefined(currentElem)) {
18513
18542
  currentElem.classList.remove('currentStartMark');
18514
18543
  if (currentElem.getAttribute('class').trim() === '') {
@@ -18650,7 +18679,7 @@ class HtmlEditor {
18650
18679
  if (e.args.code === 'Backspace' && e.args.keyCode === 8 && currentRange.startOffset === 0 &&
18651
18680
  currentRange.endOffset === 0 && this.parent.getSelection().length === 0 && currentRange.startContainer.textContent.length > 0 &&
18652
18681
  currentRange.startContainer.parentElement.tagName !== 'TD' && currentRange.startContainer.parentElement.tagName !== 'TH') {
18653
- let checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
18682
+ const checkNode = currentRange.startContainer.nodeName === '#text' ? currentRange.startContainer.parentElement : currentRange.startContainer;
18654
18683
  if (!this.parent.formatter.editorManager.domNode.isBlockNode(checkNode) &&
18655
18684
  !isNullOrUndefined(checkNode.previousSibling) && checkNode.previousSibling.nodeName === 'BR') {
18656
18685
  return;
@@ -19710,6 +19739,7 @@ class PasteCleanup {
19710
19739
  }
19711
19740
  }
19712
19741
  }
19742
+ // eslint-disable-next-line @typescript-eslint/tslint/config
19713
19743
  setCssClass(e) {
19714
19744
  if (this.popupObj && e.cssClass) {
19715
19745
  if (isNullOrUndefined(e.oldCssClass)) {
@@ -19959,7 +19989,7 @@ class PasteCleanup {
19959
19989
  const groupingTags = [...deniedTags];
19960
19990
  const keys = Object.keys(pasteCleanupGroupingTags);
19961
19991
  const values = keys.map((key) => {
19962
- return pasteCleanupGroupingTags[key];
19992
+ return pasteCleanupGroupingTags[`${key}`];
19963
19993
  });
19964
19994
  const addTags = [];
19965
19995
  for (let i = 0; i < groupingTags.length; i++) {
@@ -20279,6 +20309,7 @@ class FileManager$1 {
20279
20309
  this.dialogObj.show(Browser.isDevice ? true : false);
20280
20310
  this.setCssClass({ cssClass: this.parent.cssClass });
20281
20311
  }
20312
+ // eslint-disable-next-line @typescript-eslint/tslint/config
20282
20313
  setCssClass(e) {
20283
20314
  if (this.dialogObj && e.cssClass) {
20284
20315
  if (isNullOrUndefined(e.oldCssClass)) {
@@ -20551,6 +20582,7 @@ class FullScreen {
20551
20582
  this.parent.toolbarModule.addFixedTBarClass();
20552
20583
  }
20553
20584
  }
20585
+ this.parent.refreshUI();
20554
20586
  this.parent.trigger(actionComplete, { requestType: 'Minimize', targetItem: 'Minimize', args: event });
20555
20587
  }
20556
20588
  });
@@ -20637,33 +20669,33 @@ function setAttributes(htmlAttributes, rte, isFrame, initial) {
20637
20669
  if (Object.keys(htmlAttributes).length) {
20638
20670
  for (const htmlAttr of Object.keys(htmlAttributes)) {
20639
20671
  if (htmlAttr === 'class') {
20640
- target.classList.add(htmlAttributes[htmlAttr]);
20672
+ target.classList.add(htmlAttributes[`${htmlAttr}`]);
20641
20673
  }
20642
- else if (htmlAttr === 'disabled' && htmlAttributes[htmlAttr] === 'disabled') {
20674
+ else if (htmlAttr === 'disabled' && htmlAttributes[`${htmlAttr}`] === 'disabled') {
20643
20675
  rte.enabled = false;
20644
20676
  rte.setEnable();
20645
20677
  }
20646
- else if (htmlAttr === 'readonly' && htmlAttributes[htmlAttr] === 'readonly') {
20678
+ else if (htmlAttr === 'readonly' && htmlAttributes[`${htmlAttr}`] === 'readonly') {
20647
20679
  rte.readonly = true;
20648
20680
  rte.setReadOnly(initial);
20649
20681
  }
20650
20682
  else if (htmlAttr === 'style') {
20651
- target.setAttribute('style', htmlAttributes[htmlAttr]);
20683
+ target.setAttribute('style', htmlAttributes[`${htmlAttr}`]);
20652
20684
  }
20653
20685
  else if (htmlAttr === 'tabindex') {
20654
- rte.inputElement.setAttribute('tabindex', htmlAttributes[htmlAttr]);
20686
+ rte.inputElement.setAttribute('tabindex', htmlAttributes[`${htmlAttr}`]);
20655
20687
  }
20656
20688
  else if (htmlAttr === 'placeholder') {
20657
- rte.placeholder = htmlAttributes[htmlAttr];
20689
+ rte.placeholder = htmlAttributes[`${htmlAttr}`];
20658
20690
  rte.setPlaceHolder();
20659
20691
  }
20660
20692
  else {
20661
20693
  const validateAttr = ['name', 'required'];
20662
20694
  if (validateAttr.indexOf(htmlAttr) > -1) {
20663
- rte.valueContainer.setAttribute(htmlAttr, htmlAttributes[htmlAttr]);
20695
+ rte.valueContainer.setAttribute(htmlAttr, htmlAttributes[`${htmlAttr}`]);
20664
20696
  }
20665
20697
  else {
20666
- target.setAttribute(htmlAttr, htmlAttributes[htmlAttr]);
20698
+ target.setAttribute(htmlAttr, htmlAttributes[`${htmlAttr}`]);
20667
20699
  }
20668
20700
  }
20669
20701
  }
@@ -20857,6 +20889,7 @@ class Link {
20857
20889
  }
20858
20890
  }
20859
20891
  }
20892
+ // eslint-disable-next-line @typescript-eslint/tslint/config
20860
20893
  setCssClass(e) {
20861
20894
  this.updateCss(this.checkBoxObj, e);
20862
20895
  this.updateCss(this.dialogObj, e);
@@ -21029,13 +21062,13 @@ class Link {
21029
21062
  });
21030
21063
  const htmlTextbox = (this.parent.editorMode === 'HTML') ? '<label>' + linkTooltip +
21031
21064
  '</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
21032
- '<input type="text" data-role ="none" spellcheck="false" placeholder = "' + title + '" class="e-input e-rte-linkTitle' + ' ' + this.parent.cssClass + '"></div>' +
21065
+ '<input type="text" data-role ="none" spellcheck="false" placeholder = "' + title + '"aria-label="' + this.i10n.getConstant('linkTitle') + '" class="e-input e-rte-linkTitle' + ' ' + this.parent.cssClass + '"></div>' +
21033
21066
  '<div class="e-rte-label' + ' ' + this.parent.cssClass + '"></div>' + '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
21034
21067
  '<input type="checkbox" class="e-rte-linkTarget' + ' ' + this.parent.cssClass + '" data-role ="none"></div>' : '';
21035
21068
  const content = '<div class="e-rte-label' + ' ' + this.parent.cssClass + '"><label>' + linkWebAddress + '</label></div>' + '<div class="e-rte-field' + ' ' + this.parent.cssClass + '">' +
21036
- '<input type="text" data-role ="none" spellcheck="false" placeholder="' + urlPlace + '" class="e-input e-rte-linkurl' + ' ' + this.parent.cssClass + '"/></div>' +
21069
+ '<input type="text" data-role ="none" spellcheck="false" placeholder="' + urlPlace + '"aria-label="' + this.i10n.getConstant('linkWebUrl') + '" class="e-input e-rte-linkurl' + ' ' + this.parent.cssClass + '"/></div>' +
21037
21070
  '<div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + '<label>' + linkDisplayText + '</label></div><div class="e-rte-field' + ' ' + this.parent.cssClass + '"> ' +
21038
- '<input type="text" data-role ="none" spellcheck="false" class="e-input e-rte-linkText' + ' ' + this.parent.cssClass + '" placeholder="' + textPlace + '">' +
21071
+ '<input type="text" data-role ="none" spellcheck="false" class="e-input e-rte-linkText' + ' ' + this.parent.cssClass + '"aria-label="' + this.i10n.getConstant('linkText') + '" placeholder="' + textPlace + '">' +
21039
21072
  '</div><div class="e-rte-label' + ' ' + this.parent.cssClass + '">' + htmlTextbox;
21040
21073
  const contentElem = parseHtml(content);
21041
21074
  linkContent.appendChild(contentElem);
@@ -21061,7 +21094,7 @@ class Link {
21061
21094
  cssClass: CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
21062
21095
  enableRtl: this.parent.enableRtl,
21063
21096
  locale: this.parent.locale,
21064
- showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px', height: 'inherit',
21097
+ showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '310px',
21065
21098
  isModal: Browser.isDevice,
21066
21099
  buttons: [{
21067
21100
  click: this.insertlink.bind(selectObj),
@@ -21403,6 +21436,7 @@ class Image {
21403
21436
  }
21404
21437
  }
21405
21438
  }
21439
+ // eslint-disable-next-line @typescript-eslint/tslint/config
21406
21440
  setCssClass(e) {
21407
21441
  if (this.popupObj && e.cssClass) {
21408
21442
  if (isNullOrUndefined(e.oldCssClass)) {
@@ -21595,8 +21629,8 @@ class Image {
21595
21629
  const pos = this.calcPos(e);
21596
21630
  const top = pos.top;
21597
21631
  const left = pos.left;
21598
- const imgWid = e.width;
21599
- const imgHgt = e.height;
21632
+ const imgWid = e.getBoundingClientRect().width;
21633
+ const imgHgt = e.getBoundingClientRect().height;
21600
21634
  const borWid = (Browser.isDevice) ? (4 * parseInt((e.style.outline.slice(-3)), 10)) + 2 :
21601
21635
  (2 * parseInt((e.style.outline.slice(-3)), 10)) + 2; //span border width + image outline width
21602
21636
  const devWid = ((Browser.isDevice) ? 0 : 2); // span border width
@@ -21623,7 +21657,6 @@ class Image {
21623
21657
  offsetParent = offsetParent.parentNode;
21624
21658
  }
21625
21659
  if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
21626
- // eslint-disable-next-line
21627
21660
  parentOffset = offsetParent.getBoundingClientRect();
21628
21661
  }
21629
21662
  if (elem.offsetParent && (elem.offsetParent.classList.contains('e-img-caption'))) {
@@ -21644,6 +21677,7 @@ class Image {
21644
21677
  if (isNullOrUndefined(img.width)) {
21645
21678
  return;
21646
21679
  }
21680
+ // eslint-disable-next-line security/detect-unsafe-regex
21647
21681
  const width = img.style.width !== '' ? img.style.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(img.style.width) :
21648
21682
  parseInt(img.style.width, 10) : img.width;
21649
21683
  const height = img.style.height !== '' ? parseInt(img.style.height, 10) : img.height;
@@ -22440,6 +22474,7 @@ class Image {
22440
22474
  }
22441
22475
  }
22442
22476
  imageRemovePost(src) {
22477
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
22443
22478
  const proxy = this;
22444
22479
  let absoluteUrl = '';
22445
22480
  if (isNullOrUndefined(this.parent.insertImageSettings.removeUrl) || this.parent.insertImageSettings.removeUrl === '') {
@@ -22451,8 +22486,9 @@ class Image {
22451
22486
  else {
22452
22487
  absoluteUrl = new URL(src, document.baseURI).href;
22453
22488
  }
22454
- this.removingImgName = absoluteUrl.replace(/^.*[\\\/]/, '');
22489
+ this.removingImgName = absoluteUrl.replace(/^.*[\\/]/, '');
22455
22490
  const xhr = new XMLHttpRequest();
22491
+ // eslint-disable-next-line @typescript-eslint/tslint/config
22456
22492
  xhr.addEventListener('readystatechange', function () {
22457
22493
  if (this.readyState === 4 && this.status === 200) {
22458
22494
  proxy.triggerPost(this.response);
@@ -22467,6 +22503,7 @@ class Image {
22467
22503
  if (isNullOrUndefined(removeUrl) || removeUrl === '') {
22468
22504
  return;
22469
22505
  }
22506
+ // eslint-disable-next-line @typescript-eslint/tslint/config
22470
22507
  const file = new File([response], this.removingImgName);
22471
22508
  const ajax = new Ajax(removeUrl, 'POST', true, null);
22472
22509
  const formData = new FormData();
@@ -22614,7 +22651,7 @@ class Image {
22614
22651
  cssClass: CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
22615
22652
  enableRtl: this.parent.enableRtl,
22616
22653
  locale: this.parent.locale,
22617
- showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px', height: 'inherit',
22654
+ showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
22618
22655
  position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
22619
22656
  isModal: Browser.isDevice,
22620
22657
  buttons: [{
@@ -22762,7 +22799,7 @@ class Image {
22762
22799
  const placeUrl = this.i10n.getConstant('imageUrl');
22763
22800
  this.inputUrl = this.parent.createElement('input', {
22764
22801
  className: 'e-input e-img-url' + ' ' + this.parent.cssClass,
22765
- attrs: { placeholder: placeUrl, spellcheck: 'false' }
22802
+ attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('imageLinkHeader') }
22766
22803
  });
22767
22804
  this.inputUrl.addEventListener('input', () => {
22768
22805
  if (!isNullOrUndefined(this.inputUrl)) {
@@ -23689,6 +23726,7 @@ class Audio {
23689
23726
  }
23690
23727
  }
23691
23728
  }
23729
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
23692
23730
  touchStart(e, ele) {
23693
23731
  if (this.parent.readonly) {
23694
23732
  return;
@@ -23895,6 +23933,7 @@ class Audio {
23895
23933
  }
23896
23934
  }
23897
23935
  audioRemovePost(src) {
23936
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
23898
23937
  const proxy = this;
23899
23938
  let absoluteUrl = '';
23900
23939
  if (isNullOrUndefined(this.parent.insertAudioSettings.removeUrl) || this.parent.insertAudioSettings.removeUrl === '') {
@@ -23906,8 +23945,9 @@ class Audio {
23906
23945
  else {
23907
23946
  absoluteUrl = new URL(src, document.baseURI).href;
23908
23947
  }
23909
- this.removingAudioName = absoluteUrl.replace(/^.*[\\\/]/, '');
23948
+ this.removingAudioName = absoluteUrl.replace(/^.*[\\/]/, '');
23910
23949
  const xhr = new XMLHttpRequest();
23950
+ // eslint-disable-next-line @typescript-eslint/tslint/config
23911
23951
  xhr.addEventListener('readystatechange', function () {
23912
23952
  if (this.readyState === 4 && this.status === 200) {
23913
23953
  proxy.triggerPost(this.response);
@@ -23941,6 +23981,7 @@ class Audio {
23941
23981
  }
23942
23982
  }
23943
23983
  if (this.isAudioElem(e.target)) {
23984
+ this.audEle = e.target.querySelector('audio');
23944
23985
  e.preventDefault();
23945
23986
  }
23946
23987
  }
@@ -24079,8 +24120,6 @@ class Audio {
24079
24120
  addClass([target.querySelector('audio')], [CLS_AUD_FOCUS]);
24080
24121
  target.querySelector('audio').style.outline = '2px solid #4a90e2';
24081
24122
  }
24082
- const pageY = (this.parent.iframeSettings.enable) ? window.pageYOffset +
24083
- this.parent.element.getBoundingClientRect().top + args.clientY : args.pageY;
24084
24123
  if (this.parent.quickToolbarModule.audioQTBar) {
24085
24124
  if (e.isNotify) {
24086
24125
  setTimeout(() => {
@@ -24135,7 +24174,7 @@ class Audio {
24135
24174
  cssClass: CLS_RTE_ELEMENTS,
24136
24175
  enableRtl: this.parent.enableRtl,
24137
24176
  locale: this.parent.locale,
24138
- showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px', height: 'inherit',
24177
+ showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
24139
24178
  position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
24140
24179
  isModal: Browser.isDevice,
24141
24180
  buttons: [{
@@ -24206,7 +24245,7 @@ class Audio {
24206
24245
  const placeUrl = this.i10n.getConstant('audioUrl');
24207
24246
  this.inputUrl = this.parent.createElement('input', {
24208
24247
  className: 'e-input e-audio-url',
24209
- attrs: { placeholder: placeUrl, spellcheck: 'false' }
24248
+ attrs: { placeholder: placeUrl, spellcheck: 'false', 'aria-label': this.i10n.getConstant('audioLinkHeader') }
24210
24249
  });
24211
24250
  this.inputUrl.addEventListener('input', () => {
24212
24251
  if (!isNullOrUndefined(this.inputUrl)) {
@@ -24833,7 +24872,6 @@ class Video {
24833
24872
  offsetParent = offsetParent.parentNode;
24834
24873
  }
24835
24874
  if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
24836
- // eslint-disable-next-line
24837
24875
  parentOffset = offsetParent.getBoundingClientRect();
24838
24876
  }
24839
24877
  if (elem && elem.nodeType === 1 && elem.tagName === 'IFRAME') {
@@ -24855,6 +24893,7 @@ class Video {
24855
24893
  if (isNullOrUndefined(vidEleStyle)) {
24856
24894
  return;
24857
24895
  }
24896
+ // eslint-disable-next-line
24858
24897
  const width = vidEleStyle.width !== '' ? vidEleStyle.width.match(/^\d+(\.\d*)?%$/g) ? parseFloat(vidEleStyle.width) :
24859
24898
  parseInt(vidEleStyle.width, 10) : vid.style.width !== '' ? vid.style.width : vid.width;
24860
24899
  const height = vidEleStyle.height !== '' ? parseInt(vidEleStyle.height, 10) : vid.style.height !== '' ? vid.style.height : vid.height;
@@ -25252,6 +25291,7 @@ class Video {
25252
25291
  }
25253
25292
  }
25254
25293
  videoRemovePost(src) {
25294
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
25255
25295
  const proxy = this;
25256
25296
  let absoluteUrl = '';
25257
25297
  if (isNullOrUndefined(this.parent.insertVideoSettings.removeUrl) || this.parent.insertVideoSettings.removeUrl === '') {
@@ -25263,8 +25303,10 @@ class Video {
25263
25303
  else {
25264
25304
  absoluteUrl = new URL(src, document.baseURI).href;
25265
25305
  }
25306
+ // eslint-disable-next-line no-useless-escape
25266
25307
  this.removingVideoName = absoluteUrl.replace(/^.*[\\\/]/, '');
25267
25308
  const xhr = new XMLHttpRequest();
25309
+ // eslint-disable-next-line @typescript-eslint/tslint/config
25268
25310
  xhr.addEventListener('readystatechange', function () {
25269
25311
  if (this.readyState === 4 && this.status === 200) {
25270
25312
  proxy.triggerPost(this.response);
@@ -25394,7 +25436,7 @@ class Video {
25394
25436
  }
25395
25437
  }
25396
25438
  showVideoQuickToolbar(e) {
25397
- if (e.type !== 'Videos' || isNullOrUndefined(this.parent.quickToolbarModule)
25439
+ if (e.type !== 'Videos' || e.args.detail === 2 || isNullOrUndefined(this.parent.quickToolbarModule)
25398
25440
  || isNullOrUndefined(this.parent.quickToolbarModule.videoQTBar) || isNullOrUndefined(e.args)) {
25399
25441
  return;
25400
25442
  }
@@ -25427,6 +25469,12 @@ class Video {
25427
25469
  hideVideoQuickToolbar() {
25428
25470
  if (!isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.' + CLS_VID_FOCUS))) {
25429
25471
  removeClass([this.contentModule.getEditPanel().querySelector('.' + CLS_VID_FOCUS)], CLS_VID_FOCUS);
25472
+ if (!isNullOrUndefined(this.videoEle)) {
25473
+ this.videoEle.style.outline = '';
25474
+ }
25475
+ if (!isNullOrUndefined(this.contentModule.getEditPanel().querySelector('.e-vid-resize'))) {
25476
+ detach(this.contentModule.getEditPanel().querySelector('.e-vid-resize'));
25477
+ }
25430
25478
  if (this.quickToolObj && this.quickToolObj.videoQTBar && document.body.contains(this.quickToolObj.videoQTBar.element)) {
25431
25479
  this.quickToolObj.videoQTBar.hidePopup();
25432
25480
  }
@@ -25471,7 +25519,7 @@ class Video {
25471
25519
  cssClass: CLS_RTE_ELEMENTS,
25472
25520
  enableRtl: this.parent.enableRtl,
25473
25521
  locale: this.parent.locale,
25474
- showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px', height: 'inherit',
25522
+ showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px',
25475
25523
  position: { X: 'center', Y: (Browser.isDevice) ? 'center' : 'top' },
25476
25524
  isModal: Browser.isDevice,
25477
25525
  buttons: [{
@@ -25553,7 +25601,7 @@ class Video {
25553
25601
  videoUrl.appendChild(urlContent);
25554
25602
  this.embedInputUrl = this.parent.createElement('textarea', {
25555
25603
  className: 'e-input e-embed-video-url',
25556
- attrs: { placeholder: 'Paste Embed URL here', type: 'text', tabindex: '-1' }
25604
+ attrs: { placeholder: 'Paste Embed URL here', type: 'text', tabindex: '-1', 'aria-label': this.i10n.getConstant('embedVideoLinkHeader') }
25557
25605
  });
25558
25606
  this.embedInputUrl.addEventListener('keyup', () => {
25559
25607
  if (!isNullOrUndefined(this.embedInputUrl)) {
@@ -26200,6 +26248,7 @@ class Table {
26200
26248
  }
26201
26249
  }
26202
26250
  }
26251
+ // eslint-disable-next-line @typescript-eslint/tslint/config
26203
26252
  setCssClass(e) {
26204
26253
  if (this.popupObj && e.cssClass) {
26205
26254
  if (isNullOrUndefined(e.oldCssClass)) {
@@ -26332,18 +26381,17 @@ class Table {
26332
26381
  }
26333
26382
  }
26334
26383
  }
26384
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
26335
26385
  tableModulekeyUp(e) {
26336
- const event = e.args;
26337
26386
  if (!isNullOrUndefined(this.parent.formatter.editorManager.nodeSelection) && this.contentModule) {
26338
26387
  const range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument());
26339
- const selection = this.parent.formatter.editorManager.nodeSelection.save(range, this.contentModule.getDocument());
26340
26388
  let ele = this.parent.formatter.editorManager.nodeSelection.getParentNodeCollection(range)[0];
26341
26389
  ele = (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') ? ele.parentElement : ele;
26342
26390
  if (ele && ele.tagName !== 'TD' && ele.tagName !== 'TH') {
26343
26391
  const closestTd = closest(ele, 'td');
26344
26392
  ele = !isNullOrUndefined(closestTd) && this.parent.inputElement.contains(closestTd) ? closestTd : ele;
26345
26393
  }
26346
- if (this.previousTableElement != ele && !isNullOrUndefined(this.previousTableElement)) {
26394
+ if (this.previousTableElement !== ele && !isNullOrUndefined(this.previousTableElement)) {
26347
26395
  this.previousTableElement.classList.remove(CLS_TABLE_SEL);
26348
26396
  }
26349
26397
  }
@@ -26772,7 +26820,6 @@ class Table {
26772
26820
  top: 0,
26773
26821
  left: 0
26774
26822
  };
26775
- // eslint-disable-next-line
26776
26823
  const offset = elem.getBoundingClientRect();
26777
26824
  const doc = elem.ownerDocument;
26778
26825
  let offsetParent = elem.offsetParent || doc.documentElement;
@@ -26787,7 +26834,6 @@ class Table {
26787
26834
  isNestedTable = true;
26788
26835
  }
26789
26836
  if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
26790
- // eslint-disable-next-line
26791
26837
  parentOffset = offsetParent.getBoundingClientRect();
26792
26838
  }
26793
26839
  if (isNestedTable) {
@@ -26954,6 +27000,8 @@ class Table {
26954
27000
  const mouseY = (this.parent.enableRtl) ? -(pageY - this.pageY) : (pageY - this.pageY);
26955
27001
  this.pageX = pageX;
26956
27002
  this.pageY = pageY;
27003
+ let maxiumWidth;
27004
+ const currentTdElement = this.curTable.closest('td');
26957
27005
  const args = { event: e, requestType: 'table' };
26958
27006
  this.parent.trigger(onResize, args, (resizingArgs) => {
26959
27007
  if (resizingArgs.cancel) {
@@ -26986,6 +27034,10 @@ class Table {
26986
27034
  if (this.currentColumnResize === 'first') {
26987
27035
  mouseX = mouseX - 0.75; //This was done for to make the gripper and the table first/last column will be close.
26988
27036
  this.removeResizeElement();
27037
+ if (currentTdElement) {
27038
+ maxiumWidth = this.curTable.getBoundingClientRect().right - this.calcPos(currentTdElement).left;
27039
+ this.curTable.style.maxWidth = maxiumWidth + 'px';
27040
+ }
26989
27041
  // Below the value '100' is the 100% width of the parent element.
26990
27042
  if (((mouseX !== 0 && 5 < currentColumnCellWidth) || mouseX < 0) && currentTableWidth <= 100 &&
26991
27043
  this.convertPixelToPercentage(tableWidth - mouseX, widthCompare) <= 100) {
@@ -27003,6 +27055,10 @@ class Table {
27003
27055
  else if (this.currentColumnResize === 'last') {
27004
27056
  mouseX = mouseX + 0.75; //This was done for to make the gripper and the table first/last column will be close.
27005
27057
  this.removeResizeElement();
27058
+ if (currentTdElement) {
27059
+ maxiumWidth = currentTdElement.getBoundingClientRect().right - this.curTable.getBoundingClientRect().left;
27060
+ this.curTable.style.maxWidth = maxiumWidth + 'px';
27061
+ }
27006
27062
  // Below the value '100' is the 100% width of the parent element.
27007
27063
  if (((mouseX !== 0 && 5 < currentColumnCellWidth) || mouseX > 0) &&
27008
27064
  currentTableWidth <= 100 && this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) <= 100) {
@@ -27053,6 +27109,12 @@ class Table {
27053
27109
  if (!Browser.isDevice) {
27054
27110
  EventHandler.remove(this.contentModule.getEditPanel(), 'mouseover', this.resizeHelper);
27055
27111
  }
27112
+ if (currentTdElement) {
27113
+ // eslint-disable-next-line max-len
27114
+ const tableBoxPosition = this.curTable.getBoundingClientRect().left - currentTdElement.getBoundingClientRect().left;
27115
+ maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
27116
+ this.curTable.style.maxWidth = maxiumWidth + 'px';
27117
+ }
27056
27118
  const widthType = this.curTable.style.width.indexOf('%') > -1;
27057
27119
  this.curTable.style.width = widthType ? this.convertPixelToPercentage(tableWidth + mouseX, widthCompare) + '%'
27058
27120
  : tableWidth + mouseX + 'px';
@@ -28247,8 +28309,8 @@ class EnterKeyAction {
28247
28309
  let curElement = this.startNode;
28248
28310
  let blockElement = curElement;
28249
28311
  while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
28250
- blockElement = curElement;
28251
28312
  curElement = curElement.parentElement;
28313
+ blockElement = curElement;
28252
28314
  }
28253
28315
  isTableEnter = blockElement.tagName === 'TD' || blockElement.tagName === 'TBODY' ? false : true;
28254
28316
  }
@@ -28265,7 +28327,10 @@ class EnterKeyAction {
28265
28327
  this.parent.trigger(actionBegin, actionBeginArgs, (actionBeginArgs) => {
28266
28328
  if (!actionBeginArgs.cancel) {
28267
28329
  if (!(this.range.startOffset === this.range.endOffset && this.range.startContainer === this.range.endContainer)) {
28268
- this.range.deleteContents();
28330
+ if (!(this.range.startContainer.nodeName === 'SPAN' && (this.range.startContainer.classList.contains('e-video-wrap') ||
28331
+ this.range.startContainer.classList.contains('e-audio-wrap')))) {
28332
+ this.range.deleteContents();
28333
+ }
28269
28334
  if (this.range.startContainer.nodeName === '#text' && this.range.startContainer.textContent.length === 0 &&
28270
28335
  this.range.startContainer.parentElement !== this.parent.inputElement) {
28271
28336
  if (this.parent.enterKey === 'BR') {
@@ -28294,8 +28359,8 @@ class EnterKeyAction {
28294
28359
  while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' && currentFocusElem.nodeName !== 'BR') {
28295
28360
  currentFocusElem = currentFocusElem.lastChild;
28296
28361
  }
28297
- if (currentFocusElem.nodeName != 'BR' && currentFocusElem.parentElement.textContent.length === 0 && currentFocusElem.parentElement.innerHTML.length === 0 &&
28298
- currentFocusElem.parentElement.nodeName != 'BR') {
28362
+ if (currentFocusElem.nodeName !== 'BR' && currentFocusElem.parentElement.textContent.length === 0 && currentFocusElem.parentElement.innerHTML.length === 0 &&
28363
+ currentFocusElem.parentElement.nodeName !== 'BR') {
28299
28364
  currentFocusElem.parentElement.appendChild(this.parent.createElement('BR'));
28300
28365
  }
28301
28366
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), currentFocusElem.nodeName === 'BR' ? currentFocusElem : currentFocusElem.parentElement, currentFocusElem.parentElement.textContent.length >= 0 || currentFocusElem.nodeName === 'BR' ? 0 : 1);
@@ -28334,7 +28399,7 @@ class EnterKeyAction {
28334
28399
  (this.parent.shiftEnterKey === 'P' && shiftKey) ||
28335
28400
  (this.parent.shiftEnterKey === 'DIV' && shiftKey)) {
28336
28401
  if (this.range.startOffset === 1 && this.parent.inputElement.childNodes.length === 1 && this.parent.inputElement.childNodes[0].nodeName === 'TABLE') {
28337
- let newElem = this.createInsertElement(shiftKey);
28402
+ const newElem = this.createInsertElement(shiftKey);
28338
28403
  newElem.appendChild(this.parent.createElement('BR'));
28339
28404
  this.parent.inputElement.appendChild(newElem);
28340
28405
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), newElem, 0);
@@ -28347,13 +28412,14 @@ class EnterKeyAction {
28347
28412
  else {
28348
28413
  nearBlockNode = this.parent.formatter.editorManager.domNode.blockParentNode(this.startNode);
28349
28414
  }
28350
- let isImageNode = false;
28415
+ let isMediaNode = false; // To check the image audio and video node cases
28351
28416
  let isFocusedFirst = false;
28352
28417
  if (this.range.startOffset !== 0 && this.range.endOffset !== 0 &&
28353
28418
  this.range.startContainer === this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
28354
- && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
28419
+ && nearBlockNode.childNodes[0].nodeName === 'IMG' && nearBlockNode.querySelectorAll('img,audio,video').length > 0)) {
28355
28420
  const startNodeText = this.range.startContainer.textContent;
28356
28421
  const splitFirstText = startNodeText.substring(0, this.range.startOffset);
28422
+ // eslint-disable-next-line max-len
28357
28423
  if (splitFirstText.charCodeAt(this.range.startOffset - 1) !== 160 && splitFirstText.trim().length === 0) {
28358
28424
  isFocusedFirst = true;
28359
28425
  }
@@ -28365,26 +28431,29 @@ class EnterKeyAction {
28365
28431
  const fireFoxEnterAtMiddle = Browser.userAgent.indexOf('Firefox') !== -1 && this.range.startOffset === 0 && this.range.startContainer === this.range.endContainer &&
28366
28432
  this.range.startContainer.nodeName === '#text' && !this.parent.formatter.editorManager.domNode.isBlockNode(this.range.startContainer.previousSibling) &&
28367
28433
  this.range.startContainer.parentElement === this.range.startContainer.previousSibling.parentElement;
28434
+ // eslint-disable-next-line max-len
28368
28435
  if (!fireFoxEnterAtMiddle && ((this.range.startOffset === 0 && this.range.endOffset === 0) || isFocusedFirst) &&
28369
28436
  !(!isNullOrUndefined(this.range.startContainer.previousSibling) &&
28370
28437
  (this.range.startContainer.previousSibling.nodeName === 'IMG' || this.range.startContainer.previousSibling.nodeName === 'BR'))) {
28371
28438
  let isNearBlockLengthZero;
28372
28439
  let newElem;
28373
- if (this.range.startContainer.nodeName === 'IMG' || this.range.startContainer.nodeName === 'TABLE') {
28440
+ if (!isNullOrUndefined(this.range.startContainer.childNodes) && this.range.startContainer.textContent.length === 0 &&
28441
+ (this.range.startContainer.querySelectorAll('img,audio,video').length > 0 ||
28442
+ this.range.startContainer.nodeName === 'IMG' || this.range.startContainer.nodeName === 'TABLE')) {
28374
28443
  newElem = this.createInsertElement(shiftKey);
28375
- isImageNode = true;
28444
+ isMediaNode = true;
28376
28445
  isNearBlockLengthZero = false;
28377
28446
  }
28378
28447
  else {
28379
28448
  if ((nearBlockNode.textContent.trim().length !== 0 ||
28380
28449
  nearBlockNode.childNodes[0].nodeName === 'IMG' ||
28381
- (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img').length > 0))) {
28382
- if ((this.range.startOffset === this.range.endOffset && this.range.startOffset != 0)) {
28450
+ (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img,audio,video').length > 0))) {
28451
+ if ((this.range.startOffset === this.range.endOffset && this.range.startOffset !== 0)) {
28383
28452
  newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, false).cloneNode(true);
28384
28453
  }
28385
28454
  else {
28386
28455
  newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true).cloneNode(true);
28387
- isImageNode = true;
28456
+ isMediaNode = true;
28388
28457
  }
28389
28458
  isNearBlockLengthZero = false;
28390
28459
  }
@@ -28407,7 +28476,7 @@ class EnterKeyAction {
28407
28476
  if (!isNearBlockLengthZero) {
28408
28477
  let currentFocusElem = insertElem;
28409
28478
  let finalFocusElem;
28410
- if (this.range.startOffset === this.range.endOffset && this.range.startOffset != 0) {
28479
+ if (this.range.startOffset === this.range.endOffset && this.range.startOffset !== 0) {
28411
28480
  while (!isNullOrUndefined(currentFocusElem) && currentFocusElem.nodeName !== '#text' &&
28412
28481
  currentFocusElem.nodeName !== 'BR') {
28413
28482
  finalFocusElem = currentFocusElem;
@@ -28418,7 +28487,7 @@ class EnterKeyAction {
28418
28487
  finalFocusElem = currentFocusElem;
28419
28488
  }
28420
28489
  finalFocusElem.innerHTML = '<br>';
28421
- if (!isImageNode) {
28490
+ if (!isMediaNode) {
28422
28491
  detach(nearBlockNode);
28423
28492
  }
28424
28493
  }
@@ -28437,6 +28506,48 @@ class EnterKeyAction {
28437
28506
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), insertElem, 0);
28438
28507
  }
28439
28508
  }
28509
+ else if (this.range.startContainer === this.range.endContainer && this.range.startContainer.nodeName === 'SPAN' &&
28510
+ (this.range.startContainer.classList.contains('e-video-wrap') ||
28511
+ this.range.startContainer.classList.contains('e-audio-wrap'))) {
28512
+ if (nearBlockNode.textContent.trim().length > 0) {
28513
+ const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true);
28514
+ let audioVideoElem = !isNullOrUndefined(newElem.previousSibling.querySelector('.e-video-wrap')) ?
28515
+ newElem.previousSibling.querySelector('.e-video-wrap') : newElem.previousSibling.querySelector('.e-audio-wrap');
28516
+ let isBRInserted = false;
28517
+ let lastNode = audioVideoElem.previousSibling;
28518
+ while (!isNullOrUndefined(lastNode) && lastNode.nodeName !== '#text') {
28519
+ lastNode = lastNode.lastChild;
28520
+ }
28521
+ if (isNullOrUndefined(lastNode)) {
28522
+ const brElm = this.parent.createElement('br');
28523
+ audioVideoElem.parentElement.appendChild(brElm);
28524
+ isBRInserted = true;
28525
+ }
28526
+ if (isBRInserted) {
28527
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), audioVideoElem.parentElement, 0);
28528
+ }
28529
+ else {
28530
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), lastNode, lastNode.textContent.length);
28531
+ }
28532
+ detach(audioVideoElem);
28533
+ }
28534
+ else {
28535
+ const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true);
28536
+ let focusElem = newElem.previousSibling;
28537
+ while (!isNullOrUndefined(focusElem.firstChild)) {
28538
+ detach(focusElem.firstChild);
28539
+ }
28540
+ const brElm = this.parent.createElement('br');
28541
+ focusElem.appendChild(brElm);
28542
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), focusElem, 0);
28543
+ }
28544
+ if (!isNullOrUndefined(this.parent.audioModule)) {
28545
+ this.parent.audioModule.hideAudioQuickToolbar();
28546
+ }
28547
+ if (!isNullOrUndefined(this.parent.videoModule)) {
28548
+ this.parent.videoModule.hideVideoQuickToolbar();
28549
+ }
28550
+ }
28440
28551
  else {
28441
28552
  const newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, nearBlockNode, true);
28442
28553
  if (!isNullOrUndefined(newElem.childNodes[0]) && newElem.childNodes[0].nodeName === '#text' &&
@@ -28452,7 +28563,7 @@ class EnterKeyAction {
28452
28563
  this.startNode = startParentElem;
28453
28564
  }
28454
28565
  else {
28455
- if (this.startNode.nodeName != 'BR') {
28566
+ if (this.startNode.nodeName !== 'BR') {
28456
28567
  this.startNode.appendChild(brElm);
28457
28568
  }
28458
28569
  }
@@ -28463,7 +28574,7 @@ class EnterKeyAction {
28463
28574
  }
28464
28575
  if (((this.parent.enterKey === 'P' || this.parent.enterKey === 'DIV') && !shiftKey) || ((this.parent.shiftEnterKey === 'DIV' ||
28465
28576
  this.parent.shiftEnterKey === 'P') && shiftKey)) {
28466
- let isHeadingTag = this.formatTags.indexOf(newElem.nodeName.toLocaleLowerCase());
28577
+ const isHeadingTag = this.formatTags.indexOf(newElem.nodeName.toLocaleLowerCase());
28467
28578
  if ((isHeadingTag < 0) || (isHeadingTag >= 0 && newElem.textContent.trim().length === 0)) {
28468
28579
  const insertElm = this.createInsertElement(shiftKey);
28469
28580
  while (newElem.firstChild) {
@@ -28535,6 +28646,7 @@ class EnterKeyAction {
28535
28646
  const outerBRElem = this.parent.createElement('br');
28536
28647
  if (this.range.startOffset === 0 && this.range.endOffset === 0 &&
28537
28648
  !isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
28649
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
28538
28650
  newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, false).cloneNode(true);
28539
28651
  this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
28540
28652
  this.insertFocusContent();
@@ -28543,6 +28655,7 @@ class EnterKeyAction {
28543
28655
  currentFocusElem = currentFocusElem.lastChild;
28544
28656
  }
28545
28657
  this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), currentFocusElem, 0);
28658
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
28546
28659
 
28547
28660
  }
28548
28661
  else {
@@ -28572,7 +28685,7 @@ class EnterKeyAction {
28572
28685
  insertBRElement() {
28573
28686
  let isEmptyBrInserted = false;
28574
28687
  let isFocusTextNode = true;
28575
- if (this.range.endContainer.textContent.length == 0 && this.range.startContainer.nodeName === "BR") {
28688
+ if (this.range.endContainer.textContent.length === 0 && this.range.startContainer.nodeName === 'BR') {
28576
28689
  isFocusTextNode = false;
28577
28690
  }
28578
28691
  const brElm = this.parent.createElement('br');
@@ -28905,7 +29018,7 @@ let RichTextEditor = class RichTextEditor extends Component {
28905
29018
  this.focusIn();
28906
29019
  }
28907
29020
  }
28908
- const tool = executeGroup[commandName];
29021
+ const tool = executeGroup[`${commandName}`];
28909
29022
  if (option && option.undo) {
28910
29023
  if (option.undo && this.formatter.getUndoRedoStack().length === 0) {
28911
29024
  this.formatter.saveData();
@@ -29123,16 +29236,18 @@ let RichTextEditor = class RichTextEditor extends Component {
29123
29236
  */
29124
29237
  addAudioVideoWrapper() {
29125
29238
  let insertElem;
29126
- let audioElm = this.element.querySelectorAll('audio');
29239
+ const audioElm = this.element.querySelectorAll('audio');
29127
29240
  for (let i = 0; i < audioElm.length; i++) {
29128
29241
  if (!audioElm[i].classList.contains('e-rte-audio')) {
29129
29242
  audioElm[i].classList.add('e-rte-audio');
29130
29243
  audioElm[i].classList.add(CLS_AUDIOINLINE);
29131
29244
  }
29245
+ // eslint-disable-next-line max-len
29132
29246
  if (!audioElm[i].parentElement.classList.contains(CLS_CLICKELEM) && !audioElm[i].parentElement.classList.contains(CLS_AUDIOWRAP)) {
29133
- let audioWrapElem = this.createElement('span', { className: CLS_AUDIOWRAP });
29247
+ const audioWrapElem = this.createElement('span', { className: CLS_AUDIOWRAP });
29248
+ audioWrapElem.setAttribute('style', 'width:300px; margin:0 auto;');
29134
29249
  audioWrapElem.contentEditable = 'false';
29135
- let audioInnerWrapElem = this.createElement('span', { className: CLS_CLICKELEM });
29250
+ const audioInnerWrapElem = this.createElement('span', { className: CLS_CLICKELEM });
29136
29251
  audioWrapElem.appendChild(audioInnerWrapElem);
29137
29252
  audioElm[i].parentNode.insertBefore(audioWrapElem, audioElm[i].nextSibling);
29138
29253
  audioInnerWrapElem.appendChild(audioElm[i]);
@@ -29142,14 +29257,15 @@ let RichTextEditor = class RichTextEditor extends Component {
29142
29257
  }
29143
29258
  }
29144
29259
  }
29145
- let videoElm = this.element.querySelectorAll('video');
29260
+ const videoElm = this.element.querySelectorAll('video');
29146
29261
  for (let i = 0; i < videoElm.length; i++) {
29147
29262
  if (!videoElm[i].classList.contains('e-rte-video')) {
29148
29263
  videoElm[i].classList.add('e-rte-video');
29149
29264
  videoElm[i].classList.add(CLS_VIDEOINLINE);
29150
29265
  }
29266
+ // eslint-disable-next-line max-len
29151
29267
  if (!videoElm[i].parentElement.classList.contains(CLS_CLICKELEM) && !videoElm[i].parentElement.classList.contains(CLS_VIDEOWRAP)) {
29152
- let videoWrapElem = this.createElement('span', { className: CLS_VIDEOWRAP });
29268
+ const videoWrapElem = this.createElement('span', { className: CLS_VIDEOWRAP });
29153
29269
  videoWrapElem.contentEditable = 'false';
29154
29270
  videoElm[i].parentNode.insertBefore(videoWrapElem, videoElm[i].nextSibling);
29155
29271
  videoWrapElem.appendChild(videoElm[i]);
@@ -29159,10 +29275,12 @@ let RichTextEditor = class RichTextEditor extends Component {
29159
29275
  }
29160
29276
  }
29161
29277
  if (Browser.userAgent.indexOf('Firefox') !== -1) {
29278
+ // eslint-disable-next-line
29162
29279
  videoElm[i].addEventListener('play', (args) => {
29163
29280
  this.notify(mouseDown, { args: args });
29164
29281
  this.notify('editAreaClick', { args: args });
29165
29282
  });
29283
+ // eslint-disable-next-line
29166
29284
  videoElm[i].addEventListener('pause', (args) => {
29167
29285
  this.notify(mouseDown, { args: args });
29168
29286
  this.notify('editAreaClick', { args: args });
@@ -29181,6 +29299,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29181
29299
  eventInitializer() {
29182
29300
  this.wireEvents();
29183
29301
  }
29302
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
29184
29303
  cleanList(e) {
29185
29304
  const range = this.getRange();
29186
29305
  const currentStartContainer = range.startContainer;
@@ -29228,6 +29347,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29228
29347
  if (closest(startNode, 'pre') &&
29229
29348
  (e.which === 8 && range.startContainer.textContent.charCodeAt(range.startOffset - 1) === 8203) ||
29230
29349
  (e.which === 46 && range.startContainer.textContent.charCodeAt(range.startOffset) === 8203)) {
29350
+ // eslint-disable-next-line
29231
29351
  const regEx = new RegExp(String.fromCharCode(8203), 'g');
29232
29352
  const pointer = e.which === 8 ? range.startOffset - 1 : range.startOffset;
29233
29353
  range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
@@ -29246,6 +29366,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29246
29366
  let bool = true;
29247
29367
  const removeNodeArray = [];
29248
29368
  for (i = index; i >= 0; i--) {
29369
+ // eslint-disable-next-line max-len
29249
29370
  if (parentEle.childNodes[i].nodeType === 3 && parentEle.childNodes[i].textContent.charCodeAt(0) === 8203 && bool) {
29250
29371
  removeNodeArray.push(i);
29251
29372
  }
@@ -29304,7 +29425,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29304
29425
  }
29305
29426
  }
29306
29427
  this.notify(keyUp, { member: 'keyup', args: e });
29307
- if (e.keyCode == 39 || e.keyCode == 37) {
29428
+ if (e.keyCode === 39 || e.keyCode === 37) {
29308
29429
  this.notify(tableModulekeyUp, { member: 'tableModulekeyUp', args: e });
29309
29430
  }
29310
29431
  if (e.code === 'KeyX' && e.which === 88 && e.keyCode === 88 && e.ctrlKey && (this.inputElement.innerHTML === '' ||
@@ -29722,6 +29843,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29722
29843
  * @hidden
29723
29844
  * @deprecated
29724
29845
  */
29846
+ /* eslint-disable */
29725
29847
  onPropertyChanged(newProp, oldProp) {
29726
29848
  for (const prop of Object.keys(newProp)) {
29727
29849
  switch (prop) {
@@ -29760,7 +29882,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29760
29882
  break;
29761
29883
  }
29762
29884
  case 'valueTemplate':
29763
- this.setValue();
29885
+ this.setValue(true);
29764
29886
  if (this.showCharCount) {
29765
29887
  this.countModule.refresh();
29766
29888
  }
@@ -29856,7 +29978,6 @@ let RichTextEditor = class RichTextEditor extends Component {
29856
29978
  this.notify(xhtmlValidation, { module: 'XhtmlValidation', newProp: newProp, oldProp: oldProp });
29857
29979
  break;
29858
29980
  case 'quickToolbarSettings':
29859
- // eslint-disable-next-line
29860
29981
  newProp.quickToolbarSettings.showOnRightClick ? this.wireContextEvent() : this.unWireContextEvent();
29861
29982
  this.notify(modelChanged, { newProp: newProp, oldProp: oldProp });
29862
29983
  break;
@@ -29866,6 +29987,7 @@ let RichTextEditor = class RichTextEditor extends Component {
29866
29987
  }
29867
29988
  }
29868
29989
  }
29990
+ /* eslint-enable */
29869
29991
  /**
29870
29992
  * @hidden
29871
29993
  * @returns {void}
@@ -30206,7 +30328,7 @@ let RichTextEditor = class RichTextEditor extends Component {
30206
30328
  styleEle.rel = 'stylesheet';
30207
30329
  return styleEle;
30208
30330
  }
30209
- setValue() {
30331
+ setValue(isPropertyChange) {
30210
30332
  if (this.valueTemplate) {
30211
30333
  const regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);
30212
30334
  if (regEx.test(this.valueTemplate)) {
@@ -30214,11 +30336,30 @@ let RichTextEditor = class RichTextEditor extends Component {
30214
30336
  }
30215
30337
  else {
30216
30338
  const compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
30217
- for (let i = 0; i < compiledTemplate.length; i++) {
30218
- const item = compiledTemplate[i];
30219
- append([item], this.element);
30339
+ if (typeof this.valueTemplate !== 'string' && this.isReact) {
30340
+ this.displayTempElem = this.createElement('div');
30341
+ for (let i = 0; i < compiledTemplate.length; i++) {
30342
+ const item = compiledTemplate[i];
30343
+ append([item], this.displayTempElem);
30344
+ }
30345
+ this.renderTemplates(() => {
30346
+ this.inputElement.innerHTML = this.displayTempElem.childNodes[0].innerHTML;
30347
+ this.setProperties({ value: this.inputElement.innerHTML.trim() });
30348
+ });
30349
+ }
30350
+ else {
30351
+ let appendElem = this.element;
30352
+ if (isPropertyChange) {
30353
+ this.inputElement.innerHTML = '';
30354
+ appendElem = this.inputElement;
30355
+ }
30356
+ for (let i = 0; i < compiledTemplate.length; i++) {
30357
+ const item = compiledTemplate[i];
30358
+ append([item], appendElem);
30359
+ }
30360
+ this.setProperties({ value: appendElem.innerHTML.trim() });
30361
+ this.renderReactTemplates();
30220
30362
  }
30221
- this.setProperties({ value: this.element.innerHTML.trim() });
30222
30363
  }
30223
30364
  }
30224
30365
  else {
@@ -30234,6 +30375,10 @@ let RichTextEditor = class RichTextEditor extends Component {
30234
30375
  }
30235
30376
  }
30236
30377
  }
30378
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30379
+ renderTemplates(callBack) {
30380
+ this.renderReactTemplates(callBack);
30381
+ }
30237
30382
  updateResizeFlag() {
30238
30383
  this.isResizeInitialized = true;
30239
30384
  }
@@ -30303,7 +30448,7 @@ let RichTextEditor = class RichTextEditor extends Component {
30303
30448
  const rzHandle = this.element.querySelector('.' + CLS_RTE_RES_HANDLE);
30304
30449
  const rzHeight = this.enableResize ? (!isNullOrUndefined(rzHandle) ? (rzHandle.offsetHeight + 8) : 0) : 0;
30305
30450
  const expandPopHeight = this.getToolbar() ? this.toolbarModule.getExpandTBarPopHeight() : 0;
30306
- if (this.toolbarSettings.type === ToolbarType.Expand && isExpand && target !== 'preview') {
30451
+ if (this.toolbarSettings.type === ToolbarType.Expand && isExpand) {
30307
30452
  heightValue = (this.height === 'auto' && rzHeight === 0) ? 'auto' : rteHeight - (tbHeight + expandPopHeight + rzHeight) + 'px';
30308
30453
  topValue = (!this.toolbarSettings.enableFloating) ? expandPopHeight : 0;
30309
30454
  }