jodit 4.18.10 → 4.18.12

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 (73) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +5 -5
  4. package/es2015/jodit.js +281 -76
  5. package/es2015/jodit.min.js +5 -5
  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 +5 -5
  13. package/es2018/jodit.min.js +5 -5
  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 +7 -7
  18. package/es2021/jodit.js +278 -76
  19. package/es2021/jodit.min.js +7 -7
  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 +7 -7
  28. package/es2021.en/jodit.js +278 -76
  29. package/es2021.en/jodit.min.js +7 -7
  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 +353 -77
  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 +2 -2
  48. package/es5/polyfills.js +3 -3
  49. package/es5/polyfills.min.js +2 -2
  50. package/esm/core/async/async.js +2 -1
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/helpers/size/get-fixed-position-offset.d.ts +4 -2
  53. package/esm/core/helpers/size/get-fixed-position-offset.js +14 -2
  54. package/esm/core/selection/style/api/list/toggle-ordered-list.d.ts +1 -1
  55. package/esm/core/selection/style/api/list/toggle-ordered-list.js +30 -4
  56. package/esm/core/selection/style/transactions.js +1 -1
  57. package/esm/plugins/add-new-line/add-new-line.d.ts +7 -0
  58. package/esm/plugins/add-new-line/add-new-line.js +45 -0
  59. package/esm/plugins/backspace/backspace.d.ts +7 -0
  60. package/esm/plugins/backspace/backspace.js +45 -2
  61. package/esm/plugins/backspace/cases/check-join-neighbors.js +69 -1
  62. package/esm/plugins/backspace/cases/check-remove-char.js +3 -1
  63. package/esm/plugins/backspace/cases/check-remove-content-not-editable.d.ts +4 -1
  64. package/esm/plugins/backspace/cases/check-remove-content-not-editable.js +39 -11
  65. package/esm/plugins/wrap-nodes/wrap-nodes.js +19 -2
  66. package/esm/types/async.d.ts +7 -0
  67. package/package.json +1 -1
  68. package/types/core/helpers/size/get-fixed-position-offset.d.ts +4 -2
  69. package/types/core/selection/style/api/list/toggle-ordered-list.d.ts +1 -1
  70. package/types/plugins/add-new-line/add-new-line.d.ts +7 -0
  71. package/types/plugins/backspace/backspace.d.ts +7 -0
  72. package/types/plugins/backspace/cases/check-remove-content-not-editable.d.ts +4 -1
  73. package/types/types/async.d.ts +7 -0
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.18.10
4
+ * Version: v4.18.12
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1609,8 +1609,9 @@ var Async = /*#__PURE__*/ function() {
1609
1609
  this.__controllers.forEach(function(controller) {
1610
1610
  return controller.abort();
1611
1611
  });
1612
- this.timers.forEach(function(key) {
1613
- return (0,jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_7__.clearTimeout)(_this.timers.get(key));
1612
+ // A labelled timer is kept under its label, so clear by the value
1613
+ this.timers.forEach(function(timer) {
1614
+ return (0,jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_7__.clearTimeout)(timer);
1614
1615
  });
1615
1616
  this.timers.clear();
1616
1617
  this.promisesRejections.forEach(function(reject) {
@@ -2152,7 +2153,7 @@ __webpack_require__.r(__webpack_exports__);
2152
2153
  * @packageDocumentation
2153
2154
  * @module constants
2154
2155
  */
2155
- var APP_VERSION = "4.18.10";
2156
+ var APP_VERSION = "4.18.12";
2156
2157
  // prettier-ignore
2157
2158
  var ES = "es5";
2158
2159
  var IS_ES_MODERN = false;
@@ -8225,8 +8226,10 @@ function normalizeCssValue(key, value) {
8225
8226
  * ancestor's top-left corner. The returned offset should be subtracted from
8226
8227
  * the desired viewport coordinates before applying them.
8227
8228
  *
8228
- * Returns `{ x: 0, y: 0 }` when no such ancestor exists (the common case), so
8229
- * call sites keep their previous behaviour unchanged.
8229
+ * Without such an ancestor the containing block is the layout viewport. Its
8230
+ * offset is `{ x: 0, y: 0 }` in most browsers, but WebKit measures client
8231
+ * rects from the visual viewport, so once the page is pinch-zoomed and panned
8232
+ * the layout viewport starts above and to the left of the client origin.
8230
8233
  */ function getFixedPositionOffset(elm) {
8231
8234
  var _elm_ownerDocument;
8232
8235
  var win = (_elm_ownerDocument = elm.ownerDocument) === null || _elm_ownerDocument === void 0 ? void 0 : _elm_ownerDocument.defaultView;
@@ -8241,6 +8244,15 @@ function normalizeCssValue(key, value) {
8241
8244
  }
8242
8245
  node = node.parentElement;
8243
8246
  }
8247
+ var vv = win === null || win === void 0 ? void 0 : win.visualViewport;
8248
+ // WebKit's `scrollX`/`scrollY` follow the visual viewport too (truncated),
8249
+ // where Blink's and Gecko's follow the layout viewport
8250
+ if (win && vv && (vv.offsetLeft || vv.offsetTop) && Math.abs(vv.pageLeft - win.scrollX) < 1 && Math.abs(vv.pageTop - win.scrollY) < 1) {
8251
+ return {
8252
+ x: -Math.round(vv.offsetLeft),
8253
+ y: -Math.round(vv.offsetTop)
8254
+ };
8255
+ }
8244
8256
  return {
8245
8257
  x: 0,
8246
8258
  y: 0
@@ -15197,6 +15209,7 @@ function elementsEqualAttributes(elm1, elm2) {
15197
15209
  * Replaces `ul->ol` or `ol->ul`, apply styles to the list, or remove a list item from it
15198
15210
  * @private
15199
15211
  */ function toggleOrderedList(commitStyle, li, jodit, mode) {
15212
+ var collapsed = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
15200
15213
  if (!li) {
15201
15214
  return mode;
15202
15215
  }
@@ -15225,16 +15238,60 @@ function elementsEqualAttributes(elm1, elm2) {
15225
15238
  }
15226
15239
  // ul => ol, ol => ul or ul => ul.class1
15227
15240
  if (mode === jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE || isChangeMode || !isSameList) {
15228
- var wrapper = unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, list, li, jodit, commitStyle);
15229
- var newList = (0,_wrap_list__WEBPACK_IMPORTED_MODULE_7__.wrapList)(commitStyle, wrapper, jodit);
15241
+ // With just a caret, Word converts the whole list
15242
+ var items = collapsed && !isSameList ? Array.from(list.children).filter(function(item) {
15243
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(item);
15244
+ }) : [
15245
+ li
15246
+ ];
15247
+ var newList;
15248
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
15249
+ try {
15250
+ var _loop = function() {
15251
+ var item = _step.value;
15252
+ newList = keepNumbering(item, function(itemList) {
15253
+ return (0,_wrap_list__WEBPACK_IMPORTED_MODULE_7__.wrapList)(commitStyle, unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, itemList, item, jodit, commitStyle), jodit);
15254
+ });
15255
+ };
15256
+ for(var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
15257
+ } catch (err) {
15258
+ _didIteratorError = true;
15259
+ _iteratorError = err;
15260
+ } finally{
15261
+ try {
15262
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
15263
+ _iterator.return();
15264
+ }
15265
+ } finally{
15266
+ if (_didIteratorError) {
15267
+ throw _iteratorError;
15268
+ }
15269
+ }
15270
+ }
15230
15271
  hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE, newList, commitStyle);
15231
15272
  return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.REPLACE;
15232
15273
  }
15233
15274
  }
15234
- var wrapper1 = unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP, list, li, jodit, commitStyle);
15235
- hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP, wrapper1, commitStyle);
15275
+ var wrapper = keepNumbering(li, function(itemList) {
15276
+ return unwrapList(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP, itemList, li, jodit, commitStyle);
15277
+ });
15278
+ hook(jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP, wrapper, commitStyle);
15236
15279
  return jodit_core_selection_style_constants__WEBPACK_IMPORTED_MODULE_6__.UNWRAP;
15237
15280
  }
15281
+ /**
15282
+ * Takes `item` out of its list with `takeOut`, and carries a numbered list's
15283
+ * count on past it, as Word does: 1, a bullet, then 2
15284
+ */ function keepNumbering(item, takeOut) {
15285
+ var list = item.parentElement;
15286
+ var rest = item.nextElementSibling;
15287
+ var next = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(list, 'ol') ? (parseInt(list.getAttribute('start') || '1', 10) || 1) + Array.from(list.children).indexOf(item) : 0;
15288
+ var result = takeOut(list);
15289
+ var restList = rest === null || rest === void 0 ? void 0 : rest.parentElement;
15290
+ if (next && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isTag(restList, 'ol')) {
15291
+ next > 1 ? restList.setAttribute('start', String(next)) : restList.removeAttribute('start');
15292
+ }
15293
+ return result;
15294
+ }
15238
15295
  /**
15239
15296
  * Other attributes, such as a class, still move the items into a new list,
15240
15297
  * where the `beforeWrapList` hook can add markup to each of them
@@ -16105,7 +16162,7 @@ var transactions = (_obj = {}, (0,_swc_helpers_define_property__WEBPACK_IMPORTED
16105
16162
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(_obj, states.TOGGLE_LIST, {
16106
16163
  exec: function exec(value) {
16107
16164
  return (0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_2__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_1__._)({}, value), {
16108
- mode: (0,jodit_core_selection_style_api__WEBPACK_IMPORTED_MODULE_6__.toggleOrderedList)(value.style, value.element, value.jodit, value.mode),
16165
+ mode: (0,jodit_core_selection_style_api__WEBPACK_IMPORTED_MODULE_6__.toggleOrderedList)(value.style, value.element, value.jodit, value.mode, value.collapsed),
16109
16166
  next: states.END
16110
16167
  });
16111
16168
  }
@@ -33039,12 +33096,13 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('about', (_about_svg__W
33039
33096
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
33040
33097
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31635);
33041
33098
  /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38574);
33042
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(84839);
33043
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(28077);
33044
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65946);
33045
- /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(80991);
33046
- /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(60936);
33047
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(10685);
33099
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81937);
33100
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
33101
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28077);
33102
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65946);
33103
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80991);
33104
+ /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60936);
33105
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(10685);
33048
33106
  /*!
33049
33107
  * Jodit Editor (https://xdsoft.net/jodit/)
33050
33108
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33067,6 +33125,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('about', (_about_svg__W
33067
33125
 
33068
33126
 
33069
33127
 
33128
+
33070
33129
  var ns = 'addnewline';
33071
33130
  /**
33072
33131
  * Create helper for adding new paragraph(Jodit.defaultOptions.enter tag) before iframe, table or image
@@ -33076,7 +33135,7 @@ var ns = 'addnewline';
33076
33135
  function addNewLine() {
33077
33136
  (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, addNewLine);
33078
33137
  var _this;
33079
- _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, addNewLine, arguments), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__line", _this.j.c.fromHTML('<div role="button" tabindex="-1" title="'.concat(_this.j.i18n('Break'), '" class="jodit-add-new-line"><span>').concat(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Icon.get('enter'), "</span></div>"))), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isMatchedTag", function(node) {
33138
+ _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, addNewLine, arguments), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__line", _this.j.c.fromHTML('<div role="button" tabindex="-1" title="'.concat(_this.j.i18n('Break'), '" class="jodit-add-new-line"><span>').concat(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Icon.get('enter'), "</span></div>"))), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isMatchedTag", function(node) {
33080
33139
  return Boolean(node && _this.j.o.addNewLineTagsTriggers.includes(node.nodeName.toLowerCase()));
33081
33140
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__timeout", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isBeforeContent", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__current", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__lineInFocus", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isShown", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__hideForce", function() {
33082
33141
  if (!_this.__isShown) {
@@ -33085,24 +33144,24 @@ var ns = 'addnewline';
33085
33144
  _this.__isShown = false;
33086
33145
  _this.j.async.clearTimeout(_this.__timeout);
33087
33146
  _this.__lineInFocus = false;
33088
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(_this.__line);
33147
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(_this.__line);
33089
33148
  _this.__line.style.setProperty('--jd-anl-handle-offset', '0');
33090
33149
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__canGetFocus", function(elm) {
33091
- return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
33150
+ return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
33092
33151
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__onClickLine", function(e) {
33093
33152
  var editor = _this.j;
33094
33153
  var p = editor.createInside.element(editor.o.enter);
33095
33154
  if (_this.__isBeforeContent && _this.__current && _this.__current.parentNode) {
33096
33155
  if (_this.__current === editor.editor) {
33097
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.prepend(editor.editor, p);
33156
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
33098
33157
  } else {
33099
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.before(_this.__current, p);
33158
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.before(_this.__current, p);
33100
33159
  }
33101
33160
  } else {
33102
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(editor.editor, p);
33161
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(editor.editor, p);
33103
33162
  }
33104
33163
  editor.s.setCursorIn(p);
33105
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
33164
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
33106
33165
  editor.synchronizeValues();
33107
33166
  _this.__hideForce();
33108
33167
  e.preventDefault();
@@ -33121,8 +33180,8 @@ var ns = 'addnewline';
33121
33180
  return;
33122
33181
  }
33123
33182
  this.__isShown = true;
33124
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(this.j.container, this.__line);
33125
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_10__.css)(this.__line, 'width', this.j.container.clientWidth);
33183
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(this.j.container, this.__line);
33184
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_11__.css)(this.__line, 'width', this.j.container.clientWidth);
33126
33185
  }
33127
33186
  },
33128
33187
  {
@@ -33174,18 +33233,48 @@ var ns = 'addnewline';
33174
33233
  ], 'scroll' + '.' + ns, this.__hideForce).on('finishedCleanHTMLWorker' + '.' + ns, this.__hideForce).on(editor.editor, 'click' + '.' + ns, this.__hide).on(editor.container, 'mouseleave' + '.' + ns, this.__hide).on(editor.editor, 'mousemove' + '.' + ns, this.__onMouseMove);
33175
33234
  }
33176
33235
  },
33236
+ {
33237
+ key: "onArrowKey",
33238
+ value: /**
33239
+ * A paragraph holding only an embed has no place for the caret, so the
33240
+ * arrow keys can't get past one that ends the content, or before one that
33241
+ * starts it. When an arrow key leaves the caret where it was and there is
33242
+ * content beyond it, a new line goes there, as when the line is clicked.
33243
+ */ function onArrowKey(e) {
33244
+ var editor = this.j;
33245
+ var forward = e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_DOWN || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_RIGHT;
33246
+ if (!editor.o.addNewLine || editor.o.readonly || editor.isLocked || e.shiftKey || !(forward || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_UP || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_LEFT) || !editor.s.isCollapsed()) {
33247
+ return;
33248
+ }
33249
+ var _editor_s_range = editor.s.range, startContainer = _editor_s_range.startContainer, startOffset = _editor_s_range.startOffset;
33250
+ // Once the browser has moved the caret, if it could. With a 0 timeout
33251
+ // Jodit would run this at once, before the browser moves it
33252
+ editor.async.setTimeout(function() {
33253
+ var range = editor.s.range;
33254
+ var block = jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.closest(startContainer, jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isBlock, editor.editor);
33255
+ if (e.defaultPrevented || !editor.s.isInsideArea || !range.collapsed || range.startContainer !== startContainer || range.startOffset !== startOffset || !block || !jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.findNotEmptyNeighbor(block, !forward, editor.editor)) {
33256
+ return;
33257
+ }
33258
+ var p = editor.createInside.element(editor.o.enter);
33259
+ forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
33260
+ editor.s.setCursorIn(p);
33261
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
33262
+ editor.synchronizeValues();
33263
+ }, 1);
33264
+ }
33265
+ },
33177
33266
  {
33178
33267
  key: "onDblClickEditor",
33179
33268
  value: function onDblClickEditor(e) {
33180
33269
  var editor = this.j;
33181
33270
  if (!editor.o.readonly && editor.o.addNewLineOnDBLClick && e.target === editor.editor && editor.s.isCollapsed()) {
33182
- var editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.offset)(editor.editor, editor, editor.ed);
33271
+ var editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.offset)(editor.editor, editor, editor.ed);
33183
33272
  var top = e.pageY - editor.ew.scrollX;
33184
33273
  var p = editor.createInside.element(editor.o.enter);
33185
33274
  if (Math.abs(top - editorBound.top) < Math.abs(top - (editorBound.height + editorBound.top)) && editor.editor.firstChild) {
33186
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.prepend(editor.editor, p);
33275
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
33187
33276
  } else {
33188
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(editor.editor, p);
33277
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(editor.editor, p);
33189
33278
  }
33190
33279
  editor.s.setCursorIn(p);
33191
33280
  editor.synchronizeValues();
@@ -33202,27 +33291,27 @@ var ns = 'addnewline';
33202
33291
  // Inside Shadow DOM `document.elementFromPoint` returns the shadow
33203
33292
  // host, so the lookup must start from the shadow root
33204
33293
  var currentElement = ((_editor_o_shadowRoot = editor.o.shadowRoot) !== null && _editor_o_shadowRoot !== void 0 ? _editor_o_shadowRoot : editor.ed).elementFromPoint(e.clientX, e.clientY);
33205
- if (!jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isHTMLElement(currentElement) || !jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(editor.editor, currentElement)) {
33294
+ if (!jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isHTMLElement(currentElement) || !jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isOrContains(editor.editor, currentElement)) {
33206
33295
  return;
33207
33296
  }
33208
33297
  if (editor.editor !== currentElement && !this.__isMatchedTag(currentElement)) {
33209
- currentElement = jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(currentElement, this.__isMatchedTag, editor.editor);
33298
+ currentElement = jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.closest(currentElement, this.__isMatchedTag, editor.editor);
33210
33299
  }
33211
33300
  if (!currentElement) {
33212
33301
  this.__hide();
33213
33302
  return;
33214
33303
  }
33215
33304
  if (this.__isMatchedTag(currentElement)) {
33216
- var parentBox = jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.up(currentElement, jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.isBlock, editor.editor);
33305
+ var parentBox = jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.up(currentElement, jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isBlock, editor.editor);
33217
33306
  if (parentBox && parentBox !== editor.editor) {
33218
33307
  currentElement = parentBox;
33219
33308
  }
33220
33309
  }
33221
- var pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.position)(currentElement, this.j);
33310
+ var pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.position)(currentElement, this.j);
33222
33311
  var top = false;
33223
33312
  var clientY = e.clientY, clientX = e.clientX;
33224
33313
  if (this.j.iframe) {
33225
- var _position = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.position)(this.j.iframe, this.j, true), top1 = _position.top, left = _position.left;
33314
+ var _position = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.position)(this.j.iframe, this.j, true), top1 = _position.top, left = _position.left;
33226
33315
  clientY += top1;
