@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
|
@@ -11,8 +11,6 @@ const routes_loader_1 = require("../../ui-router/routes-loader");
|
|
|
11
11
|
const color_mode_dropdown_1 = require("../settings/color-mode-dropdown");
|
|
12
12
|
const searchConfigs = [
|
|
13
13
|
{ config: mention_configs_1.toolMentionConfig, category: "Tools", navigationPath: "tools" },
|
|
14
|
-
{ config: mention_configs_1.assistantMentionConfig, category: "Assistants", navigationPath: "assistants" },
|
|
15
|
-
{ config: mention_configs_1.workflowMentionConfig, category: "Workflows", navigationPath: "workflows" },
|
|
16
14
|
{ config: mention_configs_1.valueTypeMentionConfig, category: "Types", navigationPath: "peer-types" },
|
|
17
15
|
{ config: mention_configs_1.userMentionConfig, category: "People", navigationPath: "identity/people" },
|
|
18
16
|
];
|
|
@@ -129,7 +127,7 @@ function GlobalSearch() {
|
|
|
129
127
|
color: "#6c757d",
|
|
130
128
|
zIndex: 1,
|
|
131
129
|
fontSize: "18px",
|
|
132
|
-
} }), (0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "text", className: `form-control form-control-lg ${isDark ? "bg-dark text-light border-secondary" : ""}`, placeholder: "Search across apps, tools,
|
|
130
|
+
} }), (0, jsx_runtime_1.jsx)("input", { ref: inputRef, type: "text", className: `form-control form-control-lg ${isDark ? "bg-dark text-light border-secondary" : ""}`, placeholder: "Search across apps, tools, types, and people...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), style: {
|
|
133
131
|
paddingLeft: "50px",
|
|
134
132
|
fontSize: "18px",
|
|
135
133
|
borderRadius: "12px",
|
|
@@ -177,5 +175,5 @@ function GlobalSearch() {
|
|
|
177
175
|
fontSize: "16px",
|
|
178
176
|
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
179
177
|
minWidth: "16px",
|
|
180
|
-
} }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-grow-1", children: [(0, jsx_runtime_1.jsx)("h6", { className: "card-title mb-1 fw-medium", children: item.name }), (0, jsx_runtime_1.jsx)("small", { className: "text-muted text-uppercase", style: { fontSize: "11px", letterSpacing: "0.5px" }, children: result.category.slice(0, -1) })] }), (0, jsx_runtime_1.jsx)("i", { className: "bi-arrow-right text-muted", style: { fontSize: "12px" } })] }) }) }) }, item.id))) })] }, result.category)))] })) })), !searchQuery && ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-5", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-search mb-3 d-block text-muted", style: { fontSize: "64px" } }), (0, jsx_runtime_1.jsx)("h3", { className: "text-muted mb-3", children: "Search across everything" }), (0, jsx_runtime_1.jsx)("p", { className: "text-muted mb-4", style: { maxWidth: "400px", margin: "0 auto" }, children: "Find apps, tools,
|
|
178
|
+
} }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-grow-1", children: [(0, jsx_runtime_1.jsx)("h6", { className: "card-title mb-1 fw-medium", children: item.name }), (0, jsx_runtime_1.jsx)("small", { className: "text-muted text-uppercase", style: { fontSize: "11px", letterSpacing: "0.5px" }, children: result.category.slice(0, -1) })] }), (0, jsx_runtime_1.jsx)("i", { className: "bi-arrow-right text-muted", style: { fontSize: "12px" } })] }) }) }) }, item.id))) })] }, result.category)))] })) })), !searchQuery && ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-5", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-search mb-3 d-block text-muted", style: { fontSize: "64px" } }), (0, jsx_runtime_1.jsx)("h3", { className: "text-muted mb-3", children: "Search across everything" }), (0, jsx_runtime_1.jsx)("p", { className: "text-muted mb-4", style: { maxWidth: "400px", margin: "0 auto" }, children: "Find apps, tools, types, and people all in one place." }), (0, jsx_runtime_1.jsx)("div", { className: "d-flex flex-wrap justify-content-center gap-2", children: searchConfigs.map(({ config, category }) => ((0, jsx_runtime_1.jsxs)("span", { className: `badge ${isDark ? "bg-secondary" : "peers-surface text-body"} px-3 py-2 d-flex align-items-center`, style: { fontSize: "12px" }, children: [(0, jsx_runtime_1.jsx)("i", { className: `${config.iconClass} me-2` }), category] }, category))) })] }))] }));
|
|
181
179
|
}
|
|
@@ -22,13 +22,13 @@ export declare function getToolDetails(toolId: string): Promise<{
|
|
|
22
22
|
catalogIdentity?: "deterministic" | "legacy-alias" | undefined;
|
|
23
23
|
catalogState?: "resolved" | "unresolved" | "quarantined" | undefined;
|
|
24
24
|
catalogReason?: string | undefined;
|
|
25
|
+
detailedDescription?: string | undefined;
|
|
25
26
|
configSchema?: {
|
|
26
27
|
type: import("@peers-app/peers-sdk").IOSchemaType;
|
|
27
28
|
fields: import("@peers-app/peers-sdk").IField[];
|
|
28
29
|
} | undefined;
|
|
29
|
-
isAssistantRunner?: boolean | undefined;
|
|
30
|
-
detailedDescription?: string | undefined;
|
|
31
30
|
codeRepository?: string | undefined;
|
|
31
|
+
isAssistantRunner?: boolean | undefined;
|
|
32
32
|
packageId?: string | undefined;
|
|
33
33
|
authorityPropagation?: "preserve" | "cap" | undefined;
|
|
34
34
|
accessLevel?: number | undefined;
|
|
@@ -36,8 +36,8 @@ export declare function getToolDetails(toolId: string): Promise<{
|
|
|
36
36
|
};
|
|
37
37
|
entry: IToolCatalogEntry | undefined;
|
|
38
38
|
} | undefined>;
|
|
39
|
-
/** Query
|
|
40
|
-
export declare function
|
|
39
|
+
/** Query tool mention candidates; unavailable browser hosts retain non-quarantined rows. */
|
|
40
|
+
export declare function listMentionTools(query: string, limit: number): Promise<IToolCatalogEntry[] | {
|
|
41
41
|
code: string;
|
|
42
42
|
name: string;
|
|
43
43
|
usageDescription: string;
|
|
@@ -56,13 +56,13 @@ export declare function listWorkflowMentionTools(query: string, limit: number):
|
|
|
56
56
|
catalogIdentity?: "deterministic" | "legacy-alias" | undefined;
|
|
57
57
|
catalogState?: "resolved" | "unresolved" | "quarantined" | undefined;
|
|
58
58
|
catalogReason?: string | undefined;
|
|
59
|
+
detailedDescription?: string | undefined;
|
|
59
60
|
configSchema?: {
|
|
60
61
|
type: import("@peers-app/peers-sdk").IOSchemaType;
|
|
61
62
|
fields: import("@peers-app/peers-sdk").IField[];
|
|
62
63
|
} | undefined;
|
|
63
|
-
isAssistantRunner?: boolean | undefined;
|
|
64
|
-
detailedDescription?: string | undefined;
|
|
65
64
|
codeRepository?: string | undefined;
|
|
65
|
+
isAssistantRunner?: boolean | undefined;
|
|
66
66
|
packageId?: string | undefined;
|
|
67
67
|
authorityPropagation?: "preserve" | "cap" | undefined;
|
|
68
68
|
accessLevel?: number | undefined;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getToolCatalogConsumer = getToolCatalogConsumer;
|
|
4
4
|
exports.getToolDetails = getToolDetails;
|
|
5
|
-
exports.
|
|
5
|
+
exports.listMentionTools = listMentionTools;
|
|
6
6
|
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
7
7
|
const consumers = new Map();
|
|
8
8
|
/** Obtain a catalog consumer for the selected host context; PWA callers can fall back to rows. */
|
|
@@ -34,11 +34,10 @@ async function getToolDetails(toolId) {
|
|
|
34
34
|
}
|
|
35
35
|
return { row, entry };
|
|
36
36
|
}
|
|
37
|
-
/** Query
|
|
38
|
-
async function
|
|
37
|
+
/** Query tool mention candidates; unavailable browser hosts retain non-quarantined rows. */
|
|
38
|
+
async function listMentionTools(query, limit) {
|
|
39
39
|
try {
|
|
40
|
-
|
|
41
|
-
return tools.filter((entry) => entry.workflowInvocable).slice(0, limit);
|
|
40
|
+
return (await (await getToolCatalogConsumer()).tools.listTools({ query, limit })).tools;
|
|
42
41
|
}
|
|
43
42
|
catch {
|
|
44
43
|
return (await (0, peers_sdk_1.Tools)().list({ name: { $matchWords: query } }, { pageSize: 500 }))
|
|
@@ -8,10 +8,10 @@ const markdown_with_mentions_1 = require("../../components/markdown-with-mention
|
|
|
8
8
|
const ToolInfo = ({ tool, entry }) => {
|
|
9
9
|
const target = entry?.target;
|
|
10
10
|
const level = entry?.access?.accessLevel;
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("dl", { children: [(0, jsx_runtime_1.jsx)("dt", { children: "ID" }), (0, jsx_runtime_1.jsx)("dd", { children: tool.toolId }), (0, jsx_runtime_1.jsx)("dt", { children: "Aliases" }), (0, jsx_runtime_1.jsx)("dd", { children: entry?.aliases.join(", ") ?? tool.toolId }), (0, jsx_runtime_1.jsx)("dt", { children: "Contract" }), (0, jsx_runtime_1.jsx)("dd", { children: target
|
|
12
12
|
? `${target.contractId}@${target.version}`
|
|
13
13
|
: tool.contractId
|
|
14
14
|
? `${tool.contractId}@${tool.contractVersion}`
|
|
15
|
-
: "Unresolved" }), (0, jsx_runtime_1.jsx)("dt", { children: "Member" }), (0, jsx_runtime_1.jsx)("dd", { children: target?.toolName ?? tool.toolName ?? tool.name }), (0, jsx_runtime_1.jsx)("dt", { children: "Provider" }), (0, jsx_runtime_1.jsx)("dd", { children: entry?.provider?.activePackageId ?? "Unavailable" }), (0, jsx_runtime_1.jsx)("dt", { children: "Dispatch" }), (0, jsx_runtime_1.jsxs)("dd", { children: [entry?.availability.dispatch ?? "Host catalog unavailable", entry?.availability.message && `: ${entry.availability.message}`] }), (0, jsx_runtime_1.jsx)("dt", { children: "Live access" }), (0, jsx_runtime_1.jsx)("dd", { children: level === undefined ? "Unavailable" : `${(0, peers_sdk_1.getAccessLevelLabel)(level)} (${level})` })
|
|
15
|
+
: "Unresolved" }), (0, jsx_runtime_1.jsx)("dt", { children: "Member" }), (0, jsx_runtime_1.jsx)("dd", { children: target?.toolName ?? tool.toolName ?? tool.name }), (0, jsx_runtime_1.jsx)("dt", { children: "Provider" }), (0, jsx_runtime_1.jsx)("dd", { children: entry?.provider?.activePackageId ?? "Unavailable" }), (0, jsx_runtime_1.jsx)("dt", { children: "Dispatch" }), (0, jsx_runtime_1.jsxs)("dd", { children: [entry?.availability.dispatch ?? "Host catalog unavailable", entry?.availability.message && `: ${entry.availability.message}`] }), (0, jsx_runtime_1.jsx)("dt", { children: "Live access" }), (0, jsx_runtime_1.jsx)("dd", { children: level === undefined ? "Unavailable" : `${(0, peers_sdk_1.getAccessLevelLabel)(level)} (${level})` })] }), (0, jsx_runtime_1.jsx)(markdown_with_mentions_1.MarkdownWithMentions, { content: entry?.usageDescription ?? tool.usageDescription }), tool.detailedDescription && (0, jsx_runtime_1.jsx)(markdown_with_mentions_1.MarkdownWithMentions, { content: tool.detailedDescription })] }));
|
|
16
16
|
};
|
|
17
17
|
exports.ToolInfo = ToolInfo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ITool, IToolCatalogEntry } from "@peers-app/peers-sdk";
|
|
2
|
-
/** Read-only contract field tables
|
|
2
|
+
/** Read-only contract field tables. */
|
|
3
3
|
export declare const ToolSchema: ({ tool, entry }: {
|
|
4
4
|
tool: ITool;
|
|
5
5
|
entry?: IToolCatalogEntry;
|
|
@@ -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,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.0",
|
|
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.0",
|
|
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.0",
|
|
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
|
-
}
|