jodit 3.19.4 → 3.20.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.
Files changed (217) hide show
  1. package/build/jodit.css +45 -42
  2. package/build/jodit.es2018.css +38 -36
  3. package/build/jodit.es2018.en.css +38 -36
  4. package/build/jodit.es2018.en.js +22562 -25637
  5. package/build/jodit.es2018.en.min.css +1 -1
  6. package/build/jodit.es2018.en.min.js +1 -1
  7. package/build/jodit.es2018.js +23105 -26181
  8. package/build/jodit.es2018.min.css +1 -1
  9. package/build/jodit.es2018.min.js +1 -1
  10. package/build/jodit.js +797 -386
  11. package/build/jodit.min.css +2 -2
  12. package/build/jodit.min.js +1 -1
  13. package/build/plugins/debug/debug.es2018.en.js +97 -0
  14. package/build/plugins/debug/debug.es2018.en.min.js +1 -0
  15. package/build/plugins/debug/debug.es2018.js +97 -0
  16. package/build/plugins/debug/debug.es2018.min.js +1 -0
  17. package/build/plugins/debug/debug.js +96 -0
  18. package/build/plugins/debug/debug.min.js +1 -0
  19. package/build/plugins/speech-recognize/speech-recognize.css +1 -1
  20. package/build/plugins/speech-recognize/speech-recognize.es2018.css +1 -1
  21. package/build/plugins/speech-recognize/speech-recognize.es2018.en.css +1 -1
  22. package/build/plugins/speech-recognize/speech-recognize.es2018.en.js +331 -398
  23. package/build/plugins/speech-recognize/speech-recognize.es2018.en.min.js +1 -1
  24. package/build/plugins/speech-recognize/speech-recognize.es2018.js +331 -398
  25. package/build/plugins/speech-recognize/speech-recognize.es2018.min.js +1 -1
  26. package/build/plugins/speech-recognize/speech-recognize.js +1 -1
  27. package/build/vdom.css +1 -1
  28. package/build/vdom.js +1 -1
  29. package/index.html +2 -2
  30. package/package.json +9 -4
  31. package/src/config.ts +4 -2
  32. package/src/core/constants.ts +7 -7
  33. package/src/core/decorators/derive/README.md +71 -0
  34. package/src/core/decorators/derive/derive.ts +48 -0
  35. package/src/core/decorators/index.ts +1 -0
  36. package/src/core/decorators/spy/spy.ts +5 -0
  37. package/src/core/dom/dom.test.js +0 -1
  38. package/src/core/dom/dom.ts +28 -13
  39. package/src/core/event-emitter/observable.ts +3 -3
  40. package/src/core/helpers/helpers.test.js +0 -170
  41. package/src/core/plugin/plugin-system.ts +20 -0
  42. package/src/core/selection/select.ts +27 -9
  43. package/src/core/selection/style/api/toggle/toggle-ordered-list.ts +5 -1
  44. package/src/core/selection/style/api/wrap-ordered-list.ts +5 -1
  45. package/src/core/selection/style/api/wrap-unwrapped-text.ts +1 -1
  46. package/src/core/selection/style/style.test.js +1 -1
  47. package/src/core/{view/panel.ts → traits/dlgs.ts} +17 -9
  48. package/src/core/traits/elms.ts +4 -8
  49. package/src/core/traits/index.ts +1 -0
  50. package/src/core/traits/mods.ts +17 -10
  51. package/src/core/ui/button/index.ts +1 -0
  52. package/src/{plugins → core/ui/button}/tooltip/README.md +0 -0
  53. package/src/{plugins → core/ui/button}/tooltip/tooltip.less +4 -4
  54. package/src/{plugins → core/ui/button}/tooltip/tooltip.test.js +3 -2
  55. package/src/core/ui/button/tooltip/tooltip.ts +132 -0
  56. package/src/core/ui/element.ts +5 -27
  57. package/src/core/ui/group/group.test.js +44 -0
  58. package/src/core/ui/group/group.ts +4 -4
  59. package/src/core/view/view-with-toolbar.ts +2 -2
  60. package/src/core/view/view.ts +11 -33
  61. package/src/jodit.ts +20 -8
  62. package/src/langs/ar.js +1 -1
  63. package/src/langs/cs_cz.js +1 -1
  64. package/src/langs/de.js +1 -1
  65. package/src/langs/es.js +1 -1
  66. package/src/langs/fa.js +1 -1
  67. package/src/langs/fr.js +1 -1
  68. package/src/langs/he.js +1 -1
  69. package/src/langs/hu.js +1 -1
  70. package/src/langs/i18n.test.js +170 -0
  71. package/src/langs/id.js +1 -1
  72. package/src/langs/it.js +1 -1
  73. package/src/langs/ja.js +1 -1
  74. package/src/langs/ko.js +1 -1
  75. package/src/langs/nl.js +1 -1
  76. package/src/langs/pl.js +1 -1
  77. package/src/langs/pt_br.js +1 -1
  78. package/src/langs/ru.js +1 -1
  79. package/src/langs/tr.js +1 -1
  80. package/src/langs/zh_cn.js +1 -1
  81. package/src/langs/zh_tw.js +1 -1
  82. package/src/modules/dialog/dialog.less +2 -0
  83. package/src/modules/dialog/dialog.ts +27 -50
  84. package/src/modules/file-browser/README.md +10 -10
  85. package/src/modules/file-browser/__image_snapshots__/file-browser-test-screenshot-js-filebrowser-screenshot-testing-open-filebrowser-works-1-snap.png +0 -0
  86. package/src/modules/file-browser/builders/context-menu.ts +1 -1
  87. package/src/modules/file-browser/file-browser.test.js +26 -13
  88. package/src/modules/file-browser/file-browser.test.screenshot.js +23 -0
  89. package/src/modules/file-browser/file-browser.ts +9 -5
  90. package/src/modules/history/snapshot.ts +12 -3
  91. package/src/modules/image-editor/__image_snapshots__/image-editor-test-screenshot-js-image-editor-screenshot-testing-open-image-editor-works-1-snap.png +0 -0
  92. package/src/modules/image-editor/image-editor.test.screenshot.js +25 -0
  93. package/src/modules/image-editor/image-editor.ts +7 -6
  94. package/src/modules/status-bar/status-bar.ts +5 -16
  95. package/src/modules/table/table.test.js +2 -1
  96. package/src/modules/toolbar/collection/collection.ts +6 -1
  97. package/src/modules/uploader/README.md +1 -1
  98. package/src/modules/uploader/config.ts +1 -1
  99. package/src/modules/uploader/uploader.test.js +96 -46
  100. package/src/plugins/about/about.ts +1 -1
  101. package/src/plugins/add-new-line/add-new-line.ts +5 -4
  102. package/src/plugins/backspace/backspace.test.js +33 -39
  103. package/src/plugins/backspace/backspace.ts +10 -4
  104. package/src/plugins/backspace/cases/check-remove-char.ts +36 -14
  105. package/src/plugins/backspace/cases/check-remove-unbreakable-element.ts +8 -0
  106. package/src/plugins/backspace/config.ts +1 -1
  107. package/src/plugins/backspace/interface.d.ts +1 -1
  108. package/src/plugins/clean-html/clean-html.test.js +240 -164
  109. package/src/plugins/clean-html/config.ts +10 -2
  110. package/src/plugins/clean-html/helpers/remove-format/remove-format-for-collapsed-selection.ts +3 -2
  111. package/src/plugins/clean-html/helpers/remove-format/remove-format-for-selection.ts +2 -2
  112. package/src/plugins/clean-html/helpers/visitor/filters/index.ts +1 -0
  113. package/src/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.ts +35 -0
  114. package/src/plugins/clean-html/helpers/visitor/filters/remove-inv-text-nodes.ts +2 -6
  115. package/src/plugins/clean-html/helpers/visitor/visit-node-walker.ts +5 -0
  116. package/src/plugins/debug/debug.ts +68 -0
  117. package/src/plugins/drag-and-drop/drag-and-drop.ts +0 -1
  118. package/src/plugins/drag-and-drop-element/drag-and-drop-element.test.js +37 -34
  119. package/src/plugins/dtd/README.md +52 -0
  120. package/{types/plugins/tooltip/tooltip.d.ts → src/plugins/dtd/after-insert/index.ts} +5 -4
  121. package/src/plugins/dtd/after-insert/remove-extra-br.ts +39 -0
  122. package/src/plugins/dtd/before-insert/check-block-nesting.ts +40 -0
  123. package/src/plugins/dtd/before-insert/index.ts +12 -0
  124. package/src/plugins/dtd/config.ts +67 -0
  125. package/src/plugins/dtd/dtd.test.js +128 -0
  126. package/src/plugins/dtd/dtd.ts +48 -0
  127. package/src/plugins/enter/enter.test.js +89 -193
  128. package/src/plugins/enter/enter.ts +14 -11
  129. package/src/plugins/enter/helpers/check-br.ts +11 -1
  130. package/src/plugins/enter/helpers/index.ts +1 -0
  131. package/src/plugins/enter/helpers/move-cursor-out-from-specal-tags.ts +32 -0
  132. package/src/plugins/enter/helpers/split-fragment.ts +1 -0
  133. package/src/plugins/fullsize/config.ts +1 -1
  134. package/src/plugins/fullsize/fullsize.test.js +77 -12
  135. package/src/plugins/fullsize/fullsize.ts +12 -1
  136. package/src/plugins/iframe/config.ts +1 -1
  137. package/src/plugins/image-properties/README.md +7 -0
  138. package/src/plugins/image-properties/image-properties.ts +1 -1
  139. package/src/plugins/index.ts +1 -1
  140. package/src/plugins/limit/limit.test.js +27 -0
  141. package/src/plugins/limit/limit.ts +4 -2
  142. package/src/plugins/line-height/line-height.svg +1 -1
  143. package/src/plugins/link/README.md +5 -0
  144. package/src/plugins/link/link.test.js +11 -12
  145. package/src/plugins/link/link.ts +1 -1
  146. package/src/plugins/mobile/mobile.ts +1 -1
  147. package/src/plugins/ordered-list/ordered-list.test.js +3 -14
  148. package/src/plugins/paste/config.ts +0 -7
  149. package/src/plugins/paste/paste.test.js +3 -3
  150. package/src/plugins/paste-storage/paste-storage.ts +1 -1
  151. package/src/plugins/preview/preview.ts +1 -1
  152. package/src/plugins/search/search.ts +1 -1
  153. package/src/plugins/select/config.ts +1 -1
  154. package/src/plugins/spellcheck/config.ts +1 -1
  155. package/src/plugins/symbols/symbols.test.js +5 -4
  156. package/src/plugins/table/config.ts +4 -17
  157. package/src/plugins/table/table.test.js +2 -2
  158. package/src/plugins/wrap-nodes/wrap-nodes.test.js +34 -5
  159. package/src/plugins/wrap-nodes/wrap-nodes.ts +59 -16
  160. package/src/styles/variables.less +1 -1
  161. package/src/types/ajax.d.ts +2 -2
  162. package/src/types/file-browser.d.ts +4 -2
  163. package/src/types/jodit.d.ts +3 -2
  164. package/src/types/plugin.d.ts +1 -0
  165. package/src/types/toolbar.d.ts +12 -6
  166. package/src/types/traits.d.ts +30 -1
  167. package/src/types/types.d.ts +1 -0
  168. package/src/types/view.d.ts +9 -34
  169. package/src/typings.d.ts +1 -0
  170. package/types/config.d.ts +3 -2
  171. package/types/core/constants.d.ts +7 -7
  172. package/types/core/decorators/derive/derive.d.ts +6 -0
  173. package/types/core/decorators/index.d.ts +1 -0
  174. package/types/core/dom/dom.d.ts +5 -4
  175. package/types/core/plugin/plugin-system.d.ts +4 -0
  176. package/types/core/traits/dlgs.d.ts +15 -0
  177. package/types/core/traits/elms.d.ts +2 -4
  178. package/types/core/traits/index.d.ts +1 -0
  179. package/types/core/traits/mods.d.ts +5 -8
  180. package/types/core/ui/button/index.d.ts +1 -0
  181. package/types/core/ui/button/tooltip/tooltip.d.ts +29 -0
  182. package/types/core/ui/element.d.ts +3 -9
  183. package/types/core/ui/group/group.d.ts +2 -2
  184. package/types/core/view/view-with-toolbar.d.ts +2 -2
  185. package/types/core/view/view.d.ts +5 -10
  186. package/types/jodit.d.ts +7 -4
  187. package/types/modules/dialog/dialog.d.ts +8 -10
  188. package/types/modules/file-browser/file-browser.d.ts +5 -2
  189. package/types/modules/history/snapshot.d.ts +3 -2
  190. package/types/modules/image-editor/image-editor.d.ts +4 -4
  191. package/types/modules/status-bar/status-bar.d.ts +3 -4
  192. package/types/modules/toolbar/collection/collection.d.ts +1 -0
  193. package/types/plugins/clean-html/config.d.ts +7 -1
  194. package/types/plugins/clean-html/helpers/visitor/filters/index.d.ts +1 -0
  195. package/types/plugins/clean-html/helpers/visitor/filters/remove-empty-text-node.d.ts +13 -0
  196. package/types/plugins/dtd/after-insert/index.d.ts +10 -0
  197. package/types/plugins/dtd/after-insert/remove-extra-br.d.ts +16 -0
  198. package/types/plugins/dtd/before-insert/check-block-nesting.d.ts +16 -0
  199. package/types/plugins/dtd/before-insert/index.d.ts +10 -0
  200. package/types/plugins/dtd/config.d.ts +27 -0
  201. package/types/plugins/dtd/dtd.d.ts +6 -0
  202. package/types/plugins/enter/helpers/index.d.ts +1 -0
  203. package/types/plugins/enter/helpers/move-cursor-out-from-specal-tags.d.ts +13 -0
  204. package/types/plugins/iframe/config.d.ts +1 -1
  205. package/types/plugins/index.d.ts +1 -1
  206. package/types/plugins/paste/config.d.ts +0 -4
  207. package/types/plugins/spellcheck/config.d.ts +1 -1
  208. package/types/types/ajax.d.ts +2 -2
  209. package/types/types/file-browser.d.ts +4 -2
  210. package/types/types/jodit.d.ts +3 -2
  211. package/types/types/plugin.d.ts +1 -0
  212. package/types/types/toolbar.d.ts +12 -6
  213. package/types/types/traits.d.ts +30 -1
  214. package/types/types/types.d.ts +1 -0
  215. package/types/types/view.d.ts +9 -34
  216. package/src/plugins/tooltip/tooltip.ts +0 -114
  217. package/types/core/view/panel.d.ts +0 -13