33227
33316
  clientX += left;
33228
33317
  }
@@ -33235,8 +33324,8 @@ var ns = 'addnewline';
33235
33324
  this.__isBeforeContent = false;
33236
33325
  }
33237
33326
  var isEditor = editor.editor === currentElement;
33238
- if (top !== false && (isEditor && !this.__isBeforeContent || !isEditor && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.call)(this.__isBeforeContent ? jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.prev : jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.next, currentElement, this.__canGetFocus, editor.editor))) {
33239
- (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_10__.css)(this.__line, 'top', top);
33327
+ if (top !== false && (isEditor && !this.__isBeforeContent || !isEditor && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.call)(this.__isBeforeContent ? jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prev : jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.next, currentElement, this.__canGetFocus, editor.editor))) {
33328
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_11__.css)(this.__line, 'top', top);
33240
33329
  this.__current = currentElement;
33241
33330
  this.__show();
33242
33331
  this.__line.style.setProperty('--jd-anl-handle-offset', clientX - pos.left - 10 + 'px');
@@ -33251,7 +33340,7 @@ var ns = 'addnewline';
33251
33340
  value: /** @override */ function beforeDestruct() {
33252
33341
  this.j.async.clearTimeout(this.__timeout);
33253
33342
  this.j.e.off(this.__line).off('changePlace', this.__addEventListeners);
33254
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(this.__line);
33343
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(this.__line);
33255
33344
  this.j.e.off([
33256
33345
  this.j.ow,
33257
33346
  this.j.ew,
@@ -33261,22 +33350,25 @@ var ns = 'addnewline';
33261
33350
  }
33262
33351
  ]);
