@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
|
@@ -108,33 +108,33 @@ function WelcomeModal({ colorMode, onClose }) {
|
|
|
108
108
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
109
109
|
backdropFilter: "blur(4px)",
|
|
110
110
|
paddingTop: "10vh",
|
|
111
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { className: `${isDark ? "bg-dark text-light" : "
|
|
111
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: `${isDark ? "bg-dark text-light" : "peers-surface text-body"}`, style: {
|
|
112
112
|
width: "90%",
|
|
113
113
|
maxWidth: "500px",
|
|
114
114
|
borderRadius: "12px",
|
|
115
115
|
boxShadow: isDark ? "0 20px 40px rgba(0, 0, 0, 0.5)" : "0 20px 40px rgba(0, 0, 0, 0.1)",
|
|
116
|
-
border: isDark ? "1px solid #495057" : "1px solid
|
|
116
|
+
border: isDark ? "1px solid #495057" : "1px solid var(--peers-surface-border)",
|
|
117
117
|
overflow: "hidden",
|
|
118
118
|
}, children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 text-center", style: {
|
|
119
|
-
borderBottom: `1px solid ${isDark ? "#495057" : "
|
|
119
|
+
borderBottom: `1px solid ${isDark ? "#495057" : "var(--peers-surface-border)"}`,
|
|
120
120
|
}, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-person-circle text-primary d-block mb-3", style: { fontSize: "48px" } }), (0, jsx_runtime_1.jsx)("h4", { className: "mb-2", children: "Welcome to Peers!" }), (0, jsx_runtime_1.jsx)("p", { className: `mb-0 ${isDark ? "text-light opacity-75" : "text-muted"}`, style: { fontSize: "14px" }, children: "Let's personalize your experience. You can change these anytime in Settings." })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4", children: [error && ((0, jsx_runtime_1.jsxs)("div", { className: "alert alert-danger py-2 px-3 mb-3", style: { fontSize: "14px" }, children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-exclamation-triangle me-2" }), error] })), (0, jsx_runtime_1.jsxs)("div", { className: "mb-3", children: [(0, jsx_runtime_1.jsxs)("label", { className: "form-label fw-semibold mb-1", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-person me-2" }), "Display Name"] }), (0, jsx_runtime_1.jsx)("input", { type: "text", className: `form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`, maxLength: peers_sdk_1.DISPLAY_NAME_MAX_LENGTH, placeholder: "How should others see you?", value: displayName, onChange: (e) => {
|
|
121
121
|
setDisplayName(e.target.value);
|
|
122
122
|
setError(null);
|
|
123
123
|
}, onKeyDown: handleKeyDown, disabled: isSaving, style: {
|
|
124
124
|
fontSize: "14px",
|
|
125
|
-
backgroundColor: isDark ? "#343a40" : "
|
|
125
|
+
backgroundColor: isDark ? "#343a40" : "var(--peers-surface-bg)",
|
|
126
126
|
} }), (0, jsx_runtime_1.jsx)("small", { className: isDark ? "text-light opacity-50" : "text-muted", style: { fontSize: "11px" }, children: "This name will be visible to others when you connect" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "mb-3", children: [(0, jsx_runtime_1.jsxs)("label", { className: "form-label fw-semibold mb-1", children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-laptop me-2" }), "Device Name"] }), (0, jsx_runtime_1.jsx)("input", { type: "text", className: `form-control ${isDark ? "bg-dark text-light border-secondary" : ""}`, maxLength: peers_sdk_1.DISPLAY_NAME_MAX_LENGTH, placeholder: "e.g., My Laptop, Work Computer", value: deviceName, onChange: (e) => {
|
|
127
127
|
setDeviceName(e.target.value);
|
|
128
128
|
setError(null);
|
|
129
129
|
}, onKeyDown: handleKeyDown, disabled: isSaving, style: {
|
|
130
130
|
fontSize: "14px",
|
|
131
|
-
backgroundColor: isDark ? "#343a40" : "
|
|
131
|
+
backgroundColor: isDark ? "#343a40" : "var(--peers-surface-bg)",
|
|
132
132
|
} }), (0, jsx_runtime_1.jsx)("small", { className: isDark ? "text-light opacity-50" : "text-muted", style: { fontSize: "11px" }, children: "Helps you identify this device when syncing across multiple devices" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 d-flex justify-content-between align-items-center", style: {
|
|
133
|
-
borderTop: `1px solid ${isDark ? "#495057" : "
|
|
134
|
-
backgroundColor: isDark ? "#2d3238" : "
|
|
133
|
+
borderTop: `1px solid ${isDark ? "#495057" : "var(--peers-surface-border)"}`,
|
|
134
|
+
backgroundColor: isDark ? "#2d3238" : "var(--peers-surface-bg)",
|
|
135
135
|
}, children: [(0, jsx_runtime_1.jsx)("button", { className: `btn btn-sm ${isDark ? "btn-outline-light" : "btn-outline-secondary"}`, onClick: handleSkip, disabled: isSaving, children: "Skip for now" }), (0, jsx_runtime_1.jsx)("button", { className: "btn btn-sm btn-primary", onClick: handleSave, disabled: isSaving, style: { minWidth: "100px" }, children: isSaving ? ((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" }), "Saving..."] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "bi-check-lg me-1" }), "Get Started"] })) })] }), (0, jsx_runtime_1.jsxs)("div", { className: `px-3 py-2 small text-center ${isDark ? "text-light opacity-50" : "text-muted"}`, style: {
|
|
136
|
-
borderTop: `1px solid ${isDark ? "#495057" : "
|
|
136
|
+
borderTop: `1px solid ${isDark ? "#495057" : "var(--peers-surface-border)"}`,
|
|
137
137
|
fontSize: "11px",
|
|
138
|
-
backgroundColor: isDark ? "#212529" : "
|
|
138
|
+
backgroundColor: isDark ? "#212529" : "var(--peers-surface-bg)",
|
|
139
139
|
}, children: [(0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "\u21B5" }), " to save \u2022 ", (0, jsx_runtime_1.jsx)("kbd", { className: "small", children: "esc" }), " to skip"] })] }) }));
|
|
140
140
|
}
|
|
@@ -148,24 +148,26 @@ function TabsLayoutInternal({ fillContainer = false } = {}) {
|
|
|
148
148
|
display: "flex",
|
|
149
149
|
alignItems: "center",
|
|
150
150
|
justifyContent: "center",
|
|
151
|
-
backgroundColor: _colorMode === "light" ? "rgba(
|
|
152
|
-
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "spinner-border text-secondary mb-3", role: "status" }), (0, jsx_runtime_1.jsx)("div", { className: `small ${_colorMode === "light" ? "text-muted" : "text-secondary"}`, children: "Switching group..." })] }) })), (0, jsx_runtime_1.jsx)("div", { className: `border-bottom ${_colorMode === "light" ? "
|
|
151
|
+
backgroundColor: _colorMode === "light" ? "rgba(var(--bs-body-bg-rgb), 0.85)" : "rgba(0,0,0,0.85)",
|
|
152
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "spinner-border text-secondary mb-3", role: "status" }), (0, jsx_runtime_1.jsx)("div", { className: `small ${_colorMode === "light" ? "text-muted" : "text-secondary"}`, children: "Switching group..." })] }) })), (0, jsx_runtime_1.jsx)("div", { className: `border-bottom peers-tab-strip ${_colorMode === "light" ? "" : "bg-dark"}`, style: {
|
|
153
153
|
borderBottomWidth: "1px",
|
|
154
|
-
borderBottomColor: _colorMode === "light" ? "
|
|
154
|
+
borderBottomColor: _colorMode === "light" ? "var(--peers-tab-edge)" : "#495057",
|
|
155
155
|
}, children: isMobile ? ((0, jsx_runtime_1.jsx)(MobileTabsHeader, { tabs: tabs, activeTab: activeTab, onSwitch: switchTab, onClose: closeTab, colorMode: _colorMode })) : ((0, jsx_runtime_1.jsxs)("div", { className: "d-flex align-items-center px-1", style: { height: "36px" }, children: [(0, jsx_runtime_1.jsx)(group_switcher_1.GroupSwitcher, { colorMode: _colorMode, isMobile: false }), (0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn btn-sm me-2 d-flex align-items-center", onClick: command_palette_1.openCommandPalette, title: "Search everything (Cmd+K)", style: {
|
|
156
156
|
padding: "4px 8px",
|
|
157
157
|
fontSize: "12px",
|
|
158
158
|
borderRadius: "6px",
|
|
159
159
|
border: "none",
|
|
160
160
|
background: "transparent",
|
|
161
|
-
color: _colorMode === "light" ? "
|
|
161
|
+
color: _colorMode === "light" ? "var(--peers-tab-icon-color)" : "#adb5bd",
|
|
162
162
|
}, onMouseEnter: (e) => {
|
|
163
163
|
e.currentTarget.style.backgroundColor =
|
|
164
|
-
_colorMode === "light" ? "
|
|
165
|
-
e.currentTarget.style.color =
|
|
164
|
+
_colorMode === "light" ? "var(--peers-tab-hover-bg)" : "#495057";
|
|
165
|
+
e.currentTarget.style.color =
|
|
166
|
+
_colorMode === "light" ? "var(--bs-link-color)" : "#ffffff";
|
|
166
167
|
}, onMouseLeave: (e) => {
|
|
167
168
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
168
|
-
e.currentTarget.style.color =
|
|
169
|
+
e.currentTarget.style.color =
|
|
170
|
+
_colorMode === "light" ? "var(--peers-tab-icon-color)" : "#adb5bd";
|
|
169
171
|
}, children: (0, jsx_runtime_1.jsx)("i", { className: "bi-search", style: { fontSize: "14px" } }) }), (0, jsx_runtime_1.jsx)("div", { className: "d-flex flex-grow-1 overflow-auto", style: {
|
|
170
172
|
scrollbarWidth: "none",
|
|
171
173
|
msOverflowStyle: "none",
|
|
@@ -205,39 +207,31 @@ function MobileTabsHeader({ tabs, activeTab, onSwitch, onClose, colorMode, }) {
|
|
|
205
207
|
}, children: (0, jsx_runtime_1.jsx)("i", { className: "bi-x" }) })] }, tab.tabId)))] }))] })] }), showMenuDropdown && ((0, jsx_runtime_1.jsx)("div", { className: "position-fixed w-100 h-100", style: { top: 0, left: 0, zIndex: 999 }, onClick: () => setShowMenuDropdown(false) }))] }));
|
|
206
208
|
}
|
|
207
209
|
function TabHeader({ tab, isActive, onSwitch, onClose, colorMode }) {
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
: "bg-secondary"
|
|
212
|
-
: colorMode === "light"
|
|
213
|
-
? "bg-light"
|
|
214
|
-
: "bg-dark";
|
|
215
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: `d-flex align-items-center px-2 py-1 user-select-none ${activeClass}`, style: {
|
|
210
|
+
const isLight = colorMode === "light";
|
|
211
|
+
const activeClass = isLight ? "" : isActive ? "bg-secondary" : "bg-dark";
|
|
212
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `peers-tab ${isActive ? "peers-tab-active" : ""} d-flex align-items-center px-2 py-1 user-select-none ${activeClass}`, style: {
|
|
216
213
|
cursor: "pointer",
|
|
217
214
|
minWidth: "100px",
|
|
218
215
|
maxWidth: "180px",
|
|
219
216
|
height: "34px",
|
|
220
217
|
fontSize: "13px",
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
? "1px solid white"
|
|
227
|
-
: "1px solid #343a40"
|
|
228
|
-
: "none",
|
|
218
|
+
backgroundColor: isLight ? "var(--peers-tab-bg)" : undefined,
|
|
219
|
+
borderTop: isLight ? undefined : isActive ? "2px solid #0d6efd" : "2px solid transparent",
|
|
220
|
+
borderLeft: isLight ? undefined : "1px solid transparent",
|
|
221
|
+
borderRight: isLight ? undefined : "1px solid #495057",
|
|
222
|
+
borderBottom: isLight ? undefined : isActive ? "1px solid #343a40" : "none",
|
|
229
223
|
marginBottom: isActive ? "-1px" : "0",
|
|
230
224
|
borderRadius: isActive ? "6px 6px 0 0" : "0",
|
|
231
225
|
transition: "all 0.15s ease",
|
|
232
226
|
zIndex: isActive ? 1 : 0,
|
|
233
|
-
boxShadow: isActive ? "0 2px 4px rgba(0,0,0,0.1)" : "none",
|
|
227
|
+
boxShadow: isLight ? undefined : isActive ? "0 2px 4px rgba(0,0,0,0.1)" : "none",
|
|
234
228
|
}, onMouseEnter: (e) => {
|
|
235
|
-
if (!isActive) {
|
|
236
|
-
e.currentTarget.style.backgroundColor =
|
|
229
|
+
if (!isActive && !isLight) {
|
|
230
|
+
e.currentTarget.style.backgroundColor = "#495057";
|
|
237
231
|
}
|
|
238
232
|
}, onMouseLeave: (e) => {
|
|
239
|
-
if (!isActive) {
|
|
240
|
-
e.currentTarget.style.backgroundColor =
|
|
233
|
+
if (!isActive && !isLight) {
|
|
234
|
+
e.currentTarget.style.backgroundColor = "#343a40";
|
|
241
235
|
}
|
|
242
236
|
}, onClick: () => onSwitch(tab.tabId), children: [tab.iconClassName && (0, jsx_runtime_1.jsx)("i", { className: `${tab.iconClassName} me-2` }), (0, jsx_runtime_1.jsx)("span", { className: "text-truncate", style: { maxWidth: "120px", fontSize: "12px" }, children: tab.title }), tab.tabId !== "launcher" && ((0, jsx_runtime_1.jsx)("button", { type: "button", className: "btn p-0 ms-1 opacity-75 hover-opacity-100", style: {
|
|
243
237
|
width: "14px",
|
|
@@ -395,15 +389,15 @@ function AppCard({ appItem, onOpenApp, isMobile }) {
|
|
|
395
389
|
}, onClick: () => onOpenApp(appItem), children: [(0, jsx_runtime_1.jsx)("div", { className: "d-flex align-items-center justify-content-center mb-2", style: {
|
|
396
390
|
width: isMobile ? "64px" : "72px",
|
|
397
391
|
height: isMobile ? "64px" : "72px",
|
|
398
|
-
backgroundColor: isDark ? "#343a40" : "
|
|
392
|
+
backgroundColor: isDark ? "#343a40" : "var(--peers-surface-bg)",
|
|
399
393
|
borderRadius: "12px",
|
|
400
|
-
border: `1px solid ${isDark ? "#495057" : "
|
|
394
|
+
border: `1px solid ${isDark ? "#495057" : "var(--peers-surface-border)"}`,
|
|
401
395
|
boxShadow: isDark ? "0 2px 4px rgba(0,0,0,0.3)" : "0 2px 4px rgba(0,0,0,0.08)",
|
|
402
396
|
transition: "all 0.15s ease",
|
|
403
397
|
}, children: (0, jsx_runtime_1.jsx)("i", { className: appItem.iconClassName, style: {
|
|
404
398
|
fontSize: isMobile ? "28px" : "32px",
|
|
405
399
|
color: isDark ? "#0d6efd" : "#0d6efd",
|
|
406
|
-
} }) }), (0, jsx_runtime_1.jsx)("span", { className: isDark ? "text-light" : "text-
|
|
400
|
+
} }) }), (0, jsx_runtime_1.jsx)("span", { className: isDark ? "text-light" : "text-body", style: {
|
|
407
401
|
fontSize: isMobile ? "11px" : "12px",
|
|
408
402
|
fontWeight: "500",
|
|
409
403
|
lineHeight: "1.2",
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/* Shared light palette. Import after Bootstrap in every platform host. */
|
|
2
|
+
[data-bs-theme="light"] {
|
|
3
|
+
--bs-body-bg: #e5e9ed;
|
|
4
|
+
--bs-body-bg-rgb: 229, 233, 237;
|
|
5
|
+
--bs-body-color: #242a31;
|
|
6
|
+
--bs-body-color-rgb: 36, 42, 49;
|
|
7
|
+
--bs-secondary-color: #5f6974;
|
|
8
|
+
--bs-secondary-color-rgb: 95, 105, 116;
|
|
9
|
+
--bs-border-color: #c7ced6;
|
|
10
|
+
--bs-link-color: #2a63cb;
|
|
11
|
+
--bs-link-color-rgb: 42, 99, 203;
|
|
12
|
+
--bs-link-hover-color: var(--bs-link-color);
|
|
13
|
+
--bs-link-hover-color-rgb: var(--bs-link-color-rgb);
|
|
14
|
+
|
|
15
|
+
--peers-surface-bg: #fbfcfd;
|
|
16
|
+
--peers-surface-border: #d0d7de;
|
|
17
|
+
--peers-tab-strip-bg: #d0d6dd;
|
|
18
|
+
--peers-tab-edge: #b8c1ca;
|
|
19
|
+
--peers-tab-strip-color: #283037;
|
|
20
|
+
--peers-tab-icon-color: #56616d;
|
|
21
|
+
--peers-tab-color: #4f5a66;
|
|
22
|
+
--peers-tab-hover-bg: rgba(255, 255, 255, 0.42);
|
|
23
|
+
--peers-tab-divider: #bcc5ce;
|
|
24
|
+
--peers-tab-active-color: #1e242a;
|
|
25
|
+
--peers-tab-accent: #2f6fde;
|
|
26
|
+
--peers-tab-active-shadow: 0 -1px 3px rgba(30, 40, 55, 0.09);
|
|
27
|
+
--peers-graph-overlay-color: rgba(36, 42, 49, 0.32);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Bootstrap declares these variables locally, so override them on each component. */
|
|
31
|
+
[data-bs-theme="light"] .card {
|
|
32
|
+
--bs-card-bg: var(--peers-surface-bg);
|
|
33
|
+
--bs-card-border-color: var(--peers-surface-border);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-bs-theme="light"] .dropdown-menu {
|
|
37
|
+
--bs-dropdown-bg: var(--peers-surface-bg);
|
|
38
|
+
--bs-dropdown-border-color: var(--peers-surface-border);
|
|
39
|
+
--bs-dropdown-divider-bg: var(--peers-surface-border);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[data-bs-theme="light"] .modal {
|
|
43
|
+
--bs-modal-bg: var(--peers-surface-bg);
|
|
44
|
+
--bs-modal-border-color: var(--peers-surface-border);
|
|
45
|
+
--bs-modal-header-border-color: var(--peers-surface-border);
|
|
46
|
+
--bs-modal-footer-border-color: var(--peers-surface-border);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-bs-theme="light"] .list-group {
|
|
50
|
+
--bs-list-group-bg: var(--peers-surface-bg);
|
|
51
|
+
--bs-list-group-border-color: var(--peers-surface-border);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[data-bs-theme="light"] .popover {
|
|
55
|
+
--bs-popover-bg: var(--peers-surface-bg);
|
|
56
|
+
--bs-popover-border-color: var(--peers-surface-border);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-bs-theme="light"] .toast {
|
|
60
|
+
--bs-toast-bg: var(--peers-surface-bg);
|
|
61
|
+
--bs-toast-border-color: var(--peers-surface-border);
|
|
62
|
+
--bs-toast-header-bg: var(--peers-surface-bg);
|
|
63
|
+
--bs-toast-header-border-color: var(--peers-surface-border);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[data-bs-theme="light"]
|
|
67
|
+
:is(.offcanvas, .offcanvas-sm, .offcanvas-md, .offcanvas-lg, .offcanvas-xl, .offcanvas-xxl) {
|
|
68
|
+
--bs-offcanvas-bg: var(--peers-surface-bg);
|
|
69
|
+
--bs-offcanvas-border-color: var(--peers-surface-border);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[data-bs-theme="light"] :is(.form-control, .form-select):not(:disabled) {
|
|
73
|
+
background-color: var(--peers-surface-bg);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Keep Bootstrap's focus and validation borders. */
|
|
77
|
+
[data-bs-theme="light"]
|
|
78
|
+
:where(.form-control, .form-select):where(:not(:focus):not(.is-valid):not(.is-invalid)) {
|
|
79
|
+
border-color: var(--peers-surface-border);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[data-bs-theme="light"] .nav-tabs {
|
|
83
|
+
--bs-nav-tabs-link-active-bg: var(--bs-body-bg);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Custom panels that do not use Bootstrap's component markup. */
|
|
87
|
+
[data-bs-theme="light"] .peers-surface {
|
|
88
|
+
/* The tooltip also uses Bootstrap's bg-light-subtle utility. */
|
|
89
|
+
--bs-light-bg-subtle: var(--peers-surface-bg);
|
|
90
|
+
background-color: var(--peers-surface-bg);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-bs-theme="light"] .peers-table-surface {
|
|
94
|
+
--bs-table-bg: var(--peers-surface-bg);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[data-bs-theme="light"] .peers-tab-strip {
|
|
98
|
+
--bs-border-color: var(--peers-tab-edge);
|
|
99
|
+
background-color: var(--peers-tab-strip-bg);
|
|
100
|
+
color: var(--peers-tab-strip-color);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-bs-theme="light"] .peers-tab {
|
|
104
|
+
--peers-tab-bg: transparent;
|
|
105
|
+
background-color: var(--peers-tab-bg);
|
|
106
|
+
color: var(--peers-tab-color);
|
|
107
|
+
border-top: 2px solid transparent;
|
|
108
|
+
border-left: 1px solid transparent;
|
|
109
|
+
border-right: 1px solid var(--peers-tab-divider);
|
|
110
|
+
border-bottom: none;
|
|
111
|
+
box-shadow: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
[data-bs-theme="light"] .peers-tab:not(.peers-tab-active):hover {
|
|
115
|
+
--peers-tab-bg: var(--peers-tab-hover-bg);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[data-bs-theme="light"] .peers-tab-active {
|
|
119
|
+
--peers-tab-bg: var(--bs-body-bg);
|
|
120
|
+
color: var(--peers-tab-active-color);
|
|
121
|
+
border-top: 2px solid var(--peers-tab-accent);
|
|
122
|
+
border-left-color: var(--peers-tab-edge);
|
|
123
|
+
border-right-color: var(--peers-tab-edge);
|
|
124
|
+
border-bottom: 1px solid var(--bs-body-bg);
|
|
125
|
+
box-shadow: var(--peers-tab-active-shadow);
|
|
126
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peers-app/peers-ui",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/peers-app/peers-ui.git"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"clean": "rm -rf dist",
|
|
23
|
-
"build": "npm run clean && tsc",
|
|
23
|
+
"build": "npm run clean && tsc && cp src/theme.css dist/theme.css",
|
|
24
24
|
"dev": "tsc -w",
|
|
25
25
|
"clean:build": "npm run clean && npm run build",
|
|
26
26
|
"release:guard": "node release-guard.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"lint:fix": "biome check --write ."
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@peers-app/peers-sdk": "^0.28.
|
|
39
|
+
"@peers-app/peers-sdk": "^0.28.6",
|
|
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.28.
|
|
50
|
+
"@peers-app/peers-sdk": "0.28.6",
|
|
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,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToolTestDetails = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
6
|
-
const loading_indicator_1 = require("../../components/loading-indicator");
|
|
7
|
-
const editor_1 = require("../../components/markdown-editor/editor");
|
|
8
|
-
const save_button_1 = require("../../components/save-button");
|
|
9
|
-
const hooks_1 = require("../../hooks");
|
|
10
|
-
const tabs_state_1 = require("../../tabs-layout/tabs-state");
|
|
11
|
-
const ToolTestDetails = (props) => {
|
|
12
|
-
const { toolTestId } = props;
|
|
13
|
-
const tool = (0, hooks_1.useObservableState)(undefined);
|
|
14
|
-
const toolTest = (0, hooks_1.usePromise)(async () => {
|
|
15
|
-
const toolTestData = await (0, peers_sdk_1.ToolTests)().get(toolTestId);
|
|
16
|
-
if (!toolTestData)
|
|
17
|
-
return null;
|
|
18
|
-
const _tool = await (0, peers_sdk_1.Tools)().get(toolTestData.toolId);
|
|
19
|
-
tool(_tool);
|
|
20
|
-
const doc = (0, peers_sdk_1.ToolTests)().initDoc(toolTestData);
|
|
21
|
-
(0, tabs_state_1.updateActiveTabTitle)(_tool?.name ? `${_tool.name} Test` : "Tool Test");
|
|
22
|
-
return doc;
|
|
23
|
-
});
|
|
24
|
-
if (toolTest === null) {
|
|
25
|
-
return (0, jsx_runtime_1.jsx)("div", { children: "ToolTest not found" });
|
|
26
|
-
}
|
|
27
|
-
if (!toolTest) {
|
|
28
|
-
return (0, jsx_runtime_1.jsx)(loading_indicator_1.LoadingIndicator, {});
|
|
29
|
-
}
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "container-fluid mt-2", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("a", { href: `#tools/${toolTest.toolId}`, children: ["Tool: ", tool()?.name] }), (0, jsx_runtime_1.jsx)("div", { className: "float-end", children: (0, jsx_runtime_1.jsx)(save_button_1.SaveButton, { doc: toolTest }) })] }), (0, jsx_runtime_1.jsxs)("div", { style: { height: "calc(100vh - 55px)", overflowY: "auto", width: "100%" }, children: [(0, jsx_runtime_1.jsx)("small", { children: "Test description:" }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
31
|
-
border: "1px solid #ccc",
|
|
32
|
-
borderRadius: "5px",
|
|
33
|
-
}, children: (0, jsx_runtime_1.jsx)(editor_1.MarkdownEditor, { value: toolTest.qs.description, hideToolbar: true }) }), (0, jsx_runtime_1.jsx)("small", { children: "Code:" }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
34
|
-
border: "1px solid #ccc",
|
|
35
|
-
borderRadius: "5px",
|
|
36
|
-
}, children: (0, jsx_runtime_1.jsx)(editor_1.MarkdownEditor, { value: toolTest.qs.code, hideToolbar: true }) })] })] }));
|
|
37
|
-
};
|
|
38
|
-
exports.ToolTestDetails = ToolTestDetails;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ToolTestList = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const peers_sdk_1 = require("@peers-app/peers-sdk");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const input_1 = require("../../components/input");
|
|
8
|
-
const globals_1 = require("../../globals");
|
|
9
|
-
const hooks_1 = require("../../hooks");
|
|
10
|
-
const ToolTestList = (props) => {
|
|
11
|
-
const { toolId } = props;
|
|
12
|
-
const testsObs = (0, hooks_1.useObservableState)([]);
|
|
13
|
-
const searchText = (0, hooks_1.useObservableState)("");
|
|
14
|
-
(0, react_1.useEffect)(() => {
|
|
15
|
-
(0, peers_sdk_1.ToolTests)()
|
|
16
|
-
.list({ toolId })
|
|
17
|
-
.then((tests) => {
|
|
18
|
-
testsObs(tests);
|
|
19
|
-
});
|
|
20
|
-
}, [toolId, testsObs]);
|
|
21
|
-
const tests = testsObs().filter((test) => test.description.toLowerCase().includes(searchText().toLowerCase()));
|
|
22
|
-
async function createTest(evt) {
|
|
23
|
-
if (evt.key !== "Enter")
|
|
24
|
-
return;
|
|
25
|
-
evt.preventDefault();
|
|
26
|
-
// TODO maybe use LLM call to do this?
|
|
27
|
-
const test = await (0, peers_sdk_1.ToolTests)().insert({
|
|
28
|
-
toolTestId: (0, peers_sdk_1.newid)(),
|
|
29
|
-
toolId,
|
|
30
|
-
description: searchText(),
|
|
31
|
-
code: "",
|
|
32
|
-
input: {},
|
|
33
|
-
output: {},
|
|
34
|
-
});
|
|
35
|
-
testsObs([...tests, test]);
|
|
36
|
-
searchText("");
|
|
37
|
-
(0, globals_1.mainContentPath)(`tools/tests/${test.toolTestId}`);
|
|
38
|
-
}
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(input_1.Input, { className: "form-control mb-2", value: searchText, onKeyDown: createTest, placeholder: "Search or create new test" }), testsObs().length === 0 && ((0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("p", { children: "No test for this tool yet" }) })), testsObs().length !== 0 && tests.length === 0 && ((0, jsx_runtime_1.jsx)("div", { className: "text-center", children: (0, jsx_runtime_1.jsx)("p", { children: "No matching tests found" }) })), tests.map((test, iTest) => {
|
|
40
|
-
return ((0, jsx_runtime_1.jsx)("p", { onDoubleClick: (_e) => (0, globals_1.mainContentPath)(`tools/tests/${test.toolTestId}`), children: test.description.split("\n")[0] }, iTest));
|
|
41
|
-
})] }));
|
|
42
|
-
};
|
|
43
|
-
exports.ToolTestList = ToolTestList;
|