@ckeditor/ckeditor5-ai 40.2.0 → 41.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +28 -20
- 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
package/src/index.js
CHANGED
|
@@ -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
|
-
export{default as AIAssistant}from'./aiassistant';export{default as AIAdapter,AIRequestError}from'./adapters/aiadapter';export{default as AITextAdapter}from'./adapters/aitextadapter';export{default as OpenAITextAdapter}from'./adapters/openaitextadapter';export{default as AWSTextAdapter}from'./adapters/awstextadapter';import'./augmentation';
|
|
23
|
+
export{default as AIAssistant}from'./aiassistant.js';export{default as AIAdapter,AIRequestError}from'./adapters/aiadapter.js';export{default as AITextAdapter}from'./adapters/aitextadapter.js';export{default as OpenAITextAdapter}from'./adapters/openaitextadapter.js';export{default as AWSTextAdapter}from'./adapters/awstextadapter.js';import'./augmentation.js';
|
|
@@ -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 _0x21d2=['setContentOf','once','element','document','domConverter','isProcessing','remove','length','createElement','_sanitizeHTML','toModel','prompt','listenTo','push','exec','view','reset','editing','toView','data','stopProcessing','ELEMENT_NODE','currentContext','editor','textAdapter','nodeType','_normalizeResponseHeadings','_xmlSerializer','innerHTML','bind','match','serializeToString','previousQuery','stopListening','body','catch','name','initialContext','_handleQuery','then','processor','isRendered','_domParser','currentResponse','stringify','previousContext','childNodes','render','abort','previousActionId','custom','_parseAndNormalizeContent','_sanitizationContainer','finally','finishProcessing','value','substring','text/html','previousLabel','rename','updateView','mainAction'];(function(_0x251f43,_0x21d27f){const _0xce2700=function(_0x1c7d29){while(--_0x1c7d29){_0x251f43['push'](_0x251f43['shift']());}};_0xce2700(++_0x21d27f);}(_0x21d2,0x100));const _0xce27=function(_0x251f43,_0x21d27f){_0x251f43=_0x251f43-0x0;let _0xce2700=_0x21d2[_0x251f43];return _0xce2700;};import{ObservableMixin as _0x28c68c}from'ckeditor5/src/utils.js';import{AIRequestError as _0x4ca304}from'../adapters/aiadapter.js';import{Matcher as _0x5f22e4,UpcastWriter as _0x55009a}from'ckeditor5/src/engine.js';const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');export default class y extends _0x28c68c(){constructor(_0x4215cc,_0x149194,_0x4ebffc){super(),this[_0xce27('0xf')]=_0x4215cc,this['textAdapter']=_0x149194,this['_sanitizationContainer']=document[_0xce27('0x0')]('div'),this[_0xce27('0x22')]=new DOMParser(),this[_0xce27('0x13')]=new XMLSerializer(),this['view']=_0x4ebffc,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this[_0xce27('0x7')][_0xce27('0x15')](_0xce27('0x2f'))['to'](this,_0xce27('0xe'),this[_0xce27('0x1')][_0xce27('0x15')](this)),this['listenTo'](this[_0xce27('0x7')],'submitPrompt',(_0x5b03ca,_0x397ee7)=>{const _0x2d0765=this[_0xce27('0xe')]||this[_0xce27('0x1d')];this[_0xce27('0x1e')](_0x397ee7,_0x2d0765,_0xce27('0x2a'));}),this[_0xce27('0x4')](this[_0xce27('0x7')],'tryAgainEvent',()=>{this[_0xce27('0x7')][_0xce27('0x3')]=this[_0xce27('0x32')],this[_0xce27('0x1e')](this['previousQuery'],this[_0xce27('0x25')],this['previousActionId'],this[_0xce27('0x32')]);}),this['listenTo'](this[_0xce27('0x7')],_0xce27('0xc'),()=>{this[_0xce27('0xc')]();});}['destroy'](){this[_0xce27('0x19')]();}async[_0xce27('0x34')]({actionId:_0x44b9d0,query:_0x59a502,htmlContent:_0x3ad0f4,label:_0x118d20,mainActionLabel:_0x3deed4}){this[_0xce27('0x7')][_0xce27('0x3')]=_0x118d20,this[_0xce27('0x7')][_0xce27('0x35')]=_0x3deed4,this['initialContext']=_0x3ad0f4,_0x59a502&&(this[_0xce27('0x7')][_0xce27('0x21')]?this[_0xce27('0x1e')](_0x59a502,_0x3ad0f4,_0x44b9d0,_0x118d20):this['view'][_0xce27('0x37')](_0xce27('0x27'),()=>{this[_0xce27('0x1e')](_0x59a502,_0x3ad0f4,_0x44b9d0,_0x118d20);}));}['stopProcessing'](){this[_0xce27('0x3b')]&&(this['isProcessing']=!0x1,this[_0xce27('0x7')][_0xce27('0x2e')](),this[_0xce27('0x10')][_0xce27('0x28')]());}[_0xce27('0x8')](){this[_0xce27('0x1d')]='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this[_0xce27('0x18')]='',this[_0xce27('0x32')]='',this['previousActionId']=void 0x0,this['view'][_0xce27('0x8')](),this[_0xce27('0xc')]();}async[_0xce27('0x1e')](_0x382a15,_0x1cfda8,_0x449310,_0x46a1c6){return this[_0xce27('0x3b')]=!0x0,this['view']['startProcessing'](),this[_0xce27('0x25')]=_0x1cfda8,this[_0xce27('0x18')]=_0x382a15,this[_0xce27('0x32')]=_0x46a1c6||_0x382a15,this[_0xce27('0x29')]=_0x449310,new Promise(_0x50924d=>{this['textAdapter']['makeRequest']({'query':_0x382a15,'context':_0x1cfda8,'onData':_0x2ff3da=>{this[_0xce27('0x23')]=_0x2ff3da,this[_0xce27('0xe')]=this[_0xce27('0x2b')](this['currentResponse']);},'actionId':_0x449310})[_0xce27('0x1f')](()=>{!this['currentContext']&&this[_0xce27('0x23')]&&(this[_0xce27('0xe')]=this[_0xce27('0x2b')](this['currentResponse'],!0x0));})[_0xce27('0x1b')](_0x5b6432=>{_0x5b6432 instanceof _0x4ca304?this[_0xce27('0x7')]['handleError'](_0x5b6432['message']):this[_0xce27('0x7')]['handleError'](),_0x50924d();})[_0xce27('0x2d')](()=>{this['stopProcessing'](),_0x50924d();});});}['_parseAndNormalizeContent'](_0x4f933e,_0xabbf59=!0x1){const _0x173531=Z[_0xce27('0x6')](_0x4f933e);_0x173531?_0x4f933e=_0x4f933e[_0xce27('0x30')](_0x173531[0x1][_0xce27('0x3d')]):_0x4f933e[_0xce27('0x3d')]<0x64&&!_0xabbf59&&(_0x4f933e='');const _0x382025=this[_0xce27('0x22')]['parseFromString'](_0x4f933e,_0xce27('0x31'));if(_0x173531)for(const _0x3683bb of _0x382025[_0xce27('0x1a')][_0xce27('0x26')])_0x3683bb[_0xce27('0x11')]!=Node[_0xce27('0xd')]&&_0x3683bb[_0xce27('0x3c')]();const _0x542f29=this[_0xce27('0xf')][_0xce27('0xb')][_0xce27('0x20')][_0xce27('0xa')](this[_0xce27('0x13')][_0xce27('0x17')](_0x382025[_0xce27('0x1a')]));return this['_normalizeResponseHeadings'](_0x542f29),this[_0xce27('0xf')]['data'][_0xce27('0x24')](this[_0xce27('0xf')][_0xce27('0xb')][_0xce27('0x2')](_0x542f29));}[_0xce27('0x12')](_0x5365ca){const _0x4be235=new _0x55009a(this['editor'][_0xce27('0x9')][_0xce27('0x7')][_0xce27('0x39')]),_0x58837f=new _0x5f22e4({'name':/^h[1-5]$/}),_0x5e1509=[];let _0x49f6dc=!0x1;for(const _0x1cf1d6 of _0x5365ca)_0x1cf1d6['is'](_0xce27('0x38'))&&_0x58837f[_0xce27('0x16')](_0x1cf1d6)&&(_0x5e1509[_0xce27('0x5')](_0x1cf1d6),'h1'==_0x1cf1d6['name']&&(_0x49f6dc=!0x0));if(_0x49f6dc)for(const _0xdd94af of _0x5e1509)_0x4be235[_0xce27('0x33')]('h'+(parseInt(_0xdd94af[_0xce27('0x1c')][0x1])+0x1),_0xdd94af);}[_0xce27('0x1')](_0x7a601d){return this[_0xce27('0xf')][_0xce27('0x9')]['view'][_0xce27('0x3a')][_0xce27('0x36')](this[_0xce27('0x2c')],_0x7a601d),this[_0xce27('0x2c')][_0xce27('0x14')];}}
|
|
@@ -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 _0x52fa=['label','length','match','labelView','isVisible','highlightText','items','children','filter'];(function(_0x590b12,_0x52fa21){const _0x3d8bc5=function(_0x41bf3c){while(--_0x41bf3c){_0x590b12['push'](_0x590b12['shift']());}};_0x3d8bc5(++_0x52fa21);}(_0x52fa,0x1da));const _0x3d8b=function(_0x590b12,_0x52fa21){_0x590b12=_0x590b12-0x0;let _0x3d8bc5=_0x52fa[_0x590b12];return _0x3d8bc5;};import{ListView as _0x427608}from'ckeditor5/src/ui.js';export default class j extends _0x427608{[_0x3d8b('0x2')](_0x58ae36){let _0x5dcb81=0x0,_0x27d274=0x0;for(const _0x2e662c of this['items']){const _0x3fd615=_0x2e662c,_0x2e547e=_0x3fd615[_0x3d8b('0x0')],_0x1e8274=_0x58ae36&&!!_0x3fd615[_0x3d8b('0x3')][_0x3d8b('0x5')](_0x58ae36);_0x3fd615[_0x3d8b('0x6')]['highlightText'](_0x1e8274?_0x58ae36:null);for(const _0x11f9e2 of _0x2e547e){const _0x4e523d=_0x11f9e2[_0x3d8b('0x1')]['first'],_0x1117af=_0x4e523d[_0x3d8b('0x6')];if(_0x58ae36){const _0xb3ce8e=!!_0x4e523d[_0x3d8b('0x3')][_0x3d8b('0x5')](_0x58ae36);_0x1117af[_0x3d8b('0x8')](_0xb3ce8e?_0x58ae36:null),_0x11f9e2[_0x3d8b('0x7')]=_0x1e8274||_0xb3ce8e;}else _0x11f9e2[_0x3d8b('0x7')]=!0x0,_0x1117af[_0x3d8b('0x8')](null);}const _0x8797a1=_0x2e547e[_0x3d8b('0x2')](_0x31c2a7=>_0x31c2a7[_0x3d8b('0x7')])[_0x3d8b('0x4')];_0x5dcb81+=_0x3fd615[_0x3d8b('0x0')]['length'],_0x27d274+=_0x1e8274?_0x3fd615['items']['length']:_0x8797a1,_0x3fd615[_0x3d8b('0x7')]=_0x1e8274||!!_0x8797a1;}return{'resultsCount':_0x27d274,'totalItemsCount':_0x5dcb81};}}
|
|
@@ -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 _0x2a8c=['set','extendTemplate','bindTemplate','style','ck-button__label'];(function(_0x3a8cc5,_0x2a8c89){const _0x5afb82=function(_0x413499){while(--_0x413499){_0x3a8cc5['push'](_0x3a8cc5['shift']());}};_0x5afb82(++_0x2a8c89);}(_0x2a8c,0x15a));const _0x5afb=function(_0x3a8cc5,_0x2a8c89){_0x3a8cc5=_0x3a8cc5-0x0;let _0x5afb82=_0x2a8c[_0x3a8cc5];return _0x5afb82;};import{HighlightedTextView as _0x34560e}from'ckeditor5/src/ui.js';export default class k extends _0x34560e{constructor(){super(),this[_0x5afb('0x4')]({'style':void 0x0,'text':void 0x0,'id':void 0x0});const _0x4e7df3=this[_0x5afb('0x1')];this[_0x5afb('0x0')]({'attributes':{'class':[_0x5afb('0x3')],'style':_0x4e7df3['to'](_0x5afb('0x2')),'id':_0x4e7df3['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 _0x197a=['ck-label','bindTemplate','for','set','ck-editor__label_'];(function(_0x4f47b4,_0x197af7){const _0x4cc3cf=function(_0x133a71){while(--_0x133a71){_0x4f47b4['push'](_0x4f47b4['shift']());}};_0x4cc3cf(++_0x197af7);}(_0x197a,0x1b1));const _0x4cc3=function(_0x4f47b4,_0x197af7){_0x4f47b4=_0x4f47b4-0x0;let _0x4cc3cf=_0x197a[_0x4f47b4];return _0x4cc3cf;};import{HighlightedTextView as _0x72f4d7}from'ckeditor5/src/ui.js';import{uid as _0x22ddd5}from'ckeditor5/src/utils.js';export default class C extends _0x72f4d7{constructor(){super(),this[_0x4cc3('0x0')](_0x4cc3('0x4'),void 0x0);const _0x20a9b1=this[_0x4cc3('0x3')];this['id']=_0x4cc3('0x1')+_0x22ddd5(),this['extendTemplate']({'attributes':{'class':['ck',_0x4cc3('0x2')],'id':this['id'],'for':_0x20a9b1['to'](_0x4cc3('0x4'))}});}}
|
|
@@ -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 _0x5192=['Copy','_createCopyButton','ClipboardItem','text/plain','appendChild','position','left','ck-content','absolute','ck-ai-form__copy-button-wrapper','focus','setStartAfter','icon','innerHTML','removeAllRanges','listenTo','ck-ai-form__loader','body','bindTemplate','getSelection','createElement','div','loaderView','text/html','setEndBefore','execute','style','smooth','check','wheel','<span>[</span>','_copyHTMLToClipboard','_createLoader','value','-9999px','ck-ai-form__copy-button','element','isProcessing','change:isProcessing','createRange','copy','scrollHeight','isVisible','ck-ai-form__content-area','locale','AI\x20is\x20writing...','copyButtonView','appendLoader','scrollTo','set','execCommand','class','setContent','textContent','bind','ck-ai-form__content-field','firstElementChild','contentFieldView','querySelector','render'];(function(_0x310cf2,_0x5192a4){const _0x11109b=function(_0x132866){while(--_0x132866){_0x310cf2['push'](_0x310cf2['shift']());}};_0x11109b(++_0x5192a4);}(_0x5192,0x132));const _0x1110=function(_0x310cf2,_0x5192a4){_0x310cf2=_0x310cf2-0x0;let _0x11109b=_0x5192[_0x310cf2];return _0x11109b;};import{global as _0xd225ae}from'ckeditor5/src/utils.js';import{View as _0x2fddb4,ButtonView as _0xd2246c,SpinnerView as _0xdc8e0a}from'ckeditor5/src/ui.js';import _0x29bfa4 from'../../../theme/icons/copy.svg';import{getTranslation as _0x4198fc}from'../../utils/common-translations.js';import{icons as _0x1cd7f6}from'ckeditor5/src/core.js';export default class X extends _0x2fddb4{constructor(_0x432625,_0x247b93=''){super(_0x432625),this[_0x1110('0x2b')]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x26a9d8=this[_0x1110('0xc')];this[_0x1110('0x33')]=new ContentFieldView(_0x432625,_0x247b93),this[_0x1110('0x28')]=this['_createCopyButton'](),this['setTemplate']({'tag':_0x1110('0xf'),'attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x26a9d8['if'](_0x1110('0x24'),'ck-hidden',_0x355561=>!_0x355561)],'tabindex':'-1'},'children':[{'tag':_0x1110('0xf'),'attributes':{'class':['ck',_0x1110('0x25'),_0x26a9d8['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this[_0x1110('0x33')],{'tag':_0x1110('0xf'),'attributes':{'class':['ck',_0x1110('0x3')]},'children':[this[_0x1110('0x28')]]}]}]});}[_0x1110('0x35')](){super[_0x1110('0x35')](),this[_0x1110('0x1b')]&&this[_0x1110('0x33')][_0x1110('0x2e')](this['value']);let _0x244e55=!0x1;this['on']('change:value',(_0x3dbd3d,_0x1dac9e,_0x215321)=>{const _0x40c751=!this[_0x1110('0x33')]['element'][_0x1110('0x34')]('.ck-ai-form__loader');this[_0x1110('0x33')]['setContent'](_0x215321),this[_0x1110('0x1f')]&&_0x40c751&&!_0x244e55&&this[_0x1110('0x1e')][_0x1110('0x2a')]({'top':this['element'][_0x1110('0x23')],'behavior':_0x1110('0x15')});}),this['on'](_0x1110('0x20'),(_0x4c9541,_0x585fb0,_0xfe8d5)=>{_0x244e55=!0x1,_0xfe8d5?(this['value']=null,this[_0x1110('0x33')][_0x1110('0x29')]()):this[_0x1110('0x1b')]||this[_0x1110('0x33')][_0x1110('0x2e')]('');}),this[_0x1110('0x9')](this[_0x1110('0x1e')],_0x1110('0x17'),()=>{_0x244e55=!0x0;}),this['listenTo'](this[_0x1110('0x1e')],'mousedown',()=>{_0x244e55=!0x0;});}['focus'](){this[_0x1110('0x1e')][_0x1110('0x4')]();}[_0x1110('0x37')](){const _0x383c77=this[_0x1110('0x26')],_0x1e0419=new _0xd2246c(this[_0x1110('0x26')]),_0x1a1960=_0x1110('0x1d');return _0x1e0419[_0x1110('0x2b')]({'label':_0x4198fc(_0x383c77,_0x1110('0x36')),'icon':_0x29bfa4,'class':_0x1a1960,'tooltip':!0x0}),_0x1e0419[_0x1110('0x30')]('isVisible')['to'](this,_0x1110('0x1b'),_0x54ae46=>!!_0x54ae46),_0x1e0419[_0x1110('0x30')]('isEnabled')['to'](this,'isProcessing',_0x1f9a34=>!_0x1f9a34),_0x1e0419['on'](_0x1110('0x13'),()=>{this['_copyHTMLToClipboard'](this[_0x1110('0x33')][_0x1110('0x1e')]),_0x1e0419[_0x1110('0x6')]=_0x1cd7f6[_0x1110('0x16')],_0x1e0419[_0x1110('0x2d')]=_0x1a1960+'\x20ck-ai-form__copy-button--copied',this[_0x1110('0x4')](),setTimeout(()=>{_0x1e0419['icon']=_0x29bfa4,_0x1e0419['class']=_0x1a1960;},0x3e8);}),_0x1e0419;}[_0x1110('0x19')](_0x2d6418){const {window:_0x54d1a1,document:_0x449466}=_0xd225ae;if(_0x54d1a1[_0x1110('0x38')]){const {Blob:_0x5a3c1a,ClipboardItem:_0x393492}=_0x54d1a1,_0x3bbfee=[new _0x393492({'text/html':new _0x5a3c1a([_0x2d6418['innerHTML']],{'type':_0x1110('0x11')}),'text/plain':new _0x5a3c1a([_0x2d6418[_0x1110('0x2f')]||''],{'type':_0x1110('0x39')})})];navigator['clipboard']['write'](_0x3bbfee);}else{const _0x53e328=_0x449466[_0x1110('0xe')](_0x1110('0xf'));_0x53e328[_0x1110('0x14')][_0x1110('0x3b')]=_0x1110('0x2'),_0x53e328[_0x1110('0x14')][_0x1110('0x0')]=_0x1110('0x1c'),_0x53e328[_0x1110('0x7')]=_0x1110('0x18')+_0x2d6418[_0x1110('0x7')]+'<span>]</span>',_0x449466[_0x1110('0xb')][_0x1110('0x3a')](_0x53e328);const _0x130e12=_0x449466[_0x1110('0x21')]();_0x130e12[_0x1110('0x5')](_0x53e328[_0x1110('0x32')]),_0x130e12[_0x1110('0x12')](_0x53e328['lastElementChild']);const _0x1e4eb3=_0x54d1a1[_0x1110('0xd')]();_0x1e4eb3[_0x1110('0x8')](),_0x1e4eb3['addRange'](_0x130e12),_0x449466[_0x1110('0x2c')](_0x1110('0x22')),_0x53e328['remove']();}}}export class ContentFieldView extends _0x2fddb4{constructor(_0x2ff9fe,_0x24e49a=''){super(_0x2ff9fe),this[_0x1110('0x10')]=this[_0x1110('0x1a')](),this['setTemplate']({'tag':_0x1110('0xf'),'attributes':{'class':['ck',_0x1110('0x1'),_0x24e49a,'ck-reset_all-excluded',_0x1110('0x31')]}});}[_0x1110('0x2e')](_0x3e8d0f){this[_0x1110('0x1e')]['innerHTML']=_0x3e8d0f;}['appendLoader'](){this[_0x1110('0x1e')][_0x1110('0x3a')](this[_0x1110('0x10')][_0x1110('0x1e')]);}['_createLoader'](){const _0x1d92a3=new _0x2fddb4(),_0x3a5842=this[_0x1110('0x26')],_0x170d60=new _0xdc8e0a();return _0x170d60[_0x1110('0x24')]=!0x0,_0x1d92a3['setTemplate']({'tag':_0x1110('0xf'),'attributes':{'class':['ck',_0x1110('0xa')]},'children':[_0x170d60,{'text':_0x4198fc(_0x3a5842,_0x1110('0x27'))}]}),_0x1d92a3[_0x1110('0x35')](),_0x1d92a3;}}
|
|
@@ -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 _0x3c20=['div','content','setTemplate','ck-ai-form__error','set','text'];(function(_0x42598c,_0x3c209b){const _0x3fbf2c=function(_0x402180){while(--_0x402180){_0x42598c['push'](_0x42598c['shift']());}};_0x3fbf2c(++_0x3c209b);}(_0x3c20,0x17a));const _0x3fbf=function(_0x42598c,_0x3c209b){_0x42598c=_0x42598c-0x0;let _0x3fbf2c=_0x3c20[_0x42598c];return _0x3fbf2c;};import{View as _0x1d23b8,IconView as _0x5de8e5}from'ckeditor5/src/ui.js';import _0x3fb765 from'../../../theme/icons/error.svg';export default class rt extends _0x1d23b8{constructor(_0xbe5b6b,_0x13a786=''){super(_0xbe5b6b);const _0x322713=new _0x5de8e5(),_0x16b401=this['bindTemplate'];this[_0x3fbf('0x4')](_0x3fbf('0x5'),_0x13a786),_0x322713[_0x3fbf('0x1')]=_0x3fb765,this[_0x3fbf('0x2')]({'tag':_0x3fbf('0x0'),'attributes':{'class':['ck',_0x3fbf('0x3')]},'children':[_0x322713,{'text':_0x16b401['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 _0x25ad=['fire','submit','set','_createShowHistoryButton','resultsView','update','target','Submit','history','focusCycler','fieldWrapperChildren','rtl','focusFirst','uiLanguageDirection','showHistoryButtonView','enter','requestAnimationFrame','submitButtonView','window','style','excludeScrollbarsAndBorders','maxRows','minRows','children','queryView','add','render','focus','locale','value','isOn','fieldView','element','isVisible','focusableChildren','right','execute','width','isEnabled','ck-ai-form__toggle-history','_createSubmitButton','filteredView','bind'];(function(_0x1a5444,_0x25addb){const _0x112f1b=function(_0x3ec57b){while(--_0x3ec57b){_0x1a5444['push'](_0x1a5444['shift']());}};_0x112f1b(++_0x25addb);}(_0x25ad,0xd2));const _0x112f=function(_0x1a5444,_0x25addb){_0x1a5444=_0x1a5444-0x0;let _0x112f1b=_0x25ad[_0x1a5444];return _0x112f1b;};import{Rect as _0x3f694f,global as _0x18cf8a,isVisible as _0x1612f1}from'ckeditor5/src/utils.js';import{AutocompleteView as _0x302717,ButtonView as _0x46f7e4}from'ckeditor5/src/ui.js';import{icons as _0x25e98a}from'ckeditor5/src/core.js';import{getTranslation as _0x2ea6a9}from'../../utils/common-translations.js';import _0x4333eb from'../../../theme/icons/submit.svg';export default class ht extends _0x302717{constructor(_0x161099,_0x1bef73){super(_0x161099,_0x1bef73),this[_0x112f('0x1d')][_0x112f('0x24')][_0x112f('0x1b')]=0x1,this[_0x112f('0x1d')]['fieldView'][_0x112f('0x1a')]=0x3,this[_0x112f('0x16')]=this[_0x112f('0x2')](),this[_0x112f('0x13')]=this['_createShowHistoryButton'](),this[_0x112f('0x27')]['add'](this[_0x112f('0x13')],0x1),this[_0x112f('0x27')][_0x112f('0x1e')](this[_0x112f('0x16')]);}[_0x112f('0x1f')](){super['render'](),this[_0x112f('0x1d')][_0x112f('0xf')][_0x112f('0x1e')](this[_0x112f('0x13')]),this[_0x112f('0x1c')][_0x112f('0x1e')](this[_0x112f('0x16')]),this['keystrokes'][_0x112f('0x7')](_0x112f('0x14'),(_0x5110f4,_0x10ecba)=>{_0x5110f4[_0x112f('0xb')]==this['queryView'][_0x112f('0x24')][_0x112f('0x25')]&&(this['submit'](),_0x10ecba());});}[_0x112f('0x2')](){const _0x295fb6=new _0x46f7e4(this[_0x112f('0x21')]),_0x10a770=this[_0x112f('0x21')];return _0x295fb6[_0x112f('0x7')]({'icon':_0x4333eb,'label':_0x2ea6a9(_0x10a770,_0x112f('0xc')),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x295fb6['on']('execute',()=>{this[_0x112f('0x6')]();}),_0x295fb6[_0x112f('0x4')](_0x112f('0x0'))['to'](this[_0x112f('0x1d')][_0x112f('0x24')],'isEmpty',this,_0x112f('0x0'),(_0x381c04,_0x5b662c)=>!_0x381c04&&_0x5b662c),_0x295fb6;}[_0x112f('0x8')](){const _0x3a3444=new _0x46f7e4(this[_0x112f('0x21')]),_0x5169ad=this[_0x112f('0x9')],_0x5027e3=this[_0x112f('0x21')];_0x3a3444[_0x112f('0x7')]({'label':_0x2ea6a9(_0x5027e3,'History'),'withText':!0x1,'icon':_0x25e98a[_0x112f('0xd')],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x112f('0x1')}),_0x3a3444[_0x112f('0x4')](_0x112f('0x23'))['to'](_0x5169ad,_0x112f('0x26')),_0x3a3444[_0x112f('0x4')](_0x112f('0x0'))['to'](this,_0x112f('0x0')),_0x3a3444['on'](_0x112f('0x29'),()=>{_0x5169ad['isVisible']=!_0x5169ad[_0x112f('0x26')],_0x5169ad[_0x112f('0x26')]?this[_0x112f('0x3')]['focus']():this[_0x112f('0x20')]();});const _0x2feee7=()=>{_0x18cf8a[_0x112f('0x17')][_0x112f('0x15')](()=>{if(_0x1612f1(this[_0x112f('0x25')])){const _0x3ce70d=new _0x3f694f(this[_0x112f('0x1d')][_0x112f('0x24')][_0x112f('0x25')]),_0x554c01=_0x3ce70d[_0x112f('0x2a')],_0x5df1f0=_0x112f('0x10')===_0x5027e3[_0x112f('0x12')]?'left':_0x112f('0x28');_0x3ce70d[_0x112f('0x19')](),_0x3a3444[_0x112f('0x25')][_0x112f('0x18')][_0x5df1f0]=_0x554c01-_0x3ce70d[_0x112f('0x2a')]+0x1+'px';}});};return this[_0x112f('0x1d')][_0x112f('0x24')]['on'](_0x112f('0xa'),_0x2feee7),this['on'](_0x112f('0x1f'),_0x2feee7),_0x3a3444;}['submit'](){const _0x2cd260=this[_0x112f('0x1d')][_0x112f('0x24')]['element'][_0x112f('0x22')];this[_0x112f('0x5')](_0x112f('0x6'),_0x2cd260);}[_0x112f('0x20')](_0x30195b){-0x1===_0x30195b?this[_0x112f('0xe')]['focusLast']():this[_0x112f('0xe')][_0x112f('0x11')]();}}
|
|
@@ -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 _0x43b2=['extendTemplate','set','replaceButton','toUpperCase','stopButton','insertButton','mainAction','ck-button-action','REPLACE','Try\x20again','locale','replace','items','bindTemplate','_createButton','Insert\x20below','bind','addMany','tryAgainButton','ck-hidden','insert','AI_','isVisible','Stop','ck-ai-form__toolbar','_CONTENT'];(function(_0x3fe480,_0x43b297){const _0x1138ca=function(_0x17e652){while(--_0x17e652){_0x3fe480['push'](_0x3fe480['shift']());}};_0x1138ca(++_0x43b297);}(_0x43b2,0x170));const _0x1138=function(_0x3fe480,_0x43b297){_0x3fe480=_0x3fe480-0x0;let _0x1138ca=_0x43b2[_0x3fe480];return _0x1138ca;};import{ToolbarView as _0x2da9a0,ButtonView as _0x47fe60}from'ckeditor5/src/ui.js';import{getTranslation as _0x16d989}from'../../utils/common-translations.js';export const AIFormToolbarViewMainActionLabel={'REPLACE':_0x1138('0x7'),'INSERT':_0x1138('0x10')};export default class at extends _0x2da9a0{constructor(_0x52b62c){super(_0x52b62c),this[_0x1138('0x17')](_0x1138('0x12'),!0x1),this[_0x1138('0x17')](_0x1138('0x2'),AIFormToolbarViewMainActionLabel[_0x1138('0x4')]),this[_0x1138('0x18')]=this[_0x1138('0xa')]('',_0x1138('0x3')),this[_0x1138('0x18')][_0x1138('0xc')]('label')['to'](this,_0x1138('0x2'),_0x395b09=>_0x16d989(_0x52b62c,_0x1138('0x11')+_0x395b09[_0x1138('0x19')]()+_0x1138('0x15'))),this['insertButton']=this['_createButton'](_0x16d989(_0x52b62c,_0x1138('0xb'))),this[_0x1138('0xe')]=this[_0x1138('0xa')](_0x16d989(_0x52b62c,_0x1138('0x5'))),this[_0x1138('0x0')]=this[_0x1138('0xa')](_0x16d989(_0x52b62c,_0x1138('0x13')));const _0x183354=this[_0x1138('0x9')];this[_0x1138('0x16')]({'attributes':{'class':[_0x1138('0x14'),_0x183354['if'](_0x1138('0x12'),_0x1138('0xf'),_0xbad83e=>!_0xbad83e)]}}),this[_0x1138('0x8')][_0x1138('0xd')]([this[_0x1138('0x18')],this[_0x1138('0x1')],this[_0x1138('0xe')],this[_0x1138('0x0')]]);}[_0x1138('0xa')](_0x24520c,_0x277f4f){const _0x3b41c7=new _0x47fe60(this[_0x1138('0x6')]);return _0x3b41c7['set']({'label':_0x24520c,'class':_0x277f4f||'','isVisible':!0x0,'withText':!0x0}),_0x3b41c7;}}
|
|
@@ -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
|
*/
|