@copilotz/chat-ui 0.9.0 → 0.9.2
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 +241 -161
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +243 -162
- package/dist/index.js.map +1 -1
- package/dist/styles.css +44 -13
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -123,7 +123,7 @@ var defaultChatConfig = {
|
|
|
123
123
|
addTag: "Add tag",
|
|
124
124
|
removeTag: "Remove tag",
|
|
125
125
|
tagNamePlaceholder: "Tag name",
|
|
126
|
-
untagged: "
|
|
126
|
+
untagged: "No tag",
|
|
127
127
|
groupBy: "Group by",
|
|
128
128
|
groupByDate: "Date",
|
|
129
129
|
groupByTag: "Tag",
|
|
@@ -1393,6 +1393,12 @@ function Input({ className, type, ...props }) {
|
|
|
1393
1393
|
);
|
|
1394
1394
|
}
|
|
1395
1395
|
|
|
1396
|
+
// src/components/ui/collapsible.tsx
|
|
1397
|
+
var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"), 1);
|
|
1398
|
+
var Collapsible = CollapsiblePrimitive.Root;
|
|
1399
|
+
var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
|
|
1400
|
+
var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
|
|
1401
|
+
|
|
1396
1402
|
// src/components/ui/sidebar.tsx
|
|
1397
1403
|
var React6 = __toESM(require("react"), 1);
|
|
1398
1404
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
@@ -2458,8 +2464,16 @@ var CreateThreadDialog = ({ config, onCreateThread, trigger }) => {
|
|
|
2458
2464
|
};
|
|
2459
2465
|
var ThreadInitialsIcon = ({ title }) => {
|
|
2460
2466
|
const initials = title?.split(" ").map((n) => n[0]).slice(0, 2).join("").toUpperCase() || "?";
|
|
2461
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex shrink-0 items-center justify-center rounded bg-muted text-[10px] font-medium", children: initials });
|
|
2467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded bg-muted text-[10px] font-medium text-muted-foreground", children: initials });
|
|
2462
2468
|
};
|
|
2469
|
+
var TAG_COLOR_CLASSES = [
|
|
2470
|
+
"bg-sky-500",
|
|
2471
|
+
"bg-emerald-500",
|
|
2472
|
+
"bg-violet-500",
|
|
2473
|
+
"bg-amber-500",
|
|
2474
|
+
"bg-rose-500",
|
|
2475
|
+
"bg-cyan-500"
|
|
2476
|
+
];
|
|
2463
2477
|
function slugTagName(name) {
|
|
2464
2478
|
const slug = name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48);
|
|
2465
2479
|
return slug || "tag";
|
|
@@ -2491,6 +2505,31 @@ function collectThreadTags(threads) {
|
|
|
2491
2505
|
}
|
|
2492
2506
|
return tags.sort((a, b) => a.name.localeCompare(b.name));
|
|
2493
2507
|
}
|
|
2508
|
+
function tagColorIndex(tag) {
|
|
2509
|
+
let hash = 0;
|
|
2510
|
+
for (const char of tag.id || tag.name) {
|
|
2511
|
+
hash = hash * 31 + char.charCodeAt(0) >>> 0;
|
|
2512
|
+
}
|
|
2513
|
+
return hash % TAG_COLOR_CLASSES.length;
|
|
2514
|
+
}
|
|
2515
|
+
var TagDot = ({ tag }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2516
|
+
"span",
|
|
2517
|
+
{
|
|
2518
|
+
"aria-hidden": "true",
|
|
2519
|
+
className: `h-2 w-2 shrink-0 rounded-full ${TAG_COLOR_CLASSES[tagColorIndex(tag)]}`
|
|
2520
|
+
}
|
|
2521
|
+
);
|
|
2522
|
+
var ThreadTagBadge = ({ tag }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2523
|
+
Badge,
|
|
2524
|
+
{
|
|
2525
|
+
variant: "secondary",
|
|
2526
|
+
className: "h-4 max-w-24 gap-1 rounded px-1.5 py-0 text-[10px] font-normal text-muted-foreground",
|
|
2527
|
+
children: [
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TagDot, { tag }),
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "truncate", children: tag.name })
|
|
2530
|
+
]
|
|
2531
|
+
}
|
|
2532
|
+
);
|
|
2494
2533
|
var Sidebar2 = ({
|
|
2495
2534
|
threads,
|
|
2496
2535
|
currentThreadId,
|
|
@@ -2521,6 +2560,7 @@ var Sidebar2 = ({
|
|
|
2521
2560
|
const [newTagName, setNewTagName] = (0, import_react4.useState)("");
|
|
2522
2561
|
const [draggingThreadId, setDraggingThreadId] = (0, import_react4.useState)(null);
|
|
2523
2562
|
const [dragOverTagId, setDragOverTagId] = (0, import_react4.useState)(null);
|
|
2563
|
+
const [collapsedGroups, setCollapsedGroups] = (0, import_react4.useState)({});
|
|
2524
2564
|
const inputRef = (0, import_react4.useRef)(null);
|
|
2525
2565
|
const threadTagsConfig = config.features?.threadTags;
|
|
2526
2566
|
const tagsEnabled = !!threadTagsConfig?.enabled;
|
|
@@ -2559,8 +2599,9 @@ var Sidebar2 = ({
|
|
|
2559
2599
|
if (untagged.length > 0) {
|
|
2560
2600
|
groups2.push({
|
|
2561
2601
|
key: "untagged",
|
|
2562
|
-
label: config.labels?.untagged || "
|
|
2563
|
-
threads: untagged
|
|
2602
|
+
label: config.labels?.untagged || "No tag",
|
|
2603
|
+
threads: untagged,
|
|
2604
|
+
muted: true
|
|
2564
2605
|
});
|
|
2565
2606
|
}
|
|
2566
2607
|
return groups2;
|
|
@@ -2603,6 +2644,12 @@ var Sidebar2 = ({
|
|
|
2603
2644
|
tagsEnabled
|
|
2604
2645
|
]);
|
|
2605
2646
|
const tagDialogThread = tagDialogThreadId ? threads.find((thread) => thread.id === tagDialogThreadId) ?? null : null;
|
|
2647
|
+
const toggleGroup = (groupKey, open) => {
|
|
2648
|
+
setCollapsedGroups((current) => ({
|
|
2649
|
+
...current,
|
|
2650
|
+
[groupKey]: !open
|
|
2651
|
+
}));
|
|
2652
|
+
};
|
|
2606
2653
|
const handleDeleteThread = (threadId) => {
|
|
2607
2654
|
onDeleteThread?.(threadId);
|
|
2608
2655
|
setDeleteThreadId(null);
|
|
@@ -2717,175 +2764,206 @@ var Sidebar2 = ({
|
|
|
2717
2764
|
]
|
|
2718
2765
|
}
|
|
2719
2766
|
) }),
|
|
2720
|
-
tagsEnabled && threadTagsConfig?.groupingEnabled !== false && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "px-
|
|
2721
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
}
|
|
2742
|
-
)
|
|
2743
|
-
] })
|
|
2767
|
+
tagsEnabled && threadTagsConfig?.groupingEnabled !== false && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "px-2 py-2 group-data-[collapsible=icon]:hidden", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "grid grid-cols-2 gap-1 rounded-md bg-sidebar-accent/50 p-1", children: [
|
|
2768
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2769
|
+
Button,
|
|
2770
|
+
{
|
|
2771
|
+
variant: groupBy === "date" ? "secondary" : "ghost",
|
|
2772
|
+
size: "sm",
|
|
2773
|
+
onClick: () => setGroupBy("date"),
|
|
2774
|
+
className: "h-7 px-2 text-xs",
|
|
2775
|
+
children: config.labels?.groupByDate || "Date"
|
|
2776
|
+
}
|
|
2777
|
+
),
|
|
2778
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2779
|
+
Button,
|
|
2780
|
+
{
|
|
2781
|
+
variant: groupBy === "tag" ? "secondary" : "ghost",
|
|
2782
|
+
size: "sm",
|
|
2783
|
+
onClick: () => setGroupBy("tag"),
|
|
2784
|
+
className: "h-7 px-2 text-xs",
|
|
2785
|
+
children: config.labels?.groupByTag || "Tag"
|
|
2786
|
+
}
|
|
2787
|
+
)
|
|
2744
2788
|
] }) }),
|
|
2745
2789
|
threadGroups.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "px-4 py-8 text-center text-muted-foreground group-data-[collapsible=icon]:hidden", children: [
|
|
2746
2790
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mx-auto h-8 w-8 mb-2 flex items-center justify-center rounded-full bg-muted/50", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Plus, { className: "h-4 w-4 opacity-50" }) }),
|
|
2747
2791
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-xs", children: searchQuery ? config.labels?.noThreadsFound || "No conversations found" : config.labels?.noThreadsYet || "No conversations yet" })
|
|
2748
|
-
] }) : threadGroups.map((group) =>
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
onDragLeave: () => {
|
|
2758
|
-
if (dragOverTagId === group.tag?.id) setDragOverTagId(null);
|
|
2759
|
-
},
|
|
2760
|
-
onDrop: (event) => {
|
|
2761
|
-
if (!canDragTags || !group.tag) return;
|
|
2762
|
-
event.preventDefault();
|
|
2763
|
-
handleDropOnTag(group.tag);
|
|
2764
|
-
},
|
|
2765
|
-
children: [
|
|
2766
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2767
|
-
SidebarGroupLabel,
|
|
2792
|
+
] }) : threadGroups.map((group) => {
|
|
2793
|
+
const isOpen = !collapsedGroups[group.key];
|
|
2794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2795
|
+
Collapsible,
|
|
2796
|
+
{
|
|
2797
|
+
open: isOpen,
|
|
2798
|
+
onOpenChange: (open) => toggleGroup(group.key, open),
|
|
2799
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2800
|
+
SidebarGroup,
|
|
2768
2801
|
{
|
|
2769
|
-
className:
|
|
2802
|
+
className: "mt-1 py-1",
|
|
2803
|
+
onDragOver: (event) => {
|
|
2804
|
+
if (!canDragTags || !group.tag) return;
|
|
2805
|
+
event.preventDefault();
|
|
2806
|
+
setDragOverTagId(group.tag.id);
|
|
2807
|
+
},
|
|
2808
|
+
onDragLeave: () => {
|
|
2809
|
+
if (dragOverTagId === group.tag?.id) {
|
|
2810
|
+
setDragOverTagId(null);
|
|
2811
|
+
}
|
|
2812
|
+
},
|
|
2813
|
+
onDrop: (event) => {
|
|
2814
|
+
if (!canDragTags || !group.tag) return;
|
|
2815
|
+
event.preventDefault();
|
|
2816
|
+
handleDropOnTag(group.tag);
|
|
2817
|
+
},
|
|
2770
2818
|
children: [
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2820
|
+
SidebarGroupLabel,
|
|
2821
|
+
{
|
|
2822
|
+
asChild: true,
|
|
2823
|
+
className: `h-7 group-data-[collapsible=icon]:hidden ${dragOverTagId === group.tag?.id ? "bg-sidebar-accent text-sidebar-accent-foreground" : ""}`,
|
|
2824
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(CollapsibleTrigger2, { className: "group/trigger w-full", children: [
|
|
2825
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2826
|
+
import_lucide_react8.ChevronRight,
|
|
2827
|
+
{
|
|
2828
|
+
className: `mr-1 h-3.5 w-3.5 transition-transform ${isOpen ? "rotate-90" : ""}`
|
|
2829
|
+
}
|
|
2830
|
+
),
|
|
2831
|
+
group.tag ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TagDot, { tag: group.tag }) : group.muted ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Tag, { className: "mr-1 h-3.5 w-3.5 opacity-50" }) : null,
|
|
2832
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2833
|
+
"span",
|
|
2834
|
+
{
|
|
2835
|
+
className: `min-w-0 flex-1 truncate ${group.muted ? "text-muted-foreground" : ""}`,
|
|
2836
|
+
children: group.label
|
|
2837
|
+
}
|
|
2838
|
+
),
|
|
2839
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ml-auto rounded px-1.5 text-[10px] text-muted-foreground", children: group.threads.length })
|
|
2840
|
+
] })
|
|
2789
2841
|
}
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
{
|
|
2797
|
-
isActive: currentThreadId === thread.id,
|
|
2798
|
-
onClick: () => onSelectThread?.(thread.id),
|
|
2799
|
-
tooltip: thread.title,
|
|
2800
|
-
draggable: canDragTags,
|
|
2801
|
-
onDragStart: () => setDraggingThreadId(thread.id),
|
|
2802
|
-
onDragEnd: () => {
|
|
2803
|
-
setDraggingThreadId(null);
|
|
2804
|
-
setDragOverTagId(null);
|
|
2805
|
-
},
|
|
2806
|
-
children: [
|
|
2807
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ThreadInitialsIcon, { title: thread.title || "?" }),
|
|
2808
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col items-start gap-0.5 flex-1 min-w-0 group-data-[collapsible=icon]:hidden", children: [
|
|
2809
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "truncate w-full", children: thread.title || "New Chat" }),
|
|
2810
|
-
tagsEnabled && (thread.tags ?? []).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex max-w-full flex-wrap gap-1", children: (thread.tags ?? []).slice(0, 2).map((tag) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2811
|
-
"span",
|
|
2812
|
-
{
|
|
2813
|
-
className: "max-w-20 truncate rounded bg-sidebar-accent px-1.5 py-0.5 text-[10px] text-muted-foreground",
|
|
2814
|
-
children: tag.name
|
|
2815
|
-
},
|
|
2816
|
-
tag.id
|
|
2817
|
-
)) })
|
|
2818
|
-
] }),
|
|
2819
|
-
thread.isArchived && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Archive, { className: "ml-auto h-3 w-3 opacity-50 group-data-[collapsible=icon]:hidden" })
|
|
2820
|
-
]
|
|
2821
|
-
}
|
|
2822
|
-
),
|
|
2823
|
-
!editingThreadId && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenu, { children: [
|
|
2824
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SidebarMenuAction, { showOnHover: true, children: [
|
|
2825
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.MoreHorizontal, {}),
|
|
2826
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: "More" })
|
|
2827
|
-
] }) }),
|
|
2828
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2829
|
-
DropdownMenuContent,
|
|
2830
|
-
{
|
|
2831
|
-
className: "w-48",
|
|
2832
|
-
side: "right",
|
|
2833
|
-
align: "start",
|
|
2834
|
-
children: [
|
|
2835
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2836
|
-
DropdownMenuItem,
|
|
2837
|
-
{
|
|
2838
|
-
onClick: () => startEditing(thread),
|
|
2839
|
-
children: [
|
|
2840
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Edit2, { className: "mr-2 h-4 w-4" }),
|
|
2841
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: config.labels?.renameThread || "Rename" })
|
|
2842
|
-
]
|
|
2843
|
-
}
|
|
2844
|
-
),
|
|
2845
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2846
|
-
DropdownMenuItem,
|
|
2842
|
+
),
|
|
2843
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CollapsibleContent2, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SidebarGroupContent, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SidebarMenu, { children: group.threads.map((thread) => {
|
|
2844
|
+
const visibleTags = tagsEnabled ? (thread.tags ?? []).filter((tag) => tag.id !== group.tag?.id).slice(0, 2) : [];
|
|
2845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SidebarMenuItem, { children: [
|
|
2846
|
+
editingThreadId === thread.id ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center gap-1 px-2 py-1", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2847
|
+
Input,
|
|
2847
2848
|
{
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2849
|
+
ref: inputRef,
|
|
2850
|
+
value: editTitle,
|
|
2851
|
+
onChange: (e) => setEditTitle(e.target.value),
|
|
2852
|
+
onKeyDown: (e) => {
|
|
2853
|
+
if (e.key === "Enter") {
|
|
2854
|
+
saveEdit();
|
|
2855
|
+
}
|
|
2856
|
+
if (e.key === "Escape") {
|
|
2857
|
+
cancelEdit();
|
|
2858
|
+
}
|
|
2859
|
+
},
|
|
2860
|
+
onBlur: saveEdit,
|
|
2861
|
+
className: "h-7 text-sm"
|
|
2853
2862
|
}
|
|
2854
|
-
),
|
|
2855
|
-
|
|
2856
|
-
DropdownMenuItem,
|
|
2863
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2864
|
+
SidebarMenuButton,
|
|
2857
2865
|
{
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2866
|
+
isActive: currentThreadId === thread.id,
|
|
2867
|
+
onClick: () => onSelectThread?.(thread.id),
|
|
2868
|
+
tooltip: thread.title,
|
|
2869
|
+
draggable: canDragTags,
|
|
2870
|
+
className: "h-auto min-h-9 items-start py-1.5",
|
|
2871
|
+
onDragStart: () => setDraggingThreadId(thread.id),
|
|
2872
|
+
onDragEnd: () => {
|
|
2873
|
+
setDraggingThreadId(null);
|
|
2874
|
+
setDragOverTagId(null);
|
|
2861
2875
|
},
|
|
2862
2876
|
children: [
|
|
2863
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2864
|
-
|
|
2877
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2878
|
+
ThreadInitialsIcon,
|
|
2879
|
+
{
|
|
2880
|
+
title: thread.title || "?"
|
|
2881
|
+
}
|
|
2882
|
+
),
|
|
2883
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col items-start gap-1 group-data-[collapsible=icon]:hidden", children: [
|
|
2884
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w-full truncate leading-5", children: thread.title || "New Chat" }),
|
|
2885
|
+
visibleTags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "flex max-w-full flex-wrap gap-1", children: visibleTags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2886
|
+
ThreadTagBadge,
|
|
2887
|
+
{
|
|
2888
|
+
tag
|
|
2889
|
+
},
|
|
2890
|
+
tag.id
|
|
2891
|
+
)) })
|
|
2892
|
+
] }),
|
|
2893
|
+
thread.isArchived && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Archive, { className: "ml-auto mt-1 h-3 w-3 opacity-50 group-data-[collapsible=icon]:hidden" })
|
|
2865
2894
|
]
|
|
2866
2895
|
}
|
|
2867
2896
|
),
|
|
2868
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2897
|
+
!editingThreadId && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenu, { children: [
|
|
2898
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SidebarMenuAction, { showOnHover: true, children: [
|
|
2899
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.MoreHorizontal, {}),
|
|
2900
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: "More" })
|
|
2901
|
+
] }) }),
|
|
2902
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2903
|
+
DropdownMenuContent,
|
|
2904
|
+
{
|
|
2905
|
+
className: "w-48",
|
|
2906
|
+
side: "right",
|
|
2907
|
+
align: "start",
|
|
2908
|
+
children: [
|
|
2909
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2910
|
+
DropdownMenuItem,
|
|
2911
|
+
{
|
|
2912
|
+
onClick: () => startEditing(thread),
|
|
2913
|
+
children: [
|
|
2914
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Edit2, { className: "mr-2 h-4 w-4" }),
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: config.labels?.renameThread || "Rename" })
|
|
2916
|
+
]
|
|
2917
|
+
}
|
|
2918
|
+
),
|
|
2919
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2920
|
+
DropdownMenuItem,
|
|
2921
|
+
{
|
|
2922
|
+
onClick: () => onArchiveThread?.(thread.id),
|
|
2923
|
+
children: [
|
|
2924
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Archive, { className: "mr-2 h-4 w-4" }),
|
|
2925
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: thread.isArchived ? config.labels?.unarchiveThread || "Unarchive" : config.labels?.archiveThread || "Archive" })
|
|
2926
|
+
]
|
|
2927
|
+
}
|
|
2928
|
+
),
|
|
2929
|
+
canUpdateTags && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2930
|
+
DropdownMenuItem,
|
|
2931
|
+
{
|
|
2932
|
+
onClick: () => {
|
|
2933
|
+
setTagDialogThreadId(thread.id);
|
|
2934
|
+
setNewTagName("");
|
|
2935
|
+
},
|
|
2936
|
+
children: [
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Tag, { className: "mr-2 h-4 w-4" }),
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: config.labels?.manageTags || "Manage tags" })
|
|
2939
|
+
]
|
|
2940
|
+
}
|
|
2941
|
+
),
|
|
2942
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuSeparator, {}),
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2944
|
+
DropdownMenuItem,
|
|
2945
|
+
{
|
|
2946
|
+
onClick: () => setDeleteThreadId(thread.id),
|
|
2947
|
+
className: "text-destructive focus:text-destructive",
|
|
2948
|
+
children: [
|
|
2949
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.Trash2, { className: "mr-2 h-4 w-4" }),
|
|
2950
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: config.labels?.deleteThread || "Delete" })
|
|
2951
|
+
]
|
|
2952
|
+
}
|
|
2953
|
+
)
|
|
2954
|
+
]
|
|
2955
|
+
}
|
|
2956
|
+
)
|
|
2957
|
+
] })
|
|
2958
|
+
] }, thread.id);
|
|
2959
|
+
}) }) }) })
|
|
2960
|
+
]
|
|
2961
|
+
}
|
|
2962
|
+
)
|
|
2963
|
+
},
|
|
2964
|
+
group.key
|
|
2965
|
+
);
|
|
2966
|
+
})
|
|
2889
2967
|
] }),
|
|
2890
2968
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SidebarFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2891
2969
|
UserMenu,
|
|
@@ -2919,16 +2997,18 @@ var Sidebar2 = ({
|
|
|
2919
2997
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-2", children: [
|
|
2920
2998
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-sm font-medium", children: config.labels?.tags || "Tags" }),
|
|
2921
2999
|
(tagDialogThread.tags ?? []).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: config.labels?.untagged || "Untagged" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex flex-wrap gap-2", children: (tagDialogThread.tags ?? []).map((tag) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2922
|
-
|
|
3000
|
+
Badge,
|
|
2923
3001
|
{
|
|
2924
|
-
|
|
3002
|
+
variant: "secondary",
|
|
3003
|
+
className: "gap-1 rounded-md py-1 text-sm font-normal",
|
|
2925
3004
|
children: [
|
|
3005
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TagDot, { tag }),
|
|
2926
3006
|
tag.name,
|
|
2927
3007
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2928
3008
|
"button",
|
|
2929
3009
|
{
|
|
2930
3010
|
type: "button",
|
|
2931
|
-
className: "rounded hover:bg-background",
|
|
3011
|
+
className: "rounded-sm hover:bg-background/80",
|
|
2932
3012
|
onClick: () => removeTagFromThread(tagDialogThread, tag.id),
|
|
2933
3013
|
"aria-label": config.labels?.removeTag || "Remove tag",
|
|
2934
3014
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react8.X, { className: "h-3 w-3" })
|