jodit 4.12.21 → 4.12.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +8 -8
  4. package/es2015/jodit.js +155 -36
  5. package/es2015/jodit.min.js +8 -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 +8 -8
  13. package/es2018/jodit.min.js +24 -24
  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 +9 -9
  18. package/es2021/jodit.js +154 -35
  19. package/es2021/jodit.min.js +22 -22
  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 +9 -9
  28. package/es2021.en/jodit.js +153 -34
  29. package/es2021.en/jodit.min.js +11 -11
  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 +164 -36
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/dom/dom.js +6 -4
  52. package/esm/langs/tr.js +1 -1
  53. package/esm/modules/dialog/dialog.d.ts +5 -0
  54. package/esm/modules/dialog/dialog.js +25 -2
  55. package/esm/plugins/clean-html/clean-html.js +8 -2
  56. package/esm/plugins/clean-html/helpers/visitor/filters/allow-attributes.js +9 -2
  57. package/esm/plugins/clipboard/clipboard.js +29 -1
  58. package/esm/plugins/inline-popup/inline-popup.d.ts +8 -0
  59. package/esm/plugins/inline-popup/inline-popup.js +43 -2
  60. package/esm/plugins/limit/limit.js +7 -1
  61. package/esm/plugins/paste/paste.d.ts +1 -1
  62. package/esm/plugins/paste/paste.js +7 -5
  63. package/esm/plugins/resize-handler/resize-handler.js +13 -2
  64. package/esm/plugins/resizer/resizer.js +5 -1
  65. package/esm/plugins/source/source.js +9 -0
  66. package/package.json +1 -1
  67. package/types/modules/dialog/dialog.d.ts +5 -0
  68. package/types/plugins/inline-popup/inline-popup.d.ts +8 -0
  69. package/types/plugins/paste/paste.d.ts +1 -1
package/es5/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.21
4
+ * Version: v4.12.22
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2066,7 +2066,7 @@ __webpack_require__.r(__webpack_exports__);
2066
2066
  * @packageDocumentation
2067
2067
  * @module constants
2068
2068
  */
2069
- var APP_VERSION = "4.12.21";
2069
+ var APP_VERSION = "4.12.22";
2070
2070
  // prettier-ignore
2071
2071
  var ES = "es5";
2072
2072
  var IS_ES_MODERN = false;
@@ -3694,12 +3694,12 @@ function wait(condition) {
3694
3694
  value: /**
3695
3695
  * Check if element is element node
3696
3696
  */ function isElement(node) {
3697
- var _node_ownerDocument;
3698
3697
  if (!Dom.isNode(node)) {
3699
3698
  return false;
3700
3699
  }
3701
- var win = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;
3702
- return Boolean(win && node.nodeType === Node.ELEMENT_NODE);
3700
+ // no `defaultView` requirement nodes of an inert document
3701
+ // (`DOMParser`, `implementation.createHTMLDocument`) are still elements
3702
+ return node.nodeType === Node.ELEMENT_NODE;
3703
3703
  }
3704
3704
  },
3705
3705
  {
@@ -3724,8 +3724,10 @@ function wait(condition) {
3724
3724
  if (!Dom.isNode(node)) {
3725
3725
  return false;
3726
3726
  }
3727
+ // an inert document has no browsing context (`defaultView` is null),
3728
+ // but its nodes are same-realm HTMLElements
3727
3729
  var win = (_node_ownerDocument = node.ownerDocument) === null || _node_ownerDocument === void 0 ? void 0 : _node_ownerDocument.defaultView;
3728
- return Boolean(win && (0,_swc_helpers_instanceof__WEBPACK_IMPORTED_MODULE_2__._)(node, win.HTMLElement));
3730
+ return (0,_swc_helpers_instanceof__WEBPACK_IMPORTED_MODULE_2__._)(node, win ? win.HTMLElement : HTMLElement);
3729
3731
  }
3730
3732
  },
3731
3733
  {
@@ -22347,6 +22349,12 @@ var Dialog = /*#__PURE__*/ function(ViewWithToolbar) {
22347
22349
  if (_this.options && _this.o.resizable && !_this.moved && _this.isOpened && !_this.offsetX && !_this.offsetY) {
22348
22350
  _this.setPosition();
22349
22351
  }
22352
+ }), /**
22353
+ * Minimal size the dialog can be resized to — the header and the footer
22354
+ * (with its buttons) must always stay inside the panel
22355
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "minSize", {
22356
+ w: 0,
22357
+ h: 0
22350
22358
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "dialog", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "workplace", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "dialogbox_header", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "dialogbox_content", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "dialogbox_footer", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "dialogbox_toolbar", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "isModal", false), /**
22351
22359
  * True, if dialog was opened
22352
22360
  */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "isOpened", false);
