jodit 4.17.3 → 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 +13 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +4 -4
- package/es2015/jodit.js +73 -9
- package/es2015/jodit.min.js +10 -10
- 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 +4 -4
- package/es2018/jodit.min.js +4 -4
- 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 +5 -5
- package/es2021/jodit.js +69 -9
- package/es2021/jodit.min.js +5 -5
- 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 +5 -5
- package/es2021.en/jodit.js +69 -9
- package/es2021.en/jodit.min.js +5 -5
- 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 +79 -9
- 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/modules/file-browser/data-provider.d.ts +1 -0
- package/esm/modules/file-browser/data-provider.js +26 -5
- 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/modules/file-browser/data-provider.d.ts +1 -0
- package/types/plugins/select/select.d.ts +7 -0
- package/.nvmrc +0 -1
- package/examples/build/es2015/jodit.min.css +0 -1
- package/examples/build/es2015/jodit.min.js +0 -10
- package/examples/build/es2015/plugins/debug/debug.min.js +0 -10
- package/examples/build/es2015/plugins/speech-recognize/speech-recognize.min.css +0 -1
- package/examples/build/es2015/plugins/speech-recognize/speech-recognize.min.js +0 -10
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,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
|
|
|
27
27
|
*/
|
|
28
28
|
get o(): this['options'];
|
|
29
29
|
private __ajaxInstances;
|
|
30
|
+
private __requestSerial;
|
|
30
31
|
protected get<T extends IFileBrowserAnswer = IFileBrowserAnswer>(name: keyof IFileBrowserOptions): Promise<T>;
|
|
31
32
|
private progressHandler;
|
|
32
33
|
onProgress(callback: (percentage: number) => void): void;
|
|
@@ -77,12 +77,24 @@ export function assertSourcesAnswer(resp, action, option) {
|
|
|
77
77
|
});
|
|
78
78
|
return resp;
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Actions that only read from the connector. A newer request for one of them
|
|
82
|
+
* makes the older one pointless, so it is aborted; every other action changes
|
|
83
|
+
* server state and must be allowed to finish.
|
|
84
|
+
*/
|
|
85
|
+
const REPLACEABLE_ACTIONS = new Set([
|
|
86
|
+
'items',
|
|
87
|
+
'folder',
|
|
88
|
+
'permissions',
|
|
89
|
+
'getLocalFileByUrl'
|
|
90
|
+
]);
|
|
80
91
|
export default class DataProvider {
|
|
81
92
|
constructor(parent, options) {
|
|
82
93
|
this.parent = parent;
|
|
83
94
|
this.options = options;
|
|
84
95
|
this.__currentPermissions = null;
|
|
85
96
|
this.__ajaxInstances = new Map();
|
|
97
|
+
this.__requestSerial = 0;
|
|
86
98
|
this.progressHandler = (ignore) => { };
|
|
87
99
|
}
|
|
88
100
|
/**
|
|
@@ -93,10 +105,19 @@ export default class DataProvider {
|
|
|
93
105
|
}
|
|
94
106
|
get(name) {
|
|
95
107
|
const instances = this.__ajaxInstances;
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
// A listing asked for again supersedes the one still loading, so the
|
|
109
|
+
// earlier request is aborted. That must never happen to a request
|
|
110
|
+
// that changes something on the server: aborting it does not undo it,
|
|
111
|
+
// the caller just never hears the result. Removing several files at
|
|
112
|
+
// once used to send one `fileRemove` per file and abort all but the
|
|
113
|
+
// last, so only the last one was ever removed. Mutating requests get a
|
|
114
|
+
// key of their own and run side by side.
|
|
115
|
+
const replaceable = REPLACEABLE_ACTIONS.has(name);
|
|
116
|
+
const key = replaceable ? name : `${name}#${++this.__requestSerial}`;
|
|
117
|
+
if (replaceable && instances.has(key)) {
|
|
118
|
+
const ajax = instances.get(key);
|
|
98
119
|
ajax === null || ajax === void 0 ? void 0 : ajax.abort();
|
|
99
|
-
instances.delete(
|
|
120
|
+
instances.delete(key);
|
|
100
121
|
}
|
|
101
122
|
const opts = ConfigProto(this.options[name] !== undefined
|
|
102
123
|
? this.options[name]
|
|
@@ -107,12 +128,12 @@ export default class DataProvider {
|
|
|
107
128
|
opts.data = opts.prepareData.call(this, opts.data);
|
|
108
129
|
}
|
|
109
130
|
const ajax = new Ajax(opts);
|
|
110
|
-
instances.set(
|
|
131
|
+
instances.set(key, ajax);
|
|
111
132
|
const promise = ajax.send();
|
|
112
133
|
promise
|
|
113
134
|
.finally(() => {
|
|
114
135
|
ajax.destruct();
|
|
115
|
-
instances.delete(
|
|
136
|
+
instances.delete(key);
|
|
116
137
|
this.progressHandler(100);
|
|
117
138
|
})
|
|
118
139
|
.catch(() => null);
|
|
@@ -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,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
|
|
|
27
27
|
*/
|
|
28
28
|
get o(): this['options'];
|
|
29
29
|
private __ajaxInstances;
|
|
30
|
+
private __requestSerial;
|
|
30
31
|
protected get<T extends IFileBrowserAnswer = IFileBrowserAnswer>(name: keyof IFileBrowserOptions): Promise<T>;
|
|
31
32
|
private progressHandler;
|
|
32
33
|
onProgress(callback: (percentage: number) => void): void;
|
|
@@ -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
|
*/
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
22
|