jodit 4.6.19 → 4.7.4

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 (77) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +248 -4
  4. package/es2015/jodit.js +35173 -37099
  5. package/es2015/jodit.min.js +248 -4
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +44 -74
  8. package/es2015/plugins/debug/debug.min.js +5 -4
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +616 -714
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -4
  12. package/es2018/jodit.fat.min.js +248 -4
  13. package/es2018/jodit.min.js +248 -4
  14. package/es2018/plugins/debug/debug.min.js +5 -4
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -4
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +262 -4
  18. package/es2021/jodit.js +34763 -36981
  19. package/es2021/jodit.min.js +262 -4
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +42 -72
  22. package/es2021/plugins/debug/debug.min.js +5 -4
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +614 -712
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -4
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +262 -4
  28. package/es2021.en/jodit.js +33514 -35465
  29. package/es2021.en/jodit.min.js +262 -4
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +42 -72
  32. package/es2021.en/plugins/debug/debug.min.js +5 -4
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +318 -347
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -4
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -4
  38. package/es5/jodit.js +42978 -39182
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -4
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +152 -163
  43. package/es5/plugins/debug/debug.min.js +2 -4
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +755 -777
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -4
  47. package/es5/polyfills.fat.min.js +8 -0
  48. package/es5/{415.js → polyfills.js} +177 -5
  49. package/es5/polyfills.min.js +8 -0
  50. package/esm/config.js +3 -0
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/helpers/utils/assert.js +4 -0
  53. package/esm/core/ui/form/inputs/input/input.d.ts +1 -0
  54. package/esm/core/view/view.d.ts +2 -2
  55. package/esm/core/view/view.js +1 -1
  56. package/esm/jodit.js +7 -1
  57. package/esm/modules/dialog/dialog.js +5 -5
  58. package/esm/modules/status-bar/status-bar.d.ts +1 -1
  59. package/esm/plugins/tab/cases/on-tab-inside-li.js +1 -1
  60. package/esm/tsconfig.json +1 -1
  61. package/package.json +3 -5
  62. package/types/core/ui/form/inputs/input/input.d.ts +1 -0
  63. package/types/core/view/view.d.ts +2 -2
  64. package/types/modules/status-bar/status-bar.d.ts +1 -1
  65. package/types/tsconfig.json +1 -1
  66. package/es2018/jodit.css +0 -5386
  67. package/es2018/jodit.js +0 -45274
  68. package/es2018/plugins/debug/debug.css +0 -53
  69. package/es2018/plugins/debug/debug.js +0 -236
  70. package/es2018/plugins/speech-recognize/speech-recognize.css +0 -43
  71. package/es2018/plugins/speech-recognize/speech-recognize.js +0 -1199
  72. package/es5/415.fat.min.js +0 -10
  73. package/es5/415.min.js +0 -10
  74. package/es5/5.fat.min.js +0 -10
  75. package/es5/5.js +0 -76
  76. package/es5/5.min.js +0 -10
  77. package/esm/polyfills.js +0 -54
@@ -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.6.19
4
+ * Version: v4.7.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -25,73 +25,7 @@ module.exports = "<svg viewBox=\"0 0 16 16\" xml:space=\"preserve\" xmlns=\"http
25
25
 
26
26
  /***/ }),
27
27
 
28
- /***/ 25202:
29
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30
-
31
- "use strict";
32
- __webpack_require__.r(__webpack_exports__);
33
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34
- /* harmony export */ ar: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
35
- /* harmony export */ cs_cz: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
36
- /* harmony export */ de: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
37
- /* harmony export */ es: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
38
- /* harmony export */ fa: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
39
- /* harmony export */ fi: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
40
- /* harmony export */ fr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
41
- /* harmony export */ he: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
42
- /* harmony export */ hu: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
43
- /* harmony export */ id: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
44
- /* harmony export */ it: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
45
- /* harmony export */ ja: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
46
- /* harmony export */ ko: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
47
- /* harmony export */ mn: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
48
- /* harmony export */ nl: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
49
- /* harmony export */ no: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
50
- /* harmony export */ pl: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
51
- /* harmony export */ pt_br: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
52
- /* harmony export */ ru: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
53
- /* harmony export */ tr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
54
- /* harmony export */ ua: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
55
- /* harmony export */ zh_cn: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
56
- /* harmony export */ zh_tw: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; }
57
- /* harmony export */ });
58
- /* harmony import */ var _ar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41324);
59
- /* harmony import */ var _ar_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ar_js__WEBPACK_IMPORTED_MODULE_0__);
60
- /*!
61
- * Jodit Editor (https://xdsoft.net/jodit/)
62
- * Released under MIT see LICENSE.txt in the project root for license information.
63
- * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
64
- */
65
- // @ts-nocheck
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
- /***/ }),
93
-
94
- /***/ 37873:
28
+ /***/ 31262:
95
29
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
96
30
 
