@peers-app/peers-ui 0.28.4 → 0.28.6
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 -0
- package/dist/command-palette/command-palette-ui.js +11 -8
- package/dist/components/data-grid/autocomplete.d.ts +31 -0
- package/dist/components/data-grid/autocomplete.js +199 -0
- package/dist/components/data-grid/data-grid.d.ts +56 -0
- package/dist/components/data-grid/data-grid.js +179 -0
- package/dist/components/data-grid/index.d.ts +3 -0
- package/dist/components/data-grid/index.js +7 -0
- package/dist/components/data-grid/reactive.d.ts +5 -0
- package/dist/components/data-grid/reactive.js +9 -0
- package/dist/components/group-switcher.js +14 -12
- package/dist/components/router.js +2 -9
- package/dist/components/tooltip.d.ts +1 -0
- package/dist/components/tooltip.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/operator-console/operator-console.js +7 -7
- package/dist/root-layout/layouts/full-screen-layout.js +10 -4
- package/dist/screens/console-logs/console-logs-list.d.ts +1 -0
- package/dist/screens/console-logs/console-logs-list.js +4 -3
- package/dist/screens/console-logs/mobile-log-card.d.ts +1 -0
- package/dist/screens/console-logs/mobile-log-card.js +8 -7
- package/dist/screens/console-logs/resizable-table-header.d.ts +1 -0
- package/dist/screens/console-logs/resizable-table-header.js +3 -2
- package/dist/screens/network-viewer/usage-graph.d.ts +1 -1
- package/dist/screens/network-viewer/usage-graph.js +1 -1
- package/dist/screens/search/global-search.js +5 -5
- package/dist/screens/settings/color-mode-dropdown.d.ts +5 -0
- package/dist/screens/settings/color-mode-dropdown.js +8 -2
- package/dist/screens/settings/settings-page.js +1 -8
- package/dist/screens/setup-user.d.ts +1 -0
- package/dist/screens/setup-user.js +9 -8
- package/dist/screens/welcome-modal.js +9 -9
- package/dist/tabs-layout/tabs-layout.js +25 -31
- package/dist/theme.css +126 -0
- package/package.json +4 -4
- package/dist/screens/tools/tool-test-details.d.ts +0 -3
- package/dist/screens/tools/tool-test-details.js +0 -38
- package/dist/screens/tools/tool-test-list.d.ts +0 -3
- package/dist/screens/tools/tool-test-list.js +0 -43
|
@@ -94,14 +94,16 @@ function GroupSwitcher({ colorMode, isMobile = false }) {
|
|
|
94
94
|
borderRadius: "6px",
|
|
95
95
|
border: "none",
|
|
96
96
|
background: "transparent",
|
|
97
|
-
color: isDark ? "#adb5bd" : "
|
|
97
|
+
color: isDark ? "#adb5bd" : "var(--peers-tab-strip-color)",
|
|
98
98
|
minWidth: isMobile ? "36px" : undefined,
|
|
99
99
|
}, onMouseEnter: (e) => {
|
|
100
|
-
e.currentTarget.style.backgroundColor = isDark
|
|
101
|
-
|
|
100
|
+
e.currentTarget.style.backgroundColor = isDark
|
|
101
|
+
? "#495057"
|
|
102
|
+
: "var(--peers-tab-hover-bg)";
|
|
103
|
+
e.currentTarget.style.color = isDark ? "#ffffff" : "var(--bs-link-color)";
|
|
102
104
|
}, onMouseLeave: (e) => {
|
|
103
105
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
104
|
-
e.currentTarget.style.color = isDark ? "#adb5bd" : "
|
|
106
|
+
e.currentTarget.style.color = isDark ? "#adb5bd" : "var(--peers-tab-strip-color)";
|
|
105
107
|
}, children: [(0, jsx_runtime_1.jsx)("i", { className: `${getGroupIcon(currentGroup)} ${isMobile ? "" : "me-1"}`, style: { fontSize: "14px" } }), !isMobile && ((0, jsx_runtime_1.jsx)("span", { className: "text-truncate", style: { maxWidth: "80px" }, children: getGroupName(currentGroup) })), (0, jsx_runtime_1.jsx)("i", { className: "bi-chevron-down ms-1", style: { fontSize: "10px" } })] }), showDropdown && ((0, jsx_runtime_1.jsxs)("div", { className: `dropdown-menu show position-absolute ${isDark ? "dropdown-menu-dark" : ""}`, style: {
|
|
106
108
|
left: 0,
|
|
107
109
|
top: "100%",
|
|
@@ -222,15 +224,15 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated, })
|
|
|
222
224
|
if (e.target === e.currentTarget) {
|
|
223
225
|
onClose();
|
|
224
226
|
}
|
|
225
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { className: `${isDark ? "bg-dark text-light" : "
|
|
227
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: `${isDark ? "bg-dark text-light" : "peers-surface text-body"}`, style: {
|
|
226
228
|
width: "90%",
|
|
227
229
|
maxWidth: "500px",
|
|
228
230
|
borderRadius: "12px",
|
|
229
231
|
boxShadow: isDark ? "0 20px 40px rgba(0, 0, 0, 0.5)" : "0 20px 40px rgba(0, 0, 0, 0.1)",
|
|
230
|
-
border: isDark ? "1px solid #495057" : "1px solid
|
|
232
|
+
border: isDark ? "1px solid #495057" : "1px solid var(--peers-surface-border)",
|
|
231
233
|
overflow: "hidden",
|
|
232
234
|
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-3 border-bottom d-flex align-items-center justify-content-between", style: {
|
|
233
|
-
borderBottomColor: isDark ? "#495057" : "
|
|
235
|
+
borderBottomColor: isDark ? "#495057" : "var(--peers-surface-border)",
|
|
234
236
|
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-people-fill me-2", style: { fontSize: "20px" } }), (0, jsx_runtime_1.jsx)("h6", { className: "mb-0", children: "Create New Group" })] }), (0, jsx_runtime_1.jsx)("button", { className: "btn btn-sm p-0", style: {
|
|
235
237
|
border: "none",
|
|
236
238
|
background: "none",
|
|
@@ -246,18 +248,18 @@ function CreateGroupModal({ colorMode, userContext, onClose, onGroupCreated, })
|
|
|
246
248
|
setError(null);
|
|
247
249
|
}, onKeyDown: handleKeyDown, disabled: isCreating, maxLength: 100, style: {
|
|
248
250
|
fontSize: "14px",
|
|
249
|
-
backgroundColor: isDark ? "#343a40" : "
|
|
251
|
+
backgroundColor: isDark ? "#343a40" : "var(--peers-surface-bg)",
|
|
250
252
|
} }), (0, jsx_runtime_1.jsxs)("small", { className: "text-muted", style: { fontSize: "11px" }, children: [groupName.length, "/100 characters"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "mb-3", children: [(0, jsx_runtime_1.jsx)("label", { className: "form-label small mb-1", children: "Icon" }), (0, jsx_runtime_1.jsxs)("div", { className: "input-group", children: [(0, jsx_runtime_1.jsx)("span", { className: `input-group-text ${isDark ? "bg-dark text-light border-secondary" : ""}`, style: { backgroundColor: isDark ? "#343a40" : undefined }, children: (0, jsx_runtime_1.jsx)("i", { className: iconClassName || "bi-people-fill" }) }), (0, jsx_runtime_1.jsx)("input", { type: "text", className: `form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`, placeholder: "bi-people-fill", value: iconClassName, onChange: (e) => setIconClassName(e.target.value), onKeyDown: handleKeyDown, disabled: isCreating, style: {
|
|
251
253
|
fontSize: "14px",
|
|
252
|
-
backgroundColor: isDark ? "#343a40" : "
|
|
254
|
+
backgroundColor: isDark ? "#343a40" : "var(--peers-surface-bg)",
|
|
253
255
|
} })] }), (0, jsx_runtime_1.jsx)("small", { className: "text-muted", style: { fontSize: "11px" }, children: "Bootstrap icon class name (e.g., bi-star-fill, bi-house-fill)" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "mb-3", children: [(0, jsx_runtime_1.jsx)("label", { className: "form-label small mb-1", children: "Description (optional)" }), (0, jsx_runtime_1.jsx)("textarea", { className: `form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`, placeholder: "Enter group description", value: description, onChange: (e) => setDescription(e.target.value), disabled: isCreating, rows: 3, maxLength: 500, style: {
|
|
254
256
|
fontSize: "14px",
|
|
255
|
-
backgroundColor: isDark ? "#343a40" : "
|
|
257
|
+
backgroundColor: isDark ? "#343a40" : "var(--peers-surface-bg)",
|
|
256
258
|
resize: "none",
|
|
257
259
|
} }), (0, jsx_runtime_1.jsxs)("small", { className: "text-muted", style: { fontSize: "11px" }, children: [description.length, "/500 characters"] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 border-top d-flex justify-content-end gap-2", style: {
|
|
258
|
-
borderTopColor: isDark ? "#495057" : "
|
|
260
|
+
borderTopColor: isDark ? "#495057" : "var(--peers-surface-border)",
|
|
259
261
|
}, children: [(0, jsx_runtime_1.jsx)("button", { className: `btn btn-sm ${isDark ? "btn-outline-light" : "btn-outline-secondary"}`, onClick: onClose, disabled: isCreating, style: { minWidth: "80px" }, children: "Cancel" }), (0, jsx_runtime_1.jsx)("button", { className: "btn btn-sm btn-primary", onClick: handleCreate, disabled: isCreating || !groupName.trim(), style: { minWidth: "80px" }, children: isCreating ? ((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" }), "Creating..."] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-plus-circle me-1" }), "Create"] })) })] }), (0, jsx_runtime_1.jsxs)("div", { className: `px-3 py-2 small text-muted border-top`, style: {
|
|
260
|
-
borderTopColor: isDark ? "#495057" : "
|
|
262
|
+
borderTopColor: isDark ? "#495057" : "var(--peers-surface-border)",
|
|
261
263
|
fontSize: "11px",
|
|
262
264
|
}, children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u21B5" }), " to create \u2022 ", (0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "esc" }), " to cancel"] })] }) }));
|
|
263
265
|
}
|
|
@@ -51,7 +51,6 @@ const settings_page_1 = require("../screens/settings/settings-page");
|
|
|
51
51
|
// import { TaskList } from "../screens/tasks/task-list";
|
|
52
52
|
const tool_details_1 = require("../screens/tools/tool-details");
|
|
53
53
|
const tool_list_1 = require("../screens/tools/tool-list");
|
|
54
|
-
const tool_test_details_1 = require("../screens/tools/tool-test-details");
|
|
55
54
|
const variable_details_1 = require("../screens/variables/variable-details");
|
|
56
55
|
const variable_list_1 = require("../screens/variables/variable-list");
|
|
57
56
|
const workflow_details_1 = require("../screens/workflows/workflow-details");
|
|
@@ -129,16 +128,10 @@ function Router({ path: providedPath } = {}) {
|
|
|
129
128
|
const workflowId = parts[0];
|
|
130
129
|
return (0, jsx_runtime_1.jsx)(workflow_details_1.WorkflowDetails, { workflowId: workflowId });
|
|
131
130
|
}
|
|
132
|
-
|
|
131
|
+
// Saved tabs from the removed tool-test screens fall back to the catalog.
|
|
132
|
+
if (path === "tools" || /^tools\/tests(?:\/|$)/.test(path)) {
|
|
133
133
|
return (0, jsx_runtime_1.jsx)(tool_list_1.ToolList, {});
|
|
134
134
|
}
|
|
135
|
-
if (path.match(/^tools\/tests\//)) {
|
|
136
|
-
const parts = path.split("/");
|
|
137
|
-
parts.shift();
|
|
138
|
-
parts.shift();
|
|
139
|
-
const toolTestId = parts[0];
|
|
140
|
-
return (0, jsx_runtime_1.jsx)(tool_test_details_1.ToolTestDetails, { toolTestId: toolTestId });
|
|
141
|
-
}
|
|
142
135
|
if (path.match(/^tools\//)) {
|
|
143
136
|
const parts = path.split("/");
|
|
144
137
|
parts.shift();
|
|
@@ -7,5 +7,6 @@ interface IProps {
|
|
|
7
7
|
positions?: ("right" | "bottom" | "left" | "top")[];
|
|
8
8
|
genericContent?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
+
/** Click-triggered popover containing Markdown or custom content. */
|
|
10
11
|
export declare const Tooltip: (props: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -5,11 +5,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_tiny_popover_1 = require("react-tiny-popover");
|
|
6
6
|
const hooks_1 = require("../hooks");
|
|
7
7
|
const markdown_with_mentions_1 = require("./markdown-with-mentions");
|
|
8
|
+
/** Click-triggered popover containing Markdown or custom content. */
|
|
8
9
|
const Tooltip = (props) => {
|
|
9
10
|
const { handle } = props;
|
|
10
11
|
let [markdownContent] = (0, hooks_1.useObservable)(props.markdownContent);
|
|
11
12
|
markdownContent = markdownContent ?? "";
|
|
12
13
|
const showPopover = (0, hooks_1.useObservableState)(false);
|
|
13
|
-
return ((0, jsx_runtime_1.jsx)(react_tiny_popover_1.Popover, { isOpen: showPopover(), onClickOutside: () => showPopover(false), positions: props.positions ?? ["right", "bottom", "left", "top"], content: () => ((0, jsx_runtime_1.jsx)("div", { className: "card p-2 bg-light-subtle", style: { maxWidth: 500, maxHeight: 400, overflowY: "auto", zIndex: 1000001 }, children: props.genericContent || (0, jsx_runtime_1.jsx)(markdown_with_mentions_1.MarkdownWithMentions, { content: markdownContent }) })), children: (0, jsx_runtime_1.jsx)("span", { className: props.handleClassName ?? "p-2", onClick: () => showPopover(!showPopover()), children: handle ?? (0, jsx_runtime_1.jsx)("i", { className: "bi bi-info-circle", style: { cursor: "pointer" } }) }) }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(react_tiny_popover_1.Popover, { isOpen: showPopover(), onClickOutside: () => showPopover(false), positions: props.positions ?? ["right", "bottom", "left", "top"], content: () => ((0, jsx_runtime_1.jsx)("div", { className: "card p-2 bg-light-subtle peers-surface", style: { maxWidth: 500, maxHeight: 400, overflowY: "auto", zIndex: 1000001 }, children: props.genericContent || (0, jsx_runtime_1.jsx)(markdown_with_mentions_1.MarkdownWithMentions, { content: markdownContent }) })), children: (0, jsx_runtime_1.jsx)("span", { className: props.handleClassName ?? "p-2", onClick: () => showPopover(!showPopover()), children: handle ?? (0, jsx_runtime_1.jsx)("i", { className: "bi bi-info-circle", style: { cursor: "pointer" } }) }) }));
|
|
14
15
|
};
|
|
15
16
|
exports.Tooltip = Tooltip;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.updateActiveTabTitle = exports.goToTabPath = exports.closeCurrentTab = exports.activeTabs = exports.activeTabId = exports.setRootLayout = exports.selectedRootLayoutId = exports.getRootLayouts = exports.getRootLayout = exports.DEFAULT_ROOT_LAYOUT_ID = exports.TabsLayoutApp = exports.RootLayoutHost = exports.LayoutPicker = exports.unregisterGlobalOverlay = exports.registerGlobalOverlay = exports.globalOverlays = exports.openLink = exports.mainContentPath = exports.isDesktop = exports.Typeahead = exports.MarkdownEditor = void 0;
|
|
18
|
+
__exportStar(require("./components/data-grid"), exports);
|
|
18
19
|
__exportStar(require("./components/inverse-lazy-list"), exports);
|
|
19
20
|
var editor_1 = require("./components/markdown-editor/editor");
|
|
20
21
|
Object.defineProperty(exports, "MarkdownEditor", { enumerable: true, get: function () { return editor_1.MarkdownEditor; } });
|
|
@@ -12,13 +12,13 @@ const operator_console_state_1 = require("./operator-console-state");
|
|
|
12
12
|
*/
|
|
13
13
|
function getConsoleTheme(isDark) {
|
|
14
14
|
return {
|
|
15
|
-
bg: isDark ? "#1e1e1e" : "
|
|
16
|
-
headerBg: isDark ? "#252526" : "
|
|
17
|
-
border: isDark ? "#3c3c3c" : "
|
|
18
|
-
text: isDark ? "#cccccc" : "
|
|
19
|
-
muted: isDark ? "#8c8c8c" : "
|
|
20
|
-
hover: isDark ? "#2a2d2e" : "
|
|
21
|
-
accent: "#0d6efd",
|
|
15
|
+
bg: isDark ? "#1e1e1e" : "var(--peers-surface-bg)",
|
|
16
|
+
headerBg: isDark ? "#252526" : "var(--bs-body-bg)",
|
|
17
|
+
border: isDark ? "#3c3c3c" : "var(--peers-surface-border)",
|
|
18
|
+
text: isDark ? "#cccccc" : "var(--bs-body-color)",
|
|
19
|
+
muted: isDark ? "#8c8c8c" : "var(--bs-secondary-color)",
|
|
20
|
+
hover: isDark ? "#2a2d2e" : "var(--peers-tab-hover-bg)",
|
|
21
|
+
accent: isDark ? "#0d6efd" : "var(--bs-link-color)",
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
@@ -38,11 +38,17 @@ function FullScreenLayout() {
|
|
|
38
38
|
const isLauncher = activeTab.packageId === "launcher" || activeTab.tabId === "launcher";
|
|
39
39
|
const isLight = mode === "light";
|
|
40
40
|
const title = isLauncher ? "Apps" : activeTab.title;
|
|
41
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex flex-column", style: { height: "calc(100vh - 25px)", overflow: "hidden" }, children: [(0, jsx_runtime_1.jsxs)("div", { className: `border-bottom d-flex align-items-center px-1 ${isLight ? "
|
|
41
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex flex-column", style: { height: "calc(100vh - 25px)", overflow: "hidden" }, children: [(0, jsx_runtime_1.jsxs)("div", { className: `border-bottom peers-tab-strip d-flex align-items-center px-1 ${isLight ? "" : "bg-dark"}`, style: { height: "36px", borderBottomColor: isLight ? "var(--peers-tab-edge)" : "#495057" }, children: [(0, jsx_runtime_1.jsx)(group_switcher_1.GroupSwitcher, { colorMode: mode, isMobile: isMobile }), (0, jsx_runtime_1.jsx)(HeaderButton, { isLight: isLight, active: isLauncher, icon: "bi-grid-3x3-gap", label: "Apps", onClick: () => (0, tabs_state_1.activeTabId)("launcher") }), (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center flex-grow-1 overflow-hidden px-2", children: [!isLauncher && activeTab.iconClassName && ((0, jsx_runtime_1.jsx)("i", { className: `${activeTab.iconClassName} me-2` })), (0, jsx_runtime_1.jsx)("span", { className: "text-truncate fw-medium", style: { fontSize: "13px" }, children: title })] }), (0, jsx_runtime_1.jsx)(HeaderButton, { isLight: isLight, icon: "bi-search", label: `Search and navigate (${paletteHint})`, onClick: command_palette_1.openCommandPalette, children: (0, jsx_runtime_1.jsx)("span", { className: "d-none d-md-inline ms-1", style: { fontSize: "11px" }, children: paletteHint }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex-grow-1 overflow-hidden", children: (0, jsx_runtime_1.jsx)(tabs_layout_1.TabErrorBoundary, { tabTitle: activeTab.title, tabId: activeTab.tabId, children: (0, jsx_runtime_1.jsx)(tabs_layout_1.TabContent, { tab: activeTab, isMobile: isMobile, isActive: true }) }, activeTab.tabId) })] }));
|
|
42
42
|
}
|
|
43
43
|
/** A small, transparent header button matching the tabs layout's toolbar styling. */
|
|
44
44
|
function HeaderButton({ isLight, icon, label, onClick, active, children }) {
|
|
45
|
-
const baseColor = active
|
|
45
|
+
const baseColor = active
|
|
46
|
+
? isLight
|
|
47
|
+
? "var(--bs-link-color)"
|
|
48
|
+
: "#ffffff"
|
|
49
|
+
: isLight
|
|
50
|
+
? "var(--peers-tab-icon-color)"
|
|
51
|
+
: "#adb5bd";
|
|
46
52
|
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", className: "btn btn-sm d-flex align-items-center", onClick: onClick, title: label, "aria-label": label, style: {
|
|
47
53
|
padding: "4px 8px",
|
|
48
54
|
fontSize: "12px",
|
|
@@ -51,8 +57,8 @@ function HeaderButton({ isLight, icon, label, onClick, active, children }) {
|
|
|
51
57
|
background: "transparent",
|
|
52
58
|
color: baseColor,
|
|
53
59
|
}, onMouseEnter: (e) => {
|
|
54
|
-
e.currentTarget.style.backgroundColor = isLight ? "
|
|
55
|
-
e.currentTarget.style.color = isLight ? "
|
|
60
|
+
e.currentTarget.style.backgroundColor = isLight ? "var(--peers-tab-hover-bg)" : "#495057";
|
|
61
|
+
e.currentTarget.style.color = isLight ? "var(--bs-link-color)" : "#ffffff";
|
|
56
62
|
}, onMouseLeave: (e) => {
|
|
57
63
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
58
64
|
e.currentTarget.style.color = baseColor;
|
|
@@ -59,6 +59,7 @@ const DEFAULT_COLUMNS = [
|
|
|
59
59
|
{ key: "source", label: "Source", width: 120 },
|
|
60
60
|
{ key: "message", label: "Message", width: 600 },
|
|
61
61
|
];
|
|
62
|
+
/** Filterable console log screen with desktop columns and mobile log cards. */
|
|
62
63
|
const ConsoleLogsList = () => {
|
|
63
64
|
const logs = (0, hooks_1.useObservableState)([]);
|
|
64
65
|
const [allLogsLoaded, setAllLogsLoaded] = (0, react_1.useState)(false);
|
|
@@ -238,7 +239,7 @@ const ConsoleLogsList = () => {
|
|
|
238
239
|
flex: 1,
|
|
239
240
|
display: "flex",
|
|
240
241
|
flexDirection: "column",
|
|
241
|
-
backgroundColor: _colorMode === "dark" ? "#1a1a1a" : "
|
|
242
|
+
backgroundColor: _colorMode === "dark" ? "#1a1a1a" : "var(--peers-surface-bg)",
|
|
242
243
|
borderRadius: "0.25rem",
|
|
243
244
|
marginBottom: "50px",
|
|
244
245
|
overflow: "hidden",
|
|
@@ -257,8 +258,8 @@ const ConsoleLogsList = () => {
|
|
|
257
258
|
left: 0,
|
|
258
259
|
right: 0,
|
|
259
260
|
padding: "0.5rem 1rem",
|
|
260
|
-
backgroundColor: _colorMode === "dark" ? "#2a2a2a" : "
|
|
261
|
-
borderTop: "1px solid #dee2e6",
|
|
261
|
+
backgroundColor: _colorMode === "dark" ? "#2a2a2a" : "var(--peers-surface-bg)",
|
|
262
|
+
borderTop: "1px solid var(--peers-surface-border, #dee2e6)",
|
|
262
263
|
zIndex: 1000,
|
|
263
264
|
display: "flex",
|
|
264
265
|
justifyContent: "space-between",
|
|
@@ -3,5 +3,6 @@ interface MobileLogCardProps {
|
|
|
3
3
|
log: IConsoleLog;
|
|
4
4
|
colorMode: string;
|
|
5
5
|
}
|
|
6
|
+
/** Compact log entry with expandable details for narrow screens. */
|
|
6
7
|
export declare const MobileLogCard: ({ log, colorMode }: MobileLogCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -51,6 +51,7 @@ const getLevelIcon = (level) => {
|
|
|
51
51
|
return "bi-chat-square-text";
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
+
/** Compact log entry with expandable details for narrow screens. */
|
|
54
55
|
const MobileLogCard = ({ log, colorMode }) => {
|
|
55
56
|
const isDark = colorMode === "dark";
|
|
56
57
|
// Parse context if it's a string
|
|
@@ -63,9 +64,9 @@ const MobileLogCard = ({ log, colorMode }) => {
|
|
|
63
64
|
}
|
|
64
65
|
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
65
66
|
padding: "10px 12px",
|
|
66
|
-
borderBottom: `1px solid ${isDark ? "#333" : "
|
|
67
|
-
backgroundColor: isDark ? "#1a1a1a" : "
|
|
68
|
-
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-2 mb-1", style: { flexWrap: "wrap" }, children: [(0, jsx_runtime_1.jsx)("span", { style: { fontSize: "0.7rem", color: isDark ? "#888" : "
|
|
67
|
+
borderBottom: `1px solid ${isDark ? "#333" : "var(--peers-surface-border)"}`,
|
|
68
|
+
backgroundColor: isDark ? "#1a1a1a" : "var(--peers-surface-bg)",
|
|
69
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center gap-2 mb-1", style: { flexWrap: "wrap" }, children: [(0, jsx_runtime_1.jsx)("span", { style: { fontSize: "0.7rem", color: isDark ? "#888" : "var(--bs-secondary-color)" }, children: (0, moment_1.default)(log.timestamp).format("HH:mm:ss.SSS") }), (0, jsx_runtime_1.jsxs)("span", { className: "badge text-white", style: {
|
|
69
70
|
backgroundColor: getLevelColor(log.level),
|
|
70
71
|
fontSize: "0.65rem",
|
|
71
72
|
padding: "2px 6px",
|
|
@@ -73,14 +74,14 @@ const MobileLogCard = ({ log, colorMode }) => {
|
|
|
73
74
|
backgroundColor: getProcessColor(log.process),
|
|
74
75
|
fontSize: "0.65rem",
|
|
75
76
|
padding: "2px 6px",
|
|
76
|
-
}, children: log.process }), log.source && ((0, jsx_runtime_1.jsx)("span", { style: { fontSize: "0.65rem", color: isDark ? "#666" : "
|
|
77
|
+
}, children: log.process }), log.source && ((0, jsx_runtime_1.jsx)("span", { style: { fontSize: "0.65rem", color: isDark ? "#666" : "var(--bs-secondary-color)" }, children: log.source }))] }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
77
78
|
fontSize: "0.8rem",
|
|
78
79
|
wordBreak: "break-word",
|
|
79
|
-
color: isDark ? "#e0e0e0" : "
|
|
80
|
+
color: isDark ? "#e0e0e0" : "var(--bs-body-color)",
|
|
80
81
|
}, children: log.message }), context && ((0, jsx_runtime_1.jsxs)("details", { className: "mt-1", children: [(0, jsx_runtime_1.jsxs)("summary", { className: "text-muted", style: { cursor: "pointer", fontSize: "0.7rem" }, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-code-square me-1" }), "Context"] }), (0, jsx_runtime_1.jsx)("pre", { className: "mt-1 p-2 rounded", style: {
|
|
81
82
|
fontSize: "0.65rem",
|
|
82
|
-
backgroundColor: isDark ? "#252525" : "
|
|
83
|
-
color: isDark ? "#aaa" : "
|
|
83
|
+
backgroundColor: isDark ? "#252525" : "var(--bs-body-bg)",
|
|
84
|
+
color: isDark ? "#aaa" : "var(--bs-body-color)",
|
|
84
85
|
overflow: "auto",
|
|
85
86
|
maxHeight: "150px",
|
|
86
87
|
}, children: JSON.stringify(context, null, 2) })] })), log.stackTrace && ((0, jsx_runtime_1.jsxs)("details", { className: "mt-1", children: [(0, jsx_runtime_1.jsxs)("summary", { className: "text-danger", style: { cursor: "pointer", fontSize: "0.7rem" }, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-bug me-1" }), "Stack Trace"] }), (0, jsx_runtime_1.jsx)("pre", { className: "mt-1 p-2 rounded text-danger", style: {
|
|
@@ -9,5 +9,6 @@ interface ResizableTableHeaderProps {
|
|
|
9
9
|
onColumnsChange: (columns: Column[]) => void;
|
|
10
10
|
colorMode: string;
|
|
11
11
|
}
|
|
12
|
+
/** Log table header whose drag handles resize the displayed columns. */
|
|
12
13
|
export declare const ResizableTableHeader: ({ columns, onColumnsChange, colorMode, }: ResizableTableHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ResizableTableHeader = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
/** Log table header whose drag handles resize the displayed columns. */
|
|
6
7
|
const ResizableTableHeader = ({ columns, onColumnsChange, colorMode, }) => {
|
|
7
8
|
const [resizingColumn, setResizingColumn] = (0, react_1.useState)(null);
|
|
8
9
|
const startXRef = (0, react_1.useRef)(0);
|
|
@@ -34,11 +35,11 @@ const ResizableTableHeader = ({ columns, onColumnsChange, colorMode, }) => {
|
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
}, [resizingColumn, columns, onColumnsChange]);
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)("table", { className: "table table-sm mb-0", style: { fontSize: "0.85rem", tableLayout: "fixed", width: "100%" }, children: (0, jsx_runtime_1.jsx)("thead", { style: { backgroundColor: colorMode === "dark" ? "#2a2a2a" : "
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)("table", { className: "table table-sm mb-0 peers-table-surface", style: { fontSize: "0.85rem", tableLayout: "fixed", width: "100%" }, children: (0, jsx_runtime_1.jsx)("thead", { style: { backgroundColor: colorMode === "dark" ? "#2a2a2a" : "var(--peers-surface-bg)" }, children: (0, jsx_runtime_1.jsx)("tr", { children: columns.map((column) => ((0, jsx_runtime_1.jsxs)("th", { style: {
|
|
38
39
|
width: `${column.width}px`,
|
|
39
40
|
position: "relative",
|
|
40
41
|
padding: "0.5rem",
|
|
41
|
-
borderRight: "1px solid #dee2e6",
|
|
42
|
+
borderRight: "1px solid var(--peers-surface-border, #dee2e6)",
|
|
42
43
|
}, children: [column.label, column.key !== "message" && ((0, jsx_runtime_1.jsx)("div", { onMouseDown: (e) => handleMouseDown(e, column.key, column.width), style: {
|
|
43
44
|
position: "absolute",
|
|
44
45
|
right: 0,
|
|
@@ -34,7 +34,7 @@ interface IUsageGraphProps {
|
|
|
34
34
|
*/
|
|
35
35
|
color?: string;
|
|
36
36
|
/**
|
|
37
|
-
* Color for the overlay text (optional
|
|
37
|
+
* Color for the overlay text (optional). Defaults to the theme's `--peers-graph-overlay-color` (a faint gray in light mode), else translucent white.
|
|
38
38
|
*/
|
|
39
39
|
overlayTextColor?: string;
|
|
40
40
|
/**
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.UsageGraph = UsageGraph;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
function UsageGraph({ fetchUsage, label, durationMinutes = 5, updateInterval = 5000, minHeight = 80, color = "rgba(13, 110, 253, 1)", overlayTextColor = "rgba(255, 255, 255, 0.7)", minValue = 0, maxValue = 100, formatOverlayText, colorZones, }) {
|
|
6
|
+
function UsageGraph({ fetchUsage, label, durationMinutes = 5, updateInterval = 5000, minHeight = 80, color = "rgba(13, 110, 253, 1)", overlayTextColor = "var(--peers-graph-overlay-color, rgba(255, 255, 255, 0.7))", minValue = 0, maxValue = 100, formatOverlayText, colorZones, }) {
|
|
7
7
|
const [dataPoints, setDataPoints] = (0, react_1.useState)([]);
|
|
8
8
|
const [currentValue, setCurrentValue] = (0, react_1.useState)(0);
|
|
9
9
|
const [width, setWidth] = (0, react_1.useState)(400);
|
|
@@ -133,8 +133,8 @@ function GlobalSearch() {
|
|
|
133
133
|
paddingLeft: "50px",
|
|
134
134
|
fontSize: "18px",
|
|
135
135
|
borderRadius: "12px",
|
|
136
|
-
backgroundColor: isDark ? "#343a40" : "
|
|
137
|
-
border: isDark ? "2px solid #495057" : "2px solid
|
|
136
|
+
backgroundColor: isDark ? "#343a40" : "var(--peers-surface-bg)",
|
|
137
|
+
border: isDark ? "2px solid #495057" : "2px solid var(--peers-surface-border)",
|
|
138
138
|
} }), isSearching && ((0, jsx_runtime_1.jsx)("div", { className: "position-absolute", style: {
|
|
139
139
|
right: "16px",
|
|
140
140
|
top: "50%",
|
|
@@ -145,7 +145,7 @@ function GlobalSearch() {
|
|
|
145
145
|
? `Found ${totalResults} result${totalResults !== 1 ? "s" : ""}`
|
|
146
146
|
: searchQuery.trim()
|
|
147
147
|
? "No results found"
|
|
148
|
-
: null }))] }), searchQuery && !isSearching && ((0, jsx_runtime_1.jsx)("div", { children: searchResults.length === 0 && appResults.length === 0 ? ((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: "48px" } }), (0, jsx_runtime_1.jsx)("h4", { className: "text-muted", children: "No results found" }), (0, jsx_runtime_1.jsx)("p", { className: "text-muted", children: "Try different keywords or check your spelling" })] })) : ((0, jsx_runtime_1.jsxs)("div", { children: [appResults.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center mb-3", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-grid-3x3-gap me-3", style: { fontSize: "20px", color: "#6c757d" } }), (0, jsx_runtime_1.jsx)("h4", { className: "mb-0 me-3", children: "Apps" }), (0, jsx_runtime_1.jsx)("span", { className: "badge bg-secondary", children: appResults.length })] }), (0, jsx_runtime_1.jsx)("div", { className: "row g-3", children: appResults.map((app) => ((0, jsx_runtime_1.jsx)("div", { className: "col-12 col-md-6 col-lg-4", children: (0, jsx_runtime_1.jsx)("div", { className: `card h-100 ${isDark ? "bg-dark border-secondary" : "
|
|
148
|
+
: null }))] }), searchQuery && !isSearching && ((0, jsx_runtime_1.jsx)("div", { children: searchResults.length === 0 && appResults.length === 0 ? ((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: "48px" } }), (0, jsx_runtime_1.jsx)("h4", { className: "text-muted", children: "No results found" }), (0, jsx_runtime_1.jsx)("p", { className: "text-muted", children: "Try different keywords or check your spelling" })] })) : ((0, jsx_runtime_1.jsxs)("div", { children: [appResults.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "mb-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center mb-3", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-grid-3x3-gap me-3", style: { fontSize: "20px", color: "#6c757d" } }), (0, jsx_runtime_1.jsx)("h4", { className: "mb-0 me-3", children: "Apps" }), (0, jsx_runtime_1.jsx)("span", { className: "badge bg-secondary", children: appResults.length })] }), (0, jsx_runtime_1.jsx)("div", { className: "row g-3", children: appResults.map((app) => ((0, jsx_runtime_1.jsx)("div", { className: "col-12 col-md-6 col-lg-4", children: (0, jsx_runtime_1.jsx)("div", { className: `card h-100 ${isDark ? "bg-dark border-secondary" : "peers-surface"}`, style: {
|
|
149
149
|
cursor: "pointer",
|
|
150
150
|
transition: "all 0.15s ease",
|
|
151
151
|
borderRadius: "8px",
|
|
@@ -161,7 +161,7 @@ function GlobalSearch() {
|
|
|
161
161
|
fontSize: "16px",
|
|
162
162
|
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
163
163
|
minWidth: "16px",
|
|
164
|
-
} }), (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: app.displayName }), (0, jsx_runtime_1.jsx)("small", { className: "text-muted text-uppercase", style: { fontSize: "11px", letterSpacing: "0.5px" }, children: app.packageId === "system-apps" ? "System App" : app.packageName })] }), (0, jsx_runtime_1.jsx)("i", { className: "bi-arrow-right text-muted", style: { fontSize: "12px" } })] }) }) }) }, `${app.packageId}-${app.path}`))) })] })), searchResults.map((result) => ((0, jsx_runtime_1.jsxs)("div", { className: "mb-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center mb-3", children: [(0, jsx_runtime_1.jsx)("i", { className: `${result.config.iconClass} me-3`, style: { fontSize: "20px", color: "#6c757d" } }), (0, jsx_runtime_1.jsx)("h4", { className: "mb-0 me-3", children: result.category }), (0, jsx_runtime_1.jsx)("span", { className: "badge bg-secondary", children: result.items.length })] }), (0, jsx_runtime_1.jsx)("div", { className: "row g-3", children: result.items.map((item) => ((0, jsx_runtime_1.jsx)("div", { className: "col-12 col-md-6 col-lg-4", children: (0, jsx_runtime_1.jsx)("div", { className: `card h-100 ${isDark ? "bg-dark border-secondary" : "
|
|
164
|
+
} }), (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: app.displayName }), (0, jsx_runtime_1.jsx)("small", { className: "text-muted text-uppercase", style: { fontSize: "11px", letterSpacing: "0.5px" }, children: app.packageId === "system-apps" ? "System App" : app.packageName })] }), (0, jsx_runtime_1.jsx)("i", { className: "bi-arrow-right text-muted", style: { fontSize: "12px" } })] }) }) }) }, `${app.packageId}-${app.path}`))) })] })), searchResults.map((result) => ((0, jsx_runtime_1.jsxs)("div", { className: "mb-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center mb-3", children: [(0, jsx_runtime_1.jsx)("i", { className: `${result.config.iconClass} me-3`, style: { fontSize: "20px", color: "#6c757d" } }), (0, jsx_runtime_1.jsx)("h4", { className: "mb-0 me-3", children: result.category }), (0, jsx_runtime_1.jsx)("span", { className: "badge bg-secondary", children: result.items.length })] }), (0, jsx_runtime_1.jsx)("div", { className: "row g-3", children: result.items.map((item) => ((0, jsx_runtime_1.jsx)("div", { className: "col-12 col-md-6 col-lg-4", children: (0, jsx_runtime_1.jsx)("div", { className: `card h-100 ${isDark ? "bg-dark border-secondary" : "peers-surface"}`, style: {
|
|
165
165
|
cursor: "pointer",
|
|
166
166
|
transition: "all 0.15s ease",
|
|
167
167
|
borderRadius: "8px",
|
|
@@ -177,5 +177,5 @@ function GlobalSearch() {
|
|
|
177
177
|
fontSize: "16px",
|
|
178
178
|
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
179
179
|
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, assistants, workflows, types, and users 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" : "
|
|
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, assistants, workflows, types, and users 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
181
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/** Stored theme preference, optionally following the operating system. */
|
|
1
2
|
export type ColorModePreference = "light" | "dark" | "auto";
|
|
3
|
+
/** Resolved theme applied to the page. */
|
|
2
4
|
export type ColorMode = "light" | "dark";
|
|
5
|
+
/** Observable resolved theme for platform and package components. */
|
|
3
6
|
export declare const colorMode: import("@peers-app/peers-sdk").PersistentVar<ColorMode>;
|
|
7
|
+
/** Persistent device preference used to select the resolved theme. */
|
|
4
8
|
export declare const colorModePreference: import("@peers-app/peers-sdk").PersistentVar<ColorModePreference>;
|
|
9
|
+
/** Settings control for light, dark, or system-following appearance. */
|
|
5
10
|
export declare const ColorModeDropdown: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,9 +4,11 @@ exports.ColorModeDropdown = exports.colorModePreference = exports.colorMode = vo
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
6
6
|
const hooks_1 = require("../../hooks");
|
|
7
|
+
/** Observable resolved theme for platform and package components. */
|
|
7
8
|
exports.colorMode = (0, peers_sdk_1.deviceVar)("colorMode", {
|
|
8
9
|
defaultValue: "dark",
|
|
9
10
|
});
|
|
11
|
+
/** Persistent device preference used to select the resolved theme. */
|
|
10
12
|
exports.colorModePreference = (0, peers_sdk_1.deviceVar)("colorModePreference", {
|
|
11
13
|
defaultValue: "dark",
|
|
12
14
|
});
|
|
@@ -28,7 +30,7 @@ function applyColorMode(modePreference) {
|
|
|
28
30
|
document.documentElement.setAttribute("data-bs-theme", mode);
|
|
29
31
|
if (mode === "light") {
|
|
30
32
|
document.documentElement.style.backgroundColor = "";
|
|
31
|
-
document.body.style.backgroundColor = "
|
|
33
|
+
document.body.style.backgroundColor = "";
|
|
32
34
|
}
|
|
33
35
|
else {
|
|
34
36
|
document.documentElement.style.backgroundColor = "rgb(33, 37, 41)";
|
|
@@ -36,13 +38,17 @@ function applyColorMode(modePreference) {
|
|
|
36
38
|
}
|
|
37
39
|
const themeMeta = document.querySelector('meta[name="theme-color"]');
|
|
38
40
|
if (themeMeta) {
|
|
39
|
-
|
|
41
|
+
const themeColor = mode === "light"
|
|
42
|
+
? getComputedStyle(document.documentElement).getPropertyValue("--peers-tab-strip-bg").trim()
|
|
43
|
+
: "#212529";
|
|
44
|
+
themeMeta.setAttribute("content", themeColor);
|
|
40
45
|
}
|
|
41
46
|
(0, exports.colorMode)(mode);
|
|
42
47
|
exports.colorMode.notifySubscribers();
|
|
43
48
|
return mode;
|
|
44
49
|
}
|
|
45
50
|
exports.colorModePreference.subscribe((newValue) => applyColorMode(newValue));
|
|
51
|
+
/** Settings control for light, dark, or system-following appearance. */
|
|
46
52
|
const ColorModeDropdown = () => {
|
|
47
53
|
const [modePreference] = (0, hooks_1.useObservable)(exports.colorModePreference);
|
|
48
54
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "dropdown", children: [(0, jsx_runtime_1.jsxs)("button", { className: "btn btn-secondary dropdown-toggle", type: "button", id: "colorModeDropdown", "data-bs-toggle": "dropdown", "aria-expanded": "false", children: ["Color Mode: ", (0, peers_sdk_1.camelCaseToSpaces)(modePreference)] }), (0, jsx_runtime_1.jsxs)("ul", { className: "dropdown-menu", "aria-labelledby": "colorModeDropdown", children: [(0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)("button", { className: "dropdown-item", onClick: () => (0, exports.colorModePreference)("auto"), children: ["Auto ", modePreference === "auto" && "✓"] }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)("button", { className: "dropdown-item", onClick: () => (0, exports.colorModePreference)("light"), children: ["Light ", modePreference === "light" && "✓"] }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)("button", { className: "dropdown-item", onClick: () => (0, exports.colorModePreference)("dark"), children: ["Dark ", modePreference === "dark" && "✓"] }) })] })] }));
|
|
@@ -84,7 +84,7 @@ const AppearanceSettingsTab = () => {
|
|
|
84
84
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h5", { className: "mb-3", children: "Appearance" }), (0, jsx_runtime_1.jsx)("div", { className: "mb-3", children: (0, jsx_runtime_1.jsx)(color_mode_dropdown_1.ColorModeDropdown, {}) }), (0, jsx_runtime_1.jsx)("div", { className: "mb-3", children: (0, jsx_runtime_1.jsx)(layout_picker_1.LayoutPicker, {}) })] }));
|
|
85
85
|
};
|
|
86
86
|
const AdvancedSettingsTab = () => {
|
|
87
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h5", { className: "mb-3", children: "Advanced Settings" }), (0, jsx_runtime_1.jsx)(PackagesRootDirectory, {}), (0, jsx_runtime_1.jsx)(ReloadPackagesOnPageRefresh, {}), (0, jsx_runtime_1.jsx)(
|
|
87
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("h5", { className: "mb-3", children: "Advanced Settings" }), (0, jsx_runtime_1.jsx)(PackagesRootDirectory, {}), (0, jsx_runtime_1.jsx)(ReloadPackagesOnPageRefresh, {}), (0, jsx_runtime_1.jsx)(ResetDeviceSyncInfos, {}), (0, jsx_runtime_1.jsx)(DeleteLocalDatabase, {}), (0, jsx_runtime_1.jsx)(CleanupOldDataDir, {}), (0, jsx_runtime_1.jsx)(ResetChangeTracking, {})] }));
|
|
88
88
|
};
|
|
89
89
|
const ProfileSection = () => {
|
|
90
90
|
const me = (0, hooks_1.usePromise)(async () => {
|
|
@@ -134,13 +134,6 @@ const ReloadPackagesOnPageRefresh = () => {
|
|
|
134
134
|
(0, peers_sdk_1.reloadPackagesOnPageRefresh)(checked);
|
|
135
135
|
} }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { markdownContent: `Checking this will reload all packages very time the page is loaded. Particularly useful while developing packages.` })] }));
|
|
136
136
|
};
|
|
137
|
-
const AutoUpdatePeersCore = () => {
|
|
138
|
-
(0, hooks_1.useObservable)(peers_sdk_1.autoUpdatePeersCore);
|
|
139
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { htmlFor: "autoUpdatePeersCore", className: "form-label small mt-2 me-2", children: "Auto-update peers-core on startup:" }), (0, jsx_runtime_1.jsx)("input", { type: "checkbox", checked: (0, peers_sdk_1.autoUpdatePeersCore)(), onChange: (e) => {
|
|
140
|
-
const checked = e.target.checked;
|
|
141
|
-
(0, peers_sdk_1.autoUpdatePeersCore)(checked);
|
|
142
|
-
} }), (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { markdownContent: `When enabled, the peers-core system package is automatically updated from the bundled version on every app startup. Disable this if you want to manage peers-core manually.` })] }));
|
|
143
|
-
};
|
|
144
137
|
const ResetDeviceSyncInfos = () => {
|
|
145
138
|
return ((0, jsx_runtime_1.jsx)("div", { className: "mt-3", children: (0, jsx_runtime_1.jsx)("button", { className: "btn btn-secondary btn-sm ms-2", onClick: async () => {
|
|
146
139
|
try {
|
|
@@ -8,6 +8,7 @@ const hooks_1 = require("../hooks");
|
|
|
8
8
|
const device_pairing_1 = require("./device-pairing");
|
|
9
9
|
const identity_ipc_1 = require("./device-pairing/identity-ipc");
|
|
10
10
|
const color_mode_dropdown_1 = require("./settings/color-mode-dropdown");
|
|
11
|
+
/** Initial account setup, recovery, and pairing with an existing device. */
|
|
11
12
|
const SetupUser = () => {
|
|
12
13
|
const [_colorMode] = (0, hooks_1.useObservable)(color_mode_dropdown_1.colorMode);
|
|
13
14
|
const [step, _setStep] = (0, react_1.useState)("select-user-type");
|
|
@@ -68,34 +69,34 @@ const SetupUser = () => {
|
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
71
|
if (showPairing) {
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "container-fluid d-flex align-items-start justify-content-center", style: { paddingTop: "20px", backgroundColor: isDark ? "#212529" : "
|
|
72
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "container-fluid d-flex align-items-start justify-content-center", style: { paddingTop: "20px", backgroundColor: isDark ? "#212529" : "var(--bs-body-bg)" }, children: (0, jsx_runtime_1.jsx)("div", { className: "card shadow", style: {
|
|
72
73
|
maxWidth: "560px",
|
|
73
74
|
width: "100%",
|
|
74
|
-
backgroundColor: isDark ? "#2d3238" : "
|
|
75
|
+
backgroundColor: isDark ? "#2d3238" : "var(--peers-surface-bg)",
|
|
75
76
|
}, children: (0, jsx_runtime_1.jsx)("div", { className: "card-body p-4 p-md-5", children: (0, jsx_runtime_1.jsx)(device_pairing_1.DestinationDevicePairing, { onBack: () => setShowPairing(false) }) }) }) }));
|
|
76
77
|
}
|
|
77
78
|
// Step 1: Select User Type
|
|
78
79
|
if (step === "select-user-type" && isExistingUser === null) {
|
|
79
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "container-fluid d-flex align-items-start justify-content-center", style: { paddingTop: "20px", backgroundColor: isDark ? "#212529" : "
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "container-fluid d-flex align-items-start justify-content-center", style: { paddingTop: "20px", backgroundColor: isDark ? "#212529" : "var(--bs-body-bg)" }, children: (0, jsx_runtime_1.jsx)("div", { className: "card shadow", style: {
|
|
80
81
|
maxWidth: "500px",
|
|
81
82
|
width: "100%",
|
|
82
|
-
backgroundColor: isDark ? "#2d3238" : "
|
|
83
|
+
backgroundColor: isDark ? "#2d3238" : "var(--peers-surface-bg)",
|
|
83
84
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "card-body p-4 p-md-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center mb-4", children: [(0, jsx_runtime_1.jsx)("h2", { className: `fw-bold mb-2 ${isDark ? "text-light" : ""}`, children: "Welcome to Peers" }), (0, jsx_runtime_1.jsx)("p", { className: isDark ? "text-light opacity-75" : "text-muted", children: "Let's get you set up" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "d-grid gap-3", children: [(0, jsx_runtime_1.jsx)("button", { className: "btn btn-lg btn-primary py-3", onClick: () => setIsExistingUser(false), children: (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-center", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-person-plus fs-4 me-2" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-start", children: [(0, jsx_runtime_1.jsx)("div", { className: "fw-semibold", children: "New account" }), (0, jsx_runtime_1.jsx)("small", { className: "opacity-75", children: "Create a new account on this device" })] })] }) }), (0, jsx_runtime_1.jsx)("button", { className: `btn btn-lg py-3 ${isDark ? "btn-outline-light" : "btn-outline-primary"}`, onClick: () => setShowPairing(true), children: (0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center justify-content-center", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-phone fs-4 me-2" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-start", children: [(0, jsx_runtime_1.jsx)("div", { className: "fw-semibold", children: "Sign in from another device" }), (0, jsx_runtime_1.jsx)("small", { className: "opacity-75", children: "Show a code to a device that is already signed in" })] })] }) }), (0, jsx_runtime_1.jsxs)("details", { className: "text-center mt-2", children: [(0, jsx_runtime_1.jsx)("summary", { className: `small ${isDark ? "text-light opacity-75" : "text-muted"}`, style: { cursor: "pointer" }, children: "Advanced" }), (0, jsx_runtime_1.jsxs)("button", { type: "button", className: `btn btn-sm mt-2 ${isDark ? "btn-outline-light" : "btn-outline-secondary"}`, onClick: () => setIsExistingUser(true), children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-key me-1" }), "Enter a user ID and secret key"] })] })] })] }) }) }));
|
|
84
85
|
}
|
|
85
86
|
// Step 2: New User Confirmation
|
|
86
87
|
if (isExistingUser === false) {
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "container-fluid d-flex align-items-start justify-content-center", style: { paddingTop: "20px", backgroundColor: isDark ? "#212529" : "
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "container-fluid d-flex align-items-start justify-content-center", style: { paddingTop: "20px", backgroundColor: isDark ? "#212529" : "var(--bs-body-bg)" }, children: (0, jsx_runtime_1.jsx)("div", { className: "card shadow", style: {
|
|
88
89
|
maxWidth: "500px",
|
|
89
90
|
width: "100%",
|
|
90
|
-
backgroundColor: isDark ? "#2d3238" : "
|
|
91
|
+
backgroundColor: isDark ? "#2d3238" : "var(--peers-surface-bg)",
|
|
91
92
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "card-body p-4 p-md-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center mb-4", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-person-plus-fill text-primary fs-1 mb-3 d-block" }), (0, jsx_runtime_1.jsx)("h3", { className: `fw-bold mb-2 ${isDark ? "text-light" : ""}`, children: "Create New Account" }), (0, jsx_runtime_1.jsx)("p", { className: isDark ? "text-light opacity-75" : "text-muted", children: "We'll generate secure credentials for you" })] }), error && ((0, jsx_runtime_1.jsxs)("div", { className: "alert alert-danger", role: "alert", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-exclamation-triangle me-2" }), error] })), (0, jsx_runtime_1.jsxs)("div", { className: "d-grid gap-2", children: [(0, jsx_runtime_1.jsx)("button", { className: "btn btn-lg btn-primary", onClick: handleNewUser, disabled: isValidating, children: isValidating ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { className: "spinner-border spinner-border-sm me-2" }), "Creating Account..."] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-check-circle me-2" }), "Create Account"] })) }), (0, jsx_runtime_1.jsxs)("button", { className: "btn btn-outline-secondary", onClick: () => setIsExistingUser(null), disabled: isValidating, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-arrow-left me-2" }), "Back"] })] })] }) }) }));
|
|
92
93
|
}
|
|
93
94
|
// Step 3: Existing User Sign In
|
|
94
95
|
if (isExistingUser === true) {
|
|
95
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "container-fluid d-flex align-items-start justify-content-center", style: { paddingTop: "20px", backgroundColor: isDark ? "#212529" : "
|
|
96
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "container-fluid d-flex align-items-start justify-content-center", style: { paddingTop: "20px", backgroundColor: isDark ? "#212529" : "var(--bs-body-bg)" }, children: (0, jsx_runtime_1.jsx)("div", { className: "card shadow", style: {
|
|
96
97
|
maxWidth: "500px",
|
|
97
98
|
width: "100%",
|
|
98
|
-
backgroundColor: isDark ? "#2d3238" : "
|
|
99
|
+
backgroundColor: isDark ? "#2d3238" : "var(--peers-surface-bg)",
|
|
99
100
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "card-body p-4 p-md-5", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center mb-2", children: [(0, jsx_runtime_1.jsxs)("h3", { className: `fw-bold mb-2 ${isDark ? "text-light" : ""}`, children: [(0, jsx_runtime_1.jsx)("span", { children: "Sign In" }), "\u00A0\u00A0", (0, jsx_runtime_1.jsx)("i", { className: "bi bi-box-arrow-in-right text-primary" })] }), (0, jsx_runtime_1.jsx)("p", { className: isDark ? "text-light opacity-75" : "text-muted", children: "Paste your user ID and secret key. If you have another signed-in device, \u201CSign in from another device\u201D is easier and safer." })] }), error && ((0, jsx_runtime_1.jsxs)("div", { className: "alert alert-danger", role: "alert", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi bi-exclamation-triangle me-2" }), error] })), (0, jsx_runtime_1.jsxs)("form", { onSubmit: (e) => {
|
|
100
101
|
e.preventDefault();
|
|
101
102
|
handleExistingUser();
|