@@ -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/)
4
- * Version: v3.19.4
4
+ * Version: v3.20.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -25,279 +25,217 @@ module.exports = "<svg viewBox=\"0 0 16 16\" xml:space=\"preserve\" xmlns=\"http
25
25
 
26
26
  /***/ }),
27
27
 
28
- /***/ 57368:
28
+ /***/ 86937:
29
29
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30
30
 
31
31
  "use strict";
32
32
  __webpack_require__.r(__webpack_exports__);
33
- // extracted by mini-css-extract-plugin
34
-
35
-
36
- /***/ }),
37
-
38
- /***/ 38587:
39
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
40
-
41
- "use strict";
42
-
33
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34
+ /* harmony export */ "ar": function() { return /* binding */ ar; },
35
+ /* harmony export */ "cs_cz": function() { return /* binding */ cs_cz; },
36
+ /* harmony export */ "de": function() { return /* binding */ de; },
37
+ /* harmony export */ "es": function() { return /* binding */ es; },
38
+ /* harmony export */ "fa": function() { return /* binding */ fa; },
39
+ /* harmony export */ "fr": function() { return /* binding */ fr; },
40
+ /* harmony export */ "he": function() { return /* binding */ he; },
41
+ /* harmony export */ "hu": function() { return /* binding */ hu; },
42
+ /* harmony export */ "id": function() { return /* binding */ id; },
43
+ /* harmony export */ "it": function() { return /* binding */ it; },
44
+ /* harmony export */ "ja": function() { return /* binding */ ja; },
45
+ /* harmony export */ "ko": function() { return /* binding */ ko; },
46
+ /* harmony export */ "nl": function() { return /* binding */ nl; },
47
+ /* harmony export */ "pl": function() { return /* binding */ pl; },
48
+ /* harmony export */ "pt_br": function() { return /* binding */ pt_br; },
49
+ /* harmony export */ "ru": function() { return /* binding */ ru; },
50
+ /* harmony export */ "tr": function() { return /* binding */ tr; },
51
+ /* harmony export */ "zh_cn": function() { return /* binding */ zh_cn; },
52
+ /* harmony export */ "zh_tw": function() { return /* binding */ zh_tw; }
53
+ /* harmony export */ });
43
54
  /*!
44
55
  * Jodit Editor (https://xdsoft.net/jodit/)
45
56
  * Released under MIT see LICENSE.txt in the project root for license information.
46
57
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
47
58
  */
