jodit 4.19.5 → 4.19.7

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 (85) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +21 -8
  4. package/es2015/jodit.js +847 -155
  5. package/es2015/jodit.min.js +21 -8
  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 +20 -7
  13. package/es2018/jodit.min.js +21 -8
  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 +21 -8
  18. package/es2021/jodit.js +832 -154
  19. package/es2021/jodit.min.js +69 -56
  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 +31 -18
  28. package/es2021.en/jodit.js +832 -154
  29. package/es2021.en/jodit.min.js +31 -18
  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 +947 -166
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/config.d.ts +31 -0
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/selection/helpers/move-node-inside-start.js +5 -2
  53. package/esm/core/selection/style/apply-style.js +31 -2
  54. package/esm/jodit.js +14 -2
  55. package/esm/plugins/backspace/cases/check-join-neighbors.js +36 -7
  56. package/esm/plugins/backspace/cases/check-remove-empty-parent.js +3 -1
  57. package/esm/plugins/bold/bold.js +4 -1
  58. package/esm/plugins/delete/delete.d.ts +12 -0
  59. package/esm/plugins/delete/delete.js +50 -1
  60. package/esm/plugins/link/config.d.ts +31 -0
  61. package/esm/plugins/link/config.js +3 -0
  62. package/esm/plugins/link/link.d.ts +27 -0
  63. package/esm/plugins/link/link.js +144 -2
  64. package/esm/plugins/link/tlds.d.ts +18 -0
  65. package/esm/plugins/link/tlds.js +33 -0
  66. package/esm/plugins/link/typed-link.d.ts +23 -0
  67. package/esm/plugins/link/typed-link.js +92 -0
  68. package/esm/plugins/resize-cells/resize-cells.d.ts +25 -1
  69. package/esm/plugins/resize-cells/resize-cells.js +84 -15
  70. package/esm/plugins/select/select.d.ts +35 -0
  71. package/esm/plugins/select/select.js +153 -1
  72. package/esm/plugins/select-cells/select-cells.d.ts +24 -0
  73. package/esm/plugins/select-cells/select-cells.js +81 -18
  74. package/esm/types/style.d.ts +5 -0
  75. package/package.json +1 -1
  76. package/types/config.d.ts +31 -0
  77. package/types/plugins/delete/delete.d.ts +12 -0
  78. package/types/plugins/link/config.d.ts +31 -0
  79. package/types/plugins/link/link.d.ts +27 -0
  80. package/types/plugins/link/tlds.d.ts +18 -0
  81. package/types/plugins/link/typed-link.d.ts +23 -0
  82. package/types/plugins/resize-cells/resize-cells.d.ts +25 -1
  83. package/types/plugins/select/select.d.ts +35 -0
  84. package/types/plugins/select-cells/select-cells.d.ts +24 -0
  85. package/types/types/style.d.ts +5 -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.19.5
4
+ * Version: v4.19.7
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2154,7 +2154,7 @@ __webpack_require__.r(__webpack_exports__);
2154
2154
  * @packageDocumentation
2155
2155
  * @module constants
2156
2156
  */
2157
- var APP_VERSION = "4.19.5";
2157
+ var APP_VERSION = "4.19.7";
2158
2158
  // prettier-ignore
2159
2159
  var ES = "es5";
2160
2160
  var IS_ES_MODERN = false;
@@ -12725,7 +12725,13 @@ function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild,
12725
12725
  * When the cursor is positioned in its place, it must be inside the element and not outside its border.
12726
12726
  * @private
12727
12727
  */ function moveNodeInsideStart(j, node, start) {
12728
- var sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(node, start), anotherSibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(node, !start);
12728
+ // A text node of non-breaking spaces trims to nothing, but it's text the
12729
+ // node mustn't move past
12730
+ var isContent = function isContent(n) {
12731
+ var _n_nodeValue;
12732
+ return !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(n) || Boolean((_n_nodeValue = n.nodeValue) === null || _n_nodeValue === void 0 ? void 0 : _n_nodeValue.includes(jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE));
12733
+ };
12734
+ var sibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(node, start, isContent), anotherSibling = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(node, !start, isContent);
12729
12735
  while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(sibling) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(sibling, j.editor) && (!anotherSibling || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(node, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement, j.editor))){
12730
12736
  if (start || !sibling.firstChild) {
12731
12737
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.append(sibling, node);
@@ -15930,9 +15936,11 @@ var WRAP_NODES = new Set([
15930
15936
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15931
15937
  /* harmony export */ ApplyStyle: function() { return /* binding */ ApplyStyle; }
15932
15938
  /* harmony export */ });
15933
- /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51640);
15934
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98394);
15935
- /* harmony import */ var _transactions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(78462);
15939
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
15940
+ /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28723);
15941
+ /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(51640);
15942
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(98394);
15943
+ /* harmony import */ var _transactions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78462);
15936
15944
  /*!
15937
15945
  * Jodit Editor (https://xdsoft.net/jodit/)
15938
15946
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -15942,13 +15950,40 @@ var WRAP_NODES = new Set([
15942
15950
  */
15943
15951
 
15944
15952
 