@@ -22511,7 +22519,7 @@ var Dialog = /*#__PURE__*/ function(ViewWithToolbar) {
22511
22519
  e.stopImmediatePropagation();
22512
22520
  }
22513
22521
  if (this.resizable && this.o.resizable) {
22514
- this.setSize(this.startPoint.w + e.clientX - this.startX, this.startPoint.h + e.clientY - this.startY);
22522
+ this.setSize(Math.max(this.startPoint.w + e.clientX - this.startX, this.minSize.w), Math.max(this.startPoint.h + e.clientY - this.startY, this.minSize.h));
22515
22523
  if (this.e) {
22516
22524
  /**
22517
22525
  * Fired when dialog box is resized
@@ -22540,11 +22548,20 @@ var Dialog = /*#__PURE__*/ function(ViewWithToolbar) {
22540
22548
  {
22541
22549
  key: "__onResizerMouseDown",
22542
22550
  value: function __onResizerMouseDown(e) {
22551
+ var _ref, _ref1, _ref2;
22543
22552
  this.resizable = true;
22544
22553
  this.startX = e.clientX;
22545
22554
  this.startY = e.clientY;
22546
22555
  this.startPoint.w = this.dialog.offsetWidth;
22547
22556
  this.startPoint.h = this.dialog.offsetHeight;
22557
+ var header = this.getElm('header');
22558
+ var footer = this.getElm('footer');
22559
+ var content = this.getElm('content');
22560
+ // the content area does not shrink below its CSS `min-height`,
22561
+ // so it is part of the smallest height the panel can take
22562
+ var contentMinHeight = content ? parseFloat(this.ow.getComputedStyle(content).minHeight) || 0 : 0;
22563
+ this.minSize.w = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_16__.isNumber)(this.o.minWidth) ? this.o.minWidth : Math.max(100, (_ref = footer === null || footer === void 0 ? void 0 : footer.scrollWidth) !== null && _ref !== void 0 ? _ref : 0);
22564
+ this.minSize.h = (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_16__.isNumber)(this.o.minHeight) ? this.o.minHeight : ((_ref1 = header === null || header === void 0 ? void 0 : header.offsetHeight) !== null && _ref1 !== void 0 ? _ref1 : 0) + ((_ref2 = footer === null || footer === void 0 ? void 0 : footer.offsetHeight) !== null && _ref2 !== void 0 ? _ref2 : 0) + contentMinHeight + this.resizer.offsetHeight;
22548
22565
  this.lockSelect();
22549
22566
  this.__addGlobalResizeListeners();
22550
22567
  if (this.e) {
@@ -32874,10 +32891,14 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_10__.Icon.set('class-span', (_class_
32874
32891
  * Event handler when manually assigning a value to the HTML editor.
32875
32892
  */ function onBeforeSetNativeEditorValue(data) {
32876
32893
  var _ref = (0,_swc_helpers_sliced_to_array__WEBPACK_IMPORTED_MODULE_5__._)(this.j.o.cleanHTML.useIframeSandbox ? this.j.createInside.sandbox() : [
32877
- this.j.createInside.div()
32894
+ // an inert document never loads sub-resources, so the
32895
+ // images in the value are not re-requested from the
32896
+ // server on every assignment (e.g. on each change in
32897
+ // jodit-react). See #1237
32898
+ this.j.od.implementation.createHTMLDocument('').body
32878
32899
  ], 2), sandBox = _ref[0], iframe = _ref[1];
32879
32900
  sandBox.innerHTML = data.value;
32880
- this.onSafeHTML(sandBox);
32901
+ this.j.e.fire('safeHTML', sandBox);
32881
32902
  data.value = sandBox.innerHTML;
32882
32903
  (0,jodit_core_helpers_html_safe_html__WEBPACK_IMPORTED_MODULE_12__.safeHTML)(sandBox, {
32883
32904
  safeJavaScriptLink: true,
@@ -33213,12 +33234,19 @@ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_0__.Icon.set('eraser', (_eraser_svg_
33213
33234
  /**
33214
33235
  * @private
33215
33236
  */ function allowAttributes(jodit, nodeElm, hadEffect, allow) {
33216
- if (allow && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(nodeElm) && allow[nodeElm.nodeName] !== true) {
33237
+ var allowedForTag = allow && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(nodeElm) && allow[nodeElm.nodeName];
33238
+ if (allow && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_0__.Dom.isElement(nodeElm) && allowedForTag !== true) {
33239
+ // the tag is not in the allow list at all — attributes do not matter,
33240
+ // the element itself will be removed by the tags filter. Without this
33241
+ // check `allow[nodeName][attr]` threw on e.g. `<meta charset>`. See #1224
33242
+ if (!allowedForTag) {
33243
+ return hadEffect;
33244
+ }
33217
33245
  var attrs = nodeElm.attributes;
33218
33246
  if (attrs && attrs.length) {
33219
33247
  var removeAttrs = [];
33220
33248
  for(var i = 0; i < attrs.length; i += 1){
33221
- var attr = allow[nodeElm.nodeName][attrs[i].name];
33249
+ var attr = allowedForTag[attrs[i].name];
33222
33250
  if (!attr || attr !== true && attr !== attrs[i].value) {
33223
33251
  removeAttrs.push(attrs[i].name);
33224
33252
  }
@@ -33851,9 +33879,10 @@ var keys = Object.keys(_filters__WEBPACK_IMPORTED_MODULE_1__);
33851
33879
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25045);
33852
33880
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81937);
33853
33881
  /* harmony import */ var jodit_core_decorators_cache_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(51676);
33854
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28077);
33855
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(65946);
33856
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81008);
33882
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23211);
33883
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28077);
33884
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(65946);
33885
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81008);
33857
33886
  /*!
33858
33887
  * Jodit Editor (https://xdsoft.net/jodit/)
33859
33888
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -33870,6 +33899,7 @@ var keys = Object.keys(_filters__WEBPACK_IMPORTED_MODULE_1__);
33870
33899
 
33871
33900
 
33872
33901
 
33902
+
33873
33903
  /**
33874
33904
  * Clipboard plugin - cut and copy functionality
33875
33905
  */ var clipboard = /*#__PURE__*/ function() {
@@ -33906,10 +33936,10 @@ var keys = Object.keys(_filters__WEBPACK_IMPORTED_MODULE_1__);
33906
33936
  });
33907
33937
  editor.e.off("copy.".concat(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.CLIPBOARD_ID, " cut.").concat(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.CLIPBOARD_ID)).on("copy.".concat(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.CLIPBOARD_ID, " cut.").concat(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.CLIPBOARD_ID), function(event) {
33908
33938
  var _editor_events;
33909
- var selectedText = editor.s.html;
33910
- var clipboardData = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getDataTransfer)(event) || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getDataTransfer)(editor.ew) || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.getDataTransfer)(event.originalEvent);
33939
+ var selectedText = wrapWithInlineAncestors(editor, editor.s.html);
33940
+ var clipboardData = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.getDataTransfer)(event) || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.getDataTransfer)(editor.ew) || (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.getDataTransfer)(event.originalEvent);
33911
33941
  if (clipboardData) {
33912
- clipboardData.setData(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_PLAIN, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.stripTags)(selectedText));
33942
+ clipboardData.setData(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_PLAIN, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_7__.stripTags)(selectedText));
33913
33943
  clipboardData.setData(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.TEXT_HTML, selectedText);
33914
33944
  }
33915
33945
  editor.buffer.set(jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__.CLIPBOARD_ID, selectedText);
@@ -33937,7 +33967,30 @@ var keys = Object.keys(_filters__WEBPACK_IMPORTED_MODULE_1__);
33937
33967
  ]);
33938
33968
  return clipboard;
33939
33969
  }();
33940
- jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.pluginSystem.add('clipboard', clipboard);
33970
+ /**
33971
+ * `Selection.html` clones only the range contents — when the selection sits
33972
+ * entirely inside the text of a formatted element (`<strong>te|st|</strong>`),
33973
+ * the clone is bare text and the formatting would be lost on paste. Native
33974
+ * browser copy keeps that context, so the interception must restore it: wrap
33975
+ * the fragment in shallow clones of the inline ancestors of the range. See #1202
33976
+ */ function wrapWithInlineAncestors(editor, html) {
33977
+ if (!html || editor.s.isCollapsed()) {
33978
+ return html;
33979
+ }
33980
+ var node = editor.s.range.commonAncestorContainer;
33981
+ if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isElement(node)) {
33982
+ node = node.parentElement;
33983
+ }
33984
+ var result = html;
33985
+ while(node && node !== editor.editor && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isElement(node) && !jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__.Dom.isBlock(node)){
33986
+ var shell = node.cloneNode(false);
33987
+ shell.innerHTML = result;
33988
+ result = shell.outerHTML;
33989
+ node = node.parentElement;
33990
+ }
33991
+ return result;
33992
+ }
33993
+ jodit_core_global__WEBPACK_IMPORTED_MODULE_6__.pluginSystem.add('clipboard', clipboard);
33941
33994
 
