@ckeditor/ckeditor5-ai 0.0.0-nightly-20231010.0 → 0.0.0-nightly-20231012.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.
@@ -24,11 +24,15 @@ export default class AIAssistantController extends AIAssistantController_base {
24
24
  */
25
25
  readonly view: AIFormView;
26
26
  /**
27
- * The previous value of the user prompt. It is kept to handle the try again event.
27
+ * It is the selected HTML content from the editor on which the balloon has been initialized.
28
+ */
29
+ initialContext: string;
30
+ /**
31
+ * The value returned by the AI after executing the prompt. It will be used as a context for the next calls.
28
32
  *
29
- * @observable
33
+ * This value is also displayed in the view.
30
34
  */
31
- previousPrompt?: string;
35
+ currentContext: string;
32
36
  /**
33
37
  * The previous value of the context for the AI request. It is kept to handle the try again event.
34
38
  *
@@ -38,6 +42,18 @@ export default class AIAssistantController extends AIAssistantController_base {
38
42
  * @observable
39
43
  */
40
44
  previousContext?: string;
45
+ /**
46
+ * The previous value of the user prompt. It is kept to handle the try again event.
47
+ *
48
+ * @observable
49
+ */
50
+ previousPrompt?: string;
51
+ /**
52
+ * The label of the previous executed prompt. It is connected to #previousPrompt and is kept to handle the try again event.
53
+ *
54
+ * @observable
55
+ */
56
+ previousLabel?: string;
41
57
  /**
42
58
  * Flag that indicates if the processing is in progress.
43
59
  *
@@ -47,13 +63,21 @@ export default class AIAssistantController extends AIAssistantController_base {
47
63
  /**
48
64
  * @param connector AI connector instance.
49
65
  * @param view AI form view.
50
- * @param htmlContent The selected HTML content on which the AI should base.
51
- * @param prompt The initial prompt that causes the processing to start.
52
66
  */
53
- constructor(connector: AIConnector, view: AIFormView, htmlContent: string, prompt?: string);
67
+ constructor(connector: AIConnector, view: AIFormView);
54
68
  /**
55
69
  * Destroys `AIAssistantController` instance.
56
70
  */
57
71
  destroy(): void;
72
+ /**
73
+ * Handles the initial prompt for a new context and inits the listener for the visible view.
74
+ *
75
+ * This function should be called whenever the AI balloon is displayed.
76
+ *
77
+ * @param htmlContent The selected HTML content on which the AI should base.
78
+ * @param prompt The initial prompt that causes the processing to start.
79
+ * @param label The label that will be displayed in the view.
80
+ */
81
+ updateView(prompt: string, htmlContent: string, label: string): Promise<void>;
58
82
  }
59
83
  export {};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4057=['message','isProcessing','value','abort','previousPrompt','catch','connector','once','_updateValue','_handlePrompt','previousContext','finishProcessing','render','destroy','view','startProcessing','stopProcessing','processPrompt','submitPrompt','finally','handleError','listenTo'];(function(_0x214747,_0x4057fe){const _0x1c5dfc=function(_0x4d587a){while(--_0x4d587a){_0x214747['push'](_0x214747['shift']());}};_0x1c5dfc(++_0x4057fe);}(_0x4057,0xef));const _0x1c5d=function(_0x214747,_0x4057fe){_0x214747=_0x214747-0x0;let _0x1c5dfc=_0x4057[_0x214747];return _0x1c5dfc;};import{ObservableMixin as _0x106dac}from'ckeditor5/src/utils';import{AIRequestError as _0x11b726}from'../aiconnector';export default class I extends _0x106dac(){constructor(_0x52c542,_0x89fa16,_0x16e285,_0x501a45){super(),this[_0x1c5d('0x9')]=_0x52c542,this[_0x1c5d('0x11')]=_0x89fa16,this['set']({'previousPrompt':void 0x0,'previousContext':void 0x0,'isProcessing':!0x1}),_0x501a45&&this['view'][_0x1c5d('0xa')](_0x1c5d('0xf'),()=>{this['_handlePrompt'](_0x501a45,_0x16e285);}),this[_0x1c5d('0x2')](this[_0x1c5d('0x11')],_0x1c5d('0x15'),(_0x3bc79d,_0x1c1a54)=>{const _0xde8079=this['view'][_0x1c5d('0x5')]||_0x16e285;this['_handlePrompt'](_0x1c1a54,_0xde8079);}),this[_0x1c5d('0x2')](this[_0x1c5d('0x11')],'tryAgainEvent',()=>{this[_0x1c5d('0xc')](this[_0x1c5d('0x7')],this[_0x1c5d('0xd')]);}),this[_0x1c5d('0x2')](this[_0x1c5d('0x11')],_0x1c5d('0x13'),()=>{this[_0x1c5d('0x13')]();});}[_0x1c5d('0x10')](){this['stopListening']();}[_0x1c5d('0x13')](){this['isProcessing']&&(this['isProcessing']=!0x1,this[_0x1c5d('0x11')][_0x1c5d('0xe')](),this[_0x1c5d('0x9')][_0x1c5d('0x6')]());}async['_handlePrompt'](_0x2892ef,_0x1f47c1){return this[_0x1c5d('0x4')]=!0x0,this[_0x1c5d('0x11')][_0x1c5d('0x12')](),this[_0x1c5d('0x7')]=_0x2892ef,this[_0x1c5d('0xd')]=_0x1f47c1,new Promise(_0x1f5f69=>{this[_0x1c5d('0x9')][_0x1c5d('0x14')](_0x2892ef,_0x1f47c1,_0x2ff265=>this[_0x1c5d('0xb')](_0x2ff265))[_0x1c5d('0x8')](_0x57a4e5=>{_0x57a4e5 instanceof _0x11b726?this[_0x1c5d('0x11')][_0x1c5d('0x1')](_0x57a4e5[_0x1c5d('0x3')]):this[_0x1c5d('0x11')][_0x1c5d('0x1')](),_0x1f5f69();})[_0x1c5d('0x0')](()=>{this[_0x1c5d('0x13')](),_0x1f5f69();});});}['_updateValue'](_0x587476){this[_0x1c5d('0x11')]['value']=''+_0x587476;}}
