@progress/kendo-react-conversational-ui 14.2.1-develop.3 → 14.2.1-develop.4
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/ai-prompt/AIPrompt.d.ts +1 -1
- package/ai-prompt/AIPrompt.js +1 -1
- package/ai-prompt/AIPrompt.mjs +11 -11
- package/ai-prompt/AIPromptContent.d.ts +1 -1
- package/ai-prompt/AIPromptContent.js +1 -1
- package/ai-prompt/AIPromptContent.mjs +6 -6
- package/ai-prompt/AIPromptContext.d.ts +1 -1
- package/ai-prompt/AIPromptContext.js +1 -1
- package/ai-prompt/AIPromptContext.mjs +5 -5
- package/ai-prompt/AIPromptExpander.d.ts +1 -1
- package/ai-prompt/AIPromptExpander.js +1 -1
- package/ai-prompt/AIPromptExpander.mjs +3 -3
- package/ai-prompt/AIPromptFooter.d.ts +1 -1
- package/ai-prompt/AIPromptFooter.js +1 -1
- package/ai-prompt/AIPromptFooter.mjs +3 -3
- package/ai-prompt/AIPromptHeader.d.ts +1 -1
- package/ai-prompt/AIPromptHeader.js +1 -1
- package/ai-prompt/AIPromptHeader.mjs +7 -7
- package/ai-prompt/views/AIPromptCommandsView.d.ts +1 -1
- package/ai-prompt/views/AIPromptCommandsView.js +1 -1
- package/ai-prompt/views/AIPromptCommandsView.mjs +11 -11
- package/ai-prompt/views/AIPromptOutputView.d.ts +1 -1
- package/ai-prompt/views/AIPromptOutputView.js +1 -1
- package/ai-prompt/views/AIPromptOutputView.mjs +9 -9
- package/ai-prompt/views/AIPromptView.d.ts +1 -1
- package/ai-prompt/views/AIPromptView.js +2 -2
- package/ai-prompt/views/AIPromptView.mjs +7 -7
- package/ai-prompt/views/AIPromptViewRender.d.ts +1 -1
- package/chat/utils.d.ts +1 -1
- package/chat/utils.js +1 -1
- package/chat/utils.mjs +10 -10
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/inline-ai-prompt/InlineAIPrompt.d.ts +1 -1
- package/inline-ai-prompt/InlineAIPrompt.js +1 -1
- package/inline-ai-prompt/InlineAIPrompt.mjs +25 -25
- package/inline-ai-prompt/InlineAIPromptInput.d.ts +1 -1
- package/inline-ai-prompt/InlineAIPromptInput.js +2 -2
- package/inline-ai-prompt/InlineAIPromptInput.mjs +12 -12
- package/inline-ai-prompt/InlineAIPromptPopup.d.ts +1 -1
- package/inline-ai-prompt/InlineAIPromptPopup.js +1 -1
- package/inline-ai-prompt/InlineAIPromptPopup.mjs +14 -14
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +11 -11
package/ai-prompt/AIPrompt.d.ts
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as React } from 'react';
|
|
9
8
|
import { AIPromptToolbarItemInterface } from './AIPromptHeader.js';
|
|
10
9
|
import { promptViewDefaults, outputViewDefaults, commandsViewDefaults } from './views/constants.js';
|
|
11
10
|
import { CommandInterface } from './views/AIPromptCommandsView.js';
|
|
12
11
|
import { SuggestionsView } from '../chat/components/SuggestionsGroup.js';
|
|
12
|
+
import * as React from 'react';
|
|
13
13
|
/**
|
|
14
14
|
* Props of the AIPrompt component.
|
|
15
15
|
*/
|
package/ai-prompt/AIPrompt.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react"),O=require("./AIPromptHeader.js"),l=require("./views/constants.js"),V=require("./AIPromptContext.js"),n=require("@progress/kendo-react-common"),m=require("../package-metadata.js");function h(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const c=h(M),j=e=>{const a=!n.validatePackage(m.packageMetadata,{component:"AIPrompt"}),t=n.getLicenseMessage(m.packageMetadata),{activeView:o,toolbarItems:u,children:p,onActiveViewChange:s,onPromptRequest:d,onCommandExecute:g,style:P,dir:f,className:v,streaming:b,loading:w,onCancel:S,suggestionsView:r,...k}=e,A=u||[l.promptViewDefaults,l.outputViewDefaults],[I,q]=c.useState({activeView:o}),i={...I,activeView:o,streaming:b,loading:w,suggestionsView:r!=null?r:"classic",onCancel:S,onActiveViewChange:s,onPromptRequest:d,onCommandExecute:g},y=C=>{q(C)};return c.createElement(V.AIPromptContext.Provider,{value:[i,y]},c.createElement("div",{className:n.classNames("k-prompt",v),style:P,dir:f,...k},c.createElement(O.PromptHeader,{activeView:i.activeView,toolbarItems:A,activeViewChange:s}),p,a&&c.createElement(n.WatermarkOverlay,{message:t})))};exports.AIPrompt=j;
|
package/ai-prompt/AIPrompt.mjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import e from "react";
|
|
8
|
+
import * as e from "react";
|
|
9
9
|
import { PromptHeader as E } from "./AIPromptHeader.mjs";
|
|
10
10
|
import { promptViewDefaults as I, outputViewDefaults as x } from "./views/constants.mjs";
|
|
11
11
|
import { AIPromptContext as L } from "./AIPromptContext.mjs";
|
|
@@ -18,29 +18,29 @@ const O = (c) => {
|
|
|
18
18
|
children: l,
|
|
19
19
|
onActiveViewChange: o,
|
|
20
20
|
onPromptRequest: p,
|
|
21
|
-
onCommandExecute:
|
|
22
|
-
style:
|
|
23
|
-
dir:
|
|
24
|
-
className:
|
|
25
|
-
streaming:
|
|
26
|
-
loading:
|
|
21
|
+
onCommandExecute: g,
|
|
22
|
+
style: v,
|
|
23
|
+
dir: d,
|
|
24
|
+
className: u,
|
|
25
|
+
streaming: w,
|
|
26
|
+
loading: f,
|
|
27
27
|
onCancel: P,
|
|
28
28
|
suggestionsView: t,
|
|
29
29
|
...V
|
|
30
30
|
} = c, h = i || [I, x], [S, k] = e.useState({ activeView: a }), r = {
|
|
31
31
|
...S,
|
|
32
32
|
activeView: a,
|
|
33
|
-
streaming:
|
|
34
|
-
loading:
|
|
33
|
+
streaming: w,
|
|
34
|
+
loading: f,
|
|
35
35
|
suggestionsView: t != null ? t : "classic",
|
|
36
36
|
onCancel: P,
|
|
37
37
|
onActiveViewChange: o,
|
|
38
38
|
onPromptRequest: p,
|
|
39
|
-
onCommandExecute:
|
|
39
|
+
onCommandExecute: g
|
|
40
40
|
}, A = (C) => {
|
|
41
41
|
k(C);
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */ e.createElement(L.Provider, { value: [r, A] }, /* @__PURE__ */ e.createElement("div", { className: b("k-prompt",
|
|
43
|
+
return /* @__PURE__ */ e.createElement(L.Provider, { value: [r, A] }, /* @__PURE__ */ e.createElement("div", { className: b("k-prompt", u), style: v, dir: d, ...V }, /* @__PURE__ */ e.createElement(
|
|
44
44
|
E,
|
|
45
45
|
{
|
|
46
46
|
activeView: r.activeView,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
8
|
+
import * as React from 'react';
|
|
9
9
|
/**
|
|
10
10
|
* The props of the AIPromptContent component.
|
|
11
11
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),f=require("@progress/kendo-svg-icons"),b=require("@progress/kendo-react-buttons"),s=require("../messages/index.js"),k=require("@progress/kendo-react-intl"),I=require("./AIPromptContext.js"),C=require("./views/constants.js");function P(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const o=P(g),u=o.forwardRef((e,n)=>{const{children:t,streaming:a,onCancel:c}=e,i=k.useLocalization().toLanguageString(s.aIPromptCancel,s.messages[s.aIPromptCancel]),[m]=I.useAIPromptContext(),p=m.activeView===C.outputViewDefaults.name,r=a&&p,d=o.useCallback(l=>{l.key==="Escape"&&r&&c&&(l.preventDefault(),c())},[r,c]);return o.createElement("div",{className:"k-prompt-content",ref:n,onKeyDown:d},r&&o.createElement(b.FloatingActionButton,{onClick:c,svgIcon:f.stopSmIcon,icon:"stop-sm",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":i,title:i}),o.createElement("div",{className:"k-prompt-view"},t))});u.displayName="KendoReactAIPromptContent";exports.AIPromptContent=u;
|
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import t from "react";
|
|
8
|
+
import * as t from "react";
|
|
9
9
|
import { stopSmIcon as f } from "@progress/kendo-svg-icons";
|
|
10
|
-
import { FloatingActionButton as
|
|
11
|
-
import { aIPromptCancel as i, messages as
|
|
10
|
+
import { FloatingActionButton as g } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { aIPromptCancel as i, messages as d } from "../messages/index.mjs";
|
|
12
12
|
import { useLocalization as w } from "@progress/kendo-react-intl";
|
|
13
13
|
import { useAIPromptContext as k } from "./AIPromptContext.mjs";
|
|
14
14
|
import { outputViewDefaults as C } from "./views/constants.mjs";
|
|
15
15
|
const I = t.forwardRef((m, r) => {
|
|
16
|
-
const { children:
|
|
16
|
+
const { children: s, streaming: c, onCancel: o } = m, n = w().toLanguageString(i, d[i]), [l] = k(), p = l.activeView === C.name, e = c && p, u = t.useCallback(
|
|
17
17
|
(a) => {
|
|
18
18
|
a.key === "Escape" && e && o && (a.preventDefault(), o());
|
|
19
19
|
},
|
|
20
20
|
[e, o]
|
|
21
21
|
);
|
|
22
22
|
return /* @__PURE__ */ t.createElement("div", { className: "k-prompt-content", ref: r, onKeyDown: u }, e && /* @__PURE__ */ t.createElement(
|
|
23
|
-
|
|
23
|
+
g,
|
|
24
24
|
{
|
|
25
25
|
onClick: o,
|
|
26
26
|
svgIcon: f,
|
|
@@ -31,7 +31,7 @@ const I = t.forwardRef((m, r) => {
|
|
|
31
31
|
"aria-label": n,
|
|
32
32
|
title: n
|
|
33
33
|
}
|
|
34
|
-
), /* @__PURE__ */ t.createElement("div", { className: "k-prompt-view" },
|
|
34
|
+
), /* @__PURE__ */ t.createElement("div", { className: "k-prompt-view" }, s));
|
|
35
35
|
});
|
|
36
36
|
I.displayName = "KendoReactAIPromptContent";
|
|
37
37
|
export {
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as React } from 'react';
|
|
9
8
|
import { AIPromptOutputInterface } from './AIPrompt.js';
|
|
10
9
|
import { CommandInterface } from './views/AIPromptCommandsView.js';
|
|
11
10
|
import { SuggestionsView } from '../chat/components/SuggestionsGroup.js';
|
|
11
|
+
import * as React from 'react';
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react");function a(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const r=a(u),c=r.createContext([{},()=>{}]),s=()=>r.useContext(c);exports.AIPromptContext=c;exports.useAIPromptContext=s;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import t from "react";
|
|
9
|
-
const
|
|
10
|
-
}]),
|
|
8
|
+
import * as t from "react";
|
|
9
|
+
const o = t.createContext([{}, () => {
|
|
10
|
+
}]), e = () => t.useContext(o);
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
o as AIPromptContext,
|
|
13
|
+
e as useAIPromptContext
|
|
14
14
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
8
|
+
import * as React from 'react';
|
|
9
9
|
export interface AIPromptExpanderProps {
|
|
10
10
|
/**
|
|
11
11
|
* The content to be displayed inside the expander when it is expanded.
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),i=require("@progress/kendo-react-buttons"),a=require("@progress/kendo-svg-icons");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const o=l(d),s=e=>{const[t,n]=o.useState(!0),{children:r,title:c}=e;return o.createElement("div",{className:"k-prompt-expander"},o.createElement(i.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:t?a.chevronUpIcon:a.chevronDownIcon,title:c,onClick:()=>n(!t),"aria-expanded":t},c),t&&o.createElement("div",{id:e.id,className:"k-prompt-expander-content"},r))};exports.AIPromptExpander=s;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import t from "react";
|
|
8
|
+
import * as t from "react";
|
|
9
9
|
import { Button as c } from "@progress/kendo-react-buttons";
|
|
10
10
|
import { chevronUpIcon as d, chevronDownIcon as i } from "@progress/kendo-svg-icons";
|
|
11
|
-
const
|
|
11
|
+
const p = (n) => {
|
|
12
12
|
const [e, r] = t.useState(!0), { children: a, title: o } = n;
|
|
13
13
|
return /* @__PURE__ */ t.createElement("div", { className: "k-prompt-expander" }, /* @__PURE__ */ t.createElement(
|
|
14
14
|
c,
|
|
@@ -24,5 +24,5 @@ const s = (n) => {
|
|
|
24
24
|
), e && /* @__PURE__ */ t.createElement("div", { id: n.id, className: "k-prompt-expander-content" }, a));
|
|
25
25
|
};
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
p as AIPromptExpander
|
|
28
28
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
8
|
+
import * as React from 'react';
|
|
9
9
|
/**
|
|
10
10
|
* The props of the AIPromptFooter component.
|
|
11
11
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react");function a(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const n=a(c),s=e=>{const{children:t}=e;return n.createElement("div",{className:"k-prompt-footer"},n.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},t))};exports.AIPromptFooter=s;
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import t from "react";
|
|
9
|
-
const
|
|
8
|
+
import * as t from "react";
|
|
9
|
+
const r = (o) => {
|
|
10
10
|
const { children: e } = o;
|
|
11
11
|
return /* @__PURE__ */ t.createElement("div", { className: "k-prompt-footer" }, /* @__PURE__ */ t.createElement("div", { className: "k-actions k-actions-start k-actions-horizontal k-prompt-actions" }, e));
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
14
|
+
r as AIPromptFooter
|
|
15
15
|
};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as React } from 'react';
|
|
9
8
|
import { SVGIcon } from '@progress/kendo-svg-icons';
|
|
9
|
+
import * as React from 'react';
|
|
10
10
|
/**
|
|
11
11
|
* An interface for the AIPromptToolbarItem.
|
|
12
12
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),l=require("@progress/kendo-react-buttons");function u(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r,o,a.get?a:{enumerable:!0,get:()=>t[o]})}}return r.default=t,Object.freeze(r)}const n=u(s),d=t=>{const{activeView:r,toolbarItems:o,activeViewChange:a}=t,c=e=>{a==null||a.call(null,e)};return n.createElement("div",{className:"k-prompt-header"},n.createElement(l.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},o.map(e=>n.isValidElement(e)?e:n.createElement(l.Button,{key:e.name,className:r===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>c(e.name)},e.buttonText))))};exports.PromptHeader=d;
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import o from "react";
|
|
9
|
-
import { Toolbar as c, Button as
|
|
10
|
-
const
|
|
11
|
-
const { activeView:
|
|
8
|
+
import * as o from "react";
|
|
9
|
+
import { Toolbar as c, Button as s } from "@progress/kendo-react-buttons";
|
|
10
|
+
const d = (a) => {
|
|
11
|
+
const { activeView: l, toolbarItems: r, activeViewChange: t } = a, n = (e) => {
|
|
12
12
|
t == null || t.call(null, e);
|
|
13
13
|
};
|
|
14
14
|
return /* @__PURE__ */ o.createElement("div", { className: "k-prompt-header" }, /* @__PURE__ */ o.createElement(c, { keyboardNavigation: !1, role: "toolbar", className: "k-toolbar-flat" }, r.map(
|
|
15
15
|
(e) => o.isValidElement(e) ? e : /* @__PURE__ */ o.createElement(
|
|
16
|
-
|
|
16
|
+
s,
|
|
17
17
|
{
|
|
18
18
|
key: e.name,
|
|
19
|
-
className:
|
|
19
|
+
className: l === e.name ? "k-selected" : "",
|
|
20
20
|
size: "medium",
|
|
21
21
|
themeColor: "primary",
|
|
22
22
|
fillMode: "flat",
|
|
@@ -30,5 +30,5 @@ const u = (l) => {
|
|
|
30
30
|
)));
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
d as PromptHeader
|
|
34
34
|
};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as React } from 'react';
|
|
9
8
|
import { SVGIcon } from '@progress/kendo-react-common';
|
|
9
|
+
import * as React from 'react';
|
|
10
10
|
/**
|
|
11
11
|
* The props of the AIPromptCommandsView component.
|
|
12
12
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react"),d=require("../AIPromptContent.js"),P=require("./AIPromptViewRender.js"),g=require("../AIPromptContext.js"),s=require("@progress/kendo-react-layout"),f=require("./constants.js");function C(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const r=C(p),u=t=>t==null?void 0:t.map(e=>r.createElement(s.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&u(e.children||[]))),I=t=>{const{commands:e}=t,[n]=g.useAIPromptContext(),o=m=>{var a,l,i;const c=(l=(a=m.target)==null?void 0:a.props)==null?void 0:l.data;(i=c.children)!=null&&i.length||n.onCommandExecute&&n.onCommandExecute.call(null,c)};return r.createElement(P.AIPromptViewRender,{name:f.commandsViewDefaults.name},r.createElement(d.AIPromptContent,{streaming:n.streaming,onCancel:n.onCancel},r.createElement("div",{className:"k-prompt-view"},r.createElement(s.PanelBar,{onSelect:o,selected:""},u(e!=null?e:[])))))};exports.AIPromptCommandsView=I;
|
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import r from "react";
|
|
8
|
+
import * as r from "react";
|
|
9
9
|
import { AIPromptContent as s } from "../AIPromptContent.mjs";
|
|
10
|
-
import { AIPromptViewRender as
|
|
11
|
-
import { useAIPromptContext as
|
|
12
|
-
import { PanelBar as
|
|
13
|
-
import { commandsViewDefaults as
|
|
14
|
-
const i = (t) => t == null ? void 0 : t.map((e) => /* @__PURE__ */ r.createElement(I, { title: e.text, key: e.id, svgIcon: e.svgIcon, data: e }, e.children && i(e.children || []))),
|
|
15
|
-
const { commands: e } = t, [n] =
|
|
16
|
-
var
|
|
17
|
-
const o = (
|
|
10
|
+
import { AIPromptViewRender as C } from "./AIPromptViewRender.mjs";
|
|
11
|
+
import { useAIPromptContext as f } from "../AIPromptContext.mjs";
|
|
12
|
+
import { PanelBar as u, PanelBarItem as I } from "@progress/kendo-react-layout";
|
|
13
|
+
import { commandsViewDefaults as E } from "./constants.mjs";
|
|
14
|
+
const i = (t) => t == null ? void 0 : t.map((e) => /* @__PURE__ */ r.createElement(I, { title: e.text, key: e.id, svgIcon: e.svgIcon, data: e }, e.children && i(e.children || []))), h = (t) => {
|
|
15
|
+
const { commands: e } = t, [n] = f(), c = (p) => {
|
|
16
|
+
var a, l, m;
|
|
17
|
+
const o = (l = (a = p.target) == null ? void 0 : a.props) == null ? void 0 : l.data;
|
|
18
18
|
(m = o.children) != null && m.length || n.onCommandExecute && n.onCommandExecute.call(null, o);
|
|
19
19
|
};
|
|
20
|
-
return /* @__PURE__ */ r.createElement(
|
|
20
|
+
return /* @__PURE__ */ r.createElement(C, { name: E.name }, /* @__PURE__ */ r.createElement(s, { streaming: n.streaming, onCancel: n.onCancel }, /* @__PURE__ */ r.createElement("div", { className: "k-prompt-view" }, /* @__PURE__ */ r.createElement(u, { onSelect: c, selected: "" }, i(e != null ? e : [])))));
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
h as AIPromptCommandsView
|
|
24
24
|
};
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as React } from 'react';
|
|
9
8
|
import { AIPromptOutputInterface } from '../AIPrompt.js';
|
|
9
|
+
import * as React from 'react';
|
|
10
10
|
/**
|
|
11
11
|
* The fields of the AIPromptOutputView card prop.
|
|
12
12
|
*/
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),O=require("../AIPromptContent.js"),q=require("../AIPromptContext.js"),p=require("../../messages/index.js"),v=require("./AIPromptViewRender.js"),n=require("@progress/kendo-react-layout"),c=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons"),x=require("@progress/kendo-react-intl"),A=require("./constants.js");function N(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const o in l)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(l,o);Object.defineProperty(s,o,a.get?a:{enumerable:!0,get:()=>l[o]})}}return s.default=l,Object.freeze(s)}const e=N(w),S=l=>{const[s,o]=e.useState(""),a=e.useRef(null),[r]=q.useAIPromptContext(),{outputs:m,showOutputRating:R,outputCard:b}=l,{header:C,body:k,actions:g}=b||{},f=x.useLocalization(),I=t=>{r.onPromptRequest&&r.onPromptRequest.call(null,t.prompt,{...t,isRetry:!0}),E()},P=t=>{t!=null&&t.responseContent&&navigator.clipboard.writeText(t.responseContent),o(t.id),setTimeout(()=>{o("")},1e3)},y=(t,u)=>{r.onPromptRequest&&r.onPromptRequest.call(null,t.prompt,{...t,ratingType:u,isRetry:!1}),E()},E=()=>{a&&a.current&&a.current.scrollTo({top:0,behavior:"smooth"})},h=e.createElement(n.Card,null,e.createElement(n.CardHeader,null,e.createElement(n.CardTitle,null,e.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),e.createElement(n.CardSubtitle,null,e.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),e.createElement(n.CardBody,null,e.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),e.createElement(n.CardActions,null,e.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),d=m==null?void 0:m.map((t,u)=>e.createElement(n.Card,{key:`${t.id}_${u}`},e.createElement(n.CardHeader,null,C?C(t):e.createElement(e.Fragment,null,t.title&&e.createElement(n.CardTitle,null,t.title),t.subTitle&&e.createElement(n.CardSubtitle,null,t.subTitle))),e.createElement(n.CardBody,null,k?k(t):t.responseContent),e.createElement(n.CardActions,null,g?g(t):e.createElement(e.Fragment,null,e.createElement(i.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:s===t.id?c.checkIcon:c.copyIcon,onClick:()=>P(t)},"Copy"),e.createElement(i.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:c.arrowRotateCwIcon,onClick:()=>I(t)},"Retry"),R&&e.createElement(e.Fragment,null,e.createElement("span",{className:"k-spacer"}),e.createElement(i.Button,{size:"medium",themeColor:t.ratingType==="positive"?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:c.thumbUpOutlineIcon,onClick:()=>y(t,"positive")}),e.createElement(i.Button,{size:"medium",themeColor:t.ratingType==="negative"?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:c.thumbDownOutlineIcon,onClick:()=>y(t,"negative")})))))),T=e.createElement(n.Card,null,e.createElement(n.CardBody,null,f.toLanguageString(p.aIPromptNoOutputs,p.messages[p.aIPromptNoOutputs])));return e.createElement(v.AIPromptViewRender,{name:A.outputViewDefaults.name},e.createElement(O.AIPromptContent,{ref:a,streaming:r.streaming,onCancel:r.onCancel},e.createElement("div",{className:"k-card-list"},r.loading&&h,d,(!d||d.length===0)&&!r.loading&&T)))};exports.AIPromptOutputView=S;
|
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import e from "react";
|
|
8
|
+
import * as e from "react";
|
|
9
9
|
import { AIPromptContent as O } from "../AIPromptContent.mjs";
|
|
10
10
|
import { useAIPromptContext as z } from "../AIPromptContext.mjs";
|
|
11
11
|
import { aIPromptNoOutputs as E, messages as A } from "../../messages/index.mjs";
|
|
12
12
|
import { AIPromptViewRender as q } from "./AIPromptViewRender.mjs";
|
|
13
13
|
import { Card as s, CardHeader as g, CardTitle as f, CardSubtitle as y, CardBody as i, CardActions as R } from "@progress/kendo-react-layout";
|
|
14
|
-
import { checkIcon as M, copyIcon as F, arrowRotateCwIcon as S, thumbUpOutlineIcon as V, thumbDownOutlineIcon as
|
|
14
|
+
import { checkIcon as M, copyIcon as F, arrowRotateCwIcon as S, thumbUpOutlineIcon as V, thumbDownOutlineIcon as B } from "@progress/kendo-svg-icons";
|
|
15
15
|
import { Button as r } from "@progress/kendo-react-buttons";
|
|
16
|
-
import { useLocalization as
|
|
17
|
-
import { outputViewDefaults as
|
|
18
|
-
const
|
|
19
|
-
const [b, c] = e.useState(""), l = e.useRef(null), [n] = z(), { outputs: o, showOutputRating: I, outputCard: T } = h, { header: d, body: p, actions: k } = T || {}, w =
|
|
16
|
+
import { useLocalization as D } from "@progress/kendo-react-intl";
|
|
17
|
+
import { outputViewDefaults as L } from "./constants.mjs";
|
|
18
|
+
const W = (h) => {
|
|
19
|
+
const [b, c] = e.useState(""), l = e.useRef(null), [n] = z(), { outputs: o, showOutputRating: I, outputCard: T } = h, { header: d, body: p, actions: k } = T || {}, w = D(), v = (t) => {
|
|
20
20
|
n.onPromptRequest && n.onPromptRequest.call(null, t.prompt, { ...t, isRetry: !0 }), C();
|
|
21
21
|
}, P = (t) => {
|
|
22
22
|
t != null && t.responseContent && navigator.clipboard.writeText(t.responseContent), c(t.id), setTimeout(() => {
|
|
@@ -69,12 +69,12 @@ const X = (h) => {
|
|
|
69
69
|
fillMode: "flat",
|
|
70
70
|
rounded: "medium",
|
|
71
71
|
title: "Rate down",
|
|
72
|
-
svgIcon:
|
|
72
|
+
svgIcon: B,
|
|
73
73
|
onClick: () => u(t, "negative")
|
|
74
74
|
}
|
|
75
75
|
)))))), N = /* @__PURE__ */ e.createElement(s, null, /* @__PURE__ */ e.createElement(i, null, w.toLanguageString(E, A[E])));
|
|
76
|
-
return /* @__PURE__ */ e.createElement(q, { name:
|
|
76
|
+
return /* @__PURE__ */ e.createElement(q, { name: L.name }, /* @__PURE__ */ e.createElement(O, { ref: l, streaming: n.streaming, onCancel: n.onCancel }, /* @__PURE__ */ e.createElement("div", { className: "k-card-list" }, n.loading && x, a, (!a || a.length === 0) && !n.loading && N)));
|
|
77
77
|
};
|
|
78
78
|
export {
|
|
79
|
-
|
|
79
|
+
W as AIPromptOutputView
|
|
80
80
|
};
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as React } from 'react';
|
|
9
8
|
import { ButtonProps, SpeechToTextButtonProps } from '@progress/kendo-react-buttons';
|
|
10
9
|
import { TextAreaProps } from '@progress/kendo-react-inputs';
|
|
11
10
|
import { CustomComponent } from '@progress/kendo-react-common';
|
|
11
|
+
import * as React from 'react';
|
|
12
12
|
/**
|
|
13
13
|
* The properties of the AIPromptView component.
|
|
14
14
|
*/
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
-
`);return
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),B=require("../AIPromptContent.js"),z=require("../AIPromptFooter.js"),q=require("@progress/kendo-react-buttons"),P=require("@progress/kendo-react-inputs"),F=require("@progress/kendo-svg-icons"),C=require("@progress/kendo-react-common"),G=require("./AIPromptViewRender.js"),M=require("../AIPromptExpander.js"),D=require("../AIPromptContext.js"),_=require("../../chat/components/SuggestionsGroup.js"),H=require("./constants.js");function W(o){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(c,r,n.get?n:{enumerable:!0,get:()=>o[r]})}}return c.default=o,Object.freeze(c)}const e=W(j),N=o=>{const{promptInput:c=P.TextArea,generateButton:r=q.Button,enableSpeechToText:n=!1,promptValue:b,promptSuggestions:f}=o,[a,p]=e.useState(b||""),[u]=D.useAIPromptContext(),[R,x]=C.useCustomComponent(r),[E,S]=C.useCustomComponent(c),T=()=>{u.onPromptRequest&&u.onPromptRequest.call(null,a),p("")},m=e.useRef(null),w=t=>{p(t)};e.useEffect(()=>{var t,s;(s=(t=m.current)==null?void 0:t.element)!=null&&s.current&&requestAnimationFrame(()=>{var l,g;if((g=(l=m.current)==null?void 0:l.element)!=null&&g.current){const i=m.current.element.current;i.style.height="auto",i.style.height=`${i.scrollHeight}px`}})},[a]);const y=t=>{p(t.target.value)},k={title:"Generate",children:"Generate",svgIcon:F.sparklesIcon},V={placeholder:"Ask or generate content with AI ...",rows:2},A=Object.keys(x).length>0?x:k,v=Object.keys(S).length>0?S:V,I=t=>{const{isFinal:s,alternatives:l}=t;if(s&&l.length>0){const g=l[0].transcript,i=(()=>{const d=a,O=d&&!d.endsWith(" ")&&!d.endsWith(`
|
|
9
|
+
`);return d+(O?" ":"")+g})();p(i)}};let h;return n&&(typeof n=="object"?h={...n,onResult:n.onResult||I}:h={onResult:I}),e.createElement(G.AIPromptViewRender,{name:H.promptViewDefaults.name},e.createElement(B.AIPromptContent,{streaming:u.streaming,onCancel:u.onCancel},e.createElement(E,{ref:m,value:a,flow:"vertical",textareaStyle:{maxHeight:"110px"},autoSize:!0,suffix:n?e.createElement(e.Fragment,null,e.createElement(P.InputSeparator,{orientation:"horizontal"}),e.createElement(P.InputSuffix,{orientation:"horizontal"},e.createElement(q.SpeechToTextButton,{fillMode:"flat",...h}))):void 0,onChange:y,...v}),f&&f.length>0&&e.createElement(M.AIPromptExpander,{title:"Prompt Suggestions"},e.createElement(_.SuggestionGroup,{suggestionsView:u.suggestionsView,suggestions:f.map((t,s)=>({id:s,text:t,description:t})),onSuggestionClick:t=>{w(t.text)}}))),e.createElement(z.AIPromptFooter,null,e.createElement(R,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:T,disabled:!a.trim(),...A},A.children)))};exports.AIPromptView=N;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import e from "react";
|
|
8
|
+
import * as e from "react";
|
|
9
9
|
import { AIPromptContent as B } from "../AIPromptContent.mjs";
|
|
10
10
|
import { AIPromptFooter as q } from "../AIPromptFooter.mjs";
|
|
11
11
|
import { Button as z, SpeechToTextButton as F } from "@progress/kendo-react-buttons";
|
|
@@ -15,9 +15,9 @@ import { useCustomComponent as P } from "@progress/kendo-react-common";
|
|
|
15
15
|
import { AIPromptViewRender as H } from "./AIPromptViewRender.mjs";
|
|
16
16
|
import { AIPromptExpander as M } from "../AIPromptExpander.mjs";
|
|
17
17
|
import { useAIPromptContext as W } from "../AIPromptContext.mjs";
|
|
18
|
-
import { SuggestionGroup as
|
|
19
|
-
import { promptViewDefaults as
|
|
20
|
-
const
|
|
18
|
+
import { SuggestionGroup as D } from "../../chat/components/SuggestionsGroup.mjs";
|
|
19
|
+
import { promptViewDefaults as J } from "./constants.mjs";
|
|
20
|
+
const oe = (S) => {
|
|
21
21
|
const {
|
|
22
22
|
promptInput: A = j,
|
|
23
23
|
generateButton: E = z,
|
|
@@ -65,7 +65,7 @@ const ne = (S) => {
|
|
|
65
65
|
onResult: n.onResult || x
|
|
66
66
|
} : f = {
|
|
67
67
|
onResult: x
|
|
68
|
-
}), /* @__PURE__ */ e.createElement(H, { name:
|
|
68
|
+
}), /* @__PURE__ */ e.createElement(H, { name: J.name }, /* @__PURE__ */ e.createElement(B, { streaming: s.streaming, onCancel: s.onCancel }, /* @__PURE__ */ e.createElement(
|
|
69
69
|
C,
|
|
70
70
|
{
|
|
71
71
|
ref: m,
|
|
@@ -78,7 +78,7 @@ const ne = (S) => {
|
|
|
78
78
|
...k
|
|
79
79
|
}
|
|
80
80
|
), p && p.length > 0 && /* @__PURE__ */ e.createElement(M, { title: "Prompt Suggestions" }, /* @__PURE__ */ e.createElement(
|
|
81
|
-
|
|
81
|
+
D,
|
|
82
82
|
{
|
|
83
83
|
suggestionsView: s.suggestionsView,
|
|
84
84
|
suggestions: p.map((t, o) => ({
|
|
@@ -105,5 +105,5 @@ const ne = (S) => {
|
|
|
105
105
|
)));
|
|
106
106
|
};
|
|
107
107
|
export {
|
|
108
|
-
|
|
108
|
+
oe as AIPromptView
|
|
109
109
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
8
|
+
import * as React from 'react';
|
|
9
9
|
/**
|
|
10
10
|
* The props of the AIPromptViewRender component.
|
|
11
11
|
*/
|
package/chat/utils.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { default as React } from 'react';
|
|
9
8
|
import { LocalizationService } from '@progress/kendo-react-intl';
|
|
10
9
|
import { Message, User } from '../index.js';
|
|
10
|
+
import * as React from 'react';
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
package/chat/utils.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),r=require("../messages/index.js"),g=(e,t)=>e&&t.author&&e.id===t.author.id,
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),r=require("../messages/index.js");function g(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const u=g(d),f=(e,t)=>e&&t.author&&e.id===t.author.id,p=(e,t)=>{const s=t.toLanguageString("chatSender.deletedMessage",r.messages[r.chatSenderDeletedMessage]),o=t.toLanguageString("chatReceiver.deletedMessage",r.messages[r.chatReceiverDeletedMessage]);return e?s:o},h=e=>{navigator.clipboard.writeText(e)},T=(e,t)=>e.find(s=>s.id===t),b=(e,t,s=0)=>{if(!t)return;const o=t.querySelector(`[data-message-id="${e}"]`);if(!o)return;const n=t.querySelector(".k-message-list");if(n){const a=n.getBoundingClientRect().top,l=o.getBoundingClientRect().top,i=n.scrollTop+(l-a)-s;n.scrollTo({top:i,behavior:"smooth"})}else o.scrollIntoView({behavior:"smooth",block:"start"})},c=/(https?:\/\/[^\s]+)/g,y=e=>{if(!e)return[""];const t=e.split(c),s=[];return t.forEach(o=>{o&&c.test(o)?(c.lastIndex=0,s.push(u.createElement("a",{key:o,href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},o))):o&&s.push(o)}),s};exports.URL_REGEX=c;exports.convertTextToLinkedContent=y;exports.copyToClipboard=h;exports.getDeletedMessageText=p;exports.getMessageById=T;exports.isAuthor=f;exports.scrollToMessageById=b;
|