33942
33995
 
33943
33996
  /***/ }),
@@ -40491,7 +40544,11 @@ var align = {
40491
40544
  function inlinePopup() {
40492
40545
  (0,_swc_helpers_class_call_check__WEBPACK_IMPORTED_MODULE_1__._)(this, inlinePopup);
40493
40546
  var _this;
40494
- _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, inlinePopup, arguments), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "type", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "previousTarget", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.keys)(_this.j.o.popup, false).filter(function(s) {
40547
+ _this = (0,_swc_helpers_call_super__WEBPACK_IMPORTED_MODULE_0__._)(this, inlinePopup, arguments), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "type", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "previousTarget", void 0), /**
40548
+ * The user pressed a button inside the selection toolbar — after the
40549
+ * command fires `closeAllPopups`, the toolbar should be shown again
40550
+ * while the selection is still there. See #1238
40551
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__reopenSelectionPopup", false), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "snapRange", null), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "elmsList", (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.keys)(_this.j.o.popup, false).filter(function(s) {
40495
40552
  return !_this.isExcludedTarget(s);
40496
40553
  }));
40497
40554
  return _this;
@@ -40620,10 +40677,44 @@ var align = {
40620
40677
  }).on([
40621
40678
  this.j.ew,
40622
40679
  this.j.ow
40623
- ], 'mouseup keyup', this.onSelectionEnd);
40680
+ ], 'mouseup keyup', this.onSelectionEnd).on([
40681
+ this.j.ew,
40682
+ this.j.ow
40683
+ ], 'mousedown touchstart', this.__onDocumentMouseDown).on('closeAllPopups', this.__onCloseAllPopups);
40624
40684
  this.addListenersForElements();
40625
40685
  }
40626
40686
  },
40687
+ {
40688
+ key: "__onDocumentMouseDown",
40689
+ value: function __onDocumentMouseDown(e) {
40690
+ if (this.popup.isOpened && this.type === 'selection' && e.target && jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__.UIElement.closestElement(e.target, jodit_core_ui_popup__WEBPACK_IMPORTED_MODULE_13__.Popup)) {
40691
+ this.__reopenSelectionPopup = true;
40692
+ }
40693
+ }
40694
+ },
40695
+ {
40696
+ key: "__onCloseAllPopups",
40697
+ value: function __onCloseAllPopups() {
40698
+ var _this = this;
40699
+ if (!this.__reopenSelectionPopup) {
40700
+ return;
40701
+ }
40702
+ this.__reopenSelectionPopup = false;
40703
+ if (!this.j.o.toolbarInlineForSelection) {
40704
+ return;
40705
+ }
40706
+ // a zero timeout would run synchronously — before the popup's own
40707
+ // `closeAllPopups` handler closes it; defer to the next macrotask
40708
+ this.j.async.setTimeout(function() {
40709
+ var sel = _this.j.s.sel;
40710
+ if (sel && !sel.isCollapsed) {
40711
+ _this.showPopup(function() {
40712
+ return _this.j.s.range.getBoundingClientRect();
40713
+ }, 'selection');
40714
+ }
40715
+ }, 1);
40716
+ }
40717
+ },
40627
40718
  {
40628
40719
  key: "onSelectionStart",
40629
40720
  value: function onSelectionStart() {
@@ -40688,7 +40779,10 @@ var align = {
40688
40779
  jodit.e.off('showPopup').off([
40689
40780
  this.j.ew,
40690
40781
  this.j.ow
40691
- ], 'mouseup keyup', this.onSelectionEnd);
40782
+ ], 'mouseup keyup', this.onSelectionEnd).off([
40783
+ this.j.ew,
40784
+ this.j.ow
40785
+ ], 'mousedown touchstart', this.__onDocumentMouseDown).off('closeAllPopups', this.__onCloseAllPopups);
40692
40786
  this.removeListenersForElements();
40693
40787
  }
40694
40788
  },
@@ -40761,6 +40855,12 @@ var align = {
40761
40855
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
40762
40856
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.watch)(':outsideClick')
40763
40857
  ], inlinePopup.prototype, "onOutsideClick", null);
40858
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
40859
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
40860
+ ], inlinePopup.prototype, "__onDocumentMouseDown", null);
40861
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
40862
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
40863
+ ], inlinePopup.prototype, "__onCloseAllPopups", null);
40764
40864
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
40765
40865
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__.autobind
40766
40866
  ], inlinePopup.prototype, "onSelectionStart", null);
@@ -41103,7 +41203,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.limitHTML = false;
41103
41203
  jodit.e.fire('denyWords.limit limit.limit');
41104
41204
  return true;
41105
41205
  }
41106
- var should = Boolean(limitChars && isGt(words.join('').length, limitChars, strict));
41206
+ // with `countTextSpaces` enabled the limiter counts characters the
41207
+ // same way as the `stat` plugin's counter — including spaces. See #1144
41208
+ var charsCount = jodit.o.countTextSpaces ? text.replace((0,jodit_core_constants__WEBPACK_IMPORTED_MODULE_6__.INVISIBLE_SPACE_REG_EXP)(), '').replace(/[\r\n]/g, '').length : words.join('').length;
41209
+ var should = Boolean(limitChars && isGt(charsCount, limitChars, strict));
41107
41210
  if (should) {
41108
41211
  jodit.e.fire('denyChars.limit limit.limit');
41109
41212
  }
@@ -43533,9 +43636,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
43533
43636
  jodit.e.on('paste.paste', this.onPaste).on('pasteStack.paste', function(item) {
43534
43637
  return _this.pasteStack.push(item);
43535
43638
  });
43536
- if (jodit.o.nl2brInPlainText) {
43537
- this.j.e.on('processPaste.paste', this.onProcessPasteReplaceNl2Br);
43538
- }
43639
+ this.j.e.on('processPaste.paste', this.onProcessPasteReplaceNl2Br);
43539
43640
  }
43540
43641
  },
43541
43642
  {
@@ -43696,10 +43797,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.paste = {
43696
43797
  {
43697
43798
  key: "onProcessPasteReplaceNl2Br",
43698
43799
  value: /**
43699
- * Replace all \\n chars in plain text to br
43800
+ * Escape plain text and replace all \\n chars with br
43700
43801
  */ function onProcessPasteReplaceNl2Br(ignore, text, type) {
43701
43802
  if (type === jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.TEXT_PLAIN + ';' && !(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.isHTML)(text)) {
43702
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.nl2br)(text);
43803
+ // the clipboard contains only plain text — escape special chars
43804
+ // so a stray `<` is not parsed as an unclosed tag and does not
43805
+ // swallow the rest of the string. See #1227
43806
+ var escaped = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.htmlspecialchars)(text);
43807
+ return this.j.o.nl2brInPlainText ? (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.nl2br)(escaped) : escaped;
43703
43808
  }