23
+ const _0x1ff3=['_handlePrompt','isProcessing','destroy','bind','message','view','previousContext','reset','listenTo','currentContext','catch','updateView','initialContext','stopListening','set','previousLabel','stopProcessing','finishProcessing','render','tryAgainEvent','prompt','connector','submitPrompt','_updateValue','previousPrompt','value'];(function(_0xb36641,_0x1ff3a4){const _0x34ff0b=function(_0x14423b){while(--_0x14423b){_0xb36641['push'](_0xb36641['shift']());}};_0x34ff0b(++_0x1ff3a4);}(_0x1ff3,0x93));const _0x34ff=function(_0xb36641,_0x1ff3a4){_0xb36641=_0xb36641-0x0;let _0x34ff0b=_0x1ff3[_0xb36641];return _0x34ff0b;};import{ObservableMixin as _0x24a4f5}from'ckeditor5/src/utils';import{AIRequestError as _0xc35291}from'../aiconnector';export default class I extends _0x24a4f5(){constructor(_0x5d8dc4,_0x58e9fc){super(),this[_0x34ff('0x4')]=_0x5d8dc4,this['view']=_0x58e9fc,this[_0x34ff('0x17')]({'initialContext':'','currentContext':'','previousContext':void 0x0,'previousPrompt':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this[_0x34ff('0xe')][_0x34ff('0xc')](_0x34ff('0x8'))['to'](this,_0x34ff('0x12')),this[_0x34ff('0x11')](this[_0x34ff('0xe')],_0x34ff('0x5'),(_0x169424,_0x407c08)=>{const _0x23dc20=this[_0x34ff('0x12')]||this[_0x34ff('0x15')];this[_0x34ff('0x9')](_0x407c08,_0x23dc20);}),this['listenTo'](this[_0x34ff('0xe')],_0x34ff('0x2'),()=>{this[_0x34ff('0xe')][_0x34ff('0x3')]=this[_0x34ff('0x18')],this['_handlePrompt'](this['previousPrompt'],this[_0x34ff('0xf')],this['previousLabel']);}),this[_0x34ff('0x11')](this[_0x34ff('0xe')],_0x34ff('0x19'),()=>{this[_0x34ff('0x19')]();});}[_0x34ff('0xb')](){this[_0x34ff('0x16')]();}async[_0x34ff('0x14')](_0x1e9e00,_0x1afb5f,_0x36298a){this[_0x34ff('0xe')]['prompt']=_0x36298a,this[_0x34ff('0x15')]=_0x1afb5f,_0x1e9e00&&(this[_0x34ff('0xe')]['isRendered']?this['_handlePrompt'](_0x1e9e00,_0x1afb5f,_0x36298a):this[_0x34ff('0xe')]['once'](_0x34ff('0x1'),()=>{this[_0x34ff('0x9')](_0x1e9e00,_0x1afb5f,_0x36298a);}));}[_0x34ff('0x19')](){this[_0x34ff('0xa')]&&(this[_0x34ff('0xa')]=!0x1,this[_0x34ff('0xe')][_0x34ff('0x0')](),this[_0x34ff('0x4')]['abort']());}[_0x34ff('0x10')](){this['initialContext']='',this[_0x34ff('0x12')]='',this['previousContext']='',this[_0x34ff('0x7')]='',this['previousLabel']='',this['view'][_0x34ff('0x10')](),this[_0x34ff('0x19')]();}async[_0x34ff('0x9')](_0x35f048,_0x1400ca,_0x28136e){return this[_0x34ff('0xa')]=!0x0,this[_0x34ff('0xe')]['startProcessing'](),this[_0x34ff('0xf')]=_0x1400ca,this[_0x34ff('0x7')]=_0x35f048,this[_0x34ff('0x18')]=_0x28136e||_0x35f048,new Promise(_0x4e4d3e=>{this[_0x34ff('0x4')]['processPrompt'](_0x35f048,_0x1400ca,_0x27fe0d=>this['_updateValue'](_0x27fe0d))[_0x34ff('0x13')](_0x2280e5=>{_0x2280e5 instanceof _0xc35291?this[_0x34ff('0xe')]['handleError'](_0x2280e5[_0x34ff('0xd')]):this[_0x34ff('0xe')]['handleError'](),_0x4e4d3e();})['finally'](()=>{this[_0x34ff('0x19')](),_0x4e4d3e();});});}[_0x34ff('0x6')](_0x1ee029){this[_0x34ff('0x12')]=''+_0x1ee029;}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xde3e=['items','length','children','filter','highlightText','isVisible','label'];(function(_0x11b5b2,_0xde3e50){const _0x494e85=function(_0x48b781){while(--_0x48b781){_0x11b5b2['push'](_0x11b5b2['shift']());}};_0x494e85(++_0xde3e50);}(_0xde3e,0xae));const _0x494e=function(_0x11b5b2,_0xde3e50){_0x11b5b2=_0x11b5b2-0x0;let _0x494e85=_0xde3e[_0x11b5b2];return _0x494e85;};import{ListView as _0x33aef}from'ckeditor5/src/ui';export default class y extends _0x33aef{[_0x494e('0x4')](_0x1b7f10){let _0x1a61c2=0x0,_0x2bf24b=0x0;for(const _0x3a9388 of this['items']){const _0x4a4b60=_0x3a9388;for(const _0x438043 of _0x4a4b60[_0x494e('0x1')]){const _0x3dd3c6=_0x438043[_0x494e('0x3')]['first'],_0x42ef23=_0x3dd3c6['labelView'];_0x1b7f10?(_0x438043[_0x494e('0x6')]=!!_0x3dd3c6[_0x494e('0x0')]['match'](_0x1b7f10),_0x438043['isVisible']&&(_0x42ef23['highlightText'](_0x1b7f10),_0x2bf24b++)):(_0x438043[_0x494e('0x6')]=!0x0,_0x42ef23[_0x494e('0x5')](null),_0x2bf24b++),_0x1a61c2++;}_0x4a4b60[_0x494e('0x6')]=!!_0x4a4b60[_0x494e('0x1')][_0x494e('0x4')](_0x3624d5=>_0x3624d5['isVisible'])[_0x494e('0x2')];}return{'resultsCount':_0x2bf24b,'totalItemsCount':_0x1a61c2};}}
23
+ const _0x8252=['highlightText','isVisible','items','match','labelView','filter','first','length','children','label'];(function(_0x4f64db,_0x8252bd){const _0x3ce969=function(_0x3bb207){while(--_0x3bb207){_0x4f64db['push'](_0x4f64db['shift']());}};_0x3ce969(++_0x8252bd);}(_0x8252,0x1b1));const _0x3ce9=function(_0x4f64db,_0x8252bd){_0x4f64db=_0x4f64db-0x0;let _0x3ce969=_0x8252[_0x4f64db];return _0x3ce969;};import{ListView as _0x5d7035}from'ckeditor5/src/ui';export default class y extends _0x5d7035{['filter'](_0x2d5404){let _0x145749=0x0,_0x297af5=0x0;for(const _0x37555d of this[_0x3ce9('0x9')]){const _0x479b51=_0x37555d;for(const _0x58dcdd of _0x479b51[_0x3ce9('0x9')]){const _0x28d06e=_0x58dcdd[_0x3ce9('0x5')][_0x3ce9('0x3')],_0x1dd291=_0x28d06e[_0x3ce9('0x1')];_0x2d5404?(_0x58dcdd[_0x3ce9('0x8')]=!!_0x28d06e[_0x3ce9('0x6')][_0x3ce9('0x0')](_0x2d5404),_0x58dcdd[_0x3ce9('0x8')]&&(_0x1dd291[_0x3ce9('0x7')](_0x2d5404),_0x297af5++)):(_0x58dcdd[_0x3ce9('0x8')]=!0x0,_0x1dd291[_0x3ce9('0x7')](null),_0x297af5++),_0x145749++;}_0x479b51[_0x3ce9('0x8')]=!!_0x479b51[_0x3ce9('0x9')][_0x3ce9('0x2')](_0x785c7f=>_0x785c7f['isVisible'])[_0x3ce9('0x4')];}return{'resultsCount':_0x297af5,'totalItemsCount':_0x145749};}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x1026=['ck-button__label','bindTemplate','extendTemplate'];(function(_0x35f3fa,_0x10267d){const _0x2b8e01=function(_0x5f32ba){while(--_0x5f32ba){_0x35f3fa['push'](_0x35f3fa['shift']());}};_0x2b8e01(++_0x10267d);}(_0x1026,0x146));const _0x2b8e=function(_0x35f3fa,_0x10267d){_0x35f3fa=_0x35f3fa-0x0;let _0x2b8e01=_0x1026[_0x35f3fa];return _0x2b8e01;};import{HighlightedTextView as _0x2dc1d3}from'ckeditor5/src/ui';export default class C extends _0x2dc1d3{constructor(){super(),this['set']({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x2f37ce=this[_0x2b8e('0x2')];this[_0x2b8e('0x0')]({'attributes':{'class':[_0x2b8e('0x1')],'style':_0x2f37ce['to']('style'),'id':_0x2f37ce['to']('id')}});}}
23
+ const _0x153c=['style','bindTemplate','ck-button__label','extendTemplate','set'];(function(_0x372923,_0x153c4b){const _0x1bb877=function(_0x38dc02){while(--_0x38dc02){_0x372923['push'](_0x372923['shift']());}};_0x1bb877(++_0x153c4b);}(_0x153c,0x14b));const _0x1bb8=function(_0x372923,_0x153c4b){_0x372923=_0x372923-0x0;let _0x1bb877=_0x153c[_0x372923];return _0x1bb877;};import{HighlightedTextView as _0x4ad18e}from'ckeditor5/src/ui';export default class C extends _0x4ad18e{constructor(){super(),this[_0x1bb8('0x3')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x26a984=this[_0x1bb8('0x0')];this[_0x1bb8('0x2')]({'attributes':{'class':[_0x1bb8('0x1')],'style':_0x26a984['to'](_0x1bb8('0x4')),'id':_0x26a984['to']('id')}});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4538=['change:isProcessing','_copyHTMLToClipboard','body','text/html','ck-hidden','clipboard','value','createElement','.ck-ai-form__loader','execCommand','ck-content','_createCopyButton','Copy','innerHTML','absolute','setContent','isVisible','style','set','write','-9999px','ck-ai-form__copy-button','copyButtonView','appendLoader','querySelector','remove','setTemplate','element','text/plain','bind','ck-ai-form__content-field','loaderView','left','ck-reset_all-excluded','locale','div','focus','_createLoader','ck-ai-form__loader','bindTemplate','contentFieldView','ck-ai-form__content-area','ck-ai-form__copy-button-wrapper','execute','isEnabled','icon','createRange','scrollHeight','smooth','isProcessing','render','appendChild','class'];(function(_0x55f1bc,_0x45385b){const _0x52d000=function(_0x5b86b8){while(--_0x5b86b8){_0x55f1bc['push'](_0x55f1bc['shift']());}};_0x52d000(++_0x45385b);}(_0x4538,0x1cd));const _0x52d0=function(_0x55f1bc,_0x45385b){_0x55f1bc=_0x55f1bc-0x0;let _0x52d000=_0x4538[_0x55f1bc];return _0x52d000;};import{global as _0x373b5b}from'ckeditor5/src/utils';import{View as _0x33beca,ButtonView as _0x25a576,SpinnerView as _0x51ec17}from'ckeditor5/src/ui';import _0x852b9a from'../../../theme/icons/copy.svg';import{getTranslation as _0x9abc58}from'../../utils/common-translations';import{icons as _0x31584b}from'ckeditor5/src/core';export default class M extends _0x33beca{constructor(_0x56b937,_0x7486de=''){super(_0x56b937),this[_0x52d0('0x22')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x339a71=this[_0x52d0('0x2')];this[_0x52d0('0x3')]=new ContentFieldView(_0x56b937,_0x7486de),this['copyButtonView']=this[_0x52d0('0x1b')](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x339a71['if'](_0x52d0('0x20'),_0x52d0('0x14'),_0x586083=>!_0x586083)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck',_0x52d0('0x4'),_0x339a71['if'](_0x52d0('0xc'),'ck-ai-form__content-area--processing')]},'children':[this[_0x52d0('0x3')],{'tag':_0x52d0('0x33'),'attributes':{'class':['ck',_0x52d0('0x5')]},'children':[this[_0x52d0('0x26')]]}]}]});}[_0x52d0('0xd')](){super['render'](),this[_0x52d0('0x16')]&&this[_0x52d0('0x3')][_0x52d0('0x1f')](this[_0x52d0('0x16')]),this['on']('change:value',(_0x425a5f,_0x35a944,_0x936bd3)=>{const _0x5248b5=!this[_0x52d0('0x3')][_0x52d0('0x2b')][_0x52d0('0x28')](_0x52d0('0x18'));this[_0x52d0('0x3')][_0x52d0('0x1f')](_0x936bd3),this[_0x52d0('0xc')]&&_0x5248b5&&this[_0x52d0('0x2b')]['scrollTo']({'top':this[_0x52d0('0x2b')][_0x52d0('0xa')],'behavior':_0x52d0('0xb')});}),this['on'](_0x52d0('0x10'),(_0x4e5f96,_0x3432d2,_0x1f8c16)=>{_0x1f8c16?(this[_0x52d0('0x16')]=null,this[_0x52d0('0x3')][_0x52d0('0x27')]()):this[_0x52d0('0x16')]||this[_0x52d0('0x3')]['setContent']('');});}[_0x52d0('0x34')](){this['element']['focus']();}['_createCopyButton'](){const _0x1b2fef=this['locale'],_0x43d0ed=new _0x25a576(this[_0x52d0('0x32')]),_0xcb46ff=_0x52d0('0x25');return _0x43d0ed['set']({'label':_0x9abc58(_0x1b2fef,_0x52d0('0x1c')),'icon':_0x852b9a,'class':_0xcb46ff,'tooltip':!0x0}),_0x43d0ed['bind']('isVisible')['to'](this,_0x52d0('0x16'),_0x2214d5=>!!_0x2214d5),_0x43d0ed[_0x52d0('0x2d')](_0x52d0('0x7'))['to'](this,_0x52d0('0xc'),_0x1cb7d2=>!_0x1cb7d2),_0x43d0ed['on'](_0x52d0('0x6'),()=>{this[_0x52d0('0x11')](this[_0x52d0('0x3')][_0x52d0('0x2b')]),_0x43d0ed['icon']=_0x31584b['check'],_0x43d0ed[_0x52d0('0xf')]=_0xcb46ff+'\x20ck-ai-form__copy-button--copied',this[_0x52d0('0x34')](),setTimeout(()=>{_0x43d0ed[_0x52d0('0x8')]=_0x852b9a,_0x43d0ed[_0x52d0('0xf')]=_0xcb46ff;},0x3e8);}),_0x43d0ed;}[_0x52d0('0x11')](_0x58c6b7){const {window:_0x2f9d7c,document:_0x4f6cfc}=_0x373b5b;if(_0x2f9d7c['ClipboardItem']){const {Blob:_0x33c813,ClipboardItem:_0x181c77}=_0x2f9d7c,_0x48b8cb=[new _0x181c77({'text/html':new _0x33c813([_0x58c6b7[_0x52d0('0x1d')]],{'type':_0x52d0('0x13')}),'text/plain':new _0x33c813([_0x58c6b7['textContent']||''],{'type':_0x52d0('0x2c')})})];navigator[_0x52d0('0x15')][_0x52d0('0x23')](_0x48b8cb);}else{const _0x2139d8=_0x4f6cfc[_0x52d0('0x17')](_0x52d0('0x33'));_0x2139d8['style']['position']=_0x52d0('0x1e'),_0x2139d8[_0x52d0('0x21')][_0x52d0('0x30')]=_0x52d0('0x24'),_0x2139d8['innerHTML']=_0x58c6b7[_0x52d0('0x1d')],_0x4f6cfc[_0x52d0('0x12')][_0x52d0('0xe')](_0x2139d8);const _0x5eeefd=_0x4f6cfc[_0x52d0('0x9')]();_0x5eeefd['selectNodeContents'](_0x2139d8);const _0x5606cd=_0x2f9d7c['getSelection']();_0x5606cd['removeAllRanges'](),_0x5606cd['addRange'](_0x5eeefd),_0x4f6cfc[_0x52d0('0x19')]('copy'),_0x2139d8[_0x52d0('0x29')]();}}}export class ContentFieldView extends _0x33beca{constructor(_0x2775d5,_0x251d13=''){super(_0x2775d5),this[_0x52d0('0x2f')]=this[_0x52d0('0x0')](),this['setTemplate']({'tag':_0x52d0('0x33'),'attributes':{'class':['ck',_0x52d0('0x1a'),_0x251d13,_0x52d0('0x31'),_0x52d0('0x2e')]}});}[_0x52d0('0x1f')](_0x2480d6){this[_0x52d0('0x2b')][_0x52d0('0x1d')]=_0x2480d6;}[_0x52d0('0x27')](){this['element'][_0x52d0('0xe')](this[_0x52d0('0x2f')][_0x52d0('0x2b')]);}['_createLoader'](){const _0xe344f4=new _0x33beca(),_0x488bd5=this[_0x52d0('0x32')],_0xc59cb4=new _0x51ec17();return _0xc59cb4['isVisible']=!0x0,_0xe344f4[_0x52d0('0x2a')]({'tag':_0x52d0('0x33'),'attributes':{'class':['ck',_0x52d0('0x1')]},'children':[_0xc59cb4,{'text':_0x9abc58(_0x488bd5,'AI\x20is\x20writing...')}]}),_0xe344f4['render'](),_0xe344f4;}}
23
+ const _0x1961=['querySelector','icon','div','change:isProcessing','value','_copyHTMLToClipboard','bindTemplate','focus','setContent','scrollHeight','text/plain','scrollTo','change:value','absolute','.ck-ai-form__loader','body','copyButtonView','locale','Copy','smooth','ck-ai-form__copy-button','textContent','execute','class','set','appendChild','clipboard','appendLoader','setTemplate','ck-content','position','_createCopyButton','render','-9999px','AI\x20is\x20writing...','left','isProcessing','element','_createLoader','write','ck-ai-form__content-area','\x20ck-ai-form__copy-button--copied','wheel','getSelection','listenTo','ck-reset_all-excluded','innerHTML','isEnabled','addRange','style','ck-hidden','execCommand','isVisible','removeAllRanges','ck-ai-form__content-field','loaderView','contentFieldView'];(function(_0x303c7e,_0x196176){const _0x4640d5=function(_0x21b5bd){while(--_0x21b5bd){_0x303c7e['push'](_0x303c7e['shift']());}};_0x4640d5(++_0x196176);}(_0x1961,0x12e));const _0x4640=function(_0x303c7e,_0x196176){_0x303c7e=_0x303c7e-0x0;let _0x4640d5=_0x1961[_0x303c7e];return _0x4640d5;};import{global as _0x319731}from'ckeditor5/src/utils';import{View as _0x430405,ButtonView as _0x327f46,SpinnerView as _0x4b09f5}from'ckeditor5/src/ui';import _0x13b1ab from'../../../theme/icons/copy.svg';import{getTranslation as _0xae50f2}from'../../utils/common-translations';import{icons as _0x566f98}from'ckeditor5/src/core';export default class M extends _0x430405{constructor(_0x25c861,_0x3c0a6b=''){super(_0x25c861),this[_0x4640('0x7')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xc8d03f=this[_0x4640('0x2e')];this['contentFieldView']=new ContentFieldView(_0x25c861,_0x3c0a6b),this[_0x4640('0x38')]=this[_0x4640('0xe')](),this[_0x4640('0xb')]({'tag':_0x4640('0x2a'),'attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xc8d03f['if']('isVisible',_0x4640('0x21'),_0x495ce7=>!_0x495ce7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck',_0x4640('0x17'),_0xc8d03f['if'](_0x4640('0x13'),'ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':_0x4640('0x2a'),'attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this[_0x4640('0x38')]]}]}]});}[_0x4640('0xf')](){super[_0x4640('0xf')](),this[_0x4640('0x2c')]&&this[_0x4640('0x27')][_0x4640('0x30')](this[_0x4640('0x2c')]);let _0x2a1654=!0x1;this['on'](_0x4640('0x34'),(_0x2b4372,_0x48e496,_0x1a87be)=>{const _0x1be69b=!this[_0x4640('0x27')]['element'][_0x4640('0x28')](_0x4640('0x36'));this[_0x4640('0x27')][_0x4640('0x30')](_0x1a87be),this['isProcessing']&&_0x1be69b&&!_0x2a1654&&this[_0x4640('0x14')][_0x4640('0x33')]({'top':this[_0x4640('0x14')][_0x4640('0x31')],'behavior':_0x4640('0x2')});}),this['on'](_0x4640('0x2b'),(_0x54c64a,_0x17b92f,_0x267764)=>{_0x2a1654=!0x1,_0x267764?(this[_0x4640('0x2c')]=null,this[_0x4640('0x27')][_0x4640('0xa')]()):this[_0x4640('0x2c')]||this[_0x4640('0x27')][_0x4640('0x30')]('');}),this[_0x4640('0x1b')](this['element'],_0x4640('0x19'),()=>{_0x2a1654=!0x0;}),this[_0x4640('0x1b')](this[_0x4640('0x14')],'mousedown',()=>{_0x2a1654=!0x0;});}['focus'](){this['element'][_0x4640('0x2f')]();}[_0x4640('0xe')](){const _0x441cdb=this[_0x4640('0x0')],_0x797665=new _0x327f46(this[_0x4640('0x0')]),_0x3b2d2e=_0x4640('0x3');return _0x797665[_0x4640('0x7')]({'label':_0xae50f2(_0x441cdb,_0x4640('0x1')),'icon':_0x13b1ab,'class':_0x3b2d2e,'tooltip':!0x0}),_0x797665['bind'](_0x4640('0x23'))['to'](this,_0x4640('0x2c'),_0x13d18d=>!!_0x13d18d),_0x797665['bind'](_0x4640('0x1e'))['to'](this,_0x4640('0x13'),_0x3b31a9=>!_0x3b31a9),_0x797665['on'](_0x4640('0x5'),()=>{this['_copyHTMLToClipboard'](this[_0x4640('0x27')][_0x4640('0x14')]),_0x797665[_0x4640('0x29')]=_0x566f98['check'],_0x797665[_0x4640('0x6')]=_0x3b2d2e+_0x4640('0x18'),this[_0x4640('0x2f')](),setTimeout(()=>{_0x797665[_0x4640('0x29')]=_0x13b1ab,_0x797665[_0x4640('0x6')]=_0x3b2d2e;},0x3e8);}),_0x797665;}[_0x4640('0x2d')](_0x48d341){const {window:_0x58123f,document:_0x3586f1}=_0x319731;if(_0x58123f['ClipboardItem']){const {Blob:_0x59341d,ClipboardItem:_0xf6f724}=_0x58123f,_0x2586a8=[new _0xf6f724({'text/html':new _0x59341d([_0x48d341[_0x4640('0x1d')]],{'type':'text/html'}),'text/plain':new _0x59341d([_0x48d341[_0x4640('0x4')]||''],{'type':_0x4640('0x32')})})];navigator[_0x4640('0x9')][_0x4640('0x16')](_0x2586a8);}else{const _0x329b6b=_0x3586f1['createElement'](_0x4640('0x2a'));_0x329b6b[_0x4640('0x20')][_0x4640('0xd')]=_0x4640('0x35'),_0x329b6b[_0x4640('0x20')][_0x4640('0x12')]=_0x4640('0x10'),_0x329b6b[_0x4640('0x1d')]=_0x48d341[_0x4640('0x1d')],_0x3586f1[_0x4640('0x37')][_0x4640('0x8')](_0x329b6b);const _0x8dc76e=_0x3586f1['createRange']();_0x8dc76e['selectNodeContents'](_0x329b6b);const _0x11227b=_0x58123f[_0x4640('0x1a')]();_0x11227b[_0x4640('0x24')](),_0x11227b[_0x4640('0x1f')](_0x8dc76e),_0x3586f1[_0x4640('0x22')]('copy'),_0x329b6b['remove']();}}}export class ContentFieldView extends _0x430405{constructor(_0x4ff26d,_0x21a0d2=''){super(_0x4ff26d),this[_0x4640('0x26')]=this['_createLoader'](),this['setTemplate']({'tag':_0x4640('0x2a'),'attributes':{'class':['ck',_0x4640('0xc'),_0x21a0d2,_0x4640('0x1c'),_0x4640('0x25')]}});}[_0x4640('0x30')](_0x47ecb4){this[_0x4640('0x14')][_0x4640('0x1d')]=_0x47ecb4;}['appendLoader'](){this['element'][_0x4640('0x8')](this[_0x4640('0x26')][_0x4640('0x14')]);}[_0x4640('0x15')](){const _0xc3f8ad=new _0x430405(),_0x38f129=this['locale'],_0x43cc24=new _0x4b09f5();return _0x43cc24[_0x4640('0x23')]=!0x0,_0xc3f8ad['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x43cc24,{'text':_0xae50f2(_0x38f129,_0x4640('0x11'))}]}),_0xc3f8ad[_0x4640('0xf')](),_0xc3f8ad;}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x50ce=['ck-ai-form__error','bindTemplate','setTemplate','text','content','div'];(function(_0x4b6216,_0x50ce3d){const _0x54ee0d=function(_0x5c3353){while(--_0x5c3353){_0x4b6216['push'](_0x4b6216['shift']());}};_0x54ee0d(++_0x50ce3d);}(_0x50ce,0x1a0));const _0x54ee=function(_0x4b6216,_0x50ce3d){_0x4b6216=_0x4b6216-0x0;let _0x54ee0d=_0x50ce[_0x4b6216];return _0x54ee0d;};import{View as _0x3b66b7,IconView as _0x3778d1}from'ckeditor5/src/ui';import _0x53efdb from'../../../theme/icons/error.svg';export default class J extends _0x3b66b7{constructor(_0x5caae4,_0x1913b9=''){super(_0x5caae4);const _0x86cd7a=new _0x3778d1(),_0x543e39=this[_0x54ee('0x5')];this['set'](_0x54ee('0x1'),_0x1913b9),_0x86cd7a[_0x54ee('0x2')]=_0x53efdb,this[_0x54ee('0x0')]({'tag':_0x54ee('0x3'),'attributes':{'class':['ck',_0x54ee('0x4')]},'children':[_0x86cd7a,{'text':_0x543e39['to'](_0x54ee('0x1'))}]});}}
23
+ const _0x1db7=['bindTemplate','div','content','ck-ai-form__error','setTemplate'];(function(_0xcd5e2d,_0x1db7d0){const _0x3c29b3=function(_0x284690){while(--_0x284690){_0xcd5e2d['push'](_0xcd5e2d['shift']());}};_0x3c29b3(++_0x1db7d0);}(_0x1db7,0x99));const _0x3c29=function(_0xcd5e2d,_0x1db7d0){_0xcd5e2d=_0xcd5e2d-0x0;let _0x3c29b3=_0x1db7[_0xcd5e2d];return _0x3c29b3;};import{View as _0x2b951e,IconView as _0x9de9c8}from'ckeditor5/src/ui';import _0x3a0625 from'../../../theme/icons/error.svg';export default class J extends _0x2b951e{constructor(_0xeca465,_0x13539f=''){super(_0xeca465);const _0x315886=new _0x9de9c8(),_0x5ba963=this[_0x3c29('0x2')];this['set']('text',_0x13539f),_0x315886[_0x3c29('0x4')]=_0x3a0625,this[_0x3c29('0x1')]({'tag':_0x3c29('0x3'),'attributes':{'class':['ck',_0x3c29('0x0')]},'children':[_0x315886,{'text':_0x5ba963['to']('text')}]});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x44c9=['target','filteredView','ck-ai-form__toggle-history','set','element','requestAnimationFrame','width','history','isVisible','fieldWrapperChildren','_createShowHistoryButton','right','showHistoryButtonView','excludeScrollbarsAndBorders','maxRows','focusCycler','fire','_createSubmitButton','add','resultsView','submitButtonView','render','value','bind','style','update','ck-ai-form__submit','isOn','execute','fieldView','isEnabled','minRows','Submit','locale','submit','queryView','focusableChildren','focus'];(function(_0x48f0d0,_0x44c980){const _0xf98012=function(_0x2a2f6a){while(--_0x2a2f6a){_0x48f0d0['push'](_0x48f0d0['shift']());}};_0xf98012(++_0x44c980);}(_0x44c9,0x196));const _0xf980=function(_0x48f0d0,_0x44c980){_0x48f0d0=_0x48f0d0-0x0;let _0xf98012=_0x44c9[_0x48f0d0];return _0xf98012;};import{Rect as _0x1603cd,global as _0xaafccf,isVisible as _0x37f840}from'ckeditor5/src/utils';import{AutocompleteView as _0x40c1c3,ButtonView as _0x3367af}from'ckeditor5/src/ui';import{icons as _0xe5a0c1}from'ckeditor5/src/core';import{escape as _0x37d1f3}from'lodash-es';import{getTranslation as _0x50e810}from'../../utils/common-translations';import _0x265b00 from'../../../theme/icons/submit.svg';export default class R extends _0x40c1c3{constructor(_0x22e7a1,_0x11fa8f){super(_0x22e7a1,_0x11fa8f),this[_0xf980('0x9')]['fieldView'][_0xf980('0x5')]=0x1,this[_0xf980('0x9')][_0xf980('0x3')][_0xf980('0x1a')]=0x3,this['submitButtonView']=this[_0xf980('0x1d')](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this[_0xf980('0x18')],0x1),this[_0xf980('0xa')][_0xf980('0x1e')](this[_0xf980('0x20')]);}[_0xf980('0x21')](){super[_0xf980('0x21')](),this['queryView'][_0xf980('0x15')][_0xf980('0x1e')](this[_0xf980('0x18')]),this['children'][_0xf980('0x1e')](this[_0xf980('0x20')]),this['keystrokes'][_0xf980('0xf')]('enter',(_0x309d99,_0x71eff1)=>{_0x309d99[_0xf980('0xc')]==this[_0xf980('0x9')][_0xf980('0x3')][_0xf980('0x10')]&&(this[_0xf980('0x8')](),_0x71eff1());});}[_0xf980('0x1d')](){const _0x57618a=new _0x3367af(this[_0xf980('0x7')]),_0x3f7362=this[_0xf980('0x7')];return _0x57618a[_0xf980('0xf')]({'icon':_0x265b00,'label':_0x50e810(_0x3f7362,_0xf980('0x6')),'isVisible':!0x0,'tooltip':!0x0,'class':_0xf980('0x0')}),_0x57618a['on']('execute',()=>{this['submit']();}),_0x57618a[_0xf980('0x23')](_0xf980('0x4'))['to'](this[_0xf980('0x9')]['fieldView'],'isEmpty',this,_0xf980('0x4'),(_0x24221e,_0x18ca84)=>!_0x24221e&&_0x18ca84),_0x57618a;}[_0xf980('0x16')](){const _0x3ef0a6=new _0x3367af(this[_0xf980('0x7')]),_0x1cdc1f=this[_0xf980('0x1f')],_0x49451a=this[_0xf980('0x7')];_0x3ef0a6[_0xf980('0xf')]({'label':_0x50e810(_0x49451a,'History'),'withText':!0x1,'icon':_0xe5a0c1[_0xf980('0x13')],'tooltip':!0x0,'tooltipPosition':'sw','class':_0xf980('0xe')}),_0x3ef0a6['bind'](_0xf980('0x1'))['to'](_0x1cdc1f,'isVisible'),_0x3ef0a6[_0xf980('0x23')](_0xf980('0x4'))['to'](this,_0xf980('0x4')),_0x3ef0a6['on'](_0xf980('0x2'),()=>{_0x1cdc1f[_0xf980('0x14')]=!_0x1cdc1f[_0xf980('0x14')],_0x1cdc1f[_0xf980('0x14')]?this[_0xf980('0xd')][_0xf980('0xb')]():this[_0xf980('0xb')]();});const _0xfd2df5=()=>{_0xaafccf['window'][_0xf980('0x11')](()=>{if(_0x37f840(this[_0xf980('0x10')])){const _0x2bc76b=new _0x1603cd(this[_0xf980('0x9')][_0xf980('0x3')]['element']),_0x46f3a9=_0x2bc76b['width'];_0x2bc76b[_0xf980('0x19')](),_0x3ef0a6[_0xf980('0x10')][_0xf980('0x24')][_0xf980('0x17')]=_0x46f3a9-_0x2bc76b[_0xf980('0x12')]+0x1+'px';}});};return this[_0xf980('0x9')]['fieldView']['on'](_0xf980('0x25'),_0xfd2df5),this['on'](_0xf980('0x21'),_0xfd2df5),_0x3ef0a6;}[_0xf980('0x8')](){const _0x103e16=this[_0xf980('0x9')][_0xf980('0x3')]['element'][_0xf980('0x22')];this[_0xf980('0x1c')](_0xf980('0x8'),_0x37d1f3(_0x103e16));}[_0xf980('0xb')](_0x149bb7){-0x1===_0x149bb7?this[_0xf980('0x1b')]['focusLast']():this['focusCycler']['focusFirst']();}}
23
+ const _0x1ac3=['focus','add','isVisible','enter','focusCycler','submitButtonView','fieldWrapperChildren','bind','queryView','window','fieldView','isEnabled','focusFirst','target','showHistoryButtonView','filteredView','ck-ai-form__submit','Submit','uiLanguageDirection','set','style','update','isEmpty','_createShowHistoryButton','left','maxRows','width','excludeScrollbarsAndBorders','render','isOn','locale','keystrokes','History','_createSubmitButton','element','submit'];(function(_0x3d6964,_0x1ac379){const _0x3d1f7d=function(_0x28a283){while(--_0x28a283){_0x3d6964['push'](_0x3d6964['shift']());}};_0x3d1f7d(++_0x1ac379);}(_0x1ac3,0x166));const _0x3d1f=function(_0x3d6964,_0x1ac379){_0x3d6964=_0x3d6964-0x0;let _0x3d1f7d=_0x1ac3[_0x3d6964];return _0x3d1f7d;};import{Rect as _0x115c8b,global as _0x28ed24,isVisible as _0x49fb66}from'ckeditor5/src/utils';import{AutocompleteView as _0x45c3a9,ButtonView as _0x1e28af}from'ckeditor5/src/ui';import{icons as _0x2f8806}from'ckeditor5/src/core';import{escape as _0x1be119}from'lodash-es';import{getTranslation as _0x193d86}from'../../utils/common-translations';import _0x121c1e from'../../../theme/icons/submit.svg';export default class R extends _0x45c3a9{constructor(_0x4bc486,_0x5d07ee){super(_0x4bc486,_0x5d07ee),this[_0x3d1f('0xa')][_0x3d1f('0xc')]['minRows']=0x1,this[_0x3d1f('0xa')][_0x3d1f('0xc')][_0x3d1f('0x1b')]=0x3,this[_0x3d1f('0x7')]=this[_0x3d1f('0x23')](),this[_0x3d1f('0x10')]=this[_0x3d1f('0x19')](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren'][_0x3d1f('0x3')](this[_0x3d1f('0x7')]);}[_0x3d1f('0x1e')](){super['render'](),this[_0x3d1f('0xa')][_0x3d1f('0x8')][_0x3d1f('0x3')](this[_0x3d1f('0x10')]),this['children'][_0x3d1f('0x3')](this[_0x3d1f('0x7')]),this[_0x3d1f('0x21')][_0x3d1f('0x15')](_0x3d1f('0x5'),(_0x54edd9,_0x3efb74)=>{_0x54edd9[_0x3d1f('0xf')]==this[_0x3d1f('0xa')]['fieldView'][_0x3d1f('0x0')]&&(this['submit'](),_0x3efb74());});}['_createSubmitButton'](){const _0x571a73=new _0x1e28af(this[_0x3d1f('0x20')]),_0x32ae87=this[_0x3d1f('0x20')];return _0x571a73['set']({'icon':_0x121c1e,'label':_0x193d86(_0x32ae87,_0x3d1f('0x13')),'isVisible':!0x0,'tooltip':!0x0,'class':_0x3d1f('0x12')}),_0x571a73['on']('execute',()=>{this['submit']();}),_0x571a73[_0x3d1f('0x9')]('isEnabled')['to'](this[_0x3d1f('0xa')]['fieldView'],_0x3d1f('0x18'),this,_0x3d1f('0xd'),(_0x17a0e1,_0x2a8cad)=>!_0x17a0e1&&_0x2a8cad),_0x571a73;}[_0x3d1f('0x19')](){const _0x10b338=new _0x1e28af(this[_0x3d1f('0x20')]),_0x51ea99=this['resultsView'],_0xe6f02e=this[_0x3d1f('0x20')];_0x10b338['set']({'label':_0x193d86(_0xe6f02e,_0x3d1f('0x22')),'withText':!0x1,'icon':_0x2f8806['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x10b338[_0x3d1f('0x9')](_0x3d1f('0x1f'))['to'](_0x51ea99,_0x3d1f('0x4')),_0x10b338[_0x3d1f('0x9')](_0x3d1f('0xd'))['to'](this,_0x3d1f('0xd')),_0x10b338['on']('execute',()=>{_0x51ea99['isVisible']=!_0x51ea99[_0x3d1f('0x4')],_0x51ea99[_0x3d1f('0x4')]?this[_0x3d1f('0x11')][_0x3d1f('0x2')]():this['focus']();});const _0x5b4cac=()=>{_0x28ed24[_0x3d1f('0xb')]['requestAnimationFrame'](()=>{if(_0x49fb66(this['element'])){const _0x517cdc=new _0x115c8b(this[_0x3d1f('0xa')][_0x3d1f('0xc')][_0x3d1f('0x0')]),_0x259f7e=_0x517cdc[_0x3d1f('0x1c')],_0x28e06d='rtl'===_0xe6f02e[_0x3d1f('0x14')]?_0x3d1f('0x1a'):'right';_0x517cdc[_0x3d1f('0x1d')](),_0x10b338['element'][_0x3d1f('0x16')][_0x28e06d]=_0x259f7e-_0x517cdc['width']+0x1+'px';}});};return this[_0x3d1f('0xa')]['fieldView']['on'](_0x3d1f('0x17'),_0x5b4cac),this['on'](_0x3d1f('0x1e'),_0x5b4cac),_0x10b338;}[_0x3d1f('0x1')](){const _0x5a71ca=this['queryView'][_0x3d1f('0xc')]['element']['value'];this['fire']('submit',_0x1be119(_0x5a71ca));}[_0x3d1f('0x2')](_0x56b2fd){-0x1===_0x56b2fd?this[_0x3d1f('0x6')]['focusLast']():this[_0x3d1f('0x6')][_0x3d1f('0xe')]();}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3008=['replaceButton','ck-ai-form__toolbar','ck-button-action','insertButton','addMany','extendTemplate','locale','stopButton','bindTemplate','set','Stop','items','AI_REPLACE_CONTENT','tryAgainButton','isVisible','_createButton'];(function(_0x2f97b6,_0x300895){const _0x283618=function(_0x404176){while(--_0x404176){_0x2f97b6['push'](_0x2f97b6['shift']());}};_0x283618(++_0x300895);}(_0x3008,0x12c));const _0x2836=function(_0x2f97b6,_0x300895){_0x2f97b6=_0x2f97b6-0x0;let _0x283618=_0x3008[_0x2f97b6];return _0x283618;};import{ToolbarView as _0x5a9f12,ButtonView as _0x5dff1b}from'ckeditor5/src/ui';import{getTranslation as _0x159d4a}from'../../utils/common-translations';export default class X extends _0x5a9f12{constructor(_0x4aa943){super(_0x4aa943),this[_0x2836('0xd')](_0x2836('0x2'),!0x1),this['replaceButton']=this[_0x2836('0x3')](_0x159d4a(_0x4aa943,_0x2836('0x0')),_0x2836('0x6')),this[_0x2836('0x7')]=this[_0x2836('0x3')](_0x159d4a(_0x4aa943,'Insert\x20below')),this[_0x2836('0x1')]=this[_0x2836('0x3')](_0x159d4a(_0x4aa943,'Try\x20again')),this['stopButton']=this['_createButton'](_0x159d4a(_0x4aa943,_0x2836('0xe')));const _0x1b3abc=this[_0x2836('0xc')];this[_0x2836('0x9')]({'attributes':{'class':[_0x2836('0x5'),_0x1b3abc['if'](_0x2836('0x2'),'ck-hidden',_0x136fec=>!_0x136fec)]}}),this[_0x2836('0xf')][_0x2836('0x8')]([this[_0x2836('0x4')],this[_0x2836('0x7')],this[_0x2836('0x1')],this[_0x2836('0xb')]]);}['_createButton'](_0x349d57,_0x4cc298){const _0x1d8630=new _0x5dff1b(this[_0x2836('0xa')]);return _0x1d8630[_0x2836('0xd')]({'label':_0x349d57,'class':_0x4cc298||'','isVisible':!0x0,'withText':!0x0}),_0x1d8630;}}
23
+ const _0x3e4b=['ck-ai-form__toolbar','Stop','insertButton','_createButton','isVisible','Try\x20again','tryAgainButton','AI_REPLACE_CONTENT','set','stopButton','replaceButton','ck-hidden','bindTemplate'];(function(_0x36e21c,_0x3e4b15){const _0x105c0e=function(_0xc56a50){while(--_0xc56a50){_0x36e21c['push'](_0x36e21c['shift']());}};_0x105c0e(++_0x3e4b15);}(_0x3e4b,0x14a));const _0x105c=function(_0x36e21c,_0x3e4b15){_0x36e21c=_0x36e21c-0x0;let _0x105c0e=_0x3e4b[_0x36e21c];return _0x105c0e;};import{ToolbarView as _0x48c163,ButtonView as _0x4c2bed}from'ckeditor5/src/ui';import{getTranslation as _0x238e2b}from'../../utils/common-translations';export default class X extends _0x48c163{constructor(_0x3a55a9){super(_0x3a55a9),this[_0x105c('0x3')](_0x105c('0xc'),!0x1),this[_0x105c('0x5')]=this[_0x105c('0xb')](_0x238e2b(_0x3a55a9,_0x105c('0x2')),'ck-button-action'),this[_0x105c('0xa')]=this['_createButton'](_0x238e2b(_0x3a55a9,'Insert\x20below')),this[_0x105c('0x1')]=this[_0x105c('0xb')](_0x238e2b(_0x3a55a9,_0x105c('0x0'))),this[_0x105c('0x4')]=this['_createButton'](_0x238e2b(_0x3a55a9,_0x105c('0x9')));const _0xbe5579=this[_0x105c('0x7')];this['extendTemplate']({'attributes':{'class':[_0x105c('0x8'),_0xbe5579['if']('isVisible',_0x105c('0x6'),_0x2f1ff5=>!_0x2f1ff5)]}}),this['items']['addMany']([this['replaceButton'],this[_0x105c('0xa')],this[_0x105c('0x1')],this[_0x105c('0x4')]]);}[_0x105c('0xb')](_0x363d82,_0x367b22){const _0x79d2af=new _0x4c2bed(this['locale']);return _0x79d2af[_0x105c('0x3')]({'label':_0x363d82,'class':_0x367b22||'','isVisible':!0x0,'withText':!0x0}),_0x79d2af;}}
@@ -75,14 +75,17 @@ export default class AIFormView extends View {
75
75
  * Creates an instance of the {@link module:ai/ui/aiformview~AIFormView} class.
76
76
  *
77
77
  * @param locale The localization services instance.
78
- * @param prompt The text label of the prompt with which the form has been initialized.
79
78
  */
80
- constructor(locale: Locale, prompt: string, uiCssClass: string, contentAreaCssClass?: string);
79
+ constructor(locale: Locale, uiCssClass: string, contentAreaCssClass?: string);
81
80
  /**
82
81
  * @inheritDoc
83
82
  */
84
83
  render(): void;
85
84
  focus(): void;
85
+ /**
86
+ * Resets the form to the initial values.
87
+ */
88
+ reset(): void;
86
89
  }
87
90
  /**
88
91
  * Fired when a user performed an action that should lead to replace the current selection by generated content.
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x52e7=['errorView','label','_focusCycler','_createToolbar','bindTemplate','focusCycler','listenTo','insertButton','_promptHistory','contentArea','ck-ai-form-content','set','forwardCycle','fire','tab','startProcessing','value','queryView','keystrokes','focusPrevious','isVisible','_createHistoryView','high','add','stopButton','trim','finishProcessing','shift\x20+\x20tab','focusTracker','copyButtonView','historyGroupView','div','AI_ERROR_FAILED','reset','_createPromptView','focusNext','focus','render','setTemplate','createCollection','prompt','isEnabled','isError','stopProcessing','replaceContent','clearHistory','bind','AI\x20Assistant','submitPrompt','focusFirst','text','_focusables','locale','stop','backwardCycle','element','items','toolbar','execute','replaceButton','ck-ai-form','bindTo','search','Ask\x20AI\x20to\x20improve\x20generated\x20text','isProcessing','Empty\x20history','promptView','submit','header','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.'];(function(_0x49dab9,_0x52e7c2){const _0x29c02d=function(_0x1621e8){while(--_0x1621e8){_0x49dab9['push'](_0x49dab9['shift']());}};_0x29c02d(++_0x52e7c2);}(_0x52e7,0x19a));const _0x29c0=function(_0x49dab9,_0x52e7c2){_0x49dab9=_0x49dab9-0x0;let _0x29c02d=_0x52e7[_0x49dab9];return _0x29c02d;};import{FocusTracker as _0x43ff22,KeystrokeHandler as _0x4e1e9c}from'ckeditor5/src/utils';import{View as _0x17deb7,FocusCycler as _0x36c9de,createLabeledTextarea as _0x387179,FormHeaderView as _0x123b5b}from'ckeditor5/src/ui';import _0x23c880 from'./aiformtoolbarview';import _0x322fa4 from'./aiformcontentarea';import _0x154cc4 from'./aiformerrorview';import _0x1d8c81 from'./aiformpromptview';import _0x194976 from'./aihistorylistview';import _0x508309 from'./aihistorylistitemview';import _0x4ee99e from'./prompthistory';import{getTranslation as _0x5e477e}from'../../utils/common-translations';import _0x3aeebc from'../../../theme/icons/robot-pencil.svg';export default class g extends _0x17deb7{constructor(_0x17484e,_0x3a3883,_0xdb66d4,_0x411cc2=''){super(_0x17484e),this[_0x29c0('0x15')](_0x29c0('0x33'),!0x0),this[_0x29c0('0x15')](_0x29c0('0x4'),!0x1),this[_0x29c0('0x15')]('prompt',_0x3a3883),this[_0x29c0('0x15')](_0x29c0('0x1a'),''),this[_0x29c0('0x15')](_0x29c0('0x34'),!0x1),this[_0x29c0('0x12')]=new _0x4ee99e(),this['errorView']=new _0x154cc4(_0x17484e),this['header']=new _0x123b5b(_0x17484e,{'label':_0x5e477e(_0x17484e,_0x29c0('0x39')),'icon':_0x3aeebc}),this[_0x29c0('0x13')]=new _0x322fa4(_0x17484e,_0x411cc2),this['contentArea'][_0x29c0('0x38')](_0x29c0('0x4'))['to'](this),this['contentArea'][_0x29c0('0x38')]('value')['to'](this),this[_0x29c0('0x43')]=this[_0x29c0('0xd')](),this[_0x29c0('0x6')]=this[_0x29c0('0x2c')](),this['focusTracker']=new _0x43ff22(),this[_0x29c0('0x1c')]=new _0x4e1e9c(),this[_0x29c0('0x3d')]=this[_0x29c0('0x31')]([this[_0x29c0('0x13')],this[_0x29c0('0x13')][_0x29c0('0x27')],this[_0x29c0('0x43')],this['promptView']]),this[_0x29c0('0xc')]=new _0x36c9de({'focusables':this['_focusables'],'focusTracker':this[_0x29c0('0x26')],'keystrokeHandler':this[_0x29c0('0x1c')],'actions':{'focusPrevious':_0x29c0('0x25'),'focusNext':_0x29c0('0x18')}}),this['promptView'][_0x29c0('0xf')]['on'](_0x29c0('0x16'),_0x33a3ae=>{this[_0x29c0('0xc')][_0x29c0('0x2d')](),_0x33a3ae['stop']();}),this['promptView']['focusCycler']['on'](_0x29c0('0x40'),_0x241172=>{this[_0x29c0('0xc')][_0x29c0('0x1d')](),_0x241172[_0x29c0('0x3f')]();});const _0x5b6895=this[_0x29c0('0xe')];this[_0x29c0('0x30')]({'tag':_0x29c0('0x29'),'attributes':{'class':['ck',_0x29c0('0x0'),_0xdb66d4],'tabindex':'-1'},'children':[this[_0x29c0('0x8')],{'tag':_0x29c0('0x29'),'attributes':{'class':['ck',_0x29c0('0x14')]},'children':[{'tag':_0x29c0('0x29'),'attributes':{'class':[_0x5b6895['if'](_0x29c0('0x34'),'ck-hidden',_0x28c037=>!_0x28c037)]},'children':[this[_0x29c0('0xa')]]},this['contentArea'],this[_0x29c0('0x43')],this[_0x29c0('0x6')]]}]});}['render'](){super[_0x29c0('0x2f')](),this[_0x29c0('0x26')][_0x29c0('0x21')](this[_0x29c0('0x13')][_0x29c0('0x41')]),this['focusTracker'][_0x29c0('0x21')](this['contentArea'][_0x29c0('0x27')][_0x29c0('0x41')]),this[_0x29c0('0x26')][_0x29c0('0x21')](this[_0x29c0('0x43')]['element']),this['focusTracker']['add'](this[_0x29c0('0x6')][_0x29c0('0x41')]),this[_0x29c0('0x1c')][_0x29c0('0x10')](this['element']);}[_0x29c0('0x2e')](){this[_0x29c0('0xc')][_0x29c0('0x3b')]();}[_0x29c0('0x2c')](){const _0x229bad=this['locale'],_0x4bdfe9=new _0x1d8c81(_0x229bad,{'queryView':{'label':_0x5e477e(_0x229bad,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x387179,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x5e477e(_0x229bad,_0x29c0('0x5')),'secondary':_0x5e477e(_0x229bad,_0x29c0('0x9'))}}},'filteredView':this[_0x29c0('0x1f')](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4bdfe9[_0x29c0('0x38')]('isEnabled')['to'](this,_0x29c0('0x33'),this,_0x29c0('0x4'),(_0x13e970,_0x3b0475)=>_0x13e970&&!_0x3b0475),this[_0x29c0('0x10')](_0x4bdfe9,_0x29c0('0x7'),(_0x4d035a,_0x32af32)=>{this[_0x29c0('0x32')]=_0x32af32,this[_0x29c0('0x17')](_0x29c0('0x3a'),this[_0x29c0('0x32')]),_0x32af32[_0x29c0('0x23')]()&&this[_0x29c0('0x12')][_0x29c0('0x21')]({'prompt':_0x32af32[_0x29c0('0x23')]()},0x0);},{'priority':_0x29c0('0x20')}),_0x4bdfe9;}['_createHistoryView'](){const _0x135072=new _0x194976(this[_0x29c0('0x3e')]);return _0x135072[_0x29c0('0x28')][_0x29c0('0x42')][_0x29c0('0x1')](this[_0x29c0('0x12')])['as'](_0x508309),_0x135072['on'](_0x29c0('0x37'),()=>{this[_0x29c0('0x12')]['clear'](),this[_0x29c0('0x6')][_0x29c0('0x2')](''),this['promptView']['focus']();}),_0x135072;}[_0x29c0('0xd')](){const _0x34ebac=new _0x23c880(this['locale']);return _0x34ebac[_0x29c0('0x45')][_0x29c0('0x38')](_0x29c0('0x33'))['to'](this,_0x29c0('0x33'),this,_0x29c0('0x4'),this,_0x29c0('0x1a'),(_0x5abc8a,_0x22f9e6,_0x820e6)=>_0x5abc8a&&!_0x22f9e6&&!!_0x820e6),_0x34ebac[_0x29c0('0x45')]['on'](_0x29c0('0x44'),()=>{this[_0x29c0('0x17')](_0x29c0('0x36'),this[_0x29c0('0x1a')]);}),_0x34ebac[_0x29c0('0x11')][_0x29c0('0x38')](_0x29c0('0x33'))['to'](this,_0x29c0('0x33'),this,'isProcessing',this,_0x29c0('0x1a'),(_0x2ab8e9,_0x1072de,_0x112658)=>_0x2ab8e9&&!_0x1072de&&!!_0x112658),_0x34ebac[_0x29c0('0x11')]['on'](_0x29c0('0x44'),()=>{this[_0x29c0('0x17')]('insertContentBelow',this[_0x29c0('0x1a')]);}),_0x34ebac['tryAgainButton'][_0x29c0('0x38')]('isEnabled')['to'](this,'isEnabled',this,_0x29c0('0x4'),(_0x2b7fc9,_0x167901)=>_0x2b7fc9&&!_0x167901),_0x34ebac['tryAgainButton']['on'](_0x29c0('0x44'),()=>{this[_0x29c0('0x17')]('tryAgainEvent');}),_0x34ebac[_0x29c0('0x22')]['bind'](_0x29c0('0x33'))['to'](this,_0x29c0('0x4')),_0x34ebac[_0x29c0('0x22')]['on'](_0x29c0('0x44'),()=>{this[_0x29c0('0x17')](_0x29c0('0x35'));}),_0x34ebac;}[_0x29c0('0x19')](){this[_0x29c0('0x1a')]='',this['isError']=!0x1,this[_0x29c0('0x4')]=!0x0,this[_0x29c0('0x13')]['isVisible']=!0x0,this[_0x29c0('0x43')][_0x29c0('0x1e')]=!0x0,this[_0x29c0('0x13')][_0x29c0('0x2e')]();}[_0x29c0('0x24')](){const _0x3c61d1=this[_0x29c0('0x3e')];this[_0x29c0('0x4')]=!0x1,this[_0x29c0('0x32')]='',this[_0x29c0('0x6')][_0x29c0('0x2b')](),this[_0x29c0('0x1a')]&&(this['promptView'][_0x29c0('0x1b')][_0x29c0('0xb')]=_0x5e477e(_0x3c61d1,_0x29c0('0x3')));}['handleError'](_0x34f649){const _0x4811d6=this[_0x29c0('0x3e')];this['finishProcessing'](),this['isError']=!0x0,this['errorView'][_0x29c0('0x3c')]=_0x34f649||_0x5e477e(_0x4811d6,_0x29c0('0x2a')),this[_0x29c0('0x1a')]||(this[_0x29c0('0x13')][_0x29c0('0x1e')]=!0x1);}}
23
+ const _0x5e21=['reset','_focusables','historyGroupView','_focusCycler','stopButton','stopProcessing','startProcessing','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','locale','contentArea','trim','focusNext','isVisible','focusCycler','focusTracker','focusPrevious','queryView','_createPromptView','errorView','_promptHistory','isError','setTemplate','shift\x20+\x20tab','createCollection','bind','copyButtonView','finishProcessing','stop','fieldView','bindTemplate','focusFirst','ck-hidden','listenTo','forwardCycle','value','_createHistoryView','label','submitPrompt','promptView','text','Empty\x20history','focus','header','element','_createToolbar','isEnabled','Ask\x20AI\x20to\x20improve\x20generated\x20text','toolbar','fire','prompt','tab','div','execute','tryAgainEvent','set','isProcessing','render','keystrokes','insertContentBelow','add','ck-ai-form','bindTo','Ask\x20AI\x20to\x20edit\x20or\x20generate','tryAgainButton','replaceButton','clearHistory','high','insertButton','AI\x20Assistant','search','submit'];(function(_0x5ab071,_0x5e21f4){const _0x34958d=function(_0x1deb8a){while(--_0x1deb8a){_0x5ab071['push'](_0x5ab071['shift']());}};_0x34958d(++_0x5e21f4);}(_0x5e21,0x1e1));const _0x3495=function(_0x5ab071,_0x5e21f4){_0x5ab071=_0x5ab071-0x0;let _0x34958d=_0x5e21[_0x5ab071];return _0x34958d;};import{FocusTracker as _0x3ab92f,KeystrokeHandler as _0x150c75}from'ckeditor5/src/utils';import{View as _0x50059d,FocusCycler as _0x5523e5,createLabeledTextarea as _0x254b39,FormHeaderView as _0x1d707a}from'ckeditor5/src/ui';import _0x19565f from'./aiformtoolbarview';import _0xb14196 from'./aiformcontentarea';import _0x4653f1 from'./aiformerrorview';import _0x5a7991 from'./aiformpromptview';import _0x36f679 from'./aihistorylistview';import _0x20c0d3 from'./aihistorylistitemview';import _0x25c24d from'./prompthistory';import{getTranslation as _0x28898e}from'../../utils/common-translations';import _0x58a44f from'../../../theme/icons/robot-pencil.svg';export default class g extends _0x50059d{constructor(_0x5b3152,_0x3e3a7e,_0x2d1745=''){super(_0x5b3152),this[_0x3495('0x46')](_0x3495('0x3d'),!0x0),this['set'](_0x3495('0x0'),!0x1),this[_0x3495('0x46')]('prompt',''),this[_0x3495('0x46')](_0x3495('0x32'),''),this[_0x3495('0x46')](_0x3495('0x24'),!0x1),this[_0x3495('0x23')]=new _0x25c24d(),this[_0x3495('0x22')]=new _0x4653f1(_0x5b3152),this['header']=new _0x1d707a(_0x5b3152,{'label':_0x28898e(_0x5b3152,_0x3495('0xd')),'icon':_0x58a44f}),this['contentArea']=new _0xb14196(_0x5b3152,_0x2d1745),this['contentArea'][_0x3495('0x28')](_0x3495('0x0'))['to'](this),this[_0x3495('0x19')][_0x3495('0x28')](_0x3495('0x32'))['to'](this),this['toolbar']=this[_0x3495('0x3c')](),this[_0x3495('0x36')]=this[_0x3495('0x21')](),this[_0x3495('0x1e')]=new _0x3ab92f(),this['keystrokes']=new _0x150c75(),this['_focusables']=this[_0x3495('0x27')]([this['contentArea'],this[_0x3495('0x19')]['copyButtonView'],this['toolbar'],this['promptView']]),this[_0x3495('0x13')]=new _0x5523e5({'focusables':this[_0x3495('0x11')],'focusTracker':this[_0x3495('0x1e')],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x3495('0x26'),'focusNext':_0x3495('0x42')}}),this[_0x3495('0x36')]['focusCycler']['on'](_0x3495('0x31'),_0x1bf45c=>{this[_0x3495('0x13')][_0x3495('0x1b')](),_0x1bf45c['stop']();}),this[_0x3495('0x36')][_0x3495('0x1d')]['on']('backwardCycle',_0x24307d=>{this['_focusCycler'][_0x3495('0x1f')](),_0x24307d[_0x3495('0x2b')]();}),this[_0x3495('0x36')][_0x3495('0x20')][_0x3495('0x2c')]['bind'](_0x3495('0x32'))['to'](this,_0x3495('0x41'));const _0x586297=this[_0x3495('0x2d')];this[_0x3495('0x25')]({'tag':'div','attributes':{'class':['ck',_0x3495('0x5'),_0x3e3a7e],'tabindex':'-1'},'children':[this[_0x3495('0x3a')],{'tag':_0x3495('0x43'),'attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x586297['if'](_0x3495('0x24'),_0x3495('0x2f'),_0x5f1c18=>!_0x5f1c18)]},'children':[this[_0x3495('0x22')]]},this[_0x3495('0x19')],this[_0x3495('0x3f')],this['promptView']]}]});}[_0x3495('0x1')](){super[_0x3495('0x1')](),this[_0x3495('0x1e')][_0x3495('0x4')](this[_0x3495('0x19')]['element']),this[_0x3495('0x1e')][_0x3495('0x4')](this[_0x3495('0x19')][_0x3495('0x29')][_0x3495('0x3b')]),this['focusTracker']['add'](this[_0x3495('0x3f')][_0x3495('0x3b')]),this[_0x3495('0x1e')][_0x3495('0x4')](this[_0x3495('0x36')][_0x3495('0x3b')]),this[_0x3495('0x2')][_0x3495('0x30')](this[_0x3495('0x3b')]);}[_0x3495('0x39')](){this[_0x3495('0x13')][_0x3495('0x2e')]();}['reset'](){this['prompt']='',this[_0x3495('0x32')]='',this[_0x3495('0x36')][_0x3495('0x10')](),this[_0x3495('0x19')]['isVisible']=!0x1,this['toolbar'][_0x3495('0x1c')]=!0x1;}[_0x3495('0x21')](){const _0x5e2a29=this['locale'],_0x2f2ff2=new _0x5a7991(_0x5e2a29,{'queryView':{'label':_0x28898e(_0x5e2a29,_0x3495('0x7')),'creator':_0x254b39,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x28898e(_0x5e2a29,_0x3495('0x38')),'secondary':_0x28898e(_0x5e2a29,_0x3495('0x17'))}}},'filteredView':this[_0x3495('0x33')](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2f2ff2[_0x3495('0x28')](_0x3495('0x3d'))['to'](this,_0x3495('0x3d'),this,_0x3495('0x0'),(_0x2a9360,_0x2a1b10)=>_0x2a9360&&!_0x2a1b10),this[_0x3495('0x30')](_0x2f2ff2,_0x3495('0xf'),(_0x3b66f9,_0x57643e)=>{this[_0x3495('0x41')]=_0x57643e,this[_0x3495('0x40')](_0x3495('0x35'),this[_0x3495('0x41')]),_0x57643e['trim']()&&this[_0x3495('0x23')][_0x3495('0x4')]({'prompt':_0x57643e[_0x3495('0x1a')]()},0x0);},{'priority':_0x3495('0xb')}),_0x2f2ff2;}[_0x3495('0x33')](){const _0x291782=new _0x36f679(this[_0x3495('0x18')]);return _0x291782[_0x3495('0x12')]['items'][_0x3495('0x6')](this[_0x3495('0x23')])['as'](_0x20c0d3),_0x291782['on'](_0x3495('0xa'),()=>{this[_0x3495('0x23')]['clear'](),this['promptView'][_0x3495('0xe')](''),this[_0x3495('0x36')][_0x3495('0x39')]();}),_0x291782;}['_createToolbar'](){const _0x1cbc64=new _0x19565f(this[_0x3495('0x18')]);return _0x1cbc64[_0x3495('0x9')][_0x3495('0x28')]('isEnabled')['to'](this,'isEnabled',this,_0x3495('0x0'),this,_0x3495('0x32'),(_0x331aec,_0x38859a,_0x18f874)=>_0x331aec&&!_0x38859a&&!!_0x18f874),_0x1cbc64[_0x3495('0x9')]['on'](_0x3495('0x44'),()=>{this['fire']('replaceContent',this[_0x3495('0x32')]);}),_0x1cbc64[_0x3495('0xc')][_0x3495('0x28')](_0x3495('0x3d'))['to'](this,_0x3495('0x3d'),this,_0x3495('0x0'),this,_0x3495('0x32'),(_0x2b0e8d,_0x3c6411,_0x22cec2)=>_0x2b0e8d&&!_0x3c6411&&!!_0x22cec2),_0x1cbc64[_0x3495('0xc')]['on']('execute',()=>{this['fire'](_0x3495('0x3'),this[_0x3495('0x32')]);}),_0x1cbc64[_0x3495('0x8')][_0x3495('0x28')](_0x3495('0x3d'))['to'](this,_0x3495('0x3d'),this,'isProcessing',(_0x27ef54,_0x56b40f)=>_0x27ef54&&!_0x56b40f),_0x1cbc64['tryAgainButton']['on'](_0x3495('0x44'),()=>{this[_0x3495('0x40')](_0x3495('0x45'));}),_0x1cbc64[_0x3495('0x14')][_0x3495('0x28')]('isEnabled')['to'](this,'isProcessing'),_0x1cbc64[_0x3495('0x14')]['on'](_0x3495('0x44'),()=>{this['fire'](_0x3495('0x15'));}),_0x1cbc64;}[_0x3495('0x16')](){this[_0x3495('0x32')]='',this[_0x3495('0x24')]=!0x1,this['isProcessing']=!0x0,this[_0x3495('0x19')][_0x3495('0x1c')]=!0x0,this['toolbar'][_0x3495('0x1c')]=!0x0,this[_0x3495('0x19')][_0x3495('0x39')]();}[_0x3495('0x2a')](){const _0x3a2365=this[_0x3495('0x18')];this[_0x3495('0x0')]=!0x1,this['prompt']='',this[_0x3495('0x36')][_0x3495('0x10')](),this[_0x3495('0x32')]&&(this['promptView'][_0x3495('0x20')][_0x3495('0x34')]=_0x28898e(_0x3a2365,_0x3495('0x3e')));}['handleError'](_0x2a1cef){const _0x51d546=this['locale'];this[_0x3495('0x2a')](),this[_0x3495('0x24')]=!0x0,this[_0x3495('0x22')][_0x3495('0x37')]=_0x2a1cef||_0x28898e(_0x51d546,'AI_ERROR_FAILED'),this[_0x3495('0x32')]||(this[_0x3495('0x19')]['isVisible']=!0x1);}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5920=['prompt','execute','locale','set','add'];(function(_0x33e8ac,_0x59200b){const _0x4c2e0b=function(_0x22830d){while(--_0x22830d){_0x33e8ac['push'](_0x33e8ac['shift']());}};_0x4c2e0b(++_0x59200b);}(_0x5920,0x13e));const _0x4c2e=function(_0x33e8ac,_0x59200b){_0x33e8ac=_0x33e8ac-0x0;let _0x4c2e0b=_0x5920[_0x33e8ac];return _0x4c2e0b;};import{ListItemView as _0x585e98,ButtonView as _0x4ac0f8}from'ckeditor5/src/ui';import _0x374316 from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x5a9a68}from'lodash-es';export default class et extends _0x585e98{constructor(_0x4a8bba){super();const _0xc3a829=new _0x374316(),_0x3e53fe=new _0x4ac0f8(this[_0x4c2e('0x4')],_0xc3a829);this['children'][_0x4c2e('0x1')](_0x3e53fe),_0x3e53fe[_0x4c2e('0x0')]({'label':_0x4a8bba[_0x4c2e('0x2')],'withText':!0x0}),_0x3e53fe['on'](_0x4c2e('0x3'),()=>{this['fire']('execute',{'value':_0x5a9a68(_0x4a8bba[_0x4c2e('0x2')])});});}}
23
+ const _0x5c23=['fire','children','locale'];(function(_0x223042,_0x5c2300){const _0x5ef34e=function(_0xd0eb4d){while(--_0xd0eb4d){_0x223042['push'](_0x223042['shift']());}};_0x5ef34e(++_0x5c2300);}(_0x5c23,0xf3));const _0x5ef3=function(_0x223042,_0x5c2300){_0x223042=_0x223042-0x0;let _0x5ef34e=_0x5c23[_0x223042];return _0x5ef34e;};import{ListItemView as _0x4fd784,ButtonView as _0x16c350}from'ckeditor5/src/ui';import _0x1c547e from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x587866}from'lodash-es';export default class et extends _0x4fd784{constructor(_0x24e054){super();const _0x11730b=new _0x1c547e(),_0x1b1a4d=new _0x16c350(this[_0x5ef3('0x2')],_0x11730b);this[_0x5ef3('0x1')]['add'](_0x1b1a4d),_0x1b1a4d['set']({'label':_0x24e054['prompt'],'withText':!0x0}),_0x1b1a4d['on']('execute',()=>{this[_0x5ef3('0x0')]('execute',{'value':_0x587866(_0x24e054['prompt'])});});}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x116a=['clearHistoryButton','_createClearHistoryButton','add','historyGroupView','Prompt\x20history','items','locale','label','filter','execute','delegate','length','clearHistory','children'];(function(_0x529804,_0x116a6d){const _0x3c383c=function(_0x3fe3d2){while(--_0x3fe3d2){_0x529804['push'](_0x529804['shift']());}};_0x3c383c(++_0x116a6d);}(_0x116a,0x1bf));const _0x3c38=function(_0x529804,_0x116a6d){_0x529804=_0x529804-0x0;let _0x3c383c=_0x116a[_0x529804];return _0x3c383c;};import{ListView as _0x5c0889,ListItemGroupView as _0x106992,ButtonView as _0xaa0387}from'ckeditor5/src/ui';import{getTranslation as _0xe2be70}from'../../utils/common-translations';export default class st extends _0x5c0889{constructor(_0x4d4402){super(_0x4d4402),this[_0x3c38('0x1')]=this[_0x3c38('0x2')](),this[_0x3c38('0x4')]=new _0x106992(),this[_0x3c38('0x4')][_0x3c38('0x0')][_0x3c38('0x3')](this[_0x3c38('0x1')],0x1),this[_0x3c38('0x4')][_0x3c38('0x8')]=_0xe2be70(_0x4d4402,_0x3c38('0x5')),this[_0x3c38('0x4')][_0x3c38('0x6')][_0x3c38('0xb')](_0x3c38('0xa'))['to'](this),this[_0x3c38('0x6')]['add'](this['historyGroupView']);}[_0x3c38('0x9')](){let _0x1aaa53=0x0;for(const _0x3a3a8f of this[_0x3c38('0x6')])_0x1aaa53+=_0x3a3a8f[_0x3c38('0x6')][_0x3c38('0xc')];return{'resultsCount':_0x1aaa53,'totalItemsCount':_0x1aaa53};}['_createClearHistoryButton'](){const _0xf1e89b=this['locale'],_0xa4d4c4=new _0xaa0387(this[_0x3c38('0x7')]);return _0xa4d4c4['set']({'label':'('+_0xe2be70(_0xf1e89b,'Clear')+')','withText':!0x0}),_0xa4d4c4['on'](_0x3c38('0xa'),()=>this['fire'](_0x3c38('0xd'))),_0xa4d4c4;}}
23
+ const _0x1b4b=['filter','locale','children','clearHistoryButton','delegate','set','fire','label','historyGroupView','execute','clearHistory','_createClearHistoryButton','length','add'];(function(_0x39c0a0,_0x1b4b80){const _0x5333d1=function(_0x334194){while(--_0x334194){_0x39c0a0['push'](_0x39c0a0['shift']());}};_0x5333d1(++_0x1b4b80);}(_0x1b4b,0x156));const _0x5333=function(_0x39c0a0,_0x1b4b80){_0x39c0a0=_0x39c0a0-0x0;let _0x5333d1=_0x1b4b[_0x39c0a0];return _0x5333d1;};import{ListView as _0x4dbe5b,ListItemGroupView as _0x1b087b,ButtonView as _0x3779cf}from'ckeditor5/src/ui';import{getTranslation as _0x226aa4}from'../../utils/common-translations';export default class it extends _0x4dbe5b{constructor(_0x2ae534){super(_0x2ae534),this[_0x5333('0xb')]=this['_createClearHistoryButton'](),this[_0x5333('0x2')]=new _0x1b087b(),this['historyGroupView'][_0x5333('0xa')][_0x5333('0x7')](this['clearHistoryButton'],0x1),this['historyGroupView'][_0x5333('0x1')]=_0x226aa4(_0x2ae534,'Prompt\x20history'),this['historyGroupView']['items'][_0x5333('0xc')](_0x5333('0x3'))['to'](this),this['items'][_0x5333('0x7')](this[_0x5333('0x2')]);}[_0x5333('0x8')](){let _0x332516=0x0;for(const _0x40f27e of this['items'])_0x332516+=_0x40f27e['items'][_0x5333('0x6')];return{'resultsCount':_0x332516,'totalItemsCount':_0x332516};}[_0x5333('0x5')](){const _0x4c9d56=this[_0x5333('0x9')],_0x93c445=new _0x3779cf(this['locale']);return _0x93c445[_0x5333('0xd')]({'label':'('+_0x226aa4(_0x4c9d56,'Clear')+')','withText':!0x0}),_0x93c445['on'](_0x5333('0x3'),()=>this[_0x5333('0x0')](_0x5333('0x4'))),_0x93c445;}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5e89=['toLowerCase','prompt','add','map','parse','_saveToSessionStorage','stringify','setItem','length','remove','_loadFromSessionStorage','addMany','getItem'];(function(_0x21f80f,_0x5e89ce){const _0x3bff69=function(_0xa9ee1f){while(--_0xa9ee1f){_0x21f80f['push'](_0x21f80f['shift']());}};_0x3bff69(++_0x5e89ce);}(_0x5e89,0xf2));const _0x3bff=function(_0x21f80f,_0x5e89ce){_0x21f80f=_0x21f80f-0x0;let _0x3bff69=_0x5e89[_0x21f80f];return _0x3bff69;};import{Collection as _0x1701e4}from'ckeditor5/src/utils';const ts='CKEditor/AIFormView/PromptHistory';export default class rt extends _0x1701e4{constructor(){super(),this[_0x3bff('0x2')](),this['on'](_0x3bff('0x7'),(_0x2727a4,_0x2b2d32)=>{const _0x3d38bb=os(_0x2b2d32[_0x3bff('0x6')]);for(const _0x300a73 of this)if(_0x300a73!=_0x2b2d32&&os(_0x300a73[_0x3bff('0x6')])===_0x3d38bb){this[_0x3bff('0x1')](_0x300a73);break;}this[_0x3bff('0x0')]>0x14&&this[_0x3bff('0x1')](this['last']),this[_0x3bff('0xa')]();}),this['on'](_0x3bff('0x1'),()=>{this[_0x3bff('0xa')]();});}[_0x3bff('0x2')](){const _0x471042=sessionStorage[_0x3bff('0x4')](ts)||'[]';this[_0x3bff('0x3')](JSON[_0x3bff('0x9')](_0x471042));}['_saveToSessionStorage'](){sessionStorage[_0x3bff('0xc')](ts,JSON[_0x3bff('0xb')](this[_0x3bff('0x8')](_0x7e758d=>_0x7e758d)));}}function os(_0x101b40){return _0x101b40[_0x3bff('0x5')]()['trim']();}
23
+ const _0x25bf=['_loadFromSessionStorage','remove','toLowerCase','map','prompt','CKEditor/AIFormView/PromptHistory','add','last','length','addMany','_saveToSessionStorage'];(function(_0x14e1c8,_0x25bfb4){const _0x1dd349=function(_0x37481c){while(--_0x37481c){_0x14e1c8['push'](_0x14e1c8['shift']());}};_0x1dd349(++_0x25bfb4);}(_0x25bf,0xbb));const _0x1dd3=function(_0x14e1c8,_0x25bfb4){_0x14e1c8=_0x14e1c8-0x0;let _0x1dd349=_0x25bf[_0x14e1c8];return _0x1dd349;};import{Collection as _0x570834}from'ckeditor5/src/utils';const ts=_0x1dd3('0x5');export default class rt extends _0x570834{constructor(){super(),this[_0x1dd3('0x0')](),this['on'](_0x1dd3('0x6'),(_0x22caa8,_0x36984d)=>{const _0x1be21b=os(_0x36984d[_0x1dd3('0x4')]);for(const _0x935f74 of this)if(_0x935f74!=_0x36984d&&os(_0x935f74['prompt'])===_0x1be21b){this['remove'](_0x935f74);break;}this[_0x1dd3('0x8')]>0x14&&this[_0x1dd3('0x1')](this[_0x1dd3('0x7')]),this[_0x1dd3('0xa')]();}),this['on'](_0x1dd3('0x1'),()=>{this[_0x1dd3('0xa')]();});}['_loadFromSessionStorage'](){const _0x18247e=sessionStorage['getItem'](ts)||'[]';this[_0x1dd3('0x9')](JSON['parse'](_0x18247e));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this[_0x1dd3('0x3')](_0x2df091=>_0x2df091)));}}function os(_0xc2a4dc){return _0xc2a4dc[_0x1dd3('0x2')]()['trim']();}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x40e6=['showUI','config','element','editor','get','refresh','execute','model','getItems','includes','aiAssistant.disabledElements','getRanges','plugins','selection','isEnabled','document'];(function(_0x12a536,_0x40e69c){const _0x56f318=function(_0x12732d){while(--_0x12732d){_0x12a536['push'](_0x12a536['shift']());}};_0x56f318(++_0x40e69c);}(_0x40e6,0xb2));const _0x56f3=function(_0x12a536,_0x40e69c){_0x12a536=_0x12a536-0x0;let _0x56f318=_0x40e6[_0x12a536];return _0x56f318;};import{Command as _0x62e8bf}from'ckeditor5/src/core';import _0x31b18b from'../aiassistantui';export default class A extends _0x62e8bf{[_0x56f3('0x3')](){const _0x2adb54=this['editor'][_0x56f3('0x5')][_0x56f3('0xd')][_0x56f3('0xb')],_0x5a113b=this[_0x56f3('0x1')][_0x56f3('0xf')][_0x56f3('0x2')](_0x56f3('0x8'));for(const _0x2faa1b of _0x2adb54[_0x56f3('0x9')]())for(const _0x563ac1 of _0x2faa1b[_0x56f3('0x6')]())if(_0x563ac1['is'](_0x56f3('0x0'))&&_0x5a113b[_0x56f3('0x7')](_0x563ac1['name']))return void(this[_0x56f3('0xc')]=!0x1);this[_0x56f3('0xc')]=!0x0;}[_0x56f3('0x4')](_0x5e4007='',_0x9f6032=''){this[_0x56f3('0x1')][_0x56f3('0xa')]['get'](_0x31b18b)[_0x56f3('0xe')](_0x5e4007,_0x9f6032);}}
23
+ const _0x447b=['document','showUI','model','getItems','aiAssistant.disabledElements','execute','includes','refresh','config','name','selection','get','editor'];(function(_0x18f798,_0x447b41){const _0x23864d=function(_0x151e16){while(--_0x151e16){_0x18f798['push'](_0x18f798['shift']());}};_0x23864d(++_0x447b41);}(_0x447b,0xcc));const _0x2386=function(_0x18f798,_0x447b41){_0x18f798=_0x18f798-0x0;let _0x23864d=_0x447b[_0x18f798];return _0x23864d;};import{Command as _0x2fe45b}from'ckeditor5/src/core';import _0xfe729f from'../aiassistantui';export default class A extends _0x2fe45b{[_0x2386('0xb')](){const _0x1e307f=this['editor'][_0x2386('0x6')][_0x2386('0x4')][_0x2386('0x1')],_0x1ee83c=this['editor'][_0x2386('0xc')]['get'](_0x2386('0x8'));for(const _0x2ad495 of _0x1e307f['getRanges']())for(const _0x34bc56 of _0x2ad495[_0x2386('0x7')]())if(_0x34bc56['is']('element')&&_0x1ee83c[_0x2386('0xa')](_0x34bc56[_0x2386('0x0')]))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}[_0x2386('0x9')](_0x501671='',_0x1ba1be=''){this[_0x2386('0x3')]['plugins'][_0x2386('0x2')](_0xfe729f)[_0x2386('0x5')](_0x501671,_0x1ba1be);}}
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export function getTranslation(_0x2d4719,_0x1abc37,_0x20ec0c){const t=_0x2d4719['t'];switch(_0x1abc37){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',_0x20ec0c);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_ERROR_AUTH_REQUEST':return t({'id':'AI_ERROR_AUTH_REQUEST','string':'Authorization\x20request\x20failed'});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 _0x1abc37;}}
23
+ export function getTranslation(_0x32d646,_0x38aed3,_0x3dd74a){const t=_0x32d646['t'];switch(_0x38aed3){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',_0x3dd74a);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_ERROR_AUTH_REQUEST':return t({'id':'AI_ERROR_AUTH_REQUEST','string':'Authorization\x20request\x20failed'});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 _0x38aed3;}}
package/theme/ai-form.css CHANGED
@@ -64,10 +64,17 @@
64
64
  width: 100%;
65
65
  white-space: normal;
66
66
  padding: var(--ck-spacing-tiny) var(--ck-spacing-medium);
67
- padding-right: 0;
68
67
  min-height: calc( var(--ck-line-height-base) * var(--ck-font-size-base) );
69
68
  box-sizing: content-box;
70
69
 
70
+ @mixin ck-dir ltr {
71
+ padding-right: 0;
72
+ }
73
+
74
+ @mixin ck-dir rtl {
75
+ padding-left: 0;
76
+ }
77
+
71
78
  & > * {
72
79
  white-space: normal;
73
80
  color: inherit;
@@ -75,7 +82,14 @@
75
82
  }
76
83
 
77
84
  & .ck-spinner-container {
78
- margin-right: var(--ck-spacing-medium);
85
+ @mixin ck-dir ltr {
86
+ margin-right: var(--ck-spacing-medium);
87
+ }
88
+
89
+ @mixin ck-dir rtl {
90
+ margin-left: var(--ck-spacing-medium);
91
+ }
92
+
79
93
  }
80
94
 
81
95
  & .ck-ai-form__copy-button-wrapper {
@@ -126,14 +140,29 @@
126
140
  flex-grow: 1;
127
141
  }
128
142
 
129
- & > .ck.ck-button {
130
- margin-left: var(--ck-spacing-medium);
143
+ & > .ck.ck-ai-form__submit {
144
+ @mixin ck-dir ltr {
145
+ margin-left: var(--ck-spacing-medium);
146
+ }
147
+
148
+ @mixin ck-dir rtl {
149
+ margin-right: var(--ck-spacing-medium);
150
+ }
131
151
  }
132
152
 
133
- & > .ck-labeled-field-view .ck-button {
153
+ /* Toggle history button */
154
+ & > .ck-labeled-field-view .ck-ai-form__toggle-history {
134
155
  position: absolute;
135
156
  font-size: var(--ck-font-size-tiny);
136
- right: var(--ck-spacing-medium);
157
+
158
+ @mixin ck-dir ltr {
159
+ right: var(--ck-spacing-medium);
160
+ }
161
+
162
+ @mixin ck-dir rtl {
163
+ left: var(--ck-spacing-medium);
164
+ }
165
+
137
166
  bottom: var(--ck-spacing-small);
138
167
  top: var(--ck-spacing-small);
139
168
  padding: 4px;
@@ -142,7 +171,14 @@
142
171
  }
143
172
 
144
173
  & .ck-textarea {
145
- padding-right: 30px;
174
+ /* Give the toggle history button some space */
175
+ @mixin ck-dir ltr {
176
+ padding-right: 30px;
177
+ }
178
+
179
+ @mixin ck-dir rtl {
180
+ padding-left: 30px;
181
+ }
146
182
  }
147
183
 
148
184
  /* Prompt history group */