@burdenoff/fe-libs 2026.527.3 → 2026.527.4
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/chrome/ContextSwitcher.js +90 -339
- package/dist/chrome/GlobalSearch.js +72 -456
- package/dist/chrome/NotificationCenter.js +69 -703
- package/dist/chrome/SideNavigation.js +73 -241
- package/dist/chrome/contextSwitcher/EmptyState.js +32 -0
- package/dist/chrome/contextSwitcher/OrganizationList.js +34 -0
- package/dist/chrome/contextSwitcher/ProjectList.js +34 -0
- package/dist/chrome/contextSwitcher/SearchInput.js +50 -0
- package/dist/chrome/contextSwitcher/TabButton.js +9 -0
- package/dist/chrome/contextSwitcher/TriggerButton.js +38 -0
- package/dist/chrome/contextSwitcher/WorkspaceList.js +34 -0
- package/dist/chrome/contextSwitcher/icons.js +58 -0
- package/dist/chrome/contextSwitcher/useIsMobile.js +11 -0
- package/dist/chrome/globalSearch/AdvancedFiltersPanel.js +253 -0
- package/dist/chrome/globalSearch/CategoryTabs.js +28 -0
- package/dist/chrome/globalSearch/ResultsList.js +58 -0
- package/dist/chrome/globalSearch/SearchInput.js +28 -0
- package/dist/chrome/globalSearch/SearchModeBar.js +36 -0
- package/dist/chrome/globalSearch/useAdvancedFilters.js +78 -0
- package/dist/chrome/globalSearch/utils.js +22 -0
- package/dist/chrome/notificationCenter/BellButton.js +27 -0
- package/dist/chrome/notificationCenter/NotificationCardItem.js +129 -0
- package/dist/chrome/notificationCenter/NotificationFilters.js +67 -0
- package/dist/chrome/notificationCenter/NotificationFooter.js +23 -0
- package/dist/chrome/notificationCenter/NotificationHeader.js +75 -0
- package/dist/chrome/notificationCenter/NotificationList.js +75 -0
- package/dist/chrome/notificationCenter/NotificationPanel.js +19 -0
- package/dist/chrome/notificationCenter/SkeletonCard.js +18 -0
- package/dist/chrome/notificationCenter/constants.js +93 -0
- package/dist/chrome/notificationCenter/gql.js +58 -0
- package/dist/chrome/notificationCenter/useNotificationCenter.js +149 -0
- package/dist/chrome/notificationCenter/usePanelChrome.js +36 -0
- package/dist/chrome/sideNavigation/CollapseToggle.js +29 -0
- package/dist/chrome/sideNavigation/MobileActionsBar.js +25 -0
- package/dist/chrome/sideNavigation/NavItemRenderer.js +79 -0
- package/dist/chrome/sideNavigation/SidebarHeader.js +29 -0
- package/dist/chrome/sideNavigation/helpers.js +19 -0
- package/dist/chrome/sideNavigation/useSideNavigationState.js +45 -0
- package/dist/shared/components/ContextConversationWidget.js +173 -767
- package/dist/shared/components/contextConversationWidget/Composer.js +66 -0
- package/dist/shared/components/contextConversationWidget/MessageItem.js +124 -0
- package/dist/shared/components/contextConversationWidget/MessageList.js +32 -0
- package/dist/shared/components/contextConversationWidget/NoWorkspaceCard.js +19 -0
- package/dist/shared/components/contextConversationWidget/PendingAttachmentsBar.js +28 -0
- package/dist/shared/components/contextConversationWidget/ReplyBanner.js +32 -0
- package/dist/shared/components/contextConversationWidget/WidgetHeader.js +70 -0
- package/dist/shared/components/contextConversationWidget/queries.js +197 -0
- package/dist/shared/components/contextConversationWidget/types.js +10 -0
- package/dist/shared/components/contextConversationWidget/useAttachmentUpload.js +57 -0
- package/dist/shared/components/contextConversationWidget/useConversationSubscriptions.js +26 -0
- package/dist/shared/components/contextConversationWidget/useMessageActions.js +34 -0
- package/dist/shared/components/contextConversationWidget/useSendMessage.js +45 -0
- package/dist/shared/components/contextConversationWidget/useWidgetMessages.js +44 -0
- package/dist/shared/components/contextConversationWidget/utils.js +56 -0
- package/dist/shared/pages/SearchPage.js +293 -1076
- package/dist/shared/pages/searchPage/ActiveFilterChips.js +176 -0
- package/dist/shared/pages/searchPage/FiltersPanel.js +329 -0
- package/dist/shared/pages/searchPage/ResultsList.js +119 -0
- package/dist/shared/pages/searchPage/ResultsStatus.js +32 -0
- package/dist/shared/pages/searchPage/SearchInput.js +31 -0
- package/dist/shared/pages/searchPage/SearchPagination.js +37 -0
- package/dist/shared/pages/searchPage/SearchToolbar.js +58 -0
- package/dist/shared/pages/searchPage/constants.js +155 -0
- package/dist/shared/pages/searchPage/utils.js +24 -0
- package/dist/shared/providers/shell/AuthProvider.js +130 -384
- package/dist/shared/providers/shell/authProvider/bridgeStateSync.js +34 -0
- package/dist/shared/providers/shell/authProvider/jwt.js +13 -0
- package/dist/shared/providers/shell/authProvider/ssoRelay.js +38 -0
- package/dist/shared/providers/shell/authProvider/useAuthActions.js +170 -0
- package/dist/shared/providers/shell/authProvider/useBridgeInitialization.js +86 -0
- package/dist/shared/providers/shell/authProvider/useRemoteSLO.js +32 -0
- package/dist/shared/providers/shell/authProvider/useStorageSync.js +35 -0
- package/dist/shared/providers/shell/authProvider/useTokenExpiryTimer.js +37 -0
- package/dist/shared/tours/TourTrigger.js +86 -262
- package/dist/shared/tours/ToursContext.js +108 -398
- package/dist/shared/tours/tourTrigger/DesktopTourDropdown.js +48 -0
- package/dist/shared/tours/tourTrigger/MobileTourSheet.js +68 -0
- package/dist/shared/tours/tourTrigger/TourListItemDesktop.js +36 -0
- package/dist/shared/tours/tourTrigger/TourListItemMobile.js +47 -0
- package/dist/shared/tours/tourTrigger/TourStatusChip.js +30 -0
- package/dist/shared/tours/tourTrigger/TourTriggerButton.js +22 -0
- package/dist/shared/tours/toursContext/errors.js +18 -0
- package/dist/shared/tours/toursContext/gql.js +152 -0
- package/dist/shared/tours/toursContext/route.js +20 -0
- package/dist/shared/tours/toursContext/session.js +19 -0
- package/dist/shared/tours/toursContext/useIdleReady.js +18 -0
- package/dist/shared/tours/toursContext/useTourMutations.js +118 -0
- package/dist/tag/TagsWidget.js +81 -226
- package/dist/tag/tagsWidget/AddTagTrigger.js +14 -0
- package/dist/tag/tagsWidget/TagBadgeList.js +17 -0
- package/dist/tag/tagsWidget/TagSearchPopover.js +80 -0
- package/dist/tag/tagsWidget/operations.js +64 -0
- package/dist/tag/tagsWidget/useVocabResolver.js +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { PRIORITY_CONFIG as e, TYPE_CONFIG as t, formatRelativeTime as n } from "./constants.js";
|
|
2
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
//#region src/chrome/notificationCenter/NotificationCardItem.tsx
|
|
4
|
+
var a = ({ notification: a, onMarkAsRead: o, onDelete: s, onRedirect: c }) => {
|
|
5
|
+
let { id: l, title: u, message: d, type: f, priority: p, appName: m, redirectUrl: h, isRead: g, createdAt: _ } = a, v = e[p] ?? e.MEDIUM, y = t[f] ?? {
|
|
6
|
+
icon: "🔔",
|
|
7
|
+
label: f
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ i("div", {
|
|
10
|
+
className: `group relative flex gap-3 p-3 rounded-card border transition-all duration-150 cursor-pointer ${g ? "bg-bg-canvas border-border-subtle" : "bg-bg-elevated border-border-default shadow-sm"} hover:bg-action-ghost-bg-hover`,
|
|
11
|
+
onClick: () => {
|
|
12
|
+
g || o(l), h && c(h);
|
|
13
|
+
},
|
|
14
|
+
role: "button",
|
|
15
|
+
tabIndex: 0,
|
|
16
|
+
onKeyDown: (e) => {
|
|
17
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), g || o(l), h && c(h));
|
|
18
|
+
},
|
|
19
|
+
children: [
|
|
20
|
+
!g && /* @__PURE__ */ r("div", { className: "absolute top-3 left-1.5 size-2 rounded-full bg-action-primary-bg" }),
|
|
21
|
+
/* @__PURE__ */ r("div", {
|
|
22
|
+
className: "flex-shrink-0 mt-0.5 ml-2",
|
|
23
|
+
children: /* @__PURE__ */ r("span", {
|
|
24
|
+
className: "text-base",
|
|
25
|
+
"aria-hidden": "true",
|
|
26
|
+
children: y.icon
|
|
27
|
+
})
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ i("div", {
|
|
30
|
+
className: "flex-1 min-w-0",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ i("div", {
|
|
33
|
+
className: "flex items-start justify-between gap-2",
|
|
34
|
+
children: [/* @__PURE__ */ r("h4", {
|
|
35
|
+
className: `text-sm truncate ${g ? "font-normal text-text-secondary" : "font-semibold text-text-primary"}`,
|
|
36
|
+
children: u
|
|
37
|
+
}), /* @__PURE__ */ i("div", {
|
|
38
|
+
className: "flex-shrink-0 flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
39
|
+
children: [!g && /* @__PURE__ */ r("button", {
|
|
40
|
+
type: "button",
|
|
41
|
+
onClick: (e) => {
|
|
42
|
+
e.stopPropagation(), o(l);
|
|
43
|
+
},
|
|
44
|
+
className: "p-1 rounded hover:bg-bg-muted text-text-tertiary hover:text-text-primary",
|
|
45
|
+
title: "Mark as read",
|
|
46
|
+
"aria-label": "Mark as read",
|
|
47
|
+
children: /* @__PURE__ */ r("svg", {
|
|
48
|
+
className: "size-3.5",
|
|
49
|
+
fill: "none",
|
|
50
|
+
stroke: "currentColor",
|
|
51
|
+
viewBox: "0 0 24 24",
|
|
52
|
+
children: /* @__PURE__ */ r("path", {
|
|
53
|
+
strokeLinecap: "round",
|
|
54
|
+
strokeLinejoin: "round",
|
|
55
|
+
strokeWidth: 2,
|
|
56
|
+
d: "M5 13l4 4L19 7"
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
}), /* @__PURE__ */ r("button", {
|
|
60
|
+
type: "button",
|
|
61
|
+
onClick: (e) => {
|
|
62
|
+
e.stopPropagation(), s(l);
|
|
63
|
+
},
|
|
64
|
+
className: "p-1 rounded hover:bg-bg-muted text-text-tertiary hover:text-status-error-text",
|
|
65
|
+
title: "Dismiss",
|
|
66
|
+
"aria-label": "Dismiss notification",
|
|
67
|
+
children: /* @__PURE__ */ r("svg", {
|
|
68
|
+
className: "size-3.5",
|
|
69
|
+
fill: "none",
|
|
70
|
+
stroke: "currentColor",
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
children: /* @__PURE__ */ r("path", {
|
|
73
|
+
strokeLinecap: "round",
|
|
74
|
+
strokeLinejoin: "round",
|
|
75
|
+
strokeWidth: 2,
|
|
76
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
})]
|
|
80
|
+
})]
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ r("p", {
|
|
83
|
+
className: "text-xs text-text-secondary line-clamp-2 mt-0.5",
|
|
84
|
+
children: d
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ i("div", {
|
|
87
|
+
className: "flex items-center gap-2 mt-1.5 flex-wrap",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ r("span", {
|
|
90
|
+
className: `inline-flex items-center px-1.5 py-0.5 text-[10px] font-medium rounded ${v.bgColor} ${v.color}`,
|
|
91
|
+
children: v.label
|
|
92
|
+
}),
|
|
93
|
+
m && /* @__PURE__ */ r("span", {
|
|
94
|
+
className: "inline-flex items-center px-1.5 py-0.5 text-[10px] font-medium rounded bg-bg-muted text-text-tertiary",
|
|
95
|
+
children: m
|
|
96
|
+
}),
|
|
97
|
+
/* @__PURE__ */ r("span", {
|
|
98
|
+
className: "text-[10px] text-text-tertiary",
|
|
99
|
+
children: n(_)
|
|
100
|
+
}),
|
|
101
|
+
h && /* @__PURE__ */ i("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
onClick: (e) => {
|
|
104
|
+
e.stopPropagation(), c(h);
|
|
105
|
+
},
|
|
106
|
+
className: "inline-flex items-center gap-0.5 text-[10px] text-action-primary-bg hover:underline",
|
|
107
|
+
"aria-label": "Open link",
|
|
108
|
+
children: ["Open", /* @__PURE__ */ r("svg", {
|
|
109
|
+
className: "size-2.5",
|
|
110
|
+
fill: "none",
|
|
111
|
+
stroke: "currentColor",
|
|
112
|
+
viewBox: "0 0 24 24",
|
|
113
|
+
children: /* @__PURE__ */ r("path", {
|
|
114
|
+
strokeLinecap: "round",
|
|
115
|
+
strokeLinejoin: "round",
|
|
116
|
+
strokeWidth: 2,
|
|
117
|
+
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
118
|
+
})
|
|
119
|
+
})]
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
//#endregion
|
|
129
|
+
export { a as NotificationCardItem };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { FILTER_TABS as e, TYPE_CONFIG as t, TYPE_FILTERS as n } from "./constants.js";
|
|
2
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
//#region src/chrome/notificationCenter/NotificationFilters.tsx
|
|
4
|
+
var a = ({ filterTab: a, typeFilter: o, appFilter: s, sortBy: c, appNames: l, onFilterTabChange: u, onTypeFilterChange: d, onAppFilterChange: f, onSortByChange: p }) => /* @__PURE__ */ i("div", {
|
|
5
|
+
className: "px-4 pt-3 pb-2 space-y-2 border-b border-border-subtle",
|
|
6
|
+
children: [
|
|
7
|
+
/* @__PURE__ */ r("div", {
|
|
8
|
+
className: "flex gap-1",
|
|
9
|
+
children: e.map((e) => /* @__PURE__ */ r("button", {
|
|
10
|
+
onClick: () => u(e.value),
|
|
11
|
+
className: `px-3 py-1 text-xs font-medium rounded-full transition-colors ${a === e.value ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-muted text-text-secondary hover:bg-action-ghost-bg-hover"}`,
|
|
12
|
+
children: e.label
|
|
13
|
+
}, e.value))
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ i("div", {
|
|
16
|
+
className: "flex flex-wrap items-center gap-1",
|
|
17
|
+
children: [n.map((e) => /* @__PURE__ */ i("button", {
|
|
18
|
+
onClick: () => d(e.value),
|
|
19
|
+
className: `px-2 py-0.5 text-[11px] font-medium rounded-full whitespace-nowrap transition-colors ${o === e.value ? "bg-bg-elevated text-text-primary border border-border-default" : "text-text-tertiary hover:text-text-secondary hover:bg-bg-muted"}`,
|
|
20
|
+
children: [e.value !== "ALL" && t[e.value] && /* @__PURE__ */ r("span", {
|
|
21
|
+
className: "mr-0.5",
|
|
22
|
+
children: t[e.value].icon
|
|
23
|
+
}), e.label]
|
|
24
|
+
}, e.value)), /* @__PURE__ */ i("select", {
|
|
25
|
+
value: c,
|
|
26
|
+
onChange: (e) => p(e.target.value),
|
|
27
|
+
className: "ml-auto text-[11px] text-text-secondary bg-transparent border-none cursor-pointer focus:outline-none",
|
|
28
|
+
"aria-label": "Sort notifications",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ r("option", {
|
|
31
|
+
value: "newest",
|
|
32
|
+
children: "Newest"
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ r("option", {
|
|
35
|
+
value: "oldest",
|
|
36
|
+
children: "Oldest"
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ r("option", {
|
|
39
|
+
value: "priority",
|
|
40
|
+
children: "Priority"
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
})]
|
|
44
|
+
}),
|
|
45
|
+
l.length > 1 && /* @__PURE__ */ i("div", {
|
|
46
|
+
className: "flex flex-wrap gap-1",
|
|
47
|
+
children: [/* @__PURE__ */ r("button", {
|
|
48
|
+
onClick: () => f("ALL"),
|
|
49
|
+
className: `px-2 py-0.5 text-[11px] font-medium rounded-full whitespace-nowrap transition-colors ${s === "ALL" ? "bg-bg-elevated text-text-primary border border-border-default" : "text-text-tertiary hover:text-text-secondary hover:bg-bg-muted"}`,
|
|
50
|
+
children: "All Apps"
|
|
51
|
+
}), l.map(([e, t]) => /* @__PURE__ */ i("button", {
|
|
52
|
+
onClick: () => f(e),
|
|
53
|
+
className: `px-2 py-0.5 text-[11px] font-medium rounded-full whitespace-nowrap transition-colors ${s === e ? "bg-bg-elevated text-text-primary border border-border-default" : "text-text-tertiary hover:text-text-secondary hover:bg-bg-muted"}`,
|
|
54
|
+
children: [e, /* @__PURE__ */ i("span", {
|
|
55
|
+
className: "ml-1 text-text-tertiary",
|
|
56
|
+
children: [
|
|
57
|
+
"(",
|
|
58
|
+
t,
|
|
59
|
+
")"
|
|
60
|
+
]
|
|
61
|
+
})]
|
|
62
|
+
}, e))]
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
//#endregion
|
|
67
|
+
export { a as NotificationFilters };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/chrome/notificationCenter/NotificationFooter.tsx
|
|
3
|
+
var n = ({ totalCount: n, onViewAll: r }) => /* @__PURE__ */ e("div", {
|
|
4
|
+
className: "p-3 border-t border-border-subtle",
|
|
5
|
+
children: /* @__PURE__ */ t("div", {
|
|
6
|
+
className: "flex items-center justify-between",
|
|
7
|
+
children: [/* @__PURE__ */ t("span", {
|
|
8
|
+
className: "text-[11px] text-text-tertiary",
|
|
9
|
+
children: [
|
|
10
|
+
n,
|
|
11
|
+
" notification",
|
|
12
|
+
n === 1 ? "" : "s"
|
|
13
|
+
]
|
|
14
|
+
}), r && /* @__PURE__ */ e("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
onClick: r,
|
|
17
|
+
className: "text-xs text-action-primary-bg hover:underline font-medium",
|
|
18
|
+
children: "View All"
|
|
19
|
+
})]
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { n as NotificationFooter };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/chrome/notificationCenter/NotificationHeader.tsx
|
|
3
|
+
var n = ({ isMobile: n, unreadCount: r, onClose: i, onMarkAllAsRead: a }) => /* @__PURE__ */ t("div", {
|
|
4
|
+
className: "flex items-center justify-between p-4 border-b border-border-subtle",
|
|
5
|
+
children: [/* @__PURE__ */ t("div", {
|
|
6
|
+
className: "flex items-center gap-2",
|
|
7
|
+
children: [
|
|
8
|
+
n && /* @__PURE__ */ e("button", {
|
|
9
|
+
type: "button",
|
|
10
|
+
onClick: i,
|
|
11
|
+
className: "p-1 rounded-button hover:bg-action-ghost-bg-hover text-text-primary",
|
|
12
|
+
"aria-label": "Close",
|
|
13
|
+
children: /* @__PURE__ */ e("svg", {
|
|
14
|
+
className: "size-5",
|
|
15
|
+
fill: "none",
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
viewBox: "0 0 24 24",
|
|
18
|
+
children: /* @__PURE__ */ e("path", {
|
|
19
|
+
strokeLinecap: "round",
|
|
20
|
+
strokeLinejoin: "round",
|
|
21
|
+
strokeWidth: 2,
|
|
22
|
+
d: "M15 19l-7-7 7-7"
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ e("svg", {
|
|
27
|
+
className: "size-5 text-text-primary",
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
viewBox: "0 0 24 24",
|
|
31
|
+
children: /* @__PURE__ */ e("path", {
|
|
32
|
+
strokeLinecap: "round",
|
|
33
|
+
strokeLinejoin: "round",
|
|
34
|
+
strokeWidth: 2,
|
|
35
|
+
d: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ e("h2", {
|
|
39
|
+
className: "text-sm font-semibold text-text-primary",
|
|
40
|
+
children: "Notifications"
|
|
41
|
+
}),
|
|
42
|
+
r > 0 && /* @__PURE__ */ e("span", {
|
|
43
|
+
className: "inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold text-action-primary-text bg-action-primary-bg rounded-full",
|
|
44
|
+
children: r > 9 ? "9+" : r
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
}), /* @__PURE__ */ t("div", {
|
|
48
|
+
className: "flex items-center gap-2",
|
|
49
|
+
children: [r > 0 && /* @__PURE__ */ e("button", {
|
|
50
|
+
type: "button",
|
|
51
|
+
onClick: a,
|
|
52
|
+
className: "text-xs text-action-primary-bg hover:underline font-medium",
|
|
53
|
+
children: "Mark all read"
|
|
54
|
+
}), !n && /* @__PURE__ */ e("button", {
|
|
55
|
+
type: "button",
|
|
56
|
+
onClick: i,
|
|
57
|
+
className: "p-1 rounded-button hover:bg-action-ghost-bg-hover text-text-tertiary",
|
|
58
|
+
"aria-label": "Close panel",
|
|
59
|
+
children: /* @__PURE__ */ e("svg", {
|
|
60
|
+
className: "size-4",
|
|
61
|
+
fill: "none",
|
|
62
|
+
stroke: "currentColor",
|
|
63
|
+
viewBox: "0 0 24 24",
|
|
64
|
+
children: /* @__PURE__ */ e("path", {
|
|
65
|
+
strokeLinecap: "round",
|
|
66
|
+
strokeLinejoin: "round",
|
|
67
|
+
strokeWidth: 2,
|
|
68
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { n as NotificationHeader };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { NotificationCardItem as e } from "./NotificationCardItem.js";
|
|
2
|
+
import { SkeletonCard as t } from "./SkeletonCard.js";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/chrome/notificationCenter/NotificationList.tsx
|
|
5
|
+
var i = ({ loading: i, error: a, notifications: o, filterTab: s, typeFilter: c, appFilter: l, onRetry: u, onMarkAsRead: d, onDelete: f, onRedirect: p }) => /* @__PURE__ */ n("div", {
|
|
6
|
+
className: "flex-1 overflow-y-auto",
|
|
7
|
+
children: i ? /* @__PURE__ */ r("div", {
|
|
8
|
+
className: "p-3 space-y-2",
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ n(t, {}),
|
|
11
|
+
/* @__PURE__ */ n(t, {}),
|
|
12
|
+
/* @__PURE__ */ n(t, {})
|
|
13
|
+
]
|
|
14
|
+
}) : a ? /* @__PURE__ */ r("div", {
|
|
15
|
+
className: "flex flex-col items-center justify-center p-8 text-center",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ n("svg", {
|
|
18
|
+
className: "size-10 text-status-error-text mb-3",
|
|
19
|
+
fill: "none",
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
viewBox: "0 0 24 24",
|
|
22
|
+
children: /* @__PURE__ */ n("path", {
|
|
23
|
+
strokeLinecap: "round",
|
|
24
|
+
strokeLinejoin: "round",
|
|
25
|
+
strokeWidth: 2,
|
|
26
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"
|
|
27
|
+
})
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ n("p", {
|
|
30
|
+
className: "text-sm text-text-secondary mb-2",
|
|
31
|
+
children: "Failed to load notifications"
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ n("button", {
|
|
34
|
+
type: "button",
|
|
35
|
+
onClick: u,
|
|
36
|
+
className: "text-xs text-action-primary-bg hover:underline font-medium",
|
|
37
|
+
children: "Try again"
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
}) : o.length === 0 ? /* @__PURE__ */ r("div", {
|
|
41
|
+
className: "flex flex-col items-center justify-center p-8 text-center",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ n("svg", {
|
|
44
|
+
className: "size-12 text-text-tertiary mb-3",
|
|
45
|
+
fill: "none",
|
|
46
|
+
stroke: "currentColor",
|
|
47
|
+
viewBox: "0 0 24 24",
|
|
48
|
+
children: /* @__PURE__ */ n("path", {
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeLinejoin: "round",
|
|
51
|
+
strokeWidth: 1.5,
|
|
52
|
+
d: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"
|
|
53
|
+
})
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ n("p", {
|
|
56
|
+
className: "text-sm font-medium text-text-primary",
|
|
57
|
+
children: "You're all caught up!"
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ n("p", {
|
|
60
|
+
className: "text-xs text-text-tertiary mt-1",
|
|
61
|
+
children: s !== "all" || c !== "ALL" || l !== "ALL" ? "No notifications match your filters" : "No notifications yet"
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
}) : /* @__PURE__ */ n("div", {
|
|
65
|
+
className: "p-2 space-y-1.5",
|
|
66
|
+
children: o.map((t) => /* @__PURE__ */ n(e, {
|
|
67
|
+
notification: t,
|
|
68
|
+
onMarkAsRead: d,
|
|
69
|
+
onDelete: f,
|
|
70
|
+
onRedirect: p
|
|
71
|
+
}, t.id))
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
//#endregion
|
|
75
|
+
export { i as NotificationList };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
//#region src/chrome/notificationCenter/NotificationPanel.tsx
|
|
3
|
+
var r = ({ isMobile: r, onClose: i, children: a }) => r ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
|
|
4
|
+
className: "fixed inset-0 bg-black/50 z-[60]",
|
|
5
|
+
onClick: i,
|
|
6
|
+
"aria-hidden": "true"
|
|
7
|
+
}), /* @__PURE__ */ t("div", {
|
|
8
|
+
className: "fixed inset-x-0 bottom-0 top-0 bg-bg-elevated z-[70] flex flex-col",
|
|
9
|
+
role: "dialog",
|
|
10
|
+
"aria-label": "Notifications panel",
|
|
11
|
+
children: a
|
|
12
|
+
})] }) : /* @__PURE__ */ t("div", {
|
|
13
|
+
className: "absolute right-0 top-full mt-2 w-[calc(100vw-1.5rem)] sm:w-[420px] max-h-[600px] bg-bg-elevated border border-border-subtle rounded-card shadow-popover z-50 overflow-hidden flex flex-col",
|
|
14
|
+
role: "dialog",
|
|
15
|
+
"aria-label": "Notifications panel",
|
|
16
|
+
children: a
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { r as NotificationPanel };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/chrome/notificationCenter/SkeletonCard.tsx
|
|
3
|
+
var n = () => /* @__PURE__ */ t("div", {
|
|
4
|
+
className: "flex gap-3 p-3 rounded-card border border-border-subtle animate-pulse",
|
|
5
|
+
children: [/* @__PURE__ */ e("div", { className: "size-6 rounded bg-bg-muted flex-shrink-0" }), /* @__PURE__ */ t("div", {
|
|
6
|
+
className: "flex-1 space-y-2",
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ e("div", { className: "h-4 bg-bg-muted rounded w-3/4" }),
|
|
9
|
+
/* @__PURE__ */ e("div", { className: "h-3 bg-bg-muted rounded w-full" }),
|
|
10
|
+
/* @__PURE__ */ t("div", {
|
|
11
|
+
className: "flex gap-2",
|
|
12
|
+
children: [/* @__PURE__ */ e("div", { className: "h-3 bg-bg-muted rounded w-12" }), /* @__PURE__ */ e("div", { className: "h-3 bg-bg-muted rounded w-16" })]
|
|
13
|
+
})
|
|
14
|
+
]
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as SkeletonCard };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//#region src/chrome/notificationCenter/constants.ts
|
|
2
|
+
var e = {
|
|
3
|
+
URGENT: {
|
|
4
|
+
color: "text-status-error-text",
|
|
5
|
+
bgColor: "bg-status-error-bg",
|
|
6
|
+
label: "Urgent",
|
|
7
|
+
order: 0
|
|
8
|
+
},
|
|
9
|
+
HIGH: {
|
|
10
|
+
color: "text-status-warning-text",
|
|
11
|
+
bgColor: "bg-status-warning-bg",
|
|
12
|
+
label: "High",
|
|
13
|
+
order: 1
|
|
14
|
+
},
|
|
15
|
+
MEDIUM: {
|
|
16
|
+
color: "text-status-info-text",
|
|
17
|
+
bgColor: "bg-status-info-bg",
|
|
18
|
+
label: "Medium",
|
|
19
|
+
order: 2
|
|
20
|
+
},
|
|
21
|
+
LOW: {
|
|
22
|
+
color: "text-text-tertiary",
|
|
23
|
+
bgColor: "bg-bg-muted",
|
|
24
|
+
label: "Low",
|
|
25
|
+
order: 3
|
|
26
|
+
}
|
|
27
|
+
}, t = {
|
|
28
|
+
SYSTEM: {
|
|
29
|
+
icon: "⚙️",
|
|
30
|
+
label: "System"
|
|
31
|
+
},
|
|
32
|
+
ALERT: {
|
|
33
|
+
icon: "⚠️",
|
|
34
|
+
label: "Alert"
|
|
35
|
+
},
|
|
36
|
+
TRANSACTIONAL: {
|
|
37
|
+
icon: "📋",
|
|
38
|
+
label: "Transaction"
|
|
39
|
+
},
|
|
40
|
+
MARKETING: {
|
|
41
|
+
icon: "📣",
|
|
42
|
+
label: "Marketing"
|
|
43
|
+
}
|
|
44
|
+
}, n = [
|
|
45
|
+
{
|
|
46
|
+
value: "all",
|
|
47
|
+
label: "All"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "unread",
|
|
51
|
+
label: "Unread"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: "read",
|
|
55
|
+
label: "Read"
|
|
56
|
+
}
|
|
57
|
+
], r = [
|
|
58
|
+
{
|
|
59
|
+
value: "ALL",
|
|
60
|
+
label: "All"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
value: "SYSTEM",
|
|
64
|
+
label: "System"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
value: "ALERT",
|
|
68
|
+
label: "Alert"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
value: "TRANSACTIONAL",
|
|
72
|
+
label: "Transactional"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
value: "MARKETING",
|
|
76
|
+
label: "Marketing"
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
function i(e) {
|
|
80
|
+
let t = Date.now() - new Date(e).getTime(), n = Math.floor(t / 1e3), r = Math.floor(n / 60), i = Math.floor(r / 60), a = Math.floor(i / 24);
|
|
81
|
+
return n < 60 ? "Just now" : r < 60 ? `${r}m ago` : i < 24 ? `${i}h ago` : a < 7 ? `${a}d ago` : new Date(e).toLocaleDateString();
|
|
82
|
+
}
|
|
83
|
+
function a(t, n) {
|
|
84
|
+
let r = [...t];
|
|
85
|
+
switch (n) {
|
|
86
|
+
case "newest": return r.sort((e, t) => new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime());
|
|
87
|
+
case "oldest": return r.sort((e, t) => new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime());
|
|
88
|
+
case "priority": return r.sort((t, n) => (e[t.priority]?.order ?? 99) - (e[n.priority]?.order ?? 99));
|
|
89
|
+
default: return r;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { n as FILTER_TABS, e as PRIORITY_CONFIG, t as TYPE_CONFIG, r as TYPE_FILTERS, i as formatRelativeTime, a as sortNotifications };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { gql as e } from "@apollo/client";
|
|
2
|
+
//#region src/chrome/notificationCenter/gql.ts
|
|
3
|
+
var t = e`
|
|
4
|
+
query GetNotifications($filter: NotificationFilterInput, $limit: Int, $offset: Int) {
|
|
5
|
+
notifications(filter: $filter, limit: $limit, offset: $offset) {
|
|
6
|
+
items {
|
|
7
|
+
id
|
|
8
|
+
title
|
|
9
|
+
message
|
|
10
|
+
type
|
|
11
|
+
priority
|
|
12
|
+
status
|
|
13
|
+
channel
|
|
14
|
+
appName
|
|
15
|
+
redirectUrl
|
|
16
|
+
isRead
|
|
17
|
+
readAt
|
|
18
|
+
createdAt
|
|
19
|
+
}
|
|
20
|
+
total
|
|
21
|
+
hasMore
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`, n = e`
|
|
25
|
+
query GetMyUnreadNotificationCount($filter: NotificationFilterInput) {
|
|
26
|
+
myUnreadNotificationCount(filter: $filter)
|
|
27
|
+
}
|
|
28
|
+
`, r = e`
|
|
29
|
+
subscription MyUnreadNotificationCountStream($filter: NotificationFilterInput) {
|
|
30
|
+
myUnreadNotificationCountStream(filter: $filter)
|
|
31
|
+
}
|
|
32
|
+
`, i = e`
|
|
33
|
+
query MyCountsByApp {
|
|
34
|
+
myNotificationCountsByApp
|
|
35
|
+
}
|
|
36
|
+
`, a = e`
|
|
37
|
+
mutation MarkAsRead($id: ID!) {
|
|
38
|
+
markNotificationAsRead(id: $id) {
|
|
39
|
+
id
|
|
40
|
+
isRead
|
|
41
|
+
readAt
|
|
42
|
+
status
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`, o = e`
|
|
46
|
+
mutation MarkAllRead {
|
|
47
|
+
markAllMyNotificationsAsRead {
|
|
48
|
+
success
|
|
49
|
+
count
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`, s = e`
|
|
53
|
+
mutation DeleteNotification($id: ID!) {
|
|
54
|
+
deleteNotification(id: $id)
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
//#endregion
|
|
58
|
+
export { i as COUNTS_BY_APP_QUERY, s as DELETE_NOTIFICATION_MUTATION, o as MARK_ALL_READ_MUTATION, a as MARK_READ_MUTATION, r as MY_UNREAD_COUNT_SUBSCRIPTION, t as NOTIFICATIONS_QUERY, n as UNREAD_COUNT_QUERY };
|