43704
43809
  }
43705
43810
  }
@@ -44720,9 +44825,10 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.allowResizeY = true;
44720
44825
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(84839);
44721
44826
  /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27795);
44722
44827
  /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28077);
44723
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91206);
44724
- /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(4099);
44725
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(58293);
44828
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(65946);
44829
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(91206);
44830
+ /* harmony import */ var jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4099);
44831
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58293);
44726
44832
  /*!
44727
44833
  * Jodit Editor (https://xdsoft.net/jodit/)
44728
44834
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -44744,6 +44850,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.allowResizeY = true;
44744
44850
 
44745
44851
 
44746
44852
 
44853
+
44747
44854
  var resizeHandler = /*#__PURE__*/ function(Plugin) {
44748
44855
  "use strict";
44749
44856
  (0,_swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__._)(resizeHandler, Plugin);
@@ -44761,7 +44868,7 @@ var resizeHandler = /*#__PURE__*/ function(Plugin) {
44761
44868
  h: 0
44762
44869
  }), /**
44763
44870
  * Resize handle
44764
- */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "handle", _this.j.c.div('jodit-editor__resize', jodit_core_ui__WEBPACK_IMPORTED_MODULE_11__.Icon.get('resize_handler')));
44871
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "handle", _this.j.c.div('jodit-editor__resize', jodit_core_ui__WEBPACK_IMPORTED_MODULE_12__.Icon.get('resize_handler')));
44765
44872
  return _this;
