jodit 4.2.21 → 4.2.22

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +9 -5
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +2 -2
  6. package/es2015/jodit.min.js +2 -2
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +3 -2
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +98 -77
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  13. package/es2018/jodit.css +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +2 -2
  17. package/es2018/jodit.min.js +2 -2
  18. package/es2018/plugins/debug/debug.js +1 -1
  19. package/es2018/plugins/debug/debug.min.js +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.css +3 -2
  21. package/es2018/plugins/speech-recognize/speech-recognize.js +98 -77
  22. package/es2018/plugins/speech-recognize/speech-recognize.min.css +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  24. package/es2021/jodit.css +1 -1
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +2 -2
  28. package/es2021/jodit.min.js +2 -2
  29. package/es2021/plugins/debug/debug.js +1 -1
  30. package/es2021/plugins/debug/debug.min.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.css +3 -2
  32. package/es2021/plugins/speech-recognize/speech-recognize.js +98 -77
  33. package/es2021/plugins/speech-recognize/speech-recognize.min.css +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  35. package/es2021.en/jodit.css +1 -1
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +2 -2
  39. package/es2021.en/jodit.min.js +2 -2
  40. package/es2021.en/plugins/debug/debug.js +1 -1
  41. package/es2021.en/plugins/debug/debug.min.js +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.css +3 -2
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.js +98 -77
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.min.css +1 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  46. package/es5/jodit.css +2 -2
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +2 -2
  50. package/es5/jodit.min.css +2 -2
  51. package/es5/jodit.min.js +2 -2
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +3 -2
  55. package/es5/plugins/speech-recognize/speech-recognize.js +99 -79
  56. package/es5/plugins/speech-recognize/speech-recognize.min.css +1 -1
  57. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  58. package/esm/core/constants.js +1 -1
  59. package/esm/plugins/speech-recognize/config.d.ts +1 -1
  60. package/esm/plugins/speech-recognize/config.js +13 -5
  61. package/esm/plugins/speech-recognize/helpers/recognize-manager.d.ts +3 -2
  62. package/esm/plugins/speech-recognize/helpers/recognize-manager.js +45 -31
  63. package/esm/plugins/speech-recognize/interface.d.ts +1 -0
  64. package/esm/plugins/speech-recognize/speech-recognize.d.ts +5 -1
  65. package/esm/plugins/speech-recognize/speech-recognize.js +17 -17
  66. package/package.json +1 -1
  67. package/types/plugins/speech-recognize/config.d.ts +1 -1
  68. package/types/plugins/speech-recognize/helpers/recognize-manager.d.ts +3 -2
  69. package/types/plugins/speech-recognize/interface.d.ts +1 -0
  70. 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.21
4
+ * Version: v4.2.22
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -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.21
4
+ * Version: v4.2.22
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -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.21
4
+ * Version: v4.2.22
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: 24px;
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.21
4
+ * Version: v4.2.22
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -43,9 +43,9 @@ return (self["webpackChunkjodit"] = self["webpackChunkjodit"] || []).push([[882]
43
43
 
44
44
 
45
45
  jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.speechRecognize = {
46
- api: _helpers_api__WEBPACK_IMPORTED_MODULE_3__/* .SpeechRecognition */ .o,
46
+ api: typeof _helpers_api__WEBPACK_IMPORTED_MODULE_3__/* .SpeechRecognition */ .o !== 'undefined' ? _helpers_api__WEBPACK_IMPORTED_MODULE_3__/* .SpeechRecognition */ .o : null,
47
47
  sound: true,
48
- continuous: true,
48
+ continuous: false,
49
49
  interimResults: true,
50
50
  commands: {
51
51
  'newline|enter': 'enter',
@@ -63,6 +63,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.speechRecogn
63
63
  };
64
64
  jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_1__/* .Icon */ .I.set('speech-recognize', (_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_5___default()));
65
65
  jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.speechRecognize = {
66
+ isVisible(j) {
67
+ return Boolean(j.o.speechRecognize.api);
68
+ },
66
69
  isActive(jodit, _) {
67
70
  const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__/* .dataBind */ .m)(jodit, 'speech');
68
71
  return Boolean(api === null || api === void 0 ? void 0 : api.isEnabled);
@@ -71,14 +74,14 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.spe
71
74
  return !jodit.o.speechRecognize.api;
72
75
  },
73
76
  exec(jodit, current, { button, control }) {
74
- const { api: Api, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
75
- if (!Api) {
77
+ const { api: ApiConstructor, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
78
+ if (!ApiConstructor) {
76
79
  jodit.alert('Speech recognize API unsupported in your browser');
77
80
  return;
78
81
  }
79
82
  let api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__/* .dataBind */ .m)(jodit, 'speech');
80
83
  if (!api) {
81
- const nativeApi = new Api();
84
+ const nativeApi = new ApiConstructor();
82
85
  api = new _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_4__/* .RecognizeManager */ .g(jodit.async, nativeApi);
83
86
  api.lang = lang;
84
87
  api.continuous = continuous;
@@ -90,7 +93,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.spe
90
93
  });
91
94
  api.on('result', (text) => jodit.e.fire('speechRecognizeResult', text));
92
95
  api.on('progress', (text) => jodit.e.fire('speechRecognizeProgressResult', text));
96
+ api.on('error', (text) => jodit.message.error(text));
93
97
  button.hookStatus('beforeDestruct', () => {
98
+ (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_0__/* .dataBind */ .m)(jodit, 'speech', null);
94
99
  api.destruct();
95
100
  });
96
101
  }
@@ -105,6 +110,9 @@ jodit_config__WEBPACK_IMPORTED_MODULE_2__/* .Config */ .T.prototype.controls.spe
105
110
  }
106
111
  }
107
112
  api.toggle();
113
+ if (api.isEnabled) {
114
+ button.setMod('pulse', true);
115
+ }
108
116
  button.state.activated = api.isEnabled;
109
117
  },
110
118
  name: 'speechRecognize',
@@ -253,7 +261,7 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
253
261
  }, 5000);
