@ckeditor/ckeditor5-ai 40.0.0 → 40.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/LICENSE.md +2 -2
  2. package/build/ai.js +2 -2
  3. package/build/translations/af.js +1 -1
  4. package/build/translations/ar.js +1 -1
  5. package/build/translations/bg.js +1 -1
  6. package/build/translations/bn.js +1 -1
  7. package/build/translations/bs.js +1 -1
  8. package/build/translations/ca.js +1 -1
  9. package/build/translations/cs.js +1 -1
  10. package/build/translations/da.js +1 -1
  11. package/build/translations/de-ch.js +1 -1
  12. package/build/translations/de.js +1 -1
  13. package/build/translations/el.js +1 -1
  14. package/build/translations/en-au.js +1 -1
  15. package/build/translations/es-co.js +1 -1
  16. package/build/translations/es.js +1 -1
  17. package/build/translations/et.js +1 -1
  18. package/build/translations/fa.js +1 -1
  19. package/build/translations/fi.js +1 -1
  20. package/build/translations/fr.js +1 -1
  21. package/build/translations/gl.js +1 -1
  22. package/build/translations/he.js +1 -1
  23. package/build/translations/hi.js +1 -1
  24. package/build/translations/hr.js +1 -1
  25. package/build/translations/hu.js +1 -1
  26. package/build/translations/id.js +1 -1
  27. package/build/translations/it.js +1 -1
  28. package/build/translations/ja.js +1 -1
  29. package/build/translations/jv.js +1 -1
  30. package/build/translations/ko.js +1 -1
  31. package/build/translations/lt.js +1 -1
  32. package/build/translations/lv.js +1 -1
  33. package/build/translations/ms.js +1 -1
  34. package/build/translations/nl.js +1 -1
  35. package/build/translations/no.js +1 -1
  36. package/build/translations/pl.js +1 -1
  37. package/build/translations/pt-br.js +1 -1
  38. package/build/translations/pt.js +1 -1
  39. package/build/translations/ro.js +1 -1
  40. package/build/translations/ru.js +1 -1
  41. package/build/translations/sk.js +1 -1
  42. package/build/translations/sr-latn.js +1 -1
  43. package/build/translations/sr.js +1 -1
  44. package/build/translations/sv.js +1 -1
  45. package/build/translations/th.js +1 -1
  46. package/build/translations/tk.js +1 -1
  47. package/build/translations/tr.js +1 -1
  48. package/build/translations/ug.js +1 -1
  49. package/build/translations/uk.js +1 -1
  50. package/build/translations/ur.js +1 -1
  51. package/build/translations/uz.js +1 -0
  52. package/build/translations/vi.js +1 -1
  53. package/build/translations/zh-cn.js +1 -1
  54. package/build/translations/zh.js +1 -1
  55. package/lang/contexts.json +1 -0
  56. package/lang/translations/af.po +60 -16
  57. package/lang/translations/ar.po +60 -16
  58. package/lang/translations/bg.po +60 -16
  59. package/lang/translations/bn.po +60 -16
  60. package/lang/translations/bs.po +60 -16
  61. package/lang/translations/ca.po +60 -16
  62. package/lang/translations/cs.po +60 -16
  63. package/lang/translations/da.po +60 -16
  64. package/lang/translations/de-ch.po +60 -16
  65. package/lang/translations/de.po +60 -16
  66. package/lang/translations/el.po +60 -16
  67. package/lang/translations/en-au.po +60 -16
  68. package/lang/translations/en.po +60 -16
  69. package/lang/translations/es-co.po +60 -16
  70. package/lang/translations/es.po +60 -16
  71. package/lang/translations/et.po +60 -16
  72. package/lang/translations/fa.po +60 -16
  73. package/lang/translations/fi.po +60 -16
  74. package/lang/translations/fr.po +60 -16
  75. package/lang/translations/gl.po +60 -16
  76. package/lang/translations/he.po +60 -16
  77. package/lang/translations/hi.po +60 -16
  78. package/lang/translations/hr.po +93 -49
  79. package/lang/translations/hu.po +60 -16
  80. package/lang/translations/id.po +60 -16
  81. package/lang/translations/it.po +60 -16
  82. package/lang/translations/ja.po +60 -16
  83. package/lang/translations/jv.po +60 -16
  84. package/lang/translations/ko.po +60 -16
  85. package/lang/translations/lt.po +60 -16
  86. package/lang/translations/lv.po +60 -16
  87. package/lang/translations/ms.po +60 -16
  88. package/lang/translations/nl.po +60 -16
  89. package/lang/translations/no.po +60 -16
  90. package/lang/translations/pl.po +60 -16
  91. package/lang/translations/pt-br.po +60 -16
  92. package/lang/translations/pt.po +60 -16
  93. package/lang/translations/ro.po +60 -16
  94. package/lang/translations/ru.po +60 -16
  95. package/lang/translations/sk.po +60 -16
  96. package/lang/translations/sr-latn.po +60 -16
  97. package/lang/translations/sr.po +60 -16
  98. package/lang/translations/sv.po +60 -16
  99. package/lang/translations/th.po +60 -16
  100. package/lang/translations/tk.po +60 -16
  101. package/lang/translations/tr.po +60 -16
  102. package/lang/translations/ug.po +94 -50
  103. package/lang/translations/uk.po +60 -16
  104. package/lang/translations/ur.po +60 -16
  105. package/lang/translations/uz.po +226 -0
  106. package/lang/translations/vi.po +60 -16
  107. package/lang/translations/zh-cn.po +60 -16
  108. package/lang/translations/zh.po +60 -16
  109. package/package.json +3 -3
  110. package/src/aiassistant.d.ts +458 -419
  111. package/src/aiassistant.js +1 -1
  112. package/src/aiassistantediting.d.ts +45 -45
  113. package/src/aiassistantediting.js +1 -1
  114. package/src/aiassistantui.d.ts +44 -46
  115. package/src/aiassistantui.js +1 -1
  116. package/src/aiconnector.d.ts +45 -44
  117. package/src/aiconnector.js +1 -1
  118. package/src/augmentation.d.ts +26 -26
  119. package/src/index.d.ts +9 -9
  120. package/src/ui/aiassistantcontroller.d.ts +96 -59
  121. package/src/ui/aiassistantcontroller.js +1 -1
  122. package/src/ui/dropdown/aicommandslistview.d.ts +22 -22
  123. package/src/ui/dropdown/aicommandslistview.js +1 -1
  124. package/src/ui/dropdown/buttonlabelwithhighlightview.d.ts +29 -29
  125. package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
  126. package/src/ui/dropdown/labelwithhighlightview.d.ts +25 -0
  127. package/src/ui/dropdown/labelwithhighlightview.js +23 -0
  128. package/src/ui/form/aiformcontentarea.d.ts +48 -48
  129. package/src/ui/form/aiformcontentarea.js +1 -1
  130. package/src/ui/form/aiformerrorview.d.ts +26 -26
  131. package/src/ui/form/aiformerrorview.js +1 -1
  132. package/src/ui/form/aiformpromptview.d.ts +46 -46
  133. package/src/ui/form/aiformpromptview.js +1 -1
  134. package/src/ui/form/aiformtoolbarview.d.ts +54 -41
  135. package/src/ui/form/aiformtoolbarview.js +1 -1
  136. package/src/ui/form/aiformview.d.ts +142 -131
  137. package/src/ui/form/aiformview.js +1 -1
  138. package/src/ui/form/aihistorylistitemview.d.ts +18 -18
  139. package/src/ui/form/aihistorylistitemview.js +1 -1
  140. package/src/ui/form/aihistorylistview.d.ts +35 -35
  141. package/src/ui/form/aihistorylistview.js +1 -1
  142. package/src/ui/form/prompthistory.d.ts +20 -20
  143. package/src/ui/form/prompthistory.js +1 -1
  144. package/src/ui/showaiassistantcommand.d.ts +26 -26
  145. package/src/ui/showaiassistantcommand.js +1 -1
  146. package/src/utils/common-translations.d.ts +9 -9
  147. package/src/utils/common-translations.js +1 -1
  148. package/theme/ai-form.css +58 -11
  149. package/theme/ai.css +20 -15
