@syncfusion/ej2-richtexteditor 19.3.43 → 19.3.47-6125

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 (220) hide show
  1. package/CHANGELOG.md +999 -955
  2. package/README.md +67 -67
  3. package/dist/ej2-richtexteditor.umd.min.js +1 -10
  4. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-richtexteditor.es2015.js +323 -204
  6. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  7. package/dist/es6/ej2-richtexteditor.es5.js +428 -313
  8. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  9. package/helpers/e2e/index.js +3 -3
  10. package/license +9 -9
  11. package/package.json +55 -74
  12. package/src/common/constant.d.ts +8 -8
  13. package/src/common/constant.js +8 -8
  14. package/src/common/interface.d.ts +7 -7
  15. package/src/editor-manager/base/classes.d.ts +1 -1
  16. package/src/editor-manager/base/classes.js +1 -1
  17. package/src/editor-manager/base/editor-manager.d.ts +3 -3
  18. package/src/editor-manager/base/editor-manager.js +4 -4
  19. package/src/editor-manager/base/interface.d.ts +7 -7
  20. package/src/editor-manager/base/types.d.ts +1 -1
  21. package/src/editor-manager/plugin/alignments.d.ts +2 -2
  22. package/src/editor-manager/plugin/alignments.js +2 -2
  23. package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
  24. package/src/editor-manager/plugin/clearformat-exec.js +2 -2
  25. package/src/editor-manager/plugin/clearformat.d.ts +2 -1
  26. package/src/editor-manager/plugin/clearformat.js +2 -1
  27. package/src/editor-manager/plugin/dom-node.d.ts +34 -34
  28. package/src/editor-manager/plugin/dom-node.js +34 -34
  29. package/src/editor-manager/plugin/formats.d.ts +2 -2
  30. package/src/editor-manager/plugin/formats.js +2 -2
  31. package/src/editor-manager/plugin/image.d.ts +3 -3
  32. package/src/editor-manager/plugin/image.js +15 -20
  33. package/src/editor-manager/plugin/indents.d.ts +2 -2
  34. package/src/editor-manager/plugin/indents.js +2 -2
  35. package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
  36. package/src/editor-manager/plugin/insert-methods.js +4 -4
  37. package/src/editor-manager/plugin/insert-text.d.ts +2 -2
  38. package/src/editor-manager/plugin/insert-text.js +2 -2
  39. package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
  40. package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
  41. package/src/editor-manager/plugin/inserthtml.d.ts +2 -2
  42. package/src/editor-manager/plugin/inserthtml.js +18 -8
  43. package/src/editor-manager/plugin/isformatted.d.ts +8 -8
  44. package/src/editor-manager/plugin/isformatted.js +8 -8
  45. package/src/editor-manager/plugin/link.d.ts +2 -2
  46. package/src/editor-manager/plugin/link.js +2 -2
  47. package/src/editor-manager/plugin/lists.d.ts +2 -2
  48. package/src/editor-manager/plugin/lists.js +2 -3
  49. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
  50. package/src/editor-manager/plugin/ms-word-clean-up.js +2 -1
  51. package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
  52. package/src/editor-manager/plugin/nodecutter.js +6 -6
  53. package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
  54. package/src/editor-manager/plugin/selection-commands.js +53 -3
  55. package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
  56. package/src/editor-manager/plugin/selection-exec.js +2 -2
  57. package/src/editor-manager/plugin/table.d.ts +2 -2
  58. package/src/editor-manager/plugin/table.js +5 -5
  59. package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
  60. package/src/editor-manager/plugin/toolbar-status.js +5 -5
  61. package/src/editor-manager/plugin/undo.d.ts +6 -6
  62. package/src/editor-manager/plugin/undo.js +6 -6
  63. package/src/global.d.ts +1 -0
  64. package/src/markdown-parser/base/interface.d.ts +10 -10
  65. package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
  66. package/src/markdown-parser/base/markdown-parser.js +3 -3
  67. package/src/markdown-parser/base/types.d.ts +1 -1
  68. package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
  69. package/src/markdown-parser/plugin/clearformat.js +2 -2
  70. package/src/markdown-parser/plugin/formats.d.ts +2 -2
  71. package/src/markdown-parser/plugin/formats.js +2 -2
  72. package/src/markdown-parser/plugin/link.d.ts +2 -2
  73. package/src/markdown-parser/plugin/link.js +2 -2
  74. package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
  75. package/src/markdown-parser/plugin/markdown-selection.js +14 -14
  76. package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
  77. package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
  78. package/src/markdown-parser/plugin/table.d.ts +3 -3
  79. package/src/markdown-parser/plugin/table.js +3 -3
  80. package/src/markdown-parser/plugin/undo.d.ts +6 -6
  81. package/src/markdown-parser/plugin/undo.js +6 -6
  82. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +9 -9
  83. package/src/rich-text-editor/actions/base-quick-toolbar.js +9 -9
  84. package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
  85. package/src/rich-text-editor/actions/base-toolbar.js +3 -3
  86. package/src/rich-text-editor/actions/color-picker.d.ts +2 -2
  87. package/src/rich-text-editor/actions/color-picker.js +2 -2
  88. package/src/rich-text-editor/actions/count.d.ts +3 -3
  89. package/src/rich-text-editor/actions/count.js +3 -3
  90. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
  91. package/src/rich-text-editor/actions/dropdown-buttons.js +2 -2
  92. package/src/rich-text-editor/actions/enter-key.js +5 -16
  93. package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
  94. package/src/rich-text-editor/actions/full-screen.js +3 -3
  95. package/src/rich-text-editor/actions/html-editor.d.ts +4 -3
  96. package/src/rich-text-editor/actions/html-editor.js +34 -4
  97. package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
  98. package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
  99. package/src/rich-text-editor/actions/keyboard.js +20 -20
  100. package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
  101. package/src/rich-text-editor/actions/markdown-editor.js +2 -2
  102. package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -1
  103. package/src/rich-text-editor/actions/paste-clean-up.js +1 -1
  104. package/src/rich-text-editor/actions/quick-toolbar.d.ts +9 -9
  105. package/src/rich-text-editor/actions/quick-toolbar.js +14 -11
  106. package/src/rich-text-editor/actions/toolbar.d.ts +13 -13
  107. package/src/rich-text-editor/actions/toolbar.js +13 -13
  108. package/src/rich-text-editor/actions/xhtml-validation.d.ts +2 -1
  109. package/src/rich-text-editor/actions/xhtml-validation.js +6 -4
  110. package/src/rich-text-editor/base/classes.d.ts +107 -107
  111. package/src/rich-text-editor/base/classes.js +107 -107
  112. package/src/rich-text-editor/base/constant.d.ts +120 -120
  113. package/src/rich-text-editor/base/constant.js +120 -120
  114. package/src/rich-text-editor/base/enum.d.ts +1 -1
  115. package/src/rich-text-editor/base/enum.js +1 -1
  116. package/src/rich-text-editor/base/interface.d.ts +45 -45
  117. package/src/rich-text-editor/base/interface.js +1 -1
  118. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +851 -851
  119. package/src/rich-text-editor/base/rich-text-editor.d.ts +53 -53
  120. package/src/rich-text-editor/base/rich-text-editor.js +65 -66
  121. package/src/rich-text-editor/base/util.d.ts +2 -1
  122. package/src/rich-text-editor/base/util.js +2 -1
  123. package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
  124. package/src/rich-text-editor/formatter/formatter.js +8 -8
  125. package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
  126. package/src/rich-text-editor/formatter/html-formatter.js +15 -15
  127. package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
  128. package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
  129. package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
  130. package/src/rich-text-editor/models/iframe-settings.js +19 -19
  131. package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
  132. package/src/rich-text-editor/models/inline-mode.js +19 -19
  133. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +439 -439
  134. package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
  135. package/src/rich-text-editor/models/toolbar-settings.js +19 -19
  136. package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
  137. package/src/rich-text-editor/renderer/content-renderer.js +6 -6
  138. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -2
  139. package/src/rich-text-editor/renderer/dialog-renderer.js +2 -2
  140. package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
  141. package/src/rich-text-editor/renderer/iframe-content-renderer.js +17 -17
  142. package/src/rich-text-editor/renderer/image-module.d.ts +3 -1
  143. package/src/rich-text-editor/renderer/image-module.js +40 -13
  144. package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
  145. package/src/rich-text-editor/renderer/link-module.js +6 -4
  146. package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
  147. package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
  148. package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
  149. package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
  150. package/src/rich-text-editor/renderer/render.d.ts +2 -2
  151. package/src/rich-text-editor/renderer/render.js +2 -2
  152. package/src/rich-text-editor/renderer/table-module.d.ts +1 -1
  153. package/src/rich-text-editor/renderer/table-module.js +11 -4
  154. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +9 -10
  155. package/src/rich-text-editor/renderer/toolbar-renderer.js +10 -10
  156. package/src/rich-text-editor/renderer/view-source.d.ts +6 -6
  157. package/src/rich-text-editor/renderer/view-source.js +6 -6
  158. package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
  159. package/src/rich-text-editor/services/renderer-factory.js +3 -3
  160. package/src/rich-text-editor/services/service-locator.d.ts +3 -3
  161. package/src/rich-text-editor/services/service-locator.js +3 -3
  162. package/src/selection/selection.d.ts +22 -22
  163. package/src/selection/selection.js +22 -22
  164. package/styles/_all.scss +2 -2
  165. package/styles/bootstrap-dark.css +1 -1
  166. package/styles/bootstrap.css +1 -1
  167. package/styles/bootstrap4.css +1 -1
  168. package/styles/bootstrap5-dark.css +1 -1
  169. package/styles/bootstrap5.css +1 -1
  170. package/styles/fabric-dark.css +1 -1
  171. package/styles/fabric.css +1 -1
  172. package/styles/highcontrast-light.css +1 -1
  173. package/styles/highcontrast.css +1 -1
  174. package/styles/material-dark.css +1 -1
  175. package/styles/material.css +1 -1
  176. package/styles/rich-text-editor/_all.scss +2 -2
  177. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +187 -187
  178. package/styles/rich-text-editor/_bootstrap-definition.scss +244 -244
  179. package/styles/rich-text-editor/_bootstrap4-definition.scss +370 -370
  180. package/styles/rich-text-editor/_bootstrap5-definition.scss +168 -168
  181. package/styles/rich-text-editor/_fabric-dark-definition.scss +168 -168
  182. package/styles/rich-text-editor/_fabric-definition.scss +167 -167
  183. package/styles/rich-text-editor/_highcontrast-definition.scss +167 -167
  184. package/styles/rich-text-editor/_highcontrast-light-definition.scss +167 -167
  185. package/styles/rich-text-editor/_layout.scss +1635 -1635
  186. package/styles/rich-text-editor/_material-dark-definition.scss +172 -172
  187. package/styles/rich-text-editor/_material-definition.scss +169 -169
  188. package/styles/rich-text-editor/_tailwind-definition.scss +167 -167
  189. package/styles/rich-text-editor/_theme.scss +626 -626
  190. package/styles/rich-text-editor/bootstrap-dark.css +1 -1
  191. package/styles/rich-text-editor/bootstrap.css +1 -1
  192. package/styles/rich-text-editor/bootstrap4.css +1 -1
  193. package/styles/rich-text-editor/bootstrap5-dark.css +1 -1
  194. package/styles/rich-text-editor/bootstrap5.css +1 -1
  195. package/styles/rich-text-editor/fabric-dark.css +1 -1
  196. package/styles/rich-text-editor/fabric.css +1 -1
  197. package/styles/rich-text-editor/highcontrast-light.css +1 -1
  198. package/styles/rich-text-editor/highcontrast.css +1 -1
  199. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +304 -304
  200. package/styles/rich-text-editor/icons/_bootstrap.scss +304 -304
  201. package/styles/rich-text-editor/icons/_bootstrap4.scss +304 -304
  202. package/styles/rich-text-editor/icons/_bootstrap5.scss +303 -303
  203. package/styles/rich-text-editor/icons/_fabric-dark.scss +304 -304
  204. package/styles/rich-text-editor/icons/_fabric.scss +304 -304
  205. package/styles/rich-text-editor/icons/_highcontrast-light.scss +304 -304
  206. package/styles/rich-text-editor/icons/_highcontrast.scss +304 -304
  207. package/styles/rich-text-editor/icons/_material-dark.scss +304 -304
  208. package/styles/rich-text-editor/icons/_material.scss +304 -304
  209. package/styles/rich-text-editor/icons/_tailwind.scss +304 -304
  210. package/styles/rich-text-editor/material-dark.css +1 -1
  211. package/styles/rich-text-editor/material.css +1 -1
  212. package/styles/rich-text-editor/tailwind-dark.css +1 -1
  213. package/styles/rich-text-editor/tailwind.css +1 -1
  214. package/styles/tailwind-dark.css +1 -1
  215. package/styles/tailwind.css +1 -1
  216. package/.eslintrc.json +0 -244
  217. package/dist/global/ej2-richtexteditor.min.js +0 -11
  218. package/dist/global/ej2-richtexteditor.min.js.map +0 -1
  219. package/dist/global/index.d.ts +0 -14
  220. package/tslint.json +0 -111