33263
33352
  return addNewLine;
33264
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Plugin));
33353
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Plugin));
33265
33354
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33266
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':lock')
33355
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':lock')
33267
33356
  ], addNewLine.prototype, "onLock", null);
33268
33357
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33269
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
33358
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
33270
33359
  ], addNewLine.prototype, "__hide", null);
33271
33360
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33272
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':dblclick')
33361
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':keydown')
33362
+ ], addNewLine.prototype, "onArrowKey", null);
33363
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33364
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':dblclick')
33273
33365
  ], addNewLine.prototype, "onDblClickEditor", null);
33274
33366
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33275
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.throttle)(function(ctx) {
33367
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.throttle)(function(ctx) {
33276
33368
  return ctx.defaultTimeout;
33277
33369
  })
33278
33370
  ], addNewLine.prototype, "__onMouseMove", null);
33279
- jodit_core_global__WEBPACK_IMPORTED_MODULE_8__.pluginSystem.add('addNewLine', addNewLine);
33371
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('addNewLine', addNewLine);
33280
33372
 
33281
33373
 
33282
33374
  /***/ }),
@@ -33962,6 +34054,7 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decor
33962
34054
  /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(33831);
33963
34055
  /* harmony import */ var _cases_check_not_collapsed__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(89827);
33964
34056
  /* harmony import */ var _cases__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(17523);
