jodit 4.0.2 → 4.0.4
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.
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +25 -17
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +25 -17
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +25 -17
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +25 -17
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +25 -17
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/selection/selection.js +5 -1
- package/esm/jodit.js +6 -12
- package/esm/plugins/select/select.d.ts +2 -1
- package/esm/plugins/select/select.js +12 -2
- package/package.json +1 -1
- package/types/plugins/select/select.d.ts +2 -1
package/esm/core/constants.js
CHANGED
|
@@ -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.
|
|
6
|
+
export const APP_VERSION = "4.0.4";
|
|
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
|
|
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
|
-
|
|
547
|
-
this.
|
|
548
|
-
this.s.expandSelection();
|
|
546
|
+
try {
|
|
547
|
+
result = this.nativeExecCommand(command, showUI, value);
|
|
549
548
|
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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.
|
|
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 (
|
|
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([':
|
|
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
|
@@ -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
|
}
|