@copilotz/chat-ui 0.9.5 → 0.9.6

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
@@ -1273,25 +1273,45 @@ var Message = (0, import_react2.memo)(({
1273
1273
  ] })
1274
1274
  ] }),
1275
1275
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `flex-1 min-w-0 ${messageIsUser ? "text-right" : "text-left"} ${horizontalOffsetClass}`, children: [
1276
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `relative overflow-hidden text-left ${messageIsUser ? "ml-auto inline-flex max-w-[85%] flex-col rounded-lg bg-primary p-3 text-primary-foreground" : "flex w-full max-w-full flex-col"}`, children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-2", children: [
1276
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `relative overflow-hidden text-left ${messageIsUser ? isEditing ? "ml-auto flex w-full max-w-[min(42rem,85%)] flex-col rounded-xl border bg-background p-2 text-foreground shadow-sm" : "ml-auto inline-flex max-w-[85%] flex-col rounded-lg bg-primary p-3 text-primary-foreground" : "flex w-full max-w-full flex-col"}`, children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-2", children: [
1277
1277
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1278
1278
  Textarea,
1279
1279
  {
1280
1280
  value: editContent,
1281
1281
  onChange: (e) => setEditContent(e.target.value),
1282
- className: "min-h-[100px] resize-none",
1282
+ className: "min-h-28 resize-y bg-muted/30 text-sm leading-6",
1283
1283
  autoFocus: true
1284
1284
  }
1285
1285
  ),
1286
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex gap-2 justify-end", children: [
1287
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Button, { variant: "outline", size: "sm", onClick: handleCancelEdit, children: [
1288
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.X, { className: "h-4 w-4 mr-1" }),
1289
- "Cancelar"
1290
- ] }),
1291
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Button, { size: "sm", onClick: handleEdit, children: [
1292
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Check, { className: "h-4 w-4 mr-1" }),
1293
- "Salvar"
1294
- ] })
1286
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [
1287
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1288
+ Button,
1289
+ {
1290
+ type: "button",
1291
+ variant: "ghost",
1292
+ size: "sm",
1293
+ className: "h-8",
1294
+ onClick: handleCancelEdit,
1295
+ children: [
1296
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.X, { className: "h-4 w-4 mr-1" }),
1297
+ labels?.cancel || "Cancel"
1298
+ ]
1299
+ }
1300
+ ),
1301
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1302
+ Button,
1303
+ {
1304
+ type: "button",
1305
+ size: "sm",
1306
+ className: "h-8",
1307
+ onClick: handleEdit,
1308
+ disabled: !editContent.trim() || editContent.trim() === message.content,
1309
+ children: [
1310
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Check, { className: "h-4 w-4 mr-1" }),
1311
+ "Save"
1312
+ ]
1313
+ }
1314
+ )
1295
1315
  ] })
1296
1316
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1297
1317
  !messageIsUser && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -1327,10 +1347,10 @@ var Message = (0, import_react2.memo)(({
1327
1347
  ) }),
1328
1348
  message.attachments && message.attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-3 space-y-2", children: message.attachments.map((attachment, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(MediaRenderer, { attachment }, index)) })
1329
1349
  ] }) }),
1330
- !isEditing && (showActions || actionsFocused || copied) && (enableCopy || canEdit) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1350
+ !isEditing && (enableCopy || canEdit) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1331
1351
  "div",
1332
1352
  {
1333
- className: `mt-1 flex items-center gap-1 text-muted-foreground transition-opacity ${messageIsUser ? "justify-end" : "justify-start"}`,
1353
+ className: `mt-1 flex h-7 items-center gap-1 text-muted-foreground transition-opacity duration-150 ${messageIsUser ? "justify-end" : "justify-start"} ${showActions || actionsFocused || copied ? "opacity-100" : "pointer-events-none opacity-0"}`,
1334
1354
  children: [
1335
1355
  canEdit && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Tooltip, { children: [
1336
1356
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -2614,6 +2634,33 @@ var ThreadTagEditorBadge = ({
2614
2634
  }
2615
2635
  );
2616
2636
  };
2637
+ var ThreadTagOptionButton = ({
2638
+ tag,
2639
+ assigned,
2640
+ onClick
2641
+ }) => {
2642
+ const color = tagColor(tag);
2643
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2644
+ Button,
2645
+ {
2646
+ type: "button",
2647
+ variant: "outline",
2648
+ size: "sm",
2649
+ disabled: assigned,
2650
+ className: "gap-1.5 border font-medium disabled:opacity-70",
2651
+ style: {
2652
+ backgroundColor: color.background,
2653
+ borderColor: color.border,
2654
+ color: color.accent
2655
+ },
2656
+ onClick,
2657
+ children: [
2658
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TagDot, { tag }),
2659
+ tag.name
2660
+ ]
2661
+ }
2662
+ );
2663
+ };
2617
2664
  var Sidebar2 = ({
2618
2665
  threads,
2619
2666
  currentThreadId,
@@ -3097,14 +3144,11 @@ var Sidebar2 = ({
3097
3144
  (threadTag) => threadTag.id === tag.id
3098
3145
  );
3099
3146
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3100
- Button,
3147
+ ThreadTagOptionButton,
3101
3148
  {
3102
- type: "button",
3103
- variant: assigned ? "secondary" : "outline",
3104
- size: "sm",
3105
- disabled: assigned,
3106
- onClick: () => addTagToThread(tagDialogThread, tag),
3107
- children: tag.name
3149
+ tag,
3150
+ assigned,
3151
+ onClick: () => addTagToThread(tagDialogThread, tag)
3108
3152
  },
3109
3153
  tag.id
3110
3154
  );