@ckeditor/ckeditor5-ai 40.0.0 → 40.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +1 -1
  3. package/build/ai.js +77 -2
  4. package/build/translations/af.js +1 -1
  5. package/build/translations/ar.js +1 -1
  6. package/build/translations/bg.js +1 -1
  7. package/build/translations/bn.js +1 -1
  8. package/build/translations/bs.js +1 -1
  9. package/build/translations/ca.js +1 -1
  10. package/build/translations/cs.js +1 -1
  11. package/build/translations/da.js +1 -1
  12. package/build/translations/de-ch.js +1 -1
  13. package/build/translations/de.js +1 -1
  14. package/build/translations/el.js +1 -1
  15. package/build/translations/en-au.js +1 -1
  16. package/build/translations/es-co.js +1 -1
  17. package/build/translations/es.js +1 -1
  18. package/build/translations/et.js +1 -1
  19. package/build/translations/fa.js +1 -1
  20. package/build/translations/fi.js +1 -1
  21. package/build/translations/fr.js +1 -1
  22. package/build/translations/gl.js +1 -1
  23. package/build/translations/he.js +1 -1
  24. package/build/translations/hi.js +1 -1
  25. package/build/translations/hr.js +1 -1
  26. package/build/translations/hu.js +1 -1
  27. package/build/translations/id.js +1 -1
  28. package/build/translations/it.js +1 -1
  29. package/build/translations/ja.js +1 -1
  30. package/build/translations/jv.js +1 -1
  31. package/build/translations/ko.js +1 -1
  32. package/build/translations/lt.js +1 -1
  33. package/build/translations/lv.js +1 -1
  34. package/build/translations/ms.js +1 -1
  35. package/build/translations/nl.js +1 -1
  36. package/build/translations/no.js +1 -1
  37. package/build/translations/pl.js +1 -1
  38. package/build/translations/pt-br.js +1 -1
  39. package/build/translations/pt.js +1 -1
  40. package/build/translations/ro.js +1 -1
  41. package/build/translations/ru.js +1 -1
  42. package/build/translations/sk.js +1 -1
  43. package/build/translations/sr-latn.js +1 -1
  44. package/build/translations/sr.js +1 -1
  45. package/build/translations/sv.js +1 -1
  46. package/build/translations/th.js +1 -1
  47. package/build/translations/tk.js +1 -1
  48. package/build/translations/tr.js +1 -1
  49. package/build/translations/ug.js +1 -1
  50. package/build/translations/uk.js +1 -1
  51. package/build/translations/ur.js +1 -1
  52. package/build/translations/uz.js +1 -0
  53. package/build/translations/vi.js +1 -1
  54. package/build/translations/zh-cn.js +1 -1
  55. package/build/translations/zh.js +1 -1
  56. package/ckeditor5-metadata.json +1 -1
  57. package/lang/contexts.json +4 -1
  58. package/lang/translations/af.po +60 -16
  59. package/lang/translations/ar.po +60 -16
  60. package/lang/translations/bg.po +60 -16
  61. package/lang/translations/bn.po +60 -16
  62. package/lang/translations/bs.po +60 -16
  63. package/lang/translations/ca.po +60 -16
  64. package/lang/translations/cs.po +60 -16
  65. package/lang/translations/da.po +60 -16
  66. package/lang/translations/de-ch.po +60 -16
  67. package/lang/translations/de.po +60 -16
  68. package/lang/translations/el.po +60 -16
  69. package/lang/translations/en-au.po +60 -16
  70. package/lang/translations/en.po +60 -16
  71. package/lang/translations/es-co.po +60 -16
  72. package/lang/translations/es.po +60 -16
  73. package/lang/translations/et.po +60 -16
  74. package/lang/translations/fa.po +60 -16
  75. package/lang/translations/fi.po +60 -16
  76. package/lang/translations/fr.po +60 -16
  77. package/lang/translations/gl.po +95 -51
  78. package/lang/translations/he.po +60 -16
  79. package/lang/translations/hi.po +60 -16
  80. package/lang/translations/hr.po +93 -49
  81. package/lang/translations/hu.po +60 -16
  82. package/lang/translations/id.po +60 -16
  83. package/lang/translations/it.po +60 -16
  84. package/lang/translations/ja.po +60 -16
  85. package/lang/translations/jv.po +60 -16
  86. package/lang/translations/ko.po +60 -16
  87. package/lang/translations/lt.po +60 -16
  88. package/lang/translations/lv.po +60 -16
  89. package/lang/translations/ms.po +60 -16
  90. package/lang/translations/nl.po +60 -16
  91. package/lang/translations/no.po +60 -16
  92. package/lang/translations/pl.po +60 -16
  93. package/lang/translations/pt-br.po +60 -16
  94. package/lang/translations/pt.po +60 -16
  95. package/lang/translations/ro.po +60 -16
  96. package/lang/translations/ru.po +60 -16
  97. package/lang/translations/sk.po +60 -16
  98. package/lang/translations/sr-latn.po +95 -51
  99. package/lang/translations/sr.po +60 -16
  100. package/lang/translations/sv.po +60 -16
  101. package/lang/translations/th.po +60 -16
  102. package/lang/translations/tk.po +60 -16
  103. package/lang/translations/tr.po +60 -16
  104. package/lang/translations/ug.po +96 -52
  105. package/lang/translations/uk.po +60 -16
  106. package/lang/translations/ur.po +60 -16
  107. package/lang/translations/uz.po +226 -0
  108. package/lang/translations/vi.po +60 -16
  109. package/lang/translations/zh-cn.po +60 -16
  110. package/lang/translations/zh.po +60 -16
  111. package/package.json +4 -3
  112. package/src/adapters/aiadapter.d.ts +48 -0
  113. package/src/adapters/aiadapter.js +23 -0
  114. package/src/adapters/aitextadapter.d.ts +146 -0
  115. package/src/adapters/aitextadapter.js +23 -0
  116. package/src/adapters/awstextadapter.d.ts +178 -0
  117. package/src/adapters/awstextadapter.js +23 -0
  118. package/src/adapters/openaitextadapter.d.ts +181 -0
  119. package/src/adapters/openaitextadapter.js +23 -0
  120. package/src/aiassistant.d.ts +386 -419
  121. package/src/aiassistant.js +1 -1
  122. package/src/aiassistantediting.d.ts +45 -45
  123. package/src/aiassistantediting.js +1 -1
  124. package/src/aiassistantui.d.ts +52 -46
  125. package/src/aiassistantui.js +1 -1
  126. package/src/aiconfig.d.ts +69 -0
  127. package/src/aiconfig.js +23 -0
  128. package/src/augmentation.d.ts +27 -26
  129. package/src/index.d.ts +13 -9
  130. package/src/index.js +1 -1
  131. package/src/ui/aiassistantcontroller.d.ts +109 -59
  132. package/src/ui/aiassistantcontroller.js +1 -1
  133. package/src/ui/dropdown/aicommandslistview.d.ts +22 -22
  134. package/src/ui/dropdown/aicommandslistview.js +1 -1
  135. package/src/ui/dropdown/buttonlabelwithhighlightview.d.ts +29 -29
  136. package/src/ui/dropdown/buttonlabelwithhighlightview.js +1 -1
  137. package/src/ui/dropdown/labelwithhighlightview.d.ts +25 -0
  138. package/src/ui/dropdown/labelwithhighlightview.js +23 -0
  139. package/src/ui/form/aiformcontentarea.d.ts +48 -48
  140. package/src/ui/form/aiformcontentarea.js +1 -1
  141. package/src/ui/form/aiformerrorview.d.ts +26 -26
  142. package/src/ui/form/aiformerrorview.js +1 -1
  143. package/src/ui/form/aiformpromptview.d.ts +46 -46
  144. package/src/ui/form/aiformpromptview.js +1 -1
  145. package/src/ui/form/aiformtoolbarview.d.ts +54 -41
  146. package/src/ui/form/aiformtoolbarview.js +1 -1
  147. package/src/ui/form/aiformview.d.ts +142 -131
  148. package/src/ui/form/aiformview.js +1 -1
  149. package/src/ui/form/aihistorylistitemview.d.ts +18 -18
  150. package/src/ui/form/aihistorylistitemview.js +1 -1
  151. package/src/ui/form/aihistorylistview.d.ts +35 -35
  152. package/src/ui/form/aihistorylistview.js +1 -1
  153. package/src/ui/form/prompthistory.d.ts +20 -20
  154. package/src/ui/form/prompthistory.js +1 -1
  155. package/src/ui/showaiassistantcommand.d.ts +29 -26
  156. package/src/ui/showaiassistantcommand.js +1 -1
  157. package/src/utils/common-translations.d.ts +9 -9
  158. package/src/utils/common-translations.js +1 -1
  159. package/theme/ai-form.css +58 -11
  160. package/theme/ai.css +20 -15
  161. package/src/aiconnector.d.ts +0 -44
  162. package/src/aiconnector.js +0 -23
