jodit 4.5.9 → 4.5.11
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 +23 -2
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +71 -24
- package/es2015/jodit.min.js +2 -2
- 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.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +74 -24
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.css +1 -1
- 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 +74 -23
- package/es2021/jodit.min.js +2 -2
- 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 +2 -2
- package/es2021.en/jodit.js +74 -23
- package/es2021.en/jodit.min.js +2 -2
- 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/415.fat.min.js +1 -1
- package/es5/415.min.js +1 -1
- package/es5/5.fat.min.js +1 -1
- package/es5/5.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +73 -24
- 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/esm/core/async/async.d.ts +13 -3
- package/esm/core/async/async.js +58 -10
- package/esm/core/constants.js +1 -1
- package/esm/core/dom/lazy-walker.d.ts +4 -3
- package/esm/core/dom/lazy-walker.js +14 -12
- package/esm/types/async.d.ts +6 -0
- package/package.json +1 -1
- package/types/core/async/async.d.ts +13 -3
- package/types/core/dom/lazy-walker.d.ts +4 -3
- package/types/types/async.d.ts +6 -0
package/es2021.en/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.5.
|
|
4
|
+
* Version: v4.5.11
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1067,9 +1067,10 @@ class Async {
|
|
|
1067
1067
|
this.__queueMicrotaskNative = queueMicrotask?.bind(window) ??
|
|
1068
1068
|
Promise.resolve().then.bind(Promise.resolve());
|
|
1069
1069
|
this.promisesRejections = new Set();
|
|
1070
|
-
this.
|
|
1071
|
-
this.
|
|
1072
|
-
this.
|
|
1070
|
+
this.__requestsIdle = new Set();
|
|
1071
|
+
this.__controllers = new Set();
|
|
1072
|
+
this.__requestsRaf = new Set();
|
|
1073
|
+
this.__requestIdleCallbackNative = window['requestIdleCallback']?.bind(window) ??
|
|
1073
1074
|
((callback, options) => {
|
|
1074
1075
|
const start = Date.now();
|
|
1075
1076
|
return this.setTimeout(() => {
|
|
@@ -1300,8 +1301,8 @@ class Async {
|
|
|
1300
1301
|
return Promise.race([p, t]).then(v => (v === t ? 'pending' : 'fulfilled'), () => 'rejected');
|
|
1301
1302
|
}
|
|
1302
1303
|
requestIdleCallback(callback, options = { timeout: 100 }) {
|
|
1303
|
-
const request = this.
|
|
1304
|
-
this.
|
|
1304
|
+
const request = this.__requestIdleCallbackNative(callback, options);
|
|
1305
|
+
this.__requestsIdle.add(request);
|
|
1305
1306
|
return request;
|
|
1306
1307
|
}
|
|
1307
1308
|
requestIdlePromise(options) {
|
|
@@ -1309,22 +1310,69 @@ class Async {
|
|
|
1309
1310
|
const request = this.requestIdleCallback(() => res(request), options);
|
|
1310
1311
|
});
|
|
1311
1312
|
}
|
|
1313
|
+
/**
|
|
1314
|
+
* Try to use scheduler.postTask if it is available https://wicg.github.io/scheduling-apis/
|
|
1315
|
+
*/
|
|
1316
|
+
schedulerPostTask(task, options = {
|
|
1317
|
+
delay: 0,
|
|
1318
|
+
priority: 'user-visible'
|
|
1319
|
+
}) {
|
|
1320
|
+
const controller = new AbortController();
|
|
1321
|
+
if (options.signal) {
|
|
1322
|
+
options.signal.addEventListener('abort', () => controller.abort());
|
|
1323
|
+
}
|
|
1324
|
+
this.__controllers.add(controller);
|
|
1325
|
+
// @ts-ignore
|
|
1326
|
+
if (typeof globalThis.scheduler !== 'undefined') {
|
|
1327
|
+
const scheduler = globalThis.scheduler;
|
|
1328
|
+
const promise = scheduler.postTask(task, {
|
|
1329
|
+
...options,
|
|
1330
|
+
signal: controller.signal
|
|
1331
|
+
});
|
|
1332
|
+
promise
|
|
1333
|
+
.finally(() => {
|
|
1334
|
+
this.__controllers.delete(controller);
|
|
1335
|
+
})
|
|
1336
|
+
.catch(() => null);
|
|
1337
|
+
return promise;
|
|
1338
|
+
}
|
|
1339
|
+
return this.promise((resolve, reject) => {
|
|
1340
|
+
const timeout = this.setTimeout(() => {
|
|
1341
|
+
try {
|
|
1342
|
+
resolve(task());
|
|
1343
|
+
}
|
|
1344
|
+
catch (e) {
|
|
1345
|
+
reject(e);
|
|
1346
|
+
}
|
|
1347
|
+
this.__controllers.delete(controller);
|
|
1348
|
+
}, options.delay || 1);
|
|
1349
|
+
controller.signal.addEventListener('abort', () => {
|
|
1350
|
+
this.clearTimeout(timeout);
|
|
1351
|
+
this.__controllers.delete(controller);
|
|
1352
|
+
reject((0,jodit_core_helpers_utils_error_errors_abort_error__WEBPACK_IMPORTED_MODULE_10__/* .abort */ .h)());
|
|
1353
|
+
});
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
schedulerYield() {
|
|
1357
|
+
return this.schedulerPostTask(() => { }, { priority: 'user-visible' });
|
|
1358
|
+
}
|
|
1312
1359
|
cancelIdleCallback(request) {
|
|
1313
|
-
this.
|
|
1360
|
+
this.__requestsIdle.delete(request);
|
|
1314
1361
|
return this.__cancelIdleCallbackNative(request);
|
|
1315
1362
|
}
|
|
1316
1363
|
requestAnimationFrame(callback) {
|
|
1317
1364
|
const request = requestAnimationFrame(callback);
|
|
1318
|
-
this.
|
|
1365
|
+
this.__requestsRaf.add(request);
|
|
1319
1366
|
return request;
|
|
1320
1367
|
}
|
|
1321
1368
|
cancelAnimationFrame(request) {
|
|
1322
|
-
this.
|
|
1369
|
+
this.__requestsRaf.delete(request);
|
|
1323
1370
|
cancelAnimationFrame(request);
|
|
1324
1371
|
}
|
|
1325
1372
|
clear() {
|
|
1326
|
-
this.
|
|
1327
|
-
this.
|
|
1373
|
+
this.__requestsIdle.forEach(key => this.cancelIdleCallback(key));
|
|
1374
|
+
this.__requestsRaf.forEach(key => this.cancelAnimationFrame(key));
|
|
1375
|
+
this.__controllers.forEach(controller => controller.abort());
|
|
1328
1376
|
this.timers.forEach(key => (0,jodit_core_helpers_async__WEBPACK_IMPORTED_MODULE_1__/* .clearTimeout */ .D)(this.timers.get(key)));
|
|
1329
1377
|
this.timers.clear();
|
|
1330
1378
|
this.promisesRejections.forEach(reject => reject());
|
|
@@ -1743,7 +1791,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1743
1791
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
1744
1792
|
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
1745
1793
|
*/
|
|
1746
|
-
const APP_VERSION = "4.5.
|
|
1794
|
+
const APP_VERSION = "4.5.11";
|
|
1747
1795
|
// prettier-ignore
|
|
1748
1796
|
const ES = "es2021";
|
|
1749
1797
|
const IS_ES_MODERN = true;
|
|
@@ -3647,7 +3695,7 @@ class LazyWalker extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MOD
|
|
|
3647
3695
|
}
|
|
3648
3696
|
this.workNodes = jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.eachGen(root, !this.options.reverse);
|
|
3649
3697
|
this.isFinished = false;
|
|
3650
|
-
this.
|
|
3698
|
+
this._requestStarting();
|
|
3651
3699
|
return this;
|
|
3652
3700
|
}
|
|
3653
3701
|
constructor(async, options = {}) {
|
|
@@ -3659,11 +3707,16 @@ class LazyWalker extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MOD
|
|
|
3659
3707
|
this.isWorked = false;
|
|
3660
3708
|
this.isFinished = false;
|
|
3661
3709
|
this.idleId = 0;
|
|
3710
|
+
this.__schedulerController = null;
|
|
3662
3711
|
}
|
|
3663
|
-
|
|
3664
|
-
this.
|
|
3665
|
-
|
|
3666
|
-
|
|
3712
|
+
_requestStarting() {
|
|
3713
|
+
this.__schedulerController = new AbortController();
|
|
3714
|
+
this.async
|
|
3715
|
+
.schedulerPostTask(this.__workPerform, {
|
|
3716
|
+
delay: this.options.timeout,
|
|
3717
|
+
signal: this.__schedulerController.signal
|
|
3718
|
+
})
|
|
3719
|
+
.catch(() => null);
|
|
3667
3720
|
}
|
|
3668
3721
|
break(reason) {
|
|
3669
3722
|
if (this.isWorked) {
|
|
@@ -3688,14 +3741,12 @@ class LazyWalker extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MOD
|
|
|
3688
3741
|
super.destruct();
|
|
3689
3742
|
this.stop();
|
|
3690
3743
|
}
|
|
3691
|
-
|
|
3744
|
+
__workPerform() {
|
|
3692
3745
|
if (this.workNodes) {
|
|
3693
3746
|
this.isWorked = true;
|
|
3694
3747
|
let count = 0;
|
|
3695
3748
|
const chunkSize = this.options.timeoutChunkSize ?? 50;
|
|
3696
|
-
while (!this.isFinished &&
|
|
3697
|
-
(deadline.timeRemaining() > 0 ||
|
|
3698
|
-
(deadline.didTimeout && count <= chunkSize))) {
|
|
3749
|
+
while (!this.isFinished && count <= chunkSize) {
|
|
3699
3750
|
const item = this.workNodes.next();
|
|
3700
3751
|
count += 1;
|
|
3701
3752
|
if (this.visitNode(item.value)) {
|
|
@@ -3711,7 +3762,7 @@ class LazyWalker extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MOD
|
|
|
3711
3762
|
this.end();
|
|
3712
3763
|
}
|
|
3713
3764
|
if (!this.isFinished) {
|
|
3714
|
-
this.
|
|
3765
|
+
this._requestStarting();
|
|
3715
3766
|
}
|
|
3716
3767
|
}
|
|
3717
3768
|
visitNode(nodeElm) {
|
|
@@ -3725,7 +3776,7 @@ class LazyWalker extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MOD
|
|
|
3725
3776
|
}
|
|
3726
3777
|
(0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__decorate */ .Cg)([
|
|
3727
3778
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
|
|
3728
|
-
], LazyWalker.prototype, "
|
|
3779
|
+
], LazyWalker.prototype, "__workPerform", null);
|
|
3729
3780
|
|
|
3730
3781
|
|
|
3731
3782
|
/***/ }),
|