44766
44873
  }
44767
44874
  (0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(resizeHandler, [
@@ -44807,11 +44914,21 @@ var resizeHandler = /*#__PURE__*/ function(Plugin) {
44807
44914
  if (!this.isResized) {
44808
44915
  return;
44809
44916
  }
44917
+ var clientX = e.clientX, clientY = e.clientY;
44918
+ if (e.view === this.j.ew && this.j.ew !== this.j.ow) {
44919
+ // the event was proxied from the editor's iframe — its client
44920
+ // coordinates are relative to the iframe viewport, while the
44921
+ // start point was captured on the host-document handle;
44922
+ // shift them into the host coordinate space
44923
+ var workplacePosition = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.offset)(this.j.workplace, this.j, this.j.od, true);
44924
+ clientX += workplacePosition.left;
44925
+ clientY += workplacePosition.top;
44926
+ }
44810
44927
  if (this.j.o.allowResizeY) {
44811
- this.j.e.fire('setHeight', this.start.h + e.clientY - this.start.y);
44928
+ this.j.e.fire('setHeight', this.start.h + clientY - this.start.y);
44812
44929
  }
44813
44930
  if (this.j.o.allowResizeX) {
44814
- this.j.e.fire('setWidth', this.start.w + e.clientX - this.start.x);
44931
+ this.j.e.fire('setWidth', this.start.w + clientX - this.start.x);
44815
44932
  }
44816
44933
  this.j.e.fire('resize');
44817
44934
  }
@@ -44837,7 +44954,7 @@ var resizeHandler = /*#__PURE__*/ function(Plugin) {
44837
44954
  }
44838
44955
  ]);
