@syncfusion/ej2-richtexteditor 29.2.4-738301 → 29.2.4-760237

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 (365) hide show
  1. package/.eslintrc.json +262 -260
  2. package/aceconfig.js +17 -0
  3. package/blazorGlobalSrc/common/config.d.ts +63 -0
  4. package/blazorGlobalSrc/common/config.js +123 -0
  5. package/blazorGlobalSrc/common/constant.d.ts +117 -0
  6. package/blazorGlobalSrc/common/constant.js +23 -0
  7. package/blazorGlobalSrc/common/editor-styles.d.ts +1 -0
  8. package/blazorGlobalSrc/common/editor-styles.js +5 -0
  9. package/blazorGlobalSrc/common/index.d.ts +7 -0
  10. package/blazorGlobalSrc/common/index.js +9 -0
  11. package/blazorGlobalSrc/common/interface.d.ts +119 -0
  12. package/blazorGlobalSrc/common/interface.js +4 -0
  13. package/blazorGlobalSrc/common/types.d.ts +25 -0
  14. package/blazorGlobalSrc/common/types.js +4 -0
  15. package/blazorGlobalSrc/common/user-agent.d.ts +41 -0
  16. package/blazorGlobalSrc/common/user-agent.js +71 -0
  17. package/blazorGlobalSrc/common/util.d.ts +70 -0
  18. package/blazorGlobalSrc/common/util.js +222 -0
  19. package/blazorGlobalSrc/components.d.ts +8 -0
  20. package/blazorGlobalSrc/components.js +12 -0
  21. package/blazorGlobalSrc/editor-manager/base/classes.d.ts +31 -0
  22. package/blazorGlobalSrc/editor-manager/base/classes.js +28 -0
  23. package/blazorGlobalSrc/editor-manager/base/constant.d.ts +97 -0
  24. package/blazorGlobalSrc/editor-manager/base/constant.js +41 -0
  25. package/blazorGlobalSrc/editor-manager/base/editor-manager.d.ts +95 -0
  26. package/blazorGlobalSrc/editor-manager/base/editor-manager.js +339 -0
  27. package/blazorGlobalSrc/editor-manager/base/enum.d.ts +17 -0
  28. package/blazorGlobalSrc/editor-manager/base/enum.js +4 -0
  29. package/blazorGlobalSrc/editor-manager/base/interface.d.ts +263 -0
  30. package/blazorGlobalSrc/editor-manager/base/interface.js +4 -0
  31. package/blazorGlobalSrc/editor-manager/base/types.d.ts +7 -0
  32. package/blazorGlobalSrc/editor-manager/base/types.js +4 -0
  33. package/blazorGlobalSrc/editor-manager/base.d.ts +8 -0
  34. package/blazorGlobalSrc/editor-manager/base.js +10 -0
  35. package/blazorGlobalSrc/editor-manager/index.d.ts +5 -0
  36. package/blazorGlobalSrc/editor-manager/index.js +9 -0
  37. package/blazorGlobalSrc/editor-manager/plugin/alignments.d.ts +26 -0
  38. package/blazorGlobalSrc/editor-manager/plugin/alignments.js +105 -0
  39. package/blazorGlobalSrc/editor-manager/plugin/audio.d.ts +34 -0
  40. package/blazorGlobalSrc/editor-manager/plugin/audio.js +145 -0
  41. package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.d.ts +24 -0
  42. package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.js +47 -0
  43. package/blazorGlobalSrc/editor-manager/plugin/clearformat.d.ts +29 -0
  44. package/blazorGlobalSrc/editor-manager/plugin/clearformat.js +249 -0
  45. package/blazorGlobalSrc/editor-manager/plugin/dom-node.d.ts +351 -0
  46. package/blazorGlobalSrc/editor-manager/plugin/dom-node.js +737 -0
  47. package/blazorGlobalSrc/editor-manager/plugin/dom-tree.d.ts +84 -0
  48. package/blazorGlobalSrc/editor-manager/plugin/dom-tree.js +164 -0
  49. package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.d.ts +10 -0
  50. package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.js +86 -0
  51. package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.d.ts +47 -0
  52. package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.js +622 -0
  53. package/blazorGlobalSrc/editor-manager/plugin/formats.d.ts +43 -0
  54. package/blazorGlobalSrc/editor-manager/plugin/formats.js +597 -0
  55. package/blazorGlobalSrc/editor-manager/plugin/image.d.ts +48 -0
  56. package/blazorGlobalSrc/editor-manager/plugin/image.js +399 -0
  57. package/blazorGlobalSrc/editor-manager/plugin/indents.d.ts +24 -0
  58. package/blazorGlobalSrc/editor-manager/plugin/indents.js +106 -0
  59. package/blazorGlobalSrc/editor-manager/plugin/insert-methods.d.ts +48 -0
  60. package/blazorGlobalSrc/editor-manager/plugin/insert-methods.js +37 -0
  61. package/blazorGlobalSrc/editor-manager/plugin/insert-text.d.ts +22 -0
  62. package/blazorGlobalSrc/editor-manager/plugin/insert-text.js +36 -0
  63. package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.d.ts +22 -0
  64. package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.js +49 -0
  65. package/blazorGlobalSrc/editor-manager/plugin/inserthtml.d.ts +51 -0
  66. package/blazorGlobalSrc/editor-manager/plugin/inserthtml.js +985 -0
  67. package/blazorGlobalSrc/editor-manager/plugin/isformatted.d.ts +89 -0
  68. package/blazorGlobalSrc/editor-manager/plugin/isformatted.js +199 -0
  69. package/blazorGlobalSrc/editor-manager/plugin/link.d.ts +41 -0
  70. package/blazorGlobalSrc/editor-manager/plugin/link.js +550 -0
  71. package/blazorGlobalSrc/editor-manager/plugin/lists.d.ts +74 -0
  72. package/blazorGlobalSrc/editor-manager/plugin/lists.js +1503 -0
  73. package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.d.ts +61 -0
  74. package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.js +1136 -0
  75. package/blazorGlobalSrc/editor-manager/plugin/nodecutter.d.ts +64 -0
  76. package/blazorGlobalSrc/editor-manager/plugin/nodecutter.js +167 -0
  77. package/blazorGlobalSrc/editor-manager/plugin/selection-commands.d.ts +41 -0
  78. package/blazorGlobalSrc/editor-manager/plugin/selection-commands.js +1069 -0
  79. package/blazorGlobalSrc/editor-manager/plugin/selection-exec.d.ts +24 -0
  80. package/blazorGlobalSrc/editor-manager/plugin/selection-exec.js +49 -0
  81. package/blazorGlobalSrc/editor-manager/plugin/table-selection.d.ts +26 -0
  82. package/blazorGlobalSrc/editor-manager/plugin/table-selection.js +210 -0
  83. package/blazorGlobalSrc/editor-manager/plugin/table.d.ts +56 -0
  84. package/blazorGlobalSrc/editor-manager/plugin/table.js +1100 -0
  85. package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.d.ts +39 -0
  86. package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.js +384 -0
  87. package/blazorGlobalSrc/editor-manager/plugin/undo.d.ts +85 -0
  88. package/blazorGlobalSrc/editor-manager/plugin/undo.js +216 -0
  89. package/blazorGlobalSrc/editor-manager/plugin/video.d.ts +38 -0
  90. package/blazorGlobalSrc/editor-manager/plugin/video.js +311 -0
  91. package/blazorGlobalSrc/editor-manager/plugin.d.ts +27 -0
  92. package/blazorGlobalSrc/editor-manager/plugin.js +31 -0
  93. package/blazorGlobalSrc/global.d.ts +1 -0
  94. package/blazorGlobalSrc/global.js +3 -0
  95. package/blazorGlobalSrc/index.d.ts +8 -0
  96. package/blazorGlobalSrc/index.js +12 -0
  97. package/blazorGlobalSrc/markdown-parser/base/constant.d.ts +39 -0
  98. package/blazorGlobalSrc/markdown-parser/base/constant.js +10 -0
  99. package/blazorGlobalSrc/markdown-parser/base/interface.d.ts +169 -0
  100. package/blazorGlobalSrc/markdown-parser/base/interface.js +4 -0
  101. package/blazorGlobalSrc/markdown-parser/base/markdown-parser.d.ts +69 -0
  102. package/blazorGlobalSrc/markdown-parser/base/markdown-parser.js +87 -0
  103. package/blazorGlobalSrc/markdown-parser/base/types.d.ts +7 -0
  104. package/blazorGlobalSrc/markdown-parser/base/types.js +4 -0
  105. package/blazorGlobalSrc/markdown-parser/base.d.ts +7 -0
  106. package/blazorGlobalSrc/markdown-parser/base.js +9 -0
  107. package/blazorGlobalSrc/markdown-parser/index.d.ts +5 -0
  108. package/blazorGlobalSrc/markdown-parser/index.js +9 -0
  109. package/blazorGlobalSrc/markdown-parser/plugin/clearformat.d.ts +28 -0
  110. package/blazorGlobalSrc/markdown-parser/plugin/clearformat.js +110 -0
  111. package/blazorGlobalSrc/markdown-parser/plugin/formats.d.ts +32 -0
  112. package/blazorGlobalSrc/markdown-parser/plugin/formats.js +225 -0
  113. package/blazorGlobalSrc/markdown-parser/plugin/insert-text.d.ts +24 -0
  114. package/blazorGlobalSrc/markdown-parser/plugin/insert-text.js +49 -0
  115. package/blazorGlobalSrc/markdown-parser/plugin/link.d.ts +24 -0
  116. package/blazorGlobalSrc/markdown-parser/plugin/link.js +50 -0
  117. package/blazorGlobalSrc/markdown-parser/plugin/lists.d.ts +39 -0
  118. package/blazorGlobalSrc/markdown-parser/plugin/lists.js +462 -0
  119. package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.d.ts +140 -0
  120. package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.js +104 -0
  121. package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.d.ts +31 -0
  122. package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.js +335 -0
  123. package/blazorGlobalSrc/markdown-parser/plugin/table.d.ts +52 -0
  124. package/blazorGlobalSrc/markdown-parser/plugin/table.js +216 -0
  125. package/blazorGlobalSrc/markdown-parser/plugin/undo.d.ts +83 -0
  126. package/blazorGlobalSrc/markdown-parser/plugin/undo.js +147 -0
  127. package/blazorGlobalSrc/markdown-parser/plugin.d.ts +11 -0
  128. package/blazorGlobalSrc/markdown-parser/plugin.js +15 -0
  129. package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.d.ts +114 -0
  130. package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.js +465 -0
  131. package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.d.ts +58 -0
  132. package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.js +216 -0
  133. package/blazorGlobalSrc/rich-text-editor/actions/color-picker.d.ts +52 -0
  134. package/blazorGlobalSrc/rich-text-editor/actions/color-picker.js +241 -0
  135. package/blazorGlobalSrc/rich-text-editor/actions/count.d.ts +55 -0
  136. package/blazorGlobalSrc/rich-text-editor/actions/count.js +117 -0
  137. package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.d.ts +72 -0
  138. package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.js +552 -0
  139. package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.d.ts +51 -0
  140. package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.js +853 -0
  141. package/blazorGlobalSrc/rich-text-editor/actions/enter-key.d.ts +28 -0
  142. package/blazorGlobalSrc/rich-text-editor/actions/enter-key.js +821 -0
  143. package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.d.ts +11 -0
  144. package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.js +28 -0
  145. package/blazorGlobalSrc/rich-text-editor/actions/file-manager.d.ts +45 -0
  146. package/blazorGlobalSrc/rich-text-editor/actions/file-manager.js +249 -0
  147. package/blazorGlobalSrc/rich-text-editor/actions/format-painter.d.ts +25 -0
  148. package/blazorGlobalSrc/rich-text-editor/actions/format-painter.js +156 -0
  149. package/blazorGlobalSrc/rich-text-editor/actions/full-screen.d.ts +40 -0
  150. package/blazorGlobalSrc/rich-text-editor/actions/full-screen.js +148 -0
  151. package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.d.ts +15 -0
  152. package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.js +50 -0
  153. package/blazorGlobalSrc/rich-text-editor/actions/html-editor.d.ts +120 -0
  154. package/blazorGlobalSrc/rich-text-editor/actions/html-editor.js +1244 -0
  155. package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.d.ts +14 -0
  156. package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.js +47 -0
  157. package/blazorGlobalSrc/rich-text-editor/actions/import-export.d.ts +21 -0
  158. package/blazorGlobalSrc/rich-text-editor/actions/import-export.js +117 -0
  159. package/blazorGlobalSrc/rich-text-editor/actions/keyboard-model.d.ts +30 -0
  160. package/blazorGlobalSrc/rich-text-editor/actions/keyboard.d.ts +110 -0
  161. package/blazorGlobalSrc/rich-text-editor/actions/keyboard.js +163 -0
  162. package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.d.ts +66 -0
  163. package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.js +142 -0
  164. package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.d.ts +23 -0
  165. package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.js +124 -0
  166. package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.d.ts +86 -0
  167. package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.js +1071 -0
  168. package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.d.ts +151 -0
  169. package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.js +548 -0
  170. package/blazorGlobalSrc/rich-text-editor/actions/resize.d.ts +37 -0
  171. package/blazorGlobalSrc/rich-text-editor/actions/resize.js +188 -0
  172. package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.d.ts +11 -0
  173. package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.js +168 -0
  174. package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.d.ts +18 -0
  175. package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.js +76 -0
  176. package/blazorGlobalSrc/rich-text-editor/actions/toolbar.d.ts +185 -0
  177. package/blazorGlobalSrc/rich-text-editor/actions/toolbar.js +512 -0
  178. package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.d.ts +25 -0
  179. package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.js +166 -0
  180. package/blazorGlobalSrc/rich-text-editor/actions.d.ts +26 -0
  181. package/blazorGlobalSrc/rich-text-editor/actions.js +30 -0
  182. package/blazorGlobalSrc/rich-text-editor/audio.d.ts +4 -0
  183. package/blazorGlobalSrc/rich-text-editor/audio.js +8 -0
  184. package/blazorGlobalSrc/rich-text-editor/base/classes.d.ts +628 -0
  185. package/blazorGlobalSrc/rich-text-editor/base/classes.js +129 -0
  186. package/blazorGlobalSrc/rich-text-editor/base/constant.d.ts +808 -0
  187. package/blazorGlobalSrc/rich-text-editor/base/constant.js +334 -0
  188. package/blazorGlobalSrc/rich-text-editor/base/enum.d.ts +81 -0
  189. package/blazorGlobalSrc/rich-text-editor/base/enum.js +37 -0
  190. package/blazorGlobalSrc/rich-text-editor/base/interface.d.ts +1577 -0
  191. package/blazorGlobalSrc/rich-text-editor/base/interface.js +194 -0
  192. package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor-model.d.ts +1032 -0
  193. package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.d.ts +1699 -0
  194. package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.js +2645 -0
  195. package/blazorGlobalSrc/rich-text-editor/base/util.d.ts +212 -0
  196. package/blazorGlobalSrc/rich-text-editor/base/util.js +610 -0
  197. package/blazorGlobalSrc/rich-text-editor/base.d.ts +10 -0
  198. package/blazorGlobalSrc/rich-text-editor/base.js +13 -0
  199. package/blazorGlobalSrc/rich-text-editor/formatter/formatter.d.ts +87 -0
  200. package/blazorGlobalSrc/rich-text-editor/formatter/formatter.js +223 -0
  201. package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.d.ts +34 -0
  202. package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.js +44 -0
  203. package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.d.ts +39 -0
  204. package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.js +48 -0
  205. package/blazorGlobalSrc/rich-text-editor/formatter.d.ts +6 -0
  206. package/blazorGlobalSrc/rich-text-editor/formatter.js +10 -0
  207. package/blazorGlobalSrc/rich-text-editor/html-editor.d.ts +4 -0
  208. package/blazorGlobalSrc/rich-text-editor/html-editor.js +8 -0
  209. package/blazorGlobalSrc/rich-text-editor/image.d.ts +4 -0
  210. package/blazorGlobalSrc/rich-text-editor/image.js +8 -0
  211. package/blazorGlobalSrc/rich-text-editor/index.d.ts +9 -0
  212. package/blazorGlobalSrc/rich-text-editor/index.js +12 -0
  213. package/blazorGlobalSrc/rich-text-editor/link.d.ts +4 -0
  214. package/blazorGlobalSrc/rich-text-editor/link.js +8 -0
  215. package/blazorGlobalSrc/rich-text-editor/markdown-editor.d.ts +4 -0
  216. package/blazorGlobalSrc/rich-text-editor/markdown-editor.js +8 -0
  217. package/blazorGlobalSrc/rich-text-editor/models/default-locale.d.ts +25 -0
  218. package/blazorGlobalSrc/rich-text-editor/models/default-locale.js +391 -0
  219. package/blazorGlobalSrc/rich-text-editor/models/iframe-settings-model.d.ts +68 -0
  220. package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.d.ts +61 -0
  221. package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.js +60 -0
  222. package/blazorGlobalSrc/rich-text-editor/models/inline-mode-model.d.ts +24 -0
  223. package/blazorGlobalSrc/rich-text-editor/models/inline-mode.d.ts +20 -0
  224. package/blazorGlobalSrc/rich-text-editor/models/inline-mode.js +37 -0
  225. package/blazorGlobalSrc/rich-text-editor/models/items.d.ts +36 -0
  226. package/blazorGlobalSrc/rich-text-editor/models/items.js +1011 -0
  227. package/blazorGlobalSrc/rich-text-editor/models/models.d.ts +7 -0
  228. package/blazorGlobalSrc/rich-text-editor/models/models.js +4 -0
  229. package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings-model.d.ts +40 -0
  230. package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.d.ts +50 -0
  231. package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.js +143 -0
  232. package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings-model.d.ts +1130 -0
  233. package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.d.ts +992 -0
  234. package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.js +510 -0
  235. package/blazorGlobalSrc/rich-text-editor/models.d.ts +4 -0
  236. package/blazorGlobalSrc/rich-text-editor/models.js +4 -0
  237. package/blazorGlobalSrc/rich-text-editor/quick-toolbar.d.ts +4 -0
  238. package/blazorGlobalSrc/rich-text-editor/quick-toolbar.js +8 -0
  239. package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.d.ts +82 -0
  240. package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.js +886 -0
  241. package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.d.ts +65 -0
  242. package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.js +49 -0
  243. package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.d.ts +39 -0
  244. package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.js +111 -0
  245. package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.d.ts +33 -0
  246. package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.js +101 -0
  247. package/blazorGlobalSrc/rich-text-editor/renderer/image-module.d.ts +199 -0
  248. package/blazorGlobalSrc/rich-text-editor/renderer/image-module.js +2494 -0
  249. package/blazorGlobalSrc/rich-text-editor/renderer/link-module.d.ts +63 -0
  250. package/blazorGlobalSrc/rich-text-editor/renderer/link-module.js +596 -0
  251. package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.d.ts +65 -0
  252. package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.js +38 -0
  253. package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.d.ts +54 -0
  254. package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.js +35 -0
  255. package/blazorGlobalSrc/rich-text-editor/renderer/render.d.ts +46 -0
  256. package/blazorGlobalSrc/rich-text-editor/renderer/render.js +70 -0
  257. package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.d.ts +20 -0
  258. package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.js +224 -0
  259. package/blazorGlobalSrc/rich-text-editor/renderer/table-module.d.ts +155 -0
  260. package/blazorGlobalSrc/rich-text-editor/renderer/table-module.js +2206 -0
  261. package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.d.ts +131 -0
  262. package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.js +747 -0
  263. package/blazorGlobalSrc/rich-text-editor/renderer/video-module.d.ts +120 -0
  264. package/blazorGlobalSrc/rich-text-editor/renderer/video-module.js +1507 -0
  265. package/blazorGlobalSrc/rich-text-editor/renderer/view-source.d.ts +74 -0
  266. package/blazorGlobalSrc/rich-text-editor/renderer/view-source.js +225 -0
  267. package/blazorGlobalSrc/rich-text-editor/renderer.d.ts +17 -0
  268. package/blazorGlobalSrc/rich-text-editor/renderer.js +21 -0
  269. package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.d.ts +33 -0
  270. package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.js +29 -0
  271. package/blazorGlobalSrc/rich-text-editor/services/service-locator.d.ts +29 -0
  272. package/blazorGlobalSrc/rich-text-editor/services/service-locator.js +25 -0
  273. package/blazorGlobalSrc/rich-text-editor/services.d.ts +5 -0
  274. package/blazorGlobalSrc/rich-text-editor/services.js +9 -0
  275. package/blazorGlobalSrc/rich-text-editor/toolbar.d.ts +4 -0
  276. package/blazorGlobalSrc/rich-text-editor/toolbar.js +8 -0
  277. package/blazorGlobalSrc/rich-text-editor/video.d.ts +4 -0
  278. package/blazorGlobalSrc/rich-text-editor/video.js +8 -0
  279. package/blazorGlobalSrc/rich-text-editor.d.ts +4 -0
  280. package/blazorGlobalSrc/rich-text-editor.js +8 -0
  281. package/blazorGlobalSrc/selection/index.d.ts +4 -0
  282. package/blazorGlobalSrc/selection/index.js +8 -0
  283. package/blazorGlobalSrc/selection/selection.d.ts +244 -0
  284. package/blazorGlobalSrc/selection/selection.js +309 -0
  285. package/dist/ej2-richtexteditor.umd.min.js +1 -1
  286. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  287. package/dist/es6/ej2-richtexteditor.es2015.js +6 -4
  288. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  289. package/dist/es6/ej2-richtexteditor.es5.js +6 -4
  290. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  291. package/helpers/e2e/index.d.ts +1 -0
  292. package/helpers/e2e/index.js +8 -0
  293. package/helpers/e2e/rte-helper.d.ts +79 -0
  294. package/helpers/e2e/rte-helper.js +81 -0
  295. package/package.json +1 -1
  296. package/src/editor-manager/plugin/dom-tree.js +6 -4
  297. package/src/global.d.ts +1 -0
  298. package/styles/bds-lite.css +7 -17
  299. package/styles/bds.css +11 -22
  300. package/styles/bootstrap-dark-lite.css +3 -13
  301. package/styles/bootstrap-dark.css +3 -14
  302. package/styles/bootstrap-lite.css +3 -13
  303. package/styles/bootstrap.css +3 -14
  304. package/styles/bootstrap4-lite.css +3 -13
  305. package/styles/bootstrap4.css +3 -14
  306. package/styles/bootstrap5-dark-lite.css +3 -13
  307. package/styles/bootstrap5-dark.css +3 -14
  308. package/styles/bootstrap5-lite.css +3 -13
  309. package/styles/bootstrap5.3-lite.css +3 -13
  310. package/styles/bootstrap5.3.css +3 -14
  311. package/styles/bootstrap5.css +3 -14
  312. package/styles/fabric-dark-lite.css +3 -13
  313. package/styles/fabric-dark.css +3 -14
  314. package/styles/fabric-lite.css +3 -13
  315. package/styles/fabric.css +3 -14
  316. package/styles/fluent-dark-lite.css +3 -13
  317. package/styles/fluent-dark.css +3 -14
  318. package/styles/fluent-lite.css +3 -13
  319. package/styles/fluent.css +3 -14
  320. package/styles/fluent2-lite.css +3 -13
  321. package/styles/fluent2.css +3 -14
  322. package/styles/highcontrast-light-lite.css +3 -13
  323. package/styles/highcontrast-light.css +3 -14
  324. package/styles/highcontrast-lite.css +3 -13
  325. package/styles/highcontrast.css +3 -14
  326. package/styles/material-dark-lite.css +3 -13
  327. package/styles/material-dark.css +3 -14
  328. package/styles/material-lite.css +3 -13
  329. package/styles/material.css +3 -14
  330. package/styles/material3-dark-lite.css +3 -13
  331. package/styles/material3-dark.css +3 -14
  332. package/styles/material3-lite.css +3 -13
  333. package/styles/material3.css +3 -14
  334. package/styles/rich-text-editor/_bds-definition.scss +2 -2
  335. package/styles/rich-text-editor/_bigger.scss +0 -1
  336. package/styles/rich-text-editor/_layout.scss +0 -9
  337. package/styles/rich-text-editor/_theme.scss +3 -0
  338. package/styles/rich-text-editor/bds.css +11 -22
  339. package/styles/rich-text-editor/bootstrap-dark.css +3 -14
  340. package/styles/rich-text-editor/bootstrap.css +3 -14
  341. package/styles/rich-text-editor/bootstrap4.css +3 -14
  342. package/styles/rich-text-editor/bootstrap5-dark.css +3 -14
  343. package/styles/rich-text-editor/bootstrap5.3.css +3 -14
  344. package/styles/rich-text-editor/bootstrap5.css +3 -14
  345. package/styles/rich-text-editor/fabric-dark.css +3 -14
  346. package/styles/rich-text-editor/fabric.css +3 -14
  347. package/styles/rich-text-editor/fluent-dark.css +3 -14
  348. package/styles/rich-text-editor/fluent.css +3 -14
  349. package/styles/rich-text-editor/fluent2.css +3 -14
  350. package/styles/rich-text-editor/highcontrast-light.css +3 -14
  351. package/styles/rich-text-editor/highcontrast.css +3 -14
  352. package/styles/rich-text-editor/material-dark.css +3 -14
  353. package/styles/rich-text-editor/material.css +3 -14
  354. package/styles/rich-text-editor/material3-dark.css +3 -14
  355. package/styles/rich-text-editor/material3.css +3 -14
  356. package/styles/rich-text-editor/tailwind-dark.css +3 -14
  357. package/styles/rich-text-editor/tailwind.css +3 -14
  358. package/styles/rich-text-editor/tailwind3.css +3 -14
  359. package/styles/tailwind-dark-lite.css +3 -13
  360. package/styles/tailwind-dark.css +3 -14
  361. package/styles/tailwind-lite.css +3 -13
  362. package/styles/tailwind.css +3 -14
  363. package/styles/tailwind3-lite.css +3 -13
  364. package/styles/tailwind3.css +3 -14
  365. package/tslint.json +111 -0
