@ckeditor/ckeditor5-ai 40.0.0 → 40.2.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 (162) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +1 -1
  3. package/build/ai.js +77 -2
  4. package/build/translations/af.js +1 -1
  5. package/build/translations/ar.js +1 -1
  6. package/build/translations/bg.js +1 -1
  7. package/build/translations/bn.js +1 -1
  8. package/build/translations/bs.js +1 -1
  9. package/build/translations/ca.js +1 -1
  10. package/build/translations/cs.js +1 -1
  11. package/build/translations/da.js +1 -1
  12. package/build/translations/de-ch.js +1 -1
  13. package/build/translations/de.js +1 -1
  14. package/build/translations/el.js +1 -1
  15. package/build/translations/en-au.js +1 -1
  16. package/build/translations/es-co.js +1 -1
  17. package/build/translations/es.js +1 -1
  18. package/build/translations/et.js +1 -1
  19. package/build/translations/fa.js +1 -1
  20. package/build/translations/fi.js +1 -1
  21. package/build/translations/fr.js +1 -1
  22. package/build/translations/gl.js +1 -1
  23. package/build/translations/he.js +1 -1
  24. package/build/translations/hi.js +1 -1
  25. package/build/translations/hr.js +1 -1
  26. package/build/translations/hu.js +1 -1
  27. package/build/translations/id.js +1 -1
  28. package/build/translations/it.js +1 -1
  29. package/build/translations/ja.js +1 -1
  30. package/build/translations/jv.js +1 -1
  31. package/build/translations/ko.js +1 -1
  32. package/build/translations/lt.js +1 -1
  33. package/build/translations/lv.js +1 -1
  34. package/build/translations/ms.js +1 -1
  35. package/build/translations/nl.js +1 -1
  36. package/build/translations/no.js +1 -1
  37. package/build/translations/pl.js +1 -1
  38. package/build/translations/pt-br.js +1 -1
  39. package/build/translations/pt.js +1 -1
  40. package/build/translations/ro.js +1 -1
  41. package/build/translations/ru.js +1 -1
  42. package/build/translations/sk.js +1 -1
  43. package/build/translations/sr-latn.js +1 -1
  44. package/build/translations/sr.js +1 -1
  45. package/build/translations/sv.js +1 -1
  46. package/build/translations/th.js +1 -1
  47. package/build/translations/tk.js +1 -1
  48. package/build/translations/tr.js +1 -1
  49. package/build/translations/ug.js +1 -1
  50. package/build/translations/uk.js +1 -1
  51. package/build/translations/ur.js +1 -1
  52. package/build/translations/uz.js +1 -0
  53. package/build/translations/vi.js +1 -1
  54. package/build/translations/zh-cn.js +1 -1
  55. package/build/translations/zh.js +1 -1
  56. package/ckeditor5-metadata.json +1 -1
  57. package/lang/contexts.json +4 -1
  58. package/lang/translations/af.po +60 -16
  59. package/lang/translations/ar.po +60 -16
  60. package/lang/translations/bg.po +60 -16
  61. package/lang/translations/bn.po +60 -16
  62. package/lang/translations/bs.po +60 -16
  63. package/lang/translations/ca.po +60 -16
  64. package/lang/translations/cs.po +60 -16
  65. package/lang/translations/da.po +60 -16
  66. package/lang/translations/de-ch.po +60 -16
  67. package/lang/translations/de.po +60 -16
  68. package/lang/translations/el.po +60 -16
  69. package/lang/translations/en-au.po +60 -16
  70. package/lang/translations/en.po +60 -16
  71. package/lang/translations/es-co.po +60 -16
  72. package/lang/translations/es.po +60 -16
  73. package/lang/translations/et.po +60 -16
  74. package/lang/translations/fa.po +60 -16
  75. package/lang/translations/fi.po +60 -16
  76. package/lang/translations/fr.po +60 -16
  77. package/lang/translations/gl.po +95 -51
  78. package/lang/translations/he.po +60 -16
  79. package/lang/translations/hi.po +60 -16
  80. package/lang/translations/hr.po +93 -49
  81. package/lang/translations/hu.po +60 -16
  82. package/lang/translations/id.po +60 -16
  83. package/lang/translations/it.po +60 -16
  84. package/lang/translations/ja.po +60 -16
  85. package/lang/translations/jv.po +60 -16
  86. package/lang/translations/ko.po +60 -16
  87. package/lang/translations/lt.po +60 -16
  88. package/lang/translations/lv.po +60 -16
  89. package/lang/translations/ms.po +60 -16
  90. package/lang/translations/nl.po +60 -16
  91. package/lang/translations/no.po +60 -16
  92. package/lang/translations/pl.po +60 -16
  93. package/lang/translations/pt-br.po +60 -16
  94. package/lang/translations/pt.po +60 -16
  95. package/lang/translations/ro.po +60 -16
  96. package/lang/translations/ru.po +60 -16
  97. package/lang/translations/sk.po +60 -16
  98. package/lang/translations/sr-latn.po +95 -51
  99. package/lang/translations/sr.po +60 -16
  100. package/lang/translations/sv.po +60 -16
  101. package/lang/translations/th.po +60 -16
  102. package/lang/translations/tk.po +60 -16
  103. package/lang/translations/tr.po +60 -16
  104. package/lang/translations/ug.po +96 -52
  105. package/lang/translations/uk.po +60 -16
  106. package/lang/translations/ur.po +60 -16
  107. package/lang/translations/uz.po +226 -0
  108. package/lang/translations/vi.po +60 -16
  109. package/lang/translations/zh-cn.po +60 -16
  110. package/lang/translations/zh.po +60 -16
  111. package/package.json +4 -3
  112. package/src/adapters/aiadapter.d.ts +48 -0
  113. package/src/adapters/aiadapter.js +23 -0
  114. package/src/adapters/aitextadapter.d.ts +146 -0
  115. package/src/adapters/aitextadapter.js +23 -0
  116. package/src/adapters/awstextadapter.d.ts +178 -0
  117. package/src/adapters/awstextadapter.js +23 -0
  118. package/src/adapters/openaitextadapter.d.ts +181 -0
  119. package/src/adapters/openaitextadapter.js +23 -0
  120. package/src/aiassistant.d.ts +386 -419
  121. package/src/aiassistant.js +1 -1
  122. package/src/aiassistantediting.d.ts +45 -45
  123. package/src/aiassistantediting.js +1 -1
  124. package/src/aiassistantui.d.ts +52 -46
  125. package/src/aiassistantui.js +1 -1
  126. package/src/aiconfig.d.ts +69 -0
  127. package/src/aiconfig.js +23 -0
  128. package/src/augmentation.d.ts +27 -26
  129. package/src/index.d.ts +13 -9
  130. package/src/index.js +1 -1
  131. package/src/ui/aiassistantcontroller.d.ts +109 -59
  132. package/src/ui/aiassistantcontroller.js +1 -1
  133. package/src/ui/dropdown/aicommandslistview.d.ts +22 -22
  134. package/src/ui/dropdown/aicommandslistview.js +1 -1
  135. package/src/ui/dropdown/buttonlabelwithhighlightview.d.ts +29 -29
  136. package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
  137. package/src/ui/dropdown/labelwithhighlightview.d.ts +25 -0
  138. package/src/ui/dropdown/labelwithhighlightview.js +23 -0
  139. package/src/ui/form/aiformcontentarea.d.ts +48 -48
  140. package/src/ui/form/aiformcontentarea.js +1 -1
  141. package/src/ui/form/aiformerrorview.d.ts +26 -26
  142. package/src/ui/form/aiformerrorview.js +1 -1
  143. package/src/ui/form/aiformpromptview.d.ts +46 -46
  144. package/src/ui/form/aiformpromptview.js +1 -1
  145. package/src/ui/form/aiformtoolbarview.d.ts +54 -41
  146. package/src/ui/form/aiformtoolbarview.js +1 -1
  147. package/src/ui/form/aiformview.d.ts +142 -131
  148. package/src/ui/form/aiformview.js +1 -1
  149. package/src/ui/form/aihistorylistitemview.d.ts +18 -18
  150. package/src/ui/form/aihistorylistitemview.js +1 -1
  151. package/src/ui/form/aihistorylistview.d.ts +35 -35
  152. package/src/ui/form/aihistorylistview.js +1 -1
  153. package/src/ui/form/prompthistory.d.ts +20 -20
  154. package/src/ui/form/prompthistory.js +1 -1
  155. package/src/ui/showaiassistantcommand.d.ts +29 -26
  156. package/src/ui/showaiassistantcommand.js +1 -1
  157. package/src/utils/common-translations.d.ts +9 -9
  158. package/src/utils/common-translations.js +1 -1
  159. package/theme/ai-form.css +58 -11
  160. package/theme/ai.css +20 -15
  161. package/src/aiconnector.d.ts +0 -44
  162. package/src/aiconnector.js +0 -23