97
31
  "use strict";
@@ -99,21 +33,26 @@ __webpack_require__.r(__webpack_exports__);
99
33
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
100
34
  /* harmony export */ SpeechRecognizeNative: function() { return /* binding */ SpeechRecognizeNative; }
101
35
  /* harmony export */ });
102
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31635);
103
- /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66927);
104
- /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55186);
105
- /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56298);
106
- /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(84976);
107
- /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71005);
108
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(71096);
109
- /* harmony import */ var _jodit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(46173);
110
- /* harmony import */ var _helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(50834);
111
- /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(25202);
36
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
37
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
38
+ /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68616);
39
+ /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23211);
40
+ /* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
41
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71125);
42
+ /* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91206);
43
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75143);
44
+ /* harmony import */ var _jodit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(73302);
45
+ /* harmony import */ var _helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(86581);
46
+ /* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(43219);
112
47
  /*!
113
48
  * Jodit Editor (https://xdsoft.net/jodit/)
114
49
  * Released under MIT see LICENSE.txt in the project root for license information.
115
50
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
116
- */
51
+ */ /**
52
+ * [[include:plugins/speech-recognize/README.md]]
53
+ * @packageDocumentation
54
+ * @module plugins/speech-recognize
55
+ */
117
56
 
118
57
 
119
58
 
@@ -125,29 +64,19 @@ __webpack_require__.r(__webpack_exports__);
125
64
 
126
65
 
127
66
 
