jodit 4.18.10 → 4.18.11

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 (69) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +5 -5
  4. package/es2015/jodit.js +256 -71
  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 +6 -6
  18. package/es2021/jodit.js +253 -71
  19. package/es2021/jodit.min.js +6 -6
  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 +6 -6
  28. package/es2021.en/jodit.js +253 -71
  29. package/es2021.en/jodit.min.js +6 -6
  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 +303 -72
  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/plugins/add-new-line/add-new-line.d.ts +7 -0
  55. package/esm/plugins/add-new-line/add-new-line.js +45 -0
  56. package/esm/plugins/backspace/backspace.d.ts +7 -0
  57. package/esm/plugins/backspace/backspace.js +45 -2
  58. package/esm/plugins/backspace/cases/check-join-neighbors.js +69 -1
  59. package/esm/plugins/backspace/cases/check-remove-char.js +3 -1
  60. package/esm/plugins/backspace/cases/check-remove-content-not-editable.d.ts +4 -1
  61. package/esm/plugins/backspace/cases/check-remove-content-not-editable.js +39 -11
  62. package/esm/plugins/wrap-nodes/wrap-nodes.js +19 -2
  63. package/esm/types/async.d.ts +7 -0
  64. package/package.json +1 -1
  65. package/types/core/helpers/size/get-fixed-position-offset.d.ts +4 -2
  66. package/types/plugins/add-new-line/add-new-line.d.ts +7 -0
  67. package/types/plugins/backspace/backspace.d.ts +7 -0
  68. package/types/plugins/backspace/cases/check-remove-content-not-editable.d.ts +4 -1
  69. 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.11
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.11";
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
@@ -33039,12 +33051,13 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('about', (_about_svg__W
33039
33051
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
33040
33052
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31635);
33041
33053
  /* 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);
33054
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81937);
33055
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
33056
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28077);
33057
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65946);
33058
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(80991);
33059
+ /* harmony import */ var jodit_modules__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(60936);
33060
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(10685);
33048
33061
  /*!
33049
33062
  * Jodit Editor (https://xdsoft.net/jodit/)
33050
33063
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33067,6 +33080,7 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_3__.Icon.set('about', (_about_svg__W
33067
33080
 
33068
33081
 
33069
33082
 
33083
+
33070
33084
  var ns = 'addnewline';
33071
33085
  /**
33072
33086
  * Create helper for adding new paragraph(Jodit.defaultOptions.enter tag) before iframe, table or image
@@ -33076,7 +33090,7 @@ var ns = 'addnewline';
33076
33090
  function addNewLine() {
33077
33091
  (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, addNewLine);
33078
33092
  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) {
33093
+ _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
33094
  return Boolean(node && _this.j.o.addNewLineTagsTriggers.includes(node.nodeName.toLowerCase()));
33081
33095
  }), (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
33096
  if (!_this.__isShown) {
@@ -33085,24 +33099,24 @@ var ns = 'addnewline';
33085
33099
  _this.__isShown = false;
33086
33100
  _this.j.async.clearTimeout(_this.__timeout);
33087
33101
  _this.__lineInFocus = false;
33088
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(_this.__line);
33102
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(_this.__line);
33089
33103
  _this.__line.style.setProperty('--jd-anl-handle-offset', '0');
33090
33104
  }), (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);
33105
+ return elm != null && jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isBlock(elm) && !/^(img|table|iframe|hr)$/i.test(elm.nodeName);
33092
33106
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__onClickLine", function(e) {
33093
33107
  var editor = _this.j;
33094
33108
  var p = editor.createInside.element(editor.o.enter);
33095
33109
  if (_this.__isBeforeContent && _this.__current && _this.__current.parentNode) {
33096
33110
  if (_this.__current === editor.editor) {
33097
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.prepend(editor.editor, p);
33111
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
33098
33112
  } else {
33099
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.before(_this.__current, p);
33113
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.before(_this.__current, p);
33100
33114
  }
33101
33115
  } else {
33102
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(editor.editor, p);
33116
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(editor.editor, p);
33103
33117
  }
33104
33118
  editor.s.setCursorIn(p);
33105
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
33119
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
33106
33120
  editor.synchronizeValues();
33107
33121
  _this.__hideForce();
33108
33122
  e.preventDefault();
@@ -33121,8 +33135,8 @@ var ns = 'addnewline';
33121
33135
  return;
33122
33136
  }
33123
33137
  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);
33138
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(this.j.container, this.__line);
33139
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_11__.css)(this.__line, 'width', this.j.container.clientWidth);
33126
33140
  }
33127
33141
  },
33128
33142
  {
@@ -33174,18 +33188,48 @@ var ns = 'addnewline';
33174
33188
  ], '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
33189
  }
33176
33190
  },
33191
+ {
33192
+ key: "onArrowKey",
33193
+ value: /**
33194
+ * A paragraph holding only an embed has no place for the caret, so the
33195
+ * arrow keys can't get past one that ends the content, or before one that
33196
+ * starts it. When an arrow key leaves the caret where it was and there is
33197
+ * content beyond it, a new line goes there, as when the line is clicked.
33198
+ */ function onArrowKey(e) {
33199
+ var editor = this.j;
33200
+ var forward = e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_DOWN || e.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_RIGHT;
33201
+ 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()) {
33202
+ return;
33203
+ }
33204
+ var _editor_s_range = editor.s.range, startContainer = _editor_s_range.startContainer, startOffset = _editor_s_range.startOffset;
33205
+ // Once the browser has moved the caret, if it could. With a 0 timeout
33206
+ // Jodit would run this at once, before the browser moves it
33207
+ editor.async.setTimeout(function() {
33208
+ var range = editor.s.range;
33209
+ var block = jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.closest(startContainer, jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isBlock, editor.editor);
33210
+ 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)) {
33211
+ return;
33212
+ }
33213
+ var p = editor.createInside.element(editor.o.enter);
33214
+ forward ? jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(editor.editor, p) : jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
33215
+ editor.s.setCursorIn(p);
33216
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.scrollIntoViewIfNeeded)(p, editor.editor, editor.ed);
33217
+ editor.synchronizeValues();
33218
+ }, 1);
33219
+ }
33220
+ },
33177
33221
  {
33178
33222
  key: "onDblClickEditor",
33179
33223
  value: function onDblClickEditor(e) {
33180
33224
  var editor = this.j;
33181
33225
  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);
33226
+ var editorBound = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.offset)(editor.editor, editor, editor.ed);
33183
33227
  var top = e.pageY - editor.ew.scrollX;
33184
33228
  var p = editor.createInside.element(editor.o.enter);
33185
33229
  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);
33230
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.prepend(editor.editor, p);
33187
33231
  } else {
33188
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.append(editor.editor, p);
33232
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.append(editor.editor, p);
33189
33233
  }
33190
33234
  editor.s.setCursorIn(p);
33191
33235
  editor.synchronizeValues();
@@ -33202,27 +33246,27 @@ var ns = 'addnewline';
33202
33246
  // Inside Shadow DOM `document.elementFromPoint` returns the shadow
33203
33247
  // host, so the lookup must start from the shadow root
33204
33248
  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)) {
33249
+ if (!jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isHTMLElement(currentElement) || !jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isOrContains(editor.editor, currentElement)) {
33206
33250
  return;
33207
33251
  }
33208
33252
  if (editor.editor !== currentElement && !this.__isMatchedTag(currentElement)) {
33209
- currentElement = jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(currentElement, this.__isMatchedTag, editor.editor);
33253
+ currentElement = jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.closest(currentElement, this.__isMatchedTag, editor.editor);
33210
33254
  }
33211
33255
  if (!currentElement) {
33212
33256
  this.__hide();
33213
33257
  return;
33214
33258
  }
33215
33259
  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);
33260
+ var parentBox = jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.up(currentElement, jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.isBlock, editor.editor);
33217
33261
  if (parentBox && parentBox !== editor.editor) {
33218
33262
  currentElement = parentBox;
33219
33263
  }
