@ckeditor/ckeditor5-ai 0.0.0-internal-20241017.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/CHANGELOG.md +4 -0
- package/LICENSE.md +26 -0
- package/README.md +38 -0
- package/build/ai.js +5 -0
- package/build/translations/af.js +1 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/bs.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de-ch.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/es-co.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fa.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/gl.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/jv.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ms.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sr-latn.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/ti.js +1 -0
- package/build/translations/tk.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/tt.js +1 -0
- package/build/translations/ug.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/ur.js +1 -0
- package/build/translations/uz.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +23 -0
- package/dist/adapters/aiadapter.d.ts +60 -0
- package/dist/adapters/aitextadapter.d.ts +150 -0
- package/dist/adapters/awstextadapter.d.ts +183 -0
- package/dist/adapters/openaitextadapter.d.ts +187 -0
- package/dist/aiassistant.d.ts +393 -0
- package/dist/aiassistantediting.d.ts +59 -0
- package/dist/aiassistantui.d.ts +62 -0
- package/dist/aiconfig.d.ts +73 -0
- package/dist/augmentation.d.ts +31 -0
- package/dist/index-content.css +6 -0
- package/dist/index-editor.css +297 -0
- package/dist/index.css +392 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +24 -0
- package/dist/legacyerrors.d.ts +24 -0
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +23 -0
- package/dist/translations/af.umd.js +23 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +23 -0
- package/dist/translations/ar.umd.js +23 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +23 -0
- package/dist/translations/bg.umd.js +23 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +23 -0
- package/dist/translations/bn.umd.js +23 -0
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +23 -0
- package/dist/translations/bs.umd.js +23 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +23 -0
- package/dist/translations/ca.umd.js +23 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +23 -0
- package/dist/translations/cs.umd.js +23 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +23 -0
- package/dist/translations/da.umd.js +23 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +23 -0
- package/dist/translations/de-ch.umd.js +23 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +23 -0
- package/dist/translations/de.umd.js +23 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +23 -0
- package/dist/translations/el.umd.js +23 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +23 -0
- package/dist/translations/en-au.umd.js +23 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +23 -0
- package/dist/translations/en.umd.js +23 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +23 -0
- package/dist/translations/es-co.umd.js +23 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +23 -0
- package/dist/translations/es.umd.js +23 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +23 -0
- package/dist/translations/et.umd.js +23 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +23 -0
- package/dist/translations/fa.umd.js +23 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +23 -0
- package/dist/translations/fi.umd.js +23 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +23 -0
- package/dist/translations/fr.umd.js +23 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +23 -0
- package/dist/translations/gl.umd.js +23 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +23 -0
- package/dist/translations/he.umd.js +23 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +23 -0
- package/dist/translations/hi.umd.js +23 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +23 -0
- package/dist/translations/hr.umd.js +23 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +23 -0
- package/dist/translations/hu.umd.js +23 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +23 -0
- package/dist/translations/id.umd.js +23 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +23 -0
- package/dist/translations/it.umd.js +23 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +23 -0
- package/dist/translations/ja.umd.js +23 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +23 -0
- package/dist/translations/jv.umd.js +23 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +23 -0
- package/dist/translations/ko.umd.js +23 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +23 -0
- package/dist/translations/lt.umd.js +23 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +23 -0
- package/dist/translations/lv.umd.js +23 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +23 -0
- package/dist/translations/ms.umd.js +23 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +23 -0
- package/dist/translations/nl.umd.js +23 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +23 -0
- package/dist/translations/no.umd.js +23 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +23 -0
- package/dist/translations/pl.umd.js +23 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +23 -0
- package/dist/translations/pt-br.umd.js +23 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +23 -0
- package/dist/translations/pt.umd.js +23 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +23 -0
- package/dist/translations/ro.umd.js +23 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +23 -0
- package/dist/translations/ru.umd.js +23 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +23 -0
- package/dist/translations/sk.umd.js +23 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +23 -0
- package/dist/translations/sr-latn.umd.js +23 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +23 -0
- package/dist/translations/sr.umd.js +23 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +23 -0
- package/dist/translations/sv.umd.js +23 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +23 -0
- package/dist/translations/th.umd.js +23 -0
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +23 -0
- package/dist/translations/ti.umd.js +23 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +23 -0
- package/dist/translations/tk.umd.js +23 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +23 -0
- package/dist/translations/tr.umd.js +23 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +23 -0
- package/dist/translations/tt.umd.js +23 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +23 -0
- package/dist/translations/ug.umd.js +23 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +23 -0
- package/dist/translations/uk.umd.js +23 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +23 -0
- package/dist/translations/ur.umd.js +23 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +23 -0
- package/dist/translations/uz.umd.js +23 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +23 -0
- package/dist/translations/vi.umd.js +23 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +23 -0
- package/dist/translations/zh-cn.umd.js +23 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +23 -0
- package/dist/translations/zh.umd.js +23 -0
- package/dist/ui/aiassistantcontroller.d.ts +113 -0
- package/dist/ui/form/aiformcontentarea.d.ts +52 -0
- package/dist/ui/form/aiformerrorview.d.ts +30 -0
- package/dist/ui/form/aiformpromptview.d.ts +50 -0
- package/dist/ui/form/aiformtoolbarview.d.ts +62 -0
- package/dist/ui/form/aiformview.d.ts +145 -0
- package/dist/ui/form/aihistorylistitemview.d.ts +22 -0
- package/dist/ui/form/aihistorylistview.d.ts +39 -0
- package/dist/ui/form/prompthistory.d.ts +24 -0
- package/dist/ui/showaiassistantcommand.d.ts +44 -0
- package/dist/utils/common-translations.d.ts +13 -0
- package/dist/utils/normalizecommandsconfig.d.ts +18 -0
- package/lang/contexts.json +56 -0
- package/lang/translations/af.po +230 -0
- package/lang/translations/ar.po +230 -0
- package/lang/translations/bg.po +230 -0
- package/lang/translations/bn.po +230 -0
- package/lang/translations/bs.po +230 -0
- package/lang/translations/ca.po +230 -0
- package/lang/translations/cs.po +230 -0
- package/lang/translations/da.po +230 -0
- package/lang/translations/de-ch.po +230 -0
- package/lang/translations/de.po +230 -0
- package/lang/translations/el.po +230 -0
- package/lang/translations/en-au.po +230 -0
- package/lang/translations/en.po +230 -0
- package/lang/translations/es-co.po +230 -0
- package/lang/translations/es.po +230 -0
- package/lang/translations/et.po +230 -0
- package/lang/translations/fa.po +230 -0
- package/lang/translations/fi.po +230 -0
- package/lang/translations/fr.po +230 -0
- package/lang/translations/gl.po +230 -0
- package/lang/translations/he.po +230 -0
- package/lang/translations/hi.po +230 -0
- package/lang/translations/hr.po +230 -0
- package/lang/translations/hu.po +230 -0
- package/lang/translations/id.po +230 -0
- package/lang/translations/it.po +230 -0
- package/lang/translations/ja.po +230 -0
- package/lang/translations/jv.po +230 -0
- package/lang/translations/ko.po +230 -0
- package/lang/translations/lt.po +230 -0
- package/lang/translations/lv.po +230 -0
- package/lang/translations/ms.po +230 -0
- package/lang/translations/nl.po +230 -0
- package/lang/translations/no.po +230 -0
- package/lang/translations/pl.po +230 -0
- package/lang/translations/pt-br.po +230 -0
- package/lang/translations/pt.po +230 -0
- package/lang/translations/ro.po +230 -0
- package/lang/translations/ru.po +230 -0
- package/lang/translations/sk.po +230 -0
- package/lang/translations/sr-latn.po +230 -0
- package/lang/translations/sr.po +230 -0
- package/lang/translations/sv.po +230 -0
- package/lang/translations/th.po +230 -0
- package/lang/translations/ti.po +230 -0
- package/lang/translations/tk.po +230 -0
- package/lang/translations/tr.po +230 -0
- package/lang/translations/tt.po +230 -0
- package/lang/translations/ug.po +230 -0
- package/lang/translations/uk.po +230 -0
- package/lang/translations/ur.po +230 -0
- package/lang/translations/uz.po +230 -0
- package/lang/translations/vi.po +230 -0
- package/lang/translations/zh-cn.po +230 -0
- package/lang/translations/zh.po +230 -0
- package/package.json +53 -0
- package/src/adapters/aiadapter.d.ts +56 -0
- package/src/adapters/aiadapter.js +23 -0
- package/src/adapters/aitextadapter.d.ts +146 -0
- package/src/adapters/aitextadapter.js +23 -0
- package/src/adapters/awstextadapter.d.ts +179 -0
- package/src/adapters/awstextadapter.js +23 -0
- package/src/adapters/openaitextadapter.d.ts +183 -0
- package/src/adapters/openaitextadapter.js +23 -0
- package/src/aiassistant.d.ts +389 -0
- package/src/aiassistant.js +23 -0
- package/src/aiassistantediting.d.ts +55 -0
- package/src/aiassistantediting.js +23 -0
- package/src/aiassistantui.d.ts +58 -0
- package/src/aiassistantui.js +23 -0
- package/src/aiconfig.d.ts +69 -0
- package/src/aiconfig.js +23 -0
- package/src/augmentation.d.ts +27 -0
- package/src/augmentation.js +23 -0
- package/src/index.d.ts +13 -0
- package/src/index.js +23 -0
- package/src/legacyerrors.d.ts +20 -0
- package/src/legacyerrors.js +23 -0
- package/src/ui/aiassistantcontroller.d.ts +109 -0
- package/src/ui/aiassistantcontroller.js +24 -0
- package/src/ui/form/aiformcontentarea.d.ts +48 -0
- package/src/ui/form/aiformcontentarea.js +23 -0
- package/src/ui/form/aiformerrorview.d.ts +26 -0
- package/src/ui/form/aiformerrorview.js +23 -0
- package/src/ui/form/aiformpromptview.d.ts +46 -0
- package/src/ui/form/aiformpromptview.js +23 -0
- package/src/ui/form/aiformtoolbarview.d.ts +58 -0
- package/src/ui/form/aiformtoolbarview.js +23 -0
- package/src/ui/form/aiformview.d.ts +141 -0
- package/src/ui/form/aiformview.js +23 -0
- package/src/ui/form/aihistorylistitemview.d.ts +18 -0
- package/src/ui/form/aihistorylistitemview.js +23 -0
- package/src/ui/form/aihistorylistview.d.ts +35 -0
- package/src/ui/form/aihistorylistview.js +23 -0
- package/src/ui/form/prompthistory.d.ts +20 -0
- package/src/ui/form/prompthistory.js +23 -0
- package/src/ui/showaiassistantcommand.d.ts +40 -0
- package/src/ui/showaiassistantcommand.js +23 -0
- package/src/utils/common-translations.d.ts +9 -0
- package/src/utils/common-translations.js +23 -0
- package/src/utils/normalizecommandsconfig.d.ts +14 -0
- package/src/utils/normalizecommandsconfig.js +23 -0
- package/theme/ai-dropdown.css +37 -0
- package/theme/ai-form.css +262 -0
- package/theme/ai.css +120 -0
- package/theme/icons/copy.svg +1 -0
- package/theme/icons/error.svg +1 -0
- package/theme/icons/magic-wand.svg +1 -0
- package/theme/icons/submit.svg +1 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const _0x9fdf03=_0x19ac;(function(_0x739a99,_0x44d1b9){const _0x123050=_0x19ac,_0x365cef=_0x739a99();while(!![]){try{const _0x57fb4e=-parseInt(_0x123050(0x198))/0x1+-parseInt(_0x123050(0x183))/0x2+-parseInt(_0x123050(0x189))/0x3+-parseInt(_0x123050(0x165))/0x4*(parseInt(_0x123050(0x163))/0x5)+-parseInt(_0x123050(0x196))/0x6*(parseInt(_0x123050(0x16f))/0x7)+parseInt(_0x123050(0x157))/0x8*(parseInt(_0x123050(0x160))/0x9)+-parseInt(_0x123050(0x18f))/0xa*(-parseInt(_0x123050(0x1a6))/0xb);if(_0x57fb4e===_0x44d1b9)break;else _0x365cef['push'](_0x365cef['shift']());}catch(_0x5af84d){_0x365cef['push'](_0x365cef['shift']());}}}(_0x100c,0x24ec6));import{ObservableMixin as _0x1df16a}from'ckeditor5/src/utils.js';function _0x100c(){const _0x5c10b3=['_stripMarkdownSyntax','render','serializeToString','nodeType','view','```html','makeRequest','_sanitizeHTML','element','childNodes','viewToDom','set:currentContext','length','initialContext','catch','8lmjGoi','finishProcessing','remove','match','currentContext','mainAction','processor','isProcessing','destroy','1315134FrLwfd','finally','push','475mhgJDy','setContentOf','11688aSFecS','updateView','document','endsWith','previousQuery','toModel','startProcessing','abort','createElement','previousLabel','949907ImLZlY','once','stringify','reset','editor','from','tryAgainEvent','textAdapter','innerHTML','message','submitPrompt','domConverter','data','editing','_domParser','<h1></h1>','querySelector','rename','_sanitizationContainer','text/html','154432ENNUai','previousActionId','parseFromString','startsWith','value','reverse','422385dftoFy','toView','set','stopProcessing','previousContext','_xmlSerializer','8667510itgBUv','currentResponse','stopListening','_normalizeResponseHeadings','name','then','htmlProcessor','12kNZvpE','prompt','94636BhgHdn','body','ELEMENT_NODE','trim','_isH1TagSupportEnabled','_handleQuery','exec','```','substring','isRendered','div','_parseAndNormalizeContent','listenTo','handleError','11tdhlvW','custom'];_0x100c=function(){return _0x5c10b3;};return _0x100c();}import{AIRequestError as _0x237054}from'../adapters/aiadapter.js';import{Matcher as _0xaea43b,UpcastWriter as _0x551694}from'ckeditor5/src/engine.js';function _0x19ac(_0x24fca8,_0x519b7c){const _0x100cd0=_0x100c();return _0x19ac=function(_0x19acf2,_0x189e6b){_0x19acf2=_0x19acf2-0x148;let _0x20bcb6=_0x100cd0[_0x19acf2];return _0x20bcb6;},_0x19ac(_0x24fca8,_0x519b7c);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');export default class C extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x1df16a(){constructor(_0x454f2a,_0x4c6df5,_0x2853eb){const _0x1f5a43=_0x19ac;super(),this[_0x1f5a43(0x173)]=_0x454f2a,this[_0x1f5a43(0x176)]=_0x4c6df5,this[_0x1f5a43(0x181)]=document[_0x1f5a43(0x16d)](_0x1f5a43(0x1a2)),this[_0x1f5a43(0x17d)]=new DOMParser(),this[_0x1f5a43(0x18e)]=new XMLSerializer(),this[_0x1f5a43(0x14c)]=_0x2853eb,this[_0x1f5a43(0x18b)]({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on'](_0x1f5a43(0x153),(_0x3c4ec0,_0x5df7a4,_0x52102f)=>{const _0x4e2dc1=_0x1f5a43;this[_0x4e2dc1(0x14c)][_0x4e2dc1(0x187)]=this[_0x4e2dc1(0x14f)](_0x52102f);}),this[_0x1f5a43(0x1a4)](this[_0x1f5a43(0x14c)],_0x1f5a43(0x179),(_0x15c11e,_0x1a5d91)=>{const _0x5cd991=_0x1f5a43,_0x443d0a=this[_0x5cd991(0x15b)]||this[_0x5cd991(0x155)];this[_0x5cd991(0x19d)](_0x1a5d91,_0x443d0a,_0x5cd991(0x1a7));}),this[_0x1f5a43(0x1a4)](this[_0x1f5a43(0x14c)],_0x1f5a43(0x175),()=>{const _0x23f278=_0x1f5a43;this[_0x23f278(0x14c)][_0x23f278(0x197)]=this[_0x23f278(0x16e)],this[_0x23f278(0x19d)](this[_0x23f278(0x169)],this[_0x23f278(0x18d)],this[_0x23f278(0x184)],this[_0x23f278(0x16e)]);}),this[_0x1f5a43(0x1a4)](this[_0x1f5a43(0x14c)],_0x1f5a43(0x18c),()=>{const _0x30280d=_0x1f5a43;this[_0x30280d(0x18c)]();});}[_0x9fdf03(0x15f)](){const _0xc609de=_0x9fdf03;this[_0xc609de(0x191)]();}async[_0x9fdf03(0x166)]({actionId:_0x3378a4,query:_0x2dbe97,htmlContent:_0x228311,label:_0x283933,mainActionLabel:_0x37bc49}){const _0x441270=_0x9fdf03;this[_0x441270(0x14c)][_0x441270(0x197)]=_0x283933,this[_0x441270(0x14c)][_0x441270(0x15c)]=_0x37bc49,this[_0x441270(0x155)]=_0x228311,_0x2dbe97&&(this[_0x441270(0x14c)][_0x441270(0x1a1)]?this[_0x441270(0x19d)](_0x2dbe97,_0x228311,_0x3378a4,_0x283933):this[_0x441270(0x14c)][_0x441270(0x170)](_0x441270(0x149),()=>{const _0x26a287=_0x441270;this[_0x26a287(0x19d)](_0x2dbe97,_0x228311,_0x3378a4,_0x283933);}));}[_0x9fdf03(0x18c)](){const _0x718fc9=_0x9fdf03;this[_0x718fc9(0x15e)]&&(this[_0x718fc9(0x15e)]=!0x1,this[_0x718fc9(0x14c)][_0x718fc9(0x158)](),this[_0x718fc9(0x176)][_0x718fc9(0x16c)]());}[_0x9fdf03(0x172)](){const _0x1822dc=_0x9fdf03;this[_0x1822dc(0x155)]='',this[_0x1822dc(0x15b)]='',this[_0x1822dc(0x190)]='',this[_0x1822dc(0x18d)]='',this[_0x1822dc(0x169)]='',this[_0x1822dc(0x16e)]='',this[_0x1822dc(0x184)]=void 0x0,this[_0x1822dc(0x14c)][_0x1822dc(0x172)](),this[_0x1822dc(0x18c)]();}async[_0x9fdf03(0x19d)](_0x413fa3,_0xa839e8,_0x42506b,_0x59abcb){const _0x1c2d8e=_0x9fdf03;return this[_0x1c2d8e(0x15e)]=!0x0,this[_0x1c2d8e(0x14c)][_0x1c2d8e(0x16b)](),this[_0x1c2d8e(0x18d)]=_0xa839e8,this[_0x1c2d8e(0x169)]=_0x413fa3,this[_0x1c2d8e(0x16e)]=_0x59abcb||_0x413fa3,this[_0x1c2d8e(0x184)]=_0x42506b,new Promise(_0x4010fa=>{const _0x463431=_0x1c2d8e;this[_0x463431(0x176)][_0x463431(0x14e)]({'query':_0x413fa3,'context':_0xa839e8,'onData':_0x37f3b4=>{const _0x190f39=_0x463431;this[_0x190f39(0x190)]=_0x37f3b4,this[_0x190f39(0x15b)]=this[_0x190f39(0x1a3)](this[_0x190f39(0x190)]);},'actionId':_0x42506b})[_0x463431(0x194)](()=>{const _0x5876b6=_0x463431;!this[_0x5876b6(0x15b)]&&this[_0x5876b6(0x190)]&&(this[_0x5876b6(0x15b)]=this[_0x5876b6(0x1a3)](this[_0x5876b6(0x190)],!0x0));})[_0x463431(0x156)](_0x314491=>{const _0x28247d=_0x463431;_0x314491 instanceof _0x237054?this[_0x28247d(0x14c)][_0x28247d(0x1a5)](_0x314491[_0x28247d(0x178)]):this[_0x28247d(0x14c)][_0x28247d(0x1a5)](),_0x4010fa();})[_0x463431(0x161)](()=>{const _0x2ffafc=_0x463431;this[_0x2ffafc(0x18c)](),_0x4010fa();});});}[_0x9fdf03(0x1a3)](_0x9209cc,_0xf0bae6=!0x1){const _0x2a45b0=_0x9fdf03,_0x325b89=Z[_0x2a45b0(0x19e)](_0x9209cc);_0x9209cc=_0x325b89?_0x9209cc[_0x2a45b0(0x1a0)](_0x325b89[0x1][_0x2a45b0(0x154)]):_0x9209cc[_0x2a45b0(0x154)]<0x64&&!_0xf0bae6?'':this[_0x2a45b0(0x148)](_0x9209cc);const _0xbbe2d0=this[_0x2a45b0(0x17d)][_0x2a45b0(0x185)](_0x9209cc,_0x2a45b0(0x182));if(_0x325b89){const _0x48afa7=Array[_0x2a45b0(0x174)](_0xbbe2d0[_0x2a45b0(0x199)][_0x2a45b0(0x151)]);_0x48afa7[_0x2a45b0(0x188)]();for(const _0x205662 of _0x48afa7){if(_0x205662[_0x2a45b0(0x14b)]==Node[_0x2a45b0(0x19a)])break;_0x205662[_0x2a45b0(0x159)]();}}const _0x28b7e3=this[_0x2a45b0(0x173)][_0x2a45b0(0x17b)][_0x2a45b0(0x15d)][_0x2a45b0(0x18a)](this[_0x2a45b0(0x18e)][_0x2a45b0(0x14a)](_0xbbe2d0[_0x2a45b0(0x199)]));return this[_0x2a45b0(0x19c)]()||this[_0x2a45b0(0x192)](_0x28b7e3),this[_0x2a45b0(0x173)][_0x2a45b0(0x17b)][_0x2a45b0(0x171)](this[_0x2a45b0(0x173)][_0x2a45b0(0x17b)][_0x2a45b0(0x16a)](_0x28b7e3));}[_0x9fdf03(0x192)](_0x2a10f0){const _0x23ebd8=_0x9fdf03,_0x188846=new _0x551694(this[_0x23ebd8(0x173)][_0x23ebd8(0x17c)][_0x23ebd8(0x14c)][_0x23ebd8(0x167)]),_0xc446a1=new _0xaea43b({'name':/^h[1-5]$/}),_0x2726f2=[];let _0x11df49=!0x1;for(const _0x5317a8 of _0x2a10f0)_0x5317a8['is'](_0x23ebd8(0x150))&&_0xc446a1[_0x23ebd8(0x15a)](_0x5317a8)&&(_0x2726f2[_0x23ebd8(0x162)](_0x5317a8),'h1'==_0x5317a8[_0x23ebd8(0x193)]&&(_0x11df49=!0x0));if(_0x11df49){for(const _0x107da6 of _0x2726f2)_0x188846[_0x23ebd8(0x180)]('h'+(parseInt(_0x107da6[_0x23ebd8(0x193)][0x1])+0x1),_0x107da6);}}[_0x9fdf03(0x19c)](){const _0x1ba39f=_0x9fdf03,{data:_0x362882,editing:_0x3f3f30}=this[_0x1ba39f(0x173)],_0x4b3115=_0x362882[_0x1ba39f(0x195)][_0x1ba39f(0x18a)](_0x1ba39f(0x17e)),_0x2e8e52=_0x362882[_0x1ba39f(0x18a)](_0x362882[_0x1ba39f(0x16a)](_0x4b3115));return!!_0x3f3f30[_0x1ba39f(0x14c)][_0x1ba39f(0x17a)][_0x1ba39f(0x152)](_0x2e8e52)[_0x1ba39f(0x17f)]('h1');}[_0x9fdf03(0x14f)](_0x306d4d){const _0x2444bd=_0x9fdf03;return this[_0x2444bd(0x173)][_0x2444bd(0x17c)][_0x2444bd(0x14c)][_0x2444bd(0x17a)][_0x2444bd(0x164)](this[_0x2444bd(0x181)],_0x306d4d),this[_0x2444bd(0x181)][_0x2444bd(0x177)];}[_0x9fdf03(0x148)](_0x24b674){const _0x3b0287=_0x9fdf03,_0x3a7ab6=_0x24b674[_0x3b0287(0x19b)]();return _0x3a7ab6[_0x3b0287(0x186)](_0x3b0287(0x14d))?_0x3a7ab6[_0x3b0287(0x168)](_0x3b0287(0x19f))?_0x3a7ab6[_0x3b0287(0x1a0)](0x7,_0x3a7ab6[_0x3b0287(0x154)]-0x3):_0x3a7ab6[_0x3b0287(0x1a0)](0x7):_0x24b674;}}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ai/ui/aiformcontentarea
|
|
7
|
+
*/
|
|
8
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { View, ButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
/**
|
|
11
|
+
* A class representing the text area view of the AI assistant.
|
|
12
|
+
*/
|
|
13
|
+
export default class AIFormContentArea extends View {
|
|
14
|
+
/**
|
|
15
|
+
* The value which is displayed in the content field.
|
|
16
|
+
*
|
|
17
|
+
* @observable
|
|
18
|
+
*/
|
|
19
|
+
value: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Controls whether the content area is visible.
|
|
22
|
+
*
|
|
23
|
+
* @observable
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
isVisible: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Indicates if the content area is during processing which can change inner values.
|
|
29
|
+
*/
|
|
30
|
+
isProcessing: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The textarea view.
|
|
33
|
+
*/
|
|
34
|
+
contentFieldView: ContentFieldView;
|
|
35
|
+
/**
|
|
36
|
+
* The copy button displayed in the bottom-right corner of text area.
|
|
37
|
+
*/
|
|
38
|
+
copyButtonView: ButtonView;
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
constructor(locale: Locale, extraCssClass?: string);
|
|
43
|
+
/**
|
|
44
|
+
* @inheritDoc
|
|
45
|
+
*/
|
|
46
|
+
render(): void;
|
|
47
|
+
focus(): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const _0x435604=_0x2f73;(function(_0x57ca50,_0x4a539f){const _0x31f77a=_0x2f73,_0x490d91=_0x57ca50();while(!![]){try{const _0x4650ed=parseInt(_0x31f77a(0xdb))/0x1*(parseInt(_0x31f77a(0xc6))/0x2)+-parseInt(_0x31f77a(0xe6))/0x3+-parseInt(_0x31f77a(0xcf))/0x4*(-parseInt(_0x31f77a(0xcd))/0x5)+parseInt(_0x31f77a(0xec))/0x6+parseInt(_0x31f77a(0xd0))/0x7+parseInt(_0x31f77a(0xbe))/0x8*(parseInt(_0x31f77a(0x105))/0x9)+parseInt(_0x31f77a(0xce))/0xa*(-parseInt(_0x31f77a(0x100))/0xb);if(_0x4650ed===_0x4a539f)break;else _0x490d91['push'](_0x490d91['shift']());}catch(_0x49c804){_0x490d91['push'](_0x490d91['shift']());}}}(_0x4b39,0x34b8e));import{global as _0x24e968}from'ckeditor5/src/utils.js';import{View as _0x160016,ButtonView as _0x593106,SpinnerView as _0x331435}from'ckeditor5/src/ui.js';import _0x2f44ea from'../../../theme/icons/copy.svg';function _0x4b39(){const _0x231024=['check','ck-ai-form__copy-button-wrapper','2budpft','addRange','wheel','ck-ai-form__copy-button','scrollTo','change:isProcessing','ck-ai-form__content-area','locale','innerHTML','element','listenTo','1163583TOxMbU','remove','change:value','\x20ck-ai-form__copy-button--copied','mousedown','firstElementChild','2079774cNHVnW','ck-content','ck-ai-form__content-area-wrapper','absolute','copy','write','value','<span>[</span>','execute','appendLoader','Copy','setContent','lastElementChild','class','smooth','body','text/plain','createElement','text/html','style','22NdQDjS','_copyHTMLToClipboard','div','setTemplate','render','1116FXZQxS','getSelection','<span>]</span>','.ck-ai-form__loader','focus','AI\x20is\x20writing...','contentFieldView','ck-ai-form__loader','bind','scrollHeight','ck-ai-form__content-area--processing','_createCopyButton','position','ck-hidden','createRange','set','23136oSqXZc','appendChild','isProcessing','setEndBefore','ck-ai-form__content-field','isEnabled','setStartAfter','textContent','344878zEPXnQ','execCommand','_createLoader','isVisible','copyButtonView','querySelector','removeAllRanges','80laGLpg','5273050NCOEOX','48080wJfDbC','2911902eNUFFo','-9999px','left','ClipboardItem','icon','clipboard','bindTemplate','loaderView','ck-reset_all-excluded'];_0x4b39=function(){return _0x231024;};return _0x4b39();}function _0x2f73(_0x41291a,_0x86d555){const _0x4b39cb=_0x4b39();return _0x2f73=function(_0x2f7393,_0x355fcc){_0x2f7393=_0x2f7393-0xbb;let _0x5066a5=_0x4b39cb[_0x2f7393];return _0x5066a5;},_0x2f73(_0x41291a,_0x86d555);}import{getTranslation as _0x558369}from'../../utils/common-translations.js';import{icons as _0x2355a1}from'ckeditor5/src/core.js';export default class W extends _0x160016{constructor(_0x197192,_0x567795=''){const _0x39b353=_0x2f73;super(_0x197192),this[_0x39b353(0xbd)]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3a721d=this[_0x39b353(0xd6)];this[_0x39b353(0x10b)]=new ContentFieldView(_0x197192,_0x567795),this[_0x39b353(0xca)]=this[_0x39b353(0x110)](),this[_0x39b353(0x103)]({'tag':_0x39b353(0x102),'attributes':{'class':['ck',_0x39b353(0xee),_0x3a721d['if'](_0x39b353(0xc9),_0x39b353(0xbb),_0x2e52e1=>!_0x2e52e1)],'tabindex':'-1'},'children':[{'tag':_0x39b353(0x102),'attributes':{'class':['ck',_0x39b353(0xe1),_0x3a721d['if'](_0x39b353(0xc0),_0x39b353(0x10f))]},'children':[this[_0x39b353(0x10b)],{'tag':_0x39b353(0x102),'attributes':{'class':['ck',_0x39b353(0xda)]},'children':[this[_0x39b353(0xca)]]}]}]});}[_0x435604(0x104)](){const _0x272248=_0x435604;super[_0x272248(0x104)](),this[_0x272248(0xf2)]&&this[_0x272248(0x10b)][_0x272248(0xf7)](this[_0x272248(0xf2)]);let _0x1dd279=!0x1;this['on'](_0x272248(0xe8),(_0x454dde,_0x47f40f,_0x149a3d)=>{const _0x14200e=_0x272248,_0x4116d7=!this[_0x14200e(0x10b)][_0x14200e(0xe4)][_0x14200e(0xcb)](_0x14200e(0x108));this[_0x14200e(0x10b)][_0x14200e(0xf7)](_0x149a3d),this[_0x14200e(0xc0)]&&_0x4116d7&&!_0x1dd279&&this[_0x14200e(0xe4)][_0x14200e(0xdf)]({'top':this[_0x14200e(0xe4)][_0x14200e(0x10e)],'behavior':_0x14200e(0xfa)});}),this['on'](_0x272248(0xe0),(_0x3c3656,_0x56c30d,_0x582da8)=>{const _0x2648a7=_0x272248;_0x1dd279=!0x1,_0x582da8?(this[_0x2648a7(0xf2)]=null,this[_0x2648a7(0x10b)][_0x2648a7(0xf5)]()):this[_0x2648a7(0xf2)]||this[_0x2648a7(0x10b)][_0x2648a7(0xf7)]('');}),this[_0x272248(0xe5)](this[_0x272248(0xe4)],_0x272248(0xdd),()=>{_0x1dd279=!0x0;}),this[_0x272248(0xe5)](this[_0x272248(0xe4)],_0x272248(0xea),()=>{_0x1dd279=!0x0;});}[_0x435604(0x109)](){const _0x492186=_0x435604;this[_0x492186(0xe4)][_0x492186(0x109)]();}[_0x435604(0x110)](){const _0x1f6ffb=_0x435604,_0x1733d6=this[_0x1f6ffb(0xe2)],_0x23b00e=new _0x593106(this[_0x1f6ffb(0xe2)]),_0x586993=_0x1f6ffb(0xde);return _0x23b00e[_0x1f6ffb(0xbd)]({'label':_0x558369(_0x1733d6,_0x1f6ffb(0xf6)),'icon':_0x2f44ea,'class':_0x586993,'tooltip':!0x0}),_0x23b00e[_0x1f6ffb(0x10d)](_0x1f6ffb(0xc9))['to'](this,_0x1f6ffb(0xf2),_0x4b73e3=>!!_0x4b73e3),_0x23b00e[_0x1f6ffb(0x10d)](_0x1f6ffb(0xc3))['to'](this,_0x1f6ffb(0xc0),_0x22dd1b=>!_0x22dd1b),_0x23b00e['on'](_0x1f6ffb(0xf4),()=>{const _0x14b23c=_0x1f6ffb;this[_0x14b23c(0x101)](this[_0x14b23c(0x10b)][_0x14b23c(0xe4)]),_0x23b00e[_0x14b23c(0xd4)]=_0x2355a1[_0x14b23c(0xd9)],_0x23b00e[_0x14b23c(0xf9)]=_0x586993+_0x14b23c(0xe9),this[_0x14b23c(0x109)](),setTimeout(()=>{const _0x19cfea=_0x14b23c;_0x23b00e[_0x19cfea(0xd4)]=_0x2f44ea,_0x23b00e[_0x19cfea(0xf9)]=_0x586993;},0x3e8);}),_0x23b00e;}[_0x435604(0x101)](_0x2e5a02){const _0x13810e=_0x435604,{window:_0x518727,document:_0x28013a}=_0x24e968;if(_0x518727[_0x13810e(0xd3)]){const {Blob:_0x296283,ClipboardItem:_0x3da48a}=_0x518727,_0x2319eb=[new _0x3da48a({'text/html':new _0x296283([_0x2e5a02[_0x13810e(0xe3)]],{'type':_0x13810e(0xfe)}),'text/plain':new _0x296283([_0x2e5a02[_0x13810e(0xc5)]||''],{'type':_0x13810e(0xfc)})})];navigator[_0x13810e(0xd5)][_0x13810e(0xf1)](_0x2319eb);}else{const _0x6409b8=_0x28013a[_0x13810e(0xfd)](_0x13810e(0x102));_0x6409b8[_0x13810e(0xff)][_0x13810e(0x111)]=_0x13810e(0xef),_0x6409b8[_0x13810e(0xff)][_0x13810e(0xd2)]=_0x13810e(0xd1),_0x6409b8[_0x13810e(0xe3)]=_0x13810e(0xf3)+_0x2e5a02[_0x13810e(0xe3)]+_0x13810e(0x107),_0x28013a[_0x13810e(0xfb)][_0x13810e(0xbf)](_0x6409b8);const _0x520974=_0x28013a[_0x13810e(0xbc)]();_0x520974[_0x13810e(0xc4)](_0x6409b8[_0x13810e(0xeb)]),_0x520974[_0x13810e(0xc1)](_0x6409b8[_0x13810e(0xf8)]);const _0x3ca397=_0x518727[_0x13810e(0x106)]();_0x3ca397[_0x13810e(0xcc)](),_0x3ca397[_0x13810e(0xdc)](_0x520974),_0x28013a[_0x13810e(0xc7)](_0x13810e(0xf0)),_0x6409b8[_0x13810e(0xe7)]();}}}export class ContentFieldView extends _0x160016{constructor(_0x4b3906,_0x582c6e=''){const _0x6dbddb=_0x435604;super(_0x4b3906),this[_0x6dbddb(0xd7)]=this[_0x6dbddb(0xc8)](),this[_0x6dbddb(0x103)]({'tag':_0x6dbddb(0x102),'attributes':{'class':['ck',_0x6dbddb(0xed),_0x582c6e,_0x6dbddb(0xd8),_0x6dbddb(0xc2)]}});}[_0x435604(0xf7)](_0x3f8e32){const _0x5d522c=_0x435604;this[_0x5d522c(0xe4)][_0x5d522c(0xe3)]=_0x3f8e32;}[_0x435604(0xf5)](){const _0x10a8c0=_0x435604;this[_0x10a8c0(0xe4)][_0x10a8c0(0xbf)](this[_0x10a8c0(0xd7)][_0x10a8c0(0xe4)]);}[_0x435604(0xc8)](){const _0x3a8e7e=_0x435604,_0x388a5b=new _0x160016(),_0x42872e=this[_0x3a8e7e(0xe2)],_0x5680b4=new _0x331435();return _0x5680b4[_0x3a8e7e(0xc9)]=!0x0,_0x388a5b[_0x3a8e7e(0x103)]({'tag':_0x3a8e7e(0x102),'attributes':{'class':['ck',_0x3a8e7e(0x10c)]},'children':[_0x5680b4,{'text':_0x558369(_0x42872e,_0x3a8e7e(0x10a))}]}),_0x388a5b[_0x3a8e7e(0x104)](),_0x388a5b;}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ai/ui/aiformerrorview
|
|
7
|
+
*/
|
|
8
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
10
|
+
/**
|
|
11
|
+
* A class representing the error view of the AI assistant.
|
|
12
|
+
*/
|
|
13
|
+
export default class AIFormErrorView extends View {
|
|
14
|
+
/**
|
|
15
|
+
* The text of the error.
|
|
16
|
+
*
|
|
17
|
+
* @observable
|
|
18
|
+
*/
|
|
19
|
+
text: string;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an instance of the {@link module:ai/ui/aiformerrorview~AIFormErrorView} class.
|
|
22
|
+
*
|
|
23
|
+
* @param locale The localization services instance.
|
|
24
|
+
*/
|
|
25
|
+
constructor(locale: Locale, text?: string);
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
(function(_0x10a022,_0x401502){const _0x376bce=_0x54f7,_0x1545f3=_0x10a022();while(!![]){try{const _0x42948b=parseInt(_0x376bce(0x1bb))/0x1+-parseInt(_0x376bce(0x1b9))/0x2*(parseInt(_0x376bce(0x1b1))/0x3)+-parseInt(_0x376bce(0x1b2))/0x4+-parseInt(_0x376bce(0x1b5))/0x5+-parseInt(_0x376bce(0x1b8))/0x6*(parseInt(_0x376bce(0x1b4))/0x7)+parseInt(_0x376bce(0x1ba))/0x8+parseInt(_0x376bce(0x1ad))/0x9*(parseInt(_0x376bce(0x1b6))/0xa);if(_0x42948b===_0x401502)break;else _0x1545f3['push'](_0x1545f3['shift']());}catch(_0x2b1ebc){_0x1545f3['push'](_0x1545f3['shift']());}}}(_0x5512,0xcb0ad));function _0x54f7(_0x44c75f,_0xc2391f){const _0x55120d=_0x5512();return _0x54f7=function(_0x54f78c,_0x57221e){_0x54f78c=_0x54f78c-0x1ad;let _0x448597=_0x55120d[_0x54f78c];return _0x448597;},_0x54f7(_0x44c75f,_0xc2391f);}function _0x5512(){const _0x41a12b=['845996vTJeLC','text','bindTemplate','7132743BIWEwU','div','content','setTemplate','72ftCXUZ','1675604hidiOz','set','257229rQAhtW','304700albWfM','10LXGoDA','ck-ai-form__error','120bPhGQA','94702WoUiKG','12354744zlOpcL'];_0x5512=function(){return _0x41a12b;};return _0x5512();}import{View as _0x939d76,IconView as _0x11e3f0}from'ckeditor5/src/ui.js';import _0x5610ec from'../../../theme/icons/error.svg';export default class tt extends _0x939d76{constructor(_0x45e386,_0x40c6be=''){const _0x4a87f1=_0x54f7;super(_0x45e386);const _0x383770=new _0x11e3f0(),_0x4498ae=this[_0x4a87f1(0x1bd)];this[_0x4a87f1(0x1b3)](_0x4a87f1(0x1bc),_0x40c6be),_0x383770[_0x4a87f1(0x1af)]=_0x5610ec,this[_0x4a87f1(0x1b0)]({'tag':_0x4a87f1(0x1ae),'attributes':{'class':['ck',_0x4a87f1(0x1b7)]},'children':[_0x383770,{'text':_0x4498ae['to'](_0x4a87f1(0x1bc))}]});}}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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/aiformpromptview
|
|
7
|
+
*/
|
|
8
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { AutocompleteView, ButtonView, type TextareaView, type AutocompleteViewConfig } from 'ckeditor5/src/ui.js';
|
|
10
|
+
/**
|
|
11
|
+
* A textarea field allowing to ask AI.
|
|
12
|
+
*/
|
|
13
|
+
export default class AIFormPromptView extends AutocompleteView<TextareaView> {
|
|
14
|
+
/**
|
|
15
|
+
* The submit button view.
|
|
16
|
+
*/
|
|
17
|
+
submitButtonView: ButtonView;
|
|
18
|
+
/**
|
|
19
|
+
* The button that shows and hides the history autocomplete panel.
|
|
20
|
+
*/
|
|
21
|
+
showHistoryButtonView: ButtonView;
|
|
22
|
+
/**
|
|
23
|
+
* Creates `AIFormPromptView` instance.
|
|
24
|
+
*
|
|
25
|
+
* @param locale The localization services instance.
|
|
26
|
+
* @param config Autocomplete config.
|
|
27
|
+
*/
|
|
28
|
+
constructor(locale: Locale, config: AutocompleteViewConfig<TextareaView>);
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
render(): void;
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
focus(direction?: 1 | -1): void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Fired when the query is submitted by the user.
|
|
40
|
+
*
|
|
41
|
+
* @eventName ~AIFormPromptView#submit
|
|
42
|
+
*/
|
|
43
|
+
export type AIFormPromptViewSubmitEvent = {
|
|
44
|
+
name: 'submit';
|
|
45
|
+
args: [query: string];
|
|
46
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const _0x395172=_0x2df2;(function(_0x1940b9,_0x5538c1){const _0x21ae6d=_0x2df2,_0x5355b4=_0x1940b9();while(!![]){try{const _0xae2bbf=parseInt(_0x21ae6d(0x176))/0x1+parseInt(_0x21ae6d(0x1a7))/0x2+parseInt(_0x21ae6d(0x175))/0x3+parseInt(_0x21ae6d(0x181))/0x4*(parseInt(_0x21ae6d(0x185))/0x5)+-parseInt(_0x21ae6d(0x173))/0x6*(parseInt(_0x21ae6d(0x1ab))/0x7)+parseInt(_0x21ae6d(0x19b))/0x8*(-parseInt(_0x21ae6d(0x1a0))/0x9)+-parseInt(_0x21ae6d(0x18b))/0xa;if(_0xae2bbf===_0x5538c1)break;else _0x5355b4['push'](_0x5355b4['shift']());}catch(_0x302ac3){_0x5355b4['push'](_0x5355b4['shift']());}}}(_0x5e5b,0x343e5));import{Rect as _0x44bcca,global as _0x171228,isVisible as _0x18a7b1}from'ckeditor5/src/utils.js';function _0x5e5b(){const _0x519b8c=['execute','update','locale','value','116952UNnOcO','history','enter','width','style','99WvoCsQ','render','focusFirst','ck-ai-form__toggle-history','maxRows','rtl','minRows','672086YOMVPZ','keystrokes','focusableChildren','focusLast','1164499gOzTFl','fieldView','Submit','6IfrGdD','bind','958863ibTVUc','202048LaledH','resultsView','left','filteredView','add','right','isVisible','showHistoryButtonView','excludeScrollbarsAndBorders','focusCycler','ck-ai-form__submit','40qMxjFA','submitButtonView','uiLanguageDirection','submit','100970aNRxuC','isEmpty','_createShowHistoryButton','History','target','children','5184970AizXJy','isEnabled','requestAnimationFrame','element','set','window','queryView','isOn','fire','fieldWrapperChildren','focus','_createSubmitButton'];_0x5e5b=function(){return _0x519b8c;};return _0x5e5b();}import{AutocompleteView as _0x576f3c,ButtonView as _0x12e82b}from'ckeditor5/src/ui.js';function _0x2df2(_0x453d87,_0x4f803e){const _0x5e5be5=_0x5e5b();return _0x2df2=function(_0x2df2ca,_0x201e29){_0x2df2ca=_0x2df2ca-0x171;let _0x461cff=_0x5e5be5[_0x2df2ca];return _0x461cff;},_0x2df2(_0x453d87,_0x4f803e);}import{icons as _0x4416aa}from'ckeditor5/src/core.js';import{getTranslation as _0x3d1472}from'../../utils/common-translations.js';import _0x9812ce from'../../../theme/icons/submit.svg';export default class ht extends _0x576f3c{constructor(_0x2a75d0,_0x224959){const _0x95727c=_0x2df2;super(_0x2a75d0,_0x224959),this[_0x95727c(0x191)][_0x95727c(0x171)][_0x95727c(0x1a6)]=0x1,this[_0x95727c(0x191)][_0x95727c(0x171)][_0x95727c(0x1a4)]=0x3,this[_0x95727c(0x182)]=this[_0x95727c(0x196)](),this[_0x95727c(0x17d)]=this[_0x95727c(0x187)](),this[_0x95727c(0x1a9)][_0x95727c(0x17a)](this[_0x95727c(0x17d)],0x1),this[_0x95727c(0x1a9)][_0x95727c(0x17a)](this[_0x95727c(0x182)]);}[_0x395172(0x1a1)](){const _0x4ea2e1=_0x395172;super[_0x4ea2e1(0x1a1)](),this[_0x4ea2e1(0x191)][_0x4ea2e1(0x194)][_0x4ea2e1(0x17a)](this[_0x4ea2e1(0x17d)]),this[_0x4ea2e1(0x18a)][_0x4ea2e1(0x17a)](this[_0x4ea2e1(0x182)]),this[_0x4ea2e1(0x1a8)][_0x4ea2e1(0x18f)](_0x4ea2e1(0x19d),(_0xb31689,_0x5535c2)=>{const _0x15fbfb=_0x4ea2e1;_0xb31689[_0x15fbfb(0x189)]==this[_0x15fbfb(0x191)][_0x15fbfb(0x171)][_0x15fbfb(0x18e)]&&(this[_0x15fbfb(0x184)](),_0x5535c2());});}[_0x395172(0x196)](){const _0x51d162=_0x395172,_0x434451=new _0x12e82b(this[_0x51d162(0x199)]),_0x5031eb=this[_0x51d162(0x199)];return _0x434451[_0x51d162(0x18f)]({'icon':_0x9812ce,'label':_0x3d1472(_0x5031eb,_0x51d162(0x172)),'isVisible':!0x0,'tooltip':!0x0,'class':_0x51d162(0x180)}),_0x434451['on'](_0x51d162(0x197),()=>{const _0x2b33c8=_0x51d162;this[_0x2b33c8(0x184)]();}),_0x434451[_0x51d162(0x174)](_0x51d162(0x18c))['to'](this[_0x51d162(0x191)][_0x51d162(0x171)],_0x51d162(0x186),this,_0x51d162(0x18c),(_0x52ad96,_0x47eaa4)=>!_0x52ad96&&_0x47eaa4),_0x434451;}[_0x395172(0x187)](){const _0x176fb5=_0x395172,_0x18c47b=new _0x12e82b(this[_0x176fb5(0x199)]),_0x18e3d7=this[_0x176fb5(0x177)],_0x2fec2e=this[_0x176fb5(0x199)];_0x18c47b[_0x176fb5(0x18f)]({'label':_0x3d1472(_0x2fec2e,_0x176fb5(0x188)),'withText':!0x1,'icon':_0x4416aa[_0x176fb5(0x19c)],'tooltip':!0x0,'tooltipPosition':'sw','class':_0x176fb5(0x1a3)}),_0x18c47b[_0x176fb5(0x174)](_0x176fb5(0x192))['to'](_0x18e3d7,_0x176fb5(0x17c)),_0x18c47b[_0x176fb5(0x174)](_0x176fb5(0x18c))['to'](this,_0x176fb5(0x18c)),_0x18c47b['on'](_0x176fb5(0x197),()=>{const _0x52694d=_0x176fb5;_0x18e3d7[_0x52694d(0x17c)]=!_0x18e3d7[_0x52694d(0x17c)],_0x18e3d7[_0x52694d(0x17c)]?this[_0x52694d(0x179)][_0x52694d(0x195)]():this[_0x52694d(0x195)]();});const _0x5716b7=()=>{const _0x44b098=_0x176fb5;_0x171228[_0x44b098(0x190)][_0x44b098(0x18d)](()=>{const _0x82ffe5=_0x44b098;if(_0x18a7b1(this[_0x82ffe5(0x18e)])){const _0x598d5c=new _0x44bcca(this[_0x82ffe5(0x191)][_0x82ffe5(0x171)][_0x82ffe5(0x18e)]),_0x53165e=_0x598d5c[_0x82ffe5(0x19e)],_0x96d0ef=_0x82ffe5(0x1a5)===_0x2fec2e[_0x82ffe5(0x183)]?_0x82ffe5(0x178):_0x82ffe5(0x17b);_0x598d5c[_0x82ffe5(0x17e)](),_0x18c47b[_0x82ffe5(0x18e)][_0x82ffe5(0x19f)][_0x96d0ef]=_0x53165e-_0x598d5c[_0x82ffe5(0x19e)]+0x1+'px';}});};return this[_0x176fb5(0x191)][_0x176fb5(0x171)]['on'](_0x176fb5(0x198),_0x5716b7),this['on'](_0x176fb5(0x1a1),_0x5716b7),_0x18c47b;}[_0x395172(0x184)](){const _0x5c33dd=_0x395172,_0x557153=this[_0x5c33dd(0x191)][_0x5c33dd(0x171)][_0x5c33dd(0x18e)][_0x5c33dd(0x19a)];this[_0x5c33dd(0x193)](_0x5c33dd(0x184),_0x557153);}[_0x395172(0x195)](_0x86b1d1){const _0x5e19c0=_0x395172;-0x1===_0x86b1d1?this[_0x5e19c0(0x17f)][_0x5e19c0(0x1aa)]():this[_0x5e19c0(0x17f)][_0x5e19c0(0x1a2)]();}}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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/aiformtoolbarview
|
|
7
|
+
*/
|
|
8
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
9
|
+
import { ToolbarView, ButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
/**
|
|
11
|
+
* The action name affecting the label of {@link ~AIFormToolbarView#replaceButton}.
|
|
12
|
+
*
|
|
13
|
+
* Available keys are:
|
|
14
|
+
* * `AIFormToolbarViewMainActionLabel.REPLACE`,
|
|
15
|
+
* * `AIFormToolbarViewMainActionLabel.INSERT`
|
|
16
|
+
*/
|
|
17
|
+
export declare const AIFormToolbarViewMainActionLabel: {
|
|
18
|
+
readonly REPLACE: "replace";
|
|
19
|
+
readonly INSERT: "insert";
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A class representing the text area view of the AI assistant.
|
|
23
|
+
*/
|
|
24
|
+
export default class AIFormToolbarView extends ToolbarView {
|
|
25
|
+
/**
|
|
26
|
+
* Controls whether the toolbar is visible.
|
|
27
|
+
*
|
|
28
|
+
* @observable
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
isVisible: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Button that is used to replace the selected content by the generated one.
|
|
34
|
+
*/
|
|
35
|
+
replaceButton: ButtonView;
|
|
36
|
+
/**
|
|
37
|
+
* Button that is used to insert the generated content below the selection.
|
|
38
|
+
*/
|
|
39
|
+
insertButton: ButtonView;
|
|
40
|
+
/**
|
|
41
|
+
* Button that is used to regenerate the response.
|
|
42
|
+
*/
|
|
43
|
+
tryAgainButton: ButtonView;
|
|
44
|
+
/**
|
|
45
|
+
* Button that is used to stop the processing of the request.
|
|
46
|
+
*/
|
|
47
|
+
stopButton: ButtonView;
|
|
48
|
+
/**
|
|
49
|
+
* The action name affecting the label of {@link #replaceButton}.
|
|
50
|
+
*
|
|
51
|
+
* @default 'replace'
|
|
52
|
+
*/
|
|
53
|
+
mainAction: typeof AIFormToolbarViewMainActionLabel[keyof typeof AIFormToolbarViewMainActionLabel];
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
constructor(locale: Locale);
|
|
58
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const _0x1545fc=_0x4a08;(function(_0x495070,_0x4619c3){const _0x510dc0=_0x4a08,_0x5e069c=_0x495070();while(!![]){try{const _0x5bde91=parseInt(_0x510dc0(0x12b))/0x1*(-parseInt(_0x510dc0(0x123))/0x2)+-parseInt(_0x510dc0(0x120))/0x3*(-parseInt(_0x510dc0(0x12a))/0x4)+parseInt(_0x510dc0(0x137))/0x5*(parseInt(_0x510dc0(0x11a))/0x6)+parseInt(_0x510dc0(0x125))/0x7+-parseInt(_0x510dc0(0x13a))/0x8*(-parseInt(_0x510dc0(0x117))/0x9)+parseInt(_0x510dc0(0x127))/0xa*(parseInt(_0x510dc0(0x11c))/0xb)+-parseInt(_0x510dc0(0x130))/0xc*(parseInt(_0x510dc0(0x122))/0xd);if(_0x5bde91===_0x4619c3)break;else _0x5e069c['push'](_0x5e069c['shift']());}catch(_0x459eb9){_0x5e069c['push'](_0x5e069c['shift']());}}}(_0x2da9,0x95dc3));import{ToolbarView as _0x856a97,ButtonView as _0x1d2137}from'ckeditor5/src/ui.js';function _0x2da9(){const _0x3e41f0=['AI_','13300443JRvBIK','6yeKTKQ','replace','80339juXLlL','ck-hidden','62340GfmtNh','addMany','ck-button-action','4221272nTefid','277945boazDU','bind','replaceButton','_CONTENT','insertButton','12easGvT','Insert\x20below','extendTemplate','bindTemplate','_createButton','toUpperCase','items','5xWiiub','stopButton','Stop','9952rpXOeU','ck-ai-form__toolbar','tryAgainButton','label','Try\x20again','2430JUJCAn','isVisible','mainAction','5884932yJlefJ','insert','154nLvZtN','REPLACE','locale','set','3bGPnvF'];_0x2da9=function(){return _0x3e41f0;};return _0x2da9();}function _0x4a08(_0x59d253,_0x3aaf76){const _0x2da9d8=_0x2da9();return _0x4a08=function(_0x4a088e,_0x2d3b44){_0x4a088e=_0x4a088e-0x117;let _0x3e76f3=_0x2da9d8[_0x4a088e];return _0x3e76f3;},_0x4a08(_0x59d253,_0x3aaf76);}import{getTranslation as _0x1786f8}from'../../utils/common-translations.js';export const AIFormToolbarViewMainActionLabel={'REPLACE':_0x1545fc(0x124),'INSERT':_0x1545fc(0x11b)};export default class nt extends _0x856a97{constructor(_0x4c63d2){const _0x10d489=_0x1545fc;super(_0x4c63d2),this[_0x10d489(0x11f)](_0x10d489(0x118),!0x1),this[_0x10d489(0x11f)](_0x10d489(0x119),AIFormToolbarViewMainActionLabel[_0x10d489(0x11d)]),this[_0x10d489(0x12d)]=this[_0x10d489(0x134)]('',_0x10d489(0x129)),this[_0x10d489(0x12d)][_0x10d489(0x12c)](_0x10d489(0x13d))['to'](this,_0x10d489(0x119),_0x29a584=>_0x1786f8(_0x4c63d2,_0x10d489(0x121)+_0x29a584[_0x10d489(0x135)]()+_0x10d489(0x12e))),this[_0x10d489(0x12f)]=this[_0x10d489(0x134)](_0x1786f8(_0x4c63d2,_0x10d489(0x131))),this[_0x10d489(0x13c)]=this[_0x10d489(0x134)](_0x1786f8(_0x4c63d2,_0x10d489(0x13e))),this[_0x10d489(0x138)]=this[_0x10d489(0x134)](_0x1786f8(_0x4c63d2,_0x10d489(0x139)));const _0x533f49=this[_0x10d489(0x133)];this[_0x10d489(0x132)]({'attributes':{'class':[_0x10d489(0x13b),_0x533f49['if'](_0x10d489(0x118),_0x10d489(0x126),_0xc2e780=>!_0xc2e780)]}}),this[_0x10d489(0x136)][_0x10d489(0x128)]([this[_0x10d489(0x12d)],this[_0x10d489(0x12f)],this[_0x10d489(0x13c)],this[_0x10d489(0x138)]]);}[_0x1545fc(0x134)](_0xb75301,_0xdf7507){const _0x289b42=_0x1545fc,_0x32406c=new _0x1d2137(this[_0x289b42(0x11e)]);return _0x32406c[_0x289b42(0x11f)]({'label':_0xb75301,'class':_0xdf7507||'','isVisible':!0x0,'withText':!0x0}),_0x32406c;}}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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/aiformview
|
|
7
|
+
*/
|
|
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
|
+
/**
|
|
15
|
+
* A class representing the form view of the AI assistant.
|
|
16
|
+
*/
|
|
17
|
+
export default class AIFormView extends View implements ViewWithFocusCycler {
|
|
18
|
+
/**
|
|
19
|
+
* Tracks information about the DOM focus in the form.
|
|
20
|
+
*
|
|
21
|
+
* @readonly
|
|
22
|
+
*/
|
|
23
|
+
focusTracker: FocusTracker;
|
|
24
|
+
/**
|
|
25
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
26
|
+
*
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
29
|
+
keystrokes: KeystrokeHandler;
|
|
30
|
+
/**
|
|
31
|
+
* The text area view that is used to display AI response.
|
|
32
|
+
*/
|
|
33
|
+
contentArea: AIFormContentArea;
|
|
34
|
+
/**
|
|
35
|
+
* Toolbar view containing button views that manage the AI response and this form itself.
|
|
36
|
+
*/
|
|
37
|
+
toolbar: AIFormToolbarView;
|
|
38
|
+
/**
|
|
39
|
+
* The component used for handling the user's query, including history and submit buttons.
|
|
40
|
+
*/
|
|
41
|
+
promptView: AIFormPromptView;
|
|
42
|
+
/**
|
|
43
|
+
* View that is used to display the error message.
|
|
44
|
+
*/
|
|
45
|
+
errorView: AIFormErrorView;
|
|
46
|
+
/**
|
|
47
|
+
* The prompt text can be configured either during construction when the AI command has been selected,
|
|
48
|
+
* or later by submitting the {@link #labeledInput}, if it hasn't been previously initialized.
|
|
49
|
+
* After setting this value the AI request is triggered.
|
|
50
|
+
*/
|
|
51
|
+
prompt: string;
|
|
52
|
+
/**
|
|
53
|
+
* The value that is generated after user submitting the user prompt.
|
|
54
|
+
*/
|
|
55
|
+
value: string;
|
|
56
|
+
/**
|
|
57
|
+
* Flag that indicates if the AI assistant form view is enabled or disabled.
|
|
58
|
+
*
|
|
59
|
+
* If it is disabled, all interactive elements of this view are disabled as well.
|
|
60
|
+
*/
|
|
61
|
+
isEnabled: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Indicates if the AI request is processing.
|
|
64
|
+
*/
|
|
65
|
+
isProcessing: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Indicates if the AI request failed.
|
|
68
|
+
*/
|
|
69
|
+
isError: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The action name for the main insertion button in the {@link #toolbar}.
|
|
72
|
+
*
|
|
73
|
+
* See {@link module:ai/ui/aiformtoolbarview~AIFormToolbarView#replaceButton}.
|
|
74
|
+
*
|
|
75
|
+
* @default 'replace'
|
|
76
|
+
*/
|
|
77
|
+
mainAction: typeof AIFormToolbarViewMainActionLabel[keyof typeof AIFormToolbarViewMainActionLabel];
|
|
78
|
+
/**
|
|
79
|
+
* Creates an instance of the {@link module:ai/ui/aiformview~AIFormView} class.
|
|
80
|
+
*
|
|
81
|
+
* @param locale The localization services instance.
|
|
82
|
+
*/
|
|
83
|
+
constructor(locale: Locale, uiClasses: string, contentAreaCssClass?: string);
|
|
84
|
+
/**
|
|
85
|
+
* @inheritDoc
|
|
86
|
+
*/
|
|
87
|
+
render(): void;
|
|
88
|
+
/**
|
|
89
|
+
* @inheritDoc
|
|
90
|
+
*/
|
|
91
|
+
focus(direction?: 1 | -1): void;
|
|
92
|
+
/**
|
|
93
|
+
* Resets the form to the initial values.
|
|
94
|
+
*/
|
|
95
|
+
reset(): void;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Fired when a user performed an action that should lead to replace the current selection by generated content.
|
|
99
|
+
*
|
|
100
|
+
* @eventName ~AIFormView#replaceContent
|
|
101
|
+
*/
|
|
102
|
+
export type ReplaceContentEvent = {
|
|
103
|
+
name: 'replaceContent';
|
|
104
|
+
args: [];
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Fired when a user performed an action that should lead to insert generated content below the current selection.
|
|
108
|
+
*
|
|
109
|
+
* @eventName ~AIFormView#insertContentBelow
|
|
110
|
+
*/
|
|
111
|
+
export type InsertContentBelowEvent = {
|
|
112
|
+
name: 'insertContentBelow';
|
|
113
|
+
args: [];
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Fired when a user performed an action that should lead to retry the previous request to AI.
|
|
117
|
+
*
|
|
118
|
+
* @eventName ~AIFormView#tryAgainEvent
|
|
119
|
+
*/
|
|
120
|
+
export type TryAgainEvent = {
|
|
121
|
+
name: 'tryAgainEvent';
|
|
122
|
+
args: [];
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Fired when a user performed an action that should lead to stop the processing of AI.
|
|
126
|
+
*
|
|
127
|
+
* @eventName ~AIFormView#stopProcessing
|
|
128
|
+
*/
|
|
129
|
+
export type StopProcessingEvent = {
|
|
130
|
+
name: 'stopProcessing';
|
|
131
|
+
args: [];
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Fired when a user performed an action that should lead to ask AI.
|
|
135
|
+
*
|
|
136
|
+
* @eventName ~AIFormView#submitPrompt
|
|
137
|
+
*/
|
|
138
|
+
export type SubmitPromptEvent = {
|
|
139
|
+
name: 'submitPrompt';
|
|
140
|
+
args: [prompt: string];
|
|
141
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
function _0x37b6(){const _0x5cb9be=['focus','Ask\x20AI\x20to\x20edit\x20or\x20generate','submitPrompt','35kmBYLI','tab','high','execute','value','bind','submit','shift\x20+\x20tab','listenTo','focusCycler','element','_focusables','search','bindTemplate','isVisible','set','950gKqHQh','queryView','25407FBoYmo','REPLACE','add','Ask\x20AI\x20to\x20improve\x20generated\x20text','prompt','trim','mainAction','isProcessing','stopButton','div','AI_ERROR_FAILED','chain','_createPromptView','focusTracker','contentArea','415112kxYUeR','startProcessing','replaceButton','focusLast','_promptHistory','clear','fieldView','tryAgainButton','label','copyButtonView','text','867588rUxPbf','ck-hidden','Empty\x20history','toolbar','finishProcessing','isEnabled','fire','historyGroupView','7QLuHhV','insertContentBelow','bindTo','render','clearHistory','stopProcessing','delegate','ck-ai-form-content','ck-ai-form','createCollection','errorView','isError','tryAgainEvent','_createToolbar','reset','promptView','setTemplate','locale','1980iQAwfZ','insertButton','_createHistoryView','keystrokes','focusFirst','154150fZVpaW','replaceContent','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.','handleError','296634TVdFXd','4404nhhXoy','16KSBMig','263782koWzzq','items'];_0x37b6=function(){return _0x5cb9be;};return _0x37b6();}const _0x221b24=_0x5177;(function(_0x393296,_0x54a89f){const _0x20a79a=_0x5177,_0x78b1ca=_0x393296();while(!![]){try{const _0xa8e522=-parseInt(_0x20a79a(0xaf))/0x1+parseInt(_0x20a79a(0xa8))/0x2+parseInt(_0x20a79a(0xe0))/0x3*(parseInt(_0x20a79a(0xae))/0x4)+-parseInt(_0x20a79a(0xb4))/0x5*(-parseInt(_0x20a79a(0xac))/0x6)+parseInt(_0x20a79a(0x91))/0x7*(-parseInt(_0x20a79a(0xd5))/0x8)+parseInt(_0x20a79a(0xc6))/0x9*(-parseInt(_0x20a79a(0xc4))/0xa)+-parseInt(_0x20a79a(0xa3))/0xb*(parseInt(_0x20a79a(0xad))/0xc);if(_0xa8e522===_0x54a89f)break;else _0x78b1ca['push'](_0x78b1ca['shift']());}catch(_0x1efde7){_0x78b1ca['push'](_0x78b1ca['shift']());}}}(_0x37b6,0xe30e0));import{FocusTracker as _0x9b47e3,KeystrokeHandler as _0x59adfb}from'ckeditor5/src/utils.js';import{View as _0x377fa4,FocusCycler as _0x4304f7,createLabeledTextarea as _0x527bdf}from'ckeditor5/src/ui.js';import _0x217d1a,{AIFormToolbarViewMainActionLabel as _0x43eb6a}from'./aiformtoolbarview.js';import _0x28afa5 from'./aiformcontentarea.js';import _0x7ea8ac from'./aiformerrorview.js';import _0x42c6cc from'./aiformpromptview.js';import _0x135f98 from'./aihistorylistview.js';import _0x5203c3 from'./aihistorylistitemview.js';function _0x5177(_0x4a7d4c,_0x137e6d){const _0x37b61d=_0x37b6();return _0x5177=function(_0x5177cc,_0x184d21){_0x5177cc=_0x5177cc-0x8a;let _0x861c9e=_0x37b61d[_0x5177cc];return _0x861c9e;},_0x5177(_0x4a7d4c,_0x137e6d);}import _0x123216 from'./prompthistory.js';import{getTranslation as _0x636862}from'../../utils/common-translations.js';import{escape as _0x3353b9}from'lodash-es';export default class K extends _0x377fa4{constructor(_0x46272e,_0x4a6b97,_0x26b22d=''){const _0x105390=_0x5177;super(_0x46272e),this[_0x105390(0xc3)](_0x105390(0x8e),!0x0),this[_0x105390(0xc3)](_0x105390(0xcd),!0x1),this[_0x105390(0xc3)](_0x105390(0xca),''),this[_0x105390(0xc3)](_0x105390(0xb8),''),this[_0x105390(0xc3)](_0x105390(0x9c),!0x1),this[_0x105390(0xc3)](_0x105390(0xcc),_0x43eb6a[_0x105390(0xc7)]),this[_0x105390(0xd9)]=new _0x123216(),this[_0x105390(0x9b)]=new _0x7ea8ac(_0x46272e),this[_0x105390(0xd4)]=new _0x28afa5(_0x46272e,_0x26b22d),this[_0x105390(0xd4)][_0x105390(0xb9)](_0x105390(0xcd))['to'](this),this[_0x105390(0xd4)][_0x105390(0xb9)](_0x105390(0xb8))['to'](this),this[_0x105390(0x8c)]=this[_0x105390(0x9e)](),this[_0x105390(0x8c)][_0x105390(0xb9)](_0x105390(0xcc))['to'](this),this[_0x105390(0xa0)]=this[_0x105390(0xd2)](),this[_0x105390(0xd3)]=new _0x9b47e3(),this[_0x105390(0xa6)]=new _0x59adfb(),this[_0x105390(0xbf)]=this[_0x105390(0x9a)]([this[_0x105390(0xd4)],this[_0x105390(0xd4)][_0x105390(0xde)],this[_0x105390(0x8c)],this[_0x105390(0xa0)]]),this[_0x105390(0xbd)]=new _0x4304f7({'focusables':this[_0x105390(0xbf)],'focusTracker':this[_0x105390(0xd3)],'keystrokeHandler':this[_0x105390(0xa6)],'actions':{'focusPrevious':_0x105390(0xbb),'focusNext':_0x105390(0xb5)}}),this[_0x105390(0xbd)][_0x105390(0xd1)](this[_0x105390(0xa0)][_0x105390(0xbd)]),this[_0x105390(0xa0)][_0x105390(0xc5)][_0x105390(0xdb)][_0x105390(0xb9)](_0x105390(0xb8))['to'](this,_0x105390(0xca));const _0x503eac=this[_0x105390(0xc1)];this[_0x105390(0xa1)]({'tag':_0x105390(0xcf),'attributes':{'class':['ck',_0x105390(0x99),_0x4a6b97],'tabindex':'-1'},'children':[{'tag':_0x105390(0xcf),'attributes':{'class':['ck',_0x105390(0x98)]},'children':[{'tag':_0x105390(0xcf),'attributes':{'class':[_0x503eac['if'](_0x105390(0x9c),_0x105390(0x8a),_0x292409=>!_0x292409)]},'children':[this[_0x105390(0x9b)]]},this[_0x105390(0xd4)],this[_0x105390(0x8c)],this[_0x105390(0xa0)]]}]});}[_0x221b24(0x94)](){const _0xea4078=_0x221b24;super[_0xea4078(0x94)](),this[_0xea4078(0xd3)][_0xea4078(0xc8)](this[_0xea4078(0xd4)][_0xea4078(0xbe)]),this[_0xea4078(0xd3)][_0xea4078(0xc8)](this[_0xea4078(0xd4)][_0xea4078(0xde)][_0xea4078(0xbe)]),this[_0xea4078(0xd3)][_0xea4078(0xc8)](this[_0xea4078(0x8c)][_0xea4078(0xbe)]),this[_0xea4078(0xd3)][_0xea4078(0xc8)](this[_0xea4078(0xa0)][_0xea4078(0xbe)]),this[_0xea4078(0xa6)][_0xea4078(0xbc)](this[_0xea4078(0xbe)]);}[_0x221b24(0xb1)](_0x334cd2=0x1){const _0xf9413f=_0x221b24;-0x1===_0x334cd2?this[_0xf9413f(0xbd)][_0xf9413f(0xd8)]():this[_0xf9413f(0xbd)][_0xf9413f(0xa7)]();}[_0x221b24(0x9f)](){const _0x3deca7=_0x221b24;this[_0x3deca7(0xca)]='',this[_0x3deca7(0xb8)]='',this[_0x3deca7(0x9c)]=!0x1,this[_0x3deca7(0xa0)][_0x3deca7(0x9f)](),this[_0x3deca7(0xd4)][_0x3deca7(0xc2)]=!0x1,this[_0x3deca7(0x8c)][_0x3deca7(0xc2)]=!0x1;}[_0x221b24(0xd2)](){const _0x25496d=_0x221b24,_0x5a1409=this[_0x25496d(0xa2)],_0x4ed16a=new _0x42c6cc(_0x5a1409,{'queryView':{'label':_0x636862(_0x5a1409,_0x25496d(0xb2)),'creator':_0x527bdf,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':_0x636862(_0x5a1409,_0x25496d(0x8b)),'secondary':_0x636862(_0x5a1409,_0x25496d(0xaa))}}},'filteredView':this[_0x25496d(0xa5)](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4ed16a[_0x25496d(0xb9)](_0x25496d(0x8e))['to'](this,_0x25496d(0x8e),this,_0x25496d(0xcd),(_0x5887df,_0x276858)=>_0x5887df&&!_0x276858),this[_0x25496d(0xbc)](_0x4ed16a,_0x25496d(0xba),(_0x55f490,_0x4dbc4e)=>{const _0x3912c2=_0x25496d;this[_0x3912c2(0xca)]=_0x4dbc4e;const _0xa3ca0a=_0x3353b9(_0x4dbc4e);this[_0x3912c2(0x8f)](_0x3912c2(0xb3),_0xa3ca0a),_0x4dbc4e[_0x3912c2(0xcb)]()&&this[_0x3912c2(0xd9)][_0x3912c2(0xc8)]({'prompt':_0xa3ca0a},0x0);},{'priority':_0x25496d(0xb6)}),_0x4ed16a;}[_0x221b24(0xa5)](){const _0x3ebf09=_0x221b24,_0x1c877d=new _0x135f98(this[_0x3ebf09(0xa2)]);return _0x1c877d[_0x3ebf09(0x90)][_0x3ebf09(0xb0)][_0x3ebf09(0x93)](this[_0x3ebf09(0xd9)])['as'](_0x5203c3),_0x1c877d['on'](_0x3ebf09(0x95),()=>{const _0x48cea1=_0x3ebf09;this[_0x48cea1(0xd9)][_0x48cea1(0xda)](),this[_0x48cea1(0xa0)][_0x48cea1(0xc0)](''),this[_0x48cea1(0xa0)][_0x48cea1(0xb1)]();}),_0x1c877d;}[_0x221b24(0x9e)](){const _0x442a6d=_0x221b24,_0x4c4a61=new _0x217d1a(this[_0x442a6d(0xa2)]);return _0x4c4a61[_0x442a6d(0xd7)][_0x442a6d(0xb9)](_0x442a6d(0x8e))['to'](this,_0x442a6d(0x8e),this,_0x442a6d(0xcd),this,_0x442a6d(0xb8),(_0x18abde,_0x30fbdd,_0x268111)=>_0x18abde&&!_0x30fbdd&&!!_0x268111),_0x4c4a61[_0x442a6d(0xd7)][_0x442a6d(0x97)](_0x442a6d(0xb7))['to'](this,_0x442a6d(0xa9)),_0x4c4a61[_0x442a6d(0xa4)][_0x442a6d(0xb9)](_0x442a6d(0x8e))['to'](this,_0x442a6d(0x8e),this,_0x442a6d(0xcd),this,_0x442a6d(0xb8),(_0x232362,_0x215940,_0x4cd6b2)=>_0x232362&&!_0x215940&&!!_0x4cd6b2),_0x4c4a61[_0x442a6d(0xa4)][_0x442a6d(0x97)](_0x442a6d(0xb7))['to'](this,_0x442a6d(0x92)),_0x4c4a61[_0x442a6d(0xdc)][_0x442a6d(0xb9)](_0x442a6d(0x8e))['to'](this,_0x442a6d(0x8e),this,_0x442a6d(0xcd),(_0x38718c,_0x3b71a9)=>_0x38718c&&!_0x3b71a9),_0x4c4a61[_0x442a6d(0xdc)][_0x442a6d(0x97)](_0x442a6d(0xb7))['to'](this,_0x442a6d(0x9d)),_0x4c4a61[_0x442a6d(0xce)][_0x442a6d(0xb9)](_0x442a6d(0x8e))['to'](this,_0x442a6d(0xcd)),_0x4c4a61[_0x442a6d(0xce)][_0x442a6d(0x97)](_0x442a6d(0xb7))['to'](this,_0x442a6d(0x96)),_0x4c4a61;}[_0x221b24(0xd6)](){const _0x5d2cbd=_0x221b24;this[_0x5d2cbd(0xb8)]='',this[_0x5d2cbd(0x9c)]=!0x1,this[_0x5d2cbd(0xcd)]=!0x0,this[_0x5d2cbd(0xd4)][_0x5d2cbd(0xc2)]=!0x0,this[_0x5d2cbd(0x8c)][_0x5d2cbd(0xc2)]=!0x0,this[_0x5d2cbd(0xd4)][_0x5d2cbd(0xb1)]();}[_0x221b24(0x8d)](){const _0x4ab959=_0x221b24,_0x59ad4f=this[_0x4ab959(0xa2)];this[_0x4ab959(0xcd)]=!0x1,this[_0x4ab959(0xca)]='',this[_0x4ab959(0xa0)][_0x4ab959(0x9f)](),this[_0x4ab959(0xb8)]&&(this[_0x4ab959(0xa0)][_0x4ab959(0xc5)][_0x4ab959(0xdd)]=_0x636862(_0x59ad4f,_0x4ab959(0xc9)));}[_0x221b24(0xab)](_0x5745b3){const _0x546bf7=_0x221b24,_0x1bdfbd=this[_0x546bf7(0xa2)];this[_0x546bf7(0x8d)](),this[_0x546bf7(0x9c)]=!0x0,this[_0x546bf7(0x9b)][_0x546bf7(0xdf)]=_0x5745b3||_0x636862(_0x1bdfbd,_0x546bf7(0xd0)),this[_0x546bf7(0xb8)]||(this[_0x546bf7(0xd4)][_0x546bf7(0xc2)]=!0x1);}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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.js';
|
|
9
|
+
import type { PromptHistoryEntry } from './prompthistory.js';
|
|
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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
(function(_0x42c4fd,_0x2035c7){const _0x2a1009=_0x1e38,_0x4d5933=_0x42c4fd();while(!![]){try{const _0x1b5863=-parseInt(_0x2a1009(0xd8))/0x1*(parseInt(_0x2a1009(0xe7))/0x2)+parseInt(_0x2a1009(0xdb))/0x3+-parseInt(_0x2a1009(0xdd))/0x4*(-parseInt(_0x2a1009(0xd5))/0x5)+-parseInt(_0x2a1009(0xe4))/0x6*(-parseInt(_0x2a1009(0xdf))/0x7)+parseInt(_0x2a1009(0xe0))/0x8*(parseInt(_0x2a1009(0xd6))/0x9)+-parseInt(_0x2a1009(0xdc))/0xa*(-parseInt(_0x2a1009(0xe3))/0xb)+-parseInt(_0x2a1009(0xd7))/0xc;if(_0x1b5863===_0x2035c7)break;else _0x4d5933['push'](_0x4d5933['shift']());}catch(_0x5c61f4){_0x4d5933['push'](_0x4d5933['shift']());}}}(_0x3e40,0x4cc63));function _0x3e40(){const _0x315e1e=['533564cUZJKo','65FwFDnC','70731bToSDK','7059204HCIVLA','2wAuQmH','fire','execute','1335000JzbSOJ','5319900BuUoxT','113504aYSGVs','children','577927QrgNXW','8DVhKrm','locale','set','11uNnZbC','6zTJFEF','prompt','add'];_0x3e40=function(){return _0x315e1e;};return _0x3e40();}import{ListItemView as _0x5778c5,ButtonView as _0x2859af,ButtonLabelView as _0x2dc1ad}from'ckeditor5/src/ui.js';import{unescape as _0x1590f8}from'lodash-es';function _0x1e38(_0x58ddf3,_0x5abe4f){const _0x3e40b9=_0x3e40();return _0x1e38=function(_0x1e3842,_0x48d03e){_0x1e3842=_0x1e3842-0xd5;let _0x2c56e3=_0x3e40b9[_0x1e3842];return _0x2c56e3;},_0x1e38(_0x58ddf3,_0x5abe4f);}export default class hs extends _0x5778c5{constructor(_0x452375){const _0x17d1b7=_0x1e38;super();const _0x4d204f=new _0x2dc1ad(),_0x4efcdc=new _0x2859af(this[_0x17d1b7(0xe1)],_0x4d204f);this[_0x17d1b7(0xde)][_0x17d1b7(0xe6)](_0x4efcdc),_0x4efcdc[_0x17d1b7(0xe2)]({'label':_0x452375[_0x17d1b7(0xe5)],'withText':!0x0}),_0x4efcdc['on'](_0x17d1b7(0xda),()=>{const _0x33858f=_0x17d1b7;this[_0x33858f(0xd9)](_0x33858f(0xda),{'value':_0x1590f8(_0x452375[_0x33858f(0xe5)])});});}}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, 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.js';
|
|
9
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
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
|
+
};
|