128
- class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */ .k {
129
- constructor() {
130
- super(...arguments);
131
- this.buttons = [
132
- {
133
- group: 'state',
134
- name: 'speechRecognize'
135
- }
136
- ];
137
- this._commandToWord = {};
138
- }
67
+ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
139
68
  afterInit(jodit) {
140
69
  const { commands } = jodit.o.speechRecognize;
141
70
  if (commands) {
142
- (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_3__/* .extendLang */ .JW)(_langs__WEBPACK_IMPORTED_MODULE_9__);
143
- (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_4__/* .keys */ .HP)(commands, false).forEach(words => {
71
+ (0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.extendLang)(_langs__WEBPACK_IMPORTED_MODULE_10__);
72
+ (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_5__.keys)(commands, false).forEach((words)=>{
144
73
  const keys = words.split('|');
145
- keys.forEach(key => {
74
+ keys.forEach((key)=>{
146
75
  key = key.trim().toLowerCase();
147
76
  this._commandToWord[key] = commands[words];
148
77
  const translatedKeys = jodit.i18n(key);
149
78
  if (translatedKeys !== key) {
150
- translatedKeys.split('|').forEach(translatedKey => {
79
+ translatedKeys.split('|').forEach((translatedKey)=>{
151
80
  this._commandToWord[translatedKey.trim().toLowerCase()] = commands[words].trim();
152
81
  });
153
82
  }
@@ -156,7 +85,7 @@ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5
156
85
  }
157
86
  }
158
87
  beforeDestruct(jodit) {
159
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeRemove(this.messagePopup);
88
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(this.messagePopup);
160
89
  }
161
90
  onSpeechRecognizeProgressResult(text) {
162
91
  if (!this.messagePopup) {
@@ -164,32 +93,25 @@ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5
164
93
  }
165
94
  this.j.workplace.appendChild(this.messagePopup);
166
95
  this.j.async.clearTimeout(this.__hidePopupTimeout);
167
- this.__hidePopupTimeout = this.j.async.setTimeout(() => {
168
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeRemove(this.messagePopup);
96
+ this.__hidePopupTimeout = this.j.async.setTimeout(()=>{
97
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(this.messagePopup);
169
98
  }, 1000);
170
99
  this.messagePopup.innerText = text + '|';
171
100
  }
172
101
  onSpeechRecognizeResult(text) {
173
102
  this.j.async.clearTimeout(this.__hidePopupTimeout);
174
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.safeRemove(this.messagePopup);
103
+ jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(this.messagePopup);
175
104
  const { j } = this;
176
105
  const { s } = j;
177
106
  if (!this._checkCommand(text)) {
178
107
  const { range } = s, node = s.current();
179
- if (s.isCollapsed() &&
180
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isText(node) &&
181
- jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_2__/* .Dom */ .J.isOrContains(j.editor, node) &&
182
- node.nodeValue) {
108
+ if (s.isCollapsed() && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isText(node) && jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.isOrContains(j.editor, node) && node.nodeValue) {
183
109
  const sentence = node.nodeValue;
184
- node.nodeValue =
185
- sentence +
186
- (/[\u00A0 ]\uFEFF*$/.test(sentence) ? '' : ' ') +
187
- text;
110
+ node.nodeValue = sentence + (/[\u00A0 ]\uFEFF*$/.test(sentence) ? '' : ' ') + text;
188
111
  range.setStartAfter(node);
189
112
  s.selectRange(range);
190
113
  j.synchronizeValues();
191
- }
192
- else {
114
+ } else {
193
115
  s.insertHTML(text);
194
116
  }
195
117
  }
@@ -197,62 +119,113 @@ class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5
197
119
  _checkCommand(command) {
198
120
  command = command.toLowerCase().replace(/\./g, '');
199
121
  if (this._commandToWord[command]) {
200
- (0,_helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_8__/* .execSpellCommand */ .F)(this.j, this._commandToWord[command]);
122
+ (0,_helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_9__.execSpellCommand)(this.j, this._commandToWord[command]);
201
123
  return true;
202
124
  }
203
125
  return false;
204
126
  }
127
+ constructor(...args){
128
+ super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "buttons", [
129
+ {
130
+ group: 'state',
131
+ name: 'speechRecognize'
132
+ }
133
+ ]), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "messagePopup", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__hidePopupTimeout", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "_commandToWord", {});
134
+ }
205
135
  }
206
- (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
207
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':speechRecognizeProgressResult')
136
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
137
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_2__.watch)(':speechRecognizeProgressResult')
208
138
  ], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
209
- (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
210
- (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':speechRecognizeResult')
139
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
140
+ (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_2__.watch)(':speechRecognizeResult')
211
141
  ], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
212
- _jodit__WEBPACK_IMPORTED_MODULE_7__/* .Jodit */ .x.plugins.add('speech-recognize', SpeechRecognizeNative);
142
+ _jodit__WEBPACK_IMPORTED_MODULE_8__.Jodit.plugins.add('speech-recognize', SpeechRecognizeNative);
213
143
 
214
144
 
215
145
  /***/ }),
216
146
 
217
- /***/ 50834:
147
+ /***/ 32560:
218
148
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
219
149
 
220
150
  "use strict";
221
151
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
222
- /* harmony export */ F: function() { return /* binding */ execSpellCommand; }
152
+ /* harmony export */ sound: function() { return /* binding */ sound; }
223
153
  /* harmony export */ });
154
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
155
+ /* harmony import */ var jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94092);
224
156
  /*!
225
157
  * Jodit Editor (https://xdsoft.net/jodit/)
226
158
  * Released under MIT see LICENSE.txt in the project root for license information.
227
159
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
228
- */
229
- function execSpellCommand(jodit, commandSentence) {
230
- const [command, value] = commandSentence.split('::');
231
- jodit.execCommand(command, null, value);
160
+ */ /**
161
+ * @module plugins/speech-recognize
162
+ */
163
+
164
+ /**
165
+ * @internal
166
+ */ function sound({ sec = 0.1, frequency = jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_1__.PII, gain = 0.1, type = 'sine' } = {}) {
167
+ if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow || typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.AudioContext === 'undefined' && typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitAudioContext === 'undefined') {
168
+ return;
169
+ }
170
+ // one context per document
171
+ const context = new (jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.AudioContext || jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitAudioContext)();
172
+ const vol = context.createGain();
173
+ const osc = context.createOscillator();
174
+ osc.type = type;
175
+ osc.frequency.value = frequency; // Hz
176
+ osc.connect(vol);
177
+ vol.connect(context.destination);
178
+ osc.start(); // start the oscillator
179
+ osc.stop(context.currentTime + sec);
180
+ vol.gain.value = gain;
232
181
  }
233
182
 
234
183
 
235
184
  /***/ }),
236
185
 
237
- /***/ 71096:
238
- /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
186
+ /***/ 43219:
187
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
239
188
 
240
189
  "use strict";
241
- /* harmony import */ var jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9810);
242
- /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(98253);
243
- /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26150);
244
- /* harmony import */ var jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(72197);
245
- /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(931);
246
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(36115);
247
- /* harmony import */ var _helpers_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(71722);
248
- /* harmony import */ var _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(93676);
249
- /* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22227);
250
- /* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8__);
190
+ __webpack_require__.r(__webpack_exports__);
191
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
192
+ /* harmony export */ ar: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
193
+ /* harmony export */ cs_cz: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
194
+ /* harmony export */ de: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
195
+ /* harmony export */ es: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
196
+ /* harmony export */ fa: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
197
+ /* harmony export */ fi: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
198
+ /* harmony export */ fr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
199
+ /* harmony export */ he: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
200
+ /* harmony export */ hu: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
201
+ /* harmony export */ id: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
202
+ /* harmony export */ it: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
203
+ /* harmony export */ ja: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
204
+ /* harmony export */ ko: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
205
+ /* harmony export */ mn: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
206
+ /* harmony export */ nl: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
207
+ /* harmony export */ no: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
208
+ /* harmony export */ pl: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
209
+ /* harmony export */ pt_br: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
210
+ /* harmony export */ ru: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
211
+ /* harmony export */ tr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
212
+ /* harmony export */ ua: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
213
+ /* harmony export */ zh_cn: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
214
+ /* harmony export */ zh_tw: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; }
215
+ /* harmony export */ });
216
+ /* harmony import */ var _ar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41324);
217
+ /* harmony import */ var _ar_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ar_js__WEBPACK_IMPORTED_MODULE_0__);
251
218
  /*!
252
219
  * Jodit Editor (https://xdsoft.net/jodit/)
253
220
  * Released under MIT see LICENSE.txt in the project root for license information.
254
221
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
255
- */
222
+ */ // @ts-nocheck
223
+
224
+
225
+
226
+
227
+
228
+
256
229
 