33220
33264
  }
33221
- var pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.position)(currentElement, this.j);
33265
+ var pos = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.position)(currentElement, this.j);
33222
33266
  var top = false;
33223
33267
  var clientY = e.clientY, clientX = e.clientX;
33224
33268
  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;
33269
+ var _position = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.position)(this.j.iframe, this.j, true), top1 = _position.top, left = _position.left;
33226
33270
  clientY += top1;
33227
33271
  clientX += left;
33228
33272
  }
@@ -33235,8 +33279,8 @@ var ns = 'addnewline';
33235
33279
  this.__isBeforeContent = false;
33236
33280
  }
33237
33281
  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);
33282
+ 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))) {
33283
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_11__.css)(this.__line, 'top', top);
33240
33284
  this.__current = currentElement;
33241
33285
  this.__show();
33242
33286
  this.__line.style.setProperty('--jd-anl-handle-offset', clientX - pos.left - 10 + 'px');
@@ -33251,7 +33295,7 @@ var ns = 'addnewline';
33251
33295
  value: /** @override */ function beforeDestruct() {
33252
33296
  this.j.async.clearTimeout(this.__timeout);
33253
33297
  this.j.e.off(this.__line).off('changePlace', this.__addEventListeners);
33254
- jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Dom.safeRemove(this.__line);
33298
+ jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Dom.safeRemove(this.__line);
33255
33299
  this.j.e.off([
33256
33300
  this.j.ow,
33257
33301
  this.j.ew,
@@ -33261,22 +33305,25 @@ var ns = 'addnewline';
33261
33305
  }
33262
33306
  ]);
33263
33307
  return addNewLine;
33264
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_modules__WEBPACK_IMPORTED_MODULE_11__.Plugin));
33308
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_modules__WEBPACK_IMPORTED_MODULE_12__.Plugin));
33265
33309
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33266
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':lock')
33310
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':lock')
33267
33311
  ], addNewLine.prototype, "onLock", null);
33268
33312
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33269
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
33313
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
33270
33314
  ], addNewLine.prototype, "__hide", null);
33271
33315
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33272
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':dblclick')
33316
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':keydown')
33317
+ ], addNewLine.prototype, "onArrowKey", null);
33318
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33319
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':dblclick')
33273
33320
  ], addNewLine.prototype, "onDblClickEditor", null);
33274
33321
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
33275
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.throttle)(function(ctx) {
33322
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.throttle)(function(ctx) {
33276
33323
  return ctx.defaultTimeout;
33277
33324
  })
33278
33325
  ], addNewLine.prototype, "__onMouseMove", null);
33279
- jodit_core_global__WEBPACK_IMPORTED_MODULE_8__.pluginSystem.add('addNewLine', addNewLine);
33326
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('addNewLine', addNewLine);
33280
33327
 
33281
33328
 
33282
33329
  /***/ }),
@@ -33962,6 +34009,7 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decor
33962
34009
  /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(33831);
33963
34010
  /* harmony import */ var _cases_check_not_collapsed__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(89827);
33964
34011
  /* harmony import */ var _cases__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(17523);
34012
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(15200);
33965
34013
  /*!
33966
34014
  * Jodit Editor (https://xdsoft.net/jodit/)
33967
34015
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33986,6 +34034,7 @@ UiAiAssistant = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decor
33986
34034
 
33987
34035
 
33988
34036
 
34037
+
33989
34038
  var backspace = /*#__PURE__*/ function(Plugin) {
33990
34039
  "use strict";
33991
34040
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(backspace, Plugin);
@@ -34093,17 +34142,56 @@ var backspace = /*#__PURE__*/ function(Plugin) {
34093
34142
  throw e;
34094
34143
  } finally{
34095
34144
  jodit.e.fire('backSpaceAfterDelete', backspace, fakeNode);
34145
+ this.moveCaretToTextBefore(fakeNode);
34096
34146
  this.safeRemoveEmptyNode(fakeNode);
34097
34147
  }
34098
34148
  return false;
34099
34149
  }
