jodit 4.20.3 → 4.20.5

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 (73) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +5 -5
  5. package/es2015/jodit.js +72 -27
  6. package/es2015/jodit.min.js +4 -4
  7. package/es2015/plugins/debug/debug.css +1 -1
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +3 -6
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -4
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.css +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +5 -5
  16. package/es2018/jodit.min.js +4 -4
  17. package/es2018/plugins/debug/debug.min.js +1 -1
  18. package/es2018/plugins/speech-recognize/speech-recognize.min.css +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  20. package/es2021/jodit.css +1 -1
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +5 -5
  23. package/es2021/jodit.js +72 -27
  24. package/es2021/jodit.min.js +4 -4
  25. package/es2021/plugins/debug/debug.css +1 -1
  26. package/es2021/plugins/debug/debug.js +1 -1
  27. package/es2021/plugins/debug/debug.min.js +1 -1
  28. package/es2021/plugins/speech-recognize/speech-recognize.css +3 -6
  29. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -4
  30. package/es2021/plugins/speech-recognize/speech-recognize.min.css +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  32. package/es2021.en/jodit.css +1 -1
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +7 -7
  35. package/es2021.en/jodit.js +72 -27
  36. package/es2021.en/jodit.min.js +4 -4
  37. package/es2021.en/plugins/debug/debug.css +1 -1
  38. package/es2021.en/plugins/debug/debug.js +1 -1
  39. package/es2021.en/plugins/debug/debug.min.js +1 -1
  40. package/es2021.en/plugins/speech-recognize/speech-recognize.css +3 -6
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -4
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.min.css +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  44. package/es5/jodit.css +2 -2
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +93 -26
  48. package/es5/jodit.min.css +2 -2
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +3 -6
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -4
  55. package/es5/plugins/speech-recognize/speech-recognize.min.css +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  57. package/es5/polyfills.fat.min.js +1 -1
  58. package/es5/polyfills.js +1 -1
  59. package/es5/polyfills.min.js +1 -1
  60. package/esm/config.d.ts +2 -0
  61. package/esm/core/constants.js +1 -1
  62. package/esm/plugins/clean-html/clean-html.d.ts +1 -0
  63. package/esm/plugins/clean-html/clean-html.js +15 -0
  64. package/esm/plugins/file/file.js +12 -1
  65. package/esm/plugins/link/config.d.ts +2 -0
  66. package/esm/plugins/link/config.js +1 -0
  67. package/esm/plugins/link/link.js +49 -23
  68. package/esm/plugins/link/template.js +4 -4
  69. package/esm/plugins/speech-recognize/config.js +0 -3
  70. package/package.json +1 -1
  71. package/types/config.d.ts +2 -0
  72. package/types/plugins/clean-html/clean-html.d.ts +1 -0
  73. package/types/plugins/link/config.d.ts +2 -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.20.3
4
+ * Version: v4.20.5
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.20.3
4
+ * Version: v4.20.5
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.20.3
4
+ * Version: v4.20.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,23 +1,20 @@
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.20.3
4
+ * Version: v4.20.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
8
8
 
9
9
  @keyframes jd-speak-animation {
10
10
  0% {
11
- fill: green;
11
+ stroke: green;
12
12
  opacity: 0.3;
13
13
  }
14
14
  100% {
15
- fill: #4285f4;
15
+ stroke: #4285f4;
16
16
  }
17
17
  }
18
- svg.jodit-icon_speechRecognize {
19
- stroke: none !important;
20
- }
21
18
  .jodit-toolbar-button_pulse_true svg {
22
19
  animation-duration: 0.7s;
23
20
  animation-iteration-count: infinite;
@@ -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.20.3
4
+ * Version: v4.20.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -142,9 +142,6 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.speechRecogn
142
142
  var _ref;
143
143
  var api = (0,jodit_core_helpers_utils_data_bind__WEBPACK_IMPORTED_MODULE_3__.dataBind)(jodit, 'speech'), checked = (_ref = api === null || api === void 0 ? void 0 : api[key]) !== null && _ref !== void 0 ? _ref : jodit.o.speechRecognize[key];
144
144
  return "<span class='jodit-speech-recognize__list-item'><input ".concat(checked ? 'checked' : '', " class='jodit-checkbox' type='checkbox'>&nbsp;").concat(value, "</span>");
145
- },
146
- mods: {
147
- stroke: false
148
145
  }