@@ -0,0 +1,1071 @@
1
+ define(["require", "exports", "../base/constant", "@syncfusion/ej2-popups", "@syncfusion/ej2-buttons", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "../base/classes", "../base/classes", "../../common/config", "../../selection/selection", "./../../common/constant", "../base/enum", "@syncfusion/ej2-inputs", "../base/classes", "../base/util", "../../common/util"], function (require, exports, events, ej2_popups_1, ej2_buttons_1, ej2_base_1, ej2_base_2, classes_1, classes_2, config_1, selection_1, EVENTS, enum_1, ej2_inputs_1, classes, util_1, util_2) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var PasteCleanup = (function () {
5
+ function PasteCleanup(parent, serviceLocator) {
6
+ this.isNotFromHtml = false;
7
+ this.containsHtml = false;
8
+ this.cropImageData = [];
9
+ this.plainTextContent = '';
10
+ this.parent = parent;
11
+ this.locator = serviceLocator;
12
+ this.renderFactory = this.locator.getService('rendererFactory');
13
+ this.i10n = serviceLocator.getService('rteLocale');
14
+ this.dialogRenderObj = serviceLocator.getService('dialogRenderObject');
15
+ this.addEventListener();
16
+ this.isDestroyed = false;
17
+ }
18
+ PasteCleanup.prototype.addEventListener = function () {
19
+ this.nodeSelectionObj = new selection_1.NodeSelection(this.parent.inputElement);
20
+ if (this.parent.isDestroyed) {
21
+ return;
22
+ }
23
+ this.parent.on(events.pasteClean, this.pasteClean, this);
24
+ this.parent.on(events.bindCssClass, this.setCssClass, this);
25
+ this.parent.on(events.destroy, this.destroy, this);
26
+ this.parent.on(events.docClick, this.docClick, this);
27
+ };
28
+ PasteCleanup.prototype.destroy = function () {
29
+ if (this.isDestroyed) {
30
+ return;
31
+ }
32
+ if (this.fireFoxUploadTime) {
33
+ clearTimeout(this.fireFoxUploadTime);
34
+ this.fireFoxUploadTime = null;
35
+ }
36
+ if (this.refreshPopupTime) {
37
+ clearTimeout(this.refreshPopupTime);
38
+ this.refreshPopupTime = null;
39
+ }
40
+ if (this.popupCloseTime) {
41
+ clearTimeout(this.popupCloseTime);
42
+ this.popupCloseTime = null;
43
+ }
44
+ if (this.failureTime) {
45
+ clearTimeout(this.failureTime);
46
+ this.failureTime = null;
47
+ }
48
+ if (this.iframeUploadTime) {
49
+ clearTimeout(this.iframeUploadTime);
50
+ this.iframeUploadTime = null;
51
+ }
52
+ this.removeEventListener();
53
+ if (this.popupObj && !this.popupObj.isDestroyed) {
54
+ this.popupObj.destroy();
55
+ this.popupObj = null;
56
+ }
57
+ if (this.uploadObj && !this.uploadObj.isDestroyed) {
58
+ this.uploadObj.destroy();
59
+ this.uploadObj = null;
60
+ }
61
+ if (this.keepRadioButton && !this.keepRadioButton.isDestroyed) {
62
+ this.keepRadioButton.destroy();
63
+ this.keepRadioButton = null;
64
+ }
65
+ if (this.cleanRadioButton && !this.cleanRadioButton.isDestroyed) {
66
+ this.cleanRadioButton.destroy();
67
+ this.cleanRadioButton = null;
68
+ }
69
+ if (this.plainTextRadioButton && !this.plainTextRadioButton.isDestroyed) {
70
+ this.plainTextRadioButton.destroy();
71
+ this.plainTextRadioButton = null;
72
+ }
73
+ this.isDestroyed = true;
74
+ this.plainTextContent = '';
75
+ };
76
+ PasteCleanup.prototype.removeEventListener = function () {
77
+ this.parent.off(events.pasteClean, this.pasteClean);
78
+ this.parent.off(events.bindCssClass, this.setCssClass);
79
+ this.parent.off(events.destroy, this.destroy);
80
+ this.parent.off(events.docClick, this.docClick);
81
+ };
82
+ PasteCleanup.prototype.pasteClean = function (e) {
83
+ var _this = this;
84
+ var args = {
85
+ requestType: 'Paste',
86
+ editorMode: this.parent.editorMode,
87
+ event: e
88
+ };
89
+ var value = null;
90
+ var imageproperties;
91
+ var allowedTypes = this.parent.insertImageSettings.allowedTypes;
92
+ if (e.args && !ej2_base_1.isNullOrUndefined(e.args.clipboardData)) {
93
+ value = e.args.clipboardData.getData('text/html');
94
+ if (e.args.clipboardData.getData('text/plain')) {
95
+ this.plainTextContent = e.args.clipboardData.getData('text/plain');
96
+ }
97
+ }
98
+ if (e.args && value !== null && this.parent.editorMode === 'HTML') {
99
+ var file = void 0;
100
+ if (value.length === 0) {
101
+ var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i);
102
+ value = e.args.clipboardData.getData('text/plain');
103
+ this.parent.trigger(events.beforePasteCleanup, { value: value });
104
+ this.isNotFromHtml = value !== '' ? true : false;
105
+ value = value.replace(/</g, '&lt;');
106
+ value = value.replace(/>/g, '&gt;');
107
+ this.containsHtml = htmlRegex.test(value);
108
+ this.plainTextContent = value;
109
+ file = e && e.args.clipboardData &&
110
+ e.args.clipboardData.items.length > 0 ?
111
+ (e.args.clipboardData.items[0].getAsFile() === null ?
112
+ (!ej2_base_1.isNullOrUndefined(e.args.clipboardData.items[1]) ?
113
+ e.args.clipboardData.items[1].getAsFile() : null) :
114
+ e.args.clipboardData.items[0].getAsFile()) : null;
115
+ if (file) {
116
+ var fileNameParts = file.name;
117
+ var imgType_1 = fileNameParts.substring(fileNameParts.lastIndexOf('.'));
118
+ if (allowedTypes.every(function (type) { return type.toLowerCase() !== imgType_1; })) {
119
+ e.args.preventDefault();
120
+ return;
121
+ }
122
+ }
123
+ this.parent.notify(events.paste, {
124
+ file: file,
125
+ args: e.args,
126
+ text: value,
127
+ callBack: function (b) {
128
+ imageproperties = b;
129
+ if (typeof (imageproperties) === 'object') {
130
+ _this.parent.formatter.editorManager.execCommand('Images', 'Image', e.args, _this.imageFormatting.bind(_this, args), 'pasteCleanup', imageproperties, 'pasteCleanupModule');
131
+ }
132
+ else {
133
+ value = imageproperties;
134
+ }
135
+ }
136
+ });
137
+ if (!htmlRegex.test(value)) {
138
+ var divElement = this.parent.createElement('div');
139
+ divElement.innerHTML = this.splitBreakLine(value);
140
+ value = divElement.innerHTML;
141
+ }
142
+ }
143
+ else if (value.length > 0) {
144
+ this.parent.trigger(events.beforePasteCleanup, { value: value });
145
+ this.parent.formatter.editorManager.observer.notify(EVENTS.MS_WORD_CLEANUP, {
146
+ args: e.args,
147
+ text: e.text,
148
+ allowedStylePropertiesArray: this.parent.pasteCleanupSettings.allowedStyleProps,
149
+ callBack: function (a, cropImageData, pasteTableSource) {
150
+ args.pasteTableSource = pasteTableSource;
151
+ value = a.trim();
152
+ _this.cropImageData = cropImageData;
153
+ }
154
+ });
155
+ }
156
+ if (value !== null && value !== '') {
157
+ value = value.replace(/<base[^>]*>/g, '');
158
+ }
159
+ this.contentRenderer = this.renderFactory.getRenderer(enum_1.RenderType.Content);
160
+ var currentDocument = this.contentRenderer.getDocument();
161
+ var range = this.nodeSelectionObj.getRange(currentDocument);
162
+ this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
163
+ var tempDivElem = this.parent.createElement('div');
164
+ tempDivElem.innerHTML = value;
165
+ var unsupportedImg = tempDivElem.querySelectorAll('.e-rte-image-unsupported');
166
+ for (var index = 0; index < unsupportedImg.length; index++) {
167
+ unsupportedImg[index].setAttribute('alt', this.i10n.getConstant('unsupportedImage'));
168
+ unsupportedImg[index].classList.remove('e-rte-image-unsupported');
169
+ }
170
+ value = tempDivElem.innerHTML;
171
+ var isValueNotEmpty = tempDivElem.textContent !== '' || !ej2_base_1.isNullOrUndefined(tempDivElem.querySelector('img')) ||
172
+ !ej2_base_1.isNullOrUndefined(tempDivElem.querySelector('table'));
173
+ this.parent.notify(events.cleanupResizeElements, {
174
+ value: value,
175
+ callBack: function (currentValue) {
176
+ value = currentValue;
177
+ }
178
+ });
179
+ if (this.parent.pasteCleanupSettings.prompt && !e.isPlainPaste) {
180
+ if (isValueNotEmpty) {
181
+ e.args.preventDefault();
182
+ this.pasteDialog(value, args);
183
+ }
184
+ }
185
+ else if (this.parent.pasteCleanupSettings.plainText) {
186
+ e.args.preventDefault();
187
+ this.plainFormatting(value, args);
188
+ }
189
+ else if (this.parent.pasteCleanupSettings.keepFormat || e.isPlainPaste) {
190
+ e.args.preventDefault();
191
+ this.formatting(value, false, args);
192
+ }
193
+ else {
194
+ e.args.preventDefault();
195
+ this.formatting(value, true, args);
196
+ }
197
+ }
198
+ };
199
+ PasteCleanup.prototype.splitBreakLine = function (value) {
200
+ var enterSplitText = value.split('\r\n\r\n');
201
+ var finalText = '';
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>');
204
+ for (var i = 0; i < enterSplitText.length; i++) {
205
+ var content = enterSplitText[i];
206
+ var contentWithSpace = this.makeSpace(content);
207
+ var contentWithLineBreak = contentWithSpace.replace(/\r\n|\n/g, '<br>');
208
+ if (i === 0) {
209
+ if (this.parent.enterKey === 'BR' && !contentWithLineBreak.endsWith('<br>')) {
210
+ finalText += (contentWithLineBreak + endNode);
211
+ }
212
+ else {
213
+ finalText += contentWithLineBreak;
214
+ }
215
+ }
216
+ else {
217
+ if (this.parent.enterKey === 'BR') {
218
+ if (i === enterSplitText.length - 1) {
219
+ finalText += (contentWithLineBreak + endNode);
220
+ }
221
+ else {
222
+ finalText += (contentWithLineBreak + endNode + endNode);
223
+ }
224
+ }
225
+ else {
226
+ finalText += startNode + contentWithLineBreak + endNode;
227
+ }
228
+ }
229
+ }
230
+ return finalText;
231
+ };
232
+ PasteCleanup.prototype.makeSpace = function (text) {
233
+ var spacedContent = '';
234
+ if (text === '') {
235
+ return text;
236
+ }
237
+ var lineBreakSplitText = text.split(' ');
238
+ for (var i = 0; i < lineBreakSplitText.length; i++) {
239
+ var currentText = lineBreakSplitText[i];
240
+ if (currentText === '') {
241
+ spacedContent += '&nbsp;';
242
+ }
243
+ else if (currentText === '\t') {
244
+ spacedContent += '&nbsp;&nbsp;&nbsp;&nbsp;';
245
+ }
246
+ else {
247
+ if (i > 0 && i < lineBreakSplitText.length) {
248
+ spacedContent += ' ';
249
+ }
250
+ spacedContent += currentText;
251
+ }
252
+ }
253
+ spacedContent = spacedContent.replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;');
254
+ spacedContent = spacedContent.replace(/&nbsp;&nbsp;/g, '&nbsp; ');
255
+ return spacedContent;
256
+ };
257
+ PasteCleanup.prototype.imgUploading = function (elm) {
258
+ var allImgElm = elm.querySelectorAll('.pasteContent_Img');
259
+ if (this.parent.insertImageSettings.saveUrl && allImgElm.length > 0) {
260
+ var base64Src = [];
261
+ var imgName = [];
262
+ var uploadImg = [];
263
+ for (var i = 0; i < allImgElm.length; i++) {
264
+ if (!ej2_base_1.isNullOrUndefined(allImgElm[i].getAttribute('src')) &&
265
+ allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
266
+ base64Src.push(allImgElm[i].getAttribute('src'));
267
+ imgName.push(ej2_base_2.getUniqueID('rte_image'));
268
+ uploadImg.push(allImgElm[i]);
269
+ }
270
+ }
271
+ var fileList = [];
272
+ for (var i = 0; i < base64Src.length; i++) {
273
+ fileList.push(this.base64ToFile(base64Src[i], imgName[i]));
274
+ }
275
+ for (var i = 0; i < fileList.length; i++) {
276
+ this.uploadMethod(fileList[i], uploadImg[i]);
277
+ }
278
+ if (ej2_base_1.isNullOrUndefined(this.parent.insertImageSettings.path) &&
279
+ this.parent.insertImageSettings.saveFormat === 'Blob') {
280
+ this.getBlob(allImgElm);
281
+ }
282
+ }
283
+ else if (this.parent.insertImageSettings.saveFormat === 'Blob') {
284
+ this.getBlob(allImgElm);
285
+ }
286
+ var allImgElmId = elm.querySelectorAll('.pasteContent_Img');
287
+ for (var i = 0; i < allImgElmId.length; i++) {
288
+ allImgElmId[i].classList.remove('pasteContent_Img');
289
+ if (allImgElmId[i].getAttribute('class').trim() === '') {
290
+ allImgElm[i].removeAttribute('class');
291
+ }
292
+ }
293
+ };
294
+ PasteCleanup.prototype.getBlob = function (allImgElm) {
295
+ for (var i = 0; i < allImgElm.length; i++) {
296
+ if (!ej2_base_1.isNullOrUndefined(allImgElm[i].getAttribute('src')) &&
297
+ allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
298
+ var blopUrl = URL.createObjectURL(util_1.convertToBlob(allImgElm[i].getAttribute('src')));
299
+ allImgElm[i].setAttribute('src', blopUrl);
300
+ }
301
+ }
302
+ };
303
+ PasteCleanup.prototype.toolbarEnableDisable = function (state) {
304
+ if (!this.parent.inlineMode.enable) {
305
+ this.parent.toolbarModule.baseToolbar.toolbarObj.disable(state);
306
+ }
307
+ };
308
+ PasteCleanup.prototype.uploadMethod = function (file, imgElem) {
309
+ var _this = this;
310
+ imgElem.style.opacity = '0.5';
311
+ var popupEle = this.parent.createElement('div');
312
+ this.parent.rootContainer.appendChild(popupEle);
313
+ var contentEle = this.parent.createElement('input', {
314
+ id: this.parent.getID() + '_upload', attrs: { type: 'File', name: 'UploadFiles' }
315
+ });
316
+ this.popupObj = new ej2_popups_1.Popup(popupEle, {
317
+ relateTo: imgElem,
318
+ height: '85px',
319
+ width: '300px',
320
+ content: contentEle,
321
+ viewPortElement: this.parent.inputElement,
322
+ enableRtl: this.parent.enableRtl,
323
+ zIndex: 10001,
324
+ close: function (event) {
325
+ _this.parent.isBlur = false;
326
+ _this.popupObj.destroy();
327
+ ej2_base_1.detach(_this.popupObj.element);
328
+ }
329
+ });
330
+ this.popupObj.element.style.display = 'none';
331
+ ej2_base_1.addClass([this.popupObj.element], [classes.CLS_POPUP_OPEN, classes.CLS_RTE_UPLOAD_POPUP]);
332
+ if (!ej2_base_1.isNullOrUndefined(this.parent.cssClass)) {
333
+ ej2_base_1.addClass([this.popupObj.element], this.parent.cssClass.replace(/\s+/g, ' ').trim().split(' '));
334
+ }
335
+ var timeOut = file.size > 1000000 ? 300 : 100;
336
+ this.refreshPopupTime = setTimeout(function () {
337
+ _this.refreshPopup(imgElem, _this.popupObj);
338
+ }, timeOut);
339
+ this.uploadObj = new ej2_inputs_1.Uploader({
340
+ asyncSettings: {
341
+ saveUrl: this.parent.insertImageSettings.saveUrl,
342
+ removeUrl: this.parent.insertImageSettings.removeUrl
343
+ },
344
+ cssClass: classes.CLS_RTE_DIALOG_UPLOAD,
345
+ dropArea: this.parent.inputElement,
346
+ allowedExtensions: this.parent.insertImageSettings.allowedTypes.toString(),
347
+ success: function (e) {
348
+ _this.popupClose(_this.popupObj, _this.uploadObj, imgElem, e);
349
+ },
350
+ uploading: function (e) {
351
+ if (!_this.parent.isServerRendered) {
352
+ _this.parent.trigger(events.imageUploading, e, function (imageUploadingArgs) {
353
+ if (imageUploadingArgs.cancel) {
354
+ if (!ej2_base_1.isNullOrUndefined(imgElem)) {
355
+ ej2_base_1.detach(imgElem);
356
+ }
357
+ if (!ej2_base_1.isNullOrUndefined(_this.popupObj.element)) {
358
+ ej2_base_1.detach(_this.popupObj.element);
359
+ }
360
+ }
361
+ else {
362
+ _this.parent.inputElement.contentEditable = 'false';
363
+ }
364
+ });
365
+ }
366
+ },
367
+ beforeUpload: function (args) {
368
+ _this.parent.trigger(events.beforeImageUpload, args);
369
+ _this.toolbarEnableDisable(true);
370
+ },
371
+ failure: function (e) {
372
+ _this.failureTime = setTimeout(function () {
373
+ _this.uploadFailure(imgElem, _this.uploadObj, _this.popupObj, e);
374
+ }, 900);
375
+ },
376
+ canceling: function () {
377
+ _this.parent.inputElement.contentEditable = 'true';
378
+ if (imgElem.nextSibling.textContent === ' ') {
379
+ ej2_base_1.detach(imgElem.nextSibling);
380
+ }
381
+ ej2_base_1.detach(imgElem);
382
+ _this.popupObj.close();
383
+ },
384
+ selected: function (e) {
385
+ e.cancel = true;
386
+ },
387
+ removing: function () {
388
+ _this.parent.inputElement.contentEditable = 'true';
389
+ if (imgElem.nextSibling.textContent === ' ') {
390
+ ej2_base_1.detach(imgElem.nextSibling);
391
+ }
392
+ ej2_base_1.detach(imgElem);
393
+ _this.popupObj.close();
394
+ }
395
+ });
396
+ this.uploadObj.appendTo(this.popupObj.element.childNodes[0]);
397
+ var fileInfo = [{
398
+ name: file.name,
399
+ rawFile: file,
400
+ size: file.size,
401
+ type: file.type,
402
+ status: 'Ready to Upload',
403
+ validationMessages: { minSize: '', maxSize: '' },
404
+ statusCode: '1'
405
+ }];
406
+ this.uploadObj.createFileList(fileInfo);
407
+ this.uploadObj.upload(fileInfo);
408
+ this.popupObj.element.getElementsByClassName('e-file-select-wrap')[0].style.display = 'none';
409
+ ej2_base_1.detach(this.popupObj.element.querySelector('.e-rte-dialog-upload .e-file-select-wrap'));
410
+ };
411
+ PasteCleanup.prototype.uploadFailure = function (imgElem, uploadObj, popupObj, e) {
412
+ if (this.parent && this.parent.isDestroyed) {
413
+ return;
414
+ }
415
+ this.parent.inputElement.contentEditable = 'true';
416
+ ej2_base_1.detach(imgElem);
417
+ if (popupObj) {
418
+ this.parent.isBlur = false;
419
+ popupObj.destroy();
420
+ if (!ej2_base_1.isNullOrUndefined(popupObj.element)) {
421
+ ej2_base_1.detach(popupObj.element);
422
+ }
423
+ }
424
+ this.parent.trigger(events.imageUploadFailed, e);
425
+ if (uploadObj && document.body.contains(uploadObj.element)) {
426
+ uploadObj.destroy();
427
+ }
428
+ };
429
+ PasteCleanup.prototype.popupClose = function (popupObj, uploadObj, imgElem, e) {
430
+ var _this = this;
431
+ this.parent.inputElement.contentEditable = 'true';
432
+ e.element = imgElem;
433
+ e.detectImageSource = enum_1.ImageInputSource.Pasted;
434
+ var element = e.file;
435
+ if (element.statusCode === '2') {
436
+ this.parent.trigger(events.imageUploadSuccess, e, function (e) {
437
+ if (!ej2_base_1.isNullOrUndefined(_this.parent.insertImageSettings.path)) {
438
+ var url = _this.parent.insertImageSettings.path + e.file.name;
439
+ if (!_this.parent.inputElement.contains(imgElem) && imgElem.id) {
440
+ var imgHtmlElems = _this.parent.inputElement.querySelectorAll('#' + imgElem.id);
441
+ for (var i = 0; i < imgHtmlElems.length; i++) {
442
+ var imgHtmlElem = imgHtmlElems[i];
443
+ if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
444
+ imgHtmlElem.src = url;
445
+ imgHtmlElem.setAttribute('alt', e.file.name);
446
+ }
447
+ }
448
+ }
449
+ else {
450
+ imgElem.src = url;
451
+ imgElem.setAttribute('alt', e.file.name);
452
+ }
453
+ }
454
+ });
455
+ }
456
+ else if (element.statusCode === '5') {
457
+ this.parent.trigger(events.imageRemoving, e, function (e) {
458
+ if (!ej2_base_1.isNullOrUndefined(e.element.src)) {
459
+ e.element.src = '';
460
+ }
461
+ });
462
+ }
463
+ this.popupCloseTime = setTimeout(function () {
464
+ if (popupObj) {
465
+ _this.parent.isBlur = false;
466
+ popupObj.destroy();
467
+ if (!ej2_base_1.isNullOrUndefined(popupObj.element)) {
468
+ ej2_base_1.detach(popupObj.element);
469
+ }
470
+ }
471
+ if (!_this.parent.inputElement.contains(imgElem) && (imgElem.id || imgElem.alt)) {
472
+ var selector = imgElem.id ? "#" + imgElem.id : "[alt=\"" + imgElem.alt + "\"]";
473
+ if (selector) {
474
+ var imgHtmlElems = _this.parent.inputElement.querySelectorAll(selector);
475
+ for (var i = 0; i < imgHtmlElems.length; i++) {
476
+ var imgHtmlElem = imgHtmlElems[i];
477
+ if (imgHtmlElem && imgHtmlElem.style && imgHtmlElem.style.opacity === '0.5') {
478
+ imgHtmlElem.style.opacity = '1';
479
+ }
480
+ }
481
+ }
482
+ }
483
+ else {
484
+ imgElem.style.opacity = '1';
485
+ }
486
+ _this.toolbarEnableDisable(false);
487
+ if (uploadObj && document.body.contains(uploadObj.element)) {
488
+ uploadObj.destroy();
489
+ }
490
+ }, 1500);
491
+ };
492
+ PasteCleanup.prototype.refreshPopup = function (imageElement, popupObj) {
493
+ var imgPosition = this.parent.iframeSettings.enable ? this.parent.element.offsetTop +
494
+ imageElement.offsetTop : imageElement.offsetTop;
495
+ var rtePosition = this.parent.element.offsetTop + this.parent.element.offsetHeight;
496
+ if (imgPosition > rtePosition) {
497
+ popupObj.offsetY = this.parent.iframeSettings.enable ? -30 : -65;
498
+ popupObj.element.style.display = 'block';
499
+ }
500
+ else {
501
+ if (popupObj) {
502
+ popupObj.refreshPosition(imageElement);
503
+ popupObj.element.style.display = 'block';
504
+ }
505
+ }
506
+ };
507
+ PasteCleanup.prototype.base64ToFile = function (base64, filename) {
508
+ var baseStr = base64.split(',');
509
+ var typeStr = baseStr[0].match(/:(.*?);/)[1];
510
+ var extension = typeStr.split('/')[1];
511
+ var decodeStr = atob(baseStr[1]);
512
+ var strLen = decodeStr.length;
513
+ var decodeArr = new Uint8Array(strLen);
514
+ while (strLen--) {
515
+ decodeArr[strLen] = decodeStr.charCodeAt(strLen);
516
+ }
517
+ if (ej2_base_2.Browser.isIE || navigator.appVersion.indexOf('Edge') > -1) {
518
+ var blob = new Blob([decodeArr], { type: extension });
519
+ ej2_base_1.extend(blob, { name: filename + '.' + (!ej2_base_1.isNullOrUndefined(extension) ? extension : '') });
520
+ return blob;
521
+ }
522
+ else {
523
+ return new File([decodeArr], filename + '.' + (!ej2_base_1.isNullOrUndefined(extension) ? extension : ''), { type: extension });
524
+ }
525
+ };
526
+ PasteCleanup.prototype.imageFormatting = function (pasteArgs, imgElement) {
527
+ if (!ej2_base_1.isNullOrUndefined(imgElement.elements[0].getAttribute('src'))) {
528
+ imgElement.elements[0].classList.add('pasteContent_Img');
529
+ }
530
+ var imageElement = this.parent.createElement('span');
531
+ imageElement.appendChild(imgElement.elements[0]);
532
+ var imageValue = imageElement.innerHTML;
533
+ this.contentRenderer = this.renderFactory.getRenderer(enum_1.RenderType.Content);
534
+ var currentDocument = this.contentRenderer.getDocument();
535
+ var range = this.nodeSelectionObj.getRange(currentDocument);
536
+ this.saveSelection = this.nodeSelectionObj.save(range, currentDocument);
537
+ if (this.parent.pasteCleanupSettings.prompt) {
538
+ this.pasteDialog(imageValue, pasteArgs);
539
+ }
540
+ else if (this.parent.pasteCleanupSettings.plainText) {
541
+ this.plainFormatting(imageValue, pasteArgs);
542
+ }
543
+ else if (this.parent.pasteCleanupSettings.keepFormat) {
544
+ this.formatting(imageValue, false, pasteArgs);
545
+ }
546
+ else {
547
+ this.formatting(imageValue, true, pasteArgs);
548
+ }
549
+ };
550
+ PasteCleanup.prototype.radioRender = function () {
551
+ this.keepRadioButton = new ej2_buttons_1.RadioButton({ label: this.i10n.getConstant('keepFormat'),
552
+ name: 'pasteOption', checked: true });
553
+ this.keepRadioButton.isStringTemplate = true;
554
+ var keepFormatElement = this.parent.element.querySelector('#keepFormating');
555
+ this.keepRadioButton.appendTo(keepFormatElement);
556
+ this.cleanRadioButton = new ej2_buttons_1.RadioButton({ label: this.i10n.getConstant('cleanFormat'), name: 'pasteOption' });
557
+ this.cleanRadioButton.isStringTemplate = true;
558
+ var cleanFormatElement = this.parent.element.querySelector('#cleanFormat');
559
+ this.cleanRadioButton.appendTo(cleanFormatElement);
560
+ this.plainTextRadioButton = new ej2_buttons_1.RadioButton({ label: this.i10n.getConstant('plainText'), name: 'pasteOption' });
561
+ this.plainTextRadioButton.isStringTemplate = true;
562
+ var plainTextElement = this.parent.element.querySelector('#plainTextFormat');
563
+ this.plainTextRadioButton.appendTo(plainTextElement);
564
+ };
565
+ PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked) {
566
+ if (keepChecked) {
567
+ this.formatting(value, false, args);
568
+ }
569
+ else if (cleanChecked) {
570
+ this.formatting(value, true, args);
571
+ }
572
+ else {
573
+ this.plainFormatting(value, args);
574
+ }
575
+ };
576
+ PasteCleanup.prototype.pasteDialog = function (value, args) {
577
+ var _this = this;
578
+ var dialogModel = {
579
+ buttons: [
580
+ {
581
+ click: function () {
582
+ if (!_this.dialogObj.isDestroyed) {
583
+ var keepChecked = _this.parent.element.querySelector('#keepFormating').checked;
584
+ var cleanChecked = _this.parent.element.querySelector('#cleanFormat').checked;
585
+ _this.dialogObj.hide();
586
+ var argument = _this.dialogObj;
587
+ _this.dialogRenderObj.close(argument);
588
+ _this.dialogObj.destroy();
589
+ _this.selectFormatting(value, args, keepChecked, cleanChecked);
590
+ }
591
+ },
592
+ buttonModel: {
593
+ isPrimary: true,
594
+ cssClass: 'e-flat ' + classes_2.CLS_RTE_PASTE_OK,
595
+ content: this.i10n.getConstant('pasteDialogOk')
596
+ }
597
+ },
598
+ {
599
+ click: function () {
600
+ if (!_this.dialogObj.isDestroyed) {
601
+ _this.dialogObj.hide();
602
+ var args_1 = _this.dialogObj;
603
+ _this.dialogRenderObj.close(args_1);
604
+ _this.dialogObj.destroy();
605
+ }
606
+ },
607
+ buttonModel: {
608
+ cssClass: 'e-flat ' + classes_2.CLS_RTE_PASTE_CANCEL,
609
+ content: this.i10n.getConstant('pasteDialogCancel')
610
+ }
611
+ }
612
+ ],
613
+ header: this.i10n.getConstant('pasteFormat'),
614
+ content: this.i10n.getConstant('pasteFormatContent') + '<br/><div><div style="padding-top:24px;">' +
615
+ '<input type="radio" class="' + classes_1.CLS_RTE_PASTE_KEEP_FORMAT + '" id="keepFormating"/>' +
616
+ '</div><div style="padding-top:20px;"><input type="radio" class="' +
617
+ classes_1.CLS_RTE_PASTE_REMOVE_FORMAT + '" id="cleanFormat"/></div>' +
618
+ '<div style="padding-top:20px;"><input type="radio" class="' +
619
+ classes_1.CLS_RTE_PASTE_PLAIN_FORMAT + '" id="plainTextFormat"/></div></div>',
620
+ target: this.parent.element,
621
+ width: '300px',
622
+ height: '265px',
623
+ cssClass: classes_2.CLS_RTE_DIALOG_MIN_HEIGHT,
624
+ isModal: ej2_base_2.Browser.isDevice,
625
+ visible: false
626
+ };
627
+ this.dialogObj = this.dialogRenderObj.render(dialogModel);
628
+ var rteDialogWrapper = this.parent.element.querySelector('#' + this.parent.getID()
629
+ + '_pasteCleanupDialog');
630
+ if (rteDialogWrapper !== null && rteDialogWrapper.innerHTML !== '') {
631
+ this.destroyDialog(rteDialogWrapper);
632
+ }
633
+ if (rteDialogWrapper === null) {
634
+ rteDialogWrapper = this.parent.createElement('div', {
635
+ id: this.parent.getID() + '_pasteCleanupDialog'
636
+ });
637
+ this.parent.rootContainer.appendChild(rteDialogWrapper);
638
+ }
639
+ this.dialogObj.appendTo(rteDialogWrapper);
640
+ this.radioRender();
641
+ this.dialogObj.show();
642
+ this.setCssClass({ cssClass: this.parent.getCssClass() });
643
+ };
644
+ PasteCleanup.prototype.updateCss = function (currentObj, e) {
645
+ if (currentObj && e.cssClass) {
646
+ if (ej2_base_1.isNullOrUndefined(e.oldCssClass)) {
647
+ currentObj.setProperties({ cssClass: (currentObj.cssClass + ' ' + e.cssClass).trim() });
648
+ }
649
+ else {
650
+ currentObj.setProperties({ cssClass: (currentObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
651
+ }
652
+ }
653
+ };
654
+ PasteCleanup.prototype.setCssClass = function (e) {
655
+ if (this.popupObj && e.cssClass) {
656
+ if (ej2_base_1.isNullOrUndefined(e.oldCssClass)) {
657
+ ej2_base_1.addClass([this.popupObj.element], e.cssClass);
658
+ }
659
+ else {
660
+ ej2_base_1.removeClass([this.popupObj.element], e.oldCssClass);
661
+ ej2_base_1.addClass([this.popupObj.element], e.cssClass);
662
+ }
663
+ }
664
+ this.updateCss(this.dialogObj, e);
665
+ this.updateCss(this.uploadObj, e);
666
+ this.updateCss(this.plainTextRadioButton, e);
667
+ this.updateCss(this.cleanRadioButton, e);
668
+ this.updateCss(this.keepRadioButton, e);
669
+ };
670
+ PasteCleanup.prototype.destroyDialog = function (rteDialogWrapper) {
671
+ var rteDialogContainer = this.parent.element.querySelector('.e-rte-dialog-minheight');
672
+ ej2_base_1.detach(rteDialogContainer);
673
+ var rteDialogWrapperChildLength = rteDialogWrapper.children.length;
674
+ for (var i = 0; i < rteDialogWrapperChildLength; i++) {
675
+ ej2_base_1.detach(rteDialogWrapper.children[0]);
676
+ }
677
+ };
678
+ PasteCleanup.prototype.docClick = function (e) {
679
+ var target = e.args.target;
680
+ if (target && target.classList && ((this.dialogObj && !ej2_base_2.closest(target, '[id=' + '\'' + this.dialogObj.element.id + '\'' + ']')))
681
+ && (!target.classList.contains('e-toolbar-item'))) {
682
+ if (this.dialogObj) {
683
+ this.dialogObj.hide();
684
+ }
685
+ }
686
+ };
687
+ PasteCleanup.prototype.cleanAppleClass = function (elem) {
688
+ var appleClassElem = elem.querySelectorAll('br.Apple-interchange-newline');
689
+ for (var i = 0; i < appleClassElem.length; i++) {
690
+ ej2_base_1.detach(appleClassElem[i]);
691
+ }
692
+ return elem;
693
+ };
694
+ PasteCleanup.prototype.formatting = function (value, clean, args) {
695
+ var _this = this;
696
+ var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent', styles: 'display:inline;' });
697
+ if (this.isNotFromHtml && this.containsHtml) {
698
+ value = this.splitBreakLine(value);
699
+ }
700
+ clipBoardElem.innerHTML = value;
701
+ clipBoardElem = this.cleanAppleClass(clipBoardElem);
702
+ if (this.parent.pasteCleanupSettings.deniedTags !== null) {
703
+ clipBoardElem = this.deniedTags(clipBoardElem);
704
+ }
705
+ if (clean) {
706
+ clipBoardElem = this.deniedAttributes(clipBoardElem, clean);
707
+ }
708
+ else if (this.parent.pasteCleanupSettings.deniedAttrs !== null) {
709
+ clipBoardElem = this.deniedAttributes(clipBoardElem, clean);
710
+ }
711
+ if (this.parent.pasteCleanupSettings.allowedStyleProps !== null) {
712
+ clipBoardElem = this.allowedStyle(clipBoardElem);
713
+ }
714
+ this.saveSelection.restore();
715
+ var newText = clipBoardElem.innerHTML;
716
+ if (this.parent.enableHtmlSanitizer) {
717
+ newText = clipBoardElem.innerHTML.split('&').join('&amp;');
718
+ }
719
+ clipBoardElem.innerHTML = this.sanitizeHelper(newText);
720
+ var allImg = clipBoardElem.querySelectorAll('img');
721
+ for (var i = 0; i < allImg.length; i++) {
722
+ if (!ej2_base_1.isNullOrUndefined(allImg[i].getAttribute('src'))) {
723
+ allImg[i].classList.add('pasteContent_Img');
724
+ }
725
+ this.setImageProperties(allImg[i]);
726
+ }
727
+ this.addTempClass(clipBoardElem);
728
+ if (clipBoardElem.querySelectorAll('picture').length > 0) {
729
+ this.processPictureElement(clipBoardElem);
730
+ }
731
+ if (clipBoardElem.textContent !== '' || !ej2_base_1.isNullOrUndefined(clipBoardElem.querySelector('img')) ||
732
+ !ej2_base_1.isNullOrUndefined(clipBoardElem.querySelector('table'))) {
733
+ var tempWrapperElem = this.parent.createElement('div');
734
+ tempWrapperElem.innerHTML = value;
735
+ var filesData = [];
736
+ if (!ej2_base_1.isNullOrUndefined(tempWrapperElem.querySelector('img'))) {
737
+ var imgElem = tempWrapperElem.querySelectorAll('img');
738
+ var base64Src = [];
739
+ var imgName = [];
740
+ var uploadImg = [];
741
+ for (var i = 0; i < imgElem.length; i++) {
742
+ if (imgElem[i].getAttribute('src') &&
743
+ imgElem[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
744
+ base64Src.push(imgElem[i].getAttribute('src'));
745
+ imgName.push(ej2_base_2.getUniqueID('rte_image'));
746
+ uploadImg.push(imgElem[i]);
747
+ }
748
+ }
749
+ var fileList = [];
750
+ var currentData = void 0;
751
+ for (var i = 0; i < base64Src.length; i++) {
752
+ fileList.push(this.base64ToFile(base64Src[i], imgName[i]));
753
+ currentData = {
754
+ name: fileList[i].name, rawFile: fileList[i],
755
+ size: fileList[i].size, type: fileList[i].type,
756
+ status: '', validationMessages: { minSize: '', maxSize: '' }, statusCode: '1'
757
+ };
758
+ filesData.push(currentData);
759
+ }
760
+ }
761
+ this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: filesData }, function (updatedArgs) { value = updatedArgs.value; });
762
+ clipBoardElem.innerHTML = this.parent.addAnchorAriaLabel(value);
763
+ clipBoardElem = this.addTableClass(clipBoardElem, args.pasteTableSource);
764
+ this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
765
+ ej2_base_1.extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
766
+ _this.parent.formatter.onSuccess(_this.parent, args);
767
+ }, clipBoardElem, null, null, this.parent.enterKey);
768
+ this.parent.notify(events.autoResize, {});
769
+ util_2.scrollToCursor(this.parent.contentModule.getDocument(), this.parent.inputElement);
770
+ this.removeTempClass();
771
+ this.parent.notify(events.toolbarRefresh, {});
772
+ this.cropImageHandler(this.parent.inputElement);
773
+ }
774
+ };
775
+ PasteCleanup.prototype.convertBlobToBase64 = function (element) {
776
+ var imgElem = element.querySelectorAll('img');
777
+ var _loop_1 = function (i) {
778
+ if (imgElem[i].getAttribute('src') &&
779
+ imgElem[i].getAttribute('src').startsWith('blob')) {
780
+ var blobImageUrl = imgElem[i].getAttribute('src');
781
+ var img_1 = new Image();
782
+ var onImageLoadEvent_1 = function () {
783
+ var canvas = document.createElement('canvas');
784
+ var ctx = canvas.getContext('2d');
785
+ canvas.width = img_1.width;
786
+ canvas.height = img_1.height;
787
+ ctx.drawImage(img_1, 0, 0);
788
+ var base64String = canvas.toDataURL('image/png');
789
+ imgElem[i].src = base64String;
790
+ img_1.removeEventListener('load', onImageLoadEvent_1);
791
+ };
792
+ img_1.src = blobImageUrl;
793
+ img_1.addEventListener('load', onImageLoadEvent_1);
794
+ }
795
+ };
796
+ for (var i = 0; i < imgElem.length; i++) {
797
+ _loop_1(i);
798
+ }
799
+ };
800
+ PasteCleanup.prototype.cropImageHandler = function (element) {
801
+ var _this = this;
802
+ var allImgElm = element.querySelectorAll('.e-img-cropped');
803
+ if (allImgElm.length > 0) {
804
+ var _loop_2 = function (i) {
805
+ if (allImgElm[i].getAttribute('src').split(',')[0].indexOf('base64') >= 0) {
806
+ var image_1 = new Image();
807
+ image_1.src = allImgElm[i].getAttribute('src');
808
+ var canvas_1 = document.createElement('canvas');
809
+ var ctx_1 = canvas_1.getContext('2d');
810
+ image_1.onload = function () {
811
+ var wGoalWidth = _this.cropImageData[i].goalWidth / image_1.naturalWidth;
812
+ var hGoalHeight = _this.cropImageData[i].goalHeight / image_1.naturalHeight;
813
+ var cropLength = _this.cropImageData[i].cropLength / wGoalWidth;
814
+ var cropTop = _this.cropImageData[i].cropTop / hGoalHeight;
815
+ var cropWidth = (_this.cropImageData[i].goalWidth -
816
+ _this.cropImageData[i].cropLength -
817
+ _this.cropImageData[i].cropR) / wGoalWidth;
818
+ var cropHeight = (_this.cropImageData[i].goalHeight -
819
+ _this.cropImageData[i].cropTop -
820
+ _this.cropImageData[i].cropB) / hGoalHeight;
821
+ canvas_1.width = cropWidth;
822
+ canvas_1.height = cropHeight;
823
+ ctx_1.drawImage(image_1, cropLength, cropTop, cropWidth, cropHeight, 0, 0, cropWidth, cropHeight);
824
+ var croppedBase64 = canvas_1.toDataURL('image/png');
825
+ allImgElm[i].setAttribute('src', croppedBase64);
826
+ allImgElm[i].classList.remove('e-img-cropped');
827
+ _this.imgUploading(_this.parent.inputElement);
828
+ if (_this.parent.iframeSettings.enable) {
829
+ _this.parent.updateValue();
830
+ }
831
+ };
832
+ }
833
+ };
834
+ for (var i = 0; i < allImgElm.length; i++) {
835
+ _loop_2(i);
836
+ }
837
+ }
838
+ else {
839
+ if (!ej2_base_1.isNullOrUndefined(this.parent.insertImageSettings.saveUrl) && !ej2_base_1.isNullOrUndefined(this.parent.insertImageSettings.path) &&
840
+ this.parent.inputElement.querySelectorAll('img').length > 0 && this.parent.inputElement.querySelectorAll('img')[0].src.startsWith('blob')) {
841
+ this.convertBlobToBase64(this.parent.inputElement);
842
+ this.iframeUploadTime = setTimeout(function () {
843
+ _this.imgUploading(_this.parent.inputElement);
844
+ if (_this.parent.iframeSettings.enable) {
845
+ _this.parent.updateValue();
846
+ }
847
+ }, 20);
848
+ }
849
+ else {
850
+ this.imgUploading(this.parent.inputElement);
851
+ if (this.parent.iframeSettings.enable) {
852
+ this.parent.updateValue();
853
+ }
854
+ }
855
+ }
856
+ };
857
+ PasteCleanup.prototype.addTableClass = function (element, source) {
858
+ var tableElement = element.querySelectorAll('table');
859
+ for (var i = 0; i < tableElement.length; i++) {
860
+ var isMSTeamsTable = tableElement[i].parentElement.nodeName === 'FIGURE';
861
+ if (tableElement[i].classList.length > 0 && tableElement[i].classList.contains('e-rte-custom-table')) {
862
+ continue;
863
+ }
864
+ if (this.parent.pasteCleanupSettings.keepFormat && source && !isMSTeamsTable) {
865
+ tableElement[i].classList.add('e-rte-paste-' + source + '-table');
866
+ }
867
+ else if (!tableElement[i].classList.contains('e-rte-table')) {
868
+ tableElement[i].classList.add('e-rte-table');
869
+ }
870
+ if (ej2_base_1.isNullOrUndefined(tableElement[i].nextElementSibling) && tableElement[i].nextSibling &&
871
+ !tableElement[i].nextSibling.textContent.trim()) {
872
+ ej2_base_1.detach(tableElement[i].nextSibling);
873
+ }
874
+ }
875
+ return element;
876
+ };
877
+ PasteCleanup.prototype.setImageProperties = function (allImg) {
878
+ if (this.parent.insertImageSettings.width !== 'auto') {
879
+ allImg.setAttribute('width', this.parent.insertImageSettings.width);
880
+ }
881
+ if (this.parent.insertImageSettings.minWidth !== '0' && this.parent.insertImageSettings.minWidth !== 0) {
882
+ allImg.style.minWidth = this.parent.insertImageSettings.minWidth.toString();
883
+ }
884
+ if (this.parent.insertImageSettings.maxWidth !== null) {
885
+ allImg.style.maxWidth = this.parent.getInsertImgMaxWidth().toString();
886
+ }
887
+ if (this.parent.insertImageSettings.height !== 'auto') {
888
+ allImg.setAttribute('height', this.parent.insertImageSettings.height);
889
+ }
890
+ if (this.parent.insertImageSettings.minHeight !== '0' && this.parent.insertImageSettings.minHeight !== 0) {
891
+ allImg.style.minHeight = this.parent.insertImageSettings.minHeight.toString();
892
+ }
893
+ if (this.parent.insertImageSettings.maxHeight !== null) {
894
+ allImg.style.maxHeight = this.parent.insertImageSettings.maxHeight.toString();
895
+ }
896
+ };
897
+ PasteCleanup.prototype.addTempClass = function (clipBoardElem) {
898
+ var allChild = clipBoardElem.children;
899
+ for (var i = 0; i < allChild.length; i++) {
900
+ allChild[i].classList.add('pasteContent_RTE');
901
+ }
902
+ };
903
+ PasteCleanup.prototype.removeTempClass = function () {
904
+ var classElm = this.parent.inputElement.querySelectorAll('.pasteContent_RTE');
905
+ for (var i = 0; i < classElm.length; i++) {
906
+ classElm[i].classList.remove('pasteContent_RTE');
907
+ if (classElm[i].getAttribute('class') === '') {
908
+ classElm[i].removeAttribute('class');
909
+ }
910
+ }
911
+ };
912
+ PasteCleanup.prototype.sanitizeHelper = function (value) {
913
+ value = util_1.sanitizeHelper(value, this.parent);
914
+ return value;
915
+ };
916
+ PasteCleanup.prototype.plainFormatting = function (value, args) {
917
+ var _this = this;
918
+ var clipBoardElem = this.parent.createElement('div', { className: 'pasteContent' });
919
+ this.plainTextContent = this.plainTextContent.replace(/</g, '&lt;');
920
+ this.plainTextContent = this.plainTextContent.replace(/>/g, '&gt;');
921
+ var sanitizedContent = this.sanitizeHelper(this.plainTextContent);
922
+ var splitContent = this.splitBreakLine(sanitizedContent);
923
+ clipBoardElem.innerHTML = splitContent;
924
+ if (clipBoardElem.textContent.trim() !== '') {
925
+ this.saveSelection.restore();
926
+ this.parent.trigger(events.afterPasteCleanup, { value: clipBoardElem.innerHTML, filesData: null }, function (updatedArgs) { value = updatedArgs.value; });
927
+ clipBoardElem.innerHTML = value;
928
+ this.parent.formatter.editorManager.execCommand('inserthtml', 'pasteCleanup', args, function (returnArgs) {
929
+ ej2_base_1.extend(args, { elements: returnArgs.elements, imageElements: returnArgs.imgElem }, true);
930
+ _this.parent.formatter.onSuccess(_this.parent, args);
931
+ }, clipBoardElem, null, null, this.parent.enterKey);
932
+ this.removeTempClass();
933
+ }
934
+ else {
935
+ this.saveSelection.restore();
936
+ ej2_base_1.extend(args, { elements: [] }, true);
937
+ this.parent.formatter.onSuccess(this.parent, args);
938
+ }
939
+ };
940
+ PasteCleanup.prototype.tagGrouping = function (deniedTags) {
941
+ var groupingTags = deniedTags.slice();
942
+ var keys = Object.keys(config_1.pasteCleanupGroupingTags);
943
+ var values = keys.map(function (key) {
944
+ return config_1.pasteCleanupGroupingTags["" + key];
945
+ });
946
+ var addTags = [];
947
+ for (var i = 0; i < groupingTags.length; i++) {
948
+ if (groupingTags[i].split('[').length > 1) {
949
+ groupingTags[i] = groupingTags[i].split('[')[0].trim();
950
+ }
951
+ if (keys.indexOf(groupingTags[i]) > -1) {
952
+ for (var j = 0; j < values[keys.indexOf(groupingTags[i])].length; j++) {
953
+ if (groupingTags.indexOf(values[keys.indexOf(groupingTags[i])][j]) < 0 &&
954
+ addTags.indexOf(values[keys.indexOf(groupingTags[i])][j]) < 0) {
955
+ addTags.push(values[keys.indexOf(groupingTags[i])][j]);
956
+ }
957
+ }
958
+ }
959
+ }
960
+ return deniedTags = deniedTags.concat(addTags);
961
+ };
962
+ PasteCleanup.prototype.attributesfilter = function (deniedTags) {
963
+ for (var i = 0; i < deniedTags.length; i++) {
964
+ if (deniedTags[i].split('[').length > 1) {
965
+ var userAttributes = deniedTags[i].split('[')[1].split(']')[0].split(',');
966
+ var allowedAttributeArray = [];
967
+ var deniedAttributeArray = [];
968
+ for (var j = 0; j < userAttributes.length; j++) {
969
+ if (userAttributes[j].indexOf('!') < 0) {
970
+ allowedAttributeArray.push(userAttributes[j].trim());
971
+ }
972
+ else {
973
+ deniedAttributeArray.push(userAttributes[j].split('!')[1].trim());
974
+ }
975
+ }
976
+ var allowedAttribute = allowedAttributeArray.length > 1 ?
977
+ (allowedAttributeArray.join('][')) : (allowedAttributeArray.join());
978
+ var deniedAttribute = deniedAttributeArray.length > 1 ?
979
+ deniedAttributeArray.join('][') : (deniedAttributeArray.join());
980
+ if (deniedAttribute.length > 0) {
981
+ var select = allowedAttribute !== '' ? deniedTags[i].split('[')[0] +
982
+ '[' + allowedAttribute + ']' : deniedTags[i].split('[')[0];
983
+ deniedTags[i] = select + ':not([' + deniedAttribute + '])';
984
+ }
985
+ else {
986
+ deniedTags[i] = deniedTags[i].split('[')[0] + '[' + allowedAttribute + ']';
987
+ }
988
+ }
989
+ }
990
+ return deniedTags;
991
+ };
992
+ PasteCleanup.prototype.deniedTags = function (clipBoardElem) {
993
+ var deniedTags = ej2_base_1.isNullOrUndefined(this.parent.pasteCleanupSettings.deniedTags) ? [] : this.parent.pasteCleanupSettings.deniedTags.slice();
994
+ deniedTags = this.attributesfilter(deniedTags);
995
+ deniedTags = this.tagGrouping(deniedTags);
996
+ for (var i = 0; i < deniedTags.length; i++) {
997
+ var removableElement = clipBoardElem.querySelectorAll(deniedTags[i]);
998
+ for (var j = removableElement.length - 1; j >= 0; j--) {
999
+ var parentElem = removableElement[j].parentNode;
1000
+ while (removableElement[j].firstChild) {
1001
+ parentElem.insertBefore(removableElement[j].firstChild, removableElement[j]);
1002
+ }
1003
+ parentElem.removeChild(removableElement[j]);
1004
+ }
1005
+ }
1006
+ return clipBoardElem;
1007
+ };
1008
+ PasteCleanup.prototype.deniedAttributes = function (clipBoardElem, clean) {
1009
+ var deniedAttrs = ej2_base_1.isNullOrUndefined(this.parent.pasteCleanupSettings.deniedAttrs) ? [] : this.parent.pasteCleanupSettings.deniedAttrs.slice();
1010
+ if (clean) {
1011
+ deniedAttrs.push('style');
1012
+ }
1013
+ for (var i = 0; i < deniedAttrs.length; i++) {
1014
+ var removableAttrElement = clipBoardElem.
1015
+ querySelectorAll('[' + deniedAttrs[i] + ']');
1016
+ for (var j = 0; j < removableAttrElement.length; j++) {
1017
+ removableAttrElement[j].removeAttribute(deniedAttrs[i]);
1018
+ }
1019
+ }
1020
+ return clipBoardElem;
1021
+ };
1022
+ PasteCleanup.prototype.allowedStyle = function (clipBoardElem) {
1023
+ var allowedStyleProps = ej2_base_1.isNullOrUndefined(this.parent.pasteCleanupSettings.allowedStyleProps) ? [] : this.parent.pasteCleanupSettings.allowedStyleProps.slice();
1024
+ allowedStyleProps.push('list-style-type', 'list-style');
1025
+ var styleElement = clipBoardElem.querySelectorAll('[style]');
1026
+ for (var i = 0; i < styleElement.length; i++) {
1027
+ var allowedStyleValue = '';
1028
+ var allowedStyleValueArray = [];
1029
+ var styleValue = styleElement[i].getAttribute('style').split(';');
1030
+ for (var k = 0; k < styleValue.length; k++) {
1031
+ if (allowedStyleProps.indexOf(styleValue[k].split(':')[0].trim()) >= 0) {
1032
+ allowedStyleValueArray.push(styleValue[k]);
1033
+ }
1034
+ }
1035
+ styleElement[i].removeAttribute('style');
1036
+ allowedStyleValue = allowedStyleValueArray.join(';').trim() === '' ?
1037
+ allowedStyleValueArray.join(';') : allowedStyleValueArray.join(';') + ';';
1038
+ if (allowedStyleValue) {
1039
+ styleElement[i].style.cssText += allowedStyleValue;
1040
+ }
1041
+ }
1042
+ return clipBoardElem;
1043
+ };
1044
+ PasteCleanup.prototype.processPictureElement = function (clipBoardElem) {
1045
+ var pictureElems = clipBoardElem.querySelectorAll('picture');
1046
+ var base = this.parent.contentModule.getDocument().baseURI;
1047
+ for (var i = 0; i < pictureElems.length; i++) {
1048
+ var imgElem = pictureElems[i].querySelector('img');
1049
+ var sourceElems = pictureElems[i].querySelectorAll('source');
1050
+ if (imgElem && imgElem.getAttribute('src')) {
1051
+ var srcValue = imgElem.getAttribute('src');
1052
+ var url = srcValue.indexOf('http') > -1 ? new URL(srcValue) : new URL(srcValue, base);
1053
+ for (var j = 0; j < sourceElems.length; j++) {
1054
+ var srcset = sourceElems[j].getAttribute('srcset');
1055
+ if (srcset) {
1056
+ if (srcset.indexOf('http') === -1) {
1057
+ var fullPath = url.origin + srcset;
1058
+ sourceElems[j].setAttribute('srcset', fullPath);
1059
+ }
1060
+ }
1061
+ }
1062
+ }
1063
+ }
1064
+ };
1065
+ PasteCleanup.prototype.getModuleName = function () {
1066
+ return 'pasteCleanup';
1067
+ };
1068
+ return PasteCleanup;
1069
+ }());
1070
+ exports.PasteCleanup = PasteCleanup;
1071
+ });