15953
+
15954
+
15955
+ /**
15956
+ * Take a selected fragment out of the elements its style takes the place
15957
+ * of: one around it is split, so the fragment leaves it, and one in it is
15958
+ * unwrapped
15959
+ */ function takeOutOf(jodit, font, tags) {
15960
+ var range = jodit.s.createRange();
15961
+ var outer = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
15962
+ while(outer){
15963
+ range.selectNodeContents(outer);
15964
+ range.setEndBefore(font);
15965
+ var before = range.cloneContents();
15966
+ range.selectNodeContents(outer);
15967
+ range.setStartAfter(font);
15968
+ // Split only when there's more in it, as a split leaves empty copies
15969
+ // of the elements between
15970
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(before) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(range.cloneContents())) {
15971
+ (0,_api__WEBPACK_IMPORTED_MODULE_2__.extractSelectedPart)(outer, font, jodit);
15972
+ }
15973
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(outer);
15974
+ outer = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
15975
+ }
15976
+ ;(0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_1__.$$)(tags.join(','), font).forEach(function(inner) {
15977
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(inner);
15978
+ });
15979
+ }
15945
15980
  /** @internal */ function ApplyStyle(jodit, cs) {
15946
15981
  var _editor_firstChild;
15947
15982
  var sel = jodit.s, editor = jodit.editor;
15948
15983
  (_editor_firstChild = editor.firstChild) === null || _editor_firstChild === void 0 ? void 0 : _editor_firstChild.normalize(); // FF fix for test "commandsTest - Exec command "bold"
15949
15984
  var fakes = sel.fakes();
15950
15985
  var collapsed = sel.isCollapsed();
15951
- var mode = _constants__WEBPACK_IMPORTED_MODULE_1__.INITIAL;
15986
+ var mode = _constants__WEBPACK_IMPORTED_MODULE_3__.INITIAL;
15952
15987
  try {
15953
15988
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
15954
15989
  try {
@@ -15956,16 +15991,20 @@ var WRAP_NODES = new Set([
15956
15991
  // temporary wrapper before the selection is restored in finally.
15957
15992
  for(var _iterator = sel.wrapInTagGen(fakes)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
15958
15993
  var font = _step.value;
15994
+ var _cs_options_exclude;
15995
+ if ((_cs_options_exclude = cs.options.exclude) === null || _cs_options_exclude === void 0 ? void 0 : _cs_options_exclude.length) {
15996
+ takeOutOf(jodit, font, cs.options.exclude);
15997
+ }
15959
15998
  var state = {
15960
15999
  collapsed: collapsed,
15961
16000
  mode: mode,
15962
16001
  element: font,
15963
- next: _transactions__WEBPACK_IMPORTED_MODULE_2__.states.START,
16002
+ next: _transactions__WEBPACK_IMPORTED_MODULE_4__.states.START,
15964
16003
  jodit: jodit,
15965
16004
  style: cs
15966
16005
  };
15967
- var machine = new _api__WEBPACK_IMPORTED_MODULE_0__.FiniteStateMachine(_transactions__WEBPACK_IMPORTED_MODULE_2__.states.START, _transactions__WEBPACK_IMPORTED_MODULE_2__.transactions);
15968
- while(!jodit.isInDestruct && machine.getState() !== _transactions__WEBPACK_IMPORTED_MODULE_2__.states.END){
16006
+ var machine = new _api__WEBPACK_IMPORTED_MODULE_2__.FiniteStateMachine(_transactions__WEBPACK_IMPORTED_MODULE_4__.states.START, _transactions__WEBPACK_IMPORTED_MODULE_4__.transactions);
16007
+ while(!jodit.isInDestruct && machine.getState() !== _transactions__WEBPACK_IMPORTED_MODULE_4__.states.END){
15969
16008
  state = machine.dispatch('exec', state);
15970
16009
  }
15971
16010
  // The first selected fragment determines how later fragments toggle.
@@ -22322,6 +22361,20 @@ var FOCUS_EVENTS = new Set([
22322
22361
  'focusin',
22323
22362
  'focusout'
22324
22363
  ]);
22364
+ var EDITING_KEYS = new Set([
22365
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_12__.KEY_ENTER,
22366
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_12__.KEY_BACKSPACE,
22367
+ jodit_core_constants__WEBPACK_IMPORTED_MODULE_12__.KEY_DELETE
22368
+ ]);
22369
+ /**
22370
+ * Whether the input method (IME) is using the key. Safari fires the keydown
22371
+ * that ends a composition, as the Enter that confirms Japanese text, after
22372
+ * `compositionend`, and types Korean without one, so `isComposing` is false and
22373
+ * only keyCode 229 tells. Only the keys the editor turns into edits are held
22374
+ * back: the handlers that follow typing still see the rest.
22375
+ */ function isInputMethodKey(event) {
22376
+ return event.isComposing || event.keyCode === 229 && EDITING_KEYS.has(event.key);
22377
+ }
22325
22378
  var __defaultStyleDisplayKey = 'data-jodit-default-style-display';
22326
22379
  var __defaultClassesKey = 'data-jodit-default-classes';
22327
22380
  var NOEDIT = {
@@ -23605,7 +23658,7 @@ var Jodit = /*#__PURE__*/ function(ViewWithToolbar) {
23605
23658
  }
23606
23659
  }
23607
23660
  var w = _this.ew;
23608
- if ((0,_swc_helpers_instanceof__WEBPACK_IMPORTED_MODULE_7__._)(event, w.KeyboardEvent) && event.isComposing) {
23661
+ if ((0,_swc_helpers_instanceof__WEBPACK_IMPORTED_MODULE_7__._)(event, w.KeyboardEvent) && isInputMethodKey(event)) {
23609
23662
  return;
23610
23663
  }
23611
23664
  if (_this.e && _this.e.fire) {
@@ -34589,6 +34642,13 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34589
34642
  if (checkJoinBareText(jodit, fakeNode, backspace)) {
34590
34643
  return true;
34591
34644
  }
34645
+ // Old content can have an inline element round blocks beside the text:
34646
+ // moved inside them, the line joins the block as it would bare text
34647
+ // (#1781)
34648
+ var inline = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
34649
+ if (joinsBareText(jodit, edgeBlock(inline, backspace)) && moveInlineInside(inline, jodit.editor)) {
34650
+ return joinNeighbors(jodit, fakeNode, backspace, moved);
34651
+ }
34592
34652
  var nextBox = fakeNode, mainClosestBox = nextBox;
34593
34653
  // Find the main big closest element
34594
34654
  while(nextBox && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(nextBox, backspace) && nextBox.parentElement !== jodit.editor){
@@ -34896,9 +34956,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34896
34956
  * in `<div>a|<p>b</p>c</div>` gives `<div>a|b<br>c</div>`
34897
34957
  */ function checkJoinBareText(jodit, fakeNode, backspace) {
34898
34958
  var block = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
34899
- if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(block) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(block) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(block) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(block, 'table') || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(block) || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(block, jodit.editor) || Array.from(block.childNodes).some(function(node) {
34900
- return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);
34901
- })) {
34959
+ if (!joinsBareText(jodit, block)) {
34902
34960
  return false;
34903
34961
  }
34904
34962
  var filter = (0,jodit_plugins_backspace_helpers__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
@@ -34925,6 +34983,28 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('backspace', bac
34925
34983
  jodit.s.setCursorBefore(fakeNode);
34926
34984
  return true;
34927
34985
  }
34986
+ /**
34987
+ * Whether a block joins the bare text beside it: not a list, a table or a
34988
+ * cell, and holding no block of its own
34989
+ */ function joinsBareText(jodit, block) {
34990
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(block) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(block) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(block) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(block, 'table') && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(block) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(block, jodit.editor) && !Array.from(block.childNodes).some(function(node) {
34991
+ return jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node);
34992
+ });
34993
+ }
34994
+ /**
34995
+ * The block an inline element holds on its side facing the caret, through
34996
+ * the inline elements in it: the `<p>` of `<span><strong><p>…</p></strong></span>`
34997
+ */ function edgeBlock(node, backspace) {
34998
+ var edge = node;
34999
+ while(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(edge) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(edge)){
35000
+ var _ref;
35001
+ var children = Array.from(edge.childNodes).filter(function(child) {
35002
+ return !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(child);
35003
+ });
35004
+ edge = (_ref = backspace ? children[children.length - 1] : children[0]) !== null && _ref !== void 0 ? _ref : null;
35005
+ }
35006
+ return edge === node ? null : edge;
35007
+ }
34928
35008
  function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
34929
35009
  // Process UL/LI/OL cases
34930
35010
  var siblingIsList = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
@@ -35379,7 +35459,6 @@ function isNotEditable(jodit, node) {
35379
35459
  if (!prn || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn)) {
35380
35460
  return false;
35381
35461
  }
35382
- var neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
35383
35462
  do {
35384
35463
  if (prn && jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(prn)) {
35385
35464
  jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.after(prn, fakeNode);
@@ -35396,6 +35475,9 @@ function isNotEditable(jodit, node) {
35396
35475
  if (found && (0,_check_join_two_lists__WEBPACK_IMPORTED_MODULE_2__.checkJoinTwoLists)(jodit, fakeNode, backspace)) {
35397
35476
  return true;
35398
35477
  }
35478
+ // Looked for once the empty elements have gone, as the one beside the
35479
+ // caret can be in them: the `<br>` that Delete in `<p>|<br></p>` leaves
35480
+ var neighbor = jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
35399
35481
  if (neighbor && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(neighbor) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(neighbor, jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
35400
35482
  setCursorIn(neighbor, !backspace);
35401
35483
  } else {
@@ -35873,8 +35955,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_1__.Config.prototype.delete = {
35873
35955
  }
35874
35956
  cssRules[key] = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isArray)(cssOptions[key]) ? cssOptions[key][0] : cssOptions[key];
35875
35957
  });
35958
+ var element = control.tags ? control.tags[0] : undefined;
35876
35959
  editor.s.commitStyle({
35877
- element: control.tags ? control.tags[0] : undefined
35960
+ element: element,
35961
+ // As in the browsers and Word, each takes the other's place
35962
+ exclude: element === 'sub' ? [
35963
+ 'sup'
35964
+ ] : element === 'sup' ? [
35965
+ 'sub'
35966
+ ] : []
35878
35967
  });
35879
35968
  editor.synchronizeValues();
35880
35969
  return false;
@@ -38674,11 +38763,12 @@ __webpack_require__.r(__webpack_exports__);
38674
38763
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
38675
38764
  /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50684);
38676
38765
  /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38574);
38677
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(27795);
38678
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(28077);
38679
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65946);
38680
- /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(4040);
38681
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(91206);
38766
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81937);
38767
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27795);
38768
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28077);
38769
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65946);
38770
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4040);
38771
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
38682
38772
  /*!
38683
38773
  * Jodit Editor (https://xdsoft.net/jodit/)
38684
38774
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -38700,6 +38790,7 @@ __webpack_require__.r(__webpack_exports__);
38700
38790
 
38701
38791
 
38702
38792
 
38793
+
38703
38794
  var NOT_EMPTY_CONTENT_TAGS = new Set([
38704
38795
  'img',
38705
38796
  'table',
@@ -38707,6 +38798,18 @@ var NOT_EMPTY_CONTENT_TAGS = new Set([
38707
38798
  'iframe',
38708
38799
  'hr'
38709
38800
  ]);
38801
+ var KEEPS_SPACES = new Set([
38802
+ 'pre',
38803
+ 'pre-wrap',
38804
+ 'break-spaces'
38805
+ ]);
38806
+ /**
38807
+ * A plain space beside this neighbor isn't shown: there is none, or it's a
38808
+ * line break, a block or text starting (or ending) with a plain space
38809
+ */ function hidesSpace(neighbor, edge) {
38810
+ var _neighbor_nodeValue;
38811
+ return !neighbor || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(neighbor, 'br') || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(neighbor) || jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(neighbor) && edge.test((_neighbor_nodeValue = neighbor.nodeValue) !== null && _neighbor_nodeValue !== void 0 ? _neighbor_nodeValue : '');
38812
+ }
38710
38813
  var deleteCommand = /*#__PURE__*/ function(Plugin) {
38711
38814
  "use strict";
38712
38815
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(deleteCommand, Plugin);
@@ -38744,13 +38847,13 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
38744
38847
  */ function __afterDeleteCommand() {
38745
38848
  var jodit = this.j;
38746
38849
  var current = jodit.s.current();
38747
- if (current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(current.firstChild, 'br')) {
38850
+ if (current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(current.firstChild, 'br')) {
38748
38851
  jodit.s.removeNode(current.firstChild);
38749
38852
  }
38750
- if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_10__.trim)(jodit.editor.textContent || '') && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.first(jodit.editor, function(node) {
38751
- return jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(node, NOT_EMPTY_CONTENT_TAGS);
38752
- }) && (!current || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.closest(current, 'table', jodit.editor))) {
38753
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.detach(jodit.editor);
38853
+ if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_11__.trim)(jodit.editor.textContent || '') && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.first(jodit.editor, function(node) {
38854
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(node, NOT_EMPTY_CONTENT_TAGS);
38855
+ }) && (!current || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(current, 'table', jodit.editor))) {
38856
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.detach(jodit.editor);
38754
38857
  var node = jodit.s.setCursorIn(jodit.editor);
38755
38858
  jodit.s.removeNode(node);
38756
38859
  }
@@ -38773,14 +38876,15 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
38773
38876
  range.deleteContents();
38774
38877
  var fake = jodit.createInside.fake();
38775
38878
  range.insertNode(fake);
38776
- var leftSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.findSibling(fake, true);
38777
- var rightSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.findSibling(fake, false);
38879
+ var leftSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.findSibling(fake, true);
38880
+ var rightSibling = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.findSibling(fake, false);
38778
38881
  this.__moveContentInLeftSibling(fake, leftSibling, rightSibling);
38882
+ this.__keepSpacesVisible(fake);
38779
38883
  range.setStartBefore(fake);
38780
38884
  range.collapse(true);
38781
38885
  this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
38782
38886
  this.__addBrInEmptyBlock(fake, range);
38783
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(fake);
38887
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(fake);
38784
38888
  jodit.s.selectRange(caret !== null && caret !== void 0 ? caret : range);
38785
38889
  return false;
38786
38890
  }
@@ -38797,27 +38901,27 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
38797
38901
  * Returns where the caret goes, or null when no table is involved
38798
38902
  */ function __clearSelectedCells(range) {
38799
38903
  var _this_j = this.j, editor = _this_j.editor, createInside = _this_j.createInside;
38800
- var startCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.closest(range.startContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isCell, editor);
38801
- var endCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.closest(range.endContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isCell, editor);
38904
+ var startCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(range.startContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isCell, editor);
38905
+ var endCell = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(range.endContainer, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isCell, editor);
38802
38906
  if (startCell === endCell) {
38803
38907
  return null;
38804
38908
  }
38805
- var startTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.closest(startCell, 'table', editor);
38806
- var endTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.closest(endCell, 'table', editor);
38909
+ var startTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(startCell, 'table', editor);
38910
+ var endTable = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(endCell, 'table', editor);
38807
38911
  var caret = range.cloneRange();
38808
38912
  caret.collapse(true);
38809
38913
  var parts = [];
38810
38914
  var addParts = function addParts(table) {
38811
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.toArray)(table.rows).flatMap(function(row) {
38812
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_9__.toArray)(row.cells);
38915
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.toArray)(table.rows).flatMap(function(row) {
38916
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.toArray)(row.cells);
38813
38917
  }).filter(function(cell) {
38814
38918
  return range.intersectsNode(cell);
38815
38919
  }).forEach(function(cell) {
38816
38920
  var part = range.cloneRange();
38817
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isOrContains(cell, range.startContainer)) {
38921
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(cell, range.startContainer)) {
38818
38922
  part.setStart(cell, 0);
38819
38923
  }
38820
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isOrContains(cell, range.endContainer)) {
38924
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(cell, range.endContainer)) {
38821
38925
  part.setEnd(cell, cell.childNodes.length);
38822
38926
  }
38823
38927
  parts.push([
@@ -38841,9 +38945,9 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
38841
38945
  parts.forEach(function(param) {
38842
38946
  var _param = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(param, 2), cell = _param[0], part = _param[1];
38843
38947
  part.deleteContents();
38844
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isEmpty(cell)) {
38845
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.detach(cell);
38846
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.append(cell, createInside.element('br'));
38948
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(cell)) {
38949
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.detach(cell);
38950
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(cell, createInside.element('br'));
38847
38951
  }
38848
38952
  });
38849
38953
  return startTable ? caret : null;
@@ -38854,49 +38958,89 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
38854
38958
  value: function __moveContentInLeftSibling(fake, leftSibling, rightSibling) {
38855
38959
  leftSibling = this.__defineRightLeftBox(leftSibling);
38856
38960
  // Nothing is moved into a table, and a block left empty after it goes
38857
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(leftSibling, 'table')) {
38858
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isEmpty(rightSibling)) {
38859
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(rightSibling);
38961
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(leftSibling, 'table')) {
38962
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(rightSibling)) {
38963
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(rightSibling);
38860
38964
  }
38861
38965
  return;
38862
38966
  }
38863
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isList(rightSibling) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isTag(rightSibling, 'table') && jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(leftSibling)) {
38864
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.append(leftSibling, fake);
38865
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.moveContent(rightSibling, leftSibling);
38866
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(rightSibling);
38967
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isList(rightSibling) && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(rightSibling, 'table') && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(leftSibling)) {
38968
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(leftSibling, fake);
38969
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.moveContent(rightSibling, leftSibling);
38970
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(rightSibling);
38867
38971
  }
38868
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isList(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isLeaf(rightSibling.firstElementChild)) {
38972
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isList(rightSibling) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isLeaf(rightSibling.firstElementChild)) {
38869
38973
  var item = rightSibling.firstElementChild;
38870
38974
  // What's left of the right list's first item joins the left block,
38871
38975
  // up to a list nested in the item
38872
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isEmpty(item) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(leftSibling)) {
38873
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.append(leftSibling, fake);
38874
- while(item.firstChild && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(item.firstChild)){
38875
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.append(leftSibling, item.firstChild);
38976
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(item) && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(leftSibling)) {
38977
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(leftSibling, fake);
38978
+ while(item.firstChild && !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(item.firstChild)){
38979
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(leftSibling, item.firstChild);
38876
38980
  }
38877
38981
  }
38878
38982
  // Remove empty right LI
38879
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isEmpty(item)) {
38880
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(item);
38983
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(item)) {
38984
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(item);
38881
38985
  }
38882
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isEmpty(rightSibling)) {
38883
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(rightSibling);
38986
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isEmpty(rightSibling)) {
38987
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(rightSibling);
38884
38988
  }
38885
38989
  }
