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