jodit 4.10.2 → 4.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +121 -121
- package/es2015/jodit.js +36183 -35886
- package/es2015/jodit.min.js +121 -121
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +724 -724
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.fat.min.js +121 -121
- package/es2018/jodit.min.js +121 -121
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +135 -135
- package/es2021/jodit.js +35482 -35186
- package/es2021/jodit.min.js +135 -135
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +681 -681
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +151 -151
- package/es2021.en/jodit.js +34392 -34096
- package/es2021.en/jodit.min.js +135 -135
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +306 -306
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +44054 -43700
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +839 -839
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/polyfills.fat.min.js +2 -2
- package/es5/polyfills.js +4211 -4211
- package/es5/polyfills.min.js +2 -2
- package/esm/config.d.ts +85 -0
- package/esm/core/constants.js +1 -1
- package/esm/core/dom/dom.d.ts +1 -0
- package/esm/core/helpers/html/safe-html.d.ts +3 -2
- package/esm/core/helpers/html/safe-html.js +42 -3
- package/esm/plugins/clean-html/clean-html.js +4 -0
- package/esm/plugins/clean-html/config.d.ts +85 -0
- package/esm/plugins/clean-html/config.js +7 -1
- package/esm/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.d.ts +14 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.js +37 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/index.d.ts +4 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/index.js +4 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/safe-links-target.d.ts +14 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/safe-links-target.js +38 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.d.ts +14 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.js +24 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-attributes.js +10 -5
- package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-styles.d.ts +14 -0
- package/esm/plugins/clean-html/helpers/visitor/filters/sanitize-styles.js +70 -0
- package/esm/plugins/drag-and-drop/drag-and-drop.js +1 -1
- package/esm/plugins/enter/helpers/insert-paragraph.js +2 -1
- package/esm/plugins/file/file.js +3 -2
- package/esm/plugins/iframe/iframe.js +8 -6
- package/esm/plugins/image/image.js +3 -2
- package/esm/plugins/image-properties/writers/link.js +6 -0
- package/esm/plugins/link/link.js +15 -3
- package/esm/plugins/resizer/resizer.js +2 -2
- package/esm/plugins/source/editor/engines/area.js +3 -7
- package/package.json +1 -1
- package/types/config.d.ts +85 -0
- package/types/core/dom/dom.d.ts +1 -0
- package/types/core/helpers/html/safe-html.d.ts +3 -2
- package/types/plugins/clean-html/config.d.ts +85 -0
- package/types/plugins/clean-html/helpers/visitor/filters/convert-unsafe-embeds.d.ts +14 -0
- package/types/plugins/clean-html/helpers/visitor/filters/index.d.ts +4 -0
- package/types/plugins/clean-html/helpers/visitor/filters/safe-links-target.d.ts +14 -0
- package/types/plugins/clean-html/helpers/visitor/filters/sandbox-iframes-in-content.d.ts +14 -0
- package/types/plugins/clean-html/helpers/visitor/filters/sanitize-styles.d.ts +14 -0
|
@@ -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.
|
|
4
|
+
* Version: v4.11.2
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -18,39 +18,25 @@
|
|
|
18
18
|
})(self, function() {
|
|
19
19
|
return (self["webpackChunkjodit"] = self["webpackChunkjodit"] || []).push([[882],{
|
|
20
20
|
|
|
21
|
-
/***/
|
|
22
|
-
/***/ (function(
|
|
23
|
-
|
|
24
|
-
module.exports = "<svg viewBox=\"0 0 16 16\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M8,11c1.657,0,3-1.343,3-3V3c0-1.657-1.343-3-3-3S5,1.343,5,3v5C5,9.657,6.343,11,8,11z\"/> <path d=\"M13,8V6h-1l0,1.844c0,1.92-1.282,3.688-3.164,4.071C6.266,12.438,4,10.479,4,8V6H3v2c0,2.414,1.721,4.434,4,4.899V15H5v1h6 v-1H9v-2.101C11.279,12.434,13,10.414,13,8z\"/> </svg>"
|
|
25
|
-
|
|
26
|
-
/***/ }),
|
|
27
|
-
|
|
28
|
-
/***/ 31262:
|
|
29
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
21
|
+
/***/ 75143:
|
|
22
|
+
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
30
23
|
|
|
31
24
|
"use strict";
|
|
32
|
-
__webpack_require__
|
|
33
|
-
/* harmony
|
|
34
|
-
/* harmony
|
|
35
|
-
/* harmony
|
|
36
|
-
/* harmony import */ var
|
|
37
|
-
/* harmony import */ var
|
|
38
|
-
/* harmony import */ var
|
|
39
|
-
/* harmony import */ var
|
|
40
|
-
/* harmony import */ var
|
|
41
|
-
/* harmony import */ var
|
|
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);
|
|
25
|
+
/* harmony import */ var jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22289);
|
|
26
|
+
/* harmony import */ var jodit_core_helpers_checker_is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(85932);
|
|
27
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7909);
|
|
28
|
+
/* harmony import */ var jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36400);
|
|
29
|
+
/* harmony import */ var jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29434);
|
|
30
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
|
|
31
|
+
/* harmony import */ var _helpers_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(97743);
|
|
32
|
+
/* harmony import */ var _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(68097);
|
|
33
|
+
/* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22227);
|
|
34
|
+
/* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8__);
|
|
47
35
|
/*!
|
|
48
36
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
49
37
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
50
38
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
51
39
|
*/ /**
|
|
52
|
-
* [[include:plugins/speech-recognize/README.md]]
|
|
53
|
-
* @packageDocumentation
|
|
54
40
|
* @module plugins/speech-recognize
|
|
55
41
|
*/
|
|
56
42
|
|
|
@@ -61,189 +47,156 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61
47
|
|
|
62
48
|
|
|
63
49
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
beforeDestruct(jodit) {
|
|
88
|
-
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(this.messagePopup);
|
|
50
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.speechRecognize = {
|
|
51
|
+
api: typeof _helpers_api__WEBPACK_IMPORTED_MODULE_6__.SpeechRecognition !== 'undefined' ? _helpers_api__WEBPACK_IMPORTED_MODULE_6__.SpeechRecognition : null,
|
|
52
|
+
sound: true,
|
|
53
|
+
continuous: false,
|
|
54
|
+
interimResults: true,
|
|
55
|
+
commands: {
|
|
56
|
+
'newline|enter': 'enter',
|
|
57
|
+
'delete|remove word|delete word': 'backspaceWordButton',
|
|
58
|
+
comma: 'inserthtml::,',
|
|
59
|
+
underline: 'inserthtml::_',
|
|
60
|
+
hyphen: 'inserthtml::-',
|
|
61
|
+
space: 'inserthtml:: ',
|
|
62
|
+
question: 'inserthtml::?',
|
|
63
|
+
dot: 'inserthtml::.',
|
|
64
|
+
'quote|quotes|open quote': "inserthtml::'",
|
|
65
|
+
'header|header h1': 'formatblock::h1',
|
|
66
|
+
'select all': 'selectall'
|
|
89
67
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
68
|
+
};
|
|
69
|
+
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('speech-recognize', (_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8___default()));
|
|
70
|
+
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.speechRecognize = {
|
|
71
|
+
isVisible (j) {
|
|
72
|
+
return Boolean(j.o.speechRecognize.api);
|
|
73
|
+
},
|
|
74
|
+
isActive (jodit, _) {
|
|
75
|
+
const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech');
|
|
76
|
+
return Boolean(api?.isEnabled);
|
|
77
|
+
},
|
|
78
|
+
isDisabled (jodit) {
|
|
79
|
+
return !jodit.o.speechRecognize.api;
|
|
80
|
+
},
|
|
81
|
+
exec (jodit, current, { button, control }) {
|
|
82
|
+
const { api: ApiConstructor, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
|
|
83
|
+
if (!ApiConstructor) {
|
|
84
|
+
jodit.alert('Speech recognize API unsupported in your browser');
|
|
85
|
+
return;
|
|
93
86
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
87
|
+
let api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech');
|
|
88
|
+
if (!api) {
|
|
89
|
+
const nativeApi = new ApiConstructor();
|
|
90
|
+
api = new _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_7__.RecognizeManager(jodit.async, nativeApi);
|
|
91
|
+
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;
|
|
92
|
+
api.continuous = continuous;
|
|
93
|
+
api.interimResults = interimResults;
|
|
94
|
+
api.sound = sound;
|
|
95
|
+
(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech', api);
|
|
96
|
+
api.on('pulse', (enable)=>{
|
|
97
|
+
button.setMod('pulse', enable);
|
|
98
|
+
});
|
|
99
|
+
api.on('result', (text)=>jodit.e.fire('speechRecognizeResult', text));
|
|
100
|
+
api.on('progress', (text)=>jodit.e.fire('speechRecognizeProgressResult', text));
|
|
101
|
+
api.on('error', (text)=>jodit.message.error(text));
|
|
102
|
+
button.hookStatus('beforeDestruct', ()=>{
|
|
103
|
+
(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech', null);
|
|
104
|
+
api.destruct();
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (control.args) {
|
|
108
|
+
const key = control.args[0];
|
|
109
|
+
if ((0,jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(api[key])) {
|
|
110
|
+
api[key] = !api[key];
|
|
111
|
+
if (api.isEnabled) {
|
|
112
|
+
api.restart();
|
|
113
|
+
}
|
|
114
|
+
return;
|
|
116
115
|
}
|
|
117
116
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (this._commandToWord[command]) {
|
|
122
|
-
(0,_helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_9__.execSpellCommand)(this.j, this._commandToWord[command]);
|
|
123
|
-
return true;
|
|
117
|
+
api.toggle();
|
|
118
|
+
if (api.isEnabled) {
|
|
119
|
+
button.setMod('pulse', true);
|
|
124
120
|
}
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
button.state.activated = api.isEnabled;
|
|
122
|
+
},
|
|
123
|
+
name: 'speechRecognize',
|
|
124
|
+
command: 'toggleSpeechRecognize',
|
|
125
|
+
tooltip: 'Speech Recognize',
|
|
126
|
+
list: {
|
|
127
|
+
sound: 'Sound',
|
|
128
|
+
interimResults: 'Interim Results'
|
|
129
|
+
},
|
|
130
|
+
childTemplate (jodit, key, value) {
|
|
131
|
+
const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech'), checked = api?.[key] ?? jodit.o.speechRecognize[key];
|
|
132
|
+
return `<span class='jodit-speech-recognize__list-item'><input ${checked ? 'checked' : ''} class='jodit-checkbox' type='checkbox'> ${value}</span>`;
|
|
133
|
+
},
|
|
134
|
+
mods: {
|
|
135
|
+
stroke: false
|
|
134
136
|
}
|
|
135
|
-
}
|
|
136
|
-
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
137
|
-
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_2__.watch)(':speechRecognizeProgressResult')
|
|
138
|
-
], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
|
|
139
|
-
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
140
|
-
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_2__.watch)(':speechRecognizeResult')
|
|
141
|
-
], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
|
|
142
|
-
_jodit__WEBPACK_IMPORTED_MODULE_8__.Jodit.plugins.add('speech-recognize', SpeechRecognizeNative);
|
|
137
|
+
};
|
|
143
138
|
|
|
144
139
|
|
|
145
140
|
/***/ }),
|
|
146
141
|
|
|
147
|
-
/***/
|
|
142
|
+
/***/ 94092:
|
|
148
143
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
149
144
|
|
|
150
145
|
"use strict";
|
|
151
146
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
152
|
-
/* harmony export */
|
|
147
|
+
/* harmony export */ PII: function() { return /* binding */ PII; },
|
|
148
|
+
/* harmony export */ WARN: function() { return /* binding */ WARN; }
|
|
153
149
|
/* 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);
|
|
156
150
|
/*!
|
|
157
151
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
158
152
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
159
153
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
160
154
|
*/ /**
|
|
161
155
|
* @module plugins/speech-recognize
|
|
162
|
-
*/
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
156
|
* @internal
|
|
166
|
-
*/
|
|
167
|
-
|
|
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;
|
|
181
|
-
}
|
|
157
|
+
*/ const PII = 440;
|
|
158
|
+
const WARN = 940;
|
|
182
159
|
|
|
183
160
|
|
|
184
161
|
/***/ }),
|
|
185
162
|
|
|
186
|
-
/***/
|
|
163
|
+
/***/ 97743:
|
|
187
164
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
188
165
|
|
|
189
166
|
"use strict";
|
|
190
|
-
__webpack_require__.r(__webpack_exports__);
|
|
191
167
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
192
|
-
/* harmony export */
|
|
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__; }
|
|
168
|
+
/* harmony export */ SpeechRecognition: function() { return /* binding */ SpeechRecognition; }
|
|
215
169
|
/* harmony export */ });
|
|
216
|
-
/* harmony import */ var
|
|
217
|
-
/* harmony import */ var _ar_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ar_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
170
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
218
171
|
/*!
|
|
219
172
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
220
173
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
221
174
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
175
|
+
*/ /**
|
|
176
|
+
* @module plugins/speech-recognize
|
|
177
|
+
*/
|
|
178
|
+
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;
|
|
243
179
|
|
|
244
180
|
|
|
181
|
+
/***/ }),
|
|
245
182
|
|
|
183
|
+
/***/ 86581:
|
|
184
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
246
185
|
|
|
186
|
+
"use strict";
|
|
187
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
188
|
+
/* harmony export */ execSpellCommand: function() { return /* binding */ execSpellCommand; }
|
|
189
|
+
/* harmony export */ });
|
|
190
|
+
/*!
|
|
191
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
192
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
193
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
194
|
+
*/ /**
|
|
195
|
+
* @module plugins/speech-recognize
|
|
196
|
+
*/ function execSpellCommand(jodit, commandSentence) {
|
|
197
|
+
const [command, value] = commandSentence.split('::');
|
|
198
|
+
jodit.execCommand(command, null, value);
|
|
199
|
+
}
|
|
247
200
|
|
|
248
201
|
|
|
249
202
|
/***/ }),
|
|
@@ -431,20 +384,15 @@ class RecognizeManager extends jodit_core_event_emitter_eventify__WEBPACK_IMPORT
|
|
|
431
384
|
|
|
432
385
|
/***/ }),
|
|
433
386
|
|
|
434
|
-
/***/
|
|
435
|
-
/***/ (function(__unused_webpack_module,
|
|
387
|
+
/***/ 32560:
|
|
388
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
436
389
|
|
|
437
390
|
"use strict";
|
|
438
|
-
/* harmony
|
|
439
|
-
/* harmony
|
|
440
|
-
/* harmony
|
|
441
|
-
/* harmony import */ var
|
|
442
|
-
/* harmony import */ var
|
|
443
|
-
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5266);
|
|
444
|
-
/* harmony import */ var _helpers_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(97743);
|
|
445
|
-
/* harmony import */ var _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(68097);
|
|
446
|
-
/* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(22227);
|
|
447
|
-
/* harmony import */ var _speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8__);
|
|
391
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
392
|
+
/* harmony export */ sound: function() { return /* binding */ sound; }
|
|
393
|
+
/* harmony export */ });
|
|
394
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81937);
|
|
395
|
+
/* harmony import */ var jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(94092);
|
|
448
396
|
/*!
|
|
449
397
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
450
398
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -453,165 +401,217 @@ class RecognizeManager extends jodit_core_event_emitter_eventify__WEBPACK_IMPORT
|
|
|
453
401
|
* @module plugins/speech-recognize
|
|
454
402
|
*/
|
|
455
403
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.speechRecognize = {
|
|
464
|
-
api: typeof _helpers_api__WEBPACK_IMPORTED_MODULE_6__.SpeechRecognition !== 'undefined' ? _helpers_api__WEBPACK_IMPORTED_MODULE_6__.SpeechRecognition : null,
|
|
465
|
-
sound: true,
|
|
466
|
-
continuous: false,
|
|
467
|
-
interimResults: true,
|
|
468
|
-
commands: {
|
|
469
|
-
'newline|enter': 'enter',
|
|
470
|
-
'delete|remove word|delete word': 'backspaceWordButton',
|
|
471
|
-
comma: 'inserthtml::,',
|
|
472
|
-
underline: 'inserthtml::_',
|
|
473
|
-
hyphen: 'inserthtml::-',
|
|
474
|
-
space: 'inserthtml:: ',
|
|
475
|
-
question: 'inserthtml::?',
|
|
476
|
-
dot: 'inserthtml::.',
|
|
477
|
-
'quote|quotes|open quote': "inserthtml::'",
|
|
478
|
-
'header|header h1': 'formatblock::h1',
|
|
479
|
-
'select all': 'selectall'
|
|
480
|
-
}
|
|
481
|
-
};
|
|
482
|
-
jodit_core_ui_icon__WEBPACK_IMPORTED_MODULE_4__.Icon.set('speech-recognize', (_speech_recognize_svg__WEBPACK_IMPORTED_MODULE_8___default()));
|
|
483
|
-
jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.speechRecognize = {
|
|
484
|
-
isVisible (j) {
|
|
485
|
-
return Boolean(j.o.speechRecognize.api);
|
|
486
|
-
},
|
|
487
|
-
isActive (jodit, _) {
|
|
488
|
-
const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech');
|
|
489
|
-
return Boolean(api?.isEnabled);
|
|
490
|
-
},
|
|
491
|
-
isDisabled (jodit) {
|
|
492
|
-
return !jodit.o.speechRecognize.api;
|
|
493
|
-
},
|
|
494
|
-
exec (jodit, current, { button, control }) {
|
|
495
|
-
const { api: ApiConstructor, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
|
|
496
|
-
if (!ApiConstructor) {
|
|
497
|
-
jodit.alert('Speech recognize API unsupported in your browser');
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
let api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech');
|
|
501
|
-
if (!api) {
|
|
502
|
-
const nativeApi = new ApiConstructor();
|
|
503
|
-
api = new _helpers_recognize_manager__WEBPACK_IMPORTED_MODULE_7__.RecognizeManager(jodit.async, nativeApi);
|
|
504
|
-
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;
|
|
505
|
-
api.continuous = continuous;
|
|
506
|
-
api.interimResults = interimResults;
|
|
507
|
-
api.sound = sound;
|
|
508
|
-
(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech', api);
|
|
509
|
-
api.on('pulse', (enable)=>{
|
|
510
|
-
button.setMod('pulse', enable);
|
|
511
|
-
});
|
|
512
|
-
api.on('result', (text)=>jodit.e.fire('speechRecognizeResult', text));
|
|
513
|
-
api.on('progress', (text)=>jodit.e.fire('speechRecognizeProgressResult', text));
|
|
514
|
-
api.on('error', (text)=>jodit.message.error(text));
|
|
515
|
-
button.hookStatus('beforeDestruct', ()=>{
|
|
516
|
-
(0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech', null);
|
|
517
|
-
api.destruct();
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
if (control.args) {
|
|
521
|
-
const key = control.args[0];
|
|
522
|
-
if ((0,jodit_core_helpers_checker_is_boolean__WEBPACK_IMPORTED_MODULE_0__.isBoolean)(api[key])) {
|
|
523
|
-
api[key] = !api[key];
|
|
524
|
-
if (api.isEnabled) {
|
|
525
|
-
api.restart();
|
|
526
|
-
}
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
api.toggle();
|
|
531
|
-
if (api.isEnabled) {
|
|
532
|
-
button.setMod('pulse', true);
|
|
533
|
-
}
|
|
534
|
-
button.state.activated = api.isEnabled;
|
|
535
|
-
},
|
|
536
|
-
name: 'speechRecognize',
|
|
537
|
-
command: 'toggleSpeechRecognize',
|
|
538
|
-
tooltip: 'Speech Recognize',
|
|
539
|
-
list: {
|
|
540
|
-
sound: 'Sound',
|
|
541
|
-
interimResults: 'Interim Results'
|
|
542
|
-
},
|
|
543
|
-
childTemplate (jodit, key, value) {
|
|
544
|
-
const api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech'), checked = api?.[key] ?? jodit.o.speechRecognize[key];
|
|
545
|
-
return `<span class='jodit-speech-recognize__list-item'><input ${checked ? 'checked' : ''} class='jodit-checkbox' type='checkbox'> ${value}</span>`;
|
|
546
|
-
},
|
|
547
|
-
mods: {
|
|
548
|
-
stroke: false
|
|
404
|
+
/**
|
|
405
|
+
* @internal
|
|
406
|
+
*/ function sound({ sec = 0.1, frequency = jodit_plugins_speech_recognize_constants__WEBPACK_IMPORTED_MODULE_1__.PII, gain = 0.1, type = 'sine' } = {}) {
|
|
407
|
+
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') {
|
|
408
|
+
return;
|
|
549
409
|
}
|
|
550
|
-
|
|
410
|
+
// one context per document
|
|
411
|
+
const context = new (jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.AudioContext || jodit_core_constants__WEBPACK_IMPORTED_MODULE_0__.globalWindow.webkitAudioContext)();
|
|
412
|
+
const vol = context.createGain();
|
|
413
|
+
const osc = context.createOscillator();
|
|
414
|
+
osc.type = type;
|
|
415
|
+
osc.frequency.value = frequency; // Hz
|
|
416
|
+
osc.connect(vol);
|
|
417
|
+
vol.connect(context.destination);
|
|
418
|
+
osc.start(); // start the oscillator
|
|
419
|
+
osc.stop(context.currentTime + sec);
|
|
420
|
+
vol.gain.value = gain;
|
|
421
|
+
}
|
|
551
422
|
|
|
552
423
|
|
|
553
424
|
/***/ }),
|
|
554
425
|
|
|
555
|
-
/***/
|
|
426
|
+
/***/ 43219:
|
|
556
427
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
557
428
|
|
|
558
429
|
"use strict";
|
|
430
|
+
__webpack_require__.r(__webpack_exports__);
|
|
559
431
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
560
|
-
/* harmony export */
|
|
432
|
+
/* harmony export */ ar: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
433
|
+
/* harmony export */ cs_cz: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
434
|
+
/* harmony export */ de: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
435
|
+
/* harmony export */ es: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
436
|
+
/* harmony export */ fa: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
437
|
+
/* harmony export */ fi: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
438
|
+
/* harmony export */ fr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
439
|
+
/* harmony export */ he: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
440
|
+
/* harmony export */ hu: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
441
|
+
/* harmony export */ id: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
442
|
+
/* harmony export */ it: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
443
|
+
/* harmony export */ ja: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
444
|
+
/* harmony export */ ko: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
445
|
+
/* harmony export */ mn: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
446
|
+
/* harmony export */ nl: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
447
|
+
/* harmony export */ no: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
448
|
+
/* harmony export */ pl: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
449
|
+
/* harmony export */ pt_br: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
450
|
+
/* harmony export */ ru: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
451
|
+
/* harmony export */ tr: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
452
|
+
/* harmony export */ ua: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
453
|
+
/* harmony export */ zh_cn: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; },
|
|
454
|
+
/* harmony export */ zh_tw: function() { return /* reexport module object */ _ar_js__WEBPACK_IMPORTED_MODULE_0__; }
|
|
561
455
|
/* harmony export */ });
|
|
456
|
+
/* harmony import */ var _ar_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41324);
|
|
457
|
+
/* harmony import */ var _ar_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_ar_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
562
458
|
/*!
|
|
563
459
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
564
460
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
565
461
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
566
|
-
*/
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
462
|
+
*/ // @ts-nocheck
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
572
483
|
|
|
573
484
|
|
|
574
|
-
/***/ }),
|
|
575
485
|
|
|
576
|
-
/***/ 94092:
|
|
577
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
578
486
|
|
|
579
|
-
"use strict";
|
|
580
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
581
|
-
/* harmony export */ PII: function() { return /* binding */ PII; },
|
|
582
|
-
/* harmony export */ WARN: function() { return /* binding */ WARN; }
|
|
583
|
-
/* harmony export */ });
|
|
584
|
-
/*!
|
|
585
|
-
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
586
|
-
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
587
|
-
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
588
|
-
*/ /**
|
|
589
|
-
* @module plugins/speech-recognize
|
|
590
|
-
* @internal
|
|
591
|
-
*/ const PII = 440;
|
|
592
|
-
const WARN = 940;
|
|
593
487
|
|
|
594
488
|
|
|
595
489
|
/***/ }),
|
|
596
490
|
|
|
597
|
-
/***/
|
|
491
|
+
/***/ 31262:
|
|
598
492
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
599
493
|
|
|
600
494
|
"use strict";
|
|
495
|
+
__webpack_require__.r(__webpack_exports__);
|
|
601
496
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
602
|
-
/* harmony export */
|
|
497
|
+
/* harmony export */ SpeechRecognizeNative: function() { return /* binding */ SpeechRecognizeNative; }
|
|
603
498
|
/* harmony export */ });
|
|
604
|
-
/* harmony import */ var
|
|
499
|
+
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
500
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
501
|
+
/* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68616);
|
|
502
|
+
/* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23211);
|
|
503
|
+
/* harmony import */ var jodit_core_global__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28077);
|
|
504
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(71125);
|
|
505
|
+
/* harmony import */ var jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91206);
|
|
506
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(75143);
|
|
507
|
+
/* harmony import */ var _jodit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(73302);
|
|
508
|
+
/* harmony import */ var _helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(86581);
|
|
509
|
+
/* harmony import */ var _langs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(43219);
|
|
605
510
|
/*!
|
|
606
511
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
607
512
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
608
513
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
609
514
|
*/ /**
|
|
515
|
+
* [[include:plugins/speech-recognize/README.md]]
|
|
516
|
+
* @packageDocumentation
|
|
610
517
|
* @module plugins/speech-recognize
|
|
611
518
|
*/
|
|
612
|
-
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;
|
|
613
519
|
|
|
614
520
|
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
class SpeechRecognizeNative extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
531
|
+
afterInit(jodit) {
|
|
532
|
+
const { commands } = jodit.o.speechRecognize;
|
|
533
|
+
if (commands) {
|
|
534
|
+
(0,jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.extendLang)(_langs__WEBPACK_IMPORTED_MODULE_10__);
|
|
535
|
+
(0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_5__.keys)(commands, false).forEach((words)=>{
|
|
536
|
+
const keys = words.split('|');
|
|
537
|
+
keys.forEach((key)=>{
|
|
538
|
+
key = key.trim().toLowerCase();
|
|
539
|
+
this._commandToWord[key] = commands[words];
|
|
540
|
+
const translatedKeys = jodit.i18n(key);
|
|
541
|
+
if (translatedKeys !== key) {
|
|
542
|
+
translatedKeys.split('|').forEach((translatedKey)=>{
|
|
543
|
+
this._commandToWord[translatedKey.trim().toLowerCase()] = commands[words].trim();
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
beforeDestruct(jodit) {
|
|
551
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(this.messagePopup);
|
|
552
|
+
}
|
|
553
|
+
onSpeechRecognizeProgressResult(text) {
|
|
554
|
+
if (!this.messagePopup) {
|
|
555
|
+
this.messagePopup = this.j.create.div('jodit-speech-recognize__popup');
|
|
556
|
+
}
|
|
557
|
+
this.j.workplace.appendChild(this.messagePopup);
|
|
558
|
+
this.j.async.clearTimeout(this.__hidePopupTimeout);
|
|
559
|
+
this.__hidePopupTimeout = this.j.async.setTimeout(()=>{
|
|
560
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(this.messagePopup);
|
|
561
|
+
}, 1000);
|
|
562
|
+
this.messagePopup.innerText = text + '|';
|
|
563
|
+
}
|
|
564
|
+
onSpeechRecognizeResult(text) {
|
|
565
|
+
this.j.async.clearTimeout(this.__hidePopupTimeout);
|
|
566
|
+
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_3__.Dom.safeRemove(this.messagePopup);
|
|
567
|
+
const { j } = this;
|
|
568
|
+
const { s } = j;
|
|
569
|
+
if (!this._checkCommand(text)) {
|
|
570
|
+
const { range } = s, node = s.current();
|
|
571
|
+
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) {
|
|
572
|
+
const sentence = node.nodeValue;
|
|
573
|
+
node.nodeValue = sentence + (/[\u00A0 ]\uFEFF*$/.test(sentence) ? '' : ' ') + text;
|
|
574
|
+
range.setStartAfter(node);
|
|
575
|
+
s.selectRange(range);
|
|
576
|
+
j.synchronizeValues();
|
|
577
|
+
} else {
|
|
578
|
+
s.insertHTML(text);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
_checkCommand(command) {
|
|
583
|
+
command = command.toLowerCase().replace(/\./g, '');
|
|
584
|
+
if (this._commandToWord[command]) {
|
|
585
|
+
(0,_helpers_exec_spell_command__WEBPACK_IMPORTED_MODULE_9__.execSpellCommand)(this.j, this._commandToWord[command]);
|
|
586
|
+
return true;
|
|
587
|
+
}
|
|
588
|
+
return false;
|
|
589
|
+
}
|
|
590
|
+
constructor(...args){
|
|
591
|
+
super(...args), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "buttons", [
|
|
592
|
+
{
|
|
593
|
+
group: 'state',
|
|
594
|
+
name: 'speechRecognize'
|
|
595
|
+
}
|
|
596
|
+
]), (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", {});
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
600
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_2__.watch)(':speechRecognizeProgressResult')
|
|
601
|
+
], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
|
|
602
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
603
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_2__.watch)(':speechRecognizeResult')
|
|
604
|
+
], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
|
|
605
|
+
_jodit__WEBPACK_IMPORTED_MODULE_8__.Jodit.plugins.add('speech-recognize', SpeechRecognizeNative);
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
/***/ }),
|
|
609
|
+
|
|
610
|
+
/***/ 22227:
|
|
611
|
+
/***/ (function(module) {
|
|
612
|
+
|
|
613
|
+
module.exports = "<svg viewBox=\"0 0 16 16\" xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M8,11c1.657,0,3-1.343,3-3V3c0-1.657-1.343-3-3-3S5,1.343,5,3v5C5,9.657,6.343,11,8,11z\"/> <path d=\"M13,8V6h-1l0,1.844c0,1.92-1.282,3.688-3.164,4.071C6.266,12.438,4,10.479,4,8V6H3v2c0,2.414,1.721,4.434,4,4.899V15H5v1h6 v-1H9v-2.101C11.279,12.434,13,10.414,13,8z\"/> </svg>"
|
|
614
|
+
|
|
615
615
|
/***/ })
|
|
616
616
|
|
|
617
617
|
},
|