jodit 4.0.2 → 4.0.3

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 (53) hide show
  1. package/es2015/jodit.css +1 -1
  2. package/es2015/jodit.fat.min.js +2 -2
  3. package/es2015/jodit.js +25 -17
  4. package/es2015/jodit.min.js +2 -2
  5. package/es2015/plugins/debug/debug.js +1 -1
  6. package/es2015/plugins/debug/debug.min.js +1 -1
  7. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  8. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  10. package/es2018/jodit.css +1 -1
  11. package/es2018/jodit.fat.min.js +2 -2
  12. package/es2018/jodit.js +25 -17
  13. package/es2018/jodit.min.js +2 -2
  14. package/es2018/plugins/debug/debug.js +1 -1
  15. package/es2018/plugins/debug/debug.min.js +1 -1
  16. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  17. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  19. package/es2021/jodit.css +1 -1
  20. package/es2021/jodit.fat.min.js +2 -2
  21. package/es2021/jodit.js +25 -17
  22. package/es2021/jodit.min.js +2 -2
  23. package/es2021/plugins/debug/debug.js +1 -1
  24. package/es2021/plugins/debug/debug.min.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  26. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  27. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  28. package/es2021.en/jodit.css +1 -1
  29. package/es2021.en/jodit.fat.min.js +2 -2
  30. package/es2021.en/jodit.js +25 -17
  31. package/es2021.en/jodit.min.js +2 -2
  32. package/es2021.en/plugins/debug/debug.js +1 -1
  33. package/es2021.en/plugins/debug/debug.min.js +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  37. package/es5/jodit.css +2 -2
  38. package/es5/jodit.fat.min.js +2 -2
  39. package/es5/jodit.js +25 -17
  40. package/es5/jodit.min.css +2 -2
  41. package/es5/jodit.min.js +2 -2
  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/esm/core/constants.js +1 -1
  48. package/esm/core/selection/selection.js +5 -1
  49. package/esm/jodit.js +6 -12
  50. package/esm/plugins/select/select.d.ts +2 -1
  51. package/esm/plugins/select/select.js +12 -2
  52. package/package.json +1 -1
  53. package/types/plugins/select/select.d.ts +2 -1
package/es5/jodit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.2
4
+ * Version: v4.0.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -3084,7 +3084,7 @@ __webpack_require__.r(__webpack_exports__);
3084
3084
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
3085
3085
  */
3086
3086
 
3087
- var APP_VERSION = "4.0.2";
3087
+ var APP_VERSION = "4.0.3";
3088
3088
  // prettier-ignore
3089
3089
  var ES = "es5";
3090
3090
  var IS_ES_MODERN = false;
@@ -12856,7 +12856,8 @@ var Selection = /** @class */ (function () {
12856
12856
  if (this.isCollapsed()) {
12857
12857
  return this;
12858
12858
  }
12859
- var range = this.range, c = range.cloneRange();
12859
+ var range = this.range;
12860
+ var c = range.cloneRange();
12860
12861
  if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isOrContains(this.j.editor, range.commonAncestorContainer, true)) {
12861
12862
  return this;
12862
12863
  }
@@ -12904,6 +12905,9 @@ var Selection = /** @class */ (function () {
12904
12905
  }
12905
12906
  this.selectRange(c);
12906
12907
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.safeRemove(leftFake, rightFake);
12908
+ if (this.isCollapsed()) {
12909
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Selection is collapsed');
12910
+ }
12907
12911
  return this;
12908
12912
  };
12909
12913
  (0,tslib__WEBPACK_IMPORTED_MODULE_8__/* .__decorate */ .gn)([
@@ -18915,18 +18919,12 @@ var Jodit = /** @class */ (function (_super) {
18915
18919
  }
18916
18920
  if (result !== false) {
18917
18921
  this.s.focus();
18918
- if (command === 'selectall') {
18919
- this.s.select(this.editor, true);
18920
- this.s.expandSelection();
18922
+ try {
18923
+ result = this.nativeExecCommand(command, showUI, value);
18921
18924
  }
18922
- else {
18923
- try {
18924
- result = this.nativeExecCommand(command, showUI, value);
18925
- }
18926
- catch (e) {
18927
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
18928
- throw e;
18929
- }
18925
+ catch (e) {
18926
+ if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
18927
+ throw e;
18930
18928
  }
18931
18929
  }
18932
18930
  }
@@ -18937,7 +18935,7 @@ var Jodit = /** @class */ (function (_super) {
18937
18935
  * @param third - The third option is for the team
18938
18936
  */
18939
18937
  this.e.fire('afterCommand', command, showUI, value);
18940
- this.setEditorValue(); // synchrony
18938
+ this.__imdSynchronizeValues(); // synchrony
18941
18939
  return result;
18942
18940
  };
18943
18941
  /**
@@ -40562,13 +40560,20 @@ var select = /** @class */ (function (_super) {
40562
40560
  };
40563
40561
  select.prototype.beforeCommandCut = function (command) {
40564
40562
  var s = this.j.s;
40565
- if (command === 'cut' && !s.isCollapsed()) {
40563
+ if (!s.isCollapsed()) {
40566
40564
  var current = s.current();
40567
40565
  if (current && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .i.isOrContains(this.j.editor, current)) {
40568
40566
  this.onCopyNormalizeSelectionBound();
40569
40567
  }
40570
40568
  }
40571
40569
  };
40570
+ select.prototype.beforeCommandSelectall = function (command) {
40571
+ var s = this.j.s;
40572
+ s.focus();
40573
+ s.select(this.j.editor, true);
40574
+ s.expandSelection();
40575
+ return false;
40576
+ };
40572
40577
  select.prototype.onCopyNormalizeSelectionBound = function (e) {
40573
40578
  var _a = this.j, s = _a.s, editor = _a.editor, o = _a.o;
40574
40579
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -40589,8 +40594,11 @@ var select = /** @class */ (function (_super) {
40589
40594
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('ow:click')
40590
40595
  ], select.prototype, "onOutsideClick", null);
40591
40596
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .gn)([
40592
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommand'])
40597
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommandCut'])
40593
40598
  ], select.prototype, "beforeCommandCut", null);
40599
+ (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .gn)([
40600
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommandSelectall'])
40601
+ ], select.prototype, "beforeCommandSelectall", null);
40594
40602
  (0,tslib__WEBPACK_IMPORTED_MODULE_6__/* .__decorate */ .gn)([
40595
40603
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':copy', ':cut'])
40596
40604
  ], select.prototype, "onCopyNormalizeSelectionBound", null);
package/es5/jodit.min.css CHANGED
@@ -1,14 +1,14 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.2
4
+ * Version: v4.0.3
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
  /*!
9
9
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
10
10
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
11
- * Version: v4.0.2
11
+ * Version: v4.0.3
12
12
  * Url: https://xdsoft.net/jodit/
13
13
  * License(s): MIT
14
14
  */