jodit 4.2.25 → 4.2.32
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/.nvmrc +1 -1
- package/CHANGELOG.md +119 -5
- package/es2015/jodit.css +14 -2
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +422 -284
- package/es2015/jodit.min.css +1 -1
- 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 +25 -18
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.css +14 -2
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +416 -278
- package/es2018/jodit.min.css +1 -1
- 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 +25 -18
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +14 -2
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +416 -278
- package/es2021/jodit.min.css +1 -1
- 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 +25 -18
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021.en/jodit.css +14 -2
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +391 -272
- package/es2021.en/jodit.min.css +1 -1
- 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 +25 -18
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/164.fat.min.js +10 -0
- package/es5/164.js +4939 -0
- package/es5/164.min.js +10 -0
- package/es5/5.fat.min.js +10 -0
- package/es5/5.js +76 -0
- package/es5/5.min.js +10 -0
- package/es5/jodit.css +21 -6
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +817 -5709
- package/es5/jodit.min.css +3 -3
- 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 +26 -19
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/esm/config.js +3 -7
- package/esm/core/async/async.js +2 -1
- package/esm/core/constants.d.ts +2 -0
- package/esm/core/constants.js +12 -8
- package/esm/core/decorators/watch/watch.js +0 -1
- package/esm/core/dom/dom.d.ts +2 -1
- package/esm/core/dom/dom.js +12 -6
- package/esm/core/event-emitter/event-emitter.js +3 -3
- package/esm/core/global.js +16 -3
- package/esm/core/helpers/array/to-array.d.ts +1 -6
- package/esm/core/helpers/array/to-array.js +1 -1
- package/esm/core/helpers/async/set-timeout.d.ts +0 -3
- package/esm/core/helpers/async/set-timeout.js +3 -2
- package/esm/core/helpers/checker/has-browser-color-picker.d.ts +0 -3
- package/esm/core/helpers/checker/has-browser-color-picker.js +2 -1
- package/esm/core/helpers/checker/is-url.d.ts +0 -3
- package/esm/core/helpers/checker/is-url.js +2 -1
- package/esm/core/helpers/html/apply-styles.js +3 -3
- package/esm/core/helpers/html/clean-from-word.js +2 -1
- package/esm/core/helpers/html/htmlspecialchars.d.ts +0 -3
- package/esm/core/helpers/html/htmlspecialchars.js +2 -1
- package/esm/core/helpers/normalize/normalize-key-aliases.js +2 -1
- package/esm/core/helpers/normalize/normalize-size.d.ts +1 -1
- package/esm/core/helpers/size/get-scroll-parent.js +3 -2
- package/esm/core/helpers/utils/complete-url.js +2 -1
- package/esm/core/helpers/utils/convert-media-url-to-video-embed.js +2 -1
- package/esm/core/helpers/utils/default-language.js +3 -2
- package/esm/core/helpers/utils/reset.js +3 -3
- package/esm/core/request/ajax.js +2 -1
- package/esm/core/selection/selection.js +1 -0
- package/esm/core/selection/style/api/has-same-style.js +15 -10
- package/esm/core/selection/style/api/toggle-attributes.js +2 -1
- package/esm/core/selection/style/commit-style.d.ts +1 -1
- package/esm/core/ui/button/tooltip/tooltip.d.ts +1 -0
- package/esm/core/ui/button/tooltip/tooltip.js +11 -5
- package/esm/core/ui/form/inputs/file/file.d.ts +1 -0
- package/esm/core/ui/form/inputs/file/file.js +1 -0
- package/esm/core/ui/form/validators/input.d.ts +3 -3
- package/esm/core/ui/form/validators/select.d.ts +1 -1
- package/esm/jodit.js +3 -0
- package/esm/modules/file-browser/config.js +9 -1
- package/esm/modules/file-browser/data-provider.js +0 -1
- package/esm/modules/file-browser/file-browser.js +0 -1
- package/esm/modules/table/table.d.ts +2 -3
- package/esm/modules/table/table.js +27 -35
- package/esm/modules/toolbar/button/button.d.ts +1 -1
- package/esm/plugins/add-new-line/add-new-line.js +4 -1
- package/esm/plugins/backspace/cases/check-remove-char.js +1 -0
- package/esm/plugins/clean-html/config.d.ts +3 -3
- package/esm/plugins/clean-html/helpers/visitor/filters/fill-empty-paragraph.js +9 -1
- package/esm/plugins/hotkeys/hotkeys.js +4 -2
- package/esm/plugins/iframe/config.d.ts +15 -3
- package/esm/plugins/iframe/config.js +1 -0
- package/esm/plugins/iframe/iframe.js +3 -0
- package/esm/plugins/indent/helpers.d.ts +1 -1
- package/esm/plugins/inline-popup/config/items/a.d.ts +2 -2
- package/esm/plugins/inline-popup/config/items/cells.d.ts +1 -1
- package/esm/plugins/inline-popup/config/items/img.d.ts +1 -1
- package/esm/plugins/search/config.js +2 -2
- package/esm/plugins/search/helpers/highlight-text-ranges.js +3 -1
- package/esm/plugins/select-cells/select-cells.js +1 -1
- package/esm/plugins/source/editor/engines/ace.d.ts +0 -1
- package/esm/plugins/speech-recognize/config.js +1 -1
- package/esm/plugins/speech-recognize/helpers/api.d.ts +1 -1
- package/esm/plugins/speech-recognize/helpers/api.js +5 -2
- package/esm/plugins/speech-recognize/helpers/sound.js +6 -4
- package/esm/plugins/stat/config.d.ts +1 -0
- package/esm/plugins/stat/config.js +1 -0
- package/esm/plugins/stat/stat.js +14 -3
- package/esm/plugins/symbols/langs/index.d.ts +2 -1
- package/esm/plugins/symbols/langs/index.js +2 -1
- package/esm/plugins/symbols/langs/ua.d.ts +1 -0
- package/esm/plugins/symbols/langs/ua.js +9 -0
- package/esm/plugins/table/config.js +19 -3
- package/esm/polyfills.d.ts +10 -0
- package/esm/polyfills.js +54 -0
- package/esm/tsconfig.json +1 -1
- package/package.json +1 -1
- package/types/core/constants.d.ts +2 -0
- package/types/core/dom/dom.d.ts +2 -1
- package/types/core/helpers/array/to-array.d.ts +1 -6
- package/types/core/helpers/async/set-timeout.d.ts +0 -3
- package/types/core/helpers/checker/has-browser-color-picker.d.ts +0 -3
- package/types/core/helpers/checker/is-url.d.ts +0 -3
- package/types/core/helpers/html/htmlspecialchars.d.ts +0 -3
- package/types/core/helpers/normalize/normalize-size.d.ts +1 -1
- package/types/core/selection/style/commit-style.d.ts +1 -1
- package/types/core/ui/button/tooltip/tooltip.d.ts +1 -0
- package/types/core/ui/form/inputs/file/file.d.ts +1 -0
- package/types/core/ui/form/validators/input.d.ts +3 -3
- package/types/core/ui/form/validators/select.d.ts +1 -1
- package/types/modules/table/table.d.ts +2 -3
- package/types/modules/toolbar/button/button.d.ts +1 -1
- package/types/plugins/clean-html/config.d.ts +3 -3
- package/types/plugins/iframe/config.d.ts +15 -3
- package/types/plugins/indent/helpers.d.ts +1 -1
- package/types/plugins/inline-popup/config/items/a.d.ts +2 -2
- package/types/plugins/inline-popup/config/items/cells.d.ts +1 -1
- package/types/plugins/inline-popup/config/items/img.d.ts +1 -1
- package/types/plugins/source/editor/engines/ace.d.ts +0 -1
- package/types/plugins/speech-recognize/helpers/api.d.ts +1 -1
- package/types/plugins/stat/config.d.ts +1 -0
- package/types/plugins/symbols/langs/index.d.ts +2 -1
- package/types/plugins/symbols/langs/ua.d.ts +1 -0
- package/types/polyfills.d.ts +10 -0
- package/types/tsconfig.json +1 -1
|
@@ -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.2.
|
|
4
|
+
* Version: v4.2.32
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -91,7 +91,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_3__/* .Config */ .T.prototype.controls.spe
|
|
|
91
91
|
api = new _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_5__/* .RecognizeManager */ .g(jodit.async, nativeApi);
|
|
92
92
|
api.lang = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(lang)
|
|
93
93
|
? lang
|
|
94
|
-
: (_b = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(jodit.od.documentElement, 'lang')) !== null && _b !== void 0 ? _b : undefined;
|
|
94
|
+
: ((_b = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(jodit.od.documentElement, 'lang')) !== null && _b !== void 0 ? _b : undefined);
|
|
95
95
|
api.continuous = continuous;
|
|
96
96
|
api.interimResults = interimResults;
|
|
97
97
|
api.sound = sound;
|
|
@@ -177,13 +177,17 @@ var WARN = 940;
|
|
|
177
177
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
178
178
|
/* harmony export */ o: function() { return /* binding */ SpeechRecognition; }
|
|
179
179
|
/* harmony export */ });
|
|
180
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
|
|
180
181
|
/*!
|
|
181
182
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
182
183
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
183
184
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
184
185
|
*/
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
|
|
187
|
+
var SpeechRecognition = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow
|
|
188
|
+
? jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.SpeechRecognition ||
|
|
189
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitSpeechRecognition
|
|
190
|
+
: undefined;
|
|
187
191
|
|
|
188
192
|
|
|
189
193
|
/***/ }),
|
|
@@ -217,11 +221,11 @@ function execSpellCommand(jodit, commandSentence) {
|
|
|
217
221
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
218
222
|
/* harmony export */ g: function() { return /* binding */ RecognizeManager; }
|
|
219
223
|
/* harmony export */ });
|
|
220
|
-
/* harmony import */ var
|
|
224
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(31635);
|
|
221
225
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22664);
|
|
222
226
|
/* harmony import */ var jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(43431);
|
|
223
|
-
/* harmony import */ var
|
|
224
|
-
/* harmony import */ var
|
|
227
|
+
/* harmony import */ var _sound__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(95473);
|
|
228
|
+
/* harmony import */ var jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81629);
|
|
225
229
|
/*!
|
|
226
230
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
227
231
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -233,7 +237,7 @@ function execSpellCommand(jodit, commandSentence) {
|
|
|
233
237
|
|
|
234
238
|
|
|
235
239
|
var RecognizeManager = /** @class */ (function (_super) {
|
|
236
|
-
(0,
|
|
240
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__extends */ .C6)(RecognizeManager, _super);
|
|
237
241
|
function RecognizeManager(async, api) {
|
|
238
242
|
var _this = _super.call(this) || this;
|
|
239
243
|
_this.async = async;
|
|
@@ -250,7 +254,7 @@ var RecognizeManager = /** @class */ (function (_super) {
|
|
|
250
254
|
_this._restartTimeout = _this.async.setTimeout(function () {
|
|
251
255
|
_this.restart();
|
|
252
256
|
_this.emit('pulse', false);
|
|
253
|
-
_this._makeSound(
|
|
257
|
+
_this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_4__/* .WARN */ .Z);
|
|
254
258
|
}, 5000);
|
|
255
259
|
_this.emit('pulse', true);
|
|
256
260
|
};
|
|
@@ -367,7 +371,7 @@ var RecognizeManager = /** @class */ (function (_super) {
|
|
|
367
371
|
this.emit('pulse', false);
|
|
368
372
|
this.emit('result', this.__interimResults);
|
|
369
373
|
this.__interimResults = '';
|
|
370
|
-
this._makeSound(
|
|
374
|
+
this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_4__/* .PII */ .N);
|
|
371
375
|
this.restart();
|
|
372
376
|
};
|
|
373
377
|
RecognizeManager.prototype._onProgress = function (e) {
|
|
@@ -401,18 +405,18 @@ var RecognizeManager = /** @class */ (function (_super) {
|
|
|
401
405
|
e.error === 'language-not-supported') {
|
|
402
406
|
this.emit('error', 'Language unavailable');
|
|
403
407
|
}
|
|
404
|
-
this._makeSound(
|
|
408
|
+
this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_4__/* .WARN */ .Z);
|
|
405
409
|
this.emit('pulse', false);
|
|
406
410
|
this.stop();
|
|
407
411
|
};
|
|
408
412
|
RecognizeManager.prototype._makeSound = function (frequency) {
|
|
409
413
|
if (this.sound) {
|
|
410
|
-
(0,
|
|
414
|
+
(0,_sound__WEBPACK_IMPORTED_MODULE_2__/* .sound */ .s)({ frequency: frequency });
|
|
411
415
|
}
|
|
412
416
|
};
|
|
413
417
|
var RecognizeManager_1;
|
|
414
418
|
RecognizeManager._instances = new Set();
|
|
415
|
-
RecognizeManager = RecognizeManager_1 = (0,
|
|
419
|
+
RecognizeManager = RecognizeManager_1 = (0,tslib__WEBPACK_IMPORTED_MODULE_3__/* .__decorate */ .Cg)([
|
|
416
420
|
jodit_core_decorators__WEBPACK_IMPORTED_MODULE_0__.autobind
|
|
417
421
|
], RecognizeManager);
|
|
418
422
|
return RecognizeManager;
|
|
@@ -429,7 +433,8 @@ var RecognizeManager = /** @class */ (function (_super) {
|
|
|
429
433
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
430
434
|
/* harmony export */ s: function() { return /* binding */ sound; }
|
|
431
435
|
/* harmony export */ });
|
|
432
|
-
/* harmony import */ var
|
|
436
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
|
|
437
|
+
/* harmony import */ var jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81629);
|
|
433
438
|
/*!
|
|
434
439
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
435
440
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -439,18 +444,20 @@ var RecognizeManager = /** @class */ (function (_super) {
|
|
|
439
444
|
* @module plugins/speech-recognize
|
|
440
445
|
*/
|
|
441
446
|
|
|
447
|
+
|
|
442
448
|
/**
|
|
443
449
|
* @internal
|
|
444
450
|
*/
|
|
445
451
|
function sound(_a) {
|
|
446
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.sec, sec = _c === void 0 ? 0.1 : _c, _d = _b.frequency, frequency = _d === void 0 ?
|
|
447
|
-
if (
|
|
448
|
-
typeof
|
|
452
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.sec, sec = _c === void 0 ? 0.1 : _c, _d = _b.frequency, frequency = _d === void 0 ? jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_1__/* .PII */ .N : _d, _e = _b.gain, gain = _e === void 0 ? 0.1 : _e, _f = _b.type, type = _f === void 0 ? 'sine' : _f;
|
|
453
|
+
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow ||
|
|
454
|
+
(typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.AudioContext === 'undefined' &&
|
|
455
|
+
typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitAudioContext === 'undefined')) {
|
|
449
456
|
return;
|
|
450
457
|
}
|
|
451
458
|
// one context per document
|
|
452
|
-
var context = new (
|
|
453
|
-
|
|
459
|
+
var context = new (jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.AudioContext ||
|
|
460
|
+
jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitAudioContext)();
|
|
454
461
|
var vol = context.createGain();
|
|
455
462
|
var osc = context.createOscillator();
|
|
456
463
|
osc.type = type;
|
|
@@ -1,10 +1,10 @@
|
|
|
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.2.
|
|
4
|
+
* Version: v4.2.32
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{71096:function(e,t,n){"use strict";var i=n(9810),s=n(98253),o=n(26150),r=n(72197),u=n(931),c=n(36115),a=n(71722),l=n(93676),p=n(22227),d=n.n(p);c.T.prototype.speechRecognize={api:void 0!==a.o?a.o:null,sound:!0,continuous:!1,interimResults:!0,commands:{"newline|enter":"enter","delete|remove word|delete word":"backspaceWordButton",comma:"inserthtml::,",underline:"inserthtml::_",hyphen:"inserthtml::-",space:"inserthtml:: ",question:"inserthtml::?",dot:"inserthtml::.","quote|quotes|open quote":"inserthtml::'","header|header h1":"formatblock::h1","select all":"selectall"}},u.I.set("speech-recognize",d()),c.T.prototype.controls.speechRecognize={isVisible:function(e){return Boolean(e.o.speechRecognize.api)},isActive:function(e,t){var n=(0,r.m)(e,"speech");return Boolean(null==n?void 0:n.isEnabled)},isDisabled:function(e){return!e.o.speechRecognize.api},exec:function(e,t,n){var u,c=n.button,a=n.control,p=e.o.speechRecognize,d=p.api,h=p.lang,f=p.continuous,m=p.interimResults,g=p.sound;if(d){var R=(0,r.m)(e,"speech");if(!R){var _=new d;(R=new l.g(e.async,_)).lang=(0,s.K)(h)?h:null!==(u=(0,o.C)(e.od.documentElement,"lang"))&&void 0!==u?u:void 0,R.continuous=f,R.interimResults=m,R.sound=g,(0,r.m)(e,"speech",R),R.on("pulse",(function(e){c.setMod("pulse",e)})),R.on("result",(function(t){return e.e.fire("speechRecognizeResult",t)})),R.on("progress",(function(t){return e.e.fire("speechRecognizeProgressResult",t)})),R.on("error",(function(t){return e.message.error(t)})),c.hookStatus("beforeDestruct",(function(){(0,r.m)(e,"speech",null),R.destruct()}))}if(a.args){var v=a.args[0];if((0,i.L)(R[v]))return R[v]=!R[v],void(R.isEnabled&&R.restart())}R.toggle(),R.isEnabled&&c.setMod("pulse",!0),c.state.activated=R.isEnabled}else e.alert("Speech recognize API unsupported in your browser")},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate:function(e,t,n){var i,s=(0,r.m)(e,"speech"),o=null!==(i=null==s?void 0:s[t])&&void 0!==i?i:e.o.speechRecognize[t];return"<span class='jodit-speech-recognize__list-item'><input ".concat(o?"checked":""," class='jodit-checkbox' type='checkbox'> ").concat(n,"</span>")},mods:{stroke:!1}}},81629:function(e,t,n){"use strict";n.d(t,{N:function(){return i},Z:function(){return s}});var i=440,s=940},71722:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var i=window.SpeechRecognition||window.webkitSpeechRecognition},50834:function(e,t,n){"use strict";n.d(t,{F:function(){return s}});var i=n(31635);function s(e,t){var n=(0,i.zs)(t.split("::"),2);e.execCommand(n[0],null,n[1])}},93676:function(e,t,n){"use strict";n.d(t,{g:function(){return c}});var i=n(31635),s=n(22664),o=n(43431),r=n(95473),u=n(81629),c=function(e){function t(t,i){var s=e.call(this)||this;return s.async=t,s._continuous=!1,s._interimResults=!1,s.sound=!0,s._isEnabled=!1,s._restartTimeout=0,s._onSpeechStart=function(e){s._isEnabled&&(s.async.clearTimeout(s._restartTimeout),s._restartTimeout=s.async.setTimeout((function(){s.restart(),s.emit("pulse",!1),s._makeSound(u.Z)}),5e3),s.emit("pulse",!0))},s.__interimResults="",s._api=i,n._instances.add(s),s}var n;return(0,i.C6)(t,e),n=t,Object.defineProperty(t.prototype,"lang",{get:function(){return this._lang},set:function(e){this._lang=e,this._api.lang=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"continuous",{get:function(){return this._continuous},set:function(e){this._continuous=e,this._api.continuous=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"interimResults",{get:function(){return this._interimResults},set:function(e){this._interimResults=e,this._api.interimResults=e},enumerable:!1,configurable:!0}),t.prototype.destruct=function(){this.stop(),n._instances.delete(this),e.prototype.destruct.call(this)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},enumerable:!1,configurable:!0}),t.prototype.start=function(){var e=this;if(!this._isEnabled){this._isEnabled=!0,n._instances.forEach((function(t){t!==e&&t.stop()}));try{this._api.start()}catch(e){return this._onError(e),void this.stop()}this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onProgress).__on("end",this._onResults)}},t.prototype.stop=function(){this._isEnabled&&(this._api.abort(),this._api.stop(),this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onProgress).__off("end",this._onResults),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1))},t.prototype.toggle=function(){this._isEnabled?this.stop():this.start()},t.prototype.restart=function(){this.stop(),this.start()},t.prototype.__on=function(e,t){return this._api.addEventListener(e,t),this},t.prototype.__off=function(e,t){return this._api.removeEventListener(e,t),this},t.prototype._onResults=function(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(u.N),this.restart()},t.prototype._onProgress=function(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(var t=0;e.results.length>t;t++){var n=e.results.item(t);if(n.length){var i=n.item(0).transcript;this.__interimResults+=i}}this.__interimResults&&this.emit("progress",this.__interimResults)}},t.prototype._onError=function(e){"voice-unavailable"===e.error&&this.emit("error","Voice unavailable"),"not-allowed"===e.error&&this.emit("error","Not allowed"),"language-unavailable"!==e.error&&"language-not-supported"!==e.error||this.emit("error","Language unavailable"),this._makeSound(u.Z),this.emit("pulse",!1),this.stop()},t.prototype._makeSound=function(e){this.sound&&(0,r.s)({frequency:e})},t._instances=new Set,n=(0,i.Cg)([s.autobind],t)}(o.h)},95473:function(e,t,n){"use strict";n.d(t,{s:function(){return s}});var i=n(81629);function s(e){var t=void 0===e?{}:e,n=t.sec,s=void 0===n?.1:n,o=t.frequency,r=void 0===o?i.N:o,u=t.gain,c=void 0===u?.1:u,a=t.type,l=void 0===a?"sine":a;if(void 0!==window.AudioContext||void 0!==window.webkitAudioContext){var p=new(window.AudioContext||window.webkitAudioContext),d=p.createGain(),h=p.createOscillator();h.type=l,h.frequency.value=r,h.connect(d),d.connect(p.destination),h.start(),h.stop(p.currentTime+s),d.gain.value=c}}},61593:function(e){"use strict";e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},64458:function(e){"use strict";e.exports={newline:"řádek",delete:"odstranit",space:"prostora","Speech Recognize":"Rozpoznání Řeči",Sound:"Zvuk","Interim Results":"Průběžné Výsledky"}},89601:function(e){"use strict";e.exports={newline:"Zeilenumbruch",delete:"löschen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},87710:function(e){"use strict";e.exports={newline:"nueva línea",delete:"eliminar",space:"espacio","Speech Recognize":"Reconocimiento de Voz",Sound:"Sonido","Interim Results":"Resultados Provisionales"}},15603:function(e){"use strict";e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},84059:function(e){"use strict";e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"Ääni","Interim Results":"Välitulokset"}},13958:function(e){"use strict";e.exports={newline:"nouvelle ligne",delete:"supprimer",space:"espace","Speech Recognize":"Reconnaissance Vocale",Sound:"Son","Interim Results":"Résultats Intermédiaires"}},18717:function(e){"use strict";e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},14765:function(e){"use strict";e.exports={newline:"újsor",delete:"törlés",space:"tér","Speech Recognize":"A Beszéd Felismeri",Sound:"Hang","Interim Results":"Időközi Eredmények"}},77995:function(e){"use strict";e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},25202:function(e,t,n){"use strict";n.r(t),n.d(t,{ar:function(){return i},cs_cz:function(){return s},de:function(){return o},es:function(){return r},fa:function(){return u},fi:function(){return c},fr:function(){return a},he:function(){return l},hu:function(){return p},id:function(){return d},it:function(){return h},ja:function(){return f},ko:function(){return m},mn:function(){return g},nl:function(){return R},pl:function(){return _},pt_br:function(){return v},ru:function(){return S},tr:function(){return w},ua:function(){return z},zh_cn:function(){return y},zh_tw:function(){return b}});var i=n(61593),s=n(64458),o=n(89601),r=n(87710),u=n(15603),c=n(84059),a=n(13958),l=n(18717),p=n(14765),d=n(77995),h=n(92315),f=n(54711),m=n(68632),g=n(76769),R=n(3424),_=n(85454),v=n(64149),S=n(16491),w=n(48948),z=n(95700),y=n(84370),b=n(56646)},92315:function(e){"use strict";e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},54711:function(e){"use strict";e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},68632:function(e){"use strict";e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},76769:function(e){"use strict";e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},3424:function(e){"use strict";e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},85454:function(e){"use strict";e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},64149:function(e){"use strict";e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provisórios"}},16491:function(e){"use strict";e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},48948:function(e){"use strict";e.exports={newline:"yeni satır",delete:"silmek",space:"uzay","Speech Recognize":"Konuşma Tanıma",Sound:"Ses","Interim Results":"Ara Sonuçlar"}},95700:function(e){"use strict";e.exports={newline:"новая строка|перенос|ентер",delete:"видалити",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Проміжні результати"}},84370:function(e){"use strict";e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},56646:function(e){"use strict";e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},37873:function(e,t,n){"use strict";n.r(t),n.d(t,{SpeechRecognizeNative:function(){return d}});var i=n(31635),s=n(66927),o=n(55186),r=n(56298),u=n(84976),c=n(71005),a=(n(71096),n(46173)),l=n(50834),p=n(25202),d=function(e){function t(){var t=e.apply(this,(0,i.fX)([],(0,i.zs)(arguments),!1))||this;return t.buttons=[{group:"state",name:"speechRecognize"}],t._commandToWord={},t}return(0,i.C6)(t,e),t.prototype.afterInit=function(e){var t=this,n=e.o.speechRecognize.commands;n&&((0,r.JW)(p),(0,u.HP)(n,!1).forEach((function(i){i.split("|").forEach((function(s){s=s.trim().toLowerCase(),t._commandToWord[s]=n[i];var o=e.i18n(s);o!==s&&o.split("|").forEach((function(e){t._commandToWord[e.trim().toLowerCase()]=n[i].trim()}))}))})))},t.prototype.beforeDestruct=function(e){o.J.safeRemove(this.messagePopup)},t.prototype.onSpeechRecognizeProgressResult=function(e){var t=this;this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),this.j.workplace.appendChild(this.messagePopup),this.j.async.clearTimeout(this.__hidePopupTimeout),this.__hidePopupTimeout=this.j.async.setTimeout((function(){o.J.safeRemove(t.messagePopup)}),1e3),this.messagePopup.innerText=e+"|"},t.prototype.onSpeechRecognizeResult=function(e){this.j.async.clearTimeout(this.__hidePopupTimeout),o.J.safeRemove(this.messagePopup);var t=this.j,n=t.s;if(!this._checkCommand(e)){var i=n.range,s=n.current();if(n.isCollapsed()&&o.J.isText(s)&&o.J.isOrContains(t.editor,s)&&s.nodeValue){var r=s.nodeValue;s.nodeValue=r+(/[\u00A0 ]\uFEFF*$/.test(r)?"":" ")+e,i.setStartAfter(s),n.selectRange(i),t.synchronizeValues()}else n.insertHTML(e)}},t.prototype._checkCommand=function(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,l.F)(this.j,this._commandToWord[e]),!0)},(0,i.Cg)([(0,s.w)(":speechRecognizeProgressResult")],t.prototype,"onSpeechRecognizeProgressResult",null),(0,i.Cg)([(0,s.w)(":speechRecognizeResult")],t.prototype,"onSpeechRecognizeResult",null),t}(c.k);a.x.plugins.add("speech-recognize",d)},22227:function(e){e.exports='<svg viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M8,11c1.657,0,3-1.343,3-3V3c0-1.657-1.343-3-3-3S5,1.343,5,3v5C5,9.657,6.343,11,8,11z"/> <path d="M13,8V6h-1l0,1.844c0,1.92-1.282,3.688-3.164,4.071C6.266,12.438,4,10.479,4,8V6H3v2c0,2.414,1.721,4.434,4,4.899V15H5v1h6 v-1H9v-2.101C11.279,12.434,13,10.414,13,8z"/> </svg>'}},function(e){return e(e.s=37873)}])}));
|
|
10
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,(function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{71096:function(e,t,n){"use strict";var i=n(9810),o=n(98253),s=n(26150),r=n(72197),u=n(931),c=n(36115),a=n(71722),l=n(93676),p=n(22227),d=n.n(p);c.T.prototype.speechRecognize={api:void 0!==a.o?a.o:null,sound:!0,continuous:!1,interimResults:!0,commands:{"newline|enter":"enter","delete|remove word|delete word":"backspaceWordButton",comma:"inserthtml::,",underline:"inserthtml::_",hyphen:"inserthtml::-",space:"inserthtml:: ",question:"inserthtml::?",dot:"inserthtml::.","quote|quotes|open quote":"inserthtml::'","header|header h1":"formatblock::h1","select all":"selectall"}},u.I.set("speech-recognize",d()),c.T.prototype.controls.speechRecognize={isVisible:function(e){return Boolean(e.o.speechRecognize.api)},isActive:function(e,t){var n=(0,r.m)(e,"speech");return Boolean(null==n?void 0:n.isEnabled)},isDisabled:function(e){return!e.o.speechRecognize.api},exec:function(e,t,n){var u,c=n.button,a=n.control,p=e.o.speechRecognize,d=p.api,h=p.lang,f=p.continuous,m=p.interimResults,g=p.sound;if(d){var R=(0,r.m)(e,"speech");if(!R){var _=new d;(R=new l.g(e.async,_)).lang=(0,o.K)(h)?h:null!==(u=(0,s.C)(e.od.documentElement,"lang"))&&void 0!==u?u:void 0,R.continuous=f,R.interimResults=m,R.sound=g,(0,r.m)(e,"speech",R),R.on("pulse",(function(e){c.setMod("pulse",e)})),R.on("result",(function(t){return e.e.fire("speechRecognizeResult",t)})),R.on("progress",(function(t){return e.e.fire("speechRecognizeProgressResult",t)})),R.on("error",(function(t){return e.message.error(t)})),c.hookStatus("beforeDestruct",(function(){(0,r.m)(e,"speech",null),R.destruct()}))}if(a.args){var v=a.args[0];if((0,i.L)(R[v]))return R[v]=!R[v],void(R.isEnabled&&R.restart())}R.toggle(),R.isEnabled&&c.setMod("pulse",!0),c.state.activated=R.isEnabled}else e.alert("Speech recognize API unsupported in your browser")},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate:function(e,t,n){var i,o=(0,r.m)(e,"speech"),s=null!==(i=null==o?void 0:o[t])&&void 0!==i?i:e.o.speechRecognize[t];return"<span class='jodit-speech-recognize__list-item'><input ".concat(s?"checked":""," class='jodit-checkbox' type='checkbox'> ").concat(n,"</span>")},mods:{stroke:!1}}},81629:function(e,t,n){"use strict";n.d(t,{N:function(){return i},Z:function(){return o}});var i=440,o=940},71722:function(e,t,n){"use strict";n.d(t,{o:function(){return o}});var i=n(17352),o=i.globalWindow?i.globalWindow.SpeechRecognition||i.globalWindow.webkitSpeechRecognition:void 0},50834:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var i=n(31635);function o(e,t){var n=(0,i.zs)(t.split("::"),2);e.execCommand(n[0],null,n[1])}},93676:function(e,t,n){"use strict";n.d(t,{g:function(){return c}});var i=n(31635),o=n(22664),s=n(43431),r=n(95473),u=n(81629),c=function(e){function t(t,i){var o=e.call(this)||this;return o.async=t,o._continuous=!1,o._interimResults=!1,o.sound=!0,o._isEnabled=!1,o._restartTimeout=0,o._onSpeechStart=function(e){o._isEnabled&&(o.async.clearTimeout(o._restartTimeout),o._restartTimeout=o.async.setTimeout((function(){o.restart(),o.emit("pulse",!1),o._makeSound(u.Z)}),5e3),o.emit("pulse",!0))},o.__interimResults="",o._api=i,n._instances.add(o),o}var n;return(0,i.C6)(t,e),n=t,Object.defineProperty(t.prototype,"lang",{get:function(){return this._lang},set:function(e){this._lang=e,this._api.lang=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"continuous",{get:function(){return this._continuous},set:function(e){this._continuous=e,this._api.continuous=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"interimResults",{get:function(){return this._interimResults},set:function(e){this._interimResults=e,this._api.interimResults=e},enumerable:!1,configurable:!0}),t.prototype.destruct=function(){this.stop(),n._instances.delete(this),e.prototype.destruct.call(this)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},enumerable:!1,configurable:!0}),t.prototype.start=function(){var e=this;if(!this._isEnabled){this._isEnabled=!0,n._instances.forEach((function(t){t!==e&&t.stop()}));try{this._api.start()}catch(e){return this._onError(e),void this.stop()}this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onProgress).__on("end",this._onResults)}},t.prototype.stop=function(){this._isEnabled&&(this._api.abort(),this._api.stop(),this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onProgress).__off("end",this._onResults),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1))},t.prototype.toggle=function(){this._isEnabled?this.stop():this.start()},t.prototype.restart=function(){this.stop(),this.start()},t.prototype.__on=function(e,t){return this._api.addEventListener(e,t),this},t.prototype.__off=function(e,t){return this._api.removeEventListener(e,t),this},t.prototype._onResults=function(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(u.N),this.restart()},t.prototype._onProgress=function(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(var t=0;e.results.length>t;t++){var n=e.results.item(t);if(n.length){var i=n.item(0).transcript;this.__interimResults+=i}}this.__interimResults&&this.emit("progress",this.__interimResults)}},t.prototype._onError=function(e){"voice-unavailable"===e.error&&this.emit("error","Voice unavailable"),"not-allowed"===e.error&&this.emit("error","Not allowed"),"language-unavailable"!==e.error&&"language-not-supported"!==e.error||this.emit("error","Language unavailable"),this._makeSound(u.Z),this.emit("pulse",!1),this.stop()},t.prototype._makeSound=function(e){this.sound&&(0,r.s)({frequency:e})},t._instances=new Set,n=(0,i.Cg)([o.autobind],t)}(s.h)},95473:function(e,t,n){"use strict";n.d(t,{s:function(){return s}});var i=n(17352),o=n(81629);function s(e){var t=void 0===e?{}:e,n=t.sec,s=void 0===n?.1:n,r=t.frequency,u=void 0===r?o.N:r,c=t.gain,a=void 0===c?.1:c,l=t.type,p=void 0===l?"sine":l;if(i.globalWindow&&(void 0!==i.globalWindow.AudioContext||void 0!==i.globalWindow.webkitAudioContext)){var d=new(i.globalWindow.AudioContext||i.globalWindow.webkitAudioContext),h=d.createGain(),f=d.createOscillator();f.type=p,f.frequency.value=u,f.connect(h),h.connect(d.destination),f.start(),f.stop(d.currentTime+s),h.gain.value=a}}},61593:function(e){"use strict";e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},64458:function(e){"use strict";e.exports={newline:"řádek",delete:"odstranit",space:"prostora","Speech Recognize":"Rozpoznání Řeči",Sound:"Zvuk","Interim Results":"Průběžné Výsledky"}},89601:function(e){"use strict";e.exports={newline:"Zeilenumbruch",delete:"löschen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},87710:function(e){"use strict";e.exports={newline:"nueva línea",delete:"eliminar",space:"espacio","Speech Recognize":"Reconocimiento de Voz",Sound:"Sonido","Interim Results":"Resultados Provisionales"}},15603:function(e){"use strict";e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},84059:function(e){"use strict";e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"Ääni","Interim Results":"Välitulokset"}},13958:function(e){"use strict";e.exports={newline:"nouvelle ligne",delete:"supprimer",space:"espace","Speech Recognize":"Reconnaissance Vocale",Sound:"Son","Interim Results":"Résultats Intermédiaires"}},18717:function(e){"use strict";e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},14765:function(e){"use strict";e.exports={newline:"újsor",delete:"törlés",space:"tér","Speech Recognize":"A Beszéd Felismeri",Sound:"Hang","Interim Results":"Időközi Eredmények"}},77995:function(e){"use strict";e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},25202:function(e,t,n){"use strict";n.r(t),n.d(t,{ar:function(){return i},cs_cz:function(){return o},de:function(){return s},es:function(){return r},fa:function(){return u},fi:function(){return c},fr:function(){return a},he:function(){return l},hu:function(){return p},id:function(){return d},it:function(){return h},ja:function(){return f},ko:function(){return m},mn:function(){return g},nl:function(){return R},pl:function(){return _},pt_br:function(){return v},ru:function(){return S},tr:function(){return z},ua:function(){return w},zh_cn:function(){return b},zh_tw:function(){return y}});var i=n(61593),o=n(64458),s=n(89601),r=n(87710),u=n(15603),c=n(84059),a=n(13958),l=n(18717),p=n(14765),d=n(77995),h=n(92315),f=n(54711),m=n(68632),g=n(76769),R=n(3424),_=n(85454),v=n(64149),S=n(16491),z=n(48948),w=n(95700),b=n(84370),y=n(56646)},92315:function(e){"use strict";e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},54711:function(e){"use strict";e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},68632:function(e){"use strict";e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},76769:function(e){"use strict";e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},3424:function(e){"use strict";e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},85454:function(e){"use strict";e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},64149:function(e){"use strict";e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provisórios"}},16491:function(e){"use strict";e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},48948:function(e){"use strict";e.exports={newline:"yeni satır",delete:"silmek",space:"uzay","Speech Recognize":"Konuşma Tanıma",Sound:"Ses","Interim Results":"Ara Sonuçlar"}},95700:function(e){"use strict";e.exports={newline:"новая строка|перенос|ентер",delete:"видалити",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Проміжні результати"}},84370:function(e){"use strict";e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},56646:function(e){"use strict";e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},37873:function(e,t,n){"use strict";n.r(t),n.d(t,{SpeechRecognizeNative:function(){return d}});var i=n(31635),o=n(66927),s=n(55186),r=n(56298),u=n(84976),c=n(71005),a=(n(71096),n(46173)),l=n(50834),p=n(25202),d=function(e){function t(){var t=e.apply(this,(0,i.fX)([],(0,i.zs)(arguments),!1))||this;return t.buttons=[{group:"state",name:"speechRecognize"}],t._commandToWord={},t}return(0,i.C6)(t,e),t.prototype.afterInit=function(e){var t=this,n=e.o.speechRecognize.commands;n&&((0,r.JW)(p),(0,u.HP)(n,!1).forEach((function(i){i.split("|").forEach((function(o){o=o.trim().toLowerCase(),t._commandToWord[o]=n[i];var s=e.i18n(o);s!==o&&s.split("|").forEach((function(e){t._commandToWord[e.trim().toLowerCase()]=n[i].trim()}))}))})))},t.prototype.beforeDestruct=function(e){s.J.safeRemove(this.messagePopup)},t.prototype.onSpeechRecognizeProgressResult=function(e){var t=this;this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),this.j.workplace.appendChild(this.messagePopup),this.j.async.clearTimeout(this.__hidePopupTimeout),this.__hidePopupTimeout=this.j.async.setTimeout((function(){s.J.safeRemove(t.messagePopup)}),1e3),this.messagePopup.innerText=e+"|"},t.prototype.onSpeechRecognizeResult=function(e){this.j.async.clearTimeout(this.__hidePopupTimeout),s.J.safeRemove(this.messagePopup);var t=this.j,n=t.s;if(!this._checkCommand(e)){var i=n.range,o=n.current();if(n.isCollapsed()&&s.J.isText(o)&&s.J.isOrContains(t.editor,o)&&o.nodeValue){var r=o.nodeValue;o.nodeValue=r+(/[\u00A0 ]\uFEFF*$/.test(r)?"":" ")+e,i.setStartAfter(o),n.selectRange(i),t.synchronizeValues()}else n.insertHTML(e)}},t.prototype._checkCommand=function(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,l.F)(this.j,this._commandToWord[e]),!0)},(0,i.Cg)([(0,o.w)(":speechRecognizeProgressResult")],t.prototype,"onSpeechRecognizeProgressResult",null),(0,i.Cg)([(0,o.w)(":speechRecognizeResult")],t.prototype,"onSpeechRecognizeResult",null),t}(c.k);a.x.plugins.add("speech-recognize",d)},22227:function(e){e.exports='<svg viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M8,11c1.657,0,3-1.343,3-3V3c0-1.657-1.343-3-3-3S5,1.343,5,3v5C5,9.657,6.343,11,8,11z"/> <path d="M13,8V6h-1l0,1.844c0,1.92-1.282,3.688-3.164,4.071C6.266,12.438,4,10.479,4,8V6H3v2c0,2.414,1.721,4.434,4,4.899V15H5v1h6 v-1H9v-2.101C11.279,12.434,13,10.414,13,8z"/> </svg>'}},function(e){return e(e.s=37873)}])}));
|
package/esm/config.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @module config
|
|
18
18
|
*/
|
|
19
19
|
import * as consts from "./core/constants.js";
|
|
20
|
-
import { INSERT_AS_HTML } from "./core/constants.js";
|
|
20
|
+
import { globalDocument, globalWindow, INSERT_AS_HTML } from "./core/constants.js";
|
|
21
21
|
/**
|
|
22
22
|
* Default Editor's Configuration
|
|
23
23
|
*/
|
|
@@ -127,16 +127,12 @@ class Config {
|
|
|
127
127
|
showPlaceholder: false
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
|
-
this.ownerDocument =
|
|
131
|
-
? document
|
|
132
|
-
: null);
|
|
130
|
+
this.ownerDocument = globalDocument;
|
|
133
131
|
/**
|
|
134
132
|
* Allows you to specify the window in which the editor will be created. Default - window
|
|
135
133
|
* This is necessary if you are creating the editor inside an iframe but the code is running in the parent window
|
|
136
134
|
*/
|
|
137
|
-
this.ownerWindow =
|
|
138
|
-
? window
|
|
139
|
-
: null);
|
|
135
|
+
this.ownerWindow = globalWindow;
|
|
140
136
|
/**
|
|
141
137
|
* Shadow root if Jodit was created in it
|
|
142
138
|
*
|
package/esm/core/async/async.js
CHANGED
|
@@ -57,7 +57,8 @@ export class Async {
|
|
|
57
57
|
if (options.label) {
|
|
58
58
|
this.clearLabel(options.label);
|
|
59
59
|
}
|
|
60
|
-
const timer = setTimeout(callback, timeout, ...args)
|
|
60
|
+
const timer = setTimeout(callback, timeout, ...args);
|
|
61
|
+
const key = options.label || timer;
|
|
61
62
|
this.timers.set(key, timer);
|
|
62
63
|
this.__callbacks.set(key, callback);
|
|
63
64
|
return timer;
|
package/esm/core/constants.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export declare const INVISIBLE_SPACE_REG_EXP_START: () => RegExp;
|
|
|
32
32
|
export declare const SPACE_REG_EXP: () => RegExp;
|
|
33
33
|
export declare const SPACE_REG_EXP_START: () => RegExp;
|
|
34
34
|
export declare const SPACE_REG_EXP_END: () => RegExp;
|
|
35
|
+
export declare const globalWindow: typeof window;
|
|
36
|
+
export declare const globalDocument: Document;
|
|
35
37
|
export declare const IS_BLOCK: RegExp;
|
|
36
38
|
export declare const IS_INLINE: RegExp;
|
|
37
39
|
export declare const LIST_TAGS: Set<"ol" | "ul">;
|
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.2.
|
|
6
|
+
export const APP_VERSION = "4.2.32";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -22,6 +22,10 @@ export const INVISIBLE_SPACE_REG_EXP_START = () => /^[\uFEFF]+/g;
|
|
|
22
22
|
export const SPACE_REG_EXP = () => /[\s\n\t\r\uFEFF\u200b]+/g;
|
|
23
23
|
export const SPACE_REG_EXP_START = () => /^[\s\n\t\r\uFEFF\u200b]+/g;
|
|
24
24
|
export const SPACE_REG_EXP_END = () => /[\s\n\t\r\uFEFF\u200b]+$/g;
|
|
25
|
+
export const globalWindow = typeof window !== 'undefined' ? window : undefined;
|
|
26
|
+
export const globalDocument = typeof document !== 'undefined'
|
|
27
|
+
? document
|
|
28
|
+
: undefined;
|
|
25
29
|
export const IS_BLOCK = /^(ADDRESS|ARTICLE|ASIDE|BLOCKQUOTE|CANVAS|DD|DFN|DIV|DL|DT|FIELDSET|FIGCAPTION|FIGURE|FOOTER|FORM|H[1-6]|HEADER|HGROUP|HR|LI|MAIN|NAV|NOSCRIPT|OUTPUT|P|PRE|RUBY|SCRIPT|STYLE|OBJECT|OL|SECTION|IFRAME|JODIT|JODIT-MEDIA|UL|TR|TD|TH|TBODY|THEAD|TFOOT|TABLE|BODY|HTML|VIDEO)$/i;
|
|
26
30
|
export const IS_INLINE = /^(STRONG|SPAN|I|EM|B|SUP|SUB|A|U)$/i;
|
|
27
31
|
export const LIST_TAGS = new Set(['ul', 'ol']);
|
|
@@ -146,8 +150,8 @@ export const INSERT_AS_TEXT = 'insert_as_text';
|
|
|
146
150
|
*/
|
|
147
151
|
export const INSERT_ONLY_TEXT = 'insert_only_text';
|
|
148
152
|
export const SAFE_COUNT_CHANGE_CALL = 10;
|
|
149
|
-
export const IS_MAC = typeof
|
|
150
|
-
/Mac|iPod|iPhone|iPad/.test(
|
|
153
|
+
export const IS_MAC = typeof globalWindow !== 'undefined' &&
|
|
154
|
+
/Mac|iPod|iPhone|iPad/.test(globalWindow.navigator.platform);
|
|
151
155
|
export const KEY_ALIASES = {
|
|
152
156
|
add: '+',
|
|
153
157
|
break: 'pause',
|
|
@@ -165,8 +169,8 @@ export const KEY_ALIASES = {
|
|
|
165
169
|
option: 'alt',
|
|
166
170
|
return: 'enter',
|
|
167
171
|
right: 'arrowright',
|
|
168
|
-
space: '
|
|
169
|
-
spacebar: '
|
|
172
|
+
space: 'space',
|
|
173
|
+
spacebar: 'space',
|
|
170
174
|
up: 'arrowup',
|
|
171
175
|
win: 'meta',
|
|
172
176
|
windows: 'meta'
|
|
@@ -175,7 +179,7 @@ export const BASE_PATH = (() => {
|
|
|
175
179
|
if (typeof document === 'undefined') {
|
|
176
180
|
return '';
|
|
177
181
|
}
|
|
178
|
-
const script =
|
|
182
|
+
const script = globalDocument.currentScript, removeScriptName = (s) => {
|
|
179
183
|
const parts = s.split('/');
|
|
180
184
|
if (/\.js/.test(parts[parts.length - 1])) {
|
|
181
185
|
return parts.slice(0, parts.length - 1).join('/') + '/';
|
|
@@ -185,11 +189,11 @@ export const BASE_PATH = (() => {
|
|
|
185
189
|
if (script) {
|
|
186
190
|
return removeScriptName(script.src);
|
|
187
191
|
}
|
|
188
|
-
const scripts =
|
|
192
|
+
const scripts = globalDocument.querySelectorAll('script[src]');
|
|
189
193
|
if (scripts && scripts.length) {
|
|
190
194
|
return removeScriptName(scripts[scripts.length - 1].src);
|
|
191
195
|
}
|
|
192
|
-
return
|
|
196
|
+
return globalWindow.location.href;
|
|
193
197
|
})();
|
|
194
198
|
export const TEMP_ATTR = 'data-jodit-temp';
|
|
195
199
|
export const lang = {};
|
|
@@ -46,7 +46,6 @@ export function watch(observeFields, opts) {
|
|
|
46
46
|
const [objectPath, eventName] = field.split(':');
|
|
47
47
|
let ctx = context;
|
|
48
48
|
if (objectPath.length) {
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
50
49
|
ctx = component.get(objectPath);
|
|
51
50
|
}
|
|
52
51
|
if (isFunction(ctx)) {
|
package/esm/core/dom/dom.d.ts
CHANGED
|
@@ -45,8 +45,9 @@ export declare class Dom {
|
|
|
45
45
|
* // Replace the first <span> element to the < p >
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
+
static replace<T extends HTMLElement>(elm: Node, newTagName: HTMLTagNames): T;
|
|
48
49
|
static replace<T extends HTMLElement>(elm: Node, newTagName: HTMLTagNames, create: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
|
|
49
|
-
static replace<T extends Node>(elm: Node, newTagName: T | string, create
|
|
50
|
+
static replace<T extends Node>(elm: Node, newTagName: T | string, create?: ICreate, withAttributes?: boolean, notMoveContent?: boolean): T;
|
|
50
51
|
/**
|
|
51
52
|
* Checks whether the Node text and blank (in this case it may contain invisible auxiliary characters ,
|
|
52
53
|
* it is also empty )
|
package/esm/core/dom/dom.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
import * as consts from "../constants.js";
|
|
7
|
-
import { INSEPARABLE_TAGS, LIST_TAGS, NO_EMPTY_TAGS, TEMP_ATTR } from "../constants.js";
|
|
7
|
+
import { globalDocument, INSEPARABLE_TAGS, LIST_TAGS, NO_EMPTY_TAGS, TEMP_ATTR } from "../constants.js";
|
|
8
8
|
import { toArray } from "../helpers/array/to-array.js";
|
|
9
9
|
import { isArray, isFunction, isHTML, isMarker, isSet, isString, isVoid } from "../helpers/checker/index.js";
|
|
10
10
|
import { trim } from "../helpers/string/trim.js";
|
|
11
|
-
import { $$, attr, call, css, dataBind, error } from "../helpers/utils/index.js";
|
|
11
|
+
import { $$, assert, attr, call, css, dataBind, error } from "../helpers/utils/index.js";
|
|
12
12
|
/**
|
|
13
13
|
* Module for working with DOM
|
|
14
14
|
*/
|
|
@@ -115,11 +115,17 @@ export class Dom {
|
|
|
115
115
|
}
|
|
116
116
|
static replace(elm, newTagName, create, withAttributes = false, notMoveContent = false) {
|
|
117
117
|
if (isHTML(newTagName)) {
|
|
118
|
+
assert(create, 'Need create instance for new tag');
|
|
118
119
|
newTagName = create.fromHTML(newTagName);
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
let tag;
|
|
122
|
+
if (isString(newTagName)) {
|
|
123
|
+
assert(create, 'Need create instance for new tag');
|
|
124
|
+
tag = create.element(newTagName);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
tag = newTagName;
|
|
128
|
+
}
|
|
123
129
|
if (!notMoveContent) {
|
|
124
130
|
while (elm.firstChild) {
|
|
125
131
|
tag.appendChild(elm.firstChild);
|
|
@@ -579,7 +585,7 @@ export class Dom {
|
|
|
579
585
|
* Move all content to another element
|
|
580
586
|
*/
|
|
581
587
|
static moveContent(from, to, inStart = false, filter = () => true) {
|
|
582
|
-
const fragment = (from.ownerDocument ||
|
|
588
|
+
const fragment = (from.ownerDocument || globalDocument).createDocumentFragment();
|
|
583
589
|
toArray(from.childNodes)
|
|
584
590
|
.filter(elm => {
|
|
585
591
|
if (filter(elm)) {
|
|
@@ -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
|
-
import { PASSIVE_EVENTS } from "../constants.js";
|
|
6
|
+
import { globalDocument, PASSIVE_EVENTS } from "../constants.js";
|
|
7
7
|
import { splitArray } from "../helpers/array/split-array.js";
|
|
8
8
|
import { isArray } from "../helpers/checker/is-array.js";
|
|
9
9
|
import { isFunction } from "../helpers/checker/is-function.js";
|
|
@@ -179,7 +179,7 @@ export class EventEmitter {
|
|
|
179
179
|
passive: true,
|
|
180
180
|
capture: options?.capture ?? false
|
|
181
181
|
}
|
|
182
|
-
: options?.capture ?? false;
|
|
182
|
+
: (options?.capture ?? false);
|
|
183
183
|
syntheticCallback.options = eOpts;
|
|
184
184
|
subject.addEventListener(event, syntheticCallback, eOpts);
|
|
185
185
|
this.__memoryDOMSubjectToHandler(subject, syntheticCallback);
|
|
@@ -410,7 +410,7 @@ export class EventEmitter {
|
|
|
410
410
|
this.__domEventsMap = new Map();
|
|
411
411
|
this.__mutedEvents = new Set();
|
|
412
412
|
this.__key = '__JoditEventEmitterNamespaces';
|
|
413
|
-
this.__doc =
|
|
413
|
+
this.__doc = globalDocument;
|
|
414
414
|
this.__prepareEvent = (e) => {
|
|
415
415
|
if (e.cancelBubble) {
|
|
416
416
|
return;
|
package/esm/core/global.js
CHANGED
|
@@ -55,9 +55,20 @@ export function getContainer(jodit, classFunc, tag = 'div', createInsideEditor =
|
|
|
55
55
|
const data = boxes.get(jodit) || {}, key = name + tag;
|
|
56
56
|
const view = isViewObject(jodit) ? jodit : jodit.j;
|
|
57
57
|
if (!data[key]) {
|
|
58
|
-
let c = view.c
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
let c = view.c;
|
|
59
|
+
let body;
|
|
60
|
+
if (isJoditObject(jodit) && jodit.o.shadowRoot) {
|
|
61
|
+
body = jodit.o.shadowRoot;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
body = jodit.od.body;
|
|
65
|
+
if (isJoditObject(jodit)) {
|
|
66
|
+
const dialog = Dom.closest(jodit.container, 'dialog', jodit.od.body);
|
|
67
|
+
if (dialog) {
|
|
68
|
+
body = dialog;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
61
72
|
if (createInsideEditor &&
|
|
62
73
|
isJoditObject(jodit) &&
|
|
63
74
|
jodit.od !== jodit.ed) {
|
|
@@ -75,6 +86,7 @@ export function getContainer(jodit, classFunc, tag = 'div', createInsideEditor =
|
|
|
75
86
|
body.appendChild(box);
|
|
76
87
|
data[key] = box;
|
|
77
88
|
jodit.hookStatus('beforeDestruct', () => {
|
|
89
|
+
view.events.off(box);
|
|
78
90
|
Dom.safeRemove(box);
|
|
79
91
|
delete data[key];
|
|
80
92
|
if (Object.keys(data).length) {
|
|
@@ -82,6 +94,7 @@ export function getContainer(jodit, classFunc, tag = 'div', createInsideEditor =
|
|
|
82
94
|
}
|
|
83
95
|
});
|
|
84
96
|
boxes.set(jodit, data);
|
|
97
|
+
view.events.fire('getContainer', box);
|
|
85
98
|
}
|
|
86
99
|
data[key].classList.remove('jodit_theme_default', 'jodit_theme_dark');
|
|
87
100
|
data[key].classList.add(`jodit_theme_${view.o.theme || 'default'}`);
|
|
@@ -12,9 +12,4 @@
|
|
|
12
12
|
* Jodit.modules.Helpers.toArray(1) // []
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
export declare const toArray:
|
|
16
|
-
<T>(arrayLike: ArrayLike<T>): T[];
|
|
17
|
-
<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
18
|
-
<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
19
|
-
<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
20
|
-
};
|
|
15
|
+
export declare const toArray: typeof Array.from;
|
|
@@ -20,6 +20,6 @@ import { reset } from "../utils/reset.js";
|
|
|
20
20
|
export const toArray = function toArray(...args) {
|
|
21
21
|
const func = isNativeFunction(Array.from)
|
|
22
22
|
? Array.from
|
|
23
|
-
: reset('Array.from') ?? Array.from;
|
|
23
|
+
: (reset('Array.from') ?? Array.from);
|
|
24
24
|
return func.apply(Array, args);
|
|
25
25
|
};
|
|
@@ -3,9 +3,6 @@
|
|
|
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
|
-
/**
|
|
7
|
-
* @module helpers/async
|
|
8
|
-
*/
|
|
9
6
|
/**
|
|
10
7
|
* Create async callback if set timeout value - else call function immediately
|
|
11
8
|
*/
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module helpers/async
|
|
8
8
|
*/
|
|
9
|
+
import { globalWindow } from "../../constants.js";
|
|
9
10
|
/**
|
|
10
11
|
* Create async callback if set timeout value - else call function immediately
|
|
11
12
|
*/
|
|
@@ -14,7 +15,7 @@ export function setTimeout(callback, timeout, ...args) {
|
|
|
14
15
|
callback.call(null, ...args);
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
|
-
return
|
|
18
|
+
return globalWindow.setTimeout(callback, timeout, ...args);
|
|
18
19
|
}
|
|
19
20
|
return 0;
|
|
20
21
|
}
|
|
@@ -22,5 +23,5 @@ export function setTimeout(callback, timeout, ...args) {
|
|
|
22
23
|
* Clear timeout
|
|
23
24
|
*/
|
|
24
25
|
export function clearTimeout(timer) {
|
|
25
|
-
|
|
26
|
+
globalWindow.clearTimeout(timer);
|
|
26
27
|
}
|
|
@@ -3,9 +3,6 @@
|
|
|
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
|
-
/**
|
|
7
|
-
* @module helpers/checker
|
|
8
|
-
*/
|
|
9
6
|
/**
|
|
10
7
|
* Check if browser has a color picker (a new HTML5 attribute for input tag)
|
|
11
8
|
*/
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module helpers/checker
|
|
8
8
|
*/
|
|
9
|
+
import { globalDocument } from "../../constants.js";
|
|
9
10
|
/**
|
|
10
11
|
* Check if browser has a color picker (a new HTML5 attribute for input tag)
|
|
11
12
|
*/
|
|
12
13
|
export function hasBrowserColorPicker() {
|
|
13
14
|
let supportsColor = true;
|
|
14
15
|
try {
|
|
15
|
-
const a =
|
|
16
|
+
const a = globalDocument.createElement('input');
|
|
16
17
|
a.type = 'color';
|
|
17
18
|
a.value = '!';
|
|
18
19
|
supportsColor = a.type === 'color' && a.value !== '!';
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module helpers/checker
|
|
8
8
|
*/
|
|
9
|
+
import { globalDocument } from "../../constants.js";
|
|
9
10
|
/**
|
|
10
11
|
* Check if a string is an url
|
|
11
12
|
*/
|
|
@@ -22,7 +23,7 @@ export function isURL(str) {
|
|
|
22
23
|
return false;
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
|
-
const a =
|
|
26
|
+
const a = globalDocument.createElement('a');
|
|
26
27
|
a.href = str;
|
|
27
28
|
return Boolean(a.hostname);
|
|
28
29
|
}
|