38886
38990
  }
38887
38991
  },
38992
+ {
38993
+ key: "__keepSpacesVisible",
38994
+ value: /**
38995
+ * A plain space the deletion leaves at an edge of the block, before a line
38996
+ * break or next to another space isn't shown, and the browser drops it when
38997
+ * the next char is typed. It becomes non-breaking, as in the browsers' own
38998
+ * delete and in Backspace without a selection (#1522)
38999
+ */ function __keepSpacesVisible(fake) {
39000
+ var _Dom_closest;
39001
+ var jodit = this.jodit;
39002
+ var block = (_Dom_closest = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(fake, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock, jodit.editor)) !== null && _Dom_closest !== void 0 ? _Dom_closest : jodit.editor;
39003
+ if (KEEPS_SPACES.has(jodit.ew.getComputedStyle(block).whiteSpace)) {
39004
+ return;
39005
+ }
39006
+ var before = this.__findNeighbor(fake, true, block);
39007
+ var after = this.__findNeighbor(fake, false, block);
39008
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(before) && hidesSpace(after, /^ /)) {
39009
+ before.nodeValue = before.nodeValue.replace(/ +$/, function(spaces) {
39010
+ return jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.NBSP_SPACE.repeat(spaces.length);
39011
+ });
39012
+ }
39013
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(after) && hidesSpace(before, / $/)) {
39014
+ after.nodeValue = after.nodeValue.replace(/^ +/, function(spaces) {
39015
+ return jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.NBSP_SPACE.repeat(spaces.length);
39016
+ });
39017
+ }
39018
+ }
39019
+ },
39020
+ {
39021
+ key: "__findNeighbor",
39022
+ value: /**
39023
+ * The text, line break or other element next to the caret in its block,
39024
+ * looking inside inline elements
39025
+ */ function __findNeighbor(fake, left, block) {
39026
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.call)(left ? jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.prev : jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.next, fake, function(node) {
39027
+ var _node_nodeValue;
39028
+ return jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(node) ? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.trimInv)((_node_nodeValue = node.nodeValue) !== null && _node_nodeValue !== void 0 ? _node_nodeValue : '').length > 0 : !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isComment(node) && !(jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isInlineBlock(node) && node.firstChild);
39029
+ }, block);
39030
+ }
39031
+ },
38888
39032
  {
38889
39033
  key: "__defineRightLeftBox",
38890
39034
  value: /**
38891
39035
  * If left sibling is list - return last leaf
38892
39036
  */ function __defineRightLeftBox(leftSibling) {
38893
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isList(leftSibling)) {
39037
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isList(leftSibling)) {
38894
39038
  return leftSibling;
38895
39039
  }
38896
39040
  var lastLeaf = leftSibling.lastElementChild;
38897
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isLeaf(lastLeaf)) {
39041
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isLeaf(lastLeaf)) {
38898
39042
  lastLeaf = this.j.createInside.element('li');
38899
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.append(leftSibling, lastLeaf);
39043
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.append(leftSibling, lastLeaf);
38900
39044
  }
38901
39045
  return lastLeaf;
38902
39046
  }
@@ -38907,9 +39051,9 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
38907
39051
  * Add BR in the empty block left at the caret
38908
39052
  */ function __addBrInEmptyBlock(fake, range) {
38909
39053
  var jodit = this.j;
38910
- if (fake.isConnected && jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
39054
+ if (fake.isConnected && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
38911
39055
  var br = jodit.createInside.element('br');
38912
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.after(fake, br);
39056
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.after(fake, br);
38913
39057
  range.setStartBefore(br);
38914
39058
  range.collapse(true);
38915
39059
  }
@@ -38918,25 +39062,25 @@ var deleteCommand = /*#__PURE__*/ function(Plugin) {
38918
39062
  {
38919
39063
  key: "__moveCursorInEditableSibling",
38920
39064
  value: function __moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
38921
- if (!leftSibling || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isText(leftSibling)) {
39065
+ if (!leftSibling || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText(leftSibling)) {
38922
39066
  var _Dom_closest;
38923
- var root = (_Dom_closest = jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.closest(fake, jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isBlock, jodit.editor)) !== null && _Dom_closest !== void 0 ? _Dom_closest : jodit.editor;
38924
- var leftText = jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.prev(fake, jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.isText, root);
39067
+ var root = (_Dom_closest = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(fake, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isBlock, jodit.editor)) !== null && _Dom_closest !== void 0 ? _Dom_closest : jodit.editor;
39068
+ var leftText = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.prev(fake, jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isText, root);
38925
39069
  if (leftText) {
38926
39070
  range.setStartAfter(leftText);
38927
39071
  range.collapse(true);
38928
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_7__.Dom.safeRemove(fake);
39072
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.safeRemove(fake);
38929
39073
  }
38930
39074
  }
38931
39075
  }
38932
39076
  }
38933
39077
  ]);
38934
39078
  return deleteCommand;
38935
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__.Plugin));
39079
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__.Plugin));
38936
39080
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(deleteCommand, "requires", [
38937
39081
  'backspace'
38938
39082
  ]);
38939
- jodit_core_global__WEBPACK_IMPORTED_MODULE_8__.pluginSystem.add('deleteCommand', deleteCommand);
39083
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('deleteCommand', deleteCommand);
38940
39084
 
38941
39085
 
38942
39086
  /***/ }),
@@ -48317,6 +48461,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.link = {
48317
48461
  followOnDblClick: false,
48318
48462
  processVideoLink: true,
48319
48463
  processPastedLink: true,
48464
+ processTypedLink: false,
48465
+ typedLinkTlds: [],
48466
+ typedLinkFileEndings: [
48467
+ 'zip',
48468
+ 'mov',
48469
+ 'md',
48470
+ 'py',
48471
+ 'sh',
48472
+ 'pub'
48473
+ ],
48320
48474
  deriveUrlFromText: false,
48321
48475
  noFollowCheckbox: true,
48322
48476
  openInNewTabCheckbox: true,
@@ -48371,14 +48525,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48371
48525
  /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53429);
48372
48526
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25045);
48373
48527
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
48374
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31635);
48375
- /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38574);
48376
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(84839);
48377
- /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27795);
48378
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28077);
48379
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65946);
48380
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(91206);
48381
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(65230);
48528
+ /* harmony import */ var _swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50684);
48529
+ /* harmony import */ var _swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(42395);
48530
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
48531
+ /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(38574);
48532
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(81937);
48533
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(84839);
48534
+ /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(27795);
48535
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(28077);
48536
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65946);
48537
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(91206);
48538
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(65230);
48539
+ /* harmony import */ var _typed_link__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(99763);
48382
48540
  /*!
48383
48541
  * Jodit Editor (https://xdsoft.net/jodit/)
48384
48542
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -48400,6 +48558,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48400
48558
 
48401
48559
 
48402
48560
 
48561
+
48562
+
48563
+
48564
+
48403
48565
  /**
48404
48566
  * Process link. Insert, dblclick or remove format
48405
48567
  */ var link = /*#__PURE__*/ function(Plugin) {
@@ -48413,7 +48575,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48413
48575
  name: 'link',
48414
48576
  group: 'insert'
48415
48577
  }