@@ -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 _0x3caf=['showHistoryButtonView','_createShowHistoryButton','History','left','execute','locale','minRows','ck-ai-form__submit','maxRows','focus','focusCycler','right','isEnabled','excludeScrollbarsAndBorders','children','set','isEmpty','target','focusableChildren','rtl','add','element','style','keystrokes','value','fieldWrapperChildren','update','submitButtonView','resultsView','filteredView','focusFirst','width','queryView','window','bind','fieldView','Submit','ck-ai-form__toggle-history','_createSubmitButton','render','enter','isVisible','submit'];(function(_0xca40dd,_0x3caf3d){const _0x4722d0=function(_0x24a6b0){while(--_0x24a6b0){_0xca40dd['push'](_0xca40dd['shift']());}};_0x4722d0(++_0x3caf3d);}(_0x3caf,0x99));const _0x4722=function(_0xca40dd,_0x3caf3d){_0xca40dd=_0xca40dd-0x0;let _0x4722d0=_0x3caf[_0xca40dd];return _0x4722d0;};import{Rect as _0x13a09b,global as _0x58e7ce,isVisible as _0xbaa3d2}from'ckeditor5/src/utils';import{AutocompleteView as _0x3216dc,ButtonView as _0x1a2c14}from'ckeditor5/src/ui';import{icons as _0x369b45}from'ckeditor5/src/core';import{getTranslation as _0x3e761c}from'../../utils/common-translations';import _0x2ef7f7 from'../../../theme/icons/submit.svg';export default class ht extends _0x3216dc{constructor(_0x1dc6d7,_0x478e21){super(_0x1dc6d7,_0x478e21),this[_0x4722('0x8')]['fieldView'][_0x4722('0x19')]=0x1,this[_0x4722('0x8')][_0x4722('0xb')][_0x4722('0x1b')]=0x3,this[_0x4722('0x3')]=this[_0x4722('0xe')](),this[_0x4722('0x13')]=this[_0x4722('0x14')](),this[_0x4722('0x25')][_0x4722('0x27')](this[_0x4722('0x13')],0x1),this[_0x4722('0x25')][_0x4722('0x27')](this[_0x4722('0x3')]);}[_0x4722('0xf')](){super[_0x4722('0xf')](),this[_0x4722('0x8')][_0x4722('0x1')][_0x4722('0x27')](this[_0x4722('0x13')]),this[_0x4722('0x21')][_0x4722('0x27')](this[_0x4722('0x3')]),this[_0x4722('0x2a')][_0x4722('0x22')](_0x4722('0x10'),(_0xe5512a,_0x760f74)=>{_0xe5512a[_0x4722('0x24')]==this['queryView'][_0x4722('0xb')][_0x4722('0x28')]&&(this[_0x4722('0x12')](),_0x760f74());});}[_0x4722('0xe')](){const _0x539210=new _0x1a2c14(this['locale']),_0x344b7a=this[_0x4722('0x18')];return _0x539210['set']({'icon':_0x2ef7f7,'label':_0x3e761c(_0x344b7a,_0x4722('0xc')),'isVisible':!0x0,'tooltip':!0x0,'class':_0x4722('0x1a')}),_0x539210['on']('execute',()=>{this[_0x4722('0x12')]();}),_0x539210['bind'](_0x4722('0x1f'))['to'](this[_0x4722('0x8')][_0x4722('0xb')],_0x4722('0x23'),this,_0x4722('0x1f'),(_0x31a693,_0x12321c)=>!_0x31a693&&_0x12321c),_0x539210;}['_createShowHistoryButton'](){const _0x8142d=new _0x1a2c14(this['locale']),_0x4bd683=this[_0x4722('0x4')],_0x187b63=this[_0x4722('0x18')];_0x8142d[_0x4722('0x22')]({'label':_0x3e761c(_0x187b63,_0x4722('0x15')),'withText':!0x1,'icon':_0x369b45['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x4722('0xd')}),_0x8142d[_0x4722('0xa')]('isOn')['to'](_0x4bd683,_0x4722('0x11')),_0x8142d['bind']('isEnabled')['to'](this,_0x4722('0x1f')),_0x8142d['on'](_0x4722('0x17'),()=>{_0x4bd683[_0x4722('0x11')]=!_0x4bd683['isVisible'],_0x4bd683[_0x4722('0x11')]?this[_0x4722('0x5')][_0x4722('0x1c')]():this[_0x4722('0x1c')]();});const _0x13eb8b=()=>{_0x58e7ce[_0x4722('0x9')]['requestAnimationFrame'](()=>{if(_0xbaa3d2(this[_0x4722('0x28')])){const _0x5595d7=new _0x13a09b(this[_0x4722('0x8')][_0x4722('0xb')]['element']),_0xa75109=_0x5595d7[_0x4722('0x7')],_0x35b47c=_0x4722('0x26')===_0x187b63['uiLanguageDirection']?_0x4722('0x16'):_0x4722('0x1e');_0x5595d7[_0x4722('0x20')](),_0x8142d[_0x4722('0x28')][_0x4722('0x29')][_0x35b47c]=_0xa75109-_0x5595d7['width']+0x1+'px';}});};return this[_0x4722('0x8')][_0x4722('0xb')]['on'](_0x4722('0x2'),_0x13eb8b),this['on'](_0x4722('0xf'),_0x13eb8b),_0x8142d;}[_0x4722('0x12')](){const _0x383d0f=this[_0x4722('0x8')]['fieldView'][_0x4722('0x28')][_0x4722('0x0')];this['fire'](_0x4722('0x12'),_0x383d0f);}['focus'](_0x291896){-0x1===_0x291896?this[_0x4722('0x1d')]['focusLast']():this[_0x4722('0x1d')][_0x4722('0x6')]();}}
@@ -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 AIFormToolbarViewMainActionLabel {
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: AIFormToolbarViewMainActionLabel;
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 _0x48b2=['Stop','bindTemplate','stopButton','ck-button-action','insertButton','extendTemplate','ck-ai-form__toolbar','_CONTENT','bind','items','addMany','tryAgainButton','replaceButton','REPLACE','mainAction','Insert\x20below','toUpperCase','_createButton','set','INSERT','isVisible','insert'];(function(_0x2a1ae1,_0x48b261){const _0x2eada0=function(_0x49b414){while(--_0x49b414){_0x2a1ae1['push'](_0x2a1ae1['shift']());}};_0x2eada0(++_0x48b261);}(_0x48b2,0x115));const _0x2ead=function(_0x2a1ae1,_0x48b261){_0x2a1ae1=_0x2a1ae1-0x0;let _0x2eada0=_0x48b2[_0x2a1ae1];return _0x2eada0;};import{ToolbarView as _0xa1ba7,ButtonView as _0xb0b868}from'ckeditor5/src/ui';import{getTranslation as _0x4290d4}from'../../utils/common-translations';export var AIFormToolbarViewMainActionLabel;!function(_0x505ae7){_0x505ae7[_0x2ead('0x0')]='replace',_0x505ae7[_0x2ead('0x6')]=_0x2ead('0x8');}(AIFormToolbarViewMainActionLabel||(AIFormToolbarViewMainActionLabel={}));export default class ti extends _0xa1ba7{constructor(_0x2251e4){super(_0x2251e4),this[_0x2ead('0x5')]('isVisible',!0x1),this[_0x2ead('0x5')]('mainAction',AIFormToolbarViewMainActionLabel[_0x2ead('0x0')]),this[_0x2ead('0x15')]=this[_0x2ead('0x4')]('',_0x2ead('0xc')),this[_0x2ead('0x15')][_0x2ead('0x11')]('label')['to'](this,_0x2ead('0x1'),_0x4ae650=>_0x4290d4(_0x2251e4,'AI_'+_0x4ae650[_0x2ead('0x3')]()+_0x2ead('0x10'))),this[_0x2ead('0xd')]=this['_createButton'](_0x4290d4(_0x2251e4,_0x2ead('0x2'))),this[_0x2ead('0x14')]=this[_0x2ead('0x4')](_0x4290d4(_0x2251e4,'Try\x20again')),this[_0x2ead('0xb')]=this[_0x2ead('0x4')](_0x4290d4(_0x2251e4,_0x2ead('0x9')));const _0x4d8159=this[_0x2ead('0xa')];this[_0x2ead('0xe')]({'attributes':{'class':[_0x2ead('0xf'),_0x4d8159['if'](_0x2ead('0x7'),'ck-hidden',_0x3b1991=>!_0x3b1991)]}}),this[_0x2ead('0x12')][_0x2ead('0x13')]([this[_0x2ead('0x15')],this['insertButton'],this[_0x2ead('0x14')],this['stopButton']]);}[_0x2ead('0x4')](_0x1422c8,_0x5a39de){const _0x526411=new _0xb0b868(this['locale']);return _0x526411[_0x2ead('0x5')]({'label':_0x1422c8,'class':_0x5a39de||'','isVisible':!0x0,'withText':!0x0}),_0x526411;}}
@@ -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, { AIFormToolbarViewMainActionLabel } 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: AIFormToolbarViewMainActionLabel;
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 _0x1432=['backwardCycle','clear','_focusCycler','tryAgainButton','focus','_promptHistory','focusCycler','ck-ai-form-content','submit','stopProcessing','reset','listenTo','isProcessing','replaceContent','focusFirst','value','createCollection','execute','copyButtonView','finishProcessing','replaceButton','clearHistory','Ask\x20AI\x20to\x20edit\x20or\x20generate','focusPrevious','fire','stop','tryAgainEvent','tab','promptView','div','ck-ai-form','search','focusTracker','submitPrompt','REPLACE','toolbar','errorView','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','mainAction','bindTo','ck-hidden','keystrokes','text','isEnabled','Empty\x20history','insertButton','locale','contentArea','element','handleError','queryView','_createPromptView','historyGroupView','setTemplate','render','_createToolbar','items','isError','header','add','_focusables','shift\x20+\x20tab','isVisible','set','trim','delegate','bind','startProcessing','stopButton','prompt','label'];(function(_0x35f6bf,_0x14322a){const _0x2e8e51=function(_0x19751b){while(--_0x19751b){_0x35f6bf['push'](_0x35f6bf['shift']());}};_0x2e8e51(++_0x14322a);}(_0x1432,0x146));const _0x2e8e=function(_0x35f6bf,_0x14322a){_0x35f6bf=_0x35f6bf-0x0;let _0x2e8e51=_0x1432[_0x35f6bf];return _0x2e8e51;};import{FocusTracker as _0x38f336,KeystrokeHandler as _0x57545c}from'ckeditor5/src/utils';import{View as _0x20c254,FocusCycler as _0x16f9b8,createLabeledTextarea as _0x46d577,FormHeaderView as _0x5f1b03}from'ckeditor5/src/ui';import _0x43b247,{AIFormToolbarViewMainActionLabel as _0x50a861}from'./aiformtoolbarview';import _0x2ca7d4 from'./aiformcontentarea';import _0x9afdb8 from'./aiformerrorview';import _0x3dc9a4 from'./aiformpromptview';import _0x28264f from'./aihistorylistview';import _0x467837 from'./aihistorylistitemview';import _0x5559e9 from'./prompthistory';import{getTranslation as _0x5b3276}from'../../utils/common-translations';import{escape as _0x4b01a5}from'lodash-es';import _0x417305 from'../../../theme/icons/robot-pencil.svg';export default class v extends _0x20c254{constructor(_0x13c276,_0x449b60,_0x43b598=''){super(_0x13c276),this[_0x2e8e('0x15')](_0x2e8e('0x1'),!0x0),this[_0x2e8e('0x15')]('isProcessing',!0x1),this[_0x2e8e('0x15')]('prompt',''),this['set']('value',''),this[_0x2e8e('0x15')](_0x2e8e('0xf'),!0x1),this['set'](_0x2e8e('0x43'),_0x50a861[_0x2e8e('0x3f')]),this['_promptHistory']=new _0x5559e9(),this[_0x2e8e('0x41')]=new _0x9afdb8(_0x13c276),this['header']=new _0x5f1b03(_0x13c276,{'label':_0x5b3276(_0x13c276,'AI\x20Assistant'),'icon':_0x417305}),this[_0x2e8e('0x5')]=new _0x2ca7d4(_0x13c276,_0x43b598),this[_0x2e8e('0x5')][_0x2e8e('0x18')](_0x2e8e('0x29'))['to'](this),this[_0x2e8e('0x5')][_0x2e8e('0x18')](_0x2e8e('0x2c'))['to'](this),this[_0x2e8e('0x40')]=this[_0x2e8e('0xd')](),this['toolbar'][_0x2e8e('0x18')](_0x2e8e('0x43'))['to'](this),this['promptView']=this[_0x2e8e('0x9')](),this[_0x2e8e('0x3d')]=new _0x38f336(),this[_0x2e8e('0x46')]=new _0x57545c(),this[_0x2e8e('0x12')]=this[_0x2e8e('0x2d')]([this[_0x2e8e('0x5')],this[_0x2e8e('0x5')][_0x2e8e('0x2f')],this['toolbar'],this[_0x2e8e('0x39')]]),this[_0x2e8e('0x1f')]=new _0x16f9b8({'focusables':this['_focusables'],'focusTracker':this[_0x2e8e('0x3d')],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x2e8e('0x13'),'focusNext':_0x2e8e('0x38')}}),this['promptView']['focusCycler']['on']('forwardCycle',_0x52c668=>{this[_0x2e8e('0x1f')]['focusNext'](),_0x52c668['stop']();}),this[_0x2e8e('0x39')][_0x2e8e('0x23')]['on'](_0x2e8e('0x1d'),_0x103cef=>{this['_focusCycler'][_0x2e8e('0x34')](),_0x103cef[_0x2e8e('0x36')]();}),this[_0x2e8e('0x39')][_0x2e8e('0x8')]['fieldView'][_0x2e8e('0x18')](_0x2e8e('0x2c'))['to'](this,_0x2e8e('0x1b'));const _0x550057=this['bindTemplate'];this[_0x2e8e('0xb')]({'tag':_0x2e8e('0x3a'),'attributes':{'class':['ck',_0x2e8e('0x3b'),_0x449b60],'tabindex':'-1'},'children':[this[_0x2e8e('0x10')],{'tag':'div','attributes':{'class':['ck',_0x2e8e('0x24')]},'children':[{'tag':_0x2e8e('0x3a'),'attributes':{'class':[_0x550057['if']('isError',_0x2e8e('0x45'),_0x5d42c1=>!_0x5d42c1)]},'children':[this[_0x2e8e('0x41')]]},this[_0x2e8e('0x5')],this[_0x2e8e('0x40')],this[_0x2e8e('0x39')]]}]});}[_0x2e8e('0xc')](){super[_0x2e8e('0xc')](),this[_0x2e8e('0x3d')][_0x2e8e('0x11')](this['contentArea'][_0x2e8e('0x6')]),this[_0x2e8e('0x3d')][_0x2e8e('0x11')](this[_0x2e8e('0x5')][_0x2e8e('0x2f')]['element']),this[_0x2e8e('0x3d')][_0x2e8e('0x11')](this[_0x2e8e('0x40')]['element']),this[_0x2e8e('0x3d')][_0x2e8e('0x11')](this[_0x2e8e('0x39')]['element']),this['keystrokes']['listenTo'](this[_0x2e8e('0x6')]);}[_0x2e8e('0x21')](){this[_0x2e8e('0x1f')][_0x2e8e('0x2b')]();}[_0x2e8e('0x27')](){this['prompt']='',this['value']='',this[_0x2e8e('0xf')]=!0x1,this[_0x2e8e('0x39')]['reset'](),this['contentArea'][_0x2e8e('0x14')]=!0x1,this[_0x2e8e('0x40')][_0x2e8e('0x14')]=!0x1;}[_0x2e8e('0x9')](){const _0x29fdd4=this[_0x2e8e('0x4')],_0x1bbd3c=new _0x3dc9a4(_0x29fdd4,{'queryView':{'label':_0x5b3276(_0x29fdd4,_0x2e8e('0x33')),'creator':_0x46d577,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x5b3276(_0x29fdd4,_0x2e8e('0x2')),'secondary':_0x5b3276(_0x29fdd4,_0x2e8e('0x42'))}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1bbd3c['bind']('isEnabled')['to'](this,_0x2e8e('0x1'),this,_0x2e8e('0x29'),(_0x5a1579,_0x43d480)=>_0x5a1579&&!_0x43d480),this[_0x2e8e('0x28')](_0x1bbd3c,_0x2e8e('0x25'),(_0x47a9e8,_0x30f37f)=>{this[_0x2e8e('0x1b')]=_0x30f37f;const _0x5994e3=_0x4b01a5(_0x30f37f);this[_0x2e8e('0x35')](_0x2e8e('0x3e'),_0x5994e3),_0x30f37f[_0x2e8e('0x16')]()&&this[_0x2e8e('0x22')][_0x2e8e('0x11')]({'prompt':_0x5994e3},0x0);},{'priority':'high'}),_0x1bbd3c;}['_createHistoryView'](){const _0x4e553a=new _0x28264f(this[_0x2e8e('0x4')]);return _0x4e553a[_0x2e8e('0xa')][_0x2e8e('0xe')][_0x2e8e('0x44')](this[_0x2e8e('0x22')])['as'](_0x467837),_0x4e553a['on'](_0x2e8e('0x32'),()=>{this[_0x2e8e('0x22')][_0x2e8e('0x1e')](),this['promptView'][_0x2e8e('0x3c')](''),this['promptView'][_0x2e8e('0x21')]();}),_0x4e553a;}[_0x2e8e('0xd')](){const _0x2aacde=new _0x43b247(this[_0x2e8e('0x4')]);return _0x2aacde['replaceButton'][_0x2e8e('0x18')](_0x2e8e('0x1'))['to'](this,_0x2e8e('0x1'),this,_0x2e8e('0x29'),this,_0x2e8e('0x2c'),(_0x9c7b20,_0x548fd2,_0x2b93bd)=>_0x9c7b20&&!_0x548fd2&&!!_0x2b93bd),_0x2aacde[_0x2e8e('0x31')][_0x2e8e('0x17')](_0x2e8e('0x2e'))['to'](this,_0x2e8e('0x2a')),_0x2aacde['insertButton'][_0x2e8e('0x18')]('isEnabled')['to'](this,'isEnabled',this,_0x2e8e('0x29'),this,'value',(_0x5e0aec,_0x568c11,_0x553bac)=>_0x5e0aec&&!_0x568c11&&!!_0x553bac),_0x2aacde[_0x2e8e('0x3')][_0x2e8e('0x17')](_0x2e8e('0x2e'))['to'](this,'insertContentBelow'),_0x2aacde[_0x2e8e('0x20')][_0x2e8e('0x18')](_0x2e8e('0x1'))['to'](this,'isEnabled',this,_0x2e8e('0x29'),(_0x473b09,_0x59663f)=>_0x473b09&&!_0x59663f),_0x2aacde[_0x2e8e('0x20')][_0x2e8e('0x17')]('execute')['to'](this,_0x2e8e('0x37')),_0x2aacde[_0x2e8e('0x1a')]['bind'](_0x2e8e('0x1'))['to'](this,_0x2e8e('0x29')),_0x2aacde['stopButton'][_0x2e8e('0x17')]('execute')['to'](this,_0x2e8e('0x26')),_0x2aacde;}[_0x2e8e('0x19')](){this[_0x2e8e('0x2c')]='',this[_0x2e8e('0xf')]=!0x1,this[_0x2e8e('0x29')]=!0x0,this['contentArea'][_0x2e8e('0x14')]=!0x0,this[_0x2e8e('0x40')][_0x2e8e('0x14')]=!0x0,this[_0x2e8e('0x5')][_0x2e8e('0x21')]();}[_0x2e8e('0x30')](){const _0x3e2a89=this['locale'];this[_0x2e8e('0x29')]=!0x1,this[_0x2e8e('0x1b')]='',this[_0x2e8e('0x39')][_0x2e8e('0x27')](),this[_0x2e8e('0x2c')]&&(this[_0x2e8e('0x39')][_0x2e8e('0x8')][_0x2e8e('0x1c')]=_0x5b3276(_0x3e2a89,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}[_0x2e8e('0x7')](_0xe23341){const _0x124401=this[_0x2e8e('0x4')];this[_0x2e8e('0x30')](),this['isError']=!0x0,this[_0x2e8e('0x41')][_0x2e8e('0x0')]=_0xe23341||_0x5b3276(_0x124401,'AI_ERROR_FAILED'),this[_0x2e8e('0x2c')]||(this[_0x2e8e('0x5')][_0x2e8e('0x14')]=!0x1);}}