@progress/kendo-react-conversational-ui 11.4.0-develop.6 → 11.4.0-develop.8
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.js +1 -1
- package/ai-prompt/AIPrompt.mjs +30 -29
- package/ai-prompt/AIPromptContent.js +1 -1
- package/ai-prompt/AIPromptContent.mjs +7 -7
- package/components/Chat.js +1 -1
- package/components/Chat.mjs +26 -26
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/index.d.mts +6 -0
- package/index.d.ts +6 -0
- package/inline-ai-prompt/InlineAIPrompt.js +1 -1
- package/inline-ai-prompt/InlineAIPrompt.mjs +97 -85
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +8 -8
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 e=require("react"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),V=require("./AIPromptHeader.js"),n=require("./views/constants.js"),h=require("./AIPromptContext.js"),t=require("@progress/kendo-react-common"),E=require("../package-metadata.js"),b=c=>{const s=!t.validatePackage(E.packageMetadata,{component:"AIPrompt"}),{activeView:a,toolbarItems:i,children:m,onActiveViewChange:o,onPromptRequest:l,onCommandExecute:u,style:p,dir:d,className:v,streaming:P,loading:g,onCancel:w,...A}=c,I=i||[n.promptViewDefaults,n.outputViewDefaults],[S,k]=e.useState({activeView:a}),r={...S,activeView:a,streaming:P,loading:g,onCancel:w,onActiveViewChange:o,onPromptRequest:l,onCommandExecute:u},q=C=>{k(C)};return e.createElement(h.AIPromptContext.Provider,{value:[r,q]},e.createElement("div",{className:t.classNames("k-prompt",v),style:p,dir:d,...A},e.createElement(V.PromptHeader,{activeView:r.activeView,toolbarItems:I,activeViewChange:o}),m,s&&e.createElement(t.WatermarkOverlay,null)))};exports.AIPrompt=b;
|
package/ai-prompt/AIPrompt.mjs
CHANGED
|
@@ -5,47 +5,48 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import { PromptHeader as
|
|
10
|
-
import { promptViewDefaults as
|
|
11
|
-
import { AIPromptContext as
|
|
12
|
-
import { classNames as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
import e from "react";
|
|
9
|
+
import { PromptHeader as k } from "./AIPromptHeader.mjs";
|
|
10
|
+
import { promptViewDefaults as A, outputViewDefaults as C } from "./views/constants.mjs";
|
|
11
|
+
import { AIPromptContext as E } from "./AIPromptContext.mjs";
|
|
12
|
+
import { validatePackage as I, classNames as x, WatermarkOverlay as N } from "@progress/kendo-react-common";
|
|
13
|
+
import { packageMetadata as b } from "../package-metadata.mjs";
|
|
14
|
+
const q = (r) => {
|
|
15
|
+
const m = !I(b, { component: "AIPrompt" }), {
|
|
16
|
+
activeView: t,
|
|
17
|
+
toolbarItems: c,
|
|
18
|
+
children: n,
|
|
18
19
|
onActiveViewChange: o,
|
|
19
20
|
onPromptRequest: i,
|
|
20
|
-
onCommandExecute:
|
|
21
|
-
style:
|
|
22
|
-
dir:
|
|
23
|
-
className:
|
|
24
|
-
streaming:
|
|
25
|
-
loading:
|
|
21
|
+
onCommandExecute: s,
|
|
22
|
+
style: l,
|
|
23
|
+
dir: p,
|
|
24
|
+
className: u,
|
|
25
|
+
streaming: d,
|
|
26
|
+
loading: v,
|
|
26
27
|
onCancel: f,
|
|
27
|
-
...
|
|
28
|
-
} = r,
|
|
28
|
+
...w
|
|
29
|
+
} = r, P = c || [A, C], [V, g] = e.useState({ activeView: t }), a = {
|
|
29
30
|
...V,
|
|
30
|
-
activeView:
|
|
31
|
-
streaming:
|
|
32
|
-
loading:
|
|
31
|
+
activeView: t,
|
|
32
|
+
streaming: d,
|
|
33
|
+
loading: v,
|
|
33
34
|
onCancel: f,
|
|
34
35
|
onActiveViewChange: o,
|
|
35
36
|
onPromptRequest: i,
|
|
36
|
-
onCommandExecute:
|
|
37
|
-
}, h = (
|
|
38
|
-
S
|
|
37
|
+
onCommandExecute: s
|
|
38
|
+
}, h = (S) => {
|
|
39
|
+
g(S);
|
|
39
40
|
};
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
|
|
41
|
+
return /* @__PURE__ */ e.createElement(E.Provider, { value: [a, h] }, /* @__PURE__ */ e.createElement("div", { className: x("k-prompt", u), style: l, dir: p, ...w }, /* @__PURE__ */ e.createElement(
|
|
42
|
+
k,
|
|
42
43
|
{
|
|
43
44
|
activeView: a.activeView,
|
|
44
|
-
toolbarItems:
|
|
45
|
+
toolbarItems: P,
|
|
45
46
|
activeViewChange: o
|
|
46
47
|
}
|
|
47
|
-
),
|
|
48
|
+
), n, m && /* @__PURE__ */ e.createElement(N, null)));
|
|
48
49
|
};
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
q as AIPrompt
|
|
51
52
|
};
|
|
@@ -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 t=require("react"),g=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-buttons"),n=require("../messages/index.js"),k=require("@progress/kendo-react-intl"),C=require("./AIPromptContext.js"),w=require("./views/constants.js"),s=t.forwardRef((i,r)=>{const{children:l,streaming:u,onCancel:e}=i,a=k.useLocalization().toLanguageString(n.aIPromptCancel,n.messages[n.aIPromptCancel]),[m]=C.useAIPromptContext(),p=m.activeView===w.outputViewDefaults.name,o=u&&p,d=t.useCallback(c=>{c.key==="Escape"&&o&&e&&(c.preventDefault(),e())},[o,e]);return t.createElement("div",{className:"k-prompt-content",ref:r,onKeyDown:d},o&&t.createElement(I.FloatingActionButton,{onClick:e,svgIcon:g.stopSmIcon,icon:"stop-sm",size:"
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),g=require("@progress/kendo-svg-icons"),I=require("@progress/kendo-react-buttons"),n=require("../messages/index.js"),k=require("@progress/kendo-react-intl"),C=require("./AIPromptContext.js"),w=require("./views/constants.js"),s=t.forwardRef((i,r)=>{const{children:l,streaming:u,onCancel:e}=i,a=k.useLocalization().toLanguageString(n.aIPromptCancel,n.messages[n.aIPromptCancel]),[m]=C.useAIPromptContext(),p=m.activeView===w.outputViewDefaults.name,o=u&&p,d=t.useCallback(c=>{c.key==="Escape"&&o&&e&&(c.preventDefault(),e())},[o,e]);return t.createElement("div",{className:"k-prompt-content",ref:r,onKeyDown:d},o&&t.createElement(I.FloatingActionButton,{onClick:e,svgIcon:g.stopSmIcon,icon:"stop-sm",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":a,title:a}),t.createElement("div",{className:"k-prompt-view"},l))});s.displayName="KendoReactAIPromptContent";exports.AIPromptContent=s;
|
|
@@ -7,25 +7,25 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import 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 d } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { aIPromptCancel as i, messages as g } 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
|
-
const I = t.forwardRef((
|
|
16
|
-
const { children: c, streaming:
|
|
15
|
+
const I = t.forwardRef((m, r) => {
|
|
16
|
+
const { children: c, streaming: s, onCancel: o } = m, n = w().toLanguageString(i, g[i]), [l] = k(), p = l.activeView === C.name, e = s && 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
|
-
return /* @__PURE__ */ t.createElement("div", { className: "k-prompt-content", ref:
|
|
23
|
-
|
|
22
|
+
return /* @__PURE__ */ t.createElement("div", { className: "k-prompt-content", ref: r, onKeyDown: u }, e && /* @__PURE__ */ t.createElement(
|
|
23
|
+
d,
|
|
24
24
|
{
|
|
25
25
|
onClick: o,
|
|
26
26
|
svgIcon: f,
|
|
27
27
|
icon: "stop-sm",
|
|
28
|
-
size: "
|
|
28
|
+
size: "medium",
|
|
29
29
|
positionMode: "absolute",
|
|
30
30
|
className: "k-prompt-stop-fab k-generating",
|
|
31
31
|
"aria-label": n,
|
package/components/Chat.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 r=require("@progress/kendo-react-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@progress/kendo-react-common"),i=require("prop-types"),u=require("react"),m=require("../ViewItem.js"),d=require("./ActionGroup.js"),g=require("./AttachmentGroup.js"),I=require("./DateMarker.js"),f=require("./MessageGroup.js"),T=require("./NewMessage.js"),w=require("./ChatMessage.js"),p=require("../package-metadata.js"),c=require("../messages/index.js"),k=require("@progress/kendo-react-intl");function y(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const e in n)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:()=>n[e]})}}return s.default=n,Object.freeze(s)}const o=y(u),l=class l extends o.Component{constructor(s){super(s),this.viewItems=[],this.isDirectionRightToLeft=!1,this.scrollToBottomOnLoadingData=!0,this.showLicenseWatermark=!1,this.onFocus=()=>{clearTimeout(this.timeoutIdForChatLosingFocus)},this.onBlur=()=>{this.timeoutIdForChatLosingFocus=window.setTimeout(()=>{this.setState({selectedItemIndex:null})},0)},this.onSelectionRequested=e=>{this.setState({selectedItemIndex:e})},this.onKeyDown=e=>{let t=null;const a=this.state.selectedItemIndex!==null?this.state.selectedItemIndex:this.viewItems.lastSelectionIndex;e.keyCode===r.Keys.up?a===null?t=0:a>0&&(t=a-1):e.keyCode===r.Keys.down&&(a===null?t=0:a<this.viewItems.lastSelectionIndex&&(t=a+1)),t!==null&&(this.setState({selectedItemIndex:t}),e.preventDefault())},this.onMessageSend=(e,t)=>{r.dispatchEvent(this.props.onMessageSend,t,this,{message:e})},this.onActionExecute=(e,t)=>{if(r.dispatchEvent(this.props.onActionExecute,t,this,{action:e}),!t.isDefaultPrevented()){switch(e.type){case"reply":this.onMessageSend({author:this.props.user,text:e.value,timestamp:new Date},t);break;case"call":window.open("tel:"+e.value);break;case"openUrl":window.open(e.value);break}this.newMsgComp.focusInput()}},this.showLicenseWatermark=!r.validatePackage(p.packageMetadata,{component:"Chat"}),this.licenseMessage=r.getLicenseMessage(p.packageMetadata),this.state={selectedItemIndex:null,isFirstRender:!0}}render(){this.viewItems=this.getViewItemsFromMsgs(this.props.messages),this.isDirectionRightToLeft=this.checkIsDirectionRightToLeft(this.props);const s=k.provideLocalizationService(this);return o.createElement("div",{style:{width:this.props.width,position:"relative"},onKeyDown:this.onKeyDown,className:this.getClassNames(),ref:e=>{this.chatWrapperEl=e}},o.createElement("div",{className:"k-message-list k-avatars",onBlur:this.onBlur,onFocus:this.onFocus,role:"log","aria-label":s.toLanguageString(c.ariaLabelMessageList,c.messages[c.ariaLabelMessageList]),"aria-live":"polite",onScroll:e=>{this.scrollToBottomOnLoadingData=e.currentTarget.scrollTop===e.currentTarget.scrollHeight-e.currentTarget.clientHeight},ref:e=>{this.viewItemsWrapperEl=e}},o.createElement("div",{className:"k-message-list-content"},this.renderViewItems())),o.createElement(T,{user:this.props.user,onMessageSend:this.onMessageSend,isDirectionRightToLeft:this.isDirectionRightToLeft,ref:e=>{this.newMsgComp=e},placeholder:this.props.placeholder,MessageBox:this.props.messageBox,toolbar:this.props.toolbar,onToolbarActionButtonClick:this.props.onToolbarActionExecute,showToolbar:this.props.showToolbar}),this.showLicenseWatermark&&o.createElement(r.WatermarkOverlay,{message:this.licenseMessage}))}componentDidMount(){this.setState({isFirstRender:!1},()=>{this.nextTickId=window.setTimeout(()=>this.scrollViewItemsToBottom(),250)})}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidUpdate(s){s.messages.length!==this.props.messages.length&&this.scrollToBottomOnLoadingData&&this.scrollViewItemsToBottom()}getClassNames(){return r.classNames("k-chat",this.props.className,{"k-rtl":this.isDirectionRightToLeft})}checkIsDirectionRightToLeft(s){return!!(s.dir!==void 0?s.dir==="rtl":this.chatWrapperEl&&getComputedStyle(this.chatWrapperEl).direction==="rtl")}renderViewItems(){const s=this.viewItems.length-1;return this.viewItems.map((e,t)=>{if(e.type==="date-marker")return o.createElement(I,{item:e,key:t});if(e.type==="message-group")return o.createElement(f,{group:e,itemTemplate:this.props.messageTemplate,attachmentTemplate:this.props.attachmentTemplate,user:this.props.user,selectedItemIndex:this.state.selectedItemIndex,onRequestSelection:this.onSelectionRequested,isLastGroup:t===s,key:t,message:this.props.message||l.defaultProps.message});if(e.type==="attachment-group")return o.createElement(g,{group:e,itemTemplate:this.props.attachmentTemplate,onRequestSelection:this.onSelectionRequested,selected:e.selectionIndex===this.state.selectedItemIndex,isLastGroup:t===s,key:t});if(e.type==="action-group")return o.createElement(d,{group:e,onActionExecute:this.onActionExecute,onRequestSelection:this.onSelectionRequested,selected:e.selectionIndex===this.state.selectedItemIndex,isLastGroup:t===s,key:t})})}scrollViewItemsToBottom(){this.viewItemsWrapperEl&&(this.viewItemsWrapperEl.scrollTop=this.viewItemsWrapperEl.scrollHeight-this.viewItemsWrapperEl.clientHeight)}getViewItemsFromMsgs(s){return s.length>0?m.convertMsgsToViewItems(s):[]}};l.propTypes={messages:i.arrayOf(i.object),user:i.object,messageTemplate:i.any,attachmentTemplate:i.any,width:i.oneOfType([i.string,i.number]),onMessageSend:i.func,onActionExecute:i.func,dir:i.string,messageBox:i.any},l.defaultProps={messages:[],dateFormat:"g",message:w.ChatMessage};let h=l;exports.Chat=h;
|
package/components/Chat.mjs
CHANGED
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { Keys as n, dispatchEvent as l, validatePackage as p, WatermarkOverlay as
|
|
8
|
+
import { Keys as n, dispatchEvent as l, validatePackage as p, getLicenseMessage as u, WatermarkOverlay as d, classNames as g } from "@progress/kendo-react-common";
|
|
9
9
|
import o from "prop-types";
|
|
10
10
|
import * as i from "react";
|
|
11
|
-
import { convertMsgsToViewItems as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { ChatMessage as
|
|
18
|
-
import { packageMetadata as
|
|
19
|
-
import { ariaLabelMessageList as
|
|
20
|
-
import { provideLocalizationService as
|
|
11
|
+
import { convertMsgsToViewItems as f } from "../ViewItem.mjs";
|
|
12
|
+
import I from "./ActionGroup.mjs";
|
|
13
|
+
import T from "./AttachmentGroup.mjs";
|
|
14
|
+
import w from "./DateMarker.mjs";
|
|
15
|
+
import k from "./MessageGroup.mjs";
|
|
16
|
+
import y from "./NewMessage.mjs";
|
|
17
|
+
import { ChatMessage as S } from "./ChatMessage.mjs";
|
|
18
|
+
import { packageMetadata as c } from "../package-metadata.mjs";
|
|
19
|
+
import { ariaLabelMessageList as m, messages as x } from "../messages/index.mjs";
|
|
20
|
+
import { provideLocalizationService as E } from "@progress/kendo-react-intl";
|
|
21
21
|
const a = class a extends i.Component {
|
|
22
22
|
constructor(s) {
|
|
23
23
|
super(s), this.viewItems = [], this.isDirectionRightToLeft = !1, this.scrollToBottomOnLoadingData = !0, this.showLicenseWatermark = !1, this.onFocus = () => {
|
|
@@ -56,14 +56,14 @@ const a = class a extends i.Component {
|
|
|
56
56
|
}
|
|
57
57
|
this.newMsgComp.focusInput();
|
|
58
58
|
}
|
|
59
|
-
}, this.showLicenseWatermark = !p(
|
|
59
|
+
}, this.showLicenseWatermark = !p(c, { component: "Chat" }), this.licenseMessage = u(c), this.state = { selectedItemIndex: null, isFirstRender: !0 };
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* @hidden
|
|
63
63
|
*/
|
|
64
64
|
render() {
|
|
65
65
|
this.viewItems = this.getViewItemsFromMsgs(this.props.messages), this.isDirectionRightToLeft = this.checkIsDirectionRightToLeft(this.props);
|
|
66
|
-
const s =
|
|
66
|
+
const s = E(this);
|
|
67
67
|
return /* @__PURE__ */ i.createElement(
|
|
68
68
|
"div",
|
|
69
69
|
{
|
|
@@ -82,8 +82,8 @@ const a = class a extends i.Component {
|
|
|
82
82
|
onFocus: this.onFocus,
|
|
83
83
|
role: "log",
|
|
84
84
|
"aria-label": s.toLanguageString(
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
m,
|
|
86
|
+
x[m]
|
|
87
87
|
),
|
|
88
88
|
"aria-live": "polite",
|
|
89
89
|
onScroll: (e) => {
|
|
@@ -96,7 +96,7 @@ const a = class a extends i.Component {
|
|
|
96
96
|
/* @__PURE__ */ i.createElement("div", { className: "k-message-list-content" }, this.renderViewItems())
|
|
97
97
|
),
|
|
98
98
|
/* @__PURE__ */ i.createElement(
|
|
99
|
-
|
|
99
|
+
y,
|
|
100
100
|
{
|
|
101
101
|
user: this.props.user,
|
|
102
102
|
onMessageSend: this.onMessageSend,
|
|
@@ -111,7 +111,7 @@ const a = class a extends i.Component {
|
|
|
111
111
|
showToolbar: this.props.showToolbar
|
|
112
112
|
}
|
|
113
113
|
),
|
|
114
|
-
this.showLicenseWatermark && /* @__PURE__ */ i.createElement(
|
|
114
|
+
this.showLicenseWatermark && /* @__PURE__ */ i.createElement(d, { message: this.licenseMessage })
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
@@ -135,7 +135,7 @@ const a = class a extends i.Component {
|
|
|
135
135
|
s.messages.length !== this.props.messages.length && this.scrollToBottomOnLoadingData && this.scrollViewItemsToBottom();
|
|
136
136
|
}
|
|
137
137
|
getClassNames() {
|
|
138
|
-
return
|
|
138
|
+
return g("k-chat", this.props.className, { "k-rtl": this.isDirectionRightToLeft });
|
|
139
139
|
}
|
|
140
140
|
checkIsDirectionRightToLeft(s) {
|
|
141
141
|
return !!(s.dir !== void 0 ? s.dir === "rtl" : this.chatWrapperEl && getComputedStyle(this.chatWrapperEl).direction === "rtl");
|
|
@@ -144,10 +144,10 @@ const a = class a extends i.Component {
|
|
|
144
144
|
const s = this.viewItems.length - 1;
|
|
145
145
|
return this.viewItems.map((e, t) => {
|
|
146
146
|
if (e.type === "date-marker")
|
|
147
|
-
return /* @__PURE__ */ i.createElement(
|
|
147
|
+
return /* @__PURE__ */ i.createElement(w, { item: e, key: t });
|
|
148
148
|
if (e.type === "message-group")
|
|
149
149
|
return /* @__PURE__ */ i.createElement(
|
|
150
|
-
|
|
150
|
+
k,
|
|
151
151
|
{
|
|
152
152
|
group: e,
|
|
153
153
|
itemTemplate: this.props.messageTemplate,
|
|
@@ -162,7 +162,7 @@ const a = class a extends i.Component {
|
|
|
162
162
|
);
|
|
163
163
|
if (e.type === "attachment-group")
|
|
164
164
|
return /* @__PURE__ */ i.createElement(
|
|
165
|
-
|
|
165
|
+
T,
|
|
166
166
|
{
|
|
167
167
|
group: e,
|
|
168
168
|
itemTemplate: this.props.attachmentTemplate,
|
|
@@ -174,7 +174,7 @@ const a = class a extends i.Component {
|
|
|
174
174
|
);
|
|
175
175
|
if (e.type === "action-group")
|
|
176
176
|
return /* @__PURE__ */ i.createElement(
|
|
177
|
-
|
|
177
|
+
I,
|
|
178
178
|
{
|
|
179
179
|
group: e,
|
|
180
180
|
onActionExecute: this.onActionExecute,
|
|
@@ -190,7 +190,7 @@ const a = class a extends i.Component {
|
|
|
190
190
|
this.viewItemsWrapperEl && (this.viewItemsWrapperEl.scrollTop = this.viewItemsWrapperEl.scrollHeight - this.viewItemsWrapperEl.clientHeight);
|
|
191
191
|
}
|
|
192
192
|
getViewItemsFromMsgs(s) {
|
|
193
|
-
return s.length > 0 ?
|
|
193
|
+
return s.length > 0 ? f(s) : [];
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
a.propTypes = {
|
|
@@ -206,9 +206,9 @@ a.propTypes = {
|
|
|
206
206
|
}, a.defaultProps = {
|
|
207
207
|
messages: [],
|
|
208
208
|
dateFormat: "g",
|
|
209
|
-
message:
|
|
209
|
+
message: S
|
|
210
210
|
};
|
|
211
|
-
let
|
|
211
|
+
let h = a;
|
|
212
212
|
export {
|
|
213
|
-
|
|
213
|
+
h as Chat
|
|
214
214
|
};
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl"),require("prop-types"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-popup")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-intl","prop-types","@progress/kendo-svg-icons","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-inputs","@progress/kendo-react-popup"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactConversationalUi={},e.React,e.KendoReactCommon,e.KendoReactIntl,e.PropTypes,e.KendoSvgIcons,e.KendoReactButtons,e.KendoReactLayout,e.KendoReactInputs,e.KendoReactPopup)}(this,(function(e,t,s,n,o,a,r,i,l,c){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var m=p(t);let u=class extends m.Component{componentDidUpdate(e){!e.selected&&this.props.selected&&this.elementToFocus.focus()}};const d=class extends u{render(){return m.createElement("div",{className:this.getClassNames(),tabIndex:this.props.tabIndex,onClick:()=>this.props.onRequestSelection(this.props.item.selectionIndex),onFocus:()=>this.props.onRequestSelection(this.props.item.selectionIndex),ref:e=>{this.elementToFocus=e}},this.getTimestampView(),this.getMainView(),this.getStatusView())}getMainView(){return this.props.item.typing?m.createElement("div",{className:"k-chat-bubble"},m.createElement("div",{className:"k-typing-indicator"},m.createElement("span",null),m.createElement("span",null),m.createElement("span",null))):this.props.template?m.createElement(this.props.template,{item:this.props.item}):this.props.item.text?m.createElement("div",{className:"k-chat-bubble"},this.props.item.text):null}getTimestampView(){let e=null;return this.props.item.timestamp&&(e=m.createElement("time",{className:"k-message-time","aria-hidden":!this.props.selected},n.provideIntlService(this).formatDate(this.props.item.timestamp,this.props.dateFormat))),e}getStatusView(){let e=null;return this.props.item.status&&(e=m.createElement("span",{className:"k-message-status"},this.props.item.status)),e}getClassNames(){return s.classNames({"k-only":this.props.isOnlyItemInGroup},{"k-first":this.props.isFirstItemInGroup&&!this.props.isOnlyItemInGroup},{"k-last":this.props.isLastItemInGroup&&!this.props.isOnlyItemInGroup},{"k-selected":this.props.selected},{"k-focus":this.props.selected},"k-message")}};d.defaultProps={dateFormat:"g",tabIndex:-1};let h=d;n.registerForIntl(h);const g=(e,t)=>e&&t.author&&e.id===t.author.id,k=e=>e[e.length-1],I=e=>(t,s,n)=>{const o=n===e-1;return((e,t)=>{const s=t.timestamp,n=k(e);if(s&&(!n||((e,t)=>e&&t&&(t.getDate()!==e.getDate()||t.getMonth()!==e.getMonth()||t.getFullYear()!==e.getFullYear()))(s,n.timestamp))){const t={type:"date-marker",timestamp:s,trackBy:s.getTime()};e.push(t)}})(t,s),((e,t,s)=>{const n=k(e);let o;t.typing&&!s||(n&&"message-group"===n.type&&(o=n.messages),o&&g(t.author,k(o))?o.push(t):e.push({type:"message-group",messages:[t],author:t.author,timestamp:t.timestamp,trackBy:t}))})(t,s,o),s.attachments&&s.attachments.length>1&&t.push({type:"attachment-group",attachments:s.attachments,attachmentLayout:s.attachmentLayout,timestamp:s.timestamp,trackBy:s}),s.suggestedActions&&o&&t.push({type:"action-group",actions:s.suggestedActions,timestamp:s.timestamp,trackBy:s}),t};let E=class extends u{constructor(){super(...arguments),this.onKeyDown=e=>{e.keyCode===s.Keys.enter&&this.props.onActionExecute(this.props.item,e)}}render(){return m.createElement("span",{role:"button",className:this.getClassNames(),onClick:e=>this.props.onActionExecute(this.props.item,e),ref:e=>{this.elementToFocus=e},onKeyDown:this.onKeyDown,tabIndex:0},this.props.item.title||this.props.item.value)}getClassNames(){return s.classNames("k-quick-reply",{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup},{"k-selected":this.props.selected},{"k-focus":this.props.selected})}},v=class extends m.Component{constructor(){super(...arguments),this.state={selectedItemIndex:null},this.onRequestContainerSelection=()=>this.props.onRequestSelection(this.props.group.selectionIndex),this.onKeyDown=e=>{let t,n,o=null;this.isKeyboardNavigationLeftRight?(t=s.Keys.left,n=s.Keys.right):(t=s.Keys.up,n=s.Keys.down),e.keyCode===t?o=this.navigate(!1):e.keyCode===n&&(o=this.navigate(!0)),null!==o&&(e.preventDefault(),e.stopPropagation())}}static getDerivedStateFromProps(e,t){return e.selected||null===t.selectedItemIndex?e.selected&&null===t.selectedItemIndex?{selectedItemIndex:0}:null:{selectedItemIndex:null}}navigate(e,t=0){let s=null;const n=this.state.selectedItemIndex;return e?null===n?s=t:n<this.getLastSelectionIndex()&&(s=n+1):null===n?s=0:n>0&&(s=n-1),null!==s&&this.setState({selectedItemIndex:s}),s}get isKeyboardNavigationLeftRight(){return!0}getLastSelectionIndex(){let e=-1;if("action-group"===this.props.group.type){const t=this.props.group;e=t.actions?t.actions.length-1:-1}else if("attachment-group"===this.props.group.type){const t=this.props.group;e=t.attachments?t.attachments.length-1:-1}return e}};class C extends v{constructor(e){super(e)}render(){const e=this.props.group.actions?this.props.group.actions.length-1:0;return m.createElement("div",{className:this.getClassNames(),onClick:this.onRequestContainerSelection,onKeyDown:this.onKeyDown},this.props.group.actions&&this.props.group.actions.map(((t,s)=>m.createElement(E,{item:t,onActionExecute:this.props.onActionExecute,selected:s===this.state.selectedItemIndex,isFirstItemInGroup:0===s,isLastItemInGroup:s===e,key:s}))))}getClassNames(){return s.classNames("k-quick-replies")}}let y=class extends u{render(){return m.createElement("div",{className:this.getClassNames(),tabIndex:this.getTabIndexValue(),onClick:this.props.onClick,ref:e=>{this.elementToFocus=e}},this.props.template?m.createElement(this.props.template,{item:this.props.item}):m.createElement("div",{className:"k-card"},m.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView(),this.getContentView())))}getTabIndexValue(){if(void 0!==this.props.tabbable)return this.props.tabbable?0:-1}getClassNames(){return s.classNames({"k-selected":this.props.selected},{"k-focus":this.props.selected},{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup})}getTitleView(){return this.props.item.title?m.createElement("h5",{className:"k-card-title"},this.props.item.title):null}getSubtitleView(){return this.props.item.subtitle?m.createElement("h6",{className:"k-card-subtitle"},this.props.item.subtitle):null}getContentView(){return 0===this.props.item.contentType.indexOf("image/")?m.createElement("img",{src:this.props.item.content}):this.props.item.content}};class f extends v{render(){const e=this.isCardDeckLayout(this.props),t=m.createElement("div",{className:this.getClassNames(),onKeyDown:e?void 0:this.onKeyDown},this.props.group.attachments.map(((e,t)=>m.createElement(y,{item:e,template:this.props.itemTemplate,selected:t===this.state.selectedItemIndex,tabbable:this.props.isLastGroup&&t===this.state.selectedItemIndex,isFirstItemInGroup:0===t,isLastItemInGroup:t===this.getLastItemIndex(),onClick:()=>this.onAttachmentClick(t),key:t}))));return e?m.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:this.onKeyDown},this.getLeftScrollBtn(),t,this.getRightScrollBtn()):t}get isKeyboardNavigationLeftRight(){return this.isCardDeckLayout(this.props)}getLastItemIndex(){return this.props.group.attachments.length-1}getLeftScrollBtn(){let e=null;return this.isCardDeckLayout(this.props)&&this.state.selectedItemIndex&&(e=m.createElement(r.Button,{icon:"chevron-left",onClick:()=>this.onNavigateBtnClick(!1),svgIcon:a.chevronLeftIcon})),e}getRightScrollBtn(){let e=null;return this.isCardDeckLayout(this.props)&&this.state.selectedItemIndex!==this.getLastItemIndex()&&(e=m.createElement(r.Button,{icon:"chevron-right",onClick:()=>this.onNavigateBtnClick(!0),svgIcon:a.chevronRightIcon})),e}onAttachmentClick(e){this.onRequestContainerSelection(),this.setState({selectedItemIndex:e})}onNavigateBtnClick(e){this.onRequestContainerSelection(),this.navigate(e,1)}isCardDeckLayout(e){return"list"!==e.group.attachmentLayout}getClassNames(){return s.classNames({"k-card-list":this.props.group.attachmentLayout,"k-card-deck":this.isCardDeckLayout(this.props)})}}let b=class extends m.Component{render(){const e=this.props.item;return m.createElement("div",{className:"k-timestamp"},n.provideIntlService(this).formatDate(e.timestamp,"D"))}};n.registerForIntl(b);const x="newMessage.sendButton",w="newMessage.optionsButton",N="newMessage.messageInput",T="avatar.alt",S="messageList.ariaLabel",R="aIPrompt.noOutputs",B="aIPrompt.cancel",D={[x]:"Send",[w]:"Options",[N]:"Message",[T]:"Avatar",[S]:"Message list",[B]:"Cancel",[R]:"No output from AI available"};class L extends m.Component{render(){const{avatarUrl:e,avatarAltText:t,name:s}=this.props.group.author,o=n.provideLocalizationService(this);return m.createElement("div",{className:this.getMsgGroupClassNames()},s&&m.createElement("p",{className:"k-author"},s),e&&m.createElement(i.Avatar,{type:"image"},m.createElement("img",{src:e,alt:void 0!==t?t:o.toLanguageString(T,D[T])})),this.getGroupMessagesView())}getMsgGroupClassNames(){return s.classNames("k-message-group",{"k-no-avatar":!this.props.group.author.avatarUrl,"k-alt":g(this.props.user,this.props.group.messages[0])})}getGroupMessagesView(){const e=this.props.group.messages.length-1;return this.props.group.messages.map(((t,s)=>{const n=[m.createElement(this.props.message,{item:t,template:this.props.itemTemplate,selected:t.selectionIndex===this.props.selectedItemIndex,onRequestSelection:this.props.onRequestSelection,tabIndex:s===e&&this.props.isLastGroup?0:-1,isFirstItemInGroup:0===s,isLastItemInGroup:s===e,isOnlyItemInGroup:0===e,key:s})];return t.attachments&&1===t.attachments.length&&n.push(m.createElement(y,{item:t.attachments[0],template:this.props.attachmentTemplate,selected:!1,key:`att-${s}`})),n}))}}const A=m.forwardRef(((e,t)=>{const{className:n,...o}=e,a=m.useRef(null),i=m.useRef(null);m.useImperativeHandle(i,(()=>({element:a.current,props:e}))),m.useImperativeHandle(t,(()=>i.current));const l=m.useMemo((()=>s.classNames("k-chat-toolbar k-toolbar",n)),[n]);return m.useEffect((()=>{null!==a.current&&s.focusFirstFocusableChild(a.current,[...s.TABBABLE_ELEMENTS])}),[]),m.createElement(r.Toolbar,{id:e.id,ref:e=>{e&&(a.current=e.element)},className:l,...o},m.createElement("div",{className:"k-button-list k-toolbar-group"},e.children))}));A.displayName="KendoReactChatToolbar";class M extends m.Component{constructor(){super(...arguments),this.state={focused:!1},this.inputEl=null,this.toolbarBtnRef=m.createRef(),this.onInputKeyDown=e=>{switch(e.key){case"Enter":return this.sendMessage(e);case"F10":return this.openToolbar(e);default:return}},this.sendMessage=e=>{if(this.props.onMessageSend&&null!==this.inputEl){const t=this.inputEl.value;if(t){const s={author:this.props.user,text:t,timestamp:new Date};this.props.onMessageSend(s,e)}}null!==this.inputEl&&(this.inputEl.value=null)},this.openToolbar=e=>{null!==this.toolbarBtnRef.current&&(e.preventDefault(),this.props.onToolbarActionButtonClick(!this.props.showToolbar,e))}}render(){const e=n.provideLocalizationService(this),t=m.createElement("input",{type:"text",className:this.getClassNames(),placeholder:this.props.placeholder,onKeyDown:this.onInputKeyDown,onFocus:()=>this.setState({focused:!0}),onBlur:()=>this.setState({focused:!1}),ref:e=>{this.inputEl=e},"aria-label":e.toLanguageString(N,D[N])}),s=m.createElement(r.Button,{fillMode:"flat",themeColor:"base",className:"k-chat-send",icon:"paper-plane",svgIcon:a.paperPlaneIcon,onClick:this.sendMessage,"aria-label":e.toLanguageString(x,D[x]),dir:this.props.isDirectionRightToLeft?"rtl":void 0}),o=m.createElement(r.Button,{ref:this.toolbarBtnRef,fillMode:"flat",themeColor:"base",icon:"more-horizontal",svgIcon:a.moreHorizontalIcon,onClick:e=>this.props.onToolbarActionButtonClick(!this.props.showToolbar,e),"aria-label":e.toLanguageString(w,D[w])});return m.createElement(m.Fragment,null,m.createElement("span",{className:"k-message-box k-textbox k-input k-input-md k-rounded-md k-input-solid"},this.props.MessageBox?m.createElement(this.props.MessageBox,{messageInput:t,sendButton:s,toolbarButton:o}):m.createElement(m.Fragment,null,t,m.createElement("span",{className:"k-input-separator k-input-separator-vertical"}),m.createElement("span",{className:"k-input-suffix k-input-suffix-horizontal"},this.props.toolbar&&o,s))),this.props.showToolbar&&m.createElement(A,null,this.props.toolbar))}focusInput(){null!==this.inputEl&&this.inputEl.focus()}getClassNames(){return s.classNames("k-input-inner",{"k-focus":this.state.focused})}}const V={name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"11.4.0-develop.6",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},F=class e extends m.Component{constructor(e){super(e),this.viewItems=[],this.isDirectionRightToLeft=!1,this.scrollToBottomOnLoadingData=!0,this.showLicenseWatermark=!1,this.onFocus=()=>{clearTimeout(this.timeoutIdForChatLosingFocus)},this.onBlur=()=>{this.timeoutIdForChatLosingFocus=window.setTimeout((()=>{this.setState({selectedItemIndex:null})}),0)},this.onSelectionRequested=e=>{this.setState({selectedItemIndex:e})},this.onKeyDown=e=>{let t=null;const n=null!==this.state.selectedItemIndex?this.state.selectedItemIndex:this.viewItems.lastSelectionIndex;e.keyCode===s.Keys.up?null===n?t=0:n>0&&(t=n-1):e.keyCode===s.Keys.down&&(null===n?t=0:n<this.viewItems.lastSelectionIndex&&(t=n+1)),null!==t&&(this.setState({selectedItemIndex:t}),e.preventDefault())},this.onMessageSend=(e,t)=>{s.dispatchEvent(this.props.onMessageSend,t,this,{message:e})},this.onActionExecute=(e,t)=>{if(s.dispatchEvent(this.props.onActionExecute,t,this,{action:e}),!t.isDefaultPrevented()){switch(e.type){case"reply":this.onMessageSend({author:this.props.user,text:e.value,timestamp:new Date},t);break;case"call":window.open("tel:"+e.value);break;case"openUrl":window.open(e.value)}this.newMsgComp.focusInput()}},this.showLicenseWatermark=!s.validatePackage(V,{component:"Chat"}),this.state={selectedItemIndex:null,isFirstRender:!0}}render(){this.viewItems=this.getViewItemsFromMsgs(this.props.messages),this.isDirectionRightToLeft=this.checkIsDirectionRightToLeft(this.props);const e=n.provideLocalizationService(this);return m.createElement("div",{style:{width:this.props.width,position:"relative"},onKeyDown:this.onKeyDown,className:this.getClassNames(),ref:e=>{this.chatWrapperEl=e}},m.createElement("div",{className:"k-message-list k-avatars",onBlur:this.onBlur,onFocus:this.onFocus,role:"log","aria-label":e.toLanguageString(S,D[S]),"aria-live":"polite",onScroll:e=>{this.scrollToBottomOnLoadingData=e.currentTarget.scrollTop===e.currentTarget.scrollHeight-e.currentTarget.clientHeight},ref:e=>{this.viewItemsWrapperEl=e}},m.createElement("div",{className:"k-message-list-content"},this.renderViewItems())),m.createElement(M,{user:this.props.user,onMessageSend:this.onMessageSend,isDirectionRightToLeft:this.isDirectionRightToLeft,ref:e=>{this.newMsgComp=e},placeholder:this.props.placeholder,MessageBox:this.props.messageBox,toolbar:this.props.toolbar,onToolbarActionButtonClick:this.props.onToolbarActionExecute,showToolbar:this.props.showToolbar}),this.showLicenseWatermark&&m.createElement(s.WatermarkOverlay,null))}componentDidMount(){this.setState({isFirstRender:!1},(()=>{this.nextTickId=window.setTimeout((()=>this.scrollViewItemsToBottom()),250)}))}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidUpdate(e){e.messages.length!==this.props.messages.length&&this.scrollToBottomOnLoadingData&&this.scrollViewItemsToBottom()}getClassNames(){return s.classNames("k-chat",this.props.className,{"k-rtl":this.isDirectionRightToLeft})}checkIsDirectionRightToLeft(e){return!!(void 0!==e.dir?"rtl"===e.dir:this.chatWrapperEl&&"rtl"===getComputedStyle(this.chatWrapperEl).direction)}renderViewItems(){const t=this.viewItems.length-1;return this.viewItems.map(((s,n)=>"date-marker"===s.type?m.createElement(b,{item:s,key:n}):"message-group"===s.type?m.createElement(L,{group:s,itemTemplate:this.props.messageTemplate,attachmentTemplate:this.props.attachmentTemplate,user:this.props.user,selectedItemIndex:this.state.selectedItemIndex,onRequestSelection:this.onSelectionRequested,isLastGroup:n===t,key:n,message:this.props.message||e.defaultProps.message}):"attachment-group"===s.type?m.createElement(f,{group:s,itemTemplate:this.props.attachmentTemplate,onRequestSelection:this.onSelectionRequested,selected:s.selectionIndex===this.state.selectedItemIndex,isLastGroup:n===t,key:n}):"action-group"===s.type?m.createElement(C,{group:s,onActionExecute:this.onActionExecute,onRequestSelection:this.onSelectionRequested,selected:s.selectionIndex===this.state.selectedItemIndex,isLastGroup:n===t,key:n}):void 0))}scrollViewItemsToBottom(){this.viewItemsWrapperEl&&(this.viewItemsWrapperEl.scrollTop=this.viewItemsWrapperEl.scrollHeight-this.viewItemsWrapperEl.clientHeight)}getViewItemsFromMsgs(e){return e.length>0?(e=>{const t=e.slice().reduce(I(e.length),[]);return function(e){let t=0;e.forEach((e=>{"message-group"===e.type?e.messages.forEach((e=>{e.selectionIndex=t++})):("attachment-group"===e.type||"action-group"===e.type)&&(e.selectionIndex=t++)})),e.lastSelectionIndex=t-1}(t),t})(e):[]}};F.propTypes={messages:o.arrayOf(o.object),user:o.object,messageTemplate:o.any,attachmentTemplate:o.any,width:o.oneOfType([o.string,o.number]),onMessageSend:o.func,onActionExecute:o.func,dir:o.string,messageBox:o.any},F.defaultProps={messages:[],dateFormat:"g",message:h};let P=F;const K=e=>{const{suggestions:t,onSuggestionClick:n}=e;return m.createElement("div",{role:"group",className:"k-suggestion-group"},t.map((e=>m.createElement("span",{role:"button",tabIndex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:t=>!e.disabled&&n(t,e),onKeyDown:t=>!e.disabled&&((e,t)=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n(e,t))})(t,e),key:e.id,title:e.description,className:s.classNames("k-suggestion",{"k-disabled":e.disabled})},e.text))))};class O extends m.Component{constructor(){super(...arguments),this.onBtnClick=(e,t)=>{s.dispatchEvent(this.props.onActionExecute,t,this,{action:e})}}render(){return m.createElement("div",{className:"k-card"},m.createElement("img",{className:"k-card-image",src:this.props.imageUrl,style:{maxWidth:this.props.imageMaxWidth}}),m.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView()),m.createElement("div",{className:"k-card-actions k-card-actions-vertical"},this.getActionsView()))}getActionsView(){return this.props.actions.map(((e,t)=>m.createElement("span",{className:"k-card-action",key:t},m.createElement(r.Button,{fillMode:"flat",onClick:t=>this.onBtnClick(e,t)},e.title))))}getTitleView(){let e=null;return this.props.title&&(e=m.createElement("h5",{className:"k-card-title"},this.props.title)),e}getSubtitleView(){let e=null;return this.props.subtitle&&(e=m.createElement("h6",{className:"k-card-subtitle"},this.props.subtitle)),e}}const q=e=>{const{activeView:s,toolbarItems:n,activeViewChange:o}=e;return t.createElement("div",{className:"k-prompt-header"},t.createElement(r.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},n.map((e=>t.isValidElement(e)?e:t.createElement(r.Button,{key:e.name,className:s===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>(e=>{null==o||o.call(null,e)})(e.name)},e.buttonText)))))},G={name:"Output view",buttonText:"Output",buttonIcon:a.commentIcon},z={name:"Commands view",buttonIcon:a.moreHorizontalIcon},W={name:"prompt-view",buttonText:"Ask AI",buttonIcon:a.sparklesIcon},j=t.createContext([{},()=>{}]),U=()=>t.useContext(j),H=e=>{const{children:s}=e;return t.createElement("div",{className:"k-prompt-footer"},t.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},s))},$=t.forwardRef(((e,s)=>{const{children:o,streaming:i,onCancel:l}=e,c=n.useLocalization().toLanguageString(B,D[B]),[p]=U(),m=p.activeView===G.name,u=i&&m,d=t.useCallback((e=>{"Escape"===e.key&&u&&l&&(e.preventDefault(),l())}),[u,l]);return t.createElement("div",{className:"k-prompt-content",ref:s,onKeyDown:d},u&&t.createElement(r.FloatingActionButton,{onClick:l,svgIcon:a.stopSmIcon,icon:"stop-sm",size:"small",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":c,title:c}),t.createElement("div",{className:"k-prompt-view"},o))}));$.displayName="KendoReactAIPromptContent";const _=e=>{const[t]=U();return t.activeView===e.name?e.children:null},Y=e=>{const[s,n]=t.useState(!0),{children:o,title:i}=e;return t.createElement("div",{className:"k-prompt-expander"},t.createElement(r.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:s?a.chevronUpIcon:a.chevronDownIcon,title:i,onClick:()=>n(!s),"aria-expanded":s},i),s&&t.createElement("div",{id:e.id,className:"k-prompt-expander-content"},o))},J=e=>null==e?void 0:e.map((e=>t.createElement(i.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&J(e.children||[])))),Q=({show:e=!1,anchor:s,onOpen:n,onClose:o,animate:a=!0,appendTo:r,popupOptions:i={},children:l,style:p})=>t.createElement(c.Popup,{show:e,anchor:s,style:p,animate:a,appendTo:r,onOpen:n,onClose:o,...i},l),X=({placeholder:e="Ask or generate content with AI...",promptValue:n,onMenuClick:o,promptInput:i=l.TextArea,generateButton:c,enableSpeechToText:p=!1,streaming:m=!1,commands:u,onPromptRequest:d,onPromptCancel:h})=>{const[g,k]=t.useState(n||""),[I,E]=s.useCustomComponent(c),[v,C]=s.useCustomComponent(i),y={svgIcon:m?a.stopSmIcon:a.paperPlaneIcon,active:(!!m).toString(),title:"Send Button","aria-label":"Send Button",disabled:!g.trim()&&!m,"aria-disabled":!g.trim()&&!m},f={placeholder:e,className:"!k-flex-row",autoSize:!0,rows:1},b=u&&u.length>0,x=Object.keys(E).length>0?E:y,w=Object.keys(C).length>0?C:f,N=e=>{const{isFinal:t,alternatives:s}=e;if(t&&s.length>0){const e=s[0].transcript,t=(()=>{const t=g,s=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(s?" ":"")+e})();k(t)}},T=()=>{g.trim()&&d&&d(g.trim())};return t.createElement(v,{value:g,onChange:e=>{const t=e.target.value;k(t)},onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),T())},prefix:b||p?t.createElement(t.Fragment,null,t.createElement(l.InputPrefix,{className:"!k-align-items-start"},b&&t.createElement(r.Button,{"aria-label":"Commands Button",title:"Commands Button",fillMode:"flat",svgIcon:a.menuIcon,onClick:o}),p&&t.createElement(r.SpeechToTextButton,{fillMode:"flat",..."object"==typeof p?{...p,onResult:p.onResult||N}:{onResult:N}})),t.createElement(l.InputSeparator,null)):void 0,suffix:t.createElement(l.InputSuffix,{className:"!k-align-items-start"},t.createElement(I,{className:s.classNames("k-prompt-send",{"k-generating":m,"k-active":m}),fillMode:"flat",onClick:m?h:T,...x})),...w})};e.AIPrompt=e=>{const{activeView:n,toolbarItems:o,children:a,onActiveViewChange:r,onPromptRequest:i,onCommandExecute:l,style:c,dir:p,className:m,streaming:u,loading:d,onCancel:h,...g}=e,k=o||[W,G],[I,E]=t.useState({activeView:n}),v={...I,activeView:n,streaming:u,loading:d,onCancel:h,onActiveViewChange:r,onPromptRequest:i,onCommandExecute:l};return t.createElement(j.Provider,{value:[v,e=>{E(e)}]},t.createElement("div",{className:s.classNames("k-prompt",m),style:c,dir:p,...g},t.createElement(q,{activeView:v.activeView,toolbarItems:k,activeViewChange:r}),a))},e.AIPromptCommandsView=e=>{const{commands:s}=e,[n]=U();return t.createElement(_,{name:z.name},t.createElement($,{streaming:n.streaming,onCancel:n.onCancel},t.createElement("div",{className:"k-prompt-view"},t.createElement(i.PanelBar,{onSelect:e=>{var t,s,o;const a=null==(s=null==(t=e.target)?void 0:t.props)?void 0:s.data;null!=(o=a.children)&&o.length||n.onCommandExecute&&n.onCommandExecute.call(null,a)},selected:""},J(null!=s?s:[])))))},e.AIPromptContent=$,e.AIPromptFooter=H,e.AIPromptOutputView=e=>{const[s,o]=t.useState(""),l=t.useRef(null),[c]=U(),{outputs:p,showOutputRating:m,outputCard:u}=e,{header:d,body:h,actions:g}=u||{},k=n.useLocalization(),I=(e,t)=>{c.onPromptRequest&&c.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),E()},E=()=>{l&&l.current&&l.current.scrollTo({top:0,behavior:"smooth"})},v=t.createElement(i.Card,null,t.createElement(i.CardHeader,null,t.createElement(i.CardTitle,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),t.createElement(i.CardSubtitle,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),t.createElement(i.CardBody,null,t.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),t.createElement(i.CardActions,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),C=null==p?void 0:p.map(((e,n)=>t.createElement(i.Card,{key:`${e.id}_${n}`},t.createElement(i.CardHeader,null,d?d(e):t.createElement(t.Fragment,null,e.title&&t.createElement(i.CardTitle,null,e.title),e.subTitle&&t.createElement(i.CardSubtitle,null,e.subTitle))),t.createElement(i.CardBody,null,h?h(e):e.responseContent),t.createElement(i.CardActions,null,g?g(e):t.createElement(t.Fragment,null,t.createElement(r.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:s===e.id?a.checkIcon:a.copyIcon,onClick:()=>(e=>{null!=e&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),o(e.id),setTimeout((()=>{o("")}),1e3)})(e)},"Copy"),t.createElement(r.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:a.arrowRotateCwIcon,onClick:()=>(e=>{c.onPromptRequest&&c.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),E()})(e)},"Retry"),m&&t.createElement(t.Fragment,null,t.createElement("span",{className:"k-spacer"}),t.createElement(r.Button,{size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:a.thumbUpOutlineIcon,onClick:()=>I(e,"positive")}),t.createElement(r.Button,{size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:a.thumbDownOutlineIcon,onClick:()=>I(e,"negative")}))))))),y=t.createElement(i.Card,null,t.createElement(i.CardBody,null,k.toLanguageString(R,D[R])));return t.createElement(_,{name:G.name},t.createElement($,{ref:l,streaming:c.streaming,onCancel:c.onCancel},t.createElement("div",{className:"k-card-list"},c.loading&&v,C,(!C||0===C.length)&&!c.loading&&y)))},e.AIPromptView=e=>{const{promptInput:n=l.TextArea,generateButton:o=r.Button,enableSpeechToText:i=!1,promptValue:c,promptSuggestions:p}=e,[m,u]=t.useState(c||""),[d]=U(),[h,g]=s.useCustomComponent(o),[k,I]=s.useCustomComponent(n),E={title:"Generate",children:"Generate",svgIcon:a.sparklesIcon},v=Object.keys(g).length>0?g:E,C=Object.keys(I).length>0?I:{placeholder:"Ask or generate content with AI ...",rows:2},y=e=>{const{isFinal:t,alternatives:s}=e;if(t&&s.length>0){const e=s[0].transcript,t=(()=>{const t=m,s=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(s?" ":"")+e})();u(t)}};let f;return i&&(f="object"==typeof i?{...i,onResult:i.onResult||y}:{onResult:y}),t.createElement(_,{name:W.name},t.createElement($,{streaming:d.streaming,onCancel:d.onCancel},t.createElement(k,{value:m,className:"!k-flex-col",suffix:i?t.createElement(l.InputSuffix,{orientation:"horizontal"},t.createElement(r.SpeechToTextButton,{fillMode:"flat",...f})):void 0,onChange:e=>{u(e.target.value)},...C}),p&&p.length>0&&t.createElement(Y,{id:"prompt-suggestions",title:"Prompt Suggestions"},t.createElement(K,{suggestions:p.map(((e,t)=>({id:t,text:e,description:e}))),onSuggestionClick:(e,t)=>{(e=>{u(e)})(t.text)}}))),t.createElement(H,null,t.createElement(h,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:()=>{d.onPromptRequest&&d.onPromptRequest.call(null,m),u("")},disabled:!m.trim(),...v},v.children)))},e.AIPromptViewRender=_,e.Chat=P,e.ChatMessage=h,e.HeroCard=O,e.InlineAIPrompt=e=>{const{outputs:n=[],outputCard:o,promptInput:c=l.TextArea,generateButton:p=r.Button,promptPlaceholder:m="Ask or generate content with AI...",promptValue:u,onPromptRequest:d,onCopy:h,onDiscard:g,outputActions:k,onOutputAction:I,enableSpeechToText:E=!1,streaming:v,onPromptCancel:C,show:y=!1,anchor:f,width:b,height:x,onOpen:w,onClose:N,animate:T=!0,appendTo:S,commands:R,onCommandExecute:B,style:D,className:L,popupOptions:A={},...M}=e,[V,F]=t.useState(""),[P,K]=t.useState(!1),[O,q]=t.useState({left:0,top:0}),G=t.useRef(null),{body:z,actions:W}=o||{},j=k||[{id:"copy",text:"Copy",svgIcon:a.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:a.cancelOutlineIcon,themeColor:"base",title:"Discard"}],U=(e,t)=>{switch(e.id){case"copy":(e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),F(e.id),setTimeout((()=>F("")),1e3)),null==h||h(e)})(t);break;case"discard":(e=>{null==g||g(e)})(t);break;default:null==I||I(e,t)}},H=t.useCallback((e=>{"Escape"===e.key&&(v&&C?C():!v&&N&&N({target:null}))}),[v,C,N]),_={...D,...b&&{width:b},...x&&{height:x}},Y={...b&&{width:b},...x&&{height:x}},J=t.createElement("div",{className:s.classNames("k-prompt",L),style:_,onKeyDown:H,...M},t.createElement($,{ref:G},n&&n.length>0&&t.createElement("div",{className:"k-card-list"},n.map(((e,s)=>t.createElement(i.Card,{key:`${e.id}_${s}`},t.createElement(i.CardBody,null,z?z(e):e.responseContent),t.createElement(i.CardActions,null,W?W(e):t.createElement(t.Fragment,null,j.map((s=>{var n;return t.createElement(r.Button,{key:s.id,size:"medium",themeColor:s.themeColor||"primary",fillMode:"flat",rounded:"medium",title:null!=(n=s.title)?n:s.text,svgIcon:"copy"===s.id&&V===e.id?a.checkIcon:s.svgIcon,onClick:()=>U(s,e)},s.text)})))))))),t.createElement(X,{promptValue:u,placeholder:m,onPromptRequest:d,onMenuClick:e=>{if(!G.current)return;const t=G.current.getBoundingClientRect();q({left:t.left,top:t.bottom}),K(!0)},onPromptCancel:C,promptInput:c,generateButton:p,enableSpeechToText:E,streaming:v,commands:R})));return t.createElement(t.Fragment,null,t.createElement(Q,{show:y,anchor:f,onOpen:w,onClose:N,animate:T,appendTo:S,popupOptions:A,style:Y},J),t.createElement(i.ContextMenu,{show:P,offset:O,onClose:()=>{K(!1)},items:(e=>null==e?void 0:e.map((e=>({text:e.text,svgIcon:e.svgIcon,data:e,items:e.children?e.children.map((e=>({text:e.text,data:e}))):void 0}))))(R),onSelect:e=>{var t,s;const n=null==(t=e.item)?void 0:t.data;n&&(null==(s=n.children)||!s.length)&&(e=>{K(!1),B&&B(e)})(n)}}))},e.PromptHeader=q,e.SuggestionGroup=K,e.commandsViewDefaults=z,e.outputViewDefaults=G,e.promptViewDefaults=W}));
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl"),require("prop-types"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("@progress/kendo-react-layout"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-popup")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-intl","prop-types","@progress/kendo-svg-icons","@progress/kendo-react-buttons","@progress/kendo-react-layout","@progress/kendo-react-inputs","@progress/kendo-react-popup"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactConversationalUi={},e.React,e.KendoReactCommon,e.KendoReactIntl,e.PropTypes,e.KendoSvgIcons,e.KendoReactButtons,e.KendoReactLayout,e.KendoReactInputs,e.KendoReactPopup)}(this,(function(e,t,s,n,o,a,r,i,l,c){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var m=p(t);let u=class extends m.Component{componentDidUpdate(e){!e.selected&&this.props.selected&&this.elementToFocus.focus()}};const d=class extends u{render(){return m.createElement("div",{className:this.getClassNames(),tabIndex:this.props.tabIndex,onClick:()=>this.props.onRequestSelection(this.props.item.selectionIndex),onFocus:()=>this.props.onRequestSelection(this.props.item.selectionIndex),ref:e=>{this.elementToFocus=e}},this.getTimestampView(),this.getMainView(),this.getStatusView())}getMainView(){return this.props.item.typing?m.createElement("div",{className:"k-chat-bubble"},m.createElement("div",{className:"k-typing-indicator"},m.createElement("span",null),m.createElement("span",null),m.createElement("span",null))):this.props.template?m.createElement(this.props.template,{item:this.props.item}):this.props.item.text?m.createElement("div",{className:"k-chat-bubble"},this.props.item.text):null}getTimestampView(){let e=null;return this.props.item.timestamp&&(e=m.createElement("time",{className:"k-message-time","aria-hidden":!this.props.selected},n.provideIntlService(this).formatDate(this.props.item.timestamp,this.props.dateFormat))),e}getStatusView(){let e=null;return this.props.item.status&&(e=m.createElement("span",{className:"k-message-status"},this.props.item.status)),e}getClassNames(){return s.classNames({"k-only":this.props.isOnlyItemInGroup},{"k-first":this.props.isFirstItemInGroup&&!this.props.isOnlyItemInGroup},{"k-last":this.props.isLastItemInGroup&&!this.props.isOnlyItemInGroup},{"k-selected":this.props.selected},{"k-focus":this.props.selected},"k-message")}};d.defaultProps={dateFormat:"g",tabIndex:-1};let h=d;n.registerForIntl(h);const g=(e,t)=>e&&t.author&&e.id===t.author.id,k=e=>e[e.length-1],I=e=>(t,s,n)=>{const o=n===e-1;return((e,t)=>{const s=t.timestamp,n=k(e);if(s&&(!n||((e,t)=>e&&t&&(t.getDate()!==e.getDate()||t.getMonth()!==e.getMonth()||t.getFullYear()!==e.getFullYear()))(s,n.timestamp))){const t={type:"date-marker",timestamp:s,trackBy:s.getTime()};e.push(t)}})(t,s),((e,t,s)=>{const n=k(e);let o;t.typing&&!s||(n&&"message-group"===n.type&&(o=n.messages),o&&g(t.author,k(o))?o.push(t):e.push({type:"message-group",messages:[t],author:t.author,timestamp:t.timestamp,trackBy:t}))})(t,s,o),s.attachments&&s.attachments.length>1&&t.push({type:"attachment-group",attachments:s.attachments,attachmentLayout:s.attachmentLayout,timestamp:s.timestamp,trackBy:s}),s.suggestedActions&&o&&t.push({type:"action-group",actions:s.suggestedActions,timestamp:s.timestamp,trackBy:s}),t};let E=class extends u{constructor(){super(...arguments),this.onKeyDown=e=>{e.keyCode===s.Keys.enter&&this.props.onActionExecute(this.props.item,e)}}render(){return m.createElement("span",{role:"button",className:this.getClassNames(),onClick:e=>this.props.onActionExecute(this.props.item,e),ref:e=>{this.elementToFocus=e},onKeyDown:this.onKeyDown,tabIndex:0},this.props.item.title||this.props.item.value)}getClassNames(){return s.classNames("k-quick-reply",{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup},{"k-selected":this.props.selected},{"k-focus":this.props.selected})}},v=class extends m.Component{constructor(){super(...arguments),this.state={selectedItemIndex:null},this.onRequestContainerSelection=()=>this.props.onRequestSelection(this.props.group.selectionIndex),this.onKeyDown=e=>{let t,n,o=null;this.isKeyboardNavigationLeftRight?(t=s.Keys.left,n=s.Keys.right):(t=s.Keys.up,n=s.Keys.down),e.keyCode===t?o=this.navigate(!1):e.keyCode===n&&(o=this.navigate(!0)),null!==o&&(e.preventDefault(),e.stopPropagation())}}static getDerivedStateFromProps(e,t){return e.selected||null===t.selectedItemIndex?e.selected&&null===t.selectedItemIndex?{selectedItemIndex:0}:null:{selectedItemIndex:null}}navigate(e,t=0){let s=null;const n=this.state.selectedItemIndex;return e?null===n?s=t:n<this.getLastSelectionIndex()&&(s=n+1):null===n?s=0:n>0&&(s=n-1),null!==s&&this.setState({selectedItemIndex:s}),s}get isKeyboardNavigationLeftRight(){return!0}getLastSelectionIndex(){let e=-1;if("action-group"===this.props.group.type){const t=this.props.group;e=t.actions?t.actions.length-1:-1}else if("attachment-group"===this.props.group.type){const t=this.props.group;e=t.attachments?t.attachments.length-1:-1}return e}};class C extends v{constructor(e){super(e)}render(){const e=this.props.group.actions?this.props.group.actions.length-1:0;return m.createElement("div",{className:this.getClassNames(),onClick:this.onRequestContainerSelection,onKeyDown:this.onKeyDown},this.props.group.actions&&this.props.group.actions.map(((t,s)=>m.createElement(E,{item:t,onActionExecute:this.props.onActionExecute,selected:s===this.state.selectedItemIndex,isFirstItemInGroup:0===s,isLastItemInGroup:s===e,key:s}))))}getClassNames(){return s.classNames("k-quick-replies")}}let y=class extends u{render(){return m.createElement("div",{className:this.getClassNames(),tabIndex:this.getTabIndexValue(),onClick:this.props.onClick,ref:e=>{this.elementToFocus=e}},this.props.template?m.createElement(this.props.template,{item:this.props.item}):m.createElement("div",{className:"k-card"},m.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView(),this.getContentView())))}getTabIndexValue(){if(void 0!==this.props.tabbable)return this.props.tabbable?0:-1}getClassNames(){return s.classNames({"k-selected":this.props.selected},{"k-focus":this.props.selected},{"k-first":this.props.isFirstItemInGroup},{"k-last":this.props.isLastItemInGroup})}getTitleView(){return this.props.item.title?m.createElement("h5",{className:"k-card-title"},this.props.item.title):null}getSubtitleView(){return this.props.item.subtitle?m.createElement("h6",{className:"k-card-subtitle"},this.props.item.subtitle):null}getContentView(){return 0===this.props.item.contentType.indexOf("image/")?m.createElement("img",{src:this.props.item.content}):this.props.item.content}};class f extends v{render(){const e=this.isCardDeckLayout(this.props),t=m.createElement("div",{className:this.getClassNames(),onKeyDown:e?void 0:this.onKeyDown},this.props.group.attachments.map(((e,t)=>m.createElement(y,{item:e,template:this.props.itemTemplate,selected:t===this.state.selectedItemIndex,tabbable:this.props.isLastGroup&&t===this.state.selectedItemIndex,isFirstItemInGroup:0===t,isLastItemInGroup:t===this.getLastItemIndex(),onClick:()=>this.onAttachmentClick(t),key:t}))));return e?m.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:this.onKeyDown},this.getLeftScrollBtn(),t,this.getRightScrollBtn()):t}get isKeyboardNavigationLeftRight(){return this.isCardDeckLayout(this.props)}getLastItemIndex(){return this.props.group.attachments.length-1}getLeftScrollBtn(){let e=null;return this.isCardDeckLayout(this.props)&&this.state.selectedItemIndex&&(e=m.createElement(r.Button,{icon:"chevron-left",onClick:()=>this.onNavigateBtnClick(!1),svgIcon:a.chevronLeftIcon})),e}getRightScrollBtn(){let e=null;return this.isCardDeckLayout(this.props)&&this.state.selectedItemIndex!==this.getLastItemIndex()&&(e=m.createElement(r.Button,{icon:"chevron-right",onClick:()=>this.onNavigateBtnClick(!0),svgIcon:a.chevronRightIcon})),e}onAttachmentClick(e){this.onRequestContainerSelection(),this.setState({selectedItemIndex:e})}onNavigateBtnClick(e){this.onRequestContainerSelection(),this.navigate(e,1)}isCardDeckLayout(e){return"list"!==e.group.attachmentLayout}getClassNames(){return s.classNames({"k-card-list":this.props.group.attachmentLayout,"k-card-deck":this.isCardDeckLayout(this.props)})}}let b=class extends m.Component{render(){const e=this.props.item;return m.createElement("div",{className:"k-timestamp"},n.provideIntlService(this).formatDate(e.timestamp,"D"))}};n.registerForIntl(b);const x="newMessage.sendButton",w="newMessage.optionsButton",N="newMessage.messageInput",T="avatar.alt",S="messageList.ariaLabel",R="aIPrompt.noOutputs",B="aIPrompt.cancel",D={[x]:"Send",[w]:"Options",[N]:"Message",[T]:"Avatar",[S]:"Message list",[B]:"Cancel",[R]:"No output from AI available"};class L extends m.Component{render(){const{avatarUrl:e,avatarAltText:t,name:s}=this.props.group.author,o=n.provideLocalizationService(this);return m.createElement("div",{className:this.getMsgGroupClassNames()},s&&m.createElement("p",{className:"k-author"},s),e&&m.createElement(i.Avatar,{type:"image"},m.createElement("img",{src:e,alt:void 0!==t?t:o.toLanguageString(T,D[T])})),this.getGroupMessagesView())}getMsgGroupClassNames(){return s.classNames("k-message-group",{"k-no-avatar":!this.props.group.author.avatarUrl,"k-alt":g(this.props.user,this.props.group.messages[0])})}getGroupMessagesView(){const e=this.props.group.messages.length-1;return this.props.group.messages.map(((t,s)=>{const n=[m.createElement(this.props.message,{item:t,template:this.props.itemTemplate,selected:t.selectionIndex===this.props.selectedItemIndex,onRequestSelection:this.props.onRequestSelection,tabIndex:s===e&&this.props.isLastGroup?0:-1,isFirstItemInGroup:0===s,isLastItemInGroup:s===e,isOnlyItemInGroup:0===e,key:s})];return t.attachments&&1===t.attachments.length&&n.push(m.createElement(y,{item:t.attachments[0],template:this.props.attachmentTemplate,selected:!1,key:`att-${s}`})),n}))}}const A=m.forwardRef(((e,t)=>{const{className:n,...o}=e,a=m.useRef(null),i=m.useRef(null);m.useImperativeHandle(i,(()=>({element:a.current,props:e}))),m.useImperativeHandle(t,(()=>i.current));const l=m.useMemo((()=>s.classNames("k-chat-toolbar k-toolbar",n)),[n]);return m.useEffect((()=>{null!==a.current&&s.focusFirstFocusableChild(a.current,[...s.TABBABLE_ELEMENTS])}),[]),m.createElement(r.Toolbar,{id:e.id,ref:e=>{e&&(a.current=e.element)},className:l,...o},m.createElement("div",{className:"k-button-list k-toolbar-group"},e.children))}));A.displayName="KendoReactChatToolbar";class M extends m.Component{constructor(){super(...arguments),this.state={focused:!1},this.inputEl=null,this.toolbarBtnRef=m.createRef(),this.onInputKeyDown=e=>{switch(e.key){case"Enter":return this.sendMessage(e);case"F10":return this.openToolbar(e);default:return}},this.sendMessage=e=>{if(this.props.onMessageSend&&null!==this.inputEl){const t=this.inputEl.value;if(t){const s={author:this.props.user,text:t,timestamp:new Date};this.props.onMessageSend(s,e)}}null!==this.inputEl&&(this.inputEl.value=null)},this.openToolbar=e=>{null!==this.toolbarBtnRef.current&&(e.preventDefault(),this.props.onToolbarActionButtonClick(!this.props.showToolbar,e))}}render(){const e=n.provideLocalizationService(this),t=m.createElement("input",{type:"text",className:this.getClassNames(),placeholder:this.props.placeholder,onKeyDown:this.onInputKeyDown,onFocus:()=>this.setState({focused:!0}),onBlur:()=>this.setState({focused:!1}),ref:e=>{this.inputEl=e},"aria-label":e.toLanguageString(N,D[N])}),s=m.createElement(r.Button,{fillMode:"flat",themeColor:"base",className:"k-chat-send",icon:"paper-plane",svgIcon:a.paperPlaneIcon,onClick:this.sendMessage,"aria-label":e.toLanguageString(x,D[x]),dir:this.props.isDirectionRightToLeft?"rtl":void 0}),o=m.createElement(r.Button,{ref:this.toolbarBtnRef,fillMode:"flat",themeColor:"base",icon:"more-horizontal",svgIcon:a.moreHorizontalIcon,onClick:e=>this.props.onToolbarActionButtonClick(!this.props.showToolbar,e),"aria-label":e.toLanguageString(w,D[w])});return m.createElement(m.Fragment,null,m.createElement("span",{className:"k-message-box k-textbox k-input k-input-md k-rounded-md k-input-solid"},this.props.MessageBox?m.createElement(this.props.MessageBox,{messageInput:t,sendButton:s,toolbarButton:o}):m.createElement(m.Fragment,null,t,m.createElement("span",{className:"k-input-separator k-input-separator-vertical"}),m.createElement("span",{className:"k-input-suffix k-input-suffix-horizontal"},this.props.toolbar&&o,s))),this.props.showToolbar&&m.createElement(A,null,this.props.toolbar))}focusInput(){null!==this.inputEl&&this.inputEl.focus()}getClassNames(){return s.classNames("k-input-inner",{"k-focus":this.state.focused})}}const V={name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"11.4.0-develop.8",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},P=class e extends m.Component{constructor(e){super(e),this.viewItems=[],this.isDirectionRightToLeft=!1,this.scrollToBottomOnLoadingData=!0,this.showLicenseWatermark=!1,this.onFocus=()=>{clearTimeout(this.timeoutIdForChatLosingFocus)},this.onBlur=()=>{this.timeoutIdForChatLosingFocus=window.setTimeout((()=>{this.setState({selectedItemIndex:null})}),0)},this.onSelectionRequested=e=>{this.setState({selectedItemIndex:e})},this.onKeyDown=e=>{let t=null;const n=null!==this.state.selectedItemIndex?this.state.selectedItemIndex:this.viewItems.lastSelectionIndex;e.keyCode===s.Keys.up?null===n?t=0:n>0&&(t=n-1):e.keyCode===s.Keys.down&&(null===n?t=0:n<this.viewItems.lastSelectionIndex&&(t=n+1)),null!==t&&(this.setState({selectedItemIndex:t}),e.preventDefault())},this.onMessageSend=(e,t)=>{s.dispatchEvent(this.props.onMessageSend,t,this,{message:e})},this.onActionExecute=(e,t)=>{if(s.dispatchEvent(this.props.onActionExecute,t,this,{action:e}),!t.isDefaultPrevented()){switch(e.type){case"reply":this.onMessageSend({author:this.props.user,text:e.value,timestamp:new Date},t);break;case"call":window.open("tel:"+e.value);break;case"openUrl":window.open(e.value)}this.newMsgComp.focusInput()}},this.showLicenseWatermark=!s.validatePackage(V,{component:"Chat"}),this.licenseMessage=s.getLicenseMessage(V),this.state={selectedItemIndex:null,isFirstRender:!0}}render(){this.viewItems=this.getViewItemsFromMsgs(this.props.messages),this.isDirectionRightToLeft=this.checkIsDirectionRightToLeft(this.props);const e=n.provideLocalizationService(this);return m.createElement("div",{style:{width:this.props.width,position:"relative"},onKeyDown:this.onKeyDown,className:this.getClassNames(),ref:e=>{this.chatWrapperEl=e}},m.createElement("div",{className:"k-message-list k-avatars",onBlur:this.onBlur,onFocus:this.onFocus,role:"log","aria-label":e.toLanguageString(S,D[S]),"aria-live":"polite",onScroll:e=>{this.scrollToBottomOnLoadingData=e.currentTarget.scrollTop===e.currentTarget.scrollHeight-e.currentTarget.clientHeight},ref:e=>{this.viewItemsWrapperEl=e}},m.createElement("div",{className:"k-message-list-content"},this.renderViewItems())),m.createElement(M,{user:this.props.user,onMessageSend:this.onMessageSend,isDirectionRightToLeft:this.isDirectionRightToLeft,ref:e=>{this.newMsgComp=e},placeholder:this.props.placeholder,MessageBox:this.props.messageBox,toolbar:this.props.toolbar,onToolbarActionButtonClick:this.props.onToolbarActionExecute,showToolbar:this.props.showToolbar}),this.showLicenseWatermark&&m.createElement(s.WatermarkOverlay,{message:this.licenseMessage}))}componentDidMount(){this.setState({isFirstRender:!1},(()=>{this.nextTickId=window.setTimeout((()=>this.scrollViewItemsToBottom()),250)}))}componentWillUnmount(){clearTimeout(this.nextTickId)}componentDidUpdate(e){e.messages.length!==this.props.messages.length&&this.scrollToBottomOnLoadingData&&this.scrollViewItemsToBottom()}getClassNames(){return s.classNames("k-chat",this.props.className,{"k-rtl":this.isDirectionRightToLeft})}checkIsDirectionRightToLeft(e){return!!(void 0!==e.dir?"rtl"===e.dir:this.chatWrapperEl&&"rtl"===getComputedStyle(this.chatWrapperEl).direction)}renderViewItems(){const t=this.viewItems.length-1;return this.viewItems.map(((s,n)=>"date-marker"===s.type?m.createElement(b,{item:s,key:n}):"message-group"===s.type?m.createElement(L,{group:s,itemTemplate:this.props.messageTemplate,attachmentTemplate:this.props.attachmentTemplate,user:this.props.user,selectedItemIndex:this.state.selectedItemIndex,onRequestSelection:this.onSelectionRequested,isLastGroup:n===t,key:n,message:this.props.message||e.defaultProps.message}):"attachment-group"===s.type?m.createElement(f,{group:s,itemTemplate:this.props.attachmentTemplate,onRequestSelection:this.onSelectionRequested,selected:s.selectionIndex===this.state.selectedItemIndex,isLastGroup:n===t,key:n}):"action-group"===s.type?m.createElement(C,{group:s,onActionExecute:this.onActionExecute,onRequestSelection:this.onSelectionRequested,selected:s.selectionIndex===this.state.selectedItemIndex,isLastGroup:n===t,key:n}):void 0))}scrollViewItemsToBottom(){this.viewItemsWrapperEl&&(this.viewItemsWrapperEl.scrollTop=this.viewItemsWrapperEl.scrollHeight-this.viewItemsWrapperEl.clientHeight)}getViewItemsFromMsgs(e){return e.length>0?(e=>{const t=e.slice().reduce(I(e.length),[]);return function(e){let t=0;e.forEach((e=>{"message-group"===e.type?e.messages.forEach((e=>{e.selectionIndex=t++})):("attachment-group"===e.type||"action-group"===e.type)&&(e.selectionIndex=t++)})),e.lastSelectionIndex=t-1}(t),t})(e):[]}};P.propTypes={messages:o.arrayOf(o.object),user:o.object,messageTemplate:o.any,attachmentTemplate:o.any,width:o.oneOfType([o.string,o.number]),onMessageSend:o.func,onActionExecute:o.func,dir:o.string,messageBox:o.any},P.defaultProps={messages:[],dateFormat:"g",message:h};let F=P;const K=e=>{const{suggestions:t,onSuggestionClick:n}=e;return m.createElement("div",{role:"group",className:"k-suggestion-group"},t.map((e=>m.createElement("span",{role:"button",tabIndex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:t=>!e.disabled&&n(t,e),onKeyDown:t=>!e.disabled&&((e,t)=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n(e,t))})(t,e),key:e.id,title:e.description,className:s.classNames("k-suggestion",{"k-disabled":e.disabled})},e.text))))};class O extends m.Component{constructor(){super(...arguments),this.onBtnClick=(e,t)=>{s.dispatchEvent(this.props.onActionExecute,t,this,{action:e})}}render(){return m.createElement("div",{className:"k-card"},m.createElement("img",{className:"k-card-image",src:this.props.imageUrl,style:{maxWidth:this.props.imageMaxWidth}}),m.createElement("div",{className:"k-card-body"},this.getTitleView(),this.getSubtitleView()),m.createElement("div",{className:"k-card-actions k-card-actions-vertical"},this.getActionsView()))}getActionsView(){return this.props.actions.map(((e,t)=>m.createElement("span",{className:"k-card-action",key:t},m.createElement(r.Button,{fillMode:"flat",onClick:t=>this.onBtnClick(e,t)},e.title))))}getTitleView(){let e=null;return this.props.title&&(e=m.createElement("h5",{className:"k-card-title"},this.props.title)),e}getSubtitleView(){let e=null;return this.props.subtitle&&(e=m.createElement("h6",{className:"k-card-subtitle"},this.props.subtitle)),e}}const q=e=>{const{activeView:s,toolbarItems:n,activeViewChange:o}=e;return t.createElement("div",{className:"k-prompt-header"},t.createElement(r.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},n.map((e=>t.isValidElement(e)?e:t.createElement(r.Button,{key:e.name,className:s===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>(e=>{null==o||o.call(null,e)})(e.name)},e.buttonText)))))},G={name:"Output view",buttonText:"Output",buttonIcon:a.commentIcon},z={name:"Commands view",buttonIcon:a.moreHorizontalIcon},W={name:"prompt-view",buttonText:"Ask AI",buttonIcon:a.sparklesIcon},j=t.createContext([{},()=>{}]),U=()=>t.useContext(j),H=e=>{const{children:s}=e;return t.createElement("div",{className:"k-prompt-footer"},t.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},s))},$=t.forwardRef(((e,s)=>{const{children:o,streaming:i,onCancel:l}=e,c=n.useLocalization().toLanguageString(B,D[B]),[p]=U(),m=p.activeView===G.name,u=i&&m,d=t.useCallback((e=>{"Escape"===e.key&&u&&l&&(e.preventDefault(),l())}),[u,l]);return t.createElement("div",{className:"k-prompt-content",ref:s,onKeyDown:d},u&&t.createElement(r.FloatingActionButton,{onClick:l,svgIcon:a.stopSmIcon,icon:"stop-sm",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":c,title:c}),t.createElement("div",{className:"k-prompt-view"},o))}));$.displayName="KendoReactAIPromptContent";const _=e=>{const[t]=U();return t.activeView===e.name?e.children:null},Y=e=>{const[s,n]=t.useState(!0),{children:o,title:i}=e;return t.createElement("div",{className:"k-prompt-expander"},t.createElement(r.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:s?a.chevronUpIcon:a.chevronDownIcon,title:i,onClick:()=>n(!s),"aria-expanded":s},i),s&&t.createElement("div",{id:e.id,className:"k-prompt-expander-content"},o))},J=e=>null==e?void 0:e.map((e=>t.createElement(i.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&J(e.children||[])))),Q=({show:e=!1,anchor:s,onOpen:n,onClose:o,animate:a=!0,appendTo:r,popupOptions:i={},children:l,style:p})=>t.createElement(c.Popup,{show:e,anchor:s,style:p,animate:a,appendTo:r,onOpen:n,onClose:o,...i},l),X=({placeholder:e="Ask or generate content with AI...",promptValue:n,onMenuClick:o,promptInput:i=l.TextArea,generateButton:c,enableSpeechToText:p=!1,streaming:m=!1,commands:u,onPromptRequest:d,onPromptCancel:h})=>{const[g,k]=t.useState(n||""),[I,E]=s.useCustomComponent(c),[v,C]=s.useCustomComponent(i),y={svgIcon:m?a.stopSmIcon:a.paperPlaneIcon,active:(!!m).toString(),title:"Send Button","aria-label":"Send Button",disabled:!g.trim()&&!m,"aria-disabled":!g.trim()&&!m},f={placeholder:e,className:"!k-flex-row",autoSize:!0,rows:1},b=u&&u.length>0,x=Object.keys(E).length>0?E:y,w=Object.keys(C).length>0?C:f,N=e=>{const{isFinal:t,alternatives:s}=e;if(t&&s.length>0){const e=s[0].transcript,t=(()=>{const t=g,s=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(s?" ":"")+e})();k(t)}},T=()=>{g.trim()&&d&&d(g.trim())};return t.createElement(v,{value:g,onChange:e=>{const t=e.target.value;k(t)},onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),T())},prefix:b||p?t.createElement(t.Fragment,null,t.createElement(l.InputPrefix,{className:"!k-align-items-start"},b&&t.createElement(r.Button,{"aria-label":"Commands Button",title:"Commands Button",fillMode:"flat",svgIcon:a.menuIcon,onClick:o}),p&&t.createElement(r.SpeechToTextButton,{fillMode:"flat",..."object"==typeof p?{...p,onResult:p.onResult||N}:{onResult:N}})),t.createElement(l.InputSeparator,null)):void 0,suffix:t.createElement(l.InputSuffix,{className:"!k-align-items-start"},t.createElement(I,{className:s.classNames("k-prompt-send",{"k-generating":m,"k-active":m}),fillMode:"flat",onClick:m?h:T,...x})),...w})};e.AIPrompt=e=>{const n=!s.validatePackage(V,{component:"AIPrompt"}),{activeView:o,toolbarItems:a,children:r,onActiveViewChange:i,onPromptRequest:l,onCommandExecute:c,style:p,dir:m,className:u,streaming:d,loading:h,onCancel:g,...k}=e,I=a||[W,G],[E,v]=t.useState({activeView:o}),C={...E,activeView:o,streaming:d,loading:h,onCancel:g,onActiveViewChange:i,onPromptRequest:l,onCommandExecute:c};return t.createElement(j.Provider,{value:[C,e=>{v(e)}]},t.createElement("div",{className:s.classNames("k-prompt",u),style:p,dir:m,...k},t.createElement(q,{activeView:C.activeView,toolbarItems:I,activeViewChange:i}),r,n&&t.createElement(s.WatermarkOverlay,null)))},e.AIPromptCommandsView=e=>{const{commands:s}=e,[n]=U();return t.createElement(_,{name:z.name},t.createElement($,{streaming:n.streaming,onCancel:n.onCancel},t.createElement("div",{className:"k-prompt-view"},t.createElement(i.PanelBar,{onSelect:e=>{var t,s,o;const a=null==(s=null==(t=e.target)?void 0:t.props)?void 0:s.data;null!=(o=a.children)&&o.length||n.onCommandExecute&&n.onCommandExecute.call(null,a)},selected:""},J(null!=s?s:[])))))},e.AIPromptContent=$,e.AIPromptFooter=H,e.AIPromptOutputView=e=>{const[s,o]=t.useState(""),l=t.useRef(null),[c]=U(),{outputs:p,showOutputRating:m,outputCard:u}=e,{header:d,body:h,actions:g}=u||{},k=n.useLocalization(),I=(e,t)=>{c.onPromptRequest&&c.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),E()},E=()=>{l&&l.current&&l.current.scrollTo({top:0,behavior:"smooth"})},v=t.createElement(i.Card,null,t.createElement(i.CardHeader,null,t.createElement(i.CardTitle,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),t.createElement(i.CardSubtitle,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),t.createElement(i.CardBody,null,t.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),t.createElement(i.CardActions,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),C=null==p?void 0:p.map(((e,n)=>t.createElement(i.Card,{key:`${e.id}_${n}`},t.createElement(i.CardHeader,null,d?d(e):t.createElement(t.Fragment,null,e.title&&t.createElement(i.CardTitle,null,e.title),e.subTitle&&t.createElement(i.CardSubtitle,null,e.subTitle))),t.createElement(i.CardBody,null,h?h(e):e.responseContent),t.createElement(i.CardActions,null,g?g(e):t.createElement(t.Fragment,null,t.createElement(r.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:s===e.id?a.checkIcon:a.copyIcon,onClick:()=>(e=>{null!=e&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),o(e.id),setTimeout((()=>{o("")}),1e3)})(e)},"Copy"),t.createElement(r.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:a.arrowRotateCwIcon,onClick:()=>(e=>{c.onPromptRequest&&c.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),E()})(e)},"Retry"),m&&t.createElement(t.Fragment,null,t.createElement("span",{className:"k-spacer"}),t.createElement(r.Button,{size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:a.thumbUpOutlineIcon,onClick:()=>I(e,"positive")}),t.createElement(r.Button,{size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:a.thumbDownOutlineIcon,onClick:()=>I(e,"negative")}))))))),y=t.createElement(i.Card,null,t.createElement(i.CardBody,null,k.toLanguageString(R,D[R])));return t.createElement(_,{name:G.name},t.createElement($,{ref:l,streaming:c.streaming,onCancel:c.onCancel},t.createElement("div",{className:"k-card-list"},c.loading&&v,C,(!C||0===C.length)&&!c.loading&&y)))},e.AIPromptView=e=>{const{promptInput:n=l.TextArea,generateButton:o=r.Button,enableSpeechToText:i=!1,promptValue:c,promptSuggestions:p}=e,[m,u]=t.useState(c||""),[d]=U(),[h,g]=s.useCustomComponent(o),[k,I]=s.useCustomComponent(n),E={title:"Generate",children:"Generate",svgIcon:a.sparklesIcon},v=Object.keys(g).length>0?g:E,C=Object.keys(I).length>0?I:{placeholder:"Ask or generate content with AI ...",rows:2},y=e=>{const{isFinal:t,alternatives:s}=e;if(t&&s.length>0){const e=s[0].transcript,t=(()=>{const t=m,s=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(s?" ":"")+e})();u(t)}};let f;return i&&(f="object"==typeof i?{...i,onResult:i.onResult||y}:{onResult:y}),t.createElement(_,{name:W.name},t.createElement($,{streaming:d.streaming,onCancel:d.onCancel},t.createElement(k,{value:m,className:"!k-flex-col",suffix:i?t.createElement(l.InputSuffix,{orientation:"horizontal"},t.createElement(r.SpeechToTextButton,{fillMode:"flat",...f})):void 0,onChange:e=>{u(e.target.value)},...C}),p&&p.length>0&&t.createElement(Y,{id:"prompt-suggestions",title:"Prompt Suggestions"},t.createElement(K,{suggestions:p.map(((e,t)=>({id:t,text:e,description:e}))),onSuggestionClick:(e,t)=>{(e=>{u(e)})(t.text)}}))),t.createElement(H,null,t.createElement(h,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:()=>{d.onPromptRequest&&d.onPromptRequest.call(null,m),u("")},disabled:!m.trim(),...v},v.children)))},e.AIPromptViewRender=_,e.Chat=F,e.ChatMessage=h,e.HeroCard=O,e.InlineAIPrompt=e=>{const n=!s.validatePackage(V,{component:"InlineAIPrompt"}),{outputs:o=[],outputCard:c,promptInput:p=l.TextArea,generateButton:m=r.Button,promptPlaceholder:u="Ask or generate content with AI...",promptValue:d,onPromptRequest:h,onCopy:g,onDiscard:k,outputActions:I,onOutputAction:E,enableSpeechToText:v=!1,streaming:C,onPromptCancel:y,show:f=!1,anchor:b,width:x,height:w,onOpen:N,onClose:T,animate:S=!0,appendTo:R,commands:B,onCommandExecute:D,style:L,className:A,popupOptions:M={},...P}=e,[F,K]=t.useState(""),[O,q]=t.useState(!1),[G,z]=t.useState({left:0,top:0}),W=t.useRef(null),{body:j,actions:U}=c||{},H=I||[{id:"copy",text:"Copy",svgIcon:a.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:a.cancelOutlineIcon,themeColor:"base",title:"Discard"}],_=(e,t)=>{switch(e.id){case"copy":(e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),K(e.id),setTimeout((()=>K("")),1e3)),null==g||g(e)})(t);break;case"discard":(e=>{null==k||k(e)})(t);break;default:null==E||E(e,t)}},Y=t.useCallback((e=>{"Escape"===e.key&&(C&&y?y():!C&&T&&T({target:null}))}),[C,y,T]),J={...L,...x&&{width:x},...w&&{height:w}},Z={...x&&{width:x},...w&&{height:w}},ee=t.createElement(t.Fragment,null,t.createElement("div",{className:s.classNames("k-prompt",A),style:J,onKeyDown:Y,...P},t.createElement($,{ref:W},o&&o.length>0&&t.createElement("div",{className:"k-card-list"},o.map(((e,s)=>t.createElement(i.Card,{key:`${e.id}_${s}`},t.createElement(i.CardBody,null,j?j(e):e.responseContent),t.createElement(i.CardActions,null,U?U(e):t.createElement(t.Fragment,null,H.map((s=>{var n;return s.spacer?t.createElement("span",{key:s.id,className:"k-spacer"}):t.createElement(r.Button,{key:s.id,size:"medium",themeColor:s.themeColor||"primary",fillMode:"flat",rounded:"medium",title:null!=(n=s.title)?n:s.text,svgIcon:"copy"===s.id&&F===e.id?a.checkIcon:s.svgIcon,onClick:()=>_(s,e)},s.text)})))))))),t.createElement(X,{promptValue:d,placeholder:u,onPromptRequest:h,onMenuClick:e=>{if(!W.current)return;const t=W.current.getBoundingClientRect();z({left:t.left,top:t.bottom}),q(!0)},onPromptCancel:y,promptInput:p,generateButton:m,enableSpeechToText:v,streaming:C,commands:B}))),n&&t.createElement(s.WatermarkOverlay,null));return t.createElement(t.Fragment,null,t.createElement(Q,{show:f,anchor:b,onOpen:N,onClose:T,animate:S,appendTo:R,popupOptions:M,style:Z},ee),t.createElement(i.ContextMenu,{show:O,offset:G,onClose:()=>{q(!1)},items:(e=>null==e?void 0:e.map((e=>({text:e.text,svgIcon:e.svgIcon,data:e,items:e.children?e.children.map((e=>({text:e.text,data:e}))):void 0}))))(B),onSelect:e=>{var t,s;const n=null==(t=e.item)?void 0:t.data;n&&(null==(s=n.children)||!s.length)&&(e=>{q(!1),D&&D(e)})(n)}}))},e.PromptHeader=q,e.SuggestionGroup=K,e.commandsViewDefaults=z,e.outputViewDefaults=G,e.promptViewDefaults=W}));
|
package/index.d.mts
CHANGED
|
@@ -492,6 +492,7 @@ export declare class Chat extends React_2.Component<ChatProps, ChatState> {
|
|
|
492
492
|
private isDirectionRightToLeft;
|
|
493
493
|
private scrollToBottomOnLoadingData;
|
|
494
494
|
private readonly showLicenseWatermark;
|
|
495
|
+
private readonly licenseMessage?;
|
|
495
496
|
constructor(props: ChatProps);
|
|
496
497
|
/**
|
|
497
498
|
* @hidden
|
|
@@ -1082,6 +1083,11 @@ export declare interface OutputActionInterface {
|
|
|
1082
1083
|
* The title attribute for the button (tooltip)
|
|
1083
1084
|
*/
|
|
1084
1085
|
title?: string;
|
|
1086
|
+
/**
|
|
1087
|
+
* If set to true, adds a spacer in the action commands section.
|
|
1088
|
+
* Useful for visually separating groups of actions.
|
|
1089
|
+
*/
|
|
1090
|
+
spacer?: boolean;
|
|
1085
1091
|
}
|
|
1086
1092
|
|
|
1087
1093
|
/**
|
package/index.d.ts
CHANGED
|
@@ -492,6 +492,7 @@ export declare class Chat extends React_2.Component<ChatProps, ChatState> {
|
|
|
492
492
|
private isDirectionRightToLeft;
|
|
493
493
|
private scrollToBottomOnLoadingData;
|
|
494
494
|
private readonly showLicenseWatermark;
|
|
495
|
+
private readonly licenseMessage?;
|
|
495
496
|
constructor(props: ChatProps);
|
|
496
497
|
/**
|
|
497
498
|
* @hidden
|
|
@@ -1082,6 +1083,11 @@ export declare interface OutputActionInterface {
|
|
|
1082
1083
|
* The title attribute for the button (tooltip)
|
|
1083
1084
|
*/
|
|
1084
1085
|
title?: string;
|
|
1086
|
+
/**
|
|
1087
|
+
* If set to true, adds a spacer in the action commands section.
|
|
1088
|
+
* Useful for visually separating groups of actions.
|
|
1089
|
+
*/
|
|
1090
|
+
spacer?: boolean;
|
|
1085
1091
|
}
|
|
1086
1092
|
|
|
1087
1093
|
/**
|
|
@@ -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 t=require("react"),m=require("@progress/kendo-react-layout"),x=require("@progress/kendo-react-buttons"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),m=require("@progress/kendo-react-layout"),x=require("@progress/kendo-react-buttons"),le=require("@progress/kendo-react-inputs"),f=require("@progress/kendo-svg-icons"),k=require("@progress/kendo-react-common"),ce=require("../package-metadata.js"),ie=require("./InlineAIPromptPopup.js"),me=require("./InlineAIPromptInput.js"),de=require("../ai-prompt/AIPromptContent.js"),pe=M=>{const b=!k.validatePackage(ce.packageMetadata,{component:"InlineAIPrompt"}),{outputs:d=[],outputCard:S,promptInput:q=le.TextArea,generateButton:w=x.Button,promptPlaceholder:O="Ask or generate content with AI...",promptValue:R,onPromptRequest:A,onCopy:p,onDiscard:u,outputActions:T,onOutputAction:C,enableSpeechToText:B=!1,streaming:r,onPromptCancel:s,show:D=!1,anchor:N,width:l,height:c,onOpen:F,onClose:i,animate:K=!0,appendTo:W,commands:g,onCommandExecute:y,style:$,className:j,popupOptions:z={},...V}=M,[_,E]=t.useState(""),[G,I]=t.useState(!1),[H,J]=t.useState({left:0,top:0}),h=t.useRef(null),{body:v,actions:P}=S||{},Q=[{id:"copy",text:"Copy",svgIcon:f.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:f.cancelOutlineIcon,themeColor:"base",title:"Discard"}],U=T||Q,X=e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),E(e.id),setTimeout(()=>E(""),1e3)),p==null||p(e)},Y=e=>{u==null||u(e)},Z=(e,n)=>{switch(e.id){case"copy":X(n);break;case"discard":Y(n);break;default:C==null||C(e,n);break}},L=e=>{if(!h.current)return;const n=h.current.getBoundingClientRect();J({left:n.left,top:n.bottom}),I(!0)},ee=()=>{I(!1)},te=e=>{I(!1),y&&y(e)},ne=e=>e==null?void 0:e.map(n=>({text:n.text,svgIcon:n.svgIcon,data:n,items:n.children?n.children.map(a=>({text:a.text,data:a})):void 0})),ae=t.useCallback(e=>{e.key==="Escape"&&(r&&s?s():!r&&i&&i({target:null}))},[r,s,i]),oe={...$,...l&&{width:l},...c&&{height:c}},re={...l&&{width:l},...c&&{height:c}},se=t.createElement(t.Fragment,null,t.createElement("div",{className:k.classNames("k-prompt",j),style:oe,onKeyDown:ae,...V},t.createElement(de.AIPromptContent,{ref:h},d&&d.length>0&&t.createElement("div",{className:"k-card-list"},d.map((e,n)=>t.createElement(m.Card,{key:`${e.id}_${n}`},t.createElement(m.CardBody,null,v?v(e):e.responseContent),t.createElement(m.CardActions,null,P?P(e):t.createElement(t.Fragment,null,U.map(a=>{var o;return a.spacer?t.createElement("span",{key:a.id,className:"k-spacer"}):t.createElement(x.Button,{key:a.id,size:"medium",themeColor:a.themeColor||"primary",fillMode:"flat",rounded:"medium",title:(o=a.title)!=null?o:a.text,svgIcon:a.id==="copy"&&_===e.id?f.checkIcon:a.svgIcon,onClick:()=>Z(a,e)},a.text)})))))),t.createElement(me.InlineAIPromptInput,{promptValue:R,placeholder:O,onPromptRequest:A,onMenuClick:L,onPromptCancel:s,promptInput:q,generateButton:w,enableSpeechToText:B,streaming:r,commands:g}))),b&&t.createElement(k.WatermarkOverlay,null));return t.createElement(t.Fragment,null,t.createElement(ie.InlineAIPromptPopup,{show:D,anchor:N,onOpen:F,onClose:i,animate:K,appendTo:W,popupOptions:z,style:re},se),t.createElement(m.ContextMenu,{show:G,offset:H,onClose:ee,items:ne(g),onSelect:e=>{var a,o;const n=(a=e.item)==null?void 0:a.data;n&&!((o=n.children)!=null&&o.length)&&te(n)}}))};exports.InlineAIPrompt=pe;
|
|
@@ -6,64 +6,65 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import t from "react";
|
|
9
|
-
import { Card as
|
|
10
|
-
import { Button as
|
|
9
|
+
import { Card as oe, CardBody as ae, CardActions as re, ContextMenu as le } from "@progress/kendo-react-layout";
|
|
10
|
+
import { Button as E } from "@progress/kendo-react-buttons";
|
|
11
11
|
import { TextArea as se } from "@progress/kendo-react-inputs";
|
|
12
|
-
import { checkIcon as
|
|
13
|
-
import { classNames as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
import { checkIcon as ce, copyIcon as me, cancelOutlineIcon as ie } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { validatePackage as de, classNames as pe, WatermarkOverlay as fe } from "@progress/kendo-react-common";
|
|
14
|
+
import { packageMetadata as Ce } from "../package-metadata.mjs";
|
|
15
|
+
import { InlineAIPromptPopup as he } from "./InlineAIPromptPopup.mjs";
|
|
16
|
+
import { InlineAIPromptInput as ue } from "./InlineAIPromptInput.mjs";
|
|
17
|
+
import { AIPromptContent as ke } from "../ai-prompt/AIPromptContent.mjs";
|
|
18
|
+
const Se = (x) => {
|
|
19
|
+
const v = !de(Ce, { component: "InlineAIPrompt" }), {
|
|
19
20
|
outputs: i = [],
|
|
20
|
-
outputCard:
|
|
21
|
+
outputCard: M,
|
|
21
22
|
promptInput: b = se,
|
|
22
|
-
generateButton:
|
|
23
|
-
promptPlaceholder:
|
|
24
|
-
promptValue:
|
|
23
|
+
generateButton: w = E,
|
|
24
|
+
promptPlaceholder: O = "Ask or generate content with AI...",
|
|
25
|
+
promptValue: P,
|
|
25
26
|
onPromptRequest: S,
|
|
26
27
|
onCopy: d,
|
|
27
28
|
onDiscard: p,
|
|
28
|
-
outputActions:
|
|
29
|
+
outputActions: T,
|
|
29
30
|
onOutputAction: f,
|
|
30
|
-
enableSpeechToText:
|
|
31
|
-
streaming:
|
|
32
|
-
onPromptCancel:
|
|
33
|
-
show:
|
|
34
|
-
anchor:
|
|
35
|
-
width:
|
|
31
|
+
enableSpeechToText: A = !1,
|
|
32
|
+
streaming: r,
|
|
33
|
+
onPromptCancel: l,
|
|
34
|
+
show: B = !1,
|
|
35
|
+
anchor: D,
|
|
36
|
+
width: s,
|
|
36
37
|
height: c,
|
|
37
|
-
onOpen:
|
|
38
|
+
onOpen: N,
|
|
38
39
|
onClose: m,
|
|
39
40
|
animate: R = !0,
|
|
40
|
-
appendTo:
|
|
41
|
+
appendTo: F,
|
|
41
42
|
commands: u,
|
|
42
|
-
onCommandExecute:
|
|
43
|
+
onCommandExecute: k,
|
|
43
44
|
style: _,
|
|
44
|
-
className:
|
|
45
|
-
popupOptions:
|
|
45
|
+
className: K,
|
|
46
|
+
popupOptions: W = {},
|
|
46
47
|
...$
|
|
47
|
-
} =
|
|
48
|
+
} = x, [q, y] = t.useState(""), [z, C] = t.useState(!1), [V, j] = t.useState({
|
|
48
49
|
left: 0,
|
|
49
50
|
top: 0
|
|
50
|
-
}), h = t.useRef(null), { body:
|
|
51
|
+
}), h = t.useRef(null), { body: I, actions: g } = M || {}, G = T || [
|
|
51
52
|
{
|
|
52
53
|
id: "copy",
|
|
53
54
|
text: "Copy",
|
|
54
|
-
svgIcon:
|
|
55
|
+
svgIcon: me,
|
|
55
56
|
themeColor: "primary",
|
|
56
57
|
title: "Copy"
|
|
57
58
|
},
|
|
58
59
|
{
|
|
59
60
|
id: "discard",
|
|
60
61
|
text: "Discard",
|
|
61
|
-
svgIcon:
|
|
62
|
+
svgIcon: ie,
|
|
62
63
|
themeColor: "base",
|
|
63
64
|
title: "Discard"
|
|
64
65
|
}
|
|
65
66
|
], H = (e) => {
|
|
66
|
-
e.responseContent && (navigator.clipboard.writeText(e.responseContent),
|
|
67
|
+
e.responseContent && (navigator.clipboard.writeText(e.responseContent), y(e.id), setTimeout(() => y(""), 1e3)), d == null || d(e);
|
|
67
68
|
}, J = (e) => {
|
|
68
69
|
p == null || p(e);
|
|
69
70
|
}, Q = (e, n) => {
|
|
@@ -86,11 +87,11 @@ const be = (E) => {
|
|
|
86
87
|
left: n.left,
|
|
87
88
|
top: n.bottom
|
|
88
89
|
}), C(!0);
|
|
89
|
-
},
|
|
90
|
+
}, X = () => {
|
|
90
91
|
C(!1);
|
|
91
|
-
},
|
|
92
|
-
C(!1),
|
|
93
|
-
},
|
|
92
|
+
}, Y = (e) => {
|
|
93
|
+
C(!1), k && k(e);
|
|
94
|
+
}, Z = (e) => e == null ? void 0 : e.map((n) => ({
|
|
94
95
|
text: n.text,
|
|
95
96
|
svgIcon: n.svgIcon,
|
|
96
97
|
data: n,
|
|
@@ -98,77 +99,88 @@ const be = (E) => {
|
|
|
98
99
|
text: o.text,
|
|
99
100
|
data: o
|
|
100
101
|
})) : void 0
|
|
101
|
-
})),
|
|
102
|
+
})), L = t.useCallback(
|
|
102
103
|
(e) => {
|
|
103
|
-
e.key === "Escape" && (
|
|
104
|
+
e.key === "Escape" && (r && l ? l() : !r && m && m({ target: null }));
|
|
104
105
|
},
|
|
105
|
-
[
|
|
106
|
-
),
|
|
106
|
+
[r, l, m]
|
|
107
|
+
), ee = {
|
|
107
108
|
..._,
|
|
108
|
-
...
|
|
109
|
+
...s && { width: s },
|
|
109
110
|
...c && { height: c }
|
|
110
|
-
},
|
|
111
|
-
...
|
|
111
|
+
}, te = {
|
|
112
|
+
...s && { width: s },
|
|
112
113
|
...c && { height: c }
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
return /* @__PURE__ */ t.createElement(
|
|
116
|
-
x,
|
|
117
|
-
{
|
|
118
|
-
key: o.id,
|
|
119
|
-
size: "medium",
|
|
120
|
-
themeColor: o.themeColor || "primary",
|
|
121
|
-
fillMode: "flat",
|
|
122
|
-
rounded: "medium",
|
|
123
|
-
title: (r = o.title) != null ? r : o.text,
|
|
124
|
-
svgIcon: o.id === "copy" && q === e.id ? le : o.svgIcon,
|
|
125
|
-
onClick: () => Q(o, e)
|
|
126
|
-
},
|
|
127
|
-
o.text
|
|
128
|
-
);
|
|
129
|
-
})))))), /* @__PURE__ */ t.createElement(
|
|
130
|
-
pe,
|
|
114
|
+
}, ne = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
115
|
+
"div",
|
|
131
116
|
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
117
|
+
className: pe("k-prompt", K),
|
|
118
|
+
style: ee,
|
|
119
|
+
onKeyDown: L,
|
|
120
|
+
...$
|
|
121
|
+
},
|
|
122
|
+
/* @__PURE__ */ t.createElement(ke, { ref: h }, i && i.length > 0 && /* @__PURE__ */ t.createElement("div", { className: "k-card-list" }, i.map((e, n) => /* @__PURE__ */ t.createElement(oe, { key: `${e.id}_${n}` }, /* @__PURE__ */ t.createElement(ae, null, I ? I(e) : e.responseContent), /* @__PURE__ */ t.createElement(re, null, g ? g(e) : /* @__PURE__ */ t.createElement(t.Fragment, null, G.map(
|
|
123
|
+
(o) => {
|
|
124
|
+
var a;
|
|
125
|
+
return o.spacer ? /* @__PURE__ */ t.createElement("span", { key: o.id, className: "k-spacer" }) : /* @__PURE__ */ t.createElement(
|
|
126
|
+
E,
|
|
127
|
+
{
|
|
128
|
+
key: o.id,
|
|
129
|
+
size: "medium",
|
|
130
|
+
themeColor: o.themeColor || "primary",
|
|
131
|
+
fillMode: "flat",
|
|
132
|
+
rounded: "medium",
|
|
133
|
+
title: (a = o.title) != null ? a : o.text,
|
|
134
|
+
svgIcon: o.id === "copy" && q === e.id ? ce : o.svgIcon,
|
|
135
|
+
onClick: () => Q(o, e)
|
|
136
|
+
},
|
|
137
|
+
o.text
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
)))))), /* @__PURE__ */ t.createElement(
|
|
141
|
+
ue,
|
|
142
|
+
{
|
|
143
|
+
promptValue: P,
|
|
144
|
+
placeholder: O,
|
|
145
|
+
onPromptRequest: S,
|
|
146
|
+
onMenuClick: U,
|
|
147
|
+
onPromptCancel: l,
|
|
148
|
+
promptInput: b,
|
|
149
|
+
generateButton: w,
|
|
150
|
+
enableSpeechToText: A,
|
|
151
|
+
streaming: r,
|
|
152
|
+
commands: u
|
|
153
|
+
}
|
|
154
|
+
))
|
|
155
|
+
), v && /* @__PURE__ */ t.createElement(fe, null));
|
|
144
156
|
return /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
145
|
-
|
|
157
|
+
he,
|
|
146
158
|
{
|
|
147
|
-
show:
|
|
148
|
-
anchor:
|
|
149
|
-
onOpen:
|
|
159
|
+
show: B,
|
|
160
|
+
anchor: D,
|
|
161
|
+
onOpen: N,
|
|
150
162
|
onClose: m,
|
|
151
163
|
animate: R,
|
|
152
|
-
appendTo:
|
|
153
|
-
popupOptions:
|
|
154
|
-
style:
|
|
164
|
+
appendTo: F,
|
|
165
|
+
popupOptions: W,
|
|
166
|
+
style: te
|
|
155
167
|
},
|
|
156
|
-
|
|
168
|
+
ne
|
|
157
169
|
), /* @__PURE__ */ t.createElement(
|
|
158
|
-
|
|
170
|
+
le,
|
|
159
171
|
{
|
|
160
172
|
show: z,
|
|
161
173
|
offset: V,
|
|
162
|
-
onClose:
|
|
163
|
-
items:
|
|
174
|
+
onClose: X,
|
|
175
|
+
items: Z(u),
|
|
164
176
|
onSelect: (e) => {
|
|
165
|
-
var o,
|
|
177
|
+
var o, a;
|
|
166
178
|
const n = (o = e.item) == null ? void 0 : o.data;
|
|
167
|
-
n && !((
|
|
179
|
+
n && !((a = n.children) != null && a.length) && Y(n);
|
|
168
180
|
}
|
|
169
181
|
}
|
|
170
182
|
));
|
|
171
183
|
};
|
|
172
184
|
export {
|
|
173
|
-
|
|
185
|
+
Se as InlineAIPrompt
|
|
174
186
|
};
|
package/package-metadata.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 e={name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1754642750,version:"11.4.0-develop.8",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "KendoReact",
|
|
11
11
|
productCode: "KENDOUIREACT",
|
|
12
12
|
productCodes: ["KENDOUIREACT"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "11.4.0-develop.
|
|
13
|
+
publishDate: 1754642750,
|
|
14
|
+
version: "11.4.0-develop.8",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-conversational-ui",
|
|
3
|
-
"version": "11.4.0-develop.
|
|
3
|
+
"version": "11.4.0-develop.8",
|
|
4
4
|
"description": "React Chat component allows the user to participate in chat sessions with users or chat bots. KendoReact Conversational UI components",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@progress/kendo-licensing": "^1.
|
|
29
|
-
"@progress/kendo-react-buttons": "11.4.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "11.4.0-develop.
|
|
31
|
-
"@progress/kendo-react-intl": "11.4.0-develop.
|
|
32
|
-
"@progress/kendo-react-inputs": "11.4.0-develop.
|
|
33
|
-
"@progress/kendo-react-layout": "11.4.0-develop.
|
|
28
|
+
"@progress/kendo-licensing": "^1.7.0",
|
|
29
|
+
"@progress/kendo-react-buttons": "11.4.0-develop.8",
|
|
30
|
+
"@progress/kendo-react-common": "11.4.0-develop.8",
|
|
31
|
+
"@progress/kendo-react-intl": "11.4.0-develop.8",
|
|
32
|
+
"@progress/kendo-react-inputs": "11.4.0-develop.8",
|
|
33
|
+
"@progress/kendo-react-layout": "11.4.0-develop.8",
|
|
34
34
|
"@progress/kendo-svg-icons": "^4.0.0",
|
|
35
35
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
|
|
36
36
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"package": {
|
|
60
60
|
"productName": "KendoReact",
|
|
61
61
|
"productCode": "KENDOUIREACT",
|
|
62
|
-
"publishDate":
|
|
62
|
+
"publishDate": 1754642750,
|
|
63
63
|
"licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
64
64
|
}
|
|
65
65
|
},
|