jodit 4.14.4 → 4.14.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 (187) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +9 -9
  4. package/es2015/jodit.js +49 -34
  5. package/es2015/jodit.min.js +9 -9
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.fat.min.js +9 -9
  13. package/es2018/jodit.min.js +9 -9
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +10 -10
  18. package/es2021/jodit.js +49 -34
  19. package/es2021/jodit.min.js +10 -10
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +10 -10
  28. package/es2021.en/jodit.js +49 -34
  29. package/es2021.en/jodit.min.js +10 -10
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +49 -34
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/dom/dom.js +2 -2
  52. package/esm/core/global.js +1 -1
  53. package/esm/core/helpers/checker/has-browser-color-picker.js +1 -1
  54. package/esm/core/helpers/html/apply-styles.js +1 -1
  55. package/esm/core/helpers/string/fuzzy-search-index.js +1 -1
  56. package/esm/core/helpers/utils/set.js +2 -2
  57. package/esm/core/storage/async-storage.js +1 -3
  58. package/esm/core/ui/popup/popup.js +1 -1
  59. package/esm/modules/image-editor/image-editor.js +1 -1
  60. package/esm/modules/table/table.js +2 -2
  61. package/esm/modules/widget/file-selector/file-selector.js +0 -1
  62. package/esm/plugins/ai-assistant/langs/en.js +1 -1
  63. package/esm/plugins/ai-assistant/langs/es.js +1 -1
  64. package/esm/plugins/backspace/cases/check-remove-char.js +0 -1
  65. package/esm/plugins/clean-html/helpers/visitor/filters/replace-old-tags.js +0 -1
  66. package/esm/plugins/color/config.js +1 -1
  67. package/esm/plugins/copy-format/langs/ar.js +1 -1
  68. package/esm/plugins/copy-format/langs/cs_cz.js +1 -1
  69. package/esm/plugins/copy-format/langs/de.js +1 -1
  70. package/esm/plugins/copy-format/langs/es.js +1 -1
  71. package/esm/plugins/copy-format/langs/fa.js +1 -1
  72. package/esm/plugins/copy-format/langs/fi.js +1 -1
  73. package/esm/plugins/copy-format/langs/fr.js +1 -1
  74. package/esm/plugins/copy-format/langs/he.js +1 -1
  75. package/esm/plugins/copy-format/langs/hu.js +1 -1
  76. package/esm/plugins/copy-format/langs/id.js +1 -1
  77. package/esm/plugins/copy-format/langs/it.js +1 -1
  78. package/esm/plugins/copy-format/langs/ja.js +1 -1
  79. package/esm/plugins/copy-format/langs/ko.js +1 -1
  80. package/esm/plugins/copy-format/langs/mn.js +1 -1
  81. package/esm/plugins/copy-format/langs/nl.js +1 -1
  82. package/esm/plugins/copy-format/langs/pl.js +1 -1
  83. package/esm/plugins/copy-format/langs/pt_br.js +1 -1
  84. package/esm/plugins/copy-format/langs/ru.js +1 -1
  85. package/esm/plugins/copy-format/langs/tr.js +1 -1
  86. package/esm/plugins/copy-format/langs/zh_cn.js +1 -1
  87. package/esm/plugins/copy-format/langs/zh_tw.js +1 -1
  88. package/esm/plugins/iframe/iframe.js +28 -9
  89. package/esm/plugins/line-height/langs/ar.js +1 -1
  90. package/esm/plugins/line-height/langs/cs_cz.js +1 -1
  91. package/esm/plugins/line-height/langs/de.js +1 -1
  92. package/esm/plugins/line-height/langs/es.js +1 -1
  93. package/esm/plugins/line-height/langs/fa.js +1 -1
  94. package/esm/plugins/line-height/langs/fi.js +1 -1
  95. package/esm/plugins/line-height/langs/fr.js +1 -1
  96. package/esm/plugins/line-height/langs/he.js +1 -1
  97. package/esm/plugins/line-height/langs/hu.js +1 -1
  98. package/esm/plugins/line-height/langs/id.js +1 -1
  99. package/esm/plugins/line-height/langs/it.js +1 -1
  100. package/esm/plugins/line-height/langs/ja.js +1 -1
  101. package/esm/plugins/line-height/langs/ko.js +1 -1
  102. package/esm/plugins/line-height/langs/mn.js +1 -1
  103. package/esm/plugins/line-height/langs/nl.js +1 -1
  104. package/esm/plugins/line-height/langs/pl.js +1 -1
  105. package/esm/plugins/line-height/langs/pt_br.js +1 -1
  106. package/esm/plugins/line-height/langs/ru.js +1 -1
  107. package/esm/plugins/line-height/langs/sk.js +1 -1
  108. package/esm/plugins/line-height/langs/tr.js +1 -1
  109. package/esm/plugins/line-height/langs/ua.js +1 -1
  110. package/esm/plugins/line-height/langs/zh_cn.js +1 -1
  111. package/esm/plugins/line-height/langs/zh_tw.js +1 -1
  112. package/esm/plugins/resize-cells/resize-cells.js +2 -2
  113. package/esm/plugins/resizer/resizer.js +1 -1
  114. package/esm/plugins/search/helpers/sentence-finder.js +1 -1
  115. package/esm/plugins/source/source.js +1 -1
  116. package/esm/plugins/speech-recognize/langs/ar.js +1 -1
  117. package/esm/plugins/speech-recognize/langs/cs_cz.js +1 -1
  118. package/esm/plugins/speech-recognize/langs/de.js +1 -1
  119. package/esm/plugins/speech-recognize/langs/es.js +1 -1
  120. package/esm/plugins/speech-recognize/langs/fa.js +1 -1
  121. package/esm/plugins/speech-recognize/langs/fi.js +1 -1
  122. package/esm/plugins/speech-recognize/langs/fr.js +1 -1
  123. package/esm/plugins/speech-recognize/langs/he.js +1 -1
  124. package/esm/plugins/speech-recognize/langs/hu.js +1 -1
  125. package/esm/plugins/speech-recognize/langs/id.js +1 -1
  126. package/esm/plugins/speech-recognize/langs/it.js +1 -1
  127. package/esm/plugins/speech-recognize/langs/ja.js +1 -1
  128. package/esm/plugins/speech-recognize/langs/ko.js +1 -1
  129. package/esm/plugins/speech-recognize/langs/mn.js +1 -1
  130. package/esm/plugins/speech-recognize/langs/nl.js +1 -1
  131. package/esm/plugins/speech-recognize/langs/no.js +1 -1
  132. package/esm/plugins/speech-recognize/langs/pl.js +1 -1
  133. package/esm/plugins/speech-recognize/langs/pt_br.js +1 -1
  134. package/esm/plugins/speech-recognize/langs/ru.js +1 -1
  135. package/esm/plugins/speech-recognize/langs/sk.js +1 -1
  136. package/esm/plugins/speech-recognize/langs/tr.js +1 -1
  137. package/esm/plugins/speech-recognize/langs/ua.js +1 -1
  138. package/esm/plugins/speech-recognize/langs/zh_cn.js +1 -1
  139. package/esm/plugins/speech-recognize/langs/zh_tw.js +1 -1
  140. package/esm/plugins/spellcheck/langs/ar.js +1 -1
  141. package/esm/plugins/spellcheck/langs/cs_cz.js +1 -1
  142. package/esm/plugins/spellcheck/langs/de.js +1 -1
  143. package/esm/plugins/spellcheck/langs/es.js +1 -1
  144. package/esm/plugins/spellcheck/langs/fa.js +1 -1
  145. package/esm/plugins/spellcheck/langs/fi.js +1 -1
  146. package/esm/plugins/spellcheck/langs/fr.js +1 -1
  147. package/esm/plugins/spellcheck/langs/he.js +1 -1
  148. package/esm/plugins/spellcheck/langs/hu.js +1 -1
  149. package/esm/plugins/spellcheck/langs/id.js +1 -1
  150. package/esm/plugins/spellcheck/langs/it.js +1 -1
  151. package/esm/plugins/spellcheck/langs/ja.js +1 -1
  152. package/esm/plugins/spellcheck/langs/ko.js +1 -1
  153. package/esm/plugins/spellcheck/langs/mn.js +1 -1
  154. package/esm/plugins/spellcheck/langs/nl.js +1 -1
  155. package/esm/plugins/spellcheck/langs/no.js +1 -1
  156. package/esm/plugins/spellcheck/langs/pl.js +1 -1
  157. package/esm/plugins/spellcheck/langs/pt_br.js +1 -1
  158. package/esm/plugins/spellcheck/langs/ru.js +1 -1
  159. package/esm/plugins/spellcheck/langs/sk.js +1 -1
  160. package/esm/plugins/spellcheck/langs/tr.js +1 -1
  161. package/esm/plugins/spellcheck/langs/ua.js +1 -1
  162. package/esm/plugins/spellcheck/langs/zh_cn.js +1 -1
  163. package/esm/plugins/spellcheck/langs/zh_tw.js +1 -1
  164. package/esm/plugins/symbols/langs/ar.js +1 -1
  165. package/esm/plugins/symbols/langs/cs_cz.js +1 -1
  166. package/esm/plugins/symbols/langs/de.js +1 -1
  167. package/esm/plugins/symbols/langs/es.js +1 -1
  168. package/esm/plugins/symbols/langs/fa.js +1 -1
  169. package/esm/plugins/symbols/langs/fi.js +1 -1
  170. package/esm/plugins/symbols/langs/fr.js +1 -1
  171. package/esm/plugins/symbols/langs/he.js +1 -1
  172. package/esm/plugins/symbols/langs/hu.js +1 -1
  173. package/esm/plugins/symbols/langs/id.js +1 -1
  174. package/esm/plugins/symbols/langs/it.js +1 -1
  175. package/esm/plugins/symbols/langs/ja.js +1 -1
  176. package/esm/plugins/symbols/langs/ko.js +1 -1
  177. package/esm/plugins/symbols/langs/mn.js +1 -1
  178. package/esm/plugins/symbols/langs/nl.js +1 -1
  179. package/esm/plugins/symbols/langs/pl.js +1 -1
  180. package/esm/plugins/symbols/langs/pt_br.js +1 -1
  181. package/esm/plugins/symbols/langs/ru.js +1 -1
  182. package/esm/plugins/symbols/langs/tr.js +1 -1
  183. package/esm/plugins/symbols/langs/ua.js +1 -1
  184. package/esm/plugins/symbols/langs/zh_cn.js +1 -1
  185. package/esm/plugins/symbols/langs/zh_tw.js +1 -1
  186. package/esm/plugins/table/config.js +1 -1
  187. package/package.json +4 -1
