@syncfusion/ej2-richtexteditor 23.2.7 → 24.1.41-569781

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 (271) hide show
  1. package/.eslintrc.json +259 -259
  2. package/CHANGELOG.md +1927 -1749
  3. package/README.md +76 -76
  4. package/dist/ej2-richtexteditor.umd.min.js +1 -10
  5. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es2015.js +3069 -1283
  7. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  8. package/dist/es6/ej2-richtexteditor.es5.js +3173 -1386
  9. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  10. package/helpers/e2e/index.js +3 -3
  11. package/helpers/e2e/rte-helper.js +13 -13
  12. package/license +9 -9
  13. package/package.json +74 -74
  14. package/src/common/config.d.ts +7 -0
  15. package/src/common/config.js +12 -1
  16. package/src/common/constant.d.ts +6 -0
  17. package/src/common/constant.js +6 -0
  18. package/src/common/interface.d.ts +19 -7
  19. package/src/common/types.d.ts +6 -0
  20. package/src/common/util.d.ts +6 -0
  21. package/src/common/util.js +61 -20
  22. package/src/editor-manager/base/classes.d.ts +1 -1
  23. package/src/editor-manager/base/classes.js +1 -1
  24. package/src/editor-manager/base/constant.d.ts +6 -0
  25. package/src/editor-manager/base/constant.js +6 -0
  26. package/src/editor-manager/base/editor-manager.d.ts +8 -3
  27. package/src/editor-manager/base/editor-manager.js +62 -3
  28. package/src/editor-manager/base/enum.d.ts +2 -2
  29. package/src/editor-manager/base/interface.d.ts +17 -9
  30. package/src/editor-manager/base/types.d.ts +1 -1
  31. package/src/editor-manager/plugin/alignments.d.ts +2 -2
  32. package/src/editor-manager/plugin/alignments.js +2 -2
  33. package/src/editor-manager/plugin/audio.d.ts +3 -3
  34. package/src/editor-manager/plugin/audio.js +16 -6
  35. package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
  36. package/src/editor-manager/plugin/clearformat-exec.js +2 -2
  37. package/src/editor-manager/plugin/clearformat.d.ts +1 -1
  38. package/src/editor-manager/plugin/clearformat.js +1 -1
  39. package/src/editor-manager/plugin/dom-node.d.ts +39 -35
  40. package/src/editor-manager/plugin/dom-node.js +203 -62
  41. package/src/editor-manager/plugin/format-painter-actions.d.ts +2 -1
  42. package/src/editor-manager/plugin/format-painter-actions.js +20 -2
  43. package/src/editor-manager/plugin/formats.d.ts +3 -2
  44. package/src/editor-manager/plugin/formats.js +40 -5
  45. package/src/editor-manager/plugin/image.d.ts +3 -3
  46. package/src/editor-manager/plugin/image.js +41 -18
  47. package/src/editor-manager/plugin/indents.d.ts +2 -2
  48. package/src/editor-manager/plugin/indents.js +2 -2
  49. package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
  50. package/src/editor-manager/plugin/insert-methods.js +4 -4
  51. package/src/editor-manager/plugin/insert-text.d.ts +2 -2
  52. package/src/editor-manager/plugin/insert-text.js +2 -2
  53. package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
  54. package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
  55. package/src/editor-manager/plugin/inserthtml.d.ts +3 -2
  56. package/src/editor-manager/plugin/inserthtml.js +69 -9
  57. package/src/editor-manager/plugin/isformatted.d.ts +8 -8
  58. package/src/editor-manager/plugin/isformatted.js +8 -8
  59. package/src/editor-manager/plugin/link.d.ts +2 -2
  60. package/src/editor-manager/plugin/link.js +6 -3
  61. package/src/editor-manager/plugin/lists.d.ts +2 -2
  62. package/src/editor-manager/plugin/lists.js +123 -67
  63. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +4 -1
  64. package/src/editor-manager/plugin/ms-word-clean-up.js +216 -86
  65. package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
  66. package/src/editor-manager/plugin/nodecutter.js +8 -8
  67. package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
  68. package/src/editor-manager/plugin/selection-commands.js +166 -4
  69. package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
  70. package/src/editor-manager/plugin/selection-exec.js +2 -2
  71. package/src/editor-manager/plugin/table.d.ts +2 -3
  72. package/src/editor-manager/plugin/table.js +35 -32
  73. package/src/editor-manager/plugin/toolbar-status.d.ts +4 -4
  74. package/src/editor-manager/plugin/toolbar-status.js +22 -12
  75. package/src/editor-manager/plugin/undo.d.ts +7 -6
  76. package/src/editor-manager/plugin/undo.js +27 -7
  77. package/src/editor-manager/plugin/video.d.ts +3 -3
  78. package/src/editor-manager/plugin/video.js +3 -3
  79. package/src/markdown-parser/base/interface.d.ts +10 -10
  80. package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
  81. package/src/markdown-parser/base/markdown-parser.js +3 -3
  82. package/src/markdown-parser/base/types.d.ts +1 -1
  83. package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
  84. package/src/markdown-parser/plugin/clearformat.js +2 -2
  85. package/src/markdown-parser/plugin/formats.d.ts +2 -2
  86. package/src/markdown-parser/plugin/formats.js +2 -2
  87. package/src/markdown-parser/plugin/insert-text.d.ts +2 -2
  88. package/src/markdown-parser/plugin/insert-text.js +2 -2
  89. package/src/markdown-parser/plugin/link.d.ts +2 -2
  90. package/src/markdown-parser/plugin/link.js +2 -2
  91. package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
  92. package/src/markdown-parser/plugin/markdown-selection.js +14 -14
  93. package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
  94. package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
  95. package/src/markdown-parser/plugin/table.d.ts +3 -3
  96. package/src/markdown-parser/plugin/table.js +3 -3
  97. package/src/markdown-parser/plugin/undo.d.ts +6 -6
  98. package/src/markdown-parser/plugin/undo.js +6 -6
  99. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +12 -12
  100. package/src/rich-text-editor/actions/base-quick-toolbar.js +75 -24
  101. package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
  102. package/src/rich-text-editor/actions/base-toolbar.js +35 -37
  103. package/src/rich-text-editor/actions/color-picker.d.ts +3 -2
  104. package/src/rich-text-editor/actions/color-picker.js +15 -5
  105. package/src/rich-text-editor/actions/count.d.ts +3 -3
  106. package/src/rich-text-editor/actions/count.js +4 -4
  107. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
  108. package/src/rich-text-editor/actions/dropdown-buttons.js +27 -6
  109. package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
  110. package/src/rich-text-editor/actions/emoji-picker.js +16 -7
  111. package/src/rich-text-editor/actions/enter-key.js +6 -4
  112. package/src/rich-text-editor/actions/file-manager.js +1 -1
  113. package/src/rich-text-editor/actions/format-painter.js +1 -1
  114. package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
  115. package/src/rich-text-editor/actions/full-screen.js +8 -7
  116. package/src/rich-text-editor/actions/html-editor.d.ts +5 -3
  117. package/src/rich-text-editor/actions/html-editor.js +137 -22
  118. package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
  119. package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
  120. package/src/rich-text-editor/actions/keyboard.js +23 -21
  121. package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
  122. package/src/rich-text-editor/actions/markdown-editor.js +5 -3
  123. package/src/rich-text-editor/actions/paste-clean-up.d.ts +6 -1
  124. package/src/rich-text-editor/actions/paste-clean-up.js +157 -29
  125. package/src/rich-text-editor/actions/quick-toolbar.d.ts +16 -9
  126. package/src/rich-text-editor/actions/quick-toolbar.js +54 -20
  127. package/src/rich-text-editor/actions/resize.js +2 -1
  128. package/src/rich-text-editor/actions/toolbar-action.js +1 -1
  129. package/src/rich-text-editor/actions/toolbar.d.ts +16 -16
  130. package/src/rich-text-editor/actions/toolbar.js +48 -109
  131. package/src/rich-text-editor/actions/xhtml-validation.d.ts +1 -1
  132. package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
  133. package/src/rich-text-editor/base/classes.d.ts +125 -125
  134. package/src/rich-text-editor/base/classes.js +125 -125
  135. package/src/rich-text-editor/base/constant.d.ts +195 -150
  136. package/src/rich-text-editor/base/constant.js +364 -150
  137. package/src/rich-text-editor/base/enum.d.ts +1 -1
  138. package/src/rich-text-editor/base/enum.js +1 -1
  139. package/src/rich-text-editor/base/interface.d.ts +96 -52
  140. package/src/rich-text-editor/base/interface.js +1 -1
  141. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +891 -891
  142. package/src/rich-text-editor/base/rich-text-editor.d.ts +76 -64
  143. package/src/rich-text-editor/base/rich-text-editor.js +259 -163
  144. package/src/rich-text-editor/base/util.d.ts +5 -1
  145. package/src/rich-text-editor/base/util.js +58 -6
  146. package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
  147. package/src/rich-text-editor/formatter/formatter.js +23 -12
  148. package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
  149. package/src/rich-text-editor/formatter/html-formatter.js +15 -15
  150. package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
  151. package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
  152. package/src/rich-text-editor/models/default-locale.js +31 -25
  153. package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
  154. package/src/rich-text-editor/models/iframe-settings.js +19 -19
  155. package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
  156. package/src/rich-text-editor/models/inline-mode.js +19 -19
  157. package/src/rich-text-editor/models/items.js +3 -3
  158. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
  159. package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
  160. package/src/rich-text-editor/models/toolbar-settings.js +20 -20
  161. package/src/rich-text-editor/renderer/audio-module.d.ts +2 -1
  162. package/src/rich-text-editor/renderer/audio-module.js +14 -1
  163. package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
  164. package/src/rich-text-editor/renderer/content-renderer.js +6 -6
  165. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +4 -2
  166. package/src/rich-text-editor/renderer/dialog-renderer.js +24 -4
  167. package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
  168. package/src/rich-text-editor/renderer/iframe-content-renderer.js +19 -18
  169. package/src/rich-text-editor/renderer/image-module.d.ts +10 -2
  170. package/src/rich-text-editor/renderer/image-module.js +261 -220
  171. package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
  172. package/src/rich-text-editor/renderer/link-module.js +54 -25
  173. package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
  174. package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
  175. package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
  176. package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
  177. package/src/rich-text-editor/renderer/render.d.ts +2 -2
  178. package/src/rich-text-editor/renderer/render.js +2 -2
  179. package/src/rich-text-editor/renderer/table-module.d.ts +11 -2
  180. package/src/rich-text-editor/renderer/table-module.js +331 -166
  181. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +13 -15
  182. package/src/rich-text-editor/renderer/toolbar-renderer.js +114 -115
  183. package/src/rich-text-editor/renderer/video-module.d.ts +4 -1
  184. package/src/rich-text-editor/renderer/video-module.js +62 -35
  185. package/src/rich-text-editor/renderer/view-source.d.ts +7 -6
  186. package/src/rich-text-editor/renderer/view-source.js +21 -11
  187. package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
  188. package/src/rich-text-editor/services/renderer-factory.js +3 -3
  189. package/src/rich-text-editor/services/service-locator.d.ts +3 -3
  190. package/src/rich-text-editor/services/service-locator.js +3 -3
  191. package/src/selection/selection.d.ts +22 -22
  192. package/src/selection/selection.js +25 -22
  193. package/styles/_all.scss +1 -1
  194. package/styles/bootstrap-dark.css +345 -99
  195. package/styles/bootstrap.css +353 -108
  196. package/styles/bootstrap4.css +337 -95
  197. package/styles/bootstrap5-dark.css +343 -96
  198. package/styles/bootstrap5.css +343 -96
  199. package/styles/fabric-dark.css +331 -89
  200. package/styles/fabric.css +332 -90
  201. package/styles/fluent-dark.css +342 -92
  202. package/styles/fluent.css +342 -92
  203. package/styles/highcontrast-light.css +331 -89
  204. package/styles/highcontrast.css +335 -90
  205. package/styles/material-dark.css +337 -90
  206. package/styles/material.css +337 -90
  207. package/styles/material3-dark.css +347 -99
  208. package/styles/material3-dark.scss +1 -1
  209. package/styles/material3.css +347 -99
  210. package/styles/material3.scss +1 -1
  211. package/styles/rich-text-editor/_all.scss +2 -2
  212. package/styles/rich-text-editor/_bds-definition.scss +279 -0
  213. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +281 -277
  214. package/styles/rich-text-editor/_bootstrap-definition.scss +337 -334
  215. package/styles/rich-text-editor/_bootstrap4-definition.scss +464 -460
  216. package/styles/rich-text-editor/_bootstrap5-definition.scss +266 -262
  217. package/styles/rich-text-editor/_fabric-dark-definition.scss +263 -259
  218. package/styles/rich-text-editor/_fabric-definition.scss +261 -257
  219. package/styles/rich-text-editor/_fluent-definition.scss +267 -263
  220. package/styles/rich-text-editor/_fusionnew-definition.scss +265 -261
  221. package/styles/rich-text-editor/_highcontrast-definition.scss +261 -257
  222. package/styles/rich-text-editor/_highcontrast-light-definition.scss +261 -257
  223. package/styles/rich-text-editor/_layout.scss +2249 -2072
  224. package/styles/rich-text-editor/_material-dark-definition.scss +266 -262
  225. package/styles/rich-text-editor/_material-definition.scss +264 -260
  226. package/styles/rich-text-editor/_material3-definition.scss +266 -262
  227. package/styles/rich-text-editor/_tailwind-definition.scss +261 -257
  228. package/styles/rich-text-editor/_theme.scss +906 -837
  229. package/styles/rich-text-editor/bootstrap-dark.css +345 -99
  230. package/styles/rich-text-editor/bootstrap.css +353 -108
  231. package/styles/rich-text-editor/bootstrap4.css +337 -95
  232. package/styles/rich-text-editor/bootstrap5-dark.css +343 -96
  233. package/styles/rich-text-editor/bootstrap5.css +343 -96
  234. package/styles/rich-text-editor/fabric-dark.css +331 -89
  235. package/styles/rich-text-editor/fabric.css +332 -90
  236. package/styles/rich-text-editor/fluent-dark.css +342 -92
  237. package/styles/rich-text-editor/fluent.css +342 -92
  238. package/styles/rich-text-editor/highcontrast-light.css +331 -89
  239. package/styles/rich-text-editor/highcontrast.css +335 -90
  240. package/styles/rich-text-editor/icons/_bds.scss +348 -0
  241. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +349 -349
  242. package/styles/rich-text-editor/icons/_bootstrap.scss +349 -349
  243. package/styles/rich-text-editor/icons/_bootstrap4.scss +349 -349
  244. package/styles/rich-text-editor/icons/_bootstrap5.scss +348 -348
  245. package/styles/rich-text-editor/icons/_fabric-dark.scss +349 -349
  246. package/styles/rich-text-editor/icons/_fabric.scss +349 -349
  247. package/styles/rich-text-editor/icons/_fluent.scss +348 -348
  248. package/styles/rich-text-editor/icons/_fusionnew.scss +348 -348
  249. package/styles/rich-text-editor/icons/_highcontrast-light.scss +349 -349
  250. package/styles/rich-text-editor/icons/_highcontrast.scss +349 -349
  251. package/styles/rich-text-editor/icons/_material-dark.scss +349 -349
  252. package/styles/rich-text-editor/icons/_material.scss +349 -349
  253. package/styles/rich-text-editor/icons/_material3.scss +348 -348
  254. package/styles/rich-text-editor/icons/_tailwind.scss +348 -348
  255. package/styles/rich-text-editor/material-dark.css +337 -90
  256. package/styles/rich-text-editor/material.css +337 -90
  257. package/styles/rich-text-editor/material3-dark.css +347 -99
  258. package/styles/rich-text-editor/material3-dark.scss +1 -1
  259. package/styles/rich-text-editor/material3.css +347 -99
  260. package/styles/rich-text-editor/material3.scss +1 -1
  261. package/styles/rich-text-editor/tailwind-dark.css +386 -116
  262. package/styles/rich-text-editor/tailwind.css +386 -116
  263. package/styles/tailwind-dark.css +386 -116
  264. package/styles/tailwind.css +386 -116
  265. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
  266. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
  267. package/dist/ej2-richtexteditor.min.js +0 -10
  268. package/dist/global/ej2-richtexteditor.min.js +0 -11
  269. package/dist/global/ej2-richtexteditor.min.js.map +0 -1
  270. package/dist/global/index.d.ts +0 -14
  271. package/tslint.json +0 -111
