@peers-app/peers-ui 0.32.3 → 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/command-palette/command-palette-ui.d.ts +1 -1
- package/dist/command-palette/command-palette-ui.js +10 -74
- package/dist/command-palette/command-palette.js +4 -4
- package/dist/components/markdown-editor/mention-node.js +16 -12
- package/dist/components/markdown-editor/mentions-plugin.js +2 -5
- package/dist/components/markdown-with-mentions.js +10 -5
- package/dist/components/router.js +1 -41
- package/dist/globals.d.ts +2 -6
- package/dist/globals.js +0 -35
- package/dist/mention-configs.d.ts +1 -5
- package/dist/mention-configs.js +4 -54
- 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/screens/account/account-screen.js +1 -1
- package/dist/screens/network-viewer/connection-troubleshooter.js +8 -9
- package/dist/screens/packages/package-details.js +1 -1
- package/dist/screens/search/global-search.js +2 -4
- package/dist/screens/tools/tool-catalog-ipc.d.ts +6 -6
- package/dist/screens/tools/tool-catalog-ipc.js +4 -5
- package/dist/screens/tools/tool-info.js +2 -2
- package/dist/screens/tools/tool-schema.d.ts +1 -1
- package/dist/screens/tools/tool-schema.js +2 -2
- package/dist/system-apps/index.d.ts +0 -3
- package/dist/system-apps/index.js +1 -13
- 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/dist/tabs-layout/tabs-state.d.ts +1 -0
- package/dist/tabs-layout/tabs-state.js +9 -2
- package/dist/utils.d.ts +0 -2
- package/dist/utils.js +0 -9
- package/package.json +3 -3
- package/dist/components/access-level-field.d.ts +0 -10
- package/dist/components/access-level-field.js +0 -28
- package/dist/components/message-logs/message-logs.d.ts +0 -6
- package/dist/components/message-logs/message-logs.js +0 -324
- package/dist/components/message-logs/tool-access-approval-card.d.ts +0 -13
- package/dist/components/message-logs/tool-access-approval-card.js +0 -82
- package/dist/components/messages/avatar.d.ts +0 -9
- package/dist/components/messages/avatar.js +0 -101
- package/dist/components/messages/channel-message-list.d.ts +0 -13
- package/dist/components/messages/channel-message-list.js +0 -158
- package/dist/components/messages/channel-view.d.ts +0 -5
- package/dist/components/messages/channel-view.js +0 -62
- package/dist/components/messages/message-compose.d.ts +0 -11
- package/dist/components/messages/message-compose.js +0 -152
- package/dist/components/messages/message-display.d.ts +0 -9
- package/dist/components/messages/message-display.js +0 -99
- package/dist/components/messages/thread-message-list.d.ts +0 -10
- package/dist/components/messages/thread-message-list.js +0 -122
- package/dist/screens/assistants/assistant-config.d.ts +0 -5
- package/dist/screens/assistants/assistant-config.js +0 -56
- package/dist/screens/assistants/assistant-details.d.ts +0 -3
- package/dist/screens/assistants/assistant-details.js +0 -41
- package/dist/screens/assistants/assistant-info.d.ts +0 -11
- package/dist/screens/assistants/assistant-info.js +0 -13
- package/dist/screens/assistants/assistant-list.d.ts +0 -2
- package/dist/screens/assistants/assistant-list.js +0 -80
- package/dist/screens/assistants/assistant-tools.d.ts +0 -4
- package/dist/screens/assistants/assistant-tools.js +0 -24
- package/dist/screens/tools/tool-access-ipc.d.ts +0 -7
- package/dist/screens/tools/tool-access-ipc.js +0 -18
- package/dist/screens/workflows/workflow-details.d.ts +0 -5
- package/dist/screens/workflows/workflow-details.js +0 -57
- package/dist/screens/workflows/workflow-info.d.ts +0 -4
- package/dist/screens/workflows/workflow-info.js +0 -11
- package/dist/screens/workflows/workflow-instructions.d.ts +0 -4
- package/dist/screens/workflows/workflow-instructions.js +0 -86
- package/dist/screens/workflows/workflow-list.d.ts +0 -1
- package/dist/screens/workflows/workflow-list.js +0 -70
- package/dist/system-apps/assistants.app.d.ts +0 -2
- package/dist/system-apps/assistants.app.js +0 -8
- package/dist/system-apps/threads.app.d.ts +0 -2
- package/dist/system-apps/threads.app.js +0 -8
- package/dist/system-apps/workflows.app.d.ts +0 -2
- package/dist/system-apps/workflows.app.js +0 -8
|
@@ -5,6 +5,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
function FieldTable({ label, schema }) {
|
|
6
6
|
return ((0, jsx_runtime_1.jsxs)("section", { className: "mb-4", children: [(0, jsx_runtime_1.jsx)("h6", { children: label }), !schema?.fields.length ? ((0, jsx_runtime_1.jsx)("p", { children: "No fields" })) : ((0, jsx_runtime_1.jsxs)("table", { className: "table table-sm", children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "Name" }), (0, jsx_runtime_1.jsx)("th", { children: "Type" }), (0, jsx_runtime_1.jsx)("th", { children: "Required" }), (0, jsx_runtime_1.jsx)("th", { children: "Description" })] }) }), (0, jsx_runtime_1.jsx)("tbody", { children: schema.fields.map((field) => ((0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("td", { children: field.name }), (0, jsx_runtime_1.jsxs)("td", { children: [field.type, field.isArray ? "[]" : ""] }), (0, jsx_runtime_1.jsx)("td", { children: field.optional ? "No" : "Yes" }), (0, jsx_runtime_1.jsx)("td", { children: field.description })] }, field.name))) })] }))] }));
|
|
7
7
|
}
|
|
8
|
-
/** Read-only contract field tables
|
|
9
|
-
const ToolSchema = ({ tool, entry }) => ((0, jsx_runtime_1.jsxs)("div", { children: [
|
|
8
|
+
/** Read-only contract field tables. */
|
|
9
|
+
const ToolSchema = ({ tool, entry }) => ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(FieldTable, { label: "Input Schema", schema: entry?.inputSchema ?? tool.inputSchema }), (0, jsx_runtime_1.jsx)(FieldTable, { label: "Output Schema", schema: entry?.outputSchema ?? tool.outputSchema })] }));
|
|
10
10
|
exports.ToolSchema = ToolSchema;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IAppNav } from "@peers-app/peers-sdk";
|
|
2
2
|
import type { IPackageWithNavs } from "../ui-router/routes-loader";
|
|
3
|
-
export { assistantsApp } from "./assistants.app";
|
|
4
3
|
export { consoleLogsApp } from "./console-logs.app";
|
|
5
4
|
export { dataExplorerApp } from "./data-explorer.app";
|
|
6
5
|
export { identityApp } from "./identity.app";
|
|
@@ -10,11 +9,9 @@ export { notificationsApp } from "./notifications.app";
|
|
|
10
9
|
export { packagesApp } from "./packages.app";
|
|
11
10
|
export { searchApp } from "./search.app";
|
|
12
11
|
export { settingsApp } from "./settings.app";
|
|
13
|
-
export { threadsApp } from "./threads.app";
|
|
14
12
|
export { toolsApp } from "./tools.app";
|
|
15
13
|
export { typesApp } from "./types.app";
|
|
16
14
|
export { variablesApp } from "./variables.app";
|
|
17
|
-
export { workflowsApp } from "./workflows.app";
|
|
18
15
|
/** Every built-in app, in launcher order. Mobile Settings appears only in React Native. */
|
|
19
16
|
export declare const systemApps: IAppNav[];
|
|
20
17
|
/** Virtual package that holds {@link systemApps}, so tabs and search treat them like packages. */
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.systemPackage = exports.systemApps = exports.
|
|
4
|
-
var assistants_app_1 = require("./assistants.app");
|
|
5
|
-
Object.defineProperty(exports, "assistantsApp", { enumerable: true, get: function () { return assistants_app_1.assistantsApp; } });
|
|
3
|
+
exports.systemPackage = exports.systemApps = exports.variablesApp = exports.typesApp = exports.toolsApp = exports.settingsApp = exports.searchApp = exports.packagesApp = exports.notificationsApp = exports.networkViewerApp = exports.mobileSettingsApp = exports.identityApp = exports.dataExplorerApp = exports.consoleLogsApp = void 0;
|
|
6
4
|
var console_logs_app_1 = require("./console-logs.app");
|
|
7
5
|
Object.defineProperty(exports, "consoleLogsApp", { enumerable: true, get: function () { return console_logs_app_1.consoleLogsApp; } });
|
|
8
6
|
var data_explorer_app_1 = require("./data-explorer.app");
|
|
@@ -22,17 +20,12 @@ var search_app_1 = require("./search.app");
|
|
|
22
20
|
Object.defineProperty(exports, "searchApp", { enumerable: true, get: function () { return search_app_1.searchApp; } });
|
|
23
21
|
var settings_app_1 = require("./settings.app");
|
|
24
22
|
Object.defineProperty(exports, "settingsApp", { enumerable: true, get: function () { return settings_app_1.settingsApp; } });
|
|
25
|
-
var threads_app_1 = require("./threads.app");
|
|
26
|
-
Object.defineProperty(exports, "threadsApp", { enumerable: true, get: function () { return threads_app_1.threadsApp; } });
|
|
27
23
|
var tools_app_1 = require("./tools.app");
|
|
28
24
|
Object.defineProperty(exports, "toolsApp", { enumerable: true, get: function () { return tools_app_1.toolsApp; } });
|
|
29
25
|
var types_app_1 = require("./types.app");
|
|
30
26
|
Object.defineProperty(exports, "typesApp", { enumerable: true, get: function () { return types_app_1.typesApp; } });
|
|
31
27
|
var variables_app_1 = require("./variables.app");
|
|
32
28
|
Object.defineProperty(exports, "variablesApp", { enumerable: true, get: function () { return variables_app_1.variablesApp; } });
|
|
33
|
-
var workflows_app_1 = require("./workflows.app");
|
|
34
|
-
Object.defineProperty(exports, "workflowsApp", { enumerable: true, get: function () { return workflows_app_1.workflowsApp; } });
|
|
35
|
-
const assistants_app_2 = require("./assistants.app");
|
|
36
29
|
const console_logs_app_2 = require("./console-logs.app");
|
|
37
30
|
const data_explorer_app_2 = require("./data-explorer.app");
|
|
38
31
|
const identity_app_2 = require("./identity.app");
|
|
@@ -43,11 +36,9 @@ const packages_app_2 = require("./packages.app");
|
|
|
43
36
|
// Import individual apps
|
|
44
37
|
const search_app_2 = require("./search.app");
|
|
45
38
|
const settings_app_2 = require("./settings.app");
|
|
46
|
-
const threads_app_2 = require("./threads.app");
|
|
47
39
|
const tools_app_2 = require("./tools.app");
|
|
48
40
|
const types_app_2 = require("./types.app");
|
|
49
41
|
const variables_app_2 = require("./variables.app");
|
|
50
|
-
const workflows_app_2 = require("./workflows.app");
|
|
51
42
|
// Helper to check if running in React Native
|
|
52
43
|
function isReactNative() {
|
|
53
44
|
return typeof window.__NATIVE_THEME !== "undefined";
|
|
@@ -56,7 +47,6 @@ function isReactNative() {
|
|
|
56
47
|
exports.systemApps = [
|
|
57
48
|
// Core Navigation & Search
|
|
58
49
|
search_app_2.searchApp,
|
|
59
|
-
threads_app_2.threadsApp,
|
|
60
50
|
// System Tools & Debugging
|
|
61
51
|
network_viewer_app_2.networkViewerApp,
|
|
62
52
|
console_logs_app_2.consoleLogsApp,
|
|
@@ -65,8 +55,6 @@ exports.systemApps = [
|
|
|
65
55
|
types_app_2.typesApp,
|
|
66
56
|
variables_app_2.variablesApp,
|
|
67
57
|
tools_app_2.toolsApp,
|
|
68
|
-
workflows_app_2.workflowsApp,
|
|
69
|
-
assistants_app_2.assistantsApp,
|
|
70
58
|
packages_app_2.packagesApp,
|
|
71
59
|
identity_app_2.identityApp,
|
|
72
60
|
// User & Settings Apps
|
|
@@ -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";
|
|
@@ -64,6 +64,7 @@ export declare const handleMainPathChanged: (_oldPath: string, newPath: string,
|
|
|
64
64
|
*
|
|
65
65
|
* Contacts, Groups, and Devices tabs from before the Identity app become one
|
|
66
66
|
* Identity tab. The active tab is kept when it is one of those duplicates.
|
|
67
|
+
* Tabs of removed apps are dropped.
|
|
67
68
|
*
|
|
68
69
|
* @param tabs - Persisted tabs.
|
|
69
70
|
* @param activeId - Persisted active tab id.
|
|
@@ -150,17 +150,24 @@ const handleMainPathChanged = (_oldPath, newPath, _setNewMainPath) => {
|
|
|
150
150
|
navigateTo(newPath);
|
|
151
151
|
};
|
|
152
152
|
exports.handleMainPathChanged = handleMainPathChanged;
|
|
153
|
+
/** Routes of the built-in Threads, Assistants, and Workflows apps, which Peers no longer has. */
|
|
154
|
+
const REMOVED_APP_ROUTE = /^(threads|channel|assistants|workflows)(\/|$)/;
|
|
155
|
+
function isRemovedAppRoute(path) {
|
|
156
|
+
return REMOVED_APP_ROUTE.test((0, identity_routes_1.parseRoute)(path).pathname.toLowerCase());
|
|
157
|
+
}
|
|
153
158
|
/**
|
|
154
159
|
* Rewrite stored tabs onto canonical routes.
|
|
155
160
|
*
|
|
156
161
|
* Contacts, Groups, and Devices tabs from before the Identity app become one
|
|
157
162
|
* Identity tab. The active tab is kept when it is one of those duplicates.
|
|
163
|
+
* Tabs of removed apps are dropped.
|
|
158
164
|
*
|
|
159
165
|
* @param tabs - Persisted tabs.
|
|
160
166
|
* @param activeId - Persisted active tab id.
|
|
161
167
|
*/
|
|
162
168
|
function restoreNavigationState(tabs, activeId) {
|
|
163
|
-
const
|
|
169
|
+
const kept = tabs.filter((tab) => tab.tabId === "launcher" || !isRemovedAppRoute(tab.path));
|
|
170
|
+
const migrated = (kept.length > 0 ? kept : [exports.launcherApp]).map(migrateStoredTab);
|
|
164
171
|
const merged = mergeIdentityTabs(migrated, activeId);
|
|
165
172
|
const activeExists = merged.tabs.some((tab) => tab.tabId === merged.activeId);
|
|
166
173
|
return {
|
|
@@ -355,7 +362,7 @@ function migrateRecentPaths(paths) {
|
|
|
355
362
|
const next = [];
|
|
356
363
|
for (const path of paths) {
|
|
357
364
|
const migrated = migrateRecentPath(path);
|
|
358
|
-
if (!migrated || seen.has(migrated)) {
|
|
365
|
+
if (!migrated || seen.has(migrated) || isRemovedAppRoute(migrated)) {
|
|
359
366
|
continue;
|
|
360
367
|
}
|
|
361
368
|
seen.add(migrated);
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/** Plain text content of an HTML string (parsed with `DOMParser`, so browser-only). */
|
|
2
2
|
export declare function htmlToText(html: string): string;
|
|
3
|
-
/** Replaces `<@type:name:id>` / `<$type:name:id>` mentions with the readable name, underscores as spaces. */
|
|
4
|
-
export declare function stripMentions(text: string): string;
|
|
5
3
|
/** Sanitizes HTML with DOMPurify, collapses repeated blank paragraphs, and drops a trailing one. */
|
|
6
4
|
export declare function trimAndSanitizeHtml(value: string): string;
|
|
7
5
|
/** The `AsyncFunction` constructor, for compiling async code from a string. */
|
package/dist/utils.js
CHANGED
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AsyncFunction = void 0;
|
|
7
7
|
exports.htmlToText = htmlToText;
|
|
8
|
-
exports.stripMentions = stripMentions;
|
|
9
8
|
exports.trimAndSanitizeHtml = trimAndSanitizeHtml;
|
|
10
9
|
exports.jsAsync = jsAsync;
|
|
11
10
|
const dompurify_1 = __importDefault(require("dompurify"));
|
|
@@ -15,14 +14,6 @@ function htmlToText(html) {
|
|
|
15
14
|
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
16
15
|
return doc.body.textContent || "";
|
|
17
16
|
}
|
|
18
|
-
/** Replaces `<@type:name:id>` / `<$type:name:id>` mentions with the readable name, underscores as spaces. */
|
|
19
|
-
function stripMentions(text) {
|
|
20
|
-
// Replace <type:name:id> with just the readable name part
|
|
21
|
-
// Convert underscores to spaces for better readability
|
|
22
|
-
return text.replace(/<[@$]([^:]+):([^:]+):([^>]+)>/g, (_match, _type, name, _id) => {
|
|
23
|
-
return name.replace(/_/g, " ");
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
17
|
/** Sanitizes HTML with DOMPurify, collapses repeated blank paragraphs, and drops a trailing one. */
|
|
27
18
|
function trimAndSanitizeHtml(value) {
|
|
28
19
|
let sanitizedValue = dompurify_1.default.sanitize(value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peers-app/peers-ui",
|
|
3
|
-
"version": "0.
|
|
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.
|
|
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.
|
|
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",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type Observable } from "@peers-app/peers-sdk";
|
|
2
|
-
interface AccessLevelFieldProps {
|
|
3
|
-
value: number | Observable<number | undefined>;
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Named-preset plus custom 0–100 editor for tool and Assistant access levels.
|
|
8
|
-
*/
|
|
9
|
-
export declare function AccessLevelField(props: AccessLevelFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AccessLevelField = AccessLevelField;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
6
|
-
const hooks_1 = require("../hooks");
|
|
7
|
-
const input_1 = require("./input");
|
|
8
|
-
/**
|
|
9
|
-
* Named-preset plus custom 0–100 editor for tool and Assistant access levels.
|
|
10
|
-
*/
|
|
11
|
-
function AccessLevelField(props) {
|
|
12
|
-
const [value, setValue] = (0, hooks_1.useObservable)(props.value);
|
|
13
|
-
const level = (0, peers_sdk_1.resolveAccessLevel)(value);
|
|
14
|
-
const presets = (0, peers_sdk_1.listAccessLevelPresets)();
|
|
15
|
-
const isNamed = presets.some((preset) => preset.value === level);
|
|
16
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-3", children: [(0, jsx_runtime_1.jsx)("small", { children: "Access level:" }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex gap-2 align-items-center", children: [(0, jsx_runtime_1.jsxs)("select", { className: "form-select form-select-sm", disabled: props.disabled, value: isNamed ? String(level) : "custom", onChange: (evt) => {
|
|
17
|
-
if (evt.target.value === "custom") {
|
|
18
|
-
setValue(level);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
setValue(Number(evt.target.value));
|
|
22
|
-
}, children: [presets.map((preset) => ((0, jsx_runtime_1.jsxs)("option", { value: preset.value, children: [preset.label, " (", preset.value, ")"] }, preset.value))), (0, jsx_runtime_1.jsx)("option", { value: "custom", children: "Custom" })] }), (0, jsx_runtime_1.jsx)(input_1.Input, { type: "number", min: 0, max: 100, disabled: props.disabled, className: "form-control form-control-sm", style: { maxWidth: 90 }, value: level, onChange: (evt) => {
|
|
23
|
-
const next = Number(evt.target.value);
|
|
24
|
-
if (Number.isInteger(next) && next >= 0 && next <= 100) {
|
|
25
|
-
setValue(next);
|
|
26
|
-
}
|
|
27
|
-
} })] }), (0, jsx_runtime_1.jsxs)("div", { className: "form-text", children: [(0, peers_sdk_1.getAccessLevelLabel)(level), " (", level, "). Unclassified records default to Self (100)."] })] }));
|
|
28
|
-
}
|