@ckeditor/ckeditor5-ai 40.0.0 → 40.1.0
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/LICENSE.md +2 -2
- package/build/ai.js +2 -2
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/uz.js +1 -0
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/contexts.json +1 -0
- package/lang/translations/af.po +60 -16
- package/lang/translations/ar.po +60 -16
- package/lang/translations/bg.po +60 -16
- package/lang/translations/bn.po +60 -16
- package/lang/translations/bs.po +60 -16
- package/lang/translations/ca.po +60 -16
- package/lang/translations/cs.po +60 -16
- package/lang/translations/da.po +60 -16
- package/lang/translations/de-ch.po +60 -16
- package/lang/translations/de.po +60 -16
- package/lang/translations/el.po +60 -16
- package/lang/translations/en-au.po +60 -16
- package/lang/translations/en.po +60 -16
- package/lang/translations/es-co.po +60 -16
- package/lang/translations/es.po +60 -16
- package/lang/translations/et.po +60 -16
- package/lang/translations/fa.po +60 -16
- package/lang/translations/fi.po +60 -16
- package/lang/translations/fr.po +60 -16
- package/lang/translations/gl.po +60 -16
- package/lang/translations/he.po +60 -16
- package/lang/translations/hi.po +60 -16
- package/lang/translations/hr.po +93 -49
- package/lang/translations/hu.po +60 -16
- package/lang/translations/id.po +60 -16
- package/lang/translations/it.po +60 -16
- package/lang/translations/ja.po +60 -16
- package/lang/translations/jv.po +60 -16
- package/lang/translations/ko.po +60 -16
- package/lang/translations/lt.po +60 -16
- package/lang/translations/lv.po +60 -16
- package/lang/translations/ms.po +60 -16
- package/lang/translations/nl.po +60 -16
- package/lang/translations/no.po +60 -16
- package/lang/translations/pl.po +60 -16
- package/lang/translations/pt-br.po +60 -16
- package/lang/translations/pt.po +60 -16
- package/lang/translations/ro.po +60 -16
- package/lang/translations/ru.po +60 -16
- package/lang/translations/sk.po +60 -16
- package/lang/translations/sr-latn.po +60 -16
- package/lang/translations/sr.po +60 -16
- package/lang/translations/sv.po +60 -16
- package/lang/translations/th.po +60 -16
- package/lang/translations/tk.po +60 -16
- package/lang/translations/tr.po +60 -16
- package/lang/translations/ug.po +94 -50
- package/lang/translations/uk.po +60 -16
- package/lang/translations/ur.po +60 -16
- package/lang/translations/uz.po +226 -0
- package/lang/translations/vi.po +60 -16
- package/lang/translations/zh-cn.po +60 -16
- package/lang/translations/zh.po +60 -16
- package/package.json +3 -3
- package/src/aiassistant.d.ts +458 -419
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.d.ts +45 -45
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.d.ts +44 -46
- package/src/aiassistantui.js +1 -1
- package/src/aiconnector.d.ts +45 -44
- package/src/aiconnector.js +1 -1
- package/src/augmentation.d.ts +26 -26
- package/src/index.d.ts +9 -9
- package/src/ui/aiassistantcontroller.d.ts +96 -59
- package/src/ui/aiassistantcontroller.js +1 -1
- package/src/ui/dropdown/aicommandslistview.d.ts +22 -22
- package/src/ui/dropdown/aicommandslistview.js +1 -1
- package/src/ui/dropdown/buttonlabelwithhighlightview.d.ts +29 -29
- package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
- package/src/ui/dropdown/labelwithhighlightview.d.ts +25 -0
- package/src/ui/dropdown/labelwithhighlightview.js +23 -0
- package/src/ui/form/aiformcontentarea.d.ts +48 -48
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.d.ts +26 -26
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.d.ts +46 -46
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.d.ts +54 -41
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.d.ts +142 -131
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.d.ts +18 -18
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.d.ts +35 -35
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.d.ts +20 -20
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.d.ts +26 -26
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.d.ts +9 -9
- package/src/utils/common-translations.js +1 -1
- package/theme/ai-form.css +58 -11
- package/theme/ai.css +20 -15
package/src/aiassistant.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const _0x1c9f=['casual','aiAssistant.removeCommands','aiLicenseKeyTrial','journalism','translate','Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.','makeLonger','Professional','legal','translatePortuguese','Translate\x20the\x20content\x20to\x20English\x20language.','Direct','Confident','destroy','direct','translateHindi','_licenseKeyCheckInterval','Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.','ai-invalid-license-key','AIAssistant','summarize','aiAssistant.commands','Journalism','Simplified\x20Chinese','includes','German','Arabic','Translate\x20the\x20content\x20to\x20Arabic\x20language.','commands','Translate\x20to\x20%0','Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.','makeShorter','push','Summarize','translateGerman','Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.','aiLicenseKeyValid','Translate\x20the\x20content\x20to\x20German\x20language.','config','changeStyle','aiLicenseKeyTrialLimit:operations','changeTone','Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.','Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.','filter','Business','Legal','editOrReview','Make\x20longer','locale','info','Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.','find','forEach','translateEnglish','Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.','Continue','aiLicenseKeyInvalid','Make\x20shorter','Translate\x20the\x20content\x20to\x20Spanish\x20language.','poetic','Translate\x20the\x20content\x20to\x20Hindi\x20language.','init','define','generate','get','requires','translateChinese','English','translateFrench','Generate\x20from\x20selection','Portuguese','Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.','simplifyLanguage','Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.','friendly','Translate','groupId','Friendly','Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.','Change\x20style','Improve\x20writing','business','Change\x20tone','Simplify\x20language','Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.','set','Edit\x20or\x20review','Spanish','translateArabic','improveWriting','Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.','concat','French','licenseKey','continue','Translate\x20the\x20content\x20to\x20Portuguese\x20language.','professional','Hindi','translateSpanish','Casual','Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'];(function(_0x54f87b,_0x1c9f3b){const _0x2a897e=function(_0x468bcb){while(--_0x468bcb){_0x54f87b['push'](_0x54f87b['shift']());}};_0x2a897e(++_0x1c9f3b);}(_0x1c9f,0x1c9));const _0x2a89=function(_0x54f87b,_0x1c9f3b){_0x54f87b=_0x54f87b-0x0;let _0x2a897e=_0x1c9f[_0x54f87b];return _0x2a897e;};import{CKEditorError as _0x348d4c}from'ckeditor5/src/utils';import{Plugin as _0x2f20af}from'ckeditor5/src/core';import _0xa04d44 from'./aiassistantui';import _0x272b3c from'./aiassistantediting';import _0x462e05 from'./aiconnector';import{getTranslation as _0x2f5da4}from'./utils/common-translations';export const getDefaultCommands=_0x2f04a4=>[{'groupId':_0x2a89('0x64'),'groupLabel':_0x2f5da4(_0x2f04a4,_0x2a89('0x26')),'commands':[{'id':_0x2a89('0x29'),'label':_0x2f5da4(_0x2f04a4,'Improve\x20writing'),'prompt':_0x2a89('0x19')},{'id':'makeShorter','label':_0x2f5da4(_0x2f04a4,_0x2a89('0x9')),'prompt':_0x2a89('0x24')},{'id':_0x2a89('0x3b'),'label':_0x2f5da4(_0x2f04a4,'Make\x20longer'),'prompt':_0x2a89('0x17')},{'id':'simplifyLanguage','label':_0x2f5da4(_0x2f04a4,'Simplify\x20language'),'prompt':_0x2a89('0x53')}]},{'groupId':_0x2a89('0xf'),'groupLabel':_0x2f5da4(_0x2f04a4,_0x2a89('0x15')),'commands':[{'id':_0x2a89('0x49'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x56')),'prompt':_0x2a89('0x6')},{'id':_0x2a89('0x2e'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x7')),'prompt':_0x2a89('0x2a')}]},{'groupId':_0x2a89('0x5e'),'groupLabel':_0x2f5da4(_0x2f04a4,'Change\x20tone'),'commands':[{'id':_0x2a89('0x30'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x3c')),'prompt':_0x2a89('0x58')},{'id':_0x2a89('0x35'),'label':_0x2f5da4(_0x2f04a4,'Casual'),'prompt':_0x2a89('0x1e')},{'id':_0x2a89('0x43'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x40')),'prompt':_0x2a89('0x3a')},{'id':'confident','label':_0x2f5da4(_0x2f04a4,_0x2a89('0x41')),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':_0x2a89('0x1a'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x1d')),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':_0x2a89('0x5c'),'groupLabel':_0x2f5da4(_0x2f04a4,_0x2a89('0x1f')),'commands':[{'id':_0x2a89('0x21'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x62')),'prompt':_0x2a89('0x46')},{'id':_0x2a89('0x3d'),'label':_0x2f5da4(_0x2f04a4,'Legal'),'prompt':_0x2a89('0x5f')},{'id':'journalism','label':_0x2f5da4(_0x2f04a4,_0x2a89('0x4b')),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':_0x2a89('0xb'),'label':_0x2f5da4(_0x2f04a4,'Poetic'),'prompt':_0x2a89('0x2')}]},{'groupId':_0x2a89('0x39'),'groupLabel':_0x2f5da4(_0x2f04a4,_0x2a89('0x1b')),'commands':[{'id':_0x2a89('0x5'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x52'),[_0x2f5da4(_0x2f04a4,_0x2a89('0x13'))]),'prompt':_0x2a89('0x3f')},{'id':_0x2a89('0x32'),'label':_0x2f5da4(_0x2f04a4,'Translate\x20to\x20%0',[_0x2f5da4(_0x2f04a4,_0x2a89('0x27'))]),'prompt':_0x2a89('0xa')},{'id':_0x2a89('0x3e'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x52'),[_0x2f5da4(_0x2f04a4,_0x2a89('0x16'))]),'prompt':_0x2a89('0x2f')},{'id':_0x2a89('0x57'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x52'),[_0x2f5da4(_0x2f04a4,_0x2a89('0x4e'))]),'prompt':_0x2a89('0x5a')},{'id':_0x2a89('0x14'),'label':_0x2f5da4(_0x2f04a4,'Translate\x20to\x20%0',[_0x2f5da4(_0x2f04a4,_0x2a89('0x2c'))]),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':_0x2a89('0x12'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x52'),[_0x2f5da4(_0x2f04a4,'Simplified\x20Chinese')]),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':_0x2f5da4(_0x2f04a4,_0x2a89('0x52'),[_0x2f5da4(_0x2f04a4,_0x2a89('0x31'))]),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':_0x2a89('0x28'),'label':_0x2f5da4(_0x2f04a4,_0x2a89('0x52'),[_0x2f5da4(_0x2f04a4,'Arabic')]),'prompt':_0x2a89('0x50')}]}];export default class l extends _0x2f20af{static get[_0x2a89('0x11')](){return[_0xa04d44,_0x272b3c,_0x462e05];}static get['pluginName'](){return _0x2a89('0x48');}constructor(_0x2413dc){super(_0x2413dc);const _0x3b2219=_0x2413dc[_0x2a89('0x5b')];var _0x14f71f;_0x3b2219['define']('aiAssistant.commands',(_0x14f71f=_0x2413dc[_0x2a89('0x0')],[{'groupId':'editOrReview','groupLabel':_0x2f5da4(_0x14f71f,_0x2a89('0x26')),'commands':[{'id':_0x2a89('0x29'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x20')),'prompt':_0x2a89('0x19')},{'id':_0x2a89('0x54'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x9')),'prompt':_0x2a89('0x24')},{'id':_0x2a89('0x3b'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x65')),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':_0x2a89('0x18'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x23')),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':_0x2a89('0xf'),'groupLabel':_0x2f5da4(_0x14f71f,_0x2a89('0x15')),'commands':[{'id':'summarize','label':_0x2f5da4(_0x14f71f,'Summarize'),'prompt':_0x2a89('0x6')},{'id':_0x2a89('0x2e'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x7')),'prompt':_0x2a89('0x2a')}]},{'groupId':'changeTone','groupLabel':_0x2f5da4(_0x14f71f,_0x2a89('0x22')),'commands':[{'id':_0x2a89('0x30'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x3c')),'prompt':_0x2a89('0x58')},{'id':_0x2a89('0x35'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x33')),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':_0x2a89('0x43'),'label':_0x2f5da4(_0x14f71f,'Direct'),'prompt':_0x2a89('0x3a')},{'id':'confident','label':_0x2f5da4(_0x14f71f,_0x2a89('0x41')),'prompt':_0x2a89('0x34')},{'id':'friendly','label':_0x2f5da4(_0x14f71f,_0x2a89('0x1d')),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':_0x2f5da4(_0x14f71f,_0x2a89('0x1f')),'commands':[{'id':_0x2a89('0x21'),'label':_0x2f5da4(_0x14f71f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':_0x2f5da4(_0x14f71f,_0x2a89('0x63')),'prompt':_0x2a89('0x5f')},{'id':_0x2a89('0x38'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x4b')),'prompt':_0x2a89('0x60')},{'id':_0x2a89('0xb'),'label':_0x2f5da4(_0x14f71f,'Poetic'),'prompt':_0x2a89('0x2')}]},{'groupId':_0x2a89('0x39'),'groupLabel':_0x2f5da4(_0x14f71f,_0x2a89('0x1b')),'commands':[{'id':_0x2a89('0x5'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x52'),[_0x2f5da4(_0x14f71f,_0x2a89('0x13'))]),'prompt':_0x2a89('0x3f')},{'id':'translateSpanish','label':_0x2f5da4(_0x14f71f,_0x2a89('0x52'),[_0x2f5da4(_0x14f71f,'Spanish')]),'prompt':_0x2a89('0xa')},{'id':_0x2a89('0x3e'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x52'),[_0x2f5da4(_0x14f71f,_0x2a89('0x16'))]),'prompt':_0x2a89('0x2f')},{'id':'translateGerman','label':_0x2f5da4(_0x14f71f,_0x2a89('0x52'),[_0x2f5da4(_0x14f71f,_0x2a89('0x4e'))]),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':_0x2a89('0x14'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x52'),[_0x2f5da4(_0x14f71f,'French')]),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':_0x2a89('0x12'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x52'),[_0x2f5da4(_0x14f71f,_0x2a89('0x4c'))]),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':_0x2a89('0x44'),'label':_0x2f5da4(_0x14f71f,_0x2a89('0x52'),[_0x2f5da4(_0x14f71f,_0x2a89('0x31'))]),'prompt':_0x2a89('0xc')},{'id':_0x2a89('0x28'),'label':_0x2f5da4(_0x14f71f,'Translate\x20to\x20%0',[_0x2f5da4(_0x14f71f,_0x2a89('0x4f'))]),'prompt':_0x2a89('0x50')}]}])),_0x3b2219[_0x2a89('0xe')]('aiAssistant.extraCommandGroups',[]),_0x3b2219[_0x2a89('0xe')](_0x2a89('0x36'),[]);const _0x1e3d46=_0x3b2219[_0x2a89('0x10')](_0x2a89('0x4a')),_0x200d3b=_0x3b2219[_0x2a89('0x10')]('aiAssistant.extraCommandGroups'),_0x21b886=_0x3b2219[_0x2a89('0x10')](_0x2a89('0x36'));_0x200d3b[_0x2a89('0x4')](_0x3ebdbc=>{const _0x35cc5c=_0x1e3d46[_0x2a89('0x3')](_0x4d1f35=>_0x4d1f35[_0x2a89('0x1c')]===_0x3ebdbc[_0x2a89('0x1c')]);_0x35cc5c?_0x35cc5c[_0x2a89('0x51')]=_0x35cc5c[_0x2a89('0x51')][_0x2a89('0x2b')](_0x3ebdbc['commands']):_0x1e3d46[_0x2a89('0x55')](_0x3ebdbc);}),_0x1e3d46[_0x2a89('0x4')](_0xcb2cee=>{_0xcb2cee[_0x2a89('0x51')]=_0xcb2cee[_0x2a89('0x51')][_0x2a89('0x61')](_0x36cf93=>!_0x21b886[_0x2a89('0x4d')](_0x36cf93['id']));}),_0x3b2219[_0x2a89('0x25')]('aiAssistant.commands',_0x1e3d46);}[_0x2a89('0xd')](){const _0x279788=this['editor'];this[_0x2a89('0x2d')]=_0x279788['config'][_0x2a89('0x10')](_0x2a89('0x2d')),this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x35e190;for(const _0x4dc2cf in _0x279788){const _0x8eeec7=_0x4dc2cf,_0x5a0aa9=_0x279788[_0x8eeec7];if(_0x2a89('0x37')===_0x5a0aa9||_0x2a89('0x8')===_0x5a0aa9||_0x2a89('0x59')===_0x5a0aa9||_0x2a89('0x5d')===_0x5a0aa9){delete _0x279788[_0x8eeec7],_0x35e190=_0x5a0aa9;break;}}if(_0x2a89('0x8')===_0x35e190)throw clearInterval(this[_0x2a89('0x45')]),new _0x348d4c(_0x2a89('0x47'),null);if(_0x2a89('0x37')===_0x35e190&&console[_0x2a89('0x1')]('You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20ai\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.'),_0x2a89('0x5d')===_0x35e190)throw clearInterval(this[_0x2a89('0x45')]),new _0x348d4c('ai-trial-license-key-reached-limit-changes',null);_0x2a89('0x59')===_0x35e190&&clearInterval(this['_licenseKeyCheckInterval']);},0x3e8);}[_0x2a89('0x42')](){this['_licenseKeyCheckInterval']&&clearInterval(this[_0x2a89('0x45')]);}}
|
|
23
|
+
const _0x2076=['Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.','Change\x20tone','Translate\x20the\x20content\x20to\x20Spanish\x20language.','confident','Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.','translatePortuguese','Journalism','Legal','aiLicenseKeyValid','Simplify\x20language','Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.','Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.','changeTone','poetic','push','aiAssistant.commands','Professional','translateGerman','Generate\x20from\x20selection','improveWriting','translateFrench','_licenseKeyCheckInterval','Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.','translateChinese','Poetic','German','French','config','Casual','filter','continue','ai-invalid-license-key','Translate\x20the\x20content\x20to\x20German\x20language.','editOrReview','define','Direct','makeShorter','Arabic','aiAssistant.extraCommandGroups','Translate\x20the\x20content\x20to\x20English\x20language.','Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.','Translate\x20the\x20content\x20to\x20French\x20language.','translateSpanish','Spanish','init','Change\x20style','casual','info','Edit\x20or\x20review','makeLonger','Hindi','aiLicenseKeyInvalid','professional','Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.','ai-trial-license-key-reached-limit-changes','aiAssistant.removeCommands','translateEnglish','Translate\x20the\x20content\x20to\x20Portuguese\x20language.','Simplified\x20Chinese','journalism','Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.','translateHindi','Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.','translate','locale','destroy','legal','generate','licenseKey','requires','Portuguese','Translate\x20to\x20%0','Improve\x20writing','friendly','simplifyLanguage','Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.','aiLicenseKeyTrial','Summarize','Friendly','get','English','Continue','Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.','Make\x20longer','commands','includes','Translate','business','summarize','aiLicenseKeyTrialLimit:operations','Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.','groupId','Translate\x20the\x20content\x20to\x20Arabic\x20language.','translateArabic','Confident','Translate\x20the\x20content\x20to\x20Hindi\x20language.','Business'];(function(_0x282cf1,_0x20760a){const _0x376ca6=function(_0x436f8e){while(--_0x436f8e){_0x282cf1['push'](_0x282cf1['shift']());}};_0x376ca6(++_0x20760a);}(_0x2076,0x10c));const _0x376c=function(_0x282cf1,_0x20760a){_0x282cf1=_0x282cf1-0x0;let _0x376ca6=_0x2076[_0x282cf1];return _0x376ca6;};import{CKEditorError as _0x2a14ef}from'ckeditor5/src/utils';import{Plugin as _0x425378}from'ckeditor5/src/core';import _0x893417 from'./aiassistantui';import _0x2657d7 from'./aiassistantediting';import _0x14f7e0 from'./aiconnector';import{getTranslation as _0x45c5cd}from'./utils/common-translations';export const getDefaultCommands=_0x14bf34=>[{'groupId':_0x376c('0x38'),'groupLabel':_0x45c5cd(_0x14bf34,_0x376c('0x47')),'commands':[{'id':_0x376c('0x2a'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x5f')),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':_0x376c('0x3b'),'label':_0x45c5cd(_0x14bf34,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':_0x45c5cd(_0x14bf34,_0x376c('0x9')),'prompt':_0x376c('0x1b')},{'id':'simplifyLanguage','label':_0x45c5cd(_0x14bf34,_0x376c('0x20')),'prompt':_0x376c('0x10')}]},{'groupId':'generate','groupLabel':_0x45c5cd(_0x14bf34,_0x376c('0x29')),'commands':[{'id':_0x376c('0xe'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x3')),'prompt':_0x376c('0x2d')},{'id':_0x376c('0x35'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x7')),'prompt':_0x376c('0x21')}]},{'groupId':_0x376c('0x23'),'groupLabel':_0x45c5cd(_0x14bf34,_0x376c('0x18')),'commands':[{'id':'professional','label':_0x45c5cd(_0x14bf34,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':_0x376c('0x45'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x33')),'prompt':_0x376c('0x17')},{'id':'direct','label':_0x45c5cd(_0x14bf34,_0x376c('0x3a')),'prompt':_0x376c('0x4c')},{'id':_0x376c('0x1a'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x14')),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':_0x376c('0x60'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x4')),'prompt':_0x376c('0x55')}]},{'groupId':'changeStyle','groupLabel':_0x45c5cd(_0x14bf34,_0x376c('0x44')),'commands':[{'id':_0x376c('0xd'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x16')),'prompt':_0x376c('0x53')},{'id':'legal','label':_0x45c5cd(_0x14bf34,_0x376c('0x1e')),'prompt':_0x376c('0x8')},{'id':_0x376c('0x52'),'label':_0x45c5cd(_0x14bf34,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':_0x376c('0x24'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x2f')),'prompt':_0x376c('0x3f')}]},{'groupId':'translate','groupLabel':_0x45c5cd(_0x14bf34,_0x376c('0xc')),'commands':[{'id':_0x376c('0x4f'),'label':_0x45c5cd(_0x14bf34,'Translate\x20to\x20%0',[_0x45c5cd(_0x14bf34,_0x376c('0x6'))]),'prompt':_0x376c('0x3e')},{'id':_0x376c('0x41'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x5e'),[_0x45c5cd(_0x14bf34,_0x376c('0x42'))]),'prompt':_0x376c('0x19')},{'id':'translatePortuguese','label':_0x45c5cd(_0x14bf34,'Translate\x20to\x20%0',[_0x45c5cd(_0x14bf34,_0x376c('0x5d'))]),'prompt':_0x376c('0x50')},{'id':_0x376c('0x28'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x5e'),[_0x45c5cd(_0x14bf34,_0x376c('0x30'))]),'prompt':_0x376c('0x37')},{'id':_0x376c('0x2b'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x5e'),[_0x45c5cd(_0x14bf34,'French')]),'prompt':_0x376c('0x40')},{'id':_0x376c('0x2e'),'label':_0x45c5cd(_0x14bf34,'Translate\x20to\x20%0',[_0x45c5cd(_0x14bf34,'Simplified\x20Chinese')]),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':_0x376c('0x54'),'label':_0x45c5cd(_0x14bf34,_0x376c('0x5e'),[_0x45c5cd(_0x14bf34,_0x376c('0x49'))]),'prompt':_0x376c('0x15')},{'id':'translateArabic','label':_0x45c5cd(_0x14bf34,_0x376c('0x5e'),[_0x45c5cd(_0x14bf34,_0x376c('0x3c'))]),'prompt':_0x376c('0x12')}]}];export default class l extends _0x425378{static get[_0x376c('0x5c')](){return[_0x893417,_0x2657d7,_0x14f7e0];}static get['pluginName'](){return'AIAssistant';}constructor(_0x3c38d6){super(_0x3c38d6);const _0x12ede1=_0x3c38d6[_0x376c('0x32')];var _0x45a972;_0x12ede1[_0x376c('0x39')](_0x376c('0x26'),(_0x45a972=_0x3c38d6[_0x376c('0x57')],[{'groupId':'editOrReview','groupLabel':_0x45c5cd(_0x45a972,_0x376c('0x47')),'commands':[{'id':'improveWriting','label':_0x45c5cd(_0x45a972,_0x376c('0x5f')),'prompt':_0x376c('0x22')},{'id':_0x376c('0x3b'),'label':_0x45c5cd(_0x45a972,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':_0x376c('0x48'),'label':_0x45c5cd(_0x45a972,'Make\x20longer'),'prompt':_0x376c('0x1b')},{'id':_0x376c('0x0'),'label':_0x45c5cd(_0x45a972,_0x376c('0x20')),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':_0x376c('0x5a'),'groupLabel':_0x45c5cd(_0x45a972,_0x376c('0x29')),'commands':[{'id':'summarize','label':_0x45c5cd(_0x45a972,_0x376c('0x3')),'prompt':_0x376c('0x2d')},{'id':_0x376c('0x35'),'label':_0x45c5cd(_0x45a972,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':_0x376c('0x23'),'groupLabel':_0x45c5cd(_0x45a972,_0x376c('0x18')),'commands':[{'id':_0x376c('0x4b'),'label':_0x45c5cd(_0x45a972,_0x376c('0x27')),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':_0x376c('0x45'),'label':_0x45c5cd(_0x45a972,'Casual'),'prompt':_0x376c('0x17')},{'id':'direct','label':_0x45c5cd(_0x45a972,_0x376c('0x3a')),'prompt':_0x376c('0x4c')},{'id':_0x376c('0x1a'),'label':_0x45c5cd(_0x45a972,_0x376c('0x14')),'prompt':_0x376c('0x1')},{'id':_0x376c('0x60'),'label':_0x45c5cd(_0x45a972,_0x376c('0x4')),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':_0x45c5cd(_0x45a972,'Change\x20style'),'commands':[{'id':_0x376c('0xd'),'label':_0x45c5cd(_0x45a972,_0x376c('0x16')),'prompt':_0x376c('0x53')},{'id':_0x376c('0x59'),'label':_0x45c5cd(_0x45a972,'Legal'),'prompt':_0x376c('0x8')},{'id':_0x376c('0x52'),'label':_0x45c5cd(_0x45a972,_0x376c('0x1d')),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':_0x376c('0x24'),'label':_0x45c5cd(_0x45a972,_0x376c('0x2f')),'prompt':_0x376c('0x3f')}]},{'groupId':_0x376c('0x56'),'groupLabel':_0x45c5cd(_0x45a972,_0x376c('0xc')),'commands':[{'id':'translateEnglish','label':_0x45c5cd(_0x45a972,'Translate\x20to\x20%0',[_0x45c5cd(_0x45a972,_0x376c('0x6'))]),'prompt':_0x376c('0x3e')},{'id':_0x376c('0x41'),'label':_0x45c5cd(_0x45a972,_0x376c('0x5e'),[_0x45c5cd(_0x45a972,'Spanish')]),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':_0x376c('0x1c'),'label':_0x45c5cd(_0x45a972,_0x376c('0x5e'),[_0x45c5cd(_0x45a972,_0x376c('0x5d'))]),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':_0x376c('0x28'),'label':_0x45c5cd(_0x45a972,_0x376c('0x5e'),[_0x45c5cd(_0x45a972,_0x376c('0x30'))]),'prompt':_0x376c('0x37')},{'id':_0x376c('0x2b'),'label':_0x45c5cd(_0x45a972,_0x376c('0x5e'),[_0x45c5cd(_0x45a972,_0x376c('0x31'))]),'prompt':_0x376c('0x40')},{'id':_0x376c('0x2e'),'label':_0x45c5cd(_0x45a972,_0x376c('0x5e'),[_0x45c5cd(_0x45a972,_0x376c('0x51'))]),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':_0x376c('0x54'),'label':_0x45c5cd(_0x45a972,_0x376c('0x5e'),[_0x45c5cd(_0x45a972,_0x376c('0x49'))]),'prompt':_0x376c('0x15')},{'id':_0x376c('0x13'),'label':_0x45c5cd(_0x45a972,'Translate\x20to\x20%0',[_0x45c5cd(_0x45a972,_0x376c('0x3c'))]),'prompt':_0x376c('0x12')}]}])),_0x12ede1[_0x376c('0x39')](_0x376c('0x3d'),[]),_0x12ede1[_0x376c('0x39')](_0x376c('0x4e'),[]);const _0x5c03e0=_0x12ede1[_0x376c('0x5')]('aiAssistant.commands'),_0x312fda=_0x12ede1[_0x376c('0x5')](_0x376c('0x3d')),_0x5e00ad=_0x12ede1['get'](_0x376c('0x4e'));_0x312fda['forEach'](_0x2b1614=>{const _0x59d016=_0x5c03e0['find'](_0x458b38=>_0x458b38[_0x376c('0x11')]===_0x2b1614['groupId']);_0x59d016?_0x59d016[_0x376c('0xa')]=_0x59d016[_0x376c('0xa')]['concat'](_0x2b1614[_0x376c('0xa')]):_0x5c03e0[_0x376c('0x25')](_0x2b1614);}),_0x5c03e0['forEach'](_0x3baee2=>{_0x3baee2[_0x376c('0xa')]=_0x3baee2[_0x376c('0xa')][_0x376c('0x34')](_0xe838c5=>!_0x5e00ad[_0x376c('0xb')](_0xe838c5['id']));}),_0x12ede1['set'](_0x376c('0x26'),_0x5c03e0);}[_0x376c('0x43')](){const _0x3f4551=this['editor'];this[_0x376c('0x5b')]=_0x3f4551[_0x376c('0x32')][_0x376c('0x5')](_0x376c('0x5b')),this[_0x376c('0x2c')]=setInterval(()=>{let _0x3caed6;for(const _0x34d57f in _0x3f4551){const _0xa43076=_0x34d57f,_0x157299=_0x3f4551[_0xa43076];if('aiLicenseKeyTrial'===_0x157299||'aiLicenseKeyInvalid'===_0x157299||_0x376c('0x1f')===_0x157299||'aiLicenseKeyTrialLimit:operations'===_0x157299){delete _0x3f4551[_0xa43076],_0x3caed6=_0x157299;break;}}if(_0x376c('0x4a')===_0x3caed6)throw clearInterval(this[_0x376c('0x2c')]),new _0x2a14ef(_0x376c('0x36'),null);if(_0x376c('0x2')===_0x3caed6&&console[_0x376c('0x46')]('You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20ai\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.'),_0x376c('0xf')===_0x3caed6)throw clearInterval(this[_0x376c('0x2c')]),new _0x2a14ef(_0x376c('0x4d'),null);_0x376c('0x1f')===_0x3caed6&&clearInterval(this[_0x376c('0x2c')]);},0x3e8);}[_0x376c('0x58')](){this['_licenseKeyCheckInterval']&&clearInterval(this[_0x376c('0x2c')]);}}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ai/aiassistantediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import type { Position } from 'ckeditor5/src/engine';
|
|
10
|
-
/**
|
|
11
|
-
* The AI assistant editing plugin.
|
|
12
|
-
*/
|
|
13
|
-
export default class AIAssistantEditing extends Plugin {
|
|
14
|
-
/**
|
|
15
|
-
* @inheritDoc
|
|
16
|
-
*/
|
|
17
|
-
static get pluginName(): "AIAssistantEditing";
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
init(): void;
|
|
22
|
-
/**
|
|
23
|
-
* Displays a fake visual selection when the contextual balloon is displayed.
|
|
24
|
-
*
|
|
25
|
-
* This adds a 'ai-ui' marker into the document that is rendered as a highlight on selected text fragment.
|
|
26
|
-
*/
|
|
27
|
-
showFakeVisualSelection(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Removes a fake visual selection when the contextual balloon is hidden.
|
|
30
|
-
*
|
|
31
|
-
* This removes all 'ai-ui' markers from the document.
|
|
32
|
-
*/
|
|
33
|
-
hideFakeVisualSelection(): void;
|
|
34
|
-
/**
|
|
35
|
-
* Converts the HTML string into the model fragment and inserts it at the specified position.
|
|
36
|
-
*
|
|
37
|
-
* If a position is not provided, the insertion will be performed at the current selection.
|
|
38
|
-
*/
|
|
39
|
-
insertContent(content: string, position?: Position): void;
|
|
40
|
-
/**
|
|
41
|
-
* Converts the HTML string into the model fragment and inserts it at the specified position.
|
|
42
|
-
* If a position is not provided, the insertion will be performed at the current selection.
|
|
43
|
-
*/
|
|
44
|
-
insertContentBelow(content: string): void;
|
|
45
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ai/aiassistantediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import type { Position } from 'ckeditor5/src/engine';
|
|
10
|
+
/**
|
|
11
|
+
* The AI assistant editing plugin.
|
|
12
|
+
*/
|
|
13
|
+
export default class AIAssistantEditing extends Plugin {
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
static get pluginName(): "AIAssistantEditing";
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
init(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Displays a fake visual selection when the contextual balloon is displayed.
|
|
24
|
+
*
|
|
25
|
+
* This adds a 'ai-ui' marker into the document that is rendered as a highlight on selected text fragment.
|
|
26
|
+
*/
|
|
27
|
+
showFakeVisualSelection(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Removes a fake visual selection when the contextual balloon is hidden.
|
|
30
|
+
*
|
|
31
|
+
* This removes all 'ai-ui' markers from the document.
|
|
32
|
+
*/
|
|
33
|
+
hideFakeVisualSelection(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Converts the HTML string into the model fragment and inserts it at the specified position.
|
|
36
|
+
*
|
|
37
|
+
* If a position is not provided, the insertion will be performed at the current selection.
|
|
38
|
+
*/
|
|
39
|
+
insertContent(content: string, position?: Position): void;
|
|
40
|
+
/**
|
|
41
|
+
* Converts the HTML string into the model fragment and inserts it at the specified position.
|
|
42
|
+
* If a position is not provided, the insertion will be performed at the current selection.
|
|
43
|
+
*/
|
|
44
|
+
insertContentBelow(content: string): void;
|
|
45
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x9e50=['toView','canEditAt','insertContentBelow','data','hideFakeVisualSelection','ck-fake-ai-selection_collapsed','model','markerToElement','pluginName','conversion','document','toModel','editor','getLastMatchingPosition','getLastPosition','span','editingDowncast','processor','has','markers','getSelectedBlocks','selection','isAtEnd','createRange','addMarker','from','isContent','for','insertContent','init','pop','updateMarker','change','start','length'];(function(_0x370254,_0x9e50b8){const _0xe622b4=function(_0xb54faa){while(--_0xb54faa){_0x370254['push'](_0x370254['shift']());}};_0xe622b4(++_0x9e50b8);}(_0x9e50,0x14b));const _0xe622=function(_0x370254,_0x9e50b8){_0x370254=_0x370254-0x0;let _0xe622b4=_0x9e50[_0x370254];return _0xe622b4;};import{Plugin as _0x3a15c2}from'ckeditor5/src/core';const s='ai-ui';export default class i extends _0x3a15c2{static get[_0xe622('0x1b')](){return'AIAssistantEditing';}[_0xe622('0xd')](){const {editor:_0x33c007}=this;_0x33c007[_0xe622('0x1c')][_0xe622('0xb')](_0xe622('0x0'))['markerToHighlight']({'model':s,'view':{'classes':['ck-fake-ai-selection']}}),_0x33c007[_0xe622('0x1c')][_0xe622('0xb')](_0xe622('0x0'))[_0xe622('0x1a')]({'model':s,'view':{'name':_0xe622('0x22'),'classes':['ck-fake-ai-selection',_0xe622('0x18')]}});}['showFakeVisualSelection'](){const _0x15aeaf=this['editor'][_0xe622('0x19')];_0x15aeaf[_0xe622('0x10')](_0x471e83=>{const _0x3fe952=_0x15aeaf['document'][_0xe622('0x5')]['getFirstRange']();if(_0x15aeaf[_0xe622('0x3')][_0xe622('0x2')](s))_0x471e83[_0xe622('0xf')](s,{'range':_0x3fe952});else{if(_0x3fe952[_0xe622('0x11')][_0xe622('0x6')]){const _0x5c68c5=_0x3fe952[_0xe622('0x11')][_0xe622('0x20')](({item:_0x45e63f})=>!_0x15aeaf['schema'][_0xe622('0xa')](_0x45e63f),{'boundaries':_0x3fe952});_0x471e83['addMarker'](s,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x471e83[_0xe622('0x7')](_0x5c68c5,_0x3fe952['end'])});}else _0x471e83[_0xe622('0x8')](s,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3fe952});}});}[_0xe622('0x17')](){this['editor']['model'][_0xe622('0x10')](_0x8ff20d=>{_0x8ff20d['removeMarker'](s);});}[_0xe622('0xc')](_0x3523e0,_0x3761ab){const _0x499918=_0x3761ab||this[_0xe622('0x1f')]['model'][_0xe622('0x1d')][_0xe622('0x5')];if(!this[_0xe622('0x1f')]['model'][_0xe622('0x14')](_0x499918))return;const _0x42375b=this['editor']['data'][_0xe622('0x1')][_0xe622('0x13')](_0x3523e0),_0x19d9f2=this[_0xe622('0x1f')][_0xe622('0x16')][_0xe622('0x1e')](_0x42375b);this[_0xe622('0x1f')][_0xe622('0x19')][_0xe622('0x10')](_0x404ca2=>{const _0x38e8fd=this[_0xe622('0x1f')]['model'][_0xe622('0xc')](_0x19d9f2,_0x499918);_0x38e8fd&&_0x404ca2['setSelection'](_0x38e8fd);});}[_0xe622('0x15')](_0x2255d7){const {model:_0x2fe986}=this[_0xe622('0x1f')],_0x3df4d9=Array[_0xe622('0x9')](_0x2fe986['document']['selection'][_0xe622('0x4')]()),_0x1d9bea=_0x3df4d9[_0xe622('0x12')]?_0x2fe986['createPositionAfter'](_0x3df4d9[_0xe622('0xe')]()):_0x2fe986[_0xe622('0x1d')][_0xe622('0x5')][_0xe622('0x21')]();this['insertContent'](_0x2255d7,_0x1d9bea);}}
|
package/src/aiassistantui.d.ts
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ai/aiassistantui
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
10
|
-
import { ContextualBalloon } from 'ckeditor5/src/ui';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import '../theme/ai.css';
|
|
14
|
-
import '../theme/ai-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
export type GroupedCommandDefinitions = Record<string, Array<CommandDefinition>>;
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ai/aiassistantui
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
10
|
+
import { ContextualBalloon } from 'ckeditor5/src/ui';
|
|
11
|
+
import AIAssistantEditing from './aiassistantediting';
|
|
12
|
+
import '../theme/ai.css';
|
|
13
|
+
import '../theme/ai-dropdown.css';
|
|
14
|
+
import '../theme/ai-form.css';
|
|
15
|
+
/**
|
|
16
|
+
* The UI plugin of the AI assistant.
|
|
17
|
+
*/
|
|
18
|
+
export default class AIAssistantUI extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): "AIAssistantUI";
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get requires(): readonly [typeof AIAssistantEditing, "AIConnector", typeof ContextualBalloon];
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
constructor(editor: Editor);
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
init(): void;
|
|
35
|
+
afterInit(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Initializes the balloon content and displays it based on the selection.
|
|
38
|
+
*/
|
|
39
|
+
showUI(prompt?: string, label?: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Removes fake markers and clears the balloon content causing it hidden.
|
|
42
|
+
*/
|
|
43
|
+
hideUI(): void;
|
|
44
|
+
}
|