@ckeditor/ckeditor5-ai 40.0.0 → 40.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/LICENSE.md +2 -2
  2. package/build/ai.js +2 -2
  3. package/build/translations/af.js +1 -1
  4. package/build/translations/ar.js +1 -1
  5. package/build/translations/bg.js +1 -1
  6. package/build/translations/bn.js +1 -1
  7. package/build/translations/bs.js +1 -1
  8. package/build/translations/ca.js +1 -1
  9. package/build/translations/cs.js +1 -1
  10. package/build/translations/da.js +1 -1
  11. package/build/translations/de-ch.js +1 -1
  12. package/build/translations/de.js +1 -1
  13. package/build/translations/el.js +1 -1
  14. package/build/translations/en-au.js +1 -1
  15. package/build/translations/es-co.js +1 -1
  16. package/build/translations/es.js +1 -1
  17. package/build/translations/et.js +1 -1
  18. package/build/translations/fa.js +1 -1
  19. package/build/translations/fi.js +1 -1
  20. package/build/translations/fr.js +1 -1
  21. package/build/translations/gl.js +1 -1
  22. package/build/translations/he.js +1 -1
  23. package/build/translations/hi.js +1 -1
  24. package/build/translations/hr.js +1 -1
  25. package/build/translations/hu.js +1 -1
  26. package/build/translations/id.js +1 -1
  27. package/build/translations/it.js +1 -1
  28. package/build/translations/ja.js +1 -1
  29. package/build/translations/jv.js +1 -1
  30. package/build/translations/ko.js +1 -1
  31. package/build/translations/lt.js +1 -1
  32. package/build/translations/lv.js +1 -1
  33. package/build/translations/ms.js +1 -1
  34. package/build/translations/nl.js +1 -1
  35. package/build/translations/no.js +1 -1
  36. package/build/translations/pl.js +1 -1
  37. package/build/translations/pt-br.js +1 -1
  38. package/build/translations/pt.js +1 -1
  39. package/build/translations/ro.js +1 -1
  40. package/build/translations/ru.js +1 -1
  41. package/build/translations/sk.js +1 -1
  42. package/build/translations/sr-latn.js +1 -1
  43. package/build/translations/sr.js +1 -1
  44. package/build/translations/sv.js +1 -1
  45. package/build/translations/th.js +1 -1
  46. package/build/translations/tk.js +1 -1
  47. package/build/translations/tr.js +1 -1
  48. package/build/translations/ug.js +1 -1
  49. package/build/translations/uk.js +1 -1
  50. package/build/translations/ur.js +1 -1
  51. package/build/translations/uz.js +1 -0
  52. package/build/translations/vi.js +1 -1
  53. package/build/translations/zh-cn.js +1 -1
  54. package/build/translations/zh.js +1 -1
  55. package/lang/contexts.json +1 -0
  56. package/lang/translations/af.po +60 -16
  57. package/lang/translations/ar.po +60 -16
  58. package/lang/translations/bg.po +60 -16
  59. package/lang/translations/bn.po +60 -16
  60. package/lang/translations/bs.po +60 -16
  61. package/lang/translations/ca.po +60 -16
  62. package/lang/translations/cs.po +60 -16
  63. package/lang/translations/da.po +60 -16
  64. package/lang/translations/de-ch.po +60 -16
  65. package/lang/translations/de.po +60 -16
  66. package/lang/translations/el.po +60 -16
  67. package/lang/translations/en-au.po +60 -16
  68. package/lang/translations/en.po +60 -16
  69. package/lang/translations/es-co.po +60 -16
  70. package/lang/translations/es.po +60 -16
  71. package/lang/translations/et.po +60 -16
  72. package/lang/translations/fa.po +60 -16
  73. package/lang/translations/fi.po +60 -16
  74. package/lang/translations/fr.po +60 -16
  75. package/lang/translations/gl.po +60 -16
  76. package/lang/translations/he.po +60 -16
  77. package/lang/translations/hi.po +60 -16
  78. package/lang/translations/hr.po +93 -49
  79. package/lang/translations/hu.po +60 -16
  80. package/lang/translations/id.po +60 -16
  81. package/lang/translations/it.po +60 -16
  82. package/lang/translations/ja.po +60 -16
  83. package/lang/translations/jv.po +60 -16
  84. package/lang/translations/ko.po +60 -16
  85. package/lang/translations/lt.po +60 -16
  86. package/lang/translations/lv.po +60 -16
  87. package/lang/translations/ms.po +60 -16
  88. package/lang/translations/nl.po +60 -16
  89. package/lang/translations/no.po +60 -16
  90. package/lang/translations/pl.po +60 -16
  91. package/lang/translations/pt-br.po +60 -16
  92. package/lang/translations/pt.po +60 -16
  93. package/lang/translations/ro.po +60 -16
  94. package/lang/translations/ru.po +60 -16
  95. package/lang/translations/sk.po +60 -16
  96. package/lang/translations/sr-latn.po +60 -16
  97. package/lang/translations/sr.po +60 -16
  98. package/lang/translations/sv.po +60 -16
  99. package/lang/translations/th.po +60 -16
  100. package/lang/translations/tk.po +60 -16
  101. package/lang/translations/tr.po +60 -16
  102. package/lang/translations/ug.po +94 -50
  103. package/lang/translations/uk.po +60 -16
  104. package/lang/translations/ur.po +60 -16
  105. package/lang/translations/uz.po +226 -0
  106. package/lang/translations/vi.po +60 -16
  107. package/lang/translations/zh-cn.po +60 -16
  108. package/lang/translations/zh.po +60 -16
  109. package/package.json +3 -3
  110. package/src/aiassistant.d.ts +458 -419
  111. package/src/aiassistant.js +1 -1
  112. package/src/aiassistantediting.d.ts +45 -45
  113. package/src/aiassistantediting.js +1 -1
  114. package/src/aiassistantui.d.ts +44 -46
  115. package/src/aiassistantui.js +1 -1
  116. package/src/aiconnector.d.ts +45 -44
  117. package/src/aiconnector.js +1 -1
  118. package/src/augmentation.d.ts +26 -26
  119. package/src/index.d.ts +9 -9
  120. package/src/ui/aiassistantcontroller.d.ts +96 -59
  121. package/src/ui/aiassistantcontroller.js +1 -1
  122. package/src/ui/dropdown/aicommandslistview.d.ts +22 -22
  123. package/src/ui/dropdown/aicommandslistview.js +1 -1
  124. package/src/ui/dropdown/buttonlabelwithhighlightview.d.ts +29 -29
  125. package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
  126. package/src/ui/dropdown/labelwithhighlightview.d.ts +25 -0
  127. package/src/ui/dropdown/labelwithhighlightview.js +23 -0
  128. package/src/ui/form/aiformcontentarea.d.ts +48 -48
  129. package/src/ui/form/aiformcontentarea.js +1 -1
  130. package/src/ui/form/aiformerrorview.d.ts +26 -26
  131. package/src/ui/form/aiformerrorview.js +1 -1
  132. package/src/ui/form/aiformpromptview.d.ts +46 -46
  133. package/src/ui/form/aiformpromptview.js +1 -1
  134. package/src/ui/form/aiformtoolbarview.d.ts +54 -41
  135. package/src/ui/form/aiformtoolbarview.js +1 -1
  136. package/src/ui/form/aiformview.d.ts +142 -131
  137. package/src/ui/form/aiformview.js +1 -1
  138. package/src/ui/form/aihistorylistitemview.d.ts +18 -18
  139. package/src/ui/form/aihistorylistitemview.js +1 -1
  140. package/src/ui/form/aihistorylistview.d.ts +35 -35
  141. package/src/ui/form/aihistorylistview.js +1 -1
  142. package/src/ui/form/prompthistory.d.ts +20 -20
  143. package/src/ui/form/prompthistory.js +1 -1
  144. package/src/ui/showaiassistantcommand.d.ts +26 -26
  145. package/src/ui/showaiassistantcommand.js +1 -1
  146. package/src/utils/common-translations.d.ts +9 -9
  147. package/src/utils/common-translations.js +1 -1
  148. package/theme/ai-form.css +58 -11
  149. package/theme/ai.css +20 -15
