@progress/kendo-react-conversational-ui 15.2.0-develop.1 → 15.2.0-develop.3
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/chat/components/ChatMessage.js +1 -1
- package/chat/components/ChatMessage.mjs +1 -1
- package/chat/components/ScrollButtonsWrapper.js +1 -1
- package/chat/components/ScrollButtonsWrapper.mjs +6 -6
- package/chat/components/elements/FileBox.js +1 -1
- package/chat/components/elements/FileBox.mjs +62 -29
- package/chat/components/elements/PinnedMessage.js +1 -1
- package/chat/components/elements/PinnedMessage.mjs +20 -18
- package/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +34 -24
- package/llm-kit/AgentStep.d.ts +14 -0
- package/llm-kit/AgentStep.js +8 -0
- package/llm-kit/AgentStep.mjs +100 -0
- package/llm-kit/ChainOfThought.d.ts +10 -0
- package/llm-kit/ChainOfThought.js +8 -0
- package/llm-kit/ChainOfThought.mjs +67 -0
- package/llm-kit/Checkpoint.d.ts +10 -0
- package/llm-kit/Checkpoint.js +8 -0
- package/llm-kit/Checkpoint.mjs +45 -0
- package/llm-kit/Citation.d.ts +14 -0
- package/llm-kit/Citation.js +8 -0
- package/llm-kit/Citation.mjs +171 -0
- package/llm-kit/Events.d.ts +69 -0
- package/llm-kit/Reasoning.d.ts +10 -0
- package/llm-kit/Reasoning.js +8 -0
- package/llm-kit/Reasoning.mjs +48 -0
- package/llm-kit/Thought.d.ts +16 -0
- package/llm-kit/Thought.js +8 -0
- package/llm-kit/Thought.mjs +47 -0
- package/llm-kit/ToolCall.d.ts +10 -0
- package/llm-kit/ToolCall.js +8 -0
- package/llm-kit/ToolCall.mjs +100 -0
- package/llm-kit/defaults/DefaultCitationBody.d.ts +11 -0
- package/llm-kit/defaults/DefaultCitationBody.js +8 -0
- package/llm-kit/defaults/DefaultCitationBody.mjs +27 -0
- package/llm-kit/defaults/DefaultToolError.d.ts +11 -0
- package/llm-kit/defaults/DefaultToolError.js +8 -0
- package/llm-kit/defaults/DefaultToolError.mjs +12 -0
- package/llm-kit/defaults/DefaultToolInput.d.ts +11 -0
- package/llm-kit/defaults/DefaultToolInput.js +8 -0
- package/llm-kit/defaults/DefaultToolInput.mjs +13 -0
- package/llm-kit/defaults/DefaultToolOutput.d.ts +11 -0
- package/llm-kit/defaults/DefaultToolOutput.js +8 -0
- package/llm-kit/defaults/DefaultToolOutput.mjs +13 -0
- package/llm-kit/index.d.ts +32 -0
- package/llm-kit/interfaces/AgentStepBodyTemplateProps.d.ts +26 -0
- package/llm-kit/interfaces/AgentStepHeaderTemplateProps.d.ts +40 -0
- package/llm-kit/interfaces/AgentStepProps.d.ts +123 -0
- package/llm-kit/interfaces/ChainOfThoughtProps.d.ts +102 -0
- package/llm-kit/interfaces/CheckpointProps.d.ts +48 -0
- package/llm-kit/interfaces/CheckpointState.d.ts +20 -0
- package/llm-kit/interfaces/CheckpointTemplateProps.d.ts +19 -0
- package/llm-kit/interfaces/CitationBodyTemplateProps.d.ts +18 -0
- package/llm-kit/interfaces/CitationProps.d.ts +81 -0
- package/llm-kit/interfaces/CitationShowOn.d.ts +13 -0
- package/llm-kit/interfaces/CitationSource.d.ts +26 -0
- package/llm-kit/interfaces/ReasoningContentTemplateProps.d.ts +18 -0
- package/llm-kit/interfaces/ReasoningProps.d.ts +90 -0
- package/llm-kit/interfaces/Thought.d.ts +55 -0
- package/llm-kit/interfaces/ThoughtProps.d.ts +82 -0
- package/llm-kit/interfaces/ThoughtTemplateProps.d.ts +19 -0
- package/llm-kit/interfaces/ToolCallActionType.d.ts +14 -0
- package/llm-kit/interfaces/ToolCallApprovalTemplateProps.d.ts +20 -0
- package/llm-kit/interfaces/ToolCallErrorTemplateProps.d.ts +16 -0
- package/llm-kit/interfaces/ToolCallParamsTemplateProps.d.ts +16 -0
- package/llm-kit/interfaces/ToolCallProps.d.ts +119 -0
- package/llm-kit/interfaces/ToolCallResultTemplateProps.d.ts +16 -0
- package/llm-kit/interfaces/ToolCallState.d.ts +16 -0
- package/llm-kit/utils.d.ts +12 -0
- package/llm-kit/utils.js +8 -0
- package/llm-kit/utils.mjs +11 -0
- package/messages/index.d.ts +75 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +86 -56
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -11
- package/prompt-box/FileBox.js +1 -1
- package/prompt-box/FileBox.mjs +52 -38
- package/prompt-box/PromptBox.js +1 -1
- package/prompt-box/PromptBox.mjs +1 -1
|
@@ -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 ye=require("react"),g=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-buttons"),f=require("@progress/kendo-svg-icons"),ne=require("@progress/kendo-react-layout"),c=require("../utils.js"),Ee=require("./ChatContext.js"),xe=require("./elements/FileBox.js"),le=require("@progress/kendo-react-intl"),l=require("../../messages/index.js");function Ie(i){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(r,e,u.get?u:{enumerable:!0,get:()=>i[e]})}}return r.default=i,Object.freeze(r)}const a=Ie(ye),oe=a.forwardRef((i,r)=>{const{item:e,template:u,contentTemplate:D,onRequestSelection:C,tabIndex:ce=-1,dateFormat:H="g",selected:d,allowMessageCollapse:y,messageToolbarActions:E,messageContextMenuActions:x,fileActions:U,isSender:I}=i,{setReplyToMessage:M,messages:X,repliedToMessages:A,user:b,onToolbarAction:F,onContextMenuAction:R,onFileAction:Y,onDownload:m,onResendMessage:L,setShowCopyNotification:w,statusTemplate:q,timestampVisibility:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ye=require("react"),g=require("@progress/kendo-react-common"),S=require("@progress/kendo-react-buttons"),f=require("@progress/kendo-svg-icons"),ne=require("@progress/kendo-react-layout"),c=require("../utils.js"),Ee=require("./ChatContext.js"),xe=require("./elements/FileBox.js"),le=require("@progress/kendo-react-intl"),l=require("../../messages/index.js");function Ie(i){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(r,e,u.get?u:{enumerable:!0,get:()=>i[e]})}}return r.default=i,Object.freeze(r)}const a=Ie(ye),oe=a.forwardRef((i,r)=>{const{item:e,template:u,contentTemplate:D,onRequestSelection:C,tabIndex:ce=-1,dateFormat:H="g",selected:d,allowMessageCollapse:y,messageToolbarActions:E,messageContextMenuActions:x,fileActions:U,isSender:I}=i,{setReplyToMessage:M,messages:X,repliedToMessages:A,user:b,onToolbarAction:F,onContextMenuAction:R,onFileAction:Y,onDownload:m,onResendMessage:L,setShowCopyNotification:w,statusTemplate:q,timestampVisibility:O="onFocus",onReferencedMessageClick:T}=Ee.useChatContext(),[G,V]=a.useState(!1),[J,z]=a.useState(!1),[h,re]=a.useState(!0),[ie,Q]=a.useState(!1),o=le.useLocalization(),Z=le.useInternationalization(),$=a.useRef({left:0,top:0}),v=a.useCallback(()=>{e!=null&&e.text&&c.copyToClipboard(e.text),w&&(w(!0),setTimeout(()=>{w(!1)},3e3))},[e,w]),j=a.useCallback(t=>{t.stopPropagation(),re(s=>!s)},[]),ue=a.useCallback(()=>{Q(!1)},[]),de=a.useCallback(t=>{(t.key==="Tab"||t.key==="Enter"||t.key===" "||t.key==="ArrowUp"||t.key==="ArrowDown")&&Q(!0)},[]),B=a.useRef(null);a.useEffect(()=>{d&&B.current&&B.current.focus()},[d]);const P=a.useCallback(t=>{$.current={left:t.pageX,top:t.pageY},t.preventDefault(),z(!0),V(!0)},[]),ee=a.useCallback(()=>{z(!1),V(!1)},[]),N=a.useCallback((t,s)=>t.isDeleted?c.getDeletedMessageText(s,o):t.text?t.text:"",[o]),te=a.useCallback(t=>{var s;(s=t.item)!=null&&s.text&&(t.item.data.id==="copy"&&!e.isDeleted?v():t.item.data.id==="reply"&&M(e),R&&R(t.item.data,t,e)),z(!1),V(!1)},[e,R,M,v]),ae=a.useCallback(()=>{if(e.replyToId){const t=c.getMessageById(X,e.replyToId)||(A?c.getMessageById(A,e.replyToId):void 0);if(t){const s=n=>{n.preventDefault(),n.stopPropagation(),T==null||T(t.id)};return a.createElement("div",{className:g.classNames("k-message-reference",c.isAuthor(b,t)?"k-message-reference-sender":"k-message-reference-receiver"),onClick:s},a.createElement("div",{className:"k-message-reference-content"},c.convertTextToLinkedContent(N(t,c.isAuthor(b,t)))))}}return null},[e.replyToId,X,A,b,N,T]),K=a.useCallback(()=>{const t=[{id:"reply",label:"Reply",svgIcon:f.undoIcon},{id:"copy",label:"Copy",svgIcon:f.copyIcon}],s=x?[...t.map(n=>x.find(k=>k.id===n.id)||n),...x.filter(n=>!t.some(p=>p.id===n.id))]:t;return a.createElement(ne.ContextMenu,{onSelect:te,onClose:ee,vertical:!0,show:G,offset:$.current},s.map(n=>n.id==="delete"&&!I?null:a.createElement(ne.MenuItem,{key:n.id,text:n.label,icon:n.icon,svgIcon:n.svgIcon,data:n})))},[x,te,ee,G,I]),se=a.useCallback(()=>e.files&&e.files.length>1?a.createElement("div",{className:"k-chat-download-button-wrapper"},a.createElement(S.Button,{className:"k-chat-download-button",fillMode:"flat",svgIcon:f.downloadIcon,size:"small",onClick:t=>{t.stopPropagation(),m&&m(e.files,e)},"aria-label":o.toLanguageString(l.downloadAllFiles,l.messages[l.downloadAllFiles])},a.createElement("span",{className:"k-button-text"},o.toLanguageString(l.downloadAll,l.messages[l.downloadAll])))):null,[e,m,o]),me=a.useCallback(()=>{if(e.typing)return a.createElement("div",{className:"k-chat-bubble k-bubble"},a.createElement("div",{className:"k-bubble-content"},a.createElement("div",{className:"k-typing-indicator"},a.createElement("span",null),a.createElement("span",null),a.createElement("span",null))));if(u){const t=u;return a.createElement(a.Fragment,null,a.createElement(t,{item:e}),K())}else if(e.text||e.files&&e.files.length>0)return a.createElement(a.Fragment,null,a.createElement("div",{className:g.classNames("k-chat-bubble","k-bubble",{"k-bubble-expandable":y,"k-expanded":y&&h,"k-selected":d,"k-active":J}),onClick:()=>C(d?void 0:e.selectionIndex),onContextMenu:P},a.createElement("div",{className:"k-bubble-content"},D?a.createElement(D,{item:e}):a.createElement(a.Fragment,null,(e.text||e.isDeleted||e.replyToId)&&a.createElement("span",{className:"k-chat-bubble-text"},!e.isDeleted&&ae(),c.convertTextToLinkedContent(N(e,c.isAuthor(b,e)))),e.files&&e.files.length>0&&a.createElement(xe,{files:e.files,message:e,onFileAction:Y,onDownload:t=>m==null?void 0:m(t,e),renderInTextarea:!1,fileActions:U}),se())),y&&a.createElement("span",{className:"k-bubble-expandable-indicator",onClick:j,role:"button","aria-label":h?o.toLanguageString(l.collapseMessage,l.messages[l.collapseMessage]):o.toLanguageString(l.expandMessage,l.messages[l.expandMessage]),tabIndex:0,onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),j(t))}},a.createElement(g.IconWrap,{icon:h?f.chevronUpIcon:f.chevronDownIcon}))),K());return null},[e,u,D,y,h,d,J,C,P,ae,N,b,Y,U,se,j,o,K,m]),ge=a.useCallback(()=>{let t=null;return e.timestamp&&(O==="hidden"||(t=a.createElement("time",{className:"k-message-time"},Z.formatDate(e.timestamp,H)))),t},[e.timestamp,H,O,Z]),fe=a.useCallback(()=>{if(!e.status)return null;let t;if(q)t=a.createElement(q,{item:e});else{const s=typeof e.status=="object"&&e.status!==null;let n,p,k;if(s){const _=e.status;n=_.text,p=_.icon,k=_.svgIcon}else n=e.status;let W=null;p?W=a.createElement(g.Icon,{name:p,size:"xsmall"}):k&&(W=a.createElement(g.IconWrap,{icon:k,size:"xsmall"})),t=a.createElement(a.Fragment,null,W,n)}return a.createElement("span",{className:"k-message-status"},t)},[e,q]),pe=a.useCallback(()=>{let t=null;if(e.isFailed){const s=o.toLanguageString(l.messageFailed,l.messages[l.messageFailed]);t=a.createElement("span",{className:"k-message-failed-content"},a.createElement(g.IconWrap,{icon:f.warningTriangleIcon,size:"xsmall"}),a.createElement("span",{className:"k-message-failed-text"},s))}return t},[e,o]),be=a.useCallback(()=>{let t=null;if(e.isFailed){const s=o.toLanguageString(l.retryMessage,l.messages[l.retryMessage]);t=a.createElement(S.Button,{fillMode:"clear",size:"xs",className:"k-resend-button",svgIcon:f.arrowRotateCwIcon,"aria-label":s,title:s,onClick:n=>{n.stopPropagation(),L&&L({message:e,syntheticEvent:n,nativeEvent:n.nativeEvent,target:n.target})}})}return t},[e,o,L]),ke=a.useCallback(()=>g.classNames({"k-focus":d,"k-message-removed":e.isDeleted,"k-message-failed":e.isFailed},"k-message"),[d,e.isDeleted,e.isFailed]),Ce=a.useCallback(()=>E&&E.length>0&&a.createElement(S.Toolbar,{className:"k-chat-message-toolbar",fillMode:"flat",ariaLabel:o.toLanguageString(l.chatMessageToolbar,l.messages[l.chatMessageToolbar])},E.map(t=>t.id==="delete"&&!I?null:a.createElement(S.Button,{key:t.id,fillMode:"flat",className:"k-toolbar-button",icon:t.icon,svgIcon:t.svgIcon,"aria-label":t.label,onClick:s=>{s.stopPropagation(),t.id==="copy"&&!e.isDeleted?v():t.id==="reply"&&M(e),F&&F(t,s,e)},onMouseDown:s=>s.preventDefault()}))),[v,I,e,o,E,F,M]);return a.createElement("div",{key:e.id,"data-message-id":e.id,className:ke(),tabIndex:ce,onMouseDown:ue,onKeyDown:de,onFocus:t=>{ie&&C(e.selectionIndex)},ref:t=>{B.current=t,typeof r=="function"?r(t):r&&(r.current=t)},onContextMenu:u?P:void 0},be(),me(),(e.status||e.timestamp&&O!=="hidden"||e.isFailed)&&a.createElement("div",{className:"k-message-info"},fe(),ge(),pe()),Ce())});oe.displayName="ChatMessage";exports.ChatMessage=oe;
|
|
@@ -202,7 +202,7 @@ const We = t.forwardRef(
|
|
|
202
202
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), L(e));
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
|
-
/* @__PURE__ */ t.createElement(j, { icon: I ? Se : Fe
|
|
205
|
+
/* @__PURE__ */ t.createElement(j, { icon: I ? Se : Fe })
|
|
206
206
|
)
|
|
207
207
|
), K());
|
|
208
208
|
return null;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),b=require("@progress/kendo-react-buttons"),r=require("@progress/kendo-svg-icons"),L=require("@progress/kendo-react-intl"),n=require("../../messages/index.js");function m(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const c=m(v),S=({visible:t,dir:e,canScrollLeft:o,canScrollRight:l,onScrollLeft:d,onScrollRight:p,children:s})=>{const a=L.useLocalization();if(!t)return s;const i=a.toLanguageString(n.scrollLeft,n.messages[n.scrollLeft]),u=a.toLanguageString(n.scrollRight,n.messages[n.scrollRight]),g=e!=="rtl"?i:u,f=e!=="rtl"?u:i;return c.createElement("div",{className:"k-suggestion-scrollwrap"},c.createElement(b.Button,{fillMode:"flat",size:"xs",svgIcon:e==="rtl"?r.chevronRightIcon:r.chevronLeftIcon,onClick:d,disabled:!o,"aria-label":g,title:g}),s,c.createElement(b.Button,{fillMode:"flat",size:"xs",svgIcon:e==="rtl"?r.chevronLeftIcon:r.chevronRightIcon,onClick:p,disabled:!l,"aria-label":f,title:f}))};exports.ScrollButtonsWrapper=S;
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
import * as e from "react";
|
|
9
9
|
import { Button as c } from "@progress/kendo-react-buttons";
|
|
10
10
|
import { chevronRightIcon as i, chevronLeftIcon as m } from "@progress/kendo-svg-icons";
|
|
11
|
-
import { useLocalization as
|
|
11
|
+
import { useLocalization as x } from "@progress/kendo-react-intl";
|
|
12
12
|
import { scrollLeft as g, messages as f, scrollRight as p } from "../../messages/index.mjs";
|
|
13
|
-
const
|
|
13
|
+
const d = ({
|
|
14
14
|
visible: L,
|
|
15
15
|
dir: t,
|
|
16
16
|
canScrollLeft: b,
|
|
@@ -19,7 +19,7 @@ const k = ({
|
|
|
19
19
|
onScrollRight: h,
|
|
20
20
|
children: l
|
|
21
21
|
}) => {
|
|
22
|
-
const o =
|
|
22
|
+
const o = x();
|
|
23
23
|
if (!L)
|
|
24
24
|
return l;
|
|
25
25
|
const r = o.toLanguageString(g, f[g]), a = o.toLanguageString(p, f[p]), s = t !== "rtl" ? r : a, n = t !== "rtl" ? a : r;
|
|
@@ -27,7 +27,7 @@ const k = ({
|
|
|
27
27
|
c,
|
|
28
28
|
{
|
|
29
29
|
fillMode: "flat",
|
|
30
|
-
size: "
|
|
30
|
+
size: "xs",
|
|
31
31
|
svgIcon: t === "rtl" ? i : m,
|
|
32
32
|
onClick: v,
|
|
33
33
|
disabled: !b,
|
|
@@ -38,7 +38,7 @@ const k = ({
|
|
|
38
38
|
c,
|
|
39
39
|
{
|
|
40
40
|
fillMode: "flat",
|
|
41
|
-
size: "
|
|
41
|
+
size: "xs",
|
|
42
42
|
svgIcon: t === "rtl" ? m : i,
|
|
43
43
|
onClick: h,
|
|
44
44
|
disabled: !u,
|
|
@@ -48,5 +48,5 @@ const k = ({
|
|
|
48
48
|
));
|
|
49
49
|
};
|
|
50
50
|
export {
|
|
51
|
-
|
|
51
|
+
d as ScrollButtonsWrapper
|
|
52
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";const
|
|
8
|
+
"use strict";const I=require("react"),m=require("@progress/kendo-react-common"),N=require("@progress/kendo-react-buttons"),E=require("@progress/kendo-svg-icons"),b=require("@progress/kendo-react-intl"),n=require("../../../messages/index.js"),B=require("../ChatContext.js");function C(s){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(i,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}return i.default=s,Object.freeze(i)}const a=C(I),F=s=>{const{files:i,onFileAction:o,onDownload:l,fileActions:x}=s,{messageFilesLayout:u="vertical"}=B.useChatContext(),d=b.useLocalization(),v=[{id:"download",label:"Download",svgIcon:E.downloadIcon}],p=x||v,g=e=>{if(e==null)return"";if(e===0)return"0 B";const t=1024,c=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(2))} ${c[r]}`},f=e=>"."+e.split(".").pop()||"",z=(e,t)=>{var c,r;(r=(c=e.syntheticEvent)==null?void 0:c.stopPropagation)==null||r.call(c),e.item.id==="download"&&(l==null||l([t])),o==null||o(e.item,e,t)},k=e=>p.length>0&&a.createElement(N.DropDownButton,{fillMode:"flat",size:"xs",svgIcon:E.moreVerticalIcon,onClick:t=>{t.syntheticEvent.stopPropagation()},onItemClick:t=>z(t,e),items:p.map(t=>({id:t.id,icon:t.icon,text:t.label,svgIcon:t.svgIcon})),"aria-label":`${d.toLanguageString(n.fileActions,n.messages[n.fileActions])} ${e.name}`,title:`${d.toLanguageString(n.fileActions,n.messages[n.fileActions])} ${e.name}`}),h=a.useCallback(()=>m.classNames({"k-files-wrap":u==="wrap","k-files-vertical":u==="vertical"},"k-file-box-wrapper"),[u]);return a.createElement("ul",{role:"list","aria-label":d.toLanguageString(n.chatMessageAttachedFiles,n.messages[n.chatMessageAttachedFiles]),className:h()},u==="horizontal"?a.createElement("div",{className:"k-files-scroll",role:"presentation"},i.map(e=>a.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,g(e.size)].filter(Boolean).join(" ")||void 0},a.createElement(m.IconWrap,{size:"xlarge",...m.getFileExtensionIcon(f(e.name))}),a.createElement("div",{className:"k-file-info"},a.createElement("span",{className:"k-file-name"},e.name),a.createElement("span",{className:"k-file-size"},g(e.size))),k(e)))):i.map(e=>a.createElement("li",{key:e.name,className:"k-file-box",role:"listitem","aria-label":[e.name,g(e.size)].filter(Boolean).join(" ")||void 0},a.createElement(m.IconWrap,{size:"xlarge",...m.getFileExtensionIcon(f(e.name))}),a.createElement("div",{className:"k-file-info"},a.createElement("span",{className:"k-file-name"},e.name),a.createElement("span",{className:"k-file-size"},g(e.size))),k(e))))};module.exports=F;
|
|
@@ -5,54 +5,87 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import * as
|
|
9
|
-
import { classNames as
|
|
10
|
-
import { DropDownButton as
|
|
11
|
-
import { downloadIcon as
|
|
12
|
-
import { useLocalization as
|
|
13
|
-
import {
|
|
14
|
-
import { useChatContext as
|
|
15
|
-
const P = (
|
|
16
|
-
const { files:
|
|
8
|
+
import * as t from "react";
|
|
9
|
+
import { classNames as B, IconWrap as k, getFileExtensionIcon as E } from "@progress/kendo-react-common";
|
|
10
|
+
import { DropDownButton as I } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { downloadIcon as F, moreVerticalIcon as w } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { useLocalization as C } from "@progress/kendo-react-intl";
|
|
13
|
+
import { chatMessageAttachedFiles as z, messages as p, fileActions as i } from "../../../messages/index.mjs";
|
|
14
|
+
import { useChatContext as M } from "../ChatContext.mjs";
|
|
15
|
+
const P = (v) => {
|
|
16
|
+
const { files: g, onFileAction: r, onDownload: c, fileActions: x } = v, { messageFilesLayout: s = "vertical" } = M(), m = C(), d = x || [{ id: "download", label: "Download", svgIcon: F }], l = (e) => {
|
|
17
17
|
if (e == null)
|
|
18
18
|
return "";
|
|
19
19
|
if (e === 0)
|
|
20
20
|
return "0 B";
|
|
21
|
-
const
|
|
22
|
-
return `${parseFloat((e / Math.pow(
|
|
23
|
-
},
|
|
21
|
+
const a = 1024, o = ["B", "KB", "MB", "GB", "TB"], n = Math.floor(Math.log(e) / Math.log(a));
|
|
22
|
+
return `${parseFloat((e / Math.pow(a, n)).toFixed(2))} ${o[n]}`;
|
|
23
|
+
}, f = (e) => "." + e.split(".").pop() || "", N = (e, a) => {
|
|
24
24
|
var o, n;
|
|
25
|
-
(n = (o = e.syntheticEvent) == null ? void 0 : o.stopPropagation) == null || n.call(o), e.item.id === "download" && (
|
|
26
|
-
},
|
|
27
|
-
|
|
25
|
+
(n = (o = e.syntheticEvent) == null ? void 0 : o.stopPropagation) == null || n.call(o), e.item.id === "download" && (c == null || c([a])), r == null || r(e.item, e, a);
|
|
26
|
+
}, u = (e) => d.length > 0 && /* @__PURE__ */ t.createElement(
|
|
27
|
+
I,
|
|
28
28
|
{
|
|
29
29
|
fillMode: "flat",
|
|
30
|
-
size: "
|
|
30
|
+
size: "xs",
|
|
31
31
|
svgIcon: w,
|
|
32
|
-
onClick: (
|
|
33
|
-
|
|
32
|
+
onClick: (a) => {
|
|
33
|
+
a.syntheticEvent.stopPropagation();
|
|
34
34
|
},
|
|
35
|
-
onItemClick: (
|
|
36
|
-
items:
|
|
37
|
-
id:
|
|
38
|
-
icon:
|
|
39
|
-
text:
|
|
40
|
-
svgIcon:
|
|
35
|
+
onItemClick: (a) => N(a, e),
|
|
36
|
+
items: d.map((a) => ({
|
|
37
|
+
id: a.id,
|
|
38
|
+
icon: a.icon,
|
|
39
|
+
text: a.label,
|
|
40
|
+
svgIcon: a.svgIcon
|
|
41
41
|
})),
|
|
42
42
|
"aria-label": `${m.toLanguageString(
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
i,
|
|
44
|
+
p[i]
|
|
45
45
|
)} ${e.name}`,
|
|
46
|
-
title: `${m.toLanguageString(
|
|
46
|
+
title: `${m.toLanguageString(i, p[i])} ${e.name}`
|
|
47
47
|
}
|
|
48
|
-
),
|
|
48
|
+
), h = t.useCallback(() => B(
|
|
49
49
|
{
|
|
50
50
|
"k-files-wrap": s === "wrap",
|
|
51
51
|
"k-files-vertical": s === "vertical"
|
|
52
52
|
},
|
|
53
53
|
"k-file-box-wrapper"
|
|
54
54
|
), [s]);
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ t.createElement(
|
|
56
|
+
"ul",
|
|
57
|
+
{
|
|
58
|
+
role: "list",
|
|
59
|
+
"aria-label": m.toLanguageString(
|
|
60
|
+
z,
|
|
61
|
+
p[z]
|
|
62
|
+
),
|
|
63
|
+
className: h()
|
|
64
|
+
},
|
|
65
|
+
s === "horizontal" ? /* @__PURE__ */ t.createElement("div", { className: "k-files-scroll", role: "presentation" }, g.map((e) => /* @__PURE__ */ t.createElement(
|
|
66
|
+
"li",
|
|
67
|
+
{
|
|
68
|
+
key: e.name,
|
|
69
|
+
className: "k-file-box",
|
|
70
|
+
role: "listitem",
|
|
71
|
+
"aria-label": [e.name, l(e.size)].filter(Boolean).join(" ") || void 0
|
|
72
|
+
},
|
|
73
|
+
/* @__PURE__ */ t.createElement(k, { size: "xlarge", ...E(f(e.name)) }),
|
|
74
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-file-info" }, /* @__PURE__ */ t.createElement("span", { className: "k-file-name" }, e.name), /* @__PURE__ */ t.createElement("span", { className: "k-file-size" }, l(e.size))),
|
|
75
|
+
u(e)
|
|
76
|
+
))) : g.map((e) => /* @__PURE__ */ t.createElement(
|
|
77
|
+
"li",
|
|
78
|
+
{
|
|
79
|
+
key: e.name,
|
|
80
|
+
className: "k-file-box",
|
|
81
|
+
role: "listitem",
|
|
82
|
+
"aria-label": [e.name, l(e.size)].filter(Boolean).join(" ") || void 0
|
|
83
|
+
},
|
|
84
|
+
/* @__PURE__ */ t.createElement(k, { size: "xlarge", ...E(f(e.name)) }),
|
|
85
|
+
/* @__PURE__ */ t.createElement("div", { className: "k-file-info" }, /* @__PURE__ */ t.createElement("span", { className: "k-file-name" }, e.name), /* @__PURE__ */ t.createElement("span", { className: "k-file-size" }, l(e.size))),
|
|
86
|
+
u(e)
|
|
87
|
+
))
|
|
88
|
+
);
|
|
56
89
|
};
|
|
57
90
|
export {
|
|
58
91
|
P as default
|
|
@@ -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";const
|
|
8
|
+
"use strict";const m=require("react"),p=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-svg-icons"),k=require("@progress/kendo-react-intl"),o=require("../../utils.js"),b=require("../../../messages/index.js");function v(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const a=v(m),q=n=>{const{message:e,onUnpin:t,user:s,onReferencedMessageClick:r}=n,i=k.useLocalization(),u=a.useRef(null),g=s&&o.isAuthor(s,e),d=a.useCallback(c=>{c.preventDefault(),c.stopPropagation(),r==null||r(e.id)},[e.id,r]);return a.createElement("div",{ref:u,className:`k-message-reference ${g?"k-message-reference-sender":"k-message-reference-receiver"} k-message-pinned`,onClick:d},a.createElement(p.IconWrap,{icon:l.pinIcon}),a.createElement("div",{className:"k-message-reference-content"},e.isDeleted?s&&o.getDeletedMessageText(o.isAuthor(s,e),i):e.text),a.createElement("span",{className:"k-spacer"}),a.createElement(f.Button,{fillMode:"flat",size:"xs",svgIcon:l.xCircleIcon,onClick:c=>{c.stopPropagation(),t==null||t(e)},"aria-label":i.toLanguageString("chat.unpinMessage",b.messages["chat.unpinMessage"])}))};module.exports=q;
|
|
@@ -6,41 +6,43 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as s from "react";
|
|
9
|
-
import { IconWrap as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { pinIcon as
|
|
9
|
+
import { IconWrap as g } from "@progress/kendo-react-common";
|
|
10
|
+
import { Button as f } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { pinIcon as d, xCircleIcon as u } from "@progress/kendo-svg-icons";
|
|
12
12
|
import { useLocalization as k } from "@progress/kendo-react-intl";
|
|
13
|
-
import { isAuthor as
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
import { isAuthor as i, getDeletedMessageText as v } from "../../utils.mjs";
|
|
14
|
+
import { messages as M } from "../../../messages/index.mjs";
|
|
15
|
+
const z = (c) => {
|
|
16
|
+
const { message: e, onUnpin: r, user: t, onReferencedMessageClick: a } = c, o = k(), m = s.useRef(null), l = t && i(t, e), p = s.useCallback(
|
|
17
|
+
(n) => {
|
|
18
|
+
n.preventDefault(), n.stopPropagation(), a == null || a(e.id);
|
|
18
19
|
},
|
|
19
|
-
[e.id,
|
|
20
|
+
[e.id, a]
|
|
20
21
|
);
|
|
21
22
|
return /* @__PURE__ */ s.createElement(
|
|
22
23
|
"div",
|
|
23
24
|
{
|
|
24
|
-
ref:
|
|
25
|
-
className: `k-message-reference ${
|
|
25
|
+
ref: m,
|
|
26
|
+
className: `k-message-reference ${l ? "k-message-reference-sender" : "k-message-reference-receiver"} k-message-pinned`,
|
|
26
27
|
onClick: p
|
|
27
28
|
},
|
|
28
|
-
/* @__PURE__ */ s.createElement(
|
|
29
|
-
/* @__PURE__ */ s.createElement("div", { className: "k-message-reference-content" }, e.isDeleted ? t && v(
|
|
29
|
+
/* @__PURE__ */ s.createElement(g, { icon: d }),
|
|
30
|
+
/* @__PURE__ */ s.createElement("div", { className: "k-message-reference-content" }, e.isDeleted ? t && v(i(t, e), o) : e.text),
|
|
30
31
|
/* @__PURE__ */ s.createElement("span", { className: "k-spacer" }),
|
|
31
32
|
/* @__PURE__ */ s.createElement(
|
|
32
|
-
|
|
33
|
+
f,
|
|
33
34
|
{
|
|
34
35
|
fillMode: "flat",
|
|
35
36
|
size: "xs",
|
|
36
37
|
svgIcon: u,
|
|
37
|
-
onClick: (
|
|
38
|
-
|
|
39
|
-
}
|
|
38
|
+
onClick: (n) => {
|
|
39
|
+
n.stopPropagation(), r == null || r(e);
|
|
40
|
+
},
|
|
41
|
+
"aria-label": o.toLanguageString("chat.unpinMessage", M["chat.unpinMessage"])
|
|
40
42
|
}
|
|
41
43
|
)
|
|
42
44
|
);
|
|
43
45
|
};
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
z as default
|
|
46
48
|
};
|