jodit 4.18.4 → 4.18.6

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 (194) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/es2015/jodit.css +13 -34
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +11 -11
  5. package/es2015/jodit.js +1029 -205
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +11 -11
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +11 -11
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +11 -11
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +13 -34
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +15 -15
  23. package/es2021/jodit.js +1021 -203
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +15 -15
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +13 -34
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +15 -15
  35. package/es2021.en/jodit.js +995 -177
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +15 -15
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +14 -41
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +1152 -254
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/config.d.ts +3 -0
  60. package/esm/core/constants.js +1 -1
  61. package/esm/core/helpers/html/apply-styles.js +3 -0
  62. package/esm/core/helpers/html/clean-from-word.js +3 -0
  63. package/esm/core/helpers/html/strip-tags.js +24 -6
  64. package/esm/core/helpers/html/word-lists.d.ts +29 -0
  65. package/esm/core/helpers/html/word-lists.js +158 -0
  66. package/esm/core/selection/helpers/index.d.ts +1 -0
  67. package/esm/core/selection/helpers/index.js +1 -0
  68. package/esm/core/selection/helpers/is-moved.d.ts +15 -0
  69. package/esm/core/selection/helpers/is-moved.js +22 -0
  70. package/esm/core/selection/style/api/list/toggle-ordered-list.js +40 -3
  71. package/esm/core/selection/style/transactions.js +5 -2
  72. package/esm/langs/ar.d.ts +3 -0
  73. package/esm/langs/ar.js +4 -1
  74. package/esm/langs/az.d.ts +3 -0
  75. package/esm/langs/az.js +4 -1
  76. package/esm/langs/cs_cz.d.ts +3 -0
  77. package/esm/langs/cs_cz.js +4 -1
  78. package/esm/langs/de.d.ts +3 -0
  79. package/esm/langs/de.js +4 -1
  80. package/esm/langs/es.d.ts +3 -0
  81. package/esm/langs/es.js +4 -1
  82. package/esm/langs/fa.d.ts +3 -0
  83. package/esm/langs/fa.js +4 -1
  84. package/esm/langs/fi.d.ts +3 -0
  85. package/esm/langs/fi.js +4 -1
  86. package/esm/langs/fr.d.ts +3 -0
  87. package/esm/langs/fr.js +4 -1
  88. package/esm/langs/he.d.ts +3 -0
  89. package/esm/langs/he.js +4 -1
  90. package/esm/langs/hu.d.ts +3 -0
  91. package/esm/langs/hu.js +4 -1
  92. package/esm/langs/id.d.ts +3 -0
  93. package/esm/langs/id.js +4 -1
  94. package/esm/langs/it.d.ts +3 -0
  95. package/esm/langs/it.js +4 -1
  96. package/esm/langs/ja.d.ts +3 -0
  97. package/esm/langs/ja.js +4 -1
  98. package/esm/langs/ko.d.ts +3 -0
  99. package/esm/langs/ko.js +4 -1
  100. package/esm/langs/mn.d.ts +3 -0
  101. package/esm/langs/mn.js +4 -1
  102. package/esm/langs/nl.d.ts +3 -0
  103. package/esm/langs/nl.js +4 -1
  104. package/esm/langs/no.d.ts +3 -0
  105. package/esm/langs/no.js +4 -1
  106. package/esm/langs/pl.d.ts +3 -0
  107. package/esm/langs/pl.js +4 -1
  108. package/esm/langs/pt_br.d.ts +3 -0
  109. package/esm/langs/pt_br.js +4 -1
  110. package/esm/langs/ru.d.ts +3 -0
  111. package/esm/langs/ru.js +4 -1
  112. package/esm/langs/sk.d.ts +3 -0
  113. package/esm/langs/sk.js +4 -1
  114. package/esm/langs/sv.d.ts +3 -0
  115. package/esm/langs/sv.js +4 -1
  116. package/esm/langs/tr.d.ts +3 -0
  117. package/esm/langs/tr.js +4 -1
  118. package/esm/langs/ua.d.ts +3 -0
  119. package/esm/langs/ua.js +4 -1
  120. package/esm/langs/zh_cn.d.ts +3 -0
  121. package/esm/langs/zh_cn.js +4 -1
  122. package/esm/langs/zh_tw.d.ts +3 -0
  123. package/esm/langs/zh_tw.js +4 -1
  124. package/esm/modules/dialog/dialog.d.ts +7 -0
  125. package/esm/modules/dialog/dialog.js +24 -6
  126. package/esm/modules/table/table.d.ts +6 -0
  127. package/esm/modules/table/table.js +18 -26
  128. package/esm/plugins/backspace/cases/check-join-neighbors.js +90 -3
  129. package/esm/plugins/clean-html/clean-html.d.ts +8 -0
  130. package/esm/plugins/clean-html/clean-html.js +21 -1
  131. package/esm/plugins/clean-html/helpers/index.d.ts +1 -0
  132. package/esm/plugins/clean-html/helpers/index.js +1 -0
  133. package/esm/plugins/clean-html/helpers/remove-placeholder-br.d.ts +16 -0
  134. package/esm/plugins/clean-html/helpers/remove-placeholder-br.js +51 -0
  135. package/esm/plugins/delete/delete.d.ts +11 -1
  136. package/esm/plugins/delete/delete.js +92 -16
  137. package/esm/plugins/focus/focus.js +12 -1
  138. package/esm/plugins/iframe/config.d.ts +3 -0
  139. package/esm/plugins/iframe/config.js +0 -27
  140. package/esm/plugins/iframe/iframe.js +8 -1
  141. package/esm/plugins/image-processor/image-processor.js +6 -1
  142. package/esm/plugins/inline-popup/inline-popup.d.ts +19 -0
  143. package/esm/plugins/inline-popup/inline-popup.js +70 -1
  144. package/esm/plugins/ordered-list/config.js +13 -2
  145. package/esm/plugins/ordered-list/start-dialog.d.ts +19 -0
  146. package/esm/plugins/ordered-list/start-dialog.js +58 -0
  147. package/esm/plugins/placeholder/placeholder.js +7 -1
  148. package/esm/plugins/resizer/resizer.d.ts +10 -0
  149. package/esm/plugins/resizer/resizer.js +76 -2
  150. package/esm/plugins/select-cells/select-cells.d.ts +23 -0
  151. package/esm/plugins/select-cells/select-cells.js +75 -1
  152. package/esm/plugins/table-keyboard-navigation/table-keyboard-navigation.js +3 -2
  153. package/package.json +1 -1
  154. package/types/config.d.ts +3 -0
  155. package/types/core/helpers/html/word-lists.d.ts +29 -0
  156. package/types/core/selection/helpers/index.d.ts +1 -0
  157. package/types/core/selection/helpers/is-moved.d.ts +15 -0
  158. package/types/langs/ar.d.ts +3 -0
  159. package/types/langs/az.d.ts +3 -0
  160. package/types/langs/cs_cz.d.ts +3 -0
  161. package/types/langs/de.d.ts +3 -0
  162. package/types/langs/es.d.ts +3 -0
  163. package/types/langs/fa.d.ts +3 -0
  164. package/types/langs/fi.d.ts +3 -0
  165. package/types/langs/fr.d.ts +3 -0
  166. package/types/langs/he.d.ts +3 -0
  167. package/types/langs/hu.d.ts +3 -0
  168. package/types/langs/id.d.ts +3 -0
  169. package/types/langs/it.d.ts +3 -0
  170. package/types/langs/ja.d.ts +3 -0
  171. package/types/langs/ko.d.ts +3 -0
  172. package/types/langs/mn.d.ts +3 -0
  173. package/types/langs/nl.d.ts +3 -0
  174. package/types/langs/no.d.ts +3 -0
  175. package/types/langs/pl.d.ts +3 -0
  176. package/types/langs/pt_br.d.ts +3 -0
  177. package/types/langs/ru.d.ts +3 -0
  178. package/types/langs/sk.d.ts +3 -0
  179. package/types/langs/sv.d.ts +3 -0
  180. package/types/langs/tr.d.ts +3 -0
  181. package/types/langs/ua.d.ts +3 -0
  182. package/types/langs/zh_cn.d.ts +3 -0
  183. package/types/langs/zh_tw.d.ts +3 -0
  184. package/types/modules/dialog/dialog.d.ts +7 -0
  185. package/types/modules/table/table.d.ts +6 -0
  186. package/types/plugins/clean-html/clean-html.d.ts +8 -0
  187. package/types/plugins/clean-html/helpers/index.d.ts +1 -0
  188. package/types/plugins/clean-html/helpers/remove-placeholder-br.d.ts +16 -0
  189. package/types/plugins/delete/delete.d.ts +11 -1
  190. package/types/plugins/iframe/config.d.ts +3 -0
  191. package/types/plugins/inline-popup/inline-popup.d.ts +19 -0
  192. package/types/plugins/ordered-list/start-dialog.d.ts +19 -0
  193. package/types/plugins/resizer/resizer.d.ts +10 -0
  194. package/types/plugins/select-cells/select-cells.d.ts +23 -0
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.18.4
4
+ * Version: v4.18.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1822,7 +1822,7 @@ __webpack_require__.r(__webpack_exports__);
1822
1822
  * ```
1823
1823
  * @packageDocumentation
1824
1824
  * @module constants
1825
- */ const APP_VERSION = "4.18.4";
1825
+ */ const APP_VERSION = "4.18.6";
1826
1826
  // prettier-ignore
1827
1827
  const ES = "es2021";
1828
1828
  const IS_ES_MODERN = true;
@@ -5855,10 +5855,11 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
5855
5855
  /* harmony export */ });
5856
5856
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
5857
5857
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
5858
- /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
5859
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7909);
5860
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80991);
5861
- /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28723);
5858
+ /* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(75480);
5859
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4040);
5860
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
5861
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(80991);
5862
+ /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28723);
5862
5863
  /*!
5863
5864
  * Jodit Editor (https://xdsoft.net/jodit/)
5864
5865
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -5871,6 +5872,7 @@ const isLicense = (license)=>(0,_is_string__WEBPACK_IMPORTED_MODULE_0__.isString
5871
5872
 
5872
5873
 
5873
5874
 
5875
+
5874
5876
  function normalizeCSS(s) {
5875
5877
  return s.replace(/mso-[a-z-]+:[\s]*[^;]+;/gi, '').replace(/mso-[a-z-]+:[\s]*[^";']+$/gi, '').replace(/border[a-z-]*:[\s]*[^;]+;/gi, '').replace(/([0-9.]+)(pt|cm)/gi, (match, units, metrics)=>{
5876
5878
  switch(metrics.toLowerCase()){
@@ -5904,7 +5906,7 @@ function normalizeCSS(s) {
5904
5906
  html = html.substring(0, closeIndex + '</html>'.length);
5905
5907
  }
5906
5908
  const iframe = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('iframe');
5907
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(iframe, 'display', 'none');
5909
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_5__.css)(iframe, 'display', 'none');
5908
5910
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.body, iframe);
5909
5911
  let convertedString = '', collection;
5910
5912
  try {
@@ -5913,13 +5915,14 @@ function normalizeCSS(s) {
5913
5915
  iframeDoc.open();
5914
5916
  iframeDoc.write(html);
5915
5917
  iframeDoc.close();
5918
+ const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__.readWordListItems)(iframeDoc.body);
5916
5919
  // Word marks its auto-generated list markers (the literal
5917
5920
  // bullet/number, e.g. `1.` or `·`) with `mso-list:Ignore`.
5918
5921
  // They are display-only and must not be imported, otherwise
5919
5922
  // the marker text leaks into the content. Drop them before any
5920
5923
  // style normalization strips the `mso-list` hint. See #948
5921
5924
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
5922
- if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(node, 'style') || '')) {
5925
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && /mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style') || '')) {
5923
5926
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node);
5924
5927
  }
5925
5928
  });
@@ -5930,7 +5933,7 @@ function normalizeCSS(s) {
5930
5933
  if (rules[idx].selectorText === '') {
5931
5934
  continue;
5932
5935
  }
5933
- collection = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_5__.$$)(rules[idx].selectorText, iframeDoc.body);
5936
+ collection = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_6__.$$)(rules[idx].selectorText, iframeDoc.body);
5934
5937
  // `style.cssText` on purpose: the CSSOM parses the text,
5935
5938
  // drops invalid declarations and re-serializes it. The raw
5936
5939
  // `style` attribute would keep Word-only junk verbatim
@@ -5944,18 +5947,19 @@ function normalizeCSS(s) {
5944
5947
  throw e;
5945
5948
  }
5946
5949
  }
5950
+ ;(0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_2__.wrapWordListItems)(listItems);
5947
5951
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(iframeDoc.body, (node)=>{
5948
5952
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node)) {
5949
- const cssText = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(node, 'style');
5953
+ const cssText = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style');
5950
5954
  if (cssText) {
5951
5955
  node.style.cssText = normalizeCSS(cssText);
5952
5956
  }
5953
- if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(node, 'style')) {
5954
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_3__.attr)(node, 'style', null);
5957
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style')) {
5958
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style', null);
5955
5959
  }
5956
5960
  }
5957
5961
  });
5958
- convertedString = iframeDoc.firstChild ? (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trim)(iframeDoc.body.innerHTML) : '';
5962
+ convertedString = iframeDoc.firstChild ? (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim)(iframeDoc.body.innerHTML) : '';
5959
5963
  }
5960
5964
  } catch {} finally{
5961
5965
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(iframe);
@@ -5963,7 +5967,7 @@ function normalizeCSS(s) {
5963
5967
  if (convertedString) {
5964
5968
  html = convertedString;
5965
5969
  }
5966
- return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trim)(html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, ''));
5970
+ return (0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim)(html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, ''));
5967
5971
  }
5968
5972
 
5969
5973
 
@@ -5979,8 +5983,9 @@ function normalizeCSS(s) {
5979
5983
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
5980
5984
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
5981
5985
  /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88475);
5982
- /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4040);
5983
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7909);
5986
+ /* harmony import */ var jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(75480);
5987
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4040);
5988
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7909);
5984
5989
  /*!
5985
5990
  * Jodit Editor (https://xdsoft.net/jodit/)
5986
5991
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -5992,6 +5997,7 @@ function normalizeCSS(s) {
5992
5997
 
5993
5998
 
5994
5999
 
6000
+
5995
6001
  /**
5996
6002
  * The method automatically cleans up content from Microsoft Word and other HTML sources to ensure clean, compliant
5997
6003
  * content that matches the look and feel of the site.
@@ -6005,6 +6011,7 @@ function normalizeCSS(s) {
6005
6011
  const div = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('div');
6006
6012
  div.innerHTML = html;
6007
6013
  const marks = [];
6014
+ const listItems = (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.readWordListItems)(div);
6008
6015
  if (div.firstChild) {
6009
6016
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(div, (node)=>{
6010
6017
  if (!node) {
@@ -6029,7 +6036,7 @@ function normalizeCSS(s) {
6029
6036
  // with `mso-list:Ignore`. They are display-only
6030
6037
  // and must not be imported, otherwise the marker
6031
6038
  // text leaks into the content. See #948
6032
- if (/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attr)(node, 'style') || '')) {
6039
+ if (/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attr)(node, 'style') || '')) {
6033
6040
  marks.push(node);
6034
6041
  break;
6035
6042
  }
@@ -6043,7 +6050,7 @@ function normalizeCSS(s) {
6043
6050
  // `attrRaw`: SVG keeps camelCase names
6044
6051
  // (`viewBox`), `attr()` would kebab-case
6045
6052
  // them and silently skip the removal
6046
- (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_4__.attrRaw)(node, attribute.name, null);
6053
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_5__.attrRaw)(node, attribute.name, null);
6047
6054
  }
6048
6055
  });
6049
6056
  }
@@ -6056,12 +6063,13 @@ function normalizeCSS(s) {
6056
6063
  });
6057
6064
  }
6058
6065
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove.apply(null, marks);
6066
+ (0,jodit_core_helpers_html_word_lists__WEBPACK_IMPORTED_MODULE_3__.wrapWordListItems)(listItems);
6059
6067
  convertedString = div.innerHTML;
6060
6068
  } catch (e) {}
6061
6069
  if (convertedString) {
6062
6070
  html = convertedString;
6063
6071
  }
6064
- html = html.split(/(\n)/).filter(jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_3__.trim).join('\n');
6072
+ html = html.split(/(\n)/).filter(jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_4__.trim).join('\n');
6065
6073
  return html.replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '').replace(/<!--[^>]*>/g, '');
6066
6074
  }
6067
6075
 
@@ -6404,7 +6412,14 @@ const NEW_LINE_TAGS = new Set([
6404
6412
  'h4',
6405
6413
  'h5',
6406
6414
  'h6',
6407
- 'hr'
6415
+ 'hr',
6416
+ 'ul',
6417
+ 'ol',
6418
+ 'li'
6419
+ ]);
6420
+ const LIST_TAGS = new Set([
6421
+ 'ul',
6422
+ 'ol'
6408
6423
  ]);
6409
6424
  const INVISIBLE_TAGS = new Set([
6410
6425
  'script',
@@ -6430,6 +6445,16 @@ const ALONE_TAGS = new Set([
6430
6445
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.each(tmp, (node)=>{
6431
6446
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(node) && all.push(node);
6432
6447
  });
6448
+ // By default blocks are joined with a single space (single-line
6449
+ // plain text). When `blockBr` is set, separate them with a line
6450
+ // break instead, so paragraph structure survives — e.g. the
6451
+ // "Insert only Text" paste option. See #1232
6452
+ const separators = new Set();
6453
+ const separator = ()=>{
6454
+ const text = doc.createTextNode(blockBr ? '%%%jodit-single-br%%%' : ' ');
6455
+ separators.add(text);
6456
+ return text;
6457
+ };
6433
6458
  all.forEach((p)=>{
6434
6459
  const pr = p.parentNode;
6435
6460
  if (!pr) {
@@ -6449,16 +6474,17 @@ const ALONE_TAGS = new Set([
6449
6474
  if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, NEW_LINE_TAGS)) {
6450
6475
  return;
6451
6476
  }
6477
+ const pv = p.previousSibling;
6478
+ // A nested list starts on a new line after its item's own text
6479
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(p, LIST_TAGS) && pv && !separators.has(pv) && !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(pv) && /\s$/.test(pv.nodeValue || ''))) {
6480
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(p, separator());
6481
+ }
6452
6482
  const nx = p.nextSibling;
6453
6483
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(nx) && /^\s/.test(nx.nodeValue || '')) {
6454
6484
  return;
6455
6485
  }
6456
6486
  if (nx) {
6457
- // By default blocks are joined with a single space (single-line
6458
- // plain text). When `blockBr` is set, separate them with a line
6459
- // break instead, so paragraph structure survives — e.g. the
6460
- // "Insert only Text" paste option. See #1232
6461
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(nx, doc.createTextNode(blockBr ? '%%%jodit-single-br%%%' : ' '));
6487
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(nx, separator());
6462
6488
  }
6463
6489
  });
6464
6490
  return restoreTags((0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trim)(tmp.innerText));
@@ -6468,6 +6494,181 @@ function restoreTags(content) {
6468
6494
  }
6469
6495
 
6470
6496
 
6497
+ /***/ }),
6498
+
6499
+ /***/ 75480:
6500
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6501
+
6502
+ "use strict";
6503
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6504
+ /* harmony export */ readWordListItems: function() { return /* binding */ readWordListItems; },
6505
+ /* harmony export */ wrapWordListItems: function() { return /* binding */ wrapWordListItems; }
6506
+ /* harmony export */ });
6507
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
6508
+ /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88475);
6509
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
6510
+ /*!
6511
+ * Jodit Editor (https://xdsoft.net/jodit/)
6512
+ * Released under MIT see LICENSE.txt in the project root for license information.
6513
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
6514
+ */ /**
6515
+ * @module helpers/html
6516
+ */
6517
+
6518
+
6519
+ const ROMAN = {
6520
+ i: 1,
6521
+ v: 5,
6522
+ x: 10,
6523
+ l: 50,
6524
+ c: 100,
6525
+ d: 500,
6526
+ m: 1000
6527
+ };
6528
+ function romanValue(roman) {
6529
+ let value = 0;
6530
+ for(let i = 0; i < roman.length; i += 1){
6531
+ const current = ROMAN[roman[i]], next = ROMAN[roman[i + 1]] || 0;
6532
+ value += current < next ? -current : current;
6533
+ }
6534
+ return value;
6535
+ }
6536
+ /**
6537
+ * Word's marker text (`1.`, `b)`, `iv.`, `·`, `o`, `§`) decides the list type
6538
+ */ function parseMarker(marker) {
6539
+ const text = marker.replace(/\s+/g, '');
6540
+ const decimal = /^\(?(?:\d+\.)*(\d+)[.)]?$/.exec(text);
6541
+ if (decimal) {
6542
+ return {
6543
+ tag: 'ol',
6544
+ listStyleType: null,
6545
+ start: Number(decimal[1])
6546
+ };
6547
+ }
6548
+ const letters = /^\(?([a-z]+|[A-Z]+)[.)]$/.exec(text);
6549
+ if (letters) {
6550
+ const value = letters[1], lower = value.toLowerCase(), upper = value !== lower;
6551
+ if (/^[ivxlcdm]+$/.test(lower) && (lower.length > 1 || lower === 'i')) {
6552
+ return {
6553
+ tag: 'ol',
6554
+ listStyleType: upper ? 'upper-roman' : 'lower-roman',
6555
+ start: romanValue(lower)
6556
+ };
6557
+ }
6558
+ // Word continues a lettered list with aa, bb, ...
6559
+ if (/^([a-z])\1*$/.test(lower)) {
6560
+ return {
6561
+ tag: 'ol',
6562
+ listStyleType: upper ? 'upper-alpha' : 'lower-alpha',
6563
+ start: (lower.length - 1) * 26 + lower.charCodeAt(0) - 96
6564
+ };
6565
+ }
6566
+ }
6567
+ return {
6568
+ tag: 'ul',
6569
+ listStyleType: null,
6570
+ start: 1
6571
+ };
6572
+ }
6573
+ /**
6574
+ * Removes the marker and the wrappers it leaves empty
6575
+ */ function removeMarker(marker, paragraph) {
6576
+ let parent = marker.parentNode;
6577
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(marker);
6578
+ while(parent && parent !== paragraph && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(parent) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(parent)){
6579
+ const next = parent.parentNode;
6580
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(parent);
6581
+ parent = next;
6582
+ }
6583
+ }
6584
+ /**
6585
+ * Finds Word's list paragraphs (`<p style="mso-list:l0 level1 lfo1">`), reads
6586
+ * their list, level and type from the `mso-list:Ignore` marker, and removes the
6587
+ * marker. Call it before anything strips the `mso-list` styles, then pass the
6588
+ * result to {@link wrapWordListItems}
6589
+ */ function readWordListItems(root) {
6590
+ const items = [];
6591
+ (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(root.querySelectorAll('p')).forEach((paragraph)=>{
6592
+ const match = /mso-list:\s*l(\d+)\s+level(\d+)(?:\s+lfo(\d+))?/i.exec((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(paragraph, 'style') || '');
6593
+ if (!match) {
6594
+ return;
6595
+ }
6596
+ const marker = (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(paragraph.querySelectorAll('[style]')).find((elm)=>/mso-list:\s*ignore/i.test((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(elm, 'style') || ''));
6597
+ items.push({
6598
+ paragraph,
6599
+ list: `${match[1]}:${match[3] || ''}`,
6600
+ level: Number(match[2]),
6601
+ ...parseMarker(marker?.textContent || '')
6602
+ });
6603
+ if (marker) {
6604
+ removeMarker(marker, paragraph);
6605
+ }
6606
+ });
6607
+ return items;
6608
+ }
6609
+ function isAdjacent(prev, item) {
6610
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(item.paragraph, true, (n)=>!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmptyTextNode(n) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isComment(n)) === prev.paragraph;
6611
+ }
6612
+ /**
6613
+ * Turns the paragraphs found by {@link readWordListItems} into `<ul>`/`<ol>`
6614
+ * lists, nesting them by level. Each paragraph becomes an `<li>` without Word's
6615
+ * hanging indent
6616
+ */ function wrapWordListItems(items) {
6617
+ let stack = [];
6618
+ const continues = items.map((item, index)=>index > 0 && isAdjacent(items[index - 1], item));
6619
+ items.forEach((item, index)=>{
6620
+ const { paragraph } = item;
6621
+ if (!continues[index]) {
6622
+ stack = [];
6623
+ }
6624
+ while(stack.length && stack[stack.length - 1].level > item.level){
6625
+ stack.pop();
6626
+ }
6627
+ let top = stack[stack.length - 1];
6628
+ if (top && top.level === item.level && top.list !== item.list) {
6629
+ stack.pop();
6630
+ top = stack[stack.length - 1];
6631
+ }
6632
+ const doc = paragraph.ownerDocument;
6633
+ if (!top || top.level < item.level) {
6634
+ const element = doc.createElement(item.tag);
6635
+ if (item.listStyleType) {
6636
+ element.style.listStyleType = item.listStyleType;
6637
+ }
6638
+ if (item.tag === 'ol' && item.start !== 1) {
6639
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(element, 'start', item.start);
6640
+ }
6641
+ if (top && top.li) {
6642
+ top.li.appendChild(element);
6643
+ } else {
6644
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before(paragraph, element);
6645
+ }
6646
+ top = {
6647
+ level: item.level,
6648
+ list: item.list,
6649
+ element
6650
+ };
6651
+ stack.push(top);
6652
+ }
6653
+ const li = doc.createElement('li');
6654
+ (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_1__.toArray)(paragraph.attributes).forEach((attribute)=>{
6655
+ if (attribute.name !== 'class') {
6656
+ li.setAttribute(attribute.name, attribute.value);
6657
+ }
6658
+ });
6659
+ li.style.removeProperty('margin-left');
6660
+ li.style.removeProperty('text-indent');
6661
+ if (!(0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(li, 'style')) {
6662
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(li, 'style', null);
6663
+ }
6664
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.moveContent(paragraph, li);
6665
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(paragraph);
6666
+ top.element.appendChild(li);
6667
+ top.li = li;
6668
+ });
6669
+ }
6670
+
6671
+
6471
6672
  /***/ }),
6472
6673
 
6473
6674
  /***/ 65946:
@@ -10798,13 +10999,15 @@ function usable(ranges, shadowRoot) {
10798
10999
  /* harmony export */ composedRanges: function() { return /* reexport safe */ _composed_ranges__WEBPACK_IMPORTED_MODULE_2__.composedRanges; },
10799
11000
  /* harmony export */ cursorInTheEdgeOfString: function() { return /* binding */ cursorInTheEdgeOfString; },
10800
11001
  /* harmony export */ findCorrectCurrentNode: function() { return /* binding */ findCorrectCurrentNode; },
10801
- /* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_3__.moveNodeInsideStart; }
11002
+ /* harmony export */ isMoved: function() { return /* reexport safe */ _is_moved__WEBPACK_IMPORTED_MODULE_3__.isMoved; },
11003
+ /* harmony export */ moveNodeInsideStart: function() { return /* reexport safe */ _move_node_inside_start__WEBPACK_IMPORTED_MODULE_4__.moveNodeInsideStart; }
10802
11004
  /* harmony export */ });
10803
11005
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
10804
11006
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
10805
11007
  /* harmony import */ var _composed_ranges__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43134);
10806
- /* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(89817);
10807
- /* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7470);
11008
+ /* harmony import */ var _is_moved__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(90657);
11009
+ /* harmony import */ var _move_node_inside_start__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89817);
11010
+ /* harmony import */ var _move_the_node_along_the_edge_outward__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7470);
10808
11011
  /*!
10809
11012
  * Jodit Editor (https://xdsoft.net/jodit/)
10810
11013
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -10816,6 +11019,7 @@ function usable(ranges, shadowRoot) {
10816
11019
 
10817
11020
 
10818
11021
 
11022
+
10819
11023
  /**
10820
11024
  * Despite the name, returns `true` when the cursor is NOT at the checked edge
10821
11025
  * of the text node: there is significant (non invisible-space) text between
@@ -10870,6 +11074,36 @@ function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild,
10870
11074
  }
10871
11075
 
10872
11076
 
11077
+ /***/ }),
11078
+
11079
+ /***/ 90657:
11080
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
11081
+
11082
+ "use strict";
11083
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11084
+ /* harmony export */ isMoved: function() { return /* binding */ isMoved; }
11085
+ /* harmony export */ });
11086
+ /*!
11087
+ * Jodit Editor (https://xdsoft.net/jodit/)
11088
+ * Released under MIT see LICENSE.txt in the project root for license information.
11089
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
11090
+ */ /**
11091
+ * @module selection
11092
+ */ /**
11093
+ * Whether the selection, `before` as it was when a key went down, has since
11094
+ * moved to somewhere else in the editor
11095
+ * @private
11096
+ */ function isMoved(jodit, before) {
11097
+ const { s } = jodit;
11098
+ // Selecting table cells, for one, removes the selection altogether
11099
+ if (!before || !s.isInsideArea) {
11100
+ return false;
11101
+ }
11102
+ const { range } = s;
11103
+ return range.startContainer !== before.startContainer || range.startOffset !== before.startOffset || range.endContainer !== before.endContainer || range.endOffset !== before.endOffset;
11104
+ }
11105
+
11106
+
10873
11107
  /***/ }),
10874
11108
 
10875
11109
  /***/ 89817:
@@ -12925,12 +13159,14 @@ function elementsEqualAttributes(elm1, elm2) {
12925
13159
  /* harmony export */ toggleOrderedList: function() { return /* binding */ toggleOrderedList; }
12926
13160
  /* harmony export */ });
12927
13161
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
12928
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28712);
12929
- /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__);
12930
- /* harmony import */ var jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17481);
12931
- /* harmony import */ var jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(82794);
12932
- /* harmony import */ var jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(98394);
12933
- /* harmony import */ var _wrap_list__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97110);
13162
+ /* harmony import */ var jodit_core_helpers_size_object_size__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18073);
13163
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28712);
13164
+ /* harmony import */ var jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__);
13165
+ /* harmony import */ var jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(17481);
13166
+ /* harmony import */ var jodit_core_selection_style_api_is_same_attributes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(95971);
13167
+ /* harmony import */ var jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(82794);
13168
+ /* harmony import */ var jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98394);
13169
+ /* harmony import */ var _wrap_list__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97110);
12934
13170
  /*!
12935
13171
  * Jodit Editor (https://xdsoft.net/jodit/)
12936
13172
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -12941,6 +13177,8 @@ function elementsEqualAttributes(elm1, elm2) {
12941
13177
 
12942
13178
 
12943
13179
 
13180
+
13181
+
12944
13182
  /**
12945
13183
  * Replaces `ul->ol` or `ol->ul`, apply styles to the list, or remove a list item from it
12946
13184
  * @private
@@ -12952,39 +13190,69 @@ function elementsEqualAttributes(elm1, elm2) {
12952
13190
  if (!list) {
12953
13191
  return mode;
12954
13192
  }
12955
- const result = jodit.e.fire(`${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__._PREFIX}BeforeToggleList`, mode, commitStyle, list);
13193
+ const result = jodit.e.fire(`${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeToggleList`, mode, commitStyle, list);
12956
13194
  if (result !== undefined) {
12957
13195
  return result;
12958
13196
  }
12959
- const hook = jodit.e.fire.bind(jodit.e, `${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__._PREFIX}AfterToggleList`);
13197
+ const hook = jodit.e.fire.bind(jodit.e, `${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}AfterToggleList`);
12960
13198
  if (mode !== (/* inlined export .UNWRAP */"unwrap")) {
12961
- const isChangeMode = (0,jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_3__.toggleAttributes)(commitStyle, li.parentElement, jodit, jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL, true) === (/* inlined export .CHANGE */"change");
13199
+ const isChangeMode = (0,jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__.toggleAttributes)(commitStyle, li.parentElement, jodit, jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.INITIAL, true) === (/* inlined export .CHANGE */"change");
13200
+ const isSameList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(list, commitStyle.element);
13201
+ // ol => ol[style="list-style-type: lower-roman"]: a list's style
13202
+ // belongs to the whole list, so it is changed without splitting it
13203
+ if (isSameList && isChangeMode && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE && changesStyleOnly(commitStyle)) {
13204
+ (0,jodit_core_selection_style_api_toggle_attributes__WEBPACK_IMPORTED_MODULE_5__.toggleAttributes)(commitStyle, list, jodit, (/* inlined export .CHANGE */"change"));
13205
+ hook((/* inlined export .CHANGE */"change"), joinPrevious(commitStyle, list, mode), commitStyle);
13206
+ return (/* inlined export .CHANGE */"change");
13207
+ }
13208
+ // Restyled already, for an earlier part of the selection
13209
+ if (isSameList && mode === (/* inlined export .CHANGE */"change")) {
13210
+ return (/* inlined export .CHANGE */"change");
13211
+ }
12962
13212
  // ul => ol, ol => ul or ul => ul.class1
12963
- if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE || isChangeMode || list.tagName.toLowerCase() !== commitStyle.element) {
12964
- const wrapper = unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE, list, li, jodit, commitStyle);
12965
- const newList = (0,_wrap_list__WEBPACK_IMPORTED_MODULE_5__.wrapList)(commitStyle, wrapper, jodit);
12966
- hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE, newList, commitStyle);
12967
- return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE;
13213
+ if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE || isChangeMode || !isSameList) {
13214
+ const wrapper = unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, list, li, jodit, commitStyle);
13215
+ const newList = (0,_wrap_list__WEBPACK_IMPORTED_MODULE_7__.wrapList)(commitStyle, wrapper, jodit);
13216
+ hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, newList, commitStyle);
13217
+ return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE;
12968
13218
  }
12969
13219
  }
12970
13220
  const wrapper = unwrapList((/* inlined export .UNWRAP */"unwrap"), list, li, jodit, commitStyle);
12971
13221
  hook((/* inlined export .UNWRAP */"unwrap"), wrapper, commitStyle);
12972
13222
  return (/* inlined export .UNWRAP */"unwrap");
12973
13223
  }
13224
+ /**
13225
+ * Other attributes, such as a class, still move the items into a new list,
13226
+ * where the `beforeWrapList` hook can add markup to each of them
13227
+ */ function changesStyleOnly({ options: { attributes } }) {
13228
+ return Boolean(attributes?.style) && (0,jodit_core_helpers_size_object_size__WEBPACK_IMPORTED_MODULE_1__.size)(attributes) === 1;
13229
+ }
13230
+ /**
13231
+ * Joins a restyled list to the list before it, when the selection runs on
13232
+ * from that list and the two now match
13233
+ */ function joinPrevious(commitStyle, list, mode) {
13234
+ const prev = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(list, true);
13235
+ if (mode !== (/* inlined export .CHANGE */"change") || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(prev, commitStyle.element) || !(0,jodit_core_selection_style_api_is_same_attributes__WEBPACK_IMPORTED_MODULE_4__.elementsEqualAttributes)(prev, list)) {
13236
+ return list;
13237
+ }
13238
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.append(prev, Array.from(list.childNodes));
13239
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(list);
13240
+ return prev;
13241
+ }
12974
13242
  function unwrapList(mode, list, li, jodit, cs) {
12975
- const result = jodit.e.fire(`${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__._PREFIX}BeforeUnwrapList`, mode, list, cs);
13243
+ const result = jodit.e.fire(`${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeUnwrapList`, mode, list, cs);
12976
13244
  if (result) {
12977
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(result), `${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__._PREFIX}BeforeUnwrapList hook must return HTMLElement`);
13245
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(result), `${jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__._PREFIX}BeforeUnwrapList hook must return HTMLElement`);
12978
13246
  return result;
12979
13247
  }
12980
- ;(0,jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_2__.extractSelectedPart)(list, li, jodit);
12981
- (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_1__.assert)(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(li.parentElement), 'Element should be inside the list');
13248
+ ;(0,jodit_core_selection_style_api_extract__WEBPACK_IMPORTED_MODULE_3__.extractSelectedPart)(list, li, jodit);
13249
+ (0,jodit_core_helpers_utils_assert__WEBPACK_IMPORTED_MODULE_2__.assert)(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isHTMLElement(li.parentElement), 'Element should be inside the list');
12982
13250
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(li.parentElement);
12983
13251
  // In the REPLACE mode the content will be immediately wrapped in a `li`
12984
13252
  // of the new list inside `wrapList`, so it should stay in the document.
12985
13253
  // Replacing it with a fragment here would dissolve the content
12986
13254
  // (with `enter: 'br'`) and the new list would never be inserted.
12987
- if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE) {
13255
+ if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE) {
12988
13256
  return li;
12989
13257
  }
12990
13258
  return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.replace(li, jodit.o.enter.toLowerCase() !== 'br' ? jodit.o.enter : jodit.createInside.fragment(), jodit.createInside);
@@ -13697,7 +13965,7 @@ const transactions = {
13697
13965
  [states.LIST]: {
13698
13966
  exec (value) {
13699
13967
  const { element, jodit, mode } = value;
13700
- if (mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL && mode !== (/* inlined export .UNWRAP */"unwrap") && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE) {
13968
+ if (mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.INITIAL && mode !== (/* inlined export .UNWRAP */"unwrap") && mode !== jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_4__.REPLACE && mode !== (/* inlined export .CHANGE */"change")) {
13701
13969
  return {
13702
13970
  ...value,
13703
13971
  next: states.END
@@ -19675,6 +19943,11 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19675
19943
  }
19676
19944
  }
19677
19945
  __onResizerMouseDown(e) {
19946
+ // As for the header: otherwise Safari selects the dialog's text as
19947
+ // the pointer moves
19948
+ if (e.cancelable) {
19949
+ e.preventDefault();
19950
+ }
19678
19951
  this.resizable = true;
19679
19952
  this.startX = e.clientX;
19680
19953
  this.startY = e.clientY;
@@ -19686,7 +19959,7 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19686
19959
  // the content area does not shrink below its CSS `min-height`,
19687
19960
  // so it is part of the smallest height the panel can take
19688
19961
  const contentMinHeight = content ? parseFloat(this.ow.getComputedStyle(content).minHeight) || 0 : 0;
19689
- this.minSize.w = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minWidth) ? this.o.minWidth : Math.max(100, footer?.scrollWidth ?? 0);
19962
+ this.minSize.w = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minWidth) ? this.o.minWidth : Math.max(100, header ? this.__contentWidth(header) : 0, footer ? this.__contentWidth(footer) : 0);
19690
19963
  this.minSize.h = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_8__.isNumber)(this.o.minHeight) ? this.o.minHeight : (header?.offsetHeight ?? 0) + (footer?.offsetHeight ?? 0) + contentMinHeight + this.resizer.offsetHeight;
19691
19964
  this.lockSelect();
19692
19965
  this.__addGlobalResizeListeners();
@@ -19696,13 +19969,25 @@ class Dialog extends jodit_core_view_view_with_toolbar__WEBPACK_IMPORTED_MODULE_
19696
19969
  */ this.e.fire(this, 'startResize');
19697
19970
  }
19698
19971
  }
19972
+ /**
19973
+ * The width `box` takes with its content on one line. The header and
19974
+ * footer are flex rows as wide as the dialog, so the footer's
19975
+ * `scrollWidth` was the dialog's width and kept it from getting any
19976
+ * narrower
19977
+ */ __contentWidth(box) {
19978
+ const { width } = box.style;
19979
+ box.style.width = 'max-content';
19980
+ const contentWidth = box.offsetWidth;
19981
+ box.style.width = width;
19982
+ return contentWidth;
19983
+ }
19699
19984
  __addGlobalResizeListeners() {
19700
19985
  const self1 = this;
19701
19986
  self1.e.on(self1.ow, 'pointermove touchmove', self1.__onMouseMove).on(self1.ow, 'pointerup touchend', self1.__onMouseUp);
19702
19987
  }
19703
19988
  __removeGlobalResizeListeners() {
19704
19989
  const self1 = this;
19705
- self1.e.off(self1.ow, 'mousemove pointermove', self1.__onMouseMove).off(self1.ow, 'mouseup pointerup', self1.__onMouseUp);
19990
+ self1.e.off(self1.ow, 'pointermove touchmove', self1.__onMouseMove).off(self1.ow, 'pointerup touchend', self1.__onMouseUp);
19706
19991
  }
19707
19992
  /**
19708
19993
  * Specifies the size of the window
@@ -24015,14 +24300,12 @@ StatusBar = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)
24015
24300
  /* harmony export */ Table: function() { return /* binding */ Table; }
24016
24301
  /* harmony export */ });
24017
24302
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
24018
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
24019
- /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16964);
24020
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81937);
24021
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84839);
24022
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(27795);
24023
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28077);
24024
- /* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65946);
24025
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
24303
+ /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16964);
24304
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
24305
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27795);
24306
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
24307
+ /* harmony import */ var jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
24308
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(80991);
24026
24309
  /*!
24027
24310
  * Jodit Editor (https://xdsoft.net/jodit/)
24028
24311
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -24038,26 +24321,15 @@ StatusBar = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)
24038
24321
 
24039
24322
 
24040
24323
 
24041
-
24042
-
24043
24324
  const markedValue = new WeakMap();
24044
- class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewComponent {
24325
+ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_1__.ViewComponent {
24045
24326
  /** @override */ className() {
24046
24327
  return 'Table';
24047
24328
  }
24048
- __recalculateStyles() {
24049
- const style = (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_6__.getContainer)(this.j, Table, 'style', true);
24050
- const selectors = [];
24051
- this.selected.forEach((td)=>{
24052
- const selector = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.cssPath)(td);
24053
- selector && selectors.push(selector);
24054
- });
24055
- style.innerHTML = selectors.length ? selectors.join(',') + `{${this.jodit.options.table.selectionCellStyle}}` : '';
24056
- }
24057
24329
  addSelection(td) {
24058
24330
  this.selected.add(td);
24059
24331
  this.__recalculateStyles();
24060
- const table = jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.closest(td, 'table', this.j.editor);
24332
+ const table = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(td, 'table', this.j.editor);
24061
24333
  if (table) {
24062
24334
  const cells = Table.__selectedByTable.get(table) || new Set();
24063
24335
  cells.add(td);
@@ -24067,7 +24339,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24067
24339
  removeSelection(td) {
24068
24340
  this.selected.delete(td);
24069
24341
  this.__recalculateStyles();
24070
- const table = jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.closest(td, 'table', this.j.editor);
24342
+ const table = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(td, 'table', this.j.editor);
24071
24343
  if (table) {
24072
24344
  const cells = Table.__selectedByTable.get(table);
24073
24345
  if (cells) {
@@ -24081,11 +24353,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24081
24353
  /**
24082
24354
  * Returns array of selected cells
24083
24355
  */ getAllSelectedCells() {
24084
- return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.toArray)(this.selected);
24356
+ return (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(this.selected);
24085
24357
  }
24086
24358
  static __getSelectedCellsByTable(table) {
24087
24359
  const cells = Table.__selectedByTable.get(table);
24088
- return cells ? (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.toArray)(cells) : [];
24360
+ return cells ? (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(cells) : [];
24089
24361
  }
24090
24362
  /** @override **/ destruct() {
24091
24363
  this.selected.clear();
@@ -24112,7 +24384,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24112
24384
  const matrix = [
24113
24385
  []
24114
24386
  ];
24115
- const rows = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.toArray)(table.rows);
24387
+ const rows = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(table.rows);
24116
24388
  const setCell = (cell, i)=>{
24117
24389
  if (matrix[i] === undefined) {
24118
24390
  matrix[i] = [];
@@ -24135,7 +24407,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24135
24407
  }
24136
24408
  };
24137
24409
  for(let i = 0; i < rows.length; i += 1){
24138
- const cells = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.toArray)(rows[i].cells);
24410
+ const cells = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(rows[i].cells);
24139
24411
  for(let j = 0; j < cells.length; j += 1){
24140
24412
  if (setCell(cells[j], i) === false) {
24141
24413
  return matrix;
@@ -24185,34 +24457,34 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24185
24457
  row = create.element('tr');
24186
24458
  for(let j = 0; j < columnsCount; j += 1){
24187
24459
  const cell = create.element('td');
24188
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, create.element('br'));
24189
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(row, cell);
24460
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, create.element('br'));
24461
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(row, cell);
24190
24462
  }
24191
24463
  } else {
24192
24464
  row = line.cloneNode(true);
24193
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.each(line, (cell)=>{
24194
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isCell(cell)) {
24465
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(line, (cell)=>{
24466
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(cell)) {
24195
24467
  return;
24196
24468
  }
24197
- const rowspan = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(cell, 'rowspan');
24469
+ const rowspan = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan');
24198
24470
  if (rowspan && parseInt(rowspan, 10) > 1) {
24199
24471
  const newRowSpan = parseInt(rowspan, 10) - 1;
24200
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(cell, 'rowspan', newRowSpan > 1 ? newRowSpan : null);
24472
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', newRowSpan > 1 ? newRowSpan : null);
24201
24473
  }
24202
24474
  });
24203
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.each(row, (cell)=>{
24204
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isCell(cell)) {
24205
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.detach(cell);
24206
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, create.element('br'));
24475
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.each(row, (cell)=>{
24476
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(cell)) {
24477
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.detach(cell);
24478
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, create.element('br'));
24207
24479
  }
24208
24480
  });
24209
24481
  }
24210
24482
  if (after && line && line.nextSibling) {
24211
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.after(line, row);
24483
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(line, row);
24212
24484
  } else if (!after && line) {
24213
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.before(line, row);
24485
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(line, row);
24214
24486
  } else {
24215
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.first(table, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(node, 'tbody')) || table, row);
24487
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.first(table, (node)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'tbody')) || table, row);
24216
24488
  }
24217
24489
  }
24218
24490
  /**
@@ -24240,7 +24512,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24240
24512
  while(box[rowIndex + 1][nextCell] === cell){
24241
24513
  nextCell += 1;
24242
24514
  }
24243
- const nextRow = jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.next(cell.parentNode, (elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isTag(elm, 'tr'), table);
24515
+ const nextRow = jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.next(cell.parentNode, (elm)=>jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(elm, 'tr'), table);
24244
24516
  if (nextRow) {
24245
24517
  // `box[rowIndex + 1][nextCell]` is the cell that
24246
24518
  // logically follows the moved cell in the next row, but
@@ -24257,21 +24529,21 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24257
24529
  }
24258
24530
  }
24259
24531
  if (referenceCell) {
24260
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.before(referenceCell, cell);
24532
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(referenceCell, cell);
24261
24533
  } else {
24262
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(nextRow, cell);
24534
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(nextRow, cell);
24263
24535
  }
24264
24536
  }
24265
24537
  }
24266
24538
  } else {
24267
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.safeRemove(cell);
24539
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(cell);
24268
24540
  }
24269
24541
  if (dec && (cell.parentNode === row || cell !== box[rowIndex][j - 1])) {
24270
24542
  const rowSpan = cell.rowSpan;
24271
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(cell, 'rowspan', rowSpan - 1 > 1 ? rowSpan - 1 : null);
24543
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', rowSpan - 1 > 1 ? rowSpan - 1 : null);
24272
24544
  }
24273
24545
  });
24274
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.safeRemove(row);
24546
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(row);
24275
24547
  }
24276
24548
  /**
24277
24549
  * Remove row
@@ -24282,7 +24554,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24282
24554
  * Insert column before / after all the columns containing the selected cells
24283
24555
  */ appendColumn(table, selectedCell, insertAfter = true) {
24284
24556
  const box = Table.__formalMatrix(table);
24285
- if (!insertAfter && jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isCell(selectedCell.previousElementSibling)) {
24557
+ if (!insertAfter && jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isCell(selectedCell.previousElementSibling)) {
24286
24558
  return this.appendColumn(table, selectedCell.previousElementSibling, true);
24287
24559
  }
24288
24560
  const [, formalCol] = Table.__formalCoordinate(table, selectedCell, insertAfter);
@@ -24292,11 +24564,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24292
24564
  const cells = box[i];
24293
24565
  if (cells[columnIndex] !== cells[newColumnIndex] || columnIndex === newColumnIndex) {
24294
24566
  const cell = this.j.createInside.element('td');
24295
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(cell, this.j.createInside.element('br'));
24567
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(cell, this.j.createInside.element('br'));
24296
24568
  if (insertAfter) {
24297
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.after(cells[columnIndex], cell);
24569
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(cells[columnIndex], cell);
24298
24570
  } else {
24299
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.before(cells[columnIndex], cell);
24571
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.before(cells[columnIndex], cell);
24300
24572
  }
24301
24573
  if (cells[columnIndex].rowSpan > 1) {
24302
24574
  cell.rowSpan = cells[columnIndex].rowSpan;
@@ -24318,11 +24590,11 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24318
24590
  } else if (j + 1 < cells.length && box[i][j + 1] === td) {
24319
24591
  dec = true;
24320
24592
  } else {
24321
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.safeRemove(td);
24593
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(td);
24322
24594
  }
24323
24595
  if (dec && (i - 1 < 0 || td !== box[i - 1][j])) {
24324
24596
  const colSpan = td.colSpan;
24325
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(td, 'colspan', colSpan - 1 > 1 ? (colSpan - 1).toString() : null);
24597
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(td, 'colspan', colSpan - 1 > 1 ? (colSpan - 1).toString() : null);
24326
24598
  }
24327
24599
  });
24328
24600
  }
@@ -24399,13 +24671,13 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24399
24671
  continue; // broken table
24400
24672
  }
24401
24673
  if (box[i][j].hasAttribute('rowspan') && box[i][j].rowSpan === 1) {
24402
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(box[i][j], 'rowspan', null);
24674
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'rowspan', null);
24403
24675
  }
24404
24676
  if (box[i][j].hasAttribute('colspan') && box[i][j].colSpan === 1) {
24405
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(box[i][j], 'colspan', null);
24677
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'colspan', null);
24406
24678
  }
24407
- if (box[i][j].hasAttribute('class') && !(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(box[i][j], 'class')) {
24408
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(box[i][j], 'class', null);
24679
+ if (box[i][j].hasAttribute('class') && !(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class')) {
24680
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(box[i][j], 'class', null);
24409
24681
  }
24410
24682
  }
24411
24683
  }
@@ -24479,10 +24751,10 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24479
24751
  return;
24480
24752
  }
24481
24753
  alreadyMerged.add(td);
24482
- if (i === bound[0][0] && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.cssInline)(td, 'width')) {
24754
+ if (i === bound[0][0] && (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_6__.cssInline)(td, 'width')) {
24483
24755
  w += td.offsetWidth;
24484
24756
  }
24485
- if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.trim)(cell.innerHTML.replace(/<br(\/)?>/g, '')) !== '') {
24757
+ if ((0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.trim)(cell.innerHTML.replace(/<br(\/)?>/g, '')) !== '') {
24486
24758
  html.push(cell.innerHTML);
24487
24759
  }
24488
24760
  if (cs > 1) {
@@ -24511,7 +24783,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24511
24783
  Table.__mark(first, 'rowspan', rows, __marked);
24512
24784
  }
24513
24785
  if (w) {
24514
- Table.__mark(first, 'width', (w / table.offsetWidth * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.ACCURACY) + '%', __marked);
24786
+ Table.__mark(first, 'width', (w / table.offsetWidth * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
24515
24787
  if (first_j) {
24516
24788
  Table.__setColumnWidthByDelta(table, first_j, 0, true, __marked);
24517
24789
  }
@@ -24521,9 +24793,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24521
24793
  alreadyMerged.delete(first);
24522
24794
  Table.__unmark(__marked);
24523
24795
  Table.__normalizeTable(table);
24524
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.toArray)(table.rows).forEach((tr)=>{
24796
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.toArray)(table.rows).forEach((tr)=>{
24525
24797
  if (!tr.cells.length) {
24526
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.safeRemove(tr);
24798
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(tr);
24527
24799
  }
24528
24800
  });
24529
24801
  }
@@ -24539,7 +24811,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24539
24811
  const __marked = [];
24540
24812
  Table.__getSelectedCellsByTable(table).forEach((cell)=>{
24541
24813
  td = jodit.createInside.element('td');
24542
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(td, jodit.createInside.element('br'));
24814
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(td, jodit.createInside.element('br'));
24543
24815
  tr = jodit.createInside.element('tr');
24544
24816
  coord = Table.__formalCoordinate(table, cell);
24545
24817
  if (cell.rowSpan < 2) {
@@ -24548,8 +24820,8 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24548
24820
  Table.__mark(tdElm, 'rowspan', tdElm.rowSpan + 1, __marked);
24549
24821
  }
24550
24822
  });
24551
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.after(jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.closest(cell, 'tr', table), tr);
24552
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(tr, td);
24823
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(cell, 'tr', table), tr);
24824
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(tr, td);
24553
24825
  } else {
24554
24826
  Table.__mark(cell, 'rowspan', cell.rowSpan - 1, __marked);
24555
24827
  Table.__formalMatrix(table, (tdElm, i, j)=>{
@@ -24561,9 +24833,9 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24561
24833
  }
24562
24834
  });
24563
24835
  if (after) {
24564
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.after(after, td);
24836
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(after, td);
24565
24837
  } else {
24566
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.prepend(parent, td);
24838
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.prepend(parent, td);
24567
24839
  }
24568
24840
  }
24569
24841
  if (cell.colSpan > 1) {
@@ -24594,15 +24866,15 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24594
24866
  Table.__mark(cell, 'colspan', cell.colSpan - 1, __marked);
24595
24867
  }
24596
24868
  td = jodit.createInside.element('td');
24597
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.append(td, jodit.createInside.element('br'));
24869
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.append(td, jodit.createInside.element('br'));
24598
24870
  if (cell.rowSpan > 1) {
24599
24871
  Table.__mark(td, 'rowspan', cell.rowSpan, __marked);
24600
24872
  }
24601
24873
  const oldWidth = cell.offsetWidth; // get old width
24602
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.after(cell, td);
24874
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.after(cell, td);
24603
24875
  percentage = oldWidth / table.offsetWidth / 2;
24604
- Table.__mark(cell, 'width', (percentage * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.ACCURACY) + '%', __marked);
24605
- Table.__mark(td, 'width', (percentage * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.ACCURACY) + '%', __marked);
24876
+ Table.__mark(cell, 'width', (percentage * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
24877
+ Table.__mark(td, 'width', (percentage * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', __marked);
24606
24878
  Table.__unmark(__marked);
24607
24879
  instance(jodit).removeSelection(cell);
24608
24880
  });
@@ -24623,7 +24895,7 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24623
24895
  }
24624
24896
  const w = cell.offsetWidth;
24625
24897
  const percent = (w + delta) / table.offsetWidth * 100;
24626
- Table.__mark(cell, 'width', percent.toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.ACCURACY) + '%', marked);
24898
+ Table.__mark(cell, 'width', percent.toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.ACCURACY) + '%', marked);
24627
24899
  clearWidthIndex = i;
24628
24900
  break;
24629
24901
  }
@@ -24654,22 +24926,22 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24654
24926
  const value = dict[key];
24655
24927
  switch(key){
24656
24928
  case 'remove':
24657
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.safeRemove(cell);
24929
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(cell);
24658
24930
  break;
24659
24931
  case 'rowspan':
24660
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(cell, 'rowspan', (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.isNumber)(value) && value > 1 ? value : null);
24932
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'rowspan', (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.isNumber)(value) && value > 1 ? value : null);
24661
24933
  break;
24662
24934
  case 'colspan':
24663
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(cell, 'colspan', (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.isNumber)(value) && value > 1 ? value : null);
24935
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'colspan', (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.isNumber)(value) && value > 1 ? value : null);
24664
24936
  break;
24665
24937
  case 'width':
24666
24938
  if (value == null) {
24667
24939
  cell.style.removeProperty('width');
24668
- if (!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(cell, 'style')) {
24669
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.attr)(cell, 'style', null);
24940
+ if (!(0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'style')) {
24941
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.attr)(cell, 'style', null);
24670
24942
  }
24671
24943
  } else {
24672
- (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_7__.css)(cell, 'width', value.toString());
24944
+ (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.css)(cell, 'width', value.toString());
24673
24945
  }
24674
24946
  break;
24675
24947
  }
@@ -24680,13 +24952,23 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
24680
24952
  });
24681
24953
  }
24682
24954
  constructor(...args){
24683
- super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "selected", new Set());
24955
+ super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "selected", new Set()), /**
24956
+ * Rewrite the `<style>` that marks the selected cells once for all the
24957
+ * cells (un)selected in one go: a drag over a block of cells unmarks and
24958
+ * marks every one of them on each move. `@debounce()` was never applied,
24959
+ * as a Table never reaches `ready`
24960
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__recalculateStyles", this.async.microDebounce(()=>{
24961
+ const style = (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.getContainer)(this.j, Table, 'style', true);
24962
+ const selectors = [];
24963
+ this.selected.forEach((td)=>{
24964
+ const selector = (0,jodit_core_helpers___WEBPACK_IMPORTED_MODULE_5__.cssPath)(td);
24965
+ selector && selectors.push(selector);
24966
+ });
24967
+ style.innerHTML = selectors.length ? selectors.join(',') + `{${this.jodit.options.table.selectionCellStyle}}` : '';
24968
+ }));
24684
24969
  }
24685
24970
  }
24686
24971
  ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Table, "__selectedByTable", new WeakMap());
24687
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
24688
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_4__.debounce)()
24689
- ], Table.prototype, "__recalculateStyles", null);
24690
24972
  const instance = (j)=>j.getInstance('Table', j.o);
24691
24973
 
24692
24974
 
@@ -27886,6 +28168,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
27886
28168
  mainClosestBox = nextBox;
27887
28169
  }
27888
28170
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(mainClosestBox) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(mainClosestBox, jodit.editor)) {
28171
+ // A table cell is never joined with its neighbour
28172
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, mainClosestBox, true)) {
28173
+ return false;
28174
+ }
27889
28175
  const sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(mainClosestBox, backspace);
27890
28176
  // A line break before the cursor is a single unit: remove it instead of
27891
28177
  // merging the current element into the (void) `<br>`, which used to move
@@ -27895,13 +28181,48 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
27895
28181
  jodit.s.setCursorBefore(fakeNode);
27896
28182
  return true;
27897
28183
  }
27898
- if (sibling && (checkMoveListContent(jodit, mainClosestBox, sibling, backspace) || moveContentAndRemoveEmpty(jodit, mainClosestBox, resolveTableSibling(sibling, backspace), backspace))) {
28184
+ // Backspace leaves a block after a table alone, as Word does, rather
28185
+ // than moving its text into the last cell
28186
+ if (backspace && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, 'table')) {
28187
+ jodit.s.setCursorBefore(fakeNode);
28188
+ return true;
28189
+ }
28190
+ const box = findCaretBox(fakeNode, mainClosestBox);
28191
+ if (sibling && (checkPullNextLine(jodit, fakeNode, box, sibling, backspace) || checkMoveListContent(jodit, box, sibling, backspace) || moveContentAndRemoveEmpty(jodit, box, findEdgeBlock(resolveTableSibling(sibling, backspace), backspace, jodit.editor), backspace))) {
27899
28192
  jodit.s.setCursorBefore(fakeNode);
27900
28193
  return true;
27901
28194
  }
27902
28195
  }
27903
28196
  return false;
27904
28197
  }
28198
+ /**
28199
+ * The block holding the caret inside the box that has the sibling, so
28200
+ * `<p>one</p><div><p>|two</p></div>` joins the two paragraphs instead of
28201
+ * moving the whole `<div>` into the first one. For a list item that is its
28202
+ * list, which the list cases handle.
28203
+ */ function findCaretBox(fakeNode, mainClosestBox) {
28204
+ const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, mainClosestBox);
28205
+ if (!block) {
28206
+ return mainClosestBox;
28207
+ }
28208
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(block) && block.parentElement ? block.parentElement : block;
28209
+ }
28210
+ /**
28211
+ * The innermost block on the sibling's edge facing the caret, so the
28212
+ * content is joined to text: `<div><p>one</p></div><p>|two</p>` gives
28213
+ * `<div><p>one|two</p></div>`
28214
+ */ function findEdgeBlock(sibling, backspace, root) {
28215
+ let block = sibling;
28216
+ while(block){
28217
+ const edge = backspace ? block.lastChild : block.firstChild;
28218
+ const child = edge && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(edge) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(edge, backspace) : edge;
28219
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(child) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(child, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(child, 'table') || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(child, root)) {
28220
+ return block;
28221
+ }
28222
+ block = child;
28223
+ }
28224
+ return block;
28225
+ }
27905
28226
  /**
27906
28227
  * Content cannot be merged into the `<table>` element itself — it would land
27907
28228
  * between the table sections (after `</tbody>`), which is invalid HTML and
@@ -27918,6 +28239,40 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('backspace', bac
27918
28239
  });
27919
28240
  return cells.length ? cells[backspace ? cells.length - 1 : 0] : null;
27920
28241
  }
28242
+ /**
28243
+ * Delete at the edge of a list pulls the next line up to the caret, as the
28244
+ * browsers do, instead of moving the caret's line into the next block:
28245
+ * `<ul><li>one|</li></ul><p>two</p>` gives `<ul><li>one|two</li></ul>`, and
28246
+ * `<p>one|</p><ul><li>two</li></ul>` gives `<p>one|two</p>`
28247
+ * @private
28248
+ */ function checkPullNextLine(jodit, fakeNode, box, sibling, backspace) {
28249
+ if (backspace || !(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(box) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(sibling))) {
28250
+ return false;
28251
+ }
28252
+ const target = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.up(fakeNode, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, box, true);
28253
+ const source = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(sibling) ? sibling.firstElementChild : sibling;
28254
+ if (!target || !source || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(source, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(source, 'table')) {
28255
+ return false;
28256
+ }
28257
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(source)) {
28258
+ const line = [];
28259
+ for(let node = source.firstChild; node && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node); node = node.nextSibling){
28260
+ line.push(node);
28261
+ }
28262
+ if (!line.length) {
28263
+ return false;
28264
+ }
28265
+ const filter = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
28266
+ line.forEach((node)=>filter(node) ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(target, node) : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(node));
28267
+ }
28268
+ let remove = source;
28269
+ while(remove && remove !== jodit.editor && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(remove)){
28270
+ const parent = remove.parentElement;
28271
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(remove);
28272
+ remove = parent;
28273
+ }
28274
+ return true;
28275
+ }
27921
28276
  function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
27922
28277
  // Process UL/LI/OL cases
27923
28278
  const siblingIsList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
@@ -29022,6 +29377,18 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29022
29377
  this.walker.setWork(editor.editor);
29023
29378
  this.currentSelectionNode = editor.s.current();
29024
29379
  }
29380
+ /**
29381
+ * Typing into an empty block (`<p><br></p>`) replaces its `<br>`, but the
29382
+ * browser keeps the `<br>` when the caret is in an invisible-space text
29383
+ * node in front of it, as Jodit leaves the caret in many of the empty
29384
+ * blocks it makes (a cleared editor, a heading in an empty table cell).
29385
+ * See #1632
29386
+ */ onInputRemovePlaceholderBr(event) {
29387
+ if (!this.isEditMode || event.type === 'input' && (event.isComposing || !event.inputType?.startsWith('insert'))) {
29388
+ return;
29389
+ }
29390
+ ;(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.removePlaceholderBr)(this.j);
29391
+ }
29025
29392
  startWalker() {
29026
29393
  const { jodit } = this;
29027
29394
  const allow = (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.getHash)(this.j.o.cleanHTML.allowTags);
@@ -29190,6 +29557,12 @@ class cleanHtml extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_7__.Pl
29190
29557
  ':keydown'
29191
29558
  ])
29192
29559
  ], cleanHtml.prototype, "onChangeCleanHTML", null);
29560
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29561
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)([
29562
+ ':input',
29563
+ 'jodit.editor:compositionend'
29564
+ ])
29565
+ ], cleanHtml.prototype, "onInputRemovePlaceholderBr", null);
29193
29566
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29194
29567
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.hook)('ready')
29195
29568
  ], cleanHtml.prototype, "startWalker", null);
@@ -29328,12 +29701,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
29328
29701
  /* harmony export */ getHash: function() { return /* reexport safe */ _get_hash__WEBPACK_IMPORTED_MODULE_0__.getHash; },
29329
29702
  /* harmony export */ removeFormatForCollapsedSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__.removeFormatForCollapsedSelection; },
29330
29703
  /* harmony export */ removeFormatForSelection: function() { return /* reexport safe */ _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__.removeFormatForSelection; },
29331
- /* harmony export */ visitNodeWalker: function() { return /* reexport safe */ _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_3__.visitNodeWalker; }
29704
+ /* harmony export */ removePlaceholderBr: function() { return /* reexport safe */ _remove_placeholder_br__WEBPACK_IMPORTED_MODULE_3__.removePlaceholderBr; },
29705
+ /* harmony export */ visitNodeWalker: function() { return /* reexport safe */ _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_4__.visitNodeWalker; }
29332
29706
  /* harmony export */ });
29333
29707
  /* harmony import */ var _get_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5650);
29334
29708
  /* harmony import */ var _remove_format_remove_format_for_collapsed_selection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37431);
29335
29709
  /* harmony import */ var _remove_format_remove_format_for_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(70195);
29336
- /* harmony import */ var _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(45219);
29710
+ /* harmony import */ var _remove_placeholder_br__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53626);
29711
+ /* harmony import */ var _visitor_visit_node_walker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45219);
29337
29712
  /*!
29338
29713
  * Jodit Editor (https://xdsoft.net/jodit/)
29339
29714
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -29347,6 +29722,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.controls.eraser = {
29347
29722
 
29348
29723
 
29349
29724
 
29725
+
29350
29726
  /***/ }),
29351
29727
 
29352
29728
  /***/ 28665:
@@ -29506,6 +29882,64 @@ const VIMEO_EMBED = /^(https?:)?\/\/player\.vimeo\.com\/video\//i;
29506
29882
  }
29507
29883
 
29508
29884
 
29885
+ /***/ }),
29886
+
29887
+ /***/ 53626:
29888
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
29889
+
29890
+ "use strict";
29891
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29892
+ /* harmony export */ removePlaceholderBr: function() { return /* binding */ removePlaceholderBr; }
29893
+ /* harmony export */ });
29894
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
29895
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23211);
29896
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4040);
29897
+ /*!
29898
+ * Jodit Editor (https://xdsoft.net/jodit/)
29899
+ * Released under MIT see LICENSE.txt in the project root for license information.
29900
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
29901
+ */ /**
29902
+ * @module plugins/clean-html
29903
+ */
29904
+
29905
+
29906
+ function lastNode(node) {
29907
+ let last = node.lastChild;
29908
+ while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(last) && !last.nodeValue){
29909
+ last = last.previousSibling;
29910
+ }
29911
+ return last;
29912
+ }
29913
+ /**
29914
+ * Remove the `<br>` that kept the block with the caret open while it was
29915
+ * empty, once text has gone into the block: when the block is one line of
29916
+ * text that ends in that `<br>`, the `<br>` adds nothing to it
29917
+ * @private
29918
+ */ function removePlaceholderBr(jodit) {
29919
+ const block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(jodit.s.current(), jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor);
29920
+ if (!block || !(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_2__.trim)(block.textContent ?? '')) {
29921
+ return;
29922
+ }
29923
+ let br = lastNode(block);
29924
+ while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(br) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(br, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(br)){
29925
+ br = lastNode(br);
29926
+ }
29927
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(br, 'br')) {
29928
+ return;
29929
+ }
29930
+ // Another line break, a block, an image or an embed means the `<br>` may
29931
+ // end an empty line, or give the caret a place after the embed
29932
+ const isOneLineOfText = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.each(block, (node)=>{
29933
+ if (node !== br && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isHTMLElement(node) && !node.isContentEditable)) {
29934
+ return false;
29935
+ }
29936
+ });
29937
+ if (isOneLineOfText) {
29938
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(br);
29939
+ }
29940
+ }
29941
+
29942
+
29509
29943
  /***/ }),
29510
29944
 
29511
29945
  /***/ 95559:
@@ -30836,6 +31270,11 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
30836
31270
  }
30837
31271
  jodit.s.expandSelection();
30838
31272
  const range = jodit.s.range;
31273
+ const caret = this.__clearSelectedCells(range);
31274
+ if (caret && range.collapsed) {
31275
+ jodit.s.selectRange(caret);
31276
+ return false;
31277
+ }
30839
31278
  range.deleteContents();
30840
31279
  const fake = jodit.createInside.fake();
30841
31280
  range.insertNode(fake);
@@ -30845,21 +31284,98 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
30845
31284
  range.setStartBefore(fake);
30846
31285
  range.collapse(true);
30847
31286
  this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
30848
- this.__addBrInEmptyBlock(fake, rightSibling, range);
31287
+ this.__addBrInEmptyBlock(fake, range);
30849
31288
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
30850
- jodit.s.selectRange(range);
31289
+ jodit.s.selectRange(caret ?? range);
30851
31290
  return false;
30852
31291
  }
31292
+ /**
31293
+ * A selection that starts or ends in a table cell clears the selected part
31294
+ * of each cell it covers and keeps the cells, as the browsers do.
31295
+ * `deleteContents` would remove the cells it fully covers, and the cells
31296
+ * it cuts would then be merged as blocks. The range is moved out of those
31297
+ * tables, so only the content between them is left to delete.
31298
+ *
31299
+ * Returns where the caret goes, or null when no table is involved
31300
+ */ __clearSelectedCells(range) {
31301
+ const { editor, createInside } = this.j;
31302
+ const startCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.startContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
31303
+ const endCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.endContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
31304
+ if (startCell === endCell) {
31305
+ return null;
31306
+ }
31307
+ const startTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(startCell, 'table', editor);
31308
+ const endTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(endCell, 'table', editor);
31309
+ const caret = range.cloneRange();
31310
+ caret.collapse(true);
31311
+ const parts = [];
31312
+ const addParts = (table)=>{
31313
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.toArray)(table.rows).flatMap((row)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.toArray)(row.cells)).filter((cell)=>range.intersectsNode(cell)).forEach((cell)=>{
31314
+ const part = range.cloneRange();
31315
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.startContainer)) {
31316
+ part.setStart(cell, 0);
31317
+ }
31318
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.endContainer)) {
31319
+ part.setEnd(cell, cell.childNodes.length);
31320
+ }
31321
+ parts.push([
31322
+ cell,
31323
+ part
31324
+ ]);
31325
+ });
31326
+ };
31327
+ if (startTable) {
31328
+ addParts(startTable);
31329
+ if (startTable === endTable) {
31330
+ range.collapse(true);
31331
+ } else {
31332
+ range.setStartAfter(startTable);
31333
+ }
31334
+ }
31335
+ if (endTable && endTable !== startTable) {
31336
+ addParts(endTable);
31337
+ range.setEndBefore(endTable);
31338
+ }
31339
+ parts.forEach(([cell, part])=>{
31340
+ part.deleteContents();
31341
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(cell)) {
31342
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(cell);
31343
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(cell, createInside.element('br'));
31344
+ }
31345
+ });
31346
+ return startTable ? caret : null;
31347
+ }
30853
31348
  __moveContentInLeftSibling(fake, leftSibling, rightSibling) {
30854
31349
  leftSibling = this.__defineRightLeftBox(leftSibling);
31350
+ // Nothing is moved into a table, and a block left empty after it goes
31351
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(leftSibling, 'table')) {
31352
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
31353
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
31354
+ }
31355
+ return;
31356
+ }
30855
31357
  if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(rightSibling, 'table') && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
30856
31358
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
30857
31359
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(rightSibling, leftSibling);
30858
31360
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
30859
31361
  }
30860
- // Remove empty right LI
30861
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(rightSibling.firstElementChild) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling.firstElementChild)) {
30862
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling.firstElementChild);
31362
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(rightSibling.firstElementChild)) {
31363
+ const item = rightSibling.firstElementChild;
31364
+ // What's left of the right list's first item joins the left block,
31365
+ // up to a list nested in the item
31366
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
31367
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
31368
+ while(item.firstChild && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(item.firstChild)){
31369
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, item.firstChild);
31370
+ }
31371
+ }
31372
+ // Remove empty right LI
31373
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item)) {
31374
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(item);
31375
+ }
31376
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
31377
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
31378
+ }
30863
31379
  }
30864
31380
  }
30865
31381
  /**
@@ -30876,8 +31392,8 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
30876
31392
  return lastLeaf;
30877
31393
  }
30878
31394
  /**
30879
- * Add BR in empty blocks left and right(for table cell)
30880
- */ __addBrInEmptyBlock(fake, rightSibling, range) {
31395
+ * Add BR in the empty block left at the caret
31396
+ */ __addBrInEmptyBlock(fake, range) {
30881
31397
  const jodit = this.j;
30882
31398
  if (fake.isConnected && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
30883
31399
  const br = jodit.createInside.element('br');
@@ -30885,13 +31401,6 @@ class deleteCommand extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
30885
31401
  range.setStartBefore(br);
30886
31402
  range.collapse(true);
30887
31403
  }
30888
- // Add BR in the right empty table cell
30889
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(rightSibling, 'table')) {
30890
- const firstCell = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.$$)('td,th', rightSibling).shift();
30891
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(firstCell) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(firstCell)) {
30892
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(firstCell, jodit.createInside.element('br'));
30893
- }
30894
- }
30895
31404
  }
30896
31405
  __moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
30897
31406
  if (!leftSibling || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(leftSibling)) {
@@ -32382,7 +32891,18 @@ function focus(editor) {
32382
32891
  editor.e.on('afterInit', ()=>{
32383
32892
  if (editor.o.autofocus) {
32384
32893
  if (editor.defaultTimeout) {
32385
- editor.async.setTimeout(focus, 300);
32894
+ // A click or key in the editor during the delay has put the
32895
+ // caret where the user wants it, so autofocus leaves it there
32896
+ const userInput = 'mousedown touchstart keydown';
32897
+ const cancel = ()=>{
32898
+ editor.async.clearTimeout(timeout);
32899
+ editor.e.off(userInput, cancel);
32900
+ };
32901
+ const timeout = editor.async.setTimeout(()=>{
32902
+ editor.e.off(userInput, cancel);
32903
+ focus();
32904
+ }, 300);
32905
+ editor.e.on(userInput, cancel);
32386
32906
  } else {
32387
32907
  focus();
32388
32908
  }
@@ -33606,7 +34126,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeBaseUrl = '';
33606
34126
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeTitle = 'Jodit Editor';
33607
34127
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDoctype = '<!DOCTYPE html>';
33608
34128
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeDefaultSrc = 'about:blank';
33609
- jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '[data-jodit_iframe_wrapper]{' + 'display: block;' + 'user-select: none;' + 'position: relative;' + '}' + '[data-jodit_iframe_wrapper] iframe{' + 'position: relative;' + '}' + '[data-jodit_iframe_wrapper]:after {' + 'position:absolute;' + 'content:"";' + 'z-index:1;' + 'top:0;' + 'left:0;' + 'right: 0;' + 'bottom: 0;' + 'cursor: pointer;' + 'display: block;' + 'background: rgba(0, 0, 0, 0);' + '} ' + '[data-jodit_iframe_wrapper][data-jodit-wrapper_active=true] iframe{' + 'z-index: 2;' + '}' + '.jodit-wysiwyg_image-selected::selection,' + '.jodit-wysiwyg_image-selected *:not(img)::selection{' + 'background:transparent' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
34129
+ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeStyle = 'html{' + 'margin:0;' + 'padding:0;' + 'min-height: 100%;' + '}' + 'body{' + 'box-sizing:border-box;' + 'font-size:13px;' + 'line-height:1.6;' + 'padding:10px;' + 'margin:0;' + 'background:transparent;' + 'color:#000;' + 'position:' + 'relative;' + 'z-index:2;' + 'user-select:auto;' + 'margin:0px;' + 'overflow:auto;' + 'outline:none;' + '}' + 'table{' + 'width:100%;' + 'border:none;' + 'border-collapse:collapse;' + 'empty-cells: show;' + 'max-width: 100%;' + '}' + 'th,td{' + 'padding: 2px 5px;' + 'border:1px solid #ccc;' + '-webkit-user-select:text;' + '-moz-user-select:text;' + '-ms-user-select:text;' + 'user-select:text' + '}' + 'p{' + 'margin-top:0;' + '}' + '.jodit_disabled{' + 'user-select: none;' + '-o-user-select: none;' + '-moz-user-select: none;' + '-khtml-user-select: none;' + '-webkit-user-select: none;' + '-ms-user-select: none' + '}';
33610
34130
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeCSSLinks = [];
33611
34131
  jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
33612
34132
 
@@ -33657,6 +34177,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
33657
34177
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'rel', 'stylesheet');
33658
34178
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(link, 'href', href);
33659
34179
  doc.head && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(doc.head, link);
34180
+ // What plugins measured in the editing document changes once it's styled
34181
+ jodit.e.on(link, 'load', ()=>jodit.e.fire('resize'));
33660
34182
  });
33661
34183
  }
33662
34184
  if (opt.iframeStyle) {
@@ -33694,6 +34216,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
33694
34216
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.attr)(doc.body, 'contenteditable', editor.getMode() !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.MODE_SOURCE && !editor.getReadOnly() || null);
33695
34217
  };
33696
34218
  const clearMarkers = (html)=>{
34219
+ // The plugins' own styles, from `getContainer`, aren't part of the value
34220
+ html = html.replace(/<style[^>]+jodit-box[^>]*>[\s\S]*?<\/style>/gi, '');
33697
34221
  const bodyReg = /<body.*<\/body>/im, bodyMarker = '{%%BODY%%}', body = bodyReg.exec(html);
33698
34222
  if (body) {
33699
34223
  // remove markers
@@ -33718,7 +34242,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
33718
34242
  */ const replaceDocument = (html)=>{
33719
34243
  const inert = new DOMParser().parseFromString(html, 'text/html');
33720
34244
  editor.e.fire('safeHTML', inert.documentElement);
34245
+ // The plugins' own styles stay, as the value leaves them out
34246
+ const styles = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_3__.$$)('style.jodit-box', doc.head);
33721
34247
  doc.replaceChild(doc.adoptNode(inert.documentElement), doc.documentElement);
34248
+ styles.forEach((style)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(doc.head, style));
33722
34249
  };
33723
34250
  if (docMode) {
33724
34251
  const tag = editor.element.tagName;
@@ -33848,7 +34375,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.imageProcessor = {
33848
34375
 
33849
34376
 
33850
34377
 
33851
-
33852
34378
  const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded';
33853
34379
  const JODIT_IMAGE_BLOB_ID = JODIT_IMAGE_PROCESSOR_BINDED + 'blob-id';
33854
34380
  const IMAGE_SELECTED = 'jodit-wysiwyg_image-selected';
@@ -33862,6 +34388,9 @@ const SELECTED_TAGS = new Set([
33862
34388
  */ class imageProcessor extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
33863
34389
  afterInit(jodit) {
33864
34390
  jodit.e.on(jodit.ed, 'selectionchange', this.onSelectionChange);
34391
+ // Over the highlight in `styles/reset.less`; the image keeps its own. It goes
34392
+ // in the editing document, so iframe mode has it whatever `iframeStyle` holds
34393
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.getContainer)(jodit, 'image-processor', 'style', true).textContent = `.jodit-wysiwyg.${IMAGE_SELECTED}::selection,` + `.jodit-wysiwyg.${IMAGE_SELECTED} *:not(img)::selection{background:transparent}`;
33865
34394
  }
33866
34395
  beforeDestruct(jodit) {
33867
34396
  jodit.e.off(jodit.ed, 'selectionchange', this.onSelectionChange);
@@ -36424,10 +36953,11 @@ const align = {
36424
36953
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
36425
36954
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
36426
36955
  /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91206);
36427
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4099);
36428
- /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56490);
36429
- /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4274);
36430
- /* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(89873);
36956
+ /* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(42259);
36957
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4099);
36958
+ /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(56490);
36959
+ /* harmony import */ var jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4274);
36960
+ /* harmony import */ var _config_config__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(89873);
36431
36961
  /*!
36432
36962
  * Jodit Editor (https://xdsoft.net/jodit/)
36433
36963
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -36448,14 +36978,15 @@ const align = {
36448
36978
 
36449
36979
 
36450
36980
 
36981
+
36451
36982
  /**
36452
36983
  * Plugin for show inline popup dialog
36453
36984
  */ class inlinePopup extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
36454
36985
  get popup() {
36455
- return new jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_8__.Popup(this.jodit, false);
36986
+ return new jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup(this.jodit, false);
36456
36987
  }
36457
36988
  get toolbar() {
36458
- return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_9__.makeCollection)(this.jodit, this.popup);
36989
+ return (0,jodit_modules_toolbar_factory__WEBPACK_IMPORTED_MODULE_10__.makeCollection)(this.jodit, this.popup);
36459
36990
  }
36460
36991
  onClick(node) {
36461
36992
  const elements = this.elmsList, mediaWrapper = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.getMediaWrapper)(this.j, node), target = mediaWrapper ?? (jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isTag(node, 'img') ? node : jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, elements, this.j.editor));
@@ -36529,6 +37060,33 @@ const align = {
36529
37060
  onOutsideClick() {
36530
37061
  this.popup.close();
36531
37062
  }
37063
+ /**
37064
+ * A key that moves the caret off an element closes its popup, and one
37065
+ * that moves the caret into an element with a popup (a link) opens it,
37066
+ * as clicks do
37067
+ */ onKeyUp() {
37068
+ this.__followCaret();
37069
+ }
37070
+ __followCaret() {
37071
+ if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_7__.isMoved)(this.j, this.snapRange)) {
37072
+ return;
37073
+ }
37074
+ const { range } = this.j.s;
37075
+ const target = this.previousTarget;
37076
+ if (this.popup.isOpened && this.type !== 'selection' && target && !range.intersectsNode(target)) {
37077
+ this.popup.close();
37078
+ }
37079
+ const node = range.startContainer;
37080
+ const element = this.__elementAt(node);
37081
+ if (range.collapsed && element && element !== this.__keyDownElement) {
37082
+ this.onClick(node);
37083
+ }
37084
+ }
37085
+ /**
37086
+ * The element with a popup that holds `node`
37087
+ */ __elementAt(node) {
37088
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.closest(node, this.elmsList, this.j.editor);
37089
+ }
36532
37090
  /**
36533
37091
  * Can show popup for this type
36534
37092
  */ canShowPopupForType(type) {
@@ -36568,12 +37126,28 @@ const align = {
36568
37126
  ], 'mousedown touchstart', this.__onDocumentMouseDown).on('closeAllPopups', this.__onCloseAllPopups);
36569
37127
  this.addListenersForElements();
36570
37128
  }
37129
+ onRecalcPositionPopup() {
37130
+ if (this.popup.isOpened && this.type !== 'selection' && this.previousTarget) {
37131
+ this.__reopenFor = this.previousTarget;
37132
+ }
37133
+ }
36571
37134
  __onDocumentMouseDown(e) {
36572
- if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_8__.Popup)) {
37135
+ this.__reopenFor = null;
37136
+ if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup)) {
36573
37137
  this.__reopenSelectionPopup = true;
36574
37138
  }
36575
37139
  }
36576
37140
  __onCloseAllPopups() {
37141
+ const target = this.__reopenFor;
37142
+ if (target) {
37143
+ this.__reopenFor = null;
37144
+ // After the popup's own `closeAllPopups` handler, as below
37145
+ this.j.async.setTimeout(()=>{
37146
+ if (this.j.editor.contains(target)) {
37147
+ this.onClick(target);
37148
+ }
37149
+ }, 1);
37150
+ }
36577
37151
  if (!this.__reopenSelectionPopup) {
36578
37152
  return;
36579
37153
  }
@@ -36610,11 +37184,16 @@ const align = {
36610
37184
  height: rect.height
36611
37185
  };
36612
37186
  }
36613
- onSelectionStart() {
37187
+ onSelectionStart(event) {
37188
+ // A key held down moves the caret on every repeat, with one keyup
37189
+ if (event?.repeat) {
37190
+ this.__followCaret();
37191
+ }
36614
37192
  this.snapRange = this.j.s.range.cloneRange();
37193
+ this.__keyDownElement = this.__elementAt(this.snapRange.startContainer);
36615
37194
  }
36616
37195
  onSelectionEnd(e) {
36617
- if (e && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_8__.Popup)) {
37196
+ if (e && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_8__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_9__.Popup)) {
36618
37197
  return;
36619
37198
  }
36620
37199
  const { snapRange } = this, { range } = this.j.s;
@@ -36694,7 +37273,11 @@ const align = {
36694
37273
  * The user pressed a button inside the selection toolbar — after the
36695
37274
  * command fires `closeAllPopups`, the toolbar should be shown again
36696
37275
  * while the selection is still there. See #1238
36697
- */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenSelectionPopup", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.keys)(this.j.o.popup, false).filter((s)=>!this.isExcludedTarget(s)));
37276
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenSelectionPopup", false), /**
37277
+ * The alignment controls fire `recalcPositionPopup` once they have moved
37278
+ * the element, and their button then fires `closeAllPopups`. The popup
37279
+ * opens again beside the element, as the selection toolbar does
37280
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__reopenFor", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownElement", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.keys)(this.j.o.popup, false).filter((s)=>!this.isExcludedTarget(s)));
36698
37281
  }
36699
37282
  }
36700
37283
  ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(inlinePopup, "requires", [
@@ -36723,6 +37306,12 @@ const align = {
36723
37306
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
36724
37307
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':outsideClick')
36725
37308
  ], inlinePopup.prototype, "onOutsideClick", null);
37309
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37310
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':keyup')
37311
+ ], inlinePopup.prototype, "onKeyUp", null);
37312
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
37313
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.watch)(':recalcPositionPopup')
37314
+ ], inlinePopup.prototype, "onRecalcPositionPopup", null);
36726
37315
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
36727
37316
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
36728
37317
  ], inlinePopup.prototype, "__onDocumentMouseDown", null);
@@ -38286,6 +38875,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('mobile', mobile
38286
38875
  /* harmony import */ var _icons_ol_svg__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_icons_ol_svg__WEBPACK_IMPORTED_MODULE_3__);
38287
38876
  /* harmony import */ var _icons_ul_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83207);
38288
38877
  /* harmony import */ var _icons_ul_svg__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_icons_ul_svg__WEBPACK_IMPORTED_MODULE_4__);
38878
+ /* harmony import */ var _start_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(97547);
38289
38879
  /*!
38290
38880
  * Jodit Editor (https://xdsoft.net/jodit/)
38291
38881
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -38297,10 +38887,18 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_1__.pluginSystem.add('mobile', mobile
38297
38887
 
38298
38888
 
38299
38889
 
38890
+
38891
+ /**
38892
+ * The `ol` dropdown item that asks for the list's start number
38893
+ */ const START = 'start';
38300
38894
  const memoExec = (jodit, _, { control })=>{
38301
38895
  const key = `button${control.command}`;
38302
38896
  const value = (control.args && control.args[0]) ?? (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__.dataBind)(jodit, key);
38303
- (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__.dataBind)(jodit, key, value);
38897
+ if (value === START) {
38898
+ (0,_start_dialog__WEBPACK_IMPORTED_MODULE_5__.openStartDialog)(jodit);
38899
+ return;
38900
+ }
38901
+ ;(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__.dataBind)(jodit, key, value);
38304
38902
  jodit.execCommand(control.command, false, value === 'default' ? null : value);
38305
38903
  };
38306
38904
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__.Icon.set('ol', (_icons_ol_svg__WEBPACK_IMPORTED_MODULE_3___default())).set('ul', (_icons_ul_svg__WEBPACK_IMPORTED_MODULE_4___default()));
@@ -38330,9 +38928,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
38330
38928
  'lower-greek': 'Lower Greek',
38331
38929
  'lower-roman': 'Lower Roman',
38332
38930
  'upper-alpha': 'Upper Alpha',
38333
- 'upper-roman': 'Upper Roman'
38931
+ 'upper-roman': 'Upper Roman',
38932
+ [START]: 'Start at...'
38334
38933
  },
38335
- exec: memoExec
38934
+ exec: memoExec,
38935
+ isChildDisabled: (jodit, button)=>button.control.args?.[0] === START && !(0,_start_dialog__WEBPACK_IMPORTED_MODULE_5__.closestOrderedList)(jodit)
38336
38936
  };
38337
38937
 
38338
38938
 
@@ -38363,6 +38963,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
38363
38963
 
38364
38964
 
38365
38965
 
38966
+
38366
38967
  /**
38367
38968
  * Process commands insertOrderedList and insertUnOrderedList
38368
38969
  */ class orderedList extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__.Plugin {
@@ -38401,6 +39002,86 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.ol = {
38401
39002
  jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('orderedList', orderedList);
38402
39003
 
38403
39004
 
39005
+ /***/ }),
39006
+
39007
+ /***/ 97547:
39008
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
39009
+
39010
+ "use strict";
39011
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39012
+ /* harmony export */ closestOrderedList: function() { return /* binding */ closestOrderedList; },
39013
+ /* harmony export */ openStartDialog: function() { return /* binding */ openStartDialog; }
39014
+ /* harmony export */ });
39015
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
39016
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7909);
39017
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59400);
39018
+ /* harmony import */ var jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5658);
39019
+ /*!
39020
+ * Jodit Editor (https://xdsoft.net/jodit/)
39021
+ * Released under MIT see LICENSE.txt in the project root for license information.
39022
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
39023
+ */ /**
39024
+ * @module plugins/ordered-list
39025
+ */
39026
+
39027
+
39028
+
39029
+ /**
39030
+ * The numbered list the selection is in
39031
+ */ function closestOrderedList(jodit) {
39032
+ const current = jodit.s.current();
39033
+ return current ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(current, 'ol', jodit.editor) : null;
39034
+ }
39035
+ /**
39036
+ * Asks for the number of the first item of the list the selection is in,
39037
+ * and sets the list's `start`. The selection is put back when the dialog
39038
+ * closes, however it closes.
39039
+ */ function openStartDialog(jodit) {
39040
+ const list = closestOrderedList(jodit);
39041
+ if (!list) {
39042
+ return;
39043
+ }
39044
+ const dialog = jodit.dlg({
39045
+ resizable: false,
39046
+ closeOnClickOverlay: true
39047
+ });
39048
+ const input = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIInput(jodit, {
39049
+ name: 'start',
39050
+ type: 'number',
39051
+ label: 'Number for the first item',
39052
+ value: list.start
39053
+ });
39054
+ const form = new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIForm(jodit, [
39055
+ new jodit_core_ui_form__WEBPACK_IMPORTED_MODULE_3__.UIBlock(jodit, [
39056
+ input
39057
+ ])
39058
+ ]);
39059
+ form.container.classList.add('jodit-dialog_alert');
39060
+ form.onSubmit(({ start })=>{
39061
+ const value = start === '' ? 1 : parseInt(start, 10);
39062
+ if (isNaN(value)) {
39063
+ input.focus();
39064
+ return false;
39065
+ }
39066
+ dialog.close();
39067
+ (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_1__.attr)(list, 'start', value === 1 ? null : value);
39068
+ jodit.synchronizeValues();
39069
+ });
39070
+ jodit.s.save();
39071
+ dialog.e.on(dialog, 'afterClose', ()=>{
39072
+ jodit.s.focus();
39073
+ jodit.s.restore();
39074
+ });
39075
+ dialog.setFooter([
39076
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__.Button)(jodit, 'cancel', 'Cancel').onAction(()=>dialog.close()),
39077
+ (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_2__.Button)(jodit, 'ok', 'Apply', 'primary').onAction(()=>form.submit())
39078
+ ]);
39079
+ dialog.open(form, jodit.i18n('Start numbering at'), true, true);
39080
+ input.focus();
39081
+ input.nativeInput.select();
39082
+ }
39083
+
39084
+
38404
39085
  /***/ }),
38405
39086
 
38406
39087
  /***/ 71693:
@@ -39201,6 +39882,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
39201
39882
  return true;
39202
39883
  }
39203
39884
  const first = root.firstChild;
39885
+ // Firefox pads an empty editable body with a bare <br>
39886
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(first, 'br') && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.next(first, Boolean, root)) {
39887
+ return true;
39888
+ }
39204
39889
  if (jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.INSEPARABLE_TAGS.has(first.nodeName?.toLowerCase()) || /^(TABLE)$/i.test(first.nodeName)) {
39205
39890
  return false;
39206
39891
  }
@@ -39249,11 +39934,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
39249
39934
  marginTop = parseInt(style2.getPropertyValue('margin-top'), 10);
39250
39935
  marginLeft = parseInt(style2.getPropertyValue('margin-left'), 10);
39251
39936
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
39937
+ fontFamily: style2.getPropertyValue('font-family'),
39252
39938
  fontSize: parseInt(style2.getPropertyValue('font-size'), 10),
39253
39939
  lineHeight: style2.getPropertyValue('line-height')
39254
39940
  });
39255
39941
  } else {
39256
39942
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.placeholderElm, {
39943
+ fontFamily: style.getPropertyValue('font-family'),
39257
39944
  fontSize: parseInt(style.getPropertyValue('font-size'), 10),
39258
39945
  lineHeight: style.getPropertyValue('line-height')
39259
39946
  });
@@ -39299,7 +39986,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.useInputsPlaceholder
39299
39986
  this.placeholderElm.innerHTML = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(editor.element, 'placeholder') || '';
39300
39987
  }
39301
39988
  editor.e.fire('placeholder', this.placeholderElm.innerHTML);
39302
- editor.e.off('.placeholder').on('changePlace.placeholder', this.addNativeListeners).on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' + 'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' + 'internalChange.placeholder afterCommand.placeholder', this.toggle).on(window, 'load', this.toggle);
39989
+ editor.e.off('.placeholder').on('changePlace.placeholder', this.addNativeListeners).on('change.placeholder focus.placeholder keyup.placeholder mouseup.placeholder keydown.placeholder ' + 'mousedown.placeholder afterSetMode.placeholder changePlace.placeholder ' + 'internalChange.placeholder afterCommand.placeholder resize.placeholder', this.toggle).on(window, 'load', this.toggle);
39303
39990
  this.addNativeListeners();
39304
39991
  this.toggle();
39305
39992
  });
@@ -40163,7 +40850,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
40163
40850
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
40164
40851
  /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(80991);
40165
40852
  /* harmony import */ var jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18855);
40166
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(96608);
40853
+ /* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(42259);
40854
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4099);
40855
+ /* harmony import */ var jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(56490);
40856
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(96608);
40167
40857
  /*!
40168
40858
  * Jodit Editor (https://xdsoft.net/jodit/)
40169
40859
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -40184,6 +40874,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
40184
40874
 
40185
40875
 
40186
40876
 
40877
+
40878
+
40879
+
40187
40880
  const keyBInd = '__jodit-resizer_binded';
40188
40881
  /**
40189
40882
  * Reads a plain pixel value out of a `width`/`height` attribute.
@@ -40202,11 +40895,19 @@ const keyBInd = '__jodit-resizer_binded';
40202
40895
  */ function heightFollowsWidth(element) {
40203
40896
  return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(element, 'video') && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'height') && !(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'height');
40204
40897
  }
40898
+ const IFRAME_WRAPPER = '[data-jodit_iframe_wrapper]';
40899
+ /**
40900
+ * A click on an embed lands on its wrapper, so it selects the embed, until the
40901
+ * wrapper is active. While the editor is locked, as during resizing, the
40902
+ * wrapper takes the mouse again.
40903
+ */ const EMBED_WRAPPER_STYLE = `${IFRAME_WRAPPER}{position:relative;display:block;user-select:none}` + `${IFRAME_WRAPPER} iframe{position:relative}` + `${IFRAME_WRAPPER}::after{position:absolute;z-index:1;display:block;background:transparent;content:'';cursor:pointer;inset:0}` + `${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:2}` + `.jodit_lock ${IFRAME_WRAPPER}[data-jodit-wrapper_active=true] iframe{z-index:1}`;
40205
40904
  /**
40206
40905
  * The module creates a supporting frame for resizing of the elements img and table
40207
40906
  */ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
40208
40907
  /** @override */ afterInit(editor) {
40209
- ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('div', this.rect).forEach((resizeHandle)=>{
40908
+ // It goes in the editing document, so iframe mode has it whatever `iframeStyle` holds
40909
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.getContainer)(editor, 'resizer', 'style', true).textContent = EMBED_WRAPPER_STYLE;
40910
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('div', this.rect).forEach((resizeHandle)=>{
40210
40911
  editor.e.on(resizeHandle, 'mousedown.resizer touchstart.resizer', this.onStartResizing.bind(this, resizeHandle));
40211
40912
  });
40212
40913
  jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.on('hideHelpers', this.hide);
@@ -40214,7 +40915,11 @@ const keyBInd = '__jodit-resizer_binded';
40214
40915
  if (isReadOnly) {
40215
40916
  this.hide();
40216
40917
  }
40217
- }).on('afterInit changePlace', this.addEventListeners.bind(this)).on('afterGetValueFromEditor.resizer', (data)=>{
40918
+ }).on('afterInit changePlace', this.addEventListeners.bind(this))// Handlers without a namespace run first, ahead of those that
40919
+ // move the caret, as table-keyboard-navigation's do
40920
+ .on('keydown', this.onEditorKeyDown, {
40921
+ top: true
40922
+ }).on('afterGetValueFromEditor.resizer', (data)=>{
40218
40923
  const rgx = /<jodit[^>]+data-jodit_iframe_wrapper[^>]+>(.*?<iframe[^>]*>.*?<\/iframe>.*?)<\/jodit>/gi;
40219
40924
  if (rgx.test(data.value)) {
40220
40925
  data.value = data.value.replace(rgx, '$1');
@@ -40358,6 +41063,38 @@ const keyBInd = '__jodit-resizer_binded';
40358
41063
  e.stopImmediatePropagation();
40359
41064
  }
40360
41065
  }
41066
+ onEditorKeyDown(event) {
41067
+ // A key held down moves the caret on every repeat, with one keyup
41068
+ if (event?.repeat) {
41069
+ this.__followCaret();
41070
+ }
41071
+ this.__keyDownRange = this.j.s.range.cloneRange();
41072
+ this.__keyDownTable = this.__caretTable();
41073
+ }
41074
+ __caretTable() {
41075
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, 'table', this.j.editor);
41076
+ }
41077
+ /**
41078
+ * Hide the frame once a key has moved the caret off its element, and
41079
+ * frame a table the caret has moved into, as clicks do
41080
+ */ onEditorKeyUp() {
41081
+ this.__followCaret();
41082
+ }
41083
+ __followCaret() {
41084
+ const before = this.__keyDownRange;
41085
+ this.__keyDownRange = null;
41086
+ if (!(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_9__.isMoved)(this.j, before)) {
41087
+ return;
41088
+ }
41089
+ if (this.isShown && this.element && !this.j.s.range.intersectsNode(this.element)) {
41090
+ this.hide();
41091
+ }
41092
+ const table = this.__caretTable();
41093
+ if (table && table !== this.__keyDownTable && this.j.o.allowResizeTags.has('table')) {
41094
+ this.__bind(table);
41095
+ this.onClickElement(table);
41096
+ }
41097
+ }
40361
41098
  onKeyDown(e) {
40362
41099
  this.isAltMode = e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_ALT;
40363
41100
  if (!this.isAltMode && this.isResizeMode) {
@@ -40379,6 +41116,11 @@ const keyBInd = '__jodit-resizer_binded';
40379
41116
  return;
40380
41117
  }
40381
41118
  if (!this.isResizeMode) {
41119
+ // A click in the element's popup, or in a list it opens, works on
41120
+ // the element, so it keeps its frame
41121
+ if (e?.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_10__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_11__.Popup)) {
41122
+ return;
41123
+ }
40382
41124
  return this.hide();
40383
41125
  }
40384
41126
  e.stopImmediatePropagation();
@@ -40545,7 +41287,7 @@ const keyBInd = '__jodit-resizer_binded';
40545
41287
  this.hide();
40546
41288
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove(this.layer);
40547
41289
  jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.off('hideHelpers', this.hide);
40548
- jodit.e.off(this.j.ow, '.resizer').off('.resizer');
41290
+ jodit.e.off(this.j.ow, '.resizer').off('.resizer').off('keydown', this.onEditorKeyDown);
40549
41291
  }
40550
41292
  constructor(...args){
40551
41293
  super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "LOCK_KEY", 'resizer'), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "handle", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "element", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isResizeMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isShown", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "startY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "width", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "height", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "ratio", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "rect", this.j.c.fromHTML(`<div title="${this.j.i18n('Press Alt for custom resizing')}" class="jodit-resizer">
@@ -40555,7 +41297,7 @@ const keyBInd = '__jodit-resizer_binded';
40555
41297
  <div class="jodit-resizer__bottom-left"></div>
40556
41298
  <span>100x100</span>
40557
41299
  </div>`)), // Clips the frame to the workplace, without the frame making it scroll
40558
- (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "layer", this.j.c.div('jodit-resizer-layer')), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sizeViewer", this.rect.getElementsByTagName('span')[0]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isAltMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onClickElement", (element)=>{
41300
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "layer", this.j.c.div('jodit-resizer-layer')), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sizeViewer", this.rect.getElementsByTagName('span')[0]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "pointerY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownTable", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "isAltMode", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "onClickElement", (element)=>{
40559
41301
  if (this.isResizeMode) {
40560
41302
  return;
40561
41303
  }
@@ -40613,6 +41355,12 @@ const keyBInd = '__jodit-resizer_binded';
40613
41355
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
40614
41356
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
40615
41357
  ], resizer.prototype, "onResize", null);
41358
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
41359
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
41360
+ ], resizer.prototype, "onEditorKeyDown", null);
41361
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
41362
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keyup')
41363
+ ], resizer.prototype, "onEditorKeyUp", null);
40616
41364
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
40617
41365
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
40618
41366
  ], resizer.prototype, "onKeyDown", null);
@@ -41562,8 +42310,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelecti
41562
42310
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
41563
42311
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
41564
42312
  /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91206);
41565
- /* harmony import */ var jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98803);
41566
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(69070);
42313
+ /* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(42259);
42314
+ /* harmony import */ var jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(98803);
42315
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(69070);
41567
42316
  /*!
41568
42317
  * Jodit Editor (https://xdsoft.net/jodit/)
41569
42318
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -41582,19 +42331,24 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelecti
41582
42331
 
41583
42332
 
41584
42333
 
42334
+
41585
42335
  const key = 'table_processor_observer';
41586
42336
  const MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
41587
42337
  class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin {
41588
42338
  /**
41589
42339
  * Shortcut for Jodit.modules.Table
41590
42340
  */ get __tableModule() {
41591
- return this.j.getInstance(jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_8__.Table, this.j.o);
42341
+ return this.j.getInstance(jodit_modules_table_table__WEBPACK_IMPORTED_MODULE_9__.Table, this.j.o);
41592
42342
  }
41593
42343
  afterInit(jodit) {
41594
42344
  if (!jodit.o.tableAllowCellSelection) {
41595
42345
  return;
41596
42346
  }
41597
- jodit.e.on('keydown.select-cells', (event)=>{
42347
+ jodit.e// Handlers without a namespace run first, ahead of those that
42348
+ // move the caret, as table-keyboard-navigation's do
42349
+ .on('keydown', this.__onKeyDown, {
42350
+ top: true
42351
+ }).on('keydown.select-cells', (event)=>{
41598
42352
  if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_TAB) {
41599
42353
  this.unselectCells();
41600
42354
  }
@@ -41617,6 +42371,59 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
41617
42371
  }
41618
42372
  });
41619
42373
  }
42374
+ __onKeyDown(event) {
42375
+ // A key held down moves the caret on every repeat, with one keyup
42376
+ if (event?.repeat) {
42377
+ this.__followCaret();
42378
+ }
42379
+ this.__keyDownCell = this.__caretCell();
42380
+ this.__keyDownRange = this.j.s.range.cloneRange();
42381
+ this.__keyDownInLink = this.__isInLink();
42382
+ }
42383
+ __isInLink() {
42384
+ return Boolean(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, 'a', this.j.editor));
42385
+ }
42386
+ /**
42387
+ * Where the selection starts rather than `s.current()`, which finds the
42388
+ * first cell when the caret is just before the table
42389
+ */ __caretCell() {
42390
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(this.j.s.range.startContainer, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isCell, this.j.editor);
42391
+ }
42392
+ /**
42393
+ * A key that moves the caret into a cell, from another cell or from
42394
+ * outside the table, marks that cell and opens its popup, as a click on
42395
+ * it does. One that moves the caret out of the table unmarks the cells
42396
+ */ onKeyUp() {
42397
+ this.__followCaret();
42398
+ }
42399
+ __followCaret() {
42400
+ const before = this.__keyDownRange;
42401
+ this.__keyDownRange = null;
42402
+ if (this.j.o.readonly || !(0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_8__.isMoved)(this.j, before)) {
42403
+ return;
42404
+ }
42405
+ const cell = this.__caretCell();
42406
+ const hasLeftLink = this.__keyDownInLink && !this.__isInLink();
42407
+ if (cell === this.__keyDownCell && !(cell && hasLeftLink)) {
42408
+ return;
42409
+ }
42410
+ const hadMarked = this.__tableModule.getAllSelectedCells().length > 0;
42411
+ this.unselectCells();
42412
+ if (!cell) {
42413
+ if (hadMarked) {
42414
+ this.j.e.fire('hidePopup', 'cells');
42415
+ }
42416
+ return;
42417
+ }
42418
+ const table = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.closest(cell, 'table', this.j.editor);
42419
+ if (!table) {
42420
+ return;
42421
+ }
42422
+ // As after a click, the first change to the cell keeps the mark
42423
+ this.__selectedCell = cell;
42424
+ this.__tableModule.addSelection(cell);
42425
+ this.j.e.fire('showPopup', table, ()=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.position)(cell, this.j), 'cells');
42426
+ }
41620
42427
  /**
41621
42428
  * Mouse click inside the table
41622
42429
  */ onStartSelection(cell, event) {
@@ -41934,10 +42741,14 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
41934
42741
  }
41935
42742
  /** @override */ beforeDestruct(jodit) {
41936
42743
  this.__onRemoveSelection();
41937
- jodit.e.off('.select-cells');
42744
+ jodit.e.off('.select-cells').off('keydown', this.__onKeyDown);
41938
42745
  }
41939
42746
  constructor(...args){
41940
42747
  super(...args), /**
42748
+ * The cell with the caret, and the selection, when a key went down
42749
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownCell", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownRange", null), /**
42750
+ * A link's popup replaces the cell's while the caret is in the link
42751
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__keyDownInLink", false), /**
41941
42752
  * First selected cell
41942
42753
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__selectedCell", null), /**
41943
42754
  * User is selecting cells now
@@ -41947,6 +42758,12 @@ class selectCells extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_7__.Plugin
41947
42758
  ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(selectCells, "requires", [
41948
42759
  'select'
41949
42760
  ]);
42761
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
42762
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
42763
+ ], selectCells.prototype, "__onKeyDown", null);
42764
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
42765
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.watch)(':keyup')
42766
+ ], selectCells.prototype, "onKeyUp", null);
41950
42767
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
41951
42768
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
41952
42769
  ], selectCells.prototype, "onStartSelection", null);
@@ -44478,7 +45295,9 @@ const WORK_KEYS = new Set([
44478
45295
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
44479
45296
  {
44480
45297
  next = getNextCell();
44481
- if (!next) {
45298
+ // Left in the first cell leaves the table, as Up in the
45299
+ // top row does
45300
+ if (!next && key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
44482
45301
  tableModule.appendRow(table, !isPrev ? false : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.first(table, (node)=>jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, 'tr')), !isPrev);
44483
45302
  next = getNextCell();
44484
45303
  }
@@ -44504,7 +45323,6 @@ const WORK_KEYS = new Set([
44504
45323
  if (!next) {
44505
45324
  return;
44506
45325
  }
44507
- editor.e.fire('hidePopup hideResizer');
44508
45326
  if (!next.firstChild) {
44509
45327
  const first = editor.createInside.element('br');
44510
45328
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(next, first);
@@ -46325,7 +47143,7 @@ module.exports["default"] = {"Type something":"Start writing...","pencil":"Edit"
46325
47143
  /***/ 53414:
46326
47144
  /***/ (function(module) {
46327
47145
 
46328
- module.exports["default"] = [" URL","--Not Set--","About Jodit","Add column","Add folder","Add row","Advanced","Align","Align Center","Align Justify","Align Left","Align Right","All","Alternative","Alternative text","Anchor","Apply","Are you sure?","Audio properties","Autoplay","Background","Bold","Border","Border radius","Bottom","Break","Browse","Buy full version","Cancel","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Code","Controls","Copy selection","Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.","Create directory","Crop","Cut selection","Decrease Indent","Default","Delete","Delete column","Delete row","Delete table","Dot","Drop file","Drop image","Edit","Edit image","Edit link","Embed code","Empty cell","Enter Directory name","Enter new name","Error on load folders","Error on load list","Eye","File Browser","Fill color or set the text color","Filter","Find","Find Next","Find Previous","Font family","Font size","For information about the license, please go to our website:","Free Non-commercial Version","Heading 1","Heading 2","Heading 3","Heading 4","Height","Horizontal align","Image","Image properties","Increase Indent","Insert","Insert Horizontal Line","Insert Image","Insert Ordered List","Insert Special Character","Insert Unordered List","Insert as Text","Insert className","Insert column after","Insert column before","Insert file","Insert format block","Insert link","Insert only Text","Insert row above","Insert row below","Insert table","Insert youtube/vimeo video","Interim Results","Italic","Jodit Editor","Jodit User's Guide","Keep","Keep Aspect Ratio","Left","License: %s","Line height","Link","List view","Loop","Lower Alpha","Lower Greek","Lower Roman","Margins","Merge","Middle","Muted","No","No follow","Normal","Ok","Open in fullsize","Open in new tab","Open link","Open link in new tab","Paint format","Paste","Paste as HTML","Paste from clipboard","Please enter a web address","Please fill out this field","Poster","Press Alt for custom resizing","Print","Quadrate","Quote","Redo","Remove","Remove file","Rename","Replace","Replace with","Reset","Resize","Right","Save","Save as ...","Search for","Select","Select %s","Select Special Character","Select all","Select file","Show all","Sort by changed","Sort by name","Sort by size","Sound","Speech Recognize","Spellcheck","Split","Split horizontal","Split vertical","Src","Strike through","Styles","Text","The image has been successfully uploaded to the host!","The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","There are no files","Tiles view","Title","Top","Type something","Underline","Undo","Unlink","Update","Update file list","Upload","Upload file","Upper Alpha","Upper Roman","Vertical align","Video properties","Width","Word Paste Detected","Words: %d","Yes","You can only edit your own images. Download this image on the host?","Your browser doesn't support direct access to the clipboard.","Your code is similar to HTML. Keep as HTML?","about","apply","bold","bottom","brush","circle","contains detailed help for using","copy","cut","default","delete","dot","download","edit","eraser","file","font","fontsize","fullsize","hr","image","indent","italic","left","link","newline","ol","or click","outdent","palette","paragraph","pencil","preview","print","redo","right","selectall","shrink","sound","source","space","spellcheck","square","strikethrough","subscript","superscript","table","top","type dir name","type name","ul","underline","undo","video"]
47146
+ module.exports["default"] = [" URL","--Not Set--","About Jodit","Add column","Add folder","Add row","Advanced","Align","Align Center","Align Justify","Align Left","Align Right","All","Alternative","Alternative text","Anchor","Apply","Are you sure?","Audio properties","Autoplay","Background","Bold","Border","Border radius","Bottom","Break","Browse","Buy full version","Cancel","Center","Change mode","Chars: %d","Choose Content to Paste","Circle","Class name","Classes","Clean","Clear Formatting","Code","Controls","Copy selection","Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.","Create directory","Crop","Cut selection","Decrease Indent","Default","Delete","Delete column","Delete row","Delete table","Dot","Drop file","Drop image","Edit","Edit image","Edit link","Embed code","Empty cell","Enter Directory name","Enter new name","Error on load folders","Error on load list","Eye","File Browser","Fill color or set the text color","Filter","Find","Find Next","Find Previous","Font family","Font size","For information about the license, please go to our website:","Free Non-commercial Version","Heading 1","Heading 2","Heading 3","Heading 4","Height","Horizontal align","Image","Image properties","Increase Indent","Insert","Insert Horizontal Line","Insert Image","Insert Ordered List","Insert Special Character","Insert Unordered List","Insert as Text","Insert className","Insert column after","Insert column before","Insert file","Insert format block","Insert link","Insert only Text","Insert row above","Insert row below","Insert table","Insert youtube/vimeo video","Interim Results","Italic","Jodit Editor","Jodit User's Guide","Keep","Keep Aspect Ratio","Left","License: %s","Line height","Link","List view","Loop","Lower Alpha","Lower Greek","Lower Roman","Margins","Merge","Middle","Muted","No","No follow","Normal","Number for the first item","Ok","Open in fullsize","Open in new tab","Open link","Open link in new tab","Paint format","Paste","Paste as HTML","Paste from clipboard","Please enter a web address","Please fill out this field","Poster","Press Alt for custom resizing","Print","Quadrate","Quote","Redo","Remove","Remove file","Rename","Replace","Replace with","Reset","Resize","Right","Save","Save as ...","Search for","Select","Select %s","Select Special Character","Select all","Select file","Show all","Sort by changed","Sort by name","Sort by size","Sound","Speech Recognize","Spellcheck","Split","Split horizontal","Split vertical","Src","Start at...","Start numbering at","Strike through","Styles","Text","The image has been successfully uploaded to the host!","The pasted content is coming from a Microsoft Word/Excel document. Do you want to keep the format or clean it up?","There are no files","Tiles view","Title","Top","Type something","Underline","Undo","Unlink","Update","Update file list","Upload","Upload file","Upper Alpha","Upper Roman","Vertical align","Video properties","Width","Word Paste Detected","Words: %d","Yes","You can only edit your own images. Download this image on the host?","Your browser doesn't support direct access to the clipboard.","Your code is similar to HTML. Keep as HTML?","about","apply","bold","bottom","brush","circle","contains detailed help for using","copy","cut","default","delete","dot","download","edit","eraser","file","font","fontsize","fullsize","hr","image","indent","italic","left","link","newline","ol","or click","outdent","palette","paragraph","pencil","preview","print","redo","right","selectall","shrink","sound","source","space","spellcheck","square","strikethrough","subscript","superscript","table","top","type dir name","type name","ul","underline","undo","video"]
46329
47147
 
46330
47148
  /***/ }),
46331
47149