48416
- ]);
48578
+ ]), /**
48579
+ * Where the caret was when Enter was pressed. Enter splits the line in a
48580
+ * history transaction, so the link waits until it's over
48581
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__enteredAt", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__linkAfterEnter", function() {}), /**
48582
+ * The link just made, which Backspace straight after takes off again, as
48583
+ * in CKEditor 5. Any other key but a modifier, a click or a command
48584
+ * forgets it
48585
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__justLinked", null);
48417
48586
  return _this;
48418
48587
  }
48419
48588
  ;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(link, [
@@ -48428,6 +48597,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48428
48597
  if (jodit.o.link.processPastedLink) {
48429
48598
  jodit.e.on('processPaste.link', this.onProcessPasteLink);
48430
48599
  }
48600
+ if (jodit.o.link.processTypedLink) {
48601
+ this.__linkAfterEnter = jodit.async.microDebounce(this.__linkTyped);
48602
+ jodit.e.on('input.link', this.__onTypedSpace).on('beforeEnter.link', this.__onBeforeEnter).on('afterEnter.link', this.__onAfterEnter).on('mousedown.link blur.link beforeCommand.link', this.__forgetLink)// Without a namespace it runs ahead of table navigation,
48603
+ // which moves the caret on Tab, and of the backspace plugin
48604
+ .on('keydown', this.__onKeyDown, {
48605
+ top: true
48606
+ });
48607
+ }
48431
48608
  jodit.e.on('generateLinkForm.link', this.__generateForm);
48432
48609
  jodit.registerCommand('openLinkDialog', {
48433
48610
  exec: function exec() {
@@ -48441,7 +48618,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48441
48618
  dialog.setContent(htmlForm);
48442
48619
  dialog.open();
48443
48620
  jodit.async.requestIdleCallback(function() {
48444
- var url_input = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.refs)(htmlForm.container).url_input;
48621
+ var url_input = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.refs)(htmlForm.container).url_input;
48445
48622
  url_input === null || url_input === void 0 ? void 0 : url_input.focus();
48446
48623
  });
48447
48624
  },
@@ -48452,10 +48629,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48452
48629
  {
48453
48630
  key: "__onDblClickOnLink",
48454
48631
  value: function __onDblClickOnLink(e) {
48455
- if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(e.target, 'a')) {
48632
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(e.target, 'a')) {
48456
48633
  return;
48457
48634
  }
48458
- var href = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(e.target, 'href');
48635
+ var href = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(e.target, 'href');
48459
48636
  if (href) {
48460
48637
  location.href = href;
48461
48638
  e.preventDefault();
@@ -48466,25 +48643,25 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48466
48643
  key: "onProcessPasteLink",
48467
48644
  value: function onProcessPasteLink(ignore, html) {
48468
48645
  var jodit = this.jodit;
48469
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isURL)(html) || !jodit.o.link.processPastedLink) {
48646
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isURL)(html) || !jodit.o.link.processPastedLink) {
48470
48647
  return;
48471
48648
  }
48472
48649
  jodit.e.stopPropagation('processPaste');
48473
48650
  if (jodit.o.link.processVideoLink) {
48474
48651
  var _ref;
48475
48652
  var _jodit_o_video, _jodit_o_video1, _jodit_o_video2;
48476
- var embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.call)((_ref = (_jodit_o_video = jodit.o.video) === null || _jodit_o_video === void 0 ? void 0 : _jodit_o_video.parseUrlToVideoEmbed) !== null && _ref !== void 0 ? _ref : jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.convertMediaUrlToVideoEmbed, html, {
48653
+ var embed = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.call)((_ref = (_jodit_o_video = jodit.o.video) === null || _jodit_o_video === void 0 ? void 0 : _jodit_o_video.parseUrlToVideoEmbed) !== null && _ref !== void 0 ? _ref : jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.convertMediaUrlToVideoEmbed, html, {
48477
48654
  width: (_jodit_o_video1 = jodit.o.video) === null || _jodit_o_video1 === void 0 ? void 0 : _jodit_o_video1.defaultWidth,
48478
48655
  height: (_jodit_o_video2 = jodit.o.video) === null || _jodit_o_video2 === void 0 ? void 0 : _jodit_o_video2.defaultHeight
48479
48656
  });
48480
48657
  if (embed !== html) {
48481
- var media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.prepareEmbedCode)(jodit, embed);
48482
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isString)(media) ? jodit.createInside.fromHTML(media) : media;
48658
+ var media = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.prepareEmbedCode)(jodit, embed);
48659
+ return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(media) ? jodit.createInside.fromHTML(media) : media;
48483
48660
  }
48484
48661
  }
48485
48662
  if (jodit.s.isCollapsed()) {
48486
48663
  var a = jodit.createInside.element('a');
48487
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'href', html);
48664
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'href', html);
48488
48665
  a.textContent = html;
48489
48666
  jodit.e.fire('applyLink', jodit, a, null);
48490
48667
  return a;
@@ -48505,16 +48682,16 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48505
48682
  var i18n = jodit.i18n.bind(jodit);
48506
48683
  var _jodit_o_link = jodit.o.link, openInNewTabCheckbox = _jodit_o_link.openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked = _jodit_o_link.openInNewTabCheckboxDefaultChecked, noFollowCheckbox = _jodit_o_link.noFollowCheckbox, formTemplate = _jodit_o_link.formTemplate, formClassName = _jodit_o_link.formClassName, modeClassName = _jodit_o_link.modeClassName;
48507
48684
  var html = formTemplate(jodit);
48508
- var form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isString)(html) ? jodit.c.fromHTML(html, {
48685
+ var form = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.isString)(html) ? jodit.c.fromHTML(html, {
48509
48686
  target_checkbox_box: openInNewTabCheckbox,
48510
48687
  nofollow_checkbox_box: noFollowCheckbox
48511
48688
  }) : html;
48512
- var htmlForm = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isElement(form) ? form : form.container;
48513
- var elements = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.refs)(htmlForm);
48689
+ var htmlForm = jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isElement(form) ? form : form.container;
48690
+ var elements = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.refs)(htmlForm);
48514
48691
  var insert = elements.insert, unlink = elements.unlink, content_input_box = elements.content_input_box;
48515
48692
  var target_checkbox = elements.target_checkbox, nofollow_checkbox = elements.nofollow_checkbox, url_input = elements.url_input;
48516
48693
  var currentElement = current;
48517
- var isImageContent = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isImage(currentElement);
48694
+ var isImageContent = jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isImage(currentElement);
48518
48695
  var content_input = elements.content_input;
48519
48696
  var className_input = elements.className_input, className_select = elements.className_select, aria_label_input = elements.aria_label_input;
48520
48697
  if (!content_input) {
@@ -48527,14 +48704,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48527
48704
  htmlForm.classList.add(formClassName);
48528
48705
  }
48529
48706
  if (isImageContent) {
48530
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.hide(content_input_box);
48707
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.hide(content_input_box);
48531
48708
  }
48532
48709
  var _$link;
48533
48710
  var getSelectionText = function getSelectionText() {
48534
- return _$link ? _$link.innerText : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.stripTags)(jodit.s.range.cloneContents(), jodit.ed);
48711
+ return _$link ? _$link.innerText : (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.stripTags)(jodit.s.range.cloneContents(), jodit.ed);
48535
48712
  };
48536
- if (current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(current, 'a', jodit.editor)) {
48537
- _$link = jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.closest(current, 'a', jodit.editor);
48713
+ if (current && jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(current, 'a', jodit.editor)) {
48714
+ _$link = jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(current, 'a', jodit.editor);
48538
48715
  } else {
48539
48716
  _$link = false;
48540
48717
  }
@@ -48542,22 +48719,22 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48542
48719
  content_input.value = getSelectionText();
48543
48720
  }
48544
48721
  if (aria_label_input) {
48545
- aria_label_input.value = _$link ? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(_$link, 'aria-label') || '' : '';
48722
+ aria_label_input.value = _$link ? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(_$link, 'aria-label') || '' : '';
48546
48723
  }
48547
48724
  if (_$link) {
48548
- url_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(_$link, 'href') || '';
48725
+ url_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(_$link, 'href') || '';
48549
48726
  if (modeClassName) {
48550
48727
  readClassnames(modeClassName, className_input, _$link, className_select);
48551
48728
  }
48552
48729
  if (openInNewTabCheckbox && target_checkbox) {
48553
- target_checkbox.checked = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(_$link, 'target') === '_blank';
48730
+ target_checkbox.checked = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(_$link, 'target') === '_blank';
48554
48731
  }
48555
48732
  if (noFollowCheckbox && nofollow_checkbox) {
48556
- nofollow_checkbox.checked = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(_$link, 'rel') || '').split(/\s+/).includes('nofollow');
48733
+ nofollow_checkbox.checked = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(_$link, 'rel') || '').split(/\s+/).includes('nofollow');
48557
48734
  }
48558
48735
  insert.textContent = i18n('Update');
48559
48736
  } else {
48560
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.hide(unlink);
48737
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.hide(unlink);
48561
48738
  if (jodit.o.link.deriveUrlFromText && url_input && !isImageContent && !url_input.value.trim()) {
48562
48739
  url_input.value = guessUrlFromText(content_input.value);
48563
48740
  }
@@ -48572,7 +48749,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48572
48749
  jodit.s.restore();
48573
48750
  jodit.history.snapshot.restore(snapshot);
48574
48751
  if (_$link) {
48575
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.unwrap(_$link);
48752
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.unwrap(_$link);
48576
48753
  }
48577
48754
  jodit.synchronizeValues();
48578
48755
  close();
@@ -48593,12 +48770,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48593
48770
  var textWasChanged = getSelectionText() !== content_input.value.trim();
48594
48771
  var ci = jodit.createInside;
48595
48772
  var caretAfter = null;
48596
- if (!_$link || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isOrContains(jodit.editor, _$link)) {
48773
+ if (!_$link || !jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isOrContains(jodit.editor, _$link)) {
48597
48774
  if (!jodit.s.isCollapsed()) {
48598
48775
  var node = jodit.s.current();
48599
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(node, 'img')) {
48776
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(node, 'img')) {
48600
48777
  links = [
48601
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.wrap(node, 'a', ci)
48778
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.wrap(node, 'a', ci)
48602
48779
  ];
48603
48780
  } else {
48604
48781
  links = jodit.s.wrapInTag('a');
@@ -48620,27 +48797,27 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48620
48797
  ];
48621
48798
  }
48622
48799
  links.forEach(function(a) {
48623
- ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'href', url_input.value);
48800
+ ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'href', url_input.value);
48624
48801
  writeClasses(modeClassName, className_input, className_select, a);
48625
48802
  if (!isImageContent) {
48626
48803
  writeImage(a, content_input, textWasChanged, url_input);
48627
48804
  }
48628
48805
  if (openInNewTabCheckbox && target_checkbox) {
48629
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'target', target_checkbox.checked ? '_blank' : null);
48806
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'target', target_checkbox.checked ? '_blank' : null);
48630
48807
  }
48631
48808
  if (noFollowCheckbox && nofollow_checkbox) {
48632
- var relParts = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'rel') || '').split(/\s+/).filter(Boolean);
48809
+ var relParts = ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'rel') || '').split(/\s+/).filter(Boolean);
48633
48810
  var hasNofollow = relParts.includes('nofollow');
48634
48811
  if (nofollow_checkbox.checked && !hasNofollow) {
48635
48812
  relParts.push('nofollow');
48636
48813
  } else if (!nofollow_checkbox.checked && hasNofollow) {
48637
48814
  relParts.splice(relParts.indexOf('nofollow'), 1);
48638
48815
  }
48639
- ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'rel', relParts.length ? relParts.join(' ') : null);
48816
+ ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'rel', relParts.length ? relParts.join(' ') : null);
48640
48817
  }
48641
48818
  if (aria_label_input) {
48642
48819
  var ariaLabel = aria_label_input.value.trim();
48643
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'aria-label', ariaLabel || null);
48820
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'aria-label', ariaLabel || null);
48644
48821
  }
48645
48822
  jodit.e.fire('applyLink', jodit, a, form);
48646
48823
  });
@@ -48655,7 +48832,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48655
48832
  close();
48656
48833
  return false;
48657
48834
  };
48658
- if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isElement(form)) {
48835
+ if (jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isElement(form)) {
48659
48836
  jodit.e.on(form, 'submit', function(event) {
48660
48837
  event.preventDefault();
48661
48838
  event.stopImmediatePropagation();
@@ -48671,34 +48848,170 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
48671
48848
  {
48672
48849
  key: "beforeDestruct",
48673
48850
  value: /** @override */ function beforeDestruct(jodit) {
48674
- jodit.e.off('generateLinkForm.link', this.__generateForm).off('dblclick.link', this.__onDblClickOnLink).off(jodit.editor, 'click.link', this.__onClickReadOnlyLink).off('processPaste.link', this.onProcessPasteLink);
48851
+ jodit.e.off('generateLinkForm.link', this.__generateForm).off('dblclick.link', this.__onDblClickOnLink).off(jodit.editor, 'click.link', this.__onClickReadOnlyLink).off('processPaste.link', this.onProcessPasteLink).off('input.link', this.__onTypedSpace).off('beforeEnter.link', this.__onBeforeEnter).off('afterEnter.link', this.__onAfterEnter).off('mousedown.link blur.link beforeCommand.link', this.__forgetLink).off('keydown', this.__onKeyDown);
48852
+ }
48853
+ },
48854
+ {
48855
+ key: "__onTypedSpace",
48856
+ value: function __onTypedSpace(event) {
48857
+ if (event.inputType !== 'insertText' || !event.data || /\S/.test(event.data)) {
48858
+ return;
48859
+ }
48860
+ var range = this.j.s.range;
48861
+ if (range.collapsed) {
48862
+ this.__linkTyped(range.startContainer, range.startOffset - event.data.length);
48863
+ }
48864
+ }
48865
+ },
48866
+ {
48867
+ key: "__onBeforeEnter",
48868
+ value: function __onBeforeEnter() {
48869
+ var range = this.j.s.range;
48870
+ this.__enteredAt = range.collapsed ? [
48871
+ range.startContainer,
48872
+ range.startOffset
48873
+ ] : null;
48874
+ }
48875
+ },
48876
+ {
48877
+ key: "__onAfterEnter",
48878
+ value: function __onAfterEnter() {
48879
+ if (this.__enteredAt) {
48880
+ this.__linkAfterEnter.apply(this, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_6__._)(this.__enteredAt));
48881
+ this.__enteredAt = null;
48882
+ }
48883
+ }
48884
+ },
48885
+ {
48886
+ key: "__forgetLink",
48887
+ value: function __forgetLink() {
48888
+ this.__justLinked = null;
48889
+ }
48890
+ },
48891
+ {
48892
+ key: "__onKeyDown",
48893
+ value: function __onKeyDown(event) {
48894
+ var jodit = this.jodit;
48895
+ if (jodit.o.readonly) {
48896
+ return;
48897
+ }
48898
+ var _$link = this.__justLinked;
48899
+ var modified = event.ctrlKey || event.metaKey || event.altKey;
48900
+ if (!MODIFIER_KEYS.has(event.key)) {
48901
+ this.__justLinked = null;
48902
+ }
48903
+ if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__.KEY_BACKSPACE && !modified && (_$link === null || _$link === void 0 ? void 0 : _$link.isConnected)) {
48904
+ this.__recordStep();
48905
+ jodit.s.save();
48906
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.unwrap(_$link);
48907
+ jodit.s.restore();
48908
+ this.__recordStep();
48909
+ // Or the backspace plugin takes a character too
48910
+ jodit.e.stopPropagation('keydown');
48911
+ return false;
48912
+ }
48913
+ var range = jodit.s.range;
48914
+ if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__.KEY_TAB && !modified && range.collapsed) {
48915
+ this.__linkTyped(range.startContainer, range.startOffset);
48916
+ }
48917
+ }
48918
+ },
48919
+ {
48920
+ key: "__linkTyped",
48921
+ value: /**
48922
+ * Links the address that ends at `end` in a text node, as a step of its
48923
+ * own in the history, so Undo straight after takes the link off and
48924
+ * leaves the text
48925
+ */ function __linkTyped(node, end) {
48926
+ var jodit = this.jodit;
48927
+ if (!jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isText(node) || !node.isConnected || end < 0 || end > node.length || jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(node, NO_TYPED_LINKS, jodit.editor)) {
48928
+ return;
48929
+ }
48930
+ var found = (0,_typed_link__WEBPACK_IMPORTED_MODULE_16__.findTypedLink)(node.data, end, jodit.o.link.typedLinkTlds, jodit.o.link.typedLinkFileEndings);
48931
+ if (!found) {
48932
+ return;
48933
+ }
48934
+ var _found = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(found, 3), start = _found[0], stop = _found[1], href = _found[2];
48935
+ this.__recordStep();
48936
+ // The text round the caret splits, and WebKit doesn't keep the caret
48937
+ // where it was
48938
+ jodit.s.save();
48939
+ var range = jodit.ed.createRange();
48940
+ range.setStart(node, start);
48941
+ range.setEnd(node, stop);
48942
+ var a = jodit.createInside.element('a');
48943
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'href', href);
48944
+ range.surroundContents(a);
48945
+ jodit.s.restore();
48946
+ jodit.e.fire('applyLink', jodit, a, null);
48947
+ this.__recordStep();
48948
+ this.__justLinked = a;
48949
+ }
48950
+ },
48951
+ {
48952
+ key: "__recordStep",
48953
+ value: /**
48954
+ * Reports what's changed and makes it a history step of its own
48955
+ */ function __recordStep() {
48956
+ this.j.setEditorValue();
48957
+ this.j.e.fire('internalChange');
48675
48958
  }
48676
48959
  },
48677
48960
  {
48678
48961
  key: "__onClickReadOnlyLink",
48679
48962
  value: function __onClickReadOnlyLink(e) {
48680
48963
  var jodit = this.jodit;
48681
- if (jodit.o.readonly && jodit.o.link.preventReadOnlyNavigation && jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__.Dom.isTag(e.target, 'a')) {
48964
+ if (jodit.o.readonly && jodit.o.link.preventReadOnlyNavigation && jodit_core_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isTag(e.target, 'a')) {
48682
48965
  e.preventDefault();
48683
48966
  }
48684
48967
  }
48685
48968
  }
48686
48969
  ]);
48687
48970
  return link;
48688
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__.Plugin));
48689
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
48690
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
48971
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_8__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_14__.Plugin));
48972
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48973
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48691
48974
  ], link.prototype, "__onDblClickOnLink", null);
48692
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
48693
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
48975
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48976
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48694
48977
  ], link.prototype, "onProcessPasteLink", null);
48695
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
48696
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
48978
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48979
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48697
48980
  ], link.prototype, "__generateForm", null);
48698
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
48699
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
48981
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48982
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48983
+ ], link.prototype, "__onTypedSpace", null);
48984
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48985
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48986
+ ], link.prototype, "__onBeforeEnter", null);
48987
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48988
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48989
+ ], link.prototype, "__onAfterEnter", null);
48990
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48991
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48992
+ ], link.prototype, "__forgetLink", null);
48993
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48994
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48995
+ ], link.prototype, "__onKeyDown", null);
48996
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
48997
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48998
+ ], link.prototype, "__linkTyped", null);
48999
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
49000
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_10__.autobind
48700
49001
  ], link.prototype, "__onClickReadOnlyLink", null);
48701
- jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('link', link);
49002
+ var NO_TYPED_LINKS = new Set([
49003
+ 'a',
49004
+ 'pre',
49005
+ 'code'
49006
+ ]);
49007
+ var MODIFIER_KEYS = new Set([
49008
+ 'Shift',
49009
+ 'Control',
49010
+ 'Alt',
49011
+ 'Meta',
49012
+ 'CapsLock'
49013
+ ]);
49014
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_12__.pluginSystem.add('link', link);
48702
49015
  /**
48703
49016
  * Guess a usable `href` from the selected text for the link dialog.
48704
49017
  * Returns an empty string when the text is not a plausible URL/email,
@@ -48713,7 +49026,7 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_9__.pluginSystem.add('link', link);
48713
49026
  return value;
48714
49027
  }
48715
49028
  // email address -> mailto:
48716
- if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
49029
+ if (_typed_link__WEBPACK_IMPORTED_MODULE_16__.EMAIL.test(value)) {
48717
49030
  return "mailto:".concat(value);
48718
49031
  }
48719
49032
  // bare domain like example.com or www.example.com/path -> https://
@@ -48726,14 +49039,14 @@ function writeClasses(modeClassName, className_input, className_select, a) {
48726
49039
  if (modeClassName && (className_input !== null && className_input !== void 0 ? className_input : className_select)) {
48727
49040
  if (modeClassName === 'input') {
48728
49041
  if (className_input.value === '' && a.hasAttribute('class')) {
48729
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'class', null);
49042
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'class', null);
48730
49043
  }
48731
49044
  if (className_input.value !== '') {
48732
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'class', className_input.value);
49045
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'class', className_input.value);
48733
49046
  }
48734
49047
  } else if (modeClassName === 'select') {
48735
49048
  if (a.hasAttribute('class')) {
48736
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(a, 'class', null);
49049
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(a, 'class', null);
48737
49050
  }
48738
49051
  for(var i = 0; i < className_select.selectedOptions.length; i++){
48739
49052
  var _className_select_selectedOptions_item;
@@ -48753,7 +49066,7 @@ function readClassnames(modeClassName, className_input, link, className_select)
48753
49066
  switch(modeClassName){
48754
49067
  case 'input':
48755
49068
  if (className_input) {
48756
- className_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(link, 'class') || '';
49069
+ className_input.value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(link, 'class') || '';
48757
49070
  }
48758
49071
  break;
48759
49072
  case 'select':
@@ -48764,7 +49077,7 @@ function readClassnames(modeClassName, className_input, link, className_select)
48764
49077
  option.selected = false;
48765
49078
  }
48766
49079
  }
48767
- var classNames = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.attr)(link, 'class') || '';
49080
+ var classNames = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(link, 'class') || '';
48768
49081
  classNames.split(/\s+/).filter(function(cn) {
48769
49082
  return cn.trim().length > 0;
48770
49083
  }).forEach(function(className) {
@@ -48898,6 +49211,141 @@ var formTemplate = function formTemplate(editor) {
48898
49211
  };
48899
49212
 
48900
49213
 
49214
+ /***/ }),
49215
+
49216
+ /***/ 4441:
49217
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
49218
+
49219
+ "use strict";
49220
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
49221
+ /* harmony export */ TLDS: function() { return /* binding */ TLDS; }
49222
+ /* harmony export */ });
49223
+ /*!
49224
+ * Jodit Editor (https://xdsoft.net/jodit/)
49225
+ * Released under MIT see LICENSE.txt in the project root for license information.
49226
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
49227
+ */ /**
49228
+ * @module plugins/link
49229
+ */ /**
49230
+ * The endings a bare domain links with, besides those `link.typedLinkTlds`
49231
+ * adds: the generic ones of at least 1 in 1,000 of the sites in Tranco's top
49232
+ * million (list GQ38K, https://tranco-list.eu/list/GQ38K), then every
49233
+ * two-letter one in IANA's list (version 2026102900,
49234
+ * https://data.iana.org/TLD/tlds-alpha-by-domain.txt). Together they're the
49235
+ * endings of 96% of those sites
49236
+ * @private
49237
+ */ var TLDS = new Set("\n app biz casino click cloud club com dev edu gov info live net online org pro\n shop site space store tech top vip xyz\n ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi\n bj bm bn bo br bs bt bv bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu\n cv cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga\n gb gd ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id\n ie il im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la\n lb lc li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms\n mt mu mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph\n pk pl pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sj sk\n sl sm sn so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt\n tv tw tz ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw\n".trim().split(/\s+/));
49238
+
49239
+
49240
+ /***/ }),
49241
+
49242
+ /***/ 99763:
49243
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
49244
+
49245
+ "use strict";
49246
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
49247
+ /* harmony export */ EMAIL: function() { return /* binding */ EMAIL; },
49248
+ /* harmony export */ findTypedLink: function() { return /* binding */ findTypedLink; }
49249
+ /* harmony export */ });
49250
+ /* harmony import */ var jodit_core_helpers_checker_is_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91764);
49251
+ /* harmony import */ var _tlds__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4441);
49252
+ /*!
49253
+ * Jodit Editor (https://xdsoft.net/jodit/)
49254
+ * Released under MIT see LICENSE.txt in the project root for license information.
49255
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
49256
+ */ /**
49257
+ * @module plugins/link
49258
+ */
49259
+
49260
+ /**
49261
+ * An email address, for `mailto:`
49262
+ * @private
49263
+ */ var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
49264
+ var OPENING = new Set([
49265
+ '(',
49266
+ '[',
49267
+ '"',
49268
+ "'",
49269
+ '“',
49270
+ '‘',
49271
+ '<'
49272
+ ]);
49273
+ var CLOSING = new Set([
49274
+ '.',
49275
+ ',',
49276
+ ';',
49277
+ ':',
49278
+ '!',
49279
+ '?',
49280
+ '"',
49281
+ "'",
49282
+ '”',
49283
+ '’',
49284
+ '>'
49285
+ ]);
49286
+ var BRACKETS = {
49287
+ ')': '(',
49288
+ ']': '['
49289
+ };
49290
+ var LABEL = /^[a-z\d][a-z\d-]{0,62}$/i;
49291
+ /**
49292
+ * The address that ends at `end` in a line of text typed, back to the
49293
+ * whitespace before it, as `[start, end, href]`. Punctuation round it, such as
49294
+ * a sentence's full stop or a bracket the address doesn't open, stays out.
49295
+ * An address counts with a scheme, with `www.`, as an email address, or as a
49296
+ * bare domain that `isBareDomain` accepts, so `Node.js` or `e.g.` don't
49297
+ * @private
49298
+ */ function findTypedLink(text, end, tlds, fileEndings) {
49299
+ var start = end;
49300
+ while(start > 0 && !/\s/.test(text[start - 1])){
49301
+ start -= 1;
49302
+ }
49303
+ while(start < end && OPENING.has(text[start])){
49304
+ start += 1;
49305
+ }
49306
+ while(end > start){
49307
+ var char = text[end - 1];
49308
+ var opening = BRACKETS[char];
49309
+ if (CLOSING.has(char) || opening && !text.slice(start, end - 1).includes(opening)) {
49310
+ end -= 1;
49311
+ } else {
49312
+ break;
49313
+ }
49314
+ }
49315
+ var href = typedLinkHref(text.slice(start, end), tlds, fileEndings);
49316
+ return href ? [
49317
+ start,
49318
+ end,
49319
+ href
49320
+ ] : null;
49321
+ }
49322
+ function typedLinkHref(address, tlds, fileEndings) {
49323
+ var email = address.replace(/^mailto:/i, '');
49324
+ if (EMAIL.test(email)) {
49325
+ return "mailto:".concat(email);
49326
+ }
49327
+ if (/^www\.[^\s.]+\.\S+$/i.test(address) || isBareDomain(address, tlds, fileEndings)) {
49328
+ return "https://".concat(address);
49329
+ }
49330
+ return /^[a-z][a-z\d+.-]*:\/\//i.test(address) && (0,jodit_core_helpers_checker_is_url__WEBPACK_IMPORTED_MODULE_0__.isURL)(address) ? address : '';
49331
+ }
49332
+ /**
49333
+ * A domain typed without a scheme or `www.`, as `example.com`, `elections.nz`
49334
+ * or `bit.ly/enrol`. Its ending has to be in `TLDS` or `tlds`, typed in lower
49335
+ * case, so `Node.js` and a sentence run on, as in `home.It`, don't count, and
49336
+ * not in `fileEndings`, as in `photos.zip`. The first part has a letter,
49337
+ * which leaves out a time or a numbered step such as `11.am`
49338
+ */ function isBareDomain(address, tlds, fileEndings) {
49339
+ var cut = address.search(/[/?#]/);
49340
+ var host = cut < 0 ? address : address.slice(0, cut);
49341
+ var labels = host.split('.');
49342
+ var ending = labels[labels.length - 1];
49343
+ return labels.length > 1 && labels.every(function(label) {
49344
+ return LABEL.test(label) && !label.endsWith('-');
49345
+ }) && (_tlds__WEBPACK_IMPORTED_MODULE_1__.TLDS.has(ending) || tlds.includes(ending)) && !fileEndings.includes(ending) && /[a-z]/i.test(labels[0]);
49346
+ }
49347
+
49348
+
48901
49349
  /***/ }),
