jodit 4.19.9 → 4.19.11

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 (78) hide show
  1. package/CHANGELOG.md +145 -131
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +19 -19
  4. package/es2015/jodit.js +1222 -1033
  5. package/es2015/jodit.min.js +19 -19
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +8 -8
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  12. package/es2018/jodit.fat.min.js +19 -19
  13. package/es2018/jodit.min.js +19 -19
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +26 -26
  18. package/es2021/jodit.js +1216 -1027
  19. package/es2021/jodit.min.js +26 -26
  20. package/es2021/plugins/debug/debug.css +1 -1
  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 +8 -8
  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.fat.min.js +28 -28
  28. package/es2021.en/jodit.js +1216 -1027
  29. package/es2021.en/jodit.min.js +28 -28
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +8 -8
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +1299 -1046
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +8 -8
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/dom/dom.js +2 -2
  52. package/esm/core/helpers/checker/is-html-from-word.d.ts +4 -3
  53. package/esm/core/helpers/checker/is-html-from-word.js +94 -14
  54. package/esm/core/helpers/checker/is-html.d.ts +4 -0
  55. package/esm/core/helpers/checker/is-html.js +54 -2
  56. package/esm/core/helpers/html/apply-styles.js +20 -11
  57. package/esm/core/helpers/html/clean-from-word.js +2 -3
  58. package/esm/core/helpers/html/index.d.ts +1 -0
  59. package/esm/core/helpers/html/index.js +1 -0
  60. package/esm/core/helpers/html/tag-scan.d.ts +36 -0
  61. package/esm/core/helpers/html/tag-scan.js +257 -0
  62. package/esm/core/helpers/string/trim.d.ts +4 -0
  63. package/esm/core/helpers/string/trim.js +29 -10
  64. package/esm/core/selection/helpers/index.js +3 -2
  65. package/esm/jodit.js +2 -1
  66. package/esm/plugins/delete/delete.d.ts +6 -0
  67. package/esm/plugins/delete/delete.js +61 -2
  68. package/esm/plugins/iframe/iframe.js +59 -12
  69. package/esm/plugins/media/media.js +2 -4
  70. package/esm/plugins/paste/helpers.js +4 -2
  71. package/esm/plugins/resizer/resizer.js +2 -4
  72. package/package.json +1 -1
  73. package/types/core/helpers/checker/is-html-from-word.d.ts +4 -3
  74. package/types/core/helpers/checker/is-html.d.ts +4 -0
  75. package/types/core/helpers/html/index.d.ts +1 -0
  76. package/types/core/helpers/html/tag-scan.d.ts +36 -0
  77. package/types/core/helpers/string/trim.d.ts +4 -0
  78. package/types/plugins/delete/delete.d.ts +6 -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.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -232,7 +232,7 @@ function execSpellCommand(jodit, commandSentence) {
232
232
  /* harmony import */ var _swc_helpers_get__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22248);
233
233
  /* harmony import */ var _swc_helpers_get_prototype_of__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(66773);
234
234
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(34918);
235
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31635);
235
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(62445);
236
236
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84839);
237
237
  /* harmony import */ var jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(60216);
238
238
  /* harmony import */ var _sound__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(32560);
@@ -455,13 +455,13 @@ var RecognizeManager = /*#__PURE__*/ function(Eventify) {
455
455
  return RecognizeManager;
456
456
  }(jodit_core_event_emitter_eventify__WEBPACK_IMPORTED_MODULE_9__.Eventify);
457
457
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(RecognizeManager, "_instances", new Set());
458
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
458
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__._)([
459
459
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
460
460
  ], RecognizeManager.prototype, "_onResults", null);
461
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
461
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__._)([
462
462
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
463
463
  ], RecognizeManager.prototype, "_onProgress", null);
464
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorate)([
464
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__._)([
465
465
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_8__.autobind
466
466
  ], RecognizeManager.prototype, "_onError", null);
467
467
 
@@ -1128,7 +1128,7 @@ __webpack_require__.r(__webpack_exports__);
1128
1128
  /* harmony import */ var _swc_helpers_create_class__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(53429);
1129
1129
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25045);
1130
1130
  /* harmony import */ var _swc_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(34918);
1131
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31635);
1131
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(62445);
1132
1132
  /* harmony import */ var _swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(38574);
1133
1133
  /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(68616);
1134
1134
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(23211);
@@ -1258,10 +1258,10 @@ var SpeechRecognizeNative = /*#__PURE__*/ function(Plugin) {
1258
1258
  ]);
1259
1259
  return SpeechRecognizeNative;
1260
1260
  }((0,_swc_helpers_wrap_native_super__WEBPACK_IMPORTED_MODULE_6__._)(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_11__.Plugin));
1261
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
1261
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
1262
1262
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)(':speechRecognizeProgressResult')
1263
1263
  ], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
