@copilotz/chat-ui 0.7.7 → 0.7.9

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 CHANGED
@@ -970,7 +970,7 @@ var AttachmentDownloadButton = ({ attachment }) => /* @__PURE__ */ (0, import_js
970
970
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Download, { className: "h-4 w-4" }),
971
971
  "Download"
972
972
  ] }) });
973
- var AttachmentMetadata = ({ attachment }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm", children: [
973
+ var AttachmentMetadata = ({ attachment }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("dl", { className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-2 text-sm", children: [
974
974
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("dt", { className: "text-muted-foreground", children: "Type" }),
975
975
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("dd", { className: "min-w-0 truncate", children: attachment.mimeType || "application/octet-stream" }),
976
976
  attachment.fileName && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
@@ -985,7 +985,7 @@ var AttachmentMetadata = ({ attachment }) => /* @__PURE__ */ (0, import_jsx_runt
985
985
  var FileAttachmentCard = ({ attachment, compact = false }) => {
986
986
  const Icon = getAttachmentIcon(attachment);
987
987
  const size = formatFileSize(attachment.size);
988
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `flex items-center gap-3 rounded-lg border bg-muted/20 text-left ${compact ? "p-2" : "p-3"} max-w-md`, children: [
988
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("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: [
989
989
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { className: "h-5 w-5 text-foreground" }) }),
990
990
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "min-w-0 flex-1", children: [
991
991
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "truncate text-sm font-medium", children: getAttachmentLabel(attachment) }),
@@ -998,20 +998,20 @@ var AttachmentDialog = ({ attachment, children }) => {
998
998
  const Icon = getAttachmentIcon(attachment);
999
999
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Dialog, { children: [
1000
1000
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogTrigger, { asChild: true, children }),
1001
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogContent, { className: "max-w-3xl", children: [
1002
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogHeader, { children: [
1003
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogTitle, { className: "truncate", children: label }),
1004
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogDescription, { children: "Attachment details and download options." })
1001
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogContent, { className: "w-[min(calc(100vw-2rem),48rem)] max-w-[calc(100vw-2rem)] overflow-hidden", children: [
1002
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogHeader, { className: "min-w-0 pr-8", children: [
1003
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogTitle, { className: "min-w-0 truncate", children: label }),
1004
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogDescription, { className: "min-w-0 truncate", children: "Attachment details and download options." })
1005
1005
  ] }),
1006
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-4", children: [
1007
- attachment.kind === "image" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-h-[65vh] overflow-auto rounded-lg border bg-muted/20", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1006
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "min-w-0 max-w-full space-y-4 overflow-hidden", children: [
1007
+ attachment.kind === "image" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "max-h-[65vh] min-w-0 overflow-auto rounded-lg border bg-muted/20", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1008
1008
  "img",
1009
1009
  {
1010
1010
  src: attachment.dataUrl,
1011
1011
  alt: label,
1012
1012
  className: "mx-auto h-auto max-h-[65vh] w-auto max-w-full object-contain"
1013
1013
  }
1014
- ) }) : attachment.kind === "video" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "rounded-lg border bg-muted/20", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1014
+ ) }) : attachment.kind === "video" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "min-w-0 rounded-lg border bg-muted/20", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1015
1015
  "video",
1016
1016
  {
1017
1017
  src: attachment.dataUrl,
@@ -1019,13 +1019,13 @@ var AttachmentDialog = ({ attachment, children }) => {
1019
1019
  controls: true,
1020
1020
  className: "max-h-[65vh] w-full rounded-lg"
1021
1021
  }
1022
- ) }) : attachment.kind === "audio" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("audio", { className: "w-full", preload: "metadata", controls: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("source", { src: attachment.dataUrl, type: attachment.mimeType }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col items-center gap-3 rounded-lg border bg-muted/20 p-8 text-center", children: [
1022
+ ) }) : attachment.kind === "audio" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("audio", { className: "w-full", preload: "metadata", controls: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("source", { src: attachment.dataUrl, type: attachment.mimeType }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex min-w-0 flex-col items-center gap-3 rounded-lg border bg-muted/20 p-8 text-center", children: [
1023
1023
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex h-16 w-16 items-center justify-center rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { className: "h-8 w-8 text-foreground" }) }),
1024
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "max-w-full truncate text-sm font-medium", children: label })
1024
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "w-full min-w-0 truncate text-sm font-medium", children: label })
1025
1025
  ] }),
1026
1026
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AttachmentMetadata, { attachment })
1027
1027
  ] }),
1028
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AttachmentDownloadButton, { attachment }) })
1028
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogFooter, { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AttachmentDownloadButton, { attachment }) })
1029
1029
  ] })
1030
1030
  ] });
1031
1031
  };
@@ -1095,7 +1095,7 @@ var MediaRenderer = (0, import_react2.memo)(function MediaRenderer2({ attachment
1095
1095
  attachment.fileName && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute bottom-0 left-0 right-0 bg-black/50 p-2 text-xs text-white", children: attachment.fileName })
1096
1096
  ] }) }) });
1097
1097
  case "file":
1098
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AttachmentDialog, { attachment, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: "block max-w-md text-left", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FileAttachmentCard, { attachment }) }) });
1098
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AttachmentDialog, { attachment, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: "block w-full max-w-md text-left", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FileAttachmentCard, { attachment }) }) });
1099
1099
  default:
1100
1100
  return null;
1101
1101
  }