34057
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(15200);
33965
34058
  /*!
33966
34059
  * Jodit Editor (https://xdsoft.net/jodit/)
33967
34060
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33986,6 +34079,7 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decor
33986
34079
 
33987
34080
 
33988
34081
 
34082
+
33989
34083
  var backspace = /*#__PURE__*/ function(Plugin) {
33990
34084
  "use strict";
33991
34085
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(backspace, Plugin);
@@ -34093,17 +34187,56 @@ var backspace = /*#__PURE__*/ function(Plugin) {
34093
34187
  throw e;
34094
34188
  } finally{
34095
34189
  jodit.e.fire('backSpaceAfterDelete', backspace, fakeNode);
34190
+ this.moveCaretToTextBefore(fakeNode);
34096
34191
  this.safeRemoveEmptyNode(fakeNode);
34097
34192
  }
34098
34193
  return false;
34099
34194
  }
34100
34195
  },
34196
+ {
34197
+ key: "moveCaretToTextBefore",
34198
+ value: /**
34199
+ * The browser types at the end of the text before the caret on its line,
34200
+ * in that text's formatting, but not inside a link. Moving the caret there
34201
+ * too makes a paste and the toolbar agree with what's typed:
34202
+ * `<p>one</p><p><b>|two</b></p>` joins to `<p>one|<b>two</b></p>`
34203
+ */ function moveCaretToTextBefore(fakeNode) {
34204
+ var _ref;
34205
+ var _text_nodeValue;
34206
+ var jodit = this.jodit;
34207
+ var range = jodit.s.range;
34208
+ // A case may have merged the fake node away (#1722)
34209
+ if (!fakeNode.parentNode) {
34210
+ return;
34211
+ }
34212
+ var around = jodit.ed.createRange();
34213
+ around.selectNode(fakeNode);
34214
+ if (!range.collapsed || !around.isPointInRange(range.startContainer, range.startOffset)) {
34215
+ return;
34216
+ }
34217
+ var text = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.findMostNestedNeighbor)(fakeNode, false, jodit.editor, true);
34218
+ var link = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(text, 'a', jodit.editor);
34219
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(text) || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isContentEditable(text, jodit.editor) || link && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(link, fakeNode) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(text, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock, jodit.editor) !== jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(fakeNode, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock, jodit.editor)) {
34220
+ return;
34221
+ }
34222
+ range.setStart(text, (_ref = (_text_nodeValue = text.nodeValue) === null || _text_nodeValue === void 0 ? void 0 : _text_nodeValue.length) !== null && _ref !== void 0 ? _ref : 0);
34223
+ range.collapse(true);
34224
+ jodit.s.selectRange(range);
34225
+ }
34226
+ },
34101
34227
  {
34102
34228
  key: "safeRemoveEmptyNode",
34103
34229
  value: /**
34104
34230
  * Remove node and replace cursor position out of it
34105
34231
  */ function safeRemoveEmptyNode(fakeNode) {
34232
+ var _fakeNode_nodeValue;
34106
34233
  var range = this.j.s.range;
34234
+ // wrap-nodes normalizes the line it wraps, which can merge the text
34235
+ // after the fake node into it: remove only the fake node's own space
34236
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(fakeNode) && fakeNode.nodeValue !== jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INVISIBLE_SPACE && ((_fakeNode_nodeValue = fakeNode.nodeValue) === null || _fakeNode_nodeValue === void 0 ? void 0 : _fakeNode_nodeValue.startsWith(jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INVISIBLE_SPACE))) {
34237
+ fakeNode.deleteData(0, jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INVISIBLE_SPACE.length);
34238
+ return;
34239
+ }
34107
34240
  if (range.startContainer === fakeNode) {
34108
34241
  if (fakeNode.previousSibling) {
34109
34242
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(fakeNode.previousSibling)) {
@@ -34180,6 +34313,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34180
34313
  return false;
34181
34314
  }
34182
34315
  var sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(mainClosestBox, backspace);
34316
+ if (moveInlinesInside(jodit, fakeNode, sibling)) {
34317
+ return joinNeighbors(jodit, fakeNode, backspace, moved);
34318
+ }
34183
34319
  // A line break before the cursor is a single unit: remove it instead of
34184
34320
  // merging the current element into the (void) `<br>`, which used to move
34185
34321
  // the whole element's content into the `<br>` and delete it (#1282).
@@ -34194,6 +34330,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34194
34330
  jodit.s.setCursorBefore(fakeNode);
34195
34331
  return true;
34196
34332
  }
34333
+ // A non-editable sibling is removed by remove-not-editable, never joined
34334
+ if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(sibling) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(sibling, jodit.editor)) {
34335
+ return false;
34336
+ }
34197
34337
  var box = findCaretBox(fakeNode, mainClosestBox);