34100
34150
  },
34151
+ {
34152
+ key: "moveCaretToTextBefore",
34153
+ value: /**
34154
+ * The browser types at the end of the text before the caret on its line,
34155
+ * in that text's formatting, but not inside a link. Moving the caret there
34156
+ * too makes a paste and the toolbar agree with what's typed:
34157
+ * `<p>one</p><p><b>|two</b></p>` joins to `<p>one|<b>two</b></p>`
34158
+ */ function moveCaretToTextBefore(fakeNode) {
34159
+ var _ref;
34160
+ var _text_nodeValue;
34161
+ var jodit = this.jodit;
34162
+ var range = jodit.s.range;
34163
+ // A case may have merged the fake node away (#1722)
34164
+ if (!fakeNode.parentNode) {
34165
+ return;
34166
+ }
34167
+ var around = jodit.ed.createRange();
34168
+ around.selectNode(fakeNode);
34169
+ if (!range.collapsed || !around.isPointInRange(range.startContainer, range.startOffset)) {
34170
+ return;
34171
+ }
34172
+ var text = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.findMostNestedNeighbor)(fakeNode, false, jodit.editor, true);
34173
+ var link = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(text, 'a', jodit.editor);
34174
+ 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)) {
34175
+ return;
34176
+ }
34177
+ range.setStart(text, (_ref = (_text_nodeValue = text.nodeValue) === null || _text_nodeValue === void 0 ? void 0 : _text_nodeValue.length) !== null && _ref !== void 0 ? _ref : 0);
34178
+ range.collapse(true);
34179
+ jodit.s.selectRange(range);
34180
+ }
34181
+ },
34101
34182
  {
34102
34183
  key: "safeRemoveEmptyNode",
34103
34184
  value: /**
34104
34185
  * Remove node and replace cursor position out of it
34105
34186
  */ function safeRemoveEmptyNode(fakeNode) {
34187
+ var _fakeNode_nodeValue;
34106
34188
  var range = this.j.s.range;
34189
+ // wrap-nodes normalizes the line it wraps, which can merge the text
34190
+ // after the fake node into it: remove only the fake node's own space
34191
+ 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))) {
34192
+ fakeNode.deleteData(0, jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.INVISIBLE_SPACE.length);
34193
+ return;
34194
+ }
34107
34195
  if (range.startContainer === fakeNode) {
34108
34196
  if (fakeNode.previousSibling) {
34109
34197
  if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(fakeNode.previousSibling)) {
@@ -34180,6 +34268,9 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34180
34268
  return false;
34181
34269
  }
34182
34270
  var sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(mainClosestBox, backspace);
34271
+ if (moveInlinesInside(jodit, fakeNode, sibling)) {
34272
+ return joinNeighbors(jodit, fakeNode, backspace, moved);
34273
+ }
34183
34274
  // A line break before the cursor is a single unit: remove it instead of
34184
34275
  // merging the current element into the (void) `<br>`, which used to move
34185
34276
  // the whole element's content into the `<br>` and delete it (#1282).
@@ -34194,6 +34285,10 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34194
34285
  jodit.s.setCursorBefore(fakeNode);
34195
34286
  return true;
34196
34287
  }
34288
+ // A non-editable sibling is removed by remove-not-editable, never joined
34289
+ 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)) {
34290
+ return false;
34291
+ }
34197
34292
  var box = findCaretBox(fakeNode, mainClosestBox);
34198
34293
  // One pass only: the line now sits beside the next one, so the
