@syncfusion/ej2-richtexteditor 19.3.53-6125 → 19.4.38

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 (196) hide show
  1. package/.eslintrc.json +244 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +41 -0
  3. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +27 -0
  4. package/CHANGELOG.md +1021 -1019
  5. package/README.md +67 -67
  6. package/dist/ej2-richtexteditor.umd.min.js +10 -1
  7. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  8. package/dist/es6/ej2-richtexteditor.es2015.js +273 -181
  9. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  10. package/dist/es6/ej2-richtexteditor.es5.js +381 -289
  11. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  12. package/dist/global/ej2-richtexteditor.min.js +11 -0
  13. package/dist/global/ej2-richtexteditor.min.js.map +1 -0
  14. package/dist/global/index.d.ts +14 -0
  15. package/helpers/e2e/index.js +3 -3
  16. package/license +9 -9
  17. package/package.json +75 -75
  18. package/src/common/interface.d.ts +7 -7
  19. package/src/editor-manager/base/classes.d.ts +1 -1
  20. package/src/editor-manager/base/classes.js +1 -1
  21. package/src/editor-manager/base/editor-manager.d.ts +3 -3
  22. package/src/editor-manager/base/editor-manager.js +3 -3
  23. package/src/editor-manager/base/interface.d.ts +7 -7
  24. package/src/editor-manager/base/types.d.ts +1 -1
  25. package/src/editor-manager/plugin/alignments.d.ts +2 -2
  26. package/src/editor-manager/plugin/alignments.js +2 -2
  27. package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
  28. package/src/editor-manager/plugin/clearformat-exec.js +2 -2
  29. package/src/editor-manager/plugin/clearformat.d.ts +1 -1
  30. package/src/editor-manager/plugin/clearformat.js +1 -1
  31. package/src/editor-manager/plugin/dom-node.d.ts +34 -34
  32. package/src/editor-manager/plugin/dom-node.js +34 -34
  33. package/src/editor-manager/plugin/formats.d.ts +2 -2
  34. package/src/editor-manager/plugin/formats.js +2 -2
  35. package/src/editor-manager/plugin/image.d.ts +3 -3
  36. package/src/editor-manager/plugin/image.js +3 -3
  37. package/src/editor-manager/plugin/indents.d.ts +2 -2
  38. package/src/editor-manager/plugin/indents.js +2 -2
  39. package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
  40. package/src/editor-manager/plugin/insert-methods.js +4 -4
  41. package/src/editor-manager/plugin/insert-text.d.ts +2 -2
  42. package/src/editor-manager/plugin/insert-text.js +2 -2
  43. package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
  44. package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
  45. package/src/editor-manager/plugin/inserthtml.d.ts +2 -2
  46. package/src/editor-manager/plugin/inserthtml.js +2 -4
  47. package/src/editor-manager/plugin/isformatted.d.ts +8 -8
  48. package/src/editor-manager/plugin/isformatted.js +8 -8
  49. package/src/editor-manager/plugin/link.d.ts +2 -2
  50. package/src/editor-manager/plugin/link.js +2 -2
  51. package/src/editor-manager/plugin/lists.d.ts +2 -2
  52. package/src/editor-manager/plugin/lists.js +2 -2
  53. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +1 -1
  54. package/src/editor-manager/plugin/ms-word-clean-up.js +2 -2
  55. package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
  56. package/src/editor-manager/plugin/nodecutter.js +6 -6
  57. package/src/editor-manager/plugin/selection-commands.d.ts +1 -1
  58. package/src/editor-manager/plugin/selection-commands.js +1 -1
  59. package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
  60. package/src/editor-manager/plugin/selection-exec.js +2 -2
  61. package/src/editor-manager/plugin/table.d.ts +2 -2
  62. package/src/editor-manager/plugin/table.js +2 -2
  63. package/src/editor-manager/plugin/toolbar-status.d.ts +2 -2
  64. package/src/editor-manager/plugin/toolbar-status.js +2 -2
  65. package/src/editor-manager/plugin/undo.d.ts +6 -6
  66. package/src/editor-manager/plugin/undo.js +16 -7
  67. package/src/markdown-parser/base/interface.d.ts +10 -10
  68. package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
  69. package/src/markdown-parser/base/markdown-parser.js +3 -3
  70. package/src/markdown-parser/base/types.d.ts +1 -1
  71. package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
  72. package/src/markdown-parser/plugin/clearformat.js +2 -2
  73. package/src/markdown-parser/plugin/formats.d.ts +2 -2
  74. package/src/markdown-parser/plugin/formats.js +2 -2
  75. package/src/markdown-parser/plugin/link.d.ts +2 -2
  76. package/src/markdown-parser/plugin/link.js +2 -2
  77. package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
  78. package/src/markdown-parser/plugin/markdown-selection.js +14 -14
  79. package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
  80. package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
  81. package/src/markdown-parser/plugin/table.d.ts +3 -3
  82. package/src/markdown-parser/plugin/table.js +3 -3
  83. package/src/markdown-parser/plugin/undo.d.ts +6 -6
  84. package/src/markdown-parser/plugin/undo.js +6 -6
  85. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +9 -9
  86. package/src/rich-text-editor/actions/base-quick-toolbar.js +9 -9
  87. package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
  88. package/src/rich-text-editor/actions/base-toolbar.js +3 -3
  89. package/src/rich-text-editor/actions/color-picker.d.ts +2 -2
  90. package/src/rich-text-editor/actions/color-picker.js +2 -2
  91. package/src/rich-text-editor/actions/count.d.ts +3 -3
  92. package/src/rich-text-editor/actions/count.js +3 -3
  93. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
  94. package/src/rich-text-editor/actions/dropdown-buttons.js +2 -12
  95. package/src/rich-text-editor/actions/enter-key.d.ts +1 -0
  96. package/src/rich-text-editor/actions/enter-key.js +85 -34
  97. package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
  98. package/src/rich-text-editor/actions/full-screen.js +3 -3
  99. package/src/rich-text-editor/actions/html-editor.d.ts +3 -3
  100. package/src/rich-text-editor/actions/html-editor.js +5 -5
  101. package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
  102. package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
  103. package/src/rich-text-editor/actions/keyboard.js +20 -20
  104. package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
  105. package/src/rich-text-editor/actions/markdown-editor.js +2 -2
  106. package/src/rich-text-editor/actions/paste-clean-up.d.ts +1 -1
  107. package/src/rich-text-editor/actions/paste-clean-up.js +1 -1
  108. package/src/rich-text-editor/actions/quick-toolbar.d.ts +9 -9
  109. package/src/rich-text-editor/actions/quick-toolbar.js +10 -10
  110. package/src/rich-text-editor/actions/toolbar.d.ts +13 -13
  111. package/src/rich-text-editor/actions/toolbar.js +13 -13
  112. package/src/rich-text-editor/actions/xhtml-validation.d.ts +1 -1
  113. package/src/rich-text-editor/actions/xhtml-validation.js +2 -2
  114. package/src/rich-text-editor/base/classes.d.ts +107 -107
  115. package/src/rich-text-editor/base/classes.js +107 -107
  116. package/src/rich-text-editor/base/constant.d.ts +120 -120
  117. package/src/rich-text-editor/base/constant.js +120 -120
  118. package/src/rich-text-editor/base/enum.d.ts +1 -1
  119. package/src/rich-text-editor/base/enum.js +1 -1
  120. package/src/rich-text-editor/base/interface.d.ts +45 -45
  121. package/src/rich-text-editor/base/interface.js +1 -1
  122. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +851 -851
  123. package/src/rich-text-editor/base/rich-text-editor.d.ts +53 -53
  124. package/src/rich-text-editor/base/rich-text-editor.js +65 -65
  125. package/src/rich-text-editor/base/util.d.ts +1 -1
  126. package/src/rich-text-editor/base/util.js +1 -1
  127. package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
  128. package/src/rich-text-editor/formatter/formatter.js +8 -8
  129. package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
  130. package/src/rich-text-editor/formatter/html-formatter.js +15 -15
  131. package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
  132. package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
  133. package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
  134. package/src/rich-text-editor/models/iframe-settings.js +19 -19
  135. package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
  136. package/src/rich-text-editor/models/inline-mode.js +19 -19
  137. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +439 -439
  138. package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
  139. package/src/rich-text-editor/models/toolbar-settings.js +19 -19
  140. package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
  141. package/src/rich-text-editor/renderer/content-renderer.js +6 -6
  142. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +2 -2
  143. package/src/rich-text-editor/renderer/dialog-renderer.js +2 -2
  144. package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
  145. package/src/rich-text-editor/renderer/iframe-content-renderer.js +17 -17
  146. package/src/rich-text-editor/renderer/image-module.d.ts +1 -1
  147. package/src/rich-text-editor/renderer/image-module.js +50 -5
  148. package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
  149. package/src/rich-text-editor/renderer/link-module.js +1 -1
  150. package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
  151. package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
  152. package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
  153. package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
  154. package/src/rich-text-editor/renderer/render.d.ts +2 -2
  155. package/src/rich-text-editor/renderer/render.js +2 -2
  156. package/src/rich-text-editor/renderer/table-module.d.ts +1 -1
  157. package/src/rich-text-editor/renderer/table-module.js +1 -1
  158. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +9 -9
  159. package/src/rich-text-editor/renderer/toolbar-renderer.js +9 -9
  160. package/src/rich-text-editor/renderer/view-source.d.ts +6 -6
  161. package/src/rich-text-editor/renderer/view-source.js +6 -6
  162. package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
  163. package/src/rich-text-editor/services/renderer-factory.js +3 -3
  164. package/src/rich-text-editor/services/service-locator.d.ts +3 -3
  165. package/src/rich-text-editor/services/service-locator.js +3 -3
  166. package/src/selection/selection.d.ts +22 -22
  167. package/src/selection/selection.js +22 -22
  168. package/styles/_all.scss +2 -2
  169. package/styles/rich-text-editor/_all.scss +2 -2
  170. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +187 -187
  171. package/styles/rich-text-editor/_bootstrap-definition.scss +244 -244
  172. package/styles/rich-text-editor/_bootstrap4-definition.scss +370 -370
  173. package/styles/rich-text-editor/_bootstrap5-definition.scss +168 -168
  174. package/styles/rich-text-editor/_fabric-dark-definition.scss +168 -168
  175. package/styles/rich-text-editor/_fabric-definition.scss +167 -167
  176. package/styles/rich-text-editor/_fluent-definition.scss +168 -0
  177. package/styles/rich-text-editor/_highcontrast-definition.scss +167 -167
  178. package/styles/rich-text-editor/_highcontrast-light-definition.scss +167 -167
  179. package/styles/rich-text-editor/_layout.scss +1639 -1639
  180. package/styles/rich-text-editor/_material-dark-definition.scss +172 -172
  181. package/styles/rich-text-editor/_material-definition.scss +169 -169
  182. package/styles/rich-text-editor/_tailwind-definition.scss +167 -167
  183. package/styles/rich-text-editor/_theme.scss +626 -626
  184. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +304 -304
  185. package/styles/rich-text-editor/icons/_bootstrap.scss +304 -304
  186. package/styles/rich-text-editor/icons/_bootstrap4.scss +304 -304
  187. package/styles/rich-text-editor/icons/_bootstrap5.scss +303 -303
  188. package/styles/rich-text-editor/icons/_fabric-dark.scss +304 -304
  189. package/styles/rich-text-editor/icons/_fabric.scss +304 -304
  190. package/styles/rich-text-editor/icons/_fluent.scss +303 -0
  191. package/styles/rich-text-editor/icons/_highcontrast-light.scss +304 -304
  192. package/styles/rich-text-editor/icons/_highcontrast.scss +304 -304
  193. package/styles/rich-text-editor/icons/_material-dark.scss +304 -304
  194. package/styles/rich-text-editor/icons/_material.scss +304 -304
  195. package/styles/rich-text-editor/icons/_tailwind.scss +304 -304
  196. package/tslint.json +111 -0