149
146
  };
150
147
 
@@ -1 +1 @@
1
- @keyframes a{0%{fill:green;opacity:.3}to{fill:#4285f4}}svg.jodit-icon_speechRecognize{stroke:none!important}.jodit-toolbar-button_pulse_true svg{animation-duration:.7s;animation-iteration-count:infinite;animation-name:a}.jodit-speech-recognize__list-item{display:flex;padding:var(--jd-padding-default)}.jodit-speech-recognize__popup{background-color:hsla(0,0%,94%,.4);border-radius:8px;font-family:var(--jd-font-default);font-size:var(--jd-font-size-default);font-size:32px;left:50%;line-height:1.5;padding:8px 16px;position:absolute;top:50%;transform:translate(-50%,-50%)}
1
+ @keyframes a{0%{opacity:.3;stroke:green}to{stroke:#4285f4}}.jodit-toolbar-button_pulse_true svg{animation-duration:.7s;animation-iteration-count:infinite;animation-name:a}.jodit-speech-recognize__list-item{display:flex;padding:var(--jd-padding-default)}.jodit-speech-recognize__popup{background-color:hsla(0,0%,94%,.4);border-radius:8px;font-family:var(--jd-font-default);font-size:var(--jd-font-size-default);font-size:32px;left:50%;line-height:1.5;padding:8px 16px;position:absolute;top:50%;transform:translate(-50%,-50%)}
@@ -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.20.3
4
+ * Version: v4.20.5
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(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)}])});
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>")}}},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.20.3
4
+ * Version: v4.20.5
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.20.3
4
+ * Version: v4.20.5
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.20.3
4
+ * Version: v4.20.5
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/esm/config.d.ts CHANGED
@@ -1559,6 +1559,8 @@ interface Config {
1559
1559
  */
1560
1560
  formTemplate: (editor: IJodit) => string | HTMLElement | IUIForm;
1561
1561
  formClassName?: string;
1562
+ /** Content field format in the link form. Default: text. */
1563
+ contentMode: 'text' | 'html';
1562
1564
  /**
1563
1565
  * Follow link address after dblclick
1564
1566
  */
@@ -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.20.3";
6
+ export const APP_VERSION = "4.20.5";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -80,6 +80,7 @@ export declare class cleanHtml extends Plugin {
80
80
  private __removeTrailingBr;
81
81
  private __singleQuotesInFontFamily;
82
82
  protected onSafeHTML(sandBox: HTMLElement): void;
83
+ protected onCleanHTML(sandBox: HTMLElement): void;
83
84
  /** @override */
84
85
  protected beforeDestruct(): void;
85
86
  }
@@ -47,6 +47,7 @@ export class cleanHtml extends Plugin {
47
47
  // sanitises them.
48
48
  jodit.e
49
49
  .on('safeHTML', this.onSafeHTML)
50
+ .on('cleanHTML', this.onCleanHTML)
50
51
  .on('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue)
51
52
  .on('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
52
53
  }
@@ -244,10 +245,21 @@ export class cleanHtml extends Plugin {
244
245
  }
245
246
  safeHTML(sandBox, this.j.o.cleanHTML);
246
247
  }
248
+ onCleanHTML(sandBox) {
249
+ const allow = getHash(this.j.o.cleanHTML.allowTags);
250
+ const deny = getHash(this.j.o.cleanHTML.denyTags);
251
+ const nodes = Array.from(sandBox.querySelectorAll('*'));
252
+ for (const node of nodes) {
253
+ if (Dom.isOrContains(sandBox, node)) {
254
+ visitNodeWalker(this.j, node, allow, deny, null);
255
+ }
256
+ }
257
+ }
247
258
  /** @override */
248
259
  beforeDestruct() {
249
260
  this.j.e
250
261
  .off('safeHTML', this.onSafeHTML)
262
+ .off('cleanHTML', this.onCleanHTML)
251
263
  .off('beforeSetNativeEditorValue', this.onBeforeSetNativeEditorValue)
252
264
  .off('afterSetNativeEditorValue', this.onAfterSetNativeEditorValue);
253
265
  this.walker.destruct();
@@ -277,4 +289,7 @@ __decorate([
277
289
  __decorate([
278
290
  autobind
279
291
  ], cleanHtml.prototype, "onSafeHTML", null);
292
+ __decorate([
293
+ autobind
294
+ ], cleanHtml.prototype, "onCleanHTML", null);
280
295
  pluginSystem.add('cleanHtml', cleanHtml);
@@ -49,14 +49,25 @@ Config.prototype.controls.file = {
49
49
  popup: (editor, current, close) => {
50
50
  // The popup's first field takes the focus, so the selection the
51
51
  // popup was opened for is kept and put back before the link goes in
52
- const selected = editor.s.isCollapsed() ? null : editor.s.range;
52
+ let selected = editor.s.isCollapsed() ? null : editor.s.range;
53
53
  const restoreSelection = () => {
54
54
  if (selected) {
55
55
  editor.s.selectRange(selected);
56
+ selected = null;
56
57
  }
57
58
  };
58
59
  const insert = (url, title = '') => {
59
60
  restoreSelection();
61
+ if (sourceAnchor && Dom.isOrContains(editor.editor, sourceAnchor)) {
62
+ attr(sourceAnchor, 'href', url);
63
+ if (title) {
64
+ attr(sourceAnchor, 'title', title);
65
+ }
66
+ editor.s.setCursorAfter(sourceAnchor);
67
+ sourceAnchor = null;
68
+ editor.synchronizeValues();
69
+ return;
70
+ }
60
71
  if (wrapSelectionInLink(editor, url, title)) {
61
72
  return;
62
73
  }
@@ -15,6 +15,8 @@ declare module 'jodit/config' {
15
15
  */
16
16
  formTemplate: (editor: IJodit) => string | HTMLElement | IUIForm;
17
17
  formClassName?: string;
18
+ /** Content field format in the link form. Default: text. */
19
+ contentMode: 'text' | 'html';
18
20
  /**
19
21
  * Follow link address after dblclick
20
22
  */
@@ -11,6 +11,7 @@ import unlinkIcon from "./icons/unlink.svg.js";
11
11
  import { formTemplate } from "./template.js";
12
12
  Config.prototype.link = {
13
13
  formTemplate,
14
+ contentMode: 'text',
14
15
  followOnDblClick: false,
15
16
  processVideoLink: true,
16
17
  processPastedLink: true,
@@ -17,7 +17,7 @@ import { KEY_BACKSPACE, KEY_DOWN, KEY_ESC, KEY_TAB, KEY_UP } from "../../core/co
17
17
  import { autobind } from "../../core/decorators/index.js";
18
18
  import { Dom } from "../../core/dom/index.js";
19
19
  import { pluginSystem, uniqueUid } from "../../core/global.js";
20
- import { attr, call, convertMediaUrlToVideoEmbed, getAnchorName, getAnchors, isString, isURL, position, prepareEmbedCode, refs, stripTags } from "../../core/helpers/index.js";
20
+ import { attr, call, convertMediaUrlToVideoEmbed, getAnchorName, getAnchors, htmlspecialchars, isString, isURL, position, prepareEmbedCode, refs, safeHTML, stripTags } from "../../core/helpers/index.js";
21
21
  import { Plugin } from "../../core/plugin/index.js";
22
22
  import { UIElement } from "../../core/ui/element.js";
23
23
  import { Icon } from "../../core/ui/icon.js";
@@ -137,7 +137,7 @@ export class link extends Plugin {
137
137
  __generateForm(current, close) {
138
138
  const { jodit } = this;
139
139
  const i18n = jodit.i18n.bind(jodit);
140
- const { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
140
+ const { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName, contentMode } = jodit.o.link;
141
141
  const html = formTemplate(jodit);
142
142
  const form = isString(html)
143
143
  ? jodit.c.fromHTML(html, {
@@ -150,7 +150,7 @@ export class link extends Plugin {
150
150
  const { insert, unlink, content_input_box } = elements;
151
151
  const { target_checkbox, nofollow_checkbox, url_input } = elements;
152
152
  const currentElement = current;
153
- const isImageContent = Dom.isImage(currentElement);
153
+ const isImageContent = contentMode !== 'html' && Dom.isImage(currentElement);
154
154
  let { content_input } = elements;
155
155
  const { className_input } = elements, { className_select } = elements, { aria_label_input } = elements;
156
156
  if (!content_input) {
@@ -166,9 +166,14 @@ export class link extends Plugin {
166
166
  Dom.hide(content_input_box);
167
167
  }
168
168
  let link;
169
- const getSelectionText = () => link
170
- ? link.innerText
171
- : stripTags(jodit.s.range.cloneContents(), jodit.ed);
169
+ const getSelectionContent = () => {
170
+ if (contentMode === 'html') {
171
+ return link ? link.innerHTML : jodit.s.html;
172
+ }
173
+ return link
174
+ ? link.innerText
175
+ : stripTags(jodit.s.range.cloneContents(), jodit.ed);
176
+ };
172
177
  if (current && Dom.closest(current, 'a', jodit.editor)) {
173
178
  link = Dom.closest(current, 'a', jodit.editor);
174
179
  }
@@ -176,8 +181,9 @@ export class link extends Plugin {
176
181
  link = false;
177
182
  }
178
183
  if (!isImageContent && current) {
179
- content_input.value = getSelectionText();
184
+ content_input.value = getSelectionContent();
180
185
  }
186
+ const initialContent = content_input.value;
181
187
  if (aria_label_input) {
182
188
  aria_label_input.value = link ? attr(link, 'aria-label') || '' : '';
183
189
  }
@@ -202,7 +208,9 @@ export class link extends Plugin {
202
208
  url_input &&
203
209
  !isImageContent &&
204
210
  !url_input.value.trim()) {
205
- url_input.value = guessUrlFromText(content_input.value);
211
+ url_input.value = guessUrlFromText(contentMode === 'html'
212
+ ? stripTags(content_input.value, jodit.ed)
213
+ : content_input.value);
206
214
  }
207
215
  if (openInNewTabCheckbox && target_checkbox) {
208
216
  target_checkbox.checked = openInNewTabCheckboxDefaultChecked;
@@ -234,7 +242,7 @@ export class link extends Plugin {
234
242
  jodit.s.removeMarkers();
235
243
  jodit.editor.normalize();
236
244
  jodit.history.snapshot.restore(snapshot);
237
- const textWasChanged = getSelectionText() !== content_input.value.trim();
245
+ const contentWasChanged = initialContent !== content_input.value;
238
246
  const ci = jodit.createInside;
239
247
  let caretAfter = null;
240
248
  if (!link || !Dom.isOrContains(jodit.editor, link)) {
@@ -262,7 +270,7 @@ export class link extends Plugin {
262
270
  attr(a, 'href', url_input.value);
263
271
  writeClasses(modeClassName, className_input, className_select, a);
264
272
  if (!isImageContent) {
265
- writeImage(a, content_input, textWasChanged, url_input);
273
+ writeContent(jodit, a, content_input.value, contentWasChanged, url_input.value, contentMode);
266
274
  }
267
275
  if (openInNewTabCheckbox && target_checkbox) {
268
276
  attr(a, 'target', target_checkbox.checked ? '_blank' : null);
@@ -537,7 +545,10 @@ function addAnchorList(jodit, url, content, isImage) {
537
545
  url.value = '#' + name;
538
546
  if (!isImage &&
539
547
  (!content.value.trim() || content.value === filled)) {
540
- content.value = filled = text;
548
+ content.value = filled =
549
+ jodit.o.link.contentMode === 'html'
550
+ ? htmlspecialchars(text)
551
+ : text;
541
552
  }
542
553
  url.focus();
543
554
  });
@@ -690,18 +701,33 @@ function readClassnames(modeClassName, className_input, link, className_select)
690
701
  break;
691
702
  }
692
703
  }
693
- function writeImage(a, content_input, textWasChanged, url_input) {
694
- let newContent = a.textContent;
695
- if (content_input.value.trim().length) {
696
- if (textWasChanged) {
697
- newContent = content_input.value;
698
- }
699
- }
700
- else {
701
- newContent = url_input.value;
704
+ function writeContent(editor, anchor, value, changed, url, mode) {
705
+ if (!changed && anchor.hasChildNodes()) {
706
+ return;
702
707
  }
703
- const content = a.textContent;
704
- if (newContent !== content) {
705
- a.textContent = newContent;
708
+ if (mode === 'text' || !value.trim()) {
709
+ anchor.textContent = value.trim() ? value : url;
710
+ return;
706
711
  }
712
+ const sandboxDocument = editor.od.implementation.createHTMLDocument('');
713
+ const sandbox = sandboxDocument.createElement('div');
714
+ sandbox.innerHTML = value;
715
+ editor.e.fire('safeHTML', sandbox);
716
+ sanitizeLinkHTML(sandbox);
717
+ sandboxDocument.body.appendChild(sandbox);
718
+ editor.e.fire('cleanHTML', sandbox);
719
+ sanitizeLinkHTML(sandbox);
720
+ sandbox.querySelectorAll('a').forEach(link => Dom.unwrap(link));
721
+ Dom.detach(anchor);
722
+ Dom.moveContent(sandbox, anchor);
723
+ }
724
+ function sanitizeLinkHTML(sandbox) {
725
+ sandbox
726
+ .querySelectorAll('script,style,iframe,frame,frameset,object,embed,base,link,meta,template')
727
+ .forEach(node => Dom.safeRemove(node));
728
+ safeHTML(sandbox, {
729
+ removeEventAttributes: true,
730
+ removeOnError: true,
731
+ safeJavaScriptLink: true
732
+ });
707
733
  }
@@ -4,9 +4,9 @@
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  import { UIButton } from "../../core/ui/button/index.js";
7
- import { UIBlock, UICheckbox, UIForm, UIInput, UISelect } from "../../core/ui/form/index.js";
7
+ import { UIBlock, UICheckbox, UIForm, UIInput, UISelect, UITextArea } from "../../core/ui/form/index.js";
8
8
  export const formTemplate = (editor) => {
9
- const { openInNewTabCheckbox, noFollowCheckbox, ariaLabelInput, modeClassName, selectSizeClassName, selectMultipleClassName, selectOptionsClassName } = editor.o.link;
9
+ const { openInNewTabCheckbox, noFollowCheckbox, ariaLabelInput, modeClassName, contentMode, selectSizeClassName, selectMultipleClassName, selectOptionsClassName } = editor.o.link;
10
10
  return new UIForm(editor, [
11
11
  new UIBlock(editor, [
12
12
  new UIInput(editor, {
@@ -30,10 +30,10 @@ export const formTemplate = (editor) => {
30
30
  ])
31
31
  : null,
32
32
  new UIBlock(editor, [
33
- new UIInput(editor, {
33
+ new (contentMode === 'html' ? UITextArea : UIInput)(editor, {
34
34
  name: 'content',
35
35
  ref: 'content_input',
36
- label: 'Text'
36
+ label: contentMode === 'html' ? 'HTML' : 'Text'
37
37
  })
38
38
  ], {
39
39
  ref: 'content_input_box'
@@ -102,8 +102,5 @@ Config.prototype.controls.speechRecognize = {
102
102
  var _a;
103
103
  const api = dataBind(jodit, 'speech'), checked = (_a = api === null || api === void 0 ? void 0 : api[key]) !== null && _a !== void 0 ? _a : jodit.o.speechRecognize[key];
104
104
  return `<span class='jodit-speech-recognize__list-item'><input ${checked ? 'checked' : ''} class='jodit-checkbox' type='checkbox'>&nbsp;${value}</span>`;
105
- },
106
- mods: {
107
- stroke: false
108
105
  }
109
106
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.20.3",
3
+ "version": "4.20.5",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
package/types/config.d.ts CHANGED
@@ -1559,6 +1559,8 @@ interface Config {
1559
1559
  */
1560
1560
  formTemplate: (editor: IJodit) => string | HTMLElement | IUIForm;
1561
1561
  formClassName?: string;
1562
+ /** Content field format in the link form. Default: text. */
1563
+ contentMode: 'text' | 'html';
1562
1564
  /**
1563
1565
  * Follow link address after dblclick
1564
1566
  */
@@ -80,6 +80,7 @@ export declare class cleanHtml extends Plugin {
80
80
  private __removeTrailingBr;
81
81
  private __singleQuotesInFontFamily;
82
82
  protected onSafeHTML(sandBox: HTMLElement): void;
83
+ protected onCleanHTML(sandBox: HTMLElement): void;
83
84
  /** @override */
84
85
  protected beforeDestruct(): void;
85
86
  }
@@ -15,6 +15,8 @@ declare module 'jodit/config' {
15
15
  */
16
16
  formTemplate: (editor: IJodit) => string | HTMLElement | IUIForm;
17
17
  formClassName?: string;
18
+ /** Content field format in the link form. Default: text. */
19
+ contentMode: 'text' | 'html';
18
20
  /**
19
21
  * Follow link address after dblclick
20
22
  */