34199
34294
  // cases below join them. The DOM has changed either way
@@ -34222,6 +34317,83 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34222
34317
  }
34223
34318
  return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(block) && block.parentElement ? block.parentElement : block;
34224
34319
  }
34320
+ /**
34321
+ * With an inline element round the caret's line or the one it joins moved
34322
+ * inside its blocks, the cases join the lines as they join any two, and its
34323
+ * styles stay with its text. One round both lines is left as it is.
34324
+ */ function moveInlinesInside(jodit, fakeNode, sibling) {
34325
+ if (!sibling) {
34326
+ return false;
34327
+ }
34328
+ var around = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.furthest(fakeNode, function(node) {
34329
+ 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);
34330
+ }, jodit.editor);
34331
+ return moveInlineInside(around, jodit.editor) || moveInlineInside(sibling, jodit.editor);
34332
+ }
34333
+ /**
34334
+ * Old content can have an inline element round blocks. This moves it inside
34335
+ * them, and gives the text, images and line breaks beside them a copy of
34336
+ * their own: `<span style="…"><p>one</p><br><p>two</p></span>` becomes
34337
+ * `<p><span style="…">one</span></p><span style="…"><br></span><p><span style="…">two</span></p>`
34338
+ */ function moveInlineInside(node, root) {
34339
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(node) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node)) {
34340
+ return false;
34341
+ }
34342
+ // Embedded content, such as the `<iframe>` in a video's wrapper, counts
34343
+ // as a block in `Dom.isBlock`, but stays with the text beside it
34344
+ var isBlock = function isBlock(child) {
34345
+ 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);
34346
+ };
34347
+ // The inner one first: `<span><strong><p>one</p></strong></span>`
34348
+ Array.from(node.childNodes).forEach(function(child) {
34349
+ return moveInlineInside(child, root);
34350
+ });
34351
+ var children = Array.from(node.childNodes);
34352
+ if (!children.some(isBlock)) {
34353
+ return false;
34354
+ }
34355
+ var run = null;
34356
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
34357
+ try {
34358
+ for(var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
34359
+ var child = _step.value;
34360
+ if (!isBlock(child)) {
34361
+ // Blank text between blocks stays where it is
34362
+ if (!run && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(child)) {
34363
+ run = node.cloneNode(false);
34364
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.before(child, run);
34365
+ }
34366
+ run && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(run, child);
34367
+ continue;
34368
+ }
34369
+ run = null;
34370
+ // Nothing goes inside a rule or a non-editable block
34371
+ 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)) {
34372
+ continue;
34373
+ }
34374
+ var inner = node.cloneNode(false);
34375
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(child, inner);
34376
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(child, inner);
34377
+ // A list or a table: on down to its items or cells
34378
+ moveInlineInside(inner, root);
34379
+ }
34380
+ } catch (err) {
34381
+ _didIteratorError = true;
34382
+ _iteratorError = err;
34383
+ } finally{
34384
+ try {
34385
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
34386
+ _iterator.return();
34387
+ }
34388
+ } finally{
34389
+ if (_didIteratorError) {
34390
+ throw _iteratorError;
34391
+ }
34392
+ }
34393
+ }
34394
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.unwrap(node);
34395
+ return true;
34396
+ }
34225
34397
  /**
34226
34398
  * The innermost block on the sibling's edge facing the caret, so the
34227
34399
  * content is joined to text: `<div><p>one</p></div><p>|two</p>` gives
@@ -34591,7 +34763,9 @@ function checkRemoveChar(jodit, fakeNode, backspace, mode) {
34591
34763
  while(jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isInlineBlock(sibling)){
34592
34764
  sibling = backspace ? sibling === null || sibling === void 0 ? void 0 : sibling.lastChild : sibling === null || sibling === void 0 ? void 0 : sibling.firstChild;
34593
34765
  }
34594
- if (!sibling) {
34766
+ // A block inside an inline element, such as the `<p>` in
34767
+ // `<span><p>…</p></span>`, isn't a char: the join cases handle it
34768
+ if (!sibling || jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(sibling)) {
34595
34769
  break;
34596
34770
  }
34597
34771
  if ((_sibling_nodeValue = sibling.nodeValue) === null || _sibling_nodeValue === void 0 ? void 0 : _sibling_nodeValue.length) {
@@ -34740,6 +34914,7 @@ function isSpace(char) {
34740
34914
  /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27795);
34741
34915
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65946);
34742
34916
  /* harmony import */ var jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(42259);