48902
49350
 
48903
49351
  /***/ 51730:
@@ -51331,8 +51779,15 @@ var key = 'table_processor_observer-resize';
51331
51779
  }
51332
51780
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "hideTimeout", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "drag", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "wholeTable", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "workCell", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "workTable", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "minX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "maxX", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startX", 0), /**
51333
51781
  * The table's and its cells' styles as a column drag started, put back
51334
- * before each new width
51782
+ * as it ends, before the final widths
51335
51783
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startStyles", []), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startLeft", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startEdge", 0), /**
51784
+ * For each of the two columns a drag resizes, the cell whose width
51785
+ * `setColumnWidthByDelta` sets, with its width as the drag started, and
51786
+ * the cells below it, whose widths it clears
51787
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startWidths", []), /**
51788
+ * The table's width as the drag started, and for a drag of its edge, the
51789
+ * width inside what holds it and its margin on that side
51790
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startTableWidth", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startParentWidth", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startMargin", 0), /**
51336
51791
  * The row whose height the handle sets, or null while it sets a width
51337
51792
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "workRow", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startY", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "startHeight", 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "rowStyle", null), /**
51338
51793
  * The boxes that scroll the row, with their styles, as a row drag turns
@@ -51386,7 +51841,7 @@ var key = 'table_processor_observer-resize';
51386
51841
  * Click on resize handle
51387
51842
  */ function onHandleMouseDown(event) {
51388
51843
  var _this = this;
51389
- if (this.j.isLocked) {
51844
+ if (this.j.isLocked || this.j.o.readonly) {
51390
51845
  return;
51391
51846
  }
51392
51847
  this.drag = true;
@@ -51422,10 +51877,15 @@ var key = 'table_processor_observer-resize';
51422
51877
  var box;
51423
51878
  this.minX = 0;
51424
51879
  this.maxX = 1000000;
51880
+ this.startTableWidth = this.workTable.offsetWidth;
51425
51881
  if (this.wholeTable != null) {
51426
- var tableBox = this.workTable.parentNode.getBoundingClientRect();
51882
+ var parent = this.workTable.parentNode;
51883
+ var tableBox = parent.getBoundingClientRect();
51427
51884
  this.minX = tableBox.left;
51428
51885
  this.maxX = this.minX + tableBox.width;
51886
+ var side = this.isRTL ? 'marginRight' : 'marginLeft';
51887
+ this.startParentWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.getContentWidth)(parent, this.j.ew);
51888
+ this.startMargin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
51429
51889
  } else {
51430
51890
  // find maximum columns
51431
51891
  var coordinate = this.module.formalCoordinate(this.workTable, this.workCell, true);
@@ -51439,6 +51899,21 @@ var key = 'table_processor_observer-resize';
51439
51899
  _this.maxX = Math.min(box.left + box.width - jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__.NEARBY / 2, _this.maxX);
51440
51900
  }
51441
51901
  });
51902
+ var matrix = this.module.formalMatrix(this.workTable);
51903
+ this.startWidths = this.resizedColumns().map(function(column) {
51904
+ var cells = matrix.map(function(row) {
51905
+ return row[column];
51906
+ });
51907
+ var index = cells.findIndex(function(td) {
51908
+ return td.colSpan === 1 || cells.length === 1;
51909
+ });
51910
+ var cell = cells[index];
51911
+ return [
51912
+ cell,
51913
+ cell ? cell.offsetWidth : 0,
51914
+ cells.slice(Math.max(index, 0) + 1)
51915
+ ];
51916
+ });
51442
51917
  }
51443
51918
  return false;
51444
51919
  }
@@ -51470,8 +51945,11 @@ var key = 'table_processor_observer-resize';
51470
51945
  x = this.maxX;
51471
51946
  }
51472
51947
  this.resizeDelta = x - this.startX + (!this.j.o.iframe ? 0 : workplacePosition.left);
51473
- this.restoreStyles();
51474
- this.resizeColumnsOrTable();
51948
+ if (this.wholeTable == null) {
51949
+ this.setColumnWidths();
51950
+ } else {
51951
+ this.resizeTable();
51952
+ }
51475
51953
  var tableBox = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.offset)(this.workTable, this.j, this.j.ed);
51476
51954
  Object.assign(this.resizeHandler.style, {
51477
51955
  left: this.startLeft + this.columnEdge() - this.startEdge + 'px',
@@ -51610,6 +52088,19 @@ var key = 'table_processor_observer-resize';
51610
52088
  this.scrollFrame = this.j.async.requestAnimationFrame(scroll);
51611
52089
  }
51612
52090
  },
52091
+ {
52092
+ key: "resizedColumns",
52093
+ value: /**
52094
+ * The two columns a column drag resizes: the work cell's last, and the
52095
+ * next cell's first
52096
+ */ function resizedColumns() {
52097
+ var nextTD = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.call)(this.isRTL ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.prev : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.next, this.workCell, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isCell, this.workCell.parentNode);
52098
+ return [
52099
+ this.module.formalCoordinate(this.workTable, this.workCell, true)[1],
52100
+ this.module.formalCoordinate(this.workTable, nextTD)[1]
52101
+ ];
52102
+ }
52103
+ },
51613
52104
  {
51614
52105
  key: "resizeColumns",
51615
52106
  value: /**
@@ -51618,9 +52109,32 @@ var key = 'table_processor_observer-resize';
51618
52109
  var delta = this.resizeDelta;
51619
52110
  var marked = [];
51620
52111
  var tableModule = this.module;
51621
- tableModule.setColumnWidthByDelta(this.workTable, tableModule.formalCoordinate(this.workTable, this.workCell, true)[1], delta, true, marked);
51622
- var nextTD = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.call)(this.isRTL ? jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.prev : jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.next, this.workCell, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isCell, this.workCell.parentNode);
51623
- tableModule.setColumnWidthByDelta(this.workTable, tableModule.formalCoordinate(this.workTable, nextTD)[1], -delta, false, marked);
52112
+ var _this_resizedColumns = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(this.resizedColumns(), 2), column = _this_resizedColumns[0], nextColumn = _this_resizedColumns[1];
52113
+ tableModule.setColumnWidthByDelta(this.workTable, column, delta, true, marked);
52114
+ tableModule.setColumnWidthByDelta(this.workTable, nextColumn, -delta, false, marked);
52115
+ }
52116
+ },
52117
+ {
52118
+ key: "setColumnWidths",
52119
+ value: /**
52120
+ * Sets the widths `resizeColumns` would while the handle is dragged, from
52121
+ * the widths the drag started with, so that a move doesn't put back every
52122
+ * cell's style and lay the table out again to measure them
52123
+ */ function setColumnWidths() {
52124
+ var _this = this;
52125
+ this.startWidths.forEach(function(param, index) {
52126
+ var _param = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(param, 3), cell = _param[0], width = _param[1], below = _param[2];
52127
+ var delta = index ? -_this.resizeDelta : _this.resizeDelta;
52128
+ if (cell) {
52129
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(cell, 'width', ((width + delta) / _this.startTableWidth * 100).toFixed(jodit_core_constants__WEBPACK_IMPORTED_MODULE_9__.ACCURACY) + '%');
52130
+ }
52131
+ below.forEach(function(td) {
52132
+ td.style.removeProperty('width');
52133
+ if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(td, 'style')) {
52134
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.attr)(td, 'style', null);
52135
+ }
52136
+ });
52137
+ });
51624
52138
  }
51625
52139
  },
51626
52140
  {
@@ -51629,7 +52143,7 @@ var key = 'table_processor_observer-resize';
51629
52143
  * Resize whole table
51630
52144
  */ function resizeTable() {
51631
52145
  var delta = this.resizeDelta * (this.isRTL ? -1 : 1);
51632
- var width = this.workTable.offsetWidth, parentWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.getContentWidth)(this.workTable.parentNode, this.j.ew);
52146
+ var width = this.startTableWidth, parentWidth = this.startParentWidth;
51633
52147
  // for RTL use mirror logic
51634
52148
  var rightSide = !this.wholeTable;
51635
52149
  var needChangeWidth = this.isRTL ? !rightSide : rightSide;
@@ -51638,10 +52152,9 @@ var key = 'table_processor_observer-resize';
51638
52152
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(this.workTable, 'width', (width + delta) / parentWidth * 100 + '%');
51639
52153
  } else {
51640
52154
  var side = this.isRTL ? 'marginRight' : 'marginLeft';
51641
- var margin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
51642
52155
  (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(this.workTable, (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)({
51643
52156
  width: (width - delta) / parentWidth * 100 + '%'
51644
- }, side, (margin + delta) / parentWidth * 100 + '%'));
52157
+ }, side, (this.startMargin + delta) / parentWidth * 100 + '%'));
51645
52158
  }
