jodit 4.0.0-beta.44 → 4.0.0-beta.49

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 (81) hide show
  1. package/README.md +4 -4
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.js +414 -333
  4. package/es2015/jodit.min.js +2 -2
  5. package/es2015/plugins/debug/debug.js +1 -1
  6. package/es2015/plugins/debug/debug.min.js +1 -1
  7. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  8. package/es2015/plugins/speech-recognize/speech-recognize.js +781 -761
  9. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  10. package/es2018/jodit.css +1 -1
  11. package/es2018/jodit.js +412 -331
  12. package/es2018/jodit.min.js +2 -2
  13. package/es2018/plugins/debug/debug.js +1 -1
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  16. package/es2018/plugins/speech-recognize/speech-recognize.js +781 -761
  17. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  18. package/es2021/jodit.css +1 -1
  19. package/es2021/jodit.js +412 -331
  20. package/es2021/jodit.min.js +2 -2
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +780 -760
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.js +12 -11
  28. package/es2021.en/jodit.min.js +2 -2
  29. package/es2021.en/plugins/debug/debug.js +1 -1
  30. package/es2021.en/plugins/debug/debug.min.js +1 -1
  31. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  32. package/es2021.en/plugins/speech-recognize/speech-recognize.js +3 -3
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  34. package/es5/jodit.css +2 -2
  35. package/es5/jodit.js +1103 -1023
  36. package/es5/jodit.min.css +1 -1
  37. package/es5/jodit.min.js +2 -2
  38. package/es5/plugins/debug/debug.js +2 -2
  39. package/es5/plugins/debug/debug.min.js +2 -2
  40. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  41. package/es5/plugins/speech-recognize/speech-recognize.js +798 -778
  42. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  43. package/esm/config.js +2 -1
  44. package/esm/core/constants.js +1 -1
  45. package/esm/plugins/preview/preview.js +1 -1
  46. package/package.json +1 -1
  47. package/types/config.d.ts +2 -1
  48. package/types/tsconfig.json +2 -20
  49. package/esm/plugins/source/editor/engines/custom.js +0 -34
  50. package/esm/plugins/speech-recognize/config.js +0 -92
  51. package/esm/plugins/speech-recognize/constants.js +0 -11
  52. package/esm/plugins/speech-recognize/helpers/api.js +0 -7
  53. package/esm/plugins/speech-recognize/helpers/exec-spell-command.js +0 -9
  54. package/esm/plugins/speech-recognize/helpers/recognize-manager.js +0 -168
  55. package/esm/plugins/speech-recognize/helpers/sound.js +0 -30
  56. package/esm/plugins/speech-recognize/interface.js +0 -6
  57. package/esm/plugins/speech-recognize/langs/ar.js +0 -14
  58. package/esm/plugins/speech-recognize/langs/cs_cz.js +0 -14
  59. package/esm/plugins/speech-recognize/langs/de.js +0 -14
  60. package/esm/plugins/speech-recognize/langs/es.js +0 -14
  61. package/esm/plugins/speech-recognize/langs/fa.js +0 -14
  62. package/esm/plugins/speech-recognize/langs/fr.js +0 -14
  63. package/esm/plugins/speech-recognize/langs/he.js +0 -14
  64. package/esm/plugins/speech-recognize/langs/hu.js +0 -14
  65. package/esm/plugins/speech-recognize/langs/id.js +0 -14
  66. package/esm/plugins/speech-recognize/langs/index.js +0 -1
  67. package/esm/plugins/speech-recognize/langs/it.js +0 -14
  68. package/esm/plugins/speech-recognize/langs/ja.js +0 -14
  69. package/esm/plugins/speech-recognize/langs/ko.js +0 -14
  70. package/esm/plugins/speech-recognize/langs/mn.js +0 -14
  71. package/esm/plugins/speech-recognize/langs/nl.js +0 -14
  72. package/esm/plugins/speech-recognize/langs/pl.js +0 -14
  73. package/esm/plugins/speech-recognize/langs/pt_br.js +0 -14
  74. package/esm/plugins/speech-recognize/langs/ru.js +0 -14
  75. package/esm/plugins/speech-recognize/langs/tr.js +0 -14
  76. package/esm/plugins/speech-recognize/langs/zh_cn.js +0 -14
  77. package/esm/plugins/speech-recognize/langs/zh_tw.js +0 -14
  78. package/esm/plugins/speech-recognize/speech-recognize.js +0 -115
  79. package/esm/polyfills.js +0 -54
  80. package/types/plugins/source/editor/engines/custom.d.ts +0 -27
  81. package/types/polyfills.d.ts +0 -10
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.0.0-beta.44
4
+ * Version: v4.0.0-beta.49
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -18,1023 +18,1043 @@
18
18
  })(self, function() {
19
19
  return (self["webpackChunkjodit"] = self["webpackChunkjodit"] || []).push([[781],{
20
20
 
21
- /***/ 29204:
22
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
21
+ /***/ 57998:
22
+ /***/ (function(module) {
23
23
 
24
24
  "use strict";
25
- // ESM COMPAT FLAG
26
- __webpack_require__.r(__webpack_exports__);
27
25
 
28
- // EXPORTS
29
- __webpack_require__.d(__webpack_exports__, {
30
- "SpeechRecognizeNative": function() { return /* binding */ SpeechRecognizeNative; }
31
- });
26
+ /*!
27
+ * Jodit Editor (https://xdsoft.net/jodit/)
28
+ * Released under MIT see LICENSE.txt in the project root for license information.
29
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
30
+ */
31
+ module.exports = {
32
+ newline: 'الخط الجديد',
33
+ delete: 'حذف',
34
+ space: 'الفضاء',
35
+ 'Speech Recognize': 'التعرف على الكلام',
36
+ Sound: 'الصوت',
37
+ 'Interim Results': 'النتائج المؤقتة'
38
+ };
32
39
 
33
- // NAMESPACE OBJECT: ./src/plugins/speech-recognize/langs/index.ts
34
- var langs_namespaceObject = {};
35
- __webpack_require__.r(langs_namespaceObject);
36
- __webpack_require__.d(langs_namespaceObject, {
37
- "ar": function() { return ar; },
38
- "cs_cz": function() { return cs_cz; },
39
- "de": function() { return de; },
40
- "es": function() { return es; },
41
- "fa": function() { return fa; },
42
- "fr": function() { return fr; },
43
- "he": function() { return he; },
44
- "hu": function() { return hu; },
45
- "id": function() { return id; },
46
- "it": function() { return it; },
47
- "ja": function() { return ja; },
48
- "ko": function() { return ko; },
49
- "mn": function() { return mn; },
50
- "nl": function() { return nl; },
51
- "pl": function() { return pl; },
52
- "pt_br": function() { return pt_br; },
53
- "ru": function() { return ru; },
54
- "tr": function() { return tr; },
55
- "zh_cn": function() { return zh_cn; },
56
- "zh_tw": function() { return zh_tw; }
57
- });
58
40
 
59
- // EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.js
60
- var tslib_es6 = __webpack_require__(20255);
61
- // EXTERNAL MODULE: ./src/core/plugin/index.ts
62
- var core_plugin = __webpack_require__(7331);
63
- // EXTERNAL MODULE: ./src/core/decorators/watch/watch.ts
64
- var watch = __webpack_require__(69082);
65
- // EXTERNAL MODULE: ./src/core/helpers/utils/utils.ts
66
- var utils = __webpack_require__(87398);
67
- // EXTERNAL MODULE: ./src/core/global.ts
68
- var global = __webpack_require__(79102);
69
- // EXTERNAL MODULE: ./src/core/dom/dom.ts
70
- var dom = __webpack_require__(9162);
71
- // EXTERNAL MODULE: ./src/core/decorators/debounce/debounce.ts
72
- var debounce = __webpack_require__(62294);
73
- ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/exec-spell-command.ts
41
+ /***/ }),
42
+
43
+ /***/ 90833:
44
+ /***/ (function(module) {
45
+
46
+ "use strict";
47
+
74
48
  /*!
75
49
  * Jodit Editor (https://xdsoft.net/jodit/)
76
50
  * Released under MIT see LICENSE.txt in the project root for license information.
77
51
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
78
52
  */
53
+ module.exports = {
54
+ newline: 'řádek',
55
+ delete: 'odstranit',
56
+ space: 'prostora',
57
+ 'Speech Recognize': 'Rozpoznání Řeči',
58
+ Sound: 'Zvuk',
59
+ 'Interim Results': 'Průběžné Výsledky'
60
+ };
79
61
 
80
- function execSpellCommand(jodit, commandSentence) {
81
- var _a = (0,tslib_es6/* __read */.CR)(commandSentence.split('::'), 2), command = _a[0], value = _a[1];
82
- jodit.execCommand(command, null, value);
83
- }
84
62
 
85
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/ar.js
86
- var ar = __webpack_require__(5466);
87
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/cs_cz.js
88
- var cs_cz = __webpack_require__(65226);
89
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/de.js
90
- var de = __webpack_require__(87541);
91
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/es.js
92
- var es = __webpack_require__(87104);
93
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/fa.js
94
- var fa = __webpack_require__(53808);
95
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/fr.js
96
- var fr = __webpack_require__(48954);
97
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/he.js
98
- var he = __webpack_require__(14694);
99
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/hu.js
100
- var hu = __webpack_require__(67381);
101
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/id.js
102
- var id = __webpack_require__(99549);
103
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/it.js
104
- var it = __webpack_require__(28428);
105
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/ja.js
106
- var ja = __webpack_require__(25363);
107
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/ko.js
108
- var ko = __webpack_require__(96929);
109
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/mn.js
110
- var mn = __webpack_require__(26781);
111
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/nl.js
112
- var nl = __webpack_require__(58499);
113
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/pl.js
114
- var pl = __webpack_require__(59430);
115
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/pt_br.js
116
- var pt_br = __webpack_require__(70297);
117
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/ru.js
118
- var ru = __webpack_require__(98949);
119
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/tr.js
120
- var tr = __webpack_require__(61232);
121
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/zh_cn.js
122
- var zh_cn = __webpack_require__(56775);
123
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/zh_tw.js
124
- var zh_tw = __webpack_require__(97957);
125
- ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/langs/index.ts
63
+ /***/ }),
64
+
65
+ /***/ 36373:
66
+ /***/ (function(module) {
67
+
68
+ "use strict";
69
+
126
70
  /*!
127
71
  * Jodit Editor (https://xdsoft.net/jodit/)
128
72
  * Released under MIT see LICENSE.txt in the project root for license information.
129
73
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
130
74
  */
75
+ module.exports = {
76
+ newline: 'Zeilenumbruch',
77
+ delete: 'löschen',
78
+ space: 'Raum',
79
+ 'Speech Recognize': 'Sprache Erkennen',
80
+ Sound: 'Sound',
81
+ 'Interim Results': 'Zwischenergebnis'
82
+ };
131
83
 
132
84
 
85
+ /***/ }),
86
+
87
+ /***/ 97192:
88
+ /***/ (function(module) {
89
+
90
+ "use strict";
91
+
92
+ /*!
93
+ * Jodit Editor (https://xdsoft.net/jodit/)
94
+ * Released under MIT see LICENSE.txt in the project root for license information.
95
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
96
+ */
97
+ module.exports = {
98
+ newline: 'nueva línea',
99
+ delete: 'eliminar',
100
+ space: 'espacio',
101
+ 'Speech Recognize': 'Reconocimiento de Voz',
102
+ Sound: 'Sonido',
103
+ 'Interim Results': 'Resultados Provisionales'
104
+ };
133
105
 
134
106
 
107
+ /***/ }),
135
108
 
109
+ /***/ 6043:
110
+ /***/ (function(module) {
136
111
 
112
+ "use strict";
137
113
 
114
+ /*!
115
+ * Jodit Editor (https://xdsoft.net/jodit/)
116
+ * Released under MIT see LICENSE.txt in the project root for license information.
117
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
118
+ */
119
+ module.exports = {
120
+ newline: 'خط جدید',
121
+ delete: 'حذف',
122
+ space: 'فضا',
123
+ 'Speech Recognize': 'گفتار را تشخیص دهید',
124
+ Sound: 'صدا',
125
+ 'Interim Results': 'نتایج موقت'
126
+ };
138
127
 
139
128
 
129
+ /***/ }),
140
130
 
131
+ /***/ 76305:
132
+ /***/ (function(module) {
141
133
 
134
+ "use strict";
142
135
 
136
+ /*!
137
+ * Jodit Editor (https://xdsoft.net/jodit/)
138
+ * Released under MIT see LICENSE.txt in the project root for license information.
139
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
140
+ */
141
+ module.exports = {
142
+ newline: 'nouvelle ligne',
143
+ delete: 'supprimer',
144
+ space: 'espace',
145
+ 'Speech Recognize': 'Reconnaissance Vocale',
146
+ Sound: 'Son',
147
+ 'Interim Results': 'Résultats Intermédiaires'
148
+ };
143
149
 
144
150
 
151
+ /***/ }),
145
152
 
153
+ /***/ 45834:
154
+ /***/ (function(module) {
146
155
 
156
+ "use strict";
147
157
 
158
+ /*!
159
+ * Jodit Editor (https://xdsoft.net/jodit/)
160
+ * Released under MIT see LICENSE.txt in the project root for license information.
161
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
162
+ */
163
+ module.exports = {
164
+ newline: 'חדשות',
165
+ delete: 'מחק',
166
+ space: 'שטח',
167
+ 'Speech Recognize': 'דיבור מזהה',
168
+ Sound: 'קול',
169
+ 'Interim Results': 'תוצאות ביניים'
170
+ };
148
171
 
149
172
 
173
+ /***/ }),
150
174
 
175
+ /***/ 40509:
176
+ /***/ (function(module) {
151
177
 
178
+ "use strict";
152
179
 
153
- // EXTERNAL MODULE: ./src/config.ts
154
- var config = __webpack_require__(37446);
155
- // EXTERNAL MODULE: ./src/core/helpers/utils/data-bind.ts
156
- var data_bind = __webpack_require__(25920);
157
- // EXTERNAL MODULE: ./src/core/helpers/checker/is-boolean.ts
158
- var is_boolean = __webpack_require__(88751);
159
- // EXTERNAL MODULE: ./src/core/ui/icon.ts
160
- var icon = __webpack_require__(30052);
161
- // EXTERNAL MODULE: ./src/core/event-emitter/eventify.ts
162
- var eventify = __webpack_require__(3569);
163
- // EXTERNAL MODULE: ./src/core/decorators/index.ts + 7 modules
164
- var decorators = __webpack_require__(90283);
165
- ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/constants.ts
166
180
  /*!
167
181
  * Jodit Editor (https://xdsoft.net/jodit/)
168
182
  * Released under MIT see LICENSE.txt in the project root for license information.
169
183
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
170
184
  */
171
- /**
172
- * @module plugins/speech-recognize
173
- * @internal
185
+ module.exports = {
186
+ newline: 'újsor',
187
+ delete: 'törlés',
188
+ space: 'tér',
189
+ 'Speech Recognize': 'A Beszéd Felismeri',
190
+ Sound: 'Hang',
191
+ 'Interim Results': 'Időközi Eredmények'
192
+ };
193
+
194
+
195
+ /***/ }),
196
+
197
+ /***/ 75720:
198
+ /***/ (function(module) {
199
+
200
+ "use strict";
201
+
202
+ /*!
203
+ * Jodit Editor (https://xdsoft.net/jodit/)
204
+ * Released under MIT see LICENSE.txt in the project root for license information.
205
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
174
206
  */
175
- var PII = 440;
176
- var WARN = 940;
207
+ module.exports = {
208
+ newline: 'newline',
209
+ delete: 'Hapus',
210
+ space: 'ruang',
211
+ 'Speech Recognize': 'Pidato Mengenali',
212
+ Sound: 'Suara',
213
+ 'Interim Results': 'Hasil Sementara'
214
+ };
215
+
216
+
217
+ /***/ }),
218
+
219
+ /***/ 88369:
220
+ /***/ (function(module) {
221
+
222
+ "use strict";
177
223
 
178
- ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/sound.ts
179
224
  /*!
180
225
  * Jodit Editor (https://xdsoft.net/jodit/)
181
226
  * Released under MIT see LICENSE.txt in the project root for license information.
182
227
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
183
228
  */
184
- /**
185
- * @module plugins/speech-recognize
229
+ module.exports = {
230
+ newline: 'nuova riga',
231
+ delete: 'eliminare',
232
+ space: 'spazio',
233
+ 'Speech Recognize': 'Discorso Riconoscere',
234
+ Sound: 'Suono',
235
+ 'Interim Results': 'Risultati intermedi'
236
+ };
237
+
238
+
239
+ /***/ }),
240
+
241
+ /***/ 30878:
242
+ /***/ (function(module) {
243
+
244
+ "use strict";
245
+
246
+ /*!
247
+ * Jodit Editor (https://xdsoft.net/jodit/)
248
+ * Released under MIT see LICENSE.txt in the project root for license information.
249
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
186
250
  */
251
+ module.exports = {
252
+ newline: '改行',
253
+ delete: '削除',
254
+ space: 'スペース',
255
+ 'Speech Recognize': '音声認識',
256
+ Sound: '音',
257
+ 'Interim Results': '中間結果'
258
+ };
187
259
 
188
- /**
189
- * @internal
260
+
261
+ /***/ }),
262
+
263
+ /***/ 37780:
264
+ /***/ (function(module) {
265
+
266
+ "use strict";
267
+
268
+ /*!
269
+ * Jodit Editor (https://xdsoft.net/jodit/)
270
+ * Released under MIT see LICENSE.txt in the project root for license information.
271
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
190
272
  */
191
- function sound(_a) {
192
- var _b = _a === void 0 ? {} : _a, _c = _b.sec, sec = _c === void 0 ? 0.1 : _c, _d = _b.frequency, frequency = _d === void 0 ? PII : _d, _e = _b.gain, gain = _e === void 0 ? 0.1 : _e, _f = _b.type, type = _f === void 0 ? 'sine' : _f;
193
- if (typeof window.AudioContext === 'undefined' &&
194
- typeof window.webkitAudioContext === 'undefined') {
195
- return;
196
- }
197
- // one context per document
198
- var context = new (window.AudioContext ||
199
- window.webkitAudioContext)();
200
- var vol = context.createGain();
201
- var osc = context.createOscillator();
202
- osc.type = type;
203
- osc.frequency.value = frequency; // Hz
204
- osc.connect(vol);
205
- vol.connect(context.destination);
206
- osc.start(); // start the oscillator
207
- osc.stop(context.currentTime + sec);
208
- vol.gain.value = gain;
209
- }
273
+ module.exports = {
274
+ newline: '줄 바꿈',
275
+ delete: '삭제',
276
+ space: '공간',
277
+ 'Speech Recognize': '음성 인식',
278
+ Sound: '소리',
279
+ 'Interim Results': '중간 결과'
280
+ };
281
+
282
+
283
+ /***/ }),
284
+
285
+ /***/ 4105:
286
+ /***/ (function(module) {
287
+
288
+ "use strict";
210
289
 
211
- ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/recognize-manager.ts
212
290
  /*!
213
291
  * Jodit Editor (https://xdsoft.net/jodit/)
214
292
  * Released under MIT see LICENSE.txt in the project root for license information.
215
293
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
216
294
  */
295
+ module.exports = {
296
+ newline: 'Шинэ мөр',
297
+ delete: 'Устгах',
298
+ space: 'Зай',
299
+ 'Speech Recognize': 'Дуу хоолой таних',
300
+ Sound: 'Дуу',
301
+ 'Interim Results': 'Түр зуурын үр дүн'
302
+ };
217
303
 
218
304
 
305
+ /***/ }),
219
306
 
307
+ /***/ 2589:
308
+ /***/ (function(module) {
220
309
 
310
+ "use strict";
221
311
 
222
- var RecognizeManager = /** @class */ (function (_super) {
223
- (0,tslib_es6/* __extends */.ZT)(RecognizeManager, _super);
224
- function RecognizeManager(async, api) {
225
- var _this = _super.call(this) || this;
226
- _this.async = async;
227
- _this._continuous = false;
228
- _this._interimResults = false;
229
- _this.sound = true;
230
- _this._isEnabled = false;
231
- _this._restartTimeout = 0;
232
- _this._onSpeechStart = function (e) {
233
- if (!_this._isEnabled) {
234
- return;
235
- }
236
- _this.async.clearTimeout(_this._restartTimeout);
237
- _this._restartTimeout = _this.async.setTimeout(function () {
238
- _this.restart();
239
- _this.emit('pulse', false);
240
- _this._makeSound(WARN);
241
- }, 5000);
242
- _this.emit('pulse', true);
243
- };
244
- _this._progressTimeout = 0;
245
- _this._api = api;
246
- RecognizeManager_1._instances.add(_this);
247
- return _this;
248
- }
249
- RecognizeManager_1 = RecognizeManager;
250
- Object.defineProperty(RecognizeManager.prototype, "lang", {
251
- get: function () {
252
- return this._lang;
253
- },
254
- set: function (v) {
255
- this._lang = v;
256
- this._api.lang = v;
257
- },
258
- enumerable: false,
259
- configurable: true
260
- });
261
- Object.defineProperty(RecognizeManager.prototype, "continuous", {
262
- get: function () {
263
- return this._continuous;
264
- },
265
- set: function (v) {
266
- this._continuous = v;
267
- this._api.continuous = v;
268
- },
269
- enumerable: false,
270
- configurable: true
271
- });
272
- Object.defineProperty(RecognizeManager.prototype, "interimResults", {
273
- get: function () {
274
- return this._interimResults;
275
- },
276
- set: function (v) {
277
- this._interimResults = v;
278
- this._api.interimResults = v;
279
- },
280
- enumerable: false,
281
- configurable: true
282
- });
283
- RecognizeManager.prototype.destruct = function () {
284
- this.stop();
285
- RecognizeManager_1._instances.delete(this);
286
- _super.prototype.destruct.call(this);
287
- };
288
- Object.defineProperty(RecognizeManager.prototype, "isEnabled", {
289
- get: function () {
290
- return this._isEnabled;
291
- },
292
- enumerable: false,
293
- configurable: true
294
- });
295
- RecognizeManager.prototype.start = function () {
296
- var _this = this;
297
- if (this._isEnabled) {
298
- return;
299
- }
300
- this._isEnabled = true;
301
- RecognizeManager_1._instances.forEach(function (instance) {
302
- if (instance !== _this) {
303
- instance.stop();
304
- }
305
- });
306
- this._api.start();
307
- this.__on('speechstart', this._onSpeechStart)
308
- .__on('error', this._onError)
309
- .__on('result', this._onResult);
310
- };
311
- RecognizeManager.prototype.stop = function () {
312
- if (!this._isEnabled) {
313
- return;
314
- }
315
- try {
316
- this._api.abort();
317
- this._api.stop();
318
- }
319
- catch (_a) { }
320
- this.__off('speechstart', this._onSpeechStart)
321
- .__off('error', this._onError)
322
- .__off('result', this._onResult);
323
- this.async.clearTimeout(this._restartTimeout);
324
- this._isEnabled = false;
325
- this.emit('pulse', false);
326
- };
327
- RecognizeManager.prototype.toggle = function () {
328
- if (!this._isEnabled) {
329
- this.start();
330
- }
331
- else {
332
- this.stop();
333
- }
334
- };
335
- RecognizeManager.prototype.restart = function () {
336
- this.stop();
337
- this.start();
338
- };
339
- RecognizeManager.prototype.__on = function (event, callback) {
340
- this._api.addEventListener(event, callback);
341
- return this;
342
- };
343
- RecognizeManager.prototype.__off = function (event, callback) {
344
- this._api.removeEventListener(event, callback);
345
- return this;
346
- };
347
- RecognizeManager.prototype._onResult = function (e) {
348
- var _this = this;
349
- if (!this._isEnabled) {
350
- return;
351
- }
352
- this.async.clearTimeout(this._progressTimeout);
353
- var resultItem = e.results.item(e.resultIndex);
354
- var transcript = resultItem.item(0).transcript;
355
- var resultHandler = function () {
356
- try {
357
- _this.async.clearTimeout(_this._restartTimeout);
358
- _this.emit('result', transcript);
359
- }
360
- catch (_a) { }
361
- _this.restart();
362
- _this.emit('pulse', false);
363
- _this._makeSound(PII);
364
- };
365
- if (resultItem.isFinal === false) {
366
- this.emit('progress', transcript);
367
- this._progressTimeout = this.async.setTimeout(resultHandler, 500);
368
- return;
369
- }
370
- resultHandler();
371
- };
372
- RecognizeManager.prototype._onError = function () {
373
- if (!this._isEnabled) {
374
- return;
375
- }
376
- this._makeSound(WARN);
377
- this.emit('pulse', false);
378
- this.restart();
379
- };
380
- RecognizeManager.prototype._makeSound = function (frequency) {
381
- if (this.sound) {
382
- sound({ frequency: frequency });
383
- }
384
- };
385
- var RecognizeManager_1;
386
- RecognizeManager._instances = new Set();
387
- RecognizeManager = RecognizeManager_1 = (0,tslib_es6/* __decorate */.gn)([
388
- decorators.autobind
389
- ], RecognizeManager);
390
- return RecognizeManager;
391
- }(eventify/* Eventify */.a));
392
-
393
- ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/api.ts
394
- /*!
395
- * Jodit Editor (https://xdsoft.net/jodit/)
396
- * Released under MIT see LICENSE.txt in the project root for license information.
397
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
398
- */
399
- var SpeechRecognition = window.SpeechRecognition ||
400
- window.webkitSpeechRecognition;
401
-
402
- // EXTERNAL MODULE: ./src/plugins/speech-recognize/speech-recognize.svg
403
- var speech_recognize = __webpack_require__(55106);
404
- var speech_recognize_default = /*#__PURE__*/__webpack_require__.n(speech_recognize);
405
- ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/config.ts
406
312
  /*!
407
313
  * Jodit Editor (https://xdsoft.net/jodit/)
408
314
  * Released under MIT see LICENSE.txt in the project root for license information.
409
315
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
410
316
  */
411
-
412
-
413
-
414
-
415
-
416
-
417
-
418
- config/* Config.prototype.speechRecognize */.D.prototype.speechRecognize = {
419
- api: SpeechRecognition,
420
- sound: true,
421
- continuous: true,
422
- interimResults: true,
423
- commands: {
424
- 'newline|enter': 'enter',
425
- 'delete|remove word|delete word': 'backspaceWordButton',
426
- comma: 'inserthtml::,',
427
- underline: 'inserthtml::_',
428
- hyphen: 'inserthtml::-',
429
- space: 'inserthtml:: ',
430
- question: 'inserthtml::?',
431
- dot: 'inserthtml::.',
432
- 'quote|quotes|open quote': "inserthtml::'",
433
- 'header|header h1': 'formatblock::h1',
434
- 'select all': 'selectall'
435
- }
436
- };
437
- icon/* Icon.set */.J.set('speech-recognize', (speech_recognize_default()));
438
- config/* Config.prototype.controls.speechRecognize */.D.prototype.controls.speechRecognize = {
439
- isActive: function (jodit, _) {
440
- var api = (0,data_bind/* dataBind */.q)(jodit, 'speech');
441
- return Boolean(api === null || api === void 0 ? void 0 : api.isEnabled);
442
- },
443
- isDisabled: function (jodit) {
444
- return !jodit.o.speechRecognize.api;
445
- },
446
- exec: function (jodit, current, _a) {
447
- var button = _a.button, control = _a.control;
448
- var _b = jodit.o.speechRecognize, Api = _b.api, lang = _b.lang, continuous = _b.continuous, interimResults = _b.interimResults, sound = _b.sound;
449
- if (!Api) {
450
- jodit.alert('Speech recognize API unsupported in your browser');
451
- return;
452
- }
453
- var api = (0,data_bind/* dataBind */.q)(jodit, 'speech');
454
- if (!api) {
455
- var nativeApi = new Api();
456
- api = new RecognizeManager(jodit.async, nativeApi);
457
- api.lang = lang;
458
- api.continuous = continuous;
459
- api.interimResults = interimResults;
460
- api.sound = sound;
461
- (0,data_bind/* dataBind */.q)(jodit, 'speech', api);
462
- api.on('pulse', function (enable) {
463
- button.setMod('pulse', enable);
464
- });
465
- api.on('result', function (text) {
466
- return jodit.e.fire('speechRecognizeResult', text);
467
- });
468
- api.on('progress', function (text) {
469
- return jodit.e.fire('speechRecognizeProgressResult', text);
470
- });
471
- button.hookStatus('beforeDestruct', function () {
472
- api.destruct();
473
- });
474
- }
475
- if (control.args) {
476
- var key = control.args[0];
477
- if ((0,is_boolean/* isBoolean */.j)(api[key])) {
478
- api[key] = !api[key];
479
- if (api.isEnabled) {
480
- api.restart();
481
- }
482
- return;
483
- }
484
- }
485
- api.toggle();
486
- button.state.activated = api.isEnabled;
487
- },
488
- name: 'speechRecognize',
489
- command: 'toggleSpeechRecognize',
490
- tooltip: 'Speech Recognize',
491
- list: {
492
- sound: 'Sound',
493
- interimResults: 'Interim Results'
494
- },
495
- childTemplate: function (jodit, key, value) {
496
- var _a;
497
- var api = (0,data_bind/* dataBind */.q)(jodit, 'speech'), checked = (_a = api === null || api === void 0 ? void 0 : api[key]) !== null && _a !== void 0 ? _a : jodit.o.speechRecognize[key];
498
- return "<span class='jodit-speech-recognize__list-item'><input ".concat(checked ? 'checked' : '', " class='jodit-checkbox' type='checkbox'>&nbsp;").concat(value, "</span>");
499
- },
500
- mods: {
501
- stroke: false
502
- }
317
+ module.exports = {
318
+ newline: 'regel',
319
+ delete: 'verwijderen',
320
+ space: 'ruimte',
321
+ 'Speech Recognize': 'Spraak Herkennen',
322
+ Sound: 'Geluid',
323
+ 'Interim Results': 'Tussentijdse Resultaten'
503
324
  };
504
325
 
505
- ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/speech-recognize.ts
506
- /*!
507
- * Jodit Editor (https://xdsoft.net/jodit/)
508
- * Released under MIT see LICENSE.txt in the project root for license information.
509
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
510
- */
511
-
512
- /**
513
- * [[include:plugins/speech-recognize/README.md]]
514
- * @packageDocumentation
515
- * @module plugins/speech-recognize
516
- */
517
-
518
-
519
-
520
-
521
-
522
-
523
-
524
-
525
-
526
-
527
- var SpeechRecognizeNative = /** @class */ (function (_super) {
528
- (0,tslib_es6/* __extends */.ZT)(SpeechRecognizeNative, _super);
529
- function SpeechRecognizeNative(j) {
530
- var _this = _super.call(this, j) || this;
531
- _this._commandToWord = {};
532
- if (j.o.speechRecognize.api) {
533
- j.registerButton({
534
- group: 'state',
535
- name: 'speechRecognize'
536
- });
537
- }
538
- return _this;
539
- }
540
- SpeechRecognizeNative.prototype.afterInit = function (jodit) {
541
- var _this = this;
542
- var commands = jodit.o.speechRecognize.commands;
543
- if (commands) {
544
- (0,global/* extendLang */.xl)(langs_namespaceObject);
545
- (0,utils/* keys */.XP)(commands, false).forEach(function (words) {
546
- var keys = words.split('|');
547
- keys.forEach(function (key) {
548
- key = key.trim().toLowerCase();
549
- _this._commandToWord[key] = commands[words];
550
- var translatedKeys = jodit.i18n(key);
551
- if (translatedKeys !== key) {
552
- translatedKeys.split('|').forEach(function (translatedKey) {
553
- _this._commandToWord[translatedKey.trim().toLowerCase()] = commands[words].trim();
554
- });
555
- }
556
- });
557
- });
558
- }
559
- };
560
- SpeechRecognizeNative.prototype.beforeDestruct = function (jodit) { };
561
- SpeechRecognizeNative.prototype.onSpeechRecognizeProgressResult = function (text) {
562
- var _this = this;
563
- if (!this.messagePopup) {
564
- this.messagePopup = this.j.create.div('jodit-speech-recognize__popup');
565
- }
566
- this.j.workplace.appendChild(this.messagePopup);
567
- this.j.async.setTimeout(function () {
568
- dom/* Dom.safeRemove */.i.safeRemove(_this.messagePopup);
569
- }, {
570
- label: 'onSpeechRecognizeProgressResult',
571
- timeout: 1000
572
- });
573
- this.messagePopup.innerText = text + '|';
574
- };
575
- SpeechRecognizeNative.prototype.onSpeechRecognizeResult = function (text) {
576
- var j = this.j, s = j.s;
577
- dom/* Dom.safeRemove */.i.safeRemove(this.messagePopup);
578
- if (!this._checkCommand(text)) {
579
- var range = s.range, node = s.current();
580
- if (s.isCollapsed() &&
581
- dom/* Dom.isText */.i.isText(node) &&
582
- dom/* Dom.isOrContains */.i.isOrContains(j.editor, node) &&
583
- node.nodeValue) {
584
- var sentence = node.nodeValue;
585
- node.nodeValue =
586
- sentence +
587
- (/[\u00A0 ]\uFEFF*$/.test(sentence) ? '' : ' ') +
588
- text;
589
- range.setStartAfter(node);
590
- s.selectRange(range);
591
- j.synchronizeValues();
592
- }
593
- else {
594
- s.insertHTML(text);
595
- }
596
- }
597
- };
598
- SpeechRecognizeNative.prototype._checkCommand = function (command) {
599
- command = command.toLowerCase().replace(/\./g, '');
600
- if (this._commandToWord[command]) {
601
- execSpellCommand(this.j, this._commandToWord[command]);
602
- return true;
603
- }
604
- return false;
605
- };
606
- (0,tslib_es6/* __decorate */.gn)([
607
- (0,watch/* watch */.YP)(':speechRecognizeProgressResult'),
608
- (0,debounce/* debounce */.D)()
609
- ], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
610
- (0,tslib_es6/* __decorate */.gn)([
611
- (0,watch/* watch */.YP)(':speechRecognizeResult')
612
- ], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
613
- return SpeechRecognizeNative;
614
- }(core_plugin/* Plugin */.S));
615
- if (typeof Jodit !== 'undefined') {
616
- Jodit.plugins.add('speech-recognize', SpeechRecognizeNative);
617
- }
618
-
619
326
 
620
327
  /***/ }),
621
328
 
622
- /***/ 5466:
329
+ /***/ 72556:
623
330
  /***/ (function(module) {
624
331
 
332
+ "use strict";
333
+
625
334
  /*!
626
335
  * Jodit Editor (https://xdsoft.net/jodit/)
627
336
  * Released under MIT see LICENSE.txt in the project root for license information.
628
337
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
629
338
  */
630
-
631
339
  module.exports = {
632
- newline: 'الخط الجديد',
633
- delete: 'حذف',
634
- space: 'الفضاء',
635
- 'Speech Recognize': 'التعرف على الكلام',
636
- Sound: 'الصوت',
637
- 'Interim Results': 'النتائج المؤقتة'
340
+ newline: 'newline',
341
+ delete: 'usunąć',
342
+ space: 'przestrzeń',
343
+ 'Speech Recognize': 'Rozpoznawanie Mowy',
344
+ Sound: 'Dźwięk',
345
+ 'Interim Results': 'Wyniki Okresowe'
638
346
  };
639
347
 
640
348
 
641
349
  /***/ }),
642
350
 
643
- /***/ 65226:
351
+ /***/ 11695:
644
352
  /***/ (function(module) {
645
353
 
354
+ "use strict";
355
+
646
356
  /*!
647
357
  * Jodit Editor (https://xdsoft.net/jodit/)
648
358
  * Released under MIT see LICENSE.txt in the project root for license information.
649
359
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
650
360
  */
651
-
652
361
  module.exports = {
653
- newline: 'řádek',
654
- delete: 'odstranit',
655
- space: 'prostora',
656
- 'Speech Recognize': 'Rozpoznání Řeči',
657
- Sound: 'Zvuk',
658
- 'Interim Results': 'Průběžné Výsledky'
362
+ newline: 'linha',
363
+ delete: 'excluir',
364
+ space: 'espaco',
365
+ 'Speech Recognize': 'Discurso Reconhecer',
366
+ Sound: 'Som',
367
+ 'Interim Results': 'Resultados Provisórios'
659
368
  };
660
369
 
661
370
 
662
371
  /***/ }),
663
372
 
664
- /***/ 87541:
373
+ /***/ 52415:
665
374
  /***/ (function(module) {
666
375
 
376
+ "use strict";
377
+
667
378
  /*!
668
379
  * Jodit Editor (https://xdsoft.net/jodit/)
669
380
  * Released under MIT see LICENSE.txt in the project root for license information.
670
381
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
671
382
  */
672
-
673
383
  module.exports = {
674
- newline: 'Zeilenumbruch',
675
- delete: 'löschen',
676
- space: 'Raum',
677
- 'Speech Recognize': 'Sprache Erkennen',
678
- Sound: 'Sound',
679
- 'Interim Results': 'Zwischenergebnis'
384
+ newline: 'новая строка|перенос|энтер',
385
+ delete: 'удалить',
386
+ space: 'пробел',
387
+ 'Speech Recognize': 'Распознавание речи',
388
+ Sound: 'Звук',
389
+ 'Interim Results': 'Промежуточные результаты'
680
390
  };
681
391
 
682
392
 
683
393
  /***/ }),
684
394
 
685
- /***/ 87104:
395
+ /***/ 14569:
686
396
  /***/ (function(module) {
687
397
 
398
+ "use strict";
399
+
688
400
  /*!
689
401
  * Jodit Editor (https://xdsoft.net/jodit/)
690
402
  * Released under MIT see LICENSE.txt in the project root for license information.
691
403
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
692
404
  */
693
-
694
405
  module.exports = {
695
- newline: 'nueva línea',
696
- delete: 'eliminar',
697
- space: 'espacio',
698
- 'Speech Recognize': 'Reconocimiento de Voz',
699
- Sound: 'Sonido',
700
- 'Interim Results': 'Resultados Provisionales'
406
+ newline: 'yeni satır',
407
+ delete: 'silmek',
408
+ space: 'uzay',
409
+ 'Speech Recognize': 'Konuşma Tanıma',
410
+ Sound: 'Ses',
411
+ 'Interim Results': 'Ara Sonuçlar'
701
412
  };
702
413
 
703
414
 
704
415
  /***/ }),
705
416
 
706
- /***/ 53808:
417
+ /***/ 58649:
707
418
  /***/ (function(module) {
708
419
 
420
+ "use strict";
421
+
709
422
  /*!
710
423
  * Jodit Editor (https://xdsoft.net/jodit/)
711
424
  * Released under MIT see LICENSE.txt in the project root for license information.
712
425
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
713
426
  */
714
-
715
427
  module.exports = {
716
- newline: 'خط جدید',
717
- delete: 'حذف',
718
- space: 'فضا',
719
- 'Speech Recognize': 'گفتار را تشخیص دهید',
720
- Sound: 'صدا',
721
- 'Interim Results': 'نتایج موقت'
428
+ newline: '新行',
429
+ delete: '删除',
430
+ space: '空间',
431
+ 'Speech Recognize': '言语识别',
432
+ Sound: '声音',
433
+ 'Interim Results': '中期业绩'
722
434
  };
723
435
 
724
436
 
725
437
  /***/ }),
726
438
 
727
- /***/ 48954:
439
+ /***/ 66040:
728
440
  /***/ (function(module) {
729
441
 
442
+ "use strict";
443
+
730
444
  /*!
731
445
  * Jodit Editor (https://xdsoft.net/jodit/)
732
446
  * Released under MIT see LICENSE.txt in the project root for license information.
733
447
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
734
448
  */
735
-
736
449
  module.exports = {
737
- newline: 'nouvelle ligne',
738
- delete: 'supprimer',
739
- space: 'espace',
740
- 'Speech Recognize': 'Reconnaissance Vocale',
741
- Sound: 'Son',
742
- 'Interim Results': 'Résultats Intermédiaires'
450
+ newline: 'นิวไลน์',
451
+ delete: 'ลบ',
452
+ space: 'พื้นที่',
453
+ 'Speech Recognize': 'การรับรู้คำพูด',
454
+ Sound: 'เสียง',
455
+ 'Interim Results': 'ผลระหว่างกาล'
743
456
  };
744
457
 
745
458
 
746
459
  /***/ }),
747
460
 
748
- /***/ 14694:
749
- /***/ (function(module) {
461
+ /***/ 29204:
462
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
463
+
464
+ "use strict";
465
+ // ESM COMPAT FLAG
466
+ __webpack_require__.r(__webpack_exports__);
467
+
468
+ // EXPORTS
469
+ __webpack_require__.d(__webpack_exports__, {
470
+ "SpeechRecognizeNative": function() { return /* binding */ SpeechRecognizeNative; }
471
+ });
472
+
473
+ // NAMESPACE OBJECT: ./src/plugins/speech-recognize/langs/index.ts
474
+ var langs_namespaceObject = {};
475
+ __webpack_require__.r(langs_namespaceObject);
476
+ __webpack_require__.d(langs_namespaceObject, {
477
+ "ar": function() { return ar; },
478
+ "cs_cz": function() { return cs_cz; },
479
+ "de": function() { return de; },
480
+ "es": function() { return es; },
481
+ "fa": function() { return fa; },
482
+ "fr": function() { return fr; },
483
+ "he": function() { return he; },
484
+ "hu": function() { return hu; },
485
+ "id": function() { return id; },
486
+ "it": function() { return it; },
487
+ "ja": function() { return ja; },
488
+ "ko": function() { return ko; },
489
+ "mn": function() { return mn; },
490
+ "nl": function() { return nl; },
491
+ "pl": function() { return pl; },
492
+ "pt_br": function() { return pt_br; },
493
+ "ru": function() { return ru; },
494
+ "tr": function() { return tr; },
495
+ "zh_cn": function() { return zh_cn; },
496
+ "zh_tw": function() { return zh_tw; }
497
+ });
750
498
 
499
+ // EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.js
500
+ var tslib_es6 = __webpack_require__(85699);
501
+ // EXTERNAL MODULE: ./src/core/plugin/index.ts
502
+ var core_plugin = __webpack_require__(7331);
503
+ // EXTERNAL MODULE: ./src/core/decorators/watch/watch.ts
504
+ var watch = __webpack_require__(69082);
505
+ // EXTERNAL MODULE: ./src/core/helpers/utils/utils.ts
506
+ var utils = __webpack_require__(87398);
507
+ // EXTERNAL MODULE: ./src/core/global.ts
508
+ var global = __webpack_require__(79102);
509
+ // EXTERNAL MODULE: ./src/core/dom/dom.ts
510
+ var dom = __webpack_require__(9162);
511
+ // EXTERNAL MODULE: ./src/core/decorators/debounce/debounce.ts
512
+ var debounce = __webpack_require__(62294);
513
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/exec-spell-command.ts
751
514
  /*!
752
515
  * Jodit Editor (https://xdsoft.net/jodit/)
753
516
  * Released under MIT see LICENSE.txt in the project root for license information.
754
517
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
755
518
  */
756
519
 
757
- module.exports = {
758
- newline: 'חדשות',
759
- delete: 'מחק',
760
- space: 'שטח',
761
- 'Speech Recognize': 'דיבור מזהה',
762
- Sound: 'קול',
763
- 'Interim Results': 'תוצאות ביניים'
764
- };
765
-
766
-
767
- /***/ }),
768
-
769
- /***/ 67381:
770
- /***/ (function(module) {
520
+ function execSpellCommand(jodit, commandSentence) {
521
+ var _a = (0,tslib_es6/* __read */.CR)(commandSentence.split('::'), 2), command = _a[0], value = _a[1];
522
+ jodit.execCommand(command, null, value);
523
+ }
771
524
 
525
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/ar.js
526
+ var ar = __webpack_require__(57998);
527
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/cs_cz.js
528
+ var cs_cz = __webpack_require__(90833);
529
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/de.js
530
+ var de = __webpack_require__(36373);
531
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/es.js
532
+ var es = __webpack_require__(97192);
533
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/fa.js
534
+ var fa = __webpack_require__(6043);
535
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/fr.js
536
+ var fr = __webpack_require__(76305);
537
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/he.js
538
+ var he = __webpack_require__(45834);
539
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/hu.js
540
+ var hu = __webpack_require__(40509);
541
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/id.js
542
+ var id = __webpack_require__(75720);
543
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/it.js
544
+ var it = __webpack_require__(88369);
545
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/ja.js
546
+ var ja = __webpack_require__(30878);
547
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/ko.js
548
+ var ko = __webpack_require__(37780);
549
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/mn.js
550
+ var mn = __webpack_require__(4105);
551
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/nl.js
552
+ var nl = __webpack_require__(2589);
553
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/pl.js
554
+ var pl = __webpack_require__(72556);
555
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/pt_br.js
556
+ var pt_br = __webpack_require__(11695);
557
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/ru.js
558
+ var ru = __webpack_require__(52415);
559
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/tr.js
560
+ var tr = __webpack_require__(14569);
561
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/zh_cn.js
562
+ var zh_cn = __webpack_require__(58649);
563
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/langs/zh_tw.js
564
+ var zh_tw = __webpack_require__(66040);
565
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/langs/index.ts
772
566
  /*!
773
567
  * Jodit Editor (https://xdsoft.net/jodit/)
774
568
  * Released under MIT see LICENSE.txt in the project root for license information.
775
569
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
776
570
  */
777
571
 
778
- module.exports = {
779
- newline: 'újsor',
780
- delete: 'törlés',
781
- space: 'tér',
782
- 'Speech Recognize': 'A Beszéd Felismeri',
783
- Sound: 'Hang',
784
- 'Interim Results': 'Időközi Eredmények'
785
- };
786
572
 
787
573
 
788
- /***/ }),
789
574
 
790
- /***/ 99549:
791
- /***/ (function(module) {
792
575
 
793
- /*!
794
- * Jodit Editor (https://xdsoft.net/jodit/)
795
- * Released under MIT see LICENSE.txt in the project root for license information.
796
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
797
- */
798
576
 
799
- module.exports = {
800
- newline: 'newline',
801
- delete: 'Hapus',
802
- space: 'ruang',
803
- 'Speech Recognize': 'Pidato Mengenali',
804
- Sound: 'Suara',
805
- 'Interim Results': 'Hasil Sementara'
806
- };
807
577
 
808
578
 
809
- /***/ }),
810
579
 
811
- /***/ 28428:
812
- /***/ (function(module) {
813
580
 
814
- /*!
815
- * Jodit Editor (https://xdsoft.net/jodit/)
816
- * Released under MIT see LICENSE.txt in the project root for license information.
817
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
818
- */
819
581
 
820
- module.exports = {
821
- newline: 'nuova riga',
822
- delete: 'eliminare',
823
- space: 'spazio',
824
- 'Speech Recognize': 'Discorso Riconoscere',
825
- Sound: 'Suono',
826
- 'Interim Results': 'Risultati intermedi'
827
- };
828
582
 
829
583
 
830
- /***/ }),
831
584
 
832
- /***/ 25363:
833
- /***/ (function(module) {
834
585
 
835
- /*!
836
- * Jodit Editor (https://xdsoft.net/jodit/)
837
- * Released under MIT see LICENSE.txt in the project root for license information.
838
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
839
- */
840
586
 
841
- module.exports = {
842
- newline: '改行',
843
- delete: '削除',
844
- space: 'スペース',
845
- 'Speech Recognize': '音声認識',
846
- Sound: '音',
847
- 'Interim Results': '中間結果'
848
- };
849
587
 
850
588
 
851
- /***/ }),
852
589
 
853
- /***/ 96929:
854
- /***/ (function(module) {
855
590
 
591
+
592
+
593
+ // EXTERNAL MODULE: ./src/config.ts
594
+ var config = __webpack_require__(37446);
595
+ // EXTERNAL MODULE: ./src/core/helpers/utils/data-bind.ts
596
+ var data_bind = __webpack_require__(25920);
597
+ // EXTERNAL MODULE: ./src/core/helpers/checker/is-boolean.ts
598
+ var is_boolean = __webpack_require__(88751);
599
+ // EXTERNAL MODULE: ./src/core/ui/icon.ts
600
+ var icon = __webpack_require__(30052);
601
+ // EXTERNAL MODULE: ./src/core/event-emitter/eventify.ts
602
+ var eventify = __webpack_require__(3569);
603
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 7 modules
604
+ var decorators = __webpack_require__(98928);
605
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/constants.ts
856
606
  /*!
857
607
  * Jodit Editor (https://xdsoft.net/jodit/)
858
608
  * Released under MIT see LICENSE.txt in the project root for license information.
859
609
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
860
610
  */
611
+ /**
612
+ * @module plugins/speech-recognize
613
+ * @internal
614
+ */
615
+ var PII = 440;
616
+ var WARN = 940;
861
617
 
862
- module.exports = {
863
- newline: '줄 바꿈',
864
- delete: '삭제',
865
- space: '공간',
866
- 'Speech Recognize': '음성 인식',
867
- Sound: '소리',
868
- 'Interim Results': '중간 결과'
869
- };
870
-
871
-
872
- /***/ }),
618
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/sound.ts
619
+ /*!
620
+ * Jodit Editor (https://xdsoft.net/jodit/)
621
+ * Released under MIT see LICENSE.txt in the project root for license information.
622
+ * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
623
+ */
624
+ /**
625
+ * @module plugins/speech-recognize
626
+ */
873
627
 
874
- /***/ 26781:
875
- /***/ (function(module) {
628
+ /**
629
+ * @internal
630
+ */
631
+ function sound(_a) {
632
+ var _b = _a === void 0 ? {} : _a, _c = _b.sec, sec = _c === void 0 ? 0.1 : _c, _d = _b.frequency, frequency = _d === void 0 ? PII : _d, _e = _b.gain, gain = _e === void 0 ? 0.1 : _e, _f = _b.type, type = _f === void 0 ? 'sine' : _f;
633
+ if (typeof window.AudioContext === 'undefined' &&
634
+ typeof window.webkitAudioContext === 'undefined') {
635
+ return;
636
+ }
637
+ // one context per document
638
+ var context = new (window.AudioContext ||
639
+ window.webkitAudioContext)();
640
+ var vol = context.createGain();
641
+ var osc = context.createOscillator();
642
+ osc.type = type;
643
+ osc.frequency.value = frequency; // Hz
644
+ osc.connect(vol);
645
+ vol.connect(context.destination);
646
+ osc.start(); // start the oscillator
647
+ osc.stop(context.currentTime + sec);
648
+ vol.gain.value = gain;
649
+ }
876
650
 
651
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/recognize-manager.ts
877
652
  /*!
878
653
  * Jodit Editor (https://xdsoft.net/jodit/)
879
654
  * Released under MIT see LICENSE.txt in the project root for license information.
880
655
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
881
656
  */
882
657
 
883
- module.exports = {
884
- newline: 'Шинэ мөр',
885
- delete: 'Устгах',
886
- space: 'Зай',
887
- 'Speech Recognize': 'Дуу хоолой таних',
888
- Sound: 'Дуу',
889
- 'Interim Results': 'Түр зуурын үр дүн'
890
- };
891
658
 
892
659
 
893
- /***/ }),
894
660
 
895
- /***/ 58499:
896
- /***/ (function(module) {
897
661
 
662
+ var RecognizeManager = /** @class */ (function (_super) {
663
+ (0,tslib_es6/* __extends */.ZT)(RecognizeManager, _super);
664
+ function RecognizeManager(async, api) {
665
+ var _this = _super.call(this) || this;
666
+ _this.async = async;
667
+ _this._continuous = false;
668
+ _this._interimResults = false;
669
+ _this.sound = true;
670
+ _this._isEnabled = false;
671
+ _this._restartTimeout = 0;
672
+ _this._onSpeechStart = function (e) {
673
+ if (!_this._isEnabled) {
674
+ return;
675
+ }
676
+ _this.async.clearTimeout(_this._restartTimeout);
677
+ _this._restartTimeout = _this.async.setTimeout(function () {
678
+ _this.restart();
679
+ _this.emit('pulse', false);
680
+ _this._makeSound(WARN);
681
+ }, 5000);
682
+ _this.emit('pulse', true);
683
+ };
684
+ _this._progressTimeout = 0;
685
+ _this._api = api;
686
+ RecognizeManager_1._instances.add(_this);
687
+ return _this;
688
+ }
689
+ RecognizeManager_1 = RecognizeManager;
690
+ Object.defineProperty(RecognizeManager.prototype, "lang", {
691
+ get: function () {
692
+ return this._lang;
693
+ },
694
+ set: function (v) {
695
+ this._lang = v;
696
+ this._api.lang = v;
697
+ },
698
+ enumerable: false,
699
+ configurable: true
700
+ });
701
+ Object.defineProperty(RecognizeManager.prototype, "continuous", {
702
+ get: function () {
703
+ return this._continuous;
704
+ },
705
+ set: function (v) {
706
+ this._continuous = v;
707
+ this._api.continuous = v;
708
+ },
709
+ enumerable: false,
710
+ configurable: true
711
+ });
712
+ Object.defineProperty(RecognizeManager.prototype, "interimResults", {
713
+ get: function () {
714
+ return this._interimResults;
715
+ },
716
+ set: function (v) {
717
+ this._interimResults = v;
718
+ this._api.interimResults = v;
719
+ },
720
+ enumerable: false,
721
+ configurable: true
722
+ });
723
+ RecognizeManager.prototype.destruct = function () {
724
+ this.stop();
725
+ RecognizeManager_1._instances.delete(this);
726
+ _super.prototype.destruct.call(this);
727
+ };
728
+ Object.defineProperty(RecognizeManager.prototype, "isEnabled", {
729
+ get: function () {
730
+ return this._isEnabled;
731
+ },
732
+ enumerable: false,
733
+ configurable: true
734
+ });
735
+ RecognizeManager.prototype.start = function () {
736
+ var _this = this;
737
+ if (this._isEnabled) {
738
+ return;
739
+ }
740
+ this._isEnabled = true;
741
+ RecognizeManager_1._instances.forEach(function (instance) {
742
+ if (instance !== _this) {
743
+ instance.stop();
744
+ }
745
+ });
746
+ this._api.start();
747
+ this.__on('speechstart', this._onSpeechStart)
748
+ .__on('error', this._onError)
749
+ .__on('result', this._onResult);
750
+ };
751
+ RecognizeManager.prototype.stop = function () {
752
+ if (!this._isEnabled) {
753
+ return;
754
+ }
755
+ try {
756
+ this._api.abort();
757
+ this._api.stop();
758
+ }
759
+ catch (_a) { }
760
+ this.__off('speechstart', this._onSpeechStart)
761
+ .__off('error', this._onError)
762
+ .__off('result', this._onResult);
763
+ this.async.clearTimeout(this._restartTimeout);
764
+ this._isEnabled = false;
765
+ this.emit('pulse', false);
766
+ };
767
+ RecognizeManager.prototype.toggle = function () {
768
+ if (!this._isEnabled) {
769
+ this.start();
770
+ }
771
+ else {
772
+ this.stop();
773
+ }
774
+ };
775
+ RecognizeManager.prototype.restart = function () {
776
+ this.stop();
777
+ this.start();
778
+ };
779
+ RecognizeManager.prototype.__on = function (event, callback) {
780
+ this._api.addEventListener(event, callback);
781
+ return this;
782
+ };
783
+ RecognizeManager.prototype.__off = function (event, callback) {
784
+ this._api.removeEventListener(event, callback);
785
+ return this;
786
+ };
787
+ RecognizeManager.prototype._onResult = function (e) {
788
+ var _this = this;
789
+ if (!this._isEnabled) {
790
+ return;
791
+ }
792
+ this.async.clearTimeout(this._progressTimeout);
793
+ var resultItem = e.results.item(e.resultIndex);
794
+ var transcript = resultItem.item(0).transcript;
795
+ var resultHandler = function () {
796
+ try {
797
+ _this.async.clearTimeout(_this._restartTimeout);
798
+ _this.emit('result', transcript);
799
+ }
800
+ catch (_a) { }
801
+ _this.restart();
802
+ _this.emit('pulse', false);
803
+ _this._makeSound(PII);
804
+ };
805
+ if (resultItem.isFinal === false) {
806
+ this.emit('progress', transcript);
807
+ this._progressTimeout = this.async.setTimeout(resultHandler, 500);
808
+ return;
809
+ }
810
+ resultHandler();
811
+ };
812
+ RecognizeManager.prototype._onError = function () {
813
+ if (!this._isEnabled) {
814
+ return;
815
+ }
816
+ this._makeSound(WARN);
817
+ this.emit('pulse', false);
818
+ this.restart();
819
+ };
820
+ RecognizeManager.prototype._makeSound = function (frequency) {
821
+ if (this.sound) {
822
+ sound({ frequency: frequency });
823
+ }
824
+ };
825
+ var RecognizeManager_1;
826
+ RecognizeManager._instances = new Set();
827
+ RecognizeManager = RecognizeManager_1 = (0,tslib_es6/* __decorate */.gn)([
828
+ decorators.autobind
829
+ ], RecognizeManager);
830
+ return RecognizeManager;
831
+ }(eventify/* Eventify */.a));
832
+
833
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/api.ts
898
834
  /*!
899
835
  * Jodit Editor (https://xdsoft.net/jodit/)
900
836
  * Released under MIT see LICENSE.txt in the project root for license information.
901
837
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
902
838
  */
839
+ var SpeechRecognition = window.SpeechRecognition ||
840
+ window.webkitSpeechRecognition;
903
841
 
904
- module.exports = {
905
- newline: 'regel',
906
- delete: 'verwijderen',
907
- space: 'ruimte',
908
- 'Speech Recognize': 'Spraak Herkennen',
909
- Sound: 'Geluid',
910
- 'Interim Results': 'Tussentijdse Resultaten'
911
- };
912
-
913
-
914
- /***/ }),
915
-
916
- /***/ 59430:
917
- /***/ (function(module) {
918
-
842
+ // EXTERNAL MODULE: ./src/plugins/speech-recognize/speech-recognize.svg
843
+ var speech_recognize = __webpack_require__(55106);
844
+ var speech_recognize_default = /*#__PURE__*/__webpack_require__.n(speech_recognize);
845
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/config.ts
919
846
  /*!
920
847
  * Jodit Editor (https://xdsoft.net/jodit/)
921
848
  * Released under MIT see LICENSE.txt in the project root for license information.
922
849
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
923
850
  */
924
851
 
925
- module.exports = {
926
- newline: 'newline',
927
- delete: 'usunąć',
928
- space: 'przestrzeń',
929
- 'Speech Recognize': 'Rozpoznawanie Mowy',
930
- Sound: 'Dźwięk',
931
- 'Interim Results': 'Wyniki Okresowe'
932
- };
933
-
934
-
935
- /***/ }),
936
-
937
- /***/ 70297:
938
- /***/ (function(module) {
939
-
940
- /*!
941
- * Jodit Editor (https://xdsoft.net/jodit/)
942
- * Released under MIT see LICENSE.txt in the project root for license information.
943
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
944
- */
945
852
 
946
- module.exports = {
947
- newline: 'linha',
948
- delete: 'excluir',
949
- space: 'espaco',
950
- 'Speech Recognize': 'Discurso Reconhecer',
951
- Sound: 'Som',
952
- 'Interim Results': 'Resultados Provisórios'
953
- };
954
853
 
955
854
 
956
- /***/ }),
957
855
 
958
- /***/ 98949:
959
- /***/ (function(module) {
960
856
 
961
- /*!
962
- * Jodit Editor (https://xdsoft.net/jodit/)
963
- * Released under MIT see LICENSE.txt in the project root for license information.
964
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
965
- */
966
857
 
967
- module.exports = {
968
- newline: 'новая строка|перенос|энтер',
969
- delete: 'удалить',
970
- space: 'пробел',
971
- 'Speech Recognize': 'Распознавание речи',
972
- Sound: 'Звук',
973
- 'Interim Results': 'Промежуточные результаты'
858
+ config/* Config.prototype.speechRecognize */.D.prototype.speechRecognize = {
859
+ api: SpeechRecognition,
860
+ sound: true,
861
+ continuous: true,
862
+ interimResults: true,
863
+ commands: {
864
+ 'newline|enter': 'enter',
865
+ 'delete|remove word|delete word': 'backspaceWordButton',
866
+ comma: 'inserthtml::,',
867
+ underline: 'inserthtml::_',
868
+ hyphen: 'inserthtml::-',
869
+ space: 'inserthtml:: ',
870
+ question: 'inserthtml::?',
871
+ dot: 'inserthtml::.',
872
+ 'quote|quotes|open quote': "inserthtml::'",
873
+ 'header|header h1': 'formatblock::h1',
874
+ 'select all': 'selectall'
875
+ }
876
+ };
877
+ icon/* Icon.set */.J.set('speech-recognize', (speech_recognize_default()));
878
+ config/* Config.prototype.controls.speechRecognize */.D.prototype.controls.speechRecognize = {
879
+ isActive: function (jodit, _) {
880
+ var api = (0,data_bind/* dataBind */.q)(jodit, 'speech');
881
+ return Boolean(api === null || api === void 0 ? void 0 : api.isEnabled);
882
+ },
883
+ isDisabled: function (jodit) {
884
+ return !jodit.o.speechRecognize.api;
885
+ },
886
+ exec: function (jodit, current, _a) {
887
+ var button = _a.button, control = _a.control;
888
+ var _b = jodit.o.speechRecognize, Api = _b.api, lang = _b.lang, continuous = _b.continuous, interimResults = _b.interimResults, sound = _b.sound;
889
+ if (!Api) {
890
+ jodit.alert('Speech recognize API unsupported in your browser');
891
+ return;
892
+ }
893
+ var api = (0,data_bind/* dataBind */.q)(jodit, 'speech');
894
+ if (!api) {
895
+ var nativeApi = new Api();
896
+ api = new RecognizeManager(jodit.async, nativeApi);
897
+ api.lang = lang;
898
+ api.continuous = continuous;
899
+ api.interimResults = interimResults;
900
+ api.sound = sound;
901
+ (0,data_bind/* dataBind */.q)(jodit, 'speech', api);
902
+ api.on('pulse', function (enable) {
903
+ button.setMod('pulse', enable);
904
+ });
905
+ api.on('result', function (text) {
906
+ return jodit.e.fire('speechRecognizeResult', text);
907
+ });
908
+ api.on('progress', function (text) {
909
+ return jodit.e.fire('speechRecognizeProgressResult', text);
910
+ });
911
+ button.hookStatus('beforeDestruct', function () {
912
+ api.destruct();
913
+ });
914
+ }
915
+ if (control.args) {
916
+ var key = control.args[0];
917
+ if ((0,is_boolean/* isBoolean */.j)(api[key])) {
918
+ api[key] = !api[key];
919
+ if (api.isEnabled) {
920
+ api.restart();
921
+ }
922
+ return;
923
+ }
924
+ }
925
+ api.toggle();
926
+ button.state.activated = api.isEnabled;
927
+ },
928
+ name: 'speechRecognize',
929
+ command: 'toggleSpeechRecognize',
930
+ tooltip: 'Speech Recognize',
931
+ list: {
932
+ sound: 'Sound',
933
+ interimResults: 'Interim Results'
934
+ },
935
+ childTemplate: function (jodit, key, value) {
936
+ var _a;
937
+ var api = (0,data_bind/* dataBind */.q)(jodit, 'speech'), checked = (_a = api === null || api === void 0 ? void 0 : api[key]) !== null && _a !== void 0 ? _a : jodit.o.speechRecognize[key];
938
+ return "<span class='jodit-speech-recognize__list-item'><input ".concat(checked ? 'checked' : '', " class='jodit-checkbox' type='checkbox'>&nbsp;").concat(value, "</span>");
939
+ },
940
+ mods: {
941
+ stroke: false
942
+ }
974
943
  };
975
944
 
976
-
977
- /***/ }),
978
-
979
- /***/ 61232:
980
- /***/ (function(module) {
981
-
945
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/speech-recognize.ts
982
946
  /*!
983
947
  * Jodit Editor (https://xdsoft.net/jodit/)
984
948
  * Released under MIT see LICENSE.txt in the project root for license information.
985
949
  * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
986
950
  */
987
951
 
988
- module.exports = {
989
- newline: 'yeni satır',
990
- delete: 'silmek',
991
- space: 'uzay',
992
- 'Speech Recognize': 'Konuşma Tanıma',
993
- Sound: 'Ses',
994
- 'Interim Results': 'Ara Sonuçlar'
995
- };
952
+ /**
953
+ * [[include:plugins/speech-recognize/README.md]]
954
+ * @packageDocumentation
955
+ * @module plugins/speech-recognize
956
+ */
996
957
 
997
958
 
998
- /***/ }),
999
959
 
1000
- /***/ 56775:
1001
- /***/ (function(module) {
1002
960
 
1003
- /*!
1004
- * Jodit Editor (https://xdsoft.net/jodit/)
1005
- * Released under MIT see LICENSE.txt in the project root for license information.
1006
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1007
- */
1008
961
 
1009
- module.exports = {
1010
- newline: '新行',
1011
- delete: '删除',
1012
- space: '空间',
1013
- 'Speech Recognize': '言语识别',
1014
- Sound: '声音',
1015
- 'Interim Results': '中期业绩'
1016
- };
1017
962
 
1018
963
 
1019
- /***/ }),
1020
964
 
1021
- /***/ 97957:
1022
- /***/ (function(module) {
1023
965
 
1024
- /*!
1025
- * Jodit Editor (https://xdsoft.net/jodit/)
1026
- * Released under MIT see LICENSE.txt in the project root for license information.
1027
- * Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
1028
- */
1029
966
 
1030
- module.exports = {
1031
- newline: 'นิวไลน์',
1032
- delete: 'ลบ',
1033
- space: 'พื้นที่',
1034
- 'Speech Recognize': 'การรับรู้คำพูด',
1035
- Sound: 'เสียง',
1036
- 'Interim Results': 'ผลระหว่างกาล'
1037
- };
967
+ var SpeechRecognizeNative = /** @class */ (function (_super) {
968
+ (0,tslib_es6/* __extends */.ZT)(SpeechRecognizeNative, _super);
969
+ function SpeechRecognizeNative(j) {
970
+ var _this = _super.call(this, j) || this;
971
+ _this._commandToWord = {};
972
+ if (j.o.speechRecognize.api) {
973
+ j.registerButton({
974
+ group: 'state',
975
+ name: 'speechRecognize'
976
+ });
977
+ }
978
+ return _this;
979
+ }
980
+ SpeechRecognizeNative.prototype.afterInit = function (jodit) {
981
+ var _this = this;
982
+ var commands = jodit.o.speechRecognize.commands;
983
+ if (commands) {
984
+ (0,global/* extendLang */.xl)(langs_namespaceObject);
985
+ (0,utils/* keys */.XP)(commands, false).forEach(function (words) {
986
+ var keys = words.split('|');
987
+ keys.forEach(function (key) {
988
+ key = key.trim().toLowerCase();
989
+ _this._commandToWord[key] = commands[words];
990
+ var translatedKeys = jodit.i18n(key);
991
+ if (translatedKeys !== key) {
992
+ translatedKeys.split('|').forEach(function (translatedKey) {
993
+ _this._commandToWord[translatedKey.trim().toLowerCase()] = commands[words].trim();
994
+ });
995
+ }
996
+ });
997
+ });
998
+ }
999
+ };
1000
+ SpeechRecognizeNative.prototype.beforeDestruct = function (jodit) { };
1001
+ SpeechRecognizeNative.prototype.onSpeechRecognizeProgressResult = function (text) {
1002
+ var _this = this;
1003
+ if (!this.messagePopup) {
1004
+ this.messagePopup = this.j.create.div('jodit-speech-recognize__popup');
1005
+ }
1006
+ this.j.workplace.appendChild(this.messagePopup);
1007
+ this.j.async.setTimeout(function () {
1008
+ dom/* Dom.safeRemove */.i.safeRemove(_this.messagePopup);
1009
+ }, {
1010
+ label: 'onSpeechRecognizeProgressResult',
1011
+ timeout: 1000
1012
+ });
1013
+ this.messagePopup.innerText = text + '|';
1014
+ };
1015
+ SpeechRecognizeNative.prototype.onSpeechRecognizeResult = function (text) {
1016
+ var j = this.j, s = j.s;
1017
+ dom/* Dom.safeRemove */.i.safeRemove(this.messagePopup);
1018
+ if (!this._checkCommand(text)) {
1019
+ var range = s.range, node = s.current();
1020
+ if (s.isCollapsed() &&
1021
+ dom/* Dom.isText */.i.isText(node) &&
1022
+ dom/* Dom.isOrContains */.i.isOrContains(j.editor, node) &&
1023
+ node.nodeValue) {
1024
+ var sentence = node.nodeValue;
1025
+ node.nodeValue =
1026
+ sentence +
1027
+ (/[\u00A0 ]\uFEFF*$/.test(sentence) ? '' : ' ') +
1028
+ text;
1029
+ range.setStartAfter(node);
1030
+ s.selectRange(range);
1031
+ j.synchronizeValues();
1032
+ }
1033
+ else {
1034
+ s.insertHTML(text);
1035
+ }
1036
+ }
1037
+ };
1038
+ SpeechRecognizeNative.prototype._checkCommand = function (command) {
1039
+ command = command.toLowerCase().replace(/\./g, '');
1040
+ if (this._commandToWord[command]) {
1041
+ execSpellCommand(this.j, this._commandToWord[command]);
1042
+ return true;
1043
+ }
1044
+ return false;
1045
+ };
1046
+ (0,tslib_es6/* __decorate */.gn)([
1047
+ (0,watch/* watch */.YP)(':speechRecognizeProgressResult'),
1048
+ (0,debounce/* debounce */.D)()
1049
+ ], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
1050
+ (0,tslib_es6/* __decorate */.gn)([
1051
+ (0,watch/* watch */.YP)(':speechRecognizeResult')
1052
+ ], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
1053
+ return SpeechRecognizeNative;
1054
+ }(core_plugin/* Plugin */.S));
1055
+ if (typeof Jodit !== 'undefined') {
1056
+ Jodit.plugins.add('speech-recognize', SpeechRecognizeNative);
1057
+ }
1038
1058
 
1039
1059
 
1040
1060
  /***/ }),