@peers-app/peers-ui 0.32.3 → 0.33.0
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/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/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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Searchable overlay for launching apps
|
|
1
|
+
/** Searchable overlay for launching apps and running commands. */
|
|
2
2
|
export declare function CommandPaletteOverlay(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CommandPaletteOverlay = CommandPaletteOverlay;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
6
5
|
// biome-ignore lint/correctness/noUnusedImports: classic JSX (`jsx: react`) needs React in scope for emit
|
|
7
6
|
const react_1 = require("react");
|
|
8
|
-
const globals_1 = require("../globals");
|
|
9
7
|
const hooks_1 = require("../hooks");
|
|
10
8
|
const color_mode_dropdown_1 = require("../screens/settings/color-mode-dropdown");
|
|
11
9
|
const system_apps_1 = require("../system-apps");
|
|
12
10
|
const tabs_state_1 = require("../tabs-layout/tabs-state");
|
|
13
11
|
const routes_loader_1 = require("../ui-router/routes-loader");
|
|
14
12
|
const command_palette_1 = require("./command-palette");
|
|
15
|
-
/** Searchable overlay for launching apps
|
|
13
|
+
/** Searchable overlay for launching apps and running commands. */
|
|
16
14
|
function CommandPaletteOverlay() {
|
|
17
15
|
const [isOpen] = (0, hooks_1.useObservable)(command_palette_1.isCommandPaletteOpen);
|
|
18
16
|
const [_persistedQuery] = (0, hooks_1.useObservable)(command_palette_1.commandSearchQuery);
|
|
@@ -95,23 +93,6 @@ function CommandPaletteOverlay() {
|
|
|
95
93
|
app.packageName.toLowerCase().includes(lowerQuery));
|
|
96
94
|
};
|
|
97
95
|
const filteredApps = searchApps(searchQuery);
|
|
98
|
-
// Function to create a new thread from search query
|
|
99
|
-
const createNewThreadFromQuery = (0, react_1.useCallback)(async (query) => {
|
|
100
|
-
try {
|
|
101
|
-
const currentUser = await (0, peers_sdk_1.getMe)();
|
|
102
|
-
const threadMessage = await (0, peers_sdk_1.Messages)().insert({
|
|
103
|
-
messageId: (0, peers_sdk_1.newid)(),
|
|
104
|
-
userId: currentUser.userId,
|
|
105
|
-
channelId: currentUser.userId,
|
|
106
|
-
message: query.trim(),
|
|
107
|
-
createdAt: new Date(),
|
|
108
|
-
});
|
|
109
|
-
await (0, globals_1.openThreadInTab)(threadMessage);
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
console.error("Failed to create new thread:", error);
|
|
113
|
-
}
|
|
114
|
-
}, []);
|
|
115
96
|
// Create a flattened list that matches the visual rendering order
|
|
116
97
|
// Apps first, then commands
|
|
117
98
|
const allItems = [];
|
|
@@ -147,9 +128,7 @@ function CommandPaletteOverlay() {
|
|
|
147
128
|
const handleKeyDown = (e) => {
|
|
148
129
|
if (e.key === "ArrowDown") {
|
|
149
130
|
e.preventDefault();
|
|
150
|
-
|
|
151
|
-
const maxIndex = searchQuery.trim() ? allItems.length : allItems.length - 1;
|
|
152
|
-
setSelectedIndex((prev) => Math.min(prev + 1, maxIndex));
|
|
131
|
+
setSelectedIndex((prev) => Math.min(prev + 1, allItems.length - 1));
|
|
153
132
|
}
|
|
154
133
|
else if (e.key === "ArrowUp") {
|
|
155
134
|
e.preventDefault();
|
|
@@ -157,34 +136,19 @@ function CommandPaletteOverlay() {
|
|
|
157
136
|
}
|
|
158
137
|
else if (e.key === "Enter") {
|
|
159
138
|
e.preventDefault();
|
|
160
|
-
|
|
161
|
-
if (
|
|
139
|
+
const selectedItem = allItems[selectedIndex];
|
|
140
|
+
if (selectedItem?.type === "app" && selectedItem.app) {
|
|
162
141
|
(0, command_palette_1.closeCommandPalette)();
|
|
163
|
-
|
|
142
|
+
(0, tabs_state_1.goToTabPath)(selectedItem.app.path);
|
|
164
143
|
}
|
|
165
|
-
else {
|
|
166
|
-
|
|
167
|
-
if (selectedItem) {
|
|
168
|
-
if (selectedItem.type === "app" && selectedItem.app) {
|
|
169
|
-
(0, command_palette_1.closeCommandPalette)();
|
|
170
|
-
(0, tabs_state_1.goToTabPath)(selectedItem.app.path);
|
|
171
|
-
}
|
|
172
|
-
else if (selectedItem.type === "command" && selectedItem.command) {
|
|
173
|
-
(0, command_palette_1.executeCommand)(selectedItem.command.id);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
else if (searchQuery.trim()) {
|
|
177
|
-
// Fallback: Create a new thread with the search query as the message
|
|
178
|
-
// This happens when no item is selected (selectedIndex is out of bounds or -1)
|
|
179
|
-
(0, command_palette_1.closeCommandPalette)();
|
|
180
|
-
createNewThreadFromQuery(searchQuery);
|
|
181
|
-
}
|
|
144
|
+
else if (selectedItem?.type === "command" && selectedItem.command) {
|
|
145
|
+
(0, command_palette_1.executeCommand)(selectedItem.command.id);
|
|
182
146
|
}
|
|
183
147
|
}
|
|
184
148
|
};
|
|
185
149
|
document.addEventListener("keydown", handleKeyDown);
|
|
186
150
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
187
|
-
}, [isOpen, selectedIndex,
|
|
151
|
+
}, [isOpen, selectedIndex, allItems]);
|
|
188
152
|
if (!isOpen)
|
|
189
153
|
return null;
|
|
190
154
|
const isDark = _colorMode === "dark";
|
|
@@ -284,36 +248,8 @@ function CommandPaletteOverlay() {
|
|
|
284
248
|
? "1px solid #495057"
|
|
285
249
|
: "1px solid var(--peers-surface-border)",
|
|
286
250
|
}, children: command.shortcut }))] }, command.id));
|
|
287
|
-
})] }, category)))
|
|
288
|
-
searchQuery.trim()
|
|
289
|
-
? isDark
|
|
290
|
-
? "bg-primary bg-opacity-25"
|
|
291
|
-
: "bg-primary bg-opacity-10"
|
|
292
|
-
: ""}`, style: {
|
|
293
|
-
cursor: "pointer",
|
|
294
|
-
transition: "background-color 0.1s ease",
|
|
295
|
-
borderTop: allItems.length > 0
|
|
296
|
-
? `1px solid ${isDark ? "#495057" : "var(--peers-surface-border)"}`
|
|
297
|
-
: "none",
|
|
298
|
-
marginTop: allItems.length > 0 ? "8px" : "0",
|
|
299
|
-
paddingTop: allItems.length > 0 ? "12px" : "8px",
|
|
300
|
-
}, onClick: () => {
|
|
301
|
-
(0, command_palette_1.closeCommandPalette)();
|
|
302
|
-
createNewThreadFromQuery(searchQuery);
|
|
303
|
-
}, onMouseEnter: () => {
|
|
304
|
-
// Set selected index beyond the list to indicate this item is selected
|
|
305
|
-
setSelectedIndex(allItems.length);
|
|
306
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-chat-dots me-3", style: {
|
|
307
|
-
fontSize: "16px",
|
|
308
|
-
color: (allItems.length === 0 || selectedIndex >= allItems.length) &&
|
|
309
|
-
searchQuery.trim()
|
|
310
|
-
? isDark
|
|
311
|
-
? "#ffffff"
|
|
312
|
-
: "#0d6efd"
|
|
313
|
-
: "#6c757d",
|
|
314
|
-
minWidth: "16px",
|
|
315
|
-
} }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "fw-medium", children: ["Start new thread:", " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-muted", children: [searchQuery.trim().slice(0, 50), searchQuery.trim().length > 50 ? "..." : ""] })] }), (0, jsx_runtime_1.jsx)("div", { className: "small text-muted", style: { fontSize: "12px" }, children: "Press Enter to create" })] })] }) })] }))] })) }), (0, jsx_runtime_1.jsxs)("div", { className: `px-3 py-2 small text-muted border-top d-flex align-items-center justify-content-between`, style: {
|
|
251
|
+
})] }, category)))] })) }), (0, jsx_runtime_1.jsxs)("div", { className: `px-3 py-2 small text-muted border-top d-flex align-items-center justify-content-between`, style: {
|
|
316
252
|
borderTopColor: isDark ? "#495057" : "var(--peers-surface-border)",
|
|
317
253
|
fontSize: "11px",
|
|
318
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-3", children: [(0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u21B5" }), " to select"] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u2191\u2193" }), " to navigate"] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "esc" }), " to close"] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [allItems.length, " result", allItems.length !== 1 ? "s" : ""
|
|
254
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-3", children: [(0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u21B5" }), " to select"] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u2191\u2193" }), " to navigate"] }), (0, jsx_runtime_1.jsxs)("span", { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "esc" }), " to close"] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [allItems.length, " result", allItems.length !== 1 ? "s" : ""] })] })] }) }));
|
|
319
255
|
}
|
|
@@ -114,14 +114,14 @@ const coreCommands = [
|
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
id: "go-home",
|
|
117
|
-
label: "Go
|
|
118
|
-
description: "
|
|
117
|
+
label: "Go Home",
|
|
118
|
+
description: "Show the app launcher",
|
|
119
119
|
shortcut: `${modKey}+H`,
|
|
120
|
-
iconClassName: "bi-
|
|
120
|
+
iconClassName: "bi-grid-3x3-gap",
|
|
121
121
|
category: "Navigation",
|
|
122
122
|
action: () => {
|
|
123
123
|
closeCommandPalette();
|
|
124
|
-
(0, tabs_state_1.goToTabPath)("
|
|
124
|
+
(0, tabs_state_1.goToTabPath)("");
|
|
125
125
|
},
|
|
126
126
|
},
|
|
127
127
|
];
|
|
@@ -74,18 +74,22 @@ class MentionNode extends lexical_1.TextNode {
|
|
|
74
74
|
dom.setAttribute("data-clickable", this.data.clickable === undefined ? "" : String(this.data.clickable));
|
|
75
75
|
// currently ignoring `clickable` attribute
|
|
76
76
|
// if (this.data.clickable !== false) {...
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
// A kind with no config, such as a saved assistant or workflow mention, has no screen to
|
|
78
|
+
// open: it stays plain text, as MarkdownWithMentions renders it.
|
|
79
|
+
if (mentionConfig) {
|
|
80
|
+
const onClick = mentionConfig.onClick;
|
|
81
|
+
dom.style.cursor = "pointer";
|
|
82
|
+
dom.addEventListener("click", () => {
|
|
83
|
+
if (onClick) {
|
|
84
|
+
onClick(this.data);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const id = this.data.id;
|
|
88
|
+
const href = kind === "user" ? `identity/people/${id}` : `${kind}s/${id}`;
|
|
89
|
+
(0, globals_1.mainContentPath)(href);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
89
93
|
if (mentionConfig && kind !== "user") {
|
|
90
94
|
const iconSpan = document.createElement("i");
|
|
91
95
|
iconSpan.className = `pe-1 ${mentionConfig.iconClass}`;
|
|
@@ -124,10 +124,10 @@ function useMentionLookupService(mentionString, mentionConfigs = []) {
|
|
|
124
124
|
allResults = (0, lodash_1.uniqBy)(allResults, "id");
|
|
125
125
|
let filteredResults = allResults;
|
|
126
126
|
if (prefix === "@") {
|
|
127
|
-
filteredResults = filteredResults.filter((result) => result.kind === "user"
|
|
127
|
+
filteredResults = filteredResults.filter((result) => result.kind === "user");
|
|
128
128
|
}
|
|
129
129
|
else {
|
|
130
|
-
filteredResults = filteredResults.filter((result) => result.kind !== "user"
|
|
130
|
+
filteredResults = filteredResults.filter((result) => result.kind !== "user");
|
|
131
131
|
}
|
|
132
132
|
if (kind) {
|
|
133
133
|
filteredResults = allResults.filter((result) => result.kind.toLowerCase() === kind.toLowerCase());
|
|
@@ -179,9 +179,6 @@ class MentionTypeaheadOption extends LexicalTypeaheadMenuPlugin_1.MenuOption {
|
|
|
179
179
|
this.name = data.name;
|
|
180
180
|
this.picture = picture;
|
|
181
181
|
this.id = data.id;
|
|
182
|
-
// if (data.kind === 'assistant') {
|
|
183
|
-
// this.userId = data.userId;
|
|
184
|
-
// }
|
|
185
182
|
}
|
|
186
183
|
}
|
|
187
184
|
function MentionsTypeaheadMenuItem({ index, isSelected, onClick, onMouseEnter, option, }) {
|
|
@@ -48,13 +48,18 @@ const processTextWithMentions = (text) => {
|
|
|
48
48
|
style.whiteSpace = "nowrap";
|
|
49
49
|
}
|
|
50
50
|
const mentionConfig = mention_configs_1.mentionConfigs.find((c) => c.kind === kind);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
if (!mentionConfig) {
|
|
52
|
+
// A kind Peers no longer has, such as a saved assistant or workflow mention: its name only.
|
|
53
|
+
parts.push(name);
|
|
54
|
+
lastIndex = regex.lastIndex;
|
|
55
|
+
match = regex.exec(text);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const mentionClass = mentionConfig.styleClass || "mention-default-default";
|
|
59
|
+
const onClick = mentionConfig.onClick;
|
|
55
60
|
const href = (!onClick && `#${kind}s/${id}`) || undefined;
|
|
56
61
|
const icon = (kind === "user" && "@") ||
|
|
57
|
-
(mentionConfig
|
|
62
|
+
(mentionConfig.iconClass && (0, jsx_runtime_1.jsx)("i", { className: `pe-1 ${mentionConfig.iconClass}` })) || ((0, jsx_runtime_1.jsx)("i", { className: `pe-1 bi bi-question` }));
|
|
58
63
|
parts.push((0, jsx_runtime_1.jsxs)("a", { className: mentionClass, "data-kind": kind, "data-id": id, style: style, href: href, onClick: onClick && (() => onClick(data)), children: [icon, data.name] }, cnt));
|
|
59
64
|
lastIndex = regex.lastIndex;
|
|
60
65
|
match = regex.exec(text);
|
|
@@ -37,8 +37,6 @@ exports.Router = Router;
|
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const globals = __importStar(require("../globals"));
|
|
39
39
|
const hooks_1 = require("../hooks");
|
|
40
|
-
const assistant_details_1 = require("../screens/assistants/assistant-details");
|
|
41
|
-
const assistant_list_1 = require("../screens/assistants/assistant-list");
|
|
42
40
|
const identity_routes_1 = require("../screens/identity/identity-routes");
|
|
43
41
|
const package_details_1 = require("../screens/packages/package-details");
|
|
44
42
|
const package_list_1 = require("../screens/packages/package-list");
|
|
@@ -53,11 +51,7 @@ const tool_details_1 = require("../screens/tools/tool-details");
|
|
|
53
51
|
const tool_list_1 = require("../screens/tools/tool-list");
|
|
54
52
|
const variable_details_1 = require("../screens/variables/variable-details");
|
|
55
53
|
const variable_list_1 = require("../screens/variables/variable-list");
|
|
56
|
-
const workflow_details_1 = require("../screens/workflows/workflow-details");
|
|
57
|
-
const workflow_list_1 = require("../screens/workflows/workflow-list");
|
|
58
54
|
const ui_loader_1 = require("../ui-router/ui-loader");
|
|
59
|
-
const channel_view_1 = require("./messages/channel-view");
|
|
60
|
-
const thread_message_list_1 = require("./messages/thread-message-list");
|
|
61
55
|
require("../screens/console-logs/console-logs-list");
|
|
62
56
|
require("../screens/identity");
|
|
63
57
|
require("../screens/network-viewer");
|
|
@@ -88,29 +82,10 @@ function Router({ path: providedPath } = {}) {
|
|
|
88
82
|
if (path === "settings" || path === "profile") {
|
|
89
83
|
return (0, jsx_runtime_1.jsx)(settings_page_1.SettingsPage, {});
|
|
90
84
|
}
|
|
91
|
-
if (path === "threads" || path === "") {
|
|
92
|
-
return (0, jsx_runtime_1.jsx)(channel_view_1.ChannelMessages, {});
|
|
93
|
-
}
|
|
94
85
|
const ui = (0, ui_loader_1.UIRouter)({ path, props: {}, uiCategory: "screen" });
|
|
95
86
|
if (ui) {
|
|
96
87
|
return ui;
|
|
97
88
|
}
|
|
98
|
-
if (path.match(/^channel\//)) {
|
|
99
|
-
const parts = path.split("/");
|
|
100
|
-
parts.shift();
|
|
101
|
-
const channelId = parts[0];
|
|
102
|
-
// todo add additional params as props if they exist
|
|
103
|
-
return (0, jsx_runtime_1.jsx)(channel_view_1.ChannelMessages, { channelId: channelId });
|
|
104
|
-
}
|
|
105
|
-
if (path === "assistants") {
|
|
106
|
-
return (0, jsx_runtime_1.jsx)(assistant_list_1.AssistantList, {});
|
|
107
|
-
}
|
|
108
|
-
if (path.match(/^assistants\//)) {
|
|
109
|
-
const parts = path.split("/");
|
|
110
|
-
parts.shift();
|
|
111
|
-
const id = parts[0];
|
|
112
|
-
return (0, jsx_runtime_1.jsx)(assistant_details_1.AssistantDetails, { assistantId: id });
|
|
113
|
-
}
|
|
114
89
|
// if (path === 'tasks') {
|
|
115
90
|
// return <TaskList />;
|
|
116
91
|
// }
|
|
@@ -120,15 +95,6 @@ function Router({ path: providedPath } = {}) {
|
|
|
120
95
|
// const taskId = parts[0];
|
|
121
96
|
// return <TaskDetails taskId={taskId} />;
|
|
122
97
|
// }
|
|
123
|
-
if (path === "workflows") {
|
|
124
|
-
return (0, jsx_runtime_1.jsx)(workflow_list_1.WorkflowList, {});
|
|
125
|
-
}
|
|
126
|
-
if (path.match(/^workflows\//)) {
|
|
127
|
-
const parts = path.split("/");
|
|
128
|
-
parts.shift();
|
|
129
|
-
const workflowId = parts[0];
|
|
130
|
-
return (0, jsx_runtime_1.jsx)(workflow_details_1.WorkflowDetails, { workflowId: workflowId });
|
|
131
|
-
}
|
|
132
98
|
// Saved tabs from the removed tool-test screens fall back to the catalog.
|
|
133
99
|
if (path === "tools" || /^tools\/tests(?:\/|$)/.test(path)) {
|
|
134
100
|
return (0, jsx_runtime_1.jsx)(tool_list_1.ToolList, {});
|
|
@@ -169,15 +135,9 @@ function Router({ path: providedPath } = {}) {
|
|
|
169
135
|
const id = parts[0];
|
|
170
136
|
return (0, jsx_runtime_1.jsx)(peer_type_details_1.PeerTypeDetails, { peerTypeId: id });
|
|
171
137
|
}
|
|
172
|
-
if (path.match(/^threads\//)) {
|
|
173
|
-
const parts = path.split("/");
|
|
174
|
-
parts.shift();
|
|
175
|
-
const threadId = parts[0];
|
|
176
|
-
return (0, jsx_runtime_1.jsx)(thread_message_list_1.ThreadMessageList, { threadId: threadId });
|
|
177
|
-
}
|
|
178
138
|
throw new Error(`Unrecognized route: ${originalPath}`);
|
|
179
139
|
}
|
|
180
140
|
catch (err) {
|
|
181
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "p-3", children: [(0, jsx_runtime_1.jsx)("a", { href: "#
|
|
141
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "p-3", children: [(0, jsx_runtime_1.jsx)("a", { href: "#", children: "Home" }), (0, jsx_runtime_1.jsx)("h3", { children: "Error loading route" }), (0, jsx_runtime_1.jsxs)("pre", { children: ["route: ", `${globals.mainContentPath()}\n`, String(err)] })] }));
|
|
182
142
|
}
|
|
183
143
|
}
|
package/dist/globals.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IUser } from "@peers-app/peers-sdk";
|
|
2
2
|
/** Counter incremented when installed package UI should reload. */
|
|
3
3
|
export declare const packageReloaded: import("@peers-app/peers-sdk").Observable<number>;
|
|
4
4
|
/** Persisted route for the active data context. Prefer {@link mainContentPath}. */
|
|
@@ -7,10 +7,6 @@ export declare const _mainContentPath: import("@peers-app/peers-sdk").Persistent
|
|
|
7
7
|
export declare const mainContentPath: import("@peers-app/peers-sdk").Observable<string>;
|
|
8
8
|
/** Read or update one query parameter on {@link mainContentPath}. */
|
|
9
9
|
export declare function queryParam(name: string, value?: string): string;
|
|
10
|
-
/** Open a message thread in its owning app tab. */
|
|
11
|
-
export declare function openThread(thread: string | IMessage): Promise<void>;
|
|
12
|
-
/** Resolve a message and open its root thread in a new tab. */
|
|
13
|
-
export declare function openThreadInTab(thread: string | IMessage): Promise<void>;
|
|
14
10
|
/** Signed profile for the active user after {@link loadGlobals}. */
|
|
15
11
|
export declare let me: IUser;
|
|
16
12
|
/** Current browser viewport width. */
|
|
@@ -29,8 +25,8 @@ export declare const groups: import("@peers-app/peers-sdk").Observable<{
|
|
|
29
25
|
groupId: string;
|
|
30
26
|
founderUserId: string;
|
|
31
27
|
disabled?: boolean | undefined;
|
|
32
|
-
iconClassName?: string | undefined;
|
|
33
28
|
signedAt?: number | undefined;
|
|
29
|
+
iconClassName?: string | undefined;
|
|
34
30
|
publicRole?: import("@peers-app/peers-sdk").GroupMemberRole | undefined;
|
|
35
31
|
fileRetention?: {
|
|
36
32
|
days: number | "never";
|
package/dist/globals.js
CHANGED
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.groups = exports.isDesktop = exports.windowHeight = exports.windowWidth = exports.me = exports.mainContentPath = exports._mainContentPath = exports.packageReloaded = void 0;
|
|
4
4
|
exports.queryParam = queryParam;
|
|
5
|
-
exports.openThread = openThread;
|
|
6
|
-
exports.openThreadInTab = openThreadInTab;
|
|
7
5
|
exports.initializeHashNavigation = initializeHashNavigation;
|
|
8
6
|
exports.loadGlobals = loadGlobals;
|
|
9
7
|
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
10
8
|
const identity_routes_1 = require("./screens/identity/identity-routes");
|
|
11
9
|
const packages_ipc_1 = require("./screens/packages/packages-ipc");
|
|
12
10
|
const tabs_state_1 = require("./tabs-layout/tabs-state");
|
|
13
|
-
const utils_1 = require("./utils");
|
|
14
11
|
/** Counter incremented when installed package UI should reload. */
|
|
15
12
|
exports.packageReloaded = (0, peers_sdk_1.observable)(0);
|
|
16
13
|
/** Persisted route for the active data context. Prefer {@link mainContentPath}. */
|
|
@@ -64,38 +61,6 @@ function queryParam(name, value) {
|
|
|
64
61
|
}
|
|
65
62
|
return params[name];
|
|
66
63
|
}
|
|
67
|
-
/** Open a message thread in its owning app tab. */
|
|
68
|
-
async function openThread(thread) {
|
|
69
|
-
openThreadInTab(thread);
|
|
70
|
-
}
|
|
71
|
-
/** Resolve a message and open its root thread in a new tab. */
|
|
72
|
-
async function openThreadInTab(thread) {
|
|
73
|
-
const threadId = typeof thread === "string" ? thread : thread.messageId;
|
|
74
|
-
const message = await (0, peers_sdk_1.Messages)().get(threadId);
|
|
75
|
-
if (!message) {
|
|
76
|
-
console.warn("Thread message not found:", threadId);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
// Use parent message ID if this is a reply, otherwise use the message itself
|
|
80
|
-
const actualThreadId = message.messageParentId || message.messageId;
|
|
81
|
-
// Generate thread title from message content (strip mentions and clean formatting)
|
|
82
|
-
const cleanMessage = (0, utils_1.stripMentions)(message.message);
|
|
83
|
-
const messagePreview = cleanMessage.slice(0, 30);
|
|
84
|
-
const threadTitle = `${messagePreview}${cleanMessage.length > 30 ? "..." : ""}` || `Thread`;
|
|
85
|
-
// // Import openNewTab dynamically to avoid circular dependency
|
|
86
|
-
// const { openNewTab } = await import('./tabs-layout/tabs-layout');
|
|
87
|
-
(0, tabs_state_1.openNewTab)({
|
|
88
|
-
packageId: "system-apps",
|
|
89
|
-
path: `threads/${actualThreadId}`,
|
|
90
|
-
title: threadTitle,
|
|
91
|
-
iconClassName: "bi-chat-dots",
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
// A notification clicked in the desktop app's main process opens its thread here.
|
|
95
|
-
(0, peers_sdk_1.subscribe)("ui:openThread", (event) => {
|
|
96
|
-
if (event.data?.threadId)
|
|
97
|
-
void openThread(event.data.threadId);
|
|
98
|
-
});
|
|
99
64
|
/** Signed profile for the active user after {@link loadGlobals}. */
|
|
100
65
|
exports.me = null;
|
|
101
66
|
/** Current browser viewport width. */
|
|
@@ -9,14 +9,10 @@ export interface IMentionConfig {
|
|
|
9
9
|
picture?: (data: IMentionData) => JSX.Element;
|
|
10
10
|
onClick?: (data: IMentionData) => void;
|
|
11
11
|
}
|
|
12
|
-
/** Discover
|
|
12
|
+
/** Discover catalog tools while keeping historical mention IDs readable. */
|
|
13
13
|
export declare const toolMentionConfig: IMentionConfig;
|
|
14
14
|
/** Discover users and resolve persisted user mentions. */
|
|
15
15
|
export declare const userMentionConfig: IMentionConfig;
|
|
16
|
-
/** Discover assistants and resolve persisted assistant mentions. */
|
|
17
|
-
export declare const assistantMentionConfig: IMentionConfig;
|
|
18
|
-
/** Discover workflows and resolve persisted workflow mentions. */
|
|
19
|
-
export declare const workflowMentionConfig: IMentionConfig;
|
|
20
16
|
/** Discover data types and navigate to their definitions. */
|
|
21
17
|
export declare const valueTypeMentionConfig: IMentionConfig;
|
|
22
18
|
/** Shared mention definitions used by editors and rendered messages. */
|
package/dist/mention-configs.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mentionConfigs = exports.valueTypeMentionConfig = exports.
|
|
3
|
+
exports.mentionConfigs = exports.valueTypeMentionConfig = exports.userMentionConfig = exports.toolMentionConfig = void 0;
|
|
4
4
|
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
5
5
|
const globals_1 = require("./globals");
|
|
6
6
|
const tool_catalog_ipc_1 = require("./screens/tools/tool-catalog-ipc");
|
|
7
7
|
const MENTIONS_MAX_RESULTS = 10;
|
|
8
|
-
/** Discover
|
|
8
|
+
/** Discover catalog tools while keeping historical mention IDs readable. */
|
|
9
9
|
exports.toolMentionConfig = {
|
|
10
10
|
kind: "tool",
|
|
11
11
|
iconClass: "bi bi-tools",
|
|
12
12
|
styleClass: "mention-tool",
|
|
13
13
|
query: async (search) => {
|
|
14
|
-
const results = await (0, tool_catalog_ipc_1.
|
|
14
|
+
const results = await (0, tool_catalog_ipc_1.listMentionTools)(search, MENTIONS_MAX_RESULTS);
|
|
15
15
|
return results.map((p) => ({
|
|
16
16
|
kind: "tool",
|
|
17
17
|
id: p.toolId,
|
|
@@ -48,50 +48,6 @@ exports.userMentionConfig = {
|
|
|
48
48
|
name: item.name,
|
|
49
49
|
}),
|
|
50
50
|
};
|
|
51
|
-
/** Discover assistants and resolve persisted assistant mentions. */
|
|
52
|
-
exports.assistantMentionConfig = {
|
|
53
|
-
kind: "assistant",
|
|
54
|
-
iconClass: "bi bi-person-fill-gear",
|
|
55
|
-
styleClass: "mention-assistant",
|
|
56
|
-
query: async (search) => {
|
|
57
|
-
return (0, peers_sdk_1.Assistants)()
|
|
58
|
-
.list({ name: { $matchWords: search } }, { pageSize: MENTIONS_MAX_RESULTS })
|
|
59
|
-
.then((assistants) => assistants.map((assistant) => ({
|
|
60
|
-
kind: "assistant",
|
|
61
|
-
id: assistant.assistantId,
|
|
62
|
-
name: assistant.name,
|
|
63
|
-
})));
|
|
64
|
-
},
|
|
65
|
-
getById: (id) => (0, peers_sdk_1.Assistants)()
|
|
66
|
-
.get(id)
|
|
67
|
-
.then((item) => item && {
|
|
68
|
-
kind: "assistant",
|
|
69
|
-
id: item.assistantId,
|
|
70
|
-
name: item.name,
|
|
71
|
-
}),
|
|
72
|
-
};
|
|
73
|
-
/** Discover workflows and resolve persisted workflow mentions. */
|
|
74
|
-
exports.workflowMentionConfig = {
|
|
75
|
-
kind: "workflow",
|
|
76
|
-
iconClass: "bi bi-database-fill-gear",
|
|
77
|
-
styleClass: "mention-workflow",
|
|
78
|
-
query: async (search) => {
|
|
79
|
-
return (0, peers_sdk_1.Workflows)()
|
|
80
|
-
.list({ name: { $matchWords: search } }, { pageSize: MENTIONS_MAX_RESULTS })
|
|
81
|
-
.then((workflows) => workflows.map((workflow) => ({
|
|
82
|
-
kind: "workflow",
|
|
83
|
-
id: workflow.workflowId,
|
|
84
|
-
name: workflow.name,
|
|
85
|
-
})));
|
|
86
|
-
},
|
|
87
|
-
getById: (id) => (0, peers_sdk_1.Workflows)()
|
|
88
|
-
.get(id)
|
|
89
|
-
.then((item) => item && {
|
|
90
|
-
kind: "workflow",
|
|
91
|
-
id: item.workflowId,
|
|
92
|
-
name: item.name,
|
|
93
|
-
}),
|
|
94
|
-
};
|
|
95
51
|
/** Discover data types and navigate to their definitions. */
|
|
96
52
|
exports.valueTypeMentionConfig = {
|
|
97
53
|
kind: "type",
|
|
@@ -123,10 +79,4 @@ exports.valueTypeMentionConfig = {
|
|
|
123
79
|
// }))),
|
|
124
80
|
// picture = <i className="bi bi-list-task pe-1" />;
|
|
125
81
|
/** Shared mention definitions used by editors and rendered messages. */
|
|
126
|
-
exports.mentionConfigs = [
|
|
127
|
-
exports.toolMentionConfig,
|
|
128
|
-
exports.userMentionConfig,
|
|
129
|
-
exports.assistantMentionConfig,
|
|
130
|
-
exports.workflowMentionConfig,
|
|
131
|
-
exports.valueTypeMentionConfig,
|
|
132
|
-
];
|
|
82
|
+
exports.mentionConfigs = [exports.toolMentionConfig, exports.userMentionConfig, exports.valueTypeMentionConfig];
|
|
@@ -56,7 +56,7 @@ function AccountScreen() {
|
|
|
56
56
|
year: "numeric",
|
|
57
57
|
month: "long",
|
|
58
58
|
day: "numeric",
|
|
59
|
-
})] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-outline-secondary btn-sm", onClick: handleRegister, disabled: isRegistering, children: isRegistering ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "spinner-border spinner-border-sm me-2" }), "Refreshing..."] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-arrow-clockwise me-2" }), "Refresh Token"] })) })] })) : ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { className: "text-muted mb-3", children: "Register your account to
|
|
59
|
+
})] }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-outline-secondary btn-sm", onClick: handleRegister, disabled: isRegistering, children: isRegistering ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "spinner-border spinner-border-sm me-2" }), "Refreshing..."] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-arrow-clockwise me-2" }), "Refresh Token"] })) })] })) : ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { className: "text-muted mb-3", children: "Register your account to use Peers Services, such as delivery to devices that are offline." }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-primary", onClick: handleRegister, disabled: isRegistering, children: isRegistering ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "spinner-border spinner-border-sm me-2" }), "Registering..."] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-cloud-upload me-2" }), "Register Account"] })) })] }))] }) })] }));
|
|
60
60
|
}
|
|
61
61
|
const ROTATE_INFO = `### Rotating your signing key
|
|
62
62
|
|
|
@@ -44,7 +44,7 @@ function getSummary(checks) {
|
|
|
44
44
|
skips: checks.filter((c) => c.status === "skip").length,
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function formatReport(checks) {
|
|
48
48
|
const lines = ["Connection Troubleshooter Report", "================================"];
|
|
49
49
|
const groups = groupByLayer(checks);
|
|
50
50
|
for (const layer of LAYER_ORDER) {
|
|
@@ -145,16 +145,15 @@ function ConnectionTroubleshooter({ onBack }) {
|
|
|
145
145
|
return next;
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
|
-
const
|
|
149
|
-
const report =
|
|
150
|
-
const message = `I ran the Peers connection troubleshooter and got the following results. Please help me understand what's wrong and how to fix it:\n\n${report}`;
|
|
148
|
+
const handleCopyDetails = () => {
|
|
149
|
+
const report = formatReport(checks.filter((c) => c.status !== "running"));
|
|
151
150
|
navigator.clipboard
|
|
152
|
-
.writeText(
|
|
151
|
+
.writeText(report)
|
|
153
152
|
.then(() => {
|
|
154
|
-
alert("Diagnostic report copied to
|
|
153
|
+
alert("Diagnostic report copied to the clipboard.");
|
|
155
154
|
})
|
|
156
155
|
.catch(() => {
|
|
157
|
-
alert("Could not copy the diagnostic report.
|
|
156
|
+
alert("Could not copy the diagnostic report.");
|
|
158
157
|
});
|
|
159
158
|
};
|
|
160
159
|
const groups = groupByLayer(checks.filter((c) => !c.id.startsWith("placeholder-")));
|
|
@@ -172,7 +171,7 @@ function ConnectionTroubleshooter({ onBack }) {
|
|
|
172
171
|
: "pass";
|
|
173
172
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "container-fluid p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex justify-content-between align-items-center mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-3", children: [(0, jsx_runtime_1.jsxs)("button", { className: "btn btn-sm btn-outline-secondary", onClick: onBack, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-arrow-left me-1" }), "Back"] }), (0, jsx_runtime_1.jsxs)("h4", { className: "mb-0", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-stethoscope me-2 text-primary" }), "Connection Troubleshooter"] })] }), (0, jsx_runtime_1.jsx)("button", { className: "btn btn-sm btn-primary", onClick: runDiagnostics, disabled: running, children: running ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "spinner-border spinner-border-sm me-1", role: "status", "aria-hidden": "true" }), "Running\u2026"] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-arrow-clockwise me-1" }), "Re-run"] })) })] }), running && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex justify-content-between mb-1", children: [(0, jsx_runtime_1.jsx)("small", { className: "text-muted", children: "Running diagnostics\u2026" }), (0, jsx_runtime_1.jsxs)("small", { className: "text-muted", children: [completedCount, " / ", totalCount] })] }), (0, jsx_runtime_1.jsx)("div", { className: "progress", style: { height: "6px" }, children: (0, jsx_runtime_1.jsx)("div", { className: "progress-bar progress-bar-striped progress-bar-animated", style: { width: `${progressPct}%` } }) })] })), done && checks.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: `alert ${overallStatus === "pass" ? "alert-success" : overallStatus === "warn" ? "alert-warning" : "alert-danger"} d-flex justify-content-between align-items-center mb-4`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-2", children: [overallStatus === "pass" && (0, jsx_runtime_1.jsx)("i", { className: "bi bi-check-circle-fill fs-5" }), overallStatus === "warn" && (0, jsx_runtime_1.jsx)("i", { className: "bi bi-exclamation-triangle-fill fs-5" }), overallStatus === "fail" && (0, jsx_runtime_1.jsx)("i", { className: "bi bi-x-circle-fill fs-5" }), (0, jsx_runtime_1.jsxs)("div", { children: [overallStatus === "pass" && (0, jsx_runtime_1.jsx)("strong", { children: "All checks passed." }), overallStatus === "warn" && ((0, jsx_runtime_1.jsxs)("strong", { children: [summary.warnings, " warning", summary.warnings > 1 ? "s" : "", " found."] })), overallStatus === "fail" && ((0, jsx_runtime_1.jsxs)("strong", { children: [summary.issues, " issue", summary.issues > 1 ? "s" : "", " found", summary.warnings > 0
|
|
174
173
|
? `, ${summary.warnings} warning${summary.warnings > 1 ? "s" : ""}`
|
|
175
|
-
: "", "."] })), " ", (0, jsx_runtime_1.jsxs)("span", { className: "opacity-75", children: [summary.passes, " passed \u00B7 ", summary.issues, " failed \u00B7 ", summary.warnings, " warnings \u00B7", " ", summary.skips, " skipped"] })] })] }), (0, jsx_runtime_1.jsxs)("button", { className: "btn btn-sm btn-dark d-flex align-items-center gap-1", onClick:
|
|
174
|
+
: "", "."] })), " ", (0, jsx_runtime_1.jsxs)("span", { className: "opacity-75", children: [summary.passes, " passed \u00B7 ", summary.issues, " failed \u00B7 ", summary.warnings, " warnings \u00B7", " ", summary.skips, " skipped"] })] })] }), (0, jsx_runtime_1.jsxs)("button", { className: "btn btn-sm btn-dark d-flex align-items-center gap-1", onClick: handleCopyDetails, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-clipboard" }), "Copy details"] })] })), running && placeholders.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "card mb-3", children: (0, jsx_runtime_1.jsx)("div", { className: "card-body p-2", children: placeholders.map((p) => ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-2 p-2 border-bottom", children: [STATUS_ICON[p.status], (0, jsx_runtime_1.jsx)("span", { className: "text-muted small", children: p.label })] }, p.id))) }) })), LAYER_ORDER.map((layer) => {
|
|
176
175
|
const layerChecks = groups[layer];
|
|
177
176
|
if (!layerChecks || layerChecks.length === 0)
|
|
178
177
|
return null;
|
|
@@ -186,5 +185,5 @@ function ConnectionTroubleshooter({ onBack }) {
|
|
|
186
185
|
? "skip"
|
|
187
186
|
: "pass";
|
|
188
187
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "card mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "card-header d-flex align-items-center justify-content-between py-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-2", children: [STATUS_ICON[layerStatus], (0, jsx_runtime_1.jsx)("strong", { className: "small", children: layer })] }), (0, jsx_runtime_1.jsx)("span", { className: `badge ${STATUS_BADGE_CLASS[layerStatus]}`, children: layerStatus === "running" ? "running" : layerStatus })] }), (0, jsx_runtime_1.jsx)("div", { className: "list-group list-group-flush", children: layerChecks.map((check) => ((0, jsx_runtime_1.jsxs)("div", { className: "list-group-item p-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: `d-flex align-items-start gap-2 px-3 py-2 ${check.suggestion ? "cursor-pointer" : ""}`, style: { cursor: check.suggestion ? "pointer" : "default" }, onClick: () => check.suggestion && toggleExpand(check.id), role: check.suggestion ? "button" : undefined, children: [(0, jsx_runtime_1.jsx)("div", { className: "pt-1 flex-shrink-0", children: STATUS_ICON[check.status] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-grow-1 min-width-0", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex justify-content-between align-items-start", children: [(0, jsx_runtime_1.jsx)("span", { className: "small fw-medium", children: check.label }), check.suggestion && ((0, jsx_runtime_1.jsx)("i", { className: `bi bi-chevron-${expanded.has(check.id) ? "up" : "down"} text-muted ms-2 flex-shrink-0 small` }))] }), (0, jsx_runtime_1.jsx)("div", { className: "small text-muted mt-1", children: check.detail })] })] }), check.suggestion && expanded.has(check.id) && ((0, jsx_runtime_1.jsx)("div", { className: "px-3 pb-2 pt-0 ms-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "alert alert-info py-2 px-3 mb-0 small d-flex gap-2", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-lightbulb-fill text-info flex-shrink-0 mt-1" }), (0, jsx_runtime_1.jsx)("span", { children: check.suggestion })] }) }))] }, check.id))) })] }, layer));
|
|
189
|
-
}), done && checks.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-3", children: [(0, jsx_runtime_1.jsxs)("button", { className: "btn btn-outline-primary", onClick:
|
|
188
|
+
}), done && checks.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-3", children: [(0, jsx_runtime_1.jsxs)("button", { className: "btn btn-outline-primary", onClick: handleCopyDetails, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-clipboard me-2" }), "Copy details"] }), (0, jsx_runtime_1.jsx)("p", { className: "text-muted small mt-2 mb-0", children: "Copies the full diagnostic report, to paste wherever you're getting help." })] }))] }));
|
|
190
189
|
}
|
|
@@ -20,7 +20,7 @@ const PackageDetails = (props) => {
|
|
|
20
20
|
const pkg = (0, hooks_1.usePromise)(async () => {
|
|
21
21
|
const pkg = await (0, peers_sdk_1.Packages)().get(props.packageId);
|
|
22
22
|
if (!pkg) {
|
|
23
|
-
throw new Error("
|
|
23
|
+
throw new Error("Package not found");
|
|
24
24
|
}
|
|
25
25
|
(0, tabs_state_1.updateActiveTabTitle)(pkg.name || "Package");
|
|
26
26
|
return (0, peers_sdk_1.Packages)().initDoc(pkg);
|