captify 0.1.19 → 1.1.1
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/agents/components/agents-list-header.d.ts.map +1 -1
- package/dist/agents/components/agents-list-header.js +3 -2
- package/dist/agents/components/agents-list-header.js.map +1 -1
- package/dist/chat/components/chat-content-approval.d.ts.map +1 -1
- package/dist/chat/components/chat-content-approval.js.map +1 -1
- package/dist/chat/components/chat-context-toggle.d.ts.map +1 -1
- package/dist/chat/components/chat-context-toggle.js +2 -4
- package/dist/chat/components/chat-context-toggle.js.map +1 -1
- package/dist/comments/comments.constants.d.ts +8 -1
- package/dist/comments/comments.constants.d.ts.map +1 -1
- package/dist/comments/comments.constants.js +18 -0
- package/dist/comments/comments.constants.js.map +1 -1
- package/dist/comments/comments.interfaces.d.ts +5 -0
- package/dist/comments/comments.interfaces.d.ts.map +1 -1
- package/dist/comments/comments.utilities.d.ts +30 -1
- package/dist/comments/comments.utilities.d.ts.map +1 -1
- package/dist/comments/comments.utilities.js +41 -1
- package/dist/comments/comments.utilities.js.map +1 -1
- package/dist/comments/hooks/use-comments.d.ts.map +1 -1
- package/dist/comments/hooks/use-comments.js +1 -0
- package/dist/comments/hooks/use-comments.js.map +1 -1
- package/dist/comments/services/comments.factory.d.ts.map +1 -1
- package/dist/comments/services/comments.factory.js +5 -2
- package/dist/comments/services/comments.factory.js.map +1 -1
- package/dist/comments/services/comments.service.d.ts +9 -2
- package/dist/comments/services/comments.service.d.ts.map +1 -1
- package/dist/comments/services/comments.service.js +96 -4
- package/dist/comments/services/comments.service.js.map +1 -1
- package/dist/db/schemas/index.d.ts +6 -4
- package/dist/db/schemas/index.d.ts.map +1 -1
- package/dist/db/schemas/index.js +2 -1
- package/dist/db/schemas/index.js.map +1 -1
- package/dist/db/schemas/notifications.schema.d.ts +107 -0
- package/dist/db/schemas/notifications.schema.d.ts.map +1 -0
- package/dist/db/schemas/notifications.schema.js +124 -0
- package/dist/db/schemas/notifications.schema.js.map +1 -0
- package/dist/feedback/api/feedback.handlers.d.ts.map +1 -1
- package/dist/feedback/api/feedback.handlers.js +1 -0
- package/dist/feedback/api/feedback.handlers.js.map +1 -1
- package/dist/feedback/components/feedback-editor.d.ts.map +1 -1
- package/dist/feedback/components/feedback-editor.js +6 -4
- package/dist/feedback/components/feedback-editor.js.map +1 -1
- package/dist/feedback/feedback.interfaces.d.ts +24 -1
- package/dist/feedback/feedback.interfaces.d.ts.map +1 -1
- package/dist/feedback/services/feedback.service.d.ts +26 -3
- package/dist/feedback/services/feedback.service.d.ts.map +1 -1
- package/dist/feedback/services/feedback.service.js +270 -11
- package/dist/feedback/services/feedback.service.js.map +1 -1
- package/dist/files/components/folder-browser/folder-breadcrumb.d.ts.map +1 -1
- package/dist/files/components/folder-browser/folder-breadcrumb.js +1 -1
- package/dist/files/components/folder-browser/folder-breadcrumb.js.map +1 -1
- package/dist/files/components/folder-browser/folder-list-item.js +1 -1
- package/dist/files/components/folder-browser/folder-list-item.js.map +1 -1
- package/dist/files/components/folder-browser/folder-tree-item.d.ts.map +1 -1
- package/dist/files/components/folder-browser/folder-tree-item.js +1 -1
- package/dist/files/components/folder-browser/folder-tree-item.js.map +1 -1
- package/dist/files/components/folder-browser/folder-tree-sidebar.js +1 -1
- package/dist/files/components/folder-browser/folder-tree-sidebar.js.map +1 -1
- package/dist/notifications/api/index.d.ts +7 -0
- package/dist/notifications/api/index.d.ts.map +1 -0
- package/dist/notifications/api/index.js +8 -0
- package/dist/notifications/api/index.js.map +1 -0
- package/dist/notifications/api/notifications.client.d.ts +86 -0
- package/dist/notifications/api/notifications.client.d.ts.map +1 -0
- package/dist/notifications/api/notifications.client.js +102 -0
- package/dist/notifications/api/notifications.client.js.map +1 -0
- package/dist/notifications/api/notifications.handlers.d.ts +166 -0
- package/dist/notifications/api/notifications.handlers.d.ts.map +1 -0
- package/dist/notifications/api/notifications.handlers.js +187 -0
- package/dist/notifications/api/notifications.handlers.js.map +1 -0
- package/dist/notifications/hooks/index.d.ts +5 -0
- package/dist/notifications/hooks/index.d.ts.map +1 -0
- package/dist/notifications/hooks/index.js +5 -0
- package/dist/notifications/hooks/index.js.map +1 -0
- package/dist/notifications/hooks/use-notifications-api.d.ts +111 -0
- package/dist/notifications/hooks/use-notifications-api.d.ts.map +1 -0
- package/dist/notifications/hooks/use-notifications-api.js +253 -0
- package/dist/notifications/hooks/use-notifications-api.js.map +1 -0
- package/dist/notifications/index.d.ts +16 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +18 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/notification.utilities.d.ts +12 -0
- package/dist/notifications/notification.utilities.d.ts.map +1 -0
- package/dist/notifications/notification.utilities.js +35 -0
- package/dist/notifications/notification.utilities.js.map +1 -0
- package/dist/notifications/notifications.constants.d.ts +72 -0
- package/dist/notifications/notifications.constants.d.ts.map +1 -0
- package/dist/notifications/notifications.constants.js +104 -0
- package/dist/notifications/notifications.constants.js.map +1 -0
- package/dist/notifications/notifications.errors.d.ts +35 -0
- package/dist/notifications/notifications.errors.d.ts.map +1 -0
- package/dist/notifications/notifications.errors.js +51 -0
- package/dist/notifications/notifications.errors.js.map +1 -0
- package/dist/notifications/notifications.interfaces.d.ts +116 -0
- package/dist/notifications/notifications.interfaces.d.ts.map +1 -0
- package/dist/notifications/notifications.interfaces.js +10 -0
- package/dist/notifications/notifications.interfaces.js.map +1 -0
- package/dist/notifications/notifications.schemas.d.ts +139 -0
- package/dist/notifications/notifications.schemas.d.ts.map +1 -0
- package/dist/notifications/notifications.schemas.js +167 -0
- package/dist/notifications/notifications.schemas.js.map +1 -0
- package/dist/notifications/services/index.d.ts +6 -0
- package/dist/notifications/services/index.d.ts.map +1 -0
- package/dist/notifications/services/index.js +6 -0
- package/dist/notifications/services/index.js.map +1 -0
- package/dist/notifications/services/notifications.factory.d.ts +19 -0
- package/dist/notifications/services/notifications.factory.d.ts.map +1 -0
- package/dist/notifications/services/notifications.factory.js +58 -0
- package/dist/notifications/services/notifications.factory.js.map +1 -0
- package/dist/notifications/services/notifications.service.d.ts +88 -0
- package/dist/notifications/services/notifications.service.d.ts.map +1 -0
- package/dist/notifications/services/notifications.service.js +620 -0
- package/dist/notifications/services/notifications.service.js.map +1 -0
- package/dist/permissions/api/permissions.handlers.d.ts +20 -20
- package/dist/permissions/components/resource-panel.d.ts.map +1 -1
- package/dist/permissions/components/resource-panel.js +2 -1
- package/dist/permissions/components/resource-panel.js.map +1 -1
- package/dist/permissions/hooks/index.d.ts +1 -0
- package/dist/permissions/hooks/index.d.ts.map +1 -1
- package/dist/permissions/hooks/index.js +1 -0
- package/dist/permissions/hooks/index.js.map +1 -1
- package/dist/permissions/hooks/use-notification-permissions.d.ts +19 -0
- package/dist/permissions/hooks/use-notification-permissions.d.ts.map +1 -0
- package/dist/permissions/hooks/use-notification-permissions.js +32 -0
- package/dist/permissions/hooks/use-notification-permissions.js.map +1 -0
- package/dist/permissions/hooks/use-permissions-dashboard.d.ts +6 -6
- package/dist/permissions/hooks/use-policies.d.ts +2 -2
- package/dist/permissions/permissions.constants.d.ts +5 -0
- package/dist/permissions/permissions.constants.d.ts.map +1 -1
- package/dist/permissions/permissions.constants.js +35 -0
- package/dist/permissions/permissions.constants.js.map +1 -1
- package/dist/permissions/permissions.interfaces.d.ts +12 -0
- package/dist/permissions/permissions.interfaces.d.ts.map +1 -1
- package/dist/permissions/permissions.schemas.d.ts +56 -21
- package/dist/permissions/permissions.schemas.d.ts.map +1 -1
- package/dist/permissions/permissions.schemas.js +6 -1
- package/dist/permissions/permissions.schemas.js.map +1 -1
- package/dist/search/components/global-search-bar.d.ts.map +1 -1
- package/dist/search/components/global-search-bar.js +10 -11
- package/dist/search/components/global-search-bar.js.map +1 -1
- package/dist/shared/components/skeleton/console-layout-skeleton.d.ts +9 -21
- package/dist/shared/components/skeleton/console-layout-skeleton.d.ts.map +1 -1
- package/dist/shared/components/skeleton/console-layout-skeleton.js +13 -29
- package/dist/shared/components/skeleton/console-layout-skeleton.js.map +1 -1
- package/dist/shared/components/ui/sidebar.js +9 -9
- package/dist/shared/components/ui/sidebar.js.map +1 -1
- package/dist/shared/shared.constants.d.ts +1 -0
- package/dist/shared/shared.constants.d.ts.map +1 -1
- package/dist/shared/shared.constants.js +1 -0
- package/dist/shared/shared.constants.js.map +1 -1
- package/dist/shared/shared.interfaces.d.ts +0 -1
- package/dist/shared/shared.interfaces.d.ts.map +1 -1
- package/dist/shell/components/ConsoleLayout.d.ts +1 -1
- package/dist/shell/components/ConsoleLayout.d.ts.map +1 -1
- package/dist/shell/components/ConsoleLayout.js +6 -3
- package/dist/shell/components/ConsoleLayout.js.map +1 -1
- package/dist/shell/components/app-launcher/app-launcher-search-bar.js +1 -1
- package/dist/shell/components/app-launcher/app-launcher-search-bar.js.map +1 -1
- package/dist/shell/components/app-launcher/app-launcher.d.ts.map +1 -1
- package/dist/shell/components/app-launcher/app-launcher.js +2 -1
- package/dist/shell/components/app-launcher/app-launcher.js.map +1 -1
- package/dist/shell/components/app-launcher/category-navigation.d.ts.map +1 -1
- package/dist/shell/components/app-launcher/category-navigation.js +9 -2
- package/dist/shell/components/app-launcher/category-navigation.js.map +1 -1
- package/dist/shell/components/app-launcher/left-sidebar.d.ts +1 -1
- package/dist/shell/components/app-launcher/left-sidebar.d.ts.map +1 -1
- package/dist/shell/components/app-launcher/left-sidebar.js +3 -4
- package/dist/shell/components/app-launcher/left-sidebar.js.map +1 -1
- package/dist/shell/components/app-launcher/service-item.d.ts.map +1 -1
- package/dist/shell/components/app-launcher/service-item.js +2 -2
- package/dist/shell/components/app-launcher/service-item.js.map +1 -1
- package/dist/shell/components/index.d.ts +1 -0
- package/dist/shell/components/index.d.ts.map +1 -1
- package/dist/shell/components/index.js +2 -0
- package/dist/shell/components/index.js.map +1 -1
- package/dist/shell/components/layouts/app-sidebar.d.ts +4 -1
- package/dist/shell/components/layouts/app-sidebar.d.ts.map +1 -1
- package/dist/shell/components/layouts/app-sidebar.js +39 -6
- package/dist/shell/components/layouts/app-sidebar.js.map +1 -1
- package/dist/shell/components/layouts/content-header.d.ts.map +1 -1
- package/dist/shell/components/layouts/content-header.js +5 -24
- package/dist/shell/components/layouts/content-header.js.map +1 -1
- package/dist/shell/components/layouts/index.d.ts +1 -3
- package/dist/shell/components/layouts/index.d.ts.map +1 -1
- package/dist/shell/components/layouts/index.js +1 -3
- package/dist/shell/components/layouts/index.js.map +1 -1
- package/dist/shell/components/layouts/sidebar-nested-item.d.ts.map +1 -1
- package/dist/shell/components/layouts/sidebar-nested-item.js +12 -5
- package/dist/shell/components/layouts/sidebar-nested-item.js.map +1 -1
- package/dist/shell/components/notifications/notification-container.d.ts +16 -2
- package/dist/shell/components/notifications/notification-container.d.ts.map +1 -1
- package/dist/shell/components/notifications/notification-container.js +75 -4
- package/dist/shell/components/notifications/notification-container.js.map +1 -1
- package/dist/shell/components/notifications/notification-item.d.ts +1 -1
- package/dist/shell/components/notifications/notification-item.d.ts.map +1 -1
- package/dist/shell/components/notifications/notification-item.js +26 -7
- package/dist/shell/components/notifications/notification-item.js.map +1 -1
- package/dist/shell/components/notifications/notification-panel-header.d.ts.map +1 -1
- package/dist/shell/components/notifications/notification-panel-header.js +4 -1
- package/dist/shell/components/notifications/notification-panel-header.js.map +1 -1
- package/dist/shell/components/notifications/notifications.d.ts +1 -1
- package/dist/shell/components/notifications/notifications.d.ts.map +1 -1
- package/dist/shell/components/notifications/notifications.js +2 -2
- package/dist/shell/components/notifications/notifications.js.map +1 -1
- package/dist/shell/components/toolbars/index.d.ts +1 -4
- package/dist/shell/components/toolbars/index.d.ts.map +1 -1
- package/dist/shell/components/toolbars/index.js +2 -5
- package/dist/shell/components/toolbars/index.js.map +1 -1
- package/dist/shell/components/toolbars/top-right-toolbar.d.ts +1 -1
- package/dist/shell/components/toolbars/top-right-toolbar.d.ts.map +1 -1
- package/dist/shell/components/toolbars/top-right-toolbar.js +2 -2
- package/dist/shell/components/toolbars/top-right-toolbar.js.map +1 -1
- package/dist/shell/components/toolbars/top-toolbar-feedback.js +1 -1
- package/dist/shell/components/toolbars/top-toolbar-feedback.js.map +1 -1
- package/dist/shell/shell.constants.d.ts +1 -1
- package/dist/shell/shell.constants.js +1 -1
- package/dist/shell/shell.interfaces.d.ts +8 -4
- package/dist/shell/shell.interfaces.d.ts.map +1 -1
- package/dist/shell/shell.utilities.d.ts +7 -0
- package/dist/shell/shell.utilities.d.ts.map +1 -1
- package/dist/shell/shell.utilities.js +17 -0
- package/dist/shell/shell.utilities.js.map +1 -1
- package/package.json +130 -12
- package/dist/chat/components/chat-assistant-legacy.d.ts +0 -9
- package/dist/chat/components/chat-assistant-legacy.d.ts.map +0 -1
- package/dist/chat/components/chat-assistant-legacy.js +0 -73
- package/dist/chat/components/chat-assistant-legacy.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/shell/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,UAAU;AACV,cAAc,gCAAgC,CAAC;AAE/C,iBAAiB;AACjB,cAAc,sCAAsC,CAAC;AAErD,WAAW;AACX,cAAc,iCAAiC,CAAC;AAEhD,eAAe;AACf,cAAc,qCAAqC,CAAC;AAEpD,gBAAgB;AAChB,cAAc,sCAAsC,CAAC;AAErD,UAAU;AACV,cAAc,gCAAgC,CAAC;AAE/C,WAAW;AACX,cAAc,2DAA2D,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/shell/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,UAAU;AACV,cAAc,gCAAgC,CAAC;AAE/C,iBAAiB;AACjB,cAAc,sCAAsC,CAAC;AAErD,gBAAgB;AAChB,cAAc,sCAAsC,CAAC;AAErD,WAAW;AACX,cAAc,iCAAiC,CAAC;AAEhD,eAAe;AACf,cAAc,qCAAqC,CAAC;AAEpD,gBAAgB;AAChB,cAAc,sCAAsC,CAAC;AAErD,UAAU;AACV,cAAc,gCAAgC,CAAC;AAE/C,WAAW;AACX,cAAc,2DAA2D,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { RouteItem } from "../../shell.interfaces";
|
|
2
|
+
import type { Session } from "next-auth";
|
|
2
3
|
interface AppSidebarProps {
|
|
3
4
|
menuItems?: RouteItem[];
|
|
4
5
|
adminMenuItems?: RouteItem[];
|
|
6
|
+
session?: Session;
|
|
7
|
+
appName?: string;
|
|
5
8
|
}
|
|
6
|
-
declare const AppSidebar: ({ menuItems, adminMenuItems }: AppSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const AppSidebar: ({ menuItems, adminMenuItems, session: sessionProp, appName, }: AppSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export default AppSidebar;
|
|
8
11
|
//# sourceMappingURL=app-sidebar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/app-sidebar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/app-sidebar.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,UAAU,GAAI,+DAKjB,eAAe,4CAwRjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,16 +1,43 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useBookmarkContext } from "../../../bookmarks/components";
|
|
4
|
-
import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupLabel, } from "../../../shared/components/ui/sidebar";
|
|
5
4
|
import { COLLABORATION_ROUTES } from "../../../collaboration/collaboration.constants";
|
|
5
|
+
import { TooltipButton } from "../../../shared/components/tooltip-button";
|
|
6
|
+
import { Avatar, AvatarFallback, AvatarImage } from "../../../shared/components/ui/avatar";
|
|
7
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "../../../shared/components/ui/dropdown-menu";
|
|
8
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, useSidebar, } from "../../../shared/components/ui/sidebar";
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../shared/components/ui/tooltip";
|
|
6
10
|
import { ADMIN_MENU_ITEMS } from "../../../shared/config";
|
|
7
11
|
import { cn } from "../../../shared/utilities/cn";
|
|
12
|
+
import { getInitials } from "../../../shared/utilities/string-utilities";
|
|
13
|
+
import { AppLauncher } from "../app-launcher";
|
|
8
14
|
import { SidebarMenuList } from "./sidebar-menu-list";
|
|
9
15
|
import { useNavPermissions } from "../../hooks";
|
|
10
16
|
import { DEFAULT_SIDEBAR_HEADER } from "../../shell.constants";
|
|
17
|
+
import { getAppTitle, getEnvironmentFromHost } from "../../shell.utilities";
|
|
18
|
+
import { LogOut, Monitor, Moon, Sun, User } from "lucide-react";
|
|
19
|
+
import { signOut, useSession } from "next-auth/react";
|
|
20
|
+
import { useTheme } from "next-themes";
|
|
21
|
+
import { useRouter } from "next/navigation";
|
|
11
22
|
import { useMemo } from "react";
|
|
12
|
-
const AppSidebar = ({ menuItems, adminMenuItems = ADMIN_MENU_ITEMS }) => {
|
|
13
|
-
|
|
23
|
+
const AppSidebar = ({ menuItems, adminMenuItems = ADMIN_MENU_ITEMS, session: sessionProp, appName = "TITAN", }) => {
|
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
25
|
+
const { activeService } = useBookmarkContext();
|
|
26
|
+
const { data: sessionData } = useSession();
|
|
27
|
+
const session = sessionProp || sessionData;
|
|
28
|
+
const router = useRouter();
|
|
29
|
+
const { setTheme, theme } = useTheme();
|
|
30
|
+
const { toggleSidebar } = useSidebar();
|
|
31
|
+
// Get environment-aware app name
|
|
32
|
+
const displayAppName = useMemo(() => {
|
|
33
|
+
const environment = getEnvironmentFromHost();
|
|
34
|
+
return getAppTitle(appName, environment);
|
|
35
|
+
}, [appName]);
|
|
36
|
+
const themeOptions = [
|
|
37
|
+
{ value: "light", icon: Sun, label: "Light" },
|
|
38
|
+
{ value: "dark", icon: Moon, label: "Dark" },
|
|
39
|
+
{ value: "system", icon: Monitor, label: "System" },
|
|
40
|
+
];
|
|
14
41
|
// Permission-based navigation filtering
|
|
15
42
|
const { canViewAgents, canViewDocuments, canViewCollaboration, canViewLlm, canViewLlmBudgets, canViewLlmUsage, canViewUsers, canViewGroups, canViewOntology, canViewPermissions, canViewFeedbacks, canViewSearchIndices, } = useNavPermissions();
|
|
16
43
|
// Priority: activeService.menuItems > menuItems prop > empty array
|
|
@@ -87,9 +114,15 @@ const AppSidebar = ({ menuItems, adminMenuItems = ADMIN_MENU_ITEMS }) => {
|
|
|
87
114
|
canViewFeedbacks,
|
|
88
115
|
canViewSearchIndices,
|
|
89
116
|
]);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
117
|
+
const userInitial = useMemo(() => {
|
|
118
|
+
var _a;
|
|
119
|
+
if (!((_a = session === null || session === void 0 ? void 0 : session.user) === null || _a === void 0 ? void 0 : _a.name))
|
|
120
|
+
return "?";
|
|
121
|
+
return getInitials(session.user.name || "User");
|
|
122
|
+
}, [session]);
|
|
123
|
+
return (_jsxs(Sidebar, { collapsible: "icon", className: cn("bg-sidebar text-sidebar-foreground border-sidebar-border"), id: "sidebar-content", role: "navigation", "aria-label": "Main navigation", children: [_jsxs(SidebarHeader, { className: "border-sidebar-border border-b", children: [_jsx("div", { className: "group-data-[collapsible=icon]:hidden", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(TooltipButton, { tooltip: "Toggle sidebar", variant: "ghost", size: "icon", onClick: toggleSidebar, className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground size-8 shrink-0", "aria-label": "Toggle sidebar", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }), _jsx("path", { d: "M9 3v18" })] }) }), _jsx("div", { className: "bg-sidebar-primary flex size-8 items-center justify-center", children: _jsx("span", { className: "text-sidebar-primary-foreground text-lg font-bold", children: "T" }) }), _jsx("span", { className: "text-sidebar-foreground flex-1 text-lg font-bold", children: displayAppName }), _jsx("div", { className: "[&_button]:text-sidebar-foreground [&_button]:hover:bg-sidebar-accent [&_button]:hover:text-sidebar-foreground", children: _jsx(AppLauncher, {}) })] }) }), _jsxs("div", { className: "hidden flex-col items-center gap-2 group-data-[collapsible=icon]:flex", children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("div", { className: "bg-sidebar-primary flex size-8 cursor-default items-center justify-center", children: _jsx("span", { className: "text-sidebar-primary-foreground text-sm font-bold", children: "T" }) }) }), _jsx(TooltipContent, { side: "right", children: displayAppName })] }), _jsx("div", { className: "[&_button]:text-sidebar-foreground [&_button]:hover:bg-sidebar-accent", children: _jsx(AppLauncher, {}) }), _jsx(TooltipButton, { tooltip: "Toggle sidebar", variant: "ghost", size: "icon", onClick: toggleSidebar, className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground size-8 shrink-0", "aria-label": "Toggle sidebar", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }), _jsx("path", { d: "M9 3v18" })] }) })] })] }), _jsx(SidebarContent, { className: "bg-sidebar", children: _jsxs(SidebarGroup, { className: "px-0", children: [_jsx(SidebarGroupLabel, { className: "text-sidebar-foreground/70 px-2", children: activeService ? activeService.name : DEFAULT_SIDEBAR_HEADER }), _jsx(SidebarMenuList, { items: resolvedMenuItems })] }) }), _jsx(SidebarFooter, { className: "border-sidebar-border border-t", children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { className: "hover:bg-sidebar-accent focus-visible:ring-sidebar-ring flex w-full items-center gap-3 text-left group-data-[collapsible=icon]:justify-center focus:outline-none focus-visible:ring-2", children: [_jsxs(Avatar, { className: "size-8 shrink-0", children: [_jsx(AvatarImage, { src: (_b = (_a = session === null || session === void 0 ? void 0 : session.user) === null || _a === void 0 ? void 0 : _a.image) !== null && _b !== void 0 ? _b : undefined, alt: "User Profile" }), _jsx(AvatarFallback, { className: "bg-sidebar-primary text-sidebar-primary-foreground text-sm font-semibold", children: userInitial })] }), _jsxs("div", { className: "flex flex-1 flex-col overflow-hidden group-data-[collapsible=icon]:hidden", children: [_jsx("span", { className: "text-sidebar-foreground truncate text-sm font-semibold", children: ((_c = session === null || session === void 0 ? void 0 : session.user) === null || _c === void 0 ? void 0 : _c.name) || "User" }), _jsx("span", { className: "text-sidebar-foreground/60 truncate text-xs", children: ((_d = session === null || session === void 0 ? void 0 : session.user) === null || _d === void 0 ? void 0 : _d.email) || "" })] })] }) }), _jsxs(DropdownMenuContent, { className: "w-56", align: "end", side: "top", children: [_jsx(DropdownMenuLabel, { className: "sr-only", children: "User Profile" }), _jsxs("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [_jsxs(Avatar, { className: "size-8", children: [_jsx(AvatarImage, { src: (_f = (_e = session === null || session === void 0 ? void 0 : session.user) === null || _e === void 0 ? void 0 : _e.image) !== null && _f !== void 0 ? _f : undefined, alt: "User Profile" }), _jsx(AvatarFallback, { children: userInitial })] }), _jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [_jsx("span", { className: "truncate font-medium", children: ((_g = session === null || session === void 0 ? void 0 : session.user) === null || _g === void 0 ? void 0 : _g.name) || "User" }), _jsx("span", { className: "truncate text-xs text-gray-600", children: ((_h = session === null || session === void 0 ? void 0 : session.user) === null || _h === void 0 ? void 0 : _h.email) || "" })] })] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => router.push("/profile"), children: [_jsx(User, { "aria-hidden": "true" }), "Profile"] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => signOut(), children: [_jsx(LogOut, { "aria-hidden": "true" }), "Log out"] })] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuLabel, { children: "Theme" }), _jsx(DropdownMenuGroup, { children: _jsx("div", { className: "inline-flex gap-1 bg-neutral-100 dark:bg-neutral-800", children: themeOptions.map(({ value, icon: Icon, label }) => (_jsx(DropdownMenuItem, { onClick: () => setTheme(value), className: cn("flex cursor-pointer items-center transition-colors hover:bg-neutral-200/60 hover:text-black", theme === value
|
|
124
|
+
? "bg-white shadow-sm dark:bg-neutral-700 dark:text-neutral-100"
|
|
125
|
+
: "text-gray-600 hover:bg-neutral-200/60 hover:text-black dark:text-neutral-400 dark:hover:bg-neutral-700/60"), "data-testid": "sidebar-theme-option", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { className: "flex items-center justify-center", children: _jsx(Icon, { className: "-ml-1 size-4", "aria-hidden": "true" }) }) }), _jsx(TooltipContent, { side: "top", className: "z-[60]", children: label })] }) }, value))) }) })] })] }) })] }));
|
|
93
126
|
};
|
|
94
127
|
export default AppSidebar;
|
|
95
128
|
//# sourceMappingURL=app-sidebar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-sidebar.js","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/app-sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,OAAO,EACP,cAAc,EACd,YAAY,EACZ,iBAAiB,
|
|
1
|
+
{"version":3,"file":"app-sidebar.js","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/app-sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,OAAO,EACP,cAAc,EACd,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,GACX,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;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MAAC,OAAO,eACN,KAAC,cAAc,IAAC,OAAO,kBACrB,eAAM,SAAS,EAAC,kCAAkC,YAChD,KAAC,IAAI,IAAC,SAAS,EAAC,cAAc,iBAAa,MAAM,GAAG,GAC/C,GACQ,EACjB,KAAC,cAAc,IAAC,IAAI,EAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,YAC1C,KAAK,GACS,IACT,IAnBL,KAAK,CAoBO,CACpB,CAAC,GACE,GACY,IACA,IACT,GACD,IACR,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-header.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/content-header.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa,+
|
|
1
|
+
{"version":3,"file":"content-header.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/content-header.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa,+CAiCzB,CAAC"}
|
|
@@ -2,34 +2,15 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { BreadcrumbComponent } from "../../../breadcrumb/components";
|
|
4
4
|
import { useBreadcrumbOverrides } from "../../../breadcrumb/hooks";
|
|
5
|
-
import { capitalizeWords } from "../../../shared/utilities/string-utilities";
|
|
6
|
-
import { usePathname } from "next/navigation";
|
|
7
|
-
import { useMemo, useCallback } from "react";
|
|
8
5
|
import { GlobalSearchBar } from "../../../search/components/global-search-bar";
|
|
9
|
-
import
|
|
6
|
+
import { capitalizeWords } from "../../../shared/utilities/string-utilities";
|
|
7
|
+
import NotificationContainer from "../notifications/notification-container";
|
|
10
8
|
import { TopToolbarFeedback } from "../toolbars/top-toolbar-feedback";
|
|
9
|
+
import { usePathname } from "next/navigation";
|
|
10
|
+
import { useMemo } from "react";
|
|
11
11
|
export const ContentHeader = () => {
|
|
12
12
|
const pathname = usePathname();
|
|
13
13
|
const overrides = useBreadcrumbOverrides();
|
|
14
|
-
// Empty notifications for now - can be populated from server/context later
|
|
15
|
-
const notifications = useMemo(() => [], []);
|
|
16
|
-
const unreadCount = 0;
|
|
17
|
-
const hasMore = false;
|
|
18
|
-
const markAsRead = useCallback((_id) => {
|
|
19
|
-
// TODO: Implement mark as read
|
|
20
|
-
}, []);
|
|
21
|
-
const markAllAsRead = useCallback(() => {
|
|
22
|
-
// TODO: Implement mark all as read
|
|
23
|
-
}, []);
|
|
24
|
-
const dismissAll = useCallback(() => {
|
|
25
|
-
// TODO: Implement dismiss all
|
|
26
|
-
}, []);
|
|
27
|
-
const dismiss = useCallback((_id) => {
|
|
28
|
-
// TODO: Implement dismiss
|
|
29
|
-
}, []);
|
|
30
|
-
const showMore = useCallback(() => {
|
|
31
|
-
// TODO: Implement show more
|
|
32
|
-
}, []);
|
|
33
14
|
const breadcrumbItems = useMemo(() => {
|
|
34
15
|
return pathname
|
|
35
16
|
.split("/")
|
|
@@ -46,6 +27,6 @@ export const ContentHeader = () => {
|
|
|
46
27
|
};
|
|
47
28
|
});
|
|
48
29
|
}, [pathname, overrides]);
|
|
49
|
-
return (_jsx("div", { className: "border-b bg-white px-6 py-2 dark:bg-gray-950", children: _jsxs("div", { className: "flex items-center gap-4", children: [_jsx(BreadcrumbComponent, { items: breadcrumbItems, showHome: true }), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [_jsx(GlobalSearchBar, { placeholder: "Search...", className: "w-96" }), _jsx(
|
|
30
|
+
return (_jsx("div", { className: "border-b bg-white px-6 py-2 dark:bg-gray-950", children: _jsxs("div", { className: "flex items-center gap-4", children: [_jsx(BreadcrumbComponent, { items: breadcrumbItems, showHome: true }), _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [_jsx(GlobalSearchBar, { placeholder: "Search...", className: "w-96" }), _jsx(NotificationContainer, {}), _jsx(TopToolbarFeedback, {})] })] }) }));
|
|
50
31
|
};
|
|
51
32
|
//# sourceMappingURL=content-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-header.js","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/content-header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"content-header.js","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/content-header.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,qBAAqB,MAAM,6DAA6D,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,sBAAsB,EAAE,CAAC;IAE3C,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,EAAE;QACnC,OAAO,QAAQ;aACZ,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CAAC,OAAO,CAAC;aACf,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC1B,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YACjC,MAAM,IAAI,GAAG,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACvD,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC;gBAC5B,WAAW,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK;gBAC5B,IAAI,EAAE,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,EAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;gBACpD,IAAI,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI;aACrB,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IAE1B,OAAO,CACL,cAAK,SAAS,EAAC,8CAA8C,YAC3D,eAAK,SAAS,EAAC,yBAAyB,aACtC,KAAC,mBAAmB,IAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,IAAI,GAAI,EAC/D,eAAK,SAAS,EAAC,iCAAiC,aAC9C,KAAC,eAAe,IAAC,WAAW,EAAC,WAAW,EAAC,SAAS,EAAC,MAAM,GAAG,EAC5D,KAAC,qBAAqB,KAAG,EACzB,KAAC,kBAAkB,KAAG,IAClB,IACF,GACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export { default as AppHeader } from "./app-header";
|
|
2
|
-
export { default as AppLayout } from "./app-layout";
|
|
3
|
-
export { default as AppServicesBar } from "./app-services-bar";
|
|
4
1
|
export { default as AppSidebar } from "./app-sidebar";
|
|
5
2
|
export { SidebarMenuList } from "./sidebar-menu-list";
|
|
6
3
|
export { SidebarNestedItem } from "./sidebar-nested-item";
|
|
4
|
+
export { ContentHeader } from "./content-header";
|
|
7
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export { default as AppHeader } from "./app-header";
|
|
2
|
-
export { default as AppLayout } from "./app-layout";
|
|
3
|
-
export { default as AppServicesBar } from "./app-services-bar";
|
|
4
1
|
export { default as AppSidebar } from "./app-sidebar";
|
|
5
2
|
export { SidebarMenuList } from "./sidebar-menu-list";
|
|
6
3
|
export { SidebarNestedItem } from "./sidebar-nested-item";
|
|
4
|
+
export { ContentHeader } from "./content-header";
|
|
7
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-nested-item.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/sidebar-nested-item.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAejF,eAAO,MAAM,iBAAiB,GAAI,wCAK/B,sBAAsB,
|
|
1
|
+
{"version":3,"file":"sidebar-nested-item.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/layouts/sidebar-nested-item.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAejF,eAAO,MAAM,iBAAiB,GAAI,wCAK/B,sBAAsB,4CAuGxB,CAAC"}
|
|
@@ -21,14 +21,21 @@ export const SidebarNestedItem = ({ item, icon: Icon, isActive, depth, }) => {
|
|
|
21
21
|
const [manualOpen, setManualOpen] = useState(null);
|
|
22
22
|
// Auto-open when active, but respect manual toggle if user has interacted
|
|
23
23
|
const isOpen = manualOpen !== null && manualOpen !== void 0 ? manualOpen : (isActive || isChildActive);
|
|
24
|
-
const isLink = useMemo(() => item.path && !hasChildren, [item.path, hasChildren]);
|
|
25
24
|
const toggle = useCallback((e) => {
|
|
26
25
|
e.stopPropagation();
|
|
27
26
|
setManualOpen((prev) => (prev === null ? !(isActive || isChildActive) : !prev));
|
|
28
27
|
}, [isActive, isChildActive]);
|
|
29
|
-
const itemClasses = useMemo(() => cn("flex w-full justify-between", depth > 0 && "pl-
|
|
30
|
-
const content = (_jsxs("div", { className: "flex items-center gap-
|
|
31
|
-
const toggleIcon = hasChildren && (_jsx("div", { className: "ml-auto flex items-center", children: isOpen ? (_jsx(ChevronDown, { className: "size-4", "aria-hidden": "true" })) : (_jsx(ChevronRight, { className: "size-4", "aria-hidden": "true" })) }));
|
|
32
|
-
|
|
28
|
+
const itemClasses = useMemo(() => cn("flex w-full justify-between", depth > 0 && "pl-8"), [depth]);
|
|
29
|
+
const content = (_jsxs("div", { className: "flex items-center gap-3", children: [Icon && _jsx(Icon, { className: "size-5 shrink-0", strokeWidth: 2, "aria-hidden": "true" }), _jsx("span", { className: "text-[15px] group-data-[collapsible=icon]:hidden", children: item.title })] }));
|
|
30
|
+
const toggleIcon = hasChildren && (_jsx("div", { className: "ml-auto flex items-center group-data-[collapsible=icon]:hidden", children: isOpen ? (_jsx(ChevronDown, { className: "size-4", strokeWidth: 2, "aria-hidden": "true" })) : (_jsx(ChevronRight, { className: "size-4", strokeWidth: 2, "aria-hidden": "true" })) }));
|
|
31
|
+
// In collapsed state, if this item has children, render them as separate items
|
|
32
|
+
// Hide the parent and show children instead
|
|
33
|
+
if (hasChildren) {
|
|
34
|
+
return (_jsxs(_Fragment, { children: [_jsxs(SidebarMenuItem, { className: "group-data-[collapsible=icon]:hidden", children: [_jsxs(SidebarMenuButton, { tooltip: item.title, className: cn(itemClasses, "cursor-pointer", isActive &&
|
|
35
|
+
"bg-[rgb(67,56,202)]! text-white! hover:bg-[rgb(67,56,202)]! dark:bg-[rgb(67,56,202)]! dark:text-white!"), isActive: isActive, onClick: toggle, "aria-expanded": isOpen, children: [content, " ", toggleIcon] }), isOpen && (_jsx("div", { className: "mt-2 ml-4 border-l", children: _jsx(SidebarMenuList, { items: item.children, depth: depth + 1 }) }))] }), _jsx("div", { className: "hidden group-data-[collapsible=icon]:contents", children: _jsx(SidebarMenuList, { items: item.children, depth: 0 }) })] }));
|
|
36
|
+
}
|
|
37
|
+
// Regular item without children
|
|
38
|
+
return (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { tooltip: item.title, className: cn(itemClasses, isActive &&
|
|
39
|
+
"bg-[rgb(67,56,202)]! text-white! hover:bg-[rgb(67,56,202)]! dark:bg-[rgb(67,56,202)]! dark:text-white!"), isActive: isActive, asChild: true, children: _jsx(Link, { href: item.path, children: content }) }) }));
|
|
33
40
|
};
|
|
34
41
|
//# sourceMappingURL=sidebar-nested-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar-nested-item.js","sourceRoot":"","sources":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D,CACP,IACe,EAGlB,cAAK,SAAS,EAAC,+CAA+C,YAC5D,KAAC,eAAe,IAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,GAAI,GAC/C,IACL,CACJ,CAAC;IACJ,CAAC;IAED,gCAAgC;IAChC,OAAO,CACL,KAAC,eAAe,cACd,KAAC,iBAAiB,IAChB,OAAO,EAAE,IAAI,CAAC,KAAK,EACnB,SAAS,EAAE,EAAE,CACX,WAAW,EACX,QAAQ;gBACN,wGAAwG,CAC3G,EACD,QAAQ,EAAE,QAAQ,EAClB,OAAO,kBAEP,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,YAAG,OAAO,GAAQ,GACrB,GACJ,CACnB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import { NotificationContainerProps } from "
|
|
2
|
-
|
|
1
|
+
import type { NotificationContainerProps } from "../../../notifications/notifications.interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* Notification container that fetches notifications from the API.
|
|
4
|
+
*
|
|
5
|
+
* Uses React Query for data fetching with polling support.
|
|
6
|
+
* Handles mark-as-read, mark-all-as-read, and dismiss actions.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <NotificationContainer
|
|
11
|
+
* notificationsLimit={10}
|
|
12
|
+
* pollingInterval={30000}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare const NotificationContainer: ({ notificationsLimit, pollingInterval, enablePolling, }: NotificationContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
17
|
export default NotificationContainer;
|
|
4
18
|
//# sourceMappingURL=notification-container.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-container.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-container.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification-container.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-container.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAM/F;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,qBAAqB,GAAI,yDAI5B,0BAA0B,4CA+F5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,10 +1,81 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useNotificationsApi } from "../../../notifications/hooks";
|
|
4
|
+
import { toShellNotification } from "../../../notifications/notification.utilities";
|
|
5
|
+
import { DEFAULT_POLLING_INTERVAL_MS } from "../../../notifications/notifications.constants";
|
|
6
|
+
import { useNotificationPermissions } from "../../../permissions/hooks";
|
|
4
7
|
import Notifications from "./notifications";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
import { useRouter } from "next/navigation";
|
|
9
|
+
/**
|
|
10
|
+
* Notification container that fetches notifications from the API.
|
|
11
|
+
*
|
|
12
|
+
* Uses React Query for data fetching with polling support.
|
|
13
|
+
* Handles mark-as-read, mark-all-as-read, and dismiss actions.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <NotificationContainer
|
|
18
|
+
* notificationsLimit={10}
|
|
19
|
+
* pollingInterval={30000}
|
|
20
|
+
* />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
const NotificationContainer = ({ notificationsLimit = 20, pollingInterval = DEFAULT_POLLING_INTERVAL_MS, enablePolling = true, }) => {
|
|
24
|
+
const router = useRouter();
|
|
25
|
+
const { canList, canRead, canMarkRead } = useNotificationPermissions();
|
|
26
|
+
const { notifications: apiNotifications, unreadCount, isLoading, markAsRead, markAllAsRead, dismiss, dismissAll, } = useNotificationsApi({
|
|
27
|
+
limit: notificationsLimit,
|
|
28
|
+
enablePolling,
|
|
29
|
+
pollingInterval,
|
|
30
|
+
});
|
|
31
|
+
// Only show unread count badge if user has both list and read permissions
|
|
32
|
+
// - canList: ensures notifications are visible in the panel
|
|
33
|
+
// - canRead: ensures the unread count can be fetched
|
|
34
|
+
const displayUnreadCount = canList && canRead ? unreadCount : 0;
|
|
35
|
+
// Convert API notifications to shell format
|
|
36
|
+
const notifications = apiNotifications.map(toShellNotification);
|
|
37
|
+
/**
|
|
38
|
+
* Handle notification click - mark as read and navigate
|
|
39
|
+
*/
|
|
40
|
+
const handleNotificationClick = (notification) => {
|
|
41
|
+
// Fire-and-forget mark as read to avoid blocking navigation
|
|
42
|
+
if (!notification.read && canMarkRead) {
|
|
43
|
+
markAsRead(notification.id);
|
|
44
|
+
}
|
|
45
|
+
// Navigate to the notification URL if present
|
|
46
|
+
if (notification.url) {
|
|
47
|
+
router.push(notification.url);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Handle mark as read action
|
|
52
|
+
*/
|
|
53
|
+
const handleMarkAsRead = async (id) => {
|
|
54
|
+
await markAsRead(id);
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Handle mark all as read action
|
|
58
|
+
*/
|
|
59
|
+
const handleMarkAllAsRead = async () => {
|
|
60
|
+
await markAllAsRead();
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Handle dismiss action
|
|
64
|
+
*/
|
|
65
|
+
const handleDismiss = async (id) => {
|
|
66
|
+
await dismiss(id);
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Handle dismiss all action
|
|
70
|
+
*/
|
|
71
|
+
const handleDismissAll = async () => {
|
|
72
|
+
await dismissAll();
|
|
73
|
+
};
|
|
74
|
+
// Show empty state during initial load
|
|
75
|
+
if (isLoading && notifications.length === 0) {
|
|
76
|
+
return (_jsx(Notifications, { notifications: [], unreadCount: 0, onMarkAllAsRead: handleMarkAllAsRead, onMarkAsRead: handleMarkAsRead, onDismissAll: handleDismissAll, onDismiss: handleDismiss, hasMore: false }));
|
|
77
|
+
}
|
|
78
|
+
return (_jsx(Notifications, { notifications: notifications, unreadCount: displayUnreadCount, onMarkAllAsRead: handleMarkAllAsRead, onMarkAsRead: handleMarkAsRead, onDismissAll: handleDismissAll, onDismiss: handleDismiss, onNotificationClick: handleNotificationClick, hasMore: false }));
|
|
8
79
|
};
|
|
9
80
|
export default NotificationContainer;
|
|
10
81
|
//# sourceMappingURL=notification-container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-container.js","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-container.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"notification-container.js","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-container.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAE1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,aAAa,MAAM,oDAAoD,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AACH,MAAM,qBAAqB,GAAG,CAAC,EAC7B,kBAAkB,GAAG,EAAE,EACvB,eAAe,GAAG,2BAA2B,EAC7C,aAAa,GAAG,IAAI,GACO,EAAE,EAAE;IAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,0BAA0B,EAAE,CAAC;IAEvE,MAAM,EACJ,aAAa,EAAE,gBAAgB,EAC/B,WAAW,EACX,SAAS,EACT,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M,KAAK,CAAC,EAAE,CAAC;QAC5C,OAAO,CACL,KAAC,aAAa,IACZ,aAAa,EAAE,EAAE,EACjB,WAAW,EAAE,CAAC,EACd,eAAe,EAAE,mBAAmB,EACpC,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,KAAK,GACd,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,aAAa,IACZ,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,kBAAkB,EAC/B,eAAe,EAAE,mBAAmB,EACpC,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,SAAS,EAAE,aAAa,EACxB,mBAAmB,EAAE,uBAAuB,EAC5C,OAAO,EAAE,KAAK,GACd,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { NotificationItemProps } from "../../shell.interfaces";
|
|
2
|
-
export declare const NotificationItem: ({ notification, onMarkAsRead, onDismiss, maxLines, }: NotificationItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const NotificationItem: ({ notification, onMarkAsRead, onDismiss, onClick, maxLines, }: NotificationItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=notification-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-item.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-item.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification-item.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-item.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAIrE,eAAO,MAAM,gBAAgB,GAAI,+DAM9B,qBAAqB,4CAuIvB,CAAC"}
|
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NOTIFICATION_TYPE_CONFIG } from "../../../notifications/notifications.constants";
|
|
3
|
+
import { useNotificationPermissions } from "../../../permissions/hooks";
|
|
4
|
+
import { Avatar, AvatarFallback } from "../../../shared/components/ui/avatar";
|
|
2
5
|
import { Button } from "../../../shared/components/ui/button";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../../shared/components/ui/tooltip";
|
|
3
7
|
import { cn } from "../../../shared/utilities/cn";
|
|
4
|
-
import {
|
|
8
|
+
import { formatTime } from "../../../shared/utilities/date-utilities";
|
|
9
|
+
import { getInitials } from "../../../shared/utilities/string-utilities";
|
|
5
10
|
import { Bell, Eye, X } from "lucide-react";
|
|
6
11
|
import Link from "next/link";
|
|
7
|
-
export const NotificationItem = ({ notification, onMarkAsRead, onDismiss, maxLines = 2, }) => {
|
|
8
|
-
const { id, title, message, read, createdAt, url } = notification;
|
|
9
|
-
|
|
12
|
+
export const NotificationItem = ({ notification, onMarkAsRead, onDismiss, onClick, maxLines = 2, }) => {
|
|
13
|
+
const { id, title, message, read, createdAt, url, actorName, type } = notification;
|
|
14
|
+
const { canMarkRead, canDismiss } = useNotificationPermissions();
|
|
15
|
+
// Get icon config for notification type
|
|
16
|
+
const typeConfig = type ? NOTIFICATION_TYPE_CONFIG[type] : null;
|
|
17
|
+
const TypeIcon = typeConfig === null || typeConfig === void 0 ? void 0 : typeConfig.icon;
|
|
18
|
+
/**
|
|
19
|
+
* Handle notification click - if onClick is provided, use it to handle navigation
|
|
20
|
+
* Otherwise, let the Link component handle it normally
|
|
21
|
+
*/
|
|
22
|
+
const handleNotificationClick = (e) => {
|
|
23
|
+
if (onClick) {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
onClick(notification);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const NotificationBody = (_jsxs("div", { className: "flex flex-1 items-start gap-4", children: [_jsxs("div", { className: "relative mt-0.5 shrink-0", children: [actorName ? (_jsx(Avatar, { className: "size-8 text-xs", children: _jsx(AvatarFallback, { children: getInitials(actorName) }) })) : (_jsx("div", { className: "flex size-8 items-center justify-center", children: _jsx(Bell, { className: "text-muted-foreground size-5", "aria-hidden": "true" }) })), TypeIcon && (_jsx("span", { className: cn("absolute -right-0.5 -bottom-0.5 flex size-4 items-center justify-center rounded-full ring-2 ring-white dark:ring-black", typeConfig === null || typeConfig === void 0 ? void 0 : typeConfig.className), "aria-hidden": "true", children: _jsx(TypeIcon, { "aria-hidden": "true", className: "size-2.5" }) }))] }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "mb-1 flex flex-col-reverse items-start justify-start gap-1 sm:flex-row sm:items-center sm:gap-2", children: [_jsx("div", { id: `notification-title-${id}`, className: "text-sm leading-4 font-semibold text-gray-900 dark:text-gray-100", children: title }), _jsx("p", { className: "text-xs text-gray-500", children: _jsx("time", { dateTime: createdAt.toISOString(), children: formatTime(createdAt.getTime()) }) })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("p", { id: `notification-message-${id}`, className: "line-clamp-dynamic text-sm text-gray-800 dark:text-gray-400", style: {
|
|
10
29
|
WebkitLineClamp: maxLines,
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
30
|
+
}, children: message }) }), _jsx(TooltipContent, { className: "max-w-80", children: message })] })] })] }));
|
|
31
|
+
const ActionButtons = (_jsxs("div", { className: "flex items-center", role: "group", "aria-label": "Notification actions", children: [!read && canMarkRead && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": `Mark "${title}" as read`, onClick: () => onMarkAsRead(id), "data-testid": "notification-item-mark-as-read", children: _jsx(Eye, { "aria-hidden": "true" }) }) }), _jsx(TooltipContent, { children: "Mark as read" })] })), canDismiss && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": `Dismiss "${title}" notification`, onClick: () => onDismiss(id), "data-testid": "notification-item-dismiss", children: _jsx(X, { "aria-hidden": "true" }) }) }), _jsx(TooltipContent, { children: "Dismiss" })] }))] }));
|
|
32
|
+
return (_jsxs("div", { className: cn("flex items-start gap-4 rounded-md border border-gray-100 bg-white px-4 py-2 shadow-sm dark:border-gray-900 dark:bg-black", !read && "bg-blue-50 dark:bg-blue-900/20"), role: "article", "aria-labelledby": `notification-title-${id}`, "aria-describedby": `notification-message-${id}`, children: [url ? (_jsx(Link, { href: url, className: "flex flex-1 cursor-pointer transition-opacity hover:opacity-80", onClick: handleNotificationClick, "aria-label": `View notification: ${title}`, children: NotificationBody })) : (NotificationBody), ActionButtons] }));
|
|
14
33
|
};
|
|
15
34
|
//# sourceMappingURL=notification-item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-item.js","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"notification-item.js","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-item.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC7F,OAAO,EAAE,EAAE,EAAE,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;A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C,OAAO,kBACrB,KAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,MAAM,gBACC,YAAY,KAAK,gBAAgB,EAC7C,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,iBAChB,2BAA2B,YAEvC,KAAC,CAAC,mBAAa,MAAM,GAAG,GACjB,GACM,EACjB,KAAC,cAAc,0BAAyB,IAChC,CACX,IACG,CACP,CAAC;IAEF,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,0HAA0H,EAC1H,CAAC,IAAI,IAAI,gCAAgC,CAC1C,EACD,IAAI,EAAC,SAAS,qBACG,sBAAsB,EAAE,EAAE,sBACzB,wBAAwB,EAAE,EAAE,aAE7C,GAAG,CAAC,CAAC,CAAC,CACL,KAAC,IAAI,IACH,IAAI,EAAE,GAAG,EACT,SAAS,EAAC,gEAAgE,EAC1E,OAAO,EAAE,uBAAuB,gBACpB,sBAAsB,KAAK,EAAE,YAExC,gBAAgB,GACZ,CACR,CAAC,CAAC,CAAC,CACF,gBAAgB,CACjB,EACA,aAAa,IACV,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-panel-header.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-panel-header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification-panel-header.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-panel-header.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAG5E,eAAO,MAAM,uBAAuB,GAAI,mDAIrC,4BAA4B,4CA4C9B,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useNotificationPermissions } from "../../../permissions/hooks";
|
|
2
3
|
import { Button } from "../../../shared/components/ui/button";
|
|
3
4
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../../../shared/components/ui/dropdown-menu";
|
|
4
5
|
import { MoreVertical } from "lucide-react";
|
|
5
6
|
export const NotificationPanelHeader = ({ notifications, onMarkAllAsRead, onDismissAll, }) => {
|
|
6
|
-
|
|
7
|
+
const { canMarkAllRead, canDismissAll } = useNotificationPermissions();
|
|
8
|
+
const showMenu = notifications.length > 0 && (canMarkAllRead || canDismissAll);
|
|
9
|
+
return (_jsxs("div", { className: "mb-2 flex items-center justify-between p-2", children: [_jsx("p", { className: "text-xl font-semibold text-gray-800 focus:outline-none dark:text-white", children: "Notifications" }), showMenu && (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": "Notification options menu", "aria-haspopup": "menu", children: _jsx(MoreVertical, { className: "size-5", "aria-hidden": "true" }) }) }), _jsxs(DropdownMenuContent, { align: "end", "aria-label": "Notification actions", children: [canMarkAllRead && (_jsx(DropdownMenuItem, { onClick: onMarkAllAsRead, "aria-label": "Mark all notifications as read", children: "Mark all as read" })), canDismissAll && (_jsx(DropdownMenuItem, { onClick: onDismissAll, className: "text-red-500", "aria-label": "Dismiss all notifications", children: "Dismiss all" }))] })] }))] }));
|
|
7
10
|
};
|
|
8
11
|
//# sourceMappingURL=notification-panel-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification-panel-header.js","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-panel-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,aAAa,EACb,eAAe,EACf,YAAY,GACiB,EAAE,EAAE;IACjC,OAAO,CACL,eAAK,SAAS,EAAC,4CAA4C,aACzD,YAAG,SAAS,EAAC,wEAAwE,8BAEjF,EACH,
|
|
1
|
+
{"version":3,"file":"notification-panel-header.js","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notification-panel-header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,aAAa,EACb,eAAe,EACf,YAAY,GACiB,EAAE,EAAE;IACjC,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,GAAG,0BAA0B,EAAE,CAAC;IACvE,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,aAAa,CAAC,CAAC;IAE/E,OAAO,CACL,eAAK,SAAS,EAAC,4CAA4C,aACzD,YAAG,SAAS,EAAC,wEAAwE,8BAEjF,EACH,QAAQ,IAAI,CACX,MAAC,YAAY,eACX,KAAC,mBAAmB,IAAC,OAAO,kBAC1B,KAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,MAAM,gBACA,2BAA2B,mBACxB,MAAM,YAEpB,KAAC,YAAY,IAAC,SAAS,EAAC,QAAQ,iBAAa,MAAM,GAAG,GAC/C,GACW,EACtB,MAAC,mBAAmB,IAAC,KAAK,EAAC,KAAK,gBAAY,sBAAsB,aAC/D,cAAc,IAAI,CACjB,KAAC,gBAAgB,IACf,OAAO,EAAE,eAAe,gBACb,gCAAgC,iCAG1B,CACpB,EACA,aAAa,IAAI,CAChB,KAAC,gBAAgB,IACf,OAAO,EAAE,YAAY,EACrB,SAAS,EAAC,cAAc,gBACb,2BAA2B,4BAGrB,CACpB,IACmB,IACT,CAChB,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { NotificationsProps } from "../../shell.interfaces";
|
|
2
|
-
declare const Notifications: ({ notifications, onMarkAllAsRead, onMarkAsRead, onDismissAll, onDismiss, onShowMore, hasMore, unreadCount, maxLines, }: NotificationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const Notifications: ({ notifications, onMarkAllAsRead, onMarkAsRead, onDismissAll, onDismiss, onShowMore, onNotificationClick, hasMore, unreadCount, maxLines, }: NotificationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default Notifications;
|
|
4
4
|
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notifications.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,QAAA,MAAM,aAAa,GAAI,
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../lib/shell/components/notifications/notifications.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE,QAAA,MAAM,aAAa,GAAI,6IAWpB,kBAAkB,4CAoFpB,CAAC;AACF,eAAe,aAAa,CAAC"}
|
|
@@ -6,8 +6,8 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../../../shared/compone
|
|
|
6
6
|
import { NotificationItem } from "./notification-item";
|
|
7
7
|
import { NotificationPanelHeader } from "./notification-panel-header";
|
|
8
8
|
import { Bell, ChevronDown } from "lucide-react";
|
|
9
|
-
const Notifications = ({ notifications = [], onMarkAllAsRead, onMarkAsRead, onDismissAll, onDismiss, onShowMore, hasMore, unreadCount = 0, maxLines, }) => {
|
|
10
|
-
return (_jsxs(Popover, { children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", type: "button", size: "icon", "aria-label": "Notifications", "aria-haspopup": "dialog", className: "relative size-8
|
|
9
|
+
const Notifications = ({ notifications = [], onMarkAllAsRead, onMarkAsRead, onDismissAll, onDismiss, onShowMore, onNotificationClick, hasMore, unreadCount = 0, maxLines, }) => {
|
|
10
|
+
return (_jsxs(Popover, { children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", type: "button", size: "icon", "aria-label": "Notifications", "aria-haspopup": "dialog", className: "relative size-8", children: [_jsx(Bell, { "aria-hidden": "true" }), unreadCount > 0 && (_jsx("span", { className: "bg-destructive absolute top-0.5 right-0 flex size-5 origin-center translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full text-[10px] font-semibold text-white", role: "status", "aria-live": "polite", "aria-label": `${unreadCount} unread notifications`, "data-testid": "notification-count", children: unreadCount > 99 ? "99+" : unreadCount }))] }) }) }), _jsx(TooltipContent, { children: "Notifications" })] }), _jsxs(PopoverContent, { className: "w-[98vw] max-w-125 p-2 sm:w-125", align: "end", role: "region", "aria-label": "Notification panel", children: [_jsx(NotificationPanelHeader, { notifications: notifications, onMarkAllAsRead: onMarkAllAsRead, onDismissAll: onDismissAll }), _jsx("ul", { className: "flex max-h-96 flex-col gap-2 overflow-y-auto px-2 pb-4", "aria-label": "Notification list", children: notifications.length === 0 ? (_jsx("li", { className: "p-4 text-center text-gray-500 dark:text-gray-400", children: _jsx("div", { role: "status", "aria-live": "polite", children: _jsx("p", { children: "No new notifications" }) }) })) : (_jsx(_Fragment, { children: notifications.map((notification) => (_jsx("li", { children: _jsx(NotificationItem, { notification: notification, onMarkAsRead: onMarkAsRead, onDismiss: onDismiss, onClick: onNotificationClick, maxLines: maxLines }) }, notification.id))) })) }), hasMore && (_jsx("div", { className: "px-2", children: _jsxs(Button, { variant: "ghost", className: "w-full", onClick: onShowMore, "aria-label": "Load more notifications", "data-testid": "notification-show-more-button", children: ["Show more ", _jsx(ChevronDown, { className: "size-4", "aria-hidden": "true" })] }) }))] })] }));
|
|
11
11
|
};
|
|
12
12
|
export default Notifications;
|
|
13
13
|
//# sourceMappingURL=notifications.js.map
|