jodit 4.17.4 → 4.17.5

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 (57) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +3 -3
  4. package/es2015/jodit.js +47 -4
  5. package/es2015/jodit.min.js +3 -3
  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 +3 -3
  13. package/es2018/jodit.min.js +3 -3
  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 +4 -4
  18. package/es2021/jodit.js +43 -4
  19. package/es2021/jodit.min.js +4 -4
  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 +4 -4
  28. package/es2021.en/jodit.js +43 -4
  29. package/es2021.en/jodit.min.js +4 -4
  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 +53 -4
  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/selection/selection.d.ts +5 -0
  52. package/esm/core/selection/selection.js +25 -0
  53. package/esm/plugins/select/select.d.ts +7 -0
  54. package/esm/plugins/select/select.js +19 -1
  55. package/package.json +1 -1
  56. package/types/core/selection/selection.d.ts +5 -0
  57. package/types/plugins/select/select.d.ts +7 -0
package/es5/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.17.4
4
+ * Version: v4.17.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -2129,7 +2129,7 @@ __webpack_require__.r(__webpack_exports__);
2129
2129
  * @packageDocumentation
2130
2130
  * @module constants
2131
2131
  */
2132
- var APP_VERSION = "4.17.4";
2132
+ var APP_VERSION = "4.17.5";
2133
2133
  // prettier-ignore
2134
2134
  var ES = "es5";
2135
2135
  var IS_ES_MODERN = false;
@@ -12464,6 +12464,23 @@ var Selection = /*#__PURE__*/ function() {
12464
12464
  });
12465
12465
  }
12466
12466
  },
12467
+ {
12468
+ key: "__nativeRangeCount",
12469
+ value: /**
12470
+ * How many ranges the browser's own selection holds right now, as opposed
12471
+ * to the composed view that [[sel]] may answer from.
12472
+ */ function __nativeRangeCount() {
12473
+ var _ref;
12474
+ var _this_win_getSelection;
12475
+ var shadowRoot = this.j.o.shadowRoot;
12476
+ if (shadowRoot && (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_12__.isFunction)(shadowRoot.getSelection)) {
12477
+ var _ref1;
12478
+ var _shadowRoot_getSelection;
12479
+ return (_ref1 = (_shadowRoot_getSelection = shadowRoot.getSelection()) === null || _shadowRoot_getSelection === void 0 ? void 0 : _shadowRoot_getSelection.rangeCount) !== null && _ref1 !== void 0 ? _ref1 : 0;
12480
+ }
12481
+ return (_ref = (_this_win_getSelection = this.win.getSelection()) === null || _this_win_getSelection === void 0 ? void 0 : _this_win_getSelection.rangeCount) !== null && _ref !== void 0 ? _ref : 0;
12482
+ }
12483
+ },
12467
12484
  {
12468
12485
  key: "range",
12469
12486
  get: /**
@@ -13465,6 +13482,16 @@ var Selection = /*#__PURE__*/ function() {
13465
13482
  if (backward && ranges.length === 1) {
13466
13483
  var range = ranges[0];
13467
13484
  sel.setBaseAndExtent(range.endContainer, range.endOffset, range.startContainer, range.startOffset);
13485
+ } else if (ranges.length === 1 && !this.__nativeRangeCount() && (0,jodit_core_helpers_checker__WEBPACK_IMPORTED_MODULE_12__.isFunction)(sel.setBaseAndExtent)) {
13486
+ // `addRange` is specified to ignore a range whose root is not
13487
+ // the document, which is every range inside a shadow tree.
13488
+ // Chrome's `ShadowRoot.getSelection()` takes them anyway, but
13489
+ // Safari has only the window selection, so after
13490
+ // `removeAllRanges` the caret is simply gone: a character was
13491
+ // deleted and nothing was left to type into. `setBaseAndExtent`
13492
+ // does accept nodes inside a shadow tree.
13493
+ var range1 = ranges[0];
13494
+ sel.setBaseAndExtent(range1.startContainer, range1.startOffset, range1.endContainer, range1.endOffset);
13468
13495
  }
13469
13496
  }
13470
13497
  /**
@@ -49790,7 +49817,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
49790
49817
  'touchstart',
49791
49818
  'mouseup',
49792
49819
  'touchend'
49793
- ]);
49820
+ ]), /**
49821
+ * Where the last press started. Chrome reports a drag that begins in one
49822
+ * element and ends in another as a `click` on their common ancestor, so a
49823
+ * press inside a popup is remembered to tell such a drag from a real click.
49824
+ */ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "__pressTarget", null);
49794
49825
  return _this;
49795
49826
  }
49796
49827
  ;(0,_swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__._)(select, [
@@ -49826,18 +49857,30 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
49826
49857
  }
49827
49858
  }
49828
49859
  },
49860
+ {
49861
+ key: "onOutsidePress",
49862
+ value: function onOutsidePress(e) {
49863
+ this.__pressTarget = e.target;
49864
+ }
49865
+ },
49829
49866
  {
49830
49867
  key: "onOutsideClick",
49831
49868
  value: /**
49832
49869
  * @event outsideClick(e) - when user clicked on the outside of editor
49833
49870
  */ function onOutsideClick(e) {
49834
49871
  var _this = this;
49835
- var node = e.target;
49872
+ var node = e.target, pressed = this.__pressTarget;
49873
+ this.__pressTarget = null;
49836
49874
  if (jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_9__.Dom.up(node, function(elm) {
49837
49875
  return elm === _this.j.editor;
49838
49876
  })) {
49839
49877
  return;
49840
49878
  }
49879
+ // Selecting the text of a popup input with the mouse and releasing
49880
+ // the button past the popup's edge is not a click outside of it.
49881
+ if (pressed && jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.UIElement.closestElement(pressed, jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.Popup)) {
49882
+ return;
49883
+ }
49841
49884
  var box = jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.UIElement.closestElement(node, jodit_core_ui__WEBPACK_IMPORTED_MODULE_13__.Popup);
49842
49885
  if (!box) {
49843
49886
  this.j.e.fire('outsideClick', e);
@@ -49963,6 +50006,12 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
49963
50006
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
49964
50007
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
49965
50008
  ], select.prototype, "onStartSelection", null);
50009
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
50010
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)([
50011
+ 'ow:mousedown',
50012
+ 'ow:touchstart'
50013
+ ])
50014
+ ], select.prototype, "onOutsidePress", null);
49966
50015
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
49967
50016
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.watch)('ow:click')
49968
50017
  ], select.prototype, "onOutsideClick", null);
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.17.4
4
+ * Version: v4.17.5
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.17.4
11
+ * Version: v4.17.5
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */