@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.js CHANGED
@@ -1246,25 +1246,45 @@ var Message = memo2(({
1246
1246
  ] })
1247
1247
  ] }),
1248
1248
  /* @__PURE__ */ jsxs5("div", { className: `flex-1 min-w-0 ${messageIsUser ? "text-right" : "text-left"} ${horizontalOffsetClass}`, children: [
1249
- /* @__PURE__ */ jsx9("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__ */ jsxs5("div", { className: "space-y-2", children: [
1249
+ /* @__PURE__ */ jsx9("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__ */ jsxs5("div", { className: "space-y-2", children: [
1250
1250
  /* @__PURE__ */ jsx9(
1251
1251
  Textarea,
1252
1252
  {
1253
1253
  value: editContent,
1254
1254
  onChange: (e) => setEditContent(e.target.value),
1255
- className: "min-h-[100px] resize-none",
1255
+ className: "min-h-28 resize-y bg-muted/30 text-sm leading-6",
1256
1256
  autoFocus: true
1257
1257
  }
1258
1258
  ),
1259
- /* @__PURE__ */ jsxs5("div", { className: "flex gap-2 justify-end", children: [
1260
- /* @__PURE__ */ jsxs5(Button, { variant: "outline", size: "sm", onClick: handleCancelEdit, children: [
1261
- /* @__PURE__ */ jsx9(X, { className: "h-4 w-4 mr-1" }),
1262
- "Cancelar"
1263
- ] }),
1264
- /* @__PURE__ */ jsxs5(Button, { size: "sm", onClick: handleEdit, children: [
1265
- /* @__PURE__ */ jsx9(Check, { className: "h-4 w-4 mr-1" }),
1266
- "Salvar"
1267
- ] })
1259
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-end gap-2", children: [
1260
+ /* @__PURE__ */ jsxs5(
1261
+ Button,
1262
+ {
1263
+ type: "button",
1264
+ variant: "ghost",
1265
+ size: "sm",
1266
+ className: "h-8",
1267
+ onClick: handleCancelEdit,
1268
+ children: [
1269
+ /* @__PURE__ */ jsx9(X, { className: "h-4 w-4 mr-1" }),
1270
+ labels?.cancel || "Cancel"
1271
+ ]
1272
+ }
1273
+ ),
1274
+ /* @__PURE__ */ jsxs5(
1275
+ Button,
1276
+ {
1277
+ type: "button",
1278
+ size: "sm",
1279
+ className: "h-8",
1280
+ onClick: handleEdit,
1281
+ disabled: !editContent.trim() || editContent.trim() === message.content,
1282
+ children: [
1283
+ /* @__PURE__ */ jsx9(Check, { className: "h-4 w-4 mr-1" }),
1284
+ "Save"
1285
+ ]
1286
+ }
1287
+ )
1268
1288
  ] })
1269
1289
  ] }) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
1270
1290
  !messageIsUser && /* @__PURE__ */ jsx9(
@@ -1300,10 +1320,10 @@ var Message = memo2(({
1300
1320
  ) }),
1301
1321
  message.attachments && message.attachments.length > 0 && /* @__PURE__ */ jsx9("div", { className: "mt-3 space-y-2", children: message.attachments.map((attachment, index) => /* @__PURE__ */ jsx9(MediaRenderer, { attachment }, index)) })
1302
1322
  ] }) }),
1303
- !isEditing && (showActions || actionsFocused || copied) && (enableCopy || canEdit) && /* @__PURE__ */ jsxs5(
1323
+ !isEditing && (enableCopy || canEdit) && /* @__PURE__ */ jsxs5(
1304
1324
  "div",
1305
1325
  {
1306
- className: `mt-1 flex items-center gap-1 text-muted-foreground transition-opacity ${messageIsUser ? "justify-end" : "justify-start"}`,
1326
+ 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"}`,
1307
1327
  children: [
1308
1328
  canEdit && /* @__PURE__ */ jsxs5(Tooltip, { children: [
1309
1329
  /* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx9(
@@ -2608,6 +2628,33 @@ var ThreadTagEditorBadge = ({
2608
2628
  }
2609
2629
  );
2610
2630
  };
2631
+ var ThreadTagOptionButton = ({
2632
+ tag,
2633
+ assigned,
2634
+ onClick
2635
+ }) => {
2636
+ const color = tagColor(tag);
2637
+ return /* @__PURE__ */ jsxs11(
2638
+ Button,
2639
+ {
2640
+ type: "button",
2641
+ variant: "outline",
2642
+ size: "sm",
2643
+ disabled: assigned,
2644
+ className: "gap-1.5 border font-medium disabled:opacity-70",
2645
+ style: {
2646
+ backgroundColor: color.background,
2647
+ borderColor: color.border,
2648
+ color: color.accent
2649
+ },
2650
+ onClick,
2651
+ children: [
2652
+ /* @__PURE__ */ jsx18(TagDot, { tag }),
2653
+ tag.name
2654
+ ]
2655
+ }
2656
+ );
2657
+ };
2611
2658
  var Sidebar2 = ({
2612
2659
  threads,
2613
2660
  currentThreadId,
@@ -3091,14 +3138,11 @@ var Sidebar2 = ({
3091
3138
  (threadTag) => threadTag.id === tag.id
3092
3139
  );
3093
3140
  return /* @__PURE__ */ jsx18(
3094
- Button,
3141
+ ThreadTagOptionButton,
3095
3142
  {
3096
- type: "button",
3097
- variant: assigned ? "secondary" : "outline",
3098
- size: "sm",
3099
- disabled: assigned,
3100
- onClick: () => addTagToThread(tagDialogThread, tag),
3101
- children: tag.name
3143
+ tag,
3144
+ assigned,
3145
+ onClick: () => addTagToThread(tagDialogThread, tag)
3102
3146
  },
3103
3147
  tag.id
3104
3148
  );