@@ -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.14.4
4
+ * Version: v4.14.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1779,7 +1779,7 @@ __webpack_require__.r(__webpack_exports__);
1779
1779
  * ```
1780
1780
  * @packageDocumentation
1781
1781
  * @module constants
1782
- */ const APP_VERSION = "4.14.4";
1782
+ */ const APP_VERSION = "4.14.6";
1783
1783
  // prettier-ignore
1784
1784
  const ES = "es2021";
1785
1785
  const IS_ES_MODERN = true;
@@ -3075,7 +3075,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3075
3075
  const first = current;
3076
3076
  let last = current;
3077
3077
  editor.s.save();
3078
- let needFindNext = false;
3078
+ let needFindNext;
3079
3079
  do {
3080
3080
  needFindNext = false;
3081
3081
  tmp = last.nextSibling;
@@ -3110,7 +3110,7 @@ const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${jodit_core_constants__W
3110
3110
  let first = current;
3111
3111
  let last = current;
3112
3112
  editor.s.save();
3113
- let needFindNext = false;
3113
+ let needFindNext;
3114
3114
  do {
3115
3115
  needFindNext = false;
3116
3116
  tmp = first.previousSibling;
@@ -4778,7 +4778,7 @@ const boxes = new WeakMap();
4778
4778
  const name = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(classFunc) ? classFunc : classFunc ? (0,jodit_core_helpers_utils_get_class_name__WEBPACK_IMPORTED_MODULE_6__.getClassName)(classFunc.prototype) : 'jodit-utils';
4779
4779
  const data = boxes.get(jodit) || {}, key = name + tag;
4780
4780
  const view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_2__.isViewObject)(jodit) ? jodit : jodit.j;
4781
- let body = null;
4781
+ let body;
4782
4782
  if (!data[key]) {
4783
4783
  let c = view.c;
4784
4784
  body = getPopupViewRoot(view.o, view.container, jodit.od.body);
@@ -5025,7 +5025,7 @@ const boxes = new WeakMap();
5025
5025
  /**
5026
5026
  * Check if browser has a color picker (a new HTML5 attribute for input tag)
5027
5027
  */ function hasBrowserColorPicker() {
5028
- let supportsColor = true;
5028
+ let supportsColor;
5029
5029
  try {
5030
5030
  const a = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('input');
5031
5031
  a.type = 'color';
@@ -5859,7 +5859,7 @@ function normalizeCSS(s) {
5859
5859
  const iframe = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('iframe');
5860
5860
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(iframe, 'display', 'none');
5861
5861
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.body, iframe);
5862
- let convertedString = '', collection = [];
5862
+ let convertedString = '', collection;
5863
5863
  try {
5864
5864
  const iframeDoc = iframe.contentDocument || (iframe.contentWindow ? iframe.contentWindow.document : null);
5865
5865
  if (iframeDoc) {
@@ -7195,7 +7195,7 @@ function size(subject) {
7195
7195
  * Finds the position of the substring in the string, if any, and returns the length of the found subsequence.
7196
7196
  * Unlike `indexOf` ignores INVISIBLE_SPACE and may fail at `maxDistance` characters
7197
7197
  */ function fuzzySearchIndex(needle, haystack, offset = 0, maxDistance = 1) {
7198
- let i = 0, j = 0, startIndex = -1, len = 0, errorDistance = 0;
7198
+ let i = 0, j, startIndex = -1, len = 0, errorDistance = 0;
7199
7199
  for(j = offset; i < needle.length && j < haystack.length;){
7200
7200
  if (needle[i].toLowerCase() === haystack[j].toLowerCase()) {
7201
7201
  i++;
@@ -9420,9 +9420,9 @@ const $$temp = ()=>{
9420
9420
  if (parts.some(_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_4__.isUnsafeProtoKey)) {
9421
9421
  return;
9422
9422
  }
9423
- let result = obj, key = parts[0];
9423
+ let result = obj;
9424
9424
  for(let i = 0; i < parts.length - 1; i += 1){
9425
- key = parts[i];
9425
+ const key = parts[i];
9426
9426
  if (!(0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_0__.isArray)(result[key]) && !(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_2__.isPlainObject)(result[key])) {
9427
9427
  result[key] = (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(parts[i + 1]) ? [] : {};
9428
9428
  }
@@ -13467,7 +13467,6 @@ class AsyncStorage {
13467
13467
  }
13468
13468
  static makeStorage(persistentOrStrategy = false, suffix, options) {
13469
13469
  let provider = undefined;
13470
- let storage = null;
13471
13470
  // An explicit `defaultProvider` overrides the strategy-based selection
13472
13471
  // below and decides which provider backs the storage.
13473
13472
  const defaultProvider = options?.defaultProvider;
@@ -13492,8 +13491,7 @@ class AsyncStorage {
13492
13491
  if (!provider) {
13493
13492
  provider = new _engines_memory_storage_provider__WEBPACK_IMPORTED_MODULE_4__.MemoryStorageProvider();
13494
13493
  }
13495
- storage = new AsyncStorage(Promise.resolve(provider), suffix);
13496
- return storage;
13494
+ return new AsyncStorage(Promise.resolve(provider), suffix);
13497
13495
  }
13498
13496
  constructor(provider, suffix){
13499
13497
  ;(0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "provider", void 0);
@@ -16689,7 +16687,7 @@ class Popup extends jodit_core_ui_group_group__WEBPACK_IMPORTED_MODULE_10__.UIGr
16689
16687
  };
16690
16688
  };
16691
16689
  const getMatchStrategy = (inBox)=>{
16692
- let strategy = null;
16690
+ let strategy;
16693
16691
  if (Popup.boxInView(getPointByStrategy(defaultStrategy), inBox)) {
16694
16692
  strategy = defaultStrategy;
16695
16693
  } else {
@@ -22632,7 +22630,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
22632
22630
  h: 0
22633
22631
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "calcCropBox", ()=>{
22634
22632
  const node = this.crop_box.parentNode, w = node.offsetWidth * 0.8, h = node.offsetHeight * 0.8;
22635
- let wn = w, hn = h;
22633
+ let wn, hn;
22636
22634
  const { naturalWidth: nw, naturalHeight: nh } = this;
22637
22635
  if (w > nw && h > nh) {
22638
22636
  wn = nw;
@@ -23831,8 +23829,8 @@ class Table extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.ViewCompon
23831
23829
  }
23832
23830
  }
23833
23831
  static __removeExtraRowspans(box, marked) {
23834
- let i = 0;
23835
- let j = 0;
23832
+ let i;
23833
+ let j;
23836
23834
  for(i = 0; i < box.length; i += 1){
23837
23835
  let min = 1000000;
23838
23836
  let not = false;
@@ -25965,7 +25963,6 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
25965
25963
  button
25966
25964
  ])
25967
25965
  ]);
25968
- currentImage = null;
25969
25966
  if (elm && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isText(elm) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isComment(elm) && (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(elm, 'img') || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.$$)('img', elm).length)) {
25970
25967
  currentImage = elm.tagName === 'IMG' ? elm : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.$$)('img', elm)[0];
25971
25968
  val(form.container, 'url', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(currentImage, 'src'));
@@ -27329,7 +27326,6 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
27329
27326
  }
27330
27327
  if (removeNeighbor) {
27331
27328
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(removeNeighbor);
27332
- removeNeighbor = null;
27333
27329
  }
27334
27330
  if (charRemoved) {
27335
27331
  removeEmptyForParent(fakeNode, 'a');
@@ -28929,7 +28925,6 @@ __webpack_require__.r(__webpack_exports__);
28929
28925
  */ function replaceOldTags(jodit, nodeElm, hadEffect) {
28930
28926
  const newNodeElm = replaceIfMatched(jodit, nodeElm, jodit.o.cleanHTML.replaceOldTags);
28931
28927
  if (nodeElm !== newNodeElm) {
28932
- nodeElm = newNodeElm;
28933
28928
  return true;
28934
28929
  }
28935
28930
  return hadEffect;
@@ -29587,7 +29582,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.brush = {
29587
29582
  button.state.activated = false;
29588
29583
  },
29589
29584
  popup: (editor, current, close, button)=>{
29590
- let colorHEX = '', bg_color = '', tabs = [], currentElement = null;
29585
+ let colorHEX = '', bg_color = '', tabs, currentElement = null;
29591
29586
  if (current && current !== editor.editor && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isNode(current)) {
29592
29587
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(current) && editor.s.isCollapsed() && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(current, new Set([
29593
29588
  'br',
@@ -32244,6 +32239,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
32244
32239
  }
32245
32240
  return html;
32246
32241
  };
32242
+ /**
32243
+ * Replace the whole iframe document with the given HTML.
32244
+ *
32245
+ * The markup is parsed in an inert document first (no browsing
32246
+ * context: scripts do not run, sub-resources are not fetched),
32247
+ * sanitized there via `safeHTML`, and only then moved into the
32248
+ * live document. `document.write` on the live document would
32249
+ * execute inline scripts and event handlers while parsing,
32250
+ * before the sanitizer had a chance to strip them, and the
32251
+ * iframe is same-origin with the host page by default.
32252
+ * A `<script>` the cleaner is configured to keep still never
32253
+ * executes: nodes coming from an inert parser are flagged
32254
+ * "already started", exactly like `innerHTML`.
32255
+ * See GHSA-w3xv-x3fm-59ph.
32256
+ */ const replaceDocument = (html)=>{
32257
+ const inert = new DOMParser().parseFromString(html, 'text/html');
32258
+ editor.e.fire('safeHTML', inert.documentElement);
32259
+ doc.replaceChild(doc.adoptNode(inert.documentElement), doc.documentElement);
32260
+ };
32247
32261
  if (docMode) {
32248
32262
  const tag = editor.element.tagName;
32249
32263
  if (tag !== 'TEXTAREA' && tag !== 'INPUT') {
@@ -32256,19 +32270,20 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
32256
32270
  if (/<(html|body)/i.test(value)) {
32257
32271
  const old = doc.documentElement.outerHTML;
32258
32272
  if (clearMarkers(old) !== clearMarkers(value)) {
32259
- doc.open();
32260
- doc.write(editor.o.iframeDoctype + clearMarkers(value));
32261
- doc.close();
32273
+ replaceDocument(clearMarkers(value));
32262
32274
  editor.editor = doc.body;
32263
- editor.e.fire('safeHTML', editor.editor);
32264
32275
  toggleEditable();
32265
32276
  editor.e.fire('prepareWYSIWYGEditor');
32266
32277
  editor.e.stopPropagation('beforeSetNativeEditorValue');
32267
32278
  }
32268
- } else {
32269
- doc.body.innerHTML = value;
32279
+ return true;
32270
32280
  }
32271
- return true;
32281
+ // A partial value goes through the regular
32282
+ // path: `clean-html` sanitizes it and the
32283
+ // editor assigns it to `doc.body` via
32284
+ // `innerHTML`. Writing the raw value here
32285
+ // would fire its event handlers first.
32286
+ return false;
32272
32287
  }, {
32273
32288
  top: true
32274
32289
  });
@@ -38066,11 +38081,11 @@ const key = 'table_processor_observer-resize';
38066
38081
  this.startX = event.clientX;
38067
38082
  this.j.lock(key);
38068
38083
  this.resizeHandler.classList.add('jodit-table-resizer_moved');
38069
- let box, tableBox = this.workTable.getBoundingClientRect();
38084
+ let box;
38070
38085
  this.minX = 0;
38071
38086
  this.maxX = 1000000;
38072
38087
  if (this.wholeTable != null) {
38073
- tableBox = this.workTable.parentNode.getBoundingClientRect();
38088
+ const tableBox = this.workTable.parentNode.getBoundingClientRect();
38074
38089
  this.minX = tableBox.left;
38075
38090
  this.maxX = this.minX + tableBox.width;
38076
38091
  } else {
@@ -38606,7 +38621,7 @@ const keyBInd = '__jodit-resizer_binded';
38606
38621
  diff_y = this.pointerY - this.startY;
38607
38622
  }
38608
38623
  const className = this.handle.className;
38609
- let new_w = 0, new_h = 0;
38624
+ let new_w, new_h;
38610
38625
  const uar = this.j.o.resizer.useAspectRatio;
38611
38626
  if (!this.isAltMode && (uar === true || uar && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.isTag(this.element, uar))) {
38612
38627
  if (diff_x) {
@@ -39170,7 +39185,7 @@ class SentenceFinder {
39170
39185
  }
39171
39186
  ranges(needle, position = 0) {
39172
39187
  const results = [];
39173
- let index = position, len = 0, startQueueIndex = 0;
39188
+ let index = position, len, startQueueIndex = 0;
39174
39189
  // Find all ranges in substring
39175
39190
  do {
39176
39191
  [index, len] = this.searchIndex(needle, this.value, index);
@@ -41319,7 +41334,7 @@ class SourceEditor {
41319
41334
  return;
41320
41335
  }
41321
41336
  let value = this.getMirrorValue();
41322
- let selectionStart = 0, selectionEnd = 0;
41337
+ let selectionStart, selectionEnd;
41323
41338
  try {
41324
41339
  value = value.replace(/<span[^>]+data-jodit-selection_marker=(["'])start\1[^>]*>[<>]*?<\/span>/gim, this.tempMarkerStart).replace(/<span[^>]+data-jodit-selection_marker=(["'])end\1[^>]*>[<>]*?<\/span>/gim, this.tempMarkerEnd);
41325
41340
  if (!this.j.o.editHTMLDocumentMode && this.j.o.beautifyHTML) {
@@ -42831,7 +42846,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.table = {
42831
42846
  return;
42832
42847
  }
42833
42848
  const index = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_3__.attr)(e.target, '-index') || '0', 10), row = Math.floor(index / default_cols_count), col = index % default_cols_count;
42834
- let nextIndex = index;
42849
+ let nextIndex;
42835
42850
  switch(e.key){
42836
42851
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_LEFT:
42837
42852
  nextIndex = col > 0 ? index - 1 : index;