34917
+ /* harmony import */ var _check_join_neighbors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(26106);
34743
34918
  /*!
34744
34919
  * Jodit Editor (https://xdsoft.net/jodit/)
34745
34920
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -34749,23 +34924,48 @@ function isSpace(char) {
34749
34924
  */
34750
34925
 
34751
34926
 
34927
+
34752
34928
  /**
34753
- * Checks if a non-editable element can be deleted
34929
+ * Checks if a non-editable element can be deleted. A non-editable block goes
34930
+ * whole, and the lines either side of it then join, as the spec's tests do:
34931
+ * `<ul><li>one|</li></ul><div contenteditable="false">x</div><p>two</p>`
34932
+ * gives `<ul><li>one|two</li></ul>`
34754
34933
  * @private
34755
34934
  */ 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);
34935
+ var node = fakeNode;
34936
+ var neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(node, backspace);
34937
+ // Past the edges of the blocks the caret is at, but not into a table cell
34938
+ while(!neighbor && node.parentElement && node.parentElement !== jodit.editor && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isCell(node.parentElement)){
34939
+ node = node.parentElement;
34940
+ neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.findSibling(node, backspace);
34941
+ // At the start of a list item, Backspace takes the bullet off first,
34942
+ // unless the item before it is a non-editable one to remove
34943
+ 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))) {
34944
+ return false;
34945
+ }
34946
+ }
34947
+ if (isNotEditable(jodit, neighbor)) {
34948
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isBlock(neighbor)) {
34949
+ // Backspace after a removed list item leaves the items apart: the
34950
+ // next press takes the bullet off, as for any later item
34951
+ var joinLines = !(backspace && jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isLeaf(neighbor));
34952
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(neighbor);
34953
+ if (joinLines) {
34954
+ (0,_check_join_neighbors__WEBPACK_IMPORTED_MODULE_3__.checkJoinNeighbors)(jodit, fakeNode, backspace);
34955
+ }
34956
+ } else {
34957
+ (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);
34958
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.safeRemove(neighbor);
34959
+ (0,jodit_core_selection_helpers__WEBPACK_IMPORTED_MODULE_2__.moveNodeInsideStart)(jodit, fakeNode, backspace);
34960
+ }
34961
+ ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.call)(backspace ? jodit.s.setCursorBefore : jodit.s.setCursorAfter, fakeNode);
34765
34962
  return true;
34766
34963
  }
34767
34964
  return false;
34768
34965
  }
34966
+ function isNotEditable(jodit, node) {
34967
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(node) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isContentEditable(node, jodit.editor);
34968
+ }
34769
34969
 
34770
34970
 
34771
34971
  /***/ }),
@@ -57627,12 +57827,13 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57627
57827
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
57628
57828
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31635);
57629
57829
  /* 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);
57830
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81937);
57831
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
57832
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(27795);
57833
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28077);
57834
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(85932);
57835
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
57836
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(86038);
57636
57837
  /*!
57637
57838
  * Jodit Editor (https://xdsoft.net/jodit/)
57638
57839
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -57654,6 +57855,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57654
57855
 
57655
57856
 
57656
57857
 
57858
+
57657
57859
  /**
57658
57860
  * Wrap single text nodes in block wrapper
57659
57861
  */ var wrapNodes = /*#__PURE__*/ function(Plugin) {
@@ -57666,15 +57868,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57666
57868
  * Found Node which should be wrapped
57667
57869
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "isSuitableStart", function(n) {
57668
57870
  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);
57871
+ 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
57872
  }), /**
57671
57873
  * Node should add in a block element
57672
57874
  */ (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);
