@copilotz/chat-ui 0.7.7 → 0.7.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/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/styles.css +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -944,7 +944,7 @@ var AttachmentDownloadButton = ({ attachment }) => /* @__PURE__ */ jsx9(Button,
|
|
|
944
944
|
/* @__PURE__ */ jsx9(Download, { className: "h-4 w-4" }),
|
|
945
945
|
"Download"
|
|
946
946
|
] }) });
|
|
947
|
-
var AttachmentMetadata = ({ attachment }) => /* @__PURE__ */ jsxs5("dl", { className: "grid grid-cols-[
|
|
947
|
+
var AttachmentMetadata = ({ attachment }) => /* @__PURE__ */ jsxs5("dl", { className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-2 text-sm", children: [
|
|
948
948
|
/* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Type" }),
|
|
949
949
|
/* @__PURE__ */ jsx9("dd", { className: "min-w-0 truncate", children: attachment.mimeType || "application/octet-stream" }),
|
|
950
950
|
attachment.fileName && /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
@@ -959,7 +959,7 @@ var AttachmentMetadata = ({ attachment }) => /* @__PURE__ */ jsxs5("dl", { class
|
|
|
959
959
|
var FileAttachmentCard = ({ attachment, compact = false }) => {
|
|
960
960
|
const Icon = getAttachmentIcon(attachment);
|
|
961
961
|
const size = formatFileSize(attachment.size);
|
|
962
|
-
return /* @__PURE__ */ jsxs5("div", { className: `flex items-center gap-3 rounded-lg border bg-muted/20 text-left ${compact ? "p-2" : "p-3"}
|
|
962
|
+
return /* @__PURE__ */ jsxs5("div", { className: `flex w-full min-w-0 max-w-md items-center gap-3 rounded-lg border bg-muted/20 text-left ${compact ? "p-2" : "p-3"}`, children: [
|
|
963
963
|
/* @__PURE__ */ jsx9("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ jsx9(Icon, { className: "h-5 w-5 text-foreground" }) }),
|
|
964
964
|
/* @__PURE__ */ jsxs5("div", { className: "min-w-0 flex-1", children: [
|
|
965
965
|
/* @__PURE__ */ jsx9("p", { className: "truncate text-sm font-medium", children: getAttachmentLabel(attachment) }),
|
|
@@ -972,20 +972,20 @@ var AttachmentDialog = ({ attachment, children }) => {
|
|
|
972
972
|
const Icon = getAttachmentIcon(attachment);
|
|
973
973
|
return /* @__PURE__ */ jsxs5(Dialog, { children: [
|
|
974
974
|
/* @__PURE__ */ jsx9(DialogTrigger, { asChild: true, children }),
|
|
975
|
-
/* @__PURE__ */ jsxs5(DialogContent, { className: "max-w-
|
|
976
|
-
/* @__PURE__ */ jsxs5(DialogHeader, { children: [
|
|
977
|
-
/* @__PURE__ */ jsx9(DialogTitle, { className: "truncate", children: label }),
|
|
978
|
-
/* @__PURE__ */ jsx9(DialogDescription, { children: "Attachment details and download options." })
|
|
975
|
+
/* @__PURE__ */ jsxs5(DialogContent, { className: "w-[min(calc(100vw-2rem),48rem)] max-w-[calc(100vw-2rem)] overflow-hidden", children: [
|
|
976
|
+
/* @__PURE__ */ jsxs5(DialogHeader, { className: "min-w-0 pr-8", children: [
|
|
977
|
+
/* @__PURE__ */ jsx9(DialogTitle, { className: "min-w-0 truncate", children: label }),
|
|
978
|
+
/* @__PURE__ */ jsx9(DialogDescription, { className: "min-w-0 truncate", children: "Attachment details and download options." })
|
|
979
979
|
] }),
|
|
980
|
-
/* @__PURE__ */ jsxs5("div", { className: "space-y-4", children: [
|
|
981
|
-
attachment.kind === "image" ? /* @__PURE__ */ jsx9("div", { className: "max-h-[65vh] overflow-auto rounded-lg border bg-muted/20", children: /* @__PURE__ */ jsx9(
|
|
980
|
+
/* @__PURE__ */ jsxs5("div", { className: "min-w-0 max-w-full space-y-4 overflow-hidden", children: [
|
|
981
|
+
attachment.kind === "image" ? /* @__PURE__ */ jsx9("div", { className: "max-h-[65vh] min-w-0 overflow-auto rounded-lg border bg-muted/20", children: /* @__PURE__ */ jsx9(
|
|
982
982
|
"img",
|
|
983
983
|
{
|
|
984
984
|
src: attachment.dataUrl,
|
|
985
985
|
alt: label,
|
|
986
986
|
className: "mx-auto h-auto max-h-[65vh] w-auto max-w-full object-contain"
|
|
987
987
|
}
|
|
988
|
-
) }) : attachment.kind === "video" ? /* @__PURE__ */ jsx9("div", { className: "rounded-lg border bg-muted/20", children: /* @__PURE__ */ jsx9(
|
|
988
|
+
) }) : attachment.kind === "video" ? /* @__PURE__ */ jsx9("div", { className: "min-w-0 rounded-lg border bg-muted/20", children: /* @__PURE__ */ jsx9(
|
|
989
989
|
"video",
|
|
990
990
|
{
|
|
991
991
|
src: attachment.dataUrl,
|
|
@@ -993,13 +993,13 @@ var AttachmentDialog = ({ attachment, children }) => {
|
|
|
993
993
|
controls: true,
|
|
994
994
|
className: "max-h-[65vh] w-full rounded-lg"
|
|
995
995
|
}
|
|
996
|
-
) }) : attachment.kind === "audio" ? /* @__PURE__ */ jsx9("audio", { className: "w-full", preload: "metadata", controls: true, children: /* @__PURE__ */ jsx9("source", { src: attachment.dataUrl, type: attachment.mimeType }) }) : /* @__PURE__ */ jsxs5("div", { className: "flex flex-col items-center gap-3 rounded-lg border bg-muted/20 p-8 text-center", children: [
|
|
996
|
+
) }) : attachment.kind === "audio" ? /* @__PURE__ */ jsx9("audio", { className: "w-full", preload: "metadata", controls: true, children: /* @__PURE__ */ jsx9("source", { src: attachment.dataUrl, type: attachment.mimeType }) }) : /* @__PURE__ */ jsxs5("div", { className: "flex min-w-0 flex-col items-center gap-3 rounded-lg border bg-muted/20 p-8 text-center", children: [
|
|
997
997
|
/* @__PURE__ */ jsx9("div", { className: "flex h-16 w-16 items-center justify-center rounded-lg bg-muted", children: /* @__PURE__ */ jsx9(Icon, { className: "h-8 w-8 text-foreground" }) }),
|
|
998
|
-
/* @__PURE__ */ jsx9("p", { className: "
|
|
998
|
+
/* @__PURE__ */ jsx9("p", { className: "w-full min-w-0 truncate text-sm font-medium", children: label })
|
|
999
999
|
] }),
|
|
1000
1000
|
/* @__PURE__ */ jsx9(AttachmentMetadata, { attachment })
|
|
1001
1001
|
] }),
|
|
1002
|
-
/* @__PURE__ */ jsx9(DialogFooter, { children: /* @__PURE__ */ jsx9(AttachmentDownloadButton, { attachment }) })
|
|
1002
|
+
/* @__PURE__ */ jsx9(DialogFooter, { className: "min-w-0", children: /* @__PURE__ */ jsx9(AttachmentDownloadButton, { attachment }) })
|
|
1003
1003
|
] })
|
|
1004
1004
|
] });
|
|
1005
1005
|
};
|
|
@@ -1069,7 +1069,7 @@ var MediaRenderer = memo2(function MediaRenderer2({ attachment }) {
|
|
|
1069
1069
|
attachment.fileName && /* @__PURE__ */ jsx9("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 p-2 text-xs text-white", children: attachment.fileName })
|
|
1070
1070
|
] }) }) });
|
|
1071
1071
|
case "file":
|
|
1072
|
-
return /* @__PURE__ */ jsx9(AttachmentDialog, { attachment, children: /* @__PURE__ */ jsx9("button", { type: "button", className: "block max-w-md text-left", children: /* @__PURE__ */ jsx9(FileAttachmentCard, { attachment }) }) });
|
|
1072
|
+
return /* @__PURE__ */ jsx9(AttachmentDialog, { attachment, children: /* @__PURE__ */ jsx9("button", { type: "button", className: "block w-full max-w-md text-left", children: /* @__PURE__ */ jsx9(FileAttachmentCard, { attachment }) }) });
|
|
1073
1073
|
default:
|
|
1074
1074
|
return null;
|
|
1075
1075
|
}
|