@ckeditor/ckeditor5-ai 40.2.0 → 41.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +14 -6
- package/README.md +10 -11
- package/build/ai.js +8 -8
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/uz.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/ckeditor5-metadata.json +1 -1
- package/lang/contexts.json +3 -3
- package/lang/translations/af.po +14 -6
- package/lang/translations/ar.po +14 -6
- package/lang/translations/bg.po +14 -6
- package/lang/translations/bn.po +14 -6
- package/lang/translations/bs.po +14 -6
- package/lang/translations/ca.po +14 -6
- package/lang/translations/cs.po +14 -6
- package/lang/translations/da.po +14 -6
- package/lang/translations/de-ch.po +14 -6
- package/lang/translations/de.po +14 -6
- package/lang/translations/el.po +14 -6
- package/lang/translations/en-au.po +14 -6
- package/lang/translations/en.po +14 -6
- package/lang/translations/es-co.po +14 -6
- package/lang/translations/es.po +14 -6
- package/lang/translations/et.po +14 -6
- package/lang/translations/fa.po +14 -6
- package/lang/translations/fi.po +14 -6
- package/lang/translations/fr.po +14 -6
- package/lang/translations/gl.po +14 -6
- package/lang/translations/he.po +14 -6
- package/lang/translations/hi.po +14 -6
- package/lang/translations/hr.po +14 -6
- package/lang/translations/hu.po +14 -6
- package/lang/translations/id.po +14 -6
- package/lang/translations/it.po +14 -6
- package/lang/translations/ja.po +14 -6
- package/lang/translations/jv.po +14 -6
- package/lang/translations/ko.po +14 -6
- package/lang/translations/lt.po +14 -6
- package/lang/translations/lv.po +14 -6
- package/lang/translations/ms.po +14 -6
- package/lang/translations/nl.po +14 -6
- package/lang/translations/no.po +14 -6
- package/lang/translations/pl.po +14 -6
- package/lang/translations/pt-br.po +14 -6
- package/lang/translations/pt.po +14 -6
- package/lang/translations/ro.po +14 -6
- package/lang/translations/ru.po +14 -6
- package/lang/translations/sk.po +14 -6
- package/lang/translations/sr-latn.po +14 -6
- package/lang/translations/sr.po +14 -6
- package/lang/translations/sv.po +14 -6
- package/lang/translations/th.po +14 -6
- package/lang/translations/tk.po +14 -6
- package/lang/translations/tr.po +14 -6
- package/lang/translations/ug.po +14 -6
- package/lang/translations/uk.po +14 -6
- package/lang/translations/ur.po +14 -6
- package/lang/translations/uz.po +14 -6
- package/lang/translations/vi.po +14 -6
- package/lang/translations/zh-cn.po +14 -6
- package/lang/translations/zh.po +14 -6
- package/package.json +7 -5
- package/src/adapters/aiadapter.d.ts +3 -3
- package/src/adapters/aiadapter.js +2 -2
- package/src/adapters/aitextadapter.d.ts +3 -3
- package/src/adapters/aitextadapter.js +2 -2
- package/src/adapters/awstextadapter.d.ts +24 -24
- package/src/adapters/awstextadapter.js +2 -2
- package/src/adapters/openaitextadapter.d.ts +3 -3
- package/src/adapters/openaitextadapter.js +2 -2
- package/src/aiassistant.d.ts +5 -5
- package/src/aiassistant.js +2 -2
- package/src/aiassistantediting.d.ts +13 -12
- package/src/aiassistantediting.js +2 -2
- package/src/aiassistantui.d.ts +8 -8
- package/src/aiassistantui.js +2 -2
- package/src/aiconfig.d.ts +5 -5
- package/src/aiconfig.js +1 -1
- package/src/augmentation.d.ts +7 -7
- package/src/augmentation.js +1 -1
- package/src/index.d.ts +7 -7
- package/src/index.js +2 -2
- package/src/ui/aiassistantcontroller.d.ts +12 -12
- package/src/ui/aiassistantcontroller.js +2 -2
- package/src/ui/dropdown/aicommandslistview.d.ts +2 -2
- package/src/ui/dropdown/aicommandslistview.js +2 -2
- package/src/ui/dropdown/buttonlabelwithhighlightview.d.ts +2 -2
- package/src/ui/dropdown/buttonlabelwithhighlightview.js +2 -2
- package/src/ui/dropdown/labelwithhighlightview.d.ts +2 -2
- package/src/ui/dropdown/labelwithhighlightview.js +2 -2
- package/src/ui/form/aiformcontentarea.d.ts +3 -3
- package/src/ui/form/aiformcontentarea.js +2 -2
- package/src/ui/form/aiformerrorview.d.ts +3 -3
- package/src/ui/form/aiformerrorview.js +2 -2
- package/src/ui/form/aiformpromptview.d.ts +3 -3
- package/src/ui/form/aiformpromptview.js +2 -2
- package/src/ui/form/aiformtoolbarview.d.ts +12 -8
- package/src/ui/form/aiformtoolbarview.js +2 -2
- package/src/ui/form/aiformview.d.ts +13 -14
- package/src/ui/form/aiformview.js +2 -2
- package/src/ui/form/aihistorylistitemview.d.ts +3 -3
- package/src/ui/form/aihistorylistitemview.js +2 -2
- package/src/ui/form/aihistorylistview.d.ts +3 -3
- package/src/ui/form/aihistorylistview.js +2 -2
- package/src/ui/form/prompthistory.d.ts +2 -2
- package/src/ui/form/prompthistory.js +2 -2
- package/src/ui/showaiassistantcommand.d.ts +2 -2
- package/src/ui/showaiassistantcommand.js +2 -2
- package/src/utils/common-translations.d.ts +2 -2
- package/src/utils/common-translations.js +2 -2
- package/theme/ai-dropdown.css +1 -1
- package/theme/ai-form.css +16 -4
- package/theme/ai.css +17 -4
- package/theme/icons/robot-pencil.svg +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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 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';
|
|
5
|
+
import type AITextAdapter from '../adapters/aitextadapter.js';
|
|
6
|
+
import type { default as AIFormView } from './form/aiformview.js';
|
|
7
|
+
import type { AIFormToolbarViewMainActionLabel } from './form/aiformtoolbarview.js';
|
|
8
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
9
9
|
declare const AIAssistantController_base: {
|
|
10
|
-
new (): import("ckeditor5/src/utils").Observable;
|
|
11
|
-
prototype: import("ckeditor5/src/utils").Observable;
|
|
10
|
+
new (): import("ckeditor5/src/utils.js").Observable;
|
|
11
|
+
prototype: import("ckeditor5/src/utils.js").Observable;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Controller for the AI assistant.
|
|
15
|
-
|
|
16
|
-
* It takes
|
|
15
|
+
*
|
|
16
|
+
* It takes a AI form view, listens to events fired by that view and based on them performs actions on an AI handler.
|
|
17
17
|
* This controller is also responsible for streaming the AI response for the UI.
|
|
18
18
|
*/
|
|
19
19
|
export default class AIAssistantController extends AIAssistantController_base {
|
|
@@ -30,7 +30,7 @@ export default class AIAssistantController extends AIAssistantController_base {
|
|
|
30
30
|
*/
|
|
31
31
|
readonly view: AIFormView;
|
|
32
32
|
/**
|
|
33
|
-
* It is the selected HTML content from the editor on which the
|
|
33
|
+
* It is the selected HTML content from the editor on which the dialog has been initialized.
|
|
34
34
|
*/
|
|
35
35
|
initialContext: string;
|
|
36
36
|
/**
|
|
@@ -89,7 +89,7 @@ export default class AIAssistantController extends AIAssistantController_base {
|
|
|
89
89
|
/**
|
|
90
90
|
* Handles the initial query for a new context and inits the listener for the visible view.
|
|
91
91
|
*
|
|
92
|
-
* This function should be called whenever the AI
|
|
92
|
+
* This function should be called whenever the AI dialog is displayed.
|
|
93
93
|
*
|
|
94
94
|
* @param options
|
|
95
95
|
* @param options.actionId ID of the performed action. See {@link module:ai/adapters/aitextadapter~AITextAdapterRequestData#actionId}.
|
|
@@ -103,7 +103,7 @@ export default class AIAssistantController extends AIAssistantController_base {
|
|
|
103
103
|
query: string;
|
|
104
104
|
htmlContent: string;
|
|
105
105
|
label: string;
|
|
106
|
-
mainActionLabel: AIFormToolbarViewMainActionLabel;
|
|
106
|
+
mainActionLabel: typeof AIFormToolbarViewMainActionLabel[keyof typeof AIFormToolbarViewMainActionLabel];
|
|
107
107
|
}): Promise<void>;
|
|
108
108
|
}
|
|
109
109
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
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
|
|
23
|
+
const _0x3090=['_xmlSerializer','textAdapter','currentResponse','remove','render','document','toModel','bind','stopProcessing','element','processor','match','push','handleError','reset','then','destroy','_handleQuery','_normalizeResponseHeadings','message','substring','currentContext','nodeType','finishProcessing','createElement','childNodes','_domParser','text/html','_parseAndNormalizeContent','setContentOf','updateView','editor','_sanitizationContainer','isRendered','div','toView','stopListening','isProcessing','abort','previousLabel','prompt','custom','exec','editing','previousQuery','ELEMENT_NODE','name','body','initialContext','data','length','_sanitizeHTML','previousContext','serializeToString','mainAction','submitPrompt','listenTo','previousActionId','innerHTML','startProcessing','view','once','value'];(function(_0xf01748,_0x309056){const _0x4e94c9=function(_0x73ce5f){while(--_0x73ce5f){_0xf01748['push'](_0xf01748['shift']());}};_0x4e94c9(++_0x309056);}(_0x3090,0xa3));const _0x4e94=function(_0xf01748,_0x309056){_0xf01748=_0xf01748-0x0;let _0x4e94c9=_0x3090[_0xf01748];return _0x4e94c9;};import{ObservableMixin as _0x2c505c}from'ckeditor5/src/utils.js';import{AIRequestError as _0x6893fc}from'../adapters/aiadapter.js';import{Matcher as _0x278ca4,UpcastWriter as _0x2806c7}from'ckeditor5/src/engine.js';const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');export default class y extends _0x2c505c(){constructor(_0x3e404a,_0x1938df,_0x14a163){super(),this['editor']=_0x3e404a,this[_0x4e94('0x1b')]=_0x1938df,this[_0x4e94('0x3a')]=document[_0x4e94('0x32')](_0x4e94('0x3c')),this[_0x4e94('0x34')]=new DOMParser(),this[_0x4e94('0x1a')]=new XMLSerializer(),this[_0x4e94('0x17')]=_0x14a163,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this[_0x4e94('0x17')][_0x4e94('0x21')](_0x4e94('0x19'))['to'](this,_0x4e94('0x2f'),this[_0x4e94('0xe')][_0x4e94('0x21')](this)),this['listenTo'](this['view'],_0x4e94('0x12'),(_0x1d9bfa,_0x4b967a)=>{const _0x36280a=this['currentContext']||this[_0x4e94('0xb')];this['_handleQuery'](_0x4b967a,_0x36280a,_0x4e94('0x4'));}),this[_0x4e94('0x13')](this[_0x4e94('0x17')],'tryAgainEvent',()=>{this['view'][_0x4e94('0x3')]=this[_0x4e94('0x2')],this[_0x4e94('0x2b')](this[_0x4e94('0x7')],this[_0x4e94('0xf')],this[_0x4e94('0x14')],this[_0x4e94('0x2')]);}),this[_0x4e94('0x13')](this['view'],_0x4e94('0x22'),()=>{this['stopProcessing']();});}[_0x4e94('0x2a')](){this[_0x4e94('0x3e')]();}async[_0x4e94('0x38')]({actionId:_0xbe87af,query:_0x32057f,htmlContent:_0x1c39b0,label:_0x56f424,mainActionLabel:_0x5d95cc}){this[_0x4e94('0x17')]['prompt']=_0x56f424,this['view'][_0x4e94('0x11')]=_0x5d95cc,this[_0x4e94('0xb')]=_0x1c39b0,_0x32057f&&(this[_0x4e94('0x17')][_0x4e94('0x3b')]?this[_0x4e94('0x2b')](_0x32057f,_0x1c39b0,_0xbe87af,_0x56f424):this[_0x4e94('0x17')][_0x4e94('0x18')](_0x4e94('0x1e'),()=>{this[_0x4e94('0x2b')](_0x32057f,_0x1c39b0,_0xbe87af,_0x56f424);}));}[_0x4e94('0x22')](){this[_0x4e94('0x0')]&&(this[_0x4e94('0x0')]=!0x1,this[_0x4e94('0x17')][_0x4e94('0x31')](),this[_0x4e94('0x1b')][_0x4e94('0x1')]());}['reset'](){this[_0x4e94('0xb')]='',this['currentContext']='',this[_0x4e94('0x1c')]='',this[_0x4e94('0xf')]='',this['previousQuery']='',this['previousLabel']='',this[_0x4e94('0x14')]=void 0x0,this['view'][_0x4e94('0x28')](),this['stopProcessing']();}async[_0x4e94('0x2b')](_0x5088a6,_0x1bfe96,_0x3ddb20,_0x405eb0){return this[_0x4e94('0x0')]=!0x0,this[_0x4e94('0x17')][_0x4e94('0x16')](),this['previousContext']=_0x1bfe96,this[_0x4e94('0x7')]=_0x5088a6,this['previousLabel']=_0x405eb0||_0x5088a6,this[_0x4e94('0x14')]=_0x3ddb20,new Promise(_0x10dd65=>{this[_0x4e94('0x1b')]['makeRequest']({'query':_0x5088a6,'context':_0x1bfe96,'onData':_0x29f70b=>{this[_0x4e94('0x1c')]=_0x29f70b,this['currentContext']=this[_0x4e94('0x36')](this[_0x4e94('0x1c')]);},'actionId':_0x3ddb20})[_0x4e94('0x29')](()=>{!this[_0x4e94('0x2f')]&&this[_0x4e94('0x1c')]&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x593c4b=>{_0x593c4b instanceof _0x6893fc?this[_0x4e94('0x17')]['handleError'](_0x593c4b[_0x4e94('0x2d')]):this[_0x4e94('0x17')][_0x4e94('0x27')](),_0x10dd65();})['finally'](()=>{this[_0x4e94('0x22')](),_0x10dd65();});});}[_0x4e94('0x36')](_0x177735,_0x5a7436=!0x1){const _0x52c4e5=Z[_0x4e94('0x5')](_0x177735);_0x52c4e5?_0x177735=_0x177735[_0x4e94('0x2e')](_0x52c4e5[0x1][_0x4e94('0xd')]):_0x177735[_0x4e94('0xd')]<0x64&&!_0x5a7436&&(_0x177735='');const _0x27c1ac=this['_domParser']['parseFromString'](_0x177735,_0x4e94('0x35'));if(_0x52c4e5)for(const _0x16f173 of _0x27c1ac['body'][_0x4e94('0x33')])_0x16f173[_0x4e94('0x30')]!=Node[_0x4e94('0x8')]&&_0x16f173[_0x4e94('0x1d')]();const _0x5f4a66=this[_0x4e94('0x39')][_0x4e94('0xc')][_0x4e94('0x24')][_0x4e94('0x3d')](this[_0x4e94('0x1a')][_0x4e94('0x10')](_0x27c1ac[_0x4e94('0xa')]));return this['_normalizeResponseHeadings'](_0x5f4a66),this[_0x4e94('0x39')][_0x4e94('0xc')]['stringify'](this[_0x4e94('0x39')][_0x4e94('0xc')][_0x4e94('0x20')](_0x5f4a66));}[_0x4e94('0x2c')](_0x37c75f){const _0x343e80=new _0x2806c7(this[_0x4e94('0x39')][_0x4e94('0x6')][_0x4e94('0x17')][_0x4e94('0x1f')]),_0x392f1a=new _0x278ca4({'name':/^h[1-5]$/}),_0x5e91d7=[];let _0x35b961=!0x1;for(const _0xacfc1e of _0x37c75f)_0xacfc1e['is'](_0x4e94('0x23'))&&_0x392f1a[_0x4e94('0x25')](_0xacfc1e)&&(_0x5e91d7[_0x4e94('0x26')](_0xacfc1e),'h1'==_0xacfc1e[_0x4e94('0x9')]&&(_0x35b961=!0x0));if(_0x35b961)for(const _0x38351a of _0x5e91d7)_0x343e80['rename']('h'+(parseInt(_0x38351a[_0x4e94('0x9')][0x1])+0x1),_0x38351a);}[_0x4e94('0xe')](_0x5e3449){return this['editor'][_0x4e94('0x6')][_0x4e94('0x17')]['domConverter'][_0x4e94('0x37')](this[_0x4e94('0x3a')],_0x5e3449),this['_sanitizationContainer'][_0x4e94('0x15')];}}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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/aicommandslistview
|
|
7
7
|
*/
|
|
8
|
-
import { ListView, type FilteredView } from 'ckeditor5/src/ui';
|
|
8
|
+
import { ListView, type FilteredView } from 'ckeditor5/src/ui.js';
|
|
9
9
|
/**
|
|
10
10
|
* A list view that displays a list of AI commands with filtering capabilities.
|
|
11
11
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
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
|
|
23
|
+
const _0x2ce8=['highlightText','first','length','items','labelView','filter','label','match'];(function(_0x55d60e,_0x2ce8b3){const _0x531aba=function(_0x52292f){while(--_0x52292f){_0x55d60e['push'](_0x55d60e['shift']());}};_0x531aba(++_0x2ce8b3);}(_0x2ce8,0x1cc));const _0x531a=function(_0x55d60e,_0x2ce8b3){_0x55d60e=_0x55d60e-0x0;let _0x531aba=_0x2ce8[_0x55d60e];return _0x531aba;};import{ListView as _0x5137fc}from'ckeditor5/src/ui.js';export default class j extends _0x5137fc{['filter'](_0x42c242){let _0x5b294e=0x0,_0x517a79=0x0;for(const _0x1a6c35 of this[_0x531a('0x7')]){const _0x3cbb3f=_0x1a6c35,_0x273a24=_0x3cbb3f[_0x531a('0x7')],_0x557ec3=_0x42c242&&!!_0x3cbb3f[_0x531a('0x2')][_0x531a('0x3')](_0x42c242);_0x3cbb3f[_0x531a('0x0')]['highlightText'](_0x557ec3?_0x42c242:null);for(const _0x186e69 of _0x273a24){const _0x2c0afa=_0x186e69['children'][_0x531a('0x5')],_0x203725=_0x2c0afa[_0x531a('0x0')];if(_0x42c242){const _0x53bc31=!!_0x2c0afa['label'][_0x531a('0x3')](_0x42c242);_0x203725[_0x531a('0x4')](_0x53bc31?_0x42c242:null),_0x186e69['isVisible']=_0x557ec3||_0x53bc31;}else _0x186e69['isVisible']=!0x0,_0x203725[_0x531a('0x4')](null);}const _0x1a2347=_0x273a24[_0x531a('0x1')](_0x430a03=>_0x430a03['isVisible'])[_0x531a('0x6')];_0x5b294e+=_0x3cbb3f[_0x531a('0x7')][_0x531a('0x6')],_0x517a79+=_0x557ec3?_0x3cbb3f[_0x531a('0x7')][_0x531a('0x6')]:_0x1a2347,_0x3cbb3f['isVisible']=_0x557ec3||!!_0x1a2347;}return{'resultsCount':_0x517a79,'totalItemsCount':_0x5b294e};}}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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/buttonlabelwithhighlightview
|
|
7
7
|
*/
|
|
8
|
-
import { type ButtonLabel, HighlightedTextView } from 'ckeditor5/src/ui';
|
|
8
|
+
import { type ButtonLabel, HighlightedTextView } from 'ckeditor5/src/ui.js';
|
|
9
9
|
/**
|
|
10
10
|
* A button label view that can highlight a text fragment.
|
|
11
11
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
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
|
|
23
|
+
const _0x186a=['ck-button__label','style','set'];(function(_0x3b033c,_0x186a26){const _0x18b4c4=function(_0x3c990a){while(--_0x3c990a){_0x3b033c['push'](_0x3b033c['shift']());}};_0x18b4c4(++_0x186a26);}(_0x186a,0x73));const _0x18b4=function(_0x3b033c,_0x186a26){_0x3b033c=_0x3b033c-0x0;let _0x18b4c4=_0x186a[_0x3b033c];return _0x18b4c4;};import{HighlightedTextView as _0x21b1a7}from'ckeditor5/src/ui.js';export default class k extends _0x21b1a7{constructor(){super(),this[_0x18b4('0x1')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x48cca5=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x18b4('0x2')],'style':_0x48cca5['to'](_0x18b4('0x0')),'id':_0x48cca5['to']('id')}});}}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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/labelwithhighlightview
|
|
7
7
|
*/
|
|
8
|
-
import { type LabelView, HighlightedTextView } from 'ckeditor5/src/ui';
|
|
8
|
+
import { type LabelView, HighlightedTextView } from 'ckeditor5/src/ui.js';
|
|
9
9
|
/**
|
|
10
10
|
* A label view that can highlight a text fragment.
|
|
11
11
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
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
|
|
23
|
+
const _0x52ec=['for','set','ck-editor__label_','extendTemplate','bindTemplate','ck-label'];(function(_0x5b574b,_0x52ec17){const _0x2f766c=function(_0x154ef9){while(--_0x154ef9){_0x5b574b['push'](_0x5b574b['shift']());}};_0x2f766c(++_0x52ec17);}(_0x52ec,0x1e4));const _0x2f76=function(_0x5b574b,_0x52ec17){_0x5b574b=_0x5b574b-0x0;let _0x2f766c=_0x52ec[_0x5b574b];return _0x2f766c;};import{HighlightedTextView as _0x102864}from'ckeditor5/src/ui.js';import{uid as _0xa22d88}from'ckeditor5/src/utils.js';export default class C extends _0x102864{constructor(){super(),this[_0x2f76('0x3')](_0x2f76('0x2'),void 0x0);const _0x67410b=this[_0x2f76('0x0')];this['id']=_0x2f76('0x4')+_0xa22d88(),this[_0x2f76('0x5')]({'attributes':{'class':['ck',_0x2f76('0x1')],'id':this['id'],'for':_0x67410b['to'](_0x2f76('0x2'))}});}}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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/aiformcontentarea
|
|
7
7
|
*/
|
|
8
|
-
import { type Locale } from 'ckeditor5/src/utils';
|
|
9
|
-
import { View, ButtonView } from 'ckeditor5/src/ui';
|
|
8
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { View, ButtonView } from 'ckeditor5/src/ui.js';
|
|
10
10
|
/**
|
|
11
11
|
* A class representing the text area view of the AI assistant.
|
|
12
12
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
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
|
|
23
|
+
const _0x1e56=['clipboard','element','_createCopyButton','ClipboardItem','execute','icon','_createLoader','isEnabled','contentFieldView','createElement','check','.ck-ai-form__loader','setTemplate','innerHTML','ck-ai-form__loader','lastElementChild','Copy','locale','setEndBefore','execCommand','class','isProcessing','scrollTo','AI\x20is\x20writing...','style','copy','position','ck-ai-form__content-area-wrapper','ck-ai-form__copy-button','focus','isVisible','scrollHeight','copyButtonView','change:isProcessing','set','textContent','setStartAfter','ck-hidden','value','ck-reset_all-excluded','loaderView','-9999px','appendLoader','render','ck-content','div','smooth','setContent','ck-ai-form__content-area','left','_copyHTMLToClipboard','bind','listenTo','getSelection','querySelector','change:value','firstElementChild','<span>[</span>','text/html','appendChild','createRange','absolute','write'];(function(_0x54bf70,_0x1e5672){const _0x2cd7fe=function(_0x3da8ce){while(--_0x3da8ce){_0x54bf70['push'](_0x54bf70['shift']());}};_0x2cd7fe(++_0x1e5672);}(_0x1e56,0x1c8));const _0x2cd7=function(_0x54bf70,_0x1e5672){_0x54bf70=_0x54bf70-0x0;let _0x2cd7fe=_0x1e56[_0x54bf70];return _0x2cd7fe;};import{global as _0x3c25a9}from'ckeditor5/src/utils.js';import{View as _0x44738e,ButtonView as _0x4ce293,SpinnerView as _0x1207ed}from'ckeditor5/src/ui.js';import _0x7b5e7a from'../../../theme/icons/copy.svg';import{getTranslation as _0x62bf9}from'../../utils/common-translations.js';import{icons as _0x13984f}from'ckeditor5/src/core.js';export default class X extends _0x44738e{constructor(_0x50abfb,_0x2b510f=''){super(_0x50abfb),this[_0x2cd7('0x13')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xe96df1=this['bindTemplate'];this[_0x2cd7('0x38')]=new ContentFieldView(_0x50abfb,_0x2b510f),this['copyButtonView']=this[_0x2cd7('0x32')](),this[_0x2cd7('0x3c')]({'tag':_0x2cd7('0x1e'),'attributes':{'class':['ck',_0x2cd7('0xc'),_0xe96df1['if']('isVisible',_0x2cd7('0x16'),_0x10868e=>!_0x10868e)],'tabindex':'-1'},'children':[{'tag':_0x2cd7('0x1e'),'attributes':{'class':['ck',_0x2cd7('0x21'),_0xe96df1['if'](_0x2cd7('0x6'),'ck-ai-form__content-area--processing')]},'children':[this[_0x2cd7('0x38')],{'tag':_0x2cd7('0x1e'),'attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this[_0x2cd7('0x11')]]}]}]});}[_0x2cd7('0x1c')](){super['render'](),this[_0x2cd7('0x17')]&&this[_0x2cd7('0x38')][_0x2cd7('0x20')](this['value']);let _0x122591=!0x1;this['on'](_0x2cd7('0x28'),(_0x23f825,_0x38d82c,_0x3867dc)=>{const _0x2bb706=!this[_0x2cd7('0x38')][_0x2cd7('0x31')][_0x2cd7('0x27')](_0x2cd7('0x3b'));this[_0x2cd7('0x38')][_0x2cd7('0x20')](_0x3867dc),this[_0x2cd7('0x6')]&&_0x2bb706&&!_0x122591&&this[_0x2cd7('0x31')][_0x2cd7('0x7')]({'top':this[_0x2cd7('0x31')][_0x2cd7('0x10')],'behavior':_0x2cd7('0x1f')});}),this['on'](_0x2cd7('0x12'),(_0x109699,_0x2432e5,_0xd3d5ac)=>{_0x122591=!0x1,_0xd3d5ac?(this[_0x2cd7('0x17')]=null,this[_0x2cd7('0x38')][_0x2cd7('0x1b')]()):this[_0x2cd7('0x17')]||this['contentFieldView'][_0x2cd7('0x20')]('');}),this[_0x2cd7('0x25')](this[_0x2cd7('0x31')],'wheel',()=>{_0x122591=!0x0;}),this[_0x2cd7('0x25')](this[_0x2cd7('0x31')],'mousedown',()=>{_0x122591=!0x0;});}[_0x2cd7('0xe')](){this[_0x2cd7('0x31')][_0x2cd7('0xe')]();}[_0x2cd7('0x32')](){const _0xa8ad6d=this[_0x2cd7('0x2')],_0x28ae72=new _0x4ce293(this['locale']),_0x1a74e6=_0x2cd7('0xd');return _0x28ae72[_0x2cd7('0x13')]({'label':_0x62bf9(_0xa8ad6d,_0x2cd7('0x1')),'icon':_0x7b5e7a,'class':_0x1a74e6,'tooltip':!0x0}),_0x28ae72['bind'](_0x2cd7('0xf'))['to'](this,_0x2cd7('0x17'),_0x1a7478=>!!_0x1a7478),_0x28ae72[_0x2cd7('0x24')](_0x2cd7('0x37'))['to'](this,_0x2cd7('0x6'),_0x6b4cb9=>!_0x6b4cb9),_0x28ae72['on'](_0x2cd7('0x34'),()=>{this[_0x2cd7('0x23')](this[_0x2cd7('0x38')][_0x2cd7('0x31')]),_0x28ae72[_0x2cd7('0x35')]=_0x13984f[_0x2cd7('0x3a')],_0x28ae72['class']=_0x1a74e6+'\x20ck-ai-form__copy-button--copied',this[_0x2cd7('0xe')](),setTimeout(()=>{_0x28ae72[_0x2cd7('0x35')]=_0x7b5e7a,_0x28ae72[_0x2cd7('0x5')]=_0x1a74e6;},0x3e8);}),_0x28ae72;}[_0x2cd7('0x23')](_0x54502f){const {window:_0x293fe6,document:_0x18fdf8}=_0x3c25a9;if(_0x293fe6[_0x2cd7('0x33')]){const {Blob:_0x44cf59,ClipboardItem:_0x1c110e}=_0x293fe6,_0x24da40=[new _0x1c110e({'text/html':new _0x44cf59([_0x54502f[_0x2cd7('0x3d')]],{'type':_0x2cd7('0x2b')}),'text/plain':new _0x44cf59([_0x54502f[_0x2cd7('0x14')]||''],{'type':'text/plain'})})];navigator[_0x2cd7('0x30')][_0x2cd7('0x2f')](_0x24da40);}else{const _0xc9ba6e=_0x18fdf8[_0x2cd7('0x39')](_0x2cd7('0x1e'));_0xc9ba6e['style'][_0x2cd7('0xb')]=_0x2cd7('0x2e'),_0xc9ba6e[_0x2cd7('0x9')][_0x2cd7('0x22')]=_0x2cd7('0x1a'),_0xc9ba6e[_0x2cd7('0x3d')]=_0x2cd7('0x2a')+_0x54502f['innerHTML']+'<span>]</span>',_0x18fdf8['body'][_0x2cd7('0x2c')](_0xc9ba6e);const _0x1200b2=_0x18fdf8[_0x2cd7('0x2d')]();_0x1200b2[_0x2cd7('0x15')](_0xc9ba6e[_0x2cd7('0x29')]),_0x1200b2[_0x2cd7('0x3')](_0xc9ba6e[_0x2cd7('0x0')]);const _0x403bf8=_0x293fe6[_0x2cd7('0x26')]();_0x403bf8['removeAllRanges'](),_0x403bf8['addRange'](_0x1200b2),_0x18fdf8[_0x2cd7('0x4')](_0x2cd7('0xa')),_0xc9ba6e['remove']();}}}export class ContentFieldView extends _0x44738e{constructor(_0x5823a1,_0xb775f8=''){super(_0x5823a1),this[_0x2cd7('0x19')]=this[_0x2cd7('0x36')](),this['setTemplate']({'tag':'div','attributes':{'class':['ck',_0x2cd7('0x1d'),_0xb775f8,_0x2cd7('0x18'),'ck-ai-form__content-field']}});}[_0x2cd7('0x20')](_0x472c59){this['element'][_0x2cd7('0x3d')]=_0x472c59;}['appendLoader'](){this[_0x2cd7('0x31')][_0x2cd7('0x2c')](this[_0x2cd7('0x19')]['element']);}['_createLoader'](){const _0x1026ac=new _0x44738e(),_0x5aa48f=this[_0x2cd7('0x2')],_0x3391fb=new _0x1207ed();return _0x3391fb[_0x2cd7('0xf')]=!0x0,_0x1026ac[_0x2cd7('0x3c')]({'tag':'div','attributes':{'class':['ck',_0x2cd7('0x3e')]},'children':[_0x3391fb,{'text':_0x62bf9(_0x5aa48f,_0x2cd7('0x8'))}]}),_0x1026ac[_0x2cd7('0x1c')](),_0x1026ac;}}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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/aiformerrorview
|
|
7
7
|
*/
|
|
8
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
9
|
-
import { View } from 'ckeditor5/src/ui';
|
|
8
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
10
10
|
/**
|
|
11
11
|
* A class representing the error view of the AI assistant.
|
|
12
12
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
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
|
|
23
|
+
const _0x435d=['text','set','setTemplate','ck-ai-form__error'];(function(_0x540696,_0x435d3f){const _0x420608=function(_0x5f2213){while(--_0x5f2213){_0x540696['push'](_0x540696['shift']());}};_0x420608(++_0x435d3f);}(_0x435d,0x1c5));const _0x4206=function(_0x540696,_0x435d3f){_0x540696=_0x540696-0x0;let _0x420608=_0x435d[_0x540696];return _0x420608;};import{View as _0x426225,IconView as _0x4d328a}from'ckeditor5/src/ui.js';import _0x2d49da from'../../../theme/icons/error.svg';export default class rt extends _0x426225{constructor(_0x3c9b78,_0x4512ab=''){super(_0x3c9b78);const _0xc69f7c=new _0x4d328a(),_0xcf1cb7=this['bindTemplate'];this[_0x4206('0x0')](_0x4206('0x3'),_0x4512ab),_0xc69f7c['content']=_0x2d49da,this[_0x4206('0x1')]({'tag':'div','attributes':{'class':['ck',_0x4206('0x2')]},'children':[_0xc69f7c,{'text':_0xcf1cb7['to']('text')}]});}}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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/aiformpromptview
|
|
7
7
|
*/
|
|
8
|
-
import { type Locale } from 'ckeditor5/src/utils';
|
|
9
|
-
import { AutocompleteView, ButtonView, type TextareaView, type AutocompleteViewConfig } from 'ckeditor5/src/ui';
|
|
8
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { AutocompleteView, ButtonView, type TextareaView, type AutocompleteViewConfig } from 'ckeditor5/src/ui.js';
|
|
10
10
|
/**
|
|
11
11
|
* A textarea field allowing to ask AI.
|
|
12
12
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
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
|
|
23
|
+
const _0x40e6=['window','submit','fieldView','isEnabled','style','update','submitButtonView','render','focusCycler','focus','_createSubmitButton','history','bind','left','fieldWrapperChildren','add','History','execute','keystrokes','enter','minRows','target','Submit','maxRows','ck-ai-form__toggle-history','isVisible','children','focusableChildren','focusFirst','filteredView','ck-ai-form__submit','isEmpty','resultsView','width','value','locale','fire','requestAnimationFrame','_createShowHistoryButton','uiLanguageDirection','set','rtl','right','element','excludeScrollbarsAndBorders','showHistoryButtonView','queryView','isOn','focusLast'];(function(_0x1efa2e,_0x40e698){const _0x571045=function(_0x392924){while(--_0x392924){_0x1efa2e['push'](_0x1efa2e['shift']());}};_0x571045(++_0x40e698);}(_0x40e6,0xe6));const _0x5710=function(_0x1efa2e,_0x40e698){_0x1efa2e=_0x1efa2e-0x0;let _0x571045=_0x40e6[_0x1efa2e];return _0x571045;};import{Rect as _0x2ce0e0,global as _0x125f59,isVisible as _0x47391b}from'ckeditor5/src/utils.js';import{AutocompleteView as _0x2082c6,ButtonView as _0x242b40}from'ckeditor5/src/ui.js';import{icons as _0x395ff5}from'ckeditor5/src/core.js';import{getTranslation as _0x50b2ca}from'../../utils/common-translations.js';import _0x337335 from'../../../theme/icons/submit.svg';export default class ht extends _0x2082c6{constructor(_0x584c58,_0x16261a){super(_0x584c58,_0x16261a),this[_0x5710('0xc')]['fieldView'][_0x5710('0x23')]=0x1,this['queryView'][_0x5710('0x11')][_0x5710('0x26')]=0x3,this['submitButtonView']=this[_0x5710('0x19')](),this[_0x5710('0xb')]=this[_0x5710('0x4')](),this[_0x5710('0x2a')][_0x5710('0x1e')](this[_0x5710('0xb')],0x1),this[_0x5710('0x2a')][_0x5710('0x1e')](this['submitButtonView']);}[_0x5710('0x16')](){super[_0x5710('0x16')](),this[_0x5710('0xc')][_0x5710('0x1d')][_0x5710('0x1e')](this[_0x5710('0xb')]),this[_0x5710('0x29')]['add'](this[_0x5710('0x15')]),this[_0x5710('0x21')][_0x5710('0x6')](_0x5710('0x22'),(_0x768a70,_0x376326)=>{_0x768a70[_0x5710('0x24')]==this[_0x5710('0xc')][_0x5710('0x11')][_0x5710('0x9')]&&(this[_0x5710('0x10')](),_0x376326());});}['_createSubmitButton'](){const _0x418356=new _0x242b40(this[_0x5710('0x1')]),_0x2a6180=this['locale'];return _0x418356[_0x5710('0x6')]({'icon':_0x337335,'label':_0x50b2ca(_0x2a6180,_0x5710('0x25')),'isVisible':!0x0,'tooltip':!0x0,'class':_0x5710('0x2d')}),_0x418356['on']('execute',()=>{this[_0x5710('0x10')]();}),_0x418356[_0x5710('0x1b')]('isEnabled')['to'](this[_0x5710('0xc')][_0x5710('0x11')],_0x5710('0x2e'),this,_0x5710('0x12'),(_0x45e3aa,_0x3c0bd4)=>!_0x45e3aa&&_0x3c0bd4),_0x418356;}['_createShowHistoryButton'](){const _0x275351=new _0x242b40(this[_0x5710('0x1')]),_0x228da6=this[_0x5710('0x2f')],_0x3f351a=this['locale'];_0x275351[_0x5710('0x6')]({'label':_0x50b2ca(_0x3f351a,_0x5710('0x1f')),'withText':!0x1,'icon':_0x395ff5[_0x5710('0x1a')],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x5710('0x27')}),_0x275351[_0x5710('0x1b')](_0x5710('0xd'))['to'](_0x228da6,_0x5710('0x28')),_0x275351[_0x5710('0x1b')](_0x5710('0x12'))['to'](this,_0x5710('0x12')),_0x275351['on'](_0x5710('0x20'),()=>{_0x228da6['isVisible']=!_0x228da6[_0x5710('0x28')],_0x228da6[_0x5710('0x28')]?this[_0x5710('0x2c')][_0x5710('0x18')]():this[_0x5710('0x18')]();});const _0x3f86c3=()=>{_0x125f59[_0x5710('0xf')][_0x5710('0x3')](()=>{if(_0x47391b(this[_0x5710('0x9')])){const _0x98c5cf=new _0x2ce0e0(this[_0x5710('0xc')]['fieldView'][_0x5710('0x9')]),_0x28b284=_0x98c5cf['width'],_0x48f492=_0x5710('0x7')===_0x3f351a[_0x5710('0x5')]?_0x5710('0x1c'):_0x5710('0x8');_0x98c5cf[_0x5710('0xa')](),_0x275351['element'][_0x5710('0x13')][_0x48f492]=_0x28b284-_0x98c5cf[_0x5710('0x30')]+0x1+'px';}});};return this['queryView'][_0x5710('0x11')]['on'](_0x5710('0x14'),_0x3f86c3),this['on']('render',_0x3f86c3),_0x275351;}['submit'](){const _0x104be3=this[_0x5710('0xc')]['fieldView'][_0x5710('0x9')][_0x5710('0x0')];this[_0x5710('0x2')](_0x5710('0x10'),_0x104be3);}[_0x5710('0x18')](_0x26ba80){-0x1===_0x26ba80?this[_0x5710('0x17')][_0x5710('0xe')]():this[_0x5710('0x17')][_0x5710('0x2b')]();}}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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/aiformtoolbarview
|
|
7
7
|
*/
|
|
8
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
9
|
-
import { ToolbarView, ButtonView } from 'ckeditor5/src/ui';
|
|
8
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { ToolbarView, ButtonView } from 'ckeditor5/src/ui.js';
|
|
10
10
|
/**
|
|
11
11
|
* The action name affecting the label of {@link ~AIFormToolbarView#replaceButton}.
|
|
12
|
+
*
|
|
13
|
+
* Available keys are:
|
|
14
|
+
* * `AIFormToolbarViewMainActionLabel.REPLACE`,
|
|
15
|
+
* * `AIFormToolbarViewMainActionLabel.INSERT`
|
|
12
16
|
*/
|
|
13
|
-
export declare
|
|
14
|
-
REPLACE
|
|
15
|
-
INSERT
|
|
16
|
-
}
|
|
17
|
+
export declare const AIFormToolbarViewMainActionLabel: {
|
|
18
|
+
readonly REPLACE: "replace";
|
|
19
|
+
readonly INSERT: "insert";
|
|
20
|
+
};
|
|
17
21
|
/**
|
|
18
22
|
* A class representing the text area view of the AI assistant.
|
|
19
23
|
*/
|
|
@@ -46,7 +50,7 @@ export default class AIFormToolbarView extends ToolbarView {
|
|
|
46
50
|
*
|
|
47
51
|
* @default 'replace'
|
|
48
52
|
*/
|
|
49
|
-
mainAction: AIFormToolbarViewMainActionLabel;
|
|
53
|
+
mainAction: typeof AIFormToolbarViewMainActionLabel[keyof typeof AIFormToolbarViewMainActionLabel];
|
|
50
54
|
/**
|
|
51
55
|
* @inheritDoc
|
|
52
56
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2003-
|
|
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
|
|
23
|
+
const _0x5611=['replace','ck-ai-form__toolbar','stopButton','bind','ck-button-action','addMany','_CONTENT','insert','REPLACE','insertButton','Stop','isVisible','extendTemplate','tryAgainButton','set','bindTemplate','locale','mainAction','replaceButton','ck-hidden','items','toUpperCase','_createButton','label','AI_','Try\x20again'];(function(_0x1e0b64,_0x5611c9){const _0x8ad26=function(_0x3b98d0){while(--_0x3b98d0){_0x1e0b64['push'](_0x1e0b64['shift']());}};_0x8ad26(++_0x5611c9);}(_0x5611,0xe2));const _0x8ad2=function(_0x1e0b64,_0x5611c9){_0x1e0b64=_0x1e0b64-0x0;let _0x8ad26=_0x5611[_0x1e0b64];return _0x8ad26;};import{ToolbarView as _0x316226,ButtonView as _0x51b354}from'ckeditor5/src/ui.js';import{getTranslation as _0xddaf14}from'../../utils/common-translations.js';export const AIFormToolbarViewMainActionLabel={'REPLACE':_0x8ad2('0x8'),'INSERT':_0x8ad2('0xf')};export default class at extends _0x316226{constructor(_0x46e0de){super(_0x46e0de),this[_0x8ad2('0x16')](_0x8ad2('0x13'),!0x1),this[_0x8ad2('0x16')](_0x8ad2('0x19'),AIFormToolbarViewMainActionLabel[_0x8ad2('0x10')]),this[_0x8ad2('0x0')]=this['_createButton']('',_0x8ad2('0xc')),this[_0x8ad2('0x0')][_0x8ad2('0xb')](_0x8ad2('0x5'))['to'](this,_0x8ad2('0x19'),_0x135715=>_0xddaf14(_0x46e0de,_0x8ad2('0x6')+_0x135715[_0x8ad2('0x3')]()+_0x8ad2('0xe'))),this[_0x8ad2('0x11')]=this['_createButton'](_0xddaf14(_0x46e0de,'Insert\x20below')),this['tryAgainButton']=this[_0x8ad2('0x4')](_0xddaf14(_0x46e0de,_0x8ad2('0x7'))),this[_0x8ad2('0xa')]=this['_createButton'](_0xddaf14(_0x46e0de,_0x8ad2('0x12')));const _0x47c062=this[_0x8ad2('0x17')];this[_0x8ad2('0x14')]({'attributes':{'class':[_0x8ad2('0x9'),_0x47c062['if'](_0x8ad2('0x13'),_0x8ad2('0x1'),_0x37273a=>!_0x37273a)]}}),this[_0x8ad2('0x2')][_0x8ad2('0xd')]([this[_0x8ad2('0x0')],this[_0x8ad2('0x11')],this[_0x8ad2('0x15')],this[_0x8ad2('0xa')]]);}[_0x8ad2('0x4')](_0x56ab73,_0x2405f3){const _0x2f41c4=new _0x51b354(this[_0x8ad2('0x18')]);return _0x2f41c4[_0x8ad2('0x16')]({'label':_0x56ab73,'class':_0x2405f3||'','isVisible':!0x0,'withText':!0x0}),_0x2f41c4;}}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
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/aiformview
|
|
7
7
|
*/
|
|
8
|
-
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
9
|
-
import { View,
|
|
10
|
-
import AIFormToolbarView, { AIFormToolbarViewMainActionLabel } from './aiformtoolbarview';
|
|
11
|
-
import AIFormContentArea from './aiformcontentarea';
|
|
12
|
-
import AIFormErrorView from './aiformerrorview';
|
|
13
|
-
import AIFormPromptView from './aiformpromptview';
|
|
8
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { View, type ViewWithFocusCycler } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import AIFormToolbarView, { AIFormToolbarViewMainActionLabel } from './aiformtoolbarview.js';
|
|
11
|
+
import AIFormContentArea from './aiformcontentarea.js';
|
|
12
|
+
import AIFormErrorView from './aiformerrorview.js';
|
|
13
|
+
import AIFormPromptView from './aiformpromptview.js';
|
|
14
14
|
/**
|
|
15
15
|
* A class representing the form view of the AI assistant.
|
|
16
16
|
*/
|
|
17
|
-
export default class AIFormView extends View {
|
|
17
|
+
export default class AIFormView extends View implements ViewWithFocusCycler {
|
|
18
18
|
/**
|
|
19
19
|
* Tracks information about the DOM focus in the form.
|
|
20
20
|
*
|
|
@@ -27,10 +27,6 @@ export default class AIFormView extends View {
|
|
|
27
27
|
* @readonly
|
|
28
28
|
*/
|
|
29
29
|
keystrokes: KeystrokeHandler;
|
|
30
|
-
/**
|
|
31
|
-
* The view that represent the header of the form.
|
|
32
|
-
*/
|
|
33
|
-
header: FormHeaderView;
|
|
34
30
|
/**
|
|
35
31
|
* The text area view that is used to display AI response.
|
|
36
32
|
*/
|
|
@@ -78,7 +74,7 @@ export default class AIFormView extends View {
|
|
|
78
74
|
*
|
|
79
75
|
* @default 'replace'
|
|
80
76
|
*/
|
|
81
|
-
mainAction: AIFormToolbarViewMainActionLabel;
|
|
77
|
+
mainAction: typeof AIFormToolbarViewMainActionLabel[keyof typeof AIFormToolbarViewMainActionLabel];
|
|
82
78
|
/**
|
|
83
79
|
* Creates an instance of the {@link module:ai/ui/aiformview~AIFormView} class.
|
|
84
80
|
*
|
|
@@ -89,7 +85,10 @@ export default class AIFormView extends View {
|
|
|
89
85
|
* @inheritDoc
|
|
90
86
|
*/
|
|
91
87
|
render(): void;
|
|
92
|
-
|
|
88
|
+
/**
|
|
89
|
+
* @inheritDoc
|
|
90
|
+
*/
|
|
91
|
+
focus(direction?: 1 | -1): void;
|
|
93
92
|
/**
|
|
94
93
|
* Resets the form to the initial values.
|
|
95
94
|
*/
|