@@ -1,46 +1,46 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ai/ui/aiformpromptview
7
- */
8
- import { type Locale } from 'ckeditor5/src/utils';
9
- import { AutocompleteView, ButtonView, type TextareaView, type AutocompleteViewConfig } from 'ckeditor5/src/ui';
10
- /**
11
- * A textarea field allowing to ask AI.
12
- */
13
- export default class AIFormPromptView extends AutocompleteView<TextareaView> {
14
- /**
15
- * The submit button view.
16
- */
17
- submitButtonView: ButtonView;
18
- /**
19
- * The button that shows and hides the history autocomplete panel.
20
- */
21
- showHistoryButtonView: ButtonView;
22
- /**
23
- * Creates `AIFormPromptView` instance.
24
- *
25
- * @param locale The localization services instance.
26
- * @param config Autocomplete config.
27
- */
28
- constructor(locale: Locale, config: AutocompleteViewConfig<TextareaView>);
29
- /**
30
- * @inheritDoc
31
- */
32
- render(): void;
33
- /**
34
- * @inheritDoc
35
- */
36
- focus(direction?: 1 | -1): void;
37
- }
38
- /**
39
- * Fired when the query is submitted by the user.
40
- *
41
- * @eventName ~AIFormPromptView#submit
42
- */
43
- export type AIFormPromptViewSubmitEvent = {
44
- name: 'submit';
45
- args: [query: string];
46
- };
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ai/ui/aiformpromptview
7
+ */
8
+ import { type Locale } from 'ckeditor5/src/utils';
9
+ import { AutocompleteView, ButtonView, type TextareaView, type AutocompleteViewConfig } from 'ckeditor5/src/ui';
10
+ /**
11
+ * A textarea field allowing to ask AI.
12
+ */
13
+ export default class AIFormPromptView extends AutocompleteView<TextareaView> {
14
+ /**
15
+ * The submit button view.
16
+ */
17
+ submitButtonView: ButtonView;
18
+ /**
19
+ * The button that shows and hides the history autocomplete panel.
20
+ */
21
+ showHistoryButtonView: ButtonView;
22
+ /**
23
+ * Creates `AIFormPromptView` instance.
24
+ *
25
+ * @param locale The localization services instance.
26
+ * @param config Autocomplete config.
27
+ */
28
+ constructor(locale: Locale, config: AutocompleteViewConfig<TextareaView>);
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ render(): void;
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ focus(direction?: 1 | -1): void;
37
+ }
38
+ /**
39
+ * Fired when the query is submitted by the user.
40
+ *
41
+ * @eventName ~AIFormPromptView#submit
42
+ */
43
+ export type AIFormPromptViewSubmitEvent = {
44
+ name: 'submit';
45
+ args: [query: string];
46
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4aed=['fieldView','maxRows','history','right','children','element','minRows','style','render','locale','fire','requestAnimationFrame','submit','isVisible','value','Submit','target','focusableChildren','filteredView','showHistoryButtonView','focusFirst','resultsView','focusCycler','queryView','_createShowHistoryButton','set','width','bind','update','History','execute','window','submitButtonView','ck-ai-form__submit','_createSubmitButton','fieldWrapperChildren','focusLast','focus','isEnabled','add','isOn'];(function(_0x45cf66,_0x4aed63){const _0x34c952=function(_0x4c8106){while(--_0x4c8106){_0x45cf66['push'](_0x45cf66['shift']());}};_0x34c952(++_0x4aed63);}(_0x4aed,0x189));const _0x34c9=function(_0x45cf66,_0x4aed63){_0x45cf66=_0x45cf66-0x0;let _0x34c952=_0x4aed[_0x45cf66];return _0x34c952;};import{Rect as _0x320071,global as _0x5517d8}from'ckeditor5/src/utils';import{AutocompleteView as _0x3bb9e9,ButtonView as _0x3dd51a}from'ckeditor5/src/ui';import{icons as _0x1c4845}from'ckeditor5/src/core';import{escape as _0x16dc1f}from'lodash-es';import{getTranslation as _0x66cc04}from'../../utils/common-translations';import _0x6756fd from'../../../theme/icons/submit.svg';export default class R extends _0x3bb9e9{constructor(_0x91c65b,_0x47ff06){super(_0x91c65b,_0x47ff06),this[_0x34c9('0x28')][_0x34c9('0x11')][_0x34c9('0x17')]=0x1,this[_0x34c9('0x28')][_0x34c9('0x11')][_0x34c9('0x12')]=0x3,this[_0x34c9('0x8')]=this[_0x34c9('0xa')](),this['showHistoryButtonView']=this[_0x34c9('0x0')](),this[_0x34c9('0x22')][_0x34c9('0xf')](this[_0x34c9('0x24')],0x1),this[_0x34c9('0x22')][_0x34c9('0xf')](this['submitButtonView']);}['render'](){super[_0x34c9('0x19')](),this[_0x34c9('0x28')][_0x34c9('0xb')]['add'](this[_0x34c9('0x24')]),this[_0x34c9('0x15')][_0x34c9('0xf')](this[_0x34c9('0x8')]),this['keystrokes'][_0x34c9('0x1')]('enter',(_0x2bb7ba,_0x2e4344)=>{_0x2bb7ba[_0x34c9('0x21')]==this[_0x34c9('0x28')]['fieldView']['element']&&(this[_0x34c9('0x1d')](),_0x2e4344());});}['_createSubmitButton'](){const _0x136f63=new _0x3dd51a(this[_0x34c9('0x1a')]),_0x4598cb=this['locale'];return _0x136f63[_0x34c9('0x1')]({'icon':_0x6756fd,'label':_0x66cc04(_0x4598cb,_0x34c9('0x20')),'isVisible':!0x0,'tooltip':!0x0,'class':_0x34c9('0x9')}),_0x136f63['on'](_0x34c9('0x6'),()=>{this[_0x34c9('0x1d')]();}),_0x136f63[_0x34c9('0x3')](_0x34c9('0xe'))['to'](this[_0x34c9('0x28')][_0x34c9('0x11')],'isEmpty',this,_0x34c9('0xe'),(_0x2949dd,_0x319ecf)=>!_0x2949dd&&_0x319ecf),_0x136f63;}['_createShowHistoryButton'](){const _0x40880e=new _0x3dd51a(this[_0x34c9('0x1a')]),_0x444dea=this[_0x34c9('0x26')],_0xc4bcf1=this['locale'];_0x40880e['set']({'label':_0x66cc04(_0xc4bcf1,_0x34c9('0x5')),'withText':!0x1,'icon':_0x1c4845[_0x34c9('0x13')],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x40880e[_0x34c9('0x3')](_0x34c9('0x10'))['to'](_0x444dea,_0x34c9('0x1e')),_0x40880e[_0x34c9('0x3')](_0x34c9('0xe'))['to'](this,'isEnabled'),_0x40880e['on'](_0x34c9('0x6'),()=>{_0x444dea[_0x34c9('0x1e')]=!_0x444dea[_0x34c9('0x1e')],_0x444dea[_0x34c9('0x1e')]?this[_0x34c9('0x23')][_0x34c9('0xd')]():this[_0x34c9('0xd')]();});const _0x4c190a=()=>{_0x5517d8[_0x34c9('0x7')][_0x34c9('0x1c')](()=>{const _0x5c758b=new _0x320071(this[_0x34c9('0x28')][_0x34c9('0x11')][_0x34c9('0x16')]),_0x2c42cf=_0x5c758b[_0x34c9('0x2')];_0x5c758b['excludeScrollbarsAndBorders'](),_0x40880e[_0x34c9('0x16')][_0x34c9('0x18')][_0x34c9('0x14')]=_0x2c42cf-_0x5c758b[_0x34c9('0x2')]+0x1+'px';});};return this[_0x34c9('0x28')]['fieldView']['on'](_0x34c9('0x4'),_0x4c190a),this['on'](_0x34c9('0x19'),_0x4c190a),_0x40880e;}['submit'](){const _0x475c83=this[_0x34c9('0x28')][_0x34c9('0x11')][_0x34c9('0x16')][_0x34c9('0x1f')];this[_0x34c9('0x1b')](_0x34c9('0x1d'),_0x16dc1f(_0x475c83));}[_0x34c9('0xd')](_0x561b7b){-0x1===_0x561b7b?this[_0x34c9('0x27')][_0x34c9('0xc')]():this['focusCycler'][_0x34c9('0x25')]();}}
23
+ const _0x4894=['width','locale','_createShowHistoryButton','resultsView','left','minRows','fieldView','queryView','value','focusCycler','uiLanguageDirection','add','excludeScrollbarsAndBorders','isEnabled','submitButtonView','ck-ai-form__toggle-history','style','bind','focus','right','_createSubmitButton','enter','execute','isVisible','focusLast','fire','window','showHistoryButtonView','submit','filteredView','set','history','render','keystrokes','focusableChildren','fieldWrapperChildren','update','rtl','isOn','element','focusFirst','ck-ai-form__submit'];(function(_0x551fda,_0x48948b){const _0x21646c=function(_0x47268c){while(--_0x47268c){_0x551fda['push'](_0x551fda['shift']());}};_0x21646c(++_0x48948b);}(_0x4894,0x1c9));const _0x2164=function(_0x551fda,_0x48948b){_0x551fda=_0x551fda-0x0;let _0x21646c=_0x4894[_0x551fda];return _0x21646c;};import{Rect as _0x3749bf,global as _0x455126,isVisible as _0x21dfb4}from'ckeditor5/src/utils';import{AutocompleteView as _0x1e9f0c,ButtonView as _0x2bbd04}from'ckeditor5/src/ui';import{icons as _0x5597ac}from'ckeditor5/src/core';import{escape as _0x4b24d0}from'lodash-es';import{getTranslation as _0x1b8e72}from'../../utils/common-translations';import _0x3884a5 from'../../../theme/icons/submit.svg';export default class tt extends _0x1e9f0c{constructor(_0x53cf65,_0x11f8b2){super(_0x53cf65,_0x11f8b2),this['queryView']['fieldView'][_0x2164('0xa')]=0x1,this['queryView']['fieldView']['maxRows']=0x3,this[_0x2164('0x13')]=this[_0x2164('0x19')](),this[_0x2164('0x20')]=this[_0x2164('0x7')](),this[_0x2164('0x27')][_0x2164('0x10')](this[_0x2164('0x20')],0x1),this[_0x2164('0x27')]['add'](this['submitButtonView']);}[_0x2164('0x25')](){super[_0x2164('0x25')](),this[_0x2164('0xc')][_0x2164('0x28')][_0x2164('0x10')](this['showHistoryButtonView']),this['children'][_0x2164('0x10')](this['submitButtonView']),this[_0x2164('0x26')][_0x2164('0x23')](_0x2164('0x1a'),(_0x492274,_0x256922)=>{_0x492274['target']==this[_0x2164('0xc')][_0x2164('0xb')][_0x2164('0x2')]&&(this[_0x2164('0x21')](),_0x256922());});}['_createSubmitButton'](){const _0x37df3f=new _0x2bbd04(this['locale']),_0x4e9f87=this[_0x2164('0x6')];return _0x37df3f[_0x2164('0x23')]({'icon':_0x3884a5,'label':_0x1b8e72(_0x4e9f87,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':_0x2164('0x4')}),_0x37df3f['on'](_0x2164('0x1b'),()=>{this[_0x2164('0x21')]();}),_0x37df3f[_0x2164('0x16')](_0x2164('0x12'))['to'](this[_0x2164('0xc')][_0x2164('0xb')],'isEmpty',this,_0x2164('0x12'),(_0xb3bb7c,_0x4b13e1)=>!_0xb3bb7c&&_0x4b13e1),_0x37df3f;}['_createShowHistoryButton'](){const _0x566d1f=new _0x2bbd04(this['locale']),_0x41b3fb=this[_0x2164('0x8')],_0xe11ff0=this['locale'];_0x566d1f[_0x2164('0x23')]({'label':_0x1b8e72(_0xe11ff0,'History'),'withText':!0x1,'icon':_0x5597ac[_0x2164('0x24')],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x2164('0x14')}),_0x566d1f[_0x2164('0x16')](_0x2164('0x1'))['to'](_0x41b3fb,_0x2164('0x1c')),_0x566d1f[_0x2164('0x16')](_0x2164('0x12'))['to'](this,_0x2164('0x12')),_0x566d1f['on'](_0x2164('0x1b'),()=>{_0x41b3fb[_0x2164('0x1c')]=!_0x41b3fb[_0x2164('0x1c')],_0x41b3fb['isVisible']?this[_0x2164('0x22')][_0x2164('0x17')]():this['focus']();});const _0x1a4e11=()=>{_0x455126[_0x2164('0x1f')]['requestAnimationFrame'](()=>{if(_0x21dfb4(this[_0x2164('0x2')])){const _0x44dc56=new _0x3749bf(this['queryView']['fieldView'][_0x2164('0x2')]),_0x1d16aa=_0x44dc56[_0x2164('0x5')],_0x7dcde9=_0x2164('0x0')===_0xe11ff0[_0x2164('0xf')]?_0x2164('0x9'):_0x2164('0x18');_0x44dc56[_0x2164('0x11')](),_0x566d1f[_0x2164('0x2')][_0x2164('0x15')][_0x7dcde9]=_0x1d16aa-_0x44dc56[_0x2164('0x5')]+0x1+'px';}});};return this['queryView'][_0x2164('0xb')]['on'](_0x2164('0x29'),_0x1a4e11),this['on'](_0x2164('0x25'),_0x1a4e11),_0x566d1f;}['submit'](){const _0x5a30c2=this[_0x2164('0xc')][_0x2164('0xb')][_0x2164('0x2')][_0x2164('0xd')];this[_0x2164('0x1e')]('submit',_0x4b24d0(_0x5a30c2));}[_0x2164('0x17')](_0xcf91a8){-0x1===_0xcf91a8?this[_0x2164('0xe')][_0x2164('0x1d')]():this[_0x2164('0xe')][_0x2164('0x3')]();}}
@@ -1,41 +1,54 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ai/ui/aiformtoolbarview
7
- */
8
- import type { Locale } from 'ckeditor5/src/utils';
9
- import { ToolbarView, ButtonView } from 'ckeditor5/src/ui';
10
- /**
11
- * A class representing the text area view of the AI assistant.
12
- */
13
- export default class AIFormToolbarView extends ToolbarView {
14
- /**
15
- * Controls whether the toolbar is visible.
16
- *
17
- * @observable
18
- * @default false
19
- */
20
- isVisible: boolean;
21
- /**
22
- * Button that is used to replace the selected content by the generated one.
23
- */
24
- replaceButton: ButtonView;
25
- /**
26
- * Button that is used to insert the generated content below the selection.
27
- */
28
- insertButton: ButtonView;
29
- /**
30
- * Button that is used to regenerate the response.
31
- */
32
- tryAgainButton: ButtonView;
33
- /**
34
- * Button that is used to stop the processing of the request.
35
- */
36
- stopButton: ButtonView;
37
- /**
38
- * @inheritDoc
39
- */
40
- constructor(locale: Locale);
41
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ai/ui/aiformtoolbarview
7
+ */
8
+ import type { Locale } from 'ckeditor5/src/utils';
9
+ import { ToolbarView, ButtonView } from 'ckeditor5/src/ui';
10
+ /**
11
+ * The action name affecting the label of {@link ~AIFormToolbarView#replaceButton}.
12
+ */
13
+ export declare enum AIFormToolbarViewMainAction {
14
+ REPLACE = "replace",
15
+ INSERT = "insert"
16
+ }
17
+ /**
18
+ * A class representing the text area view of the AI assistant.
19
+ */
20
+ export default class AIFormToolbarView extends ToolbarView {
21
+ /**
22
+ * Controls whether the toolbar is visible.
23
+ *
24
+ * @observable
25
+ * @default false
26
+ */
27
+ isVisible: boolean;
28
+ /**
29
+ * Button that is used to replace the selected content by the generated one.
30
+ */
31
+ replaceButton: ButtonView;
32
+ /**
33
+ * Button that is used to insert the generated content below the selection.
34
+ */
35
+ insertButton: ButtonView;
36
+ /**
37
+ * Button that is used to regenerate the response.
38
+ */
39
+ tryAgainButton: ButtonView;
40
+ /**
41
+ * Button that is used to stop the processing of the request.
42
+ */
43
+ stopButton: ButtonView;
44
+ /**
45
+ * The action name affecting the label of {@link #replaceButton}.
46
+ *
47
+ * @default 'replace'
48
+ */
49
+ mainAction: AIFormToolbarViewMainAction;
50
+ /**
51
+ * @inheritDoc
52
+ */
53
+ constructor(locale: Locale);
54
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5cc3=['Stop','set','locale','AI_REPLACE_CONTENT','extendTemplate','_createButton','ck-ai-form__toolbar','addMany','insertButton','ck-button-action','ck-hidden','replaceButton','bindTemplate','stopButton','tryAgainButton','Try\x20again'];(function(_0x2fd897,_0x5cc31d){const _0x4ab6b6=function(_0xb8390e){while(--_0xb8390e){_0x2fd897['push'](_0x2fd897['shift']());}};_0x4ab6b6(++_0x5cc31d);}(_0x5cc3,0x12d));const _0x4ab6=function(_0x2fd897,_0x5cc31d){_0x2fd897=_0x2fd897-0x0;let _0x4ab6b6=_0x5cc3[_0x2fd897];return _0x4ab6b6;};import{ToolbarView as _0x407443,ButtonView as _0x47cdb4}from'ckeditor5/src/ui';import{getTranslation as _0x5d9ea9}from'../../utils/common-translations';export default class X extends _0x407443{constructor(_0x54d3b6){super(_0x54d3b6),this['set']('isVisible',!0x1),this['replaceButton']=this[_0x4ab6('0x8')](_0x5d9ea9(_0x54d3b6,_0x4ab6('0x6')),_0x4ab6('0xc')),this[_0x4ab6('0xb')]=this[_0x4ab6('0x8')](_0x5d9ea9(_0x54d3b6,'Insert\x20below')),this[_0x4ab6('0x1')]=this[_0x4ab6('0x8')](_0x5d9ea9(_0x54d3b6,_0x4ab6('0x2'))),this[_0x4ab6('0x0')]=this['_createButton'](_0x5d9ea9(_0x54d3b6,_0x4ab6('0x3')));const _0x2b79ac=this[_0x4ab6('0xf')];this[_0x4ab6('0x7')]({'attributes':{'class':[_0x4ab6('0x9'),_0x2b79ac['if']('isVisible',_0x4ab6('0xd'),_0x1d339f=>!_0x1d339f)]}}),this['items'][_0x4ab6('0xa')]([this[_0x4ab6('0xe')],this[_0x4ab6('0xb')],this[_0x4ab6('0x1')],this[_0x4ab6('0x0')]]);}[_0x4ab6('0x8')](_0x1b39ab,_0x3c9fb3){const _0xfe8c85=new _0x47cdb4(this[_0x4ab6('0x5')]);return _0xfe8c85[_0x4ab6('0x4')]({'label':_0x1b39ab,'class':_0x3c9fb3||'','isVisible':!0x0,'withText':!0x0}),_0xfe8c85;}}
23
+ const _0x48b8=['stopButton','insert','items','AI_','_createButton','Try\x20again','insertButton','tryAgainButton','locale','replaceButton','set','toUpperCase','isVisible','bindTemplate','ck-button-action','bind','Insert\x20below','REPLACE','mainAction','addMany','_CONTENT'];(function(_0x47e8d6,_0x48b88b){const _0x62d03=function(_0x5c84c0){while(--_0x5c84c0){_0x47e8d6['push'](_0x47e8d6['shift']());}};_0x62d03(++_0x48b88b);}(_0x48b8,0x192));const _0x62d0=function(_0x47e8d6,_0x48b88b){_0x47e8d6=_0x47e8d6-0x0;let _0x62d03=_0x48b8[_0x47e8d6];return _0x62d03;};import{ToolbarView as _0x52f42f,ButtonView as _0x34f683}from'ckeditor5/src/ui';import{getTranslation as _0x1db11e}from'../../utils/common-translations';export var AIFormToolbarViewMainAction;!function(_0x1dfb7d){_0x1dfb7d[_0x62d0('0xe')]='replace',_0x1dfb7d['INSERT']=_0x62d0('0x13');}(AIFormToolbarViewMainAction||(AIFormToolbarViewMainAction={}));export default class ti extends _0x52f42f{constructor(_0x194ad9){super(_0x194ad9),this[_0x62d0('0x7')](_0x62d0('0x9'),!0x1),this[_0x62d0('0x7')](_0x62d0('0xf'),AIFormToolbarViewMainAction[_0x62d0('0xe')]),this[_0x62d0('0x6')]=this[_0x62d0('0x1')]('',_0x62d0('0xb')),this['replaceButton'][_0x62d0('0xc')]('label')['to'](this,_0x62d0('0xf'),_0x683105=>_0x1db11e(_0x194ad9,_0x62d0('0x0')+_0x683105[_0x62d0('0x8')]()+_0x62d0('0x11'))),this[_0x62d0('0x3')]=this['_createButton'](_0x1db11e(_0x194ad9,_0x62d0('0xd'))),this[_0x62d0('0x4')]=this['_createButton'](_0x1db11e(_0x194ad9,_0x62d0('0x2'))),this[_0x62d0('0x12')]=this[_0x62d0('0x1')](_0x1db11e(_0x194ad9,'Stop'));const _0x5038a1=this[_0x62d0('0xa')];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5038a1['if'](_0x62d0('0x9'),'ck-hidden',_0x5b0eca=>!_0x5b0eca)]}}),this[_0x62d0('0x14')][_0x62d0('0x10')]([this[_0x62d0('0x6')],this[_0x62d0('0x3')],this[_0x62d0('0x4')],this[_0x62d0('0x12')]]);}['_createButton'](_0x32fc28,_0x285a7b){const _0x2de9a0=new _0x34f683(this[_0x62d0('0x5')]);return _0x2de9a0['set']({'label':_0x32fc28,'class':_0x285a7b||'','isVisible':!0x0,'withText':!0x0}),_0x2de9a0;}}
@@ -1,131 +1,142 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module ai/ui/aiformview
7
- */
8
- import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
9
- import { View, FormHeaderView } from 'ckeditor5/src/ui';
10
- import AIFormToolbarView from './aiformtoolbarview';
11
- import AIFormContentArea from './aiformcontentarea';
12
- import AIFormErrorView from './aiformerrorview';
13
- import AIFormPromptView from './aiformpromptview';
14
- /**
15
- * A class representing the form view of the AI assistant.
16
- */
17
- export default class AIFormView extends View {
18
- /**
19
- * Tracks information about the DOM focus in the form.
20
- *
21
- * @readonly
22
- */
23
- focusTracker: FocusTracker;
24
- /**
25
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
26
- *
27
- * @readonly
28
- */
29
- keystrokes: KeystrokeHandler;
30
- /**
31
- * The view that represent the header of the form.
32
- */
33
- header: FormHeaderView;
34
- /**
35
- * The text area view that is used to display AI response.
36
- */
37
- contentArea: AIFormContentArea;
38
- /**
39
- * Toolbar view containing button views that manage the AI response and this form itself.
40
- */
41
- toolbar: AIFormToolbarView;
42
- /**
43
- * The component used for handling the user's query, including history and submit buttons.
44
- */
45
- promptView: AIFormPromptView;
46
- /**
47
- * View that is used to display the error message.
48
- */
49
- errorView: AIFormErrorView;
50
- /**
51
- * The prompt text can be configured either during construction when the AI command has been selected,
52
- * or later by submitting the {@link #labeledInput}, if it hasn't been previously initialized.
53
- * After setting this value the AI request is triggered.
54
- */
55
- prompt: string;
56
- /**
57
- * The value that is generated after user submitting the user prompt.
58
- */
59
- value: string;
60
- /**
61
- * Flag that indicates if the AI assistant form view is enabled or disabled.
62
- *
63
- * If it is disabled, all interactive elements of this view are disabled as well.
64
- */
65
- isEnabled: boolean;
66
- /**
67
- * Indicates if the AI request is processing.
68
- */
69
- isProcessing: boolean;
70
- /**
71
- * Indicates if the AI request failed.
72
- */
73
- isError: boolean;
74
- /**
75
- * Creates an instance of the {@link module:ai/ui/aiformview~AIFormView} class.
76
- *
77
- * @param locale The localization services instance.
78
- * @param prompt The text label of the prompt with which the form has been initialized.
79
- */
80
- constructor(locale: Locale, prompt: string, uiCssClass: string, contentAreaCssClass?: string);
81
- /**
82
- * @inheritDoc
83
- */
84
- render(): void;
85
- focus(): void;
86
- }
87
- /**
88
- * Fired when a user performed an action that should lead to replace the current selection by generated content.
89
- *
90
- * @eventName ~AIFormView#replaceContent
91
- */
92
- export type ReplaceContentEvent = {
93
- name: 'replaceContent';
94
- args: [value: string];
95
- };
96
- /**
97
- * Fired when a user performed an action that should lead to insert generated content below the current selection.
98
- *
99
- * @eventName ~AIFormView#insertContentBelow
100
- */
101
- export type InsertContentBelowEvent = {
102
- name: 'insertContentBelow';
103
- args: [value: string];
104
- };
105
- /**
106
- * Fired when a user performed an action that should lead to retry the previous request to AI.
107
- *
108
- * @eventName ~AIFormView#tryAgainEvent
109
- */
110
- export type TryAgainEvent = {
111
- name: 'tryAgainEvent';
112
- args: [];
113
- };
114
- /**
115
- * Fired when a user performed an action that should lead to stop the processing of AI.
116
- *
117
- * @eventName ~AIFormView#stopProcessing
118
- */
119
- export type StopProcessingEvent = {
120
- name: 'stopProcessing';
121
- args: [];
122
- };
123
- /**
124
- * Fired when a user performed an action that should lead to ask AI.
125
- *
126
- * @eventName ~AIFormView#submitPrompt
127
- */
128
- export type SubmitPromptEvent = {
129
- name: 'submitPrompt';
130
- args: [prompt: string];
131
- };
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ai/ui/aiformview
7
+ */
8
+ import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
9
+ import { View, FormHeaderView } from 'ckeditor5/src/ui';
10
+ import AIFormToolbarView, { AIFormToolbarViewMainAction } from './aiformtoolbarview';
11
+ import AIFormContentArea from './aiformcontentarea';
12
+ import AIFormErrorView from './aiformerrorview';
13
+ import AIFormPromptView from './aiformpromptview';
14
+ /**
15
+ * A class representing the form view of the AI assistant.
16
+ */
17
+ export default class AIFormView extends View {
18
+ /**
19
+ * Tracks information about the DOM focus in the form.
20
+ *
21
+ * @readonly
22
+ */
23
+ focusTracker: FocusTracker;
24
+ /**
25
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
26
+ *
27
+ * @readonly
28
+ */
29
+ keystrokes: KeystrokeHandler;
30
+ /**
31
+ * The view that represent the header of the form.
32
+ */
33
+ header: FormHeaderView;
34
+ /**
35
+ * The text area view that is used to display AI response.
36
+ */
37
+ contentArea: AIFormContentArea;
38
+ /**
39
+ * Toolbar view containing button views that manage the AI response and this form itself.
40
+ */
41
+ toolbar: AIFormToolbarView;
42
+ /**
43
+ * The component used for handling the user's query, including history and submit buttons.
44
+ */
45
+ promptView: AIFormPromptView;
46
+ /**
47
+ * View that is used to display the error message.
48
+ */
49
+ errorView: AIFormErrorView;
50
+ /**
51
+ * The prompt text can be configured either during construction when the AI command has been selected,
52
+ * or later by submitting the {@link #labeledInput}, if it hasn't been previously initialized.
53
+ * After setting this value the AI request is triggered.
54
+ */
55
+ prompt: string;
56
+ /**
57
+ * The value that is generated after user submitting the user prompt.
58
+ */
59
+ value: string;
60
+ /**
61
+ * Flag that indicates if the AI assistant form view is enabled or disabled.
62
+ *
63
+ * If it is disabled, all interactive elements of this view are disabled as well.
64
+ */
65
+ isEnabled: boolean;
66
+ /**
67
+ * Indicates if the AI request is processing.
68
+ */
69
+ isProcessing: boolean;
70
+ /**
71
+ * Indicates if the AI request failed.
72
+ */
73
+ isError: boolean;
74
+ /**
75
+ * The action name for the main insertion button in the {@link #toolbar}.
76
+ *
77
+ * See {@link module:ai/ui/aiformtoolbarview~AIFormToolbarView#replaceButton}.
78
+ *
79
+ * @default 'replace'
80
+ */
81
+ mainAction: AIFormToolbarViewMainAction;
82
+ /**
83
+ * Creates an instance of the {@link module:ai/ui/aiformview~AIFormView} class.
84
+ *
85
+ * @param locale The localization services instance.
86
+ */
87
+ constructor(locale: Locale, uiClasses: string, contentAreaCssClass?: string);
88
+ /**
89
+ * @inheritDoc
90
+ */
91
+ render(): void;
92
+ focus(): void;
93
+ /**
94
+ * Resets the form to the initial values.
95
+ */
96
+ reset(): void;
97
+ }
98
+ /**
99
+ * Fired when a user performed an action that should lead to replace the current selection by generated content.
100
+ *
101
+ * @eventName ~AIFormView#replaceContent
102
+ */
103
+ export type ReplaceContentEvent = {
104
+ name: 'replaceContent';
105
+ args: [];
106
+ };
107
+ /**
108
+ * Fired when a user performed an action that should lead to insert generated content below the current selection.
109
+ *
110
+ * @eventName ~AIFormView#insertContentBelow
111
+ */
112
+ export type InsertContentBelowEvent = {
113
+ name: 'insertContentBelow';
114
+ args: [];
115
+ };
116
+ /**
117
+ * Fired when a user performed an action that should lead to retry the previous request to AI.
118
+ *
119
+ * @eventName ~AIFormView#tryAgainEvent
120
+ */
121
+ export type TryAgainEvent = {
122
+ name: 'tryAgainEvent';
123
+ args: [];
124
+ };
125
+ /**
126
+ * Fired when a user performed an action that should lead to stop the processing of AI.
127
+ *
128
+ * @eventName ~AIFormView#stopProcessing
129
+ */
130
+ export type StopProcessingEvent = {
131
+ name: 'stopProcessing';
132
+ args: [];
133
+ };
134
+ /**
135
+ * Fired when a user performed an action that should lead to ask AI.
136
+ *
137
+ * @eventName ~AIFormView#submitPrompt
138
+ */
139
+ export type SubmitPromptEvent = {
140
+ name: 'submitPrompt';
141
+ args: [prompt: string];
142
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x66e6=['listenTo','_focusCycler','AI\x20Assistant','isError','_createToolbar','isVisible','tab','startProcessing','clear','execute','_createHistoryView','queryView','finishProcessing','forwardCycle','focus','clearHistory','render','isProcessing','AI_ERROR_FAILED','submitPrompt','items','_focusables','prompt','_promptHistory','tryAgainEvent','trim','bindTo','setTemplate','div','stopButton','ck-ai-form-content','focusFirst','_createPromptView','set','Ask\x20AI\x20to\x20improve\x20generated\x20text','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','element','add','insertButton','submit','promptView','locale','contentArea','shift\x20+\x20tab','tryAgainButton','toolbar','replaceButton','bindTemplate','value','copyButtonView','stop','isEnabled','errorView','handleError','bind','replaceContent','Empty\x20history','createCollection','ck-ai-form','keystrokes','stopProcessing','focusTracker','fire','text','backwardCycle','focusCycler','Ask\x20AI\x20to\x20edit\x20or\x20generate','focusPrevious'];(function(_0x4a2397,_0x66e670){const _0x2c3adb=function(_0x3d59e0){while(--_0x3d59e0){_0x4a2397['push'](_0x4a2397['shift']());}};_0x2c3adb(++_0x66e670);}(_0x66e6,0x19b));const _0x2c3a=function(_0x4a2397,_0x66e670){_0x4a2397=_0x4a2397-0x0;let _0x2c3adb=_0x66e6[_0x4a2397];return _0x2c3adb;};import{FocusTracker as _0x50263a,KeystrokeHandler as _0x36c307}from'ckeditor5/src/utils';import{View as _0x727a95,FocusCycler as _0x739176,createLabeledTextarea as _0x55129a,FormHeaderView as _0x5a1a65}from'ckeditor5/src/ui';import _0x36e6aa from'./aiformtoolbarview';import _0xbfd655 from'./aiformcontentarea';import _0x3f3334 from'./aiformerrorview';import _0x2d54b8 from'./aiformpromptview';import _0x60b8c3 from'./aihistorylistview';import _0x21a2e6 from'./aihistorylistitemview';import _0x247d7d from'./prompthistory';import{getTranslation as _0xc386e8}from'../../utils/common-translations';import _0x1ef5f4 from'../../../theme/icons/robot-pencil.svg';export default class y extends _0x727a95{constructor(_0x127562,_0x2871dc,_0x3daeef,_0x305b59=''){super(_0x127562),this[_0x2c3a('0x1e')](_0x2c3a('0x30'),!0x0),this[_0x2c3a('0x1e')](_0x2c3a('0xe'),!0x1),this[_0x2c3a('0x1e')](_0x2c3a('0x13'),_0x2871dc),this['set'](_0x2c3a('0x2d'),''),this[_0x2c3a('0x1e')](_0x2c3a('0x0'),!0x1),this[_0x2c3a('0x14')]=new _0x247d7d(),this[_0x2c3a('0x31')]=new _0x3f3334(_0x127562),this['header']=new _0x5a1a65(_0x127562,{'label':_0xc386e8(_0x127562,_0x2c3a('0x43')),'icon':_0x1ef5f4}),this[_0x2c3a('0x27')]=new _0xbfd655(_0x127562,_0x305b59),this['contentArea'][_0x2c3a('0x33')]('isProcessing')['to'](this),this[_0x2c3a('0x27')][_0x2c3a('0x33')](_0x2c3a('0x2d'))['to'](this),this['toolbar']=this['_createToolbar'](),this['promptView']=this[_0x2c3a('0x1d')](),this[_0x2c3a('0x3a')]=new _0x50263a(),this['keystrokes']=new _0x36c307(),this[_0x2c3a('0x12')]=this[_0x2c3a('0x36')]([this[_0x2c3a('0x27')],this[_0x2c3a('0x27')]['copyButtonView'],this[_0x2c3a('0x2a')],this['promptView']]),this[_0x2c3a('0x42')]=new _0x739176({'focusables':this[_0x2c3a('0x12')],'focusTracker':this['focusTracker'],'keystrokeHandler':this[_0x2c3a('0x38')],'actions':{'focusPrevious':_0x2c3a('0x28'),'focusNext':_0x2c3a('0x3')}}),this[_0x2c3a('0x25')][_0x2c3a('0x3e')]['on'](_0x2c3a('0xa'),_0x16bdb3=>{this[_0x2c3a('0x42')]['focusNext'](),_0x16bdb3[_0x2c3a('0x2f')]();}),this[_0x2c3a('0x25')]['focusCycler']['on'](_0x2c3a('0x3d'),_0x16e24b=>{this[_0x2c3a('0x42')][_0x2c3a('0x40')](),_0x16e24b[_0x2c3a('0x2f')]();});const _0x499261=this[_0x2c3a('0x2c')];this[_0x2c3a('0x18')]({'tag':_0x2c3a('0x19'),'attributes':{'class':['ck',_0x2c3a('0x37'),_0x3daeef],'tabindex':'-1'},'children':[this['header'],{'tag':'div','attributes':{'class':['ck',_0x2c3a('0x1b')]},'children':[{'tag':_0x2c3a('0x19'),'attributes':{'class':[_0x499261['if'](_0x2c3a('0x0'),'ck-hidden',_0x8f99e4=>!_0x8f99e4)]},'children':[this[_0x2c3a('0x31')]]},this[_0x2c3a('0x27')],this[_0x2c3a('0x2a')],this[_0x2c3a('0x25')]]}]});}[_0x2c3a('0xd')](){super['render'](),this[_0x2c3a('0x3a')][_0x2c3a('0x22')](this[_0x2c3a('0x27')][_0x2c3a('0x21')]),this[_0x2c3a('0x3a')]['add'](this[_0x2c3a('0x27')][_0x2c3a('0x2e')][_0x2c3a('0x21')]),this[_0x2c3a('0x3a')][_0x2c3a('0x22')](this[_0x2c3a('0x2a')][_0x2c3a('0x21')]),this[_0x2c3a('0x3a')][_0x2c3a('0x22')](this[_0x2c3a('0x25')]['element']),this['keystrokes']['listenTo'](this['element']);}[_0x2c3a('0xb')](){this[_0x2c3a('0x42')][_0x2c3a('0x1c')]();}[_0x2c3a('0x1d')](){const _0x5d990d=this[_0x2c3a('0x26')],_0xba9f39=new _0x2d54b8(_0x5d990d,{'queryView':{'label':_0xc386e8(_0x5d990d,_0x2c3a('0x3f')),'creator':_0x55129a,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0xc386e8(_0x5d990d,_0x2c3a('0x35')),'secondary':_0xc386e8(_0x5d990d,_0x2c3a('0x20'))}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xba9f39['bind'](_0x2c3a('0x30'))['to'](this,'isEnabled',this,_0x2c3a('0xe'),(_0x239622,_0x5a97bb)=>_0x239622&&!_0x5a97bb),this[_0x2c3a('0x41')](_0xba9f39,_0x2c3a('0x24'),(_0x4b4ee2,_0x4ad695)=>{this[_0x2c3a('0x13')]=_0x4ad695,this[_0x2c3a('0x3b')](_0x2c3a('0x10'),this[_0x2c3a('0x13')]),_0x4ad695[_0x2c3a('0x16')]()&&this['_promptHistory'][_0x2c3a('0x22')]({'prompt':_0x4ad695['trim']()},0x0);},{'priority':'high'}),_0xba9f39;}[_0x2c3a('0x7')](){const _0x433a84=new _0x60b8c3(this[_0x2c3a('0x26')]);return _0x433a84['historyGroupView'][_0x2c3a('0x11')][_0x2c3a('0x17')](this[_0x2c3a('0x14')])['as'](_0x21a2e6),_0x433a84['on'](_0x2c3a('0xc'),()=>{this[_0x2c3a('0x14')][_0x2c3a('0x5')](),this[_0x2c3a('0x25')]['search'](''),this['promptView'][_0x2c3a('0xb')]();}),_0x433a84;}[_0x2c3a('0x1')](){const _0x13bf63=new _0x36e6aa(this[_0x2c3a('0x26')]);return _0x13bf63[_0x2c3a('0x2b')][_0x2c3a('0x33')](_0x2c3a('0x30'))['to'](this,_0x2c3a('0x30'),this,_0x2c3a('0xe'),this,_0x2c3a('0x2d'),(_0x531e90,_0x52ff92,_0x5ad3e8)=>_0x531e90&&!_0x52ff92&&!!_0x5ad3e8),_0x13bf63[_0x2c3a('0x2b')]['on'](_0x2c3a('0x6'),()=>{this[_0x2c3a('0x3b')](_0x2c3a('0x34'),this['value']);}),_0x13bf63[_0x2c3a('0x23')][_0x2c3a('0x33')](_0x2c3a('0x30'))['to'](this,_0x2c3a('0x30'),this,_0x2c3a('0xe'),this,_0x2c3a('0x2d'),(_0x1ee47e,_0x215607,_0x437184)=>_0x1ee47e&&!_0x215607&&!!_0x437184),_0x13bf63[_0x2c3a('0x23')]['on'](_0x2c3a('0x6'),()=>{this['fire']('insertContentBelow',this['value']);}),_0x13bf63[_0x2c3a('0x29')][_0x2c3a('0x33')](_0x2c3a('0x30'))['to'](this,_0x2c3a('0x30'),this,_0x2c3a('0xe'),(_0x569f0c,_0x1ec4f0)=>_0x569f0c&&!_0x1ec4f0),_0x13bf63[_0x2c3a('0x29')]['on'](_0x2c3a('0x6'),()=>{this[_0x2c3a('0x3b')](_0x2c3a('0x15'));}),_0x13bf63[_0x2c3a('0x1a')][_0x2c3a('0x33')](_0x2c3a('0x30'))['to'](this,'isProcessing'),_0x13bf63[_0x2c3a('0x1a')]['on']('execute',()=>{this[_0x2c3a('0x3b')](_0x2c3a('0x39'));}),_0x13bf63;}[_0x2c3a('0x4')](){this['value']='',this[_0x2c3a('0x0')]=!0x1,this[_0x2c3a('0xe')]=!0x0,this[_0x2c3a('0x27')][_0x2c3a('0x2')]=!0x0,this[_0x2c3a('0x2a')][_0x2c3a('0x2')]=!0x0,this[_0x2c3a('0x27')][_0x2c3a('0xb')]();}['finishProcessing'](){const _0x30e579=this['locale'];this[_0x2c3a('0xe')]=!0x1,this[_0x2c3a('0x13')]='',this['promptView']['reset'](),this[_0x2c3a('0x2d')]&&(this[_0x2c3a('0x25')][_0x2c3a('0x8')]['label']=_0xc386e8(_0x30e579,_0x2c3a('0x1f')));}[_0x2c3a('0x32')](_0x36306f){const _0x1cd1e6=this[_0x2c3a('0x26')];this[_0x2c3a('0x9')](),this[_0x2c3a('0x0')]=!0x0,this['errorView'][_0x2c3a('0x3c')]=_0x36306f||_0xc386e8(_0x1cd1e6,_0x2c3a('0xf')),this[_0x2c3a('0x2d')]||(this['contentArea'][_0x2c3a('0x2')]=!0x1);}}
23
+ const _0xa281=['replaceButton','copyButtonView','focus','execute','div','locale','isEnabled','prompt','isProcessing','backwardCycle','trim','tryAgainEvent','clear','forwardCycle','Ask\x20AI\x20to\x20improve\x20generated\x20text','_focusCycler','createCollection','tryAgainButton','shift\x20+\x20tab','submitPrompt','header','clearHistory','tab','AI_ERROR_FAILED','focusFirst','isVisible','mainAction','isError','focusCycler','items','_promptHistory','keystrokes','_createToolbar','reset','stopButton','toolbar','focusPrevious','fieldView','insertButton','_focusables','errorView','label','promptView','bindTemplate','handleError','_createHistoryView','listenTo','search','high','focusTracker','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','stop','value','element','add','delegate','bindTo','bind','insertContentBelow','contentArea','set','finishProcessing','setTemplate','Ask\x20AI\x20to\x20edit\x20or\x20generate','AI\x20Assistant','queryView','render'];(function(_0x450a90,_0xa28152){const _0x50fe49=function(_0x3c64e5){while(--_0x3c64e5){_0x450a90['push'](_0x450a90['shift']());}};_0x50fe49(++_0xa28152);}(_0xa281,0x186));const _0x50fe=function(_0x450a90,_0xa28152){_0x450a90=_0x450a90-0x0;let _0x50fe49=_0xa281[_0x450a90];return _0x50fe49;};import{FocusTracker as _0x24a234,KeystrokeHandler as _0x58ee63}from'ckeditor5/src/utils';import{View as _0x4886d6,FocusCycler as _0x35aec3,createLabeledTextarea as _0x25b4b0,FormHeaderView as _0x419d54}from'ckeditor5/src/ui';import _0x10fe6c,{AIFormToolbarViewMainAction as _0x2dcd77}from'./aiformtoolbarview';import _0x181bb8 from'./aiformcontentarea';import _0x1de56c from'./aiformerrorview';import _0x1a8634 from'./aiformpromptview';import _0x194eed from'./aihistorylistview';import _0x36ed0f from'./aihistorylistitemview';import _0x216e55 from'./prompthistory';import{getTranslation as _0x5205d6}from'../../utils/common-translations';import _0x52871c from'../../../theme/icons/robot-pencil.svg';export default class v extends _0x4886d6{constructor(_0x16ef1b,_0xfae830,_0x38736b=''){super(_0x16ef1b),this[_0x50fe('0x5')](_0x50fe('0x12'),!0x0),this[_0x50fe('0x5')](_0x50fe('0x14'),!0x1),this[_0x50fe('0x5')](_0x50fe('0x13'),''),this[_0x50fe('0x5')]('value',''),this[_0x50fe('0x5')]('isError',!0x1),this[_0x50fe('0x5')](_0x50fe('0x26'),_0x2dcd77['REPLACE']),this[_0x50fe('0x2a')]=new _0x216e55(),this[_0x50fe('0x34')]=new _0x1de56c(_0x16ef1b),this['header']=new _0x419d54(_0x16ef1b,{'label':_0x5205d6(_0x16ef1b,_0x50fe('0x9')),'icon':_0x52871c}),this['contentArea']=new _0x181bb8(_0x16ef1b,_0x38736b),this[_0x50fe('0x4')][_0x50fe('0x2')](_0x50fe('0x14'))['to'](this),this[_0x50fe('0x4')]['bind'](_0x50fe('0x40'))['to'](this),this[_0x50fe('0x2f')]=this['_createToolbar'](),this[_0x50fe('0x2f')][_0x50fe('0x2')](_0x50fe('0x26'))['to'](this),this[_0x50fe('0x36')]=this['_createPromptView'](),this[_0x50fe('0x3d')]=new _0x24a234(),this['keystrokes']=new _0x58ee63(),this[_0x50fe('0x33')]=this[_0x50fe('0x1c')]([this[_0x50fe('0x4')],this[_0x50fe('0x4')][_0x50fe('0xd')],this[_0x50fe('0x2f')],this[_0x50fe('0x36')]]),this[_0x50fe('0x1b')]=new _0x35aec3({'focusables':this[_0x50fe('0x33')],'focusTracker':this[_0x50fe('0x3d')],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x50fe('0x1e'),'focusNext':_0x50fe('0x22')}}),this[_0x50fe('0x36')][_0x50fe('0x28')]['on'](_0x50fe('0x19'),_0x10cc63=>{this[_0x50fe('0x1b')]['focusNext'](),_0x10cc63[_0x50fe('0x3f')]();}),this[_0x50fe('0x36')][_0x50fe('0x28')]['on'](_0x50fe('0x15'),_0x1301b4=>{this['_focusCycler'][_0x50fe('0x30')](),_0x1301b4[_0x50fe('0x3f')]();}),this[_0x50fe('0x36')]['queryView'][_0x50fe('0x31')][_0x50fe('0x2')]('value')['to'](this,_0x50fe('0x13'));const _0x1cbedf=this[_0x50fe('0x37')];this[_0x50fe('0x7')]({'tag':_0x50fe('0x10'),'attributes':{'class':['ck','ck-ai-form',_0xfae830],'tabindex':'-1'},'children':[this[_0x50fe('0x20')],{'tag':_0x50fe('0x10'),'attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':_0x50fe('0x10'),'attributes':{'class':[_0x1cbedf['if']('isError','ck-hidden',_0x292036=>!_0x292036)]},'children':[this[_0x50fe('0x34')]]},this[_0x50fe('0x4')],this[_0x50fe('0x2f')],this[_0x50fe('0x36')]]}]});}[_0x50fe('0xb')](){super[_0x50fe('0xb')](),this[_0x50fe('0x3d')][_0x50fe('0x42')](this['contentArea'][_0x50fe('0x41')]),this[_0x50fe('0x3d')][_0x50fe('0x42')](this['contentArea']['copyButtonView'][_0x50fe('0x41')]),this[_0x50fe('0x3d')][_0x50fe('0x42')](this[_0x50fe('0x2f')]['element']),this[_0x50fe('0x3d')][_0x50fe('0x42')](this[_0x50fe('0x36')][_0x50fe('0x41')]),this[_0x50fe('0x2b')][_0x50fe('0x3a')](this[_0x50fe('0x41')]);}['focus'](){this[_0x50fe('0x1b')][_0x50fe('0x24')]();}[_0x50fe('0x2d')](){this[_0x50fe('0x13')]='',this[_0x50fe('0x40')]='',this[_0x50fe('0x36')][_0x50fe('0x2d')](),this[_0x50fe('0x4')][_0x50fe('0x25')]=!0x1,this[_0x50fe('0x2f')][_0x50fe('0x25')]=!0x1;}['_createPromptView'](){const _0x2ebf7e=this[_0x50fe('0x11')],_0x5bfc56=new _0x1a8634(_0x2ebf7e,{'queryView':{'label':_0x5205d6(_0x2ebf7e,_0x50fe('0x8')),'creator':_0x25b4b0,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x5205d6(_0x2ebf7e,'Empty\x20history'),'secondary':_0x5205d6(_0x2ebf7e,_0x50fe('0x3e'))}}},'filteredView':this[_0x50fe('0x39')](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5bfc56['bind'](_0x50fe('0x12'))['to'](this,'isEnabled',this,'isProcessing',(_0x186aba,_0x2ca2c3)=>_0x186aba&&!_0x2ca2c3),this[_0x50fe('0x3a')](_0x5bfc56,'submit',(_0x15b251,_0x59841a)=>{this[_0x50fe('0x13')]=_0x59841a,this['fire'](_0x50fe('0x1f'),this[_0x50fe('0x13')]),_0x59841a[_0x50fe('0x16')]()&&this[_0x50fe('0x2a')][_0x50fe('0x42')]({'prompt':_0x59841a[_0x50fe('0x16')]()},0x0);},{'priority':_0x50fe('0x3c')}),_0x5bfc56;}['_createHistoryView'](){const _0x1c055f=new _0x194eed(this[_0x50fe('0x11')]);return _0x1c055f['historyGroupView'][_0x50fe('0x29')][_0x50fe('0x1')](this[_0x50fe('0x2a')])['as'](_0x36ed0f),_0x1c055f['on'](_0x50fe('0x21'),()=>{this['_promptHistory'][_0x50fe('0x18')](),this[_0x50fe('0x36')][_0x50fe('0x3b')](''),this[_0x50fe('0x36')][_0x50fe('0xe')]();}),_0x1c055f;}[_0x50fe('0x2c')](){const _0x421df2=new _0x10fe6c(this[_0x50fe('0x11')]);return _0x421df2[_0x50fe('0xc')]['bind'](_0x50fe('0x12'))['to'](this,_0x50fe('0x12'),this,_0x50fe('0x14'),this,'value',(_0x5a503e,_0x268654,_0x45ed25)=>_0x5a503e&&!_0x268654&&!!_0x45ed25),_0x421df2[_0x50fe('0xc')][_0x50fe('0x0')](_0x50fe('0xf'))['to'](this,'replaceContent'),_0x421df2[_0x50fe('0x32')]['bind']('isEnabled')['to'](this,'isEnabled',this,_0x50fe('0x14'),this,_0x50fe('0x40'),(_0x347cb0,_0x15cdb1,_0x429280)=>_0x347cb0&&!_0x15cdb1&&!!_0x429280),_0x421df2[_0x50fe('0x32')]['delegate']('execute')['to'](this,_0x50fe('0x3')),_0x421df2[_0x50fe('0x1d')][_0x50fe('0x2')](_0x50fe('0x12'))['to'](this,_0x50fe('0x12'),this,_0x50fe('0x14'),(_0x13e098,_0x1a18d7)=>_0x13e098&&!_0x1a18d7),_0x421df2[_0x50fe('0x1d')][_0x50fe('0x0')](_0x50fe('0xf'))['to'](this,_0x50fe('0x17')),_0x421df2['stopButton'][_0x50fe('0x2')](_0x50fe('0x12'))['to'](this,_0x50fe('0x14')),_0x421df2[_0x50fe('0x2e')][_0x50fe('0x0')](_0x50fe('0xf'))['to'](this,'stopProcessing'),_0x421df2;}['startProcessing'](){this[_0x50fe('0x40')]='',this[_0x50fe('0x27')]=!0x1,this['isProcessing']=!0x0,this[_0x50fe('0x4')]['isVisible']=!0x0,this['toolbar'][_0x50fe('0x25')]=!0x0,this[_0x50fe('0x4')][_0x50fe('0xe')]();}[_0x50fe('0x6')](){const _0x35cda0=this[_0x50fe('0x11')];this[_0x50fe('0x14')]=!0x1,this[_0x50fe('0x13')]='',this[_0x50fe('0x36')]['reset'](),this[_0x50fe('0x40')]&&(this[_0x50fe('0x36')][_0x50fe('0xa')][_0x50fe('0x35')]=_0x5205d6(_0x35cda0,_0x50fe('0x1a')));}[_0x50fe('0x38')](_0x21537b){const _0x4272a0=this['locale'];this[_0x50fe('0x6')](),this['isError']=!0x0,this[_0x50fe('0x34')]['text']=_0x21537b||_0x5205d6(_0x4272a0,_0x50fe('0x23')),this[_0x50fe('0x40')]||(this[_0x50fe('0x4')][_0x50fe('0x25')]=!0x1);}}