257
230
 
258
231
 
@@ -262,169 +235,45 @@ function execSpellCommand(jodit, commandSentence) {
262
235
 
263
236
 
264
237
 
265
- jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.speechRecognize = {
266
- api: typeof _helpers_api__WEBPACK_IMPORTED_MODULE_6__/* .SpeechRecognition */ .o !== 'undefined' ? _helpers_api__WEBPACK_IMPORTED_MODULE_6__/* .SpeechRecognition */ .o : null,
267
- sound: true,
268
- continuous: false,
269
- interimResults: true,
270
- commands: {
271
- 'newline|enter': 'enter',
272
- 'delete|remove word|delete word': 'backspaceWordButton',
273
- comma: 'inserthtml::,',
274
- underline: 'inserthtml::_',
275
- hyphen: 'inserthtml::-',
276
- space: 'inserthtml:: ',
277
- question: 'inserthtml::?',
278
- dot: 'inserthtml::.',
279
- 'quote|quotes|open quote': "inserthtml::'",
280
- 'header|header h1': 'formatblock::h1',
281
- 'select all': 'selectall'
282
- }
283
- };
284
- jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__/* .Icon */ .I.set('speech-recognize', (_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8___default()));
285
- jodit_config__WEBPACK_IMPORTED_MODULE_5__/* .Config */ .T.prototype.controls.speechRecognize = {
286
- isVisible(j) {
287
- return Boolean(j.o.speechRecognize.api);
288
- },
289
- isActive(jodit, _) {
290
- const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__/* .dataBind */ .m)(jodit, 'speech');
291
- return Boolean(api?.isEnabled);
292
- },
293
- isDisabled(jodit) {
294
- return !jodit.o.speechRecognize.api;
295
- },
296
- exec(jodit, current, { button, control }) {
297
- const { api: ApiConstructor, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
298
- if (!ApiConstructor) {
299
- jodit.alert('Speech recognize API unsupported in your browser');
300
- return;
301
- }
302
- let api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__/* .dataBind */ .m)(jodit, 'speech');
303
- if (!api) {
304
- const nativeApi = new ApiConstructor();
305
- api = new _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_7__/* .RecognizeManager */ .g(jodit.async, nativeApi);
306
- api.lang = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .K)(lang)
307
- ? lang
308
- : ((0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__/* .attr */ .C)(jodit.od.documentElement, 'lang') ?? undefined);
309
- api.continuous = continuous;
310
- api.interimResults = interimResults;
311
- api.sound = sound;
312
- (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__/* .dataBind */ .m)(jodit, 'speech', api);
313
- api.on('pulse', (enable) => {
314
- button.setMod('pulse', enable);
315
- });
316
- api.on('result', (text) => jodit.e.fire('speechRecognizeResult', text));
317
- api.on('progress', (text) => jodit.e.fire('speechRecognizeProgressResult', text));
318
- api.on('error', (text) => jodit.message.error(text));
319
- button.hookStatus('beforeDestruct', () => {
320
- (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__/* .dataBind */ .m)(jodit, 'speech', null);
321
- api.destruct();
322
- });
323
- }
324
- if (control.args) {
325
- const key = control.args[0];
326
- if ((0,jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_0__/* .isBoolean */ .L)(api[key])) {
327
- api[key] = !api[key];
328
- if (api.isEnabled) {
329
- api.restart();
330
- }
331
- return;
332
- }
333
- }
334
- api.toggle();
335
- if (api.isEnabled) {
336
- button.setMod('pulse', true);
337
- }
338
- button.state.activated = api.isEnabled;
339
- },
340
- name: 'speechRecognize',
341
- command: 'toggleSpeechRecognize',
342
- tooltip: 'Speech Recognize',
343
- list: {
344
- sound: 'Sound',
345
- interimResults: 'Interim Results'
346
- },
347
- childTemplate(jodit, key, value) {
348
- const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__/* .dataBind */ .m)(jodit, 'speech'), checked = api?.[key] ?? jodit.o.speechRecognize[key];
349
- return `<span class='jodit-speech-recognize__list-item'><input ${checked ? 'checked' : ''} class='jodit-checkbox' type='checkbox'>&nbsp;${value}</span>`;
350
- },
351
- mods: {
352
- stroke: false
353
- }
354
- };
355
238
 
356
239
 
357
- /***/ }),
358
240
 
359
- /***/ 71722:
360
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
361
241
 
362
- "use strict";
363
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
364
- /* harmony export */ o: function() { return /* binding */ SpeechRecognition; }
365
- /* harmony export */ });
366
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
367
- /*!
368
- * Jodit Editor (https://xdsoft.net/jodit/)
369
- * Released under MIT see LICENSE.txt in the project root for license information.
370
- * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
371
- */
372
242
 
373
- const SpeechRecognition = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow
374
- ? jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.SpeechRecognition ||
375
- jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitSpeechRecognition
376
- : undefined;
377
243
 
378
244
 
379
- /***/ }),
380
245
 
381
- /***/ 81629:
382
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
383
246
 
384
- "use strict";
385
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
386
- /* harmony export */ N: function() { return /* binding */ PII; },
387
- /* harmony export */ Z: function() { return /* binding */ WARN; }
388
- /* harmony export */ });
389
- /*!
390
- * Jodit Editor (https://xdsoft.net/jodit/)
391
- * Released under MIT see LICENSE.txt in the project root for license information.
392
- * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
393
- */
394
- /**
395
- * @module plugins/speech-recognize
396
- * @internal
397
- */
398
- const PII = 440;
399
- const WARN = 940;
400
247
 
401
248
 
402
249
  /***/ }),
403
250
 
404
- /***/ 93676:
251
+ /***/ 68097:
405
252
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
406
253
 
407
254
  "use strict";
408
255
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
409
- /* harmony export */ g: function() { return /* binding */ RecognizeManager; }
256
+ /* harmony export */ RecognizeManager: function() { return /* binding */ RecognizeManager; }
410
257
  /* harmony export */ });
411
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31635);
412
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22664);
413
- /* harmony import */ var jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43431);
414
- /* harmony import */ var _sound__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(95473);
415
- /* harmony import */ var jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(81629);
258
+ /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
259
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
260
+ /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(84839);
261
+ /* harmony import */ var jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(60216);
262
+ /* harmony import */ var _sound__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(32560);
263
+ /* harmony import */ var jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(94092);
416
264
  /*!
417
265
  * Jodit Editor (https://xdsoft.net/jodit/)
418
266
  * Released under MIT see LICENSE.txt in the project root for license information.
419
267
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
420
- */
421
- var RecognizeManager_1;
268
+ */ /**
269
+ * @module plugins/speech-recognize
270
+ */
422
271
 
423
272
 
424
273
 
425
274
 
426
275
 
427
- let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MODULE_2__/* .Eventify */ .h {
276
+ class RecognizeManager extends jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MODULE_3__.Eventify {
428
277
  set lang(v) {
429
278
  this._lang = v;
430
279
  this._api.lang = v;
@@ -446,33 +295,9 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
446
295
  get interimResults() {
447
296
  return this._interimResults;
448
297
  }
449
- constructor(async, api) {
450
- super();
451
- this.async = async;
452
- this._continuous = false;
453
- this._interimResults = false;
454
- this.sound = true;
455
- this._isEnabled = false;
456
- this._restartTimeout = 0;
457
- this._onSpeechStart = (e) => {
458
- if (!this._isEnabled) {
459
- return;
460
- }
461
- this.async.clearTimeout(this._restartTimeout);
462
- this._restartTimeout = this.async.setTimeout(() => {
463
- this.restart();
464
- this.emit('pulse', false);
465
- this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_4__/* .WARN */ .Z);
466
- }, 5000);
467
- this.emit('pulse', true);
468
- };
469
- this.__interimResults = '';
470
- this._api = api;
471
- RecognizeManager_1._instances.add(this);
472
- }
473
298
  destruct() {
474
299
  this.stop();
475
- RecognizeManager_1._instances.delete(this);
300
+ RecognizeManager._instances.delete(this);
476
301
  super.destruct();
477
302
  }
478
303
  get isEnabled() {
@@ -483,23 +308,19 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
483
308
  return;
484
309
  }
485
310
  this._isEnabled = true;
486
- RecognizeManager_1._instances.forEach(instance => {
311
+ RecognizeManager._instances.forEach((instance)=>{
487
312
  if (instance !== this) {
488
313
  instance.stop();
489
314
  }
490
315
  });
491
316
  try {
492
317
  this._api.start();
493
- }
494
- catch (e) {
318
+ } catch (e) {
495
319
  this._onError(e);
496
320
  this.stop();
497
321
  return;
498
322
  }
499
- this.__on('speechstart', this._onSpeechStart)
500
- .__on('error', this._onError)
501
- .__on('result', this._onProgress)
502
- .__on('end', this._onResults);
323
+ this.__on('speechstart', this._onSpeechStart).__on('error', this._onError).__on('result', this._onProgress).__on('end', this._onResults);
503
324
  }
504
325
  stop() {
505
326
  if (!this._isEnabled) {
@@ -507,10 +328,7 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
507
328
  }
508
329
  this._api.abort();
509
330
  this._api.stop();
510
- this.__off('speechstart', this._onSpeechStart)
511
- .__off('error', this._onError)
512
- .__off('result', this._onProgress)
513
- .__off('end', this._onResults);
331
+ this.__off('speechstart', this._onSpeechStart).__off('error', this._onError).__off('result', this._onProgress).__off('end', this._onResults);
514
332
  this.async.clearTimeout(this._restartTimeout);
515
333
  this._isEnabled = false;
516
334
  this.emit('pulse', false);
@@ -518,8 +336,7 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
518
336
  toggle() {
519
337
  if (!this._isEnabled) {
520
338
  this.start();
521
- }
522
- else {
339
+ } else {
523
340
  this.stop();
524
341
  }
525
342
  }
@@ -539,7 +356,7 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
539
356
  this.emit('pulse', false);
540
357
  this.emit('result', this.__interimResults);
541
358
  this.__interimResults = '';
542
- this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_4__/* .PII */ .N);
359
+ this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_5__.PII);
543
360
  this.restart();
544
361
  }
545
362
  _onProgress(e) {
@@ -550,7 +367,7 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
550
367
  if (!e.results) {
551
368
  return;
552
369
  }
553
- for (let i = 0; i < e.results.length; i++) {
370
+ for(let i = 0; i < e.results.length; i++){
554
371
  const resultItem = e.results.item(i);
555
372
  if (resultItem.length) {
556
373
  const { transcript } = resultItem.item(0);
@@ -568,71 +385,225 @@ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends jodit
568
385
  if (e.error === 'not-allowed') {
569
386
  this.emit('error', 'Not allowed');
570
387
  }
571
- if (e.error === 'language-unavailable' ||
572
- // @ts-ignore
573
- e.error === 'language-not-supported') {
388
+ if (e.error === 'language-unavailable' || // @ts-ignore
389
+ e.error === 'language-not-supported') {
574
390
  this.emit('error', 'Language unavailable');
575
391
  }
576
- this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_4__/* .WARN */ .Z);
392
+ this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_5__.WARN);
577
393
  this.emit('pulse', false);
578
394
  this.stop();
579
395
  }
580
396
  _makeSound(frequency) {
581
397
  if (this.sound) {
582
- (0,_sound__WEBPACK_IMPORTED_MODULE_3__/* .sound */ .s)({ frequency });
398
+ (0,_sound__WEBPACK_IMPORTED_MODULE_4__.sound)({
399
+ frequency
400
+ });
583
401
  }
584
402
  }
585
- };
586
- RecognizeManager._instances = new Set();
587
- RecognizeManager = RecognizeManager_1 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__/* .__decorate */ .Cg)([
588
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_1__.autobind
403
+ constructor(async, api){
404
+ super(), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "async", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "_lang", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "_continuous", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "_interimResults", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "sound", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "_isEnabled", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "_restartTimeout", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "_onSpeechStart", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "_api", void 0), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "__interimResults", void 0), this.async = async, this._continuous = false, this._interimResults = false, this.sound = true, this._isEnabled = false, this._restartTimeout = 0, this._onSpeechStart = (e)=>{
405
+ if (!this._isEnabled) {
406
+ return;
407
+ }
408
+ this.async.clearTimeout(this._restartTimeout);
409
+ this._restartTimeout = this.async.setTimeout(()=>{
410
+ this.restart();
411
+ this.emit('pulse', false);
412
+ this._makeSound(jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_5__.WARN);
413
+ }, 5000);
414
+ this.emit('pulse', true);
415
+ }, this.__interimResults = '';
416
+ this._api = api;
417
+ RecognizeManager._instances.add(this);
418
+ }
419
+ }
420
+ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(RecognizeManager, "_instances", new Set());
421
+ RecognizeManager = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
422
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
589
423
  ], RecognizeManager);
590
424
 
591
425
 
426
+ /***/ }),
427
+
428
+ /***/ 75143:
429
+ /***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
430
+
431
+ "use strict";
432
+ /* harmony import */ var jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22289);
433
+ /* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
434
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
435
+ /* harmony import */ var jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36400);
436
+ /* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
437
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
438
+ /* harmony import */ var _helpers_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(97743);
439
+ /* harmony import */ var _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(68097);
440
+ /* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22227);
441
+ /* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8__);
442
+ /*!
443
+ * Jodit Editor (https://xdsoft.net/jodit/)
444
+ * Released under MIT see LICENSE.txt in the project root for license information.
445
+ * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
446
+ */ /**
447
+ * @module plugins/speech-recognize
448
+ */
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.speechRecognize = {
458
+ api: typeof _helpers_api__WEBPACK_IMPORTED_MODULE_6__.SpeechRecognition !== 'undefined' ? _helpers_api__WEBPACK_IMPORTED_MODULE_6__.SpeechRecognition : null,
459
+ sound: true,
460
+ continuous: false,
461
+ interimResults: true,
462
+ commands: {
463
+ 'newline|enter': 'enter',
464
+ 'delete|remove word|delete word': 'backspaceWordButton',
465
+ comma: 'inserthtml::,',
466
+ underline: 'inserthtml::_',
467
+ hyphen: 'inserthtml::-',
468
+ space: 'inserthtml:: ',
469
+ question: 'inserthtml::?',
470
+ dot: 'inserthtml::.',
471
+ 'quote|quotes|open quote': "inserthtml::'",
472
+ 'header|header h1': 'formatblock::h1',
473
+ 'select all': 'selectall'
474
+ }
475
+ };
476
+ jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('speech-recognize', (_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8___default()));
477
+ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.speechRecognize = {
478
+ isVisible (j) {
479
+ return Boolean(j.o.speechRecognize.api);
480
+ },
481
+ isActive (jodit, _) {
482
+ const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech');
483
+ return Boolean(api?.isEnabled);
484
+ },
485
+ isDisabled (jodit) {
486
+ return !jodit.o.speechRecognize.api;
487
+ },
488
+ exec (jodit, current, { button, control }) {
489
+ const { api: ApiConstructor, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
490
+ if (!ApiConstructor) {
491
+ jodit.alert('Speech recognize API unsupported in your browser');
492
+ return;
493
+ }
494
+ let api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech');
495
+ if (!api) {
496
+ const nativeApi = new ApiConstructor();
497
+ api = new _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_7__.RecognizeManager(jodit.async, nativeApi);
498
+ api.lang = (0,jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__.isString)(lang) ? lang : (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__.attr)(jodit.od.documentElement, 'lang') ?? undefined;
499
+ api.continuous = continuous;
500
+ api.interimResults = interimResults;
501
+ api.sound = sound;
502
+ (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech', api);
503
+ api.on('pulse', (enable)=>{
504
+ button.setMod('pulse', enable);
505
+ });
506
+ api.on('result', (text)=>jodit.e.fire('speechRecognizeResult', text));
507
+ api.on('progress', (text)=>jodit.e.fire('speechRecognizeProgressResult', text));
508
+ api.on('error', (text)=>jodit.message.error(text));
509
+ button.hookStatus('beforeDestruct', ()=>{
510
+ (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech', null);
511
+ api.destruct();
512
+ });
513
+ }
514
+ if (control.args) {
515
+ const key = control.args[0];
516
+ if ((0,jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(api[key])) {
517
+ api[key] = !api[key];
518
+ if (api.isEnabled) {
519
+ api.restart();
520
+ }
521
+ return;
522
+ }
523
+ }
524
+ api.toggle();
525
+ if (api.isEnabled) {
526
+ button.setMod('pulse', true);
527
+ }
528
+ button.state.activated = api.isEnabled;
529
+ },
530
+ name: 'speechRecognize',
531
+ command: 'toggleSpeechRecognize',
532
+ tooltip: 'Speech Recognize',
533
+ list: {
534
+ sound: 'Sound',
535
+ interimResults: 'Interim Results'
536
+ },
537
+ childTemplate (jodit, key, value) {
538
+ const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech'), checked = api?.[key] ?? jodit.o.speechRecognize[key];
539
+ return `<span class='jodit-speech-recognize__list-item'><input ${checked ? 'checked' : ''} class='jodit-checkbox' type='checkbox'>&nbsp;${value}</span>`;
540
+ },
541
+ mods: {
542
+ stroke: false
543
+ }
544
+ };
545
+
592
546
 
593
547
  /***/ }),
594
548
 
595
- /***/ 95473:
549
+ /***/ 86581:
596
550
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
597
551
 
598
552
  "use strict";
599
553
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
600
- /* harmony export */ s: function() { return /* binding */ sound; }
554
+ /* harmony export */ execSpellCommand: function() { return /* binding */ execSpellCommand; }
601
555
  /* harmony export */ });