57875
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isText(n) || _this.isNotWrapped(n);
57674
57876
  }), /**
57675
57877
  * Some element which needs to append in block
57676
57878
  */ (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));
57879
+ 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
57880
  });
57679
57881
  return _this;
57680
57882
  }
@@ -57715,10 +57917,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57715
57917
  }
57716
57918
  isChanged = true;
57717
57919
  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)){
57920
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.before(child, box);
57921
+ // `exclude` keeps a <br> from starting a box, but one between loose lines stays with them
57922
+ while(child && (this.isSuitable(child) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(child, 'br'))){
57720
57923
  var next = child.nextSibling;
57721
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(box, child);
57924
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.append(box, child);
57722
57925
  child = next;
57723
57926
  }
57724
57927
  box.normalize();
@@ -57745,8 +57948,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57745
57948
  }
57746
57949
  var box = jodit.createInside.element(jodit.o.enter);
57747
57950
  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);
57951
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.append(box, br);
57952
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.append(jodit.editor, box);
57750
57953
  if (jodit.s.isFocused() || jodit.e.current === 'backSpaceAfterDelete') {
57751
57954
  jodit.s.setCursorBefore(br);
57752
57955
  }
@@ -57755,23 +57958,51 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.wrapNodes = {
57755
57958
  }
57756
57959
  ]);
57757
57960
  return wrapNodes;
57758
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__.Plugin));
57961
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__.Plugin));
57759
57962
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
57760
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
57963
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
57761
57964
  ], wrapNodes.prototype, "postProcessSetEditorValue", null);
57762
57965
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
57763
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
57966
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
57764
57967
  ], wrapNodes.prototype, "preprocessInput", null);
57968
+ /**
57969
+ * A block can't go in a paragraph, so neither can an element that holds one,
57970
+ * such as a `<span>` round a `<p>`. Embedded content such as an `<iframe>` can.
57971
+ */ function holdsBlock(elm) {
57972
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
57973
+ try {
57974
+ for(var _iterator = jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.eachGen(elm)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
57975
+ var node = _step.value;
57976
+ 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)) {
57977
+ return true;
57978
+ }
57979
+ }
57980
+ } catch (err) {
57981
+ _didIteratorError = true;
57982
+ _iteratorError = err;
57983
+ } finally{
57984
+ try {
57985
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
57986
+ _iterator.return();
57987
+ }
57988
+ } finally{
57989
+ if (_didIteratorError) {
57990
+ throw _iteratorError;
57991
+ }
57992
+ }
57993
+ }
57994
+ return false;
57995
+ }
57765
57996
  function checkAloneListLeaf(child, jodit) {
57766
57997
  var result = child;
57767
57998
  var next = child;
57768
57999
  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);
58000
+ 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)) {
58001
+ var nextChild = jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.findNotEmptySibling(next, false);
58002
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(result, 'ul')) {
58003
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.append(result, next);
57773
58004
  } else {
57774
- result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.wrap(next, 'ul', jodit.createInside);
58005
+ result = jodit_core_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.wrap(next, 'ul', jodit.createInside);
57775
58006
  }
57776
58007
  next = nextChild;
57777
58008
  } else {
@@ -57780,7 +58011,7 @@ function checkAloneListLeaf(child, jodit) {
57780
58011
  }while (next);
57781
58012
  return result;
57782
58013
  }
57783
- jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('wrapNodes', wrapNodes);
58014
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_10__.pluginSystem.add('wrapNodes', wrapNodes);
57784
58015
 
57785
58016
 
57786
58017
  /***/ }),