@ckeditor/ckeditor5-ai 0.0.0-nightly-20231004.0 → 40.0.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 (138) hide show
  1. package/README.md +19 -1
  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/vi.js +1 -1
  52. package/build/translations/zh-cn.js +1 -1
  53. package/build/translations/zh.js +1 -1
  54. package/lang/contexts.json +15 -5
  55. package/lang/translations/ar.po +39 -39
  56. package/lang/translations/bg.po +39 -39
  57. package/lang/translations/bn.po +39 -39
  58. package/lang/translations/ca.po +39 -39
  59. package/lang/translations/cs.po +39 -39
  60. package/lang/translations/da.po +39 -39
  61. package/lang/translations/de.po +39 -39
  62. package/lang/translations/el.po +39 -39
  63. package/lang/translations/es.po +39 -39
  64. package/lang/translations/et.po +39 -39
  65. package/lang/translations/fi.po +39 -39
  66. package/lang/translations/fr.po +39 -39
  67. package/lang/translations/he.po +39 -39
  68. package/lang/translations/hi.po +39 -39
  69. package/lang/translations/hu.po +39 -39
  70. package/lang/translations/id.po +39 -39
  71. package/lang/translations/it.po +39 -39
  72. package/lang/translations/ja.po +39 -39
  73. package/lang/translations/ko.po +39 -39
  74. package/lang/translations/lt.po +39 -39
  75. package/lang/translations/lv.po +39 -39
  76. package/lang/translations/ms.po +39 -39
  77. package/lang/translations/nl.po +40 -40
  78. package/lang/translations/no.po +39 -39
  79. package/lang/translations/pl.po +39 -39
  80. package/lang/translations/pt-br.po +39 -39
  81. package/lang/translations/pt.po +39 -39
  82. package/lang/translations/ro.po +39 -39
  83. package/lang/translations/ru.po +39 -39
  84. package/lang/translations/sk.po +39 -39
  85. package/lang/translations/sr.po +39 -39
  86. package/lang/translations/sv.po +39 -39
  87. package/lang/translations/th.po +39 -39
  88. package/lang/translations/tr.po +39 -39
  89. package/lang/translations/uk.po +39 -39
  90. package/lang/translations/vi.po +39 -39
  91. package/lang/translations/zh-cn.po +39 -39
  92. package/lang/translations/zh.po +39 -39
  93. package/package.json +5 -3
  94. package/src/aiassistant.d.ts +419 -128
  95. package/src/aiassistant.js +1 -1
  96. package/src/aiassistantediting.d.ts +45 -44
  97. package/src/aiassistantediting.js +1 -1
  98. package/src/aiassistantui.d.ts +46 -41
  99. package/src/aiassistantui.js +1 -1
  100. package/src/aiconnector.d.ts +44 -40
  101. package/src/aiconnector.js +1 -1
  102. package/src/augmentation.d.ts +26 -26
  103. package/src/index.d.ts +9 -9
  104. package/src/ui/aiassistantcontroller.d.ts +59 -59
  105. package/src/ui/aiassistantcontroller.js +1 -1
  106. package/src/ui/dropdown/aicommandslistview.d.ts +22 -22
  107. package/src/ui/dropdown/aicommandslistview.js +1 -1
  108. package/src/ui/dropdown/buttonlabelwithhighlightview.d.ts +29 -29
  109. package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
  110. package/src/ui/form/aiformcontentarea.d.ts +48 -70
  111. package/src/ui/form/aiformcontentarea.js +1 -1
  112. package/src/ui/form/aiformerrorview.d.ts +26 -26
  113. package/src/ui/form/aiformerrorview.js +1 -1
  114. package/src/ui/form/aiformpromptview.d.ts +46 -46
  115. package/src/ui/form/aiformpromptview.js +1 -1
  116. package/src/ui/form/aiformtoolbarview.d.ts +41 -41
  117. package/src/ui/form/aiformtoolbarview.js +1 -1
  118. package/src/ui/form/aiformview.d.ts +131 -125
  119. package/src/ui/form/aiformview.js +1 -1
  120. package/src/ui/form/aihistorylistitemview.d.ts +18 -18
  121. package/src/ui/form/aihistorylistitemview.js +1 -1
  122. package/src/ui/form/aihistorylistview.d.ts +35 -35
  123. package/src/ui/form/aihistorylistview.js +1 -1
  124. package/src/ui/form/prompthistory.d.ts +20 -20
  125. package/src/ui/form/prompthistory.js +1 -1
  126. package/src/ui/showaiassistantcommand.d.ts +26 -26
  127. package/src/ui/showaiassistantcommand.js +1 -1
  128. package/src/utils/common-translations.d.ts +9 -0
  129. package/src/utils/common-translations.js +23 -0
  130. package/theme/ai-dropdown.css +4 -4
  131. package/theme/ai-form.css +2 -0
  132. package/theme/ai.css +15 -13
  133. package/theme/icons/error.svg +1 -3
  134. package/theme/icons/magic-wand.svg +1 -7
  135. package/theme/icons/robot-pencil.svg +1 -9
  136. package/theme/icons/submit.svg +1 -3
  137. package/src/ui/form/aiformtextareaview.d.ts +0 -31
  138. package/src/ui/form/aiformtextareaview.js +0 -23
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{global as _0x31314f}from'ckeditor5/src/utils';import{View as _0x33e40a,ButtonView as _0x42961d,SpinnerView as _0x4cf9ec}from'ckeditor5/src/ui';import _0x4e0150 from'../../../theme/icons/copy.svg';import{icons as _0x29b23e}from'ckeditor5/src/core';export default class $ extends _0x33e40a{constructor(_0x4de70e){super(_0x4de70e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3ae009=this['bindTemplate'];this['contentFieldView']=new j(_0x4de70e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3ae009['if']('isVisible','ck-hidden',_0x53686d=>!_0x53686d)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3ae009['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']),this['on']('change:value',(_0x5ea396,_0x86c878,_0x317ade)=>{this['contentFieldView']['setContent'](_0x317ade),this['isProcessing']&&this['value']&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x332590,_0x373aeb,_0xfa61ae)=>{_0xfa61ae?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const t=this['locale']['t'],_0x459382=new _0x42961d(this['locale']),_0x582cd6='ck-ai-form__copy-button';return _0x459382['set']({'label':t('Copy'),'icon':_0x4e0150,'class':_0x582cd6,'tooltip':!0x0}),_0x459382['bind']('isVisible')['to'](this,'value',_0x30e1a9=>!!_0x30e1a9),_0x459382['bind']('isEnabled')['to'](this,'isProcessing',_0x295f1b=>!_0x295f1b),_0x459382['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x459382['icon']=_0x29b23e['check'],_0x459382['class']=_0x582cd6+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x459382['icon']=_0x4e0150,_0x459382['class']=_0x582cd6;},0x3e8);}),_0x459382;}['_copyHTMLToClipboard'](_0x191994){const {window:_0x35eec6,document:_0xd2280a}=_0x31314f;if(_0x35eec6['ClipboardItem']){const {Blob:_0x53066a,ClipboardItem:_0x2c5eb6}=_0x35eec6,_0x2b4ef6=[new _0x2c5eb6({'text/html':new _0x53066a([_0x191994['innerHTML']],{'type':'text/html'}),'text/plain':new _0x53066a([_0x191994['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2b4ef6);}else{const _0x13fb6e=_0xd2280a['createElement']('div');_0x13fb6e['style']['position']='absolute',_0x13fb6e['style']['left']='-9999px',_0x13fb6e['innerHTML']=_0x191994['innerHTML'],_0xd2280a['body']['appendChild'](_0x13fb6e);const _0x28a254=_0xd2280a['createRange']();_0x28a254['selectNodeContents'](_0x13fb6e);const _0x49487f=_0x35eec6['getSelection']();_0x49487f['removeAllRanges'](),_0x49487f['addRange'](_0x28a254),_0xd2280a['execCommand']('copy'),_0x13fb6e['remove']();}}}class j extends _0x33e40a{constructor(_0x33ccb2){super(_0x33ccb2),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x4355ad){this['element']['innerHTML']=_0x4355ad;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x150e06=new _0x33e40a(),t=this['locale']['t'],_0x3c6459=new _0x4cf9ec();return _0x3c6459['isVisible']=!0x0,_0x150e06['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3c6459,{'text':t('AI\x20is\x20writing...')}]}),_0x150e06['render'](),_0x150e06;}}
23
+ const _0x18ce=['isEnabled','scrollHeight','ck-content','isVisible','textContent','ck-ai-form__content-area-wrapper','ck-ai-form__copy-button','bind','ck-ai-form__copy-button-wrapper','element','contentFieldView','_createLoader','style','text/html','ClipboardItem','loaderView','change:isProcessing','remove','.ck-ai-form__loader','innerHTML','createElement','ck-hidden','position','_copyHTMLToClipboard','bindTemplate','scrollTo','appendLoader','removeAllRanges','_createCopyButton','execCommand','render','value','clipboard','isProcessing','setContent','addRange','appendChild','setTemplate','copyButtonView','copy','locale','text/plain','focus','div','ck-ai-form__content-area','execute','write','change:value','left','class','-9999px'];(function(_0x5d26b5,_0x18cee4){const _0x33b0ef=function(_0x3bd0c8){while(--_0x3bd0c8){_0x5d26b5['push'](_0x5d26b5['shift']());}};_0x33b0ef(++_0x18cee4);}(_0x18ce,0x1eb));const _0x33b0=function(_0x5d26b5,_0x18cee4){_0x5d26b5=_0x5d26b5-0x0;let _0x33b0ef=_0x18ce[_0x5d26b5];return _0x33b0ef;};import{global as _0x15a759}from'ckeditor5/src/utils';import{View as _0x306ae0,ButtonView as _0x42c4ee,SpinnerView as _0x157b07}from'ckeditor5/src/ui';import _0x3e37fe from'../../../theme/icons/copy.svg';import{getTranslation as _0x79ef4b}from'../../utils/common-translations';import{icons as _0x5c8901}from'ckeditor5/src/core';export default class M extends _0x306ae0{constructor(_0x437fa0,_0x2778d0=''){super(_0x437fa0),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x28d8bb=this[_0x33b0('0x2b')];this[_0x33b0('0x1d')]=new ContentFieldView(_0x437fa0,_0x2778d0),this['copyButtonView']=this[_0x33b0('0x2f')](),this[_0x33b0('0x5')]({'tag':'div','attributes':{'class':['ck',_0x33b0('0x18'),_0x28d8bb['if'](_0x33b0('0x16'),_0x33b0('0x28'),_0x265554=>!_0x265554)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck',_0x33b0('0xc'),_0x28d8bb['if'](_0x33b0('0x1'),'ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':_0x33b0('0xb'),'attributes':{'class':['ck',_0x33b0('0x1b')]},'children':[this[_0x33b0('0x6')]]}]}]});}[_0x33b0('0x31')](){super[_0x33b0('0x31')](),this[_0x33b0('0x32')]&&this['contentFieldView'][_0x33b0('0x2')](this[_0x33b0('0x32')]),this['on'](_0x33b0('0xf'),(_0x4f9e4d,_0x548108,_0x567cad)=>{const _0x94cb=!this['contentFieldView']['element']['querySelector'](_0x33b0('0x25'));this[_0x33b0('0x1d')][_0x33b0('0x2')](_0x567cad),this[_0x33b0('0x1')]&&_0x94cb&&this[_0x33b0('0x1c')][_0x33b0('0x2c')]({'top':this[_0x33b0('0x1c')][_0x33b0('0x14')],'behavior':'smooth'});}),this['on'](_0x33b0('0x23'),(_0x8e2a45,_0x4fb235,_0x161559)=>{_0x161559?(this[_0x33b0('0x32')]=null,this[_0x33b0('0x1d')]['appendLoader']()):this['value']||this[_0x33b0('0x1d')][_0x33b0('0x2')]('');});}['focus'](){this['element'][_0x33b0('0xa')]();}[_0x33b0('0x2f')](){const _0x535476=this[_0x33b0('0x8')],_0x3070b5=new _0x42c4ee(this[_0x33b0('0x8')]),_0x2281ff=_0x33b0('0x19');return _0x3070b5['set']({'label':_0x79ef4b(_0x535476,'Copy'),'icon':_0x3e37fe,'class':_0x2281ff,'tooltip':!0x0}),_0x3070b5[_0x33b0('0x1a')](_0x33b0('0x16'))['to'](this,'value',_0x3a9d40=>!!_0x3a9d40),_0x3070b5[_0x33b0('0x1a')](_0x33b0('0x13'))['to'](this,'isProcessing',_0x3cb7ec=>!_0x3cb7ec),_0x3070b5['on'](_0x33b0('0xd'),()=>{this[_0x33b0('0x2a')](this['contentFieldView'][_0x33b0('0x1c')]),_0x3070b5['icon']=_0x5c8901['check'],_0x3070b5['class']=_0x2281ff+'\x20ck-ai-form__copy-button--copied',this[_0x33b0('0xa')](),setTimeout(()=>{_0x3070b5['icon']=_0x3e37fe,_0x3070b5[_0x33b0('0x11')]=_0x2281ff;},0x3e8);}),_0x3070b5;}[_0x33b0('0x2a')](_0x66ebd7){const {window:_0x86f361,document:_0x41117a}=_0x15a759;if(_0x86f361[_0x33b0('0x21')]){const {Blob:_0x2db330,ClipboardItem:_0x57d375}=_0x86f361,_0x34e37a=[new _0x57d375({'text/html':new _0x2db330([_0x66ebd7[_0x33b0('0x26')]],{'type':_0x33b0('0x20')}),'text/plain':new _0x2db330([_0x66ebd7[_0x33b0('0x17')]||''],{'type':_0x33b0('0x9')})})];navigator[_0x33b0('0x0')][_0x33b0('0xe')](_0x34e37a);}else{const _0x2a2048=_0x41117a[_0x33b0('0x27')](_0x33b0('0xb'));_0x2a2048[_0x33b0('0x1f')][_0x33b0('0x29')]='absolute',_0x2a2048[_0x33b0('0x1f')][_0x33b0('0x10')]=_0x33b0('0x12'),_0x2a2048[_0x33b0('0x26')]=_0x66ebd7[_0x33b0('0x26')],_0x41117a['body'][_0x33b0('0x4')](_0x2a2048);const _0x101b46=_0x41117a['createRange']();_0x101b46['selectNodeContents'](_0x2a2048);const _0x40343=_0x86f361['getSelection']();_0x40343[_0x33b0('0x2e')](),_0x40343[_0x33b0('0x3')](_0x101b46),_0x41117a[_0x33b0('0x30')](_0x33b0('0x7')),_0x2a2048[_0x33b0('0x24')]();}}}export class ContentFieldView extends _0x306ae0{constructor(_0x39cb90,_0x38eacd=''){super(_0x39cb90),this[_0x33b0('0x22')]=this[_0x33b0('0x1e')](),this[_0x33b0('0x5')]({'tag':_0x33b0('0xb'),'attributes':{'class':['ck',_0x33b0('0x15'),_0x38eacd,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x20f466){this['element'][_0x33b0('0x26')]=_0x20f466;}[_0x33b0('0x2d')](){this[_0x33b0('0x1c')][_0x33b0('0x4')](this[_0x33b0('0x22')][_0x33b0('0x1c')]);}['_createLoader'](){const _0x3bd92f=new _0x306ae0(),_0x5f5217=this[_0x33b0('0x8')],_0x51ac03=new _0x157b07();return _0x51ac03['isVisible']=!0x0,_0x3bd92f['setTemplate']({'tag':_0x33b0('0xb'),'attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x51ac03,{'text':_0x79ef4b(_0x5f5217,'AI\x20is\x20writing...')}]}),_0x3bd92f[_0x33b0('0x31')](),_0x3bd92f;}}
@@ -1,26 +1,26 @@
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/aiformerrorview
7
- */
8
- import type { Locale } from 'ckeditor5/src/utils';
9
- import { View } from 'ckeditor5/src/ui';
10
- /**
11
- * A class representing the error view of the AI assistant.
12
- */
13
- export default class AIFormErrorView extends View {
14
- /**
15
- * The text of the error.
16
- *
17
- * @observable
18
- */
19
- text: string;
20
- /**
21
- * Creates an instance of the {@link module:ai/ui/aiformerrorview~AIFormErrorView} class.
22
- *
23
- * @param locale The localization services instance.
24
- */
25
- constructor(locale: Locale, text?: string);
26
- }
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/aiformerrorview
7
+ */
8
+ import type { Locale } from 'ckeditor5/src/utils';
9
+ import { View } from 'ckeditor5/src/ui';
10
+ /**
11
+ * A class representing the error view of the AI assistant.
12
+ */
13
+ export default class AIFormErrorView extends View {
14
+ /**
15
+ * The text of the error.
16
+ *
17
+ * @observable
18
+ */
19
+ text: string;
20
+ /**
21
+ * Creates an instance of the {@link module:ai/ui/aiformerrorview~AIFormErrorView} class.
22
+ *
23
+ * @param locale The localization services instance.
24
+ */
25
+ constructor(locale: Locale, text?: string);
26
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4201=['setTemplate','div','ck-ai-form__error','bindTemplate','set','content','text'];(function(_0x5b7a63,_0x4201e5){const _0x278c7b=function(_0x323609){while(--_0x323609){_0x5b7a63['push'](_0x5b7a63['shift']());}};_0x278c7b(++_0x4201e5);}(_0x4201,0x1e4));const _0x278c=function(_0x5b7a63,_0x4201e5){_0x5b7a63=_0x5b7a63-0x0;let _0x278c7b=_0x4201[_0x5b7a63];return _0x278c7b;};import{View as _0x123644,IconView as _0x358e01}from'ckeditor5/src/ui';import _0x5214f9 from'../../../theme/icons/error.svg';export default class D extends _0x123644{constructor(_0x3f86f6,_0x39b758=''){super(_0x3f86f6);const _0xfd5163=new _0x358e01(),_0x4d7571=this[_0x278c('0x2')];this[_0x278c('0x3')](_0x278c('0x5'),_0x39b758),_0xfd5163[_0x278c('0x4')]=_0x5214f9,this[_0x278c('0x6')]({'tag':_0x278c('0x0'),'attributes':{'class':['ck',_0x278c('0x1')]},'children':[_0xfd5163,{'text':_0x4d7571['to'](_0x278c('0x5'))}]});}}
23
+ const _0x2a0b=['set','text','content','setTemplate','bindTemplate','div','ck-ai-form__error'];(function(_0x35b5de,_0x2a0b2f){const _0x484251=function(_0x29f41d){while(--_0x29f41d){_0x35b5de['push'](_0x35b5de['shift']());}};_0x484251(++_0x2a0b2f);}(_0x2a0b,0x145));const _0x4842=function(_0x35b5de,_0x2a0b2f){_0x35b5de=_0x35b5de-0x0;let _0x484251=_0x2a0b[_0x35b5de];return _0x484251;};import{View as _0x423231,IconView as _0x192b42}from'ckeditor5/src/ui';import _0x80cd23 from'../../../theme/icons/error.svg';export default class J extends _0x423231{constructor(_0x189d5e,_0x406cce=''){super(_0x189d5e);const _0xe8707a=new _0x192b42(),_0x70c12b=this[_0x4842('0x1')];this[_0x4842('0x4')](_0x4842('0x5'),_0x406cce),_0xe8707a[_0x4842('0x6')]=_0x80cd23,this[_0x4842('0x0')]({'tag':_0x4842('0x2'),'attributes':{'class':['ck',_0x4842('0x3')]},'children':[_0xe8707a,{'text':_0x70c12b['to'](_0x4842('0x5'))}]});}}
@@ -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 value Initial textarea state.
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
- import{Rect as _0x4bdab2,global as _0x1896be}from'ckeditor5/src/utils';import{AutocompleteView as _0x3fccbc,ButtonView as _0x546102}from'ckeditor5/src/ui';import{icons as _0x1aeefa}from'ckeditor5/src/core';import{escape as _0x2d665d}from'lodash-es';import _0x2a84d2 from'../../../theme/icons/submit.svg';export default class J extends _0x3fccbc{constructor(_0x8d3d4f,_0x2b14f4){super(_0x8d3d4f,_0x2b14f4),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2de500,_0x47714d)=>{_0x2de500['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x47714d());});}['_createSubmitButton'](){const _0x517ddd=new _0x546102(this['locale']),t=this['locale']['t'];return _0x517ddd['set']({'icon':_0x2a84d2,'label':t('Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x517ddd['on']('execute',()=>{this['submit']();}),_0x517ddd['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x33e286,_0x74b73c)=>!_0x33e286&&_0x74b73c),_0x517ddd;}['_createShowHistoryButton'](){const _0x3d6442=new _0x546102(this['locale']),_0x4b501e=this['resultsView'],t=this['locale']['t'];_0x3d6442['set']({'label':t('History'),'withText':!0x1,'icon':_0x1aeefa['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3d6442['bind']('isOn')['to'](_0x4b501e,'isVisible'),_0x3d6442['on']('execute',()=>{_0x4b501e['isVisible']=!_0x4b501e['isVisible'],_0x4b501e['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x388d9e=()=>{_0x1896be['window']['requestAnimationFrame'](()=>{const _0x5d5400=new _0x4bdab2(this['queryView']['fieldView']['element']),_0xb3ceec=_0x5d5400['width'];_0x5d5400['excludeScrollbarsAndBorders'](),_0x3d6442['element']['style']['right']=_0xb3ceec-_0x5d5400['width']+0x1+'px';});};return this['queryView']['fieldView']['on']('update',_0x388d9e),this['on']('render',_0x388d9e),_0x3d6442;}['submit'](){const _0x25639e=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2d665d(_0x25639e));}['focus'](_0x5214cb){-0x1===_0x5214cb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}
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')]();}}
@@ -1,41 +1,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
- * 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
+ * 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
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ToolbarView as _0x22e17f,ButtonView as _0x2be118}from'ckeditor5/src/ui';export default class W extends _0x22e17f{constructor(_0xe29969){super(_0xe29969);const t=_0xe29969['t'];this['set']('isVisible',!0x1);const _0x234dde=t({'string':'Replace','id':'AI_REPLACE_CONTENT'});this['replaceButton']=this['_createButton'](_0x234dde,'ck-button-action'),this['insertButton']=this['_createButton'](t('Insert\x20below')),this['tryAgainButton']=this['_createButton'](t('Try\x20again')),this['stopButton']=this['_createButton'](t('Stop'));const _0x308349=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x308349['if']('isVisible','ck-hidden',_0x2efa12=>!_0x2efa12)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1352e4,_0x1da5cd){const _0x1f897e=new _0x2be118(this['locale']);return _0x1f897e['set']({'label':_0x1352e4,'class':_0x1da5cd||'','isVisible':!0x0,'withText':!0x0}),_0x1f897e;}}
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;}}
@@ -1,125 +1,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 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
- * Indicates if the AI request is processing.
62
- */
63
- isProcessing: boolean;
64
- /**
65
- * Indicates if the AI request failed.
66
- */
67
- isError: boolean;
68
- /**
69
- * Creates an instance of the {@link module:ai/ui/aiformview~AIFormView} class.
70
- *
71
- * @param locale The localization services instance.
72
- * @param prompt The text label of the prompt with which the form has been initialized.
73
- */
74
- constructor(locale: Locale, prompt: string);
75
- /**
76
- * @inheritDoc
77
- */
78
- render(): void;
79
- focus(): void;
80
- }
81
- /**
82
- * Fired when a user performed an action that should lead to replace the current selection by generated content.
83
- *
84
- * @eventName ~AIFormView#replaceContent
85
- */
86
- export type ReplaceContentEvent = {
87
- name: 'replaceContent';
88
- args: [value: string];
89
- };
90
- /**
91
- * Fired when a user performed an action that should lead to insert generated content below the current selection.
92
- *
93
- * @eventName ~AIFormView#insertContentBelow
94
- */
95
- export type InsertContentBelowEvent = {
96
- name: 'insertContentBelow';
97
- args: [value: string];
98
- };
99
- /**
100
- * Fired when a user performed an action that should lead to retry the previous request to AI.
101
- *
102
- * @eventName ~AIFormView#tryAgainEvent
103
- */
104
- export type TryAgainEvent = {
105
- name: 'tryAgainEvent';
106
- args: [];
107
- };
108
- /**
109
- * Fired when a user performed an action that should lead to stop the processing of AI.
110
- *
111
- * @eventName ~AIFormView#stopProcessing
112
- */
113
- export type StopProcessingEvent = {
114
- name: 'stopProcessing';
115
- args: [];
116
- };
117
- /**
118
- * Fired when a user performed an action that should lead to ask AI.
119
- *
120
- * @eventName ~AIFormView#submitPrompt
121
- */
122
- export type SubmitPromptEvent = {
123
- name: 'submitPrompt';
124
- args: [prompt: string];
125
- };
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
+ };