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
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.0.2";
6
+ export const APP_VERSION = "4.0.3";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -1086,7 +1086,8 @@ export class Selection {
1086
1086
  if (this.isCollapsed()) {
1087
1087
  return this;
1088
1088
  }
1089
- const { range } = this, c = range.cloneRange();
1089
+ const { range } = this;
1090
+ const c = range.cloneRange();
1090
1091
  if (!Dom.isOrContains(this.j.editor, range.commonAncestorContainer, true)) {
1091
1092
  return this;
1092
1093
  }
@@ -1134,6 +1135,9 @@ export class Selection {
1134
1135
  }
1135
1136
  this.selectRange(c);
1136
1137
  Dom.safeRemove(leftFake, rightFake);
1138
+ if (this.isCollapsed()) {
1139
+ throw error('Selection is collapsed');
1140
+ }
1137
1141
  return this;
1138
1142
  }
1139
1143
  }
package/esm/jodit.js CHANGED
@@ -543,18 +543,12 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
543
543
  }
544
544
  if (result !== false) {
545
545
  this.s.focus();
546
- if (command === 'selectall') {
547
- this.s.select(this.editor, true);
548
- this.s.expandSelection();
546
+ try {
547
+ result = this.nativeExecCommand(command, showUI, value);
549
548
  }
550
- else {
551
- try {
552
- result = this.nativeExecCommand(command, showUI, value);
553
- }
554
- catch (e) {
555
- if (!IS_PROD) {
556
- throw e;
557
- }
549
+ catch (e) {
550
+ if (!IS_PROD) {
551
+ throw e;
558
552
  }
559
553
  }
560
554
  }
@@ -565,7 +559,7 @@ let Jodit = Jodit_1 = class Jodit extends ViewWithToolbar {
565
559
  * @param third - The third option is for the team
566
560
  */
567
561
  this.e.fire('afterCommand', command, showUI, value);
568
- this.setEditorValue(); // synchrony
562
+ this.__imdSynchronizeValues(); // synchrony
569
563
  return result;
570
564
  }
571
565
  /**
@@ -31,6 +31,7 @@ export declare class select extends Plugin {
31
31
  * @event outsideClick(e) - when user clicked in the outside of editor
32
32
  */
33
33
  protected onOutsideClick(e: MouseEvent): void;
34
- protected beforeCommandCut(command: string): void;
34
+ protected beforeCommandCut(command: string): void | false;
35
+ protected beforeCommandSelectall(command: string): false;
35
36
  protected onCopyNormalizeSelectionBound(e?: ClipboardEvent): void;
36
37
  }
@@ -78,13 +78,20 @@ export class select extends Plugin {
78
78
  }
79
79
  beforeCommandCut(command) {
80
80
  const { s } = this.j;
81
- if (command === 'cut' && !s.isCollapsed()) {
81
+ if (!s.isCollapsed()) {
82
82
  const current = s.current();
83
83
  if (current && Dom.isOrContains(this.j.editor, current)) {
84
84
  this.onCopyNormalizeSelectionBound();
85
85
  }
86
86
  }
87
87
  }
88
+ beforeCommandSelectall(command) {
89
+ const { s } = this.j;
90
+ s.focus();
91
+ s.select(this.j.editor, true);
92
+ s.expandSelection();
93
+ return false;
94
+ }
88
95
  onCopyNormalizeSelectionBound(e) {
89
96
  const { s, editor, o } = this.j;
90
97
  if (!o.select.normalizeSelectionBeforeCutAndCopy || s.isCollapsed()) {
@@ -106,8 +113,11 @@ __decorate([
106
113
  watch('ow:click')
107
114
  ], select.prototype, "onOutsideClick", null);
108
115
  __decorate([
109
- watch([':beforeCommand'])
116
+ watch([':beforeCommandCut'])
110
117
  ], select.prototype, "beforeCommandCut", null);
118
+ __decorate([
119
+ watch([':beforeCommandSelectall'])
120
+ ], select.prototype, "beforeCommandSelectall", null);
111
121
  __decorate([
112
122
  watch([':copy', ':cut'])
113
123
  ], select.prototype, "onCopyNormalizeSelectionBound", null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Jodit is awesome and usefully wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -31,6 +31,7 @@ export declare class select extends Plugin {
31
31
  * @event outsideClick(e) - when user clicked in the outside of editor
32
32
  */
33
33
  protected onOutsideClick(e: MouseEvent): void;
34
- protected beforeCommandCut(command: string): void;
34
+ protected beforeCommandCut(command: string): void | false;
35
+ protected beforeCommandSelectall(command: string): false;
35
36
  protected onCopyNormalizeSelectionBound(e?: ClipboardEvent): void;
36
37
  }