@@ -2513,6 +2513,7 @@ function getEditValue(value, rteObj) {
2513
2513
  }
2514
2514
  /**
2515
2515
  * @param {string} value - specifies the value
2516
+ * @param {IRichTextEditor} rteObj - specifies the rich text editor instance.
2516
2517
  * @returns {string} - returns the string
2517
2518
  * @hidden
2518
2519
  */
@@ -2858,7 +2859,6 @@ class ToolbarRenderer {
2858
2859
  * renderListDropDown method
2859
2860
  *
2860
2861
  * @param {IDropDownModel} args - specifies the the arguments.
2861
- * @param {string} item - specifies the string value
2862
2862
  * @returns {void}
2863
2863
  * @hidden
2864
2864
  * @deprecated
@@ -3145,6 +3145,7 @@ class ToolbarRenderer {
3145
3145
  enablePersistence: this.parent.enablePersistence,
3146
3146
  enableRtl: this.parent.enableRtl,
3147
3147
  inline: true,
3148
+ value: '#fff',
3148
3149
  created: () => {
3149
3150
  const value = (item === 'backgroundcolor') ? proxy.parent.backgroundColor.default : proxy.parent.fontColor.default;
3150
3151
  colorPicker.setProperties({ value: value });
@@ -4706,12 +4707,12 @@ class Toolbar$2 {
4706
4707
  }
4707
4708
  }
4708
4709
 
4709
- var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4710
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4711
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4712
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4713
- return c > 3 && r && Object.defineProperty(target, key, r), r;
4714
- };
4710
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
4711
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4712
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4713
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4714
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4715
+ };
4715
4716
  var KeyboardEvents_1;