34198
34338
  // One pass only: the line now sits beside the next one, so the
34199
34339
  // cases below join them. The DOM has changed either way
@@ -34222,6 +34362,83 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34222
34362
  }
34223
34363
  return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(block) && block.parentElement ? block.parentElement : block;
34224
34364
  }
34365
+ /**
34366
+ * With an inline element round the caret's line or the one it joins moved
34367
+ * inside its blocks, the cases join the lines as they join any two, and its
34368
+ * styles stay with its text. One round both lines is left as it is.
34369
+ */ function moveInlinesInside(jodit, fakeNode, sibling) {
34370
+ if (!sibling) {
34371
+ return false;
34372
+ }
34373
+ var around = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(fakeNode, function(node) {
34374
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(node, sibling);
34375
+ }, jodit.editor);
34376
+ return moveInlineInside(around, jodit.editor) || moveInlineInside(sibling, jodit.editor);
34377
+ }
34378
+ /**
34379
+ * Old content can have an inline element round blocks. This moves it inside
34380
+ * them, and gives the text, images and line breaks beside them a copy of
34381
+ * their own: `<span style="…"><p>one</p><br><p>two</p></span>` becomes
34382
+ * `<p><span style="…">one</span></p><span style="…"><br></span><p><span style="…">two</span></p>`
34383
+ */ function moveInlineInside(node, root) {
34384
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node)) {
34385
+ return false;
34386
+ }
34387
+ // Embedded content, such as the `<iframe>` in a video's wrapper, counts
34388
+ // as a block in `Dom.isBlock`, but stays with the text beside it
34389
+ var isBlock = function isBlock(child) {
34390
+ return 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__.NO_EMPTY_TAGS);
34391
+ };
34392
+ // The inner one first: `<span><strong><p>one</p></strong></span>`
34393
+ Array.from(node.childNodes).forEach(function(child) {
34394
+ return moveInlineInside(child, root);
34395
+ });
34396
+ var children = Array.from(node.childNodes);
34397
+ if (!children.some(isBlock)) {
34398
+ return false;
34399
+ }
34400
+ var run = null;
34401
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
34402
+ try {
34403
+ for(var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
34404
+ var child = _step.value;
34405
+ if (!isBlock(child)) {
34406
+ // Blank text between blocks stays where it is
34407
+ if (!run && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(child)) {
34408
+ run = node.cloneNode(false);
34409
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before(child, run);
34410
+ }
34411
+ run && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(run, child);
34412
+ continue;
34413
+ }
34414
+ run = null;
34415
+ // Nothing goes inside a rule or a non-editable block
34416
+ if (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.isContentEditable(child, root)) {
34417
+ continue;
34418
+ }
34419
+ var inner = node.cloneNode(false);
34420
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(child, inner);
34421
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(child, inner);
34422
+ // A list or a table: on down to its items or cells
34423
+ moveInlineInside(inner, root);
34424
+ }
34425
+ } catch (err) {
34426
+ _didIteratorError = true;
34427
+ _iteratorError = err;
34428
+ } finally{
34429
+ try {
34430
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
34431
+ _iterator.return();
34432
+ }
34433
+ } finally{
34434
+ if (_didIteratorError) {
34435
+ throw _iteratorError;
34436
+ }
34437
+ }
34438
+ }
34439
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.unwrap(node);
34440
+ return true;
34441
+ }
34225
34442
  /**
34226
34443
  * The innermost block on the sibling's edge facing the caret, so the
34227
34444
  * content is joined to text: `<div><p>one</p></div><p>|two</p>` gives
@@ -34591,7 +34808,9 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
34591
34808
  while(jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isInlineBlock(sibling)){
34592
34809
  sibling = backspace ? sibling === null || sibling === void 0 ? void 0 : sibling.lastChild : sibling === null || sibling === void 0 ? void 0 : sibling.firstChild;
34593
34810
  }
34594
- if (!sibling) {
34811
+ // A block inside an inline element, such as the `<p>` in
34812
+ // `<span><p>…</p></span>`, isn't a char: the join cases handle it
34813
+ if (!sibling || jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(sibling)) {
34595
34814
  break;
34596
34815
  }
34597
34816
  if ((_sibling_nodeValue = sibling.nodeValue) === null || _sibling_nodeValue === void 0 ? void 0 : _sibling_nodeValue.length) {
@@ -34740,6 +34959,7 @@ function isSpace(char) {
34740
34959
  /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
34741
34960
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
34742
34961
  /* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42259);
34962
+ /* harmony import */ var _check_join_neighbors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26106);
34743
34963
  /*!
34744
34964
  * Jodit Editor (https://xdsoft.net/jodit/)
34745
34965
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34749,23 +34969,48 @@ function isSpace(char) {
34749
34969
  */
