@syncfusion/ej2-richtexteditor 23.2.7 → 24.1.41-569421

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 (272) hide show
  1. package/.eslintrc.json +259 -259
  2. package/CHANGELOG.md +1953 -1749
  3. package/README.md +76 -76
  4. package/dist/ej2-richtexteditor.umd.min.js +1 -10
  5. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es2015.js +9971 -8025
  7. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  8. package/dist/es6/ej2-richtexteditor.es5.js +8445 -6498
  9. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  10. package/helpers/e2e/index.js +3 -3
  11. package/helpers/e2e/rte-helper.js +13 -13
  12. package/license +9 -9
  13. package/package.json +74 -74
  14. package/src/common/config.d.ts +7 -0
  15. package/src/common/config.js +12 -1
  16. package/src/common/constant.d.ts +6 -0
  17. package/src/common/constant.js +6 -0
  18. package/src/common/interface.d.ts +19 -7
  19. package/src/common/types.d.ts +6 -0
  20. package/src/common/util.d.ts +6 -0
  21. package/src/common/util.js +61 -20
  22. package/src/editor-manager/base/classes.d.ts +1 -1
  23. package/src/editor-manager/base/classes.js +1 -1
  24. package/src/editor-manager/base/constant.d.ts +6 -0
  25. package/src/editor-manager/base/constant.js +6 -0
  26. package/src/editor-manager/base/editor-manager.d.ts +8 -3
  27. package/src/editor-manager/base/editor-manager.js +62 -3
  28. package/src/editor-manager/base/enum.d.ts +2 -2
  29. package/src/editor-manager/base/interface.d.ts +17 -9
  30. package/src/editor-manager/base/types.d.ts +1 -1
  31. package/src/editor-manager/plugin/alignments.d.ts +2 -2
  32. package/src/editor-manager/plugin/alignments.js +2 -2
  33. package/src/editor-manager/plugin/audio.d.ts +3 -3
  34. package/src/editor-manager/plugin/audio.js +16 -6
  35. package/src/editor-manager/plugin/clearformat-exec.d.ts +2 -2
  36. package/src/editor-manager/plugin/clearformat-exec.js +2 -2
  37. package/src/editor-manager/plugin/clearformat.d.ts +1 -1
  38. package/src/editor-manager/plugin/clearformat.js +1 -1
  39. package/src/editor-manager/plugin/dom-node.d.ts +39 -35
  40. package/src/editor-manager/plugin/dom-node.js +203 -62
  41. package/src/editor-manager/plugin/format-painter-actions.d.ts +2 -1
  42. package/src/editor-manager/plugin/format-painter-actions.js +20 -2
  43. package/src/editor-manager/plugin/formats.d.ts +3 -2
  44. package/src/editor-manager/plugin/formats.js +40 -5
  45. package/src/editor-manager/plugin/image.d.ts +3 -3
  46. package/src/editor-manager/plugin/image.js +41 -18
  47. package/src/editor-manager/plugin/indents.d.ts +2 -2
  48. package/src/editor-manager/plugin/indents.js +3 -3
  49. package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
  50. package/src/editor-manager/plugin/insert-methods.js +4 -4
  51. package/src/editor-manager/plugin/insert-text.d.ts +2 -2
  52. package/src/editor-manager/plugin/insert-text.js +2 -2
  53. package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
  54. package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
  55. package/src/editor-manager/plugin/inserthtml.d.ts +3 -2
  56. package/src/editor-manager/plugin/inserthtml.js +85 -22
  57. package/src/editor-manager/plugin/isformatted.d.ts +8 -8
  58. package/src/editor-manager/plugin/isformatted.js +8 -8
  59. package/src/editor-manager/plugin/link.d.ts +2 -2
  60. package/src/editor-manager/plugin/link.js +10 -5
  61. package/src/editor-manager/plugin/lists.d.ts +2 -2
  62. package/src/editor-manager/plugin/lists.js +161 -72
  63. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +4 -1
  64. package/src/editor-manager/plugin/ms-word-clean-up.js +216 -86
  65. package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
  66. package/src/editor-manager/plugin/nodecutter.js +11 -8
  67. package/src/editor-manager/plugin/selection-commands.d.ts +3 -1
  68. package/src/editor-manager/plugin/selection-commands.js +249 -5
  69. package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
  70. package/src/editor-manager/plugin/selection-exec.js +2 -2
  71. package/src/editor-manager/plugin/table.d.ts +6 -3
  72. package/src/editor-manager/plugin/table.js +97 -51
  73. package/src/editor-manager/plugin/toolbar-status.d.ts +4 -4
  74. package/src/editor-manager/plugin/toolbar-status.js +22 -12
  75. package/src/editor-manager/plugin/undo.d.ts +7 -6
  76. package/src/editor-manager/plugin/undo.js +27 -7
  77. package/src/editor-manager/plugin/video.d.ts +3 -3
  78. package/src/editor-manager/plugin/video.js +3 -3
  79. package/src/global.d.ts +1 -0
  80. package/src/markdown-parser/base/interface.d.ts +10 -10
  81. package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
  82. package/src/markdown-parser/base/markdown-parser.js +3 -3
  83. package/src/markdown-parser/base/types.d.ts +1 -1
  84. package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
  85. package/src/markdown-parser/plugin/clearformat.js +2 -2
  86. package/src/markdown-parser/plugin/formats.d.ts +2 -2
  87. package/src/markdown-parser/plugin/formats.js +2 -2
  88. package/src/markdown-parser/plugin/insert-text.d.ts +2 -2
  89. package/src/markdown-parser/plugin/insert-text.js +2 -2
  90. package/src/markdown-parser/plugin/link.d.ts +2 -2
  91. package/src/markdown-parser/plugin/link.js +2 -2
  92. package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
  93. package/src/markdown-parser/plugin/markdown-selection.js +14 -14
  94. package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
  95. package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
  96. package/src/markdown-parser/plugin/table.d.ts +3 -3
  97. package/src/markdown-parser/plugin/table.js +3 -3
  98. package/src/markdown-parser/plugin/undo.d.ts +6 -6
  99. package/src/markdown-parser/plugin/undo.js +6 -6
  100. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +13 -12
  101. package/src/rich-text-editor/actions/base-quick-toolbar.js +70 -23
  102. package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
  103. package/src/rich-text-editor/actions/base-toolbar.js +36 -37
  104. package/src/rich-text-editor/actions/color-picker.d.ts +3 -2
  105. package/src/rich-text-editor/actions/color-picker.js +15 -5
  106. package/src/rich-text-editor/actions/count.d.ts +3 -3
  107. package/src/rich-text-editor/actions/count.js +4 -4
  108. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +3 -2
  109. package/src/rich-text-editor/actions/dropdown-buttons.js +13 -7
  110. package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
  111. package/src/rich-text-editor/actions/emoji-picker.js +17 -8
  112. package/src/rich-text-editor/actions/enter-key.js +10 -5
  113. package/src/rich-text-editor/actions/file-manager.js +1 -1
  114. package/src/rich-text-editor/actions/format-painter.js +5 -2
  115. package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
  116. package/src/rich-text-editor/actions/full-screen.js +8 -7
  117. package/src/rich-text-editor/actions/html-editor.d.ts +5 -3
  118. package/src/rich-text-editor/actions/html-editor.js +134 -22
  119. package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
  120. package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
  121. package/src/rich-text-editor/actions/keyboard.js +23 -21
  122. package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
  123. package/src/rich-text-editor/actions/markdown-editor.js +5 -3
  124. package/src/rich-text-editor/actions/paste-clean-up.d.ts +6 -1
  125. package/src/rich-text-editor/actions/paste-clean-up.js +157 -29
  126. package/src/rich-text-editor/actions/quick-toolbar.d.ts +17 -9
  127. package/src/rich-text-editor/actions/quick-toolbar.js +68 -21
  128. package/src/rich-text-editor/actions/resize.js +2 -1
  129. package/src/rich-text-editor/actions/toolbar-action.js +1 -1
  130. package/src/rich-text-editor/actions/toolbar.d.ts +16 -16
  131. package/src/rich-text-editor/actions/toolbar.js +48 -109
  132. package/src/rich-text-editor/actions/xhtml-validation.d.ts +1 -1
  133. package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
  134. package/src/rich-text-editor/base/classes.d.ts +125 -125
  135. package/src/rich-text-editor/base/classes.js +125 -125
  136. package/src/rich-text-editor/base/constant.d.ts +195 -150
  137. package/src/rich-text-editor/base/constant.js +364 -150
  138. package/src/rich-text-editor/base/enum.d.ts +1 -1
  139. package/src/rich-text-editor/base/enum.js +1 -1
  140. package/src/rich-text-editor/base/interface.d.ts +96 -52
  141. package/src/rich-text-editor/base/interface.js +1 -1
  142. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +891 -891
  143. package/src/rich-text-editor/base/rich-text-editor.d.ts +76 -64
  144. package/src/rich-text-editor/base/rich-text-editor.js +247 -160
  145. package/src/rich-text-editor/base/util.d.ts +1 -1
  146. package/src/rich-text-editor/base/util.js +23 -5
  147. package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
  148. package/src/rich-text-editor/formatter/formatter.js +24 -12
  149. package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
  150. package/src/rich-text-editor/formatter/html-formatter.js +15 -15
  151. package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
  152. package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
  153. package/src/rich-text-editor/models/default-locale.js +31 -25
  154. package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
  155. package/src/rich-text-editor/models/iframe-settings.js +19 -19
  156. package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
  157. package/src/rich-text-editor/models/inline-mode.js +19 -19
  158. package/src/rich-text-editor/models/items.js +3 -3
  159. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
  160. package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
  161. package/src/rich-text-editor/models/toolbar-settings.js +20 -20
  162. package/src/rich-text-editor/renderer/audio-module.d.ts +2 -1
  163. package/src/rich-text-editor/renderer/audio-module.js +23 -5
  164. package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
  165. package/src/rich-text-editor/renderer/content-renderer.js +6 -6
  166. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +4 -2
  167. package/src/rich-text-editor/renderer/dialog-renderer.js +24 -4
  168. package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
  169. package/src/rich-text-editor/renderer/iframe-content-renderer.js +19 -18
  170. package/src/rich-text-editor/renderer/image-module.d.ts +10 -2
  171. package/src/rich-text-editor/renderer/image-module.js +265 -221
  172. package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
  173. package/src/rich-text-editor/renderer/link-module.js +54 -25
  174. package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
  175. package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
  176. package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
  177. package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
  178. package/src/rich-text-editor/renderer/render.d.ts +2 -2
  179. package/src/rich-text-editor/renderer/render.js +2 -2
  180. package/src/rich-text-editor/renderer/table-module.d.ts +11 -2
  181. package/src/rich-text-editor/renderer/table-module.js +344 -169
  182. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +12 -15
  183. package/src/rich-text-editor/renderer/toolbar-renderer.js +115 -110
  184. package/src/rich-text-editor/renderer/video-module.d.ts +4 -1
  185. package/src/rich-text-editor/renderer/video-module.js +83 -42
  186. package/src/rich-text-editor/renderer/view-source.d.ts +7 -6
  187. package/src/rich-text-editor/renderer/view-source.js +21 -11
  188. package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
  189. package/src/rich-text-editor/services/renderer-factory.js +3 -3
  190. package/src/rich-text-editor/services/service-locator.d.ts +3 -3
  191. package/src/rich-text-editor/services/service-locator.js +3 -3
  192. package/src/selection/selection.d.ts +22 -22
  193. package/src/selection/selection.js +25 -22
  194. package/styles/_all.scss +1 -1
  195. package/styles/bootstrap-dark.css +353 -103
  196. package/styles/bootstrap.css +357 -112
  197. package/styles/bootstrap4.css +338 -96
  198. package/styles/bootstrap5-dark.css +344 -97
  199. package/styles/bootstrap5.css +344 -97
  200. package/styles/fabric-dark.css +332 -90
  201. package/styles/fabric.css +333 -91
  202. package/styles/fluent-dark.css +360 -98
  203. package/styles/fluent.css +360 -98
  204. package/styles/highcontrast-light.css +332 -90
  205. package/styles/highcontrast.css +336 -91
  206. package/styles/material-dark.css +339 -92
  207. package/styles/material.css +339 -92
  208. package/styles/material3-dark.css +348 -100
  209. package/styles/material3-dark.scss +1 -1
  210. package/styles/material3.css +348 -100
  211. package/styles/material3.scss +1 -1
  212. package/styles/rich-text-editor/_all.scss +2 -2
  213. package/styles/rich-text-editor/_bds-definition.scss +279 -0
  214. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +281 -277
  215. package/styles/rich-text-editor/_bootstrap-definition.scss +337 -334
  216. package/styles/rich-text-editor/_bootstrap4-definition.scss +464 -460
  217. package/styles/rich-text-editor/_bootstrap5-definition.scss +266 -262
  218. package/styles/rich-text-editor/_fabric-dark-definition.scss +263 -259
  219. package/styles/rich-text-editor/_fabric-definition.scss +261 -257
  220. package/styles/rich-text-editor/_fluent-definition.scss +267 -263
  221. package/styles/rich-text-editor/_fusionnew-definition.scss +265 -261
  222. package/styles/rich-text-editor/_highcontrast-definition.scss +261 -257
  223. package/styles/rich-text-editor/_highcontrast-light-definition.scss +261 -257
  224. package/styles/rich-text-editor/_layout.scss +2249 -2072
  225. package/styles/rich-text-editor/_material-dark-definition.scss +266 -262
  226. package/styles/rich-text-editor/_material-definition.scss +264 -260
  227. package/styles/rich-text-editor/_material3-definition.scss +266 -262
  228. package/styles/rich-text-editor/_tailwind-definition.scss +261 -257
  229. package/styles/rich-text-editor/_theme.scss +926 -837
  230. package/styles/rich-text-editor/bootstrap-dark.css +353 -103
  231. package/styles/rich-text-editor/bootstrap.css +357 -112
  232. package/styles/rich-text-editor/bootstrap4.css +338 -96
  233. package/styles/rich-text-editor/bootstrap5-dark.css +344 -97
  234. package/styles/rich-text-editor/bootstrap5.css +344 -97
  235. package/styles/rich-text-editor/fabric-dark.css +332 -90
  236. package/styles/rich-text-editor/fabric.css +333 -91
  237. package/styles/rich-text-editor/fluent-dark.css +360 -98
  238. package/styles/rich-text-editor/fluent.css +360 -98
  239. package/styles/rich-text-editor/highcontrast-light.css +332 -90
  240. package/styles/rich-text-editor/highcontrast.css +336 -91
  241. package/styles/rich-text-editor/icons/_bds.scss +348 -0
  242. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +349 -349
  243. package/styles/rich-text-editor/icons/_bootstrap.scss +349 -349
  244. package/styles/rich-text-editor/icons/_bootstrap4.scss +349 -349
  245. package/styles/rich-text-editor/icons/_bootstrap5.scss +348 -348
  246. package/styles/rich-text-editor/icons/_fabric-dark.scss +349 -349
  247. package/styles/rich-text-editor/icons/_fabric.scss +349 -349
  248. package/styles/rich-text-editor/icons/_fluent.scss +348 -348
  249. package/styles/rich-text-editor/icons/_fusionnew.scss +348 -348
  250. package/styles/rich-text-editor/icons/_highcontrast-light.scss +349 -349
  251. package/styles/rich-text-editor/icons/_highcontrast.scss +349 -349
  252. package/styles/rich-text-editor/icons/_material-dark.scss +349 -349
  253. package/styles/rich-text-editor/icons/_material.scss +349 -349
  254. package/styles/rich-text-editor/icons/_material3.scss +348 -348
  255. package/styles/rich-text-editor/icons/_tailwind.scss +348 -348
  256. package/styles/rich-text-editor/material-dark.css +339 -92
  257. package/styles/rich-text-editor/material.css +339 -92
  258. package/styles/rich-text-editor/material3-dark.css +348 -100
  259. package/styles/rich-text-editor/material3-dark.scss +1 -1
  260. package/styles/rich-text-editor/material3.css +348 -100
  261. package/styles/rich-text-editor/material3.scss +1 -1
  262. package/styles/rich-text-editor/tailwind-dark.css +383 -113
  263. package/styles/rich-text-editor/tailwind.css +383 -113
  264. package/styles/tailwind-dark.css +383 -113
  265. package/styles/tailwind.css +383 -113
  266. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
  267. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
  268. package/dist/ej2-richtexteditor.min.js +0 -10
  269. package/dist/global/ej2-richtexteditor.min.js +0 -11
  270. package/dist/global/ej2-richtexteditor.min.js.map +0 -1
  271. package/dist/global/index.d.ts +0 -14
  272. package/tslint.json +0 -111