4716
4717
  const keyCode = {
4717
4718
  'backspace': 8,
@@ -5760,7 +5761,10 @@ class QuickToolbar {
5760
5761
  else {
5761
5762
  const closestAnchor = closest(target, 'a');
5762
5763
  target = closestAnchor ? closestAnchor : target;
5763
- if (target.tagName !== 'IMG' && target.tagName !== 'A' && (!closest(target, 'td,th') || !range.collapsed)) {
5764
+ const startNode = this.parent.getRange().startContainer.parentElement;
5765
+ const endNode = this.parent.getRange().endContainer.parentElement;
5766
+ if ((isNullOrUndefined(closest(startNode, 'A')) || isNullOrUndefined(closest(endNode, 'A'))) && (!closest(target, 'td,th') || !range.collapsed) &&
5767
+ (target.tagName !== 'IMG' || this.parent.getRange().startOffset !== this.parent.getRange().endOffset)) {
5764
5768
  if (this.parent.inlineMode.onSelection && range.collapsed) {
5765
5769
  return;
5766
5770
  }
@@ -6728,16 +6732,16 @@ const MS_WORD_CLEANUP_PLUGIN = 'ms_word_cleanup_plugin';
6728
6732
  */
6729
6733
  const MS_WORD_CLEANUP = 'ms_word_cleanup';
6730
6734
  /**
6731
- * ActionBegin event callback
6732
- *
6733
- * @hidden
6734
- */
6735
+ * ActionBegin event callback
6736
+ *
6737
+ * @hidden
6738
+ */
6735
6739
  const ON_BEGIN = 'onBegin';
6736
6740
  /**
6737
- * Callback for spacelist action
6738
- *
6739
- * @hidden
6740
- */
6741
+ * Callback for spacelist action
6742
+ *
6743
+ * @hidden
6744
+ */
6741
6745
  const SPACE_ACTION = 'actionBegin';
6742
6746
 
6743
6747
  /**
@@ -10482,7 +10486,6 @@ class Lists {
10482
10486
  }
10483
10487
  }
10484
10488
  }
10485
- // eslint-disable-next-line
10486
10489
  enterList(e) {
10487
10490
  const range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
10488
10491
  const startNode = range.startContainer.nodeName === 'LI' ? range.startContainer :
@@ -11832,6 +11835,11 @@ class InsertHtml {
11832
11835
  const nodeSelection = new NodeSelection();
11833
11836
  const nodeCutter = new NodeCutter();
11834
11837
  let range = nodeSelection.getRange(docElement);
11838
+ if (range.startContainer === editNode && range.startContainer === range.endContainer && range.startOffset === 0 &&
11839
+ range.startOffset === range.endOffset && editNode.textContent.length === 0 && editNode.children[0].tagName === 'P') {
11840
+ nodeSelection.setSelectionText(docElement, range.startContainer.children[0], range.startContainer.children[0], 0, 0);
11841
+ range = nodeSelection.getRange(docElement);
11842
+ }
11835
11843
  const isCursor = range.startOffset === range.endOffset && range.startOffset === 0 &&
11836
11844
  range.startContainer === range.endContainer;
11837
11845
  const isCollapsed = range.collapsed;
@@ -12143,15 +12151,20 @@ class InsertHtml {
12143
12151
  blockNode = range.endContainer;
12144
12152
  range.setEnd(blockNode, range.endContainer.textContent.length);
12145
12153
  }
12146
- if (!isNullOrUndefined(blockNode) && editNode === blockNode &&
12147
- range.startContainer === editNode && range.endContainer === editNode) {
12148
- blockNode = editNode.firstElementChild;
12149
- range.setStart(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
12150
- range.setEnd(editNode.firstElementChild, editNode.firstElementChild.textContent.length);
12151
- }
12152
12154
  if (blockNode.nodeName === 'BODY' && range.startContainer === range.endContainer && range.startContainer.nodeType === 1) {
12153
12155
  blockNode = range.startContainer;
12154
12156
  }
12157
+ if (blockNode.closest('LI') && node && node.firstElementChild &&
12158
+ ((node).firstElementChild.tagName === 'OL' || node.firstElementChild.tagName === 'UL')) {
12159
+ let liNode;
12160
+ while (node.firstElementChild.lastElementChild && node.firstElementChild.lastElementChild.tagName === 'LI') {
12161
+ liNode = node.firstElementChild.lastElementChild;
12162
+ liNode.style.removeProperty('margin-left');
12163
+ liNode.style.removeProperty('margin-top');
12164
+ liNode.style.removeProperty('margin-bottom');
12165
+ node.firstElementChild.insertAdjacentElement('afterend', liNode);
12166
+ }
12167
+ }
12155
12168
  if (blockNode.nodeName === 'TD' || blockNode.nodeName === 'TH') {
12156
12169
  const tempSpan = createElement('span', { className: 'tempSpan' });
12157
12170
  range.insertNode(tempSpan);
@@ -12784,7 +12797,7 @@ class ImageCommand {
12784
12797
  * @deprecated
12785
12798
  */
12786
12799
  imageCommand(e) {
12787
- switch (e.value.toString().toLocaleLowerCase()) {
12800
+ switch (e.value.toString().toLowerCase()) {
12788
12801
  case 'image':
12789
12802
  case 'replace':
12790
12803
  this.createImage(e);
@@ -12860,21 +12873,8 @@ class ImageCommand {
12860
12873
  const selectedNode = this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)[0];
12861
12874
  const imgElm = (e.value === 'Replace' || isReplaced) ? e.item.selectParent[0] :
12862
12875
  (Browser.isIE ? selectedNode.previousSibling : selectedNode.previousElementSibling);
12863
- let preventLoadCall = false;
12864
12876
  imgElm.addEventListener('load', () => {
12865
- if (e.value === 'Replace' || isReplaced) {
12866
- if (!preventLoadCall) {
12867
- e.callBack({
12868
- requestType: 'Images',
12869
- editorMode: 'HTML',
12870
- event: e.event,
12871
- range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
12872
- elements: [imgElm]
12873
- });
12874
- preventLoadCall = true;
12875
- }
12876
- }
12877
- else {
12877
+ if (e.value !== 'Replace' || !isReplaced) {
12878
12878
  e.callBack({
12879
12879
  requestType: 'Images',
12880
12880
  editorMode: 'HTML',
@@ -13004,10 +13004,18 @@ class ImageCommand {
13004
13004
  const selectNode = e.item.selectNode[0];
13005
13005
  selectNode.style.height = '';
13006
13006
  selectNode.style.width = '';
13007
- e.item.width !== 'auto' ? selectNode.style.width = formatUnit(e.item.width) :
13007
+ if (e.item.width !== 'auto') {
13008
+ selectNode.style.width = formatUnit(e.item.width);
13009
+ }
13010
+ else {
13008
13011
  selectNode.removeAttribute('width');
13009
- e.item.height !== 'auto' ? selectNode.style.height = formatUnit(e.item.height) :
13012
+ }
13013
+ if (e.item.height !== 'auto') {
13014
+ selectNode.style.height = formatUnit(e.item.height);
13015
+ }
13016
+ else {
13010
13017
  selectNode.removeAttribute('height');
13018
+ }
13011
13019
  this.callBack(e);
13012
13020
  }
13013
13021
  imageCaption(e) {
@@ -13333,10 +13341,10 @@ class TableCommand {
13333
13341
  const colIndex = Array.prototype.slice.call(curRow.querySelectorAll(':scope > td, :scope > th')).indexOf(selectedCell);
13334
13342
  const previousWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length);
13335
13343
  const currentWidth = parseInt(e.item.width, 10) / (curRow.querySelectorAll(':scope > td, :scope > th').length + 1);
13336
- let currentTabElm = closest(curRow, 'table');
13337
- let thTdElm = closest(curRow, 'table').querySelectorAll('th,td');
13344
+ const currentTabElm = closest(curRow, 'table');
13345
+ const thTdElm = closest(curRow, 'table').querySelectorAll('th,td');
13338
13346
  for (let i = 0; i < thTdElm.length; i++) {
13339
- thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + "%";
13347
+ thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + '%';
13340
13348
  }
13341
13349
  for (let i = 0; i < allRows.length; i++) {
13342
13350
  curCell = allRows[i].querySelectorAll(':scope > td, :scope > th')[colIndex];
@@ -13349,11 +13357,11 @@ class TableCommand {
13349
13357
  // eslint-disable-next-line
13350
13358
  (e.item.subCommand === 'InsertColumnLeft') ? curCell.parentElement.insertBefore(colTemplate, curCell) :
13351
13359
  this.insertAfter(colTemplate, curCell);
13352
- colTemplate.style.width = currentWidth.toFixed(4) + "%";
13360
+ colTemplate.style.width = currentWidth.toFixed(4) + '%';
13353
13361
  delete colTemplate.dataset.oldWidth;
13354
13362
  }
13355
13363
  for (let i = 0; i < thTdElm.length; i++) {
13356
- thTdElm[i].style.width = (Number(thTdElm[i].dataset.oldWidth.split('%')[0]) * currentWidth / previousWidth).toFixed(4) + "%";
13364
+ thTdElm[i].style.width = (Number(thTdElm[i].dataset.oldWidth.split('%')[0]) * currentWidth / previousWidth).toFixed(4) + '%';
13357
13365
  delete thTdElm[i].dataset.oldWidth;
13358
13366
  }
13359
13367
  e.item.selection.setSelectionText(this.parent.currentDocument, selectedCell, selectedCell, 0, 0);
@@ -14282,6 +14290,7 @@ class SelectionCommands {
14282
14290
  * @param {Document} docElement - specifies the document
14283
14291
  * @param {string} format - specifies the string value
14284
14292
  * @param {Node} endNode - specifies the end node
14293
+ * @param {string} enterAction - specifies the enter key action
14285
14294
  * @param {string} value - specifies the string value
14286
14295
  * @param {string} selector - specifies the string
14287
14296
  * @returns {void}
@@ -14296,7 +14305,6 @@ class SelectionCommands {
14296
14305
  if (format === 'backgroundcolor' && value === '') {
14297
14306
  value = 'transparent';
14298
14307
  }
14299
- let preventRestore = false;
14300
14308
  let domSelection = new NodeSelection();
14301
14309
  const domNode = new DOMNode(endNode, docElement);
14302
14310
  const nodeCutter = new NodeCutter();
@@ -14308,6 +14316,7 @@ class SelectionCommands {
14308
14316
  let isCollapsed = false;
14309
14317
  let isFormat = false;
14310
14318
  let isCursor = false;
14319
+ let preventRestore = false;
14311
14320
  const isFontStyle = (['fontcolor', 'fontname', 'fontsize', 'backgroundcolor'].indexOf(format) > -1);
14312
14321
  if (range.collapsed) {
14313
14322
  if (nodes.length > 0) {
@@ -14331,6 +14340,9 @@ class SelectionCommands {
14331
14340
  else {
14332
14341
  domSelection.endOffset = domSelection.startOffset = 1;
14333
14342
  }
14343
+ if (cursorNode.nodeName === 'BR' && cursorNode.parentNode.textContent.length === 0) {
14344
+ preventRestore = true;
14345
+ }
14334
14346
  }
14335
14347
  }
14336
14348
  isCursor = range.collapsed;
@@ -14378,7 +14390,52 @@ class SelectionCommands {
14378
14390
  let cursorNode = null;
14379
14391
  if (cursorFormat) {
14380
14392
  cursorNode = cursorNodes[0];
14381
- InsertMethods.unwrap(cursorFormat);
14393
+ if (cursorFormat.firstChild.textContent.charCodeAt(0) === 8203) {
14394
+ const regEx = new RegExp(String.fromCharCode(8203), 'g');
14395
+ let emptySpaceNode;
14396
+ if (cursorFormat.firstChild === cursorNode) {
14397
+ cursorNode.textContent = cursorNode.textContent.replace(regEx, '');
14398
+ emptySpaceNode = cursorNode;
14399
+
14400
+ }
14401
+ else {
14402
+ cursorFormat.firstChild.textContent = cursorFormat.firstChild.textContent.replace(regEx, '');
14403
+ emptySpaceNode = cursorFormat.firstChild;
14404
+ }
14405
+ let pointer;
14406
+ if (emptySpaceNode.textContent.length === 0) {
14407
+ if (!isNullOrUndefined(emptySpaceNode.previousSibling)) {
14408
+ cursorNode = emptySpaceNode.previousSibling;
14409
+ pointer = emptySpaceNode.textContent.length - 1;
14410
+ domSelection.setCursorPoint(docElement, emptySpaceNode, pointer);
14411
+ }
14412
+ else if (!isNullOrUndefined(emptySpaceNode.parentElement) && emptySpaceNode.parentElement.textContent.length === 0) {
14413
+ let brElem = document.createElement('BR');
14414
+ emptySpaceNode.parentElement.appendChild(brElem);
14415
+ detach(emptySpaceNode);
14416
+ cursorNode = brElem;
14417
+ domSelection.setCursorPoint(docElement, cursorNode.parentElement, 0);
14418
+ }
14419
+ }
14420
+ }
14421
+ if ((['fontcolor', 'fontname', 'fontsize', 'backgroundcolor'].indexOf(format) > -1)) {
14422
+ if (format === 'fontcolor') {
14423
+ cursorFormat.style.color = value;
14424
+ }
14425
+ else if (format === 'fontname') {
14426
+ cursorFormat.style.fontFamily = value;
14427
+ }
14428
+ else if (format === 'fontsize') {
14429
+ cursorFormat.style.fontSize = value;
14430
+ }
14431
+ else {
14432
+ cursorFormat.style.backgroundColor = value;
14433
+ }
14434
+ cursorNode = cursorFormat;
14435
+ }
14436
+ else {
14437
+ InsertMethods.unwrap(cursorFormat);
14438
+ }
14382
14439
  }
14383
14440
  else {
14384
14441
  if (cursorNodes.length > 1 && range.startOffset > 0 && (cursorNodes[0].firstElementChild &&
@@ -14813,6 +14870,7 @@ class ClearFormat$1 {
14813
14870
  *
14814
14871
  * @param {Document} docElement - specifies the document element.
14815
14872
  * @param {Node} endNode - specifies the end node
14873
+ * @param {string} enterAction - specifies the enter key action
14816
14874
  * @param {string} selector - specifies the string value
14817
14875
  * @returns {void}
14818
14876
  * @hidden
@@ -15394,6 +15452,7 @@ class MsWordPaste {
15394
15452
  const imgSrc = [];
15395
15453
  const base64Src = [];
15396
15454
  const imgName = [];
15455
+ // eslint-disable-next-line
15397
15456
  const linkRegex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi);
15398
15457
  if (imgElem.length > 0) {
15399
15458
  for (let i = 0; i < imgElem.length; i++) {
@@ -16048,7 +16107,7 @@ class EditorManager {
16048
16107
  */
16049
16108
  /* eslint-enable */
16050
16109
  execCommand(command, value, event, callBack, text, exeValue, selector, enterAction) {
16051
- switch (command.toLocaleLowerCase()) {
16110
+ switch (command.toLowerCase()) {
16052
16111
  case 'lists':
16053
16112
  this.observer.notify(LIST_TYPE, { subCommand: value, event: event, callBack: callBack,
16054
16113
  selector: selector, item: exeValue, enterAction: enterAction });
@@ -16214,8 +16273,8 @@ class ToolbarStatus {
16214
16273
  const range = nodeSelection.getRange(docElement);
16215
16274
  for (let index = 0; index < nodes.length; index++) {
16216
16275
  while (nodes[index].nodeType === 3 && range.startContainer.nodeType === 3 && nodes[index].parentNode &&
16217
- nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== "BR" &&
16218
- this.getImmediateBlockNode(nodes[index].parentNode, targetNode).textContent.replace(/\u200B/g, '').length === 0 &&
16276
+ nodes[index].parentNode.lastElementChild && nodes[index].parentNode.lastElementChild.nodeName !== 'BR' &&
16277
+ (this.getImmediateBlockNode(nodes[index].parentNode)).textContent.replace(/\u200B/g, '').length === 0 &&
16219
16278
  range.startContainer.textContent.replace(/\u200B/g, '').length === 0 &&
16220
16279
  nodeSelection.get(docElement).toString().replace(/\u200B/g, '').length === 0) {
16221
16280
  nodes[index] = nodes[index].parentNode.lastElementChild.firstChild;
@@ -16291,7 +16350,7 @@ class ToolbarStatus {
16291
16350
  }
16292
16351
  return nodeCollection;
16293
16352
  }
16294
- static getImmediateBlockNode(node, editNode) {
16353
+ static getImmediateBlockNode(node) {
16295
16354
  do {
16296
16355
  node = node.parentNode;
16297
16356
  } while (node && BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0);
@@ -16653,98 +16712,98 @@ class ContentRender {
16653
16712
  }
16654
16713
  }
16655
16714
 
16656
- const IFRAMEHEADER = `
16657
- <!DOCTYPE html>
16658
- <html>
16659
- <head>
16660
- <meta charset='utf-8' />
16661
- <style>
16662
- @charset "UTF-8";
16663
- body {
16664
- font-family: "Roboto", sans-serif;
16665
- font-size: 14px;
16666
- }
16667
- html, body{height: 100%;margin: 0;}
16668
- body.e-cursor{cursor:default}
16669
- span.e-selected-node {background-color: #939393;color: white;}
16670
- span.e-selected-node.e-highlight {background-color: #1d9dd8;}
16671
- body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}
16672
- .e-rte-image {border: 0;cursor: pointer;display:
16673
- block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
16674
- .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}
16675
- .e-img-caption.e-caption-inline {display: inline-block;float: none;
16676
- margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));
16677
- position: relativetext-align: center;vertical-align: bottom;}
16678
- .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;
16679
- margin: auto;opacity: .9;text-align: center;width: 100%;}
16680
- .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}
16681
- .e-imgleft {float: left;margin: 0 5px 0 0;text-align: left;}
16682
- .e-imgright {float: right;margin: 0 0 0 5px;text-align: right;}
16683
- .e-imgcenter {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
16684
- .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}
16685
- .e-imginline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;
16686
- max-width: calc(100% - (2 * 5px));vertical-align: bottom;}
16687
- .e-imgbreak {border: 0;cursor: pointer;
16688
- display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
16689
- .e-rte-image.e-img-focus:not(.e-resize) {border: solid 2px #4a90e2;}
16690
- img.e-img-focus::selection { background: transparent;color: transparent;}
16691
- span.e-rte-imageboxmark { width: 10px; height: 10px; position: absolute; display: block;
16692
- background: #4a90e2; border: 1px solid #fff; z-index: 1000;}
16693
- .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }
16694
- .e-mob-rte span.e-rte-imageboxmark { background: #fff; border: 1px solid #4a90e2;
16695
- border-radius: 15px; height: 20px; width: 20px; }
16696
- .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }
16697
- .e-rte-content .e-content img.e-resize { z-index: 1000; }
16698
- .e-img-caption .e-img-inner { outline: 0; }
16699
- .e-img-caption a:focus-visible { outline: none; }
16700
- .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}
16701
- body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;
16702
- overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}
16703
- p{margin: 0 0 10px;margin-bottom: 10px;}
16704
- li{margin-bottom: 10px;}
16705
- h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}
16706
- h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}
16707
- h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}
16708
- h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}
16709
- h5{font-size: 00.8em;font-weight: 400;margin: 0;}
16710
- h6{font-size: 00.65em;font-weight: 400;margin: 0;}
16711
- blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}
16712
- pre{background-color: inherit;border: 0;border-radius: 0;color: #333;
16713
- font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;
16714
- white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}
16715
- strong, b{font-weight: 700;}
16716
- a{text-decoration: none;user-select: auto;}
16717
- a:hover{text-decoration: underline;};
16718
- p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}
16719
- h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}
16720
- ul:last-child{margin-bottom: 0;}
16721
- table { border-collapse: collapse; empty-cells: show;}
16722
- table td,table th {border: 1px solid #BDBDBD; height: 20px; vertical-align: middle;}
16723
- table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}
16724
- table th {background-color: #E0E0E0;}
16725
- table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD}
16726
- table .e-cell-select {border: 1px double #4a90e2;}
16727
- span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }
16728
- span.e-table-box.e-rmob {height: 14px;width: 14px;}
16729
- .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;
16730
- bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }
16731
- .e-row-resize { cursor: row-resize; height: 1px;}
16732
- .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}
16733
- .e-table-rhelper.e-column-helper { width: 1px; }
16734
- .e-table-rhelper.e-row-helper {height: 1px;}
16735
- .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;
16736
- border-top: 6px solid transparent; content: ''; display: block; height: 0;
16737
- position: absolute; right: 4px; top: 4px; width: 20px; }
16738
- .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;
16739
- border-top: 6px solid transparent; content: ''; display: block;
16740
- height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }
16741
- .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }
16742
- .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }
16743
- span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }
16744
- span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }
16745
- .e-table-rhelper { background-color: #4a90e2;}
16746
- .e-rtl { direction: rtl; }
16747
- </style>
16715
+ const IFRAMEHEADER = `
16716
+ <!DOCTYPE html>
16717
+ <html>
16718
+ <head>
16719
+ <meta charset='utf-8' />
16720
+ <style>
16721
+ @charset "UTF-8";
16722
+ body {
16723
+ font-family: "Roboto", sans-serif;
16724
+ font-size: 14px;
16725
+ }
16726
+ html, body{height: 100%;margin: 0;}
16727
+ body.e-cursor{cursor:default}
16728
+ span.e-selected-node {background-color: #939393;color: white;}
16729
+ span.e-selected-node.e-highlight {background-color: #1d9dd8;}
16730
+ body{color:#333;word-wrap:break-word;padding: 8px;box-sizing: border-box;}
16731
+ .e-rte-image {border: 0;cursor: pointer;display:
16732
+ block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
16733
+ .e-img-caption { display: inline-block; float: none; margin: 5px auto; max-width: 100%;position: relative;}
16734
+ .e-img-caption.e-caption-inline {display: inline-block;float: none;
16735
+ margin: 5px auto;margin-left: 5px;margin-right: 5px;max-width: calc(100% - (2 * 5px));
16736
+ position: relativetext-align: center;vertical-align: bottom;}
16737
+ .e-img-inner {box-sizing: border-box;display: block;font-size: 16px;font-weight: initial;
16738
+ margin: auto;opacity: .9;text-align: center;width: 100%;}
16739
+ .e-img-wrap {display: inline-block;margin: auto;padding: 0;text-align: center;width: 100%;}
16740
+ .e-imgleft {float: left;margin: 0 5px 0 0;text-align: left;}
16741
+ .e-imgright {float: right;margin: 0 0 0 5px;text-align: right;}
16742
+ .e-imgcenter {cursor: pointer;display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
16743
+ .e-control img:not(.e-resize) {border: 2px solid transparent; z-index: 1000}
16744
+ .e-imginline {display: inline-block;float: none;margin-left: 5px;margin-right: 5px;
16745
+ max-width: calc(100% - (2 * 5px));vertical-align: bottom;}
16746
+ .e-imgbreak {border: 0;cursor: pointer;
16747
+ display: block;float: none;height: auto;margin: 5px auto;max-width: 100%;position: relative;}
16748
+ .e-rte-image.e-img-focus:not(.e-resize) {border: solid 2px #4a90e2;}
16749
+ img.e-img-focus::selection { background: transparent;color: transparent;}
16750
+ span.e-rte-imageboxmark { width: 10px; height: 10px; position: absolute; display: block;
16751
+ background: #4a90e2; border: 1px solid #fff; z-index: 1000;}
16752
+ .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }
16753
+ .e-mob-rte span.e-rte-imageboxmark { background: #fff; border: 1px solid #4a90e2;
16754
+ border-radius: 15px; height: 20px; width: 20px; }
16755
+ .e-mob-rte.e-mob-span span.e-rte-imageboxmark { background: #4a90e2; border: 1px solid #fff; }
16756
+ .e-rte-content .e-content img.e-resize { z-index: 1000; }
16757
+ .e-img-caption .e-img-inner { outline: 0; }
16758
+ .e-img-caption a:focus-visible { outline: none; }
16759
+ .e-img-caption .e-rte-image.e-imgright, .e-img-caption .e-rte-image.e-imgleft { float: none; margin: 0;}
16760
+ body{box-sizing: border-box;min-height: 100px;outline: 0 solid transparent;
16761
+ overflow-x: auto;padding: 16px;position: relative;text-align: inherit;z-index: 2;}
16762
+ p{margin: 0 0 10px;margin-bottom: 10px;}
16763
+ li{margin-bottom: 10px;}
16764
+ h1{font-size: 2.17em;font-weight: 400;line-height: 1;margin: 10px 0;}
16765
+ h2{font-size: 1.74em;font-weight: 400;margin: 10px 0;}
16766
+ h3{font-size: 1.31em;font-weight: 400;margin: 10px 0;}
16767
+ h4{font-size: 16px;font-weight: 400;line-height: 1.5;margin: 0;}
16768
+ h5{font-size: 00.8em;font-weight: 400;margin: 0;}
16769
+ h6{font-size: 00.65em;font-weight: 400;margin: 0;}
16770
+ blockquote{margin: 10px 0;margin-left: 0;padding-left: 5px;border-left: solid 2px #5c5c5c;}
16771
+ pre{background-color: inherit;border: 0;border-radius: 0;color: #333;
16772
+ font-size: inherit;line-height: inherit;margin: 0 0 10px;overflow: visible;padding: 0;
16773
+ white-space: pre-wrap;word-break: inherit;word-wrap: break-word;}
16774
+ strong, b{font-weight: 700;}
16775
+ a{text-decoration: none;user-select: auto;}
16776
+ a:hover{text-decoration: underline;};
16777
+ p:last-child, pre:last-child, blockquote:last-child{margin-bottom: 0;}
16778
+ h3+h4, h4+h5, h5+h6{margin-top: 00.6em;}
16779
+ ul:last-child{margin-bottom: 0;}
16780
+ table { border-collapse: collapse; empty-cells: show;}
16781
+ table td,table th {border: 1px solid #BDBDBD; height: 20px; vertical-align: middle;}
16782
+ table.e-alternate-border tbody tr:nth-child(2n) {background-color: #F5F5F5;}
16783
+ table th {background-color: #E0E0E0;}
16784
+ table.e-dashed-border td,table.e-dashed-border th { border: 1px dashed #BDBDBD}
16785
+ table .e-cell-select {border: 1px double #4a90e2;}
16786
+ span.e-table-box { cursor: nwse-resize; display: block; height: 10px; position: absolute; width: 10px; }
16787
+ span.e-table-box.e-rmob {height: 14px;width: 14px;}
16788
+ .e-row-resize, .e-column-resize { background-color: transparent; background-repeat: repeat;
16789
+ bottom: 0;cursor: col-resize;height: 1px;overflow: visible;position: absolute;width: 1px; }
16790
+ .e-row-resize { cursor: row-resize; height: 1px;}
16791
+ .e-table-rhelper { cursor: col-resize; opacity: .87;position: absolute;}
16792
+ .e-table-rhelper.e-column-helper { width: 1px; }
16793
+ .e-table-rhelper.e-row-helper {height: 1px;}
16794
+ .e-reicon::before { border-bottom: 6px solid transparent; border-right: 6px solid;
16795
+ border-top: 6px solid transparent; content: ''; display: block; height: 0;
16796
+ position: absolute; right: 4px; top: 4px; width: 20px; }
16797
+ .e-reicon::after { border-bottom: 6px solid transparent; border-left: 6px solid;
16798
+ border-top: 6px solid transparent; content: ''; display: block;
16799
+ height: 0; left: 4px; position: absolute; top: 4px; width: 20px; z-index: 3; }
16800
+ .e-row-helper.e-reicon::after { top: 10px; transform: rotate(90deg); }
16801
+ .e-row-helper.e-reicon::before { left: 4px; top: -20px; transform: rotate(90deg); }
16802
+ span.e-table-box { background-color: #ffffff; border: 1px solid #BDBDBD; }
16803
+ span.e-table-box.e-rbox-select { background-color: #BDBDBD; border: 1px solid #BDBDBD; }
16804
+ .e-table-rhelper { background-color: #4a90e2;}
16805
+ .e-rtl { direction: rtl; }
16806
+ </style>
16748
16807
  </head>`;
16749
16808
  /**
16750
16809
  * Content module is used to render Rich Text Editor content
@@ -16845,22 +16904,24 @@ class XhtmlValidation {
16845
16904
  this.ImageTags();
16846
16905
  this.removeTags();
16847
16906
  this.RemoveUnsupported();
16848
- this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText === "\n" ? this.currentElement.innerText.length : this.currentElement.innerText.trim().length);
16907
+ this.currentElement.innerHTML = this.selfEncloseValidation(this.currentElement.innerHTML, this.currentElement.innerText === '\n' ?
16908
+ this.currentElement.innerText.length : this.currentElement.innerText.trim().length);
16849
16909
  this.parent.setProperties({ value: this.currentElement.innerHTML }, true);
16850
16910
  }
16851
16911
  }
16852
16912
  /**
16853
16913
  * @param {string} currentValue - specifies the string value.
16914
+ * @param {number} valueLength - specifies the length of the current value.
16854
16915
  * @returns {void}
16855
16916
  * @deprecated
16856
16917
  */
16857
16918
  selfEncloseValidation(currentValue, valueLength) {
16858
16919
  if (valueLength === 0 && currentValue.indexOf('table') < 0 && currentValue.indexOf('img') < 0) {
16859
- let arrayValue = currentValue.split('&nbsp;');
16860
- arrayValue[arrayValue.length - 1] = "&#8203;" + arrayValue[arrayValue.length - 1];
16920
+ const arrayValue = currentValue.split('&nbsp;');
16921
+ arrayValue[arrayValue.length - 1] = '&#8203;' + arrayValue[arrayValue.length - 1];
16861
16922
  currentValue = arrayValue.join('');
16862
16923
  }
16863
- currentValue = currentValue.replace(/<br>/g, '<br/>').replace(/<hr>/g, '<hr/>').replace(/&nbsp;/gi, ' ').replace(/ /g, ' ');
16924
+ currentValue = currentValue.replace(/<br>/g, '<br/>').replace(/<hr>/g, '<hr/>').replace(/ /g, ' ');
16864
16925
  let valueTemp;
16865
16926
  const valueDupe = [];
16866
16927
  let valueOriginal = [];
@@ -17035,6 +17096,7 @@ class HtmlEditor {
17035
17096
  this.parent.on(initialLoad, this.instantiateRenderer, this);
17036
17097
  this.parent.on(htmlToolbarClick, this.onToolbarClick, this);
17037
17098
  this.parent.on(keyDown, this.onKeyDown, this);
17099
+ this.parent.on(keyUp, this.onKeyUp, this);
17038
17100
  this.parent.on(renderColorPicker, this.renderColorPicker, this);
17039
17101
  this.parent.on(initialEnd, this.render, this);
17040
17102
  this.parent.on(modelChanged, this.onPropertyChanged, this);
@@ -17069,9 +17131,33 @@ class HtmlEditor {
17069
17131
  this.saveSelection.restore();
17070
17132
  }
17071
17133
  }
17134
+ onKeyUp(e) {
17135
+ let args = e.args;
17136
+ const restrictKeys = [8, 9, 13, 16, 17, 18, 20, 27, 37, 38, 39, 40, 44, 45, 46, 91,
17137
+ 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123];
17138
+ const range = this.parent.getRange();
17139
+ const regEx = new RegExp(String.fromCharCode(8203), 'g');
17140
+ let pointer;
17141
+ if (restrictKeys.indexOf(args.keyCode) < 0 && !args.shiftKey && !args.ctrlKey && !args.altKey) {
17142
+ if (range.startContainer.textContent.charCodeAt(0) === 8203) {
17143
+ pointer = range.startOffset - 1;
17144
+ range.startContainer.textContent = range.startContainer.textContent.replace(regEx, '');
17145
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), range.startContainer, pointer);
17146
+ }
17147
+ if (!isNullOrUndefined(range.startContainer.previousSibling) && !isNullOrUndefined(range.startContainer.previousSibling.parentElement) &&
17148
+ range.startContainer.parentElement === range.startContainer.previousSibling.parentElement && range.startContainer.previousSibling.textContent.charCodeAt(0) === 8203) {
17149
+ range.startContainer.previousSibling.textContent = range.startContainer.previousSibling.textContent.replace(regEx, '');
17150
+ }
17151
+ if (range.endContainer.textContent.charCodeAt(range.endOffset) === 8203) {
17152
+ pointer = range.startOffset;
17153
+ range.endContainer.textContent = range.endContainer.textContent.replace(regEx, '');
17154
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), range.startContainer, pointer);
17155
+ }
17156
+ }
17157
+ }
17072
17158
  onKeyDown(e) {
17073
17159
  let currentRange;
17074
- let args = e.args;
17160
+ const args = e.args;
17075
17161
  if (Browser.info.name === 'chrome') {
17076
17162
  currentRange = this.parent.getRange();
17077
17163
  this.backSpaceCleanup(e, currentRange);
@@ -17278,7 +17364,12 @@ class HtmlEditor {
17278
17364
  while (this.deleteOldRangeElement.firstChild) {
17279
17365
  this.deleteRangeElement.appendChild(this.deleteOldRangeElement.childNodes[0]);
17280
17366
  }
17281
- !isLiElement ? detach(this.deleteOldRangeElement) : detach(this.deleteOldRangeElement.parentElement);
17367
+ if (!isLiElement) {
17368
+ detach(this.deleteOldRangeElement);
17369
+ }
17370
+ else {
17371
+ detach(this.deleteOldRangeElement.parentElement);
17372
+ }
17282
17373
  this.deleteRangeElement.normalize();
17283
17374
  }
17284
17375
  else {
@@ -19305,7 +19396,8 @@ class Link {
19305
19396
  this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
19306
19397
  const isPopupOpen = this.quickToolObj.linkQTBar.element.classList.contains('e-rte-pop');
19307
19398
  if (target.nodeName === 'A' && (target.childNodes.length > 0 && target.childNodes[0].nodeName !== 'IMG') &&
19308
- e.args.target.nodeName !== 'IMG') {
19399
+ e.args.target.nodeName !== 'IMG' &&
19400
+ !isNullOrUndefined(closest(this.parent.getRange().startContainer.parentElement, 'A')) && !isNullOrUndefined(closest(this.parent.getRange().endContainer.parentElement, 'A'))) {
19309
19401
  if (isPopupOpen) {
19310
19402
  return;
19311
19403
  }
@@ -19565,7 +19657,8 @@ class Link {
19565
19657
  else {
19566
19658
  argsValue = this.args;
19567
19659
  }
19568
- this.selfLink.parent.formatter.process(this.selfLink.parent, argsValue, (!isNullOrUndefined(this.args) && this.args.originalEvent), value);
19660
+ this.selfLink.parent.formatter.process(this.selfLink.parent, argsValue, (!isNullOrUndefined(this.args) &&
19661
+ this.args.originalEvent), value);
19569
19662
  this.selfLink.parent.contentModule.getEditPanel().focus();
19570
19663
  }
19571
19664
  isUrl(url) {
@@ -19982,7 +20075,7 @@ class Image {
19982
20075
  if (width > height) {
19983
20076
  img.style.minWidth = '20px';
19984
20077
  if (this.parent.insertImageSettings.resizeByPercent) {
19985
- if (parseInt('' + img.getBoundingClientRect().width + '') !== 0 && parseInt('' + width + '') !== 0) {
20078
+ if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
19986
20079
  const percentageValue = this.pixToPerc((width / height * expectedY), (img.previousElementSibling || img.parentElement));
19987
20080
  img.style.width = Math.min(Math.round((percentageValue / img.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
19988
20081
  }
@@ -20008,7 +20101,7 @@ class Image {
20008
20101
  }
20009
20102
  else if (height > width) {
20010
20103
  if (this.parent.insertImageSettings.resizeByPercent) {
20011
- if (parseInt('' + img.getBoundingClientRect().width + '') !== 0 && parseInt('' + width + '') !== 0) {
20104
+ if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
20012
20105
  img.style.width = Math.min(Math.round((width / img.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
20013
20106
  }
20014
20107
  else {
@@ -20479,7 +20572,7 @@ class Image {
20479
20572
  const target = args.target;
20480
20573
  this.contentModule = this.rendererFactory.getRenderer(RenderType.Content);
20481
20574
  const isPopupOpen = this.quickToolObj.imageQTBar.element.classList.contains('e-rte-pop');
20482
- if (target.nodeName === 'IMG' && this.parent.quickToolbarModule) {
20575
+ if (target.nodeName === 'IMG' && this.parent.quickToolbarModule && this.parent.getRange().startOffset === this.parent.getRange().endOffset) {
20483
20576
  if (isPopupOpen) {
20484
20577
  return;
20485
20578
  }
@@ -20716,13 +20809,34 @@ class Image {
20716
20809
  }
20717
20810
  }
20718
20811
  imageRemovePost(src) {
20812
+ const proxy = this;
20813
+ let absoluteUrl = '';
20814
+ if (src.indexOf('http://') > -1 || src.indexOf('https://') > -1) {
20815
+ absoluteUrl = src;
20816
+ }
20817
+ else {
20818
+ absoluteUrl = new URL(src, document.baseURI).href;
20819
+ }
20820
+ this.removingImgName = absoluteUrl.replace(/^.*[\\\/]/, '');
20821
+ const xhr = new XMLHttpRequest();
20822
+ xhr.addEventListener("readystatechange", function () {
20823
+ if (this.readyState == 4 && this.status == 200) {
20824
+ proxy.triggerPost(this.response);
20825
+ }
20826
+ });
20827
+ xhr.open('GET', absoluteUrl);
20828
+ xhr.responseType = 'blob';
20829
+ xhr.send();
20830
+ }
20831
+ triggerPost(response) {
20719
20832
  const removeUrl = this.parent.insertImageSettings.removeUrl;
20720
20833
  if (isNullOrUndefined(removeUrl) || removeUrl === '') {
20721
20834
  return;
20722
20835
  }
20836
+ const file = new File([response], this.removingImgName);
20723
20837
  const ajax = new Ajax(removeUrl, 'POST', true, null);
20724
20838
  const formData = new FormData();
20725
- formData.append(name, src);
20839
+ formData.append('UploadFiles', file);
20726
20840
  ajax.send(formData);
20727
20841
  }
20728
20842
  caption(e) {
@@ -20960,9 +21074,15 @@ class Image {
20960
21074
  (this.parent.getToolbarElement() && this.parent.getToolbarElement().contains(e.target) &&
20961
21075
  !closest(target, '#' + this.parent.getID() + '_toolbar_Image') &&
20962
21076
  !target.querySelector('#' + this.parent.getID() + '_toolbar_Image')))) {
20963
- this.dialogObj.hide({ returnValue: true });
20964
- this.parent.isBlur = true;
20965
- dispatchEvent(this.parent.element, 'focusout');
21077
+ /* eslint-disable */
21078
+ if (e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight) {
21079
+ }
21080
+ else {
21081
+ this.dialogObj.hide({ returnValue: true });
21082
+ this.parent.isBlur = true;
21083
+ dispatchEvent(this.parent.element, 'focusout');
21084
+ }
21085
+ /* eslint-enable */
20966
21086
  }
20967
21087
  if (e.target.tagName !== 'IMG' && this.imgResizeDiv && !(this.quickToolObj &&
20968
21088
  this.quickToolObj.imageQTBar && this.quickToolObj.imageQTBar.element.contains(e.target)) &&
@@ -21064,11 +21184,11 @@ class Image {
21064
21184
  const imgWidth = this.i10n.getConstant('imageWidth');
21065
21185
  const imgSizeWrap = this.parent.createElement('div', { className: 'e-img-sizewrap' });
21066
21186
  const widthVal = isNullOrUndefined(this.changedWidthValue) && (selectNode.style.width.toString() === 'auto' ||
21067
- selectNode.style.width !== "") ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
21068
- this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString())).toString();
21187
+ selectNode.style.width !== '') ? selectNode.style.width : !isNullOrUndefined(this.changedWidthValue) ?
21188
+ this.changedWidthValue : (parseInt(selectNode.getClientRects()[0].width.toString(), 10)).toString();
21069
21189
  const heightVal = isNullOrUndefined(this.changedHeightValue) && (selectNode.style.height.toString() === 'auto' ||
21070
- selectNode.style.height !== "") ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
21071
- this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString())).toString();
21190
+ selectNode.style.height !== '') ? selectNode.style.height : !isNullOrUndefined(this.changedHeightValue) ?
21191
+ this.changedHeightValue : (parseInt(selectNode.getClientRects()[0].height.toString(), 10)).toString();
21072
21192
  this.changedWidthValue = null;
21073
21193
  this.changedHeightValue = null;
21074
21194
  const content = '<div class="e-rte-label"><label>' + imgWidth +
@@ -21107,7 +21227,7 @@ class Image {
21107
21227
  return value;
21108
21228
  }
21109
21229
  else {
21110
- return "auto";
21230
+ return 'auto';
21111
21231
  }
21112
21232
  }
21113
21233
  insertSize(e) {
@@ -22299,8 +22419,12 @@ class Table {
22299
22419
  if (args.args && args.args.item.cssClass) {
22300
22420
  const classList = args.args.item.cssClass.split(' ');
22301
22421
  for (let i = 0; i < classList.length; i++) {
22302
- (table.classList.contains(classList[i])) ? table.classList.remove(classList[i]) :
22422
+ if (table.classList.contains(classList[i])) {
22423
+ table.classList.remove(classList[i]);
22424
+ }
22425
+ else {
22303
22426
  table.classList.add(classList[i]);
22427
+ }
22304
22428
  }
22305
22429
  }
22306
22430
  this.parent.formatter.saveData();
@@ -22456,7 +22580,9 @@ class Table {
22456
22580
  }
22457
22581
  const range = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
22458
22582
  const closestTable = closest(target, 'table');
22459
- if (target && target.nodeName !== 'A' && target.nodeName !== 'IMG' && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
22583
+ const startNode = this.parent.getRange().startContainer.parentElement;
22584
+ const endNode = this.parent.getRange().endContainer.parentElement;
22585
+ if (target && target.nodeName !== 'A' && target.nodeName !== 'IMG' && startNode === endNode && (target.nodeName === 'TD' || target.nodeName === 'TH' ||
22460
22586
  target.nodeName === 'TABLE' || (closestTable && this.parent.contentModule.getEditPanel().contains(closestTable)))
22461
22587
  && !(range.startContainer.nodeType === 3 && !range.collapsed)) {
22462
22588
  const range = this.parent.formatter.editorManager.nodeSelection.getRange(this.contentModule.getDocument());
@@ -22543,7 +22669,6 @@ class Table {
22543
22669
  tdNode : target;
22544
22670
  removeClass(this.contentModule.getEditPanel().querySelectorAll('table td, table th'), CLS_TABLE_SEL);
22545
22671
  if (target && (target.tagName === 'TD' || target.tagName === 'TH')) {
22546
- target.removeAttribute('class');
22547
22672
  addClass([target], CLS_TABLE_SEL);
22548
22673
  this.activeCell = target;
22549
22674
  this.curTable = (this.curTable) ? this.curTable : closest(target, 'table');
@@ -22642,6 +22767,7 @@ class Table {
22642
22767
  top: 0,
22643
22768
  left: 0
22644
22769
  };
22770
+ // eslint-disable-next-line
22645
22771
  const offset = elem.getBoundingClientRect();
22646
22772
  const doc = elem.ownerDocument;
22647
22773
  let offsetParent = elem.offsetParent || doc.documentElement;
@@ -22654,6 +22780,7 @@ class Table {
22654
22780
  offsetParent = closest(offsetParent, '.e-rte-content');
22655
22781
  }
22656
22782
  if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
22783
+ // eslint-disable-next-line
22657
22784
  parentOffset = offsetParent.getBoundingClientRect();
22658
22785
  }
22659
22786
  return {
@@ -23517,12 +23644,12 @@ const executeGroup = {
23517
23644
  }
23518
23645
  };
23519
23646
 
23520
- var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23521
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23522
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23523
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23524
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23525
- };
23647
+ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23648
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23649
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23650
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23651
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23652
+ };
23526
23653
  /**
23527
23654
  * Configures the toolbar settings of the RichTextEditor.
23528
23655
  */
@@ -23811,12 +23938,12 @@ __decorate$2([
23811
23938
  Property(bulletFormatList)
23812
23939
  ], BulletFormatList.prototype, "types", void 0);
23813
23940
 
23814
- var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23815
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23816
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23817
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23818
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23819
- };
23941
+ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23942
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23943
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23944
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23945
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23946
+ };
23820
23947
  /**
23821
23948
  * Objects used for configuring the iframe resources properties.
23822
23949
  */
@@ -23843,12 +23970,12 @@ __decorate$3([
23843
23970
  Complex({}, Resources)
23844
23971
  ], IFrameSettings.prototype, "resources", void 0);
23845
23972
 
23846
- var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23847
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23848
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23849
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23850
- return c > 3 && r && Object.defineProperty(target, key, r), r;
23851
- };
23973
+ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
23974
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
23975
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23976
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
23977
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23978
+ };
23852
23979
  /**
23853
23980
  * Configures the inlineMode property of the RTE.
23854
23981
  */
@@ -23944,9 +24071,9 @@ class EnterKeyAction {
23944
24071
  this.getRangeNode();
23945
24072
  }
23946
24073
  }
23947
- if (this.range.startContainer === this.range.endContainer && this.range.startOffset === 0 &&
23948
- this.range.startOffset == this.range.endOffset && this.range.startContainer === this.parent.inputElement) {
23949
- this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.range.startContainer.childNodes[this.range.startOffset], this.range.startOffset);
24074
+ if (this.range.startContainer === this.range.endContainer &&
24075
+ this.range.startOffset === this.range.endOffset && this.range.startContainer === this.parent.inputElement) {
24076
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.range.startContainer.childNodes[this.range.startOffset], 0);
23950
24077
  this.getRangeNode();
23951
24078
  }
23952
24079
  if (this.parent.enterKey === 'P' || this.parent.enterKey === 'DIV' ||
@@ -23989,6 +24116,7 @@ class EnterKeyAction {
23989
24116
  detach(nearBlockNode);
23990
24117
  }
23991
24118
  }
24119
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), insertElem.nextElementSibling, 0);
23992
24120
  }
23993
24121
  else if (nearBlockNode.textContent.length === 0 && !(!isNullOrUndefined(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
23994
24122
  if (!isNullOrUndefined(nearBlockNode.children[0]) && nearBlockNode.children[0].tagName !== 'BR') {
@@ -24022,7 +24150,7 @@ class EnterKeyAction {
24022
24150
  }
24023
24151
  this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
24024
24152
  detach(newElem);
24025
- this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), insertElm, insertElm.textContent.length >= 0 ? 0 : 1);
24153
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), this.parent.formatter.editorManager.domNode.isBlockNode(this.startNode) ? insertElm : this.startNode, 0);
24026
24154
  }
24027
24155
  }
24028
24156
  e.args.preventDefault();
@@ -24062,11 +24190,9 @@ class EnterKeyAction {
24062
24190
  }
24063
24191
  else {
24064
24192
  let newElem;
24065
- let focusElem;
24066
24193
  const outerBRElem = this.parent.createElement('br');
24067
24194
  if (this.range.startOffset === 0 && this.range.endOffset === 0 &&
24068
24195
  !isNullOrUndefined(currentParent.previousSibling) && currentParent.previousSibling.nodeName === 'BR') {
24069
- focusElem = this.range.startContainer;
24070
24196
  newElem = this.parent.formatter.editorManager.nodeCutter.SplitNode(this.range, currentParent, false).cloneNode(true);
24071
24197
  this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
24072
24198
  this.insertFocusContent();
@@ -24109,12 +24235,6 @@ class EnterKeyAction {
24109
24235
  }
24110
24236
  e.args.preventDefault();
24111
24237
  }
24112
- if (this.range.startContainer.nodeName === '#text') {
24113
- this.range.startContainer.parentElement.scrollIntoView(false);
24114
- }
24115
- else {
24116
- this.range.startContainer.scrollIntoView(false);
24117
- }
24118
24238
  this.parent.trigger(actionComplete, { requestType: shiftKey ? 'ShiftEnterAction' : 'EnterAction', args: e.args });
24119
24239
  }
24120
24240
  });
@@ -24143,12 +24263,12 @@ class EnterKeyAction {
24143
24263
  }
24144
24264
  }
24145
24265
 
24146
- var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
24147
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
24148
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
24149
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24150
- return c > 3 && r && Object.defineProperty(target, key, r), r;
24151
- };
24266
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
24267
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
24268
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
24269
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24270
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
24271
+ };
24152
24272
  /**
24153
24273
  * Represents the Rich Text Editor component.
24154
24274
  * ```html
@@ -25518,8 +25638,7 @@ let RichTextEditor = class RichTextEditor extends Component {
25518
25638
  this.setProperties({ value: this.valueTemplate });
25519
25639
  }
25520
25640
  else {
25521
- const compiledString = compile(this.valueTemplate);
25522
- const compiledTemplate = compiledString({});
25641
+ const compiledTemplate = compile(this.valueTemplate)('', this, 'valueTemplate');
25523
25642
  for (let i = 0; i < compiledTemplate.length; i++) {
25524
25643
  const item = compiledTemplate[i];
25525
25644
  append([item], this.element);