UNPKG

@ckeditor/ckeditor5-ai

Version:

AI Assistant feature for CKEditor 5.

23 lines 10.6 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x43d6ec=_0x467c;(function(_0x1b70d0,_0x234053){const _0x202b8f=_0x467c,_0x3ad044=_0x1b70d0();while(!![]){try{const _0x36b7a1=-parseInt(_0x202b8f(0x1af))/0x1+parseInt(_0x202b8f(0x184))/0x2+-parseInt(_0x202b8f(0x172))/0x3*(parseInt(_0x202b8f(0x18a))/0x4)+-parseInt(_0x202b8f(0x19a))/0x5+-parseInt(_0x202b8f(0x1bf))/0x6+-parseInt(_0x202b8f(0x194))/0x7*(parseInt(_0x202b8f(0x197))/0x8)+-parseInt(_0x202b8f(0x1b2))/0x9*(-parseInt(_0x202b8f(0x1c2))/0xa);if(_0x36b7a1===_0x234053)break;else _0x3ad044['push'](_0x3ad044['shift']());}catch(_0xa94520){_0x3ad044['push'](_0x3ad044['shift']());}}}(_0xffd2,0xc1293));import{Plugin as _0x3c25d3}from'ckeditor5/src/core.js';import{AIAssistantUI as _0x552fd7}from'./aiassistantui.js';function _0x467c(_0x2c06b9,_0x1df675){const _0xffd2b1=_0xffd2();return _0x467c=function(_0x467c3f,_0x529beb){_0x467c3f=_0x467c3f-0x15b;let _0x306c7c=_0xffd2b1[_0x467c3f];return _0x306c7c;},_0x467c(_0x2c06b9,_0x1df675);}import{AIAssistantEditing as _0x5725f1}from'./aiassistantediting.js';import{getTranslation as _0x5284fc}from'./utils/common-translations.js';import{normalizeCommandsConfig as _0x46da91}from'./utils/normalizecommandsconfig.js';export class AIAssistant extends _0x3c25d3{static get[_0x43d6ec(0x15c)](){return[_0x552fd7,_0x5725f1];}static get[_0x43d6ec(0x182)](){const _0x48978b=_0x43d6ec;return _0x48978b(0x183);}static get[_0x43d6ec(0x168)](){return!0x0;}static get[_0x43d6ec(0x1a7)](){return!0x0;}constructor(_0x33cdcf){const _0x47eaf7=_0x43d6ec;super(_0x33cdcf);const _0xfed7ae=_0x33cdcf[_0x47eaf7(0x1b5)],_0x1cf42=_0x33cdcf[_0x47eaf7(0x1a0)];_0xfed7ae[_0x47eaf7(0x17e)](_0x47eaf7(0x16f),!0x0),_0xfed7ae[_0x47eaf7(0x17e)](_0x47eaf7(0x1b7),getDefaultAICommands(_0x1cf42)),_0xfed7ae[_0x47eaf7(0x17e)](_0x47eaf7(0x17c),[]),_0xfed7ae[_0x47eaf7(0x17e)](_0x47eaf7(0x1c4),[]);let _0x159240=_0x46da91(_0xfed7ae[_0x47eaf7(0x1a5)](_0x47eaf7(0x1b7)),_0x1cf42);const _0x3d54a=_0xfed7ae[_0x47eaf7(0x1a5)](_0x47eaf7(0x17c)),_0x110bac=_0xfed7ae[_0x47eaf7(0x1a5)](_0x47eaf7(0x1c4));_0x3d54a[_0x47eaf7(0x19f)](_0x2039ea=>{const _0x113c46=_0x47eaf7,_0x2783af=_0x159240[_0x113c46(0x18d)](_0x1dcd09=>_0x1dcd09[_0x113c46(0x18b)]===_0x2039ea[_0x113c46(0x18b)]);_0x2783af?_0x2783af[_0x113c46(0x1bb)]=_0x2783af[_0x113c46(0x1bb)][_0x113c46(0x17b)](_0x2039ea[_0x113c46(0x1bb)]):_0x159240[_0x113c46(0x195)](_0x2039ea);}),_0x159240=_0x159240[_0x47eaf7(0x1c7)](_0x5885d4=>!_0x110bac[_0x47eaf7(0x190)](_0x5885d4[_0x47eaf7(0x18b)])),_0x159240[_0x47eaf7(0x19f)](_0x5e87e7=>{const _0x5604a7=_0x47eaf7;_0x5e87e7[_0x5604a7(0x1bb)]=_0x5e87e7[_0x5604a7(0x1bb)][_0x5604a7(0x1c7)](_0x3ac34d=>!_0x110bac[_0x5604a7(0x190)](_0x3ac34d['id']));}),_0xfed7ae[_0x47eaf7(0x1b8)](_0x47eaf7(0x1b7),_0x159240);}}function _0xffd2(){const _0x35a833=['Translate','friendly','casual','597592cCMgfO','Generate\x20from\x20selection','Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.','9SbuCvQ','generate','Direct','config','editOrReview','ai.aiAssistant.commands','set','Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.','translateHindi','commands','Friendly','Hindi','Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.','1925952xGKpeN','Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.','Confident','16573020acTcTk','Translate\x20the\x20content\x20to\x20Arabic\x20language.','ai.aiAssistant.removeCommands','Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.','makeLonger','filter','Translate\x20the\x20content\x20to\x20English\x20language.','Make\x20longer','Arabic','requires','Translate\x20the\x20content\x20to\x20Hindi\x20language.','Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.','Change\x20style','Simplified\x20Chinese','Journalism','business','poetic','Translate\x20the\x20content\x20to\x20Portuguese\x20language.','translateFrench','simplifyLanguage','Professional','isOfficialPlugin','changeStyle','Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.','English','translatePortuguese','translate','Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.','ai.aiAssistant.preserveComments','direct','changeTone','60AJDTzk','Edit\x20or\x20review','improveWriting','translateSpanish','translateArabic','translateGerman','Translate\x20the\x20content\x20to\x20German\x20language.','Business','Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.','concat','ai.aiAssistant.extraCommandGroups','Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.','define','translateChinese','Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.','Translate\x20the\x20content\x20to\x20French\x20language.','pluginName','AIAssistant','1527240SpmUuv','makeShorter','Poetic','Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.','Summarize','Casual','14716NHKCls','groupId','professional','find','Change\x20tone','Improve\x20writing','includes','German','confident','Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.','57197XDHryU','push','Spanish','392WyIvzK','Legal','French','1185960Cxpovr','Continue','Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.','Translate\x20the\x20content\x20to\x20Spanish\x20language.','Make\x20shorter','forEach','locale','translateEnglish','legal','Simplify\x20language','Portuguese','get','continue','isPremiumPlugin','Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.','journalism','summarize','Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'];_0xffd2=function(){return _0x35a833;};return _0xffd2();}export function getDefaultAICommands(_0x138b07){const _0x81fb88=_0x43d6ec;return[{'groupId':_0x81fb88(0x1b6),'groupLabel':_0x5284fc(_0x138b07,_0x81fb88(0x173)),'commands':[{'id':_0x81fb88(0x174),'label':_0x5284fc(_0x138b07,_0x81fb88(0x18f)),'prompt':_0x81fb88(0x187)},{'id':_0x81fb88(0x185),'label':_0x5284fc(_0x138b07,_0x81fb88(0x19e)),'prompt':_0x81fb88(0x1be)},{'id':_0x81fb88(0x1c6),'label':_0x5284fc(_0x138b07,_0x81fb88(0x1c9)),'prompt':_0x81fb88(0x193)},{'id':_0x81fb88(0x166),'label':_0x5284fc(_0x138b07,_0x81fb88(0x1a3)),'prompt':_0x81fb88(0x16a)}]},{'groupId':_0x81fb88(0x1b3),'groupLabel':_0x5284fc(_0x138b07,_0x81fb88(0x1b0)),'commands':[{'id':_0x81fb88(0x1aa),'label':_0x5284fc(_0x138b07,_0x81fb88(0x188)),'prompt':_0x81fb88(0x1a8)},{'id':_0x81fb88(0x1a6),'label':_0x5284fc(_0x138b07,_0x81fb88(0x19b)),'prompt':_0x81fb88(0x1c5)}]},{'groupId':_0x81fb88(0x171),'groupLabel':_0x5284fc(_0x138b07,_0x81fb88(0x18e)),'commands':[{'id':_0x81fb88(0x18c),'label':_0x5284fc(_0x138b07,_0x81fb88(0x167)),'prompt':_0x81fb88(0x1c0)},{'id':_0x81fb88(0x1ae),'label':_0x5284fc(_0x138b07,_0x81fb88(0x189)),'prompt':_0x81fb88(0x16e)},{'id':_0x81fb88(0x170),'label':_0x5284fc(_0x138b07,_0x81fb88(0x1b4)),'prompt':_0x81fb88(0x1b1)},{'id':_0x81fb88(0x192),'label':_0x5284fc(_0x138b07,_0x81fb88(0x1c1)),'prompt':_0x81fb88(0x180)},{'id':_0x81fb88(0x1ad),'label':_0x5284fc(_0x138b07,_0x81fb88(0x1bc)),'prompt':_0x81fb88(0x17a)}]},{'groupId':_0x81fb88(0x169),'groupLabel':_0x5284fc(_0x138b07,_0x81fb88(0x15f)),'commands':[{'id':_0x81fb88(0x162),'label':_0x5284fc(_0x138b07,_0x81fb88(0x179)),'prompt':_0x81fb88(0x1ab)},{'id':_0x81fb88(0x1a2),'label':_0x5284fc(_0x138b07,_0x81fb88(0x198)),'prompt':_0x81fb88(0x1b9)},{'id':_0x81fb88(0x1a9),'label':_0x5284fc(_0x138b07,_0x81fb88(0x161)),'prompt':_0x81fb88(0x15e)},{'id':_0x81fb88(0x163),'label':_0x5284fc(_0x138b07,_0x81fb88(0x186)),'prompt':_0x81fb88(0x17d)}]},{'groupId':_0x81fb88(0x16d),'groupLabel':_0x5284fc(_0x138b07,_0x81fb88(0x1ac)),'commands':[{'id':_0x81fb88(0x1a1),'label':_0x5284fc(_0x138b07,_0x81fb88(0x16b)),'prompt':_0x81fb88(0x1c8)},{'id':_0x81fb88(0x175),'label':_0x5284fc(_0x138b07,_0x81fb88(0x196)),'prompt':_0x81fb88(0x19d)},{'id':_0x81fb88(0x16c),'label':_0x5284fc(_0x138b07,_0x81fb88(0x1a4)),'prompt':_0x81fb88(0x164)},{'id':_0x81fb88(0x177),'label':_0x5284fc(_0x138b07,_0x81fb88(0x191)),'prompt':_0x81fb88(0x178)},{'id':_0x81fb88(0x165),'label':_0x5284fc(_0x138b07,_0x81fb88(0x199)),'prompt':_0x81fb88(0x181)},{'id':_0x81fb88(0x17f),'label':_0x5284fc(_0x138b07,_0x81fb88(0x160)),'prompt':_0x81fb88(0x19c)},{'id':_0x81fb88(0x1ba),'label':_0x5284fc(_0x138b07,_0x81fb88(0x1bd)),'prompt':_0x81fb88(0x15d)},{'id':_0x81fb88(0x176),'label':_0x5284fc(_0x138b07,_0x81fb88(0x15b)),'prompt':_0x81fb88(0x1c3)}]}];}