@smartspace/chat-ui 1.14.4-dev.3cc43b1 → 1.14.4-dev.3f92249
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/dist/index.js +32 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MuiButton from '@mui/material/Button';
|
|
2
2
|
import IconButton from '@mui/material/IconButton';
|
|
3
|
-
import { Loader2, Cpu, ChevronDown, Check, Globe, Zap, SlidersHorizontal, X, Paperclip, Mic, Square, Send, Minimize2, AlertTriangle, FileImage, FileVideo, FileAudio, FileArchive, FileCode, FileSpreadsheet, Presentation, FileText, ChevronUp, Download, ShieldAlert, Copy } from 'lucide-react';
|
|
3
|
+
import { Loader2, Cpu, ChevronDown, Check, Globe, Zap, SlidersHorizontal, X, Paperclip, Mic, Square, Send, Minimize2, AlertTriangle, FileImage, FileVideo, FileAudio, FileArchive, FileCode, FileSpreadsheet, Presentation, FileText, ChevronUp, ExternalLink, Download, ShieldAlert, Copy } from 'lucide-react';
|
|
4
4
|
import * as React8 from 'react';
|
|
5
5
|
import { createContext, forwardRef, useImperativeHandle, useRef, useState, useEffect, useMemo, useCallback, useContext, useSyncExternalStore } from 'react';
|
|
6
6
|
import { createPortal } from 'react-dom';
|
|
@@ -19550,6 +19550,7 @@ function ChatMessageSources({
|
|
|
19550
19550
|
/* @__PURE__ */ jsx(SectionLabel, { children: "Files" }),
|
|
19551
19551
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: fileSources.map((source) => {
|
|
19552
19552
|
const Icon = getFileIcon3(source.file.name);
|
|
19553
|
+
const sourceHref = source.webUrl ? getSafeUrl(source.webUrl) : null;
|
|
19553
19554
|
if (!openIndexes.has(source.index)) {
|
|
19554
19555
|
return /* @__PURE__ */ jsxs(
|
|
19555
19556
|
"button",
|
|
@@ -19598,19 +19599,36 @@ function ChatMessageSources({
|
|
|
19598
19599
|
)
|
|
19599
19600
|
] }),
|
|
19600
19601
|
/* @__PURE__ */ jsx(CitedQuote, { text: source.citedText }),
|
|
19601
|
-
/* @__PURE__ */ jsxs(
|
|
19602
|
-
|
|
19603
|
-
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
|
|
19611
|
-
|
|
19612
|
-
|
|
19613
|
-
|
|
19602
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
19603
|
+
sourceHref && /* @__PURE__ */ jsxs(
|
|
19604
|
+
"a",
|
|
19605
|
+
{
|
|
19606
|
+
href: sourceHref,
|
|
19607
|
+
target: "_blank",
|
|
19608
|
+
rel: "noreferrer",
|
|
19609
|
+
title: source.webUrl ?? void 0,
|
|
19610
|
+
className: "inline-flex w-fit items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-xs font-medium text-foreground no-underline transition-colors hover:bg-muted/40",
|
|
19611
|
+
children: [
|
|
19612
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" }),
|
|
19613
|
+
"Open in ",
|
|
19614
|
+
getHost(sourceHref)
|
|
19615
|
+
]
|
|
19616
|
+
}
|
|
19617
|
+
),
|
|
19618
|
+
/* @__PURE__ */ jsxs(
|
|
19619
|
+
"button",
|
|
19620
|
+
{
|
|
19621
|
+
type: "button",
|
|
19622
|
+
onClick: () => downloadFileMutation.mutate(source.file),
|
|
19623
|
+
disabled: downloadFileMutation.isPending,
|
|
19624
|
+
className: "inline-flex w-fit items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-muted/40 disabled:cursor-not-allowed disabled:opacity-50",
|
|
19625
|
+
children: [
|
|
19626
|
+
/* @__PURE__ */ jsx(Download, { className: "h-3 w-3" }),
|
|
19627
|
+
"Download"
|
|
19628
|
+
]
|
|
19629
|
+
}
|
|
19630
|
+
)
|
|
19631
|
+
] })
|
|
19614
19632
|
]
|
|
19615
19633
|
},
|
|
19616
19634
|
`${source.file.id}-${source.index}`
|