34750
34970
 
34751
34971
 
34972
+
34752
34973
  /**
34753
- * Checks if a non-editable element can be deleted
34974
+ * Checks if a non-editable element can be deleted. A non-editable block goes
34975
+ * whole, and the lines either side of it then join, as the spec's tests do:
34976
+ * `<ul><li>one|</li></ul><div contenteditable="false">x</div><p>two</p>`
34977
+ * gives `<ul><li>one|two</li></ul>`
34754
34978
  * @private
34755
34979
  */ function checkRemoveContentNotEditable(jodit, fakeNode, backspace) {
34756
- var neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(fakeNode, backspace);
34757
- if (!neighbor && fakeNode.parentElement && fakeNode.parentElement !== jodit.editor) {
34758
- neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(fakeNode.parentElement, backspace);
34759
- }
34760
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(neighbor) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isContentEditable(neighbor, jodit.editor)) {
34761
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before : jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after, neighbor, fakeNode);
34762
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(neighbor);
34763
- (0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__.moveNodeInsideStart)(jodit, fakeNode, backspace);
34764
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit.s.setCursorBefore : jodit.s.setCursorAfter, fakeNode);
34980
+ var node = fakeNode;
34981
+ var neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(node, backspace);
34982
+ // Past the edges of the blocks the caret is at, but not into a table cell
34983
+ while(!neighbor && node.parentElement && node.parentElement !== jodit.editor && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isCell(node.parentElement)){
34984
+ node = node.parentElement;
34985
+ neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(node, backspace);
34986
+ // At the start of a list item, Backspace takes the bullet off first,
34987
+ // unless the item before it is a non-editable one to remove
34988
+ if (backspace && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(node) && !(jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(neighbor) && isNotEditable(jodit, neighbor))) {
34989
+ return false;
34990
+ }
34991
+ }
34992
+ if (isNotEditable(jodit, neighbor)) {
34993
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(neighbor)) {
34994
+ // Backspace after a removed list item leaves the items apart: the
34995
+ // next press takes the bullet off, as for any later item
34996
+ var joinLines = !(backspace && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(neighbor));
34997
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(neighbor);
34998
+ if (joinLines) {
34999
+ (0,_check_join_neighbors__WEBPACK_IMPORTED_MODULE_3__.checkJoinNeighbors)(jodit, fakeNode, backspace);
35000
+ }
35001
+ } else {
35002
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.before : jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.after, neighbor, fakeNode);
35003
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(neighbor);
35004
+ (0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__.moveNodeInsideStart)(jodit, fakeNode, backspace);
35005
+ }
35006
+ ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit.s.setCursorBefore : jodit.s.setCursorAfter, fakeNode);
34765
35007
  return true;
