@syncfusion/ej2-richtexteditor 24.1.41 → 24.1.43-569781

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/.eslintrc.json +259 -259
  2. package/CHANGELOG.md +1927 -1775
  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 +2601 -1077
  7. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  8. package/dist/es6/ej2-richtexteditor.es5.js +2706 -1181
  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 +11 -0
  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 +3 -3
  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 -49
  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 +15 -19
  47. package/src/editor-manager/plugin/indents.d.ts +2 -2
  48. package/src/editor-manager/plugin/indents.js +2 -2
  49. package/src/editor-manager/plugin/insert-methods.d.ts +4 -4
  50. package/src/editor-manager/plugin/insert-methods.js +4 -4
  51. package/src/editor-manager/plugin/insert-text.d.ts +2 -2
  52. package/src/editor-manager/plugin/insert-text.js +2 -2
  53. package/src/editor-manager/plugin/inserthtml-exec.d.ts +2 -2
  54. package/src/editor-manager/plugin/inserthtml-exec.js +2 -2
  55. package/src/editor-manager/plugin/inserthtml.d.ts +3 -2
  56. package/src/editor-manager/plugin/inserthtml.js +64 -7
  57. package/src/editor-manager/plugin/isformatted.d.ts +8 -8
  58. package/src/editor-manager/plugin/isformatted.js +8 -8
  59. package/src/editor-manager/plugin/link.d.ts +2 -2
  60. package/src/editor-manager/plugin/link.js +6 -3
  61. package/src/editor-manager/plugin/lists.d.ts +2 -2
  62. package/src/editor-manager/plugin/lists.js +123 -67
  63. package/src/editor-manager/plugin/ms-word-clean-up.d.ts +4 -1
  64. package/src/editor-manager/plugin/ms-word-clean-up.js +213 -86
  65. package/src/editor-manager/plugin/nodecutter.d.ts +6 -6
  66. package/src/editor-manager/plugin/nodecutter.js +8 -8
  67. package/src/editor-manager/plugin/selection-commands.d.ts +2 -1
  68. package/src/editor-manager/plugin/selection-commands.js +127 -4
  69. package/src/editor-manager/plugin/selection-exec.d.ts +2 -2
  70. package/src/editor-manager/plugin/selection-exec.js +2 -2
  71. package/src/editor-manager/plugin/table.d.ts +2 -3
  72. package/src/editor-manager/plugin/table.js +35 -32
  73. package/src/editor-manager/plugin/toolbar-status.d.ts +4 -4
  74. package/src/editor-manager/plugin/toolbar-status.js +22 -12
  75. package/src/editor-manager/plugin/undo.d.ts +7 -6
  76. package/src/editor-manager/plugin/undo.js +27 -7
  77. package/src/editor-manager/plugin/video.d.ts +3 -3
  78. package/src/editor-manager/plugin/video.js +3 -3
  79. package/src/markdown-parser/base/interface.d.ts +10 -10
  80. package/src/markdown-parser/base/markdown-parser.d.ts +3 -3
  81. package/src/markdown-parser/base/markdown-parser.js +3 -3
  82. package/src/markdown-parser/base/types.d.ts +1 -1
  83. package/src/markdown-parser/plugin/clearformat.d.ts +2 -2
  84. package/src/markdown-parser/plugin/clearformat.js +2 -2
  85. package/src/markdown-parser/plugin/formats.d.ts +2 -2
  86. package/src/markdown-parser/plugin/formats.js +2 -2
  87. package/src/markdown-parser/plugin/insert-text.d.ts +2 -2
  88. package/src/markdown-parser/plugin/insert-text.js +2 -2
  89. package/src/markdown-parser/plugin/link.d.ts +2 -2
  90. package/src/markdown-parser/plugin/link.js +2 -2
  91. package/src/markdown-parser/plugin/markdown-selection.d.ts +14 -14
  92. package/src/markdown-parser/plugin/markdown-selection.js +14 -14
  93. package/src/markdown-parser/plugin/md-selection-formats.d.ts +1 -1
  94. package/src/markdown-parser/plugin/md-selection-formats.js +1 -1
  95. package/src/markdown-parser/plugin/table.d.ts +3 -3
  96. package/src/markdown-parser/plugin/table.js +3 -3
  97. package/src/markdown-parser/plugin/undo.d.ts +6 -6
  98. package/src/markdown-parser/plugin/undo.js +6 -6
  99. package/src/rich-text-editor/actions/base-quick-toolbar.d.ts +12 -12
  100. package/src/rich-text-editor/actions/base-quick-toolbar.js +57 -20
  101. package/src/rich-text-editor/actions/base-toolbar.d.ts +3 -3
  102. package/src/rich-text-editor/actions/base-toolbar.js +35 -37
  103. package/src/rich-text-editor/actions/color-picker.d.ts +3 -2
  104. package/src/rich-text-editor/actions/color-picker.js +12 -2
  105. package/src/rich-text-editor/actions/count.d.ts +3 -3
  106. package/src/rich-text-editor/actions/count.js +4 -4
  107. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -2
  108. package/src/rich-text-editor/actions/dropdown-buttons.js +23 -4
  109. package/src/rich-text-editor/actions/emoji-picker.d.ts +1 -1
  110. package/src/rich-text-editor/actions/emoji-picker.js +4 -4
  111. package/src/rich-text-editor/actions/enter-key.js +4 -3
  112. package/src/rich-text-editor/actions/full-screen.d.ts +3 -3
  113. package/src/rich-text-editor/actions/full-screen.js +6 -5
  114. package/src/rich-text-editor/actions/html-editor.d.ts +5 -5
  115. package/src/rich-text-editor/actions/html-editor.js +129 -45
  116. package/src/rich-text-editor/actions/keyboard-model.d.ts +16 -16
  117. package/src/rich-text-editor/actions/keyboard.d.ts +1 -1
  118. package/src/rich-text-editor/actions/keyboard.js +23 -21
  119. package/src/rich-text-editor/actions/markdown-editor.d.ts +2 -2
  120. package/src/rich-text-editor/actions/markdown-editor.js +5 -3
  121. package/src/rich-text-editor/actions/paste-clean-up.d.ts +4 -1
  122. package/src/rich-text-editor/actions/paste-clean-up.js +87 -12
  123. package/src/rich-text-editor/actions/quick-toolbar.d.ts +16 -9
  124. package/src/rich-text-editor/actions/quick-toolbar.js +33 -18
  125. package/src/rich-text-editor/actions/resize.js +2 -1
  126. package/src/rich-text-editor/actions/toolbar-action.js +1 -1
  127. package/src/rich-text-editor/actions/toolbar.d.ts +15 -16
  128. package/src/rich-text-editor/actions/toolbar.js +31 -100
  129. package/src/rich-text-editor/actions/xhtml-validation.d.ts +1 -1
  130. package/src/rich-text-editor/actions/xhtml-validation.js +1 -1
  131. package/src/rich-text-editor/base/classes.d.ts +121 -126
  132. package/src/rich-text-editor/base/classes.js +121 -126
  133. package/src/rich-text-editor/base/constant.d.ts +190 -150
  134. package/src/rich-text-editor/base/constant.js +359 -150
  135. package/src/rich-text-editor/base/enum.d.ts +1 -1
  136. package/src/rich-text-editor/base/enum.js +1 -1
  137. package/src/rich-text-editor/base/interface.d.ts +87 -53
  138. package/src/rich-text-editor/base/interface.js +1 -1
  139. package/src/rich-text-editor/base/rich-text-editor-model.d.ts +891 -891
  140. package/src/rich-text-editor/base/rich-text-editor.d.ts +68 -65
  141. package/src/rich-text-editor/base/rich-text-editor.js +232 -199
  142. package/src/rich-text-editor/base/util.d.ts +5 -1
  143. package/src/rich-text-editor/base/util.js +47 -4
  144. package/src/rich-text-editor/formatter/formatter.d.ts +8 -8
  145. package/src/rich-text-editor/formatter/formatter.js +23 -12
  146. package/src/rich-text-editor/formatter/html-formatter.d.ts +2 -2
  147. package/src/rich-text-editor/formatter/html-formatter.js +15 -15
  148. package/src/rich-text-editor/formatter/markdown-formatter.d.ts +2 -2
  149. package/src/rich-text-editor/formatter/markdown-formatter.js +15 -15
  150. package/src/rich-text-editor/models/default-locale.js +30 -26
  151. package/src/rich-text-editor/models/iframe-settings-model.d.ts +26 -26
  152. package/src/rich-text-editor/models/iframe-settings.js +19 -19
  153. package/src/rich-text-editor/models/inline-mode-model.d.ts +11 -11
  154. package/src/rich-text-editor/models/inline-mode.js +19 -19
  155. package/src/rich-text-editor/models/items.js +2 -2
  156. package/src/rich-text-editor/models/toolbar-settings-model.d.ts +760 -760
  157. package/src/rich-text-editor/models/toolbar-settings.d.ts +1 -1
  158. package/src/rich-text-editor/models/toolbar-settings.js +20 -20
  159. package/src/rich-text-editor/renderer/audio-module.d.ts +2 -1
  160. package/src/rich-text-editor/renderer/audio-module.js +14 -1
  161. package/src/rich-text-editor/renderer/content-renderer.d.ts +6 -6
  162. package/src/rich-text-editor/renderer/content-renderer.js +6 -6
  163. package/src/rich-text-editor/renderer/dialog-renderer.d.ts +4 -2
  164. package/src/rich-text-editor/renderer/dialog-renderer.js +14 -3
  165. package/src/rich-text-editor/renderer/iframe-content-renderer.d.ts +4 -4
  166. package/src/rich-text-editor/renderer/iframe-content-renderer.js +19 -18
  167. package/src/rich-text-editor/renderer/image-module.d.ts +10 -2
  168. package/src/rich-text-editor/renderer/image-module.js +200 -168
  169. package/src/rich-text-editor/renderer/link-module.d.ts +1 -1
  170. package/src/rich-text-editor/renderer/link-module.js +11 -2
  171. package/src/rich-text-editor/renderer/markdown-renderer.d.ts +6 -6
  172. package/src/rich-text-editor/renderer/markdown-renderer.js +6 -6
  173. package/src/rich-text-editor/renderer/popup-renderer.d.ts +5 -5
  174. package/src/rich-text-editor/renderer/popup-renderer.js +5 -5
  175. package/src/rich-text-editor/renderer/render.d.ts +2 -2
  176. package/src/rich-text-editor/renderer/render.js +2 -2
  177. package/src/rich-text-editor/renderer/table-module.d.ts +9 -2
  178. package/src/rich-text-editor/renderer/table-module.js +289 -137
  179. package/src/rich-text-editor/renderer/toolbar-renderer.d.ts +13 -9
  180. package/src/rich-text-editor/renderer/toolbar-renderer.js +103 -24
  181. package/src/rich-text-editor/renderer/video-module.d.ts +4 -1
  182. package/src/rich-text-editor/renderer/video-module.js +62 -35
  183. package/src/rich-text-editor/renderer/view-source.d.ts +7 -6
  184. package/src/rich-text-editor/renderer/view-source.js +18 -10
  185. package/src/rich-text-editor/services/renderer-factory.d.ts +3 -3
  186. package/src/rich-text-editor/services/renderer-factory.js +3 -3
  187. package/src/rich-text-editor/services/service-locator.d.ts +3 -3
  188. package/src/rich-text-editor/services/service-locator.js +3 -3
  189. package/src/selection/selection.d.ts +22 -22
  190. package/src/selection/selection.js +25 -22
  191. package/styles/_all.scss +1 -1
  192. package/styles/bootstrap-dark.css +153 -49
  193. package/styles/bootstrap.css +158 -57
  194. package/styles/bootstrap4.css +145 -45
  195. package/styles/bootstrap5-dark.css +150 -45
  196. package/styles/bootstrap5.css +150 -45
  197. package/styles/fabric-dark.css +139 -39
  198. package/styles/fabric.css +140 -40
  199. package/styles/fluent-dark.css +147 -41
  200. package/styles/fluent.css +147 -41
  201. package/styles/highcontrast-light.css +139 -39
  202. package/styles/highcontrast.css +143 -40
  203. package/styles/material-dark.css +143 -39
  204. package/styles/material.css +143 -39
  205. package/styles/material3-dark.css +155 -49
  206. package/styles/material3-dark.scss +1 -1
  207. package/styles/material3.css +155 -49
  208. package/styles/material3.scss +1 -1
  209. package/styles/rich-text-editor/_all.scss +2 -2
  210. package/styles/rich-text-editor/_bds-definition.scss +279 -0
  211. package/styles/rich-text-editor/_bootstrap-dark-definition.scss +281 -277
  212. package/styles/rich-text-editor/_bootstrap-definition.scss +337 -334
  213. package/styles/rich-text-editor/_bootstrap4-definition.scss +464 -460
  214. package/styles/rich-text-editor/_bootstrap5-definition.scss +266 -262
  215. package/styles/rich-text-editor/_fabric-dark-definition.scss +263 -259
  216. package/styles/rich-text-editor/_fabric-definition.scss +261 -257
  217. package/styles/rich-text-editor/_fluent-definition.scss +267 -263
  218. package/styles/rich-text-editor/_fusionnew-definition.scss +265 -261
  219. package/styles/rich-text-editor/_highcontrast-definition.scss +261 -257
  220. package/styles/rich-text-editor/_highcontrast-light-definition.scss +261 -257
  221. package/styles/rich-text-editor/_layout.scss +2249 -2147
  222. package/styles/rich-text-editor/_material-dark-definition.scss +266 -262
  223. package/styles/rich-text-editor/_material-definition.scss +264 -260
  224. package/styles/rich-text-editor/_material3-definition.scss +266 -262
  225. package/styles/rich-text-editor/_tailwind-definition.scss +261 -257
  226. package/styles/rich-text-editor/_theme.scss +906 -837
  227. package/styles/rich-text-editor/bootstrap-dark.css +153 -49
  228. package/styles/rich-text-editor/bootstrap.css +158 -57
  229. package/styles/rich-text-editor/bootstrap4.css +145 -45
  230. package/styles/rich-text-editor/bootstrap5-dark.css +150 -45
  231. package/styles/rich-text-editor/bootstrap5.css +150 -45
  232. package/styles/rich-text-editor/fabric-dark.css +139 -39
  233. package/styles/rich-text-editor/fabric.css +140 -40
  234. package/styles/rich-text-editor/fluent-dark.css +147 -41
  235. package/styles/rich-text-editor/fluent.css +147 -41
  236. package/styles/rich-text-editor/highcontrast-light.css +139 -39
  237. package/styles/rich-text-editor/highcontrast.css +143 -40
  238. package/styles/rich-text-editor/icons/_bds.scss +348 -0
  239. package/styles/rich-text-editor/icons/_bootstrap-dark.scss +349 -349
  240. package/styles/rich-text-editor/icons/_bootstrap.scss +349 -349
  241. package/styles/rich-text-editor/icons/_bootstrap4.scss +349 -349
  242. package/styles/rich-text-editor/icons/_bootstrap5.scss +348 -348
  243. package/styles/rich-text-editor/icons/_fabric-dark.scss +349 -349
  244. package/styles/rich-text-editor/icons/_fabric.scss +349 -349
  245. package/styles/rich-text-editor/icons/_fluent.scss +348 -348
  246. package/styles/rich-text-editor/icons/_fusionnew.scss +348 -348
  247. package/styles/rich-text-editor/icons/_highcontrast-light.scss +349 -349
  248. package/styles/rich-text-editor/icons/_highcontrast.scss +349 -349
  249. package/styles/rich-text-editor/icons/_material-dark.scss +349 -349
  250. package/styles/rich-text-editor/icons/_material.scss +349 -349
  251. package/styles/rich-text-editor/icons/_material3.scss +348 -348
  252. package/styles/rich-text-editor/icons/_tailwind.scss +348 -348
  253. package/styles/rich-text-editor/material-dark.css +143 -39
  254. package/styles/rich-text-editor/material.css +143 -39
  255. package/styles/rich-text-editor/material3-dark.css +155 -49
  256. package/styles/rich-text-editor/material3-dark.scss +1 -1
  257. package/styles/rich-text-editor/material3.css +155 -49
  258. package/styles/rich-text-editor/material3.scss +1 -1
  259. package/styles/rich-text-editor/tailwind-dark.css +194 -66
  260. package/styles/rich-text-editor/tailwind.css +194 -66
  261. package/styles/tailwind-dark.css +194 -66
  262. package/styles/tailwind.css +194 -66
  263. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +0 -41
  264. package/.github/PULL_REQUEST_TEMPLATE/Feature.md +0 -27
  265. package/dist/ej2-richtexteditor.min.js +0 -10
  266. package/dist/global/ej2-richtexteditor.min.js +0 -11
  267. package/dist/global/ej2-richtexteditor.min.js.map +0 -1
  268. package/dist/global/index.d.ts +0 -14
  269. 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,7 +444,7 @@ 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);