@@ -2,7 +2,7 @@ import * as events from '../base/constant';
2
2
  import { Popup } from '@syncfusion/ej2-popups';
3
3
  import { RadioButton } from '@syncfusion/ej2-buttons';
4
4
  import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass, removeClass } from '@syncfusion/ej2-base';
5
- import { getUniqueID, Browser } from '@syncfusion/ej2-base';
5
+ import { getUniqueID, Browser, closest } from '@syncfusion/ej2-base';
6
6
  import { CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT } from '../base/classes';
7
7
  import { CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT } from '../base/classes';
8
8
  import { CLS_RTE_IMAGE, CLS_IMGINLINE, CLS_IMGBREAK } from '../base/classes';
@@ -46,6 +46,7 @@ var PasteCleanup = /** @class */ (function () {
46
46
  this.parent.on(events.pasteClean, this.pasteClean, this);
47
47
  this.parent.on(events.bindCssClass, this.setCssClass, this);
48
48
  this.parent.on(events.destroy, this.destroy, this);
49
+ this.parent.on(events.docClick, this.docClick, this);
49
50
  };
50
51
  PasteCleanup.prototype.destroy = function () {
51
52
  this.removeEventListener();
@@ -57,6 +58,7 @@ var PasteCleanup = /** @class */ (function () {
57
58
  this.parent.off(events.pasteClean, this.pasteClean);
58
59
  this.parent.off(events.bindCssClass, this.setCssClass);
59
60
  this.parent.off(events.destroy, this.destroy);
61
+ this.parent.off(events.docClick, this.docClick);
60
62
  };
61
63
  PasteCleanup.prototype.pasteClean = function (e) {
62
64
  var _this = this;
@@ -66,6 +68,7 @@ var PasteCleanup = /** @class */ (function () {
66
68
  event: e
67
69
  };
68
70
  var value = null;
71
+ var isClipboardHTMLDataNull = false;
69
72
  var imageproperties;
70
73
  if (e.args && !isNOU(e.args.clipboardData)) {
71
74
  value = e.args.clipboardData.getData('text/html');
@@ -104,6 +107,7 @@ var PasteCleanup = /** @class */ (function () {
104
107
  var divElement = this.parent.createElement('div');
105
108
  divElement.innerHTML = this.splitBreakLine(value);
106
109
  value = divElement.innerHTML;
110
+ isClipboardHTMLDataNull = true;
107
111
  }
108
112
  }
109
113
  else if (value.length > 0) {
@@ -111,7 +115,8 @@ var PasteCleanup = /** @class */ (function () {
111
115
  args: e.args,
112
116
  text: e.text,
113
117
  allowedStylePropertiesArray: this.parent.pasteCleanupSettings.allowedStyleProps,
114
- callBack: function (a, cropImageData) {
118
+ callBack: function (a, cropImageData, pasteTableSource) {
119
+ args.pasteTableSource = pasteTableSource;
115
120
  value = a.trim();
116
121
  _this.cropImageData = cropImageData;
117
122
  }
@@ -123,12 +128,24 @@ var PasteCleanup = /** @class */ (function () {
123
128
  this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
124
129
  var tempDivElem = this.parent.createElement('div');
125
130
  tempDivElem.innerHTML = value;
131
+ var unsupportedImg = tempDivElem.querySelectorAll('.e-rte-image-unsupported');
132
+ for (var index = 0; index < unsupportedImg.length; index++) {
133
+ unsupportedImg[index].setAttribute('alt', this.i10n.getConstant('unsupportedImage'));
134
+ unsupportedImg[index].classList.remove('e-rte-image-unsupported');
135
+ }
136
+ value = tempDivElem.innerHTML;
126
137
  var isValueNotEmpty = tempDivElem.textContent !== '' || !isNOU(tempDivElem.querySelector('img')) ||
127
138
  !isNOU(tempDivElem.querySelector('table'));
139
+ this.parent.notify(events.cleanupResizeElements, {
140
+ value: value,
141
+ callBack: function (currentValue) {
142
+ value = currentValue;
143
+ }
144
+ });
128
145
  if (this.parent.pasteCleanupSettings.prompt) {
129
146
  if (isValueNotEmpty) {
130
147
  e.args.preventDefault();
131
- this.pasteDialog(value, args);
148
+ this.pasteDialog(value, args, isClipboardHTMLDataNull);
132
149
  }
133
150
  else if (Browser.userAgent.indexOf('Firefox') !== -1 && isNOU(file)) {
134
151
  this.fireFoxImageUpload();
@@ -140,7 +157,7 @@ var PasteCleanup = /** @class */ (function () {
140
157
  }
141
158
  else if (this.parent.pasteCleanupSettings.plainText) {
142
159
  e.args.preventDefault();
143
- this.plainFormatting(value, args);
160
+ this.plainFormatting(value, args, isClipboardHTMLDataNull);
144
161
  }
145
162
  else if (this.parent.pasteCleanupSettings.keepFormat) {
146
163
  e.args.preventDefault();
@@ -182,13 +199,17 @@ var PasteCleanup = /** @class */ (function () {
182
199
  PasteCleanup.prototype.splitBreakLine = function (value) {
183
200
  var enterSplitText = value.split('\n');
184
201
  var contentInnerElem = '';
202
+ var startNode = this.parent.enterKey === 'P' ? '<p>' : (this.parent.enterKey === 'DIV' ? '<div>' : '');
203
+ var endNode = this.parent.enterKey === 'P' ? '</p>' : (this.parent.enterKey === 'DIV' ? '</div>' : '<br>');
185
204
  for (var i = 0; i < enterSplitText.length; i++) {
186
205
  if (enterSplitText[i].trim() === '') {
187
206
  contentInnerElem += getDefaultValue(this.parent);
188
207
  }
189
208
  else {
190
209
  var contentWithSpace = this.makeSpace(enterSplitText[i]);
191
- contentInnerElem += '<p>' + contentWithSpace.trim() + '</p>';
210
+ contentInnerElem += (i === 0 && this.parent.enterKey !== 'BR' ? '<span>' : startNode) +
211
+ (contentWithSpace.trim() === '' ? '<br>' : contentWithSpace.trim()) +
212
+ (enterSplitText.length - 1 === i && this.parent.enterKey === 'BR' ? '' : (i === 0 && this.parent.enterKey !== 'BR' ? '</span>' : endNode));
192
213
  }
193
214
  }
194
215
  return contentInnerElem;
@@ -398,7 +419,9 @@ var PasteCleanup = /** @class */ (function () {
398
419
  });
399
420
  popupObj.close();
400
421
  imgElem.style.opacity = '1';
401
- uploadObj.destroy();
422
+ if (!uploadObj.isDestroyed) {
423
+ uploadObj.destroy();
424
+ }
402
425
  this.toolbarEnableDisable(false);
403
426
  };
404
427
  PasteCleanup.prototype.refreshPopup = function (imageElement, popupObj) {
@@ -443,7 +466,7 @@ var PasteCleanup = /** @class */ (function () {
443
466
  * @param {Element []} imgElement - specifies the array elements.
444
467
  * @returns {void}
445
468
  * @hidden
446
-
469
+ * @deprecated
447
470
  */
448
471
  PasteCleanup.prototype.imageFormatting = function (pasteArgs, imgElement) {
449
472
  if (!isNOU(imgElement.elements[0].getAttribute('src'))) {
@@ -457,10 +480,10 @@ var PasteCleanup = /** @class */ (function () {
457
480
  var range = this.nodeSelectionObj.getRange(currentDocument);
458
481
  this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
459
482
  if (this.parent.pasteCleanupSettings.prompt) {
460
- this.pasteDialog(imageValue, pasteArgs);
483
+ this.pasteDialog(imageValue, pasteArgs, false);
461
484
  }
462
485
  else if (this.parent.pasteCleanupSettings.plainText) {
463
- this.plainFormatting(imageValue, pasteArgs);
486
+ this.plainFormatting(imageValue, pasteArgs, false);
464
487
  }
465
488
  else if (this.parent.pasteCleanupSettings.keepFormat) {
466
489
  this.formatting(imageValue, false, pasteArgs);
@@ -484,7 +507,7 @@ var PasteCleanup = /** @class */ (function () {
484
507
  var plainTextElement = this.parent.element.querySelector('#plainTextFormat');
485
508
  this.plainTextRadioButton.appendTo(plainTextElement);
486
509
  };
487
- PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked) {
510
+ PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull) {
488
511
  if (keepChecked) {
489
512
  this.formatting(value, false, args);
490
513
  }
@@ -492,10 +515,10 @@ var PasteCleanup = /** @class */ (function () {
492
515
  this.formatting(value, true, args);
493
516
  }
494
517
  else {
495
- this.plainFormatting(value, args);
518
+ this.plainFormatting(value, args, isClipboardHTMLDataNull);
496
519
  }
497
520
  };
498
- PasteCleanup.prototype.pasteDialog = function (value, args) {
521
+ PasteCleanup.prototype.pasteDialog = function (value, args, isClipboardHTMLDataNull) {
499
522
  var _this = this;
500
523
  var isHeight = false;
501
524
  var preRTEHeight = this.parent.height;
@@ -512,7 +535,7 @@ var PasteCleanup = /** @class */ (function () {
512
535
  var argument = _this.dialogObj;
513
536
  _this.dialogRenderObj.close(argument);
514
537
  _this.dialogObj.destroy();
515
- _this.selectFormatting(value, args, keepChecked, cleanChecked);
538
+ _this.selectFormatting(value, args, keepChecked, cleanChecked, isClipboardHTMLDataNull);
516
539
  }
517
540
  },
518
541
  buttonModel: {
@@ -549,7 +572,7 @@ var PasteCleanup = /** @class */ (function () {
549
572
  width: '300px',
550
573
  height: '265px',
551
574
  cssClass: CLS_RTE_DIALOG_MIN_HEIGHT,
552
- isModal: true,
575
+ isModal: Browser.isDevice,
553
576
  visible: false
554
577
  };
555
578
  this.dialogObj = this.dialogRenderObj.render(dialogModel);
@@ -573,7 +596,7 @@ var PasteCleanup = /** @class */ (function () {
573
596
  isHeight = true;
574
597
  }
575
598
  this.dialogObj.show();
576
- this.setCssClass({ cssClass: this.parent.cssClass });
599
+ this.setCssClass({ cssClass: this.parent.getCssClass() });
577
600
  };
578
601
  PasteCleanup.prototype.updateCss = function (currentObj, e) {
579
602
  if (currentObj && e.cssClass) {
@@ -603,13 +626,22 @@ var PasteCleanup = /** @class */ (function () {
603
626
  this.updateCss(this.keepRadioButton, e);
604
627
  };
605
628
  PasteCleanup.prototype.destroyDialog = function (rteDialogWrapper) {
606
- var rteDialogContainer = this.parent.element.querySelector('.e-dlg-container');
629
+ var rteDialogContainer = this.parent.element.querySelector('.e-rte-dialog-minheight');
607
630
  detach(rteDialogContainer);
608
631
  var rteDialogWrapperChildLength = rteDialogWrapper.children.length;
609
632
  for (var i = 0; i < rteDialogWrapperChildLength; i++) {
610
633
  detach(rteDialogWrapper.children[0]);
611
634
  }
612
635
  };
636
+ PasteCleanup.prototype.docClick = function (e) {
637
+ var target = e.args.target;
638
+ if (target && target.classList && ((this.dialogObj && !closest(target, '[id=' + "'" + this.dialogObj.element.id + "'" + ']')))
639
+ && (!target.classList.contains('e-toolbar-item'))) {
640
+ if (this.dialogObj) {
641
+ this.dialogObj.hide();
642
+ }
643
+ }
644
+ };
613
645
  PasteCleanup.prototype.cleanAppleClass = function (elem) {
614
646
  var appleClassElem = elem.querySelectorAll('br.Apple-interchange-newline');
615
647
  for (var i = 0; i < appleClassElem.length; i++) {
@@ -647,6 +679,9 @@ var PasteCleanup = /** @class */ (function () {
647
679
  this.setImageProperties(allImg[i]);
648
680
  }
649
681
  this.addTempClass(clipBoardElem);
682
+ if (clipBoardElem.querySelectorAll('picture').length > 0) {
683
+ this.processPictureElement(clipBoardElem);
684
+ }
650
685
  if (clipBoardElem.textContent !== '' || !isNOU(clipBoardElem.querySelector('img')) ||
651
686
  !isNOU(clipBoardElem.querySelector('table'))) {
652
687
  var tempWrapperElem = this.parent.createElement('div');
@@ -678,11 +713,26 @@ var PasteCleanup = /** @class */ (function () {
678
713
  }
679
714
  }
680
715
  this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
681
- clipBoardElem.innerHTML = value;
682
- clipBoardElem = this.addTableClass(clipBoardElem);
716
+ clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
717
+ clipBoardElem = this.addTableClass(clipBoardElem, args.pasteTableSource);
683
718
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
684
719
  extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
685
720
  _this.parent.formatter.onSuccess(_this.parent, args);
721
+ if (!isNOU(returnArgs.elements) && !isNOU(returnArgs.imgElem) &&
722
+ returnArgs.imgElem.length > 0) {
723
+ var pasteContent = returnArgs.elements;
724
+ var imageContent = returnArgs.imgElem;
725
+ var lastElementChild = _this.findLastElement(pasteContent[pasteContent.length - 1]);
726
+ var isImageAtLast = !isNOU(lastElementChild) ? lastElementChild.nodeName === 'IMG' : false;
727
+ if (isImageAtLast || pasteContent[pasteContent.length - 1] === imageContent[imageContent.length - 1]) {
728
+ _this.parent.notify(events.insertCompleted, {
729
+ args: args.event,
730
+ type: 'Images',
731
+ isNotify: true,
732
+ elements: imageContent[imageContent.length - 1]
733
+ });
734
+ }
735
+ }
686
736
  }, clipBoardElem, null, null, this.parent.enterKey);
687
737
  this.removeTempClass();
688
738
  this.parent.notify(events.toolbarRefresh, {});
@@ -737,12 +787,16 @@ var PasteCleanup = /** @class */ (function () {
737
787
  }
738
788
  }
739
789
  };
740
- PasteCleanup.prototype.addTableClass = function (element) {
790
+ PasteCleanup.prototype.addTableClass = function (element, source) {
791
+ source = isNOU(source) ? '' : source;
741
792
  var tableElement = element.querySelectorAll('table');
742
793
  for (var i = 0; i < tableElement.length; i++) {
743
- if (!tableElement[i].classList.contains('e-rte-table')) {
794
+ if (!tableElement[i].classList.contains('e-rte-table') && (source === 'html' || source === '')) {
744
795
  tableElement[i].classList.add('e-rte-table');
745
796
  }
797
+ else if (source && source !== 'html') {
798
+ tableElement[i].classList.add('e-rte-paste-' + source + '-table');
799
+ }
746
800
  }
747
801
  return element;
748
802
  };
@@ -786,7 +840,7 @@ var PasteCleanup = /** @class */ (function () {
786
840
  return value;
787
841
  };
788
842
  //Plain Formatting
789
- PasteCleanup.prototype.plainFormatting = function (value, args) {
843
+ PasteCleanup.prototype.plainFormatting = function (value, args, isClipboardHTMLDataNull) {
790
844
  var _this = this;
791
845
  var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
792
846
  clipBoardElem.innerHTML = value;
@@ -824,6 +878,13 @@ var PasteCleanup = /** @class */ (function () {
824
878
  this.saveSelection.restore();
825
879
  clipBoardElem.innerHTML = this.sanitizeHelper(clipBoardElem.innerHTML);
826
880
  this.addTempClass(clipBoardElem);
881
+ this.removingComments(clipBoardElem);
882
+ if (this.parent.enterKey === 'BR' && !isClipboardHTMLDataNull) {
883
+ clipBoardElem = this.reframeToBrContent(clipBoardElem);
884
+ }
885
+ else if (this.parent.enterKey === 'DIV') {
886
+ clipBoardElem.innerHTML = clipBoardElem.innerHTML.replace(/<p class="pasteContent_RTE">/g, '<div>').replace(/<\/p>/g, '</div>');
887
+ }
827
888
  this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
828
889
  clipBoardElem.innerHTML = value;
829
890
  this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
@@ -838,6 +899,41 @@ var PasteCleanup = /** @class */ (function () {
838
899
  this.parent.formatter.onSuccess(this.parent, args);
839
900
  }
840
901
  };
902
+ PasteCleanup.prototype.removingComments = function (elm) {
903
+ var innerElement = elm.innerHTML;
904
+ innerElement = innerElement.replace(/<!--[\s\S]*?-->/g, '');
905
+ elm.innerHTML = innerElement;
906
+ };
907
+ PasteCleanup.prototype.reframeToBrContent = function (clipBoardElem) {
908
+ var newClipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
909
+ while (!isNOU(clipBoardElem.firstChild)) {
910
+ var brElem = this.parent.createElement('br');
911
+ var currentFirstChild = clipBoardElem.firstChild;
912
+ if (currentFirstChild.nodeName === '#text') {
913
+ var isNextSibPresent = !isNOU(currentFirstChild.nextSibling);
914
+ newClipBoardElem.appendChild(currentFirstChild);
915
+ if (isNextSibPresent) {
916
+ newClipBoardElem.appendChild(brElem);
917
+ }
918
+ }
919
+ else {
920
+ var isCurrentNodeBRElm = currentFirstChild.nodeName === 'BR';
921
+ if (isCurrentNodeBRElm) {
922
+ newClipBoardElem.appendChild(currentFirstChild);
923
+ }
924
+ else {
925
+ newClipBoardElem.appendChild(currentFirstChild.childNodes[0]);
926
+ }
927
+ if (!isNOU(currentFirstChild) && !isNOU(currentFirstChild.nextSibling)) {
928
+ newClipBoardElem.appendChild(brElem);
929
+ }
930
+ if (!isCurrentNodeBRElm && !isNOU(currentFirstChild)) {
931
+ detach(currentFirstChild);
932
+ }
933
+ }
934
+ }
935
+ return newClipBoardElem;
936
+ };
841
937
  PasteCleanup.prototype.getTextContent = function (clipBoardElem) {
842
938
  for (var i = 0; i < this.blockNode.length; i++) {
843
939
  var inElem = clipBoardElem.querySelectorAll(this.blockNode[i]);
@@ -885,14 +981,16 @@ var PasteCleanup = /** @class */ (function () {
885
981
  for (var i = 0; i < this.inlineNode.length; i++) {
886
982
  var inElem = clipBoardElem.querySelectorAll(this.inlineNode[i]);
887
983
  for (var j = 0; j < inElem.length; j++) {
888
- var parElem = void 0;
889
- for (var k = 0; k < inElem[j].childNodes.length; k++) {
890
- parElem = inElem[j].childNodes[k].parentElement;
891
- inElem[j].childNodes[k].parentElement.parentElement.insertBefore(inElem[j].childNodes[k], inElem[j].childNodes[k].parentElement);
892
- k--;
893
- }
894
- if (!isNOU(parElem)) {
895
- detach(parElem);
984
+ if (!(inElem[j] === clipBoardElem.firstChild && inElem[j].nodeName === 'SPAN')) {
985
+ var parElem = void 0;
986
+ for (var k = 0; k < inElem[j].childNodes.length; k++) {
987
+ parElem = inElem[j].childNodes[k].parentElement;
988
+ inElem[j].childNodes[k].parentElement.parentElement.insertBefore(inElem[j].childNodes[k], inElem[j].childNodes[k].parentElement);
989
+ k--;
990
+ }
991
+ if (!isNOU(parElem)) {
992
+ detach(parElem);
993
+ }
896
994
  }
897
995
  }
898
996
  }
@@ -1033,6 +1131,36 @@ var PasteCleanup = /** @class */ (function () {
1033
1131
  }
1034
1132
  return clipBoardElem;
1035
1133
  };
1134
+ PasteCleanup.prototype.findLastElement = function (element) {
1135
+ if (!isNOU(element) && !isNOU(element.lastElementChild)) {
1136
+ var lastChild = element.lastElementChild;
1137
+ while (lastChild && lastChild.lastElementChild) {
1138
+ lastChild = lastChild.lastElementChild;
1139
+ }
1140
+ return lastChild;
1141
+ }
1142
+ return null;
1143
+ };
1144
+ PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
1145
+ var pictureElems = clipBoardElem.querySelectorAll('picture');
1146
+ for (var i = 0; i < pictureElems.length; i++) {
1147
+ var imgElem = pictureElems[i].querySelector('img');
1148
+ var sourceElems = pictureElems[i].querySelectorAll('source');
1149
+ if (imgElem && imgElem.getAttribute('src')) {
1150
+ var srcValue = imgElem.getAttribute('src');
1151
+ var url = new URL(srcValue);
1152
+ for (var j = 0; j < sourceElems.length; j++) {
1153
+ var srcset = sourceElems[j].getAttribute('srcset');
1154
+ if (srcset) {
1155
+ if (srcset.indexOf('http') === -1) {
1156
+ var fullPath = url.origin + srcset;
1157
+ sourceElems[j].setAttribute('srcset', fullPath);
1158
+ }
1159
+ }
1160
+ }
1161
+ }
1162
+ }
1163
+ };
1036
1164
  /**
1037
1165
  * For internal use only - Get the module name.
1038
1166
  *
@@ -35,7 +35,7 @@ export declare class QuickToolbar {
35
35
  * @param {RenderType} type - specifies the render type.
36
36
  * @returns {BaseQuickToolbar} - specifies the quick toolbar
37
37
  * @hidden
38
-
38
+ * @deprecated
39
39
  */
40
40
  createQTBar(popupType: string, mode: string, items: (string | IToolbarItems)[], type: RenderType): BaseQuickToolbar;
41
41
  private initializeQuickToolbars;
@@ -51,7 +51,7 @@ export declare class QuickToolbar {
51
51
  * @param {HTMLElement} target - specifies the target element.
52
52
  * @returns {void}
53
53
  * @hidden
54
-
54
+ * @deprecated
55
55
  */
56
56
  showInlineQTBar(x: number, y: number, target: HTMLElement): void;
57
57
  /**
@@ -59,7 +59,7 @@ export declare class QuickToolbar {
59
59
  *
60
60
  * @returns {void}
61
61
  * @hidden
62
-
62
+ * @deprecated
63
63
  */
64
64
  hideInlineQTBar(): void;
65
65
  /**
@@ -67,7 +67,7 @@ export declare class QuickToolbar {
67
67
  *
68
68
  * @returns {void}
69
69
  * @hidden
70
-
70
+ * @deprecated
71
71
  */
72
72
  hideQuickToolbars(): void;
73
73
  private deBounce;
@@ -82,7 +82,7 @@ export declare class QuickToolbar {
82
82
  *
83
83
  * @returns {void}
84
84
  * @hidden
85
-
85
+ * @deprecated
86
86
  */
87
87
  getInlineBaseToolbar(): BaseToolbar;
88
88
  /**
@@ -91,7 +91,7 @@ export declare class QuickToolbar {
91
91
  * @function destroy
92
92
  * @returns {void}
93
93
  * @hidden
94
-
94
+ * @deprecated
95
95
  */
96
96
  destroy(): void;
97
97
  private moduleDestroy;
@@ -103,7 +103,7 @@ export declare class QuickToolbar {
103
103
  *
104
104
  * @returns {void}
105
105
  * @hidden
106
-
106
+ * @deprecated
107
107
  */
108
108
  addEventListener(): void;
109
109
  private onKeyDown;
@@ -116,7 +116,7 @@ export declare class QuickToolbar {
116
116
  *
117
117
  * @returns {void}
118
118
  * @hidden
119
-
119
+ * @deprecated
120
120
  */
121
121
  removeEventListener(): void;
122
122
  /**
@@ -125,7 +125,7 @@ export declare class QuickToolbar {
125
125
  * @param {RichTextEditorModel} e - specifies the element.
126
126
  * @returns {void}
127
127
  * @hidden
128
-
128
+ * @deprecated
129
129
  */
130
130
  protected onPropertyChanged(e: {
131
131
  [key: string]: RichTextEditorModel;
@@ -137,4 +137,11 @@ export declare class QuickToolbar {
137
137
  * @hidden
138
138
  */
139
139
  private getModuleName;
140
+ /**
141
+ *
142
+ * @returns {BaseQuickToolbar[]} - specifies the quick toolbar instance.
143
+ * @hidden
144
+ * @private
145
+ */
146
+ getQuickToolbarInstance(): BaseQuickToolbar[];
140
147
  }
@@ -47,7 +47,7 @@ var QuickToolbar = /** @class */ (function () {
47
47
  toolbarItems: items,
48
48
  mode: mode,
49
49
  renderType: type,
50
- cssClass: this.parent.cssClass
50
+ cssClass: this.parent.getCssClass()
51
51
  };
52
52
  };
53
53
  /**
@@ -59,7 +59,7 @@ var QuickToolbar = /** @class */ (function () {
59
59
  * @param {RenderType} type - specifies the render type.
60
60
  * @returns {BaseQuickToolbar} - specifies the quick toolbar
61
61
  * @hidden
62
-
62
+ * @deprecated
63
63
  */
64
64
  QuickToolbar.prototype.createQTBar = function (popupType, mode, items, type) {
65
65
  if (items.length < 1) {
@@ -146,10 +146,10 @@ var QuickToolbar = /** @class */ (function () {
146
146
  * @param {HTMLElement} target - specifies the target element.
147
147
  * @returns {void}
148
148
  * @hidden
149
-
149
+ * @deprecated
150
150
  */
151
151
  QuickToolbar.prototype.showInlineQTBar = function (x, y, target) {
152
- if (isNOU(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img') {
152
+ if (isNOU(this.parent) || this.parent.readonly || target.tagName.toLowerCase() === 'img' || this.inlineQTBar.element.querySelector('.e-rte-color-content')) {
153
153
  return;
154
154
  }
155
155
  this.inlineQTBar.showPopup(x, y, target);
@@ -159,7 +159,7 @@ var QuickToolbar = /** @class */ (function () {
159
159
  *
160
160
  * @returns {void}
161
161
  * @hidden
162
-
162
+ * @deprecated
163
163
  */
164
164
  QuickToolbar.prototype.hideInlineQTBar = function () {
165
165
  if (this.inlineQTBar && !hasClass(this.inlineQTBar.element, 'e-popup-close')) {
@@ -171,7 +171,7 @@ var QuickToolbar = /** @class */ (function () {
171
171
  *
172
172
  * @returns {void}
173
173
  * @hidden
174
-
174
+ * @deprecated
175
175
  */
176
176
  QuickToolbar.prototype.hideQuickToolbars = function () {
177
177
  if (this.linkQTBar && !hasClass(this.linkQTBar.element, 'e-popup-close') && document.body.contains(this.linkQTBar.element)) {
@@ -238,6 +238,9 @@ var QuickToolbar = /** @class */ (function () {
238
238
  }
239
239
  }
240
240
  if (!isNOU(this.textQTBar) && !isNOU(this.parent.quickToolbarSettings.text) && !this.parent.inlineMode.enable) {
241
+ if (!isNOU(e) && !isNOU(e.name) && e.name === 'sourceCodeMouseDown') {
242
+ return;
243
+ }
241
244
  var args = e.args.touches ?
242
245
  e.args.changedTouches[0] : e.args;
243
246
  var target = e.args.target;
@@ -248,7 +251,7 @@ var QuickToolbar = /** @class */ (function () {
248
251
  this.offsetY = pageYOffset(args, this.parent.element, this.parent.iframeSettings.enable);
249
252
  var range = this.parent.getRange();
250
253
  if ((range.endContainer.parentElement.tagName === range.startContainer.parentElement.tagName && (range.startContainer.parentElement.tagName === 'A' && range.endContainer.parentElement.tagName === 'A')) ||
251
- (target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
254
+ (target.tagName === 'IMG') || (target.tagName === 'VIDEO') || (target.tagName === 'AUDIO') || (target.childNodes[0] && target.childNodes[0].nodeType === 1 && target.childNodes[0].classList.contains('e-rte-audio')) ||
252
255
  (this.parent.getRange().startOffset === this.parent.getRange().endOffset)) {
253
256
  return;
254
257
  }
@@ -256,10 +259,16 @@ var QuickToolbar = /** @class */ (function () {
256
259
  this.textQTBar.showPopup(this.offsetX, this.offsetY, target, 'text');
257
260
  }
258
261
  };
259
- QuickToolbar.prototype.keyDownHandler = function () {
260
- if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
261
- && !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
262
- this.hideInlineQTBar();
262
+ QuickToolbar.prototype.keyDownHandler = function (e) {
263
+ var preventHide = e.args.altKey;
264
+ if (!preventHide) {
265
+ if ((this.parent.inlineMode.enable && (!Browser.isDevice || isIDevice()))
266
+ && !isNullOrUndefined(select('.' + CLS_INLINE_POP, document))) {
267
+ this.hideInlineQTBar();
268
+ }
269
+ if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
270
+ this.textQTBar.hidePopup();
271
+ }
263
272
  }
264
273
  };
265
274
  QuickToolbar.prototype.inlineQTBarMouseDownHandler = function () {
@@ -274,8 +283,8 @@ var QuickToolbar = /** @class */ (function () {
274
283
  }
275
284
  };
276
285
  QuickToolbar.prototype.keyUpHandler = function (e) {
286
+ var args = e.args;
277
287
  if (this.parent.inlineMode.enable && !Browser.isDevice) {
278
- var args = e.args;
279
288
  if (this.parent.inlineMode.onSelection) {
280
289
  if (this.parent.getSelection().length > 0) {
281
290
  if ((args.ctrlKey && args.keyCode === 65) || (args.shiftKey && (args.keyCode === 33 || args.keyCode === 34 ||
@@ -288,6 +297,13 @@ var QuickToolbar = /** @class */ (function () {
288
297
  }
289
298
  this.deBounce(this.offsetX, this.offsetY, args.target);
290
299
  }
300
+ if (this.parent.quickToolbarSettings.text && !Browser.isDevice) {
301
+ if ((args.ctrlKey && args.keyCode === 65) || (args.shiftKey && (args.keyCode === 33 || args.keyCode === 34 ||
302
+ args.keyCode === 35 || args.keyCode === 36 || args.keyCode === 37 || args.keyCode === 38 ||
303
+ args.keyCode === 39 || args.keyCode === 40))) {
304
+ this.textQTBar.showPopup(this.offsetX, this.offsetY, args.target, 'text');
305
+ }
306
+ }
291
307
  };
292
308
  QuickToolbar.prototype.selectionChangeHandler = function (e) {
293
309
  var _this = this;
@@ -310,7 +326,7 @@ var QuickToolbar = /** @class */ (function () {
310
326
  *
311
327
  * @returns {void}
312
328
  * @hidden
313
-
329
+ * @deprecated
314
330
  */
315
331
  QuickToolbar.prototype.getInlineBaseToolbar = function () {
316
332
  return this.inlineQTBar && this.inlineQTBar.quickTBarObj;
@@ -321,7 +337,7 @@ var QuickToolbar = /** @class */ (function () {
321
337
  * @function destroy
322
338
  * @returns {void}
323
339
  * @hidden
324
-
340
+ * @deprecated
325
341
  */
326
342
  QuickToolbar.prototype.destroy = function () {
327
343
  if (isNOU(this.parent)) {
@@ -411,7 +427,7 @@ var QuickToolbar = /** @class */ (function () {
411
427
  *
412
428
  * @returns {void}
413
429
  * @hidden
414
-
430
+ * @deprecated
415
431
  */
416
432
  QuickToolbar.prototype.addEventListener = function () {
417
433
  if (this.parent.isDestroyed) {
@@ -447,6 +463,15 @@ var QuickToolbar = /** @class */ (function () {
447
463
  if (this.videoQTBar && !hasClass(this.videoQTBar.element, 'e-popup-close')) {
448
464
  this.videoQTBar.hidePopup();
449
465
  }
466
+ if (this.tableQTBar && !hasClass(this.tableQTBar.element, 'e-popup-close')) {
467
+ this.tableQTBar.hidePopup();
468
+ }
469
+ if (this.linkQTBar && !hasClass(this.linkQTBar.element, 'e-popup-close')) {
470
+ this.linkQTBar.hidePopup();
471
+ }
472
+ if (this.textQTBar && !hasClass(this.textQTBar.element, 'e-popup-close')) {
473
+ this.textQTBar.hidePopup();
474
+ }
450
475
  }
451
476
  };
452
477
  QuickToolbar.prototype.onIframeMouseDown = function () {
@@ -496,9 +521,12 @@ var QuickToolbar = /** @class */ (function () {
496
521
  *
497
522
  * @returns {void}
498
523
  * @hidden
499
-
524
+ * @deprecated
500
525
  */
501
526
  QuickToolbar.prototype.removeEventListener = function () {
527
+ if (this.deBouncer) {
528
+ clearTimeout(this.deBouncer);
529
+ }
502
530
  if (this.parent.isDestroyed) {
503
531
  return;
504
532
  }
@@ -519,9 +547,6 @@ var QuickToolbar = /** @class */ (function () {
519
547
  this.parent.off(events.rtlMode, this.setRtl);
520
548
  this.parent.off(events.bindCssClass, this.setCssClass);
521
549
  this.parent.off(events.hidePopup, this.hideQuickToolbars);
522
- if (this.deBouncer) {
523
- clearTimeout(this.deBouncer);
524
- }
525
550
  };
526
551
  /**
527
552
  * Called internally if any of the property value changed.
@@ -529,7 +554,7 @@ var QuickToolbar = /** @class */ (function () {
529
554
  * @param {RichTextEditorModel} e - specifies the element.
530
555
  * @returns {void}
531
556
  * @hidden
532
-
557
+ * @deprecated
533
558
  */
534
559
  QuickToolbar.prototype.onPropertyChanged = function (e) {
535
560
  if (!isNullOrUndefined(e.newProp.quickToolbarSettings)) {
@@ -571,6 +596,15 @@ var QuickToolbar = /** @class */ (function () {
571
596
  QuickToolbar.prototype.getModuleName = function () {
572
597
  return 'quickToolbar';
573
598
  };
599
+ /**
600
+ *
601
+ * @returns {BaseQuickToolbar[]} - specifies the quick toolbar instance.
602
+ * @hidden
603
+ * @private
604
+ */
605
+ QuickToolbar.prototype.getQuickToolbarInstance = function () {
606
+ return [this.linkQTBar, this.imageQTBar, this.audioQTBar, this.videoQTBar, this.tableQTBar, this.textQTBar, this.inlineQTBar];
607
+ };
574
608
  return QuickToolbar;
575
609
  }());
576
610
  export { QuickToolbar };