@@ -11,7 +11,7 @@ export var markerClassName = {
11
11
  * DOMNode internal plugin
12
12
  *
13
13
  * @hidden
14
-
14
+ * @deprecated
15
15
  */
16
16
  var DOMNode = /** @class */ (function () {
17
17
  /**
@@ -20,7 +20,7 @@ var DOMNode = /** @class */ (function () {
20
20
  * @param {Element} parent - specifies the parent element
21
21
  * @param {Document} currentDocument - specifies the current document.
22
22
  * @hidden
23
-
23
+ * @deprecated
24
24
  */
25
25
  function DOMNode(parent, currentDocument) {
26
26
  this.parent = parent;
@@ -33,7 +33,7 @@ var DOMNode = /** @class */ (function () {
33
33
  * @param {Element} element - specifies the element.
34
34
  * @returns {void}
35
35
  * @hidden
36
-
36
+ * @deprecated
37
37
  */
38
38
  DOMNode.prototype.contents = function (element) {
39
39
  return (element && 'IFRAME' !== element.tagName ? Array.prototype.slice.call(element.childNodes || []) : []);
@@ -44,7 +44,7 @@ var DOMNode = /** @class */ (function () {
44
44
  * @param {Element} element - specifies the node element.
45
45
  * @returns {boolean} - sepcifies the boolean value
46
46
  * @hidden
47
-
47
+ * @deprecated
48
48
  */
49
49
  DOMNode.prototype.isBlockNode = function (element) {
50
50
  return (!!element && (element.nodeType === Node.ELEMENT_NODE && CONSTANT.BLOCK_TAGS.indexOf(element.tagName.toLowerCase()) >= 0));
@@ -55,7 +55,7 @@ var DOMNode = /** @class */ (function () {
55
55
  * @param {Element} element - specifies the element
56
56
  * @returns {boolean} - specifies the boolean value
57
57
  * @hidden
58
-
58
+ * @deprecated
59
59
  */
60
60
  DOMNode.prototype.isLink = function (element) {
61
61
  return (!!element && (element.nodeType === Node.ELEMENT_NODE && 'a' === element.tagName.toLowerCase()));
@@ -66,7 +66,7 @@ var DOMNode = /** @class */ (function () {
66
66
  * @param {Element} element - specifies the element
67
67
  * @returns {Element} - returns the element value
68
68
  * @hidden
69
-
69
+ * @deprecated
70
70
  */
71
71
  DOMNode.prototype.blockParentNode = function (element) {
72
72
  for (; element && element.parentNode !== this.parent && ((!element.parentNode ||
@@ -84,7 +84,7 @@ var DOMNode = /** @class */ (function () {
84
84
  * @param {Element} element - specifies the element
85
85
  * @returns {string} - returns the string value
86
86
  * @hidden
87
-
87
+ * @deprecated
88
88
  */
89
89
  DOMNode.prototype.rawAttributes = function (element) {
90
90
  var rawAttr = {};
@@ -103,7 +103,7 @@ var DOMNode = /** @class */ (function () {
103
103
  * @param {Element} element - sepcifies the element.
104
104
  * @returns {string} - returns the string value.
105
105
  * @hidden
106
-
106
+ * @deprecated
107
107
  */
108
108
  DOMNode.prototype.attributes = function (element) {
109
109
  if (!element) {
@@ -136,7 +136,7 @@ var DOMNode = /** @class */ (function () {
136
136
  * @param {Element} element - specifies the element
137
137
  * @returns {void}
138
138
  * @hidden
139
-
139
+ * @deprecated
140
140
  */
141
141
  DOMNode.prototype.clearAttributes = function (element) {
142
142
  for (var attr = element.attributes, c = attr.length - 1; c >= 0; c--) {
@@ -150,7 +150,7 @@ var DOMNode = /** @class */ (function () {
150
150
  * @param {Element} element - specifies the element.
151
151
  * @returns {string} - returns the string
152
152
  * @hidden
153
-
153
+ * @deprecated
154
154
  */
155
155
  DOMNode.prototype.openTagString = function (element) {
156
156
  return '<' + element.tagName.toLowerCase() + this.attributes(element) + '>';
@@ -161,7 +161,7 @@ var DOMNode = /** @class */ (function () {
161
161
  * @param {Element} element - specifies the element
162
162
  * @returns {string} - returns the string value
163
163
  * @hidden
164
-
164
+ * @deprecated
165
165
  */
166
166
  DOMNode.prototype.closeTagString = function (element) {
167
167
  return '</' + element.tagName.toLowerCase() + '>';
@@ -174,7 +174,7 @@ var DOMNode = /** @class */ (function () {
174
174
  * @param {string} innerHTML - specifies the string value
175
175
  * @returns {string} - returns the string value.
176
176
  * @hidden
177
-
177
+ * @deprecated
178
178
  */
179
179
  DOMNode.prototype.createTagString = function (tagName, relativeElement, innerHTML) {
180
180
  return '<' + tagName.toLowerCase() + this.attributes(relativeElement) + '>' + innerHTML + '</' + tagName.toLowerCase() + '>';
@@ -185,7 +185,7 @@ var DOMNode = /** @class */ (function () {
185
185
  * @param {Element} element - specifes the element.
186
186
  * @returns {boolean} - returns the boolean value
187
187
  * @hidden
188
-
188
+ * @deprecated
189
189
  */
190
190
  DOMNode.prototype.isList = function (element) {
191
191
  return !!element && ['UL', 'OL'].indexOf(element.tagName) >= 0;
@@ -196,7 +196,7 @@ var DOMNode = /** @class */ (function () {
196
196
  * @param {Element} element - specifes the element.
197
197
  * @returns {boolean} - returns the boolean value
198
198
  * @hidden
199
-
199
+ * @deprecated
200
200
  */
201
201
  DOMNode.prototype.isElement = function (element) {
202
202
  return element === this.parent;
@@ -207,7 +207,7 @@ var DOMNode = /** @class */ (function () {
207
207
  * @param {Element} element - specifes the element.
208
208
  * @returns {boolean} - returns the boolean value
209
209
  * @hidden
210
-
210
+ * @deprecated
211
211
  */
212
212
  DOMNode.prototype.isEditable = function (element) {
213
213
  return ((!element.getAttribute || element.getAttribute('contenteditable') === 'true')
@@ -220,7 +220,7 @@ var DOMNode = /** @class */ (function () {
220
220
  * @param {string} className - specifies the class name value
221
221
  * @returns {boolean} - returns the boolean value
222
222
  * @hidden
223
-
223
+ * @deprecated
224
224
  */
225
225
  DOMNode.prototype.hasClass = function (element, className) {
226
226
  return element && element.classList && element.classList.contains(className);
@@ -232,7 +232,7 @@ var DOMNode = /** @class */ (function () {
232
232
  * @param {string} value - specifies the string value
233
233
  * @returns {void}
234
234
  * @hidden
235
-
235
+ * @deprecated
236
236
  */
237
237
  DOMNode.prototype.replaceWith = function (element, value) {
238
238
  var parentNode = element.parentNode;
@@ -245,7 +245,7 @@ var DOMNode = /** @class */ (function () {
245
245
  * @param {string} value - specifies the string value
246
246
  * @returns {Element} - returns the element
247
247
  * @hidden
248
-
248
+ * @deprecated
249
249
  */
250
250
  DOMNode.prototype.parseHTMLFragment = function (value) {
251
251
  /* eslint-disable */
@@ -266,7 +266,7 @@ var DOMNode = /** @class */ (function () {
266
266
  * @param {Element} wrapper - specifies the element.
267
267
  * @returns {Element} - returns the element
268
268
  * @hidden
269
-
269
+ * @deprecated
270
270
  */
271
271
  DOMNode.prototype.wrap = function (element, wrapper) {
272
272
  element.parentNode.insertBefore(wrapper, element);
@@ -281,7 +281,7 @@ var DOMNode = /** @class */ (function () {
281
281
  * @param {Element} referenceNode - specifies the referenece node
282
282
  * @returns {void}
283
283
  * @hidden
284
-
284
+ * @deprecated
285
285
  */
286
286
  DOMNode.prototype.insertAfter = function (newNode, referenceNode) {
287
287
  referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
@@ -293,7 +293,7 @@ var DOMNode = /** @class */ (function () {
293
293
  * @param {Element} wrapper - specifies the wrapper element.
294
294
  * @returns {Element} - returns the element
295
295
  * @hidden
296
-
296
+ * @deprecated
297
297
  */
298
298
  DOMNode.prototype.wrapInner = function (parent, wrapper) {
299
299
  parent.appendChild(wrapper);
@@ -313,7 +313,7 @@ var DOMNode = /** @class */ (function () {
313
313
  * @param {Element} element - specifies the element.
314
314
  * @returns {Element} - returns the element.
315
315
  * @hidden
316
-
316
+ * @deprecated
317
317
  */
318
318
  DOMNode.prototype.unWrap = function (element) {
319
319
  var parent = element.parentNode;
@@ -333,7 +333,7 @@ var DOMNode = /** @class */ (function () {
333
333
  * @param {number} index - specifies the index value.
334
334
  * @returns {Element} - returns the element
335
335
  * @hidden
336
-
336
+ * @deprecated
337
337
  */
338
338
  DOMNode.prototype.getSelectedNode = function (element, index) {
339
339
  if (element.nodeType === Node.ELEMENT_NODE && element.childNodes.length > 0 &&
@@ -357,7 +357,7 @@ var DOMNode = /** @class */ (function () {
357
357
  * @param {Element[]} elements - specifies the array of elements
358
358
  * @returns {Element[]} - returnts the array elements
359
359
  * @hidden
360
-
360
+ * @deprecated
361
361
  */
362
362
  DOMNode.prototype.nodeFinds = function (element, elements) {
363
363
  var existNodes = [];
@@ -373,7 +373,7 @@ var DOMNode = /** @class */ (function () {
373
373
  *
374
374
  * @returns {boolean} - returns the boolean value
375
375
  * @hidden
376
-
376
+ * @deprecated
377
377
  */
378
378
  DOMNode.prototype.isEditorArea = function () {
379
379
  var range = this.getRangePoint(0);
@@ -389,7 +389,7 @@ var DOMNode = /** @class */ (function () {
389
389
  * @param {number} point - specifies the number value.
390
390
  * @returns {Range} - returns the range.
391
391
  * @hidden
392
-
392
+ * @deprecated
393
393
  */
394
394
  DOMNode.prototype.getRangePoint = function (point) {
395
395
  var selection = this.getSelection();
@@ -414,7 +414,7 @@ var DOMNode = /** @class */ (function () {
414
414
  * @param {Element} element - specifies the element
415
415
  * @returns {Element} - returns the element
416
416
  * @hidden
417
-
417
+ * @deprecated
418
418
  */
419
419
  DOMNode.prototype.getPreviousNode = function (element) {
420
420
  element = element.previousElementSibling;
@@ -429,7 +429,7 @@ var DOMNode = /** @class */ (function () {
429
429
  * @param {string} value - specifies the string value
430
430
  * @returns {string} - specifies the string value
431
431
  * @hidden
432
-
432
+ * @deprecated
433
433
  */
434
434
  DOMNode.prototype.encode = function (value) {
435
435
  var divNode = document.createElement('div');
@@ -444,26 +444,13 @@ var DOMNode = /** @class */ (function () {
444
444
  * @param {string} action - specifies the action value.
445
445
  * @returns {NodeSelection} - returns the value
446
446
  * @hidden
447
-
447
+ * @deprecated
448
448
  */
449
449
  DOMNode.prototype.saveMarker = function (save, action) {
450
450
  var start = this.parent.querySelector('.' + markerClassName.startSelection);
451
451
  var end = this.parent.querySelector('.' + markerClassName.endSelection);
452
452
  var startTextNode;
453
453
  var endTextNode;
454
- if (start.textContent === '' && isNOU(end) && action !== 'tab') {
455
- // To Do Apply Heading and Back space press in empty content.
456
- // if (isNOU(action) && save.range.startContainer.nodeType === 1 &&
457
- // (save.range.startContainer as HTMLElement).querySelectorAll('audio,video,image').length === 0) {
458
- // start.innerHTML = '<br>';
459
- // }
460
- if (start.childNodes.length === 1 && start.childNodes[0].nodeName === 'BR') {
461
- start.innerHTML = '&#65279;&#65279;<br>';
462
- }
463
- else {
464
- start.innerHTML = '&#65279;&#65279;';
465
- }
466
- }
467
454
  if (this.hasClass(start, markerClassName.startSelection) && start.classList.length > 1) {
468
455
  var replace = this.createTagString(CONSTANT.DEFAULT_TAG, start, this.encode(start.textContent));
469
456
  this.replaceWith(start, replace);
@@ -497,15 +484,17 @@ var DOMNode = /** @class */ (function () {
497
484
  * @param {NodeSelection} save - specifies the node selection.
498
485
  * @returns {void}
499
486
  * @hidden
500
-
487
+ * @deprecated
501
488
  */
502
489
  DOMNode.prototype.setMarker = function (save) {
503
490
  var range = save.range;
504
491
  var startChildNodes = range.startContainer.childNodes;
505
492
  var isTableStart = startChildNodes.length > 1 && startChildNodes[0].nodeName === 'TABLE';
493
+ var isImgOnlySelected = startChildNodes.length > 1 && startChildNodes[0].nodeName === 'IMAGE' &&
494
+ range.endOffset === 1 && range.endContainer.nodeName === '#text' && range.endContainer.textContent.length === 0;
506
495
  var start = ((isTableStart ? getLastTextNode(startChildNodes[range.startOffset + 1]) :
507
496
  startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) : range.startOffset]) || range.startContainer);
508
- var end = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) : range.endOffset]
497
+ var end = (range.endContainer.childNodes[(range.endOffset > 0) ? (isImgOnlySelected ? range.endOffset : (range.endOffset - 1)) : range.endOffset]
509
498
  || range.endContainer);
510
499
  if ((start.nodeType === Node.ELEMENT_NODE && end.nodeType === Node.ELEMENT_NODE) && (start.contains(end) || end.contains(start))) {
511
500
  var existNode = start.contains(end) ? start : end;
@@ -576,7 +565,7 @@ var DOMNode = /** @class */ (function () {
576
565
  * @param {Range} range - specifies the range value
577
566
  * @returns {void}
578
567
  * @hidden
579
-
568
+ * @deprecated
580
569
  */
581
570
  DOMNode.prototype.ensureSelfClosingTag = function (start, className, range) {
582
571
  var isTable = false;
@@ -586,10 +575,13 @@ var DOMNode = /** @class */ (function () {
586
575
  else if (start.tagName === 'BR') {
587
576
  this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
588
577
  var markerStart = range.startContainer.querySelector('.' + className);
589
- markerStart.appendChild(start);
578
+ if (markerStart) {
579
+ markerStart.parentElement.appendChild(start);
580
+ }
590
581
  }
591
582
  else {
592
- if (start.tagName === 'IMG') {
583
+ var tagName = !isNOU(start.parentElement) ? start.parentElement.tagName.toLocaleLowerCase() : '';
584
+ if (start.tagName === 'IMG' && tagName !== 'p' && tagName !== 'div') {
593
585
  var parNode = document.createElement('p');
594
586
  start.parentElement.insertBefore(parNode, start);
595
587
  parNode.appendChild(start);
@@ -634,7 +626,7 @@ var DOMNode = /** @class */ (function () {
634
626
  * @param {Element} element - specifies the element.
635
627
  * @returns {Element} - returns the element
636
628
  * @hidden
637
-
629
+ * @deprecated
638
630
  */
639
631
  DOMNode.prototype.createTempNode = function (element) {
640
632
  var textContent = element.textContent;
@@ -667,7 +659,7 @@ var DOMNode = /** @class */ (function () {
667
659
  *
668
660
  * @returns {void}
669
661
  * @hidden
670
-
662
+ * @deprecated
671
663
  */
672
664
  DOMNode.prototype.getImageTagInSelection = function () {
673
665
  var selection = this.getSelection();
@@ -679,11 +671,12 @@ var DOMNode = /** @class */ (function () {
679
671
  /**
680
672
  * blockNodes method
681
673
  *
674
+ * @param {boolean} action - Optional Boolean that specifies the action is whether performed.
682
675
  * @returns {Node[]} - returns the node array values
683
676
  * @hidden
684
-
677
+ * @deprecated
685
678
  */
686
- DOMNode.prototype.blockNodes = function () {
679
+ DOMNode.prototype.blockNodes = function (action) {
687
680
  var collectionNodes = [];
688
681
  var selection = this.getSelection();
689
682
  if (this.isEditorArea() && selection.rangeCount) {
@@ -697,23 +690,46 @@ var DOMNode = /** @class */ (function () {
697
690
  collectionNodes.push(startNode);
698
691
  }
699
692
  parentNode = this.blockParentNode(startNode);
693
+ var endParentNode = this.blockParentNode(endNode);
700
694
  if (parentNode && collectionNodes.indexOf(parentNode) < 0) {
701
- if (CONSTANT.IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
702
- startNode.nodeType === Node.TEXT_NODE ||
703
- startNode.classList.contains(markerClassName.startSelection) ||
704
- startNode.classList.contains(markerClassName.endSelection))) {
705
- var tempNode = startNode.previousSibling &&
706
- startNode.previousSibling.nodeType === Node.TEXT_NODE ?
707
- startNode.previousSibling : startNode;
708
- if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
709
- collectionNodes.push(tempNode);
695
+ if (!isNOU(action) && action) {
696
+ if (range.commonAncestorContainer.nodeName === 'TD' || parentNode.nodeName === 'TD' || endParentNode.nodeName === 'TD') {
697
+ var processedNodes = this.getPreBlockNodeCollection(range);
698
+ if (processedNodes.length > 1) {
699
+ this.wrapWithBlockNode(processedNodes, collectionNodes);
700
+ }
701
+ else if (processedNodes.length > 0) {
702
+ if (startNode !== endNode && startNode.nodeName !== 'BR') {
703
+ collectionNodes.push(this.createTempNode(startNode));
704
+ }
705
+ else if (startNode === endNode && startNode.nodeName === 'SPAN' && (startNode.classList.contains(markerClassName.startSelection)
706
+ || startNode.classList.contains(markerClassName.endSelection))) {
707
+ collectionNodes.push(this.createTempNode(startNode));
708
+ }
709
+ }
710
710
  }
711
711
  else {
712
- collectionNodes.push(this.createTempNode(tempNode));
712
+ collectionNodes.push(parentNode);
713
713
  }
714
714
  }
715
715
  else {
716
- collectionNodes.push(parentNode);
716
+ if (CONSTANT.IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
717
+ startNode.nodeType === Node.TEXT_NODE ||
718
+ startNode.classList.contains(markerClassName.startSelection) ||
719
+ startNode.classList.contains(markerClassName.endSelection))) {
720
+ var tempNode = startNode.previousSibling &&
721
+ startNode.previousSibling.nodeType === Node.TEXT_NODE ?
722
+ startNode.previousSibling : startNode;
723
+ if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
724
+ collectionNodes.push(tempNode);
725
+ }
726
+ else {
727
+ collectionNodes.push(this.createTempNode(tempNode));
728
+ }
729
+ }
730
+ else {
731
+ collectionNodes.push(parentNode);
732
+ }
717
733
  }
718
734
  }
719
735
  var nodes = [];
@@ -782,6 +798,131 @@ var DOMNode = /** @class */ (function () {
782
798
  DOMNode.prototype.ignoreTableTag = function (element) {
783
799
  return !(CONSTANT.TABLE_BLOCK_TAGS.indexOf(element.tagName.toLocaleLowerCase()) >= 0);
784
800
  };
801
+ DOMNode.prototype.getPreBlockNodeCollection = function (range) {
802
+ var startNode = this.getSelectedNode(range.startContainer, range.startOffset);
803
+ var endNode = this.getSelectedNode(range.endContainer, range.endOffset);
804
+ var nodes = [];
805
+ var rootNode = startNode.closest('td, th');
806
+ if (isNOU(rootNode)) {
807
+ return nodes;
808
+ }
809
+ var rootChildNode = Array.from(rootNode.childNodes);
810
+ var isContinue = true;
811
+ var processedStart = this.getClosestInlineParent(startNode, rootNode, true);
812
+ var processedEnd = this.getClosestInlineParent(endNode, rootNode, false);
813
+ for (var i = 0; i < rootChildNode.length; i++) {
814
+ var child = rootChildNode[i];
815
+ if (processedStart === processedEnd && child === processedStart) {
816
+ nodes.push(child);
817
+ isContinue = true;
818
+ }
819
+ else if (child === processedStart) {
820
+ isContinue = false;
821
+ }
822
+ else if (child === processedEnd) {
823
+ nodes.push(child); // Early Exit so Push the end node.
824
+ isContinue = true;
825
+ }
826
+ if (isContinue) {
827
+ continue;
828
+ }
829
+ else {
830
+ nodes.push(child);
831
+ }
832
+ }
833
+ return nodes;
834
+ };
835
+ DOMNode.prototype.getClosestInlineParent = function (node, rootNode, isStart) {
836
+ // 1. If the node is a text node, return the node
837
+ // 2. If the node is a block node return block node
838
+ // 3. If the node is a inline node,
839
+ // Traverse back untill the TD or TH node
840
+ // Check if the the previous sibling , next sibling is a block node.
841
+ // If yes return the inline node that is closest to the block node.
842
+ if (node.nodeType === Node.TEXT_NODE) {
843
+ return node;
844
+ }
845
+ if (this.isBlockNode(node)) {
846
+ return node;
847
+ }
848
+ var currentNode = node;
849
+ var rootFlag = false;
850
+ while (currentNode) {
851
+ var previousNode = currentNode;
852
+ if (rootFlag) {
853
+ if (this.isBlockNode(currentNode)) {
854
+ return previousNode;
855
+ }
856
+ if (isStart && currentNode.previousSibling) {
857
+ if (this.isBlockNode(currentNode.previousSibling) || currentNode.previousSibling.nodeName === 'BR') {
858
+ return previousNode;
859
+ }
860
+ else {
861
+ currentNode = currentNode.previousSibling;
862
+ }
863
+ }
864
+ else if (!isStart && currentNode.nextSibling) {
865
+ if (this.isBlockNode(currentNode.nextSibling) || currentNode.nextSibling.nodeName === 'BR') {
866
+ return previousNode;
867
+ }
868
+ else {
869
+ currentNode = currentNode.nextSibling;
870
+ }
871
+ }
872
+ else {
873
+ return currentNode;
874
+ }
875
+ }
876
+ else {
877
+ currentNode = currentNode.parentElement;
878
+ if (currentNode === rootNode) {
879
+ currentNode = previousNode;
880
+ rootFlag = true;
881
+ }
882
+ }
883
+ }
884
+ return null;
885
+ };
886
+ DOMNode.prototype.wrapWithBlockNode = function (nodes, collectionNodes) {
887
+ var wrapperElement = createElement('p');
888
+ for (var i = 0; i < nodes.length; i++) {
889
+ var child = nodes[i];
890
+ if (child.nodeName === 'BR') {
891
+ child.parentNode.insertBefore(wrapperElement, child);
892
+ wrapperElement.appendChild(child);
893
+ if (wrapperElement.childNodes.length > 0) {
894
+ collectionNodes.push(wrapperElement);
895
+ }
896
+ wrapperElement = createElement('p');
897
+ }
898
+ else {
899
+ if (!this.isBlockNode(child)) {
900
+ if (child.nodeName === '#text' && child.textContent.trim() === '') {
901
+ continue;
902
+ }
903
+ if (wrapperElement.childElementCount === 0) {
904
+ child.parentNode.insertBefore(wrapperElement, child);
905
+ wrapperElement.appendChild(child);
906
+ }
907
+ else {
908
+ wrapperElement.appendChild(child);
909
+ }
910
+ }
911
+ else {
912
+ collectionNodes.push(child);
913
+ }
914
+ // Use case when the BR is next sibling but the BR is not the part of selection.
915
+ if ((i === nodes.length - 1) && wrapperElement.nextElementSibling &&
916
+ wrapperElement.querySelectorAll('br').length === 0 &&
917
+ wrapperElement.nextElementSibling.nodeName === 'BR') {
918
+ wrapperElement.appendChild(wrapperElement.nextElementSibling);
919
+ }
920
+ }
921
+ }
922
+ if (wrapperElement.childNodes.length > 0 && collectionNodes.indexOf(wrapperElement) < 0) {
923
+ collectionNodes.push(wrapperElement);
924
+ }
925
+ };
785
926
  return DOMNode;
786
927
  }());
787
928
  export { DOMNode };
@@ -18,7 +18,7 @@ export declare class FormatPainterActions implements IFormatPainterEditor {
18
18
  * @function destroy
19
19
  * @returns {void}
20
20
  * @hidden
21
-
21
+ * @deprecated
22
22
  */
23
23
  destroy(): void;
24
24
  private actionHandler;
@@ -35,6 +35,7 @@ export declare class FormatPainterActions implements IFormatPainterEditor {
35
35
  private validateELementTag;
36
36
  private findCurrentContext;
37
37
  private insertFormatNode;
38
+ private isListCopied;
38
39
  private insertBlockNode;
39
40
  private insertNewList;
40
41
  private insertSameList;
@@ -34,7 +34,7 @@ var FormatPainterActions = /** @class */ (function () {
34
34
  * @function destroy
35
35
  * @returns {void}
36
36
  * @hidden
37
-
37
+ * @deprecated
38
38
  */
39
39
  FormatPainterActions.prototype.destroy = function () {
40
40
  this.removeEventListener();
@@ -174,7 +174,7 @@ var FormatPainterActions = /** @class */ (function () {
174
174
  };
175
175
  FormatPainterActions.prototype.copyAction = function () {
176
176
  var copyCollection = [];
177
- var range = this.parent.nodeSelection.getRange(document);
177
+ var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
178
178
  var domSelection = this.parent.nodeSelection;
179
179
  var nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
180
180
  domSelection.getSelectionNodeCollectionBr(range);
@@ -363,6 +363,14 @@ var FormatPainterActions = /** @class */ (function () {
363
363
  var range = this.parent.nodeSelection.getRange(docElement);
364
364
  var isCollapsed = range.collapsed;
365
365
  var blockNodes = this.parent.domNode.blockNodes();
366
+ var isListCopied = this.isListCopied();
367
+ if (isListCopied) {
368
+ for (var i = 0; i < blockNodes.length; i++) {
369
+ if (closest(blockNodes[i], 'li')) {
370
+ blockNodes[i] = closest(blockNodes[i], 'li');
371
+ }
372
+ }
373
+ }
366
374
  var isFullNodeSelected = false;
367
375
  if (blockNodes.length === 1) {
368
376
  isFullNodeSelected = blockNodes[0].textContent.trim() === range.toString().trim();
@@ -371,6 +379,16 @@ var FormatPainterActions = /** @class */ (function () {
371
379
  this.insertBlockNode(clonedElem, range, docElement, blockNodes);
372
380
  }
373
381
  };
382
+ FormatPainterActions.prototype.isListCopied = function () {
383
+ var isListCopied = false;
384
+ for (var i = 0; i < this.copyCollection.length; i++) {
385
+ if (this.copyCollection[i].tagName === 'OL' || this.copyCollection[i].tagName === 'UL') {
386
+ isListCopied = true;
387
+ break;
388
+ }
389
+ }
390
+ return isListCopied;
391
+ };
374
392
  FormatPainterActions.prototype.insertBlockNode = function (element, range, docElement, nodes) {
375
393
  var domSelection = this.parent.nodeSelection;
376
394
  var saveSelection = domSelection.save(range, docElement);
@@ -3,7 +3,7 @@ import { EditorManager } from './../base/editor-manager';
3
3
  * Formats internal component
4
4
  *
5
5
  * @hidden
6
-
6
+ * @deprecated
7
7
  */
8
8
  export declare class Formats {
9
9
  private parent;
@@ -12,12 +12,13 @@ export declare class Formats {
12
12
  *
13
13
  * @param {EditorManager} parent - specifies the parent element.
14
14
  * @hidden
15
-
15
+ * @deprecated
16
16
  */
17
17
  constructor(parent: EditorManager);
18
18
  private addEventListener;
19
19
  private getParentNode;
20
20
  private onKeyUp;
21
+ private getBlockParent;
21
22
  private onKeyDown;
22
23
  private removeCodeContent;
23
24
  private deleteContent;