@@ -1,18 +1,18 @@
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/aihistorylistitemview
7
- */
8
- import { ListItemView } from 'ckeditor5/src/ui';
9
- import type { PromptHistoryEntry } from './prompthistory';
10
- /**
11
- * A list item view that displays a historical prompt
12
- */
13
- export default class AIHistoryListItemView extends ListItemView {
14
- /**
15
- * @inheritDoc
16
- */
17
- constructor(promptHistoryEntry: PromptHistoryEntry);
18
- }
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/aihistorylistitemview
7
+ */
8
+ import { ListItemView } from 'ckeditor5/src/ui';
9
+ import type { PromptHistoryEntry } from './prompthistory';
10
+ /**
11
+ * A list item view that displays a historical prompt
12
+ */
13
+ export default class AIHistoryListItemView extends ListItemView {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ constructor(promptHistoryEntry: PromptHistoryEntry);
18
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2709=['add','execute','prompt','locale','set','children'];(function(_0x50495a,_0x270962){const _0x1982eb=function(_0x17f496){while(--_0x17f496){_0x50495a['push'](_0x50495a['shift']());}};_0x1982eb(++_0x270962);}(_0x2709,0x1b5));const _0x1982=function(_0x50495a,_0x270962){_0x50495a=_0x50495a-0x0;let _0x1982eb=_0x2709[_0x50495a];return _0x1982eb;};import{ListItemView as _0x35e25a,ButtonView as _0x8bc712}from'ckeditor5/src/ui';import _0x567cdb from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x502257}from'lodash-es';export default class et extends _0x35e25a{constructor(_0x21d01f){super();const _0x344282=new _0x567cdb(),_0x40844b=new _0x8bc712(this[_0x1982('0x4')],_0x344282);this[_0x1982('0x0')][_0x1982('0x1')](_0x40844b),_0x40844b[_0x1982('0x5')]({'label':_0x21d01f[_0x1982('0x3')],'withText':!0x0}),_0x40844b['on'](_0x1982('0x2'),()=>{this['fire'](_0x1982('0x2'),{'value':_0x502257(_0x21d01f['prompt'])});});}}
23
+ const _0x5889=['prompt','add','fire','execute'];(function(_0x24ebea,_0x5889f4){const _0x31fa98=function(_0x3b64dc){while(--_0x3b64dc){_0x24ebea['push'](_0x24ebea['shift']());}};_0x31fa98(++_0x5889f4);}(_0x5889,0xff));const _0x31fa=function(_0x24ebea,_0x5889f4){_0x24ebea=_0x24ebea-0x0;let _0x31fa98=_0x5889[_0x24ebea];return _0x31fa98;};import{ListItemView as _0x1a0eb7,ButtonView as _0x107702}from'ckeditor5/src/ui';import _0x2a6888 from'../dropdown/buttonlabelwithhighlightview';import{unescape as _0x47b238}from'lodash-es';export default class nt extends _0x1a0eb7{constructor(_0x1131a3){super();const _0x5d2606=new _0x2a6888(),_0x2a8095=new _0x107702(this['locale'],_0x5d2606);this['children'][_0x31fa('0x2')](_0x2a8095),_0x2a8095['set']({'label':_0x1131a3[_0x31fa('0x1')],'withText':!0x0}),_0x2a8095['on'](_0x31fa('0x0'),()=>{this[_0x31fa('0x3')](_0x31fa('0x0'),{'value':_0x47b238(_0x1131a3[_0x31fa('0x1')])});});}}
@@ -1,35 +1,35 @@
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/aihistorylistview
7
- */
8
- import { ListView, ListItemGroupView, ButtonView, type FilteredView } from 'ckeditor5/src/ui';
9
- import type { Locale } from 'ckeditor5/src/utils';
10
- /**
11
- * A list view that displays a list of AI prompts with filter pass-through.
12
- *
13
- * @private
14
- */
15
- export default class AIHistoryListView extends ListView implements FilteredView {
16
- historyGroupView: ListItemGroupView;
17
- clearHistoryButton: ButtonView;
18
- constructor(locale: Locale);
19
- /**
20
- * @inheritDoc
21
- */
22
- filter(): {
23
- resultsCount: number;
24
- totalItemsCount: number;
25
- };
26
- }
27
- /**
28
- * Fired when the clear history button was executed by the user.
29
- *
30
- * @eventName ~AIHistoryListView#clearHistory
31
- */
32
- export type AIHistoryListViewClearHistoryEvent = {
33
- name: 'clearHistory';
34
- args: [];
35
- };
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/aihistorylistview
7
+ */
8
+ import { ListView, ListItemGroupView, ButtonView, type FilteredView } from 'ckeditor5/src/ui';
9
+ import type { Locale } from 'ckeditor5/src/utils';
10
+ /**
11
+ * A list view that displays a list of AI prompts with filter pass-through.
12
+ *
13
+ * @private
14
+ */
15
+ export default class AIHistoryListView extends ListView implements FilteredView {
16
+ historyGroupView: ListItemGroupView;
17
+ clearHistoryButton: ButtonView;
18
+ constructor(locale: Locale);
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ filter(): {
23
+ resultsCount: number;
24
+ totalItemsCount: number;
25
+ };
26
+ }
27
+ /**
28
+ * Fired when the clear history button was executed by the user.
29
+ *
30
+ * @eventName ~AIHistoryListView#clearHistory
31
+ */
32
+ export type AIHistoryListViewClearHistoryEvent = {
33
+ name: 'clearHistory';
34
+ args: [];
35
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x1f85=['filter','locale','label','items','delegate','children','execute','fire','Clear','set','_createClearHistoryButton','historyGroupView','clearHistoryButton','Prompt\x20history','add','length','clearHistory'];(function(_0x15144d,_0x1f8511){const _0x4dcf81=function(_0x1effcf){while(--_0x1effcf){_0x15144d['push'](_0x15144d['shift']());}};_0x4dcf81(++_0x1f8511);}(_0x1f85,0xbc));const _0x4dcf=function(_0x15144d,_0x1f8511){_0x15144d=_0x15144d-0x0;let _0x4dcf81=_0x1f85[_0x15144d];return _0x4dcf81;};import{ListView as _0x3279da,ListItemGroupView as _0x6dc875,ButtonView as _0x58d7b3}from'ckeditor5/src/ui';import{getTranslation as _0x57f81d}from'../../utils/common-translations';export default class st extends _0x3279da{constructor(_0x4a65e3){super(_0x4a65e3),this[_0x4dcf('0xb')]=this[_0x4dcf('0x9')](),this[_0x4dcf('0xa')]=new _0x6dc875(),this[_0x4dcf('0xa')][_0x4dcf('0x4')][_0x4dcf('0xd')](this[_0x4dcf('0xb')],0x1),this[_0x4dcf('0xa')][_0x4dcf('0x1')]=_0x57f81d(_0x4a65e3,_0x4dcf('0xc')),this[_0x4dcf('0xa')]['items'][_0x4dcf('0x3')](_0x4dcf('0x5'))['to'](this),this[_0x4dcf('0x2')]['add'](this[_0x4dcf('0xa')]);}[_0x4dcf('0x10')](){let _0x305117=0x0;for(const _0x24cd1e of this[_0x4dcf('0x2')])_0x305117+=_0x24cd1e[_0x4dcf('0x2')][_0x4dcf('0xe')];return{'resultsCount':_0x305117,'totalItemsCount':_0x305117};}['_createClearHistoryButton'](){const _0x1aaf52=this[_0x4dcf('0x0')],_0x379f8c=new _0x58d7b3(this[_0x4dcf('0x0')]);return _0x379f8c[_0x4dcf('0x8')]({'label':'('+_0x57f81d(_0x1aaf52,_0x4dcf('0x7'))+')','withText':!0x0}),_0x379f8c['on'](_0x4dcf('0x5'),()=>this[_0x4dcf('0x6')](_0x4dcf('0xf'))),_0x379f8c;}}
23
+ const _0x433a=['Prompt\x20history','historyGroupView','delegate','clearHistoryButton','_createClearHistoryButton','length','filter','add','clearHistory','set','fire','locale','label','children','execute','items'];(function(_0x309933,_0x433a77){const _0x1114b9=function(_0x4687b4){while(--_0x4687b4){_0x309933['push'](_0x309933['shift']());}};_0x1114b9(++_0x433a77);}(_0x433a,0x130));const _0x1114=function(_0x309933,_0x433a77){_0x309933=_0x309933-0x0;let _0x1114b9=_0x433a[_0x309933];return _0x1114b9;};import{ListView as _0x39c127,ListItemGroupView as _0x355b6d,ButtonView as _0x3b2b3a}from'ckeditor5/src/ui';import{getTranslation as _0x2e3f47}from'../../utils/common-translations';export default class ot extends _0x39c127{constructor(_0x58fe50){super(_0x58fe50),this[_0x1114('0x3')]=this[_0x1114('0x4')](),this['historyGroupView']=new _0x355b6d(),this[_0x1114('0x1')][_0x1114('0xd')][_0x1114('0x7')](this[_0x1114('0x3')],0x1),this[_0x1114('0x1')][_0x1114('0xc')]=_0x2e3f47(_0x58fe50,_0x1114('0x0')),this['historyGroupView']['items'][_0x1114('0x2')](_0x1114('0xe'))['to'](this),this[_0x1114('0xf')][_0x1114('0x7')](this[_0x1114('0x1')]);}[_0x1114('0x6')](){let _0x222365=0x0;for(const _0x2102c2 of this[_0x1114('0xf')])_0x222365+=_0x2102c2[_0x1114('0xf')][_0x1114('0x5')];return{'resultsCount':_0x222365,'totalItemsCount':_0x222365};}[_0x1114('0x4')](){const _0x501d4a=this['locale'],_0x4c28d4=new _0x3b2b3a(this[_0x1114('0xb')]);return _0x4c28d4[_0x1114('0x9')]({'label':'('+_0x2e3f47(_0x501d4a,'Clear')+')','withText':!0x0}),_0x4c28d4['on']('execute',()=>this[_0x1114('0xa')](_0x1114('0x8'))),_0x4c28d4;}}
@@ -1,20 +1,20 @@
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
- import { Collection } from 'ckeditor5/src/utils';
6
- /**
7
- * A collection that stores the prompt history in the session storage as a side effect.
8
- */
9
- export default class PromptHistory extends Collection<PromptHistoryEntry> {
10
- /**
11
- * @inheritDoc
12
- */
13
- constructor();
14
- }
15
- /**
16
- * An object that represents a historical prompt.
17
- */
18
- export type PromptHistoryEntry = {
19
- prompt: string;
20
- };
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
+ import { Collection } from 'ckeditor5/src/utils';
6
+ /**
7
+ * A collection that stores the prompt history in the session storage as a side effect.
8
+ */
9
+ export default class PromptHistory extends Collection<PromptHistoryEntry> {
10
+ /**
11
+ * @inheritDoc
12
+ */
13
+ constructor();
14
+ }
15
+ /**
16
+ * An object that represents a historical prompt.
17
+ */
18
+ export type PromptHistoryEntry = {
19
+ prompt: string;
20
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x20eb=['CKEditor/AIFormView/PromptHistory','trim','prompt','getItem','setItem','parse','remove','last','addMany','_saveToSessionStorage','map','add','_loadFromSessionStorage'];(function(_0x515ea8,_0x20eb5c){const _0x575c3d=function(_0x324e74){while(--_0x324e74){_0x515ea8['push'](_0x515ea8['shift']());}};_0x575c3d(++_0x20eb5c);}(_0x20eb,0x1ba));const _0x575c=function(_0x515ea8,_0x20eb5c){_0x515ea8=_0x515ea8-0x0;let _0x575c3d=_0x20eb[_0x515ea8];return _0x575c3d;};import{Collection as _0x4e31d3}from'ckeditor5/src/utils';const ts=_0x575c('0x0');export default class rt extends _0x4e31d3{constructor(){super(),this[_0x575c('0xc')](),this['on'](_0x575c('0xb'),(_0x35ac10,_0x44a3ff)=>{const _0x839757=os(_0x44a3ff[_0x575c('0x2')]);for(const _0x216331 of this)if(_0x216331!=_0x44a3ff&&os(_0x216331[_0x575c('0x2')])===_0x839757){this['remove'](_0x216331);break;}this['length']>0x14&&this[_0x575c('0x6')](this[_0x575c('0x7')]),this[_0x575c('0x9')]();}),this['on']('remove',()=>{this[_0x575c('0x9')]();});}[_0x575c('0xc')](){const _0x4d4bcf=sessionStorage[_0x575c('0x3')](ts)||'[]';this[_0x575c('0x8')](JSON[_0x575c('0x5')](_0x4d4bcf));}['_saveToSessionStorage'](){sessionStorage[_0x575c('0x4')](ts,JSON['stringify'](this[_0x575c('0xa')](_0x5eb5c9=>_0x5eb5c9)));}}function os(_0x322da0){return _0x322da0['toLowerCase']()[_0x575c('0x1')]();}
23
+ const _0x1087=['length','map','addMany','last','stringify','setItem','getItem','CKEditor/AIFormView/PromptHistory','add','_saveToSessionStorage','parse','_loadFromSessionStorage','trim','remove','toLowerCase','prompt'];(function(_0x4a0ac9,_0x108718){const _0x359b4f=function(_0x12d1a4){while(--_0x12d1a4){_0x4a0ac9['push'](_0x4a0ac9['shift']());}};_0x359b4f(++_0x108718);}(_0x1087,0x19b));const _0x359b=function(_0x4a0ac9,_0x108718){_0x4a0ac9=_0x4a0ac9-0x0;let _0x359b4f=_0x1087[_0x4a0ac9];return _0x359b4f;};import{Collection as _0x1aa872}from'ckeditor5/src/utils';const ts=_0x359b('0xc');export default class at extends _0x1aa872{constructor(){super(),this[_0x359b('0x0')](),this['on'](_0x359b('0xd'),(_0x5d4b5e,_0x4de006)=>{const _0x223fa9=os(_0x4de006['prompt']);for(const _0xf48b6d of this)if(_0xf48b6d!=_0x4de006&&os(_0xf48b6d[_0x359b('0x4')])===_0x223fa9){this[_0x359b('0x2')](_0xf48b6d);break;}this[_0x359b('0x5')]>0x14&&this[_0x359b('0x2')](this[_0x359b('0x8')]),this[_0x359b('0xe')]();}),this['on'](_0x359b('0x2'),()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2b47b4=sessionStorage[_0x359b('0xb')](ts)||'[]';this[_0x359b('0x7')](JSON[_0x359b('0xf')](_0x2b47b4));}[_0x359b('0xe')](){sessionStorage[_0x359b('0xa')](ts,JSON[_0x359b('0x9')](this[_0x359b('0x6')](_0x4d35f6=>_0x4d35f6)));}}function os(_0x10acf3){return _0x10acf3[_0x359b('0x3')]()[_0x359b('0x1')]();}
@@ -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/showaiassistantcommand
7
- * @publicApi
8
- */
9
- import { Command } from 'ckeditor5/src/core';
10
- /**
11
- * Command that shows the AI Assistant user interface.
12
- */
13
- export default class ShowAIAssistantCommand extends Command {
14
- /**
15
- * @inheritDoc
16
- */
17
- refresh(): void;
18
- /**
19
- * Opens AI Assistant user interface for the current document selection.
20
- *
21
- * @param prompt The initial prompt. If set, the AI assistant will automatically submit given prompt to the AI service.
22
- * @param label Label to be displayed in the AI assistant query input field while the AI assistant processes the initial prompt.
23
- * @fires execute
24
- */
25
- execute(prompt?: string, label?: string): void;
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/showaiassistantcommand
7
+ * @publicApi
8
+ */
9
+ import { Command } from 'ckeditor5/src/core';
10
+ /**
11
+ * Command that shows the AI Assistant user interface.
12
+ */
13
+ export default class ShowAIAssistantCommand extends Command {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ refresh(): void;
18
+ /**
19
+ * Opens AI Assistant user interface for the current document selection.
20
+ *
21
+ * @param prompt The initial prompt. If set, the AI assistant will automatically submit given prompt to the AI service.
22
+ * @param label Label to be displayed in the AI assistant query input field while the AI assistant processes the initial prompt.
23
+ * @fires execute
24
+ */
25
+ execute(prompt?: string, label?: string): void;
26
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5be9=['selection','execute','isEnabled','getRanges','plugins','editor','get','getItems','name','model','includes','showUI','element','refresh'];(function(_0x3b8c6f,_0x5be972){const _0x4ae474=function(_0x1c8ab8){while(--_0x1c8ab8){_0x3b8c6f['push'](_0x3b8c6f['shift']());}};_0x4ae474(++_0x5be972);}(_0x5be9,0x15e));const _0x4ae4=function(_0x3b8c6f,_0x5be972){_0x3b8c6f=_0x3b8c6f-0x0;let _0x4ae474=_0x5be9[_0x3b8c6f];return _0x4ae474;};import{Command as _0x5696cd}from'ckeditor5/src/core';import _0x4baeb8 from'../aiassistantui';export default class A extends _0x5696cd{[_0x4ae4('0xd')](){const _0x3f2962=this['editor'][_0x4ae4('0x9')]['document'][_0x4ae4('0x0')],_0x19b897=this['editor']['config'][_0x4ae4('0x6')]('aiAssistant.disabledElements');for(const _0x1a2185 of _0x3f2962[_0x4ae4('0x3')]())for(const _0x409131 of _0x1a2185[_0x4ae4('0x7')]())if(_0x409131['is'](_0x4ae4('0xc'))&&_0x19b897[_0x4ae4('0xa')](_0x409131[_0x4ae4('0x8')]))return void(this[_0x4ae4('0x2')]=!0x1);this[_0x4ae4('0x2')]=!0x0;}[_0x4ae4('0x1')](_0x219880='',_0x2e174e=''){this[_0x4ae4('0x5')][_0x4ae4('0x4')][_0x4ae4('0x6')](_0x4baeb8)[_0x4ae4('0xb')](_0x219880,_0x2e174e,this['editor'][_0x4ae4('0x9')]['document']['selection']);}}
23
+ const _0x2af0=['aiAssistant.disabledElements','config','document','includes','selection','showUI','element','model','refresh','isEnabled','editor','plugins','get','name'];(function(_0x3c511d,_0x2af0a6){const _0x317296=function(_0x397cac){while(--_0x397cac){_0x3c511d['push'](_0x3c511d['shift']());}};_0x317296(++_0x2af0a6);}(_0x2af0,0x161));const _0x3172=function(_0x3c511d,_0x2af0a6){_0x3c511d=_0x3c511d-0x0;let _0x317296=_0x2af0[_0x3c511d];return _0x317296;};import{Command as _0x20ea57}from'ckeditor5/src/core';import _0x2a1a3d from'../aiassistantui';export default class I extends _0x20ea57{[_0x3172('0x5')](){const _0x3e53d4=this['editor'][_0x3172('0x4')][_0x3172('0xd')][_0x3172('0x1')],_0x544306=this[_0x3172('0x7')][_0x3172('0xc')][_0x3172('0x9')](_0x3172('0xb'));for(const _0x1db871 of _0x3e53d4['getRanges']())for(const _0x37c4be of _0x1db871['getItems']())if(_0x37c4be['is'](_0x3172('0x3'))&&_0x544306[_0x3172('0x0')](_0x37c4be[_0x3172('0xa')]))return void(this['isEnabled']=!0x1);this[_0x3172('0x6')]=!0x0;}['execute'](_0xfb3456='',_0x3c0a25=''){this[_0x3172('0x7')][_0x3172('0x8')][_0x3172('0x9')](_0x2a1a3d)[_0x3172('0x2')](_0xfb3456,_0x3c0a25);}}
@@ -1,9 +1,9 @@
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/utils/common-translations
7
- */
8
- import type { Locale } from 'ckeditor5/src/utils';
9
- export declare function getTranslation(locale: Locale, id: string, values?: string | Array<string> | number): string;
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/utils/common-translations
7
+ */
8
+ import type { Locale } from 'ckeditor5/src/utils';
9
+ export declare function getTranslation(locale: Locale, id: string, values?: string | Array<string> | number): string;
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export function getTranslation(_0x3d8e36,_0x3cb3a2,_0x5fe0cd){const t=_0x3d8e36['t'];switch(_0x3cb3a2){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',_0x5fe0cd);case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Search\x20AI\x20command':return t('Search\x20AI\x20command');case'No\x20commands\x20found':return t('No\x20commands\x20found');case'No\x20commands\x20available':return t('No\x20commands\x20available');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_ERROR_AUTH_REQUEST':return t({'id':'AI_ERROR_AUTH_REQUEST','string':'Authorization\x20request\x20failed'});case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return'';}}
23
+ export function getTranslation(_0x2e53a6,_0x3aee86,_0x52ed40){const t=_0x2e53a6['t'];switch(_0x3aee86){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',_0x52ed40);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_AUTH_REQUEST':return t({'id':'AI_ERROR_AUTH_REQUEST','string':'Authorization\x20request\x20failed'});case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x3aee86;}}
package/theme/ai-form.css CHANGED
@@ -16,8 +16,7 @@
16
16
  --ck-ai-form-content-background: hsl(0, 0%, 98%);
17
17
  --ck-ai-form-history-font-size: .9em;
18
18
 
19
- /* TODO: Move this color to CKE5 */
20
- --ck-ai-form-error-background: hsl(0, 100%, 90%);
19
+ --ck-ai-form-error-background: var(--ck-color-light-red);
21
20
  }
22
21
 
23
22
  /* Note: This class name is mentioned in the guide and acts like a public API. */
@@ -64,10 +63,17 @@
64
63
  width: 100%;
65
64
  white-space: normal;
66
65
  padding: var(--ck-spacing-tiny) var(--ck-spacing-medium);
67
- padding-right: 0;
68
66
  min-height: calc( var(--ck-line-height-base) * var(--ck-font-size-base) );
69
67
  box-sizing: content-box;
70
68
 
69
+ @mixin ck-dir ltr {
70
+ padding-right: 0;
71
+ }
72
+
73
+ @mixin ck-dir rtl {
74
+ padding-left: 0;
75
+ }
76
+
71
77
  & > * {
72
78
  white-space: normal;
73
79
  color: inherit;
@@ -75,7 +81,14 @@
75
81
  }
76
82
 
77
83
  & .ck-spinner-container {
78
- margin-right: var(--ck-spacing-medium);
84
+ @mixin ck-dir ltr {
85
+ margin-right: var(--ck-spacing-medium);
86
+ }
87
+
88
+ @mixin ck-dir rtl {
89
+ margin-left: var(--ck-spacing-medium);
90
+ }
91
+
79
92
  }
80
93
 
81
94
  & .ck-ai-form__copy-button-wrapper {
@@ -126,14 +139,36 @@
126
139
  flex-grow: 1;
127
140
  }
128
141
 
129
- & > .ck.ck-button {
130
- margin-left: var(--ck-spacing-medium);
142
+ & > .ck.ck-ai-form__submit {
143
+ @mixin ck-dir ltr {
144
+ margin-left: var(--ck-spacing-medium);
145
+ }
146
+
147
+ @mixin ck-dir rtl {
148
+ margin-right: var(--ck-spacing-medium);
149
+ }
150
+
151
+ border-color: var(--ck-ai-form-submit-button-border-color);
152
+ color: var(--ck-ai-form-submit-button-text-color);
153
+
154
+ &.ck-disabled {
155
+ border-color: var(--ck-ai-form-submit-button-disabled-border-color);
156
+ }
131
157
  }
132
158
 
133
- & > .ck-labeled-field-view .ck-button {
159
+ /* Toggle history button */
160
+ & > .ck-labeled-field-view .ck-ai-form__toggle-history {
134
161
  position: absolute;
135
162
  font-size: var(--ck-font-size-tiny);
136
- right: var(--ck-spacing-medium);
163
+
164
+ @mixin ck-dir ltr {
165
+ right: var(--ck-spacing-medium);
166
+ }
167
+
168
+ @mixin ck-dir rtl {
169
+ left: var(--ck-spacing-medium);
170
+ }
171
+
137
172
  bottom: var(--ck-spacing-small);
138
173
  top: var(--ck-spacing-small);
139
174
  padding: 4px;
@@ -142,7 +177,14 @@
142
177
  }
143
178
 
144
179
  & .ck-textarea {
145
- padding-right: 30px;
180
+ /* Give the toggle history button some space */
181
+ @mixin ck-dir ltr {
182
+ padding-right: 30px;
183
+ }
184
+
185
+ @mixin ck-dir rtl {
186
+ padding-left: 30px;
187
+ }
146
188
  }
147
189
 
148
190
  /* Prompt history group */
@@ -166,9 +208,14 @@
166
208
  font-size: var(--ck-ai-form-history-font-size);
167
209
  justify-self: start;
168
210
  background: none;
211
+ margin: var(--ck-spacing-medium) 0 0;
212
+
213
+ & .ck-button__label {
214
+ line-height: inherit;
169
215
 
170
- &:hover .ck-button__label {
171
- text-decoration: underline;
216
+ &:hover {
217
+ text-decoration: underline;
218
+ }
172
219
  }
173
220
  }
174
221
 
package/theme/ai.css CHANGED
@@ -10,7 +10,15 @@
10
10
  /*
11
11
  * These definitions bring violet accents (tint) across the AI UI.
12
12
  */
13
- .ck-ai-assistant-ui {
13
+ :root {
14
+ --ck-ai-form-submit-button-text-color: var(--ck-color-text);
15
+ --ck-ai-form-submit-button-border-color: transparent;
16
+ --ck-ai-form-submit-button-disabled-border-color: transparent;
17
+ --ck-ai-toolbar-button-hover-color: var(--ck-color-text);
18
+ }
19
+
20
+ /* Note: This class name is mentioned in the guide and acts like a public API. */
21
+ .ck-ai-assistant-ui_theme {
14
22
  --ck-color-button-default-hover-background: hsl(262.1,100%,96.3%);
15
23
  --ck-color-button-default-active-background: hsl(262.1,100%,96.3%);
16
24
 
@@ -28,22 +36,19 @@
28
36
  --ck-color-list-button-hover-background: hsl(262.1,100%,96.3%);
29
37
 
30
38
  --ck-ai-form-content-background: hsl(0,0%,97.6%);
31
-
32
- & .ck-ai-form__submit {
33
- border-color: var(--ck-color-button-action-background);
34
- color: var(--ck-color-button-action-background);
35
-
36
- &.ck-disabled {
37
- border-color: var(--ck-color-button-action-disabled-background);
38
- }
39
- }
40
-
41
- &.ck-ai-commands-dropdown > .ck-button:hover,
42
- &.ck-ai-assistant-button:hover {
43
- color: var(--ck-color-button-on-color);
44
- }
39
+ --ck-ai-form-submit-button-text-color: var(--ck-color-button-on-color);
40
+ --ck-ai-form-submit-button-border-color: var(--ck-color-button-action-background);
41
+ --ck-ai-form-submit-button-disabled-border-color: var(--ck-color-button-action-disabled-background);
42
+ --ck-ai-toolbar-button-hover-color: var(--ck-color-button-on-color);
45
43
  }
46
44
 
45
+ /*
46
+ * Apply the theme colors for specific elements.
47
+ */
48
+ .ck-ai-commands-dropdown > .ck-button:hover,
49
+ .ck-ai-assistant-button:hover {
50
+ color: var(--ck-ai-toolbar-button-hover-color);
51
+ }
47
52
 
48
53
  /*
49
54
  * Classes used by the "fake visual selection" displayed in the content when an input