thepopebot 1.2.36 → 1.2.37
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/lib/chat/actions.js +15 -0
- package/lib/chat/components/app-sidebar.js +11 -9
- package/lib/chat/components/app-sidebar.jsx +9 -6
- package/lib/chat/components/icons.js +25 -3
- package/lib/chat/components/icons.jsx +23 -3
- package/lib/chat/components/sidebar-history-item.js +4 -2
- package/lib/chat/components/sidebar-history-item.jsx +4 -2
- package/lib/chat/components/ui/dropdown-menu.js +1 -1
- package/lib/chat/components/ui/dropdown-menu.jsx +1 -1
- package/package.json +1 -1
package/lib/chat/actions.js
CHANGED
|
@@ -154,6 +154,21 @@ export async function markNotificationsRead() {
|
|
|
154
154
|
return { success: true };
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
158
|
+
// App info actions
|
|
159
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Get the installed package version (auth-gated, never in client bundle).
|
|
163
|
+
* @returns {Promise<string>}
|
|
164
|
+
*/
|
|
165
|
+
export async function getAppVersion() {
|
|
166
|
+
await requireAuth();
|
|
167
|
+
const { createRequire } = await import('module');
|
|
168
|
+
const require = createRequire(import.meta.url);
|
|
169
|
+
return require('../../../package.json').version;
|
|
170
|
+
}
|
|
171
|
+
|
|
157
172
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
158
173
|
// API Key actions
|
|
159
174
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { getUnreadNotificationCount } from "../actions.js";
|
|
4
|
+
import { CirclePlusIcon, PanelLeftIcon, MessageIcon, BellIcon, SwarmIcon } from "./icons.js";
|
|
5
|
+
import { getUnreadNotificationCount, getAppVersion } from "../actions.js";
|
|
6
6
|
import { SidebarHistory } from "./sidebar-history.js";
|
|
7
7
|
import { SidebarUserNav } from "./sidebar-user-nav.js";
|
|
8
8
|
import {
|
|
@@ -19,24 +19,26 @@ import {
|
|
|
19
19
|
} from "./ui/sidebar.js";
|
|
20
20
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip.js";
|
|
21
21
|
import { useChatNav } from "./chat-nav-context.js";
|
|
22
|
-
import pkg from "../../../package.json";
|
|
23
22
|
function AppSidebar({ user }) {
|
|
24
23
|
const { navigateToChat } = useChatNav();
|
|
25
24
|
const { state, open, setOpenMobile, toggleSidebar } = useSidebar();
|
|
26
25
|
const collapsed = state === "collapsed";
|
|
27
26
|
const [unreadCount, setUnreadCount] = useState(0);
|
|
27
|
+
const [version, setVersion] = useState("");
|
|
28
28
|
useEffect(() => {
|
|
29
29
|
getUnreadNotificationCount().then((count) => setUnreadCount(count)).catch(() => {
|
|
30
30
|
});
|
|
31
|
+
getAppVersion().then(setVersion).catch(() => {
|
|
32
|
+
});
|
|
31
33
|
}, []);
|
|
32
34
|
return /* @__PURE__ */ jsxs(Sidebar, { children: [
|
|
33
35
|
/* @__PURE__ */ jsxs(SidebarHeader, { children: [
|
|
34
36
|
/* @__PURE__ */ jsxs("div", { className: collapsed ? "flex justify-center" : "flex items-center justify-between", children: [
|
|
35
37
|
!collapsed && /* @__PURE__ */ jsxs("span", { className: "px-2 font-semibold text-lg", children: [
|
|
36
|
-
"The Pope Bot
|
|
37
|
-
/* @__PURE__ */ jsxs("span", { className: "text-[11px] font-normal text-muted-foreground", children: [
|
|
38
|
-
"v",
|
|
39
|
-
|
|
38
|
+
"The Pope Bot",
|
|
39
|
+
version && /* @__PURE__ */ jsxs("span", { className: "text-[11px] font-normal text-muted-foreground", children: [
|
|
40
|
+
" v",
|
|
41
|
+
version
|
|
40
42
|
] })
|
|
41
43
|
] }),
|
|
42
44
|
/* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
@@ -52,7 +54,7 @@ function AppSidebar({ user }) {
|
|
|
52
54
|
] })
|
|
53
55
|
] }),
|
|
54
56
|
/* @__PURE__ */ jsxs(SidebarMenu, { children: [
|
|
55
|
-
/* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(SidebarMenuItem, { className: "mb-2", children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
56
58
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
57
59
|
SidebarMenuButton,
|
|
58
60
|
{
|
|
@@ -62,7 +64,7 @@ function AppSidebar({ user }) {
|
|
|
62
64
|
setOpenMobile(false);
|
|
63
65
|
},
|
|
64
66
|
children: [
|
|
65
|
-
/* @__PURE__ */ jsx(
|
|
67
|
+
/* @__PURE__ */ jsx(CirclePlusIcon, { size: 16 }),
|
|
66
68
|
!collapsed && /* @__PURE__ */ jsx("span", { children: "New chat" })
|
|
67
69
|
]
|
|
68
70
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useState, useEffect } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import { getUnreadNotificationCount } from '../actions.js';
|
|
4
|
+
import { CirclePlusIcon, PanelLeftIcon, MessageIcon, BellIcon, SwarmIcon } from './icons.js';
|
|
5
|
+
import { getUnreadNotificationCount, getAppVersion } from '../actions.js';
|
|
6
6
|
import { SidebarHistory } from './sidebar-history.js';
|
|
7
7
|
import { SidebarUserNav } from './sidebar-user-nav.js';
|
|
8
8
|
import {
|
|
@@ -19,18 +19,21 @@ import {
|
|
|
19
19
|
} from './ui/sidebar.js';
|
|
20
20
|
import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip.js';
|
|
21
21
|
import { useChatNav } from './chat-nav-context.js';
|
|
22
|
-
import pkg from '../../../package.json';
|
|
23
22
|
|
|
24
23
|
export function AppSidebar({ user }) {
|
|
25
24
|
const { navigateToChat } = useChatNav();
|
|
26
25
|
const { state, open, setOpenMobile, toggleSidebar } = useSidebar();
|
|
27
26
|
const collapsed = state === 'collapsed';
|
|
28
27
|
const [unreadCount, setUnreadCount] = useState(0);
|
|
28
|
+
const [version, setVersion] = useState('');
|
|
29
29
|
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
getUnreadNotificationCount()
|
|
32
32
|
.then((count) => setUnreadCount(count))
|
|
33
33
|
.catch(() => {});
|
|
34
|
+
getAppVersion()
|
|
35
|
+
.then(setVersion)
|
|
36
|
+
.catch(() => {});
|
|
34
37
|
}, []);
|
|
35
38
|
|
|
36
39
|
return (
|
|
@@ -39,7 +42,7 @@ export function AppSidebar({ user }) {
|
|
|
39
42
|
{/* Top row: brand name + toggle icon (open) or just toggle icon (collapsed) */}
|
|
40
43
|
<div className={collapsed ? 'flex justify-center' : 'flex items-center justify-between'}>
|
|
41
44
|
{!collapsed && (
|
|
42
|
-
<span className="px-2 font-semibold text-lg">The Pope Bot <span className="text-[11px] font-normal text-muted-foreground">v{
|
|
45
|
+
<span className="px-2 font-semibold text-lg">The Pope Bot{version && <span className="text-[11px] font-normal text-muted-foreground"> v{version}</span>}</span>
|
|
43
46
|
)}
|
|
44
47
|
<Tooltip>
|
|
45
48
|
<TooltipTrigger asChild>
|
|
@@ -58,7 +61,7 @@ export function AppSidebar({ user }) {
|
|
|
58
61
|
|
|
59
62
|
<SidebarMenu>
|
|
60
63
|
{/* New chat */}
|
|
61
|
-
<SidebarMenuItem>
|
|
64
|
+
<SidebarMenuItem className="mb-2">
|
|
62
65
|
<Tooltip>
|
|
63
66
|
<TooltipTrigger asChild>
|
|
64
67
|
<SidebarMenuButton
|
|
@@ -68,7 +71,7 @@ export function AppSidebar({ user }) {
|
|
|
68
71
|
setOpenMobile(false);
|
|
69
72
|
}}
|
|
70
73
|
>
|
|
71
|
-
<
|
|
74
|
+
<CirclePlusIcon size={16} />
|
|
72
75
|
{!collapsed && <span>New chat</span>}
|
|
73
76
|
</SidebarMenuButton>
|
|
74
77
|
</TooltipTrigger>
|
|
@@ -516,9 +516,9 @@ function MoreHorizontalIcon({ size = 16 }) {
|
|
|
516
516
|
width: size,
|
|
517
517
|
height: size,
|
|
518
518
|
children: [
|
|
519
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "1" }),
|
|
520
|
-
/* @__PURE__ */ jsx("circle", { cx: "19", cy: "12", r: "1" }),
|
|
521
|
-
/* @__PURE__ */ jsx("circle", { cx: "5", cy: "12", r: "1" })
|
|
519
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "1.5" }),
|
|
520
|
+
/* @__PURE__ */ jsx("circle", { cx: "19", cy: "12", r: "1.5" }),
|
|
521
|
+
/* @__PURE__ */ jsx("circle", { cx: "5", cy: "12", r: "1.5" })
|
|
522
522
|
]
|
|
523
523
|
}
|
|
524
524
|
);
|
|
@@ -540,6 +540,27 @@ function PencilIcon({ size = 16 }) {
|
|
|
540
540
|
}
|
|
541
541
|
);
|
|
542
542
|
}
|
|
543
|
+
function CirclePlusIcon({ size = 16 }) {
|
|
544
|
+
return /* @__PURE__ */ jsxs(
|
|
545
|
+
"svg",
|
|
546
|
+
{
|
|
547
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
548
|
+
viewBox: "0 0 24 24",
|
|
549
|
+
fill: "none",
|
|
550
|
+
stroke: "currentColor",
|
|
551
|
+
strokeWidth: 2,
|
|
552
|
+
strokeLinecap: "round",
|
|
553
|
+
strokeLinejoin: "round",
|
|
554
|
+
width: size,
|
|
555
|
+
height: size,
|
|
556
|
+
children: [
|
|
557
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
558
|
+
/* @__PURE__ */ jsx("path", { d: "M8 12h8" }),
|
|
559
|
+
/* @__PURE__ */ jsx("path", { d: "M12 8v8" })
|
|
560
|
+
]
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
}
|
|
543
564
|
function LogOutIcon({ size = 16 }) {
|
|
544
565
|
return /* @__PURE__ */ jsxs(
|
|
545
566
|
"svg",
|
|
@@ -565,6 +586,7 @@ export {
|
|
|
565
586
|
BellIcon,
|
|
566
587
|
CheckIcon,
|
|
567
588
|
ChevronDownIcon,
|
|
589
|
+
CirclePlusIcon,
|
|
568
590
|
ClockIcon,
|
|
569
591
|
CopyIcon,
|
|
570
592
|
FileTextIcon,
|
|
@@ -510,9 +510,9 @@ export function MoreHorizontalIcon({ size = 16 }) {
|
|
|
510
510
|
width={size}
|
|
511
511
|
height={size}
|
|
512
512
|
>
|
|
513
|
-
<circle cx="12" cy="12" r="1" />
|
|
514
|
-
<circle cx="19" cy="12" r="1" />
|
|
515
|
-
<circle cx="5" cy="12" r="1" />
|
|
513
|
+
<circle cx="12" cy="12" r="1.5" />
|
|
514
|
+
<circle cx="19" cy="12" r="1.5" />
|
|
515
|
+
<circle cx="5" cy="12" r="1.5" />
|
|
516
516
|
</svg>
|
|
517
517
|
);
|
|
518
518
|
}
|
|
@@ -535,6 +535,26 @@ export function PencilIcon({ size = 16 }) {
|
|
|
535
535
|
);
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
+
export function CirclePlusIcon({ size = 16 }) {
|
|
539
|
+
return (
|
|
540
|
+
<svg
|
|
541
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
542
|
+
viewBox="0 0 24 24"
|
|
543
|
+
fill="none"
|
|
544
|
+
stroke="currentColor"
|
|
545
|
+
strokeWidth={2}
|
|
546
|
+
strokeLinecap="round"
|
|
547
|
+
strokeLinejoin="round"
|
|
548
|
+
width={size}
|
|
549
|
+
height={size}
|
|
550
|
+
>
|
|
551
|
+
<circle cx="12" cy="12" r="10" />
|
|
552
|
+
<path d="M8 12h8" />
|
|
553
|
+
<path d="M12 8v8" />
|
|
554
|
+
</svg>
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
|
|
538
558
|
export function LogOutIcon({ size = 16 }) {
|
|
539
559
|
return (
|
|
540
560
|
<svg
|
|
@@ -66,6 +66,7 @@ function SidebarHistoryItem({ chat, isActive, onDelete, onStar, onRename }) {
|
|
|
66
66
|
] }) : /* @__PURE__ */ jsxs(
|
|
67
67
|
SidebarMenuButton,
|
|
68
68
|
{
|
|
69
|
+
className: "pr-8",
|
|
69
70
|
isActive,
|
|
70
71
|
onClick: () => {
|
|
71
72
|
navigateToChat(chat.id);
|
|
@@ -97,10 +98,11 @@ function SidebarHistoryItem({ chat, isActive, onDelete, onStar, onRename }) {
|
|
|
97
98
|
{
|
|
98
99
|
className: cn(
|
|
99
100
|
"rounded-md p-1",
|
|
100
|
-
"text-muted-foreground hover:text-foreground
|
|
101
|
+
"text-muted-foreground hover:text-foreground",
|
|
102
|
+
"bg-foreground/10 hover:bg-foreground/15"
|
|
101
103
|
),
|
|
102
104
|
"aria-label": "Chat options",
|
|
103
|
-
children: /* @__PURE__ */ jsx(MoreHorizontalIcon, { size:
|
|
105
|
+
children: /* @__PURE__ */ jsx(MoreHorizontalIcon, { size: 16 })
|
|
104
106
|
}
|
|
105
107
|
) }),
|
|
106
108
|
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", side: "bottom", children: [
|
|
@@ -70,6 +70,7 @@ export function SidebarHistoryItem({ chat, isActive, onDelete, onStar, onRename
|
|
|
70
70
|
</div>
|
|
71
71
|
) : (
|
|
72
72
|
<SidebarMenuButton
|
|
73
|
+
className="pr-8"
|
|
73
74
|
isActive={isActive}
|
|
74
75
|
onClick={() => {
|
|
75
76
|
navigateToChat(chat.id);
|
|
@@ -100,11 +101,12 @@ export function SidebarHistoryItem({ chat, isActive, onDelete, onStar, onRename
|
|
|
100
101
|
<button
|
|
101
102
|
className={cn(
|
|
102
103
|
'rounded-md p-1',
|
|
103
|
-
'text-muted-foreground hover:text-foreground
|
|
104
|
+
'text-muted-foreground hover:text-foreground',
|
|
105
|
+
'bg-foreground/10 hover:bg-foreground/15'
|
|
104
106
|
)}
|
|
105
107
|
aria-label="Chat options"
|
|
106
108
|
>
|
|
107
|
-
<MoreHorizontalIcon size={
|
|
109
|
+
<MoreHorizontalIcon size={16} />
|
|
108
110
|
</button>
|
|
109
111
|
</DropdownMenuTrigger>
|
|
110
112
|
<DropdownMenuContent align="end" side="bottom">
|
|
@@ -47,7 +47,7 @@ function DropdownMenuContent({ children, className, align = "start", side = "bot
|
|
|
47
47
|
{
|
|
48
48
|
ref,
|
|
49
49
|
className: cn(
|
|
50
|
-
"absolute z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-
|
|
50
|
+
"absolute z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-background/80 backdrop-blur-sm p-1 text-foreground shadow-lg",
|
|
51
51
|
side === "bottom" && `top-full mt-1`,
|
|
52
52
|
side === "top" && `bottom-full mb-1`,
|
|
53
53
|
align === "end" && "right-0",
|
|
@@ -65,7 +65,7 @@ export function DropdownMenuContent({ children, className, align = 'start', side
|
|
|
65
65
|
<div
|
|
66
66
|
ref={ref}
|
|
67
67
|
className={cn(
|
|
68
|
-
'absolute z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-
|
|
68
|
+
'absolute z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-background/80 backdrop-blur-sm p-1 text-foreground shadow-lg',
|
|
69
69
|
side === 'bottom' && `top-full mt-1`,
|
|
70
70
|
side === 'top' && `bottom-full mb-1`,
|
|
71
71
|
align === 'end' && 'right-0',
|