51646
52159
  }
51647
52160
  },
@@ -51738,9 +52251,10 @@ var key = 'table_processor_observer-resize';
51738
52251
  if (!editor.o.tableAllowCellResize) {
51739
52252
  return;
51740
52253
  }
51741
- editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', function() {
52254
+ var observeTables = function observeTables() {
51742
52255
  ;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_13__.$$)('table', editor.editor).forEach(_this.observe);
51743
- }).on(this.j.ow, 'scroll.resize-cells', function() {
52256
+ };
52257
+ editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', observeTables).on(this.j.ow, 'scroll.resize-cells', function() {
51744
52258
  if (!_this.drag || _this.workRow) {
51745
52259
  return;
51746
52260
  }
@@ -51758,6 +52272,8 @@ var key = 'table_processor_observer-resize';
51758
52272
  tableModule.normalizeTable(jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.closest(td, 'table', editor.editor));
51759
52273
  });
51760
52274
  });
52275
+ // None of those events comes with the editor's starting value
52276
+ observeTables();
51761
52277
  }
51762
52278
  },
51763
52279
  {
@@ -51775,7 +52291,9 @@ var key = 'table_processor_observer-resize';
51775
52291
  _this.hideResizeHandle();
51776
52292
  }
51777
52293
  }).on(table, 'mousemove.resize-cells touchmove.resize-cells', this.j.async.throttle(function(event) {
51778
- if (_this.j.isLocked) {
52294
+ // A drag from a cell isn't a resize, and the handle on
52295
+ // a border it passes would take its moves (#1778)
52296
+ if (_this.j.isLocked || _this.j.o.readonly || event.buttons) {
51779
52297
  return;
51780
52298
  }
51781
52299
  var cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.up(event.target, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_11__.Dom.isCell, table);
@@ -54060,7 +54578,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelecti
54060
54578
 
54061
54579
 
54062
54580
  var key = 'table_processor_observer';
54063
- var MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
54064
54581
  var selectCells = /*#__PURE__*/ function(Plugin) {
54065
54582
  "use strict";
54066
54583
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(selectCells, Plugin);
@@ -54075,7 +54592,12 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54075
54592
  * First selected cell
54076
54593
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__selectedCell", null), /**
54077
54594
  * User is selecting cells now
54078
- */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isSelectionMode", false);
54595
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__isSelectionMode", false), /**
54596
+ * The cell the marks were last drawn to
54597
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__movedTo", null), /**
54598
+ * A drag let go outside the table ends in a click on the editor, which
54599
+ * would unmark its cells
54600
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__keepMarks", false);
54079
54601
  return _this;
54080
54602
  }
54081
54603
  ;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(selectCells, [
@@ -54098,6 +54620,8 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54098
54620
  // move the caret, as table-keyboard-navigation's do
54099
54621
  .on('keydown', this.__onKeyDown, {
54100
54622
  top: true
54623
+ }).on('clickEditor', this.__onClickAfterDrag, {
54624
+ top: true
54101
54625
  }).on('keydown.select-cells', function(event) {
54102
54626
  if (event.key === jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__.KEY_TAB) {
54103
54627
  _this.unselectCells();
@@ -54243,12 +54767,15 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54243
54767
  }
54244
54768
  this.__isSelectionMode = true;
54245
54769
  this.__selectedCell = cell;
54770
+ this.__movedTo = cell;
54246
54771
  this.__tableModule.addSelection(cell);
54247
- this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells', // Don't use decorator because need clear label on mouseup
54248
- this.j.async.throttle(this.__onMove.bind(this, table), {
54249
- label: MOUSE_MOVE_LABEL,
54250
- timeout: this.j.defaultTimeout / 2
54251
- })).on(table, 'mouseup.select-cells touchend.select-cells', this.__onStopSelection.bind(this, table));
54772
+ this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells', this.__onMove.bind(this, table)).on(table, 'mouseup.select-cells touchend.select-cells', this.__onStopSelection.bind(this, table));
54773
+ new Set([
54774
+ this.j.ew,
54775
+ this.j.ow
54776
+ ]).forEach(function(win) {
54777
+ return _this.j.e.on(win, 'mouseup.select-cells touchend.select-cells', _this.__onRelease.bind(_this, table));
54778
+ });
54252
54779
  return false;
54253
54780
  }
54254
54781
  },
@@ -54259,6 +54786,29 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54259
54786
  this.__onRemoveSelection();
54260
54787
  }
54261
54788
  },
54789
+ {
54790
+ key: "onMouseDown",
54791
+ value: function onMouseDown() {
54792
+ this.__keepMarks = false;
54793
+ }
54794
+ },
54795
+ {
54796
+ key: "__onClickAfterDrag",
54797
+ value: /**
54798
+ * The click that ends a drag let go outside the table, and inside the
54799
+ * editor, lands on the editor. Taken on, it would unmark the cells and
54800
+ * close their popup. As for the click on a row after a drag over the
54801
+ * cells, the browser's own selection from the drag goes
54802
+ */ function __onClickAfterDrag() {
54803
+ if (this.__keepMarks) {
54804
+ var _this_j_s_sel;
54805
+ this.__keepMarks = false;
54806
+ (_this_j_s_sel = this.j.s.sel) === null || _this_j_s_sel === void 0 ? void 0 : _this_j_s_sel.removeAllRanges();
54807
+ this.j.e.stopPropagation('clickEditor');
54808
+ return false;
54809
+ }
54810
+ }
54811
+ },
54262
54812
  {
54263
54813
  key: "onChange",
54264
54814
  value: function onChange() {
@@ -54282,16 +54832,20 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54282
54832
  // Inside Shadow DOM `document.elementFromPoint` returns the shadow
54283
54833
  // host, so the lookup must start from the shadow root
54284
54834
  var node = ((_this_j_o_shadowRoot = this.j.o.shadowRoot) !== null && _this_j_o_shadowRoot !== void 0 ? _this_j_o_shadowRoot : this.j.ed).elementFromPoint(e.clientX, e.clientY);
54285
- if (!node) {
54286
- return;
54287
- }
54288
- var cell = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(node, [
54835
+ var cell = node && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.closest(node, [
54289
54836
  'td',
54290
54837
  'th'
54291
54838
  ], table);
54292
54839
  if (!cell || !this.__selectedCell) {
54293
54840
  return;
54294
54841
  }
54842
+ // The marks change only when the mouse goes into another cell, and then
54843
+ // at once rather than throttled, as the browser's own selection from
54844
+ // the drag shows in the cells between until they do (#1778)
54845
+ if (cell === this.__movedTo) {
54846
+ return;
54847
+ }
54848
+ this.__movedTo = cell;
54295
54849
  if (cell !== this.__selectedCell) {
54296
54850
  this.j.lock(key);
54297
54851
  }
@@ -54335,9 +54889,7 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54335
54889
  value: /**
54336
54890
  * Stop a selection process
54337
54891
  */ function __onStopSelection(table, e) {
54338
- var _this = this;
54339
54892
  var _this_j_o_shadowRoot;
54340
- var _box_bound__, _box_bound__1;
54341
54893
  if (!this.__selectedCell) {
54342
54894
  return;
54343
54895
  }
@@ -54360,10 +54912,40 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54360
54912
  if (ownTable && ownTable !== table) {
54361
54913
  return; // Nested tables
54362
54914
  }
54363
- var bound = this.__tableModule.getSelectedBound(table, [
54915
+ this.__showCellsPopup(table, [
54364
54916
  cell,
54365
54917
  this.__selectedCell
54366
- ]), box = this.__tableModule.formalMatrix(table);
54918
+ ]);
54919
+ this.__stopListening();
54920
+ }
54921
+ },
54922
+ {
54923
+ key: "__onRelease",
54924
+ value: /**
54925
+ * A drag let go outside the table doesn't reach the table's `mouseup`, so
54926
+ * the window's ends it, leaving the cells marked as they were (#1774)
54927
+ */ function __onRelease(table, e) {
54928
+ if (this.__isSelectionMode) {
54929
+ this.__isSelectionMode = false;
54930
+ if (!this.j.isLockedNotBy(key)) {
54931
+ this.j.unlock();
54932
+ }
54933
+ var cells = this.__tableModule.getAllSelectedCells();
54934
+ // One let go outside the editor clicks outside it, which unmarks them
54935
+ if (cells.length > 1 && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.isOrContains(this.j.editor, e.target)) {
54936
+ this.__keepMarks = true;
54937
+ this.__showCellsPopup(table, cells);
54938
+ }
54939
+ }
54940
+ this.__stopListening();
54941
+ }
54942
+ },
54943
+ {
54944
+ key: "__showCellsPopup",
54945
+ value: function __showCellsPopup(table, cells) {
54946
+ var _this = this;
54947
+ var _box_bound__, _box_bound__1;
54948
+ var bound = this.__tableModule.getSelectedBound(table, cells), box = this.__tableModule.formalMatrix(table);
54367
54949
  var max = (_box_bound__ = box[bound[1][0]]) === null || _box_bound__ === void 0 ? void 0 : _box_bound__[bound[1][1]], min = (_box_bound__1 = box[bound[0][0]]) === null || _box_bound__1 === void 0 ? void 0 : _box_bound__1[bound[0][1]];
54368
54950
  // `getSelectedBound` keeps its `Infinity` sentinel when none of the
54369
54951
  // selected cells belong to this table's matrix — e.g. after a
@@ -54383,10 +54965,22 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54383
54965
  height: maxOffset.top - minOffset.top + maxOffset.height
54384
54966
  };
54385
54967
  }, 'cells');
54968
+ }
54969
+ },
54970
+ {
54971
+ key: "__stopListening",
54972
+ value: function __stopListening() {
54973
+ var _this = this;
54386
54974
  (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_12__.$$)('table', this.j.editor).forEach(function(table) {
54387
54975
  _this.j.e.off(table, 'mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells');
54388
54976
  });
54389
- this.j.async.clearTimeout(MOUSE_MOVE_LABEL);
54977
+ new Set([
54978
+ this.j.ew,
54979
+ this.j.ow
54980
+ ]).forEach(function(win) {
54981
+ return _this.j.e.off(win, 'mouseup.select-cells touchend.select-cells');
54982
+ });
54983
+ this.__movedTo = null;
54390
54984
  }
54391
54985
  },
54392
54986
  {
@@ -54589,7 +55183,8 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54589
55183
  key: "beforeDestruct",
54590
55184
  value: /** @override */ function beforeDestruct(jodit) {
54591
55185
  this.__onRemoveSelection();
54592
- jodit.e.off('.select-cells').off('keydown', this.__onKeyDown);
55186
+ this.__stopListening();
55187
+ jodit.e.off('.select-cells').off('keydown', this.__onKeyDown).off('clickEditor', this.__onClickAfterDrag);
54593
55188
  }
54594
55189
  }
54595
55190
  ]);
@@ -54610,6 +55205,15 @@ var selectCells = /*#__PURE__*/ function(Plugin) {
54610
55205
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
54611
55206
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':outsideClick')
54612
55207
  ], selectCells.prototype, "onOutsideClick", null);
55208
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
55209
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)([
55210
+ ':mousedown',
55211
+ ':touchstart'
55212
+ ])
55213
+ ], selectCells.prototype, "onMouseDown", null);
55214
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
55215
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.autobind
55216
+ ], selectCells.prototype, "__onClickAfterDrag", null);
54613
55217
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
54614
55218
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__.watch)(':change')
54615
55219
  ], selectCells.prototype, "onChange", null);
