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/es2018/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
  */
@@ -1691,7 +1691,7 @@ __webpack_require__.r(__webpack_exports__);
1691
1691
  * Released under MIT see LICENSE.txt in the project root for license information.
1692
1692
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1693
1693
  */
1694
- const APP_VERSION = "4.0.2";
1694
+ const APP_VERSION = "4.0.3";
1695
1695
  // prettier-ignore
1696
1696
  const ES = "es2018";
1697
1697
  const IS_ES_MODERN = true;
@@ -10997,7 +10997,8 @@ class Selection {
10997
10997
  if (this.isCollapsed()) {
10998
10998
  return this;
10999
10999
  }
11000
- const { range } = this, c = range.cloneRange();
11000
+ const { range } = this;
11001
+ const c = range.cloneRange();
11001
11002
  if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isOrContains(this.j.editor, range.commonAncestorContainer, true)) {
11002
11003
  return this;
11003
11004
  }
@@ -11045,6 +11046,9 @@ class Selection {
11045
11046
  }
11046
11047
  this.selectRange(c);
11047
11048
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.safeRemove(leftFake, rightFake);
11049
+ if (this.isCollapsed()) {
11050
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Selection is collapsed');
11051
+ }
11048
11052
  return this;
11049
11053
  }
11050
11054
  }
@@ -16655,18 +16659,12 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
16655
16659
  }
16656
16660
  if (result !== false) {
16657
16661
  this.s.focus();
16658
- if (command === 'selectall') {
16659
- this.s.select(this.editor, true);
16660
- this.s.expandSelection();
16662
+ try {
16663
+ result = this.nativeExecCommand(command, showUI, value);
16661
16664
  }
16662
- else {
16663
- try {
16664
- result = this.nativeExecCommand(command, showUI, value);
16665
- }
16666
- catch (e) {
16667
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
16668
- throw e;
16669
- }
16665
+ catch (e) {
16666
+ if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
16667
+ throw e;
16670
16668
  }
16671
16669
  }
16672
16670
  }
@@ -16677,7 +16675,7 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
16677
16675
  * @param third - The third option is for the team
16678
16676
  */
16679
16677
  this.e.fire('afterCommand', command, showUI, value);
16680
- this.setEditorValue(); // synchrony
16678
+ this.__imdSynchronizeValues(); // synchrony
16681
16679
  return result;
16682
16680
  }
16683
16681
  /**
@@ -37798,13 +37796,20 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin */
37798
37796
  }
37799
37797
  beforeCommandCut(command) {
37800
37798
  const { s } = this.j;
37801
- if (command === 'cut' && !s.isCollapsed()) {
37799
+ if (!s.isCollapsed()) {
37802
37800
  const current = s.current();
37803
37801
  if (current && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .i.isOrContains(this.j.editor, current)) {
37804
37802
  this.onCopyNormalizeSelectionBound();
37805
37803
  }
37806
37804
  }
37807
37805
  }
37806
+ beforeCommandSelectall(command) {
37807
+ const { s } = this.j;
37808
+ s.focus();
37809
+ s.select(this.j.editor, true);
37810
+ s.expandSelection();
37811
+ return false;
37812
+ }
37808
37813
  onCopyNormalizeSelectionBound(e) {
37809
37814
  const { s, editor, o } = this.j;
37810
37815
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -37826,8 +37831,11 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin */
37826
37831
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('ow:click')
37827
37832
  ], select.prototype, "onOutsideClick", null);
37828
37833
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
37829
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommand'])
37834
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommandCut'])
37830
37835
  ], select.prototype, "beforeCommandCut", null);
37836
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
37837
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommandSelectall'])
37838
+ ], select.prototype, "beforeCommandSelectall", null);
37831
37839
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
37832
37840
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':copy', ':cut'])
37833
37841
  ], select.prototype, "onCopyNormalizeSelectionBound", null);