602
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17352);
603
- /* harmony import */ var jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81629);
604
556
  /*!
605
557
  * Jodit Editor (https://xdsoft.net/jodit/)
606
558
  * Released under MIT see LICENSE.txt in the project root for license information.
607
559
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
608
- */
609
- /**
560
+ */ /**
610
561
  * @module plugins/speech-recognize
611
- */
562
+ */ function execSpellCommand(jodit, commandSentence) {
563
+ const [command, value] = commandSentence.split('::');
564
+ jodit.execCommand(command, null, value);
565
+ }
612
566
 
613
567
 
614
- /**
568
+ /***/ }),
569
+
570
+ /***/ 94092:
571
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
572
+
573
+ "use strict";
574
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
575
+ /* harmony export */ PII: function() { return /* binding */ PII; },
576
+ /* harmony export */ WARN: function() { return /* binding */ WARN; }
577
+ /* harmony export */ });
578
+ /*!
579
+ * Jodit Editor (https://xdsoft.net/jodit/)
580
+ * Released under MIT see LICENSE.txt in the project root for license information.
581
+ * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
582
+ */ /**
583
+ * @module plugins/speech-recognize
615
584
  * @internal
616
- */
617
- function sound({ sec = 0.1, frequency = jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_1__/* .PII */ .N, gain = 0.1, type = 'sine' } = {}) {
618
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow ||
619
- (typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.AudioContext === 'undefined' &&
620
- typeof jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitAudioContext === 'undefined')) {
621
- return;
622
- }
623
- // one context per document
624
- const context = new (jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.AudioContext ||
625
- jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitAudioContext)();
626
- const vol = context.createGain();
627
- const osc = context.createOscillator();
628
- osc.type = type;
629
- osc.frequency.value = frequency; // Hz
630
- osc.connect(vol);
631
- vol.connect(context.destination);
632
- osc.start(); // start the oscillator
633
- osc.stop(context.currentTime + sec);
634
- vol.gain.value = gain;
635
- }
585
+ */ const PII = 440;
586
+ const WARN = 940;
587
+
588
+
589
+ /***/ }),
590
+
591
+ /***/ 97743:
592
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
593
+
594
+ "use strict";
595
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
596
+ /* harmony export */ SpeechRecognition: function() { return /* binding */ SpeechRecognition; }
597
+ /* harmony export */ });
598
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
599
+ /*!
600
+ * Jodit Editor (https://xdsoft.net/jodit/)
601
+ * Released under MIT see LICENSE.txt in the project root for license information.
602
+ * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
603
+ */ /**
604
+ * @module plugins/speech-recognize
605
+ */
606
+ const SpeechRecognition = jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow ? jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.SpeechRecognition || jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitSpeechRecognition : undefined;
636
607
 
637
608
 
638
609
  /***/ })
@@ -640,7 +611,7 @@ function sound({ sec = 0.1, frequency = jodit_plugins_speech_recognize_constants
640
611
  },
641
612
  /******/ function(__webpack_require__) { // webpackRuntimeModules
642
613
  /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
643
- /******/ var __webpack_exports__ = (__webpack_exec__(37873));
614
+ /******/ var __webpack_exports__ = (__webpack_exec__(31262));
644
615
  /******/ return __webpack_exports__;
645
616
  /******/ }
646
617
  ]);