48
- Object.defineProperty(exports, "__esModule", ({ value: true }));
49
- var config_1 = __webpack_require__(27537);
50
- var data_bind_1 = __webpack_require__(70774);
51
- var is_boolean_1 = __webpack_require__(65131);
52
- var icon_1 = __webpack_require__(76381);
53
- var recognize_manager_1 = __webpack_require__(94539);
54
- var api_1 = __webpack_require__(43467);
55
- config_1.Config.prototype.speechRecognize = {
56
- api: api_1.SpeechRecognition,
57
- sound: true,
58
- continuous: true,
59
- interimResults: true,
60
- commands: {
61
- 'newline|enter': 'enter',
62
- 'delete|remove word|delete word': 'backspaceWordButton',
63
- comma: 'inserthtml::,',
64
- underline: 'inserthtml::_',
65
- hyphen: 'inserthtml::-',
66
- space: 'inserthtml:: ',
67
- question: 'inserthtml::?',
68
- dot: 'inserthtml::.',
69
- 'quote|quotes|open quote': "inserthtml::'",
70
- 'header|header h1': 'formatblock::h1',
71
- 'select all': 'selectall'
72
- }
73
- };
74
- icon_1.Icon.set('speech-recognize', __webpack_require__(90327));
75
- config_1.Config.prototype.controls.speechRecognize = {
76
- isActive: function (jodit, _) {
77
- var api = (0, data_bind_1.dataBind)(jodit, 'speech');
78
- return Boolean(api === null || api === void 0 ? void 0 : api.isEnabled);
79
- },
80
- isDisabled: function (jodit) {
81
- return !jodit.o.speechRecognize.api;
82
- },
83
- exec: function (jodit, current, _a) {
84
- var button = _a.button, control = _a.control;
85
- var _b = jodit.o.speechRecognize, Api = _b.api, lang = _b.lang, continuous = _b.continuous, interimResults = _b.interimResults, sound = _b.sound;
86
- if (!Api) {
87
- jodit.alert('Speech recognize API unsupported in your browser');
88
- return;
89
- }
90
- var api = (0, data_bind_1.dataBind)(jodit, 'speech');
91
- if (!api) {
92
- var nativeApi = new Api();
93
- api = new recognize_manager_1.RecognizeManager(jodit.async, nativeApi);
94
- api.lang = lang;
95
- api.continuous = continuous;
96
- api.interimResults = interimResults;
97
- api.sound = sound;
98
- (0, data_bind_1.dataBind)(jodit, 'speech', api);
99
- api.on('pulse', function (enable) {
100
- button.setMod('pulse', enable);
101
- });
102
- api.on('result', function (text) {
103
- return jodit.e.fire('speechRecognizeResult', text);
104
- });
105
- api.on('progress', function (text) {
106
- return jodit.e.fire('speechRecognizeProgressResult', text);
107
- });
108
- button.hookStatus('beforeDestruct', function () {
109
- api.destruct();
110
- });
111
- }
112
- if (control.args) {
113
- var key = control.args[0];
114
- if ((0, is_boolean_1.isBoolean)(api[key])) {
115
- api[key] = !api[key];
116
- if (api.isEnabled) {
117
- api.restart();
118
- }
119
- return;
120
- }
121
- }
122
- api.toggle();
123
- button.state.activated = api.isEnabled;
124
- },
125
- name: 'speechRecognize',
126
- command: 'toggleSpeechRecognize',
127
- tooltip: 'Speech Recognize',
128
- list: {
129
- sound: 'Sound',
130
- interimResults: 'Interim Results'
131
- },
132
- childTemplate: function (jodit, key, value) {
133
- var _a;
134
- var api = (0, data_bind_1.dataBind)(jodit, 'speech'), checked = (_a = api === null || api === void 0 ? void 0 : api[key]) !== null && _a !== void 0 ? _a : jodit.o.speechRecognize[key];
135
- return "<span class='jodit-speech-recognize__list-item'><input ".concat(checked ? 'checked' : '', " class='jodit-checkbox' type='checkbox'>&nbsp;").concat(value, "</span>");
136
- },
137
- mods: {
138
- stroke: false
139
- }
140
- };
59
+ const ar = __webpack_require__(5466);
60
+ const cs_cz = __webpack_require__(65226);
61
+ const de = __webpack_require__(87541);
62
+ const es = __webpack_require__(87104);
63
+ const fa = __webpack_require__(53808);
64
+ const fr = __webpack_require__(48954);
65
+ const he = __webpack_require__(14694);
66
+ const hu = __webpack_require__(67381);
67
+ const id = __webpack_require__(99549);
68
+ const it = __webpack_require__(28428);
69
+ const ja = __webpack_require__(25363);
70
+ const ko = __webpack_require__(96929);
71
+ const nl = __webpack_require__(58499);
72
+ const pl = __webpack_require__(59430);
73
+ const pt_br = __webpack_require__(70297);
74
+ const ru = __webpack_require__(98949);
75
+ const tr = __webpack_require__(61232);
76
+ const zh_cn = __webpack_require__(56775);
77
+ const zh_tw = __webpack_require__(97957);
78
+
141
79
 