44839
44956
  return resizeHandler;
44840
- }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_5__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_10__.Plugin));
44957
+ }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_5__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__.Plugin));
44841
44958
  /** @override **/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(resizeHandler, "requires", [
44842
44959
  'size'
44843
44960
  ]);
@@ -45098,7 +45215,11 @@ var keyBInd = '__jodit-resizer_binded';
45098
45215
  this.pointerX = e.clientX;
45099
45216
  this.pointerY = e.clientY;
45100
45217
  var diff_x, diff_y;
45101
- if (this.j.options.iframe) {
45218
+ if (this.j.options.iframe && e.view === this.j.ew) {
45219
+ // the event was proxied from the editor's iframe — its client
45220
+ // coordinates are relative to the iframe viewport, while
45221
+ // `startX/startY` were captured on a host-document handle;
45222
+ // shift them into the host coordinate space
45102
45223
  var workplacePosition = this.getWorkplacePosition();
45103
45224
  diff_x = e.clientX + workplacePosition.left - this.startX;
45104
45225
  diff_y = e.clientY + workplacePosition.top - this.startY;
@@ -48478,6 +48599,13 @@ var SourceEditor = /*#__PURE__*/ function() {
48478
48599
  key: "setFocusToMirror",
48479
48600
  value: function setFocusToMirror() {
48480
48601
  var _this_sourceEditor;
48602
+ var active = this.j.od.activeElement;
48603
+ // do not steal focus from another editor or control — e.g. when the
48604
+ // mode is switched programmatically (a Vue/React wrapper re-render)
48605
+ // while the user is already typing elsewhere. See #1356
48606
+ if (active && active !== this.j.od.body && !this.j.container.contains(active)) {
48607
+ return;
48608
+ }
48481
48609
  (_this_sourceEditor = this.sourceEditor) === null || _this_sourceEditor === void 0 ? void 0 : _this_sourceEditor.focus();
48482
48610
  }
48483
48611
  },
@@ -51723,7 +51851,7 @@ module.exports["default"] = ["Напишите что-либо","О Jodit","Ре
51723
51851
  /***/ 68368:
51724
51852
  /***/ (function(module) {
51725
51853
 
51726
- module.exports["default"] = ["Bir şeyler yaz","Jodit Hakkında","Jodit Editor","Jodit Kullanım Kılavuzu","kullanım için detaylı bilgiler içerir","Lisans hakkında bilgi için lütfen web sitemize gidin:","Tam versiyonunu satın al","Copyright © XDSoft.net - Chupurnov Valeriy. Tüm hakları saklıdır.","Bağlantı","Yeni sekmede aç","Editörü tam ekranda aç","Stili temizle","Renk doldur veya yazı rengi seç","Yinele","Geri Al","Kalın","İtalik","Sırasız Liste Ekle","Sıralı Liste Ekle","Ortala","Kenarlara Yasla","Sola Yasla","Sağa Yasla","Yatay Çizgi Ekle","Resim Ekle","Dosya Ekle","Youtube/Vimeo Videosu Ekle","Bağlantı Ekle","Font Boyutu","Font Ailesi","Blok Ekle","Normal","Başlık 1","Başlık 2","Başlık 3","Başlık 4","Alıntı","Kod","Ekle","Tablo Ekle","Girintiyi Azalt","Girintiyi Arttır","Özel Karakter Seç","Özel Karakter Ekle","Resim Biçimi","Mod Değiştir","Boşluklar","Üst","Sağ","Alt","Sol","CSS Stilleri","CSS Sınıfları","Hizalama","Sağ","Ortalı","Sol","Belirsiz","Kaynak","Başlık","Alternatif Yazı","Link","Bağlantıyı yeni sekmede aç","Resim","Dosya","Gelişmiş","Resim özellikleri","İptal","Tamam","Dosya Listeleyici","Liste yüklenirken hata oluştu","Klasörler yüklenirken hata oluştur","Emin misiniz?","Dizin yolu giriniz","Dizin oluştur","İsim yaz","Resim bırak","Dosya bırak","veya tıkla","Alternatif yazı","Yükle","Gözat","Arka plan","Yazı","Üst","Orta","Aşağı","Öncesine kolon ekle","Sonrasına kolon ekle","Üstüne satır ekle","Altına satır ekle","Tabloyu sil","Satırı sil","Kolonu sil","Hücreyi temizle","Harfler: %d","Kelimeler: %d","Üstü çizili","Alt çizgi","Üst yazı","Alt yazı","Seçilimi kes","Tümünü seç","Satır sonu","Ara","Şununla değiştir","Değiştir","Yapıştır","Yapıştırılacak içerik seç","Kaynak","Kalın","italik","Fırça","Bağlantı","Geri al","Yinele","Tablo","Resim","Silgi","Paragraf","Font boyutu","Video","Font","Hakkında","Yazdır","Alt çizgi","Üstü çizili","Girinti","Çıkıntı","Tam ekran","Küçült","Ayraç","Sırasız liste","Sıralı liste","Kes","Tümünü seç","Kod ekle","Bağlantıyı aç","Bağlantıyı düzenle","Nofollow özelliği","Bağlantıyı kaldır","Güncelle","Düzenlemek için","Yorumu","URL","Düzenle","Yatay hizala","Filtre","Değişime göre sırala","İsme göre sırala","Boyuta göre sırala","Klasör ekle","Sıfırla","Kaydet","Farklı kaydet","Boyutlandır","Kırp","Genişlik","Yükseklik","En boy oranını koru","Evet","Hayır","Sil","Seç","Seç: %s","Dikey hizala","Ayır","Birleştir","Kolon ekle","Satır ekle","Lisans: %s","Sil","Dikey ayır","Yatay ayır","Kenarlık","Kodunuz HTML koduna benziyor. HTML olarak devam etmek ister misiniz?","HTML olarak yapıştır","Sakla","Yazı olarak ekle","Sadece yazıyı ekle","Sadece kendi resimlerinizi düzenleyebilirsiniz. Bu görseli kendi hostunuza indirmek ister misiniz?","Görsel başarıyla hostunuza yüklendi","Palet","Bu dizinde dosya yok","Yeniden isimlendir","Yeni isim girin","Ön izleme","İndir","Panodan yapıştır ","Tarayıcınız panoya doğrudan erişimi desteklemiyor.","Seçimi kopyala","Kopyala","Sınır yarıçapı","Tümünü Göster","Uygula","Lütfen bu alanı doldurun","Lütfen bir web adresi girin","Varsayılan","Daire","Nokta","Kare","Bul","Öncekini Bul","Sonrakini Bul","Der Inhalt, den Sie einfügen, stammt aus einem Microsoft Word / Excel-Dokument. Möchten Sie das Format erhalten oder löschen?","Word biçiminde yapıştırma algılandı","Temizle","Sınıf adı girin","Özel yeniden boyutlandırma için Alt tuşuna basın",null,null,null,"Tümü"]
51854
+ module.exports["default"] = ["Bir şeyler yaz","Jodit Hakkında","Jodit Editor","Jodit Kullanım Kılavuzu","kullanım için detaylı bilgiler içerir","Lisans hakkında bilgi için lütfen web sitemize gidin:","Tam versiyonunu satın al","Copyright © XDSoft.net - Chupurnov Valeriy. Tüm hakları saklıdır.","Bağlantı","Yeni sekmede aç","Editörü tam ekranda aç","Stili temizle","Renk doldur veya yazı rengi seç","Yinele","Geri Al","Kalın","İtalik","Sırasız Liste Ekle","Sıralı Liste Ekle","Ortala","Kenarlara Yasla","Sola Yasla","Sağa Yasla","Yatay Çizgi Ekle","Resim Ekle","Dosya Ekle","Youtube/Vimeo Videosu Ekle","Bağlantı Ekle","Font Boyutu","Font Ailesi","Blok Ekle","Normal","Başlık 1","Başlık 2","Başlık 3","Başlık 4","Alıntı","Kod","Ekle","Tablo Ekle","Girintiyi Azalt","Girintiyi Arttır","Özel Karakter Seç","Özel Karakter Ekle","Resim Biçimi","Mod Değiştir","Boşluklar","Üst","Sağ","Alt","Sol","CSS Stilleri","CSS Sınıfları","Hizalama","Sağ","Ortalı","Sol","Belirsiz","Kaynak","Başlık","Alternatif Yazı","Link","Bağlantıyı yeni sekmede aç","Resim","Dosya","Gelişmiş","Resim özellikleri","İptal","Tamam","Dosya Listeleyici","Liste yüklenirken hata oluştu","Klasörler yüklenirken hata oluştur","Emin misiniz?","Dizin yolu giriniz","Dizin oluştur","İsim yaz","Resim bırak","Dosya bırak","veya tıkla","Alternatif yazı","Yükle","Gözat","Arka plan","Yazı","Üst","Orta","Aşağı","Öncesine kolon ekle","Sonrasına kolon ekle","Üstüne satır ekle","Altına satır ekle","Tabloyu sil","Satırı sil","Kolonu sil","Hücreyi temizle","Harfler: %d","Kelimeler: %d","Üstü çizili","Alt çizgi","Üst yazı","Alt yazı","Seçilimi kes","Tümünü seç","Satır sonu","Ara","Şununla değiştir","Değiştir","Yapıştır","Yapıştırılacak içerik seç","Kaynak","Kalın","italik","Fırça","Bağlantı","Geri al","Yinele","Tablo","Resim","Silgi","Paragraf","Font boyutu","Video","Font","Hakkında","Yazdır","Alt çizgi","Üstü çizili","Girinti","Çıkıntı","Tam ekran","Küçült","Ayraç","Sırasız liste","Sıralı liste","Kes","Tümünü seç","Kod ekle","Bağlantıyı aç","Bağlantıyı düzenle","Nofollow özelliği","Bağlantıyı kaldır","Güncelle","Düzenlemek için","Yorumu","URL","Düzenle","Yatay hizala","Filtre","Değişime göre sırala","İsme göre sırala","Boyuta göre sırala","Klasör ekle","Sıfırla","Kaydet","Farklı kaydet","Boyutlandır","Kırp","Genişlik","Yükseklik","En boy oranını koru","Evet","Hayır","Sil","Seç","Seç: %s","Dikey hizala","Ayır","Birleştir","Kolon ekle","Satır ekle","Lisans: %s","Sil","Dikey ayır","Yatay ayır","Kenarlık","Kodunuz HTML koduna benziyor. HTML olarak devam etmek ister misiniz?","HTML olarak yapıştır","Sakla","Yazı olarak ekle","Sadece yazıyı ekle","Sadece kendi resimlerinizi düzenleyebilirsiniz. Bu görseli kendi hostunuza indirmek ister misiniz?","Görsel başarıyla hostunuza yüklendi","Palet","Bu dizinde dosya yok","Yeniden isimlendir","Yeni isim girin","Ön izleme","İndir","Panodan yapıştır ","Tarayıcınız panoya doğrudan erişimi desteklemiyor.","Seçimi kopyala","Kopyala","Sınır yarıçapı","Tümünü Göster","Uygula","Lütfen bu alanı doldurun","Lütfen bir web adresi girin","Varsayılan","Daire","Nokta","Kare","Bul","Öncekini Bul","Sonrakini Bul","Yapıştırılan içerik bir Microsoft Word/Excel belgesinden geliyor. Formatı korumak yoksa temizlemek mi istiyorsunuz?","Word biçiminde yapıştırma algılandı","Temizle","Sınıf adı girin","Özel yeniden boyutlandırma için Alt tuşuna basın",null,null,null,"Tümü"]
51727
51855
 
51728
51856
  /***/ }),
51729
51857
 
package/es5/jodit.min.css CHANGED
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.12.21
4
+ * Version: v4.12.22
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
11
- * Version: v4.12.21
11
+ * Version: v4.12.22
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */