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/es2021/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
  */
@@ -1692,7 +1692,7 @@ __webpack_require__.r(__webpack_exports__);
1692
1692
  * Released under MIT see LICENSE.txt in the project root for license information.
1693
1693
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1694
1694
  */
1695
- const APP_VERSION = "4.0.2";
1695
+ const APP_VERSION = "4.0.3";
1696
1696
  // prettier-ignore
1697
1697
  const ES = "es2021";
1698
1698
  const IS_ES_MODERN = true;
@@ -10966,7 +10966,8 @@ class Selection {
10966
10966
  if (this.isCollapsed()) {
10967
10967
  return this;
10968
10968
  }
10969
- const { range } = this, c = range.cloneRange();
10969
+ const { range } = this;
10970
+ const c = range.cloneRange();
10970
10971
  if (!jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.isOrContains(this.j.editor, range.commonAncestorContainer, true)) {
10971
10972
  return this;
10972
10973
  }
@@ -11014,6 +11015,9 @@ class Selection {
11014
11015
  }
11015
11016
  this.selectRange(c);
11016
11017
  jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .i.safeRemove(leftFake, rightFake);
11018
+ if (this.isCollapsed()) {
11019
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Selection is collapsed');
11020
+ }
11017
11021
  return this;
11018
11022
  }
11019
11023
  }
@@ -16606,18 +16610,12 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
16606
16610
  }
16607
16611
  if (result !== false) {
16608
16612
  this.s.focus();
16609
- if (command === 'selectall') {
16610
- this.s.select(this.editor, true);
16611
- this.s.expandSelection();
16613
+ try {
16614
+ result = this.nativeExecCommand(command, showUI, value);
16612
16615
  }
16613
- else {
16614
- try {
16615
- result = this.nativeExecCommand(command, showUI, value);
16616
- }
16617
- catch (e) {
16618
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
16619
- throw e;
16620
- }
16616
+ catch (e) {
16617
+ if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
16618
+ throw e;
16621
16619
  }
16622
16620
  }
16623
16621
  }
@@ -16628,7 +16626,7 @@ let Jodit = Jodit_1 = class Jodit extends jodit_modules__WEBPACK_IMPORTED_MODULE
16628
16626
  * @param third - The third option is for the team
16629
16627
  */
16630
16628
  this.e.fire('afterCommand', command, showUI, value);
16631
- this.setEditorValue(); // synchrony
16629
+ this.__imdSynchronizeValues(); // synchrony
16632
16630
  return result;
16633
16631
  }
16634
16632
  /**
@@ -37689,13 +37687,20 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin */
37689
37687
  }
37690
37688
  beforeCommandCut(command) {
37691
37689
  const { s } = this.j;
37692
- if (command === 'cut' && !s.isCollapsed()) {
37690
+ if (!s.isCollapsed()) {
37693
37691
  const current = s.current();
37694
37692
  if (current && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .i.isOrContains(this.j.editor, current)) {
37695
37693
  this.onCopyNormalizeSelectionBound();
37696
37694
  }
37697
37695
  }
37698
37696
  }
37697
+ beforeCommandSelectall(command) {
37698
+ const { s } = this.j;
37699
+ s.focus();
37700
+ s.select(this.j.editor, true);
37701
+ s.expandSelection();
37702
+ return false;
37703
+ }
37699
37704
  onCopyNormalizeSelectionBound(e) {
37700
37705
  const { s, editor, o } = this.j;
37701
37706
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -37717,8 +37722,11 @@ class select extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_0__/* .Plugin */
37717
37722
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)('ow:click')
37718
37723
  ], select.prototype, "onOutsideClick", null);
37719
37724
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
37720
- (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommand'])
37725
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommandCut'])
37721
37726
  ], select.prototype, "beforeCommandCut", null);
37727
+ (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
37728
+ (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':beforeCommandSelectall'])
37729
+ ], select.prototype, "beforeCommandSelectall", null);
37722
37730
  (0,tslib__WEBPACK_IMPORTED_MODULE_7__/* .__decorate */ .gn)([
37723
37731
  (0,jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.watch)([':copy', ':cut'])
37724
37732
  ], select.prototype, "onCopyNormalizeSelectionBound", null);