142
80
 
143
81
  /***/ }),
144
82
 
145
- /***/ 28511:
146
- /***/ (function(__unused_webpack_module, exports) {
83
+ /***/ 56949:
84
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
147
85
 
148
86
  "use strict";
87
+ // ESM COMPAT FLAG
88
+ __webpack_require__.r(__webpack_exports__);
149
89
 
90
+ // EXPORTS
91
+ __webpack_require__.d(__webpack_exports__, {
92
+ "SpeechRecognizeNative": function() { return /* binding */ SpeechRecognizeNative; }
93
+ });
94
+
95
+ // EXTERNAL MODULE: ./node_modules/tslib/tslib.es6.js
96
+ var tslib_es6 = __webpack_require__(20255);
97
+ // EXTERNAL MODULE: ./src/core/plugin/index.ts
98
+ var core_plugin = __webpack_require__(35570);
99
+ // EXTERNAL MODULE: ./src/core/decorators/watch/watch.ts
100
+ var watch = __webpack_require__(44101);
101
+ // EXTERNAL MODULE: ./src/core/helpers/utils/utils.ts
102
+ var utils = __webpack_require__(51976);
103
+ // EXTERNAL MODULE: ./src/core/global.ts
104
+ var global = __webpack_require__(58299);
105
+ // EXTERNAL MODULE: ./src/core/dom/dom.ts
106
+ var dom = __webpack_require__(43887);
107
+ // EXTERNAL MODULE: ./src/core/decorators/debounce/debounce.ts
108
+ var debounce = __webpack_require__(1509);
109
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/exec-spell-command.ts
150
110
  /*!
151
111
  * Jodit Editor (https://xdsoft.net/jodit/)
152
112
  * Released under MIT see LICENSE.txt in the project root for license information.
153
113
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
154
114
  */
155
- Object.defineProperty(exports, "__esModule", ({ value: true }));
156
- exports.WARN = exports.PII = void 0;
157
- exports.PII = 440;
158
- exports.WARN = 940;
159
-
160
-
161
- /***/ }),
162
-
163
- /***/ 43467:
164
- /***/ (function(__unused_webpack_module, exports) {
165
-
166
- "use strict";
115
+ function execSpellCommand(jodit, commandSentence) {
116
+ const [command, value] = commandSentence.split('::');
117
+ jodit.execCommand(command, null, value);
118
+ }
167
119
 
120
+ // EXTERNAL MODULE: ./src/config.ts
121
+ var config = __webpack_require__(27537);
122
+ // EXTERNAL MODULE: ./src/core/helpers/utils/data-bind.ts
123
+ var data_bind = __webpack_require__(70774);
124
+ // EXTERNAL MODULE: ./src/core/helpers/checker/is-boolean.ts
125
+ var is_boolean = __webpack_require__(65131);
126
+ // EXTERNAL MODULE: ./src/core/ui/icon.ts
127
+ var icon = __webpack_require__(76381);
128
+ // EXTERNAL MODULE: ./src/core/event-emitter/eventify.ts
129
+ var eventify = __webpack_require__(99437);
130
+ // EXTERNAL MODULE: ./src/core/decorators/index.ts + 8 modules
131
+ var decorators = __webpack_require__(63345);
132
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/constants.ts
168
133
  /*!
169
134
  * Jodit Editor (https://xdsoft.net/jodit/)
170
135
  * Released under MIT see LICENSE.txt in the project root for license information.
171
136
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
172
137
  */
173
- Object.defineProperty(exports, "__esModule", ({ value: true }));
174
- exports.SpeechRecognition = void 0;
175
- exports.SpeechRecognition = window.SpeechRecognition ||
176
- window.webkitSpeechRecognition;
177
-
178
-
179
- /***/ }),
180
-
181
- /***/ 99829:
182
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
183
-
184
- "use strict";
138
+ const PII = 440;
139
+ const WARN = 940;
185
140
 