@@ -54666,10 +55270,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54666
55270
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
54667
55271
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23211);
54668
55272
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(28077);
54669
- /* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(57821);
54670
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(91206);
54671
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4099);
54672
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(47670);
55273
+ /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(88475);
55274
+ /* harmony import */ var jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(57821);
55275
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(91206);
55276
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(4099);
55277
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(47670);
54673
55278
  /*!
54674
55279
  * Jodit Editor (https://xdsoft.net/jodit/)
54675
55280
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -54693,6 +55298,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54693
55298
 
54694
55299
 
54695
55300
 
55301
+
54696
55302
  /**
54697
55303
  * A utility plugin that allows you to subscribe to a click/mousedown/touchstart/mouseup on an element in DOM order
54698
55304
  *
@@ -54719,7 +55325,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54719
55325
  * Where the last press started. Chrome reports a drag that begins in one
54720
55326
  * element and ends in another as a `click` on their common ancestor, so a
54721
55327
  * press inside a popup is remembered to tell such a drag from a real click.
54722
- */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__pressTarget", null);
55328
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__pressTarget", null), /**
55329
+ * The row a press to its right was beside, and the caret it put there,
55330
+ * while the button is down
55331
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__pressBesideRow", null);
54723
55332
  return _this;
54724
55333
  }
54725
55334
  ;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(select, [
@@ -54730,6 +55339,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54730
55339
  this.proxyEventsList.forEach(function(eventName) {
54731
55340
  jodit.e.on(eventName + '.select', _this.onStartSelection);
54732
55341
  });
55342
+ jodit.e.on('dblclick', this.__onDblClickBesideRow, {
55343
+ top: true
55344
+ });
54733
55345
  }
54734
55346
  },
54735
55347
  {
@@ -54737,8 +55349,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54737
55349
  value: function beforeDestruct(jodit) {
54738
55350
  var _this = this;
54739
55351
  this.proxyEventsList.forEach(function(eventName) {
54740
- jodit.e.on(eventName + '.select', _this.onStartSelection);
55352
+ jodit.e.off(eventName + '.select', _this.onStartSelection);
54741
55353
  });
55354
+ this.__endPressBesideRow();
55355
+ jodit.e.off('dblclick', this.__onDblClickBesideRow);
54742
55356
  }
54743
55357
  },
54744
55358
  {
@@ -54747,7 +55361,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54747
55361
  var j = this.j;
54748
55362
  var result, target = e.target;
54749
55363
  while(result === undefined && target && target !== j.editor){
54750
- result = j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_11__.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e);
55364
+ result = j.e.fire((0,jodit_core_helpers_string_camel_case__WEBPACK_IMPORTED_MODULE_12__.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e);
54751
55365
  target = target.parentElement;
54752
55366
  }
54753
55367
  if (e.type === 'click' && result === undefined && target === j.editor) {
@@ -54776,10 +55390,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54776
55390
  }
54777
55391
  // Selecting the text of a popup input with the mouse and releasing
54778
55392
  // the button past the popup's edge is not a click outside of it.
54779
- if (pressed && jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.UIElement.closestElement(pressed, jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.Popup)) {
55393
+ if (pressed && jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.UIElement.closestElement(pressed, jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.Popup)) {
54780
55394
  return;
54781
55395
  }
54782
- var box = jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.UIElement.closestElement(node, jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.Popup);
55396
+ var box = jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.UIElement.closestElement(node, jodit_core_ui__WEBPACK_IMPORTED_MODULE_14__.Popup);
54783
55397
  if (!box) {
54784
55398
  this.j.e.fire('outsideClick', e);
54785
55399
  }
@@ -54837,6 +55451,161 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54837
55451
  }
54838
55452
  }
54839
55453
  },
55454
+ {
55455
+ key: "__rowBeside",
55456
+ value: /**
55457
+ * The table row the mouse is to the right of
55458
+ */ function __rowBeside(e) {
55459
+ var _rows_find;
55460
+ var j = this.j;
55461
+ var target = e.target;
55462
+ if (j.o.readonly || e.button !== 0 || e.detail > 2 || !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isHTMLElement(target) || jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.closest(target, jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isCell, j.editor)) {
55463
+ return null;
55464
+ }
55465
+ var table = (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__.toArray)(target.children).find(function(elm) {
55466
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(elm, 'table')) {
55467
+ return false;
55468
+ }
55469
+ var box = elm.getBoundingClientRect();
55470
+ return e.clientX >= box.right && e.clientY >= box.top && e.clientY < box.bottom;
55471
+ });
55472
+ var rows = table ? (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__.toArray)(table.rows).filter(function(row) {
55473
+ return row.cells.length;
55474
+ }) : [];
55475
+ if (!table || !rows.length) {
55476
+ return null;
55477
+ }
55478
+ var row = (_rows_find = rows.find(function(row) {
55479
+ return e.clientY < row.getBoundingClientRect().bottom;
55480
+ })) !== null && _rows_find !== void 0 ? _rows_find : rows[rows.length - 1];
55481
+ return {
55482
+ table: table,
55483
+ row: row
55484
+ };
55485
+ }
55486
+ },
55487
+ {
55488
+ key: "onMouseDownBesideTableRow",
55489
+ value: /**
55490
+ * A press to the right of a table row puts the caret where Word's typing
55491
+ * goes from there: the start of the next row's first cell, or of the block
55492
+ * after the table for the last row (#1770). The browsers put it after the
55493
+ * table, whichever row it's beside, so typing starts a new line below it.
55494
+ * Their own press is stopped, as its drag would start after the table and
55495
+ * take in the rows below first
55496
+ */ function onMouseDownBesideTableRow(e) {
55497
+ var _this = this;
55498
+ var j = this.j;
55499
+ var beside = this.__rowBeside(e);
55500
+ if (!beside) {
55501
+ return;
55502
+ }
55503
+ // A press before the last one was let go must not stack its listeners
55504
+ this.__endPressBesideRow();
55505
+ e.preventDefault();
55506
+ this.__putCaretBesideRow(beside.table, beside.row);
55507
+ this.__pressBesideRow = {
55508
+ row: beside.row,
55509
+ caret: j.s.range.cloneRange()
55510
+ };
55511
+ j.e.on(j.ew, 'mousemove', this.__onDragFromRow);
55512
+ new Set([
55513
+ j.ew,
55514
+ j.ow
55515
+ ]).forEach(function(win) {
55516
+ return j.e.on(win, 'mouseup', _this.__onReleaseFromRow);
55517
+ });
55518
+ }
55519
+ },
55520
+ {
55521
+ key: "__onDragFromRow",
55522
+ value: /**
55523
+ * A drag from beside a row selects from the end of the row to the mouse,
55524
+ * and back beside the row it's the caret again
55525
+ */ function __onDragFromRow(e) {
55526
+ var _this___rowBeside;
55527
+ var s = this.j.s;
55528
+ var press = this.__pressBesideRow;
55529
+ if (!press || !(e.buttons & 1)) {
55530
+ this.__endPressBesideRow();
55531
+ return;
55532
+ }
55533
+ if (((_this___rowBeside = this.__rowBeside(e)) === null || _this___rowBeside === void 0 ? void 0 : _this___rowBeside.row) === press.row) {
55534
+ if (!s.isCollapsed()) {
55535
+ s.selectRange(press.caret.cloneRange());
55536
+ }
55537
+ return;
55538
+ }
55539
+ var cells = press.row.cells;
55540
+ var last = cells[cells.length - 1];
55541
+ if (s.insertCursorAtPoint(e.clientX, e.clientY)) {
55542
+ var _s_sel;
55543
+ var _s_range = s.range, startContainer = _s_range.startContainer, startOffset = _s_range.startOffset;
55544
+ (_s_sel = s.sel) === null || _s_sel === void 0 ? void 0 : _s_sel.setBaseAndExtent(last, last.childNodes.length, startContainer, startOffset);
55545
+ }
55546
+ }
55547
+ },
55548
+ {
55549
+ key: "__onReleaseFromRow",
55550
+ value: /**
55551
+ * In iframe mode, a press in an editor without the focus puts the caret at
55552
+ * its end, so a release that selected nothing puts it back
55553
+ */ function __onReleaseFromRow() {
55554
+ var press = this.__pressBesideRow;
55555
+ this.__endPressBesideRow();
55556
+ if (press && this.j.s.isCollapsed()) {
55557
+ this.j.s.selectRange(press.caret);
55558
+ }
55559
+ }
55560
+ },
55561
+ {
55562
+ key: "__endPressBesideRow",
55563
+ value: function __endPressBesideRow() {
55564
+ var _this = this;
55565
+ var j = this.j;
55566
+ this.__pressBesideRow = null;
55567
+ j.e.off(j.ew, 'mousemove', this.__onDragFromRow);
55568
+ new Set([
55569
+ j.ew,
55570
+ j.ow
55571
+ ]).forEach(function(win) {
55572
+ return j.e.off(win, 'mouseup', _this.__onReleaseFromRow);
55573
+ });
55574
+ }
55575
+ },
55576
+ {
55577
+ key: "__onDblClickBesideRow",
55578
+ value: /**
55579
+ * A double click beside a row is two clicks there, so add-new-line,
55580
+ * which adds a line on a double click with a caret, doesn't see it
55581
+ */ function __onDblClickBesideRow(e) {
55582
+ if (this.__rowBeside(e)) {
55583
+ this.j.e.stopPropagation('dblclick');
55584
+ return false;
55585
+ }
55586
+ }
55587
+ },
55588
+ {
55589
+ key: "__putCaretBesideRow",
55590
+ value: function __putCaretBesideRow(table, row) {
55591
+ var j = this.j;
55592
+ var rows = (0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__.toArray)(table.rows);
55593
+ var next = rows.slice(rows.indexOf(row) + 1).find(function(row) {
55594
+ return row.cells.length;
55595
+ });
55596
+ var after = table.nextSibling;
55597
+ while(after && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isEmptyTextNode(after)){
55598
+ after = after.nextSibling;
55599
+ }
55600
+ if (next) {
55601
+ j.s.setCursorIn(next.cells[0], true);
55602
+ } else if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isBlock(after) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isTag(after, 'table') && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.isContentEditable(after, j.editor)) {
55603
+ j.s.setCursorIn(after, true);
55604
+ } else {
55605
+ j.s.setCursorAfter(table);
55606
+ }
55607
+ }
55608
+ },
54840
55609
  {
54841
55610
  key: "onClickKeepPendingFormat",
54842
55611
  value: /**
@@ -54900,7 +55669,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54900
55669
  }
54901
55670
  ]);
54902
55671
  return select;
54903
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_12__.Plugin));
55672
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_13__.Plugin));
54904
55673
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
54905
55674
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
54906
55675
  ], select.prototype, "onStartSelection", null);
@@ -54928,6 +55697,18 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
54928
55697
  ':click'
54929
55698
  ])
54930
55699
  ], select.prototype, "onClickRightOfNestedListItem", null);
55700
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
55701
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)(':mousedown')
55702
+ ], select.prototype, "onMouseDownBesideTableRow", null);
55703
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
55704
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
55705
+ ], select.prototype, "__onDragFromRow", null);
55706
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
55707
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
55708
+ ], select.prototype, "__onReleaseFromRow", null);
55709
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
55710
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
55711
+ ], select.prototype, "__onDblClickBesideRow", null);
54931
55712
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
54932
55713
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)([
54933
55714
  ':click'