@ckeditor/ckeditor5-ai 40.2.0 → 41.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/LICENSE.md +14 -6
  2. package/README.md +10 -11
  3. package/build/ai.js +8 -8
  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 -1
  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 +3 -3
  58. package/lang/translations/af.po +14 -6
  59. package/lang/translations/ar.po +14 -6
  60. package/lang/translations/bg.po +14 -6
  61. package/lang/translations/bn.po +14 -6
  62. package/lang/translations/bs.po +14 -6
  63. package/lang/translations/ca.po +14 -6
  64. package/lang/translations/cs.po +14 -6
  65. package/lang/translations/da.po +14 -6
  66. package/lang/translations/de-ch.po +14 -6
  67. package/lang/translations/de.po +14 -6
  68. package/lang/translations/el.po +14 -6
  69. package/lang/translations/en-au.po +14 -6
  70. package/lang/translations/en.po +14 -6
  71. package/lang/translations/es-co.po +14 -6
  72. package/lang/translations/es.po +14 -6
  73. package/lang/translations/et.po +14 -6
  74. package/lang/translations/fa.po +14 -6
  75. package/lang/translations/fi.po +14 -6
  76. package/lang/translations/fr.po +14 -6
  77. package/lang/translations/gl.po +14 -6
  78. package/lang/translations/he.po +14 -6
  79. package/lang/translations/hi.po +14 -6
  80. package/lang/translations/hr.po +14 -6
  81. package/lang/translations/hu.po +14 -6
  82. package/lang/translations/id.po +14 -6
  83. package/lang/translations/it.po +28 -20
  84. package/lang/translations/ja.po +14 -6
  85. package/lang/translations/jv.po +14 -6
  86. package/lang/translations/ko.po +14 -6
  87. package/lang/translations/lt.po +14 -6
  88. package/lang/translations/lv.po +14 -6
  89. package/lang/translations/ms.po +14 -6
  90. package/lang/translations/nl.po +14 -6
  91. package/lang/translations/no.po +14 -6
  92. package/lang/translations/pl.po +14 -6
  93. package/lang/translations/pt-br.po +14 -6
  94. package/lang/translations/pt.po +14 -6
  95. package/lang/translations/ro.po +14 -6
  96. package/lang/translations/ru.po +14 -6
  97. package/lang/translations/sk.po +14 -6
  98. package/lang/translations/sr-latn.po +14 -6
  99. package/lang/translations/sr.po +14 -6
  100. package/lang/translations/sv.po +14 -6
  101. package/lang/translations/th.po +14 -6
  102. package/lang/translations/tk.po +14 -6
  103. package/lang/translations/tr.po +14 -6
  104. package/lang/translations/ug.po +14 -6
  105. package/lang/translations/uk.po +14 -6
  106. package/lang/translations/ur.po +14 -6
  107. package/lang/translations/uz.po +14 -6
  108. package/lang/translations/vi.po +14 -6
  109. package/lang/translations/zh-cn.po +14 -6
  110. package/lang/translations/zh.po +14 -6
  111. package/package.json +7 -5
  112. package/src/adapters/aiadapter.d.ts +3 -3
  113. package/src/adapters/aiadapter.js +2 -2
  114. package/src/adapters/aitextadapter.d.ts +3 -3
  115. package/src/adapters/aitextadapter.js +2 -2
  116. package/src/adapters/awstextadapter.d.ts +24 -24
  117. package/src/adapters/awstextadapter.js +2 -2
  118. package/src/adapters/openaitextadapter.d.ts +3 -3
  119. package/src/adapters/openaitextadapter.js +2 -2
  120. package/src/aiassistant.d.ts +5 -5
  121. package/src/aiassistant.js +2 -2
  122. package/src/aiassistantediting.d.ts +13 -12
  123. package/src/aiassistantediting.js +2 -2
  124. package/src/aiassistantui.d.ts +8 -8
  125. package/src/aiassistantui.js +2 -2
  126. package/src/aiconfig.d.ts +5 -5
  127. package/src/aiconfig.js +1 -1
  128. package/src/augmentation.d.ts +7 -7
  129. package/src/augmentation.js +1 -1
  130. package/src/index.d.ts +7 -7
  131. package/src/index.js +2 -2
  132. package/src/ui/aiassistantcontroller.d.ts +12 -12
  133. package/src/ui/aiassistantcontroller.js +2 -2
  134. package/src/ui/dropdown/aicommandslistview.d.ts +2 -2
  135. package/src/ui/dropdown/aicommandslistview.js +2 -2
  136. package/src/ui/dropdown/buttonlabelwithhighlightview.d.ts +2 -2
  137. package/src/ui/dropdown/buttonlabelwithhighlightview.js +2 -2
  138. package/src/ui/dropdown/labelwithhighlightview.d.ts +2 -2
  139. package/src/ui/dropdown/labelwithhighlightview.js +2 -2
  140. package/src/ui/form/aiformcontentarea.d.ts +3 -3
  141. package/src/ui/form/aiformcontentarea.js +2 -2
  142. package/src/ui/form/aiformerrorview.d.ts +3 -3
  143. package/src/ui/form/aiformerrorview.js +2 -2
  144. package/src/ui/form/aiformpromptview.d.ts +3 -3
  145. package/src/ui/form/aiformpromptview.js +2 -2
  146. package/src/ui/form/aiformtoolbarview.d.ts +12 -8
  147. package/src/ui/form/aiformtoolbarview.js +2 -2
  148. package/src/ui/form/aiformview.d.ts +13 -14
  149. package/src/ui/form/aiformview.js +2 -2
  150. package/src/ui/form/aihistorylistitemview.d.ts +3 -3
  151. package/src/ui/form/aihistorylistitemview.js +2 -2
  152. package/src/ui/form/aihistorylistview.d.ts +3 -3
  153. package/src/ui/form/aihistorylistview.js +2 -2
  154. package/src/ui/form/prompthistory.d.ts +2 -2
  155. package/src/ui/form/prompthistory.js +2 -2
  156. package/src/ui/showaiassistantcommand.d.ts +2 -2
  157. package/src/ui/showaiassistantcommand.js +2 -2
  158. package/src/utils/common-translations.d.ts +2 -2
  159. package/src/utils/common-translations.js +2 -2
  160. package/theme/ai-dropdown.css +1 -1
  161. package/theme/ai-form.css +16 -4
  162. package/theme/ai.css +17 -4
  163. package/theme/icons/robot-pencil.svg +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
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);}}
23
+ const _0x287b=['replaceButton','clear','isEnabled','locale','AI_ERROR_FAILED','focusCycler','add','historyGroupView','shift\x20+\x20tab','fire','value','insertContentBelow','contentArea','focusPrevious','replaceContent','set','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','isError','submitPrompt','fieldView','delegate','errorView','clearHistory','_promptHistory','Ask\x20AI\x20to\x20improve\x20generated\x20text','stopButton','focusNext','backwardCycle','stop','focusTracker','ck-ai-form','promptView','handleError','_createHistoryView','div','toolbar','startProcessing','focusFirst','REPLACE','render','element','text','tryAgainEvent','insertButton','bindTo','isVisible','ck-ai-form-content','_createToolbar','focus','tryAgainButton','finishProcessing','createCollection','mainAction','stopProcessing','bind','reset','execute','trim','focusLast','items','setTemplate','prompt','submit','keystrokes','queryView','_focusables','isProcessing','copyButtonView','_createPromptView'];(function(_0x2da91a,_0x287bba){const _0x455b21=function(_0x144636){while(--_0x144636){_0x2da91a['push'](_0x2da91a['shift']());}};_0x455b21(++_0x287bba);}(_0x287b,0x123));const _0x455b=function(_0x2da91a,_0x287bba){_0x2da91a=_0x2da91a-0x0;let _0x455b21=_0x287b[_0x2da91a];return _0x455b21;};import{FocusTracker as _0x53ee1d,KeystrokeHandler as _0x41d6c6}from'ckeditor5/src/utils.js';import{View as _0x43f5d6,FocusCycler as _0x313bdc,createLabeledTextarea as _0x284bbc}from'ckeditor5/src/ui.js';import _0x27ae3a,{AIFormToolbarViewMainActionLabel as _0x494123}from'./aiformtoolbarview.js';import _0x3b3ccd from'./aiformcontentarea.js';import _0x256f89 from'./aiformerrorview.js';import _0x2b0094 from'./aiformpromptview.js';import _0x343725 from'./aihistorylistview.js';import _0x54f7f6 from'./aihistorylistitemview.js';import _0x44ec00 from'./prompthistory.js';import{getTranslation as _0x10e538}from'../../utils/common-translations.js';import{escape as _0x72d839}from'lodash-es';export default class v extends _0x43f5d6{constructor(_0x4d02c8,_0x178708,_0x5ee5b1=''){super(_0x4d02c8),this[_0x455b('0x0')](_0x455b('0x38'),!0x0),this[_0x455b('0x0')](_0x455b('0x33'),!0x1),this['set'](_0x455b('0x2e'),''),this[_0x455b('0x0')](_0x455b('0x40'),''),this[_0x455b('0x0')](_0x455b('0x2'),!0x1),this[_0x455b('0x0')](_0x455b('0x25'),_0x494123[_0x455b('0x17')]),this[_0x455b('0x8')]=new _0x44ec00(),this[_0x455b('0x6')]=new _0x256f89(_0x4d02c8),this[_0x455b('0x42')]=new _0x3b3ccd(_0x4d02c8,_0x5ee5b1),this['contentArea'][_0x455b('0x27')](_0x455b('0x33'))['to'](this),this[_0x455b('0x42')][_0x455b('0x27')](_0x455b('0x40'))['to'](this),this[_0x455b('0x14')]=this[_0x455b('0x20')](),this[_0x455b('0x14')]['bind']('mainAction')['to'](this),this[_0x455b('0x10')]=this['_createPromptView'](),this[_0x455b('0xe')]=new _0x53ee1d(),this[_0x455b('0x30')]=new _0x41d6c6(),this[_0x455b('0x32')]=this[_0x455b('0x24')]([this['contentArea'],this[_0x455b('0x42')][_0x455b('0x34')],this[_0x455b('0x14')],this[_0x455b('0x10')]]),this[_0x455b('0x3b')]=new _0x313bdc({'focusables':this[_0x455b('0x32')],'focusTracker':this[_0x455b('0xe')],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':_0x455b('0x3e'),'focusNext':'tab'}}),this[_0x455b('0x10')][_0x455b('0x3b')]['on']('forwardCycle',_0x456929=>{this[_0x455b('0x3b')][_0x455b('0xb')](),_0x456929[_0x455b('0xd')]();}),this[_0x455b('0x10')][_0x455b('0x3b')]['on'](_0x455b('0xc'),_0x59a37e=>{this[_0x455b('0x3b')][_0x455b('0x43')](),_0x59a37e[_0x455b('0xd')]();}),this[_0x455b('0x10')][_0x455b('0x31')][_0x455b('0x4')]['bind'](_0x455b('0x40'))['to'](this,_0x455b('0x2e'));const _0x4bafdb=this['bindTemplate'];this[_0x455b('0x2d')]({'tag':_0x455b('0x13'),'attributes':{'class':['ck',_0x455b('0xf'),_0x178708],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck',_0x455b('0x1f')]},'children':[{'tag':_0x455b('0x13'),'attributes':{'class':[_0x4bafdb['if']('isError','ck-hidden',_0x16ceec=>!_0x16ceec)]},'children':[this[_0x455b('0x6')]]},this[_0x455b('0x42')],this[_0x455b('0x14')],this['promptView']]}]});}[_0x455b('0x18')](){super[_0x455b('0x18')](),this['focusTracker'][_0x455b('0x3c')](this[_0x455b('0x42')]['element']),this[_0x455b('0xe')][_0x455b('0x3c')](this['contentArea'][_0x455b('0x34')][_0x455b('0x19')]),this[_0x455b('0xe')][_0x455b('0x3c')](this['toolbar'][_0x455b('0x19')]),this[_0x455b('0xe')][_0x455b('0x3c')](this[_0x455b('0x10')][_0x455b('0x19')]),this['keystrokes']['listenTo'](this[_0x455b('0x19')]);}[_0x455b('0x21')](_0x49a309=0x1){-0x1===_0x49a309?this['focusCycler'][_0x455b('0x2b')]():this[_0x455b('0x3b')][_0x455b('0x16')]();}[_0x455b('0x28')](){this['prompt']='',this['value']='',this[_0x455b('0x2')]=!0x1,this['promptView']['reset'](),this[_0x455b('0x42')]['isVisible']=!0x1,this[_0x455b('0x14')][_0x455b('0x1e')]=!0x1;}[_0x455b('0x35')](){const _0x56dd74=this[_0x455b('0x39')],_0x237644=new _0x2b0094(_0x56dd74,{'queryView':{'label':_0x10e538(_0x56dd74,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x284bbc,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x10e538(_0x56dd74,'Empty\x20history'),'secondary':_0x10e538(_0x56dd74,_0x455b('0x1'))}}},'filteredView':this[_0x455b('0x12')](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x237644[_0x455b('0x27')](_0x455b('0x38'))['to'](this,_0x455b('0x38'),this,_0x455b('0x33'),(_0xb59428,_0xe00802)=>_0xb59428&&!_0xe00802),this['listenTo'](_0x237644,_0x455b('0x2f'),(_0x6ed043,_0x2f074e)=>{this['prompt']=_0x2f074e;const _0xdc6a0=_0x72d839(_0x2f074e);this[_0x455b('0x3f')](_0x455b('0x3'),_0xdc6a0),_0x2f074e[_0x455b('0x2a')]()&&this[_0x455b('0x8')]['add']({'prompt':_0xdc6a0},0x0);},{'priority':'high'}),_0x237644;}[_0x455b('0x12')](){const _0x4d1d91=new _0x343725(this['locale']);return _0x4d1d91[_0x455b('0x3d')][_0x455b('0x2c')][_0x455b('0x1d')](this[_0x455b('0x8')])['as'](_0x54f7f6),_0x4d1d91['on'](_0x455b('0x7'),()=>{this[_0x455b('0x8')][_0x455b('0x37')](),this['promptView']['search'](''),this[_0x455b('0x10')]['focus']();}),_0x4d1d91;}['_createToolbar'](){const _0x1dd56c=new _0x27ae3a(this[_0x455b('0x39')]);return _0x1dd56c[_0x455b('0x36')]['bind']('isEnabled')['to'](this,_0x455b('0x38'),this,'isProcessing',this,_0x455b('0x40'),(_0x3048b2,_0x5a9f38,_0x5e9238)=>_0x3048b2&&!_0x5a9f38&&!!_0x5e9238),_0x1dd56c['replaceButton'][_0x455b('0x5')](_0x455b('0x29'))['to'](this,_0x455b('0x44')),_0x1dd56c[_0x455b('0x1c')][_0x455b('0x27')](_0x455b('0x38'))['to'](this,_0x455b('0x38'),this,'isProcessing',this,_0x455b('0x40'),(_0x233f1d,_0x122b37,_0x225080)=>_0x233f1d&&!_0x122b37&&!!_0x225080),_0x1dd56c['insertButton'][_0x455b('0x5')](_0x455b('0x29'))['to'](this,_0x455b('0x41')),_0x1dd56c[_0x455b('0x22')][_0x455b('0x27')](_0x455b('0x38'))['to'](this,_0x455b('0x38'),this,_0x455b('0x33'),(_0x4cde12,_0x5eda1d)=>_0x4cde12&&!_0x5eda1d),_0x1dd56c[_0x455b('0x22')][_0x455b('0x5')](_0x455b('0x29'))['to'](this,_0x455b('0x1b')),_0x1dd56c[_0x455b('0xa')][_0x455b('0x27')]('isEnabled')['to'](this,_0x455b('0x33')),_0x1dd56c[_0x455b('0xa')][_0x455b('0x5')](_0x455b('0x29'))['to'](this,_0x455b('0x26')),_0x1dd56c;}[_0x455b('0x15')](){this['value']='',this[_0x455b('0x2')]=!0x1,this['isProcessing']=!0x0,this[_0x455b('0x42')]['isVisible']=!0x0,this[_0x455b('0x14')][_0x455b('0x1e')]=!0x0,this[_0x455b('0x42')][_0x455b('0x21')]();}[_0x455b('0x23')](){const _0x2143ef=this[_0x455b('0x39')];this['isProcessing']=!0x1,this[_0x455b('0x2e')]='',this[_0x455b('0x10')][_0x455b('0x28')](),this[_0x455b('0x40')]&&(this['promptView'][_0x455b('0x31')]['label']=_0x10e538(_0x2143ef,_0x455b('0x9')));}[_0x455b('0x11')](_0x352c47){const _0x4e9b30=this[_0x455b('0x39')];this[_0x455b('0x23')](),this['isError']=!0x0,this[_0x455b('0x6')][_0x455b('0x1a')]=_0x352c47||_0x10e538(_0x4e9b30,_0x455b('0x3a')),this['value']||(this[_0x455b('0x42')][_0x455b('0x1e')]=!0x1);}}
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module ai/ui/aihistorylistitemview
7
7
  */
8
- import { ListItemView } from 'ckeditor5/src/ui';
9
- import type { PromptHistoryEntry } from './prompthistory';
8
+ import { ListItemView } from 'ckeditor5/src/ui.js';
9
+ import type { PromptHistoryEntry } from './prompthistory.js';
10
10
  /**
11
11
  * A list item view that displays a historical prompt
12
12
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x35dc=['fire','locale','execute','children','prompt','add','set'];(function(_0x546f54,_0x35dc86){const _0x2f68e5=function(_0x13289d){while(--_0x13289d){_0x546f54['push'](_0x546f54['shift']());}};_0x2f68e5(++_0x35dc86);}(_0x35dc,0x7a));const _0x2f68=function(_0x546f54,_0x35dc86){_0x546f54=_0x546f54-0x0;let _0x2f68e5=_0x35dc[_0x546f54];return _0x2f68e5;};import{ListItemView as _0x56287e,ButtonView as _0x4fe861}from'ckeditor5/src/ui';import _0x5e63be from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x572a25}from'lodash-es';export default class pt extends _0x56287e{constructor(_0x429b4c){super();const _0x54e236=new _0x5e63be(),_0x524a0f=new _0x4fe861(this[_0x2f68('0x5')],_0x54e236);this[_0x2f68('0x0')][_0x2f68('0x2')](_0x524a0f),_0x524a0f[_0x2f68('0x3')]({'label':_0x429b4c[_0x2f68('0x1')],'withText':!0x0}),_0x524a0f['on'](_0x2f68('0x6'),()=>{this[_0x2f68('0x4')](_0x2f68('0x6'),{'value':_0x572a25(_0x429b4c[_0x2f68('0x1')])});});}}
23
+ const _0x5e70=['add','prompt','execute','fire'];(function(_0x2c4464,_0x5e70d1){const _0x5711aa=function(_0x2d5c09){while(--_0x2d5c09){_0x2c4464['push'](_0x2c4464['shift']());}};_0x5711aa(++_0x5e70d1);}(_0x5e70,0x11e));const _0x5711=function(_0x2c4464,_0x5e70d1){_0x2c4464=_0x2c4464-0x0;let _0x5711aa=_0x5e70[_0x2c4464];return _0x5711aa;};import{ListItemView as _0x5942e3,ButtonView as _0x142971}from'ckeditor5/src/ui.js';import _0x35f643 from'../dropdown/buttonlabelwithhighlightview.js';import{unescape as _0x2caf88}from'lodash-es';export default class hs extends _0x5942e3{constructor(_0x365248){super();const _0x3067d6=new _0x35f643(),_0x419c88=new _0x142971(this['locale'],_0x3067d6);this['children'][_0x5711('0x2')](_0x419c88),_0x419c88['set']({'label':_0x365248[_0x5711('0x3')],'withText':!0x0}),_0x419c88['on'](_0x5711('0x0'),()=>{this[_0x5711('0x1')](_0x5711('0x0'),{'value':_0x2caf88(_0x365248[_0x5711('0x3')])});});}}
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module ai/ui/aihistorylistview
7
7
  */
8
- import { ListView, ListItemGroupView, ButtonView, type FilteredView } from 'ckeditor5/src/ui';
9
- import type { Locale } from 'ckeditor5/src/utils';
8
+ import { ListView, ListItemGroupView, ButtonView, type FilteredView } from 'ckeditor5/src/ui.js';
9
+ import type { Locale } from 'ckeditor5/src/utils.js';
10
10
  /**
11
11
  * A list view that displays a list of AI prompts with filter pass-through.
12
12
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4f95=['locale','add','children','historyGroupView','execute','clearHistory','fire','items','_createClearHistoryButton','delegate','clearHistoryButton','Prompt\x20history','Clear'];(function(_0x23faf1,_0x4f952f){const _0x3ce790=function(_0x465884){while(--_0x465884){_0x23faf1['push'](_0x23faf1['shift']());}};_0x3ce790(++_0x4f952f);}(_0x4f95,0xfb));const _0x3ce7=function(_0x23faf1,_0x4f952f){_0x23faf1=_0x23faf1-0x0;let _0x3ce790=_0x4f95[_0x23faf1];return _0x3ce790;};import{ListView as _0x3276da,ListItemGroupView as _0x303995,ButtonView as _0x3e2e1d}from'ckeditor5/src/ui';import{getTranslation as _0x2aaab3}from'../../utils/common-translations';export default class ut extends _0x3276da{constructor(_0x548d1d){super(_0x548d1d),this[_0x3ce7('0x6')]=this[_0x3ce7('0x4')](),this['historyGroupView']=new _0x303995(),this[_0x3ce7('0xc')][_0x3ce7('0xb')][_0x3ce7('0xa')](this[_0x3ce7('0x6')],0x1),this[_0x3ce7('0xc')]['label']=_0x2aaab3(_0x548d1d,_0x3ce7('0x7')),this[_0x3ce7('0xc')][_0x3ce7('0x3')][_0x3ce7('0x5')](_0x3ce7('0x0'))['to'](this),this['items']['add'](this[_0x3ce7('0xc')]);}['filter'](){let _0x4a59f1=0x0;for(const _0x85ff85 of this[_0x3ce7('0x3')])_0x4a59f1+=_0x85ff85[_0x3ce7('0x3')]['length'];return{'resultsCount':_0x4a59f1,'totalItemsCount':_0x4a59f1};}[_0x3ce7('0x4')](){const _0xa17eaf=this['locale'],_0x1204b5=new _0x3e2e1d(this[_0x3ce7('0x9')]);return _0x1204b5['set']({'label':'('+_0x2aaab3(_0xa17eaf,_0x3ce7('0x8'))+')','withText':!0x0}),_0x1204b5['on']('execute',()=>this[_0x3ce7('0x2')](_0x3ce7('0x1'))),_0x1204b5;}}
23
+ const _0x1f1b=['set','items','Clear','historyGroupView','filter','length','add','clearHistoryButton','clearHistory','execute','fire','locale'];(function(_0x1b3d0a,_0x1f1b2c){const _0x4e4322=function(_0x4c23f4){while(--_0x4c23f4){_0x1b3d0a['push'](_0x1b3d0a['shift']());}};_0x4e4322(++_0x1f1b2c);}(_0x1f1b,0xd6));const _0x4e43=function(_0x1b3d0a,_0x1f1b2c){_0x1b3d0a=_0x1b3d0a-0x0;let _0x4e4322=_0x1f1b[_0x1b3d0a];return _0x4e4322;};import{ListView as _0x2ea859,ListItemGroupView as _0x5383d5,ButtonView as _0x99327e}from'ckeditor5/src/ui.js';import{getTranslation as _0x52d153}from'../../utils/common-translations.js';export default class rs extends _0x2ea859{constructor(_0x1689c1){super(_0x1689c1),this[_0x4e43('0x9')]=this['_createClearHistoryButton'](),this[_0x4e43('0x5')]=new _0x5383d5(),this['historyGroupView']['children'][_0x4e43('0x8')](this[_0x4e43('0x9')],0x1),this[_0x4e43('0x5')]['label']=_0x52d153(_0x1689c1,'Prompt\x20history'),this[_0x4e43('0x5')][_0x4e43('0x3')]['delegate'](_0x4e43('0xb'))['to'](this),this[_0x4e43('0x3')]['add'](this['historyGroupView']);}[_0x4e43('0x6')](){let _0x477be0=0x0;for(const _0x15a621 of this[_0x4e43('0x3')])_0x477be0+=_0x15a621[_0x4e43('0x3')][_0x4e43('0x7')];return{'resultsCount':_0x477be0,'totalItemsCount':_0x477be0};}['_createClearHistoryButton'](){const _0x352003=this['locale'],_0x557e3a=new _0x99327e(this[_0x4e43('0x1')]);return _0x557e3a[_0x4e43('0x2')]({'label':'('+_0x52d153(_0x352003,_0x4e43('0x4'))+')','withText':!0x0}),_0x557e3a['on'](_0x4e43('0xb'),()=>this[_0x4e43('0x0')](_0x4e43('0xa'))),_0x557e3a;}}
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import { Collection } from 'ckeditor5/src/utils';
5
+ import { Collection } from 'ckeditor5/src/utils.js';
6
6
  /**
7
7
  * A collection that stores the prompt history in the session storage as a side effect.
8
8
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x249f=['_loadFromSessionStorage','add','map','last','remove','_saveToSessionStorage','toLowerCase','stringify','CKEditor/AIFormView/PromptHistory','length','addMany','trim','setItem','getItem','prompt'];(function(_0x25c4c3,_0x249fb7){const _0x516582=function(_0x9431f3){while(--_0x9431f3){_0x25c4c3['push'](_0x25c4c3['shift']());}};_0x516582(++_0x249fb7);}(_0x249f,0x102));const _0x5165=function(_0x25c4c3,_0x249fb7){_0x25c4c3=_0x25c4c3-0x0;let _0x516582=_0x249f[_0x25c4c3];return _0x516582;};import{Collection as _0x396808}from'ckeditor5/src/utils';const ts=_0x5165('0x5');export default class dt extends _0x396808{constructor(){super(),this[_0x5165('0xc')](),this['on'](_0x5165('0xd'),(_0x809c23,_0x2ab92e)=>{const _0x467a55=os(_0x2ab92e[_0x5165('0xb')]);for(const _0x26f08a of this)if(_0x26f08a!=_0x2ab92e&&os(_0x26f08a[_0x5165('0xb')])===_0x467a55){this['remove'](_0x26f08a);break;}this[_0x5165('0x6')]>0x14&&this['remove'](this[_0x5165('0x0')]),this[_0x5165('0x2')]();}),this['on'](_0x5165('0x1'),()=>{this[_0x5165('0x2')]();});}['_loadFromSessionStorage'](){const _0x3bbdee=sessionStorage[_0x5165('0xa')](ts)||'[]';this[_0x5165('0x7')](JSON['parse'](_0x3bbdee));}[_0x5165('0x2')](){sessionStorage[_0x5165('0x9')](ts,JSON[_0x5165('0x4')](this[_0x5165('0xe')](_0x530358=>_0x530358)));}}function os(_0xb5b7b2){return _0xb5b7b2[_0x5165('0x3')]()[_0x5165('0x8')]();}
23
+ const _0x1242=['CKEditor/AIFormView/PromptHistory','toLowerCase','length','getItem','remove','stringify','addMany','last','add','setItem','prompt','_saveToSessionStorage','map'];(function(_0xfca20c,_0x124275){const _0x41a510=function(_0x1fce27){while(--_0x1fce27){_0xfca20c['push'](_0xfca20c['shift']());}};_0x41a510(++_0x124275);}(_0x1242,0xa6));const _0x41a5=function(_0xfca20c,_0x124275){_0xfca20c=_0xfca20c-0x0;let _0x41a510=_0x1242[_0xfca20c];return _0x41a510;};import{Collection as _0x379985}from'ckeditor5/src/utils.js';const cs=_0x41a5('0x3');export default class os extends _0x379985{constructor(){super(),this['_loadFromSessionStorage'](),this['on'](_0x41a5('0xb'),(_0x5c5b9b,_0x269b4d)=>{const _0x44f0ba=Ss(_0x269b4d[_0x41a5('0x0')]);for(const _0x7df0b7 of this)if(_0x7df0b7!=_0x269b4d&&Ss(_0x7df0b7['prompt'])===_0x44f0ba){this[_0x41a5('0x7')](_0x7df0b7);break;}this[_0x41a5('0x5')]>0x14&&this[_0x41a5('0x7')](this[_0x41a5('0xa')]),this[_0x41a5('0x1')]();}),this['on']('remove',()=>{this[_0x41a5('0x1')]();});}['_loadFromSessionStorage'](){const _0x48dd43=sessionStorage[_0x41a5('0x6')](cs)||'[]';this[_0x41a5('0x9')](JSON['parse'](_0x48dd43));}['_saveToSessionStorage'](){sessionStorage[_0x41a5('0xc')](cs,JSON[_0x41a5('0x8')](this[_0x41a5('0x2')](_0x4e67a8=>_0x4e67a8)));}}function Ss(_0x238169){return _0x238169[_0x41a5('0x4')]()['trim']();}
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module ai/ui/showaiassistantcommand
7
7
  * @publicApi
8
8
  */
9
- import { Command } from 'ckeditor5/src/core';
9
+ import { Command } from 'ckeditor5/src/core.js';
10
10
  /**
11
11
  * Command that shows the AI Assistant user interface.
12
12
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x218c=['model','showUI','getRanges','get','selection','editor','element','ai.aiAssistant.disabledElements','getItems','custom','plugins','isEnabled','includes','document'];(function(_0x4b9bee,_0x218c26){const _0x34e3a9=function(_0x52c64e){while(--_0x52c64e){_0x4b9bee['push'](_0x4b9bee['shift']());}};_0x34e3a9(++_0x218c26);}(_0x218c,0x1a1));const _0x34e3=function(_0x4b9bee,_0x218c26){_0x4b9bee=_0x4b9bee-0x0;let _0x34e3a9=_0x218c[_0x4b9bee];return _0x34e3a9;};import{Command as _0x4a67c9}from'ckeditor5/src/core';import _0x23b8a8 from'../aiassistantui';export default class I extends _0x4a67c9{['refresh'](){const _0x467a38=this['editor'][_0x34e3('0x3')][_0x34e3('0x2')][_0x34e3('0x7')],_0x56b682=this[_0x34e3('0x8')]['config'][_0x34e3('0x6')](_0x34e3('0xa'));for(const _0x2562e3 of _0x467a38[_0x34e3('0x5')]())for(const _0x4bb82d of _0x2562e3[_0x34e3('0xb')]())if(_0x4bb82d['is'](_0x34e3('0x9'))&&_0x56b682[_0x34e3('0x1')](_0x4bb82d['name']))return void(this[_0x34e3('0x0')]=!0x1);this[_0x34e3('0x0')]=!0x0;}['execute'](_0x49c74f='',_0x41faf0='',_0x1c3269=_0x34e3('0xc')){this[_0x34e3('0x8')][_0x34e3('0xd')]['get'](_0x23b8a8)[_0x34e3('0x4')](_0x49c74f,_0x41faf0,_0x1c3269);}}
23
+ const _0x40bb=['refresh','includes','isEnabled','ai.aiAssistant.disabledElements','element','getRanges','config','execute','get','editor','showUI','model','name','getItems','plugins'];(function(_0x3cc29,_0x40bbf6){const _0x84905b=function(_0x5ba3c4){while(--_0x5ba3c4){_0x3cc29['push'](_0x3cc29['shift']());}};_0x84905b(++_0x40bbf6);}(_0x40bb,0x64));const _0x8490=function(_0x3cc29,_0x40bbf6){_0x3cc29=_0x3cc29-0x0;let _0x84905b=_0x40bb[_0x3cc29];return _0x84905b;};import{Command as _0x53afe4}from'ckeditor5/src/core.js';import _0x1ab446 from'../aiassistantui.js';export default class g extends _0x53afe4{[_0x8490('0x5')](){const _0x291b71=this[_0x8490('0xe')][_0x8490('0x1')]['document']['selection'],_0x181958=this[_0x8490('0xe')][_0x8490('0xb')][_0x8490('0xd')](_0x8490('0x8'));for(const _0x2aa27c of _0x291b71[_0x8490('0xa')]())for(const _0x293a68 of _0x2aa27c[_0x8490('0x3')]())if(_0x293a68['is'](_0x8490('0x9'))&&_0x181958[_0x8490('0x6')](_0x293a68[_0x8490('0x2')]))return void(this[_0x8490('0x7')]=!0x1);this[_0x8490('0x7')]=!0x0;}[_0x8490('0xc')](_0x56df60='',_0x6e9843='',_0x49cc57='custom'){this['editor'][_0x8490('0x4')][_0x8490('0xd')](_0x1ab446)[_0x8490('0x0')](_0x56df60,_0x6e9843,_0x49cc57);}}
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module ai/utils/common-translations
7
7
  */
8
- import type { Locale } from 'ckeditor5/src/utils';
8
+ import type { Locale } from 'ckeditor5/src/utils.js';
9
9
  export declare function getTranslation(locale: Locale, id: string, values?: string | Array<string> | number): string;
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export function getTranslation(_0x28a569,_0x40dec0,_0x17b838){const t=_0x28a569['t'];switch(_0x40dec0){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'Translate\x20to\x20%0':return t('Translate\x20to\x20%0',_0x17b838);case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Search\x20AI\x20command':return t('Search\x20AI\x20command');case'No\x20commands\x20found':return t('No\x20commands\x20found');case'No\x20commands\x20available':return t('No\x20commands\x20available');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x17b838);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x40dec0;}}
23
+ export function getTranslation(_0x47f906,_0x13ad73,_0x2540fc){const t=_0x47f906['t'];switch(_0x13ad73){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'Translate\x20to\x20%0':return t('Translate\x20to\x20%0',_0x2540fc);case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Search\x20AI\x20command':return t('Search\x20AI\x20command');case'No\x20commands\x20found':return t('No\x20commands\x20found');case'No\x20commands\x20available':return t('No\x20commands\x20available');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x2540fc);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x13ad73;}}
@@ -3,7 +3,7 @@
3
3
  * CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
4
4
  * all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
5
5
  *
6
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
6
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
8
  */
9
9
 
package/theme/ai-form.css CHANGED
@@ -3,7 +3,7 @@
3
3
  * CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
4
4
  * all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
5
5
  *
6
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
6
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
8
  */
9
9
 
@@ -11,8 +11,8 @@
11
11
  @import "@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css";
12
12
 
13
13
  :root {
14
- --ck-ai-form-view-width: 470px;
15
- --ck-ai-form-content-height: 126px;
14
+ --ck-ai-form-view-width: 600px;
15
+ --ck-ai-form-content-height: 175px;
16
16
  --ck-ai-form-content-background: hsl(0, 0%, 98%);
17
17
  --ck-ai-form-history-font-size: .9em;
18
18
 
@@ -23,8 +23,13 @@
23
23
  .ck .ck-ai-form {
24
24
  width: var(--ck-ai-form-view-width);
25
25
 
26
+ /* Don't overflow the parent dialog container */
27
+ max-width: 100%;
28
+
26
29
  @mixin ck-media-phone {
27
- --ck-ai-form-view-width: 350px;
30
+ /* Allow the for the layout to be fluid in narrow viewports to avoid breaking it due to limited
31
+ * horizontal space (https://github.com/cksource/ckeditor5-commercial/issues/5913). */
32
+ --ck-ai-form-view-width: 100vw;
28
33
  }
29
34
 
30
35
  & .ck-ai-form-content {
@@ -185,6 +190,13 @@
185
190
  @mixin ck-dir rtl {
186
191
  padding-left: 30px;
187
192
  }
193
+
194
+ /* Squash the textarea horizontally if necessary on narrow layouts
195
+ * to avoid breaking the layout even at the cost of the placeholder
196
+ * being cut off (https://github.com/cksource/ckeditor5-commercial/issues/5913). */
197
+ @mixin ck-media-phone {
198
+ --ck-input-width: auto;
199
+ }
188
200
  }
189
201
 
190
202
  /* Prompt history group */
package/theme/ai.css CHANGED
@@ -3,7 +3,7 @@
3
3
  * CKEditor 5 Collaboration is licensed under a commercial license and protected by copyright law. Where not otherwise indicated,
4
4
  * all CKEditor 5 Collaboration content is authored by CKSource engineers and consists of CKSource-owned intellectual property.
5
5
  *
6
- * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
6
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
7
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
8
  */
9
9
 
@@ -15,6 +15,7 @@
15
15
  --ck-ai-form-submit-button-border-color: transparent;
16
16
  --ck-ai-form-submit-button-disabled-border-color: transparent;
17
17
  --ck-ai-toolbar-button-hover-color: var(--ck-color-text);
18
+ --ck-color-ai-selection: hsla(201, 100%, 56%, 0.3);
18
19
  }
19
20
 
20
21
  /* Note: This class name is mentioned in the guide and acts like a public API. */
@@ -40,6 +41,8 @@
40
41
  --ck-ai-form-submit-button-border-color: var(--ck-color-button-action-background);
41
42
  --ck-ai-form-submit-button-disabled-border-color: var(--ck-color-button-action-disabled-background);
42
43
  --ck-ai-toolbar-button-hover-color: var(--ck-color-button-on-color);
44
+
45
+ --ck-color-ai-selection: hsl(262.5,60%,90%);
43
46
  }
44
47
 
45
48
  /*
@@ -51,13 +54,23 @@
51
54
  }
52
55
 
53
56
  /*
54
- * Classes used by the "fake visual selection" displayed in the content when an input
55
- * in the AI UI has focus (the browser does not render the native selection in this state).
57
+ * Classes used by the "fake visual selection" displayed in the content
58
+ * when the AI dialog is open.
56
59
  *
57
60
  * Narrow down to <span> to prevent changing background for widgets and nested editables.
58
61
  */
59
62
  .ck span.ck-fake-ai-selection {
60
- background: var(--ck-color-link-fake-selection);
63
+ background: var(--ck-color-ai-selection);
64
+ }
65
+
66
+ /*
67
+ * Classes used by the "fake visual candidate selection" displayed in the content when an input
68
+ * in the AI dropdown has focus (the browser does not render the native selection in this state).
69
+ *
70
+ * Narrow down to <span> to prevent changing background for widgets and nested editables.
71
+ */
72
+ .ck span.ck-fake-ai-selection-candidate {
73
+ background: var(--ck-color-ai-selection);
61
74
  }
62
75
 
63
76
  /* A collapsed fake visual selection. */
@@ -1 +0,0 @@
1
- <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9.61 2.66a1.406 1.406 0 1 0-1.407 0v.891H3.28a2.11 2.11 0 0 0-2.11 2.11v10.312a2.11 2.11 0 0 0 2.11 2.109h5.684l-.054-1.157.18-.25H3.28a.703.703 0 0 1-.703-.702V5.66c0-.389.315-.704.703-.704h11.25c.388 0 .703.315.703.704v2.484l.358-.497a2.492 2.492 0 0 1 1.048-.84V5.66a2.11 2.11 0 0 0-2.11-2.11H9.61v-.89Z"/><path d="M5.625 10.817c.518 0 .937-.63.937-1.407 0-.776-.42-1.406-.937-1.406-.518 0-.938.63-.938 1.406 0 .777.42 1.407.938 1.407Z"/><path d="M13.125 9.41c0 .777-.42 1.407-.938 1.407s-.937-.63-.937-1.407c0-.776.42-1.406.937-1.406.518 0 .938.63.938 1.406Z"/><path d="M.937 8.004A.937.937 0 0 0 0 8.942v1.875c0 .517.42.937.937.937v-3.75Z"/><path d="M6.128 12.51a.782.782 0 0 1 1.085.216c.272.408.907.707 1.693.707s1.421-.3 1.693-.707a.782.782 0 0 1 1.302.868c-.666 1-1.906 1.403-2.995 1.403-1.089 0-2.329-.404-2.995-1.403a.782.782 0 0 1 .217-1.085Z"/><path d="m16.987 8.91-.622.864 2.879 2.074.622-.864a.71.71 0 0 0-.161-.99l-1.728-1.245a.71.71 0 0 0-.99.161Z"/><path d="M11.635 19.951a.355.355 0 0 1-.449-.31l-.214-2.38 4.978-6.911 2.88 2.074-4.978 6.91-2.217.617Z"/></svg>