141
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/sound.ts
186
142
  /*!
187
143
  * Jodit Editor (https://xdsoft.net/jodit/)
188
144
  * Released under MIT see LICENSE.txt in the project root for license information.
189
145
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
190
146
  */
191
- Object.defineProperty(exports, "__esModule", ({ value: true }));
192
- exports.execSpellCommand = void 0;
193
- var tslib_1 = __webpack_require__(20255);
194
- function execSpellCommand(jodit, commandSentence) {
195
- var _a = tslib_1.__read(commandSentence.split('::'), 2), command = _a[0], value = _a[1];
196
- jodit.execCommand(command, null, value);
197
- }
198
- exports.execSpellCommand = execSpellCommand;
199
-
200
-
201
- /***/ }),
202
147
 
203
- /***/ 94539:
204
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
205
-
206
- "use strict";
148
+ function sound({ sec = 0.1, frequency = PII, gain = 0.1, type = 'sine' } = {}) {
149
+ if (typeof window.AudioContext === 'undefined' &&
150
+ typeof window.webkitAudioContext === 'undefined') {
151
+ return;
152
+ }
153
+ const context = new (window.AudioContext ||
154
+ window.webkitAudioContext)();
155
+ const vol = context.createGain();
156
+ const osc = context.createOscillator();
157
+ osc.type = type;
158
+ osc.frequency.value = frequency;
159
+ osc.connect(vol);
160
+ vol.connect(context.destination);
161
+ osc.start();
162
+ osc.stop(context.currentTime + sec);
163
+ vol.gain.value = gain;
164
+ }
207
165
 
166
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/recognize-manager.ts
208
167
  /*!
209
168
  * Jodit Editor (https://xdsoft.net/jodit/)
210
169
  * Released under MIT see LICENSE.txt in the project root for license information.
211
170
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
212
171
  */
