@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,244 @@
1
+ import { ImageOrTableCursor } from '../common';
2
+ /**
3
+ * `Selection` module is used to handle RTE Selections.
4
+ */
5
+ export declare class NodeSelection {
6
+ range: Range;
7
+ rootNode: Node;
8
+ body: HTMLBodyElement;
9
+ html: string;
10
+ startContainer: number[];
11
+ endContainer: number[];
12
+ startOffset: number;
13
+ endOffset: number;
14
+ startNodeName: string[];
15
+ endNodeName: string[];
16
+ editableElement: HTMLElement | HTMLBodyElement;
17
+ constructor(editElement?: HTMLElement | HTMLBodyElement);
18
+ private saveInstance;
19
+ private documentFromRange;
20
+ getRange(docElement: Document): Range;
21
+ /**
22
+ * get method
23
+ *
24
+ * @param {Document} docElement - specifies the get function
25
+ * @returns {void}
26
+ * @hidden
27
+ * @deprecated
28
+ */
29
+ get(docElement: Document): Selection;
30
+ /**
31
+ * save method
32
+ *
33
+ * @param {Range} range - range value.
34
+ * @param {Document} docElement - specifies the document.
35
+ * @returns {void}
36
+ * @hidden
37
+ * @deprecated
38
+ */
39
+ save(range: Range, docElement: Document): NodeSelection;
40
+ /**
41
+ * getIndex method
42
+ *
43
+ * @param {Node} node - specifies the node value.
44
+ * @returns {void}
45
+ * @hidden
46
+ * @deprecated
47
+ */
48
+ getIndex(node: Node): number;
49
+ private isChildNode;
50
+ private getNode;
51
+ /**
52
+ * getNodeCollection method
53
+ *
54
+ * @param {Range} range -specifies the range.
55
+ * @returns {void}
56
+ * @hidden
57
+ * @deprecated
58
+ */
59
+ getNodeCollection(range: Range): Node[];
60
+ /**
61
+ * getParentNodeCollection method
62
+ *
63
+ * @param {Range} range - specifies the range value.
64
+ * @returns {void}
65
+ * @hidden
66
+ * @deprecated
67
+ */
68
+ getParentNodeCollection(range: Range): Node[];
69
+ /**
70
+ * getParentNodes method
71
+ *
72
+ * @param {Node[]} nodeCollection - specifies the collection of nodes.
73
+ * @param {Range} range - specifies the range values.
74
+ * @returns {void}
75
+ * @hidden
76
+ * @deprecated
77
+ */
78
+ getParentNodes(nodeCollection: Node[], range: Range): Node[];
79
+ /**
80
+ * getSelectionNodeCollection method
81
+ *
82
+ * @param {Range} range - specifies the range value.
83
+ * @returns {void}
84
+ * @hidden
85
+ * @deprecated
86
+ */
87
+ getSelectionNodeCollection(range: Range): Node[];
88
+ /**
89
+ * getSelectionNodeCollection along with BR node method
90
+ *
91
+ * @param {Range} range - specifies the range value.
92
+ * @returns {void}
93
+ * @hidden
94
+ * @deprecated
95
+ */
96
+ getSelectionNodeCollectionBr(range: Range): Node[];
97
+ /**
98
+ * getParentNodes method
99
+ *
100
+ * @param {Node[]} nodeCollection - specifies the collection of nodes.
101
+ * @returns {void}
102
+ * @hidden
103
+ * @deprecated
104
+ */
105
+ getSelectionNodes(nodeCollection: Node[]): Node[];
106
+ /**
107
+ * Get selection text nodes with br method.
108
+ *
109
+ * @param {Node[]} nodeCollection - specifies the collection of nodes.
110
+ * @returns {void}
111
+ * @hidden
112
+ * @deprecated
113
+ */
114
+ getSelectionNodesBr(nodeCollection: Node[]): Node[];
115
+ /**
116
+ * getInsertNodeCollection method
117
+ *
118
+ * @param {Range} range - specifies the range value.
119
+ * @returns {void}
120
+ * @hidden
121
+ * @deprecated
122
+ */
123
+ getInsertNodeCollection(range: Range): Node[];
124
+ /**
125
+ * getInsertNodes method
126
+ *
127
+ * @param {Node[]} nodeCollection - specifies the collection of nodes.
128
+ * @returns {void}
129
+ * @hidden
130
+ * @deprecated
131
+ */
132
+ getInsertNodes(nodeCollection: Node[]): Node[];
133
+ /**
134
+ * getNodeArray method
135
+ *
136
+ * @param {Node} node - specifies the node content.
137
+ * @param {boolean} isStart - specifies the boolean value.
138
+ * @param {Document} root - specifies the root document.
139
+ * @returns {void}
140
+ * @hidden
141
+ * @deprecated
142
+ */
143
+ getNodeArray(node: Node, isStart: boolean, root?: Document): number[];
144
+ private setRangePoint;
145
+ /**
146
+ * restore method
147
+ *
148
+ * @returns {void}
149
+ * @hidden
150
+ * @deprecated
151
+ */
152
+ restore(): Range;
153
+ selectRange(docElement: Document, range: Range): void;
154
+ /**
155
+ * setRange method
156
+ *
157
+ * @param {Document} docElement - specifies the document.
158
+ * @param {Range} range - specifies the range.
159
+ * @returns {void}
160
+ * @hidden
161
+ * @deprecated
162
+ */
163
+ setRange(docElement: Document, range: Range): void;
164
+ /**
165
+ * setSelectionText method
166
+ *
167
+ * @param {Document} docElement - specifies the documrent
168
+ * @param {Node} startNode - specifies the starting node.
169
+ * @param {Node} endNode - specifies the the end node.
170
+ * @param {number} startIndex - specifies the starting index.
171
+ * @param {number} endIndex - specifies the end index.
172
+ * @returns {void}
173
+ * @hidden
174
+ * @deprecated
175
+ */
176
+ setSelectionText(docElement: Document, startNode: Node, endNode: Node, startIndex: number, endIndex: number): void;
177
+ /**
178
+ * setSelectionContents method
179
+ *
180
+ * @param {Document} docElement - specifies the document.
181
+ * @param {Node} element - specifies the node.
182
+ * @returns {void}
183
+ * @hidden
184
+ * @deprecated
185
+ */
186
+ setSelectionContents(docElement: Document, element: Node): void;
187
+ /**
188
+ * setSelectionNode method
189
+ *
190
+ * @param {Document} docElement - specifies the document.
191
+ * @param {Node} element - specifies the node.
192
+ * @returns {void}
193
+ * @hidden
194
+ * @deprecated
195
+ */
196
+ setSelectionNode(docElement: Document, element: Node): void;
197
+ /**
198
+ * getSelectedNodes method
199
+ *
200
+ * @param {Document} docElement - specifies the document.
201
+ * @returns {void}
202
+ * @hidden
203
+ * @deprecated
204
+ */
205
+ getSelectedNodes(docElement: Document): Node[];
206
+ /**
207
+ * Clear method
208
+ *
209
+ * @param {Document} docElement - specifies the document.
210
+ * @returns {void}
211
+ * @hidden
212
+ * @deprecated
213
+ */
214
+ Clear(docElement: Document): void;
215
+ /**
216
+ * insertParentNode method
217
+ *
218
+ * @param {Document} docElement - specifies the document.
219
+ * @param {Node} newNode - specicfies the new node.
220
+ * @param {Range} range - specifies the range.
221
+ * @returns {void}
222
+ * @hidden
223
+ * @deprecated
224
+ */
225
+ insertParentNode(docElement: Document, newNode: Node, range: Range): void;
226
+ /**
227
+ * setCursorPoint method
228
+ *
229
+ * @param {Document} docElement - specifies the document.
230
+ * @param {Element} element - specifies the element.
231
+ * @param {number} point - specifies the point.
232
+ * @returns {void}
233
+ * @hidden
234
+ * @deprecated
235
+ */
236
+ setCursorPoint(docElement: Document, element: Element, point: number): void;
237
+ private isTableOrImageStart;
238
+ private isTableOrImageEnd;
239
+ processedTableImageCursor(range: Range): ImageOrTableCursor;
240
+ findLastTextPosition(element: Node): {
241
+ node: Node;
242
+ offset: number;
243
+ } | null;
244
+ }
@@ -0,0 +1,309 @@
1
+ define(["require", "exports", "@syncfusion/ej2-base", "./../editor-manager/base"], function (require, exports, ej2_base_1, CONSTANT) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var NodeSelection = (function () {
5
+ function NodeSelection(editElement) {
6
+ this.startNodeName = [];
7
+ this.endNodeName = [];
8
+ this.editableElement = editElement;
9
+ }
10
+ NodeSelection.prototype.saveInstance = function (range, body) {
11
+ this.range = range.cloneRange();
12
+ this.rootNode = this.documentFromRange(range);
13
+ this.body = body;
14
+ this.startContainer = this.getNodeArray(range.startContainer, true);
15
+ this.endContainer = this.getNodeArray(range.endContainer, false);
16
+ this.startOffset = range.startOffset;
17
+ this.endOffset = range.endOffset;
18
+ this.html = this.body.innerHTML;
19
+ return this;
20
+ };
21
+ NodeSelection.prototype.documentFromRange = function (range) {
22
+ return (9 === range.startContainer.nodeType) ? range.startContainer : range.startContainer.ownerDocument;
23
+ };
24
+ NodeSelection.prototype.getRange = function (docElement) {
25
+ var select = this.get(docElement);
26
+ var range = select && select.rangeCount > 0 ? select.getRangeAt(select.rangeCount - 1) : docElement.createRange();
27
+ return (range.startContainer !== docElement || range.endContainer !== docElement
28
+ || range.startOffset || range.endOffset || (range.setStart(docElement.body, 0),
29
+ range.collapse(!0)),
30
+ range);
31
+ };
32
+ NodeSelection.prototype.get = function (docElement) {
33
+ return docElement.defaultView.getSelection();
34
+ };
35
+ NodeSelection.prototype.save = function (range, docElement) {
36
+ range = (range) ? range.cloneRange() : this.getRange(docElement);
37
+ return this.saveInstance(range, docElement.body);
38
+ };
39
+ NodeSelection.prototype.getIndex = function (node) {
40
+ var index;
41
+ var num = 0;
42
+ node = !node.previousSibling && node.tagName === 'BR' ? node : node.previousSibling;
43
+ if (node) {
44
+ for (var type = node.nodeType; node; null) {
45
+ index = node.nodeType;
46
+ num++;
47
+ type = index;
48
+ node = node.previousSibling;
49
+ }
50
+ }
51
+ return num;
52
+ };
53
+ NodeSelection.prototype.isChildNode = function (nodeCollection, parentNode) {
54
+ for (var index = 0; index < parentNode.childNodes.length; index++) {
55
+ if (nodeCollection.indexOf(parentNode.childNodes[index]) > -1) {
56
+ return true;
57
+ }
58
+ }
59
+ return false;
60
+ };
61
+ NodeSelection.prototype.getNode = function (startNode, endNode, nodeCollection) {
62
+ if (this.editableElement && (!this.editableElement.contains(startNode) || this.editableElement === startNode)) {
63
+ return null;
64
+ }
65
+ if (endNode === startNode &&
66
+ (startNode.nodeType === 3 || !startNode.firstChild || nodeCollection.indexOf(startNode.firstChild) !== -1
67
+ || this.isChildNode(nodeCollection, startNode))) {
68
+ return null;
69
+ }
70
+ if (startNode.nodeType === 3 && startNode.previousSibling === endNode && endNode.nodeName === 'IMG') {
71
+ return null;
72
+ }
73
+ if (nodeCollection.indexOf(startNode.firstChild) === -1 && startNode.firstChild && !this.isChildNode(nodeCollection, startNode)) {
74
+ return startNode.firstChild;
75
+ }
76
+ if (startNode.nextSibling) {
77
+ return startNode.nextSibling;
78
+ }
79
+ if (!startNode.parentNode) {
80
+ return null;
81
+ }
82
+ else {
83
+ return startNode.parentNode;
84
+ }
85
+ };
86
+ NodeSelection.prototype.getNodeCollection = function (range) {
87
+ var startNode = range.startContainer.childNodes[range.startOffset]
88
+ || range.startContainer;
89
+ var endNode = range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
90
+ || range.endContainer;
91
+ var tableCursor = this.processedTableImageCursor(range);
92
+ if (tableCursor.start || tableCursor.end) {
93
+ if (tableCursor.startName === 'TABLE' || tableCursor.endName === 'TABLE') {
94
+ var tableNode = tableCursor.start ? tableCursor.startNode : tableCursor.endNode;
95
+ return [tableNode];
96
+ }
97
+ }
98
+ if ((startNode === endNode || (startNode.nodeName === 'BR' && startNode === range.endContainer.childNodes[range.endOffset])) &&
99
+ startNode.childNodes.length === 0) {
100
+ return [startNode];
101
+ }
102
+ if (range.startOffset === range.endOffset && range.startOffset !== 0 && range.startContainer.nodeName === 'PRE') {
103
+ return [startNode.nodeName === 'BR' || startNode.nodeName === '#text' ? startNode : startNode.childNodes[0]];
104
+ }
105
+ var nodeCollection = [];
106
+ do {
107
+ if (nodeCollection.indexOf(startNode) === -1) {
108
+ nodeCollection.push(startNode);
109
+ }
110
+ startNode = this.getNode(startNode, endNode, nodeCollection);
111
+ } while (startNode);
112
+ return nodeCollection;
113
+ };
114
+ NodeSelection.prototype.getParentNodeCollection = function (range) {
115
+ return this.getParentNodes(this.getNodeCollection(range), range);
116
+ };
117
+ NodeSelection.prototype.getParentNodes = function (nodeCollection, range) {
118
+ nodeCollection = nodeCollection.reverse();
119
+ for (var index = 0; index < nodeCollection.length; index++) {
120
+ if ((nodeCollection.indexOf(nodeCollection[index].parentNode) !== -1)
121
+ || (nodeCollection[index].nodeType === 3 &&
122
+ range.startContainer !== range.endContainer &&
123
+ range.startContainer.parentNode !== range.endContainer.parentNode) &&
124
+ range.startContainer.parentNode.tagName && range.endContainer.parentNode.tagName &&
125
+ CONSTANT.BLOCK_TAGS.indexOf(range.startContainer.parentNode.tagName.toLowerCase()) !== -1
126
+ && CONSTANT.BLOCK_TAGS.indexOf(range.endContainer.parentNode.tagName.toLowerCase()) !== -1) {
127
+ nodeCollection.splice(index, 1);
128
+ index--;
129
+ }
130
+ else if (nodeCollection[index].nodeType === 3) {
131
+ nodeCollection[index] = nodeCollection[index].parentNode;
132
+ }
133
+ }
134
+ return nodeCollection;
135
+ };
136
+ NodeSelection.prototype.getSelectionNodeCollection = function (range) {
137
+ return this.getSelectionNodes(this.getNodeCollection(range));
138
+ };
139
+ NodeSelection.prototype.getSelectionNodeCollectionBr = function (range) {
140
+ return this.getSelectionNodesBr(this.getNodeCollection(range));
141
+ };
142
+ NodeSelection.prototype.getSelectionNodes = function (nodeCollection) {
143
+ nodeCollection = nodeCollection.reverse();
144
+ var regEx = new RegExp('\u200B', 'g');
145
+ for (var index = 0; index < nodeCollection.length; index++) {
146
+ if (nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === '' ||
147
+ (nodeCollection[index].textContent.length === 1 && nodeCollection[index].textContent.match(regEx)))) {
148
+ nodeCollection.splice(index, 1);
149
+ index--;
150
+ }
151
+ }
152
+ return nodeCollection.reverse();
153
+ };
154
+ NodeSelection.prototype.getSelectionNodesBr = function (nodeCollection) {
155
+ nodeCollection = nodeCollection.reverse();
156
+ for (var index = 0; index < nodeCollection.length; index++) {
157
+ if (nodeCollection[index].nodeName !== 'BR' &&
158
+ (nodeCollection[index].nodeType !== 3 || (nodeCollection[index].textContent.trim() === ''))) {
159
+ nodeCollection.splice(index, 1);
160
+ index--;
161
+ }
162
+ }
163
+ return nodeCollection.reverse();
164
+ };
165
+ NodeSelection.prototype.getInsertNodeCollection = function (range) {
166
+ return this.getInsertNodes(this.getNodeCollection(range));
167
+ };
168
+ NodeSelection.prototype.getInsertNodes = function (nodeCollection) {
169
+ nodeCollection = nodeCollection.reverse();
170
+ for (var index = 0; index < nodeCollection.length; index++) {
171
+ if ((nodeCollection[index].childNodes.length !== 0 &&
172
+ nodeCollection[index].nodeType !== 3) ||
173
+ (nodeCollection[index].nodeType === 3 &&
174
+ nodeCollection[index].textContent === '')) {
175
+ nodeCollection.splice(index, 1);
176
+ index--;
177
+ }
178
+ }
179
+ return nodeCollection.reverse();
180
+ };
181
+ NodeSelection.prototype.getNodeArray = function (node, isStart, root) {
182
+ var array = [];
183
+ ((isStart) ? (this.startNodeName = []) : (this.endNodeName = []));
184
+ for (; node !== (root ? root : this.rootNode); null) {
185
+ if (ej2_base_1.isNullOrUndefined(node)) {
186
+ break;
187
+ }
188
+ (isStart) ? this.startNodeName.push(node.nodeName.toLowerCase()) : this.endNodeName.push(node.nodeName.toLowerCase());
189
+ array.push(this.getIndex(node));
190
+ node = node.parentNode;
191
+ }
192
+ return array;
193
+ };
194
+ NodeSelection.prototype.setRangePoint = function (range, isvalid, num, size) {
195
+ var node = this.rootNode;
196
+ var index = num.length;
197
+ var constant = size;
198
+ for (; index--; null) {
199
+ node = node && node.childNodes[num[index]];
200
+ }
201
+ if (node && constant >= 0 && node.nodeName !== 'html') {
202
+ if (node.nodeType === 3 && node.nodeValue.replace(/\u00a0/g, '&nbsp;') === '&nbsp;') {
203
+ constant = node.textContent.length;
204
+ }
205
+ range[isvalid ? 'setStart' : 'setEnd'](node, constant);
206
+ }
207
+ return range;
208
+ };
209
+ NodeSelection.prototype.restore = function () {
210
+ var range = this.range.cloneRange();
211
+ range = this.setRangePoint(range, true, this.startContainer, this.startOffset);
212
+ range = this.setRangePoint(range, false, this.endContainer, this.endOffset);
213
+ this.selectRange(this.rootNode, range);
214
+ return range;
215
+ };
216
+ NodeSelection.prototype.selectRange = function (docElement, range) {
217
+ this.setRange(docElement, range);
218
+ this.save(range, docElement);
219
+ };
220
+ NodeSelection.prototype.setRange = function (docElement, range) {
221
+ var selection = this.get(docElement);
222
+ selection.removeAllRanges();
223
+ selection.addRange(range);
224
+ };
225
+ NodeSelection.prototype.setSelectionText = function (docElement, startNode, endNode, startIndex, endIndex) {
226
+ var range = docElement.createRange();
227
+ range.setStart(startNode, startIndex);
228
+ range.setEnd(endNode, endIndex);
229
+ this.setRange(docElement, range);
230
+ };
231
+ NodeSelection.prototype.setSelectionContents = function (docElement, element) {
232
+ var range = docElement.createRange();
233
+ range.selectNode(element);
234
+ this.setRange(docElement, range);
235
+ };
236
+ NodeSelection.prototype.setSelectionNode = function (docElement, element) {
237
+ var range = docElement.createRange();
238
+ range.selectNodeContents(element);
239
+ this.setRange(docElement, range);
240
+ };
241
+ NodeSelection.prototype.getSelectedNodes = function (docElement) {
242
+ return this.getNodeCollection(this.getRange(docElement));
243
+ };
244
+ NodeSelection.prototype.Clear = function (docElement) {
245
+ this.get(docElement).removeAllRanges();
246
+ };
247
+ NodeSelection.prototype.insertParentNode = function (docElement, newNode, range) {
248
+ range.surroundContents(newNode);
249
+ this.selectRange(docElement, range);
250
+ };
251
+ NodeSelection.prototype.setCursorPoint = function (docElement, element, point) {
252
+ var range = docElement.createRange();
253
+ var selection = docElement.defaultView.getSelection();
254
+ range.setStart(element, point);
255
+ range.collapse(true);
256
+ selection.removeAllRanges();
257
+ selection.addRange(range);
258
+ };
259
+ NodeSelection.prototype.isTableOrImageStart = function (range) {
260
+ var customHandlerElements = ['TABLE'];
261
+ var startContainer = range.startContainer;
262
+ var startOffset = range.startOffset;
263
+ var startNode = startContainer.childNodes[startOffset];
264
+ var isCursorAtStart = range.collapsed && (startContainer.nodeType === 1) &&
265
+ startContainer.isContentEditable && startNode &&
266
+ (customHandlerElements.indexOf(startNode.nodeName) > -1);
267
+ if (isCursorAtStart) {
268
+ return { start: isCursorAtStart, startNodeName: startNode.nodeName, startNode: startNode };
269
+ }
270
+ else {
271
+ return { start: false, startNodeName: '', startNode: undefined };
272
+ }
273
+ };
274
+ NodeSelection.prototype.isTableOrImageEnd = function (range) {
275
+ var customHandlerElements = ['TABLE'];
276
+ var startContainer = range.startContainer;
277
+ var startOffset = range.startOffset;
278
+ var endNode = startContainer.childNodes[startOffset - 1];
279
+ var isCursorAtEnd = range.collapsed && (startContainer.nodeType === 1) &&
280
+ startContainer.isContentEditable && endNode &&
281
+ (customHandlerElements.indexOf(endNode.nodeName) > -1);
282
+ if (isCursorAtEnd) {
283
+ return { end: isCursorAtEnd, endNodeName: endNode.nodeName, endNode: endNode };
284
+ }
285
+ else {
286
+ return { end: false, endNodeName: '', endNode: undefined };
287
+ }
288
+ };
289
+ NodeSelection.prototype.processedTableImageCursor = function (range) {
290
+ var _a = this.isTableOrImageStart(range), start = _a.start, startNodeName = _a.startNodeName, startNode = _a.startNode;
291
+ var _b = this.isTableOrImageEnd(range), end = _b.end, endNodeName = _b.endNodeName, endNode = _b.endNode;
292
+ return { start: start, startName: startNodeName, end: end, endName: endNodeName, startNode: startNode, endNode: endNode };
293
+ };
294
+ NodeSelection.prototype.findLastTextPosition = function (element) {
295
+ if (element.nodeType === Node.TEXT_NODE) {
296
+ return { node: element, offset: element.textContent ? element.textContent.length : 0 };
297
+ }
298
+ for (var i = element.childNodes.length - 1; i >= 0; i--) {
299
+ var lastPosition = this.findLastTextPosition(element.childNodes[i]);
300
+ if (lastPosition) {
301
+ return lastPosition;
302
+ }
303
+ }
304
+ return null;
305
+ };
306
+ return NodeSelection;
307
+ }());
308
+ exports.NodeSelection = NodeSelection;
309
+ });