34766
35008
  }
34767
35009
  return false;
34768
35010
  }
35011
+ function isNotEditable(jodit, node) {
35012
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(node) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isContentEditable(node, jodit.editor);
35013
+ }
34769
35014
 
34770
35015
 
34771
35016
  /***/ }),
@@ -57627,12 +57872,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57627
57872
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
57628
57873
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31635);
57629
57874
  /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38574);
57630
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(84839);
57631
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27795);
57632
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28077);
57633
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(85932);
57634
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(91206);
57635
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(86038);
57875
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81937);
57876
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
57877
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(27795);
57878
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28077);
57879
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(85932);
57880
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
57881
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(86038);
57636
57882
  /*!
57637
57883
  * Jodit Editor (https://xdsoft.net/jodit/)
57638
57884
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -57654,6 +57900,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57654
57900
 
57655
57901
 
57656
57902
 
57903
+
57657
57904
  /**
57658
57905
  * Wrap single text nodes in block wrapper
57659
57906
  */ var wrapNodes = /*#__PURE__*/ function(Plugin) {
@@ -57666,15 +57913,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57666
57913
  * Found Node which should be wrapped
57667
57914
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "isSuitableStart", function(n) {
57668
57915
  var _n_parentNode;
57669
- return jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(n) && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_10__.isString)(n.nodeValue) && (/[^\s]/.test(n.nodeValue) || ((_n_parentNode = n.parentNode) === null || _n_parentNode === void 0 ? void 0 : _n_parentNode.firstChild) === n && _this.isSuitable(n.nextSibling)) || _this.isNotWrapped(n) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTemporary(n);
57916
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isText(n) && (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_11__.isString)(n.nodeValue) && (/[^\s]/.test(n.nodeValue) || ((_n_parentNode = n.parentNode) === null || _n_parentNode === void 0 ? void 0 : _n_parentNode.firstChild) === n && _this.isSuitable(n.nextSibling)) || _this.isNotWrapped(n) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTemporary(n);
57670
57917
  }), /**
57671
57918
  * Node should add in a block element
57672
57919
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "isSuitable", function(n) {
57673
- return jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(n) || _this.isNotWrapped(n);
57920
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isText(n) || _this.isNotWrapped(n);
57674
57921
  }), /**
57675
57922
  * Some element which needs to append in block
57676
57923
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "isNotWrapped", function(n) {
57677
- return jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isElement(n) && !(jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(n) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(n, _this.j.o.wrapNodes.exclude));
57924
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isElement(n) && !(jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isBlock(n) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(n, _this.j.o.wrapNodes.exclude) || holdsBlock(n));
57678
57925
  });
57679
57926
  return _this;
57680
57927
  }
@@ -57715,10 +57962,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57715
57962
  }
57716
57963
  isChanged = true;
57717
57964
  var box = jodit.createInside.element(jodit.o.enter);
57718
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.before(child, box);
57719
- while(child && this.isSuitable(child)){
57965
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.before(child, box);
57966
+ // `exclude` keeps a <br> from starting a box, but one between loose lines stays with them
57967
+ while(child && (this.isSuitable(child) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(child, 'br'))){
57720
57968
  var next = child.nextSibling;
57721
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(box, child);
57969
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.append(box, child);
57722
57970
  child = next;
57723
57971
  }
57724
57972
  box.normalize();
@@ -57745,8 +57993,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57745
57993
  }
57746
57994
  var box = jodit.createInside.element(jodit.o.enter);
57747
57995
  var br = jodit.createInside.element('br');
57748
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(box, br);
57749
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(jodit.editor, box);
57996
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.append(box, br);
57997
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.append(jodit.editor, box);
57750
57998
  if (jodit.s.isFocused() || jodit.e.current === 'backSpaceAfterDelete') {
57751
57999
  jodit.s.setCursorBefore(br);
57752
58000
  }
@@ -57755,23 +58003,51 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57755
58003
  }
57756
58004
  ]);
57757
58005
  return wrapNodes;
57758
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__.Plugin));
58006
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__.Plugin));
57759
58007
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
57760
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
58008
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
57761
58009
  ], wrapNodes.prototype, "postProcessSetEditorValue", null);
57762
58010
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
57763
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
58011
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
57764
58012
  ], wrapNodes.prototype, "preprocessInput", null);
58013
+ /**
58014
+ * A block can't go in a paragraph, so neither can an element that holds one,
58015
+ * such as a `<span>` round a `<p>`. Embedded content such as an `<iframe>` can.
58016
+ */ function holdsBlock(elm) {
58017
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
58018
+ try {
58019
+ for(var _iterator = jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.eachGen(elm)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
58020
+ var node = _step.value;
58021
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isBlock(node) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(node, jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.NO_EMPTY_TAGS)) {
58022
+ return true;
58023
+ }
58024
+ }
58025
+ } catch (err) {
58026
+ _didIteratorError = true;
58027
+ _iteratorError = err;
58028
+ } finally{
58029
+ try {
58030
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
58031
+ _iterator.return();
58032
+ }
58033
+ } finally{
58034
+ if (_didIteratorError) {
58035
+ throw _iteratorError;
58036
+ }
58037
+ }
58038
+ }
58039
+ return false;
58040
+ }
57765
58041
  function checkAloneListLeaf(child, jodit) {
57766
58042
  var result = child;
57767
58043
  var next = child;
57768
58044
  do {
57769
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isElement(next) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isLeaf(next) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isList(next.parentElement)) {
57770
- var nextChild = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.findNotEmptySibling(next, false);
57771
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(result, 'ul')) {
57772
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(result, next);
58045
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isElement(next) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isLeaf(next) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isList(next.parentElement)) {
58046
+ var nextChild = jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.findNotEmptySibling(next, false);
58047
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(result, 'ul')) {
58048
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.append(result, next);
57773
58049
  } else {
57774
- result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.wrap(next, 'ul', jodit.createInside);
58050
+ result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.wrap(next, 'ul', jodit.createInside);
57775
58051
  }
57776
58052
  next = nextChild;
57777
58053
  } else {
@@ -57780,7 +58056,7 @@ function checkAloneListLeaf(child, jodit) {
57780
58056
  }while (next);
57781
58057
  return result;
57782
58058
  }
57783
- jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('wrapNodes', wrapNodes);
58059
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_10__.pluginSystem.add('wrapNodes', wrapNodes);
57784
58060
 
57785
58061
 
57786
58062
  /***/ }),