@@ -484,15 +484,17 @@ var DOMNode = /** @class */ (function () {
484
484
  * @param {NodeSelection} save - specifies the node selection.
485
485
  * @returns {void}
486
486
  * @hidden
487
-
487
+ * @deprecated
488
488
  */
489
489
  DOMNode.prototype.setMarker = function (save) {
490
490
  var range = save.range;
491
491
  var startChildNodes = range.startContainer.childNodes;
492
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;
493
495
  var start = ((isTableStart ? getLastTextNode(startChildNodes[range.startOffset + 1]) :
494
496
  startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) : range.startOffset]) || range.startContainer);
495
- 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]
496
498
  || range.endContainer);
497
499
  if ((start.nodeType === Node.ELEMENT_NODE && end.nodeType === Node.ELEMENT_NODE) && (start.contains(end) || end.contains(start))) {
498
500
  var existNode = start.contains(end) ? start : end;
@@ -563,7 +565,7 @@ var DOMNode = /** @class */ (function () {
563
565
  * @param {Range} range - specifies the range value
564
566
  * @returns {void}
565
567
  * @hidden
566
-
568
+ * @deprecated
567
569
  */
568
570
  DOMNode.prototype.ensureSelfClosingTag = function (start, className, range) {
569
571
  var isTable = false;
@@ -573,10 +575,13 @@ var DOMNode = /** @class */ (function () {
573
575
  else if (start.tagName === 'BR') {
574
576
  this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
575
577
  var markerStart = range.startContainer.querySelector('.' + className);
576
- markerStart.parentElement.appendChild(start);
578
+ if (markerStart) {
579
+ markerStart.parentElement.appendChild(start);
580
+ }
577
581
  }
578
582
  else {
579
- if (start.tagName === 'IMG') {
583
+ var tagName = !isNOU(start.parentElement) ? start.parentElement.tagName.toLocaleLowerCase() : '';
584
+ if (start.tagName === 'IMG' && tagName !== 'p' && tagName !== 'div') {
580
585
  var parNode = document.createElement('p');
581
586
  start.parentElement.insertBefore(parNode, start);
582
587
  parNode.appendChild(start);
@@ -621,7 +626,7 @@ var DOMNode = /** @class */ (function () {
621
626
  * @param {Element} element - specifies the element.
622
627
  * @returns {Element} - returns the element
623
628
  * @hidden
624
-
629
+ * @deprecated
625
630
  */
626
631
  DOMNode.prototype.createTempNode = function (element) {
627
632
  var textContent = element.textContent;
@@ -654,7 +659,7 @@ var DOMNode = /** @class */ (function () {
654
659
  *
655
660
  * @returns {void}
656
661
  * @hidden
657
-
662
+ * @deprecated
658
663
  */
659
664
  DOMNode.prototype.getImageTagInSelection = function () {
660
665
  var selection = this.getSelection();
@@ -666,11 +671,12 @@ var DOMNode = /** @class */ (function () {
666
671
  /**
667
672
  * blockNodes method
668
673
  *
674
+ * @param {boolean} action - Optional Boolean that specifies the action is whether performed.
669
675
  * @returns {Node[]} - returns the node array values
670
676
  * @hidden
671
-
677
+ * @deprecated
672
678
  */
673
- DOMNode.prototype.blockNodes = function () {
679
+ DOMNode.prototype.blockNodes = function (action) {
674
680
  var collectionNodes = [];
675
681
  var selection = this.getSelection();
676
682
  if (this.isEditorArea() && selection.rangeCount) {
@@ -684,23 +690,46 @@ var DOMNode = /** @class */ (function () {
684
690
  collectionNodes.push(startNode);
685
691
  }
686
692
  parentNode = this.blockParentNode(startNode);
693
+ var endParentNode = this.blockParentNode(endNode);
687
694
  if (parentNode && collectionNodes.indexOf(parentNode) < 0) {
688
- if (CONSTANT.IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
689
- startNode.nodeType === Node.TEXT_NODE ||
690
- startNode.classList.contains(markerClassName.startSelection) ||
691
- startNode.classList.contains(markerClassName.endSelection))) {
692
- var tempNode = startNode.previousSibling &&
693
- startNode.previousSibling.nodeType === Node.TEXT_NODE ?
694
- startNode.previousSibling : startNode;
695
- if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
696
- 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
+ }
697
710
  }
698
711
  else {
699
- collectionNodes.push(this.createTempNode(tempNode));
712
+ collectionNodes.push(parentNode);
700
713
  }
701
714
  }
702
715
  else {
703
- 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
+ }
704
733
  }
705
734
  }
706
735
  var nodes = [];
@@ -769,6 +798,131 @@ var DOMNode = /** @class */ (function () {
769
798
  DOMNode.prototype.ignoreTableTag = function (element) {
770
799
  return !(CONSTANT.TABLE_BLOCK_TAGS.indexOf(element.tagName.toLocaleLowerCase()) >= 0);
771
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
+ };
772
926
  return DOMNode;
773
927
  }());
774
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;