jodit 4.1.11 → 4.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -5
- package/es2015/jodit.css +2 -1
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +2 -2
- package/es2015/jodit.js +145 -105
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +2 -2
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +3 -3
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2018/jodit.css +2 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +2 -2
- package/es2018/jodit.js +144 -104
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +2 -2
- package/es2018/plugins/debug/debug.js +1 -1
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.js +3 -3
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021/jodit.css +2 -1
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +2 -2
- package/es2021/jodit.js +143 -104
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +2 -2
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +3 -3
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es2021.en/jodit.css +2 -1
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +2 -2
- package/es2021.en/jodit.js +143 -104
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +2 -2
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +3 -3
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/es5/jodit.css +3 -2
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +156 -108
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +3 -3
- package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
- package/esm/core/constants.js +1 -1
- package/esm/core/decorators/watch/watch.d.ts +0 -1
- package/esm/core/decorators/watch/watch.js +0 -1
- package/esm/modules/file-browser/data-provider.js +1 -0
- package/esm/modules/file-browser/file-browser.d.ts +3 -0
- package/esm/modules/file-browser/file-browser.js +27 -1
- package/esm/plugins/ai-assistant/ai-assistant.d.ts +2 -0
- package/esm/plugins/ai-assistant/ai-assistant.js +40 -29
- package/esm/plugins/ai-assistant/ui/ui-ai-assistant.js +1 -1
- package/package.json +1 -1
- package/types/core/decorators/watch/watch.d.ts +0 -1
- package/types/modules/file-browser/file-browser.d.ts +3 -0
- package/types/plugins/ai-assistant/ai-assistant.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.1.
|
|
4
|
+
* Version: v4.1.14
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1115,11 +1115,11 @@ var SpeechRecognizeNative = /** @class */ (function (_super) {
|
|
|
1115
1115
|
return false;
|
|
1116
1116
|
};
|
|
1117
1117
|
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
1118
|
-
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .
|
|
1118
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':speechRecognizeProgressResult'),
|
|
1119
1119
|
(0,jodit_core_decorators_debounce_debounce__WEBPACK_IMPORTED_MODULE_0__/* .debounce */ .s)()
|
|
1120
1120
|
], SpeechRecognizeNative.prototype, "onSpeechRecognizeProgressResult", null);
|
|
1121
1121
|
(0,tslib__WEBPACK_IMPORTED_MODULE_9__/* .__decorate */ .Cg)([
|
|
1122
|
-
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .
|
|
1122
|
+
(0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_1__/* .watch */ .w)(':speechRecognizeResult')
|
|
1123
1123
|
], SpeechRecognizeNative.prototype, "onSpeechRecognizeResult", null);
|
|
1124
1124
|
return SpeechRecognizeNative;
|
|
1125
1125
|
}(jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__/* .Plugin */ .k));
|
|
@@ -1,10 +1,10 @@
|
|
|
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.1.
|
|
4
|
+
* Version: v4.1.14
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
!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],{71096:function(e,t,n){"use strict";var i=n(9810),o=n(72197),s=n(931),r=n(71722),u=n(93676),c=n(22227),a=n.n(c),p=n(36115);p.T.prototype.speechRecognize={api:r.o,sound:!0,continuous:!0,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"}},s.I.set("speech-recognize",a()),p.T.prototype.controls.speechRecognize={isActive:function(e,t){var n=(0,o.m)(e,"speech");return Boolean(null==n?void 0:n.isEnabled)},isDisabled:function(e){return!e.o.speechRecognize.api},exec:function(e,t,n){var s=n.button,r=n.control,c=e.o.speechRecognize,a=c.api,p=c.lang,l=c.continuous,d=c.interimResults,h=c.sound;if(a){var f=(0,o.m)(e,"speech");if(!f){var m=new a;(f=new u.g(e.async,m)).lang=p,f.continuous=l,f.interimResults=d,f.sound=h,(0,o.m)(e,"speech",f),f.on("pulse",(function(e){s.setMod("pulse",e)})),f.on("result",(function(t){return e.e.fire("speechRecognizeResult",t)})),f.on("progress",(function(t){return e.e.fire("speechRecognizeProgressResult",t)})),s.hookStatus("beforeDestruct",(function(){f.destruct()}))}if(r.args){var g=r.args[0];if((0,i.L)(f[g]))return f[g]=!f[g],void(f.isEnabled&&f.restart())}f.toggle(),s.state.activated=f.isEnabled}else e.alert("Speech recognize API unsupported in your browser")},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate:function(e,t,n){var i,s=(0,o.m)(e,"speech"),r=null!==(i=null==s?void 0:s[t])&&void 0!==i?i:e.o.speechRecognize[t];return"<span class='jodit-speech-recognize__list-item'><input ".concat(r?"checked":""," class='jodit-checkbox' type='checkbox'> ").concat(n,"</span>")},mods:{stroke:!1}}},81629:function(e,t,n){"use strict";n.d(t,{N:function(){return i},Z:function(){return o}});var i=440,o=940},71722:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var i=window.SpeechRecognition||window.webkitSpeechRecognition},50834:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var i=n(31635);function o(e,t){var n=(0,i.zs)(t.split("::"),2);e.execCommand(n[0],null,n[1])}},93676:function(e,t,n){"use strict";n.d(t,{g:function(){return c}});var i=n(31635),o=n(22664),s=n(43431),r=n(95473),u=n(81629),c=function(e){function t(t,i){var o=e.call(this)||this;return o.async=t,o._continuous=!1,o._interimResults=!1,o.sound=!0,o._isEnabled=!1,o._restartTimeout=0,o._onSpeechStart=function(e){o._isEnabled&&(o.async.clearTimeout(o._restartTimeout),o._restartTimeout=o.async.setTimeout((function(){o.restart(),o.emit("pulse",!1),o._makeSound(u.Z)}),5e3),o.emit("pulse",!0))},o._progressTimeout=0,o._api=i,n._instances.add(o),o}var n;return(0,i.C6)(t,e),n=t,Object.defineProperty(t.prototype,"lang",{get:function(){return this._lang},set:function(e){this._lang=e,this._api.lang=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"continuous",{get:function(){return this._continuous},set:function(e){this._continuous=e,this._api.continuous=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"interimResults",{get:function(){return this._interimResults},set:function(e){this._interimResults=e,this._api.interimResults=e},enumerable:!1,configurable:!0}),t.prototype.destruct=function(){this.stop(),n._instances.delete(this),e.prototype.destruct.call(this)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},enumerable:!1,configurable:!0}),t.prototype.start=function(){var e=this;this._isEnabled||(this._isEnabled=!0,n._instances.forEach((function(t){t!==e&&t.stop()})),this._api.start(),this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onResult))},t.prototype.stop=function(){if(this._isEnabled){try{this._api.abort(),this._api.stop()}catch(e){}this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onResult),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1)}},t.prototype.toggle=function(){this._isEnabled?this.stop():this.start()},t.prototype.restart=function(){this.stop(),this.start()},t.prototype.__on=function(e,t){return this._api.addEventListener(e,t),this},t.prototype.__off=function(e,t){return this._api.removeEventListener(e,t),this},t.prototype._onResult=function(e){var t=this;if(this._isEnabled){this.async.clearTimeout(this._progressTimeout);var n=e.results.item(e.resultIndex),i=n.item(0).transcript,o=function(){try{t.async.clearTimeout(t._restartTimeout),t.emit("result",i)}catch(e){}t.restart(),t.emit("pulse",!1),t._makeSound(u.N)};if(!1===n.isFinal)return this.emit("progress",i),void(this._progressTimeout=this.async.setTimeout(o,500));o()}},t.prototype._onError=function(){this._isEnabled&&(this._makeSound(u.Z),this.emit("pulse",!1),this.restart())},t.prototype._makeSound=function(e){this.sound&&(0,r.s)({frequency:e})},t._instances=new Set,n=(0,i.Cg)([o.autobind],t)}(s.h)},95473:function(e,t,n){"use strict";n.d(t,{s:function(){return o}});var i=n(81629);function o(e){var t=void 0===e?{}:e,n=t.sec,o=void 0===n?.1:n,s=t.frequency,r=void 0===s?i.N:s,u=t.gain,c=void 0===u?.1:u,a=t.type,p=void 0===a?"sine":a;if(void 0!==window.AudioContext||void 0!==window.webkitAudioContext){var l=new(window.AudioContext||window.webkitAudioContext),d=l.createGain(),h=l.createOscillator();h.type=p,h.frequency.value=r,h.connect(d),d.connect(l.destination),h.start(),h.stop(l.currentTime+o),d.gain.value=c}}},61593:function(e){"use strict";e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},64458:function(e){"use strict";e.exports={newline:"řádek",delete:"odstranit",space:"prostora","Speech Recognize":"Rozpoznání Řeči",Sound:"Zvuk","Interim Results":"Průběžné Výsledky"}},89601:function(e){"use strict";e.exports={newline:"Zeilenumbruch",delete:"löschen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},87710:function(e){"use strict";e.exports={newline:"nueva línea",delete:"eliminar",space:"espacio","Speech Recognize":"Reconocimiento de Voz",Sound:"Sonido","Interim Results":"Resultados Provisionales"}},15603:function(e){"use strict";e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},84059:function(e){"use strict";e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"Ääni","Interim Results":"Välitulokset"}},13958:function(e){"use strict";e.exports={newline:"nouvelle ligne",delete:"supprimer",space:"espace","Speech Recognize":"Reconnaissance Vocale",Sound:"Son","Interim Results":"Résultats Intermédiaires"}},18717:function(e){"use strict";e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},14765:function(e){"use strict";e.exports={newline:"újsor",delete:"törlés",space:"tér","Speech Recognize":"A Beszéd Felismeri",Sound:"Hang","Interim Results":"Időközi Eredmények"}},77995:function(e){"use strict";e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},25202:function(e,t,n){"use strict";n.r(t),n.d(t,{ar:function(){return i},cs_cz:function(){return o},de:function(){return s},es:function(){return r},fa:function(){return u},fi:function(){return c},fr:function(){return a},he:function(){return p},hu:function(){return l},id:function(){return d},it:function(){return h},ja:function(){return f},ko:function(){return m},mn:function(){return g},nl:function(){return R},pl:function(){return _},pt_br:function(){return S},ru:function(){return v},tr:function(){return w},zh_cn:function(){return z},zh_tw:function(){return y}});var i=n(61593),o=n(64458),s=n(89601),r=n(87710),u=n(15603),c=n(84059),a=n(13958),p=n(18717),l=n(14765),d=n(77995),h=n(92315),f=n(54711),m=n(68632),g=n(76769),R=n(3424),_=n(85454),S=n(64149),v=n(16491),w=n(48948),z=n(84370),y=n(56646)},92315:function(e){"use strict";e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},54711:function(e){"use strict";e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},68632:function(e){"use strict";e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},76769:function(e){"use strict";e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},3424:function(e){"use strict";e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},85454:function(e){"use strict";e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},64149:function(e){"use strict";e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provisórios"}},16491:function(e){"use strict";e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},48948:function(e){"use strict";e.exports={newline:"yeni satır",delete:"silmek",space:"uzay","Speech Recognize":"Konuşma Tanıma",Sound:"Ses","Interim Results":"Ara Sonuçlar"}},84370:function(e){"use strict";e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},56646:function(e){"use strict";e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},37873:function(e,t,n){"use strict";n.r(t),n.d(t,{SpeechRecognizeNative:function(){return h}});var i=n(31635),o=n(37075),s=n(66927),r=n(55186),u=n(56298),c=n(84976),a=n(71005),p=(n(71096),n(46173)),l=n(50834),d=n(25202),h=function(e){function t(t){var n=e.call(this,t)||this;return n._commandToWord={},t.o.speechRecognize.api&&t.registerButton({group:"state",name:"speechRecognize"}),n}return(0,i.C6)(t,e),t.prototype.afterInit=function(e){var t=this,n=e.o.speechRecognize.commands;n&&((0,u.JW)(d),(0,c.HP)(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()}))}))})))},t.prototype.beforeDestruct=function(e){},t.prototype.onSpeechRecognizeProgressResult=function(e){var t=this;this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),this.j.workplace.appendChild(this.messagePopup),this.j.async.setTimeout((function(){r.J.safeRemove(t.messagePopup)}),{label:"onSpeechRecognizeProgressResult",timeout:1e3}),this.messagePopup.innerText=e+"|"},t.prototype.onSpeechRecognizeResult=function(e){var t=this.j,n=t.s;if(r.J.safeRemove(this.messagePopup),!this._checkCommand(e)){var i=n.range,o=n.current();if(n.isCollapsed()&&r.J.isText(o)&&r.J.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)}},t.prototype._checkCommand=function(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,l.F)(this.j,this._commandToWord[e]),!0)},(0,i.Cg)([(0,s.wB)(":speechRecognizeProgressResult"),(0,o.s)()],t.prototype,"onSpeechRecognizeProgressResult",null),(0,i.Cg)([(0,s.wB)(":speechRecognizeResult")],t.prototype,"onSpeechRecognizeResult",null),t}(a.k);p.x.plugins.add("speech-recognize",h)},22227:function(e){e.exports='<svg viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M8,11c1.657,0,3-1.343,3-3V3c0-1.657-1.343-3-3-3S5,1.343,5,3v5C5,9.657,6.343,11,8,11z"/> <path d="M13,8V6h-1l0,1.844c0,1.92-1.282,3.688-3.164,4.071C6.266,12.438,4,10.479,4,8V6H3v2c0,2.414,1.721,4.434,4,4.899V15H5v1h6 v-1H9v-2.101C11.279,12.434,13,10.414,13,8z"/> </svg>'}},function(e){return e(e.s=37873)}])}));
|
|
10
|
+
!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],{71096:function(e,t,n){"use strict";var i=n(9810),o=n(72197),s=n(931),r=n(71722),u=n(93676),c=n(22227),a=n.n(c),p=n(36115);p.T.prototype.speechRecognize={api:r.o,sound:!0,continuous:!0,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"}},s.I.set("speech-recognize",a()),p.T.prototype.controls.speechRecognize={isActive:function(e,t){var n=(0,o.m)(e,"speech");return Boolean(null==n?void 0:n.isEnabled)},isDisabled:function(e){return!e.o.speechRecognize.api},exec:function(e,t,n){var s=n.button,r=n.control,c=e.o.speechRecognize,a=c.api,p=c.lang,l=c.continuous,d=c.interimResults,h=c.sound;if(a){var f=(0,o.m)(e,"speech");if(!f){var m=new a;(f=new u.g(e.async,m)).lang=p,f.continuous=l,f.interimResults=d,f.sound=h,(0,o.m)(e,"speech",f),f.on("pulse",(function(e){s.setMod("pulse",e)})),f.on("result",(function(t){return e.e.fire("speechRecognizeResult",t)})),f.on("progress",(function(t){return e.e.fire("speechRecognizeProgressResult",t)})),s.hookStatus("beforeDestruct",(function(){f.destruct()}))}if(r.args){var g=r.args[0];if((0,i.L)(f[g]))return f[g]=!f[g],void(f.isEnabled&&f.restart())}f.toggle(),s.state.activated=f.isEnabled}else e.alert("Speech recognize API unsupported in your browser")},name:"speechRecognize",command:"toggleSpeechRecognize",tooltip:"Speech Recognize",list:{sound:"Sound",interimResults:"Interim Results"},childTemplate:function(e,t,n){var i,s=(0,o.m)(e,"speech"),r=null!==(i=null==s?void 0:s[t])&&void 0!==i?i:e.o.speechRecognize[t];return"<span class='jodit-speech-recognize__list-item'><input ".concat(r?"checked":""," class='jodit-checkbox' type='checkbox'> ").concat(n,"</span>")},mods:{stroke:!1}}},81629:function(e,t,n){"use strict";n.d(t,{N:function(){return i},Z:function(){return o}});var i=440,o=940},71722:function(e,t,n){"use strict";n.d(t,{o:function(){return i}});var i=window.SpeechRecognition||window.webkitSpeechRecognition},50834:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var i=n(31635);function o(e,t){var n=(0,i.zs)(t.split("::"),2);e.execCommand(n[0],null,n[1])}},93676:function(e,t,n){"use strict";n.d(t,{g:function(){return c}});var i=n(31635),o=n(22664),s=n(43431),r=n(95473),u=n(81629),c=function(e){function t(t,i){var o=e.call(this)||this;return o.async=t,o._continuous=!1,o._interimResults=!1,o.sound=!0,o._isEnabled=!1,o._restartTimeout=0,o._onSpeechStart=function(e){o._isEnabled&&(o.async.clearTimeout(o._restartTimeout),o._restartTimeout=o.async.setTimeout((function(){o.restart(),o.emit("pulse",!1),o._makeSound(u.Z)}),5e3),o.emit("pulse",!0))},o._progressTimeout=0,o._api=i,n._instances.add(o),o}var n;return(0,i.C6)(t,e),n=t,Object.defineProperty(t.prototype,"lang",{get:function(){return this._lang},set:function(e){this._lang=e,this._api.lang=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"continuous",{get:function(){return this._continuous},set:function(e){this._continuous=e,this._api.continuous=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"interimResults",{get:function(){return this._interimResults},set:function(e){this._interimResults=e,this._api.interimResults=e},enumerable:!1,configurable:!0}),t.prototype.destruct=function(){this.stop(),n._instances.delete(this),e.prototype.destruct.call(this)},Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this._isEnabled},enumerable:!1,configurable:!0}),t.prototype.start=function(){var e=this;this._isEnabled||(this._isEnabled=!0,n._instances.forEach((function(t){t!==e&&t.stop()})),this._api.start(),this.__on("speechstart",this._onSpeechStart).__on("error",this._onError).__on("result",this._onResult))},t.prototype.stop=function(){if(this._isEnabled){try{this._api.abort(),this._api.stop()}catch(e){}this.__off("speechstart",this._onSpeechStart).__off("error",this._onError).__off("result",this._onResult),this.async.clearTimeout(this._restartTimeout),this._isEnabled=!1,this.emit("pulse",!1)}},t.prototype.toggle=function(){this._isEnabled?this.stop():this.start()},t.prototype.restart=function(){this.stop(),this.start()},t.prototype.__on=function(e,t){return this._api.addEventListener(e,t),this},t.prototype.__off=function(e,t){return this._api.removeEventListener(e,t),this},t.prototype._onResult=function(e){var t=this;if(this._isEnabled){this.async.clearTimeout(this._progressTimeout);var n=e.results.item(e.resultIndex),i=n.item(0).transcript,o=function(){try{t.async.clearTimeout(t._restartTimeout),t.emit("result",i)}catch(e){}t.restart(),t.emit("pulse",!1),t._makeSound(u.N)};if(!1===n.isFinal)return this.emit("progress",i),void(this._progressTimeout=this.async.setTimeout(o,500));o()}},t.prototype._onError=function(){this._isEnabled&&(this._makeSound(u.Z),this.emit("pulse",!1),this.restart())},t.prototype._makeSound=function(e){this.sound&&(0,r.s)({frequency:e})},t._instances=new Set,n=(0,i.Cg)([o.autobind],t)}(s.h)},95473:function(e,t,n){"use strict";n.d(t,{s:function(){return o}});var i=n(81629);function o(e){var t=void 0===e?{}:e,n=t.sec,o=void 0===n?.1:n,s=t.frequency,r=void 0===s?i.N:s,u=t.gain,c=void 0===u?.1:u,a=t.type,p=void 0===a?"sine":a;if(void 0!==window.AudioContext||void 0!==window.webkitAudioContext){var l=new(window.AudioContext||window.webkitAudioContext),d=l.createGain(),h=l.createOscillator();h.type=p,h.frequency.value=r,h.connect(d),d.connect(l.destination),h.start(),h.stop(l.currentTime+o),d.gain.value=c}}},61593:function(e){"use strict";e.exports={newline:"الخط الجديد",delete:"حذف",space:"الفضاء","Speech Recognize":"التعرف على الكلام",Sound:"الصوت","Interim Results":"النتائج المؤقتة"}},64458:function(e){"use strict";e.exports={newline:"řádek",delete:"odstranit",space:"prostora","Speech Recognize":"Rozpoznání Řeči",Sound:"Zvuk","Interim Results":"Průběžné Výsledky"}},89601:function(e){"use strict";e.exports={newline:"Zeilenumbruch",delete:"löschen",space:"Raum","Speech Recognize":"Sprache Erkennen",Sound:"Sound","Interim Results":"Zwischenergebnis"}},87710:function(e){"use strict";e.exports={newline:"nueva línea",delete:"eliminar",space:"espacio","Speech Recognize":"Reconocimiento de Voz",Sound:"Sonido","Interim Results":"Resultados Provisionales"}},15603:function(e){"use strict";e.exports={newline:"خط جدید",delete:"حذف",space:"فضا","Speech Recognize":"گفتار را تشخیص دهید",Sound:"صدا","Interim Results":"نتایج موقت"}},84059:function(e){"use strict";e.exports={"Speech Recognize":"Puheentunnistus",newline:"uusi rivi",delete:"poistaa",space:"tilaa",Sound:"Ääni","Interim Results":"Välitulokset"}},13958:function(e){"use strict";e.exports={newline:"nouvelle ligne",delete:"supprimer",space:"espace","Speech Recognize":"Reconnaissance Vocale",Sound:"Son","Interim Results":"Résultats Intermédiaires"}},18717:function(e){"use strict";e.exports={newline:"חדשות",delete:"מחק",space:"שטח","Speech Recognize":"דיבור מזהה",Sound:"קול","Interim Results":"תוצאות ביניים"}},14765:function(e){"use strict";e.exports={newline:"újsor",delete:"törlés",space:"tér","Speech Recognize":"A Beszéd Felismeri",Sound:"Hang","Interim Results":"Időközi Eredmények"}},77995:function(e){"use strict";e.exports={newline:"newline",delete:"Hapus",space:"ruang","Speech Recognize":"Pidato Mengenali",Sound:"Suara","Interim Results":"Hasil Sementara"}},25202:function(e,t,n){"use strict";n.r(t),n.d(t,{ar:function(){return i},cs_cz:function(){return o},de:function(){return s},es:function(){return r},fa:function(){return u},fi:function(){return c},fr:function(){return a},he:function(){return p},hu:function(){return l},id:function(){return d},it:function(){return h},ja:function(){return f},ko:function(){return m},mn:function(){return g},nl:function(){return R},pl:function(){return _},pt_br:function(){return S},ru:function(){return v},tr:function(){return w},zh_cn:function(){return z},zh_tw:function(){return y}});var i=n(61593),o=n(64458),s=n(89601),r=n(87710),u=n(15603),c=n(84059),a=n(13958),p=n(18717),l=n(14765),d=n(77995),h=n(92315),f=n(54711),m=n(68632),g=n(76769),R=n(3424),_=n(85454),S=n(64149),v=n(16491),w=n(48948),z=n(84370),y=n(56646)},92315:function(e){"use strict";e.exports={newline:"nuova riga",delete:"eliminare",space:"spazio","Speech Recognize":"Discorso Riconoscere",Sound:"Suono","Interim Results":"Risultati intermedi"}},54711:function(e){"use strict";e.exports={newline:"改行",delete:"削除",space:"スペース","Speech Recognize":"音声認識",Sound:"音","Interim Results":"中間結果"}},68632:function(e){"use strict";e.exports={newline:"줄 바꿈",delete:"삭제",space:"공간","Speech Recognize":"음성 인식",Sound:"소리","Interim Results":"중간 결과"}},76769:function(e){"use strict";e.exports={newline:"Шинэ мөр",delete:"Устгах",space:"Зай","Speech Recognize":"Дуу хоолой таних",Sound:"Дуу","Interim Results":"Түр зуурын үр дүн"}},3424:function(e){"use strict";e.exports={newline:"regel",delete:"verwijderen",space:"ruimte","Speech Recognize":"Spraak Herkennen",Sound:"Geluid","Interim Results":"Tussentijdse Resultaten"}},85454:function(e){"use strict";e.exports={newline:"newline",delete:"usunąć",space:"przestrzeń","Speech Recognize":"Rozpoznawanie Mowy",Sound:"Dźwięk","Interim Results":"Wyniki Okresowe"}},64149:function(e){"use strict";e.exports={newline:"linha",delete:"excluir",space:"espaco","Speech Recognize":"Discurso Reconhecer",Sound:"Som","Interim Results":"Resultados Provisórios"}},16491:function(e){"use strict";e.exports={newline:"новая строка|перенос|энтер",delete:"удалить",space:"пробел","Speech Recognize":"Распознавание речи",Sound:"Звук","Interim Results":"Промежуточные результаты"}},48948:function(e){"use strict";e.exports={newline:"yeni satır",delete:"silmek",space:"uzay","Speech Recognize":"Konuşma Tanıma",Sound:"Ses","Interim Results":"Ara Sonuçlar"}},84370:function(e){"use strict";e.exports={newline:"新行",delete:"删除",space:"空间","Speech Recognize":"言语识别",Sound:"声音","Interim Results":"中期业绩"}},56646:function(e){"use strict";e.exports={newline:"換行",delete:"刪除",space:"空白","Speech Recognize":"語音辨識",Sound:"聲音","Interim Results":"階段性辨識結果"}},37873:function(e,t,n){"use strict";n.r(t),n.d(t,{SpeechRecognizeNative:function(){return h}});var i=n(31635),o=n(37075),s=n(66927),r=n(55186),u=n(56298),c=n(84976),a=n(71005),p=(n(71096),n(46173)),l=n(50834),d=n(25202),h=function(e){function t(t){var n=e.call(this,t)||this;return n._commandToWord={},t.o.speechRecognize.api&&t.registerButton({group:"state",name:"speechRecognize"}),n}return(0,i.C6)(t,e),t.prototype.afterInit=function(e){var t=this,n=e.o.speechRecognize.commands;n&&((0,u.JW)(d),(0,c.HP)(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()}))}))})))},t.prototype.beforeDestruct=function(e){},t.prototype.onSpeechRecognizeProgressResult=function(e){var t=this;this.messagePopup||(this.messagePopup=this.j.create.div("jodit-speech-recognize__popup")),this.j.workplace.appendChild(this.messagePopup),this.j.async.setTimeout((function(){r.J.safeRemove(t.messagePopup)}),{label:"onSpeechRecognizeProgressResult",timeout:1e3}),this.messagePopup.innerText=e+"|"},t.prototype.onSpeechRecognizeResult=function(e){var t=this.j,n=t.s;if(r.J.safeRemove(this.messagePopup),!this._checkCommand(e)){var i=n.range,o=n.current();if(n.isCollapsed()&&r.J.isText(o)&&r.J.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)}},t.prototype._checkCommand=function(e){return e=e.toLowerCase().replace(/\./g,""),!!this._commandToWord[e]&&((0,l.F)(this.j,this._commandToWord[e]),!0)},(0,i.Cg)([(0,s.w)(":speechRecognizeProgressResult"),(0,o.s)()],t.prototype,"onSpeechRecognizeProgressResult",null),(0,i.Cg)([(0,s.w)(":speechRecognizeResult")],t.prototype,"onSpeechRecognizeResult",null),t}(a.k);p.x.plugins.add("speech-recognize",h)},22227:function(e){e.exports='<svg viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <path d="M8,11c1.657,0,3-1.343,3-3V3c0-1.657-1.343-3-3-3S5,1.343,5,3v5C5,9.657,6.343,11,8,11z"/> <path d="M13,8V6h-1l0,1.844c0,1.92-1.282,3.688-3.164,4.071C6.266,12.438,4,10.479,4,8V6H3v2c0,2.414,1.721,4.434,4,4.899V15H5v1h6 v-1H9v-2.101C11.279,12.434,13,10.414,13,8z"/> </svg>'}},function(e){return e(e.s=37873)}])}));
|
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.1.
|
|
6
|
+
export const APP_VERSION = "4.1.14";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -103,6 +103,7 @@ let DataProvider = class DataProvider {
|
|
|
103
103
|
if (process) {
|
|
104
104
|
const respData = process.call(self, resp);
|
|
105
105
|
if (respData.data.permissions) {
|
|
106
|
+
this.parent.events.fire(this, 'changePermissions', this.__currentPermissions, respData.data.permissions);
|
|
106
107
|
this.__currentPermissions = respData.data.permissions;
|
|
107
108
|
}
|
|
108
109
|
}
|
|
@@ -36,6 +36,7 @@ export declare class FileBrowser extends ViewWithToolbar implements IFileBrowser
|
|
|
36
36
|
/**
|
|
37
37
|
* It displays a message in the status bar of filebrowser
|
|
38
38
|
*
|
|
39
|
+
* @param message - The message that will be displayed
|
|
39
40
|
* @param success - true It will be shown a message light . If no option is specified ,
|
|
40
41
|
* ßan error will be shown the red
|
|
41
42
|
* @example
|
|
@@ -65,8 +66,10 @@ export declare class FileBrowser extends ViewWithToolbar implements IFileBrowser
|
|
|
65
66
|
* ```
|
|
66
67
|
*/
|
|
67
68
|
open(callback?: CanUndef<(_: IFileBrowserCallBackData) => void>, onlyImages?: boolean): Promise<void>;
|
|
69
|
+
private __prevButtons;
|
|
68
70
|
private __getButtons;
|
|
69
71
|
private initUploader;
|
|
70
72
|
constructor(options?: IFileBrowserOptions);
|
|
71
73
|
destruct(): void;
|
|
74
|
+
private __updateToolbarButtons;
|
|
72
75
|
}
|
|
@@ -17,6 +17,7 @@ import { STATUSES } from "jodit/esm/core/component/index.js";
|
|
|
17
17
|
import * as consts from "jodit/esm/core/constants.js";
|
|
18
18
|
import { IS_PROD } from "jodit/esm/core/constants.js";
|
|
19
19
|
import { autobind, cache, derive } from "jodit/esm/core/decorators/index.js";
|
|
20
|
+
import { watch } from "jodit/esm/core/decorators/watch/watch.js";
|
|
20
21
|
import { observable } from "jodit/esm/core/event-emitter/index.js";
|
|
21
22
|
import { ConfigProto, error, isAbortError, isFunction, isString, trim } from "jodit/esm/core/helpers/index.js";
|
|
22
23
|
import { Storage } from "jodit/esm/core/storage/index.js";
|
|
@@ -89,6 +90,7 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
89
90
|
/**
|
|
90
91
|
* It displays a message in the status bar of filebrowser
|
|
91
92
|
*
|
|
93
|
+
* @param message - The message that will be displayed
|
|
92
94
|
* @param success - true It will be shown a message light . If no option is specified ,
|
|
93
95
|
* ßan error will be shown the red
|
|
94
96
|
* @example
|
|
@@ -147,7 +149,8 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
147
149
|
.off('select.filebrowser')
|
|
148
150
|
.on('select.filebrowser', this.onSelect(callback));
|
|
149
151
|
const header = this.c.div();
|
|
150
|
-
this.toolbar?.
|
|
152
|
+
this.toolbar?.appendTo(header);
|
|
153
|
+
this.__updateToolbarButtons();
|
|
151
154
|
this._dialog.open(this.browser, header);
|
|
152
155
|
this.e.fire('sort.filebrowser', this.state.sortBy);
|
|
153
156
|
loadTree(this).then(resolve, reject);
|
|
@@ -228,6 +231,7 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
228
231
|
this.close = () => {
|
|
229
232
|
this._dialog.close();
|
|
230
233
|
};
|
|
234
|
+
this.__prevButtons = [];
|
|
231
235
|
this.attachEvents(options);
|
|
232
236
|
const self = this;
|
|
233
237
|
self.options = ConfigProto(options || {}, Config.defaultOptions.filebrowser);
|
|
@@ -302,6 +306,14 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
|
|
|
302
306
|
this.events && this.e.off('.filebrowser');
|
|
303
307
|
this.uploader && this.uploader.destruct();
|
|
304
308
|
}
|
|
309
|
+
__updateToolbarButtons() {
|
|
310
|
+
const buttons = this.__getButtons();
|
|
311
|
+
if (isEqualButtonList(this.__prevButtons, buttons)) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
this.__prevButtons = buttons;
|
|
315
|
+
this.toolbar?.build(buttons);
|
|
316
|
+
}
|
|
305
317
|
};
|
|
306
318
|
__decorate([
|
|
307
319
|
cache
|
|
@@ -318,7 +330,21 @@ __decorate([
|
|
|
318
330
|
__decorate([
|
|
319
331
|
autobind
|
|
320
332
|
], FileBrowser.prototype, "open", null);
|
|
333
|
+
__decorate([
|
|
334
|
+
watch('dataProvider:changePermissions')
|
|
335
|
+
], FileBrowser.prototype, "__updateToolbarButtons", null);
|
|
321
336
|
FileBrowser = __decorate([
|
|
322
337
|
derive(Dlgs)
|
|
323
338
|
], FileBrowser);
|
|
324
339
|
export { FileBrowser };
|
|
340
|
+
function isEqualButtonList(prevButtons, buttons) {
|
|
341
|
+
if (prevButtons.length !== buttons.length) {
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
for (let i = 0; i < prevButtons.length; i++) {
|
|
345
|
+
if (prevButtons[i] !== buttons[i]) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
@@ -17,6 +17,8 @@ import "./config";
|
|
|
17
17
|
export declare class aiAssistant extends Plugin {
|
|
18
18
|
/** @override */
|
|
19
19
|
buttons: Plugin['buttons'];
|
|
20
|
+
private get __dialog();
|
|
21
|
+
private get __container();
|
|
20
22
|
constructor(jodit: IJodit);
|
|
21
23
|
/** @override */
|
|
22
24
|
afterInit(jodit: IJodit): void;
|
|
@@ -13,7 +13,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
13
13
|
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
|
-
import
|
|
16
|
+
import { cache } from "jodit/esm/core/decorators/cache/cache.js";
|
|
17
|
+
import { watch } from "jodit/esm/core/decorators/watch/watch.js";
|
|
17
18
|
import { extendLang, pluginSystem } from "jodit/esm/core/global.js";
|
|
18
19
|
import { isAbortError } from "jodit/esm/core/helpers/checker/is-abort-error.js";
|
|
19
20
|
import { Plugin } from "jodit/esm/core/plugin/plugin.js";
|
|
@@ -24,6 +25,32 @@ import * as langs from "./langs";
|
|
|
24
25
|
* The plugin inserts content generated by AI into the editor.
|
|
25
26
|
*/
|
|
26
27
|
export class aiAssistant extends Plugin {
|
|
28
|
+
get __dialog() {
|
|
29
|
+
return this.jodit.dlg({
|
|
30
|
+
buttons: ['fullsize', 'dialog.close'],
|
|
31
|
+
closeOnClickOverlay: true,
|
|
32
|
+
closeOnEsc: true,
|
|
33
|
+
resizable: false,
|
|
34
|
+
draggable: true,
|
|
35
|
+
minHeight: 160
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
get __container() {
|
|
39
|
+
const { jodit, __dialog } = this;
|
|
40
|
+
return new UiAiAssistant(jodit, {
|
|
41
|
+
onInsertAfter(html) {
|
|
42
|
+
jodit.s.focus();
|
|
43
|
+
jodit.s.setCursorAfter(jodit.s.current());
|
|
44
|
+
jodit.s.insertHTML(html);
|
|
45
|
+
__dialog.close();
|
|
46
|
+
},
|
|
47
|
+
onInsert(html) {
|
|
48
|
+
jodit.s.focus();
|
|
49
|
+
jodit.s.insertHTML(html);
|
|
50
|
+
__dialog.close();
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
27
54
|
constructor(jodit) {
|
|
28
55
|
super(jodit);
|
|
29
56
|
/** @override */
|
|
@@ -42,33 +69,8 @@ export class aiAssistant extends Plugin {
|
|
|
42
69
|
/** @override */
|
|
43
70
|
afterInit(jodit) { }
|
|
44
71
|
onGenerateAiAssistantForm(prompt) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
buttons: ['fullsize', 'dialog.close'],
|
|
48
|
-
closeOnClickOverlay: true,
|
|
49
|
-
closeOnEsc: true,
|
|
50
|
-
resizable: false,
|
|
51
|
-
draggable: true
|
|
52
|
-
// minWidth: 460,
|
|
53
|
-
// maxWidth: 460
|
|
54
|
-
});
|
|
55
|
-
dialog.bindDestruct(jodit);
|
|
56
|
-
const container = new UiAiAssistant(jodit, {
|
|
57
|
-
onInsertAfter(html) {
|
|
58
|
-
jodit.s.focus();
|
|
59
|
-
jodit.s.setCursorAfter(jodit.s.current());
|
|
60
|
-
jodit.s.insertHTML(html);
|
|
61
|
-
dialog.close();
|
|
62
|
-
},
|
|
63
|
-
onInsert(html) {
|
|
64
|
-
jodit.s.focus();
|
|
65
|
-
jodit.s.insertHTML(html);
|
|
66
|
-
dialog.close();
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
container.bindDestruct(dialog);
|
|
70
|
-
dialog.open(container, 'AI Assistant', true, false);
|
|
71
|
-
container.setPrompt(prompt);
|
|
72
|
+
this.__dialog.open(this.__container, 'AI Assistant');
|
|
73
|
+
this.__container.setPrompt(prompt);
|
|
72
74
|
}
|
|
73
75
|
onInvokeAiAssistant(prompt) {
|
|
74
76
|
const { jodit } = this;
|
|
@@ -97,8 +99,17 @@ export class aiAssistant extends Plugin {
|
|
|
97
99
|
});
|
|
98
100
|
}
|
|
99
101
|
/** @override */
|
|
100
|
-
beforeDestruct(_) {
|
|
102
|
+
beforeDestruct(_) {
|
|
103
|
+
this.__container.destruct();
|
|
104
|
+
this.__dialog.destruct();
|
|
105
|
+
}
|
|
101
106
|
}
|
|
107
|
+
__decorate([
|
|
108
|
+
cache
|
|
109
|
+
], aiAssistant.prototype, "__dialog", null);
|
|
110
|
+
__decorate([
|
|
111
|
+
cache
|
|
112
|
+
], aiAssistant.prototype, "__container", null);
|
|
102
113
|
__decorate([
|
|
103
114
|
watch(':generateAiAssistantForm.ai-assistant')
|
|
104
115
|
], aiAssistant.prototype, "onGenerateAiAssistantForm", null);
|
|
@@ -14,7 +14,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
16
|
import { component } from "jodit/esm/core/decorators/component/component.js";
|
|
17
|
-
import watch from "jodit/esm/core/decorators/watch/watch.js";
|
|
17
|
+
import { watch } from "jodit/esm/core/decorators/watch/watch.js";
|
|
18
18
|
import { Dom } from "jodit/esm/core/dom/dom.js";
|
|
19
19
|
import { isString } from "jodit/esm/core/helpers/checker/is-string.js";
|
|
20
20
|
import { Button, UIBlock, UIForm, UITextArea } from "jodit/esm/core/ui/index.js";
|
package/package.json
CHANGED
|
@@ -36,6 +36,7 @@ export declare class FileBrowser extends ViewWithToolbar implements IFileBrowser
|
|
|
36
36
|
/**
|
|
37
37
|
* It displays a message in the status bar of filebrowser
|
|
38
38
|
*
|
|
39
|
+
* @param message - The message that will be displayed
|
|
39
40
|
* @param success - true It will be shown a message light . If no option is specified ,
|
|
40
41
|
* ßan error will be shown the red
|
|
41
42
|
* @example
|
|
@@ -65,8 +66,10 @@ export declare class FileBrowser extends ViewWithToolbar implements IFileBrowser
|
|
|
65
66
|
* ```
|
|
66
67
|
*/
|
|
67
68
|
open(callback?: CanUndef<(_: IFileBrowserCallBackData) => void>, onlyImages?: boolean): Promise<void>;
|
|
69
|
+
private __prevButtons;
|
|
68
70
|
private __getButtons;
|
|
69
71
|
private initUploader;
|
|
70
72
|
constructor(options?: IFileBrowserOptions);
|
|
71
73
|
destruct(): void;
|
|
74
|
+
private __updateToolbarButtons;
|
|
72
75
|
}
|
|
@@ -17,6 +17,8 @@ import "./config";
|
|
|
17
17
|
export declare class aiAssistant extends Plugin {
|
|
18
18
|
/** @override */
|
|
19
19
|
buttons: Plugin['buttons'];
|
|
20
|
+
private get __dialog();
|
|
21
|
+
private get __container();
|
|
20
22
|
constructor(jodit: IJodit);
|
|
21
23
|
/** @override */
|
|
22
24
|
afterInit(jodit: IJodit): void;
|