jodit 4.2.21 → 4.2.24
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 +9 -5
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +2 -2
- 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 +3 -2
- package/es2015/plugins/speech-recognize/speech-recognize.js +125 -95
- package/es2015/plugins/speech-recognize/speech-recognize.min.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.css +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +2 -2
- 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 +3 -2
- package/es2018/plugins/speech-recognize/speech-recognize.js +125 -95
- package/es2018/plugins/speech-recognize/speech-recognize.min.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +2 -2
- 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 +3 -2
- package/es2021/plugins/speech-recognize/speech-recognize.js +124 -95
- package/es2021/plugins/speech-recognize/speech-recognize.min.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +2 -2
- 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 +3 -2
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +124 -95
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +2 -2
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +3 -2
- package/es5/plugins/speech-recognize/speech-recognize.js +126 -97
- package/es5/plugins/speech-recognize/speech-recognize.min.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/esm/core/constants.js +1 -1
- package/esm/plugins/speech-recognize/config.d.ts +1 -1
- package/esm/plugins/speech-recognize/config.js +18 -6
- package/esm/plugins/speech-recognize/helpers/recognize-manager.d.ts +3 -2
- package/esm/plugins/speech-recognize/helpers/recognize-manager.js +47 -31
- package/esm/plugins/speech-recognize/interface.d.ts +2 -0
- package/esm/plugins/speech-recognize/speech-recognize.d.ts +5 -1
- package/esm/plugins/speech-recognize/speech-recognize.js +17 -17
- package/package.json +1 -1
- package/types/plugins/speech-recognize/config.d.ts +1 -1
- package/types/plugins/speech-recognize/helpers/recognize-manager.d.ts +3 -2
- package/types/plugins/speech-recognize/interface.d.ts +2 -0
- package/types/plugins/speech-recognize/speech-recognize.d.ts +5 -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.24
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -33,10 +33,11 @@ svg.jodit-icon_speechRecognize {
|
|
|
33
33
|
position: absolute;
|
|
34
34
|
top: 50%;
|
|
35
35
|
left: 50%;
|
|
36
|
-
padding:
|
|
36
|
+
padding: 8px 16px;
|
|
37
37
|
border-radius: 8px;
|
|
38
38
|
background-color: rgba(240, 240, 240, 0.4);
|
|
39
39
|
font-size: 32px;
|
|
40
|
+
line-height: 1.5;
|
|
40
41
|
transform: translate(-50%, -50%);
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -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.24
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -22,14 +22,16 @@ return (self["webpackChunkjodit"] = self["webpackChunkjodit"] || []).push([[882]
|
|
|
22
22
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
23
23
|
|
|
24
24
|
"use strict";
|
|
25
|
-
/* harmony import */ var
|
|
26
|
-
/* harmony import */ var
|
|
27
|
-
/* harmony import */ var
|
|
28
|
-
/* harmony import */ var
|
|
29
|
-
/* harmony import */ var
|
|
30
|
-
/* harmony import */ var
|
|
31
|
-
/* harmony import */ var
|
|
32
|
-
/* harmony import */ var
|
|
25
|
+
/* harmony import */ var jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9810);
|
|
26
|
+
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(98253);
|
|
27
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26150);
|
|
28
|
+
/* harmony import */ var jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(72197);
|
|
29
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(931);
|
|
30
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36115);
|
|
31
|
+
/* harmony import */ var _helpers_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71722);
|
|
32
|
+
/* harmony import */ var _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93676);
|
|
33
|
+
/* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(22227);
|
|
34
|
+
/* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_6__);
|
|
33
35
|
/*!
|
|
34
36
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
35
37
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -42,10 +44,12 @@ return (self["webpackChunkjodit"] = self["webpackChunkjodit"] || []).push([[882]
|
|
|
42
44
|
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_3__/* .Config */ .T.prototype.speechRecognize = {
|
|
50
|
+
api: typeof _helpers_api__WEBPACK_IMPORTED_MODULE_4__/* .SpeechRecognition */ .o !== 'undefined' ? _helpers_api__WEBPACK_IMPORTED_MODULE_4__/* .SpeechRecognition */ .o : null,
|
|
47
51
|
sound: true,
|
|
48
|
-
continuous:
|
|
52
|
+
continuous: false,
|
|
49
53
|
interimResults: true,
|
|
50
54
|
commands: {
|
|
51
55
|
'newline|enter': 'enter',
|
|
@@ -61,42 +65,49 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.speechRecogn
|
|
|
61
65
|
'select all': 'selectall'
|
|
62
66
|
}
|
|
63
67
|
};
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_2__/* .Icon */ .I.set('speech-recognize', (_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_6___default()));
|
|
69
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_3__/* .Config */ .T.prototype.controls.speechRecognize = {
|
|
70
|
+
isVisible(j) {
|
|
71
|
+
return Boolean(j.o.speechRecognize.api);
|
|
72
|
+
},
|
|
66
73
|
isActive(jodit, _) {
|
|
67
|
-
const api = (0,
|
|
74
|
+
const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_1__/* .dataBind */ .m)(jodit, 'speech');
|
|
68
75
|
return Boolean(api?.isEnabled);
|
|
69
76
|
},
|
|
70
77
|
isDisabled(jodit) {
|
|
71
78
|
return !jodit.o.speechRecognize.api;
|
|
72
79
|
},
|
|
73
80
|
exec(jodit, current, { button, control }) {
|
|
74
|
-
const { api:
|
|
75
|
-
if (!
|
|
81
|
+
const { api: ApiConstructor, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
|
|
82
|
+
if (!ApiConstructor) {
|
|
76
83
|
jodit.alert('Speech recognize API unsupported in your browser');
|
|
77
84
|
return;
|
|
78
85
|
}
|
|
79
|
-
let api = (0,
|
|
86
|
+
let api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_1__/* .dataBind */ .m)(jodit, 'speech');
|
|
80
87
|
if (!api) {
|
|
81
|
-
const nativeApi = new
|
|
82
|
-
api = new
|
|
83
|
-
api.lang = lang
|
|
88
|
+
const nativeApi = new ApiConstructor();
|
|
89
|
+
api = new _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_5__/* .RecognizeManager */ .g(jodit.async, nativeApi);
|
|
90
|
+
api.lang = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_7__/* .isString */ .K)(lang)
|
|
91
|
+
? lang
|
|
92
|
+
: (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_0__/* .attr */ .C)(jodit.od.documentElement, 'lang') ?? undefined;
|
|
84
93
|
api.continuous = continuous;
|
|
85
94
|
api.interimResults = interimResults;
|
|
86
95
|
api.sound = sound;
|
|
87
|
-
(0,
|
|
96
|
+
(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_1__/* .dataBind */ .m)(jodit, 'speech', api);
|
|
88
97
|
api.on('pulse', (enable) => {
|
|
89
98
|
button.setMod('pulse', enable);
|
|
90
99
|
});
|
|
91
100
|
api.on('result', (text) => jodit.e.fire('speechRecognizeResult', text));
|
|
92
101
|
api.on('progress', (text) => jodit.e.fire('speechRecognizeProgressResult', text));
|
|
102
|
+
api.on('error', (text) => jodit.message.error(text));
|
|
93
103
|
button.hookStatus('beforeDestruct', () => {
|
|
104
|
+
(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_1__/* .dataBind */ .m)(jodit, 'speech', null);
|
|
94
105
|
api.destruct();
|
|
95
106
|
});
|
|
96
107
|
}
|
|
97
108
|
if (control.args) {
|
|
98
109
|
const key = control.args[0];
|
|
99
|
-
if ((0,
|
|
110
|
+
if ((0,jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_8__/* .isBoolean */ .L)(api[key])) {
|
|
100
111
|
api[key] = !api[key];
|
|
101
112
|
if (api.isEnabled) {
|
|
102
113
|
api.restart();
|
|
@@ -105,6 +116,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.spe
|
|
|
105
116
|
}
|
|
106
117
|
}
|
|
107
118
|
api.toggle();
|
|
119
|
+
if (api.isEnabled) {
|
|
120
|
+
button.setMod('pulse', true);
|
|
121
|
+
}
|
|
108
122
|
button.state.activated = api.isEnabled;
|
|
109
123
|
},
|
|
110
124
|
name: 'speechRecognize',
|
|
@@ -115,7 +129,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.spe
|
|
|
115
129
|
interimResults: 'Interim Results'
|
|
116
130
|
},
|
|
117
131
|
childTemplate(jodit, key, value) {
|
|
118
|
-
const api = (0,
|
|
132
|
+
const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_1__/* .dataBind */ .m)(jodit, 'speech'), checked = api?.[key] ?? jodit.o.speechRecognize[key];
|
|
119
133
|
return `<span class='jodit-speech-recognize__list-item'><input ${checked ? 'checked' : ''} class='jodit-checkbox' type='checkbox'> ${value}</span>`;
|
|
120
134
|
},
|
|
121
135
|
mods: {
|
|
@@ -252,7 +266,7 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
|
|
|
252
266
|
}, 5000);
|
|
253
267
|
this.emit('pulse', true);
|
|
254
268
|
};
|
|
255
|
-
this.
|
|
269
|
+
this.__interimResults = '';
|
|
256
270
|
this._api = api;
|
|
257
271
|
RecognizeManager_1._instances.add(this);
|
|
258
272
|
}
|
|
@@ -274,23 +288,29 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
|
|
|
274
288
|
instance.stop();
|
|
275
289
|
}
|
|
276
290
|
});
|
|
277
|
-
|
|
291
|
+
try {
|
|
292
|
+
this._api.start();
|
|
293
|
+
}
|
|
294
|
+
catch (e) {
|
|
295
|
+
this._onError(e);
|
|
296
|
+
this.stop();
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
278
299
|
this.__on('speechstart', this._onSpeechStart)
|
|
279
300
|
.__on('error', this._onError)
|
|
280
|
-
.__on('result', this.
|
|
301
|
+
.__on('result', this._onProgress)
|
|
302
|
+
.__on('end', this._onResults);
|
|
281
303
|
}
|
|
282
304
|
stop() {
|
|
283
305
|
if (!this._isEnabled) {
|
|
284
306
|
return;
|
|
285
307
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
this._api.stop();
|
|
289
|
-
}
|
|
290
|
-
catch { }
|
|
308
|
+
this._api.abort();
|
|
309
|
+
this._api.stop();
|
|
291
310
|
this.__off('speechstart', this._onSpeechStart)
|
|
292
311
|
.__off('error', this._onError)
|
|
293
|
-
.__off('result', this.
|
|
312
|
+
.__off('result', this._onProgress)
|
|
313
|
+
.__off('end', this._onResults);
|
|
294
314
|
this.async.clearTimeout(this._restartTimeout);
|
|
295
315
|
this._isEnabled = false;
|
|
296
316
|
this.emit('pulse', false);
|
|
@@ -315,37 +335,47 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
|
|
|
315
335
|
this._api.removeEventListener(event, callback);
|
|
316
336
|
return this;
|
|
317
337
|
}
|
|
318
|
-
|
|
338
|
+
_onResults(e) {
|
|
339
|
+
this.emit('pulse', false);
|
|
340
|
+
this.emit('result', this.__interimResults);
|
|
341
|
+
this.__interimResults = '';
|
|
342
|
+
this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_2__/* .PII */ .N);
|
|
343
|
+
this.restart();
|
|
344
|
+
}
|
|
345
|
+
_onProgress(e) {
|
|
319
346
|
if (!this._isEnabled) {
|
|
320
347
|
return;
|
|
321
348
|
}
|
|
322
|
-
this.
|
|
323
|
-
|
|
324
|
-
const { transcript } = resultItem.item(0);
|
|
325
|
-
const resultHandler = () => {
|
|
326
|
-
try {
|
|
327
|
-
this.async.clearTimeout(this._restartTimeout);
|
|
328
|
-
this.emit('result', transcript);
|
|
329
|
-
}
|
|
330
|
-
catch { }
|
|
331
|
-
this.restart();
|
|
332
|
-
this.emit('pulse', false);
|
|
333
|
-
this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_2__/* .PII */ .N);
|
|
334
|
-
};
|
|
335
|
-
if (resultItem.isFinal === false) {
|
|
336
|
-
this.emit('progress', transcript);
|
|
337
|
-
this._progressTimeout = this.async.setTimeout(resultHandler, 500);
|
|
349
|
+
this.__interimResults = '';
|
|
350
|
+
if (!e.results) {
|
|
338
351
|
return;
|
|
339
352
|
}
|
|
340
|
-
|
|
353
|
+
for (let i = 0; i < e.results.length; i++) {
|
|
354
|
+
const resultItem = e.results.item(i);
|
|
355
|
+
if (resultItem.length) {
|
|
356
|
+
const { transcript } = resultItem.item(0);
|
|
357
|
+
this.__interimResults += transcript;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (this.__interimResults) {
|
|
361
|
+
this.emit('progress', this.__interimResults);
|
|
362
|
+
}
|
|
341
363
|
}
|
|
342
|
-
_onError() {
|
|
343
|
-
if (
|
|
344
|
-
|
|
364
|
+
_onError(e) {
|
|
365
|
+
if (e.error === 'voice-unavailable') {
|
|
366
|
+
this.emit('error', 'Voice unavailable');
|
|
367
|
+
}
|
|
368
|
+
if (e.error === 'not-allowed') {
|
|
369
|
+
this.emit('error', 'Not allowed');
|
|
370
|
+
}
|
|
371
|
+
if (e.error === 'language-unavailable' ||
|
|
372
|
+
// @ts-ignore
|
|
373
|
+
e.error === 'language-not-supported') {
|
|
374
|
+
this.emit('error', 'Language unavailable');
|
|
345
375
|
}
|
|
346
376
|
this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_2__/* .WARN */ .Z);
|
|
347
377
|
this.emit('pulse', false);
|
|
348
|
-
this.
|
|
378
|
+
this.stop();
|
|
349
379
|
}
|
|
350
380
|
_makeSound(frequency) {
|
|
351
381
|
if (this.sound) {
|
|
@@ -976,17 +1006,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
976
1006
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
977
1007
|
/* harmony export */ SpeechRecognizeNative: function() { return /* binding */ SpeechRecognizeNative; }
|
|
978
1008
|
/* harmony export */ });
|
|
979
|
-
/* harmony import */ var
|
|
980
|
-
/* harmony import */ var
|
|
981
|
-
/* harmony import */ var
|
|
982
|
-
/* harmony import */ var
|
|
983
|
-
/* harmony import */ var
|
|
984
|
-
/* harmony import */ var
|
|
985
|
-
/* harmony import */ var
|
|
986
|
-
/* harmony import */ var
|
|
987
|
-
/* harmony import */ var
|
|
988
|
-
/* harmony import */ var
|
|
989
|
-
/* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(25202);
|
|
1009
|
+
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31635);
|
|
1010
|
+
/* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66927);
|
|
1011
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
|
|
1012
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
|
|
1013
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84976);
|
|
1014
|
+
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71005);
|
|
1015
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71096);
|
|
1016
|
+
/* harmony import */ var _jodit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46173);
|
|
1017
|
+
/* harmony import */ var _helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(50834);
|
|
1018
|
+
/* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(25202);
|
|
990
1019
|
/*!
|
|
991
1020
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
992
1021
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -1003,23 +1032,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1003
1032
|
|
|
1004
1033
|
|
|
1005
1034
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
if (j.o.speechRecognize.api) {
|
|
1012
|
-
j.registerButton({
|
|
1035
|
+
class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
|
|
1036
|
+
constructor() {
|
|
1037
|
+
super(...arguments);
|
|
1038
|
+
this.buttons = [
|
|
1039
|
+
{
|
|
1013
1040
|
group: 'state',
|
|
1014
1041
|
name: 'speechRecognize'
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1042
|
+
}
|
|
1043
|
+
];
|
|
1044
|
+
this._commandToWord = {};
|
|
1017
1045
|
}
|
|
1018
1046
|
afterInit(jodit) {
|
|
1019
1047
|
const { commands } = jodit.o.speechRecognize;
|
|
1020
1048
|
if (commands) {
|
|
1021
|
-
(0,
|
|
1022
|
-
(0,
|
|
1049
|
+
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_7__);
|
|
1050
|
+
(0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_3__/* .keys */ .HP)(commands, false).forEach(words => {
|
|
1023
1051
|
const keys = words.split('|');
|
|
1024
1052
|
keys.forEach(key => {
|
|
1025
1053
|
key = key.trim().toLowerCase();
|
|
@@ -1034,28 +1062,30 @@ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5
|
|
|
1034
1062
|
});
|
|
1035
1063
|
}
|
|
1036
1064
|
}
|
|
1037
|
-
beforeDestruct(jodit) {
|
|
1065
|
+
beforeDestruct(jodit) {
|
|
1066
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.safeRemove(this.messagePopup);
|
|
1067
|
+
}
|
|
1038
1068
|
onSpeechRecognizeProgressResult(text) {
|
|
1039
1069
|
if (!this.messagePopup) {
|
|
1040
1070
|
this.messagePopup = this.j.create.div('jodit-speech-recognize__popup');
|
|
1041
1071
|
}
|
|
1042
1072
|
this.j.workplace.appendChild(this.messagePopup);
|
|
1043
|
-
this.j.async.
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
timeout: 1000
|
|
1048
|
-
});
|
|
1073
|
+
this.j.async.clearTimeout(this.__hidePopupTimeout);
|
|
1074
|
+
this.__hidePopupTimeout = this.j.async.setTimeout(() => {
|
|
1075
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.safeRemove(this.messagePopup);
|
|
1076
|
+
}, 1000);
|
|
1049
1077
|
this.messagePopup.innerText = text + '|';
|
|
1050
1078
|
}
|
|
1051
1079
|
onSpeechRecognizeResult(text) {
|
|
1052
|
-
|
|
1053
|
-
|
|
1080
|
+
this.j.async.clearTimeout(this.__hidePopupTimeout);
|
|
1081
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.safeRemove(this.messagePopup);
|
|
1082
|
+
const { j } = this;
|
|
1083
|
+
const { s } = j;
|
|
1054
1084
|
if (!this._checkCommand(text)) {
|
|
1055
1085
|
const { range } = s, node = s.current();
|
|
1056
1086
|
if (s.isCollapsed() &&
|
|
1057
|
-
|
|
1058
|
-
|
|
1087
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(node) &&
|
|
1088
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isOrContains(j.editor, node) &&
|
|
1059
1089
|
node.nodeValue) {
|
|
1060
1090
|
const sentence = node.nodeValue;
|
|
1061
1091
|
node.nodeValue =
|
|
@@ -1074,20 +1104,19 @@ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5
|
|
|
1074
1104
|
_checkCommand(command) {
|
|
1075
1105
|
command = command.toLowerCase().replace(/\./g, '');
|
|
1076
1106
|
if (this._commandToWord[command]) {
|
|
1077
|
-
(0,
|
|
1107
|
+
(0,_helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_8__/* .execSpellCommand */ .F)(this.j, this._commandToWord[command]);
|
|
1078
1108
|
return true;
|
|
1079
1109
|
}
|
|
1080
1110
|
return false;
|
|
1081
1111
|
}
|
|
1082
1112
|
}
|
|
1083
|
-
(0,
|
|
1084
|
-
(0,
|
|
1085
|
-
(0,jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_0__/* .debounce */ .s)()
|
|
1113
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
1114
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':speechRecognizeProgressResult')
|
|
1086
1115
|
], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
|
|
1087
|
-
(0,
|
|
1088
|
-
(0,
|
|
1116
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
1117
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':speechRecognizeResult')
|
|
1089
1118
|
], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
|
|
1090
|
-
|
|
1119
|
+
_jodit__WEBPACK_IMPORTED_MODULE_6__/* .Jodit */ .x.plugins.add('speech-recognize', SpeechRecognizeNative);
|
|
1091
1120
|
|
|
1092
1121
|
|
|
1093
1122
|
/***/ }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes a{0%{fill:green;opacity:.3}to{fill:#4285f4}}svg.jodit-icon_speechRecognize{stroke:none!important}.jodit-toolbar-button_pulse_true svg{animation-duration:.7s;animation-iteration-count:infinite;animation-name:a}.jodit-speech-recognize__list-item{display:flex;padding:var(--jd-padding-default)}.jodit-speech-recognize__popup{background-color:hsla(0,0%,94%,.4);border-radius:8px;font-family:var(--jd-font-default);font-size:var(--jd-font-size-default);font-size:32px;left:50%;padding:
|
|
1
|
+
@keyframes a{0%{fill:green;opacity:.3}to{fill:#4285f4}}svg.jodit-icon_speechRecognize{stroke:none!important}.jodit-toolbar-button_pulse_true svg{animation-duration:.7s;animation-iteration-count:infinite;animation-name:a}.jodit-speech-recognize__list-item{display:flex;padding:var(--jd-padding-default)}.jodit-speech-recognize__popup{background-color:hsla(0,0%,94%,.4);border-radius:8px;font-family:var(--jd-font-default);font-size:var(--jd-font-size-default);font-size:32px;left:50%;line-height:1.5;padding:8px 16px;position:absolute;top:50%;transform:translate(-50%,-50%)}
|
|
@@ -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.24
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var n in s)("object"==typeof exports?exports:e)[n]=s[n]}})(self,(function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{71096(e,t,s){"use strict";var n=s(9810),i=s(72197),r=s(931),o=s(36115),c=s(71722),u=s(93676),a=s(22227),l=s.n(a);o.T.prototype.speechRecognize={api:c.o,sound:!0,continuous:!0,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"}},r.I.set("speech-recognize",l()),o.T.prototype.controls.speechRecognize={isActive(e,t){const s=(0,i.m)(e,"speech");return!!s?.isEnabled},isDisabled:e=>!e.o.speechRecognize.api,exec(e,t,{button:s,control:r}){const{api:o,lang:c,continuous:a,interimResults:l,sound:p}=e.o.speechRecognize;if(!o)return void e.alert("Speech recognize API unsupported in your browser");let h=(0,i.m)(e,"speech");if(!h){const t=new o;h=new u.g(e.async,t),h.lang=c,h.continuous=a,h.interimResults=l,h.sound=p,(0,i.m)(e,"speech",h),h.on("pulse",(e=>{s.setMod("pulse",e)})),h.on("result",(t=>e.e.fire("speechRecognizeResult",t))),h.on("progress",(t=>e.e.fire("speechRecognizeProgressResult",t))),s.hookStatus("beforeDestruct",(()=>{h.destruct()}))}if(r.args){const e=r.args[0];if((0,n.L)(h[e]))return h[e]=!h[e],void(h.isEnabled&&h.restart())}h.toggle(),s.state.activated=h.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate(e,t,s){const n=(0,i.m)(e,"speech");return`<span class='jodit-speech-recognize__list-item'><input ${n?.[t]??e.o.speechRecognize[t]?"checked":""} class='jodit-checkbox' type='checkbox'> ${s}</span>`},mods:{stroke:!1}}},81629(e,t,s){"use strict";s.d(t,{N(){return n},Z(){return i}});const n=440,i=940},71722(e,t,s){"use strict";s.d(t,{o(){return n}});const n=window.SpeechRecognition||window.webkitSpeechRecognition},50834(e,t,s){"use strict";function n(e,t){const[s,n]=t.split("::");e.execCommand(s,null,n)}s.d(t,{F(){return n}})},93676(e,t,s){"use strict";s.d(t,{g(){return a}});var n,i=s(31635),r=s(22664),o=s(43431),c=s(95473),u=s(81629);let a=n=class e extends o.h{set lang(e){this._lang=e,this._api.lang=e}get lang(){return this._lang}set continuous(e){this._continuous=e,this._api.continuous=e}get continuous(){return this._continuous}set interimResults(e){this._interimResults=e,this._api.interimResults=e}get interimResults(){return this._interimResults}constructor(e,t){super(),this.async=e,this._continuous=!1,this._interimResults=!1,this.sound=!0,this._isEnabled=!1,this._restartTimeout=0,this._onSpeechStart=e=>{this._isEnabled&&(this.async.clearTimeout(this._restartTimeout),this._restartTimeout=this.async.setTimeout((()=>{this.restart(),this.emit("pulse",!1),this._makeSound(u.Z)}),5e3),this.emit("pulse",!0))},this._progressTimeout=0,this._api=t,n._instances.add(this)}destruct(){this.stop(),n._instances.delete(this),super.destruct()}get isEnabled(){return this._isEnabled}start(){this._isEnabled||(this._isEnabled=!0,n._instances.forEach((e=>{e!==this&&e.stop()})),this._api.start(),this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onResult))}stop(){if(this._isEnabled){try{this._api.abort(),this._api.stop()}catch{}this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onResult),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1)}}toggle(){this._isEnabled?this.stop():this.start()}restart(){this.stop(),this.start()}__on(e,t){return this._api.addEventListener(e,t),this}__off(e,t){return this._api.removeEventListener(e,t),this}_onResult(e){if(!this._isEnabled)return;this.async.clearTimeout(this._progressTimeout);const t=e.results.item(e.resultIndex),{transcript:s}=t.item(0),n=()=>{try{this.async.clearTimeout(this._restartTimeout),this.emit("result",s)}catch{}this.restart(),this.emit("pulse",!1),this._makeSound(u.N)};if(!1===t.isFinal)return this.emit("progress",s),void(this._progressTimeout=this.async.setTimeout(n,500));n()}_onError(){this._isEnabled&&(this._makeSound(u.Z),this.emit("pulse",!1),this.restart())}_makeSound(e){this.sound&&(0,c.s)({frequency:e})}};a._instances=new Set,a=n=(0,i.Cg)([r.autobind],a)},95473(e,t,s){"use strict";s.d(t,{s(){return i}});var n=s(81629);function i({sec:e=.1,frequency:t=n.N,gain:s=.1,type:i="sine"}={}){if(void 0===window.AudioContext&&void 0===window.webkitAudioContext)return;const r=new(window.AudioContext||window.webkitAudioContext),o=r.createGain(),c=r.createOscillator();c.type=i,c.frequency.value=t,c.connect(o),o.connect(r.destination),c.start(),c.stop(r.currentTime+e),o.gain.value=s}},61593(e){"use strict";e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},64458(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(e){"use strict";e.exports={newline:"Zeilenumbruch",delete:"löschen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},87710(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(e){"use strict";e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},84059(e){"use strict";e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"Ääni","Interim Results":"Välitulokset"}},13958(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(e){"use strict";e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},14765(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(e){"use strict";e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},25202(e,t,s){"use strict";s.r(t),s.d(t,{ar(){return n},cs_cz(){return i},de(){return r},es(){return o},fa(){return c},fi(){return u},fr(){return a},he(){return l},hu(){return p},id(){return h},it(){return d},ja(){return m},ko(){return g},mn(){return R},nl(){return _},pl(){return S},pt_br(){return w},ru(){return z},tr(){return f},zh_cn(){return x},zh_tw(){return v}});var n=s(61593),i=s(64458),r=s(89601),o=s(87710),c=s(15603),u=s(84059),a=s(13958),l=s(18717),p=s(14765),h=s(77995),d=s(92315),m=s(54711),g=s(68632),R=s(76769),_=s(3424),S=s(85454),w=s(64149),z=s(16491),f=s(48948),x=s(84370),v=s(56646)},92315(e){"use strict";e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},54711(e){"use strict";e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},68632(e){"use strict";e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},76769(e){"use strict";e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},3424(e){"use strict";e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},85454(e){"use strict";e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},64149(e){"use strict";e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provisórios"}},16491(e){"use strict";e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},48948(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"}},84370(e){"use strict";e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},56646(e){"use strict";e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},37873(e,t,s){"use strict";s.r(t),s.d(t,{SpeechRecognizeNative(){return d}});var n=s(31635),i=s(37075),r=s(66927),o=s(55186),c=s(56298),u=s(84976),a=s(71005),l=(s(71096),s(46173)),p=s(50834),h=s(25202);class d extends a.k{constructor(e){super(e),this._commandToWord={},e.o.speechRecognize.api&&e.registerButton({group:"state",name:"speechRecognize"})}afterInit(e){const{commands:t}=e.o.speechRecognize;t&&((0,c.JW)(h),(0,u.HP)(t,!1).forEach((s=>{s.split("|").forEach((n=>{n=n.trim().toLowerCase(),this._commandToWord[n]=t[s];const i=e.i18n(n);i!==n&&i.split("|").forEach((e=>{this._commandToWord[e.trim().toLowerCase()]=t[s].trim()}))}))})))}beforeDestruct(e){}onSpeechRecognizeProgressResult(e){this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),this.j.workplace.appendChild(this.messagePopup),this.j.async.setTimeout((()=>{o.J.safeRemove(this.messagePopup)}),{label:"onSpeechRecognizeProgressResult",timeout:1e3}),this.messagePopup.innerText=e+"|"}onSpeechRecognizeResult(e){const{j:t}=this,{s}=t;if(o.J.safeRemove(this.messagePopup),!this._checkCommand(e)){const{range:n}=s,i=s.current();if(s.isCollapsed()&&o.J.isText(i)&&o.J.isOrContains(t.editor,i)&&i.nodeValue){const r=i.nodeValue;i.nodeValue=r+(/[\u00A0 ]\uFEFF*$/.test(r)?"":" ")+e,n.setStartAfter(i),s.selectRange(n),t.synchronizeValues()}else s.insertHTML(e)}}_checkCommand(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,p.F)(this.j,this._commandToWord[e]),!0)}}(0,n.Cg)([(0,r.w)(":speechRecognizeProgressResult"),(0,i.s)()],d.prototype,"onSpeechRecognizeProgressResult",null),(0,n.Cg)([(0,r.w)(":speechRecognizeResult")],d.prototype,"onSpeechRecognizeResult",null),l.x.plugins.add("speech-recognize",d)},22227(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>'}},e=>e(e.s=37873)])}));
|
|
10
|
+
((e,t)=>{if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var s=t();for(var i in s)("object"==typeof exports?exports:e)[i]=s[i]}})(self,(function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{71096(e,t,s){"use strict";var i=s(9810),n=s(98253),r=s(26150),o=s(72197),u=s(931),c=s(36115),a=s(71722),l=s(93676),p=s(22227),h=s.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",h()),c.T.prototype.controls.speechRecognize={isVisible:e=>!!e.o.speechRecognize.api,isActive(e,t){const s=(0,o.m)(e,"speech");return!!s?.isEnabled},isDisabled:e=>!e.o.speechRecognize.api,exec(e,t,{button:s,control:u}){const{api:c,lang:a,continuous:p,interimResults:h,sound:d}=e.o.speechRecognize;if(!c)return void e.alert("Speech recognize API unsupported in your browser");let m=(0,o.m)(e,"speech");if(!m){const t=new c;m=new l.g(e.async,t),m.lang=(0,n.K)(a)?a:(0,r.C)(e.od.documentElement,"lang")??void 0,m.continuous=p,m.interimResults=h,m.sound=d,(0,o.m)(e,"speech",m),m.on("pulse",(e=>{s.setMod("pulse",e)})),m.on("result",(t=>e.e.fire("speechRecognizeResult",t))),m.on("progress",(t=>e.e.fire("speechRecognizeProgressResult",t))),m.on("error",(t=>e.message.error(t))),s.hookStatus("beforeDestruct",(()=>{(0,o.m)(e,"speech",null),m.destruct()}))}if(u.args){const e=u.args[0];if((0,i.L)(m[e]))return m[e]=!m[e],void(m.isEnabled&&m.restart())}m.toggle(),m.isEnabled&&s.setMod("pulse",!0),s.state.activated=m.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate(e,t,s){const i=(0,o.m)(e,"speech");return`<span class='jodit-speech-recognize__list-item'><input ${i?.[t]??e.o.speechRecognize[t]?"checked":""} class='jodit-checkbox' type='checkbox'> ${s}</span>`},mods:{stroke:!1}}},81629(e,t,s){"use strict";s.d(t,{N(){return i},Z(){return n}});const i=440,n=940},71722(e,t,s){"use strict";s.d(t,{o(){return i}});const i=window.SpeechRecognition||window.webkitSpeechRecognition},50834(e,t,s){"use strict";function i(e,t){const[s,i]=t.split("::");e.execCommand(s,null,i)}s.d(t,{F(){return i}})},93676(e,t,s){"use strict";s.d(t,{g(){return a}});var i,n=s(31635),r=s(22664),o=s(43431),u=s(95473),c=s(81629);let a=i=class e extends o.h{set lang(e){this._lang=e,this._api.lang=e}get lang(){return this._lang}set continuous(e){this._continuous=e,this._api.continuous=e}get continuous(){return this._continuous}set interimResults(e){this._interimResults=e,this._api.interimResults=e}get interimResults(){return this._interimResults}constructor(e,t){super(),this.async=e,this._continuous=!1,this._interimResults=!1,this.sound=!0,this._isEnabled=!1,this._restartTimeout=0,this._onSpeechStart=e=>{this._isEnabled&&(this.async.clearTimeout(this._restartTimeout),this._restartTimeout=this.async.setTimeout((()=>{this.restart(),this.emit("pulse",!1),this._makeSound(c.Z)}),5e3),this.emit("pulse",!0))},this.__interimResults="",this._api=t,i._instances.add(this)}destruct(){this.stop(),i._instances.delete(this),super.destruct()}get isEnabled(){return this._isEnabled}start(){if(!this._isEnabled){this._isEnabled=!0,i._instances.forEach((e=>{e!==this&&e.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)}}stop(){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))}toggle(){this._isEnabled?this.stop():this.start()}restart(){this.stop(),this.start()}__on(e,t){return this._api.addEventListener(e,t),this}__off(e,t){return this._api.removeEventListener(e,t),this}_onResults(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(c.N),this.restart()}_onProgress(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(let t=0;e.results.length>t;t++){const s=e.results.item(t);if(s.length){const{transcript:e}=s.item(0);this.__interimResults+=e}}this.__interimResults&&this.emit("progress",this.__interimResults)}}_onError(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(c.Z),this.emit("pulse",!1),this.stop()}_makeSound(e){this.sound&&(0,u.s)({frequency:e})}};a._instances=new Set,a=i=(0,n.Cg)([r.autobind],a)},95473(e,t,s){"use strict";s.d(t,{s(){return n}});var i=s(81629);function n({sec:e=.1,frequency:t=i.N,gain:s=.1,type:n="sine"}={}){if(void 0===window.AudioContext&&void 0===window.webkitAudioContext)return;const r=new(window.AudioContext||window.webkitAudioContext),o=r.createGain(),u=r.createOscillator();u.type=n,u.frequency.value=t,u.connect(o),o.connect(r.destination),u.start(),u.stop(r.currentTime+e),o.gain.value=s}},61593(e){"use strict";e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},64458(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(e){"use strict";e.exports={newline:"Zeilenumbruch",delete:"löschen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},87710(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(e){"use strict";e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},84059(e){"use strict";e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"Ääni","Interim Results":"Välitulokset"}},13958(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(e){"use strict";e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},14765(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(e){"use strict";e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},25202(e,t,s){"use strict";s.r(t),s.d(t,{ar(){return i},cs_cz(){return n},de(){return r},es(){return o},fa(){return u},fi(){return c},fr(){return a},he(){return l},hu(){return p},id(){return h},it(){return d},ja(){return m},ko(){return g},mn(){return R},nl(){return _},pl(){return S},pt_br(){return w},ru(){return z},tr(){return f},zh_cn(){return v},zh_tw(){return b}});var i=s(61593),n=s(64458),r=s(89601),o=s(87710),u=s(15603),c=s(84059),a=s(13958),l=s(18717),p=s(14765),h=s(77995),d=s(92315),m=s(54711),g=s(68632),R=s(76769),_=s(3424),S=s(85454),w=s(64149),z=s(16491),f=s(48948),v=s(84370),b=s(56646)},92315(e){"use strict";e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},54711(e){"use strict";e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},68632(e){"use strict";e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},76769(e){"use strict";e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},3424(e){"use strict";e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},85454(e){"use strict";e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},64149(e){"use strict";e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provisórios"}},16491(e){"use strict";e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},48948(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"}},84370(e){"use strict";e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},56646(e){"use strict";e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},37873(e,t,s){"use strict";s.r(t),s.d(t,{SpeechRecognizeNative(){return h}});var i=s(31635),n=s(66927),r=s(55186),o=s(56298),u=s(84976),c=s(71005),a=(s(71096),s(46173)),l=s(50834),p=s(25202);class h extends c.k{constructor(){super(...arguments),this.buttons=[{group:"state",name:"speechRecognize"}],this._commandToWord={}}afterInit(e){const{commands:t}=e.o.speechRecognize;t&&((0,o.JW)(p),(0,u.HP)(t,!1).forEach((s=>{s.split("|").forEach((i=>{i=i.trim().toLowerCase(),this._commandToWord[i]=t[s];const n=e.i18n(i);n!==i&&n.split("|").forEach((e=>{this._commandToWord[e.trim().toLowerCase()]=t[s].trim()}))}))})))}beforeDestruct(e){r.J.safeRemove(this.messagePopup)}onSpeechRecognizeProgressResult(e){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((()=>{r.J.safeRemove(this.messagePopup)}),1e3),this.messagePopup.innerText=e+"|"}onSpeechRecognizeResult(e){this.j.async.clearTimeout(this.__hidePopupTimeout),r.J.safeRemove(this.messagePopup);const{j:t}=this,{s}=t;if(!this._checkCommand(e)){const{range:i}=s,n=s.current();if(s.isCollapsed()&&r.J.isText(n)&&r.J.isOrContains(t.editor,n)&&n.nodeValue){const r=n.nodeValue;n.nodeValue=r+(/[\u00A0 ]\uFEFF*$/.test(r)?"":" ")+e,i.setStartAfter(n),s.selectRange(i),t.synchronizeValues()}else s.insertHTML(e)}}_checkCommand(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,l.F)(this.j,this._commandToWord[e]),!0)}}(0,i.Cg)([(0,n.w)(":speechRecognizeProgressResult")],h.prototype,"onSpeechRecognizeProgressResult",null),(0,i.Cg)([(0,n.w)(":speechRecognizeResult")],h.prototype,"onSpeechRecognizeResult",null),a.x.plugins.add("speech-recognize",h)},22227(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>'}},e=>e(e.s=37873)])}));
|
package/es2021.en/jodit.css
CHANGED