@peers-app/peers-ui 0.33.0 → 0.33.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/notifications/group-names.d.ts +2 -0
- package/dist/notifications/group-names.js +23 -0
- package/dist/notifications/notification-bell.d.ts +5 -3
- package/dist/notifications/notification-bell.js +23 -49
- package/dist/notifications/notifications-client.d.ts +12 -1
- package/dist/notifications/notifications-client.js +20 -7
- package/dist/notifications/notifications-panel.d.ts +41 -0
- package/dist/notifications/notifications-panel.js +108 -0
- package/dist/notifications/notifications-screen.js +14 -4
- package/dist/tabs-layout/network-status-indicator.d.ts +8 -2
- package/dist/tabs-layout/network-status-indicator.js +8 -3
- package/dist/tabs-layout/tabs-layout.js +21 -4
- package/package.json +3 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGroupNames = useGroupNames;
|
|
4
|
+
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
/** Group names by id, with "Personal" for the user's own context. */
|
|
7
|
+
function useGroupNames() {
|
|
8
|
+
const [names, setNames] = (0, react_1.useState)(new Map());
|
|
9
|
+
(0, react_1.useEffect)(() => {
|
|
10
|
+
let cancelled = false;
|
|
11
|
+
void (0, peers_sdk_1.getUserContext)().then(async (userContext) => {
|
|
12
|
+
const groups = await (0, peers_sdk_1.Groups)(userContext.userDataContext).list({});
|
|
13
|
+
const next = new Map(groups.map((group) => [group.groupId, group.name]));
|
|
14
|
+
next.set(userContext.userId, "Personal");
|
|
15
|
+
if (!cancelled)
|
|
16
|
+
setNames(next);
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
cancelled = true;
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
return names;
|
|
23
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { useGroupNames } from "./group-names";
|
|
2
|
+
/**
|
|
3
|
+
* Bell with the notification badge, and a popover of active notifications. On a narrow screen
|
|
4
|
+
* the popover is a sheet across the screen instead, so it can't run off the edge.
|
|
5
|
+
*/
|
|
4
6
|
export declare function NotificationBell({ compact }: {
|
|
5
7
|
compact?: boolean;
|
|
6
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,41 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGroupNames =
|
|
3
|
+
exports.useGroupNames = void 0;
|
|
4
4
|
exports.NotificationBell = NotificationBell;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
7
6
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
7
|
+
const globals_1 = require("../globals");
|
|
8
|
+
const hooks_1 = require("../hooks");
|
|
10
9
|
const notifications_client_1 = require("./notifications-client");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const next = new Map(groups.map((group) => [group.groupId, group.name]));
|
|
19
|
-
next.set(userContext.userId, "Personal");
|
|
20
|
-
if (!cancelled)
|
|
21
|
-
setNames(next);
|
|
22
|
-
});
|
|
23
|
-
return () => {
|
|
24
|
-
cancelled = true;
|
|
25
|
-
};
|
|
26
|
-
}, []);
|
|
27
|
-
return names;
|
|
28
|
-
}
|
|
29
|
-
/** Bell with the notification badge, and a popover of active notifications. */
|
|
10
|
+
const notifications_panel_1 = require("./notifications-panel");
|
|
11
|
+
var group_names_1 = require("./group-names");
|
|
12
|
+
Object.defineProperty(exports, "useGroupNames", { enumerable: true, get: function () { return group_names_1.useGroupNames; } });
|
|
13
|
+
/**
|
|
14
|
+
* Bell with the notification badge, and a popover of active notifications. On a narrow screen
|
|
15
|
+
* the popover is a sheet across the screen instead, so it can't run off the edge.
|
|
16
|
+
*/
|
|
30
17
|
function NotificationBell({ compact = false }) {
|
|
18
|
+
(0, hooks_1.useObservable)(globals_1.isDesktop);
|
|
31
19
|
const summary = (0, notifications_client_1.useNotificationSummary)();
|
|
32
20
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
21
|
+
const [sheetTop, setSheetTop] = (0, react_1.useState)(0);
|
|
33
22
|
const containerRef = (0, react_1.useRef)(null);
|
|
34
23
|
const popoverId = (0, react_1.useId)();
|
|
35
|
-
const
|
|
36
|
-
const groupNames = useGroupNames();
|
|
24
|
+
const narrow = !(0, globals_1.isDesktop)();
|
|
37
25
|
(0, react_1.useEffect)(() => {
|
|
38
|
-
if (!open)
|
|
26
|
+
if (!open || narrow)
|
|
39
27
|
return;
|
|
40
28
|
const closeOutside = (event) => {
|
|
41
29
|
if (!containerRef.current?.contains(event.target))
|
|
@@ -51,31 +39,17 @@ function NotificationBell({ compact = false }) {
|
|
|
51
39
|
document.removeEventListener("mousedown", closeOutside);
|
|
52
40
|
document.removeEventListener("keydown", closeOnEscape);
|
|
53
41
|
};
|
|
54
|
-
}, [open]);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (!open
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
void (0, notifications_client_1.actOnNotifications)({ action: "seen", notificationIds: unseen });
|
|
62
|
-
}, [open, notifications]);
|
|
63
|
-
const label = summary.count
|
|
64
|
-
? `${summary.count} notification${summary.count === 1 ? "" : "s"}`
|
|
65
|
-
: summary.dot
|
|
66
|
-
? "New notifications"
|
|
67
|
-
: "Notifications";
|
|
42
|
+
}, [open, narrow]);
|
|
43
|
+
const label = (0, notifications_panel_1.notificationBadgeLabel)(summary);
|
|
44
|
+
const toggle = () => {
|
|
45
|
+
if (!open)
|
|
46
|
+
setSheetTop((containerRef.current?.getBoundingClientRect().bottom ?? 0) + 4);
|
|
47
|
+
setOpen((current) => !current);
|
|
48
|
+
};
|
|
68
49
|
return ((0, jsx_runtime_1.jsxs)("div", { ref: containerRef, className: "position-relative d-flex align-items-center", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm d-flex align-items-center px-2 text-body-secondary", style: {
|
|
69
50
|
border: "none",
|
|
70
51
|
background: "transparent",
|
|
71
52
|
minWidth: compact ? "30px" : undefined,
|
|
72
|
-
}, "aria-label": label, title: summary.paused ? `${label} (paused)` : label, "aria-expanded": open, "aria-controls": popoverId, "data-testid": "notification-bell", onClick:
|
|
73
|
-
|
|
74
|
-
top: "-0.45rem",
|
|
75
|
-
right: "-0.7rem",
|
|
76
|
-
padding: "0.2em 0.4em",
|
|
77
|
-
}, "aria-hidden": "true", "data-testid": "notification-count", children: summary.count > 99 ? "99+" : summary.count })) : (summary.dot && ((0, jsx_runtime_1.jsx)("span", { className: "position-absolute rounded-circle bg-danger", style: { width: "0.45rem", height: "0.45rem", top: "-0.1rem", right: "-0.2rem" }, "aria-hidden": "true", "data-testid": "notification-dot" })))] }) }), open && ((0, jsx_runtime_1.jsxs)("div", { id: popoverId, role: "dialog", "aria-label": "Notifications", className: "position-absolute end-0 top-100 mt-1 bg-body border rounded shadow", style: { width: "min(22rem, calc(100vw - 2rem))", zIndex: 1080 }, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-between px-2 py-1 border-bottom", children: [(0, jsx_runtime_1.jsx)("strong", { className: "small", children: "Notifications" }), notifications && notifications.length > 0 && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-link p-0", onClick: () => void (0, notifications_client_1.actOnNotifications)({ action: "dismiss", all: true }), children: "Clear all" }))] }), (0, jsx_runtime_1.jsx)("div", { style: { maxHeight: "24rem", overflowY: "auto" }, children: error ? ((0, jsx_runtime_1.jsx)("output", { className: "small text-danger p-3", children: error })) : notifications === undefined ? ((0, jsx_runtime_1.jsx)("div", { className: "small text-body-secondary p-3", children: "Loading\u2026" })) : notifications.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "small text-body-secondary p-3", children: "You're all caught up." })) : (notifications.map((notification) => ((0, jsx_runtime_1.jsx)(notification_item_1.NotificationItem, { notification: notification, groupName: groupNames.get(notification.groupId), onOpened: () => setOpen(false) }, notification.notificationId)))) }), (0, jsx_runtime_1.jsx)("div", { className: "border-top px-2 py-1 text-end", children: (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-link p-0", onClick: () => {
|
|
78
|
-
setOpen(false);
|
|
79
|
-
(0, tabs_state_1.goToTabPath)(notifications_client_1.NOTIFICATIONS_PATH);
|
|
80
|
-
}, children: "History and settings" }) })] }))] }));
|
|
53
|
+
}, "aria-label": label, title: summary.paused ? `${label} (paused)` : label, "aria-expanded": open, "aria-controls": popoverId, "data-testid": "notification-bell", onClick: toggle, children: (0, jsx_runtime_1.jsxs)("span", { className: "position-relative d-inline-flex", children: [(0, jsx_runtime_1.jsx)("i", { className: `bi ${summary.paused ? "bi-bell-slash" : (0, notifications_panel_1.hasNotificationBadge)(summary) ? "bi-bell-fill" : "bi-bell"}`, "aria-hidden": "true" }), (0, jsx_runtime_1.jsx)(notifications_panel_1.NotificationBadge, { summary: summary })] }) }), open &&
|
|
54
|
+
(narrow ? ((0, jsx_runtime_1.jsx)(notifications_panel_1.NotificationsSheet, { id: popoverId, top: sheetTop, onClose: () => setOpen(false) })) : ((0, jsx_runtime_1.jsx)("div", { id: popoverId, role: "dialog", "aria-label": "Notifications", className: "position-absolute end-0 top-100 mt-1 bg-body border rounded shadow", style: { width: "min(22rem, calc(100vw - 2rem))", zIndex: 1080 }, children: (0, jsx_runtime_1.jsx)(notifications_panel_1.NotificationsPanel, { onClose: () => setOpen(false) }) })))] }));
|
|
81
55
|
}
|
|
@@ -41,7 +41,18 @@ export declare function actOnNotifications(input: IActOnNotificationsInput): Pro
|
|
|
41
41
|
export declare function openNotification(notification: INotification): Promise<void>;
|
|
42
42
|
/** Finish a notification's group switch after the new group's routes and tabs have loaded. */
|
|
43
43
|
export declare function resumeNotificationNavigation(): Promise<void>;
|
|
44
|
-
/**
|
|
44
|
+
/** How long {@link openNotificationById} waits for a notification to sync in, and how often it looks. */
|
|
45
|
+
export declare const OPEN_NOTIFICATION_WAIT: {
|
|
46
|
+
totalMs: number;
|
|
47
|
+
everyMs: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Open a notification by id, as the desktop app does when its OS notification is clicked.
|
|
51
|
+
*
|
|
52
|
+
* A notification pushed to a closed PWA reaches its table only once the app has started and
|
|
53
|
+
* synced, so a missing one is looked for again for a few seconds before the notifications
|
|
54
|
+
* screen opens instead.
|
|
55
|
+
*/
|
|
45
56
|
export declare function openNotificationById(notificationId: string): Promise<void>;
|
|
46
57
|
/** Short relative time, such as "3m" or "2d". */
|
|
47
58
|
export declare function timeAgo(date: Date, now?: number): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NOTIFICATIONS_PATH = exports.notificationsContract = void 0;
|
|
3
|
+
exports.OPEN_NOTIFICATION_WAIT = exports.NOTIFICATIONS_PATH = exports.notificationsContract = void 0;
|
|
4
4
|
exports.useNotificationSummary = useNotificationSummary;
|
|
5
5
|
exports.useNotifications = useNotifications;
|
|
6
6
|
exports.listNotifications = listNotifications;
|
|
@@ -132,13 +132,26 @@ async function resumeNotificationNavigation() {
|
|
|
132
132
|
// A stale or malformed session value must not prevent the shell from starting.
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
/**
|
|
135
|
+
/** How long {@link openNotificationById} waits for a notification to sync in, and how often it looks. */
|
|
136
|
+
exports.OPEN_NOTIFICATION_WAIT = { totalMs: 10_000, everyMs: 500 };
|
|
137
|
+
/**
|
|
138
|
+
* Open a notification by id, as the desktop app does when its OS notification is clicked.
|
|
139
|
+
*
|
|
140
|
+
* A notification pushed to a closed PWA reaches its table only once the app has started and
|
|
141
|
+
* synced, so a missing one is looked for again for a few seconds before the notifications
|
|
142
|
+
* screen opens instead.
|
|
143
|
+
*/
|
|
136
144
|
async function openNotificationById(notificationId) {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
await
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
const deadline = Date.now() + exports.OPEN_NOTIFICATION_WAIT.totalMs;
|
|
146
|
+
do {
|
|
147
|
+
const [notification] = await listNotifications({ notificationIds: [notificationId], limit: 1 });
|
|
148
|
+
if (notification)
|
|
149
|
+
return openNotification(notification);
|
|
150
|
+
if (Date.now() >= deadline)
|
|
151
|
+
break;
|
|
152
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(exports.OPEN_NOTIFICATION_WAIT.everyMs, deadline - Date.now())));
|
|
153
|
+
} while (Date.now() < deadline);
|
|
154
|
+
(0, tabs_state_1.goToTabPath)(exports.NOTIFICATIONS_PATH);
|
|
142
155
|
}
|
|
143
156
|
/** Short relative time, such as "3m" or "2d". */
|
|
144
157
|
function timeAgo(date, now = Date.now()) {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { INotificationSummary } from "@peers-app/peers-sdk";
|
|
2
|
+
/** Whether the badge shows anything: a count of loud and priority, or a dot for unseen quiet. */
|
|
3
|
+
export declare function hasNotificationBadge(summary: INotificationSummary): boolean;
|
|
4
|
+
/** A short label for the badge, for `aria-label` and `title`. */
|
|
5
|
+
export declare function notificationBadgeLabel(summary: INotificationSummary): string;
|
|
6
|
+
/**
|
|
7
|
+
* The notification badge: the red count of active loud and priority notifications, otherwise a
|
|
8
|
+
* red dot while quiet ones are unseen, otherwise nothing.
|
|
9
|
+
*
|
|
10
|
+
* `corner` places it on the top-right corner of a `position-relative` parent that wraps a
|
|
11
|
+
* button's content inside its padding (the bell's icon, the mobile menu button's icon and tab
|
|
12
|
+
* count); `inline` sits in a row of text (a menu item).
|
|
13
|
+
*/
|
|
14
|
+
export declare function NotificationBadge({ summary, placement, testId, }: {
|
|
15
|
+
summary: INotificationSummary;
|
|
16
|
+
placement?: "corner" | "inline";
|
|
17
|
+
testId?: string;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
/**
|
|
20
|
+
* The active notifications, with "Clear all" and a link to the notifications screen. Showing
|
|
21
|
+
* the list counts as seeing what's in it.
|
|
22
|
+
*
|
|
23
|
+
* @param onClose - Called when the panel should close: a notification was opened, or the
|
|
24
|
+
* "History and settings" link was used.
|
|
25
|
+
*/
|
|
26
|
+
export declare function NotificationsPanel({ onClose }: {
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
/**
|
|
30
|
+
* {@link NotificationsPanel} as a sheet across the screen, for narrow screens: fixed below
|
|
31
|
+
* `top`, 0.5 rem from each edge, so it can't run off the screen. Tapping outside it or pressing
|
|
32
|
+
* Escape closes it. Like a dialog, it takes keyboard focus when it opens, and gives it back to
|
|
33
|
+
* what had it when it closes, if that's still on the page.
|
|
34
|
+
*
|
|
35
|
+
* @param top - Where the sheet starts, in px from the top of the viewport (below the header).
|
|
36
|
+
*/
|
|
37
|
+
export declare function NotificationsSheet({ top, onClose, id, }: {
|
|
38
|
+
top: number;
|
|
39
|
+
onClose: () => void;
|
|
40
|
+
id?: string;
|
|
41
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasNotificationBadge = hasNotificationBadge;
|
|
4
|
+
exports.notificationBadgeLabel = notificationBadgeLabel;
|
|
5
|
+
exports.NotificationBadge = NotificationBadge;
|
|
6
|
+
exports.NotificationsPanel = NotificationsPanel;
|
|
7
|
+
exports.NotificationsSheet = NotificationsSheet;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const tabs_state_1 = require("../tabs-layout/tabs-state");
|
|
11
|
+
const group_names_1 = require("./group-names");
|
|
12
|
+
const notification_item_1 = require("./notification-item");
|
|
13
|
+
const notifications_client_1 = require("./notifications-client");
|
|
14
|
+
/** Whether the badge shows anything: a count of loud and priority, or a dot for unseen quiet. */
|
|
15
|
+
function hasNotificationBadge(summary) {
|
|
16
|
+
return summary.count > 0 || summary.dot;
|
|
17
|
+
}
|
|
18
|
+
/** A short label for the badge, for `aria-label` and `title`. */
|
|
19
|
+
function notificationBadgeLabel(summary) {
|
|
20
|
+
return summary.count
|
|
21
|
+
? `${summary.count} notification${summary.count === 1 ? "" : "s"}`
|
|
22
|
+
: summary.dot
|
|
23
|
+
? "New notifications"
|
|
24
|
+
: "Notifications";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The notification badge: the red count of active loud and priority notifications, otherwise a
|
|
28
|
+
* red dot while quiet ones are unseen, otherwise nothing.
|
|
29
|
+
*
|
|
30
|
+
* `corner` places it on the top-right corner of a `position-relative` parent that wraps a
|
|
31
|
+
* button's content inside its padding (the bell's icon, the mobile menu button's icon and tab
|
|
32
|
+
* count); `inline` sits in a row of text (a menu item).
|
|
33
|
+
*/
|
|
34
|
+
function NotificationBadge({ summary, placement = "corner", testId = "notification", }) {
|
|
35
|
+
const corner = placement === "corner";
|
|
36
|
+
if (summary.count > 0) {
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: `badge rounded-pill bg-danger ${corner ? "position-absolute" : ""}`, style: corner
|
|
38
|
+
? { fontSize: "0.55rem", top: "-0.45rem", right: "-0.7rem", padding: "0.2em 0.4em" }
|
|
39
|
+
: { fontSize: "0.75rem" }, "aria-hidden": "true", "data-testid": `${testId}-count`, children: summary.count > 99 ? "99+" : summary.count }));
|
|
40
|
+
}
|
|
41
|
+
if (!summary.dot)
|
|
42
|
+
return null;
|
|
43
|
+
const size = corner ? "0.45rem" : "0.6rem";
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: `rounded-circle bg-danger d-inline-block ${corner ? "position-absolute" : ""}`, style: corner
|
|
45
|
+
? { width: size, height: size, top: "-0.1rem", right: "-0.2rem" }
|
|
46
|
+
: { width: size, height: size }, "aria-hidden": "true", "data-testid": `${testId}-dot` }));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The active notifications, with "Clear all" and a link to the notifications screen. Showing
|
|
50
|
+
* the list counts as seeing what's in it.
|
|
51
|
+
*
|
|
52
|
+
* @param onClose - Called when the panel should close: a notification was opened, or the
|
|
53
|
+
* "History and settings" link was used.
|
|
54
|
+
*/
|
|
55
|
+
function NotificationsPanel({ onClose }) {
|
|
56
|
+
const { notifications, error } = (0, notifications_client_1.useNotifications)({ activeOnly: true, limit: 20 }, true);
|
|
57
|
+
const groupNames = (0, group_names_1.useGroupNames)();
|
|
58
|
+
(0, react_1.useEffect)(() => {
|
|
59
|
+
if (!notifications)
|
|
60
|
+
return;
|
|
61
|
+
const unseen = notifications.filter((n) => !n.seenAt).map((n) => n.notificationId);
|
|
62
|
+
if (unseen.length)
|
|
63
|
+
void (0, notifications_client_1.actOnNotifications)({ action: "seen", notificationIds: unseen });
|
|
64
|
+
}, [notifications]);
|
|
65
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-between px-2 py-1 border-bottom", children: [(0, jsx_runtime_1.jsx)("strong", { className: "small", children: "Notifications" }), notifications && notifications.length > 0 && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-link p-0", onClick: () => void (0, notifications_client_1.actOnNotifications)({ action: "dismiss", all: true }), children: "Clear all" }))] }), (0, jsx_runtime_1.jsx)("div", { style: { maxHeight: "24rem", overflowY: "auto" }, children: error ? ((0, jsx_runtime_1.jsx)("output", { className: "small text-danger p-3", children: error })) : notifications === undefined ? ((0, jsx_runtime_1.jsx)("div", { className: "small text-body-secondary p-3", children: "Loading\u2026" })) : notifications.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "small text-body-secondary p-3", children: "You're all caught up." })) : (notifications.map((notification) => ((0, jsx_runtime_1.jsx)(notification_item_1.NotificationItem, { notification: notification, groupName: groupNames.get(notification.groupId), onOpened: onClose }, notification.notificationId)))) }), (0, jsx_runtime_1.jsx)("div", { className: "border-top px-2 py-1 text-end", children: (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-link p-0", onClick: () => {
|
|
66
|
+
onClose();
|
|
67
|
+
(0, tabs_state_1.goToTabPath)(notifications_client_1.NOTIFICATIONS_PATH);
|
|
68
|
+
}, children: "History and settings" }) })] }));
|
|
69
|
+
}
|
|
70
|
+
/** Gap between the screen edges and the sheet. */
|
|
71
|
+
const SHEET_GUTTER = "0.5rem";
|
|
72
|
+
/**
|
|
73
|
+
* {@link NotificationsPanel} as a sheet across the screen, for narrow screens: fixed below
|
|
74
|
+
* `top`, 0.5 rem from each edge, so it can't run off the screen. Tapping outside it or pressing
|
|
75
|
+
* Escape closes it. Like a dialog, it takes keyboard focus when it opens, and gives it back to
|
|
76
|
+
* what had it when it closes, if that's still on the page.
|
|
77
|
+
*
|
|
78
|
+
* @param top - Where the sheet starts, in px from the top of the viewport (below the header).
|
|
79
|
+
*/
|
|
80
|
+
function NotificationsSheet({ top, onClose, id, }) {
|
|
81
|
+
const ownId = (0, react_1.useId)();
|
|
82
|
+
const dialogRef = (0, react_1.useRef)(null);
|
|
83
|
+
(0, react_1.useEffect)(() => {
|
|
84
|
+
const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
85
|
+
dialogRef.current?.focus();
|
|
86
|
+
return () => {
|
|
87
|
+
if (opener?.isConnected)
|
|
88
|
+
opener.focus();
|
|
89
|
+
};
|
|
90
|
+
}, []);
|
|
91
|
+
(0, react_1.useEffect)(() => {
|
|
92
|
+
const closeOnEscape = (event) => {
|
|
93
|
+
if (event.key === "Escape")
|
|
94
|
+
onClose();
|
|
95
|
+
};
|
|
96
|
+
document.addEventListener("keydown", closeOnEscape);
|
|
97
|
+
return () => document.removeEventListener("keydown", closeOnEscape);
|
|
98
|
+
}, [onClose]);
|
|
99
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "position-fixed", style: { inset: 0, zIndex: 1079 }, onClick: onClose, "aria-hidden": "true", "data-testid": "notifications-sheet-backdrop" }), (0, jsx_runtime_1.jsx)("div", { ref: dialogRef, id: id ?? ownId, role: "dialog", "aria-label": "Notifications", tabIndex: -1, className: "position-fixed bg-body border rounded shadow", style: {
|
|
100
|
+
outline: "none",
|
|
101
|
+
top: `${top}px`,
|
|
102
|
+
left: SHEET_GUTTER,
|
|
103
|
+
right: SHEET_GUTTER,
|
|
104
|
+
maxHeight: `calc(100dvh - ${top}px - ${SHEET_GUTTER})`,
|
|
105
|
+
overflowY: "auto",
|
|
106
|
+
zIndex: 1080,
|
|
107
|
+
}, "data-testid": "notifications-sheet", children: (0, jsx_runtime_1.jsx)(NotificationsPanel, { onClose: onClose }) })] }));
|
|
108
|
+
}
|
|
@@ -6,8 +6,8 @@ const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const use_observable_1 = require("../hooks/use-observable");
|
|
8
8
|
const ui_loader_1 = require("../ui-router/ui-loader");
|
|
9
|
+
const group_names_1 = require("./group-names");
|
|
9
10
|
const host_controls_1 = require("./host-controls");
|
|
10
|
-
const notification_bell_1 = require("./notification-bell");
|
|
11
11
|
const notification_item_1 = require("./notification-item");
|
|
12
12
|
const notifications_client_1 = require("./notifications-client");
|
|
13
13
|
const levelLabels = {
|
|
@@ -29,7 +29,7 @@ function NotificationList({ section }) {
|
|
|
29
29
|
limit: 100,
|
|
30
30
|
...cursor,
|
|
31
31
|
});
|
|
32
|
-
const groupNames = (0,
|
|
32
|
+
const groupNames = (0, group_names_1.useGroupNames)();
|
|
33
33
|
if (error)
|
|
34
34
|
return (0, jsx_runtime_1.jsx)("div", { className: "alert alert-warning", children: error });
|
|
35
35
|
if (!notifications)
|
|
@@ -41,7 +41,7 @@ function NotificationList({ section }) {
|
|
|
41
41
|
}
|
|
42
42
|
/** Sources the user has heard from, plus every group, so they can set a level for each. */
|
|
43
43
|
function useSources(history, rules) {
|
|
44
|
-
const groupNames = (0,
|
|
44
|
+
const groupNames = (0, group_names_1.useGroupNames)();
|
|
45
45
|
const [packageNames, setPackageNames] = (0, react_1.useState)(new Map());
|
|
46
46
|
const packageIds = (0, react_1.useMemo)(() => [
|
|
47
47
|
...new Set([
|
|
@@ -157,7 +157,7 @@ function NotificationSettings() {
|
|
|
157
157
|
date.setHours(8, 0, 0, 0);
|
|
158
158
|
return date.getTime() - Date.now();
|
|
159
159
|
};
|
|
160
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex flex-column gap-4", children: [(0, jsx_runtime_1.jsx)(ThisDeviceSettings, {}), (0, jsx_runtime_1.jsxs)("section", { children: [(0, jsx_runtime_1.jsx)("h6", { children: "Do not disturb" }), (0, jsx_runtime_1.jsx)("p", { className: "small text-body-secondary mb-2", children: "While paused, loud notifications arrive without sound. Priority notifications still come through." }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex flex-wrap gap-2 align-items-center", children: [paused && ((0, jsx_runtime_1.jsxs)("span", { className: "small me-2", children: ["Paused until ", new Date(current.pausedUntil ?? 0).toLocaleString()] })), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-outline-secondary", onClick: () => pauseFor(60 * 60_000), children: "1 hour" }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-outline-secondary", onClick: () => pauseFor(tomorrowMorning()), children: "Until tomorrow morning" }), paused && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-primary", onClick: () => pauseFor(undefined), children: "Resume" }))] })] }), (0, jsx_runtime_1.jsxs)("section", { children: [(0, jsx_runtime_1.jsx)("h6", { children: "Levels by source" }), (0, jsx_runtime_1.jsx)("p", { className: "small text-body-secondary mb-2", children: "Each app asks for a level; you decide what you get. More specific choices win, and a person can only use priority if you allow it here." }), (0, jsx_runtime_1.jsxs)("div", { className: "border rounded", children: [sources.length === 0 && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 small text-body-secondary", children: "Sources appear here once you've had a notification from them." })), sources.map((source) => {
|
|
160
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex flex-column gap-4", children: [(0, jsx_runtime_1.jsx)(ThisDeviceSettings, {}), (0, jsx_runtime_1.jsxs)("section", { children: [(0, jsx_runtime_1.jsx)("h6", { children: "Do not disturb" }), (0, jsx_runtime_1.jsx)("p", { className: "small text-body-secondary mb-2", children: "While paused, loud notifications arrive without sound. Priority notifications still come through." }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex flex-wrap gap-2 align-items-center", children: [paused && ((0, jsx_runtime_1.jsxs)("span", { className: "small me-2", children: ["Paused until ", new Date(current.pausedUntil ?? 0).toLocaleString()] })), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-outline-secondary", onClick: () => pauseFor(60 * 60_000), children: "1 hour" }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-outline-secondary", onClick: () => pauseFor(tomorrowMorning()), children: "Until tomorrow morning" }), paused && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm btn-primary", onClick: () => pauseFor(undefined), children: "Resume" }))] })] }), (0, jsx_runtime_1.jsx)(AwaySetting, { current: current, save: save }), (0, jsx_runtime_1.jsxs)("section", { children: [(0, jsx_runtime_1.jsx)("h6", { children: "Levels by source" }), (0, jsx_runtime_1.jsx)("p", { className: "small text-body-secondary mb-2", children: "Each app asks for a level; you decide what you get. More specific choices win, and a person can only use priority if you allow it here." }), (0, jsx_runtime_1.jsxs)("div", { className: "border rounded", children: [sources.length === 0 && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 small text-body-secondary", children: "Sources appear here once you've had a notification from them." })), sources.map((source) => {
|
|
161
161
|
const rule = rules.find((r) => sameMatch(r, source.match));
|
|
162
162
|
const key = `${source.match.groupId ?? ""}:${source.match.packageId ?? ""}:${source.match.fromUserId ?? ""}:${source.match.kind ?? ""}`;
|
|
163
163
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex flex-wrap align-items-center gap-2 px-2 py-2 border-bottom", children: [(0, jsx_runtime_1.jsx)("span", { className: "flex-grow-1 small", children: source.label }), (0, jsx_runtime_1.jsxs)("select", { className: "form-select form-select-sm", style: { width: "auto" }, "aria-label": `Level for ${source.label}`, value: rule?.level ?? "", onChange: (event) => setRule(source.match, {
|
|
@@ -167,6 +167,16 @@ function NotificationSettings() {
|
|
|
167
167
|
}) }), "Allow priority"] }))] }, key));
|
|
168
168
|
})] })] })] }));
|
|
169
169
|
}
|
|
170
|
+
/** Choices for how long without input counts as away, in minutes. */
|
|
171
|
+
const AWAY_AFTER_CHOICES = [1, 2, 5, 10, 15, 30];
|
|
172
|
+
/** How long a computer waits without input before it counts the user as away. */
|
|
173
|
+
function AwaySetting({ current, save, }) {
|
|
174
|
+
const minutes = (0, peers_sdk_1.notificationAwayAfterMs)(current) / 60_000;
|
|
175
|
+
const choices = AWAY_AFTER_CHOICES.includes(minutes)
|
|
176
|
+
? AWAY_AFTER_CHOICES
|
|
177
|
+
: [...AWAY_AFTER_CHOICES, minutes].sort((a, b) => a - b);
|
|
178
|
+
return ((0, jsx_runtime_1.jsxs)("section", { children: [(0, jsx_runtime_1.jsx)("h6", { children: "When you're away" }), (0, jsx_runtime_1.jsx)("p", { className: "small text-body-secondary mb-2", children: "While you aren't using any of your computers, loud and priority notifications also go to your phone, and to other browsers where you turned notifications on. Priority ones always do. A computer counts you as away when its screen locks, when it sleeps, or after this long without input:" }), (0, jsx_runtime_1.jsx)("select", { className: "form-select form-select-sm w-auto", "aria-label": "Away after", value: minutes, onChange: (event) => save({ ...current, awayAfterMinutes: Number(event.target.value) }), children: choices.map((choice) => ((0, jsx_runtime_1.jsxs)("option", { value: choice, children: [choice, " minute", choice === 1 ? "" : "s"] }, choice))) })] }));
|
|
179
|
+
}
|
|
170
180
|
/** Per-device controls the host provides, such as the PWA's browser permission. */
|
|
171
181
|
function ThisDeviceSettings() {
|
|
172
182
|
const [controls] = (0, use_observable_1.useObservable)(host_controls_1.notificationHostControls);
|
|
@@ -64,8 +64,14 @@ export declare function connectionIdentityLabel(name: string | undefined, id: st
|
|
|
64
64
|
export declare function NetworkStatusIndicator({ compact }: {
|
|
65
65
|
compact?: boolean;
|
|
66
66
|
}): import("react/jsx-runtime").JSX.Element;
|
|
67
|
-
/**
|
|
68
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Fixed tabs-strip area for built-in shell indicators.
|
|
69
|
+
*
|
|
70
|
+
* @param notifications - Show the notification bell. The mobile header leaves it out, since
|
|
71
|
+
* notifications live in its menu.
|
|
72
|
+
*/
|
|
73
|
+
export declare function TabsStripIndicators({ compact, notifications, }: {
|
|
69
74
|
compact?: boolean;
|
|
75
|
+
notifications?: boolean;
|
|
70
76
|
}): import("react/jsx-runtime").JSX.Element;
|
|
71
77
|
export {};
|
|
@@ -394,7 +394,12 @@ function NetworkStatusIndicator({ compact = false }) {
|
|
|
394
394
|
(0, tabs_state_1.goToTabPath)("network-viewer");
|
|
395
395
|
} }))] }));
|
|
396
396
|
}
|
|
397
|
-
/**
|
|
398
|
-
|
|
399
|
-
|
|
397
|
+
/**
|
|
398
|
+
* Fixed tabs-strip area for built-in shell indicators.
|
|
399
|
+
*
|
|
400
|
+
* @param notifications - Show the notification bell. The mobile header leaves it out, since
|
|
401
|
+
* notifications live in its menu.
|
|
402
|
+
*/
|
|
403
|
+
function TabsStripIndicators({ compact = false, notifications = true, }) {
|
|
404
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center flex-shrink-0", role: "group", "aria-label": "Application status", children: [notifications && (0, jsx_runtime_1.jsx)(notification_bell_1.NotificationBell, { compact: compact }), (0, jsx_runtime_1.jsx)(NetworkStatusIndicator, { compact: compact })] }));
|
|
400
405
|
}
|
|
@@ -45,6 +45,8 @@ const router_1 = require("../components/router");
|
|
|
45
45
|
const globals_1 = require("../globals");
|
|
46
46
|
const hooks_1 = require("../hooks");
|
|
47
47
|
const local_network_offer_1 = require("../local-network/local-network-offer");
|
|
48
|
+
const notifications_client_1 = require("../notifications/notifications-client");
|
|
49
|
+
const notifications_panel_1 = require("../notifications/notifications-panel");
|
|
48
50
|
const identity_routes_1 = require("../screens/identity/identity-routes");
|
|
49
51
|
const color_mode_dropdown_1 = require("../screens/settings/color-mode-dropdown");
|
|
50
52
|
const system_apps_1 = require("../system-apps");
|
|
@@ -176,14 +178,26 @@ function TabsLayoutInternal({ fillContainer = false } = {}) {
|
|
|
176
178
|
}
|
|
177
179
|
function MobileTabsHeader({ tabs, activeTab, onSwitch, onClose, colorMode, }) {
|
|
178
180
|
const [showMenuDropdown, setShowMenuDropdown] = react_1.default.useState(false);
|
|
181
|
+
// Where the notifications sheet starts: just below this header, or undefined when closed.
|
|
182
|
+
const [notificationsTop, setNotificationsTop] = react_1.default.useState();
|
|
183
|
+
const headerRef = react_1.default.useRef(null);
|
|
184
|
+
const notificationSummary = (0, notifications_client_1.useNotificationSummary)();
|
|
185
|
+
const notificationsLabel = (0, notifications_panel_1.notificationBadgeLabel)(notificationSummary);
|
|
179
186
|
const currentTab = tabs.find((t) => t.tabId === activeTab);
|
|
180
187
|
const nonLauncherTabs = tabs.filter((t) => t.packageId !== "launcher");
|
|
181
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-between px-2 position-relative", style: { height: "36px" }, children: [(0, jsx_runtime_1.jsx)("div", { className: "d-flex align-items-center gap-1", children: (0, jsx_runtime_1.jsx)(group_switcher_1.GroupSwitcher, { colorMode: colorMode, isMobile: true }) }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-center position-absolute", style: {
|
|
188
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: headerRef, className: "d-flex align-items-center justify-content-between px-2 position-relative", style: { height: "36px" }, children: [(0, jsx_runtime_1.jsx)("div", { className: "d-flex align-items-center gap-1", children: (0, jsx_runtime_1.jsx)(group_switcher_1.GroupSwitcher, { colorMode: colorMode, isMobile: true }) }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-center position-absolute", style: {
|
|
182
189
|
left: "50%",
|
|
183
190
|
transform: "translateX(-50%)",
|
|
184
191
|
pointerEvents: "none",
|
|
185
192
|
maxWidth: "calc(100% - 140px)",
|
|
186
|
-
}, children: [currentTab?.iconClassName && currentTab.packageId !== "launcher" && ((0, jsx_runtime_1.jsx)("i", { className: `${currentTab.iconClassName} me-2` })), (0, jsx_runtime_1.jsx)("span", { className: "fw-medium text-truncate small", children: currentTab?.title || "Apps" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-1", children: [(0, jsx_runtime_1.jsx)(network_status_indicator_1.TabsStripIndicators, { compact: true }), (0, jsx_runtime_1.jsxs)("div", { className: "dropdown", children: [(0, jsx_runtime_1.
|
|
193
|
+
}, children: [currentTab?.iconClassName && currentTab.packageId !== "launcher" && ((0, jsx_runtime_1.jsx)("i", { className: `${currentTab.iconClassName} me-2` })), (0, jsx_runtime_1.jsx)("span", { className: "fw-medium text-truncate small", children: currentTab?.title || "Apps" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-1", children: [(0, jsx_runtime_1.jsx)(network_status_indicator_1.TabsStripIndicators, { compact: true, notifications: false }), (0, jsx_runtime_1.jsxs)("div", { className: "dropdown", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: `btn btn-sm ${colorMode === "light" ? "btn-outline-dark" : "btn-outline-light"}`, onClick: () => setShowMenuDropdown(!showMenuDropdown), style: { minWidth: "36px" }, "aria-label": [
|
|
194
|
+
"Menu",
|
|
195
|
+
nonLauncherTabs.length > 0 &&
|
|
196
|
+
`${nonLauncherTabs.length} tab${nonLauncherTabs.length === 1 ? "" : "s"}`,
|
|
197
|
+
(0, notifications_panel_1.hasNotificationBadge)(notificationSummary) && notificationsLabel,
|
|
198
|
+
]
|
|
199
|
+
.filter(Boolean)
|
|
200
|
+
.join(", "), "data-testid": "mobile-menu-button", children: (0, jsx_runtime_1.jsxs)("span", { className: "position-relative d-inline-flex align-items-center", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-list" }), nonLauncherTabs.length > 0 && (0, jsx_runtime_1.jsx)("span", { className: "ms-1", children: nonLauncherTabs.length }), (0, jsx_runtime_1.jsx)(notifications_panel_1.NotificationBadge, { summary: notificationSummary, testId: "mobile-menu-notification" })] }) }), showMenuDropdown && ((0, jsx_runtime_1.jsxs)("div", { className: `dropdown-menu show position-absolute ${colorMode === "light" ? "" : "dropdown-menu-dark"}`, style: {
|
|
187
201
|
right: 0,
|
|
188
202
|
top: "100%",
|
|
189
203
|
zIndex: 1000,
|
|
@@ -196,7 +210,10 @@ function MobileTabsHeader({ tabs, activeTab, onSwitch, onClose, colorMode, }) {
|
|
|
196
210
|
}, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-grid-3x3-gap me-3", style: { fontSize: "20px" } }), (0, jsx_runtime_1.jsx)("span", { children: "Apps" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "dropdown-item d-flex align-items-center", style: { cursor: "pointer", padding: "14px 18px", fontSize: "17px" }, onClick: () => {
|
|
197
211
|
(0, command_palette_1.openCommandPalette)();
|
|
198
212
|
setShowMenuDropdown(false);
|
|
199
|
-
}, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-search me-3", style: { fontSize: "20px" } }), (0, jsx_runtime_1.jsx)("span", { children: "Search" })] }),
|
|
213
|
+
}, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-search me-3", style: { fontSize: "20px" } }), (0, jsx_runtime_1.jsx)("span", { children: "Search" })] }), (0, jsx_runtime_1.jsxs)("button", { type: "button", className: "dropdown-item d-flex align-items-center", style: { cursor: "pointer", padding: "14px 18px", fontSize: "17px" }, "data-testid": "mobile-menu-notifications", onClick: () => {
|
|
214
|
+
setNotificationsTop(headerRef.current?.getBoundingClientRect().bottom ?? 36);
|
|
215
|
+
setShowMenuDropdown(false);
|
|
216
|
+
}, children: [(0, jsx_runtime_1.jsx)("i", { className: `${notificationSummary.paused ? "bi-bell-slash" : (0, notifications_panel_1.hasNotificationBadge)(notificationSummary) ? "bi-bell-fill" : "bi-bell"} me-3`, style: { fontSize: "20px" } }), (0, jsx_runtime_1.jsx)("span", { className: "flex-grow-1", children: "Notifications" }), (0, jsx_runtime_1.jsx)(notifications_panel_1.NotificationBadge, { summary: notificationSummary, placement: "inline", testId: "mobile-menu-item-notification" })] }), nonLauncherTabs.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "dropdown-divider", style: { margin: "8px 0" } })), nonLauncherTabs
|
|
200
217
|
.slice()
|
|
201
218
|
.reverse()
|
|
202
219
|
.map((tab) => ((0, jsx_runtime_1.jsxs)("div", { className: `dropdown-item d-flex align-items-center justify-content-between ${activeTab === tab.tabId ? "active" : ""}`, style: { cursor: "pointer", padding: "14px 18px", fontSize: "17px" }, onClick: () => {
|
|
@@ -205,7 +222,7 @@ function MobileTabsHeader({ tabs, activeTab, onSwitch, onClose, colorMode, }) {
|
|
|
205
222
|
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center", children: [tab.iconClassName && ((0, jsx_runtime_1.jsx)("i", { className: `${tab.iconClassName} me-3`, style: { fontSize: "20px" } })), (0, jsx_runtime_1.jsx)("span", { children: tab.title })] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm p-0 ms-3", style: { width: "32px", height: "32px", fontSize: "20px" }, onClick: (e) => {
|
|
206
223
|
e.stopPropagation();
|
|
207
224
|
onClose(tab.tabId);
|
|
208
|
-
}, children: (0, jsx_runtime_1.jsx)("i", { className: "bi-x" }) })] }, tab.tabId)))] }))] })] }), showMenuDropdown && ((0, jsx_runtime_1.jsx)("div", { className: "position-fixed w-100 h-100", style: { top: 0, left: 0, zIndex: 999 }, onClick: () => setShowMenuDropdown(false) }))] }));
|
|
225
|
+
}, children: (0, jsx_runtime_1.jsx)("i", { className: "bi-x" }) })] }, tab.tabId)))] }))] })] }), showMenuDropdown && ((0, jsx_runtime_1.jsx)("div", { className: "position-fixed w-100 h-100", style: { top: 0, left: 0, zIndex: 999 }, onClick: () => setShowMenuDropdown(false) })), notificationsTop !== undefined && ((0, jsx_runtime_1.jsx)(notifications_panel_1.NotificationsSheet, { top: notificationsTop, onClose: () => setNotificationsTop(undefined) }))] }));
|
|
209
226
|
}
|
|
210
227
|
function TabHeader({ tab, isActive, onSwitch, onClose, colorMode }) {
|
|
211
228
|
const isLight = colorMode === "light";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peers-app/peers-ui",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/peers-app/peers-ui.git"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"lint:fix": "biome check --write ."
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@peers-app/peers-sdk": "^0.33.
|
|
39
|
+
"@peers-app/peers-sdk": "^0.33.1",
|
|
40
40
|
"bootstrap": "^5.3.3",
|
|
41
41
|
"react": "^18.0.0",
|
|
42
42
|
"react-dom": "^18.0.0"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@babel/preset-react": "^7.24.1",
|
|
48
48
|
"@babel/preset-typescript": "^7.27.1",
|
|
49
49
|
"@biomejs/biome": "2.3.11",
|
|
50
|
-
"@peers-app/peers-sdk": "0.33.
|
|
50
|
+
"@peers-app/peers-sdk": "0.33.1",
|
|
51
51
|
"@testing-library/dom": "^10.4.0",
|
|
52
52
|
"@testing-library/jest-dom": "^6.6.3",
|
|
53
53
|
"@testing-library/react": "^16.3.0",
|