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
package/es5/jodit.js CHANGED
@@ -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
  */
@@ -2107,7 +2107,7 @@ __webpack_require__.r(__webpack_exports__);
2107
2107
  * @packageDocumentation
2108
2108
  * @module constants
2109
2109
  */
2110
- var APP_VERSION = "4.14.4";
2110
+ var APP_VERSION = "4.14.6";
2111
2111
  // prettier-ignore
2112
2112
  var ES = "es5";
2113
2113
  var IS_ES_MODERN = false;
@@ -3482,7 +3482,7 @@ var TEMP_ELEMENT_REG_EXP = new RegExp("<([a-z]+)[^>]+".concat(jodit_core_constan
3482
3482
  var first = current;
3483
3483
  var last = current;
3484
3484
  editor.s.save();
3485
- var needFindNext = false;
3485
+ var needFindNext;
3486
3486
  do {
3487
3487
  needFindNext = false;
3488
3488
  tmp = last.nextSibling;
@@ -3523,7 +3523,7 @@ var TEMP_ELEMENT_REG_EXP = new RegExp("<([a-z]+)[^>]+".concat(jodit_core_constan
3523
3523
  var first = current;
3524
3524
  var last = current;
3525
3525
  editor.s.save();
3526
- var needFindNext = false;
3526
+ var needFindNext;
3527
3527
  do {
3528
3528
  needFindNext = false;
3529
3529
  tmp = first.previousSibling;
@@ -5698,7 +5698,7 @@ var boxes = new WeakMap();
5698
5698
  var 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';
5699
5699
  var data = boxes.get(jodit) || {}, key = name + tag;
5700
5700
  var view = (0,jodit_core_helpers_checker_is_view_object__WEBPACK_IMPORTED_MODULE_2__.isViewObject)(jodit) ? jodit : jodit.j;
5701
- var body = null;
5701
+ var body;
5702
5702
  if (!data[key]) {
5703
5703
  var c = view.c;
5704
5704
  body = getPopupViewRoot(view.o, view.container, jodit.od.body);
@@ -5956,7 +5956,7 @@ var boxes = new WeakMap();
5956
5956
  /**
5957
5957
  * Check if browser has a color picker (a new HTML5 attribute for input tag)
5958
5958
  */ function hasBrowserColorPicker() {
5959
- var supportsColor = true;
5959
+ var supportsColor;
5960
5960
  try {
5961
5961
  var a = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('input');
5962
5962
  a.type = 'color';
@@ -6801,7 +6801,7 @@ function normalizeCSS(s) {
6801
6801
  var iframe = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.createElement('iframe');
6802
6802
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_4__.css)(iframe, 'display', 'none');
6803
6803
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalDocument.body, iframe);
6804
- var convertedString = '', collection = [];
6804
+ var convertedString = '', collection;
6805
6805
  try {
6806
6806
  var iframeDoc = iframe.contentDocument || (iframe.contentWindow ? iframe.contentWindow.document : null);
6807
6807
  if (iframeDoc) {
@@ -8210,7 +8210,7 @@ function size(subject) {
8210
8210
  * Unlike `indexOf` ignores INVISIBLE_SPACE and may fail at `maxDistance` characters
8211
8211
  */ function fuzzySearchIndex(needle, haystack) {
8212
8212
  var offset = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0, maxDistance = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
8213
- var i = 0, j = 0, startIndex = -1, len = 0, errorDistance = 0;
8213
+ var i = 0, j, startIndex = -1, len = 0, errorDistance = 0;
8214
8214
  for(j = offset; i < needle.length && j < haystack.length;){
8215
8215
  if (needle[i].toLowerCase() === haystack[j].toLowerCase()) {
8216
8216
  i++;
@@ -10497,9 +10497,9 @@ var $$temp = function $$temp() {
10497
10497
  if (parts.some(_is_unsafe_proto_key__WEBPACK_IMPORTED_MODULE_4__.isUnsafeProtoKey)) {
10498
10498
  return;
10499
10499
  }
10500
- var result = obj, key = parts[0];
10500
+ var result = obj;
10501
10501
  for(var i = 0; i < parts.length - 1; i += 1){
10502
- key = parts[i];
10502
+ var key = parts[i];
10503
10503
  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])) {
10504
10504
  result[key] = (0,jodit_core_helpers_checker_is_numeric__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(parts[i + 1]) ? [] : {};
10505
10505
  }
@@ -15604,7 +15604,6 @@ var AsyncStorage = /*#__PURE__*/ function() {
15604
15604
  value: function makeStorage() {
15605
15605
  var persistentOrStrategy = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, suffix = arguments.length > 1 ? arguments[1] : void 0, options = arguments.length > 2 ? arguments[2] : void 0;
15606
15606
  var provider = undefined;
15607
- var storage = null;
15608
15607
  // An explicit `defaultProvider` overrides the strategy-based selection
15609
15608
  // below and decides which provider backs the storage.
15610
15609
  var defaultProvider = options === null || options === void 0 ? void 0 : options.defaultProvider;
@@ -15631,8 +15630,7 @@ var AsyncStorage = /*#__PURE__*/ function() {
15631
15630
  if (!provider) {
15632
15631
  provider = new _engines_memory_storage_provider__WEBPACK_IMPORTED_MODULE_8__.MemoryStorageProvider();
15633
15632
  }
15634
- storage = new AsyncStorage(Promise.resolve(provider), suffix);
15635
- return storage;
15633
+ return new AsyncStorage(Promise.resolve(provider), suffix);
15636
15634
  }
15637
15635
  }
15638
15636
  ]);
@@ -20255,7 +20253,7 @@ var Popup = /*#__PURE__*/ function(UIGroup) {
20255
20253
  };
20256
20254
  };
20257
20255
  var getMatchStrategy = function getMatchStrategy(inBox) {
20258
- var strategy = null;
20256
+ var strategy;
20259
20257
  if (Popup.boxInView(getPointByStrategy(defaultStrategy), inBox)) {
20260
20258
  strategy = defaultStrategy;
20261
20259
  } else {
@@ -27292,7 +27290,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
27292
27290
  h: 0
27293
27291
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "calcCropBox", function() {
27294
27292
  var node = _this.crop_box.parentNode, w = node.offsetWidth * 0.8, h = node.offsetHeight * 0.8;
27295
- var wn = w, hn = h;
27293
+ var wn, hn;
27296
27294
  var nw = _this.naturalWidth, nh = _this.naturalHeight;
27297
27295
  if (w > nw && h > nh) {
27298
27296
  wn = nw;
@@ -28971,8 +28969,8 @@ var Table = /*#__PURE__*/ function(ViewComponent) {
28971
28969
  {
28972
28970
  key: "__removeExtraRowspans",
28973
28971
  value: function __removeExtraRowspans(box, marked) {
28974
- var i = 0;
28975
- var j = 0;
28972
+ var i;
28973
+ var j;
28976
28974
  for(i = 0; i < box.length; i += 1){
28977
28975
  var min = 1000000;
28978
28976
  var not = false;
@@ -31503,7 +31501,6 @@ jodit_core_ui__WEBPACK_IMPORTED_MODULE_2__.Icon.set('palette', (_palette_svg__WE
31503
31501
  button
31504
31502
  ])
31505
31503
  ]);
31506
- currentImage = null;
31507
31504
  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)) {
31508
31505
  currentImage = elm.tagName === 'IMG' ? elm : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.$$)('img', elm)[0];
31509
31506
  val(form.container, 'url', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.attr)(currentImage, 'src'));
@@ -33122,7 +33119,6 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
33122
33119
  }
33123
33120
  if (removeNeighbor) {
33124
33121
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(removeNeighbor);
33125
- removeNeighbor = null;
33126
33122
  }
33127
33123
  if (charRemoved) {
33128
33124
  removeEmptyForParent(fakeNode, 'a');
@@ -34811,7 +34807,6 @@ __webpack_require__.r(__webpack_exports__);
34811
34807
  */ function replaceOldTags(jodit, nodeElm, hadEffect) {
34812
34808
  var newNodeElm = replaceIfMatched(jodit, nodeElm, jodit.o.cleanHTML.replaceOldTags);
34813
34809
  if (nodeElm !== newNodeElm) {
34814
- nodeElm = newNodeElm;
34815
34810
  return true;
34816
34811
  }
34817
34812
  return hadEffect;
@@ -35549,7 +35544,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__.Config.prototype.controls.brush = {
35549
35544
  button.state.activated = false;
35550
35545
  },
35551
35546
  popup: function popup(editor, current, close, button) {
35552
- var colorHEX = '', bg_color = '', tabs = [], currentElement = null;
35547
+ var colorHEX = '', bg_color = '', tabs, currentElement = null;
35553
35548
  if (current && current !== editor.editor && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isNode(current)) {
35554
35549
  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([
35555
35550
  'br',
@@ -38813,6 +38808,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
38813
38808
  }
38814
38809
  return html;
38815
38810
  };
38811
+ /**
38812
+ * Replace the whole iframe document with the given HTML.
38813
+ *
38814
+ * The markup is parsed in an inert document first (no browsing
38815
+ * context: scripts do not run, sub-resources are not fetched),
38816
+ * sanitized there via `safeHTML`, and only then moved into the
38817
+ * live document. `document.write` on the live document would
38818
+ * execute inline scripts and event handlers while parsing,
38819
+ * before the sanitizer had a chance to strip them, and the
38820
+ * iframe is same-origin with the host page by default.
38821
+ * A `<script>` the cleaner is configured to keep still never
38822
+ * executes: nodes coming from an inert parser are flagged
38823
+ * "already started", exactly like `innerHTML`.
38824
+ * See GHSA-w3xv-x3fm-59ph.
38825
+ */ var replaceDocument = function replaceDocument(html) {
38826
+ var inert = new DOMParser().parseFromString(html, 'text/html');
38827
+ editor.e.fire('safeHTML', inert.documentElement);
38828
+ doc.replaceChild(doc.adoptNode(inert.documentElement), doc.documentElement);
38829
+ };
38816
38830
  if (docMode) {
38817
38831
  var tag = editor.element.tagName;
38818
38832
  if (tag !== 'TEXTAREA' && tag !== 'INPUT') {
@@ -38828,19 +38842,20 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
38828
38842
  if (/<(html|body)/i.test(value)) {
38829
38843
  var old = doc.documentElement.outerHTML;
38830
38844
  if (clearMarkers(old) !== clearMarkers(value)) {
38831
- doc.open();
38832
- doc.write(editor.o.iframeDoctype + clearMarkers(value));
38833
- doc.close();
38845
+ replaceDocument(clearMarkers(value));
38834
38846
  editor.editor = doc.body;
38835
- editor.e.fire('safeHTML', editor.editor);
38836
38847
  toggleEditable();
38837
38848
  editor.e.fire('prepareWYSIWYGEditor');
38838
38849
  editor.e.stopPropagation('beforeSetNativeEditorValue');
38839
38850
  }
38840
- } else {
38841
- doc.body.innerHTML = value;
38851
+ return true;
38842
38852
  }
38843
- return true;
38853
+ // A partial value goes through the regular
38854
+ // path: `clean-html` sanitizes it and the
38855
+ // editor assigns it to `doc.body` via
38856
+ // `innerHTML`. Writing the raw value here
38857
+ // would fire its event handlers first.
38858
+ return false;
38844
38859
  }, {
38845
38860
  top: true
38846
38861
  });
@@ -46142,11 +46157,11 @@ var key = 'table_processor_observer-resize';
46142
46157
  this.startX = event.clientX;
46143
46158
  this.j.lock(key);
46144
46159
  this.resizeHandler.classList.add('jodit-table-resizer_moved');
46145
- var box, tableBox = this.workTable.getBoundingClientRect();
46160
+ var box;
46146
46161
  this.minX = 0;
46147
46162
  this.maxX = 1000000;
46148
46163
  if (this.wholeTable != null) {
46149
- tableBox = this.workTable.parentNode.getBoundingClientRect();
46164
+ var tableBox = this.workTable.parentNode.getBoundingClientRect();
46150
46165
  this.minX = tableBox.left;
46151
46166
  this.maxX = this.minX + tableBox.width;
46152
46167
  } else {
@@ -46821,7 +46836,7 @@ var keyBInd = '__jodit-resizer_binded';
46821
46836
  diff_y = this.pointerY - this.startY;
46822
46837
  }
46823
46838
  var className = this.handle.className;
46824
- var new_w = 0, new_h = 0;
46839
+ var new_w, new_h;
46825
46840
  var uar = this.j.o.resizer.useAspectRatio;
46826
46841
  if (!this.isAltMode && (uar === true || uar && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(this.element, uar))) {
46827
46842
  if (diff_x) {
@@ -47430,7 +47445,7 @@ var SentenceFinder = /*#__PURE__*/ function() {
47430
47445
  value: function ranges(needle) {
47431
47446
  var position = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
47432
47447
  var results = [];
47433
- var index = position, len = 0, startQueueIndex = 0;
47448
+ var index = position, len, startQueueIndex = 0;
47434
47449
  // Find all ranges in substring
47435
47450
  do {
47436
47451
  var ref;
@@ -50321,7 +50336,7 @@ var SourceEditor = /*#__PURE__*/ function() {
50321
50336
  return;
50322
50337
  }
50323
50338
  var value = this.getMirrorValue();
50324
- var selectionStart = 0, selectionEnd = 0;
50339
+ var selectionStart, selectionEnd;
50325
50340
  try {
50326
50341
  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);
50327
50342
  if (!this.j.o.editHTMLDocumentMode && this.j.o.beautifyHTML) {
@@ -52753,7 +52768,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_6__.Config.prototype.controls.table = {
52753
52768
  return;
52754
52769
  }
52755
52770
  var index = parseInt((0,jodit_core_helpers_utils__WEBPACK_IMPORTED_MODULE_4__.attr)(e.target, '-index') || '0', 10), row = Math.floor(index / default_cols_count), col = index % default_cols_count;
52756
- var nextIndex = index;
52771
+ var nextIndex;
52757
52772
  switch(e.key){
52758
52773
  case jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_LEFT:
52759
52774
  nextIndex = col > 0 ? index - 1 : index;
package/es5/jodit.min.css CHANGED
@@ -1,14 +1,14 @@
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
  */
8
8
  /*!
9
9
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
11
- * Version: v4.14.4
11
+ * Version: v4.14.6
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */