jodit 4.17.4 → 4.17.5
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/CHANGELOG.md +7 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +3 -3
- package/es2015/jodit.js +47 -4
- package/es2015/jodit.min.js +3 -3
- package/es2015/plugins/debug/debug.css +1 -1
- 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.fat.min.js +3 -3
- package/es2018/jodit.min.js +3 -3
- package/es2018/plugins/debug/debug.min.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 +4 -4
- package/es2021/jodit.js +43 -4
- package/es2021/jodit.min.js +4 -4
- package/es2021/plugins/debug/debug.css +1 -1
- 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 +4 -4
- package/es2021.en/jodit.js +43 -4
- package/es2021.en/jodit.min.js +4 -4
- package/es2021.en/plugins/debug/debug.css +1 -1
- 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 +53 -4
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- 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/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/selection/selection.d.ts +5 -0
- package/esm/core/selection/selection.js +25 -0
- package/esm/plugins/select/select.d.ts +7 -0
- package/esm/plugins/select/select.js +19 -1
- package/package.json +1 -1
- package/types/core/selection/selection.d.ts +5 -0
- package/types/plugins/select/select.d.ts +7 -0
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
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-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.17.
|
|
6
|
+
export const APP_VERSION = "4.17.5";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -60,6 +60,11 @@ export declare class Selection implements ISelect {
|
|
|
60
60
|
* back to the plain window selection.
|
|
61
61
|
*/
|
|
62
62
|
private __composedSelection;
|
|
63
|
+
/**
|
|
64
|
+
* How many ranges the browser's own selection holds right now, as opposed
|
|
65
|
+
* to the composed view that [[sel]] may answer from.
|
|
66
|
+
*/
|
|
67
|
+
private __nativeRangeCount;
|
|
63
68
|
/**
|
|
64
69
|
* Return first selected range or create new
|
|
65
70
|
*/
|
|
@@ -151,6 +151,18 @@ export class Selection {
|
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* How many ranges the browser's own selection holds right now, as opposed
|
|
156
|
+
* to the composed view that [[sel]] may answer from.
|
|
157
|
+
*/
|
|
158
|
+
__nativeRangeCount() {
|
|
159
|
+
var _a, _b, _c, _d;
|
|
160
|
+
const { shadowRoot } = this.j.o;
|
|
161
|
+
if (shadowRoot && isFunction(shadowRoot.getSelection)) {
|
|
162
|
+
return (_b = (_a = shadowRoot.getSelection()) === null || _a === void 0 ? void 0 : _a.rangeCount) !== null && _b !== void 0 ? _b : 0;
|
|
163
|
+
}
|
|
164
|
+
return (_d = (_c = this.win.getSelection()) === null || _c === void 0 ? void 0 : _c.rangeCount) !== null && _d !== void 0 ? _d : 0;
|
|
165
|
+
}
|
|
154
166
|
/**
|
|
155
167
|
* Return first selected range or create new
|
|
156
168
|
*/
|
|
@@ -1035,6 +1047,19 @@ export class Selection {
|
|
|
1035
1047
|
const range = ranges[0];
|
|
1036
1048
|
sel.setBaseAndExtent(range.endContainer, range.endOffset, range.startContainer, range.startOffset);
|
|
1037
1049
|
}
|
|
1050
|
+
else if (ranges.length === 1 &&
|
|
1051
|
+
!this.__nativeRangeCount() &&
|
|
1052
|
+
isFunction(sel.setBaseAndExtent)) {
|
|
1053
|
+
// `addRange` is specified to ignore a range whose root is not
|
|
1054
|
+
// the document, which is every range inside a shadow tree.
|
|
1055
|
+
// Chrome's `ShadowRoot.getSelection()` takes them anyway, but
|
|
1056
|
+
// Safari has only the window selection, so after
|
|
1057
|
+
// `removeAllRanges` the caret is simply gone: a character was
|
|
1058
|
+
// deleted and nothing was left to type into. `setBaseAndExtent`
|
|
1059
|
+
// does accept nodes inside a shadow tree.
|
|
1060
|
+
const range = ranges[0];
|
|
1061
|
+
sel.setBaseAndExtent(range.startContainer, range.startOffset, range.endContainer, range.endOffset);
|
|
1062
|
+
}
|
|
1038
1063
|
}
|
|
1039
1064
|
/**
|
|
1040
1065
|
* Fired after change selection
|
|
@@ -27,6 +27,13 @@ export declare class select extends Plugin {
|
|
|
27
27
|
protected afterInit(jodit: IJodit): void;
|
|
28
28
|
protected beforeDestruct(jodit: IJodit): void;
|
|
29
29
|
private onStartSelection;
|
|
30
|
+
/**
|
|
31
|
+
* Where the last press started. Chrome reports a drag that begins in one
|
|
32
|
+
* element and ends in another as a `click` on their common ancestor, so a
|
|
33
|
+
* press inside a popup is remembered to tell such a drag from a real click.
|
|
34
|
+
*/
|
|
35
|
+
private __pressTarget;
|
|
36
|
+
protected onOutsidePress(e: Event): void;
|
|
30
37
|
/**
|
|
31
38
|
* @event outsideClick(e) - when user clicked on the outside of editor
|
|
32
39
|
*/
|
|
@@ -42,6 +42,12 @@ export class select extends Plugin {
|
|
|
42
42
|
'mouseup',
|
|
43
43
|
'touchend'
|
|
44
44
|
];
|
|
45
|
+
/**
|
|
46
|
+
* Where the last press started. Chrome reports a drag that begins in one
|
|
47
|
+
* element and ends in another as a `click` on their common ancestor, so a
|
|
48
|
+
* press inside a popup is remembered to tell such a drag from a real click.
|
|
49
|
+
*/
|
|
50
|
+
this.__pressTarget = null;
|
|
45
51
|
}
|
|
46
52
|
afterInit(jodit) {
|
|
47
53
|
this.proxyEventsList.forEach(eventName => {
|
|
@@ -64,14 +70,23 @@ export class select extends Plugin {
|
|
|
64
70
|
j.e.fire(e.type + 'Editor', target, e);
|
|
65
71
|
}
|
|
66
72
|
}
|
|
73
|
+
onOutsidePress(e) {
|
|
74
|
+
this.__pressTarget = e.target;
|
|
75
|
+
}
|
|
67
76
|
/**
|
|
68
77
|
* @event outsideClick(e) - when user clicked on the outside of editor
|
|
69
78
|
*/
|
|
70
79
|
onOutsideClick(e) {
|
|
71
|
-
const node = e.target;
|
|
80
|
+
const node = e.target, pressed = this.__pressTarget;
|
|
81
|
+
this.__pressTarget = null;
|
|
72
82
|
if (Dom.up(node, elm => elm === this.j.editor)) {
|
|
73
83
|
return;
|
|
74
84
|
}
|
|
85
|
+
// Selecting the text of a popup input with the mouse and releasing
|
|
86
|
+
// the button past the popup's edge is not a click outside of it.
|
|
87
|
+
if (pressed && UIElement.closestElement(pressed, Popup)) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
75
90
|
const box = UIElement.closestElement(node, Popup);
|
|
76
91
|
if (!box) {
|
|
77
92
|
this.j.e.fire('outsideClick', e);
|
|
@@ -186,6 +201,9 @@ export class select extends Plugin {
|
|
|
186
201
|
__decorate([
|
|
187
202
|
autobind
|
|
188
203
|
], select.prototype, "onStartSelection", null);
|
|
204
|
+
__decorate([
|
|
205
|
+
watch(['ow:mousedown', 'ow:touchstart'])
|
|
206
|
+
], select.prototype, "onOutsidePress", null);
|
|
189
207
|
__decorate([
|
|
190
208
|
watch('ow:click')
|
|
191
209
|
], select.prototype, "onOutsideClick", null);
|
package/package.json
CHANGED
|
@@ -60,6 +60,11 @@ export declare class Selection implements ISelect {
|
|
|
60
60
|
* back to the plain window selection.
|
|
61
61
|
*/
|
|
62
62
|
private __composedSelection;
|
|
63
|
+
/**
|
|
64
|
+
* How many ranges the browser's own selection holds right now, as opposed
|
|
65
|
+
* to the composed view that [[sel]] may answer from.
|
|
66
|
+
*/
|
|
67
|
+
private __nativeRangeCount;
|
|
63
68
|
/**
|
|
64
69
|
* Return first selected range or create new
|
|
65
70
|
*/
|
|
@@ -27,6 +27,13 @@ export declare class select extends Plugin {
|
|
|
27
27
|
protected afterInit(jodit: IJodit): void;
|
|
28
28
|
protected beforeDestruct(jodit: IJodit): void;
|
|
29
29
|
private onStartSelection;
|
|
30
|
+
/**
|
|
31
|
+
* Where the last press started. Chrome reports a drag that begins in one
|
|
32
|
+
* element and ends in another as a `click` on their common ancestor, so a
|
|
33
|
+
* press inside a popup is remembered to tell such a drag from a real click.
|
|
34
|
+
*/
|
|
35
|
+
private __pressTarget;
|
|
36
|
+
protected onOutsidePress(e: Event): void;
|
|
30
37
|
/**
|
|
31
38
|
* @event outsideClick(e) - when user clicked on the outside of editor
|
|
32
39
|
*/
|