1264
- (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__.__decorate)([
1264
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_5__._)([
1265
1265
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_7__.watch)(':speechRecognizeResult')
1266
1266
  ], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
1267
1267
  _jodit__WEBPACK_IMPORTED_MODULE_13__.Jodit.plugins.add('speech-recognize', SpeechRecognizeNative);
@@ -1,8 +1,8 @@
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.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{75143:function(e,t,n){"use strict";var i=n(22289),o=n(85932),s=n(7909),r=n(36400),u=n(29434),c=n(5266),a=n(97743),l=n(68097),p=n(22227),d=n.n(p);c.Config.prototype.speechRecognize={api:void 0!==a.SpeechRecognition?a.SpeechRecognition:null,sound:!0,continuous:!1,interimResults:!0,commands:{"newline|enter":"enter","delete|remove word|delete word":"backspaceWordButton",comma:"inserthtml::,",underline:"inserthtml::_",hyphen:"inserthtml::-",space:"inserthtml:: ",question:"inserthtml::?",dot:"inserthtml::.","quote|quotes|open quote":"inserthtml::'","header|header h1":"formatblock::h1","select all":"selectall"}},u.Icon.set("speech-recognize",d()),c.Config.prototype.controls.speechRecognize={isVisible:function(e){return!!e.o.speechRecognize.api},isActive:function(e,t){var n=(0,r.dataBind)(e,"speech");return!!(null==n?void 0:n.isEnabled)},isDisabled:function(e){return!e.o.speechRecognize.api},exec:function(e,t,n){var u=n.button,c=n.control,a=e.o.speechRecognize,p=a.api,d=a.lang,h=a.continuous,f=a.interimResults,m=a.sound;if(!p)return void e.alert("Speech recognize API unsupported in your browser");var _=(0,r.dataBind)(e,"speech");if(!_){var g,R=new p;(_=new l.RecognizeManager(e.async,R)).lang=(0,o.isString)(d)?d:null!=(g=(0,s.attr)(e.od.documentElement,"lang"))?g:void 0,_.continuous=h,_.interimResults=f,_.sound=m,(0,r.dataBind)(e,"speech",_),_.on("pulse",function(e){u.setMod("pulse",e)}),_.on("result",function(t){return e.e.fire("speechRecognizeResult",t)}),_.on("progress",function(t){return e.e.fire("speechRecognizeProgressResult",t)}),_.on("error",function(t){return e.message.error(t)}),e.hookStatus("beforeDestruct",function(){(0,r.dataBind)(e,"speech",null),_.destruct()})}if(c.args){var v=c.args[0];if((0,i.isBoolean)(_[v])){_[v]=!_[v],_.isEnabled&&_.restart();return}}_.toggle(),_.isEnabled&&u.setMod("pulse",!0),u.state.activated=_.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate:function(e,t,n){var i,o=(0,r.dataBind)(e,"speech"),s=null!=(i=null==o?void 0:o[t])?i:e.o.speechRecognize[t];return"<span class='jodit-speech-recognize__list-item'><input ".concat(s?"checked":""," class='jodit-checkbox' type='checkbox'>&nbsp;").concat(n,"</span>")},mods:{stroke:!1}}},94092:function(e,t,n){"use strict";n.d(t,{PII:function(){return i},WARN:function(){return o}});var i=440,o=940},97743:function(e,t,n){"use strict";n.d(t,{SpeechRecognition:function(){return o}});var i=n(81937),o=i.globalWindow?i.globalWindow.SpeechRecognition||i.globalWindow.webkitSpeechRecognition:void 0},8962:function(e,t,n){"use strict";n.d(t,{execSpellCommand:function(){return o}});var i=n(50684);function o(e,t){var n=(0,i._)(t.split("::"),2),o=n[0],s=n[1];"open"===o.toLowerCase()&&s&&/^(javascript:|data:|vbscript:)/i.test(s.trim())||e.execCommand(o,null,s)}},68097:function(e,t,n){"use strict";n.d(t,{RecognizeManager:function(){return m}});var i=n(69262),o=n(73104),s=n(53429),r=n(25045),u=n(22248),c=n(66773),a=n(34918),l=n(31635),p=n(84839),d=n(60216),h=n(32560),f=n(94092),m=function(e){function t(e,n){var s;return(0,o._)(this,t),s=(0,i._)(this,t),(0,r._)(s,"async",void 0),(0,r._)(s,"_lang",void 0),(0,r._)(s,"_continuous",void 0),(0,r._)(s,"_interimResults",void 0),(0,r._)(s,"sound",void 0),(0,r._)(s,"_isEnabled",void 0),(0,r._)(s,"_restartTimeout",void 0),(0,r._)(s,"_onSpeechStart",void 0),(0,r._)(s,"_api",void 0),(0,r._)(s,"__interimResults",void 0),s.async=e,s._continuous=!1,s._interimResults=!1,s.sound=!0,s._isEnabled=!1,s._restartTimeout=0,s._onSpeechStart=function(e){s._isEnabled&&(s.async.clearTimeout(s._restartTimeout),s._restartTimeout=s.async.setTimeout(function(){s.restart(),s.emit("pulse",!1),s._makeSound(f.WARN)},5e3),s.emit("pulse",!0))},s.__interimResults="",s._api=n,t._instances.add(s),s}return(0,a._)(t,e),(0,s._)(t,[{key:"lang",get:function(){return this._lang},set:function(e){this._lang=e,this._api.lang=e}},{key:"continuous",get:function(){return this._continuous},set:function(e){this._continuous=e,this._api.continuous=e}},{key:"interimResults",get:function(){return this._interimResults},set:function(e){this._interimResults=e,this._api.interimResults=e}},{key:"destruct",value:function(){this.stop(),(0,h.closeSound)(this),t._instances.delete(this),(0,u._)((0,c._)(t.prototype),"destruct",this).call(this)}},{key:"isEnabled",get:function(){return this._isEnabled}},{key:"start",value:function(){var e=this;if(!this._isEnabled){this._isEnabled=!0,t._instances.forEach(function(t){t!==e&&t.stop()});try{this._api.start()}catch(e){this._onError(e),this.stop();return}this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onProgress).__on("end",this._onResults)}}},{key:"stop",value:function(){this._isEnabled&&(this._api.abort(),this._api.stop(),this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onProgress).__off("end",this._onResults),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1))}},{key:"toggle",value:function(){this._isEnabled?this.stop():this.start()}},{key:"restart",value:function(){this.stop(),this.start()}},{key:"__on",value:function(e,t){return this._api.addEventListener(e,t),this}},{key:"__off",value:function(e,t){return this._api.removeEventListener(e,t),this}},{key:"_onResults",value:function(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(f.PII),this.restart()}},{key:"_onProgress",value:function(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(var t=0;t<e.results.length;t++){var n=e.results.item(t);if(n.length){var i=n.item(0).transcript;this.__interimResults+=i}}this.__interimResults&&this.emit("progress",this.__interimResults)}}},{key:"_onError",value:function(e){"voice-unavailable"===e.error&&this.emit("error","Voice unavailable"),"not-allowed"===e.error&&this.emit("error","Not allowed"),("language-unavailable"===e.error||"language-not-supported"===e.error)&&this.emit("error","Language unavailable"),this._makeSound(f.WARN),this.emit("pulse",!1),this.stop()}},{key:"_makeSound",value:function(e){this.sound&&(0,h.sound)(this,{frequency:e})}}]),t}(d.Eventify);(0,r._)(m,"_instances",new Set),(0,l.__decorate)([p.autobind],m.prototype,"_onResults",null),(0,l.__decorate)([p.autobind],m.prototype,"_onProgress",null),(0,l.__decorate)([p.autobind],m.prototype,"_onError",null)},32560:function(e,t,n){"use strict";n.d(t,{closeSound:function(){return u},sound:function(){return r}});var i=n(81937),o=n(94092),s=new WeakMap;function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sec,r=t.frequency,u=void 0===r?o.PII:r,c=t.gain,a=t.type,l=function(e){if(!i.globalWindow)return null;var t=s.get(e);if(t&&"closed"!==t.state)return t;var n=i.globalWindow.AudioContext||i.globalWindow.webkitAudioContext;if(!n)return null;var o=new n;return s.set(e,o),o}(e);if(l){var p=l.createGain(),d=l.createOscillator();d.type=void 0===a?"sine":a,d.frequency.value=u,p.gain.value=void 0===c?.1:c,d.connect(p),p.connect(l.destination),d.start(),d.stop(l.currentTime+(void 0===n?.1:n))}}function u(e){var t=s.get(e);t&&(s.delete(e),"closed"!==t.state&&t.close())}},19922:function(e){e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},20759:function(e){e.exports={newline:"ř\xe1dek",delete:"odstranit",space:"prostora","Speech Recognize":"Rozpozn\xe1n\xed Řeči",Sound:"Zvuk","Interim Results":"Průběžn\xe9 V\xfdsledky"}},22350:function(e){e.exports={newline:"Zeilenumbruch",delete:"l\xf6schen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},97509:function(e){e.exports={newline:"nueva l\xednea",delete:"eliminar",space:"espacio","Speech Recognize":"Reconocimiento de Voz",Sound:"Sonido","Interim Results":"Resultados Provisionales"}},49668:function(e){e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},33276:function(e){e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"\xc4\xe4ni","Interim Results":"V\xe4litulokset"}},43517:function(e){e.exports={newline:"nouvelle ligne",delete:"supprimer",space:"espace","Speech Recognize":"Reconnaissance Vocale",Sound:"Son","Interim Results":"R\xe9sultats Interm\xe9diaires"}},8858:function(e){e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},22922:function(e){e.exports={newline:"\xfajsor",delete:"t\xf6rl\xe9s",space:"t\xe9r","Speech Recognize":"A Besz\xe9d Felismeri",Sound:"Hang","Interim Results":"Idők\xf6zi Eredm\xe9nyek"}},81900:function(e){e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},43219:function(e,t,n){"use strict";n.r(t),n.d(t,{ar:function(){return i||(i=n.t(I,2))},cs_cz:function(){return o||(o=n.t(E,2))},de:function(){return s||(s=n.t(P,2))},es:function(){return r||(r=n.t(T,2))},fa:function(){return u||(u=n.t(j,2))},fi:function(){return c||(c=n.t(C,2))},fr:function(){return a||(a=n.t(W,2))},he:function(){return l||(l=n.t(D,2))},hu:function(){return p||(p=n.t(A,2))},id:function(){return d||(d=n.t(M,2))},it:function(){return h||(h=n.t(L,2))},ja:function(){return f||(f=n.t(V,2))},ko:function(){return m||(m=n.t(B,2))},mn:function(){return _||(_=n.t(q,2))},nl:function(){return g||(g=n.t(H,2))},no:function(){return R||(R=n.t(N,2))},pl:function(){return v||(v=n.t(F,2))},pt_br:function(){return S||(S=n.t(Z,2))},ru:function(){return z||(z=n.t(O,2))},sk:function(){return w||(w=n.t(G,2))},tr:function(){return k||(k=n.t(J,2))},ua:function(){return y||(y=n.t(K,2))},zh_cn:function(){return b||(b=n.t($,2))},zh_tw:function(){return x||(x=n.t(Q,2))}});var i,o,s,r,u,c,a,l,p,d,h,f,m,_,g,R,v,S,z,w,k,y,b,x,I=n(19922),E=n(20759),P=n(22350),T=n(97509),j=n(49668),C=n(33276),W=n(43517),D=n(8858),A=n(22922),M=n(81900),L=n(35420),V=n(18712),B=n(73363),q=n(74762),H=n(73759),N=n(72850),F=n(37161),Z=n(62896),O=n(39996),G=n(62415),J=n(93423),K=n(10179),$=n(62547),Q=n(29475)},35420:function(e){e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},18712:function(e){e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},73363:function(e){e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},74762:function(e){e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},73759:function(e){e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},72850:function(e){e.exports={newline:"nylinje",delete:"slette",space:"rom","Speech Recognize":"Talegjenkjenning",Sound:"Lyd","Interim Results":"Midlertidige resultater"}},37161:function(e){e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},62896:function(e){e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provis\xf3rios"}},39996:function(e){e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},62415:function(e){e.exports={newline:"nov\xfd riadok",delete:"vymazať",space:"medzera","Speech Recognize":"Rozpozn\xe1vanie reči",Sound:"Zvuk","Interim Results":"Predbežn\xe9 v\xfdsledky"}},93423:function(e){e.exports={newline:"yeni satır",delete:"silmek",space:"uzay","Speech Recognize":"Konuşma Tanıma",Sound:"Ses","Interim Results":"Ara Sonu\xe7lar"}},10179:function(e){e.exports={newline:"новая строка|перенос|ентер",delete:"видалити",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Проміжні результати"}},62547:function(e){e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},29475:function(e){e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},31262:function(e,t,n){"use strict";n.r(t),n.d(t,{SpeechRecognizeNative:function(){return R}});var i=n(69262),o=n(73104),s=n(53429),r=n(25045),u=n(34918),c=n(31635),a=n(38574),l=n(68616),p=n(23211),d=n(28077),h=n(71125),f=n(91206);n(75143);var m=n(73302),_=n(8962),g=n(43219),R=function(e){function t(){var e;return(0,o._)(this,t),e=(0,i._)(this,t,arguments),(0,r._)(e,"buttons",[{group:"state",name:"speechRecognize"}]),(0,r._)(e,"messagePopup",void 0),(0,r._)(e,"__hidePopupTimeout",void 0),(0,r._)(e,"_commandToWord",{}),e}return(0,u._)(t,e),(0,s._)(t,[{key:"afterInit",value:function(e){var t=this,n=e.o.speechRecognize.commands;n&&((0,d.extendLang)(g),(0,h.keys)(n,!1).forEach(function(i){i.split("|").forEach(function(o){o=o.trim().toLowerCase(),t._commandToWord[o]=n[i];var s=e.i18n(o);s!==o&&s.split("|").forEach(function(e){t._commandToWord[e.trim().toLowerCase()]=n[i].trim()})})}))}},{key:"beforeDestruct",value:function(e){p.Dom.safeRemove(this.messagePopup)}},{key:"onSpeechRecognizeProgressResult",value:function(e){var t=this;this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),p.Dom.append(this.j.workplace,this.messagePopup),this.j.async.clearTimeout(this.__hidePopupTimeout),this.__hidePopupTimeout=this.j.async.setTimeout(function(){p.Dom.safeRemove(t.messagePopup)},1e3),this.messagePopup.innerText=e+"|"}},{key:"onSpeechRecognizeResult",value:function(e){this.j.async.clearTimeout(this.__hidePopupTimeout),p.Dom.safeRemove(this.messagePopup);var t=this.j,n=t.s;if(!this._checkCommand(e)){var i=n.range,o=n.current();if(n.isCollapsed()&&p.Dom.isText(o)&&p.Dom.isOrContains(t.editor,o)&&o.nodeValue){var s=o.nodeValue;o.nodeValue=s+(/[\u00A0 ]\uFEFF*$/.test(s)?"":" ")+e,i.setStartAfter(o),n.selectRange(i),t.synchronizeValues()}else n.insertHTML(e)}}},{key:"_checkCommand",value:function(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,_.execSpellCommand)(this.j,this._commandToWord[e]),!0)}}]),t}((0,a._)(f.Plugin));(0,c.__decorate)([(0,l.watch)(":speechRecognizeProgressResult")],R.prototype,"onSpeechRecognizeProgressResult",null),(0,c.__decorate)([(0,l.watch)(":speechRecognizeResult")],R.prototype,"onSpeechRecognizeResult",null),m.Jodit.plugins.add("speech-recognize",R)},22227:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"> <g fill="none"> <rect x="9" y="2" width="6" height="13" rx="3"/><path d="M5 10v2a7 7 0 0 0 14 0v-2M12 19v3m-4 0h8"/> </g> </svg>'}},function(e){return e(31262)}])});
8
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(self,function(){return(self.webpackChunkjodit=self.webpackChunkjodit||[]).push([[882],{75143:function(e,t,n){"use strict";var i=n(22289),o=n(85932),s=n(7909),r=n(36400),u=n(29434),c=n(5266),a=n(97743),l=n(68097),p=n(22227),d=n.n(p);c.Config.prototype.speechRecognize={api:void 0!==a.SpeechRecognition?a.SpeechRecognition:null,sound:!0,continuous:!1,interimResults:!0,commands:{"newline|enter":"enter","delete|remove word|delete word":"backspaceWordButton",comma:"inserthtml::,",underline:"inserthtml::_",hyphen:"inserthtml::-",space:"inserthtml:: ",question:"inserthtml::?",dot:"inserthtml::.","quote|quotes|open quote":"inserthtml::'","header|header h1":"formatblock::h1","select all":"selectall"}},u.Icon.set("speech-recognize",d()),c.Config.prototype.controls.speechRecognize={isVisible:function(e){return!!e.o.speechRecognize.api},isActive:function(e,t){var n=(0,r.dataBind)(e,"speech");return!!(null==n?void 0:n.isEnabled)},isDisabled:function(e){return!e.o.speechRecognize.api},exec:function(e,t,n){var u=n.button,c=n.control,a=e.o.speechRecognize,p=a.api,d=a.lang,h=a.continuous,f=a.interimResults,m=a.sound;if(!p)return void e.alert("Speech recognize API unsupported in your browser");var _=(0,r.dataBind)(e,"speech");if(!_){var g,R=new p;(_=new l.RecognizeManager(e.async,R)).lang=(0,o.isString)(d)?d:null!=(g=(0,s.attr)(e.od.documentElement,"lang"))?g:void 0,_.continuous=h,_.interimResults=f,_.sound=m,(0,r.dataBind)(e,"speech",_),_.on("pulse",function(e){u.setMod("pulse",e)}),_.on("result",function(t){return e.e.fire("speechRecognizeResult",t)}),_.on("progress",function(t){return e.e.fire("speechRecognizeProgressResult",t)}),_.on("error",function(t){return e.message.error(t)}),e.hookStatus("beforeDestruct",function(){(0,r.dataBind)(e,"speech",null),_.destruct()})}if(c.args){var v=c.args[0];if((0,i.isBoolean)(_[v])){_[v]=!_[v],_.isEnabled&&_.restart();return}}_.toggle(),_.isEnabled&&u.setMod("pulse",!0),u.state.activated=_.isEnabled},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate:function(e,t,n){var i,o=(0,r.dataBind)(e,"speech"),s=null!=(i=null==o?void 0:o[t])?i:e.o.speechRecognize[t];return"<span class='jodit-speech-recognize__list-item'><input ".concat(s?"checked":""," class='jodit-checkbox' type='checkbox'>&nbsp;").concat(n,"</span>")},mods:{stroke:!1}}},94092:function(e,t,n){"use strict";n.d(t,{PII:function(){return i},WARN:function(){return o}});var i=440,o=940},97743:function(e,t,n){"use strict";n.d(t,{SpeechRecognition:function(){return o}});var i=n(81937),o=i.globalWindow?i.globalWindow.SpeechRecognition||i.globalWindow.webkitSpeechRecognition:void 0},8962:function(e,t,n){"use strict";n.d(t,{execSpellCommand:function(){return o}});var i=n(50684);function o(e,t){var n=(0,i._)(t.split("::"),2),o=n[0],s=n[1];"open"===o.toLowerCase()&&s&&/^(javascript:|data:|vbscript:)/i.test(s.trim())||e.execCommand(o,null,s)}},68097:function(e,t,n){"use strict";n.d(t,{RecognizeManager:function(){return m}});var i=n(69262),o=n(73104),s=n(53429),r=n(25045),u=n(22248),c=n(66773),a=n(34918),l=n(62445),p=n(84839),d=n(60216),h=n(32560),f=n(94092),m=function(e){function t(e,n){var s;return(0,o._)(this,t),s=(0,i._)(this,t),(0,r._)(s,"async",void 0),(0,r._)(s,"_lang",void 0),(0,r._)(s,"_continuous",void 0),(0,r._)(s,"_interimResults",void 0),(0,r._)(s,"sound",void 0),(0,r._)(s,"_isEnabled",void 0),(0,r._)(s,"_restartTimeout",void 0),(0,r._)(s,"_onSpeechStart",void 0),(0,r._)(s,"_api",void 0),(0,r._)(s,"__interimResults",void 0),s.async=e,s._continuous=!1,s._interimResults=!1,s.sound=!0,s._isEnabled=!1,s._restartTimeout=0,s._onSpeechStart=function(e){s._isEnabled&&(s.async.clearTimeout(s._restartTimeout),s._restartTimeout=s.async.setTimeout(function(){s.restart(),s.emit("pulse",!1),s._makeSound(f.WARN)},5e3),s.emit("pulse",!0))},s.__interimResults="",s._api=n,t._instances.add(s),s}return(0,a._)(t,e),(0,s._)(t,[{key:"lang",get:function(){return this._lang},set:function(e){this._lang=e,this._api.lang=e}},{key:"continuous",get:function(){return this._continuous},set:function(e){this._continuous=e,this._api.continuous=e}},{key:"interimResults",get:function(){return this._interimResults},set:function(e){this._interimResults=e,this._api.interimResults=e}},{key:"destruct",value:function(){this.stop(),(0,h.closeSound)(this),t._instances.delete(this),(0,u._)((0,c._)(t.prototype),"destruct",this).call(this)}},{key:"isEnabled",get:function(){return this._isEnabled}},{key:"start",value:function(){var e=this;if(!this._isEnabled){this._isEnabled=!0,t._instances.forEach(function(t){t!==e&&t.stop()});try{this._api.start()}catch(e){this._onError(e),this.stop();return}this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onProgress).__on("end",this._onResults)}}},{key:"stop",value:function(){this._isEnabled&&(this._api.abort(),this._api.stop(),this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onProgress).__off("end",this._onResults),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1))}},{key:"toggle",value:function(){this._isEnabled?this.stop():this.start()}},{key:"restart",value:function(){this.stop(),this.start()}},{key:"__on",value:function(e,t){return this._api.addEventListener(e,t),this}},{key:"__off",value:function(e,t){return this._api.removeEventListener(e,t),this}},{key:"_onResults",value:function(e){this.emit("pulse",!1),this.emit("result",this.__interimResults),this.__interimResults="",this._makeSound(f.PII),this.restart()}},{key:"_onProgress",value:function(e){if(this._isEnabled&&(this.__interimResults="",e.results)){for(var t=0;t<e.results.length;t++){var n=e.results.item(t);if(n.length){var i=n.item(0).transcript;this.__interimResults+=i}}this.__interimResults&&this.emit("progress",this.__interimResults)}}},{key:"_onError",value:function(e){"voice-unavailable"===e.error&&this.emit("error","Voice unavailable"),"not-allowed"===e.error&&this.emit("error","Not allowed"),("language-unavailable"===e.error||"language-not-supported"===e.error)&&this.emit("error","Language unavailable"),this._makeSound(f.WARN),this.emit("pulse",!1),this.stop()}},{key:"_makeSound",value:function(e){this.sound&&(0,h.sound)(this,{frequency:e})}}]),t}(d.Eventify);(0,r._)(m,"_instances",new Set),(0,l._)([p.autobind],m.prototype,"_onResults",null),(0,l._)([p.autobind],m.prototype,"_onProgress",null),(0,l._)([p.autobind],m.prototype,"_onError",null)},32560:function(e,t,n){"use strict";n.d(t,{closeSound:function(){return u},sound:function(){return r}});var i=n(81937),o=n(94092),s=new WeakMap;function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.sec,r=t.frequency,u=void 0===r?o.PII:r,c=t.gain,a=t.type,l=function(e){if(!i.globalWindow)return null;var t=s.get(e);if(t&&"closed"!==t.state)return t;var n=i.globalWindow.AudioContext||i.globalWindow.webkitAudioContext;if(!n)return null;var o=new n;return s.set(e,o),o}(e);if(l){var p=l.createGain(),d=l.createOscillator();d.type=void 0===a?"sine":a,d.frequency.value=u,p.gain.value=void 0===c?.1:c,d.connect(p),p.connect(l.destination),d.start(),d.stop(l.currentTime+(void 0===n?.1:n))}}function u(e){var t=s.get(e);t&&(s.delete(e),"closed"!==t.state&&t.close())}},19922:function(e){e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},20759:function(e){e.exports={newline:"ř\xe1dek",delete:"odstranit",space:"prostora","Speech Recognize":"Rozpozn\xe1n\xed Řeči",Sound:"Zvuk","Interim Results":"Průběžn\xe9 V\xfdsledky"}},22350:function(e){e.exports={newline:"Zeilenumbruch",delete:"l\xf6schen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},97509:function(e){e.exports={newline:"nueva l\xednea",delete:"eliminar",space:"espacio","Speech Recognize":"Reconocimiento de Voz",Sound:"Sonido","Interim Results":"Resultados Provisionales"}},49668:function(e){e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},33276:function(e){e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"\xc4\xe4ni","Interim Results":"V\xe4litulokset"}},43517:function(e){e.exports={newline:"nouvelle ligne",delete:"supprimer",space:"espace","Speech Recognize":"Reconnaissance Vocale",Sound:"Son","Interim Results":"R\xe9sultats Interm\xe9diaires"}},8858:function(e){e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},22922:function(e){e.exports={newline:"\xfajsor",delete:"t\xf6rl\xe9s",space:"t\xe9r","Speech Recognize":"A Besz\xe9d Felismeri",Sound:"Hang","Interim Results":"Idők\xf6zi Eredm\xe9nyek"}},81900:function(e){e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},43219:function(e,t,n){"use strict";n.r(t),n.d(t,{ar:function(){return i||(i=n.t(I,2))},cs_cz:function(){return o||(o=n.t(E,2))},de:function(){return s||(s=n.t(P,2))},es:function(){return r||(r=n.t(T,2))},fa:function(){return u||(u=n.t(j,2))},fi:function(){return c||(c=n.t(C,2))},fr:function(){return a||(a=n.t(W,2))},he:function(){return l||(l=n.t(D,2))},hu:function(){return p||(p=n.t(A,2))},id:function(){return d||(d=n.t(M,2))},it:function(){return h||(h=n.t(L,2))},ja:function(){return f||(f=n.t(V,2))},ko:function(){return m||(m=n.t(B,2))},mn:function(){return _||(_=n.t(q,2))},nl:function(){return g||(g=n.t(H,2))},no:function(){return R||(R=n.t(N,2))},pl:function(){return v||(v=n.t(F,2))},pt_br:function(){return S||(S=n.t(Z,2))},ru:function(){return z||(z=n.t(O,2))},sk:function(){return w||(w=n.t(G,2))},tr:function(){return k||(k=n.t(J,2))},ua:function(){return y||(y=n.t(K,2))},zh_cn:function(){return b||(b=n.t($,2))},zh_tw:function(){return x||(x=n.t(Q,2))}});var i,o,s,r,u,c,a,l,p,d,h,f,m,_,g,R,v,S,z,w,k,y,b,x,I=n(19922),E=n(20759),P=n(22350),T=n(97509),j=n(49668),C=n(33276),W=n(43517),D=n(8858),A=n(22922),M=n(81900),L=n(35420),V=n(18712),B=n(73363),q=n(74762),H=n(73759),N=n(72850),F=n(37161),Z=n(62896),O=n(39996),G=n(62415),J=n(93423),K=n(10179),$=n(62547),Q=n(29475)},35420:function(e){e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},18712:function(e){e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},73363:function(e){e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},74762:function(e){e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},73759:function(e){e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},72850:function(e){e.exports={newline:"nylinje",delete:"slette",space:"rom","Speech Recognize":"Talegjenkjenning",Sound:"Lyd","Interim Results":"Midlertidige resultater"}},37161:function(e){e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},62896:function(e){e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provis\xf3rios"}},39996:function(e){e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},62415:function(e){e.exports={newline:"nov\xfd riadok",delete:"vymazať",space:"medzera","Speech Recognize":"Rozpozn\xe1vanie reči",Sound:"Zvuk","Interim Results":"Predbežn\xe9 v\xfdsledky"}},93423:function(e){e.exports={newline:"yeni satır",delete:"silmek",space:"uzay","Speech Recognize":"Konuşma Tanıma",Sound:"Ses","Interim Results":"Ara Sonu\xe7lar"}},10179:function(e){e.exports={newline:"новая строка|перенос|ентер",delete:"видалити",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Проміжні результати"}},62547:function(e){e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},29475:function(e){e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},31262:function(e,t,n){"use strict";n.r(t),n.d(t,{SpeechRecognizeNative:function(){return R}});var i=n(69262),o=n(73104),s=n(53429),r=n(25045),u=n(34918),c=n(62445),a=n(38574),l=n(68616),p=n(23211),d=n(28077),h=n(71125),f=n(91206);n(75143);var m=n(73302),_=n(8962),g=n(43219),R=function(e){function t(){var e;return(0,o._)(this,t),e=(0,i._)(this,t,arguments),(0,r._)(e,"buttons",[{group:"state",name:"speechRecognize"}]),(0,r._)(e,"messagePopup",void 0),(0,r._)(e,"__hidePopupTimeout",void 0),(0,r._)(e,"_commandToWord",{}),e}return(0,u._)(t,e),(0,s._)(t,[{key:"afterInit",value:function(e){var t=this,n=e.o.speechRecognize.commands;n&&((0,d.extendLang)(g),(0,h.keys)(n,!1).forEach(function(i){i.split("|").forEach(function(o){o=o.trim().toLowerCase(),t._commandToWord[o]=n[i];var s=e.i18n(o);s!==o&&s.split("|").forEach(function(e){t._commandToWord[e.trim().toLowerCase()]=n[i].trim()})})}))}},{key:"beforeDestruct",value:function(e){p.Dom.safeRemove(this.messagePopup)}},{key:"onSpeechRecognizeProgressResult",value:function(e){var t=this;this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),p.Dom.append(this.j.workplace,this.messagePopup),this.j.async.clearTimeout(this.__hidePopupTimeout),this.__hidePopupTimeout=this.j.async.setTimeout(function(){p.Dom.safeRemove(t.messagePopup)},1e3),this.messagePopup.innerText=e+"|"}},{key:"onSpeechRecognizeResult",value:function(e){this.j.async.clearTimeout(this.__hidePopupTimeout),p.Dom.safeRemove(this.messagePopup);var t=this.j,n=t.s;if(!this._checkCommand(e)){var i=n.range,o=n.current();if(n.isCollapsed()&&p.Dom.isText(o)&&p.Dom.isOrContains(t.editor,o)&&o.nodeValue){var s=o.nodeValue;o.nodeValue=s+(/[\u00A0 ]\uFEFF*$/.test(s)?"":" ")+e,i.setStartAfter(o),n.selectRange(i),t.synchronizeValues()}else n.insertHTML(e)}}},{key:"_checkCommand",value:function(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,_.execSpellCommand)(this.j,this._commandToWord[e]),!0)}}]),t}((0,a._)(f.Plugin));(0,c._)([(0,l.watch)(":speechRecognizeProgressResult")],R.prototype,"onSpeechRecognizeProgressResult",null),(0,c._)([(0,l.watch)(":speechRecognizeResult")],R.prototype,"onSpeechRecognizeResult",null),m.Jodit.plugins.add("speech-recognize",R)},22227:function(e){e.exports='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"> <g fill="none"> <rect x="9" y="2" width="6" height="13" rx="3"/><path d="M5 10v2a7 7 0 0 0 14 0v-2M12 19v3m-4 0h8"/> </g> </svg>'}},function(e){return e(31262)}])});
@@ -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.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/es5/polyfills.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.19.9
4
+ * Version: v4.19.11
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.19.9";
6
+ export const APP_VERSION = "4.19.11";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -12,6 +12,7 @@ import { isHTML } from "../helpers/checker/is-html.js";
12
12
  import { isSet } from "../helpers/checker/is-set.js";
13
13
  import { isString } from "../helpers/checker/is-string.js";
14
14
  import { isVoid } from "../helpers/checker/is-void.js";
15
+ import { unwrapMarkedTags } from "../helpers/html/tag-scan.js";
15
16
  import { trim } from "../helpers/string/trim.js";
16
17
  import { assert } from "../helpers/utils/assert.js";
17
18
  import { attr } from "../helpers/utils/attr.js";
@@ -19,7 +20,6 @@ import { css } from "../helpers/utils/css.js";
19
20
  import { dataBind } from "../helpers/utils/data-bind.js";
20
21
  import { error } from "../helpers/utils/error/index.js";
21
22
  import { call } from "../helpers/utils/utils.js";
22
- const TEMP_ELEMENT_REG_EXP = new RegExp(`<([a-z]+)[^>]+${TEMP_ATTR}[^>]*>(.+?)</\\1>`, 'gi');
23
23
  /**
24
24
  * Module for working with DOM
25
25
  */
@@ -765,7 +765,7 @@ export class Dom {
765
765
  * Unwrap temporary elements inside a HTML string (keeps their content)
766
766
  */
767
767
  static replaceTemporaryFromString(value) {
768
- return value.replace(TEMP_ELEMENT_REG_EXP, '$2');
768
+ return unwrapMarkedTags(value, null, TEMP_ATTR);
769
769
  }
770
770
  /**
771
771
  * Collect the temporary elements (`data-jodit-temp`) inside the root.
@@ -3,10 +3,11 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- /**
7
- * @module helpers/checker
8
- */
9
6
  /**
10
7
  * Detect if string is HTML from MS Word, Excel or LibreOffice/OpenOffice
8
+ *
9
+ * The clipboard text is attacker controlled, so every check walks the string
10
+ * once with `indexOf`: a regex with an unbounded group before a required
11
+ * literal was quadratic on a long run of `<meta` and froze the tab.
11
12
  */
12
13
  export declare function isHtmlFromWord(data: string): boolean;
@@ -6,22 +6,102 @@
6
6
  /**
7
7
  * @module helpers/checker
8
8
  */
9
+ const SPACE = /\s/;
10
+ const DIGIT = /\d/;
11
+ const WORD_CHAR = /\w/;
12
+ // `content="Microsoft Word 15"` — the name followed by a space and a version digit
13
+ function hasGenerator(tag, name) {
14
+ let index = tag.indexOf(name);
15
+ while (index !== -1) {
16
+ const after = index + name.length;
17
+ if (SPACE.test(tag.charAt(after)) &&
18
+ DIGIT.test(tag.charAt(after + 1))) {
19
+ return true;
20
+ }
21
+ index = tag.indexOf(name, after);
22
+ }
23
+ return false;
24
+ }
25
+ // `<meta name=ProgId content=Word.Document>`, `<meta name=Generator content="LibreOffice 7.6">`
26
+ function isOfficeMeta(tag) {
27
+ if (hasGenerator(tag, 'Microsoft Word') ||
28
+ hasGenerator(tag, 'Microsoft Excel')) {
29
+ return true;
30
+ }
31
+ const lower = tag.toLowerCase();
32
+ const progId = lower.indexOf('progid');
33
+ if (progId !== -1 &&
34
+ (lower.indexOf('word.', progId) !== -1 ||
35
+ lower.indexOf('excel.', progId) !== -1)) {
36
+ return true;
37
+ }
38
+ return lower.includes('libreoffice') || lower.includes('openoffice');
39
+ }
40
+ // ` class=MsoNormal`, ` class="MsoListParagraph"` inside one tag
41
+ function hasMsoClass(tag) {
42
+ let index = tag.indexOf('class=');
43
+ while (index !== -1) {
44
+ if (index > 0 && SPACE.test(tag.charAt(index - 1))) {
45
+ let value = index + 'class='.length;
46
+ const quote = tag.charAt(value);
47
+ if (quote === '"' || quote === "'") {
48
+ value += 1;
49
+ }
50
+ if (tag.startsWith('Mso', value)) {
51
+ return true;
52
+ }
53
+ }
54
+ index = tag.indexOf('class=', index + 'class='.length);
55
+ }
56
+ return false;
57
+ }
58
+ // `style='mso-list:l0 level1 lfo1'` — an `mso-` property inside a style attribute with the given quote
59
+ function hasMsoStyle(data, quote) {
60
+ const open = 'style=' + quote;
61
+ let index = data.indexOf(open);
62
+ while (index !== -1) {
63
+ const start = index + open.length;
64
+ let end = data.indexOf(quote, start);
65
+ if (end === -1) {
66
+ end = data.length;
67
+ }
68
+ if (data.slice(start, end).includes('mso-')) {
69
+ return true;
70
+ }
71
+ index = data.indexOf(open, end);
72
+ }
73
+ return false;
74
+ }
9
75
  /**
10
76
  * Detect if string is HTML from MS Word, Excel or LibreOffice/OpenOffice
77
+ *
78
+ * The clipboard text is attacker controlled, so every check walks the string
79
+ * once with `indexOf`: a regex with an unbounded group before a required
80
+ * literal was quadratic on a long run of `<meta` and froze the tab.
11
81
  */
12
82
  export function isHtmlFromWord(data) {
13
- return (data.search(/<meta.*?Microsoft Excel\s[\d].*?>/) !== -1 ||
14
- data.search(/<meta.*?Microsoft Word\s[\d].*?>/) !== -1 ||
15
- // `<meta name=ProgId content=Word.Document>` — attribute values are
16
- // unquoted in the raw Word clipboard fragment
17
- data.search(/<meta[^>]*?ProgId[^>]*?(Word|Excel)\./i) !== -1 ||
18
- // LibreOffice/OpenOffice Writer & Calc
19
- data.search(/<meta[^>]*?(LibreOffice|OpenOffice)/i) !== -1 ||
20
- // Office namespaces on the root element of the clipboard fragment
21
- data.search(/urn:schemas-microsoft-com:office:(word|excel)/) !== -1 ||
22
- // `class=MsoNormal` and friends (unquoted/quoted)
23
- data.search(/<\w[^>]*\sclass=("|')?Mso/) !== -1 ||
24
- // the raw Word clipboard uses SINGLE quotes: style='mso-…'
25
- data.search(/style='[^']*mso-/) !== -1 ||
26
- (data.search(/style="[^"]*mso-/) !== -1 && data.search(/<font/) !== -1));
83
+ if (data.includes('urn:schemas-microsoft-com:office:word') ||
84
+ data.includes('urn:schemas-microsoft-com:office:excel')) {
85
+ return true;
86
+ }
87
+ // Each tag is taken once, from its `<` to the next `>`, so the scan stays linear
88
+ let index = data.indexOf('<');
89
+ while (index !== -1) {
90
+ if (!WORD_CHAR.test(data.charAt(index + 1))) {
91
+ index = data.indexOf('<', index + 1);
92
+ continue;
93
+ }
94
+ let end = data.indexOf('>', index);
95
+ if (end === -1) {
96
+ end = data.length;
97
+ }
98
+ const tag = data.slice(index, end);
99
+ if ((tag.slice(0, 5).toLowerCase() === '<meta' && isOfficeMeta(tag)) ||
100
+ hasMsoClass(tag)) {
101
+ return true;
102
+ }
103
+ index = data.indexOf('<', end);
104
+ }
105
+ return (hasMsoStyle(data, "'") ||
106
+ (hasMsoStyle(data, '"') && data.includes('<font')));
27
107
  }
@@ -5,5 +5,9 @@
5
5
  */
6
6
  /**
7
7
  * Check if a string is html or not
8
+ *
9
+ * The pasted text is attacker controlled, so the check walks the string with
10
+ * `indexOf`: the former regex `<(\w+)[^>]*>(.*?)<\/\1>` was quadratic on a
11
+ * long run of `<a>` and froze the tab.
8
12
  */
9
13
  export declare const isHTML: (str: unknown) => str is string;
@@ -7,8 +7,60 @@
7
7
  * @module helpers/checker
8
8
  */
9
9
  import { isString } from "./is-string.js";
10
+ const NAME_START = /[A-Za-z]/;
11
+ const NAME_CHAR = /[A-Za-z0-9]/;
12
+ const WORD_CHAR = /\w/;
13
+ // The tag name at `from`, or '' when there is none
14
+ function readTagName(str, from) {
15
+ if (!NAME_START.test(str.charAt(from))) {
16
+ return '';
17
+ }
18
+ let end = from + 1;
19
+ while (NAME_CHAR.test(str.charAt(end))) {
20
+ end += 1;
21
+ }
22
+ return str.slice(from, end);
23
+ }
24
+ // Is there an element `<name ...>` closed later by `</name>`? One pass for the closing tags, one for the opening ones
25
+ function hasElement(str) {
26
+ const lastClose = new Map();
27
+ let index = str.indexOf('</');
28
+ while (index !== -1) {
29
+ const name = readTagName(str, index + 2);
30
+ if (name !== '' && str.charAt(index + 2 + name.length) === '>') {
31
+ lastClose.set(name, index);
32
+ }
33
+ index = str.indexOf('</', index + 2);
34
+ }
35
+ if (lastClose.size === 0) {
36
+ return false;
37
+ }
38
+ let gt = -1;
39
+ index = str.indexOf('<');
40
+ while (index !== -1) {
41
+ const name = readTagName(str, index + 1);
42
+ const after = index + 1 + name.length;
43
+ if (name !== '' && !WORD_CHAR.test(str.charAt(after))) {
44
+ if (gt < after) {
45
+ gt = str.indexOf('>', after);
46
+ }
47
+ if (gt === -1) {
48
+ return false;
49
+ }
50
+ const close = lastClose.get(name);
51
+ if (close !== undefined && close > gt) {
52
+ return true;
53
+ }
54
+ }
55
+ index = str.indexOf('<', index + 1);
56
+ }
57
+ return false;
58
+ }
10
59
  /**
11
60
  * Check if a string is html or not
61
+ *
62
+ * The pasted text is attacker controlled, so the check walks the string with
63
+ * `indexOf`: the former regex `<(\w+)[^>]*>(.*?)<\/\1>` was quadratic on a
64
+ * long run of `<a>` and froze the tab.
12
65
  */
13
- export const isHTML = (str) => isString(str) &&
14
- /<([A-Za-z][A-Za-z0-9]*)\b[^>]*>(.*?)<\/\1>/m.test(str.replace(/[\r\n]/g, ''));
66
+ export const isHTML = (str) => isString(str) && hasElement(str);
@@ -8,17 +8,28 @@
8
8
  */
9
9
  import { globalDocument, IS_PROD } from "../../constants.js";
10
10
  import { Dom } from "../../dom/dom.js";
11
+ import { indexOfOpenTag, removeWordWrappers } from "./tag-scan.js";
11
12
  import { readWordListItems, wrapWordListItems } from "./word-lists.js";
12
13
  import { trim } from "../string/trim.js";
13
14
  import { attr } from "../utils/attr.js";
14
15
  import { css } from "../utils/css.js";
15
16
  import { $$ } from "../utils/selector.js";
17
+ // Drop the `mso-*` and `border*` declarations and turn pt/cm into px; one declaration at a time, so a long value cannot make the regexes backtrack
16
18
  function normalizeCSS(s) {
17
- return s
18
- .replace(/mso-[a-z-]+:[\s]*[^;]+;/gi, '')
19
- .replace(/mso-[a-z-]+:[\s]*[^";']+$/gi, '')
20
- .replace(/border[a-z-]*:[\s]*[^;]+;/gi, '')
21
- .replace(/([0-9.]+)(pt|cm)/gi, (match, units, metrics) => {
19
+ const declarations = s.split(';');
20
+ const last = declarations.length - 1;
21
+ return declarations
22
+ .filter((declaration, index) => {
23
+ const match = /^\s*([a-z-]{1,64})\s*:/i.exec(declaration);
24
+ if (!match) {
25
+ return true;
26
+ }
27
+ const property = match[1].toLowerCase();
28
+ return !(property.startsWith('mso-') ||
29
+ (property.startsWith('border') && index !== last));
30
+ })
31
+ .join(';')
32
+ .replace(/([0-9.]{1,32})(pt|cm)/gi, (match, units, metrics) => {
22
33
  switch (metrics.toLowerCase()) {
23
34
  case 'pt':
24
35
  return (parseFloat(units) * 1.328).toFixed(0) + 'px';
@@ -41,11 +52,11 @@ export function applyStyles(html) {
41
52
  // cell backgrounds/borders, e.g. `.xl31 { background:#FCE4D6 }`) were never
42
53
  // inlined and all styling was lost once the `<style>` block got stripped.
43
54
  // See https://github.com/xdan/jodit/issues/1362
44
- const openMatch = /<html(?:\s[^>]*)?>/i.exec(html);
45
- if (!openMatch) {
55
+ const open = indexOfOpenTag(html, 'html');
56
+ if (open === -1) {
46
57
  return html;
47
58
  }
48
- html = html.substring(openMatch.index);
59
+ html = html.substring(open);
49
60
  const closeIndex = html.toLowerCase().lastIndexOf('</html>');
50
61
  if (closeIndex !== -1) {
51
62
  html = html.substring(0, closeIndex + '</html>'.length);
@@ -123,7 +134,5 @@ export function applyStyles(html) {
123
134
  if (convertedString) {
124
135
  html = convertedString;
125
136
  }
126
- return trim(html
127
- .replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '')
128
- .replace(/<!--[^>]*>/g, ''));
137
+ return trim(removeWordWrappers(html));
129
138
  }
@@ -9,6 +9,7 @@
9
9
  import { globalDocument } from "../../constants.js";
10
10
  import { Dom } from "../../dom/dom.js";
11
11
  import { toArray } from "../array/to-array.js";
12
+ import { removeWordWrappers } from "./tag-scan.js";
12
13
  import { readWordListItems, wrapWordListItems } from "./word-lists.js";
13
14
  import { trim } from "../string/trim.js";
14
15
  import { attr, attrRaw } from "../utils/attr.js";
@@ -86,7 +87,5 @@ export function cleanFromWord(html) {
86
87
  html = convertedString;
87
88
  }
88
89
  html = html.split(/(\n)/).filter(trim).join('\n');
89
- return html
90
- .replace(/<(\/)?(html|colgroup|col|o:p)[^>]*>/g, '')
91
- .replace(/<!--[^>]*>/g, '');
90
+ return removeWordWrappers(html);
92
91
  }
@@ -12,3 +12,4 @@ export * from "./htmlspecialchars";
12
12
  export * from "./nl2br";
13
13
  export * from "./safe-html";
14
14
  export * from "./strip-tags";
15
+ export * from "./tag-scan";
@@ -12,3 +12,4 @@ export * from "./htmlspecialchars.js";
12
12
  export * from "./nl2br.js";
13
13
  export * from "./safe-html.js";
14
14
  export * from "./strip-tags.js";
15
+ export * from "./tag-scan.js";
@@ -0,0 +1,36 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * The first `</name>` at or after `from`, case-insensitive, or -1
8
+ */
9
+ export declare function indexOfClosingTag(html: string, name: string, from: number): number;
10
+ /**
11
+ * Remove every tag that starts with one of the prefixes, up to its `>`:
12
+ * `removeTagsByPrefix(html, ['<meta', '<!--'])`
13
+ */
14
+ export declare function removeTagsByPrefix(html: string, prefixes: string[]): string;
15
+ /**
16
+ * Strip the Word wrapper tags and then the comments, as the clean-up always did
17
+ */
18
+ export declare function removeWordWrappers(html: string): string;
19
+ /**
20
+ * The index of the first `<name>` or `<name …>` tag, or -1
21
+ */
22
+ export declare function indexOfOpenTag(html: string, name: string): number;
23
+ /**
24
+ * Replace every `<name … marker …>inner</name>` with `inner`.
25
+ * `name` null takes any tag; `keep` can refuse an element by its inner HTML.
26
+ */
27
+ export declare function unwrapMarkedTags(html: string, name: string | null, marker: string, keep?: (inner: string) => boolean): string;
28
+ /**
29
+ * Remove every `open … openEnd … close` block whose opener holds `marker` (any opener when it is ''):
30
+ * `removeBetween(html, '<style', '>', '</style>', 'jodit-box')`
31
+ */
32
+ export declare function removeBetween(html: string, open: string, openEnd: string, close: string, marker?: string): string;
33
+ /**
34
+ * Remove every empty `<name … marker …></name>` element
35
+ */
36
+ export declare function removeEmptyMarkedTags(html: string, name: string, marker: string): string;