213
- Object.defineProperty(exports, "__esModule", ({ value: true }));
214
- exports.RecognizeManager = void 0;
215
- var tslib_1 = __webpack_require__(20255);
216
- var eventify_1 = __webpack_require__(99437);
217
- var decorators_1 = __webpack_require__(9901);
218
- var sound_1 = __webpack_require__(87672);
219
- var constants_1 = __webpack_require__(28511);
220
- var RecognizeManager = (function (_super) {
221
- tslib_1.__extends(RecognizeManager, _super);
222
- function RecognizeManager(async, api) {
223
- var _this = _super.call(this) || this;
224
- _this.async = async;
225
- _this._continuous = false;
226
- _this._interimResults = false;
227
- _this.sound = true;
228
- _this._isEnabled = false;
229
- _this._restartTimeout = 0;
230
- _this._onSpeechStart = function (e) {
231
- if (!_this._isEnabled) {
172
+ var RecognizeManager_1;
173
+
174
+
175
+
176
+
177
+
178
+ let RecognizeManager = RecognizeManager_1 = class RecognizeManager extends eventify/* Eventify */.a {
179
+ constructor(async, api) {
180
+ super();
181
+ this.async = async;
182
+ this._continuous = false;
183
+ this._interimResults = false;
184
+ this.sound = true;
185
+ this._isEnabled = false;
186
+ this._restartTimeout = 0;
187
+ this._onSpeechStart = (e) => {
188
+ if (!this._isEnabled) {
232
189
  return;
233
190
  }
234
- _this.async.clearTimeout(_this._restartTimeout);
235
- _this._restartTimeout = _this.async.setTimeout(function () {
236
- _this.restart();
237
- _this.emit('pulse', false);
238
- _this._makeSound(constants_1.WARN);
191
+ this.async.clearTimeout(this._restartTimeout);
192
+ this._restartTimeout = this.async.setTimeout(() => {
193
+ this.restart();
194
+ this.emit('pulse', false);
195
+ this._makeSound(WARN);
239
196
  }, 5000);
240
- _this.emit('pulse', true);
197
+ this.emit('pulse', true);
241
198
  };
242
- _this._progressTimeout = 0;
243
- _this._api = api;
244
- RecognizeManager_1._instances.add(_this);
245
- return _this;
199
+ this._progressTimeout = 0;
200
+ this._api = api;
201
+ RecognizeManager_1._instances.add(this);
202
+ }
203
+ set lang(v) {
204
+ this._lang = v;
205
+ this._api.lang = v;
206
+ }
207
+ get lang() {
208
+ return this._lang;
209
+ }
210
+ set continuous(v) {
211
+ this._continuous = v;
212
+ this._api.continuous = v;
213
+ }
214
+ get continuous() {
215
+ return this._continuous;
246
216
  }
247
- RecognizeManager_1 = RecognizeManager;
248
- Object.defineProperty(RecognizeManager.prototype, "lang", {
249
- get: function () {
250
- return this._lang;
251
- },
252
- set: function (v) {
253
- this._lang = v;
254
- this._api.lang = v;
255
- },
256
- enumerable: false,
257
- configurable: true
258
- });
259
- Object.defineProperty(RecognizeManager.prototype, "continuous", {
260
- get: function () {
261
- return this._continuous;
262
- },
263
- set: function (v) {
264
- this._continuous = v;
265
- this._api.continuous = v;
266
- },
267
- enumerable: false,
268
- configurable: true
269
- });
270
- Object.defineProperty(RecognizeManager.prototype, "interimResults", {
271
- get: function () {
272
- return this._interimResults;
273
- },
274
- set: function (v) {
275
- this._interimResults = v;
276
- this._api.interimResults = v;
277
- },
278
- enumerable: false,
279
- configurable: true
280
- });
281
- RecognizeManager.prototype.destruct = function () {
217
+ set interimResults(v) {
218
+ this._interimResults = v;
219
+ this._api.interimResults = v;
220
+ }
221
+ get interimResults() {
222
+ return this._interimResults;
223
+ }
224
+ destruct() {
282
225
  this.stop();
283
226
  RecognizeManager_1._instances.delete(this);
284
- _super.prototype.destruct.call(this);
285
- };
286
- Object.defineProperty(RecognizeManager.prototype, "isEnabled", {
287
- get: function () {
288
- return this._isEnabled;
289
- },
290
- enumerable: false,
291
- configurable: true
292
- });
293
- RecognizeManager.prototype.start = function () {
294
- var _this = this;
227
+ super.destruct();
228
+ }
229
+ get isEnabled() {
230
+ return this._isEnabled;
231
+ }
232
+ start() {
295
233
  if (this._isEnabled) {
296
234
  return;
297
235
  }
298
236
  this._isEnabled = true;
299
- RecognizeManager_1._instances.forEach(function (instance) {
300
- if (instance !== _this) {
237
+ RecognizeManager_1._instances.forEach(instance => {
238
+ if (instance !== this) {
301
239
  instance.stop();
302
240
  }
303
241
  });
@@ -305,8 +243,8 @@ var RecognizeManager = (function (_super) {
305
243
  this.__on('speechstart', this._onSpeechStart)
306
244
  .__on('error', this._onError)
307
245
  .__on('result', this._onResult);
308
- };
309
- RecognizeManager.prototype.stop = function () {
246
+ }
247
+ stop() {
310
248
  if (!this._isEnabled) {
311
249
  return;
312
250
  }
@@ -321,44 +259,43 @@ var RecognizeManager = (function (_super) {
321
259
  this.async.clearTimeout(this._restartTimeout);
322
260
  this._isEnabled = false;
323
261
  this.emit('pulse', false);
324
- };
325
- RecognizeManager.prototype.toggle = function () {
262
+ }
263
+ toggle() {
326
264
  if (!this._isEnabled) {
327
265
  this.start();
328
266
  }
329
267
  else {
330
268
  this.stop();
331
269
  }
332
- };
333
- RecognizeManager.prototype.restart = function () {
270
+ }
271
+ restart() {
334
272
  this.stop();
335
273
  this.start();
336
- };
337
- RecognizeManager.prototype.__on = function (event, callback) {
274
+ }
275
+ __on(event, callback) {
338
276
  this._api.addEventListener(event, callback);
339
277
  return this;
340
- };
341
- RecognizeManager.prototype.__off = function (event, callback) {
278
+ }
279
+ __off(event, callback) {
342
280
  this._api.removeEventListener(event, callback);
343
281
  return this;
344
- };
345
- RecognizeManager.prototype._onResult = function (e) {
346
- var _this = this;
282
+ }
283
+ _onResult(e) {
347
284
  if (!this._isEnabled) {
348
285
  return;
349
286
  }
350
287
  this.async.clearTimeout(this._progressTimeout);
351
- var resultItem = e.results.item(e.resultIndex);
352
- var transcript = resultItem.item(0).transcript;
353
- var resultHandler = function () {
288
+ const resultItem = e.results.item(e.resultIndex);
289
+ const { transcript } = resultItem.item(0);
290
+ const resultHandler = () => {
354
291
  try {
355
- _this.async.clearTimeout(_this._restartTimeout);
356
- _this.emit('result', transcript);
292
+ this.async.clearTimeout(this._restartTimeout);
293
+ this.emit('result', transcript);
357
294
  }
358
295
  catch (_a) { }
359
- _this.restart();
360
- _this.emit('pulse', false);
361
- _this._makeSound(constants_1.PII);
296
+ this.restart();
297
+ this.emit('pulse', false);
298
+ this._makeSound(PII);
362
299
  };
363
300
  if (resultItem.isFinal === false) {
364
301
  this.emit('progress', transcript);
@@ -366,202 +303,200 @@ var RecognizeManager = (function (_super) {
366
303
  return;
367
304
  }
368
305
  resultHandler();
369
- };
370
- RecognizeManager.prototype._onError = function () {
306
+ }
307
+ _onError() {
371
308
  if (!this._isEnabled) {
372
309
  return;
373
310
  }
374
- this._makeSound(constants_1.WARN);
311
+ this._makeSound(WARN);
375
312
  this.emit('pulse', false);
376
313
  this.restart();
377
- };
378
- RecognizeManager.prototype._makeSound = function (frequency) {
314
+ }
315
+ _makeSound(frequency) {
379
316
  if (this.sound) {
380
- (0, sound_1.sound)({ frequency: frequency });
317
+ sound({ frequency });
381
318
  }
382
- };
383
- var RecognizeManager_1;
384
- RecognizeManager._instances = new Set();
385
- RecognizeManager = RecognizeManager_1 = tslib_1.__decorate([
386
- decorators_1.autobind
387
- ], RecognizeManager);
388
- return RecognizeManager;
389
- }(eventify_1.Eventify));
390
- exports.RecognizeManager = RecognizeManager;
391
-
392
-
393
- /***/ }),
394
-
395
- /***/ 87672:
396
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
319
+ }
320
+ };
321
+ RecognizeManager._instances = new Set();
322
+ RecognizeManager = RecognizeManager_1 = (0,tslib_es6/* __decorate */.gn)([
323
+ decorators.autobind
324
+ ], RecognizeManager);
397
325
 
398
- "use strict";
399
326
 
327
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/helpers/api.ts
400
328
  /*!
401
329
  * Jodit Editor (https://xdsoft.net/jodit/)
402
330
  * Released under MIT see LICENSE.txt in the project root for license information.
403
331
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
404
332
  */
405
- Object.defineProperty(exports, "__esModule", ({ value: true }));
406
- exports.sound = void 0;
407
- var constants_1 = __webpack_require__(28511);
408
- function sound(_a) {
409
- var _b = _a === void 0 ? {} : _a, _c = _b.sec, sec = _c === void 0 ? 0.1 : _c, _d = _b.frequency, frequency = _d === void 0 ? constants_1.PII : _d, _e = _b.gain, gain = _e === void 0 ? 0.1 : _e, _f = _b.type, type = _f === void 0 ? 'sine' : _f;
410
- if (typeof window.AudioContext === 'undefined' &&
411
- typeof window.webkitAudioContext === 'undefined') {
412
- return;
413
- }
414
- var context = new (window.AudioContext ||
415
- window.webkitAudioContext)();
416
- var vol = context.createGain();
417
- var osc = context.createOscillator();
418
- osc.type = type;
419
- osc.frequency.value = frequency;
420
- osc.connect(vol);
421
- vol.connect(context.destination);
422
- osc.start();
423
- osc.stop(context.currentTime + sec);
424
- vol.gain.value = gain;
425
- }
426
- exports.sound = sound;
427
-
428
-
429
- /***/ }),
430
-
431
- /***/ 86937:
432
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
433
-
434
- "use strict";
333
+ const SpeechRecognition = window.SpeechRecognition ||
334
+ window.webkitSpeechRecognition;
435
335
 
336
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/config.ts
436
337
  /*!
437
338
  * Jodit Editor (https://xdsoft.net/jodit/)
438
339
  * Released under MIT see LICENSE.txt in the project root for license information.
439
340
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
440
341
  */
441
- Object.defineProperty(exports, "__esModule", ({ value: true }));
442
- exports.zh_tw = exports.zh_cn = exports.tr = exports.ru = exports.pt_br = exports.pl = exports.nl = exports.ko = exports.ja = exports.it = exports.id = exports.hu = exports.he = exports.fr = exports.fa = exports.es = exports.de = exports.cs_cz = exports.ar = void 0;
443
- var ar = __webpack_require__(5466);
444
- exports.ar = ar;
445
- var cs_cz = __webpack_require__(65226);
446
- exports.cs_cz = cs_cz;
447
- var de = __webpack_require__(87541);
448
- exports.de = de;
449
- var es = __webpack_require__(87104);
450
- exports.es = es;
451
- var fa = __webpack_require__(53808);
452
- exports.fa = fa;
453
- var fr = __webpack_require__(48954);
454
- exports.fr = fr;
455
- var he = __webpack_require__(14694);
456
- exports.he = he;
457
- var hu = __webpack_require__(67381);
458
- exports.hu = hu;
459
- var id = __webpack_require__(99549);
460
- exports.id = id;
461
- var it = __webpack_require__(28428);
462
- exports.it = it;
463
- var ja = __webpack_require__(25363);
464
- exports.ja = ja;
465
- var ko = __webpack_require__(96929);
466
- exports.ko = ko;
467
- var nl = __webpack_require__(58499);
468
- exports.nl = nl;
469
- var pl = __webpack_require__(59430);
470
- exports.pl = pl;
471
- var pt_br = __webpack_require__(70297);
472
- exports.pt_br = pt_br;
473
- var ru = __webpack_require__(98949);
474
- exports.ru = ru;
475
- var tr = __webpack_require__(61232);
476
- exports.tr = tr;
477
- var zh_cn = __webpack_require__(56775);
478
- exports.zh_cn = zh_cn;
479
- var zh_tw = __webpack_require__(97957);
480
- exports.zh_tw = zh_tw;
481
342
 
482
343
 
483
- /***/ }),
484
344
 
485
- /***/ 40256:
486
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
487
345
 
488
- "use strict";
489
346
 
347
+
348
+ config/* Config.prototype.speechRecognize */.D.prototype.speechRecognize = {
349
+ api: SpeechRecognition,
350
+ sound: true,
351
+ continuous: true,
352
+ interimResults: true,
353
+ commands: {
354
+ 'newline|enter': 'enter',
355
+ 'delete|remove word|delete word': 'backspaceWordButton',
356
+ comma: 'inserthtml::,',
357
+ underline: 'inserthtml::_',
358
+ hyphen: 'inserthtml::-',
359
+ space: 'inserthtml:: ',
360
+ question: 'inserthtml::?',
361
+ dot: 'inserthtml::.',
362
+ 'quote|quotes|open quote': "inserthtml::'",
363
+ 'header|header h1': 'formatblock::h1',
364
+ 'select all': 'selectall'
365
+ }
366
+ };
367
+ icon/* Icon.set */.J.set('speech-recognize', __webpack_require__(90327));
368
+ config/* Config.prototype.controls.speechRecognize */.D.prototype.controls.speechRecognize = {
369
+ isActive(jodit, _) {
370
+ const api = (0,data_bind/* dataBind */.q)(jodit, 'speech');
371
+ return Boolean(api === null || api === void 0 ? void 0 : api.isEnabled);
372
+ },
373
+ isDisabled(jodit) {
374
+ return !jodit.o.speechRecognize.api;
375
+ },
376
+ exec(jodit, current, { button, control }) {
377
+ const { api: Api, lang, continuous, interimResults, sound } = jodit.o.speechRecognize;
378
+ if (!Api) {
379
+ jodit.alert('Speech recognize API unsupported in your browser');
380
+ return;
381
+ }
382
+ let api = (0,data_bind/* dataBind */.q)(jodit, 'speech');
383
+ if (!api) {
384
+ const nativeApi = new Api();
385
+ api = new RecognizeManager(jodit.async, nativeApi);
386
+ api.lang = lang;
387
+ api.continuous = continuous;
388
+ api.interimResults = interimResults;
389
+ api.sound = sound;
390
+ (0,data_bind/* dataBind */.q)(jodit, 'speech', api);
391
+ api.on('pulse', (enable) => {
392
+ button.setMod('pulse', enable);
393
+ });
394
+ api.on('result', (text) => jodit.e.fire('speechRecognizeResult', text));
395
+ api.on('progress', (text) => jodit.e.fire('speechRecognizeProgressResult', text));
396
+ button.hookStatus('beforeDestruct', () => {
397
+ api.destruct();
398
+ });
399
+ }
400
+ if (control.args) {
401
+ const key = control.args[0];
402
+ if ((0,is_boolean/* isBoolean */.j)(api[key])) {
403
+ api[key] = !api[key];
404
+ if (api.isEnabled) {
405
+ api.restart();
406
+ }
407
+ return;
408
+ }
409
+ }
410
+ api.toggle();
411
+ button.state.activated = api.isEnabled;
412
+ },
413
+ name: 'speechRecognize',
414
+ command: 'toggleSpeechRecognize',
415
+ tooltip: 'Speech Recognize',
416
+ list: {
417
+ sound: 'Sound',
418
+ interimResults: 'Interim Results'
419
+ },
420
+ childTemplate(jodit, key, value) {
421
+ var _a;
422
+ const 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];
423
+ return `<span class='jodit-speech-recognize__list-item'><input ${checked ? 'checked' : ''} class='jodit-checkbox' type='checkbox'>&nbsp;${value}</span>`;
424
+ },
425
+ mods: {
426
+ stroke: false
427
+ }
428
+ };
429
+
430
+ ;// CONCATENATED MODULE: ./src/plugins/speech-recognize/speech-recognize.ts
490
431
  /*!
491
432
  * Jodit Editor (https://xdsoft.net/jodit/)
492
433
  * Released under MIT see LICENSE.txt in the project root for license information.
493
434
  * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
494
435
  */
495
- Object.defineProperty(exports, "__esModule", ({ value: true }));
496
- exports.SpeechRecognizeNative = void 0;
497
- var tslib_1 = __webpack_require__(20255);
498
- __webpack_require__(57368);
499
- var plugin_1 = __webpack_require__(35570);
500
- var watch_1 = __webpack_require__(44101);
501
- var utils_1 = __webpack_require__(51976);
502
- var global_1 = __webpack_require__(58299);
503
- var dom_1 = __webpack_require__(43887);
504
- var debounce_1 = __webpack_require__(1509);
505
- var exec_spell_command_1 = __webpack_require__(99829);
506
- __webpack_require__(38587);
507
- var SpeechRecognizeNative = (function (_super) {
508
- tslib_1.__extends(SpeechRecognizeNative, _super);
509
- function SpeechRecognizeNative(j) {
510
- var _this = _super.call(this, j) || this;
511
- _this._commandToWord = {};
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+ class SpeechRecognizeNative extends core_plugin/* Plugin */.S {
447
+ constructor(j) {
448
+ super(j);
449
+ this._commandToWord = {};
512
450
  if (j.o.speechRecognize.api) {
513
451
  j.registerButton({
514
452
  group: 'state',
515
453
  name: 'speechRecognize'
516
454
  });
517
455
  }
518
- return _this;
519
456
  }
520
- SpeechRecognizeNative.prototype.afterInit = function (jodit) {
521
- var _this = this;
522
- var commands = jodit.o.speechRecognize.commands;
457
+ afterInit(jodit) {
458
+ const { commands } = jodit.o.speechRecognize;
523
459
  if (commands) {
524
- (0, global_1.extendLang)(__webpack_require__(86937));
525
- (0, utils_1.keys)(commands, false).forEach(function (words) {
526
- var keys = words.split('|');
527
- keys.forEach(function (key) {
460
+ (0,global/* extendLang */.xl)(__webpack_require__(86937));
461
+ (0,utils/* keys */.XP)(commands, false).forEach(words => {
462
+ const keys = words.split('|');
463
+ keys.forEach(key => {
528
464
  key = key.trim().toLowerCase();
529
- _this._commandToWord[key] = commands[words];
530
- var translatedKeys = jodit.i18n(key);
465
+ this._commandToWord[key] = commands[words];
466
+ const translatedKeys = jodit.i18n(key);
531
467
  if (translatedKeys !== key) {
532
- translatedKeys.split('|').forEach(function (translatedKey) {
533
- _this._commandToWord[translatedKey.trim().toLowerCase()] = commands[words].trim();
468
+ translatedKeys.split('|').forEach(translatedKey => {
469
+ this._commandToWord[translatedKey.trim().toLowerCase()] = commands[words].trim();
534
470
  });
535
471
  }
536
472
  });
537
473
  });
538
474
  }
539
- };
540
- SpeechRecognizeNative.prototype.beforeDestruct = function (jodit) { };
541
- SpeechRecognizeNative.prototype.onSpeechRecognizeProgressResult = function (text) {
542
- var _this = this;
475
+ }
476
+ beforeDestruct(jodit) { }
477
+ onSpeechRecognizeProgressResult(text) {
543
478
  if (!this.messagePopup) {
544
479
  this.messagePopup = this.j.create.div('jodit-speech-recognize__popup');
545
480
  }
546
481
  this.j.workplace.appendChild(this.messagePopup);
547
- this.j.async.setTimeout(function () {
548
- dom_1.Dom.safeRemove(_this.messagePopup);
482
+ this.j.async.setTimeout(() => {
483
+ dom/* Dom.safeRemove */.i.safeRemove(this.messagePopup);
549
484
  }, {
550
485
  label: 'onSpeechRecognizeProgressResult',
551
486
  timeout: 1000
552
487
  });
553
488
  this.messagePopup.innerText = text + '|';
554
- };
555
- SpeechRecognizeNative.prototype.onSpeechRecognizeResult = function (text) {
556
- var j = this.j, s = j.s;
557
- dom_1.Dom.safeRemove(this.messagePopup);
489
+ }
490
+ onSpeechRecognizeResult(text) {
491
+ const { j } = this, { s } = j;
492
+ dom/* Dom.safeRemove */.i.safeRemove(this.messagePopup);
558
493
  if (!this._checkCommand(text)) {
559
- var range = s.range, node = s.current();
494
+ const { range } = s, node = s.current();
560
495
  if (s.isCollapsed() &&
561
- dom_1.Dom.isText(node) &&
562
- dom_1.Dom.isOrContains(j.editor, node) &&
496
+ dom/* Dom.isText */.i.isText(node) &&
497
+ dom/* Dom.isOrContains */.i.isOrContains(j.editor, node) &&
563
498
  node.nodeValue) {
564
- var sentence = node.nodeValue;
499
+ const sentence = node.nodeValue;
565
500
  node.nodeValue =
566
501
  sentence +
567
502
  (/[\u00A0 ]\uFEFF*$/.test(sentence) ? '' : ' ') +
@@ -574,25 +509,23 @@ var SpeechRecognizeNative = (function (_super) {
574
509
  s.insertHTML(text);
575
510
  }
576
511
  }
577
- };
578
- SpeechRecognizeNative.prototype._checkCommand = function (command) {
512
+ }
513
+ _checkCommand(command) {
579
514
  command = command.toLowerCase().replace(/\./g, '');
580
515
  if (this._commandToWord[command]) {
581
- (0, exec_spell_command_1.execSpellCommand)(this.j, this._commandToWord[command]);
516
+ execSpellCommand(this.j, this._commandToWord[command]);
582
517
  return true;
583
518
  }
584
519
  return false;
585
- };
586
- tslib_1.__decorate([
587
- (0, watch_1.watch)(':speechRecognizeProgressResult'),
588
- (0, debounce_1.debounce)()
589
- ], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
590
- tslib_1.__decorate([
591
- (0, watch_1.watch)(':speechRecognizeResult')
592
- ], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
593
- return SpeechRecognizeNative;
594
- }(plugin_1.Plugin));
595
- exports.SpeechRecognizeNative = SpeechRecognizeNative;
520
+ }
521
+ }
522
+ (0,tslib_es6/* __decorate */.gn)([
523
+ (0,watch/* watch */.YP)(':speechRecognizeProgressResult'),
524
+ (0,debounce/* debounce */.D)()
525
+ ], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
526
+ (0,tslib_es6/* __decorate */.gn)([
527
+ (0,watch/* watch */.YP)(':speechRecognizeResult')
528
+ ], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
596
529
  if (typeof Jodit !== 'undefined') {
597
530
  Jodit.plugins.add('speech-recognize', SpeechRecognizeNative);
598
531
  }
@@ -1002,7 +935,7 @@ module.exports = {
1002
935
  },
1003
936
  /******/ function(__webpack_require__) { // webpackRuntimeModules
1004
937
  /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
1005
- /******/ var __webpack_exports__ = (__webpack_exec__(40256));
938
+ /******/ var __webpack_exports__ = (__webpack_exec__(56949));
1006
939
  /******/ return __webpack_exports__;
1007
940
  /******/ }
1008
941
  ]);