@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.41
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/LICENSE.md +6 -0
- package/__assets__/package-og.svg +1 -1
- package/dist/index.d.ts +33 -18
- package/dist/index.js +29 -29
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +3 -2
- package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
- package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
- package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
- package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
- package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
- package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
- package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
- package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
- package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
- package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
- package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
- package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
- package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
- package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
- package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
- package/dist/packem_chunks/SettingsPanel.js +391 -0
- package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +158 -387
- package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
- package/dist/packem_chunks/analytics-panel.js +261 -0
- package/dist/packem_chunks/auth-config-panel.js +365 -0
- package/dist/packem_chunks/auth-sessions-panel.js +175 -0
- package/dist/packem_chunks/containers-panel.js +247 -0
- package/dist/packem_chunks/dashboards-panel.js +780 -0
- package/dist/packem_chunks/fanout-panel.js +482 -0
- package/dist/packem_chunks/flags-panel.js +176 -0
- package/dist/packem_chunks/kv-browser.js +1896 -0
- package/dist/packem_chunks/log-drains-panel.js +273 -0
- package/dist/packem_chunks/organizations-panel.js +3178 -0
- package/dist/packem_chunks/payments-panel.js +186 -0
- package/dist/packem_chunks/permissions-panel.js +805 -0
- package/dist/packem_chunks/queues-panel.js +1075 -0
- package/dist/packem_chunks/rls-panel.js +315 -0
- package/dist/packem_chunks/schedule-panel.js +831 -0
- package/dist/packem_chunks/sparkline.js +79 -0
- package/dist/packem_chunks/storage-rules-panel.js +140 -0
- package/dist/packem_chunks/subscriptions-panel.js +238 -0
- package/dist/packem_chunks/users-panel.js +1731 -0
- package/dist/packem_chunks/vector-browser.js +281 -0
- package/dist/packem_chunks/workflows-panel.js +562 -0
- package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-BHHJi3Gb.js} +7 -0
- package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-CBma-lnp.js} +2 -2
- package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-CQM3pPN7.js} +2 -1
- package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-X2tkbyHk.js} +1 -1
- package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-D2ywrdId.js} +198 -247
- package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-BkTPLzAY.js} +37 -66
- package/dist/packem_shared/HomePanel-D1Q9LZgK.js +14 -0
- package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-Dno-hfDb.js} +2 -1
- package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-Ctw4jYtU.js} +163 -60
- package/dist/packem_shared/Studio-lJhzDAze.js +16 -0
- package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-DiMkupvZ.js} +276 -11
- package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-BX8OhG0w.js} +6 -6
- package/dist/packem_shared/alert-CdAET2K_.js +68 -0
- package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
- package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
- package/dist/packem_shared/browser-storage-BTrX4y3B.js +215 -0
- package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
- package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-CdXztApG.js} +1 -1
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
- package/dist/packem_shared/error-alert-CXjqyGw9.js +114 -0
- package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-BF-KBDFz.js} +131 -163
- package/dist/packem_shared/home-panel-TFcRf9Ui.js +1889 -0
- package/dist/packem_shared/{internal-rXJEAhXS.js → internal-CYcbqMjX.js} +44 -3
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
- package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUiJcILV.js} +6 -45
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
- package/dist/packem_shared/select-UkNYCT3s.js +273 -0
- package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
- package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
- package/dist/packem_shared/studio-Dh9UlaF_.js +4015 -0
- package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
- package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-UVIXQJdU.js} +1 -1
- package/dist/packem_shared/use-admin-query-CfHYWx5n.js +106 -0
- package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
- package/dist/standalone/chunk-25AYY4H7.js +2 -0
- package/dist/standalone/chunk-2ANAF4ZM.js +1 -0
- package/dist/standalone/chunk-2K47A3P6.js +1 -0
- package/dist/standalone/chunk-2NGUNNGW.js +1 -0
- package/dist/standalone/chunk-3CJW6NWG.js +4 -0
- package/dist/standalone/chunk-3OA7PECS.js +6 -0
- package/dist/standalone/chunk-3OIHOXVV.js +1 -0
- package/dist/standalone/chunk-447TAUFD.js +1 -0
- package/dist/standalone/chunk-4QHKBC77.js +1 -0
- package/dist/standalone/chunk-5C4TSNE6.js +1 -0
- package/dist/standalone/chunk-5OIBXYZM.js +1 -0
- package/dist/standalone/chunk-6HSHEMZV.js +76 -0
- package/dist/standalone/chunk-6JIZ34MB.js +3 -0
- package/dist/standalone/chunk-6VO23MMW.js +4 -0
- package/dist/standalone/chunk-7MVSQS7B.js +1 -0
- package/dist/standalone/chunk-7TJJXVSE.js +1 -0
- package/dist/standalone/chunk-7YXOPTWI.js +1 -0
- package/dist/standalone/chunk-AHILM3ZP.js +1 -0
- package/dist/standalone/chunk-BGXOXASQ.js +1 -0
- package/dist/standalone/chunk-BJGBHGK3.js +1 -0
- package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
- package/dist/standalone/chunk-BX5MKYOC.js +1 -0
- package/dist/standalone/chunk-CKSHCYGC.js +2 -0
- package/dist/standalone/chunk-DWDILV2E.js +1 -0
- package/dist/standalone/chunk-E75ANNWX.js +19 -0
- package/dist/standalone/chunk-EQZQOTJY.js +1 -0
- package/dist/standalone/chunk-GTLEWM5Y.js +1 -0
- package/dist/standalone/chunk-GTM65MVX.js +1 -0
- package/dist/standalone/chunk-GUI5GFFI.js +1 -0
- package/dist/standalone/chunk-HN6KJXYQ.js +1 -0
- package/dist/standalone/chunk-HV7G6DFP.js +5 -0
- package/dist/standalone/chunk-HYDJNCGW.js +1 -0
- package/dist/standalone/chunk-HZK5RQHG.js +1 -0
- package/dist/standalone/chunk-IN2SYVJB.js +1 -0
- package/dist/standalone/chunk-IOANPSJN.js +1 -0
- package/dist/standalone/chunk-ISDZPW3V.js +1 -0
- package/dist/standalone/chunk-IXDH4GL5.js +1 -0
- package/dist/standalone/chunk-J6J54MBP.js +1 -0
- package/dist/standalone/chunk-J73VHFCL.js +1 -0
- package/dist/standalone/chunk-JHKMUTIF.js +13 -0
- package/dist/standalone/chunk-JPRH6DPK.js +1 -0
- package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
- package/dist/standalone/chunk-KA5YB3VP.js +1 -0
- package/dist/standalone/chunk-KBB75WNT.js +1 -0
- package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
- package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
- package/dist/standalone/chunk-KQV4NGH3.js +1 -0
- package/dist/standalone/chunk-KSKXW5PX.js +1 -0
- package/dist/standalone/chunk-KUH4P5F5.js +1 -0
- package/dist/standalone/chunk-KYJPPVGB.js +1 -0
- package/dist/standalone/chunk-KZ6INM5M.js +1 -0
- package/dist/standalone/chunk-L2TJVSDQ.js +1 -0
- package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
- package/dist/standalone/chunk-LAK5VSPI.js +1 -0
- package/dist/standalone/chunk-LBN7LPVK.js +1 -0
- package/dist/standalone/chunk-LNZIB2MD.js +1 -0
- package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
- package/dist/standalone/chunk-MLZYX5CQ.js +1 -0
- package/dist/standalone/chunk-N2X2OO4V.js +1 -0
- package/dist/standalone/chunk-NGKITPQP.js +13 -0
- package/dist/standalone/chunk-O3NAGRTR.js +1 -0
- package/dist/standalone/chunk-OZACQNKG.js +1 -0
- package/dist/standalone/chunk-PNDNXS5Z.js +1 -0
- package/dist/standalone/chunk-Q7DMUTUE.js +1 -0
- package/dist/standalone/chunk-QAFAJBAW.js +1 -0
- package/dist/standalone/chunk-QBAT52GB.js +1 -0
- package/dist/standalone/chunk-RHZ4M2NZ.js +1 -0
- package/dist/standalone/chunk-RRCPZMC2.js +22 -0
- package/dist/standalone/chunk-SEU5V7I6.js +1 -0
- package/dist/standalone/chunk-TAD43CG5.js +1 -0
- package/dist/standalone/chunk-TBMYIZIO.js +1 -0
- package/dist/standalone/chunk-TDZ44E5I.js +4 -0
- package/dist/standalone/chunk-THNBTMUF.js +1 -0
- package/dist/standalone/chunk-TIQISBGK.js +1 -0
- package/dist/standalone/chunk-TMYVNQ66.js +1 -0
- package/dist/standalone/chunk-TQ36RWOP.js +1 -0
- package/dist/standalone/chunk-UGUEC6BC.js +1 -0
- package/dist/standalone/chunk-UJB2LEI4.js +4 -0
- package/dist/standalone/chunk-UK64ZSUW.js +1 -0
- package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
- package/dist/standalone/chunk-VLXV72QE.js +1 -0
- package/dist/standalone/chunk-VON7JUPG.js +1 -0
- package/dist/standalone/chunk-W3JK4YWR.js +1 -0
- package/dist/standalone/chunk-W3SHEIAL.js +3 -0
- package/dist/standalone/chunk-WI7GWFEG.js +1 -0
- package/dist/standalone/chunk-WIHXMNUY.js +1 -0
- package/dist/standalone/chunk-WLDVXVI2.js +1 -0
- package/dist/standalone/chunk-XLXNLJ4N.js +1 -0
- package/dist/standalone/chunk-XNJNSCLM.js +1 -0
- package/dist/standalone/chunk-YAECF5LW.js +1 -0
- package/dist/standalone/chunk-YBGC4PPD.js +1 -0
- package/dist/standalone/chunk-YJAPWSDC.js +4 -0
- package/dist/standalone/chunk-ZEJB6DXU.js +8 -0
- package/dist/standalone/chunk-ZFNBPAIZ.js +1 -0
- package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
- package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
- package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
- package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
- package/dist/standalone/studio.js +104 -246
- package/dist/styles.css +2 -2
- package/package.json +15 -13
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
- package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { useLunora } from '@lunora/react';
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { B as Button } from '../packem_shared/button-BhsN2uZH.js';
|
|
5
|
+
import { C as Card, a as CardContent } from '../packem_shared/card-DURq3ElK.js';
|
|
6
|
+
import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
|
|
7
|
+
import { I as Input } from '../packem_shared/input-XH4r1Pt1.js';
|
|
8
|
+
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from '../packem_shared/table-DsCa9Qp9.js';
|
|
9
|
+
import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
10
|
+
import { f as fireAndForget, e as errorMessage, h as formatCell } from '../packem_shared/internal-CYcbqMjX.js';
|
|
11
|
+
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
12
|
+
|
|
13
|
+
const DEFAULT_TOP_K = 10;
|
|
14
|
+
const Detail = (t0) => {
|
|
15
|
+
const $ = c(7);
|
|
16
|
+
const {
|
|
17
|
+
label,
|
|
18
|
+
value
|
|
19
|
+
} = t0;
|
|
20
|
+
let t1;
|
|
21
|
+
if ($[0] !== label) {
|
|
22
|
+
t1 = /* @__PURE__ */ jsxDEV("span", {
|
|
23
|
+
className: "font-mono text-[11px] uppercase tracking-wide text-muted-foreground",
|
|
24
|
+
children: label
|
|
25
|
+
}, void 0, false);
|
|
26
|
+
$[0] = label;
|
|
27
|
+
$[1] = t1;
|
|
28
|
+
} else {
|
|
29
|
+
t1 = $[1];
|
|
30
|
+
}
|
|
31
|
+
const t2 = value ?? "—";
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[2] !== t2) {
|
|
34
|
+
t3 = /* @__PURE__ */ jsxDEV("span", {
|
|
35
|
+
className: "font-mono text-sm",
|
|
36
|
+
children: t2
|
|
37
|
+
}, void 0, false);
|
|
38
|
+
$[2] = t2;
|
|
39
|
+
$[3] = t3;
|
|
40
|
+
} else {
|
|
41
|
+
t3 = $[3];
|
|
42
|
+
}
|
|
43
|
+
let t4;
|
|
44
|
+
if ($[4] !== t1 || $[5] !== t3) {
|
|
45
|
+
t4 = /* @__PURE__ */ jsxDEV("div", {
|
|
46
|
+
className: "flex flex-col gap-0.5",
|
|
47
|
+
children: [t1, t3]
|
|
48
|
+
}, void 0, true);
|
|
49
|
+
$[4] = t1;
|
|
50
|
+
$[5] = t3;
|
|
51
|
+
$[6] = t4;
|
|
52
|
+
} else {
|
|
53
|
+
t4 = $[6];
|
|
54
|
+
}
|
|
55
|
+
return t4;
|
|
56
|
+
};
|
|
57
|
+
const VectorBrowser = ({
|
|
58
|
+
loadIndexes,
|
|
59
|
+
runQuery
|
|
60
|
+
} = {}) => {
|
|
61
|
+
const client = useLunora();
|
|
62
|
+
const t = useT();
|
|
63
|
+
const [indexes, setIndexes] = useState(null);
|
|
64
|
+
const [error, setError] = useState(null);
|
|
65
|
+
const [selected, setSelected] = useState(null);
|
|
66
|
+
const [queryText, setQueryText] = useState("");
|
|
67
|
+
const [matches, setMatches] = useState(null);
|
|
68
|
+
const [queryError, setQueryError] = useState(null);
|
|
69
|
+
const [searching, setSearching] = useState(false);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
const token = {
|
|
72
|
+
cancelled: false
|
|
73
|
+
};
|
|
74
|
+
fireAndForget((async () => {
|
|
75
|
+
try {
|
|
76
|
+
const result = await (loadIndexes ?? (() => client.listVectorIndexes()))();
|
|
77
|
+
if (!token.cancelled) {
|
|
78
|
+
setIndexes(result);
|
|
79
|
+
setError(null);
|
|
80
|
+
setSelected((current) => current ?? result[0]?.name ?? null);
|
|
81
|
+
}
|
|
82
|
+
} catch (error_) {
|
|
83
|
+
if (!token.cancelled) {
|
|
84
|
+
setIndexes(null);
|
|
85
|
+
setError(errorMessage(error_));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
})());
|
|
89
|
+
return () => {
|
|
90
|
+
token.cancelled = true;
|
|
91
|
+
};
|
|
92
|
+
}, [client, loadIndexes]);
|
|
93
|
+
const selectedIndex = indexes?.find((index) => index.name === selected) ?? null;
|
|
94
|
+
const onSelect = (event) => {
|
|
95
|
+
setSelected(event.currentTarget.dataset.index ?? null);
|
|
96
|
+
setMatches(null);
|
|
97
|
+
setQueryError(null);
|
|
98
|
+
};
|
|
99
|
+
const onQueryTextChange = (event_0) => {
|
|
100
|
+
setQueryText(event_0.target.value);
|
|
101
|
+
};
|
|
102
|
+
const search = async () => {
|
|
103
|
+
const text = queryText.trim();
|
|
104
|
+
if (selected === null || text === "") {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
setSearching(true);
|
|
108
|
+
setQueryError(null);
|
|
109
|
+
try {
|
|
110
|
+
const result_0 = await (runQuery ?? ((options) => client.queryVectorIndex(options)))({
|
|
111
|
+
name: selected,
|
|
112
|
+
text,
|
|
113
|
+
topK: DEFAULT_TOP_K
|
|
114
|
+
});
|
|
115
|
+
setMatches(result_0);
|
|
116
|
+
} catch (error__0) {
|
|
117
|
+
setMatches(null);
|
|
118
|
+
setQueryError(errorMessage(error__0));
|
|
119
|
+
} finally {
|
|
120
|
+
setSearching(false);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const onSearch = () => {
|
|
124
|
+
fireAndForget(search());
|
|
125
|
+
};
|
|
126
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
127
|
+
className: "flex flex-col gap-4",
|
|
128
|
+
"data-testid": "lunora-vector-browser",
|
|
129
|
+
children: [error !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
130
|
+
className: "text-sm text-destructive",
|
|
131
|
+
"data-testid": "vector-error",
|
|
132
|
+
role: "alert",
|
|
133
|
+
children: error
|
|
134
|
+
}, void 0, false), indexes !== null && indexes.length === 0 && /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
135
|
+
description: t("Indexes declared with .vectorize() or defineVectorIndex() appear here."),
|
|
136
|
+
icon: /* @__PURE__ */ jsxDEV("svg", {
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
fill: "none",
|
|
139
|
+
stroke: "currentColor",
|
|
140
|
+
strokeLinecap: "round",
|
|
141
|
+
strokeLinejoin: "round",
|
|
142
|
+
strokeWidth: 1.6,
|
|
143
|
+
viewBox: "0 0 24 24",
|
|
144
|
+
children: /* @__PURE__ */ jsxDEV("path", {
|
|
145
|
+
d: "M4 7l8-4 8 4-8 4-8-4Zm0 5 8 4 8-4M4 17l8 4 8-4"
|
|
146
|
+
}, void 0, false)
|
|
147
|
+
}, void 0, false),
|
|
148
|
+
testId: "vector-empty",
|
|
149
|
+
title: t("No vector indexes.")
|
|
150
|
+
}, void 0, false), indexes !== null && indexes.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
|
|
151
|
+
className: "overflow-hidden py-0",
|
|
152
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
153
|
+
className: "px-0",
|
|
154
|
+
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
155
|
+
"data-testid": "vector-table",
|
|
156
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
157
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
158
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
159
|
+
children: t("name")
|
|
160
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
161
|
+
children: t("table")
|
|
162
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
163
|
+
children: t("dimensions")
|
|
164
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
165
|
+
children: t("metric")
|
|
166
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
167
|
+
children: t("vectors")
|
|
168
|
+
}, void 0, false)]
|
|
169
|
+
}, void 0, true)
|
|
170
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
171
|
+
children: indexes.map((index_0) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
172
|
+
className: index_0.name === selected ? "border-l-2 border-l-royal-amethyst bg-muted/50" : "cursor-pointer",
|
|
173
|
+
"data-index": index_0.name,
|
|
174
|
+
"data-testid": `vector-row-${index_0.name}`,
|
|
175
|
+
onClick: onSelect,
|
|
176
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
177
|
+
className: "font-mono text-xs",
|
|
178
|
+
children: index_0.name
|
|
179
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
180
|
+
className: "font-mono text-xs",
|
|
181
|
+
children: index_0.table
|
|
182
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
183
|
+
className: "tabular-nums",
|
|
184
|
+
children: index_0.dimensions ?? "—"
|
|
185
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
186
|
+
children: index_0.metric ?? "—"
|
|
187
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
188
|
+
className: "tabular-nums",
|
|
189
|
+
children: index_0.vectorsCount ?? "—"
|
|
190
|
+
}, void 0, false)]
|
|
191
|
+
}, index_0.name, true))
|
|
192
|
+
}, void 0, false)]
|
|
193
|
+
}, void 0, true)
|
|
194
|
+
}, void 0, false)
|
|
195
|
+
}, void 0, false), selectedIndex !== null && /* @__PURE__ */ jsxDEV("section", {
|
|
196
|
+
className: "border border-border bg-card p-3",
|
|
197
|
+
"data-testid": "vector-detail",
|
|
198
|
+
children: [/* @__PURE__ */ jsxDEV("div", {
|
|
199
|
+
className: "grid grid-cols-2 gap-3 sm:grid-cols-4",
|
|
200
|
+
children: [/* @__PURE__ */ jsxDEV(Detail, {
|
|
201
|
+
label: t("field"),
|
|
202
|
+
value: selectedIndex.field
|
|
203
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(Detail, {
|
|
204
|
+
label: t("dimensions"),
|
|
205
|
+
value: selectedIndex.dimensions
|
|
206
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(Detail, {
|
|
207
|
+
label: t("metric"),
|
|
208
|
+
value: selectedIndex.metric
|
|
209
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(Detail, {
|
|
210
|
+
label: t("vectors"),
|
|
211
|
+
value: selectedIndex.vectorsCount
|
|
212
|
+
}, void 0, false)]
|
|
213
|
+
}, void 0, true), selectedIndex.metadata !== void 0 && selectedIndex.metadata.length > 0 && /* @__PURE__ */ jsxDEV("p", {
|
|
214
|
+
className: "mt-3 text-xs text-muted-foreground",
|
|
215
|
+
"data-testid": "vector-metadata",
|
|
216
|
+
children: [t("metadata"), ": ", /* @__PURE__ */ jsxDEV("span", {
|
|
217
|
+
className: "font-mono",
|
|
218
|
+
children: selectedIndex.metadata.join(", ")
|
|
219
|
+
}, void 0, false)]
|
|
220
|
+
}, void 0, true), /* @__PURE__ */ jsxDEV("div", {
|
|
221
|
+
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
222
|
+
children: [/* @__PURE__ */ jsxDEV(Input, {
|
|
223
|
+
className: "min-w-[18rem] flex-1",
|
|
224
|
+
"data-testid": "vector-query-input",
|
|
225
|
+
onChange: onQueryTextChange,
|
|
226
|
+
placeholder: t("Search by similarity…"),
|
|
227
|
+
value: queryText
|
|
228
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(Button, {
|
|
229
|
+
"data-testid": "vector-search",
|
|
230
|
+
disabled: searching || queryText.trim() === "",
|
|
231
|
+
onClick: onSearch,
|
|
232
|
+
children: searching ? t("Searching…") : t("Search")
|
|
233
|
+
}, void 0, false)]
|
|
234
|
+
}, void 0, true), queryError !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
235
|
+
className: "mt-2 text-sm text-destructive",
|
|
236
|
+
"data-testid": "vector-query-error",
|
|
237
|
+
role: "alert",
|
|
238
|
+
children: queryError
|
|
239
|
+
}, void 0, false), matches !== null && matches.length === 0 && /* @__PURE__ */ jsxDEV("p", {
|
|
240
|
+
className: "mt-2 text-sm text-muted-foreground",
|
|
241
|
+
"data-testid": "vector-no-matches",
|
|
242
|
+
children: t("No matches.")
|
|
243
|
+
}, void 0, false), matches !== null && matches.length > 0 && /* @__PURE__ */ jsxDEV(Card, {
|
|
244
|
+
className: "mt-3 overflow-hidden py-0",
|
|
245
|
+
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
246
|
+
className: "px-0",
|
|
247
|
+
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
248
|
+
"data-testid": "vector-matches",
|
|
249
|
+
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
250
|
+
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
251
|
+
children: [/* @__PURE__ */ jsxDEV(TableHead, {
|
|
252
|
+
children: t("id")
|
|
253
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
254
|
+
children: t("score")
|
|
255
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableHead, {
|
|
256
|
+
children: t("metadata")
|
|
257
|
+
}, void 0, false)]
|
|
258
|
+
}, void 0, true)
|
|
259
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
260
|
+
children: matches.map((match) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
261
|
+
"data-testid": `vector-match-${match.id}`,
|
|
262
|
+
children: [/* @__PURE__ */ jsxDEV(TableCell, {
|
|
263
|
+
className: "font-mono text-xs",
|
|
264
|
+
children: match.id
|
|
265
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
266
|
+
className: "tabular-nums",
|
|
267
|
+
children: match.score.toFixed(4)
|
|
268
|
+
}, void 0, false), /* @__PURE__ */ jsxDEV(TableCell, {
|
|
269
|
+
className: "max-w-md truncate font-mono text-xs",
|
|
270
|
+
children: match.metadata === void 0 ? "—" : formatCell(match.metadata)
|
|
271
|
+
}, void 0, false)]
|
|
272
|
+
}, match.id, true))
|
|
273
|
+
}, void 0, false)]
|
|
274
|
+
}, void 0, true)
|
|
275
|
+
}, void 0, false)
|
|
276
|
+
}, void 0, false)]
|
|
277
|
+
}, void 0, true)]
|
|
278
|
+
}, void 0, true);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
export { VectorBrowser };
|