@ckeditor/ckeditor5-ai 0.0.0-nightly-20240116.0 → 0.0.0-nightly-20240118.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 +13 -5
- package/README.md +9 -10
- package/build/ai.js +6 -6
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.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.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.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/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.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/translations/ar.po +2 -2
- package/lang/translations/bg.po +2 -2
- package/lang/translations/bn.po +2 -2
- package/lang/translations/ca.po +2 -2
- package/lang/translations/cs.po +2 -2
- package/lang/translations/da.po +2 -2
- package/lang/translations/de.po +2 -2
- package/lang/translations/el.po +2 -2
- package/lang/translations/es.po +2 -2
- package/lang/translations/et.po +2 -2
- package/lang/translations/fi.po +2 -2
- package/lang/translations/fr.po +2 -2
- package/lang/translations/he.po +2 -2
- package/lang/translations/hi.po +2 -2
- package/lang/translations/hu.po +2 -2
- package/lang/translations/id.po +2 -2
- package/lang/translations/it.po +2 -2
- package/lang/translations/ja.po +2 -2
- package/lang/translations/ko.po +2 -2
- package/lang/translations/lt.po +2 -2
- package/lang/translations/lv.po +2 -2
- package/lang/translations/ms.po +2 -2
- package/lang/translations/nl.po +2 -2
- package/lang/translations/no.po +2 -2
- package/lang/translations/pl.po +2 -2
- package/lang/translations/pt-br.po +2 -2
- package/lang/translations/pt.po +2 -2
- package/lang/translations/ro.po +2 -2
- package/lang/translations/ru.po +2 -2
- package/lang/translations/sk.po +2 -2
- package/lang/translations/sr.po +2 -2
- package/lang/translations/sv.po +2 -2
- package/lang/translations/th.po +2 -2
- package/lang/translations/tr.po +2 -2
- package/lang/translations/uk.po +2 -2
- package/lang/translations/vi.po +2 -2
- package/lang/translations/zh-cn.po +2 -2
- package/lang/translations/zh.po +2 -2
- package/package.json +6 -6
- package/src/adapters/aiadapter.js +1 -1
- package/src/adapters/aitextadapter.js +1 -1
- package/src/adapters/awstextadapter.d.ts +21 -21
- package/src/adapters/awstextadapter.js +1 -1
- package/src/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.js +1 -1
- package/src/aiconfig.d.ts +1 -1
- package/src/ui/aiassistantcontroller.js +1 -1
- package/src/ui/dropdown/aicommandslistview.js +1 -1
- package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
- package/src/ui/dropdown/labelwithhighlightview.js +1 -1
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/theme/ai-form.css +13 -1
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x3ca6=['rtl','focusFirst','update','target','children','showHistoryButtonView','set','focusCycler','focusableChildren','history','width','queryView','left','execute','submitButtonView','isOn','fieldWrapperChildren','value','resultsView','ck-ai-form__submit','isEnabled','locale','uiLanguageDirection','right','fieldView','isVisible','minRows','_createShowHistoryButton','element','maxRows','ck-ai-form__toggle-history','render','window','fire','focus','excludeScrollbarsAndBorders','add','focusLast','requestAnimationFrame','bind','Submit','keystrokes','submit'];(function(_0x392fbc,_0x3ca648){const _0x4c1f86=function(_0x4d621d){while(--_0x4d621d){_0x392fbc['push'](_0x392fbc['shift']());}};_0x4c1f86(++_0x3ca648);}(_0x3ca6,0x154));const _0x4c1f=function(_0x392fbc,_0x3ca648){_0x392fbc=_0x392fbc-0x0;let _0x4c1f86=_0x3ca6[_0x392fbc];return _0x4c1f86;};import{Rect as _0x312d8f,global as _0x27da9f,isVisible as _0x48c997}from'ckeditor5/src/utils.js';import{AutocompleteView as _0x3d1302,ButtonView as _0x1e2bb6}from'ckeditor5/src/ui.js';import{icons as _0x13c03a}from'ckeditor5/src/core.js';import{getTranslation as _0x38a760}from'../../utils/common-translations.js';import _0x5ae05f from'../../../theme/icons/submit.svg';export default class ht extends _0x3d1302{constructor(_0x3cc59f,_0xef0bbc){super(_0x3cc59f,_0xef0bbc),this[_0x4c1f('0xf')]['fieldView'][_0x4c1f('0x1e')]=0x1,this[_0x4c1f('0xf')][_0x4c1f('0x1c')][_0x4c1f('0x21')]=0x3,this[_0x4c1f('0x12')]=this['_createSubmitButton'](),this[_0x4c1f('0x9')]=this[_0x4c1f('0x1f')](),this['focusableChildren']['add'](this[_0x4c1f('0x9')],0x1),this[_0x4c1f('0xc')]['add'](this['submitButtonView']);}['render'](){super[_0x4c1f('0x23')](),this[_0x4c1f('0xf')][_0x4c1f('0x14')][_0x4c1f('0x28')](this[_0x4c1f('0x9')]),this[_0x4c1f('0x8')][_0x4c1f('0x28')](this['submitButtonView']),this[_0x4c1f('0x2')][_0x4c1f('0xa')]('enter',(_0x354874,_0x22d62b)=>{_0x354874[_0x4c1f('0x7')]==this[_0x4c1f('0xf')]['fieldView']['element']&&(this[_0x4c1f('0x3')](),_0x22d62b());});}['_createSubmitButton'](){const _0x1e7dd4=new _0x1e2bb6(this['locale']),_0x4e756a=this[_0x4c1f('0x19')];return _0x1e7dd4['set']({'icon':_0x5ae05f,'label':_0x38a760(_0x4e756a,_0x4c1f('0x1')),'isVisible':!0x0,'tooltip':!0x0,'class':_0x4c1f('0x17')}),_0x1e7dd4['on'](_0x4c1f('0x11'),()=>{this['submit']();}),_0x1e7dd4[_0x4c1f('0x0')]('isEnabled')['to'](this[_0x4c1f('0xf')][_0x4c1f('0x1c')],'isEmpty',this,'isEnabled',(_0x3821ea,_0x3aa061)=>!_0x3821ea&&_0x3aa061),_0x1e7dd4;}[_0x4c1f('0x1f')](){const _0x38d1d8=new _0x1e2bb6(this[_0x4c1f('0x19')]),_0x9b0d5a=this[_0x4c1f('0x16')],_0x11b1ac=this['locale'];_0x38d1d8[_0x4c1f('0xa')]({'label':_0x38a760(_0x11b1ac,'History'),'withText':!0x1,'icon':_0x13c03a[_0x4c1f('0xd')],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x4c1f('0x22')}),_0x38d1d8[_0x4c1f('0x0')](_0x4c1f('0x13'))['to'](_0x9b0d5a,_0x4c1f('0x1d')),_0x38d1d8[_0x4c1f('0x0')](_0x4c1f('0x18'))['to'](this,_0x4c1f('0x18')),_0x38d1d8['on'](_0x4c1f('0x11'),()=>{_0x9b0d5a[_0x4c1f('0x1d')]=!_0x9b0d5a['isVisible'],_0x9b0d5a['isVisible']?this['filteredView'][_0x4c1f('0x26')]():this[_0x4c1f('0x26')]();});const _0x10f6f0=()=>{_0x27da9f[_0x4c1f('0x24')][_0x4c1f('0x2a')](()=>{if(_0x48c997(this[_0x4c1f('0x20')])){const _0x113eca=new _0x312d8f(this[_0x4c1f('0xf')]['fieldView'][_0x4c1f('0x20')]),_0x17b519=_0x113eca[_0x4c1f('0xe')],_0x3eae2e=_0x4c1f('0x4')===_0x11b1ac[_0x4c1f('0x1a')]?_0x4c1f('0x10'):_0x4c1f('0x1b');_0x113eca[_0x4c1f('0x27')](),_0x38d1d8[_0x4c1f('0x20')]['style'][_0x3eae2e]=_0x17b519-_0x113eca[_0x4c1f('0xe')]+0x1+'px';}});};return this[_0x4c1f('0xf')][_0x4c1f('0x1c')]['on'](_0x4c1f('0x6'),_0x10f6f0),this['on']('render',_0x10f6f0),_0x38d1d8;}[_0x4c1f('0x3')](){const _0x160d6e=this[_0x4c1f('0xf')][_0x4c1f('0x1c')]['element'][_0x4c1f('0x15')];this[_0x4c1f('0x25')]('submit',_0x160d6e);}[_0x4c1f('0x26')](_0x1306c9){-0x1===_0x1306c9?this[_0x4c1f('0xb')][_0x4c1f('0x29')]():this[_0x4c1f('0xb')][_0x4c1f('0x5')]();}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5aa5=['items','toUpperCase','_CONTENT','replaceButton','replace','isVisible','mainAction','set','label','ck-button-action','ck-hidden','bind','ck-ai-form__toolbar','extendTemplate','tryAgainButton','AI_','_createButton','bindTemplate','insert','insertButton'];(function(_0x7db6e9,_0x5aa557){const _0x4ec477=function(_0x239708){while(--_0x239708){_0x7db6e9['push'](_0x7db6e9['shift']());}};_0x4ec477(++_0x5aa557);}(_0x5aa5,0x85));const _0x4ec4=function(_0x7db6e9,_0x5aa557){_0x7db6e9=_0x7db6e9-0x0;let _0x4ec477=_0x5aa5[_0x7db6e9];return _0x4ec477;};import{ToolbarView as _0x457082,ButtonView as _0x327251}from'ckeditor5/src/ui.js';import{getTranslation as _0x221712}from'../../utils/common-translations.js';export const AIFormToolbarViewMainActionLabel={'REPLACE':_0x4ec4('0xb'),'INSERT':_0x4ec4('0x5')};export default class at extends _0x457082{constructor(_0x5d59f9){super(_0x5d59f9),this['set'](_0x4ec4('0xc'),!0x1),this[_0x4ec4('0xe')](_0x4ec4('0xd'),AIFormToolbarViewMainActionLabel['REPLACE']),this['replaceButton']=this[_0x4ec4('0x3')]('',_0x4ec4('0x10')),this[_0x4ec4('0xa')][_0x4ec4('0x12')](_0x4ec4('0xf'))['to'](this,_0x4ec4('0xd'),_0x8bb4b4=>_0x221712(_0x5d59f9,_0x4ec4('0x2')+_0x8bb4b4[_0x4ec4('0x8')]()+_0x4ec4('0x9'))),this['insertButton']=this[_0x4ec4('0x3')](_0x221712(_0x5d59f9,'Insert\x20below')),this[_0x4ec4('0x1')]=this[_0x4ec4('0x3')](_0x221712(_0x5d59f9,'Try\x20again')),this['stopButton']=this['_createButton'](_0x221712(_0x5d59f9,'Stop'));const _0x195854=this[_0x4ec4('0x4')];this[_0x4ec4('0x0')]({'attributes':{'class':[_0x4ec4('0x13'),_0x195854['if'](_0x4ec4('0xc'),_0x4ec4('0x11'),_0x322108=>!_0x322108)]}}),this[_0x4ec4('0x7')]['addMany']([this['replaceButton'],this[_0x4ec4('0x6')],this[_0x4ec4('0x1')],this['stopButton']]);}[_0x4ec4('0x3')](_0x4c5fad,_0x4c4e07){const _0x58b065=new _0x327251(this['locale']);return _0x58b065[_0x4ec4('0xe')]({'label':_0x4c5fad,'class':_0x4c4e07||'','isVisible':!0x0,'withText':!0x0}),_0x58b065;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x7676=['listenTo','focusCycler','search','fieldView','_focusables','_createToolbar','tab','items','Empty\x20history','AI_ERROR_FAILED','finishProcessing','backwardCycle','focusTracker','clearHistory','stopButton','focusPrevious','delegate','createCollection','ck-ai-form-content','startProcessing','submitPrompt','bindTemplate','add','focusLast','div','execute','submit','ck-ai-form','trim','queryView','focusNext','mainAction','copyButtonView','insertContentBelow','_createPromptView','REPLACE','isError','ck-hidden','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','high','_createHistoryView','shift\x20+\x20tab','reset','errorView','fire','set','isVisible','keystrokes','contentArea','toolbar','locale','isEnabled','stop','prompt','isProcessing','tryAgainButton','promptView','bindTo','tryAgainEvent','bind','_promptHistory','Ask\x20AI\x20to\x20improve\x20generated\x20text','text','element','value','insertButton','forwardCycle','render','focus'];(function(_0x34ba10,_0x76767c){const _0x8d10bb=function(_0x7f2986){while(--_0x7f2986){_0x34ba10['push'](_0x34ba10['shift']());}};_0x8d10bb(++_0x76767c);}(_0x7676,0x141));const _0x8d10=function(_0x34ba10,_0x76767c){_0x34ba10=_0x34ba10-0x0;let _0x8d10bb=_0x7676[_0x34ba10];return _0x8d10bb;};import{FocusTracker as _0x227307,KeystrokeHandler as _0x2361b6}from'ckeditor5/src/utils.js';import{View as _0x5e2e2a,FocusCycler as _0x173011,createLabeledTextarea as _0x294840}from'ckeditor5/src/ui.js';import _0x48426b,{AIFormToolbarViewMainActionLabel as _0x463643}from'./aiformtoolbarview.js';import _0x39e919 from'./aiformcontentarea.js';import _0xc7ddfa from'./aiformerrorview.js';import _0x3c3023 from'./aiformpromptview.js';import _0x5c0db6 from'./aihistorylistview.js';import _0x503564 from'./aihistorylistitemview.js';import _0x1ed2fa from'./prompthistory.js';import{getTranslation as _0x3076cc}from'../../utils/common-translations.js';import{escape as _0x4ff001}from'lodash-es';export default class v extends _0x5e2e2a{constructor(_0x5891a7,_0x20b804,_0x5ca228=''){super(_0x5891a7),this[_0x8d10('0x0')](_0x8d10('0x6'),!0x0),this[_0x8d10('0x0')](_0x8d10('0x9'),!0x1),this['set'](_0x8d10('0x8'),''),this[_0x8d10('0x0')](_0x8d10('0x13'),''),this[_0x8d10('0x0')](_0x8d10('0x3c'),!0x1),this[_0x8d10('0x0')](_0x8d10('0x37'),_0x463643[_0x8d10('0x3b')]),this[_0x8d10('0xf')]=new _0x1ed2fa(),this[_0x8d10('0x43')]=new _0xc7ddfa(_0x5891a7),this[_0x8d10('0x3')]=new _0x39e919(_0x5891a7,_0x5ca228),this[_0x8d10('0x3')][_0x8d10('0xe')]('isProcessing')['to'](this),this[_0x8d10('0x3')][_0x8d10('0xe')](_0x8d10('0x13'))['to'](this),this[_0x8d10('0x4')]=this['_createToolbar'](),this['toolbar'][_0x8d10('0xe')](_0x8d10('0x37'))['to'](this),this[_0x8d10('0xb')]=this[_0x8d10('0x3a')](),this[_0x8d10('0x24')]=new _0x227307(),this[_0x8d10('0x2')]=new _0x2361b6(),this[_0x8d10('0x1c')]=this[_0x8d10('0x29')]([this['contentArea'],this[_0x8d10('0x3')]['copyButtonView'],this[_0x8d10('0x4')],this[_0x8d10('0xb')]]),this[_0x8d10('0x19')]=new _0x173011({'focusables':this[_0x8d10('0x1c')],'focusTracker':this[_0x8d10('0x24')],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x8d10('0x41'),'focusNext':_0x8d10('0x1e')}}),this['promptView'][_0x8d10('0x19')]['on'](_0x8d10('0x15'),_0x50fbb9=>{this[_0x8d10('0x19')][_0x8d10('0x36')](),_0x50fbb9[_0x8d10('0x7')]();}),this[_0x8d10('0xb')][_0x8d10('0x19')]['on'](_0x8d10('0x23'),_0x17cde0=>{this[_0x8d10('0x19')][_0x8d10('0x27')](),_0x17cde0[_0x8d10('0x7')]();}),this[_0x8d10('0xb')]['queryView'][_0x8d10('0x1b')][_0x8d10('0xe')](_0x8d10('0x13'))['to'](this,'prompt');const _0x380920=this[_0x8d10('0x2d')];this['setTemplate']({'tag':_0x8d10('0x30'),'attributes':{'class':['ck',_0x8d10('0x33'),_0x20b804],'tabindex':'-1'},'children':[{'tag':_0x8d10('0x30'),'attributes':{'class':['ck',_0x8d10('0x2a')]},'children':[{'tag':_0x8d10('0x30'),'attributes':{'class':[_0x380920['if'](_0x8d10('0x3c'),_0x8d10('0x3d'),_0x208b4f=>!_0x208b4f)]},'children':[this['errorView']]},this['contentArea'],this[_0x8d10('0x4')],this[_0x8d10('0xb')]]}]});}[_0x8d10('0x16')](){super[_0x8d10('0x16')](),this[_0x8d10('0x24')]['add'](this[_0x8d10('0x3')]['element']),this[_0x8d10('0x24')][_0x8d10('0x2e')](this[_0x8d10('0x3')][_0x8d10('0x38')]['element']),this[_0x8d10('0x24')]['add'](this[_0x8d10('0x4')][_0x8d10('0x12')]),this['focusTracker'][_0x8d10('0x2e')](this[_0x8d10('0xb')][_0x8d10('0x12')]),this[_0x8d10('0x2')]['listenTo'](this[_0x8d10('0x12')]);}[_0x8d10('0x17')](_0x324caf=0x1){-0x1===_0x324caf?this['focusCycler'][_0x8d10('0x2f')]():this['focusCycler']['focusFirst']();}[_0x8d10('0x42')](){this['prompt']='',this['value']='',this[_0x8d10('0x3c')]=!0x1,this[_0x8d10('0xb')][_0x8d10('0x42')](),this['contentArea']['isVisible']=!0x1,this[_0x8d10('0x4')][_0x8d10('0x1')]=!0x1;}[_0x8d10('0x3a')](){const _0x25cd98=this[_0x8d10('0x5')],_0xd06f=new _0x3c3023(_0x25cd98,{'queryView':{'label':_0x3076cc(_0x25cd98,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x294840,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x3076cc(_0x25cd98,_0x8d10('0x20')),'secondary':_0x3076cc(_0x25cd98,_0x8d10('0x3e'))}}},'filteredView':this[_0x8d10('0x40')](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xd06f[_0x8d10('0xe')](_0x8d10('0x6'))['to'](this,'isEnabled',this,_0x8d10('0x9'),(_0x2c09e3,_0x121a8f)=>_0x2c09e3&&!_0x121a8f),this[_0x8d10('0x18')](_0xd06f,_0x8d10('0x32'),(_0x1461c2,_0x57051f)=>{this[_0x8d10('0x8')]=_0x57051f;const _0x34c77e=_0x4ff001(_0x57051f);this[_0x8d10('0x44')](_0x8d10('0x2c'),_0x34c77e),_0x57051f[_0x8d10('0x34')]()&&this[_0x8d10('0xf')][_0x8d10('0x2e')]({'prompt':_0x34c77e},0x0);},{'priority':_0x8d10('0x3f')}),_0xd06f;}['_createHistoryView'](){const _0x63c3c6=new _0x5c0db6(this['locale']);return _0x63c3c6['historyGroupView'][_0x8d10('0x1f')][_0x8d10('0xc')](this[_0x8d10('0xf')])['as'](_0x503564),_0x63c3c6['on'](_0x8d10('0x25'),()=>{this['_promptHistory']['clear'](),this[_0x8d10('0xb')][_0x8d10('0x1a')](''),this[_0x8d10('0xb')][_0x8d10('0x17')]();}),_0x63c3c6;}[_0x8d10('0x1d')](){const _0x2a2b57=new _0x48426b(this['locale']);return _0x2a2b57['replaceButton'][_0x8d10('0xe')](_0x8d10('0x6'))['to'](this,_0x8d10('0x6'),this,_0x8d10('0x9'),this,_0x8d10('0x13'),(_0x1a4606,_0x99f868,_0x52a8f3)=>_0x1a4606&&!_0x99f868&&!!_0x52a8f3),_0x2a2b57['replaceButton']['delegate'](_0x8d10('0x31'))['to'](this,'replaceContent'),_0x2a2b57[_0x8d10('0x14')][_0x8d10('0xe')]('isEnabled')['to'](this,_0x8d10('0x6'),this,_0x8d10('0x9'),this,_0x8d10('0x13'),(_0x1b11d9,_0x40dd36,_0x550733)=>_0x1b11d9&&!_0x40dd36&&!!_0x550733),_0x2a2b57[_0x8d10('0x14')]['delegate'](_0x8d10('0x31'))['to'](this,_0x8d10('0x39')),_0x2a2b57['tryAgainButton'][_0x8d10('0xe')]('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x537605,_0x3d8316)=>_0x537605&&!_0x3d8316),_0x2a2b57[_0x8d10('0xa')]['delegate']('execute')['to'](this,_0x8d10('0xd')),_0x2a2b57[_0x8d10('0x26')][_0x8d10('0xe')]('isEnabled')['to'](this,_0x8d10('0x9')),_0x2a2b57[_0x8d10('0x26')][_0x8d10('0x28')](_0x8d10('0x31'))['to'](this,'stopProcessing'),_0x2a2b57;}[_0x8d10('0x2b')](){this['value']='',this[_0x8d10('0x3c')]=!0x1,this[_0x8d10('0x9')]=!0x0,this[_0x8d10('0x3')][_0x8d10('0x1')]=!0x0,this[_0x8d10('0x4')]['isVisible']=!0x0,this[_0x8d10('0x3')][_0x8d10('0x17')]();}[_0x8d10('0x22')](){const _0x3a77b8=this[_0x8d10('0x5')];this[_0x8d10('0x9')]=!0x1,this[_0x8d10('0x8')]='',this[_0x8d10('0xb')]['reset'](),this[_0x8d10('0x13')]&&(this[_0x8d10('0xb')][_0x8d10('0x35')]['label']=_0x3076cc(_0x3a77b8,_0x8d10('0x10')));}['handleError'](_0x3a45df){const _0x3914c5=this[_0x8d10('0x5')];this[_0x8d10('0x22')](),this[_0x8d10('0x3c')]=!0x0,this[_0x8d10('0x43')][_0x8d10('0x11')]=_0x3a45df||_0x3076cc(_0x3914c5,_0x8d10('0x21')),this[_0x8d10('0x13')]||(this[_0x8d10('0x3')][_0x8d10('0x1')]=!0x1);}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x156c=['add','children','execute','prompt','set'];(function(_0x2f26fe,_0x156c8f){const _0x171960=function(_0x39a64e){while(--_0x39a64e){_0x2f26fe['push'](_0x2f26fe['shift']());}};_0x171960(++_0x156c8f);}(_0x156c,0x12a));const _0x1719=function(_0x2f26fe,_0x156c8f){_0x2f26fe=_0x2f26fe-0x0;let _0x171960=_0x156c[_0x2f26fe];return _0x171960;};import{ListItemView as _0x592955,ButtonView as _0x392671}from'ckeditor5/src/ui.js';import _0x282f04 from'../dropdown/buttonlabelwithhighlightview.js';import{unescape as _0x3aa31b}from'lodash-es';export default class hs extends _0x592955{constructor(_0xb4b54c){super();const _0xf885ca=new _0x282f04(),_0x1c6655=new _0x392671(this['locale'],_0xf885ca);this[_0x1719('0x3')][_0x1719('0x2')](_0x1c6655),_0x1c6655[_0x1719('0x1')]({'label':_0xb4b54c[_0x1719('0x0')],'withText':!0x0}),_0x1c6655['on'](_0x1719('0x4'),()=>{this['fire'](_0x1719('0x4'),{'value':_0x3aa31b(_0xb4b54c[_0x1719('0x0')])});});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x42d1=['Prompt\x20history','items','clearHistoryButton','clearHistory','length','locale','Clear','fire','delegate','add','execute','_createClearHistoryButton','historyGroupView','label','filter'];(function(_0x5f349e,_0x42d160){const _0x317bbe=function(_0x1dc5b8){while(--_0x1dc5b8){_0x5f349e['push'](_0x5f349e['shift']());}};_0x317bbe(++_0x42d160);}(_0x42d1,0x1f4));const _0x317b=function(_0x5f349e,_0x42d160){_0x5f349e=_0x5f349e-0x0;let _0x317bbe=_0x42d1[_0x5f349e];return _0x317bbe;};import{ListView as _0x4cab08,ListItemGroupView as _0x426feb,ButtonView as _0x41e27c}from'ckeditor5/src/ui.js';import{getTranslation as _0x3b3718}from'../../utils/common-translations.js';export default class rs extends _0x4cab08{constructor(_0x34e249){super(_0x34e249),this[_0x317b('0xc')]=this[_0x317b('0x6')](),this[_0x317b('0x7')]=new _0x426feb(),this['historyGroupView']['children'][_0x317b('0x4')](this[_0x317b('0xc')],0x1),this['historyGroupView'][_0x317b('0x8')]=_0x3b3718(_0x34e249,_0x317b('0xa')),this[_0x317b('0x7')][_0x317b('0xb')][_0x317b('0x3')](_0x317b('0x5'))['to'](this),this[_0x317b('0xb')][_0x317b('0x4')](this[_0x317b('0x7')]);}[_0x317b('0x9')](){let _0x5e6495=0x0;for(const _0x523cec of this[_0x317b('0xb')])_0x5e6495+=_0x523cec[_0x317b('0xb')][_0x317b('0xe')];return{'resultsCount':_0x5e6495,'totalItemsCount':_0x5e6495};}['_createClearHistoryButton'](){const _0x9b7be7=this[_0x317b('0x0')],_0x449e6e=new _0x41e27c(this[_0x317b('0x0')]);return _0x449e6e['set']({'label':'('+_0x3b3718(_0x9b7be7,_0x317b('0x1'))+')','withText':!0x0}),_0x449e6e['on'](_0x317b('0x5'),()=>this[_0x317b('0x2')](_0x317b('0xd'))),_0x449e6e;}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1649=['remove','prompt','stringify','getItem','parse','add','_saveToSessionStorage','trim','CKEditor/AIFormView/PromptHistory','_loadFromSessionStorage','map'];(function(_0x1d8891,_0x16490d){const _0x220deb=function(_0x3ddd67){while(--_0x3ddd67){_0x1d8891['push'](_0x1d8891['shift']());}};_0x220deb(++_0x16490d);}(_0x1649,0xe0));const _0x220d=function(_0x1d8891,_0x16490d){_0x1d8891=_0x1d8891-0x0;let _0x220deb=_0x1649[_0x1d8891];return _0x220deb;};import{Collection as _0x4df774}from'ckeditor5/src/utils.js';const cs=_0x220d('0x4');export default class os extends _0x4df774{constructor(){super(),this[_0x220d('0x5')](),this['on'](_0x220d('0x1'),(_0x2f9bb9,_0x52e8ff)=>{const _0x4cef36=Ss(_0x52e8ff[_0x220d('0x8')]);for(const _0xbe6bb1 of this)if(_0xbe6bb1!=_0x52e8ff&&Ss(_0xbe6bb1['prompt'])===_0x4cef36){this[_0x220d('0x7')](_0xbe6bb1);break;}this['length']>0x14&&this[_0x220d('0x7')](this['last']),this['_saveToSessionStorage']();}),this['on'](_0x220d('0x7'),()=>{this[_0x220d('0x2')]();});}[_0x220d('0x5')](){const _0x49f745=sessionStorage[_0x220d('0xa')](cs)||'[]';this['addMany'](JSON[_0x220d('0x0')](_0x49f745));}[_0x220d('0x2')](){sessionStorage['setItem'](cs,JSON[_0x220d('0x9')](this[_0x220d('0x6')](_0x4b698c=>_0x4b698c)));}}function Ss(_0xd67a9b){return _0xd67a9b['toLowerCase']()[_0x220d('0x3')]();}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xa448=['getRanges','editor','refresh','showUI','config','model','selection','name','execute','ai.aiAssistant.disabledElements','plugins','element','includes','isEnabled','get'];(function(_0x10eb99,_0xa448df){const _0x108654=function(_0x2e5ad5){while(--_0x2e5ad5){_0x10eb99['push'](_0x10eb99['shift']());}};_0x108654(++_0xa448df);}(_0xa448,0xab));const _0x1086=function(_0x10eb99,_0xa448df){_0x10eb99=_0x10eb99-0x0;let _0x108654=_0xa448[_0x10eb99];return _0x108654;};import{Command as _0x1e5645}from'ckeditor5/src/core.js';import _0x1cd99e from'../aiassistantui.js';export default class g extends _0x1e5645{[_0x1086('0xb')](){const _0x3c5734=this[_0x1086('0xa')][_0x1086('0xe')]['document'][_0x1086('0x0')],_0x2c63ed=this[_0x1086('0xa')][_0x1086('0xd')][_0x1086('0x8')](_0x1086('0x3'));for(const _0x331efa of _0x3c5734[_0x1086('0x9')]())for(const _0x4f0deb of _0x331efa['getItems']())if(_0x4f0deb['is'](_0x1086('0x5'))&&_0x2c63ed[_0x1086('0x6')](_0x4f0deb[_0x1086('0x1')]))return void(this['isEnabled']=!0x1);this[_0x1086('0x7')]=!0x0;}[_0x1086('0x2')](_0x1008a0='',_0x2b963a='',_0x6fc602='custom'){this[_0x1086('0xa')][_0x1086('0x4')][_0x1086('0x8')](_0x1cd99e)[_0x1086('0xc')](_0x1008a0,_0x2b963a,_0x6fc602);}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export function getTranslation(
|
|
23
|
+
export function getTranslation(_0x26c977,_0x3d75c7,_0x44cba8){const t=_0x26c977['t'];switch(_0x3d75c7){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'Translate\x20to\x20%0':return t('Translate\x20to\x20%0',_0x44cba8);case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Search\x20AI\x20command':return t('Search\x20AI\x20command');case'No\x20commands\x20found':return t('No\x20commands\x20found');case'No\x20commands\x20available':return t('No\x20commands\x20available');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x44cba8);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x3d75c7;}}
|
package/theme/ai-form.css
CHANGED
|
@@ -23,8 +23,13 @@
|
|
|
23
23
|
.ck .ck-ai-form {
|
|
24
24
|
width: var(--ck-ai-form-view-width);
|
|
25
25
|
|
|
26
|
+
/* Don't overflow the parent dialog container */
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
|
|
26
29
|
@mixin ck-media-phone {
|
|
27
|
-
|
|
30
|
+
/* Allow the for the layout to be fluid in narrow viewports to avoid breaking it due to limited
|
|
31
|
+
* horizontal space (https://github.com/cksource/ckeditor5-commercial/issues/5913). */
|
|
32
|
+
--ck-ai-form-view-width: 100vw;
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
& .ck-ai-form-content {
|
|
@@ -185,6 +190,13 @@
|
|
|
185
190
|
@mixin ck-dir rtl {
|
|
186
191
|
padding-left: 30px;
|
|
187
192
|
}
|
|
193
|
+
|
|
194
|
+
/* Squash the textarea horizontally if necessary on narrow layouts
|
|
195
|
+
* to avoid breaking the layout even at the cost of the placeholder
|
|
196
|
+
* being cut off (https://github.com/cksource/ckeditor5-commercial/issues/5913). */
|
|
197
|
+
@mixin ck-media-phone {
|
|
198
|
+
--ck-input-width: auto;
|
|
199
|
+
}
|
|
188
200
|
}
|
|
189
201
|
|
|
190
202
|
/* Prompt history group */
|