@@ -29,9 +29,20 @@ var EnterKeyAction = /** @class */ (function () {
29
29
  EnterKeyAction.prototype.enterHandler = function (e) {
30
30
  var _this = this;
31
31
  this.getRangeNode();
32
+ var isTableEnter = true;
33
+ if (!isNOU(this.startNode.closest('TABLE')) && !isNOU(this.endNode.closest('TABLE'))) {
34
+ isTableEnter = false;
35
+ var curElement = this.startNode;
36
+ var blockElement = curElement;
37
+ while (!this.parent.formatter.editorManager.domNode.isBlockNode(curElement)) {
38
+ blockElement = curElement;
39
+ curElement = curElement.parentElement;
40
+ }
41
+ isTableEnter = blockElement.tagName === 'TD' ? false : true;
42
+ }
32
43
  if (e.args.which === 13 && e.args.code === 'Enter') {
33
- if (isNOU(this.startNode.closest('LI')) && isNOU(this.endNode.closest('LI')) && isNOU(this.startNode.closest('TABLE')) &&
34
- isNOU(this.endNode.closest('TABLE')) && isNOU(this.startNode.closest('PRE')) && isNOU(this.endNode.closest('PRE'))) {
44
+ if (isNOU(this.startNode.closest('LI')) && isNOU(this.endNode.closest('LI')) && isTableEnter &&
45
+ isNOU(this.startNode.closest('PRE')) && isNOU(this.endNode.closest('PRE'))) {
35
46
  var shiftKey_1 = e.args.shiftKey;
36
47
  var actionBeginArgs = {
37
48
  cancel: false,
@@ -89,12 +100,32 @@ var EnterKeyAction = /** @class */ (function () {
89
100
  _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.range.startContainer.childNodes[_this.range.startOffset], 0);
90
101
  _this.getRangeNode();
91
102
  }
92
- if (_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV' ||
103
+ if ((_this.parent.enterKey === 'P' && !shiftKey_1) || (_this.parent.enterKey === 'DIV' && !shiftKey_1) ||
93
104
  (_this.parent.shiftEnterKey === 'P' && shiftKey_1) ||
94
105
  (_this.parent.shiftEnterKey === 'DIV' && shiftKey_1)) {
95
- var nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
106
+ var nearBlockNode = void 0;
107
+ if (isTableEnter && _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
108
+ nearBlockNode = _this.startNode;
109
+ }
110
+ else {
111
+ nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
112
+ }
96
113
  var isImageNode = false;
97
- if (_this.range.startOffset === 0 && _this.range.endOffset === 0 && !(!isNOU(_this.range.startContainer.previousSibling) && _this.range.startContainer.previousSibling.nodeName === 'IMG')) {
114
+ var isFocusedFirst = false;
115
+ if (_this.range.startOffset != 0 && _this.range.endOffset != 0 && _this.range.startContainer === _this.range.endContainer &&
116
+ !(!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG')) {
117
+ var startNodeText = _this.range.startContainer.textContent;
118
+ var splitFirstText = startNodeText.substring(0, _this.range.startOffset);
119
+ if (splitFirstText.charCodeAt(_this.range.startOffset - 1) != 160 && splitFirstText.trim().length === 0) {
120
+ isFocusedFirst = true;
121
+ }
122
+ }
123
+ else if (_this.range.startOffset === 0 && _this.range.endOffset === 0) {
124
+ isFocusedFirst = true;
125
+ }
126
+ if (((_this.range.startOffset === 0 && _this.range.endOffset === 0) || isFocusedFirst) &&
127
+ !(!isNOU(_this.range.startContainer.previousSibling) &&
128
+ (_this.range.startContainer.previousSibling.nodeName === 'IMG' || _this.range.startContainer.previousSibling.nodeName === 'BR'))) {
98
129
  var isNearBlockLengthZero = void 0;
99
130
  var newElem = void 0;
100
131
  if (_this.range.startContainer.nodeName === 'IMG') {
@@ -103,7 +134,7 @@ var EnterKeyAction = /** @class */ (function () {
103
134
  isNearBlockLengthZero = false;
104
135
  }
105
136
  else {
106
- if (nearBlockNode.textContent.length !== 0) {
137
+ if (nearBlockNode.textContent.trim().length !== 0) {
107
138
  newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
108
139
  isNearBlockLengthZero = false;
109
140
  }
@@ -152,7 +183,18 @@ var EnterKeyAction = /** @class */ (function () {
152
183
  }
153
184
  if (newElem.textContent.trim().length === 0) {
154
185
  var brElm = _this.parent.createElement('br');
155
- _this.startNode.appendChild(brElm);
186
+ if (_this.startNode.nodeName === 'A') {
187
+ var startParentElem = _this.startNode.parentElement;
188
+ _this.startNode.parentElement.insertBefore(brElm, _this.startNode);
189
+ detach(_this.startNode);
190
+ _this.startNode = startParentElem;
191
+ }
192
+ else {
193
+ _this.startNode.appendChild(brElm);
194
+ }
195
+ if (newElem.childNodes[0].textContent === '\n') {
196
+ detach(newElem.childNodes[0]);
197
+ }
156
198
  _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.startNode, 0);
157
199
  }
158
200
  if (((_this.parent.enterKey === 'P' || _this.parent.enterKey === 'DIV') && !shiftKey_1) || ((_this.parent.shiftEnterKey === 'DIV' ||
@@ -163,12 +205,13 @@ var EnterKeyAction = /** @class */ (function () {
163
205
  }
164
206
  _this.parent.formatter.editorManager.domNode.insertAfter(insertElm, newElem);
165
207
  detach(newElem);
166
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode) ? insertElm : _this.startNode, 0);
208
+ _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode) ?
209
+ insertElm : _this.startNode, 0);
167
210
  }
168
211
  }
169
212
  e.args.preventDefault();
170
213
  }
171
- if (_this.parent.enterKey === 'BR' && !shiftKey_1) {
214
+ if ((_this.parent.enterKey === 'BR' && !shiftKey_1) || (_this.parent.shiftEnterKey === 'BR' && shiftKey_1)) {
172
215
  var currentParent = void 0;
173
216
  if (!_this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
174
217
  var currentNode = _this.startNode;
@@ -184,10 +227,16 @@ var EnterKeyAction = /** @class */ (function () {
184
227
  currentParent = _this.startNode;
185
228
  }
186
229
  var isEmptyBrInserted = false;
230
+ var currentParentLastChild = currentParent.lastChild;
231
+ while (!isNOU(currentParentLastChild) && !(currentParentLastChild.nodeName === '#text')) {
232
+ currentParentLastChild = currentParentLastChild.lastChild;
233
+ }
234
+ var isLastNodeLength = _this.range.startContainer === currentParentLastChild ?
235
+ _this.range.startContainer.textContent.length : currentParent.textContent.length;
187
236
  if (currentParent !== _this.parent.inputElement &&
188
237
  _this.parent.formatter.editorManager.domNode.isBlockNode(currentParent) &&
189
238
  _this.range.startOffset === _this.range.endOffset &&
190
- _this.range.startOffset === currentParent.textContent.length) {
239
+ _this.range.startOffset === isLastNodeLength) {
191
240
  var outerBRElem = _this.parent.createElement('br');
192
241
  _this.parent.formatter.editorManager.domNode.insertAfter(outerBRElem, currentParent);
193
242
  _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), outerBRElem, 0);
@@ -217,34 +266,12 @@ var EnterKeyAction = /** @class */ (function () {
217
266
  isEmptyBrInserted = true;
218
267
  }
219
268
  else {
220
- newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, currentParent, true);
221
- newElem.parentElement.insertBefore(outerBRElem, newElem);
222
- _this.insertFocusContent();
269
+ _this.insertBRElement();
223
270
  }
224
271
  }
225
272
  }
226
273
  else {
227
- var brElm = _this.parent.createElement('br');
228
- if (_this.startNode.nodeName === 'BR' && _this.endNode.nodeName === 'BR' && _this.range.startOffset === 0 && _this.range.startOffset === _this.range.endOffset) {
229
- _this.parent.formatter.editorManager.domNode.insertAfter(brElm, _this.startNode);
230
- isEmptyBrInserted = true;
231
- }
232
- else {
233
- if (_this.startNode === _this.parent.inputElement && !isNOU(_this.range.startContainer.previousSibling) &&
234
- _this.range.startContainer.previousSibling.nodeName === 'BR' && _this.range.startContainer.textContent.length === 0) {
235
- isEmptyBrInserted = true;
236
- }
237
- _this.range.insertNode(brElm);
238
- }
239
- if (isEmptyBrInserted || (!isNOU(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNOU(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
240
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), !isNOU(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
241
- isEmptyBrInserted = false;
242
- }
243
- else {
244
- var brElm2 = _this.parent.createElement('br');
245
- _this.range.insertNode(brElm2);
246
- _this.parent.formatter.editorManager.nodeSelection.setCursorPoint(_this.parent.contentModule.getDocument(), brElm, 0);
247
- }
274
+ _this.insertBRElement();
248
275
  }
249
276
  e.args.preventDefault();
250
277
  }
@@ -254,6 +281,30 @@ var EnterKeyAction = /** @class */ (function () {
254
281
  }
255
282
  }
256
283
  };
284
+ EnterKeyAction.prototype.insertBRElement = function () {
285
+ var isEmptyBrInserted = false;
286
+ var brElm = this.parent.createElement('br');
287
+ if (this.startNode.nodeName === 'BR' && this.endNode.nodeName === 'BR' && this.range.startOffset === 0 && this.range.startOffset === this.range.endOffset) {
288
+ this.parent.formatter.editorManager.domNode.insertAfter(brElm, this.startNode);
289
+ isEmptyBrInserted = true;
290
+ }
291
+ else {
292
+ if (this.startNode === this.parent.inputElement && !isNOU(this.range.startContainer.previousSibling) &&
293
+ this.range.startContainer.previousSibling.nodeName === 'BR' && this.range.startContainer.textContent.length === 0) {
294
+ isEmptyBrInserted = true;
295
+ }
296
+ this.range.insertNode(brElm);
297
+ }
298
+ if (isEmptyBrInserted || (!isNOU(brElm.nextElementSibling) && brElm.nextElementSibling.tagName === 'BR') || (!isNOU(brElm.nextSibling) && brElm.nextSibling.textContent.length > 0)) {
299
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), !isNOU(brElm.nextSibling) ? brElm.nextSibling : brElm, 0);
300
+ isEmptyBrInserted = false;
301
+ }
302
+ else {
303
+ var brElm2 = this.parent.createElement('br');
304
+ this.range.insertNode(brElm2);
305
+ this.parent.formatter.editorManager.nodeSelection.setCursorPoint(this.parent.contentModule.getDocument(), brElm, 0);
306
+ }
307
+ };
257
308
  EnterKeyAction.prototype.insertFocusContent = function () {
258
309
  if (this.range.startContainer.textContent.length === 0) {
259
310
  if (this.range.startContainer.nodeName === '#text') {
@@ -13,7 +13,7 @@ export declare class FullScreen {
13
13
  * @param {MouseEvent} event - specifies the mouse event
14
14
  * @returns {void}
15
15
  * @hidden
16
- * @deprecated
16
+
17
17
  */
18
18
  showFullScreen(event?: MouseEvent | KeyboardEventArgs): void;
19
19
  /**
@@ -22,7 +22,7 @@ export declare class FullScreen {
22
22
  * @param {MouseEvent} event - specifies the mouse event
23
23
  * @returns {void}
24
24
  * @hidden
25
- * @deprecated
25
+
26
26
  */
27
27
  hideFullScreen(event?: MouseEvent | KeyboardEventArgs): void;
28
28
  private toggleParentOverflow;
@@ -34,7 +34,7 @@ export declare class FullScreen {
34
34
  *
35
35
  * @returns {void}
36
36
  * @hidden
37
- * @deprecated
37
+
38
38
  */
39
39
  destroy(): void;
40
40
  }
@@ -17,7 +17,7 @@ var FullScreen = /** @class */ (function () {
17
17
  * @param {MouseEvent} event - specifies the mouse event
18
18
  * @returns {void}
19
19
  * @hidden
20
- * @deprecated
20
+
21
21
  */
22
22
  FullScreen.prototype.showFullScreen = function (event) {
23
23
  var _this = this;
@@ -67,7 +67,7 @@ var FullScreen = /** @class */ (function () {
67
67
  * @param {MouseEvent} event - specifies the mouse event
68
68
  * @returns {void}
69
69
  * @hidden
70
- * @deprecated
70
+
71
71
  */
72
72
  FullScreen.prototype.hideFullScreen = function (event) {
73
73
  var _this = this;
@@ -150,7 +150,7 @@ var FullScreen = /** @class */ (function () {
150
150
  *
151
151
  * @returns {void}
152
152
  * @hidden
153
- * @deprecated
153
+
154
154
  */
155
155
  FullScreen.prototype.destroy = function () {
156
156
  if (this.parent.element.classList.contains(classes.CLS_FULL_SCREEN)) {
@@ -27,14 +27,14 @@ export declare class HtmlEditor {
27
27
  * @function destroy
28
28
  * @returns {void}
29
29
  * @hidden
30
- * @deprecated
30
+
31
31
  */
32
32
  destroy(): void;
33
33
  /**
34
34
  * @param {string} value - specifies the string value
35
35
  * @returns {void}
36
36
  * @hidden
37
- * @deprecated
37
+
38
38
  */
39
39
  sanitizeHelper(value: string): string;
40
40
  private addEventListener;
@@ -64,7 +64,7 @@ export declare class HtmlEditor {
64
64
  * @param {RichTextEditorModel} e - specifies the editor model
65
65
  * @returns {void}
66
66
  * @hidden
67
- * @deprecated
67
+
68
68
  */
69
69
  protected onPropertyChanged(e: {
70
70
  [key: string]: RichTextEditorModel;
@@ -32,7 +32,7 @@ var HtmlEditor = /** @class */ (function () {
32
32
  * @function destroy
33
33
  * @returns {void}
34
34
  * @hidden
35
- * @deprecated
35
+
36
36
  */
37
37
  HtmlEditor.prototype.destroy = function () {
38
38
  this.removeEventListener();
@@ -41,7 +41,7 @@ var HtmlEditor = /** @class */ (function () {
41
41
  * @param {string} value - specifies the string value
42
42
  * @returns {void}
43
43
  * @hidden
44
- * @deprecated
44
+
45
45
  */
46
46
  HtmlEditor.prototype.sanitizeHelper = function (value) {
47
47
  value = sanitizeHelper(value, this.parent);
@@ -149,7 +149,7 @@ var HtmlEditor = /** @class */ (function () {
149
149
  e.args.action === 'enter' ||
150
150
  e.args.keyCode === 13) {
151
151
  this.spaceLink(e.args);
152
- if (this.parent.editorMode === 'HTML' && !((this.parent.shiftEnterKey === 'BR' && e.args.shiftKey))) {
152
+ if (this.parent.editorMode === 'HTML' && !this.parent.readonly) {
153
153
  this.parent.notify(events.enterHandler, { args: e.args });
154
154
  }
155
155
  }
@@ -426,7 +426,7 @@ var HtmlEditor = /** @class */ (function () {
426
426
  var divElement = this.parent.createElement('div');
427
427
  divElement.setAttribute('class', 'pasteContent');
428
428
  divElement.style.display = 'inline';
429
- divElement.innerHTML = contentInnerElem;
429
+ divElement.innerHTML = contentInnerElem.replace('&para', '&para');
430
430
  var paraElem = divElement.querySelectorAll('span, p');
431
431
  for (var i = 0; i < paraElem.length; i++) {
432
432
  var splitTextContent = paraElem[i].innerHTML.split(' ');
@@ -641,7 +641,7 @@ var HtmlEditor = /** @class */ (function () {
641
641
  * @param {RichTextEditorModel} e - specifies the editor model
642
642
  * @returns {void}
643
643
  * @hidden
644
- * @deprecated
644
+
645
645
  */
646
646
  HtmlEditor.prototype.onPropertyChanged = function (e) {
647
647
  // On property code change here
@@ -1,4 +1,4 @@
1
- import { Property, NotifyPropertyChanges, INotifyPropertyChanged, Event } from '@syncfusion/ej2-base';
1
+ import { Property, NotifyPropertyChanges, INotifyPropertyChanged, Event } from '@syncfusion/ej2-base';import { Base, EmitType } from '@syncfusion/ej2-base';import { KeyboardEventsModel } from '@syncfusion/ej2-base';
2
2
  import {KeyboardEventArgs} from "./keyboard";
3
3
 
4
4
  /**
@@ -7,24 +7,24 @@ import {KeyboardEventArgs} from "./keyboard";
7
7
  export interface KeyboardEventsModel {
8
8
 
9
9
  /**
10
- * Specifies key combination and it respective action name.
11
- *
12
- * @default null
13
- */
14
- keyConfigs?: { [key: string]: string };
10
+ * Specifies key combination and it respective action name.
11
+ *
12
+ * @default null
13
+ */
14
+ keyConfigs?: { [key: string]: string };
15
15
 
16
16
  /**
17
- * Specifies on which event keyboardEvents class should listen for key press. For ex., `keyup`, `keydown` or `keypress`
18
- *
19
- * @default 'keyup'
20
- */
21
- eventName?: string;
17
+ * Specifies on which event keyboardEvents class should listen for key press. For ex., `keyup`, `keydown` or `keypress`
18
+ *
19
+ * @default 'keyup'
20
+ */
21
+ eventName?: string;
22
22
 
23
23
  /**
24
- * Specifies the listener when keyboard actions is performed.
25
- *
26
- * @event 'keyAction'
27
- */
28
- keyAction?: EmitType<KeyboardEventArgs>;
24
+ * Specifies the listener when keyboard actions is performed.
25
+ *
26
+ * @event 'keyAction'
27
+ */
28
+ keyAction?: EmitType<KeyboardEventArgs>;
29
29
 
30
30
  }
@@ -27,7 +27,7 @@ export interface KeyboardEventArgs extends KeyboardEvent {
27
27
  * ```
28
28
  *
29
29
  * @hidden
30
- * @deprecated
30
+
31
31
  */
32
32
  export declare class KeyboardEvents extends Base<HTMLElement> implements INotifyPropertyChanged {
33
33
  /**
@@ -1,22 +1,22 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- 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;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- };
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
+ 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;
18
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
19
+ };
20
20
  import { Property, NotifyPropertyChanges, Event } from '@syncfusion/ej2-base';
21
21
  import { Base } from '@syncfusion/ej2-base';
22
22
  var keyCode = {
@@ -84,7 +84,7 @@ var keyCode = {
84
84
  * ```
85
85
  *
86
86
  * @hidden
87
- * @deprecated
87
+
88
88
  */
89
89
  var KeyboardEvents = /** @class */ (function (_super) {
90
90
  __extends(KeyboardEvents, _super);
@@ -19,7 +19,7 @@ export declare class MarkdownEditor {
19
19
  * @function destroy
20
20
  * @returns {void}
21
21
  * @hidden
22
- * @deprecated
22
+
23
23
  */
24
24
  destroy(): void;
25
25
  private addEventListener;
@@ -36,7 +36,7 @@ export declare class MarkdownEditor {
36
36
  * @param {RichTextEditorModel} e - specifies the editor model
37
37
  * @returns {void}
38
38
  * @hidden
39
- * @deprecated
39
+
40
40
  */
41
41
  protected onPropertyChanged(e: {
42
42
  [key: string]: RichTextEditorModel;
@@ -22,7 +22,7 @@ var MarkdownEditor = /** @class */ (function () {
22
22
  * @function destroy
23
23
  * @returns {void}
24
24
  * @hidden
25
- * @deprecated
25
+
26
26
  */
27
27
  MarkdownEditor.prototype.destroy = function () {
28
28
  this.removeEventListener();
@@ -138,7 +138,7 @@ var MarkdownEditor = /** @class */ (function () {
138
138
  * @param {RichTextEditorModel} e - specifies the editor model
139
139
  * @returns {void}
140
140
  * @hidden
141
- * @deprecated
141
+
142
142
  */
143
143
  MarkdownEditor.prototype.onPropertyChanged = function (e) {
144
144
  // On property code change here
@@ -39,7 +39,7 @@ export declare class PasteCleanup {
39
39
  * @param {Element []} imgElement - specifies the array elements.
40
40
  * @returns {void}
41
41
  * @hidden
42
- * @deprecated
42
+
43
43
  */
44
44
  private imageFormatting;
45
45
  private radioRender;
@@ -414,7 +414,7 @@ var PasteCleanup = /** @class */ (function () {
414
414
  * @param {Element []} imgElement - specifies the array elements.
415
415
  * @returns {void}
416
416
  * @hidden
417
- * @deprecated
417
+
418
418
  */
419
419
  PasteCleanup.prototype.imageFormatting = function (pasteArgs, imgElement) {
420
420
  var imageElement = this.parent.createElement('span');
@@ -33,7 +33,7 @@ export declare class QuickToolbar {
33
33
  * @param {RenderType} type - specifies the render type.
34
34
  * @returns {BaseQuickToolbar} - specifies the quick toolbar
35
35
  * @hidden
36
- * @deprecated
36
+
37
37
  */
38
38
  createQTBar(popupType: string, mode: string, items: (string | IToolbarItems)[], type: RenderType): BaseQuickToolbar;
39
39
  private initializeQuickToolbars;
@@ -49,7 +49,7 @@ export declare class QuickToolbar {
49
49
  * @param {HTMLElement} target - specifies the target element.
50
50
  * @returns {void}
51
51
  * @hidden
52
- * @deprecated
52
+
53
53
  */
54
54
  showInlineQTBar(x: number, y: number, target: HTMLElement): void;
55
55
  /**
@@ -57,7 +57,7 @@ export declare class QuickToolbar {
57
57
  *
58
58
  * @returns {void}
59
59
  * @hidden
60
- * @deprecated
60
+
61
61
  */
62
62
  hideInlineQTBar(): void;
63
63
  /**
@@ -65,7 +65,7 @@ export declare class QuickToolbar {
65
65
  *
66
66
  * @returns {void}
67
67
  * @hidden
68
- * @deprecated
68
+
69
69
  */
70
70
  hideQuickToolbars(): void;
71
71
  private deBounce;
@@ -80,7 +80,7 @@ export declare class QuickToolbar {
80
80
  *
81
81
  * @returns {void}
82
82
  * @hidden
83
- * @deprecated
83
+
84
84
  */
85
85
  getInlineBaseToolbar(): BaseToolbar;
86
86
  /**
@@ -89,7 +89,7 @@ export declare class QuickToolbar {
89
89
  * @function destroy
90
90
  * @returns {void}
91
91
  * @hidden
92
- * @deprecated
92
+
93
93
  */
94
94
  destroy(): void;
95
95
  private wireInlineQTBarEvents;
@@ -100,7 +100,7 @@ export declare class QuickToolbar {
100
100
  *
101
101
  * @returns {void}
102
102
  * @hidden
103
- * @deprecated
103
+
104
104
  */
105
105
  addEventListener(): void;
106
106
  private onKeyDown;
@@ -111,7 +111,7 @@ export declare class QuickToolbar {
111
111
  *
112
112
  * @returns {void}
113
113
  * @hidden
114
- * @deprecated
114
+
115
115
  */
116
116
  removeEventListener(): void;
117
117
  /**
@@ -120,7 +120,7 @@ export declare class QuickToolbar {
120
120
  * @param {RichTextEditorModel} e - specifies the element.
121
121
  * @returns {void}
122
122
  * @hidden
123
- * @deprecated
123
+
124
124
  */
125
125
  protected onPropertyChanged(e: {
126
126
  [key: string]: RichTextEditorModel;
@@ -58,7 +58,7 @@ var QuickToolbar = /** @class */ (function () {
58
58
  * @param {RenderType} type - specifies the render type.
59
59
  * @returns {BaseQuickToolbar} - specifies the quick toolbar
60
60
  * @hidden
61
- * @deprecated
61
+
62
62
  */
63
63
  QuickToolbar.prototype.createQTBar = function (popupType, mode, items, type) {
64
64
  if (items.length < 1) {
@@ -131,10 +131,10 @@ var QuickToolbar = /** @class */ (function () {
131
131
  * @param {HTMLElement} target - specifies the target element.
132
132
  * @returns {void}
133
133
  * @hidden
134
- * @deprecated
134
+
135
135
  */
136
136
  QuickToolbar.prototype.showInlineQTBar = function (x, y, target) {
137
- if (this.parent.readonly) {
137
+ if (this.parent.readonly || target.tagName.toLowerCase() === "img") {
138
138
  return;
139
139
  }
140
140
  this.inlineQTBar.showPopup(x, y, target);
@@ -144,7 +144,7 @@ var QuickToolbar = /** @class */ (function () {
144
144
  *
145
145
  * @returns {void}
146
146
  * @hidden
147
- * @deprecated
147
+
148
148
  */
149
149
  QuickToolbar.prototype.hideInlineQTBar = function () {
150
150
  if (this.inlineQTBar && !hasClass(this.inlineQTBar.element, 'e-popup-close')) {
@@ -156,7 +156,7 @@ var QuickToolbar = /** @class */ (function () {
156
156
  *
157
157
  * @returns {void}
158
158
  * @hidden
159
- * @deprecated
159
+
160
160
  */
161
161
  QuickToolbar.prototype.hideQuickToolbars = function () {
162
162
  if (this.linkQTBar && !hasClass(this.linkQTBar.element, 'e-popup-close') && document.body.contains(this.linkQTBar.element)) {
@@ -259,7 +259,7 @@ var QuickToolbar = /** @class */ (function () {
259
259
  *
260
260
  * @returns {void}
261
261
  * @hidden
262
- * @deprecated
262
+
263
263
  */
264
264
  QuickToolbar.prototype.getInlineBaseToolbar = function () {
265
265
  return this.inlineQTBar && this.inlineQTBar.quickTBarObj;
@@ -270,7 +270,7 @@ var QuickToolbar = /** @class */ (function () {
270
270
  * @function destroy
271
271
  * @returns {void}
272
272
  * @hidden
273
- * @deprecated
273
+
274
274
  */
275
275
  QuickToolbar.prototype.destroy = function () {
276
276
  if (this.linkQTBar) {
@@ -336,7 +336,7 @@ var QuickToolbar = /** @class */ (function () {
336
336
  *
337
337
  * @returns {void}
338
338
  * @hidden
339
- * @deprecated
339
+
340
340
  */
341
341
  QuickToolbar.prototype.addEventListener = function () {
342
342
  if (this.parent.isDestroyed) {
@@ -386,7 +386,7 @@ var QuickToolbar = /** @class */ (function () {
386
386
  *
387
387
  * @returns {void}
388
388
  * @hidden
389
- * @deprecated
389
+
390
390
  */
391
391
  QuickToolbar.prototype.removeEventListener = function () {
392
392
  if (this.parent.isDestroyed) {
@@ -414,7 +414,7 @@ var QuickToolbar = /** @class */ (function () {
414
414
  * @param {RichTextEditorModel} e - specifies the element.
415
415
  * @returns {void}
416
416
  * @hidden
417
- * @deprecated
417
+
418
418
  */
419
419
  QuickToolbar.prototype.onPropertyChanged = function (e) {
420
420
  if (!isNullOrUndefined(e.newProp.quickToolbarSettings)) {