@@ -1,59 +1,109 @@
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 { type default as AIConnector } from '../aiconnector';
6
- import type { default as AIFormView } from './form/aiformview';
7
- declare const AIAssistantController_base: {
8
- new (): import("ckeditor5/src/utils").Observable;
9
- prototype: import("ckeditor5/src/utils").Observable;
10
- };
11
- /**
12
- * Controller for the AI assistant.
13
- *
14
- * It takes a AI balloon view, listens to events fired by that view and based on them performs actions on an AI handler.
15
- * This controller is also responsible for streaming the AI response for the UI.
16
- */
17
- export default class AIAssistantController extends AIAssistantController_base {
18
- /**
19
- * An instance of the {@link module:ai/aiconnector~AIConnector}.
20
- */
21
- readonly connector: AIConnector;
22
- /**
23
- * An instance of the {@link module:ai/ui/aiformview~AIFormView}.
24
- */
25
- readonly view: AIFormView;
26
- /**
27
- * The previous value of the user prompt. It is kept to handle the try again event.
28
- *
29
- * @observable
30
- */
31
- previousPrompt?: string;
32
- /**
33
- * The previous value of the context for the AI request. It is kept to handle the try again event.
34
- *
35
- * Initially it is the selected HTML content from the editor. Subsequently,
36
- * the context is replaced by each response from AI.
37
- *
38
- * @observable
39
- */
40
- previousContext?: string;
41
- /**
42
- * Flag that indicates if the processing is in progress.
43
- *
44
- * @observable
45
- */
46
- isProcessing: boolean;
47
- /**
48
- * @param connector AI connector instance.
49
- * @param view AI form view.
50
- * @param htmlContent The selected HTML content on which the AI should base.
51
- * @param prompt The initial prompt that causes the processing to start.
52
- */
53
- constructor(connector: AIConnector, view: AIFormView, htmlContent: string, prompt?: string);
54
- /**
55
- * Destroys `AIAssistantController` instance.
56
- */
57
- destroy(): void;
58
- }
59
- export {};
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 type AITextAdapter from '../adapters/aitextadapter';
6
+ import type { default as AIFormView } from './form/aiformview';
7
+ import type { AIFormToolbarViewMainActionLabel } from './form/aiformtoolbarview';
8
+ import type { Editor } from 'ckeditor5/src/core';
9
+ declare const AIAssistantController_base: {
10
+ new (): import("ckeditor5/src/utils").Observable;
11
+ prototype: import("ckeditor5/src/utils").Observable;
12
+ };
13
+ /**
14
+ * Controller for the AI assistant.
15
+ *
16
+ * It takes the AI balloon view, listens to events fired by that view and based on them performs actions on an AI handler.
17
+ * This controller is also responsible for streaming the AI response for the UI.
18
+ */
19
+ export default class AIAssistantController extends AIAssistantController_base {
20
+ /**
21
+ * The editor instance.
22
+ */
23
+ readonly editor: Editor;
24
+ /**
25
+ * An instance of the {@link module:ai/adapters/aitextadapter~AITextAdapter}.
26
+ */
27
+ readonly textAdapter: AITextAdapter;
28
+ /**
29
+ * An instance of the {@link module:ai/ui/aiformview~AIFormView}.
30
+ */
31
+ readonly view: AIFormView;
32
+ /**
33
+ * It is the selected HTML content from the editor on which the balloon has been initialized.
34
+ */
35
+ initialContext: string;
36
+ /**
37
+ * The latest value returned by the AI while executing the request. It is before parsing and normalization.
38
+ */
39
+ currentResponse: string;
40
+ /**
41
+ * The latest value returned by the AI while executing the request. It is after parsing and normalization. It will be used as context
42
+ * for the next calls.
43
+ *
44
+ * This value is also displayed in the view.
45
+ */
46
+ currentContext: string;
47
+ /**
48
+ * The previous value of the context for the AI request. It is kept to handle the try again event.
49
+ *
50
+ * Initially it is the selected HTML content from the editor. Subsequently, the context is replaced by each response from AI.
51
+ *
52
+ * @observable
53
+ */
54
+ previousContext?: string;
55
+ /**
56
+ * The previous value of the user query. It is kept to handle the try again event.
57
+ *
58
+ * @observable
59
+ */
60
+ previousQuery?: string;
61
+ /**
62
+ * The label of the previous executed query. It is connected to {@link ~AIAssistantController#previousQuery `previousQuery`} and is kept
63
+ * to handle the "try again" event.
64
+ *
65
+ * @observable
66
+ */
67
+ previousLabel?: string;
68
+ /**
69
+ * The id of the previous executed action. It is kept to handle the try again event.
70
+ *
71
+ * @observable
72
+ */
73
+ previousActionId?: string;
74
+ /**
75
+ * Flag that indicates if the processing is in progress.
76
+ *
77
+ * @observable
78
+ */
79
+ isProcessing: boolean;
80
+ /**
81
+ * @param adapter AI connector instance.
82
+ * @param view AI form view.
83
+ */
84
+ constructor(editor: Editor, adapter: AITextAdapter, view: AIFormView);
85
+ /**
86
+ * Destroys `AIAssistantController` instance.
87
+ */
88
+ destroy(): void;
89
+ /**
90
+ * Handles the initial query for a new context and inits the listener for the visible view.
91
+ *
92
+ * This function should be called whenever the AI balloon is displayed.
93
+ *
94
+ * @param options
95
+ * @param options.actionId ID of the performed action. See {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId}.
96
+ * @param options.htmlContent The selected HTML content on which the AI should base.
97
+ * @param options.query The initial query to be processed.
98
+ * @param options.label The label that will be displayed in the view.
99
+ * @param options.mainActionLabel The action label for the main insertion button.
100
+ */
101
+ updateView({ actionId, query, htmlContent, label, mainActionLabel }: {
102
+ actionId: string;
103
+ query: string;
104
+ htmlContent: string;
105
+ label: string;
106
+ mainActionLabel: AIFormToolbarViewMainActionLabel;
107
+ }): Promise<void>;
108
+ }
109
+ export {};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2ef6=['connector','isProcessing','previousPrompt','stopProcessing','view','previousContext','_handlePrompt','startProcessing','_updateValue','finishProcessing','abort','stopListening','finally','submitPrompt','handleError','once','set','render','destroy','listenTo','catch'];(function(_0x4557ac,_0x2ef671){const _0x476276=function(_0x57a67c){while(--_0x57a67c){_0x4557ac['push'](_0x4557ac['shift']());}};_0x476276(++_0x2ef671);}(_0x2ef6,0x187));const _0x4762=function(_0x4557ac,_0x2ef671){_0x4557ac=_0x4557ac-0x0;let _0x476276=_0x2ef6[_0x4557ac];return _0x476276;};import{ObservableMixin as _0x3191af}from'ckeditor5/src/utils';import{AIRequestError as _0x20abd1}from'../aiconnector';export default class I extends _0x3191af(){constructor(_0x5a4b3e,_0x3187f8,_0x589562,_0x4bab65){super(),this['connector']=_0x5a4b3e,this['view']=_0x3187f8,this[_0x4762('0x3')]({'previousPrompt':void 0x0,'previousContext':void 0x0,'isProcessing':!0x1}),_0x4bab65&&this[_0x4762('0xc')][_0x4762('0x2')](_0x4762('0x4'),()=>{this[_0x4762('0xe')](_0x4bab65,_0x589562);}),this[_0x4762('0x6')](this[_0x4762('0xc')],_0x4762('0x0'),(_0x29a4aa,_0x3c6b48)=>{const _0x27f6aa=this['view']['value']||_0x589562;this[_0x4762('0xe')](_0x3c6b48,_0x27f6aa);}),this[_0x4762('0x6')](this['view'],'tryAgainEvent',()=>{this[_0x4762('0xe')](this[_0x4762('0xa')],this[_0x4762('0xd')]);}),this['listenTo'](this[_0x4762('0xc')],_0x4762('0xb'),()=>{this[_0x4762('0x9')]=!0x1,this[_0x4762('0x8')][_0x4762('0x12')](),this[_0x4762('0xc')]['finishProcessing']();});}[_0x4762('0x5')](){this[_0x4762('0x13')]();}async['_handlePrompt'](_0xcf87cb,_0x3537d4){return this[_0x4762('0x9')]=!0x0,this[_0x4762('0xc')][_0x4762('0xf')](),this[_0x4762('0xa')]=_0xcf87cb,this[_0x4762('0xd')]=_0x3537d4,new Promise(_0x56d5ce=>{this[_0x4762('0x8')]['processPrompt'](_0xcf87cb,_0x3537d4,_0x306969=>this[_0x4762('0x10')](_0x306969))[_0x4762('0x7')](_0x812213=>{_0x812213 instanceof _0x20abd1?this[_0x4762('0xc')]['handleError'](_0x812213['message']):this[_0x4762('0xc')][_0x4762('0x1')](),_0x56d5ce();})[_0x4762('0x14')](()=>{this[_0x4762('0x9')]=!0x1,this[_0x4762('0xc')][_0x4762('0x11')](),_0x56d5ce();});});}[_0x4762('0x10')](_0x22deb2){this[_0x4762('0xc')]['value']=''+_0x22deb2;}}
23
+ const _0x5c73=['startProcessing','_normalizeResponseHeadings','isProcessing','textAdapter','rename','bind','push','domConverter','text/html','_xmlSerializer','currentContext','_domParser','_parseAndNormalizeContent','substring','isRendered','stopProcessing','handleError','previousQuery','updateView','stringify','editing','listenTo','length','childNodes','body','previousLabel','_handleQuery','processor','prompt','reset','makeRequest','element','finally','match','custom','_sanitizationContainer','toModel','tryAgainEvent','set','mainAction','finishProcessing','currentResponse','remove','innerHTML','exec','createElement','view','previousActionId','destroy','abort','editor','initialContext','data','previousContext','parseFromString','serializeToString','document','ELEMENT_NODE','div','nodeType','then','_sanitizeHTML'];(function(_0x44a658,_0x5c73f0){const _0x1d1e24=function(_0x4b3aae){while(--_0x4b3aae){_0x44a658['push'](_0x44a658['shift']());}};_0x1d1e24(++_0x5c73f0);}(_0x5c73,0x184));const _0x1d1e=function(_0x44a658,_0x5c73f0){_0x44a658=_0x44a658-0x0;let _0x1d1e24=_0x5c73[_0x44a658];return _0x1d1e24;};import{ObservableMixin as _0x504da8}from'ckeditor5/src/utils';import{AIRequestError as _0x4d4690}from'../adapters/aiadapter';import{Matcher as _0x32f5dd,UpcastWriter as _0x5644b7}from'ckeditor5/src/engine';const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');export default class g extends _0x504da8(){constructor(_0x5a22f7,_0x18ae04,_0x26b422){super(),this[_0x1d1e('0x22')]=_0x5a22f7,this[_0x1d1e('0x31')]=_0x18ae04,this[_0x1d1e('0x13')]=document[_0x1d1e('0x1d')](_0x1d1e('0x2a')),this[_0x1d1e('0x39')]=new DOMParser(),this[_0x1d1e('0x37')]=new XMLSerializer(),this[_0x1d1e('0x1e')]=_0x26b422,this[_0x1d1e('0x16')]({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['view'][_0x1d1e('0x33')]('value')['to'](this,_0x1d1e('0x38'),this['_sanitizeHTML'][_0x1d1e('0x33')](this)),this[_0x1d1e('0x5')](this[_0x1d1e('0x1e')],'submitPrompt',(_0x40414c,_0x1f475c)=>{const _0x91cc86=this[_0x1d1e('0x38')]||this[_0x1d1e('0x23')];this[_0x1d1e('0xa')](_0x1f475c,_0x91cc86,_0x1d1e('0x12'));}),this[_0x1d1e('0x5')](this['view'],_0x1d1e('0x15'),()=>{this['view'][_0x1d1e('0xc')]=this[_0x1d1e('0x9')],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this[_0x1d1e('0x5')](this[_0x1d1e('0x1e')],_0x1d1e('0x3d'),()=>{this[_0x1d1e('0x3d')]();});}[_0x1d1e('0x20')](){this['stopListening']();}async[_0x1d1e('0x2')]({actionId:_0x2ef7c8,query:_0x3a4f5d,htmlContent:_0x4e4131,label:_0x3690a7,mainActionLabel:_0x5935dc}){this[_0x1d1e('0x1e')][_0x1d1e('0xc')]=_0x3690a7,this[_0x1d1e('0x1e')][_0x1d1e('0x17')]=_0x5935dc,this[_0x1d1e('0x23')]=_0x4e4131,_0x3a4f5d&&(this[_0x1d1e('0x1e')][_0x1d1e('0x3c')]?this[_0x1d1e('0xa')](_0x3a4f5d,_0x4e4131,_0x2ef7c8,_0x3690a7):this['view']['once']('render',()=>{this[_0x1d1e('0xa')](_0x3a4f5d,_0x4e4131,_0x2ef7c8,_0x3690a7);}));}[_0x1d1e('0x3d')](){this['isProcessing']&&(this[_0x1d1e('0x30')]=!0x1,this[_0x1d1e('0x1e')][_0x1d1e('0x18')](),this[_0x1d1e('0x31')][_0x1d1e('0x21')]());}['reset'](){this['initialContext']='',this[_0x1d1e('0x38')]='',this[_0x1d1e('0x19')]='',this[_0x1d1e('0x25')]='',this[_0x1d1e('0x1')]='',this[_0x1d1e('0x9')]='',this['previousActionId']=void 0x0,this[_0x1d1e('0x1e')][_0x1d1e('0xd')](),this[_0x1d1e('0x3d')]();}async[_0x1d1e('0xa')](_0x2eff3d,_0x4e156c,_0x266348,_0xae26e6){return this[_0x1d1e('0x30')]=!0x0,this[_0x1d1e('0x1e')][_0x1d1e('0x2e')](),this[_0x1d1e('0x25')]=_0x4e156c,this['previousQuery']=_0x2eff3d,this[_0x1d1e('0x9')]=_0xae26e6||_0x2eff3d,this[_0x1d1e('0x1f')]=_0x266348,new Promise(_0x4895c0=>{this[_0x1d1e('0x31')][_0x1d1e('0xe')]({'query':_0x2eff3d,'context':_0x4e156c,'onData':_0x5d4109=>{this[_0x1d1e('0x19')]=_0x5d4109,this['currentContext']=this[_0x1d1e('0x3a')](this[_0x1d1e('0x19')]);},'actionId':_0x266348})[_0x1d1e('0x2c')](()=>{!this[_0x1d1e('0x38')]&&this[_0x1d1e('0x19')]&&(this[_0x1d1e('0x38')]=this['_parseAndNormalizeContent'](this[_0x1d1e('0x19')],!0x0));})['catch'](_0x1a3d46=>{_0x1a3d46 instanceof _0x4d4690?this[_0x1d1e('0x1e')][_0x1d1e('0x0')](_0x1a3d46['message']):this['view'][_0x1d1e('0x0')](),_0x4895c0();})[_0x1d1e('0x10')](()=>{this[_0x1d1e('0x3d')](),_0x4895c0();});});}[_0x1d1e('0x3a')](_0x3862a7,_0x5a0ee7=!0x1){const _0x4813f8=Z[_0x1d1e('0x1c')](_0x3862a7);_0x4813f8?_0x3862a7=_0x3862a7[_0x1d1e('0x3b')](_0x4813f8[0x1][_0x1d1e('0x6')]):_0x3862a7['length']<0x64&&!_0x5a0ee7&&(_0x3862a7='');const _0x4b7dda=this[_0x1d1e('0x39')][_0x1d1e('0x26')](_0x3862a7,_0x1d1e('0x36'));if(_0x4813f8)for(const _0x388c83 of _0x4b7dda[_0x1d1e('0x8')][_0x1d1e('0x7')])_0x388c83[_0x1d1e('0x2b')]!=Node[_0x1d1e('0x29')]&&_0x388c83[_0x1d1e('0x1a')]();const _0x27b105=this[_0x1d1e('0x22')]['data'][_0x1d1e('0xb')]['toView'](this[_0x1d1e('0x37')][_0x1d1e('0x27')](_0x4b7dda[_0x1d1e('0x8')]));return this[_0x1d1e('0x2f')](_0x27b105),this['editor']['data'][_0x1d1e('0x3')](this[_0x1d1e('0x22')][_0x1d1e('0x24')][_0x1d1e('0x14')](_0x27b105));}[_0x1d1e('0x2f')](_0x52232d){const _0x2060e2=new _0x5644b7(this['editor'][_0x1d1e('0x4')][_0x1d1e('0x1e')][_0x1d1e('0x28')]),_0x396d49=new _0x32f5dd({'name':/^h[1-5]$/}),_0x11755e=[];let _0xaf0d77=!0x1;for(const _0x538722 of _0x52232d)_0x538722['is'](_0x1d1e('0xf'))&&_0x396d49[_0x1d1e('0x11')](_0x538722)&&(_0x11755e[_0x1d1e('0x34')](_0x538722),'h1'==_0x538722['name']&&(_0xaf0d77=!0x0));if(_0xaf0d77)for(const _0x132255 of _0x11755e)_0x2060e2[_0x1d1e('0x32')]('h'+(parseInt(_0x132255['name'][0x1])+0x1),_0x132255);}[_0x1d1e('0x2d')](_0x55edd3){return this[_0x1d1e('0x22')][_0x1d1e('0x4')]['view'][_0x1d1e('0x35')]['setContentOf'](this['_sanitizationContainer'],_0x55edd3),this[_0x1d1e('0x13')][_0x1d1e('0x1b')];}}
@@ -1,22 +1,22 @@
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/aicommandslistview
7
- */
8
- import { ListView, type FilteredView } from 'ckeditor5/src/ui';
9
- /**
10
- * A list view that displays a list of AI commands with filtering capabilities.
11
- *
12
- * @private
13
- */
14
- export default class AICommandsListView extends ListView implements FilteredView {
15
- /**
16
- * @inheritDoc
17
- */
18
- filter(regExp: RegExp | null): {
19
- resultsCount: number;
20
- totalItemsCount: number;
21
- };
22
- }
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/aicommandslistview
7
+ */
8
+ import { ListView, type FilteredView } from 'ckeditor5/src/ui';
9
+ /**
10
+ * A list view that displays a list of AI commands with filtering capabilities.
11
+ *
12
+ * @private
13
+ */
14
+ export default class AICommandsListView extends ListView implements FilteredView {
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ filter(regExp: RegExp | null): {
19
+ resultsCount: number;
20
+ totalItemsCount: number;
21
+ };
22
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x34b7=['items','length','isVisible','filter','children','highlightText','labelView'];(function(_0x3e148b,_0x34b7a6){const _0x96013a=function(_0x134738){while(--_0x134738){_0x3e148b['push'](_0x3e148b['shift']());}};_0x96013a(++_0x34b7a6);}(_0x34b7,0x169));const _0x9601=function(_0x3e148b,_0x34b7a6){_0x3e148b=_0x3e148b-0x0;let _0x96013a=_0x34b7[_0x3e148b];return _0x96013a;};import{ListView as _0x24b8a3}from'ckeditor5/src/ui';export default class g extends _0x24b8a3{['filter'](_0x3ce949){let _0x1bf9bd=0x0,_0x3abfa3=0x0;for(const _0x1a8b42 of this[_0x9601('0x3')]){const _0x5e3f08=_0x1a8b42;for(const _0x30aced of _0x5e3f08['items']){const _0x4ca43e=_0x30aced[_0x9601('0x0')]['first'],_0x297dd2=_0x4ca43e[_0x9601('0x2')];_0x3ce949?(_0x30aced[_0x9601('0x5')]=!!_0x4ca43e['label']['match'](_0x3ce949),_0x30aced[_0x9601('0x5')]&&(_0x297dd2[_0x9601('0x1')](_0x3ce949),_0x3abfa3++)):(_0x30aced[_0x9601('0x5')]=!0x0,_0x297dd2[_0x9601('0x1')](null),_0x3abfa3++),_0x1bf9bd++;}_0x5e3f08[_0x9601('0x5')]=!!_0x5e3f08[_0x9601('0x3')][_0x9601('0x6')](_0x15708b=>_0x15708b['isVisible'])[_0x9601('0x4')];}return{'resultsCount':_0x3abfa3,'totalItemsCount':_0x1bf9bd};}}
23
+ const _0x11ab=['children','filter','length','labelView','label','highlightText','isVisible','items','match'];(function(_0x5ba5f6,_0x11ab10){const _0x25074b=function(_0x58dd3d){while(--_0x58dd3d){_0x5ba5f6['push'](_0x5ba5f6['shift']());}};_0x25074b(++_0x11ab10);}(_0x11ab,0x1e5));const _0x2507=function(_0x5ba5f6,_0x11ab10){_0x5ba5f6=_0x5ba5f6-0x0;let _0x25074b=_0x11ab[_0x5ba5f6];return _0x25074b;};import{ListView as _0x8274be}from'ckeditor5/src/ui';export default class y extends _0x8274be{[_0x2507('0x2')](_0x53833f){let _0x411229=0x0,_0x26b7ff=0x0;for(const _0x48e838 of this[_0x2507('0x8')]){const _0x21e993=_0x48e838,_0x452651=_0x21e993['items'],_0x187512=_0x53833f&&!!_0x21e993[_0x2507('0x5')][_0x2507('0x0')](_0x53833f);_0x21e993[_0x2507('0x4')][_0x2507('0x6')](_0x187512?_0x53833f:null);for(const _0x5150d6 of _0x452651){const _0x4fdb4b=_0x5150d6[_0x2507('0x1')]['first'],_0xc6fd64=_0x4fdb4b[_0x2507('0x4')];if(_0x53833f){const _0x98c58c=!!_0x4fdb4b[_0x2507('0x5')]['match'](_0x53833f);_0xc6fd64[_0x2507('0x6')](_0x98c58c?_0x53833f:null),_0x5150d6[_0x2507('0x7')]=_0x187512||_0x98c58c;}else _0x5150d6[_0x2507('0x7')]=!0x0,_0xc6fd64[_0x2507('0x6')](null);}const _0x24e342=_0x452651[_0x2507('0x2')](_0x3b02e8=>_0x3b02e8['isVisible'])[_0x2507('0x3')];_0x411229+=_0x21e993['items'][_0x2507('0x3')],_0x26b7ff+=_0x187512?_0x21e993[_0x2507('0x8')][_0x2507('0x3')]:_0x24e342,_0x21e993[_0x2507('0x7')]=_0x187512||!!_0x24e342;}return{'resultsCount':_0x26b7ff,'totalItemsCount':_0x411229};}}
@@ -1,29 +1,29 @@
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/buttonlabelwithhighlightview
7
- */
8
- import { type ButtonLabel, HighlightedTextView } from 'ckeditor5/src/ui';
9
- /**
10
- * A button label view that can highlight a text fragment.
11
- */
12
- export default class ButtonLabelWithHighlightView extends HighlightedTextView implements ButtonLabel {
13
- /**
14
- * @inheritDoc
15
- */
16
- style: string | undefined;
17
- /**
18
- * @inheritDoc
19
- */
20
- text: string | undefined;
21
- /**
22
- * @inheritDoc
23
- */
24
- id: string | undefined;
25
- /**
26
- * @inheritDoc
27
- */
28
- constructor();
29
- }
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/buttonlabelwithhighlightview
7
+ */
8
+ import { type ButtonLabel, HighlightedTextView } from 'ckeditor5/src/ui';
9
+ /**
10
+ * A button label view that can highlight a text fragment.
11
+ */
12
+ export default class ButtonLabelWithHighlightView extends HighlightedTextView implements ButtonLabel {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ style: string | undefined;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ text: string | undefined;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ id: string | undefined;
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ constructor();
29
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x36be=['extendTemplate','set','bindTemplate','style'];(function(_0xfd1ca,_0x36bec2){const _0xda4ac1=function(_0x2d79ee){while(--_0x2d79ee){_0xfd1ca['push'](_0xfd1ca['shift']());}};_0xda4ac1(++_0x36bec2);}(_0x36be,0x68));const _0xda4a=function(_0xfd1ca,_0x36bec2){_0xfd1ca=_0xfd1ca-0x0;let _0xda4ac1=_0x36be[_0xfd1ca];return _0xda4ac1;};import{HighlightedTextView as _0x5cf719}from'ckeditor5/src/ui';export default class C extends _0x5cf719{constructor(){super(),this[_0xda4a('0x1')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x456ec4=this[_0xda4a('0x2')];this[_0xda4a('0x0')]({'attributes':{'class':['ck-button__label'],'style':_0x456ec4['to'](_0xda4a('0x3')),'id':_0x456ec4['to']('id')}});}}
23
+ const _0x53a3=['bindTemplate','set','extendTemplate','ck-button__label','style'];(function(_0x6aa097,_0x53a357){const _0x365265=function(_0x314723){while(--_0x314723){_0x6aa097['push'](_0x6aa097['shift']());}};_0x365265(++_0x53a357);}(_0x53a3,0x7f));const _0x3652=function(_0x6aa097,_0x53a357){_0x6aa097=_0x6aa097-0x0;let _0x365265=_0x53a3[_0x6aa097];return _0x365265;};import{HighlightedTextView as _0x5501c6}from'ckeditor5/src/ui';export default class k extends _0x5501c6{constructor(){super(),this[_0x3652('0x4')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x3dce57=this[_0x3652('0x3')];this[_0x3652('0x0')]({'attributes':{'class':[_0x3652('0x1')],'style':_0x3dce57['to'](_0x3652('0x2')),'id':_0x3dce57['to']('id')}});}}
@@ -0,0 +1,25 @@
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/labelwithhighlightview
7
+ */
8
+ import { type LabelView, HighlightedTextView } from 'ckeditor5/src/ui';
9
+ /**
10
+ * A label view that can highlight a text fragment.
11
+ */
12
+ export default class LabelWithHighlightView extends HighlightedTextView implements LabelView {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ readonly id: string;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ for: string | undefined;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ constructor();
25
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ *
4
+ *
5
+ *
6
+ *
7
+ * +---------------------------------------------------------------------------------+
8
+ * | |
9
+ * | Hello stranger! |
10
+ * | |
11
+ * | |
12
+ * | What you're currently looking at is the source code of a legally protected, |
13
+ * | proprietary software. Any attempts to deobfuscate / disassemble this code |
14
+ * | are forbidden and will result in legal consequences. |
15
+ * | |
16
+ * | |
17
+ * +---------------------------------------------------------------------------------+
18
+ *
19
+ *
20
+ *
21
+ *
22
+ */
23
+ const _0x2d4d=['ck-label','ck-editor__label_','set','bindTemplate','extendTemplate'];(function(_0x8c3844,_0x2d4d59){const _0x5f068d=function(_0x9a9fb2){while(--_0x9a9fb2){_0x8c3844['push'](_0x8c3844['shift']());}};_0x5f068d(++_0x2d4d59);}(_0x2d4d,0x88));const _0x5f06=function(_0x8c3844,_0x2d4d59){_0x8c3844=_0x8c3844-0x0;let _0x5f068d=_0x2d4d[_0x8c3844];return _0x5f068d;};import{HighlightedTextView as _0xa94dca}from'ckeditor5/src/ui';import{uid as _0x139cc2}from'ckeditor5/src/utils';export default class C extends _0xa94dca{constructor(){super(),this[_0x5f06('0x1')]('for',void 0x0);const _0x3559be=this[_0x5f06('0x2')];this['id']=_0x5f06('0x0')+_0x139cc2(),this[_0x5f06('0x3')]({'attributes':{'class':['ck',_0x5f06('0x4')],'id':this['id'],'for':_0x3559be['to']('for')}});}}
@@ -1,48 +1,48 @@
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/aiformcontentarea
7
- */
8
- import { type Locale } from 'ckeditor5/src/utils';
9
- import { View, ButtonView } from 'ckeditor5/src/ui';
10
- /**
11
- * A class representing the text area view of the AI assistant.
12
- */
13
- export default class AIFormContentArea extends View {
14
- /**
15
- * The value which is displayed in the content field.
16
- *
17
- * @observable
18
- */
19
- value: string | null;
20
- /**
21
- * Controls whether the content area is visible.
22
- *
23
- * @observable
24
- * @default false
25
- */
26
- isVisible: boolean;
27
- /**
28
- * Indicates if the content area is during processing which can change inner values.
29
- */
30
- isProcessing: boolean;
31
- /**
32
- * The textarea view.
33
- */
34
- contentFieldView: ContentFieldView;
35
- /**
36
- * The copy button displayed in the bottom-right corner of text area.
37
- */
38
- copyButtonView: ButtonView;
39
- /**
40
- * @inheritDoc
41
- */
42
- constructor(locale: Locale, extraCssClass?: string);
43
- /**
44
- * @inheritDoc
45
- */
46
- render(): void;
47
- focus(): void;
48
- }
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/aiformcontentarea
7
+ */
8
+ import { type Locale } from 'ckeditor5/src/utils';
9
+ import { View, ButtonView } from 'ckeditor5/src/ui';
10
+ /**
11
+ * A class representing the text area view of the AI assistant.
12
+ */
13
+ export default class AIFormContentArea extends View {
14
+ /**
15
+ * The value which is displayed in the content field.
16
+ *
17
+ * @observable
18
+ */
19
+ value: string | null;
20
+ /**
21
+ * Controls whether the content area is visible.
22
+ *
23
+ * @observable
24
+ * @default false
25
+ */
26
+ isVisible: boolean;
27
+ /**
28
+ * Indicates if the content area is during processing which can change inner values.
29
+ */
30
+ isProcessing: boolean;
31
+ /**
32
+ * The textarea view.
33
+ */
34
+ contentFieldView: ContentFieldView;
35
+ /**
36
+ * The copy button displayed in the bottom-right corner of text area.
37
+ */
38
+ copyButtonView: ButtonView;
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ constructor(locale: Locale, extraCssClass?: string);
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ render(): void;
47
+ focus(): void;
48
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
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;}}
23
+ const _0x2e73=['set','execCommand','\x20ck-ai-form__copy-button--copied','.ck-ai-form__loader','setStartAfter','mousedown','addRange','icon','ck-ai-form__loader','firstElementChild','setEndBefore','render','querySelector','change:value','ck-ai-form__content-area-wrapper','body','textContent','appendChild','value','ck-ai-form__content-area--processing','style','innerHTML','absolute','focus','-9999px','ck-reset_all-excluded','listenTo','write','left','_copyHTMLToClipboard','createElement','element','bind','class','isVisible','position','_createCopyButton','ck-hidden','locale','wheel','_createLoader','<span>[</span>','smooth','ClipboardItem','setContent','ck-ai-form__content-area','copy','lastElementChild','ck-ai-form__copy-button-wrapper','check','scrollTo','<span>]</span>','loaderView','isProcessing','clipboard','div','copyButtonView','AI\x20is\x20writing...','appendLoader','contentFieldView','setTemplate'];(function(_0x21230e,_0x2e730){const _0x121250=function(_0x3b8050){while(--_0x3b8050){_0x21230e['push'](_0x21230e['shift']());}};_0x121250(++_0x2e730);}(_0x2e73,0xef));const _0x1212=function(_0x21230e,_0x2e730){_0x21230e=_0x21230e-0x0;let _0x121250=_0x2e73[_0x21230e];return _0x121250;};import{global as _0x3fc965}from'ckeditor5/src/utils';import{View as _0x449075,ButtonView as _0x5c57d3,SpinnerView as _0xd9e06f}from'ckeditor5/src/ui';import _0x2d2aaa from'../../../theme/icons/copy.svg';import{getTranslation as _0x186599}from'../../utils/common-translations';import{icons as _0x2b0e34}from'ckeditor5/src/core';export default class Y extends _0x449075{constructor(_0x553016,_0x1541d6=''){super(_0x553016),this[_0x1212('0x5')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1c0c95=this['bindTemplate'];this[_0x1212('0x3')]=new ContentFieldView(_0x553016,_0x1541d6),this[_0x1212('0x0')]=this[_0x1212('0x29')](),this[_0x1212('0x4')]({'tag':_0x1212('0x3c'),'attributes':{'class':['ck',_0x1212('0x13'),_0x1c0c95['if'](_0x1212('0x27'),_0x1212('0x2a'),_0x4d1958=>!_0x4d1958)],'tabindex':'-1'},'children':[{'tag':_0x1212('0x3c'),'attributes':{'class':['ck',_0x1212('0x32'),_0x1c0c95['if'](_0x1212('0x3a'),_0x1212('0x18'))]},'children':[this[_0x1212('0x3')],{'tag':'div','attributes':{'class':['ck',_0x1212('0x35')]},'children':[this[_0x1212('0x0')]]}]}]});}['render'](){super[_0x1212('0x10')](),this[_0x1212('0x17')]&&this['contentFieldView'][_0x1212('0x31')](this[_0x1212('0x17')]);let _0x29276a=!0x1;this['on'](_0x1212('0x12'),(_0x3b768b,_0x3f9ad9,_0x466f85)=>{const _0x2c724a=!this[_0x1212('0x3')]['element'][_0x1212('0x11')](_0x1212('0x8'));this['contentFieldView'][_0x1212('0x31')](_0x466f85),this['isProcessing']&&_0x2c724a&&!_0x29276a&&this[_0x1212('0x24')][_0x1212('0x37')]({'top':this['element']['scrollHeight'],'behavior':_0x1212('0x2f')});}),this['on']('change:isProcessing',(_0x47a035,_0x869405,_0x2c8b28)=>{_0x29276a=!0x1,_0x2c8b28?(this['value']=null,this[_0x1212('0x3')][_0x1212('0x2')]()):this[_0x1212('0x17')]||this[_0x1212('0x3')][_0x1212('0x31')]('');}),this[_0x1212('0x1f')](this[_0x1212('0x24')],_0x1212('0x2c'),()=>{_0x29276a=!0x0;}),this[_0x1212('0x1f')](this[_0x1212('0x24')],_0x1212('0xa'),()=>{_0x29276a=!0x0;});}[_0x1212('0x1c')](){this['element'][_0x1212('0x1c')]();}[_0x1212('0x29')](){const _0x1d1656=this[_0x1212('0x2b')],_0x51f9cd=new _0x5c57d3(this[_0x1212('0x2b')]),_0x540f92='ck-ai-form__copy-button';return _0x51f9cd[_0x1212('0x5')]({'label':_0x186599(_0x1d1656,'Copy'),'icon':_0x2d2aaa,'class':_0x540f92,'tooltip':!0x0}),_0x51f9cd[_0x1212('0x25')](_0x1212('0x27'))['to'](this,_0x1212('0x17'),_0x5d6744=>!!_0x5d6744),_0x51f9cd[_0x1212('0x25')]('isEnabled')['to'](this,_0x1212('0x3a'),_0x18b7f6=>!_0x18b7f6),_0x51f9cd['on']('execute',()=>{this[_0x1212('0x22')](this[_0x1212('0x3')][_0x1212('0x24')]),_0x51f9cd[_0x1212('0xc')]=_0x2b0e34[_0x1212('0x36')],_0x51f9cd[_0x1212('0x26')]=_0x540f92+_0x1212('0x7'),this[_0x1212('0x1c')](),setTimeout(()=>{_0x51f9cd['icon']=_0x2d2aaa,_0x51f9cd[_0x1212('0x26')]=_0x540f92;},0x3e8);}),_0x51f9cd;}['_copyHTMLToClipboard'](_0x2d48da){const {window:_0x2791c5,document:_0x3711cc}=_0x3fc965;if(_0x2791c5[_0x1212('0x30')]){const {Blob:_0x18ead9,ClipboardItem:_0x2e5a4e}=_0x2791c5,_0x3fad8d=[new _0x2e5a4e({'text/html':new _0x18ead9([_0x2d48da['innerHTML']],{'type':'text/html'}),'text/plain':new _0x18ead9([_0x2d48da[_0x1212('0x15')]||''],{'type':'text/plain'})})];navigator[_0x1212('0x3b')][_0x1212('0x20')](_0x3fad8d);}else{const _0x488f56=_0x3711cc[_0x1212('0x23')](_0x1212('0x3c'));_0x488f56[_0x1212('0x19')][_0x1212('0x28')]=_0x1212('0x1b'),_0x488f56[_0x1212('0x19')][_0x1212('0x21')]=_0x1212('0x1d'),_0x488f56[_0x1212('0x1a')]=_0x1212('0x2e')+_0x2d48da[_0x1212('0x1a')]+_0x1212('0x38'),_0x3711cc[_0x1212('0x14')][_0x1212('0x16')](_0x488f56);const _0x545e1d=_0x3711cc['createRange']();_0x545e1d[_0x1212('0x9')](_0x488f56[_0x1212('0xe')]),_0x545e1d[_0x1212('0xf')](_0x488f56[_0x1212('0x34')]);const _0x212a88=_0x2791c5['getSelection']();_0x212a88['removeAllRanges'](),_0x212a88[_0x1212('0xb')](_0x545e1d),_0x3711cc[_0x1212('0x6')](_0x1212('0x33')),_0x488f56['remove']();}}}export class ContentFieldView extends _0x449075{constructor(_0x464e4e,_0x352374=''){super(_0x464e4e),this[_0x1212('0x39')]=this[_0x1212('0x2d')](),this[_0x1212('0x4')]({'tag':_0x1212('0x3c'),'attributes':{'class':['ck','ck-content',_0x352374,_0x1212('0x1e'),'ck-ai-form__content-field']}});}['setContent'](_0x59d545){this[_0x1212('0x24')][_0x1212('0x1a')]=_0x59d545;}[_0x1212('0x2')](){this[_0x1212('0x24')][_0x1212('0x16')](this['loaderView'][_0x1212('0x24')]);}['_createLoader'](){const _0x5409fb=new _0x449075(),_0x22af48=this[_0x1212('0x2b')],_0x1cf4ec=new _0xd9e06f();return _0x1cf4ec['isVisible']=!0x0,_0x5409fb['setTemplate']({'tag':_0x1212('0x3c'),'attributes':{'class':['ck',_0x1212('0xd')]},'children':[_0x1cf4ec,{'text':_0x186599(_0x22af48,_0x1212('0x1'))}]}),_0x5409fb[_0x1212('0x10')](),_0x5409fb;}}
@@ -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 _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'))}]});}}
23
+ const _0x12b7=['setTemplate','content','bindTemplate','text'];(function(_0x5e418a,_0x12b769){const _0x4dfc07=function(_0x3d92b3){while(--_0x3d92b3){_0x5e418a['push'](_0x5e418a['shift']());}};_0x4dfc07(++_0x12b769);}(_0x12b7,0x1f0));const _0x4dfc=function(_0x5e418a,_0x12b769){_0x5e418a=_0x5e418a-0x0;let _0x4dfc07=_0x12b7[_0x5e418a];return _0x4dfc07;};import{View as _0x3e1314,IconView as _0x1cf3ac}from'ckeditor5/src/ui';import _0x4798e9 from'../../../theme/icons/error.svg';export default class et extends _0x3e1314{constructor(_0x1d0821,_0x5ceb46=''){super(_0x1d0821);const _0xf91973=new _0x1cf3ac(),_0x50832d=this[_0x4dfc('0x2')];this['set'](_0x4dfc('0x3'),_0x5ceb46),_0xf91973[_0x4dfc('0x1')]=_0x4798e9,this[_0x4dfc('0x0')]({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xf91973,{'text':_0x50832d['to'](_0x4dfc('0x3'))}]});}}