254
262
  this.emit('pulse', true);
255
263
  };
256
- this._progressTimeout = 0;
264
+ this.__interimResults = '';
257
265
  this._api = api;
258
266
  RecognizeManager_1._instances.add(this);
259
267
  }
@@ -275,23 +283,29 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
275
283
  instance.stop();
276
284
  }
277
285
  });
278
- this._api.start();
286
+ try {
287
+ this._api.start();
288
+ }
289
+ catch (e) {
290
+ this._onError(e);
291
+ this.stop();
292
+ return;
293
+ }
279
294
  this.__on('speechstart', this._onSpeechStart)
280
295
  .__on('error', this._onError)
281
- .__on('result', this._onResult);
296
+ .__on('result', this._onProgress)
297
+ .__on('end', this._onResults);
282
298
  }
283
299
  stop() {
284
300
  if (!this._isEnabled) {
285
301
  return;
286
302
  }
287
- try {
288
- this._api.abort();
289
- this._api.stop();
290
- }
291
- catch (_a) { }
303
+ this._api.abort();
304
+ this._api.stop();
292
305
  this.__off('speechstart', this._onSpeechStart)
293
306
  .__off('error', this._onError)
294
- .__off('result', this._onResult);
307
+ .__off('result', this._onProgress)
308
+ .__off('end', this._onResults);
295
309
  this.async.clearTimeout(this._restartTimeout);
296
310
  this._isEnabled = false;
297
311
  this.emit('pulse', false);
@@ -316,37 +330,45 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
316
330
  this._api.removeEventListener(event, callback);
317
331
  return this;
318
332
  }
319
- _onResult(e) {
333
+ _onResults(e) {
334
+ this.emit('pulse', false);
335
+ this.emit('result', this.__interimResults);
336
+ this.__interimResults = '';
337
+ this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_2__/* .PII */ .N);
338
+ this.restart();
339
+ }
340
+ _onProgress(e) {
320
341
  if (!this._isEnabled) {
321
342
  return;
322
343
  }
323
- this.async.clearTimeout(this._progressTimeout);
324
- const resultItem = e.results.item(e.resultIndex);
325
- const { transcript } = resultItem.item(0);
326
- const resultHandler = () => {
327
- try {
328
- this.async.clearTimeout(this._restartTimeout);
329
- this.emit('result', transcript);
330
- }
331
- catch (_a) { }
332
- this.restart();
333
- this.emit('pulse', false);
334
- this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_2__/* .PII */ .N);
335
- };
336
- if (resultItem.isFinal === false) {
337
- this.emit('progress', transcript);
338
- this._progressTimeout = this.async.setTimeout(resultHandler, 500);
344
+ this.__interimResults = '';
345
+ if (!e.results) {
339
346
  return;
340
347
  }
341
- resultHandler();
348
+ for (let i = 0; i < e.results.length; i++) {
349
+ const resultItem = e.results.item(i);
350
+ const { transcript } = resultItem.item(0);
351
+ this.__interimResults += transcript;
352
+ }
353
+ if (this.__interimResults) {
354
+ this.emit('progress', this.__interimResults);
355
+ }
342
356
  }
343
- _onError() {
344
- if (!this._isEnabled) {
345
- return;
357
+ _onError(e) {
358
+ if (e.error === 'voice-unavailable') {
359
+ this.emit('error', 'Voice unavailable');
360
+ }
361
+ if (e.error === 'not-allowed') {
362
+ this.emit('error', 'Not allowed');
363
+ }
364
+ if (e.error === 'language-unavailable' ||
365
+ // @ts-ignore
366
+ e.error === 'language-not-supported') {
367
+ this.emit('error', 'Language unavailable');
346
368
  }
347
369
  this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_2__/* .WARN */ .Z);
348
370
  this.emit('pulse', false);
349
- this.restart();
371
+ this.stop();
350
372
  }
351
373
  _makeSound(frequency) {
352
374
  if (this.sound) {
@@ -977,17 +999,16 @@ __webpack_require__.r(__webpack_exports__);
977
999
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
978
1000
  /* harmony export */ SpeechRecognizeNative: function() { return /* binding */ SpeechRecognizeNative; }
979
1001
  /* harmony export */ });
980
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(31635);
981
- /* harmony import */ var jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37075);
982
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
983
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55186);
984
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56298);
985
- /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84976);
986
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71005);
987
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(71096);
988
- /* harmony import */ var _jodit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(46173);
989
- /* harmony import */ var _helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(50834);
990
- /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(25202);
1002
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(31635);
1003
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(66927);
1004
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55186);
1005
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56298);
1006
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84976);
1007
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71005);
1008
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71096);
1009
+ /* harmony import */ var _jodit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(46173);
1010
+ /* harmony import */ var _helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(50834);
1011
+ /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(25202);
991
1012
  /*!
992
1013
  * Jodit Editor (https://xdsoft.net/jodit/)
993
1014
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -1004,23 +1025,22 @@ __webpack_require__.r(__webpack_exports__);
1004
1025
 
1005
1026
 
1006
1027
 
1007
-
1008
- class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */ .k {
1009
- constructor(j) {
1010
- super(j);
1011
- this._commandToWord = {};
1012
- if (j.o.speechRecognize.api) {
1013
- j.registerButton({
1028
+ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_4__/* .Plugin */ .k {
1029
+ constructor() {
1030
+ super(...arguments);
1031
+ this.buttons = [
1032
+ {
1014
1033
  group: 'state',
1015
1034
  name: 'speechRecognize'
1016
- });
1017
- }
1035
+ }
1036
+ ];
1037
+ this._commandToWord = {};
1018
1038
  }
1019
1039
  afterInit(jodit) {
1020
1040
  const { commands } = jodit.o.speechRecognize;
1021
1041
  if (commands) {
1022
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_8__);
1023
- (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_4__/* .keys */ .HP)(commands, false).forEach(words => {
1042
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_2__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_7__);
1043
+ (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_3__/* .keys */ .HP)(commands, false).forEach(words => {
1024
1044
  const keys = words.split('|');
1025
1045
  keys.forEach(key => {
1026
1046
  key = key.trim().toLowerCase();
@@ -1035,28 +1055,30 @@ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5
1035
1055
  });
1036
1056
  }
1037
1057
  }
1038
- beforeDestruct(jodit) { }
1058
+ beforeDestruct(jodit) {
1059
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.safeRemove(this.messagePopup);
1060
+ }
1039
1061
  onSpeechRecognizeProgressResult(text) {
1040
1062
  if (!this.messagePopup) {
1041
1063
  this.messagePopup = this.j.create.div('jodit-speech-recognize__popup');
1042
1064
  }
1043
1065
  this.j.workplace.appendChild(this.messagePopup);
1044
- this.j.async.setTimeout(() => {
1045
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeRemove(this.messagePopup);
1046
- }, {
1047
- label: 'onSpeechRecognizeProgressResult',
1048
- timeout: 1000
1049
- });
1066
+ this.j.async.clearTimeout(this.__hidePopupTimeout);
1067
+ this.__hidePopupTimeout = this.j.async.setTimeout(() => {
1068
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.safeRemove(this.messagePopup);
1069
+ }, 1000);
1050
1070
  this.messagePopup.innerText = text + '|';
1051
1071
  }
1052
1072
  onSpeechRecognizeResult(text) {
1053
- const { j } = this, { s } = j;
1054
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeRemove(this.messagePopup);
1073
+ this.j.async.clearTimeout(this.__hidePopupTimeout);
1074
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.safeRemove(this.messagePopup);
1075
+ const { j } = this;
1076
+ const { s } = j;
1055
1077
  if (!this._checkCommand(text)) {
1056
1078
  const { range } = s, node = s.current();
1057
1079
  if (s.isCollapsed() &&
1058
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(node) &&
1059
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(j.editor, node) &&
1080
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isText(node) &&
1081
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_1__/* .Dom */ .J.isOrContains(j.editor, node) &&
1060
1082
  node.nodeValue) {
1061
1083
  const sentence = node.nodeValue;
1062
1084
  node.nodeValue =
@@ -1075,20 +1097,19 @@ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5
1075
1097
  _checkCommand(command) {
1076
1098
  command = command.toLowerCase().replace(/\./g, '');
1077
1099
  if (this._commandToWord[command]) {
1078
- (0,_helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_9__/* .execSpellCommand */ .F)(this.j, this._commandToWord[command]);
1100
+ (0,_helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_8__/* .execSpellCommand */ .F)(this.j, this._commandToWord[command]);
1079
1101
  return true;
1080
1102
  }
1081
1103
  return false;
1082
1104
  }
1083
1105
  }
1084
- (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__decorate */ .Cg)([
1085
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':speechRecognizeProgressResult'),
1086
- (0,jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_0__/* .debounce */ .s)()
1106
+ (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
1107
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':speechRecognizeProgressResult')
1087
1108
  ], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
1088
- (0,tslib__WEBPACK_IMPORTED_MODULE_10__/* .__decorate */ .Cg)([
1089
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':speechRecognizeResult')
1109
+ (0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
1110
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_0__/* .watch */ .w)(':speechRecognizeResult')
1090
1111
  ], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
1091
- _jodit__WEBPACK_IMPORTED_MODULE_7__/* .Jodit */ .x.plugins.add('speech-recognize', SpeechRecognizeNative);
1112
+ _jodit__WEBPACK_IMPORTED_MODULE_6__/* .Jodit */ .x.plugins.add('speech-recognize', SpeechRecognizeNative);
1092
1113
 
1093
1114
 
1094
1115
  /***/ }),
@@ -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:24px;position:absolute;top:50%;transform:translate(-50%,-50%)}
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.21
4
+ * Version: v4.2.22
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 s in n)("object"==typeof exports?exports:e)[s]=n[s]}}(self,(function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{71096:function(e,t,n){"use strict";var s=n(9810),i=n(72197),o=n(931),r=n(36115),c=n(71722),u=n(93676),a=n(22227),l=n.n(a);r.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"}},o.I.set("speech-recognize",l()),r.T.prototype.controls.speechRecognize={isActive(e,t){const n=(0,i.m)(e,"speech");return Boolean(null==n?void 0:n.isEnabled)},isDisabled(e){return!e.o.speechRecognize.api},exec(e,t,{button:n,control:o}){const{api:r,lang:c,continuous:a,interimResults:l,sound:p}=e.o.speechRecognize;if(!r)return void e.alert("Speech recognize API unsupported in your browser");let h=(0,i.m)(e,"speech");if(!h){const t=new r;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=>{n.setMod("pulse",e)})),h.on("result",(t=>e.e.fire("speechRecognizeResult",t))),h.on("progress",(t=>e.e.fire("speechRecognizeProgressResult",t))),n.hookStatus("beforeDestruct",(()=>{h.destruct()}))}if(o.args){const e=o.args[0];if((0,s.L)(h[e]))return h[e]=!h[e],void(h.isEnabled&&h.restart())}h.toggle(),n.state.activated=h.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate(e,t,n){var s;const o=(0,i.m)(e,"speech");return`<span class='jodit-speech-recognize__list-item'><input ${(null!==(s=null==o?void 0:o[t])&&void 0!==s?s:e.o.speechRecognize[t])?"checked":""} class='jodit-checkbox' type='checkbox'>&nbsp;${n}</span>`},mods:{stroke:!1}}},81629:function(e,t,n){"use strict";n.d(t,{N:function(){return s},Z:function(){return i}});const s=440,i=940},71722:function(e,t,n){"use strict";n.d(t,{o:function(){return s}});const s=window.SpeechRecognition||window.webkitSpeechRecognition},50834:function(e,t,n){"use strict";function s(e,t){const[n,s]=t.split("::");e.execCommand(n,null,s)}n.d(t,{F:function(){return s}})},93676:function(e,t,n){"use strict";n.d(t,{g:function(){return a}});var s,i=n(31635),o=n(22664),r=n(43431),c=n(95473),u=n(81629);let a=s=class e extends r.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,s._instances.add(this)}destruct(){this.stop(),s._instances.delete(this),super.destruct()}get isEnabled(){return this._isEnabled}start(){this._isEnabled||(this._isEnabled=!0,s._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(e){}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:n}=t.item(0),s=()=>{try{this.async.clearTimeout(this._restartTimeout),this.emit("result",n)}catch(e){}this.restart(),this.emit("pulse",!1),this._makeSound(u.N)};if(!1===t.isFinal)return this.emit("progress",n),void(this._progressTimeout=this.async.setTimeout(s,500));s()}_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=s=(0,i.Cg)([o.autobind],a)},95473:function(e,t,n){"use strict";n.d(t,{s:function(){return i}});var s=n(81629);function i({sec:e=.1,frequency:t=s.N,gain:n=.1,type:i="sine"}={}){if(void 0===window.AudioContext&&void 0===window.webkitAudioContext)return;const o=new(window.AudioContext||window.webkitAudioContext),r=o.createGain(),c=o.createOscillator();c.type=i,c.frequency.value=t,c.connect(r),r.connect(o.destination),c.start(),c.stop(o.currentTime+e),r.gain.value=n}},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 s},cs_cz:function(){return i},de:function(){return o},es:function(){return r},fa:function(){return c},fi:function(){return u},fr:function(){return a},he:function(){return l},hu:function(){return p},id:function(){return h},it:function(){return d},ja:function(){return m},ko:function(){return f},mn:function(){return g},nl:function(){return R},pl:function(){return _},pt_br:function(){return S},ru:function(){return w},tr:function(){return z},zh_cn:function(){return v},zh_tw:function(){return x}});var s=n(61593),i=n(64458),o=n(89601),r=n(87710),c=n(15603),u=n(84059),a=n(13958),l=n(18717),p=n(14765),h=n(77995),d=n(92315),m=n(54711),f=n(68632),g=n(76769),R=n(3424),_=n(85454),S=n(64149),w=n(16491),z=n(48948),v=n(84370),x=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"}},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 s=n(31635),i=n(37075),o=n(66927),r=n(55186),c=n(56298),u=n(84976),a=n(71005),l=(n(71096),n(46173)),p=n(50834),h=n(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((n=>{n.split("|").forEach((s=>{s=s.trim().toLowerCase(),this._commandToWord[s]=t[n];const i=e.i18n(s);i!==s&&i.split("|").forEach((e=>{this._commandToWord[e.trim().toLowerCase()]=t[n].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((()=>{r.J.safeRemove(this.messagePopup)}),{label:"onSpeechRecognizeProgressResult",timeout:1e3}),this.messagePopup.innerText=e+"|"}onSpeechRecognizeResult(e){const{j:t}=this,{s:n}=t;if(r.J.safeRemove(this.messagePopup),!this._checkCommand(e)){const{range:s}=n,i=n.current();if(n.isCollapsed()&&r.J.isText(i)&&r.J.isOrContains(t.editor,i)&&i.nodeValue){const o=i.nodeValue;i.nodeValue=o+(/[\u00A0 ]\uFEFF*$/.test(o)?"":" ")+e,s.setStartAfter(i),n.selectRange(s),t.synchronizeValues()}else n.insertHTML(e)}}_checkCommand(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,p.F)(this.j,this._commandToWord[e]),!0)}}(0,s.Cg)([(0,o.w)(":speechRecognizeProgressResult"),(0,i.s)()],d.prototype,"onSpeechRecognizeProgressResult",null),(0,s.Cg)([(0,o.w)(":speechRecognizeResult")],d.prototype,"onSpeechRecognizeResult",null),l.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 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:function(e,t,s){"use strict";var n=s(9810),i=s(72197),o=s(931),r=s(36115),u=s(71722),c=s(93676),a=s(22227),l=s.n(a);r.T.prototype.speechRecognize={api:void 0!==u.o?u.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"}},o.I.set("speech-recognize",l()),r.T.prototype.controls.speechRecognize={isVisible(e){return Boolean(e.o.speechRecognize.api)},isActive(e,t){const s=(0,i.m)(e,"speech");return Boolean(null==s?void 0:s.isEnabled)},isDisabled(e){return!e.o.speechRecognize.api},exec(e,t,{button:s,control:o}){const{api:r,lang:u,continuous:a,interimResults:l,sound:p}=e.o.speechRecognize;if(!r)return void e.alert("Speech recognize API unsupported in your browser");let h=(0,i.m)(e,"speech");if(!h){const t=new r;h=new c.g(e.async,t),h.lang=u,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))),h.on("error",(t=>e.message.error(t))),s.hookStatus("beforeDestruct",(()=>{(0,i.m)(e,"speech",null),h.destruct()}))}if(o.args){const e=o.args[0];if((0,n.L)(h[e]))return h[e]=!h[e],void(h.isEnabled&&h.restart())}h.toggle(),h.isEnabled&&s.setMod("pulse",!0),s.state.activated=h.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate(e,t,s){var n;const o=(0,i.m)(e,"speech");return`<span class='jodit-speech-recognize__list-item'><input ${(null!==(n=null==o?void 0:o[t])&&void 0!==n?n:e.o.speechRecognize[t])?"checked":""} class='jodit-checkbox' type='checkbox'>&nbsp;${s}</span>`},mods:{stroke:!1}}},81629:function(e,t,s){"use strict";s.d(t,{N:function(){return n},Z:function(){return i}});const n=440,i=940},71722:function(e,t,s){"use strict";s.d(t,{o:function(){return n}});const n=window.SpeechRecognition||window.webkitSpeechRecognition},50834:function(e,t,s){"use strict";function n(e,t){const[s,n]=t.split("::");e.execCommand(s,null,n)}s.d(t,{F:function(){return n}})},93676:function(e,t,s){"use strict";s.d(t,{g:function(){return a}});var n,i=s(31635),o=s(22664),r=s(43431),u=s(95473),c=s(81629);let a=n=class e extends r.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,n._instances.add(this)}destruct(){this.stop(),n._instances.delete(this),super.destruct()}get isEnabled(){return this._isEnabled}start(){if(!this._isEnabled){this._isEnabled=!0,n._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),{transcript:n}=s.item(0);this.__interimResults+=n}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=n=(0,i.Cg)([o.autobind],a)},95473:function(e,t,s){"use strict";s.d(t,{s:function(){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 o=new(window.AudioContext||window.webkitAudioContext),r=o.createGain(),u=o.createOscillator();u.type=i,u.frequency.value=t,u.connect(r),r.connect(o.destination),u.start(),u.stop(o.currentTime+e),r.gain.value=s}},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,s){"use strict";s.r(t),s.d(t,{ar:function(){return n},cs_cz:function(){return i},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 h},it:function(){return d},ja:function(){return m},ko:function(){return f},mn:function(){return g},nl:function(){return R},pl:function(){return _},pt_br:function(){return S},ru:function(){return w},tr:function(){return z},zh_cn:function(){return v},zh_tw:function(){return b}});var n=s(61593),i=s(64458),o=s(89601),r=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),f=s(68632),g=s(76769),R=s(3424),_=s(85454),S=s(64149),w=s(16491),z=s(48948),v=s(84370),b=s(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"}},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,s){"use strict";s.r(t),s.d(t,{SpeechRecognizeNative:function(){return h}});var n=s(31635),i=s(66927),o=s(55186),r=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,r.JW)(p),(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){o.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((()=>{o.J.safeRemove(this.messagePopup)}),1e3),this.messagePopup.innerText=e+"|"}onSpeechRecognizeResult(e){this.j.async.clearTimeout(this.__hidePopupTimeout),o.J.safeRemove(this.messagePopup);const{j:t}=this,{s:s}=t;if(!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 o=i.nodeValue;i.nodeValue=o+(/[\u00A0 ]\uFEFF*$/.test(o)?"":" ")+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,l.F)(this.j,this._commandToWord[e]),!0)}}(0,n.Cg)([(0,i.w)(":speechRecognizeProgressResult")],h.prototype,"onSpeechRecognizeProgressResult",null),(0,n.Cg)([(0,i.w)(":speechRecognizeResult")],h.prototype,"onSpeechRecognizeResult",null),a.x.plugins.add("speech-recognize",h)},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/es2018/jodit.css CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.2.21
4
+ * Version: v4.2.22
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */