@hachej/boring-workspace 0.1.10 → 0.1.13
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/{CommandPalette-D5KPKtKA.js → CommandPalette-Dme9em28.js} +600 -599
- package/dist/{FileTree-CwC01Ijr.js → FileTree-BVfqs3rR.js} +1 -1
- package/dist/{MarkdownEditor-CB7nfhN9.js → MarkdownEditor-CcCDF65H.js} +1 -1
- package/dist/{WorkspaceLoadingState-J8XVhEyL.js → WorkspaceLoadingState-BjZGQLS_.js} +85 -85
- package/dist/app-front.js +2 -2
- package/dist/app-server.d.ts +3 -3
- package/dist/app-server.js +50 -19
- package/dist/server.d.ts +3 -3
- package/dist/server.js +42 -16
- package/dist/testing.js +1 -1
- package/dist/workspace.css +3 -3
- package/dist/workspace.d.ts +3 -1
- package/dist/workspace.js +718 -692
- package/docs/plans/ASK_USER_QUESTIONS_PLUGIN_SPEC.md +322 -0
- package/package.json +3 -3
package/dist/workspace.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var ne = (e, t, r) =>
|
|
4
|
-
import { d as ae, u as
|
|
5
|
-
import { A as
|
|
6
|
-
import { jsxs as h, jsx as a, Fragment as
|
|
7
|
-
import { useSyncExternalStore as
|
|
8
|
-
import {
|
|
9
|
-
import { EmptyState as
|
|
10
|
-
import { Toaster as Ma, dismissToast as Da, toast as
|
|
1
|
+
var $e = Object.defineProperty;
|
|
2
|
+
var Ke = (e, t, r) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var ne = (e, t, r) => Ke(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { d as ae, u as ke, p as Ve, P as je, a as Ge, b as Qe, D as He } from "./CommandPalette-Dme9em28.js";
|
|
5
|
+
import { A as yr, C as br, c as vr, e as Nr, f as Sr, F as Cr, g as Tr, M as Pr, h as kr, i as Er, j as wr, k as Ir, l as Mr, R as Dr, S as Rr, m as Or, n as Fr, T as Lr, W as zr, o as qr, q as _r, r as Br, s as Ar, t as $r, v as Kr, w as Vr, x as jr, y as Gr, z as Qr, B as Hr, E as Wr, G as Ur, H as Xr, I as Jr, J as Yr, K as Zr, L as ea, N as ta, O as ra, Q as aa, U as na, V as la, X as oa, Y as sa, Z as ca, _ as ia, $ as ua, a0 as da, a1 as pa, a2 as fa, a3 as ma, a4 as ga, a5 as ha, a6 as xa, a7 as ya, a8 as ba, a9 as va, aa as Na, ab as Sa, ac as Ca, ad as Ta, ae as Pa, af as ka, ag as Ea, ah as wa } from "./CommandPalette-Dme9em28.js";
|
|
6
|
+
import { jsxs as h, jsx as a, Fragment as We } from "react/jsx-runtime";
|
|
7
|
+
import { useSyncExternalStore as Ue, useState as V, useEffect as Y, useRef as I, useCallback as v, useReducer as Xe, useMemo as ee, Suspense as Je, Component as Ye } from "react";
|
|
8
|
+
import { SearchIcon as Ze, XIcon as pe, FilterIcon as et, ChevronDownIcon as Ee, ChevronRightIcon as we, Database as tt, BarChart3 as fe, MenuIcon as rt, PanelLeftOpenIcon as at, PanelLeftCloseIcon as nt, PinIcon as lt } from "lucide-react";
|
|
9
|
+
import { EmptyState as Ie, Toolbar as ot, Popover as me, PopoverTrigger as ge, PopoverContent as he, Input as Me, Button as J, Spinner as st, ChipButton as ct, Chip as it, Sheet as ut, SheetContent as dt, SheetHeader as pt, SheetTitle as ft, SheetDescription as mt, Kbd as le, ErrorState as gt, IconButton as De } from "@hachej/boring-ui-kit";
|
|
10
|
+
import { Toaster as Ma, dismissToast as Da, toast as Ra } from "@hachej/boring-ui-kit";
|
|
11
11
|
import { c as H } from "./utils-B6yFEsav.js";
|
|
12
|
-
import { d as
|
|
13
|
-
import { C as
|
|
14
|
-
import { C as
|
|
15
|
-
import { FileTree as
|
|
16
|
-
import { MarkdownEditor as
|
|
12
|
+
import { d as Re } from "./panel-DnvDNQac.js";
|
|
13
|
+
import { C as Fa, T as La, W as za, b as qa } from "./WorkspaceLoadingState-BjZGQLS_.js";
|
|
14
|
+
import { C as Ba, c as Aa } from "./CodeEditor-DQqOn4xz.js";
|
|
15
|
+
import { FileTree as Ka } from "./FileTree-BVfqs3rR.js";
|
|
16
|
+
import { MarkdownEditor as ja } from "./MarkdownEditor-CcCDF65H.js";
|
|
17
17
|
function re(e, t) {
|
|
18
18
|
const { pluginId: r, ...n } = e;
|
|
19
19
|
return t ? { ...n, pluginId: t } : n;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function xe(e, t) {
|
|
22
22
|
const r = [];
|
|
23
23
|
for (const n of e.panels ?? [])
|
|
24
24
|
r.push(re({ type: "panel", panel: n }, t));
|
|
@@ -34,15 +34,15 @@ function fe(e, t) {
|
|
|
34
34
|
r.push(re(n, t));
|
|
35
35
|
return r;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function ht(e) {
|
|
38
38
|
return e.map((r) => r == null ? void 0 : r.trim()).filter((r) => !!r).join(`
|
|
39
39
|
|
|
40
40
|
`) || void 0;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function tr(e) {
|
|
43
43
|
const t = e.adoptOutputs !== !1, r = e.plugins.flatMap(
|
|
44
|
-
(l) =>
|
|
45
|
-
), n =
|
|
44
|
+
(l) => xe(l, t ? void 0 : l.id)
|
|
45
|
+
), n = xe(
|
|
46
46
|
{
|
|
47
47
|
id: e.id,
|
|
48
48
|
panels: e.panels,
|
|
@@ -56,74 +56,74 @@ function er(e) {
|
|
|
56
56
|
return ae({
|
|
57
57
|
id: e.id,
|
|
58
58
|
label: e.label,
|
|
59
|
-
systemPrompt:
|
|
59
|
+
systemPrompt: ht([
|
|
60
60
|
...e.plugins.map((l) => l.systemPrompt),
|
|
61
61
|
e.systemPrompt
|
|
62
62
|
]),
|
|
63
63
|
outputs: [...r, ...n]
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const e =
|
|
68
|
-
return
|
|
66
|
+
function rr() {
|
|
67
|
+
const e = ke();
|
|
68
|
+
return Ue(e.subscribe, e.getSnapshot);
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ye(e) {
|
|
71
71
|
return typeof window > "u" ? !1 : window.innerWidth < e;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const [t, r] = V(() =>
|
|
75
|
-
return
|
|
73
|
+
function be(e = 1024) {
|
|
74
|
+
const [t, r] = V(() => ye(e));
|
|
75
|
+
return Y(() => {
|
|
76
76
|
const n = () => {
|
|
77
|
-
r(
|
|
77
|
+
r(ye(e));
|
|
78
78
|
};
|
|
79
79
|
return n(), window.addEventListener("resize", n), () => {
|
|
80
80
|
window.removeEventListener("resize", n);
|
|
81
81
|
};
|
|
82
82
|
}, [e]), t;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function xt({
|
|
85
85
|
isNarrowViewport: e,
|
|
86
86
|
isCollapsed: t,
|
|
87
87
|
setCollapsed: r
|
|
88
88
|
}) {
|
|
89
|
-
const n =
|
|
90
|
-
return
|
|
89
|
+
const n = I(t), l = I(!1), o = I(null);
|
|
90
|
+
return Y(() => {
|
|
91
91
|
n.current = t;
|
|
92
|
-
}, [t]),
|
|
93
|
-
const
|
|
92
|
+
}, [t]), Y(() => {
|
|
93
|
+
const d = o.current, c = d !== !0 && e, s = d === !0 && !e;
|
|
94
94
|
if (o.current = e, e && c && !n.current) {
|
|
95
95
|
l.current = !0, r(!0);
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
s && l.current && (l.current = !1, r(!1));
|
|
99
|
-
}, [e, r]),
|
|
99
|
+
}, [e, r]), v(() => {
|
|
100
100
|
l.current = !1;
|
|
101
101
|
}, []);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const [t, r] = V([]), n =
|
|
105
|
-
n.current = t,
|
|
103
|
+
function ar(e) {
|
|
104
|
+
const [t, r] = V([]), n = I(t);
|
|
105
|
+
n.current = t, Y(() => {
|
|
106
106
|
if (!e) {
|
|
107
107
|
r([]);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
function s() {
|
|
111
111
|
try {
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
116
|
-
for (const [,
|
|
117
|
-
|
|
118
|
-
id:
|
|
119
|
-
component:
|
|
120
|
-
params:
|
|
112
|
+
const u = e.toJSON(), x = [];
|
|
113
|
+
if (u && typeof u == "object" && "panels" in u) {
|
|
114
|
+
const C = u;
|
|
115
|
+
if (C.panels)
|
|
116
|
+
for (const [, y] of Object.entries(C.panels))
|
|
117
|
+
y.id && x.push({
|
|
118
|
+
id: y.id,
|
|
119
|
+
component: y.contentComponent ?? y.id,
|
|
120
|
+
params: y.params
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
const
|
|
124
|
-
(
|
|
125
|
-
var
|
|
126
|
-
return
|
|
123
|
+
const g = n.current;
|
|
124
|
+
(g.length !== x.length || g.some((C, y) => {
|
|
125
|
+
var P;
|
|
126
|
+
return C.id !== ((P = x[y]) == null ? void 0 : P.id);
|
|
127
127
|
})) && r(x);
|
|
128
128
|
} catch {
|
|
129
129
|
}
|
|
@@ -132,7 +132,7 @@ function rr(e) {
|
|
|
132
132
|
const i = setInterval(s, 500);
|
|
133
133
|
return () => clearInterval(i);
|
|
134
134
|
}, [e]);
|
|
135
|
-
const l =
|
|
135
|
+
const l = v(
|
|
136
136
|
(s) => {
|
|
137
137
|
e == null || e.addPanel("artifacts", {
|
|
138
138
|
id: s.id,
|
|
@@ -141,39 +141,39 @@ function rr(e) {
|
|
|
141
141
|
});
|
|
142
142
|
},
|
|
143
143
|
[e]
|
|
144
|
-
), o =
|
|
144
|
+
), o = v(
|
|
145
145
|
(s) => {
|
|
146
146
|
e == null || e.removePanel(s);
|
|
147
147
|
},
|
|
148
148
|
[e]
|
|
149
|
-
),
|
|
149
|
+
), d = v(
|
|
150
150
|
(s) => {
|
|
151
151
|
e == null || e.activatePanel(s);
|
|
152
152
|
},
|
|
153
153
|
[e]
|
|
154
|
-
), c =
|
|
154
|
+
), c = v(
|
|
155
155
|
(s) => n.current.some((i) => i.id === s),
|
|
156
156
|
[]
|
|
157
157
|
);
|
|
158
|
-
return { panels: t, open: l, close: o, activate:
|
|
158
|
+
return { panels: t, open: l, close: o, activate: d, isOpen: c };
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
const r = t.toolPanelMap ?? {}, n =
|
|
160
|
+
function nr(e, t = {}) {
|
|
161
|
+
const r = t.toolPanelMap ?? {}, n = v(
|
|
162
162
|
(o) => r[o],
|
|
163
163
|
[r]
|
|
164
164
|
);
|
|
165
|
-
return { openForTool:
|
|
166
|
-
(o,
|
|
165
|
+
return { openForTool: v(
|
|
166
|
+
(o, d) => {
|
|
167
167
|
const c = r[o];
|
|
168
168
|
if (!c) return;
|
|
169
|
-
const s = `artifact-${
|
|
170
|
-
e.isOpen(s) ? e.activate(s) : e.open({ id: s, component: c, params:
|
|
169
|
+
const s = `artifact-${d.path}`;
|
|
170
|
+
e.isOpen(s) ? e.activate(s) : e.open({ id: s, component: c, params: d });
|
|
171
171
|
},
|
|
172
172
|
[r, e]
|
|
173
173
|
), resolvePanel: n };
|
|
174
174
|
}
|
|
175
175
|
const ce = { items: [], total: 0, hasMore: !1, loading: !1 };
|
|
176
|
-
function
|
|
176
|
+
function yt(e, t) {
|
|
177
177
|
switch (t.type) {
|
|
178
178
|
case "setPendingQuery":
|
|
179
179
|
return { ...e, pendingQuery: t.query };
|
|
@@ -240,7 +240,7 @@ function xt(e, t) {
|
|
|
240
240
|
return { ...e, loading: t.loading };
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
const
|
|
243
|
+
const bt = {
|
|
244
244
|
query: "",
|
|
245
245
|
pendingQuery: "",
|
|
246
246
|
filters: {},
|
|
@@ -256,181 +256,181 @@ const yt = {
|
|
|
256
256
|
function oe(e) {
|
|
257
257
|
return e instanceof DOMException && e.name === "AbortError";
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function vt(e) {
|
|
260
260
|
const {
|
|
261
261
|
adapter: t,
|
|
262
262
|
facets: r,
|
|
263
263
|
groupBy: n,
|
|
264
264
|
pageSize: l = 50,
|
|
265
265
|
debounceMs: o = 200,
|
|
266
|
-
query:
|
|
267
|
-
} = e, c =
|
|
268
|
-
|
|
269
|
-
const x =
|
|
266
|
+
query: d
|
|
267
|
+
} = e, c = d !== void 0, [s, i] = Xe(yt, bt), u = I(s);
|
|
268
|
+
u.current = s;
|
|
269
|
+
const x = I(t);
|
|
270
270
|
x.current = t;
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
async (
|
|
275
|
-
var
|
|
276
|
-
(
|
|
271
|
+
const g = I({ pageSize: l, groupBy: n, hasFacets: !!(r != null && r.length) });
|
|
272
|
+
g.current = { pageSize: l, groupBy: n, hasFacets: !!(r != null && r.length) };
|
|
273
|
+
const m = I(null), C = I(/* @__PURE__ */ new Map()), y = I(null), P = I(null), O = I(!0), j = v(
|
|
274
|
+
async (p) => {
|
|
275
|
+
var R;
|
|
276
|
+
(R = m.current) == null || R.abort();
|
|
277
277
|
const N = new AbortController();
|
|
278
|
-
|
|
278
|
+
m.current = N, i({ type: "loading", loading: !0 });
|
|
279
279
|
const b = {
|
|
280
|
-
query:
|
|
281
|
-
filters:
|
|
282
|
-
offset:
|
|
283
|
-
limit:
|
|
280
|
+
query: p.query,
|
|
281
|
+
filters: p.filters,
|
|
282
|
+
offset: p.offset,
|
|
283
|
+
limit: g.current.pageSize,
|
|
284
284
|
signal: N.signal
|
|
285
285
|
};
|
|
286
286
|
try {
|
|
287
|
-
const
|
|
288
|
-
if (!
|
|
287
|
+
const E = await x.current.search(b);
|
|
288
|
+
if (!O.current || N.signal.aborted) return;
|
|
289
289
|
i({
|
|
290
290
|
type: "topResolved",
|
|
291
|
-
items:
|
|
292
|
-
total:
|
|
293
|
-
hasMore:
|
|
294
|
-
offset:
|
|
295
|
-
append:
|
|
291
|
+
items: E.items,
|
|
292
|
+
total: E.total,
|
|
293
|
+
hasMore: E.hasMore,
|
|
294
|
+
offset: p.offset,
|
|
295
|
+
append: p.append
|
|
296
296
|
});
|
|
297
|
-
} catch (
|
|
298
|
-
if (oe(
|
|
299
|
-
console.error("DataExplorer: search failed",
|
|
297
|
+
} catch (E) {
|
|
298
|
+
if (oe(E)) return;
|
|
299
|
+
console.error("DataExplorer: search failed", E);
|
|
300
300
|
} finally {
|
|
301
|
-
|
|
301
|
+
O.current && m.current === N && i({ type: "loading", loading: !1 });
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
304
|
[]
|
|
305
|
-
),
|
|
306
|
-
async (
|
|
307
|
-
var
|
|
308
|
-
const N =
|
|
305
|
+
), F = v(
|
|
306
|
+
async (p) => {
|
|
307
|
+
var E;
|
|
308
|
+
const N = g.current.groupBy;
|
|
309
309
|
if (!N) return;
|
|
310
|
-
(
|
|
310
|
+
(E = C.current.get(p.groupValue)) == null || E.abort();
|
|
311
311
|
const b = new AbortController();
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
query:
|
|
315
|
-
filters:
|
|
316
|
-
group: { key: N, value:
|
|
317
|
-
offset:
|
|
318
|
-
limit:
|
|
312
|
+
C.current.set(p.groupValue, b), i({ type: "groupLoading", value: p.groupValue, loading: !0 });
|
|
313
|
+
const R = {
|
|
314
|
+
query: p.query,
|
|
315
|
+
filters: p.filters,
|
|
316
|
+
group: { key: N, value: p.groupValue },
|
|
317
|
+
offset: p.offset,
|
|
318
|
+
limit: g.current.pageSize,
|
|
319
319
|
signal: b.signal
|
|
320
320
|
};
|
|
321
321
|
try {
|
|
322
|
-
const
|
|
323
|
-
if (!
|
|
322
|
+
const X = await x.current.search(R);
|
|
323
|
+
if (!O.current || b.signal.aborted) return;
|
|
324
324
|
i({
|
|
325
325
|
type: "groupResolved",
|
|
326
|
-
value:
|
|
327
|
-
items:
|
|
328
|
-
total:
|
|
329
|
-
hasMore:
|
|
330
|
-
append:
|
|
326
|
+
value: p.groupValue,
|
|
327
|
+
items: X.items,
|
|
328
|
+
total: X.total,
|
|
329
|
+
hasMore: X.hasMore,
|
|
330
|
+
append: p.append
|
|
331
331
|
});
|
|
332
|
-
} catch (
|
|
333
|
-
if (oe(
|
|
334
|
-
console.error("DataExplorer: group search failed",
|
|
332
|
+
} catch (X) {
|
|
333
|
+
if (oe(X)) return;
|
|
334
|
+
console.error("DataExplorer: group search failed", X), O.current && i({ type: "groupLoading", value: p.groupValue, loading: !1 });
|
|
335
335
|
}
|
|
336
336
|
},
|
|
337
337
|
[]
|
|
338
|
-
),
|
|
339
|
-
var
|
|
340
|
-
if (!
|
|
338
|
+
), _ = v(async (p) => {
|
|
339
|
+
var R;
|
|
340
|
+
if (!g.current.hasFacets) return;
|
|
341
341
|
const N = x.current.fetchFacets;
|
|
342
342
|
if (!N) return;
|
|
343
|
-
(
|
|
343
|
+
(R = y.current) == null || R.abort();
|
|
344
344
|
const b = new AbortController();
|
|
345
|
-
|
|
345
|
+
y.current = b;
|
|
346
346
|
try {
|
|
347
|
-
const
|
|
348
|
-
if (!
|
|
349
|
-
i({ type: "facetsResolved", facets:
|
|
350
|
-
} catch (
|
|
351
|
-
if (oe(
|
|
352
|
-
console.error("DataExplorer: fetchFacets failed",
|
|
347
|
+
const E = await N({ filters: p, signal: b.signal });
|
|
348
|
+
if (!O.current || b.signal.aborted) return;
|
|
349
|
+
i({ type: "facetsResolved", facets: E });
|
|
350
|
+
} catch (E) {
|
|
351
|
+
if (oe(E)) return;
|
|
352
|
+
console.error("DataExplorer: fetchFacets failed", E);
|
|
353
353
|
}
|
|
354
|
-
}, []),
|
|
355
|
-
(
|
|
356
|
-
j({ query:
|
|
354
|
+
}, []), S = v(
|
|
355
|
+
(p, N) => {
|
|
356
|
+
j({ query: p, filters: N, offset: 0, append: !1 }), _(N);
|
|
357
357
|
},
|
|
358
|
-
[j,
|
|
359
|
-
),
|
|
360
|
-
|
|
361
|
-
const
|
|
362
|
-
(
|
|
363
|
-
|
|
364
|
-
i({ type: "applyQuery", query:
|
|
358
|
+
[j, _]
|
|
359
|
+
), z = I(c);
|
|
360
|
+
z.current = c;
|
|
361
|
+
const k = v(
|
|
362
|
+
(p) => {
|
|
363
|
+
z.current || (i({ type: "setPendingQuery", query: p }), P.current && clearTimeout(P.current), P.current = setTimeout(() => {
|
|
364
|
+
i({ type: "applyQuery", query: p }), S(p, u.current.filters);
|
|
365
365
|
}, o));
|
|
366
366
|
},
|
|
367
|
-
[o,
|
|
368
|
-
),
|
|
369
|
-
(
|
|
370
|
-
const b =
|
|
371
|
-
|
|
367
|
+
[o, S]
|
|
368
|
+
), L = v(
|
|
369
|
+
(p, N) => {
|
|
370
|
+
const b = u.current.filters[p] ?? [], R = b.includes(N) ? b.filter((X) => X !== N) : [...b, N], E = { ...u.current.filters };
|
|
371
|
+
R.length ? E[p] = R : delete E[p], i({ type: "setFilters", filters: E }), S(u.current.query, E);
|
|
372
372
|
},
|
|
373
|
-
[
|
|
374
|
-
),
|
|
375
|
-
i({ type: "setFilters", filters: {} }),
|
|
376
|
-
}, [
|
|
377
|
-
(
|
|
373
|
+
[S]
|
|
374
|
+
), B = v(() => {
|
|
375
|
+
i({ type: "setFilters", filters: {} }), S(u.current.query, {});
|
|
376
|
+
}, [S]), T = v(
|
|
377
|
+
(p) => {
|
|
378
378
|
var b;
|
|
379
|
-
const N = (((b =
|
|
380
|
-
i({ type: "expandGroup", value:
|
|
381
|
-
groupValue:
|
|
382
|
-
query:
|
|
383
|
-
filters:
|
|
379
|
+
const N = (((b = u.current.groups[p]) == null ? void 0 : b.items.length) ?? 0) > 0;
|
|
380
|
+
i({ type: "expandGroup", value: p }), N || F({
|
|
381
|
+
groupValue: p,
|
|
382
|
+
query: u.current.query,
|
|
383
|
+
filters: u.current.filters,
|
|
384
384
|
offset: 0,
|
|
385
385
|
append: !1
|
|
386
386
|
});
|
|
387
387
|
},
|
|
388
|
-
[
|
|
389
|
-
),
|
|
390
|
-
i({ type: "collapseGroup", value:
|
|
391
|
-
}, []),
|
|
392
|
-
const
|
|
393
|
-
|
|
394
|
-
query:
|
|
395
|
-
filters:
|
|
396
|
-
offset:
|
|
388
|
+
[F]
|
|
389
|
+
), G = v((p) => {
|
|
390
|
+
i({ type: "collapseGroup", value: p });
|
|
391
|
+
}, []), D = v(() => {
|
|
392
|
+
const p = u.current;
|
|
393
|
+
p.topHasMore && j({
|
|
394
|
+
query: p.query,
|
|
395
|
+
filters: p.filters,
|
|
396
|
+
offset: p.topOffset,
|
|
397
397
|
append: !0
|
|
398
398
|
});
|
|
399
|
-
}, [j]),
|
|
400
|
-
(
|
|
401
|
-
const N =
|
|
402
|
-
b != null && b.hasMore &&
|
|
403
|
-
groupValue:
|
|
399
|
+
}, [j]), Q = v(
|
|
400
|
+
(p) => {
|
|
401
|
+
const N = u.current, b = N.groups[p];
|
|
402
|
+
b != null && b.hasMore && F({
|
|
403
|
+
groupValue: p,
|
|
404
404
|
query: N.query,
|
|
405
405
|
filters: N.filters,
|
|
406
406
|
offset: b.items.length,
|
|
407
407
|
append: !0
|
|
408
408
|
});
|
|
409
409
|
},
|
|
410
|
-
[
|
|
410
|
+
[F]
|
|
411
411
|
);
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
const
|
|
415
|
-
return
|
|
412
|
+
Y(() => {
|
|
413
|
+
O.current = !0;
|
|
414
|
+
const p = z.current ? d ?? "" : "";
|
|
415
|
+
return p && i({ type: "applyQuery", query: p }), S(p, {}), () => {
|
|
416
416
|
var N, b;
|
|
417
|
-
|
|
418
|
-
for (const
|
|
419
|
-
|
|
417
|
+
O.current = !1, P.current && clearTimeout(P.current), (N = m.current) == null || N.abort(), (b = y.current) == null || b.abort();
|
|
418
|
+
for (const R of C.current.values()) R.abort();
|
|
419
|
+
C.current.clear();
|
|
420
420
|
};
|
|
421
421
|
}, []);
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
if (!c ||
|
|
425
|
-
|
|
426
|
-
const
|
|
427
|
-
i({ type: "applyQuery", query:
|
|
428
|
-
}, [c,
|
|
429
|
-
const te =
|
|
430
|
-
(
|
|
422
|
+
const U = I(d);
|
|
423
|
+
Y(() => {
|
|
424
|
+
if (!c || U.current === d) return;
|
|
425
|
+
U.current = d;
|
|
426
|
+
const p = d ?? "";
|
|
427
|
+
i({ type: "applyQuery", query: p }), S(p, u.current.filters);
|
|
428
|
+
}, [c, d, S]);
|
|
429
|
+
const te = v(
|
|
430
|
+
(p) => s.groups[p] ?? ce,
|
|
431
431
|
[s.groups]
|
|
432
|
-
),
|
|
433
|
-
(
|
|
432
|
+
), Z = v(
|
|
433
|
+
(p) => !!s.expanded[p],
|
|
434
434
|
[s.expanded]
|
|
435
435
|
);
|
|
436
436
|
return {
|
|
@@ -442,14 +442,14 @@ function bt(e) {
|
|
|
442
442
|
topHasMore: s.topHasMore,
|
|
443
443
|
loading: s.loading,
|
|
444
444
|
getGroup: te,
|
|
445
|
-
isExpanded:
|
|
446
|
-
setQuery:
|
|
447
|
-
toggleFilter:
|
|
448
|
-
clearFilters:
|
|
449
|
-
expandGroup:
|
|
450
|
-
collapseGroup:
|
|
451
|
-
loadMoreTop:
|
|
452
|
-
loadMoreGroup:
|
|
445
|
+
isExpanded: Z,
|
|
446
|
+
setQuery: k,
|
|
447
|
+
toggleFilter: L,
|
|
448
|
+
clearFilters: B,
|
|
449
|
+
expandGroup: T,
|
|
450
|
+
collapseGroup: G,
|
|
451
|
+
loadMoreTop: D,
|
|
452
|
+
loadMoreGroup: Q
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
455
|
function ie({
|
|
@@ -459,107 +459,132 @@ function ie({
|
|
|
459
459
|
onActivate: n,
|
|
460
460
|
getDragPayload: l,
|
|
461
461
|
emptyState: o = "No results",
|
|
462
|
-
searchPlaceholder:
|
|
462
|
+
searchPlaceholder: d = "Search…",
|
|
463
463
|
searchable: c = !0,
|
|
464
464
|
query: s,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
465
|
+
onQueryChange: i,
|
|
466
|
+
pageSize: u,
|
|
467
|
+
debounceMs: x,
|
|
468
|
+
className: g
|
|
468
469
|
}) {
|
|
469
|
-
const
|
|
470
|
+
const m = vt({
|
|
470
471
|
adapter: e,
|
|
471
472
|
facets: t,
|
|
472
473
|
groupBy: r,
|
|
473
|
-
pageSize:
|
|
474
|
-
debounceMs:
|
|
474
|
+
pageSize: u,
|
|
475
|
+
debounceMs: x,
|
|
475
476
|
query: s
|
|
476
|
-
}),
|
|
477
|
-
var
|
|
478
|
-
if (!
|
|
479
|
-
const
|
|
480
|
-
if ((
|
|
481
|
-
const
|
|
482
|
-
const
|
|
483
|
-
return
|
|
477
|
+
}), C = s !== void 0, y = c && (!C || !!i), P = C && i ? i : m.setQuery, O = (s ?? m.query ?? "").length > 0, j = Object.values(m.filters).some((k) => k.length > 0), F = !!r && !O && !j, _ = Object.values(m.filters).reduce((k, L) => k + L.length, 0), S = ee(() => {
|
|
478
|
+
var T, G;
|
|
479
|
+
if (!F || !r) return [];
|
|
480
|
+
const k = t == null ? void 0 : t.find((D) => D.key === r), B = [...((T = m.facets) == null ? void 0 : T[r]) ?? []];
|
|
481
|
+
if ((G = k == null ? void 0 : k.order) != null && G.length) {
|
|
482
|
+
const D = (Q) => {
|
|
483
|
+
const U = k.order.indexOf(Q);
|
|
484
|
+
return U === -1 ? Number.MAX_SAFE_INTEGER : U;
|
|
484
485
|
};
|
|
485
|
-
|
|
486
|
+
B.sort((Q, U) => D(Q.value) - D(U.value));
|
|
486
487
|
}
|
|
487
|
-
return
|
|
488
|
-
value:
|
|
489
|
-
count:
|
|
490
|
-
label:
|
|
488
|
+
return B.map((D) => ({
|
|
489
|
+
value: D.value,
|
|
490
|
+
count: D.count,
|
|
491
|
+
label: k != null && k.formatValue ? k.formatValue(D.value) : D.value
|
|
491
492
|
}));
|
|
492
|
-
}, [
|
|
493
|
-
return /* @__PURE__ */ h("div", { className: H("flex h-full flex-col",
|
|
494
|
-
|
|
495
|
-
|
|
493
|
+
}, [F, r, t, m.facets]), z = !m.loading && !F && m.topItems.length === 0 && m.query.length === 0 && !j;
|
|
494
|
+
return /* @__PURE__ */ h("div", { className: H("flex h-full flex-col", g), "data-slot": "data-explorer", children: [
|
|
495
|
+
y || t != null && t.length ? /* @__PURE__ */ a(
|
|
496
|
+
Nt,
|
|
496
497
|
{
|
|
497
|
-
searchable:
|
|
498
|
-
searchPlaceholder:
|
|
499
|
-
query:
|
|
500
|
-
onQueryChange:
|
|
498
|
+
searchable: y,
|
|
499
|
+
searchPlaceholder: d,
|
|
500
|
+
query: m.query,
|
|
501
|
+
onQueryChange: P,
|
|
501
502
|
facetConfigs: t,
|
|
502
|
-
facets:
|
|
503
|
-
filters:
|
|
504
|
-
filterCount:
|
|
505
|
-
onToggleFilter:
|
|
506
|
-
onClearFilters:
|
|
507
|
-
total:
|
|
503
|
+
facets: m.facets,
|
|
504
|
+
filters: m.filters,
|
|
505
|
+
filterCount: _,
|
|
506
|
+
onToggleFilter: m.toggleFilter,
|
|
507
|
+
onClearFilters: m.clearFilters,
|
|
508
|
+
total: F ? null : m.topTotal
|
|
508
509
|
}
|
|
509
510
|
) : null,
|
|
510
|
-
/* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", "data-slot": "data-explorer-list", children: z ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center px-4 py-8", children: /* @__PURE__ */ a(
|
|
511
|
-
|
|
511
|
+
/* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", "data-slot": "data-explorer-list", children: z ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center px-4 py-8", children: /* @__PURE__ */ a(Ie, { className: "min-h-0 border-0", description: o }) }) : F ? /* @__PURE__ */ a(
|
|
512
|
+
Tt,
|
|
512
513
|
{
|
|
513
|
-
entries:
|
|
514
|
-
isExpanded:
|
|
515
|
-
getGroup:
|
|
516
|
-
onExpand:
|
|
517
|
-
onCollapse:
|
|
518
|
-
onLoadMoreGroup:
|
|
514
|
+
entries: S,
|
|
515
|
+
isExpanded: m.isExpanded,
|
|
516
|
+
getGroup: m.getGroup,
|
|
517
|
+
onExpand: m.expandGroup,
|
|
518
|
+
onCollapse: m.collapseGroup,
|
|
519
|
+
onLoadMoreGroup: m.loadMoreGroup,
|
|
519
520
|
onActivate: n,
|
|
520
521
|
getDragPayload: l
|
|
521
522
|
}
|
|
522
523
|
) : /* @__PURE__ */ a(
|
|
523
|
-
|
|
524
|
+
Ct,
|
|
524
525
|
{
|
|
525
|
-
items:
|
|
526
|
-
hasMore:
|
|
527
|
-
loading:
|
|
528
|
-
onLoadMore:
|
|
526
|
+
items: m.topItems,
|
|
527
|
+
hasMore: m.topHasMore,
|
|
528
|
+
loading: m.loading,
|
|
529
|
+
onLoadMore: m.loadMoreTop,
|
|
529
530
|
onActivate: n,
|
|
530
531
|
getDragPayload: l
|
|
531
532
|
}
|
|
532
533
|
) })
|
|
533
534
|
] });
|
|
534
535
|
}
|
|
535
|
-
function
|
|
536
|
+
function Nt({
|
|
536
537
|
searchable: e,
|
|
537
538
|
searchPlaceholder: t,
|
|
538
539
|
query: r,
|
|
539
540
|
onQueryChange: n,
|
|
540
541
|
facetConfigs: l,
|
|
541
542
|
facets: o,
|
|
542
|
-
filters:
|
|
543
|
+
filters: d,
|
|
543
544
|
filterCount: c,
|
|
544
545
|
onToggleFilter: s,
|
|
545
546
|
onClearFilters: i,
|
|
546
|
-
total:
|
|
547
|
+
total: u
|
|
547
548
|
}) {
|
|
548
|
-
return /* @__PURE__ */ h(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
549
|
+
return /* @__PURE__ */ h(ot, { className: "border-b border-border/60 px-2 py-1.5", children: [
|
|
550
|
+
u != null ? /* @__PURE__ */ a("span", { className: "px-1 font-mono text-[10.5px] uppercase tracking-[0.05em] text-muted-foreground/80", children: u.toLocaleString() }) : null,
|
|
551
|
+
/* @__PURE__ */ a("div", { className: "flex-1" }),
|
|
552
|
+
e ? /* @__PURE__ */ h(me, { children: [
|
|
553
|
+
/* @__PURE__ */ h(
|
|
554
|
+
ge,
|
|
555
|
+
{
|
|
556
|
+
"aria-label": "Search",
|
|
557
|
+
className: H(
|
|
558
|
+
"inline-flex h-7 items-center gap-1 rounded-sm px-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground",
|
|
559
|
+
r.length > 0 && "bg-muted text-foreground"
|
|
560
|
+
),
|
|
561
|
+
children: [
|
|
562
|
+
/* @__PURE__ */ a(Ze, { size: 12 }),
|
|
563
|
+
r.length > 0 ? /* @__PURE__ */ a("span", { className: "max-w-20 truncate text-[11px]", children: r }) : null
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
),
|
|
567
|
+
/* @__PURE__ */ h(he, { side: "right", align: "start", sideOffset: 8, className: "w-64 p-3", children: [
|
|
568
|
+
/* @__PURE__ */ a(
|
|
569
|
+
Me,
|
|
570
|
+
{
|
|
571
|
+
"aria-label": "Search",
|
|
572
|
+
autoFocus: !0,
|
|
573
|
+
placeholder: t,
|
|
574
|
+
value: r,
|
|
575
|
+
onChange: (x) => n(x.target.value),
|
|
576
|
+
className: "h-8 rounded-sm text-[12.5px]"
|
|
577
|
+
}
|
|
578
|
+
),
|
|
579
|
+
r.length > 0 ? /* @__PURE__ */ h(J, { type: "button", variant: "ghost", size: "xs", onClick: () => n(""), className: "mt-2 gap-1 text-[11px] text-muted-foreground hover:text-foreground", children: [
|
|
580
|
+
/* @__PURE__ */ a(pe, { size: 11 }),
|
|
581
|
+
" Clear search"
|
|
582
|
+
] }) : null
|
|
583
|
+
] })
|
|
584
|
+
] }) : null,
|
|
585
|
+
l != null && l.length ? /* @__PURE__ */ h(me, { children: [
|
|
561
586
|
/* @__PURE__ */ h(
|
|
562
|
-
|
|
587
|
+
ge,
|
|
563
588
|
{
|
|
564
589
|
"aria-label": "Filters",
|
|
565
590
|
className: H(
|
|
@@ -567,16 +592,17 @@ function vt({
|
|
|
567
592
|
c > 0 && "bg-muted text-foreground"
|
|
568
593
|
),
|
|
569
594
|
children: [
|
|
570
|
-
/* @__PURE__ */ a(
|
|
595
|
+
/* @__PURE__ */ a(et, { size: 12 }),
|
|
571
596
|
c > 0 ? /* @__PURE__ */ a("span", { className: "font-mono text-[10px]", children: c }) : null
|
|
572
597
|
]
|
|
573
598
|
}
|
|
574
599
|
),
|
|
575
600
|
/* @__PURE__ */ h(
|
|
576
|
-
|
|
601
|
+
he,
|
|
577
602
|
{
|
|
578
|
-
|
|
579
|
-
|
|
603
|
+
side: "right",
|
|
604
|
+
align: "start",
|
|
605
|
+
sideOffset: 8,
|
|
580
606
|
className: "w-64 space-y-3 p-3 text-[12px]",
|
|
581
607
|
children: [
|
|
582
608
|
l.map((x) => /* @__PURE__ */ a(
|
|
@@ -584,13 +610,13 @@ function vt({
|
|
|
584
610
|
{
|
|
585
611
|
config: x,
|
|
586
612
|
values: (o == null ? void 0 : o[x.key]) ?? [],
|
|
587
|
-
selected:
|
|
613
|
+
selected: d[x.key] ?? [],
|
|
588
614
|
onToggle: s
|
|
589
615
|
},
|
|
590
616
|
x.key
|
|
591
617
|
)),
|
|
592
618
|
c > 0 ? /* @__PURE__ */ h(J, { type: "button", variant: "ghost", size: "xs", onClick: i, className: "gap-1 text-[11px] text-muted-foreground hover:text-foreground", children: [
|
|
593
|
-
/* @__PURE__ */ a(
|
|
619
|
+
/* @__PURE__ */ a(pe, { size: 11 }),
|
|
594
620
|
" Clear all"
|
|
595
621
|
] }) : null
|
|
596
622
|
]
|
|
@@ -606,19 +632,19 @@ function St({
|
|
|
606
632
|
onToggle: n
|
|
607
633
|
}) {
|
|
608
634
|
if (!t.length) return null;
|
|
609
|
-
const l = e.order ? [...t].sort((o,
|
|
610
|
-
const c = e.order.indexOf(o.value), s = e.order.indexOf(
|
|
635
|
+
const l = e.order ? [...t].sort((o, d) => {
|
|
636
|
+
const c = e.order.indexOf(o.value), s = e.order.indexOf(d.value);
|
|
611
637
|
return (c === -1 ? 999 : c) - (s === -1 ? 999 : s);
|
|
612
638
|
}) : t;
|
|
613
639
|
return /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
|
|
614
640
|
/* @__PURE__ */ a("div", { className: "font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: e.label }),
|
|
615
641
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: l.map((o) => {
|
|
616
|
-
const
|
|
642
|
+
const d = r.includes(o.value), c = e.formatValue ? e.formatValue(o.value) : o.value;
|
|
617
643
|
return /* @__PURE__ */ h(
|
|
618
|
-
|
|
644
|
+
ct,
|
|
619
645
|
{
|
|
620
646
|
type: "button",
|
|
621
|
-
selected:
|
|
647
|
+
selected: d,
|
|
622
648
|
onClick: () => n(e.key, o.value),
|
|
623
649
|
className: "gap-1 rounded-sm text-[11px]",
|
|
624
650
|
children: [
|
|
@@ -631,7 +657,7 @@ function St({
|
|
|
631
657
|
}) })
|
|
632
658
|
] });
|
|
633
659
|
}
|
|
634
|
-
function
|
|
660
|
+
function Ct({
|
|
635
661
|
items: e,
|
|
636
662
|
hasMore: t,
|
|
637
663
|
loading: r,
|
|
@@ -640,30 +666,30 @@ function Nt({
|
|
|
640
666
|
getDragPayload: o
|
|
641
667
|
}) {
|
|
642
668
|
return /* @__PURE__ */ h("ul", { className: "flex flex-col px-1 py-1", children: [
|
|
643
|
-
e.map((
|
|
644
|
-
|
|
669
|
+
e.map((d) => /* @__PURE__ */ a(
|
|
670
|
+
Oe,
|
|
645
671
|
{
|
|
646
|
-
row:
|
|
672
|
+
row: d,
|
|
647
673
|
onActivate: l,
|
|
648
674
|
getDragPayload: o
|
|
649
675
|
},
|
|
650
|
-
|
|
676
|
+
d.id
|
|
651
677
|
)),
|
|
652
678
|
t ? /* @__PURE__ */ a("li", { className: "px-3 py-2", children: /* @__PURE__ */ a(J, { type: "button", variant: "ghost", size: "xs", onClick: n, disabled: r, className: "w-full justify-start text-[11px] text-muted-foreground hover:text-foreground", children: r ? "Loading…" : "Load more" }) }) : null
|
|
653
679
|
] });
|
|
654
680
|
}
|
|
655
|
-
function
|
|
681
|
+
function Tt({
|
|
656
682
|
entries: e,
|
|
657
683
|
isExpanded: t,
|
|
658
684
|
getGroup: r,
|
|
659
685
|
onExpand: n,
|
|
660
686
|
onCollapse: l,
|
|
661
687
|
onLoadMoreGroup: o,
|
|
662
|
-
onActivate:
|
|
688
|
+
onActivate: d,
|
|
663
689
|
getDragPayload: c
|
|
664
690
|
}) {
|
|
665
691
|
return /* @__PURE__ */ a("ul", { className: "flex flex-col py-1", children: e.map((s) => {
|
|
666
|
-
const i = t(s.value),
|
|
692
|
+
const i = t(s.value), u = r(s.value);
|
|
667
693
|
return /* @__PURE__ */ h("li", { children: [
|
|
668
694
|
/* @__PURE__ */ h(
|
|
669
695
|
J,
|
|
@@ -675,33 +701,33 @@ function Ct({
|
|
|
675
701
|
onClick: () => i ? l(s.value) : n(s.value),
|
|
676
702
|
className: "group mx-1 h-auto w-[calc(100%-0.5rem)] justify-start gap-1.5 px-1.5 py-1 text-left hover:bg-muted/40",
|
|
677
703
|
children: [
|
|
678
|
-
i ? /* @__PURE__ */ a(
|
|
704
|
+
i ? /* @__PURE__ */ a(Ee, { size: 11, className: "text-muted-foreground/80" }) : /* @__PURE__ */ a(we, { size: 11, className: "text-muted-foreground/80" }),
|
|
679
705
|
/* @__PURE__ */ a("span", { className: "text-[12.5px] font-medium text-foreground", children: s.label }),
|
|
680
706
|
/* @__PURE__ */ a("span", { className: "ml-auto font-mono text-[10.5px] text-muted-foreground/80", children: s.count.toLocaleString() })
|
|
681
707
|
]
|
|
682
708
|
}
|
|
683
709
|
),
|
|
684
710
|
i ? /* @__PURE__ */ h("ul", { className: "flex flex-col", children: [
|
|
685
|
-
|
|
686
|
-
|
|
711
|
+
u.items.map((x) => /* @__PURE__ */ a(
|
|
712
|
+
Oe,
|
|
687
713
|
{
|
|
688
714
|
row: x,
|
|
689
715
|
indent: !0,
|
|
690
|
-
onActivate:
|
|
716
|
+
onActivate: d,
|
|
691
717
|
getDragPayload: c
|
|
692
718
|
},
|
|
693
719
|
x.id
|
|
694
720
|
)),
|
|
695
|
-
|
|
696
|
-
/* @__PURE__ */ a(
|
|
721
|
+
u.loading && u.items.length === 0 ? /* @__PURE__ */ h("li", { className: "flex items-center gap-1.5 pl-7 pr-3 py-1.5 text-[11px] text-muted-foreground/80", children: [
|
|
722
|
+
/* @__PURE__ */ a(st, { className: "size-3" }),
|
|
697
723
|
"Loading…"
|
|
698
724
|
] }) : null,
|
|
699
|
-
|
|
725
|
+
u.hasMore ? /* @__PURE__ */ a("li", { className: "pl-7 pr-3 py-1", children: /* @__PURE__ */ a(J, { type: "button", variant: "ghost", size: "xs", onClick: () => o(s.value), disabled: u.loading, className: "text-[11px] text-muted-foreground hover:text-foreground", children: u.loading ? "Loading…" : "Load more" }) }) : null
|
|
700
726
|
] }) : null
|
|
701
727
|
] }, s.value);
|
|
702
728
|
}) });
|
|
703
729
|
}
|
|
704
|
-
function
|
|
730
|
+
function Oe({
|
|
705
731
|
row: e,
|
|
706
732
|
indent: t,
|
|
707
733
|
onActivate: r,
|
|
@@ -712,11 +738,11 @@ function Me({
|
|
|
712
738
|
return /* @__PURE__ */ h(
|
|
713
739
|
"li",
|
|
714
740
|
{
|
|
715
|
-
...l ? { role: "button", tabIndex: 0, onClick: () => r == null ? void 0 : r(e), onKeyDown: (
|
|
716
|
-
l && (
|
|
741
|
+
...l ? { role: "button", tabIndex: 0, onClick: () => r == null ? void 0 : r(e), onKeyDown: (u) => {
|
|
742
|
+
l && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), r == null || r(e));
|
|
717
743
|
} } : {},
|
|
718
|
-
...!!o ? { draggable: !0, onDragStart: (
|
|
719
|
-
o && (
|
|
744
|
+
...!!o ? { draggable: !0, onDragStart: (u) => {
|
|
745
|
+
o && (u.dataTransfer.setData(o.mimeType, o.value), u.dataTransfer.setData("text/plain", o.value), u.dataTransfer.effectAllowed = "copy");
|
|
720
746
|
} } : {},
|
|
721
747
|
className: H(
|
|
722
748
|
"group mx-1 flex items-start gap-2 rounded-md px-1.5 py-1",
|
|
@@ -726,20 +752,20 @@ function Me({
|
|
|
726
752
|
),
|
|
727
753
|
title: e.title,
|
|
728
754
|
children: [
|
|
729
|
-
e.leading ? /* @__PURE__ */ a(
|
|
755
|
+
e.leading ? /* @__PURE__ */ a(ve, { badge: e.leading }) : null,
|
|
730
756
|
/* @__PURE__ */ h("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
731
757
|
/* @__PURE__ */ a("span", { className: "truncate text-[12.5px] font-medium leading-tight text-foreground", children: e.title }),
|
|
732
758
|
e.subtitle ? /* @__PURE__ */ a("span", { className: "truncate text-[11.5px] leading-snug text-muted-foreground/85", children: e.subtitle }) : null
|
|
733
759
|
] }),
|
|
734
|
-
(i = e.trailing) != null && i.length ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1", children: e.trailing.map((
|
|
760
|
+
(i = e.trailing) != null && i.length ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1", children: e.trailing.map((u, x) => /* @__PURE__ */ a(ve, { badge: u }, x)) }) : null,
|
|
735
761
|
e.meta ? /* @__PURE__ */ a("span", { className: "shrink-0 self-center font-mono text-[10.5px] text-muted-foreground/80", children: e.meta }) : null
|
|
736
762
|
]
|
|
737
763
|
}
|
|
738
764
|
);
|
|
739
765
|
}
|
|
740
|
-
function
|
|
766
|
+
function ve({ badge: e }) {
|
|
741
767
|
return /* @__PURE__ */ a(
|
|
742
|
-
|
|
768
|
+
it,
|
|
743
769
|
{
|
|
744
770
|
"aria-hidden": "true",
|
|
745
771
|
title: e.tooltip,
|
|
@@ -748,12 +774,12 @@ function he({ badge: e }) {
|
|
|
748
774
|
}
|
|
749
775
|
);
|
|
750
776
|
}
|
|
751
|
-
const
|
|
752
|
-
function
|
|
777
|
+
const lr = "explorer";
|
|
778
|
+
function Pt(e) {
|
|
753
779
|
return e.mode ? e.mode : e.sectionedAdapter ? "sectioned" : e.groupBy ? "grouped" : "flat";
|
|
754
780
|
}
|
|
755
|
-
function
|
|
756
|
-
const t =
|
|
781
|
+
function kt(e) {
|
|
782
|
+
const t = Pt(e);
|
|
757
783
|
if (t === "sectioned") {
|
|
758
784
|
if (!e.sectionedAdapter)
|
|
759
785
|
throw new Error(`explorer "${e.id}" requires sectionedAdapter for sectioned mode`);
|
|
@@ -790,26 +816,26 @@ function Pt(e) {
|
|
|
790
816
|
className: e.className
|
|
791
817
|
};
|
|
792
818
|
}
|
|
793
|
-
function
|
|
819
|
+
function Ne(e) {
|
|
794
820
|
if (e.mode === "sectioned") {
|
|
795
821
|
const {
|
|
796
822
|
sectionedAdapter: l,
|
|
797
823
|
mode: o,
|
|
798
|
-
adapter:
|
|
824
|
+
adapter: d,
|
|
799
825
|
facets: c,
|
|
800
826
|
groupBy: s,
|
|
801
827
|
...i
|
|
802
828
|
} = e;
|
|
803
|
-
return /* @__PURE__ */ a(
|
|
829
|
+
return /* @__PURE__ */ a(wt, { adapter: l, ...i });
|
|
804
830
|
}
|
|
805
831
|
const { mode: t, sectionedAdapter: r, ...n } = e;
|
|
806
832
|
return /* @__PURE__ */ a(ie, { ...n });
|
|
807
833
|
}
|
|
808
|
-
function
|
|
809
|
-
const t = [], r = e.label ?? "Explorer", n =
|
|
834
|
+
function Et(e) {
|
|
835
|
+
const t = [], r = e.label ?? "Explorer", n = kt(e), l = e.source ?? "app";
|
|
810
836
|
function o({ params: c, className: s }) {
|
|
811
837
|
return /* @__PURE__ */ a(
|
|
812
|
-
|
|
838
|
+
Ne,
|
|
813
839
|
{
|
|
814
840
|
...n,
|
|
815
841
|
query: (c == null ? void 0 : c.searchQuery) ?? (c == null ? void 0 : c.query) ?? n.query,
|
|
@@ -817,8 +843,8 @@ function kt(e) {
|
|
|
817
843
|
}
|
|
818
844
|
);
|
|
819
845
|
}
|
|
820
|
-
function
|
|
821
|
-
return /* @__PURE__ */ a(
|
|
846
|
+
function d({ className: c }) {
|
|
847
|
+
return /* @__PURE__ */ a(Ne, { ...n, className: c ?? n.className ?? "h-full" });
|
|
822
848
|
}
|
|
823
849
|
if (e.leftTab !== !1) {
|
|
824
850
|
const c = e.leftTab ?? {};
|
|
@@ -833,11 +859,11 @@ function kt(e) {
|
|
|
833
859
|
});
|
|
834
860
|
}
|
|
835
861
|
if (e.panel) {
|
|
836
|
-
const c =
|
|
862
|
+
const c = Re({
|
|
837
863
|
id: e.panel.id ?? `${e.id}-panel`,
|
|
838
864
|
title: e.panel.title ?? e.panel.label ?? r,
|
|
839
865
|
icon: e.panel.icon,
|
|
840
|
-
component:
|
|
866
|
+
component: d,
|
|
841
867
|
placement: "center",
|
|
842
868
|
source: l
|
|
843
869
|
});
|
|
@@ -857,40 +883,40 @@ function kt(e) {
|
|
|
857
883
|
}
|
|
858
884
|
return t;
|
|
859
885
|
}
|
|
860
|
-
function
|
|
886
|
+
function or(e) {
|
|
861
887
|
return ae({
|
|
862
888
|
id: e.pluginId ?? e.id,
|
|
863
889
|
label: e.label ?? "Explorer",
|
|
864
|
-
outputs:
|
|
890
|
+
outputs: Et(e)
|
|
865
891
|
});
|
|
866
892
|
}
|
|
867
893
|
function se(e) {
|
|
868
894
|
return e instanceof DOMException && e.name === "AbortError";
|
|
869
895
|
}
|
|
870
|
-
function
|
|
896
|
+
function wt({
|
|
871
897
|
adapter: e,
|
|
872
898
|
onActivate: t,
|
|
873
899
|
getDragPayload: r,
|
|
874
900
|
emptyState: n = "No results",
|
|
875
901
|
searchPlaceholder: l = "Search…",
|
|
876
902
|
searchable: o = !0,
|
|
877
|
-
query:
|
|
903
|
+
query: d,
|
|
878
904
|
pageSize: c = 50,
|
|
879
905
|
className: s
|
|
880
906
|
}) {
|
|
881
|
-
const i =
|
|
882
|
-
|
|
883
|
-
const N =
|
|
884
|
-
N.current =
|
|
885
|
-
const b =
|
|
886
|
-
async (
|
|
907
|
+
const i = d !== void 0, [u, x] = V(d ?? ""), [g, m] = V([]), [C, y] = V({}), [P, O] = V({}), [j, F] = V({}), [_, S] = V(!1), [z, k] = V({}), [L, B] = V({}), [T, G] = V({}), [D, Q] = V({}), U = I(null), te = I(/* @__PURE__ */ new Map()), Z = d ?? u, p = I(C);
|
|
908
|
+
p.current = C;
|
|
909
|
+
const N = I(L);
|
|
910
|
+
N.current = L;
|
|
911
|
+
const b = v(
|
|
912
|
+
async (f, M, w) => {
|
|
887
913
|
var $;
|
|
888
|
-
($ = te.current.get(
|
|
914
|
+
($ = te.current.get(f)) == null || $.abort();
|
|
889
915
|
const A = new AbortController();
|
|
890
|
-
te.current.set(
|
|
916
|
+
te.current.set(f, A), k((K) => ({ ...K, [f]: !0 }));
|
|
891
917
|
try {
|
|
892
|
-
const K =
|
|
893
|
-
query:
|
|
918
|
+
const K = T[f] ?? {}, q = await e.searchSection(f, {
|
|
919
|
+
query: Z,
|
|
894
920
|
globalFilters: {},
|
|
895
921
|
filters: K,
|
|
896
922
|
limit: c,
|
|
@@ -898,145 +924,145 @@ function Et({
|
|
|
898
924
|
signal: A.signal
|
|
899
925
|
});
|
|
900
926
|
if (A.signal.aborted) return;
|
|
901
|
-
|
|
902
|
-
...
|
|
903
|
-
[
|
|
904
|
-
})),
|
|
927
|
+
y((W) => ({
|
|
928
|
+
...W,
|
|
929
|
+
[f]: w ? [...W[f] ?? [], ...q.items] : q.items
|
|
930
|
+
})), O((W) => ({ ...W, [f]: q.total })), F((W) => ({ ...W, [f]: q.hasMore }));
|
|
905
931
|
} catch (K) {
|
|
906
932
|
se(K) || console.error("Explorer: section search failed", K);
|
|
907
933
|
} finally {
|
|
908
|
-
te.current.get(
|
|
934
|
+
te.current.get(f) === A && k((K) => ({ ...K, [f]: !1 }));
|
|
909
935
|
}
|
|
910
936
|
},
|
|
911
|
-
[e,
|
|
912
|
-
),
|
|
913
|
-
async (
|
|
937
|
+
[e, Z, c, T]
|
|
938
|
+
), R = v(
|
|
939
|
+
async (f) => {
|
|
914
940
|
if (e.fetchSectionFacets)
|
|
915
941
|
try {
|
|
916
|
-
const M = await e.fetchSectionFacets(
|
|
917
|
-
query:
|
|
942
|
+
const M = await e.fetchSectionFacets(f, {
|
|
943
|
+
query: Z,
|
|
918
944
|
globalFilters: {},
|
|
919
|
-
filters:
|
|
945
|
+
filters: T[f] ?? {}
|
|
920
946
|
});
|
|
921
|
-
|
|
947
|
+
Q((w) => ({ ...w, [f]: M }));
|
|
922
948
|
} catch (M) {
|
|
923
949
|
se(M) || console.error("Explorer: section facets failed", M);
|
|
924
950
|
}
|
|
925
951
|
},
|
|
926
|
-
[e,
|
|
927
|
-
),
|
|
928
|
-
|
|
952
|
+
[e, Z, T]
|
|
953
|
+
), E = I(b), X = I(R);
|
|
954
|
+
E.current = b, X.current = R, Y(() => {
|
|
929
955
|
var M;
|
|
930
|
-
(M =
|
|
931
|
-
const
|
|
932
|
-
return
|
|
933
|
-
if (
|
|
934
|
-
|
|
956
|
+
(M = U.current) == null || M.abort();
|
|
957
|
+
const f = new AbortController();
|
|
958
|
+
return U.current = f, S(!0), e.sections({ query: Z, globalFilters: {}, signal: f.signal }).then((w) => {
|
|
959
|
+
if (f.signal.aborted) return;
|
|
960
|
+
m(w);
|
|
935
961
|
const A = {};
|
|
936
|
-
for (const $ of
|
|
937
|
-
|
|
938
|
-
for (const $ of
|
|
939
|
-
$.defaultExpanded && (
|
|
940
|
-
}).catch((
|
|
941
|
-
se(
|
|
962
|
+
for (const $ of w) A[$.id] = !!$.defaultExpanded;
|
|
963
|
+
B(A), y({}), F({}), O({});
|
|
964
|
+
for (const $ of w)
|
|
965
|
+
$.defaultExpanded && (X.current($.id), E.current($.id, 0, !1));
|
|
966
|
+
}).catch((w) => {
|
|
967
|
+
se(w) || console.error("Explorer: sections failed", w);
|
|
942
968
|
}).finally(() => {
|
|
943
|
-
|
|
944
|
-
}), () =>
|
|
945
|
-
}, [e,
|
|
946
|
-
const
|
|
947
|
-
(
|
|
948
|
-
|
|
949
|
-
const
|
|
950
|
-
return
|
|
969
|
+
U.current === f && S(!1);
|
|
970
|
+
}), () => f.abort();
|
|
971
|
+
}, [e, Z]);
|
|
972
|
+
const qe = v(
|
|
973
|
+
(f) => {
|
|
974
|
+
B((M) => {
|
|
975
|
+
const w = !M[f];
|
|
976
|
+
return w && !(f in p.current) && (R(f), b(f, 0, !1)), { ...M, [f]: w };
|
|
951
977
|
});
|
|
952
978
|
},
|
|
953
|
-
[
|
|
954
|
-
),
|
|
955
|
-
(
|
|
956
|
-
|
|
957
|
-
const $ = A[
|
|
958
|
-
return
|
|
959
|
-
}),
|
|
979
|
+
[R, b]
|
|
980
|
+
), _e = v(
|
|
981
|
+
(f, M, w) => {
|
|
982
|
+
G((A) => {
|
|
983
|
+
const $ = A[f] ?? {}, K = $[M] ?? [], q = K.includes(w) ? K.filter((Ae) => Ae !== w) : [...K, w], W = { ...$ };
|
|
984
|
+
return q.length ? W[M] = q : delete W[M], { ...A, [f]: W };
|
|
985
|
+
}), y((A) => ({ ...A, [f]: [] }));
|
|
960
986
|
},
|
|
961
987
|
[]
|
|
962
988
|
);
|
|
963
|
-
|
|
964
|
-
for (const
|
|
965
|
-
N.current[
|
|
966
|
-
}, [
|
|
967
|
-
const
|
|
989
|
+
Y(() => {
|
|
990
|
+
for (const f of Object.keys(T))
|
|
991
|
+
N.current[f] && (R(f), b(f, 0, !1));
|
|
992
|
+
}, [T, R, b]);
|
|
993
|
+
const Be = !_ && g.length === 0;
|
|
968
994
|
return /* @__PURE__ */ h("div", { className: H("flex h-full flex-col", s), "data-slot": "sectioned-explorer", children: [
|
|
969
995
|
o && !i ? /* @__PURE__ */ a("div", { className: "border-b border-border/60 px-2 py-1.5", children: /* @__PURE__ */ a(
|
|
970
|
-
|
|
996
|
+
Me,
|
|
971
997
|
{
|
|
972
998
|
"aria-label": "Search",
|
|
973
999
|
placeholder: l,
|
|
974
|
-
value:
|
|
975
|
-
onChange: (
|
|
1000
|
+
value: u,
|
|
1001
|
+
onChange: (f) => x(f.target.value),
|
|
976
1002
|
className: "h-7 rounded-sm border-transparent bg-muted/40 px-2 text-[12.5px] shadow-none focus-visible:bg-background focus-visible:ring-1"
|
|
977
1003
|
}
|
|
978
1004
|
) }) : null,
|
|
979
|
-
/* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", "data-slot": "sectioned-explorer-list", children:
|
|
980
|
-
const M = !!
|
|
981
|
-
(
|
|
982
|
-
), $ =
|
|
1005
|
+
/* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", "data-slot": "sectioned-explorer-list", children: Be ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center px-4 py-8 text-[12px] text-muted-foreground", children: n }) : /* @__PURE__ */ a("ul", { className: "flex flex-col py-1", children: g.map((f) => {
|
|
1006
|
+
const M = !!L[f.id], w = C[f.id] ?? [], A = Object.fromEntries(
|
|
1007
|
+
(f.filters ?? []).map((q) => [q.key, q.values ?? []])
|
|
1008
|
+
), $ = D[f.id] ?? A, K = T[f.id] ?? {};
|
|
983
1009
|
return /* @__PURE__ */ h("li", { children: [
|
|
984
1010
|
/* @__PURE__ */ h(
|
|
985
1011
|
"button",
|
|
986
1012
|
{
|
|
987
1013
|
type: "button",
|
|
988
1014
|
"aria-expanded": M,
|
|
989
|
-
onClick: () =>
|
|
1015
|
+
onClick: () => qe(f.id),
|
|
990
1016
|
className: H(
|
|
991
1017
|
"group mx-1 flex w-[calc(100%-0.5rem)] items-center gap-1.5 rounded-md px-1.5 py-1 text-left",
|
|
992
1018
|
"transition-colors duration-120 ease-[cubic-bezier(0.22,1,0.36,1)] hover:bg-muted/40"
|
|
993
1019
|
),
|
|
994
1020
|
children: [
|
|
995
|
-
M ? /* @__PURE__ */ a(
|
|
996
|
-
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground", children:
|
|
997
|
-
/* @__PURE__ */ a("span", { className: "font-mono text-[10.5px] text-muted-foreground/80", children: (
|
|
1021
|
+
M ? /* @__PURE__ */ a(Ee, { size: 11 }) : /* @__PURE__ */ a(we, { size: 11 }),
|
|
1022
|
+
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground", children: f.title }),
|
|
1023
|
+
/* @__PURE__ */ a("span", { className: "font-mono text-[10.5px] text-muted-foreground/80", children: (P[f.id] ?? f.count ?? 0).toLocaleString() })
|
|
998
1024
|
]
|
|
999
1025
|
}
|
|
1000
1026
|
),
|
|
1001
1027
|
M ? /* @__PURE__ */ h("div", { children: [
|
|
1002
1028
|
/* @__PURE__ */ a(
|
|
1003
|
-
|
|
1029
|
+
It,
|
|
1004
1030
|
{
|
|
1005
|
-
configs:
|
|
1031
|
+
configs: f.filters ?? [],
|
|
1006
1032
|
facets: $,
|
|
1007
1033
|
selected: K,
|
|
1008
|
-
onToggle: (
|
|
1034
|
+
onToggle: (q, W) => _e(f.id, q, W)
|
|
1009
1035
|
}
|
|
1010
1036
|
),
|
|
1011
1037
|
/* @__PURE__ */ h("ul", { className: "flex flex-col", children: [
|
|
1012
|
-
|
|
1038
|
+
w.map((q) => /* @__PURE__ */ a(
|
|
1013
1039
|
Mt,
|
|
1014
1040
|
{
|
|
1015
|
-
row:
|
|
1041
|
+
row: q,
|
|
1016
1042
|
indent: !0,
|
|
1017
1043
|
onActivate: t,
|
|
1018
1044
|
getDragPayload: r
|
|
1019
1045
|
},
|
|
1020
|
-
|
|
1046
|
+
q.id
|
|
1021
1047
|
)),
|
|
1022
|
-
|
|
1023
|
-
j[
|
|
1048
|
+
z[f.id] && w.length === 0 ? /* @__PURE__ */ a("li", { className: "py-1.5 pl-7 pr-3 text-[11px] text-muted-foreground/80", children: "Loading…" }) : null,
|
|
1049
|
+
j[f.id] ? /* @__PURE__ */ a("li", { className: "py-1 pl-7 pr-3", children: /* @__PURE__ */ a(
|
|
1024
1050
|
"button",
|
|
1025
1051
|
{
|
|
1026
1052
|
type: "button",
|
|
1027
|
-
onClick: () => b(
|
|
1028
|
-
disabled:
|
|
1053
|
+
onClick: () => b(f.id, w.length, !0),
|
|
1054
|
+
disabled: z[f.id],
|
|
1029
1055
|
className: "text-[11px] text-muted-foreground hover:text-foreground disabled:opacity-60",
|
|
1030
|
-
children:
|
|
1056
|
+
children: z[f.id] ? "Loading…" : "Load more"
|
|
1031
1057
|
}
|
|
1032
1058
|
) }) : null
|
|
1033
1059
|
] })
|
|
1034
1060
|
] }) : null
|
|
1035
|
-
] },
|
|
1061
|
+
] }, f.id);
|
|
1036
1062
|
}) }) })
|
|
1037
1063
|
] });
|
|
1038
1064
|
}
|
|
1039
|
-
function
|
|
1065
|
+
function It({
|
|
1040
1066
|
configs: e,
|
|
1041
1067
|
facets: t,
|
|
1042
1068
|
selected: r,
|
|
@@ -1044,24 +1070,24 @@ function wt({
|
|
|
1044
1070
|
}) {
|
|
1045
1071
|
return e.length ? /* @__PURE__ */ a("div", { className: "space-y-1 px-7 py-1", children: e.map((l) => {
|
|
1046
1072
|
const o = t[l.key] ?? l.values ?? [];
|
|
1047
|
-
return o.length ? /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: o.map((
|
|
1073
|
+
return o.length ? /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: o.map((d) => {
|
|
1048
1074
|
var i;
|
|
1049
|
-
const c = ((i = r[l.key]) == null ? void 0 : i.includes(
|
|
1075
|
+
const c = ((i = r[l.key]) == null ? void 0 : i.includes(d.value)) ?? !1, s = l.formatValue ? l.formatValue(d.value) : d.value;
|
|
1050
1076
|
return /* @__PURE__ */ h(
|
|
1051
1077
|
"button",
|
|
1052
1078
|
{
|
|
1053
1079
|
type: "button",
|
|
1054
|
-
onClick: () => n(l.key,
|
|
1080
|
+
onClick: () => n(l.key, d.value),
|
|
1055
1081
|
className: H(
|
|
1056
1082
|
"rounded border px-1.5 py-0.5 text-[10.5px] transition-colors",
|
|
1057
1083
|
c ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/70 text-muted-foreground hover:text-foreground"
|
|
1058
1084
|
),
|
|
1059
1085
|
children: [
|
|
1060
1086
|
s,
|
|
1061
|
-
/* @__PURE__ */ a("span", { className: "ml-1 font-mono opacity-70", children:
|
|
1087
|
+
/* @__PURE__ */ a("span", { className: "ml-1 font-mono opacity-70", children: d.count })
|
|
1062
1088
|
]
|
|
1063
1089
|
},
|
|
1064
|
-
|
|
1090
|
+
d.value
|
|
1065
1091
|
);
|
|
1066
1092
|
}) }, l.key) : null;
|
|
1067
1093
|
}) }) : null;
|
|
@@ -1091,18 +1117,18 @@ function Mt({
|
|
|
1091
1117
|
),
|
|
1092
1118
|
title: e.title,
|
|
1093
1119
|
children: [
|
|
1094
|
-
e.leading ? /* @__PURE__ */ a(
|
|
1120
|
+
e.leading ? /* @__PURE__ */ a(Se, { badge: e.leading }) : null,
|
|
1095
1121
|
/* @__PURE__ */ h("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
1096
1122
|
/* @__PURE__ */ a("span", { className: "truncate text-[12.5px] font-medium leading-tight text-foreground", children: e.title }),
|
|
1097
1123
|
e.subtitle ? /* @__PURE__ */ a("span", { className: "truncate text-[11.5px] leading-snug text-muted-foreground/85", children: e.subtitle }) : null
|
|
1098
1124
|
] }),
|
|
1099
|
-
(s = e.trailing) != null && s.length ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1", children: e.trailing.map((i,
|
|
1125
|
+
(s = e.trailing) != null && s.length ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1", children: e.trailing.map((i, u) => /* @__PURE__ */ a(Se, { badge: i }, u)) }) : null,
|
|
1100
1126
|
e.meta ? /* @__PURE__ */ a("span", { className: "shrink-0 self-center font-mono text-[10.5px] text-muted-foreground/80", children: e.meta }) : null
|
|
1101
1127
|
]
|
|
1102
1128
|
}
|
|
1103
1129
|
);
|
|
1104
1130
|
}
|
|
1105
|
-
function
|
|
1131
|
+
function Se({ badge: e }) {
|
|
1106
1132
|
return /* @__PURE__ */ a(
|
|
1107
1133
|
"span",
|
|
1108
1134
|
{
|
|
@@ -1113,21 +1139,21 @@ function ye({ badge: e }) {
|
|
|
1113
1139
|
}
|
|
1114
1140
|
);
|
|
1115
1141
|
}
|
|
1116
|
-
const ue = "data-catalog",
|
|
1142
|
+
const ue = "data-catalog", sr = "query_data_catalog", de = "data-catalog.open-row";
|
|
1117
1143
|
function Dt(e) {
|
|
1118
1144
|
let t = 2166136261;
|
|
1119
1145
|
for (let r = 0; r < e.length; r++)
|
|
1120
1146
|
t ^= e.charCodeAt(r), t = Math.imul(t, 16777619);
|
|
1121
1147
|
return (t >>> 0).toString(36);
|
|
1122
1148
|
}
|
|
1123
|
-
function
|
|
1149
|
+
function Ce(e) {
|
|
1124
1150
|
return e.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32) || "row";
|
|
1125
1151
|
}
|
|
1126
|
-
function
|
|
1127
|
-
const r = Dt(e), n =
|
|
1152
|
+
function Rt(e, t = "data") {
|
|
1153
|
+
const r = Dt(e), n = Ce(e), l = Ce(t), o = `${n}-${r}`, d = Math.max(0, 64 - o.length - 1), c = l.slice(0, d);
|
|
1128
1154
|
return c ? `${c}-${o}` : o.slice(0, 64);
|
|
1129
1155
|
}
|
|
1130
|
-
function
|
|
1156
|
+
function Fe(e, t) {
|
|
1131
1157
|
const r = {
|
|
1132
1158
|
...t.params ?? {},
|
|
1133
1159
|
// Keep routing keys authoritative even when callers pass extra params.
|
|
@@ -1135,7 +1161,7 @@ function De(e, t) {
|
|
|
1135
1161
|
catalogId: t.catalogId,
|
|
1136
1162
|
...t.title ? { title: t.title } : {}
|
|
1137
1163
|
};
|
|
1138
|
-
|
|
1164
|
+
Ve({
|
|
1139
1165
|
kind: "openSurface",
|
|
1140
1166
|
params: {
|
|
1141
1167
|
kind: t.surfaceKind ?? de,
|
|
@@ -1144,65 +1170,65 @@ function De(e, t) {
|
|
|
1144
1170
|
}
|
|
1145
1171
|
});
|
|
1146
1172
|
}
|
|
1147
|
-
function Rt(e) {
|
|
1148
|
-
return (t) => De(t, e);
|
|
1149
|
-
}
|
|
1150
1173
|
function Ot(e) {
|
|
1174
|
+
return (t) => Fe(t, e);
|
|
1175
|
+
}
|
|
1176
|
+
function Ft(e) {
|
|
1151
1177
|
if (!e || typeof e != "object") return !1;
|
|
1152
1178
|
const t = e;
|
|
1153
1179
|
return typeof t.id == "string" && typeof t.title == "string";
|
|
1154
1180
|
}
|
|
1155
|
-
function
|
|
1181
|
+
function Te(e, t) {
|
|
1156
1182
|
const r = e[t];
|
|
1157
1183
|
return typeof r == "string" && r.length > 0 ? r : void 0;
|
|
1158
1184
|
}
|
|
1159
|
-
function
|
|
1185
|
+
function Lt(e) {
|
|
1160
1186
|
const t = e.surfaceKind ?? de, r = e.panelIdPrefix ?? e.id;
|
|
1161
1187
|
return {
|
|
1162
1188
|
id: e.surfaceResolverId ?? `${e.id}-row`,
|
|
1163
1189
|
source: e.source,
|
|
1164
1190
|
resolve(n) {
|
|
1165
1191
|
if (n.kind !== t) return;
|
|
1166
|
-
const l = n.meta ?? {}, o =
|
|
1192
|
+
const l = n.meta ?? {}, o = Te(l, "catalogId");
|
|
1167
1193
|
if (o && o !== e.catalogId) return;
|
|
1168
|
-
const
|
|
1194
|
+
const d = Ft(l.row) ? l.row : void 0, {
|
|
1169
1195
|
catalogId: c,
|
|
1170
1196
|
row: s,
|
|
1171
1197
|
title: i,
|
|
1172
|
-
...
|
|
1198
|
+
...u
|
|
1173
1199
|
} = l;
|
|
1174
1200
|
return {
|
|
1175
|
-
id:
|
|
1201
|
+
id: Rt(n.target, r),
|
|
1176
1202
|
component: e.visualizationPanelId,
|
|
1177
|
-
title:
|
|
1203
|
+
title: Te(l, "title") ?? (d == null ? void 0 : d.title) ?? e.visualizationTitle,
|
|
1178
1204
|
params: {
|
|
1179
|
-
...
|
|
1180
|
-
...
|
|
1205
|
+
...u,
|
|
1206
|
+
...d ? { row: d } : { query: n.target }
|
|
1181
1207
|
},
|
|
1182
1208
|
score: 0
|
|
1183
1209
|
};
|
|
1184
1210
|
}
|
|
1185
1211
|
};
|
|
1186
1212
|
}
|
|
1187
|
-
function
|
|
1213
|
+
function zt(e) {
|
|
1188
1214
|
if (!e || typeof e != "object") return;
|
|
1189
1215
|
const t = e;
|
|
1190
1216
|
if (!(typeof t.id != "string" || typeof t.title != "string"))
|
|
1191
1217
|
return t;
|
|
1192
1218
|
}
|
|
1193
|
-
function
|
|
1219
|
+
function Le(e) {
|
|
1194
1220
|
if (e) {
|
|
1195
1221
|
if ("searchQuery" in e && typeof e.searchQuery == "string")
|
|
1196
1222
|
return e.searchQuery;
|
|
1197
1223
|
if ("query" in e && typeof e.query == "string") return e.query;
|
|
1198
1224
|
}
|
|
1199
1225
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const t =
|
|
1226
|
+
function qt(e) {
|
|
1227
|
+
const t = Le(e);
|
|
1202
1228
|
return { query: t, controlled: t !== void 0 };
|
|
1203
1229
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const r =
|
|
1230
|
+
function _t(e, t) {
|
|
1231
|
+
const r = zt(e == null ? void 0 : e.row), n = Le(e) ?? (r == null ? void 0 : r.id);
|
|
1206
1232
|
return {
|
|
1207
1233
|
row: r,
|
|
1208
1234
|
query: n,
|
|
@@ -1210,68 +1236,68 @@ function qt(e, t) {
|
|
|
1210
1236
|
title: (r == null ? void 0 : r.title) ?? t
|
|
1211
1237
|
};
|
|
1212
1238
|
}
|
|
1213
|
-
function
|
|
1214
|
-
return
|
|
1239
|
+
function Bt(e) {
|
|
1240
|
+
return ee(() => qt(e), [e]);
|
|
1215
1241
|
}
|
|
1216
|
-
function
|
|
1217
|
-
return
|
|
1218
|
-
() =>
|
|
1242
|
+
function At(e, t) {
|
|
1243
|
+
return ee(
|
|
1244
|
+
() => _t(e, t),
|
|
1219
1245
|
[t, e]
|
|
1220
1246
|
);
|
|
1221
1247
|
}
|
|
1222
|
-
function
|
|
1248
|
+
function cr(e) {
|
|
1223
1249
|
const { catalogId: t, surfaceKind: r, title: n, params: l } = e;
|
|
1224
|
-
return
|
|
1225
|
-
(o) =>
|
|
1250
|
+
return v(
|
|
1251
|
+
(o) => Fe(o, { catalogId: t, surfaceKind: r, title: n, params: l }),
|
|
1226
1252
|
[t, r, n, l]
|
|
1227
1253
|
);
|
|
1228
1254
|
}
|
|
1229
|
-
function
|
|
1230
|
-
const t = e.id ?? ue, r = e.label ?? "Data", n = e.catalogId ?? t, l = e.catalogLabel ?? r, o = e.leftTabId ?? `${t}-tab`,
|
|
1255
|
+
function ze(e) {
|
|
1256
|
+
const t = e.id ?? ue, r = e.label ?? "Data", n = e.catalogId ?? t, l = e.catalogLabel ?? r, o = e.leftTabId ?? `${t}-tab`, d = e.leftTabTitle ?? r, c = e.visualizationPanelId ?? `${t}-visualization`, s = e.visualizationTitle ?? `${r} View`, i = e.surfaceKind ?? de, u = e.source ?? "app", x = e.includeVisualizationPanel ?? !0, g = e.includeLeftTab ?? !0, m = e.includeCatalog ?? !0, C = e.includeSurfaceResolver ?? (x && !e.onSelect), y = e.emptyState ?? "No data found", P = e.searchPlaceholder ?? `Search ${r.toLowerCase()}...`, O = e.onSelect ?? (x ? Ot({
|
|
1231
1257
|
catalogId: n,
|
|
1232
1258
|
surfaceKind: i
|
|
1233
1259
|
}) : () => {
|
|
1234
1260
|
});
|
|
1235
|
-
function j({ params:
|
|
1236
|
-
const { query:
|
|
1261
|
+
function j({ params: S, className: z }) {
|
|
1262
|
+
const { query: k, controlled: L } = Bt(S), B = S == null ? void 0 : S.bridge, T = (G) => O(G, { params: S, bridge: B });
|
|
1237
1263
|
return /* @__PURE__ */ a(
|
|
1238
1264
|
ie,
|
|
1239
1265
|
{
|
|
1240
1266
|
adapter: e.adapter,
|
|
1241
1267
|
facets: e.facets,
|
|
1242
1268
|
groupBy: e.groupBy,
|
|
1243
|
-
onActivate:
|
|
1269
|
+
onActivate: T,
|
|
1244
1270
|
getDragPayload: e.getDragPayload,
|
|
1245
|
-
emptyState:
|
|
1246
|
-
searchPlaceholder:
|
|
1247
|
-
query:
|
|
1248
|
-
searchable: !
|
|
1271
|
+
emptyState: y,
|
|
1272
|
+
searchPlaceholder: P,
|
|
1273
|
+
query: L ? k : void 0,
|
|
1274
|
+
searchable: !L,
|
|
1249
1275
|
pageSize: e.pageSize,
|
|
1250
1276
|
debounceMs: e.debounceMs,
|
|
1251
|
-
className:
|
|
1277
|
+
className: z ?? "h-full"
|
|
1252
1278
|
}
|
|
1253
1279
|
);
|
|
1254
1280
|
}
|
|
1255
|
-
function
|
|
1256
|
-
params:
|
|
1257
|
-
api:
|
|
1258
|
-
className:
|
|
1281
|
+
function F({
|
|
1282
|
+
params: S,
|
|
1283
|
+
api: z,
|
|
1284
|
+
className: k
|
|
1259
1285
|
}) {
|
|
1260
|
-
const { row:
|
|
1261
|
-
|
|
1286
|
+
const { row: L, query: B, controlled: T, title: G } = At(
|
|
1287
|
+
S,
|
|
1262
1288
|
s
|
|
1263
|
-
),
|
|
1289
|
+
), D = (Q) => O(Q, {});
|
|
1264
1290
|
return /* @__PURE__ */ h(
|
|
1265
|
-
|
|
1291
|
+
je,
|
|
1266
1292
|
{
|
|
1267
|
-
title:
|
|
1268
|
-
icon: e.visualizationIcon ??
|
|
1269
|
-
panelApi:
|
|
1270
|
-
className:
|
|
1293
|
+
title: G,
|
|
1294
|
+
icon: e.visualizationIcon ?? fe,
|
|
1295
|
+
panelApi: z,
|
|
1296
|
+
className: k,
|
|
1271
1297
|
children: [
|
|
1272
|
-
|
|
1273
|
-
/* @__PURE__ */ a("div", { className: "truncate text-sm font-medium text-foreground", children:
|
|
1274
|
-
/* @__PURE__ */ a("div", { className: "truncate text-xs text-muted-foreground", children:
|
|
1298
|
+
L ? /* @__PURE__ */ h("div", { className: "border-b border-border/60 px-3 py-2", children: [
|
|
1299
|
+
/* @__PURE__ */ a("div", { className: "truncate text-sm font-medium text-foreground", children: L.title }),
|
|
1300
|
+
/* @__PURE__ */ a("div", { className: "truncate text-xs text-muted-foreground", children: L.subtitle ?? L.id })
|
|
1275
1301
|
] }) : null,
|
|
1276
1302
|
/* @__PURE__ */ a(
|
|
1277
1303
|
ie,
|
|
@@ -1279,12 +1305,12 @@ function Re(e) {
|
|
|
1279
1305
|
adapter: e.adapter,
|
|
1280
1306
|
facets: e.facets,
|
|
1281
1307
|
groupBy: e.groupBy,
|
|
1282
|
-
onActivate:
|
|
1308
|
+
onActivate: D,
|
|
1283
1309
|
getDragPayload: e.getDragPayload,
|
|
1284
|
-
emptyState:
|
|
1285
|
-
searchPlaceholder:
|
|
1286
|
-
query:
|
|
1287
|
-
searchable: !
|
|
1310
|
+
emptyState: y,
|
|
1311
|
+
searchPlaceholder: P,
|
|
1312
|
+
query: T ? B : void 0,
|
|
1313
|
+
searchable: !T,
|
|
1288
1314
|
pageSize: e.pageSize,
|
|
1289
1315
|
debounceMs: e.debounceMs,
|
|
1290
1316
|
className: "h-full"
|
|
@@ -1294,41 +1320,41 @@ function Re(e) {
|
|
|
1294
1320
|
}
|
|
1295
1321
|
);
|
|
1296
1322
|
}
|
|
1297
|
-
const
|
|
1298
|
-
if (
|
|
1323
|
+
const _ = [];
|
|
1324
|
+
if (g && _.push({
|
|
1299
1325
|
type: "left-tab",
|
|
1300
1326
|
id: o,
|
|
1301
|
-
title:
|
|
1302
|
-
icon: e.leftTabIcon ??
|
|
1327
|
+
title: d,
|
|
1328
|
+
icon: e.leftTabIcon ?? tt,
|
|
1303
1329
|
component: j,
|
|
1304
|
-
source:
|
|
1330
|
+
source: u,
|
|
1305
1331
|
chromeless: !0
|
|
1306
1332
|
}), x) {
|
|
1307
|
-
const
|
|
1333
|
+
const S = Re({
|
|
1308
1334
|
id: c,
|
|
1309
1335
|
title: s,
|
|
1310
|
-
icon: e.visualizationIcon ??
|
|
1311
|
-
component: e.visualizationComponent ??
|
|
1336
|
+
icon: e.visualizationIcon ?? fe,
|
|
1337
|
+
component: e.visualizationComponent ?? F,
|
|
1312
1338
|
placement: "center",
|
|
1313
|
-
source:
|
|
1339
|
+
source: u
|
|
1314
1340
|
});
|
|
1315
|
-
|
|
1341
|
+
_.push({
|
|
1316
1342
|
type: "panel",
|
|
1317
|
-
panel:
|
|
1343
|
+
panel: S
|
|
1318
1344
|
});
|
|
1319
1345
|
}
|
|
1320
|
-
if (
|
|
1321
|
-
const
|
|
1346
|
+
if (m) {
|
|
1347
|
+
const S = {
|
|
1322
1348
|
id: n,
|
|
1323
1349
|
label: l,
|
|
1324
1350
|
adapter: e.adapter,
|
|
1325
|
-
onSelect: (
|
|
1351
|
+
onSelect: (z) => O(z, {})
|
|
1326
1352
|
};
|
|
1327
|
-
|
|
1353
|
+
_.push({ type: "catalog", catalog: S });
|
|
1328
1354
|
}
|
|
1329
|
-
return
|
|
1355
|
+
return C && _.push({
|
|
1330
1356
|
type: "surface-resolver",
|
|
1331
|
-
resolver:
|
|
1357
|
+
resolver: Lt({
|
|
1332
1358
|
id: t,
|
|
1333
1359
|
catalogId: n,
|
|
1334
1360
|
visualizationPanelId: c,
|
|
@@ -1336,25 +1362,25 @@ function Re(e) {
|
|
|
1336
1362
|
panelIdPrefix: t,
|
|
1337
1363
|
surfaceKind: i,
|
|
1338
1364
|
surfaceResolverId: e.surfaceResolverId,
|
|
1339
|
-
source:
|
|
1365
|
+
source: u
|
|
1340
1366
|
})
|
|
1341
|
-
}),
|
|
1367
|
+
}), _;
|
|
1342
1368
|
}
|
|
1343
|
-
function
|
|
1369
|
+
function ir(e) {
|
|
1344
1370
|
const t = e.pluginId ?? e.id ?? ue;
|
|
1345
1371
|
return ae({
|
|
1346
1372
|
id: t,
|
|
1347
1373
|
label: e.label ?? "Data Catalog",
|
|
1348
|
-
outputs:
|
|
1374
|
+
outputs: ze(e)
|
|
1349
1375
|
});
|
|
1350
1376
|
}
|
|
1351
|
-
function
|
|
1377
|
+
function ur(e, t) {
|
|
1352
1378
|
return ae({
|
|
1353
1379
|
...e,
|
|
1354
|
-
outputs: [...e.outputs ?? [], ...
|
|
1380
|
+
outputs: [...e.outputs ?? [], ...ze(t)]
|
|
1355
1381
|
});
|
|
1356
1382
|
}
|
|
1357
|
-
function
|
|
1383
|
+
function dr(e) {
|
|
1358
1384
|
return {
|
|
1359
1385
|
id: e.catalogId ?? e.id ?? ue,
|
|
1360
1386
|
label: e.catalogLabel ?? e.label ?? "Data",
|
|
@@ -1365,64 +1391,64 @@ function ur(e) {
|
|
|
1365
1391
|
}
|
|
1366
1392
|
};
|
|
1367
1393
|
}
|
|
1368
|
-
const
|
|
1369
|
-
function
|
|
1394
|
+
const $t = 768, Kt = 1024;
|
|
1395
|
+
function Vt(e) {
|
|
1370
1396
|
return {
|
|
1371
1397
|
...e,
|
|
1372
1398
|
groups: e.groups.filter((t) => t.id !== "sidebar")
|
|
1373
1399
|
};
|
|
1374
1400
|
}
|
|
1375
|
-
function
|
|
1401
|
+
function jt({
|
|
1376
1402
|
layout: e,
|
|
1377
1403
|
className: t
|
|
1378
1404
|
}) {
|
|
1379
|
-
var
|
|
1380
|
-
const r =
|
|
1381
|
-
() => e.groups.find((
|
|
1405
|
+
var B;
|
|
1406
|
+
const r = ke(), n = Ge(), l = Qe(), o = be($t), d = be(Kt), c = d && !o, s = ee(
|
|
1407
|
+
() => e.groups.find((T) => T.id === "sidebar" && T.panel),
|
|
1382
1408
|
[e]
|
|
1383
|
-
), i = s == null ? void 0 : s.panel,
|
|
1384
|
-
isNarrowViewport:
|
|
1409
|
+
), i = s == null ? void 0 : s.panel, u = !!i, x = xt({
|
|
1410
|
+
isNarrowViewport: u && d,
|
|
1385
1411
|
isCollapsed: n.collapsed,
|
|
1386
|
-
setCollapsed: (
|
|
1387
|
-
}), [
|
|
1388
|
-
|
|
1389
|
-
(!
|
|
1390
|
-
}, [
|
|
1391
|
-
const
|
|
1392
|
-
() =>
|
|
1393
|
-
[
|
|
1394
|
-
),
|
|
1395
|
-
const
|
|
1396
|
-
let
|
|
1412
|
+
setCollapsed: (T) => l({ collapsed: T })
|
|
1413
|
+
}), [g, m] = V(!1);
|
|
1414
|
+
Y(() => {
|
|
1415
|
+
(!u || !o && !c) && m(!1);
|
|
1416
|
+
}, [u, o, c]);
|
|
1417
|
+
const C = u && (o || c && n.collapsed), y = u && !o && (!c || !n.collapsed), P = ee(
|
|
1418
|
+
() => y ? e : Vt(e),
|
|
1419
|
+
[y, e]
|
|
1420
|
+
), O = ee(() => {
|
|
1421
|
+
const T = y ? "inline-sidebar" : "overlay-sidebar", G = P.groups.map((D) => {
|
|
1422
|
+
let Q = "";
|
|
1397
1423
|
try {
|
|
1398
|
-
|
|
1424
|
+
Q = JSON.stringify(D.params ?? null);
|
|
1399
1425
|
} catch {
|
|
1400
|
-
|
|
1426
|
+
Q = "unserializable";
|
|
1401
1427
|
}
|
|
1402
|
-
return `${
|
|
1428
|
+
return `${D.id}:${D.panel ?? ""}:${Q}`;
|
|
1403
1429
|
}).join(",");
|
|
1404
|
-
return `${
|
|
1405
|
-
}, [
|
|
1406
|
-
|
|
1407
|
-
}, []),
|
|
1408
|
-
x(), l({ collapsed: !1 }),
|
|
1409
|
-
}, [x, l]),
|
|
1410
|
-
x(), l({ collapsed: !0 }),
|
|
1411
|
-
}, [x, l]),
|
|
1412
|
-
(
|
|
1413
|
-
|
|
1430
|
+
return `${P.version}:${T}:${G}`;
|
|
1431
|
+
}, [P, y]), j = ee(() => r.getComponents(), [r]), F = i ? j[i] : null, _ = i ? ((B = r.get(i)) == null ? void 0 : B.title) ?? "Sidebar" : "Sidebar", S = v(() => {
|
|
1432
|
+
m(!0);
|
|
1433
|
+
}, []), z = v(() => {
|
|
1434
|
+
x(), l({ collapsed: !1 }), m(!1);
|
|
1435
|
+
}, [x, l]), k = v(() => {
|
|
1436
|
+
x(), l({ collapsed: !0 }), m(!1);
|
|
1437
|
+
}, [x, l]), L = v(
|
|
1438
|
+
(T) => {
|
|
1439
|
+
T.target.closest("[role='treeitem']") && m(!1);
|
|
1414
1440
|
},
|
|
1415
1441
|
[]
|
|
1416
1442
|
);
|
|
1417
1443
|
return /* @__PURE__ */ h("div", { className: "relative h-full w-full", children: [
|
|
1418
|
-
c &&
|
|
1444
|
+
c && u && n.collapsed && /* @__PURE__ */ a(
|
|
1419
1445
|
"div",
|
|
1420
1446
|
{
|
|
1421
1447
|
className: "pointer-events-none absolute inset-y-0 left-0 z-20 w-10 border-r border-border bg-background/95",
|
|
1422
1448
|
"aria-hidden": "true"
|
|
1423
1449
|
}
|
|
1424
1450
|
),
|
|
1425
|
-
|
|
1451
|
+
C && /* @__PURE__ */ a(
|
|
1426
1452
|
"div",
|
|
1427
1453
|
{
|
|
1428
1454
|
className: H(
|
|
@@ -1435,45 +1461,45 @@ function Vt({
|
|
|
1435
1461
|
type: "button",
|
|
1436
1462
|
variant: "outline",
|
|
1437
1463
|
size: "icon-sm",
|
|
1438
|
-
onClick:
|
|
1464
|
+
onClick: S,
|
|
1439
1465
|
"aria-label": o ? "Open sidebar menu" : "Open collapsed sidebar",
|
|
1440
|
-
children: o ? /* @__PURE__ */ a(
|
|
1466
|
+
children: o ? /* @__PURE__ */ a(rt, { className: "h-4 w-4" }) : /* @__PURE__ */ a(at, { className: "h-4 w-4" })
|
|
1441
1467
|
}
|
|
1442
1468
|
)
|
|
1443
1469
|
}
|
|
1444
1470
|
),
|
|
1445
|
-
c &&
|
|
1471
|
+
c && u && !n.collapsed && /* @__PURE__ */ a("div", { className: "absolute left-2 top-2 z-30", children: /* @__PURE__ */ a(
|
|
1446
1472
|
J,
|
|
1447
1473
|
{
|
|
1448
1474
|
type: "button",
|
|
1449
1475
|
variant: "outline",
|
|
1450
1476
|
size: "icon-sm",
|
|
1451
|
-
onClick:
|
|
1477
|
+
onClick: k,
|
|
1452
1478
|
"aria-label": "Collapse sidebar",
|
|
1453
|
-
children: /* @__PURE__ */ a(
|
|
1479
|
+
children: /* @__PURE__ */ a(nt, { className: "h-4 w-4" })
|
|
1454
1480
|
}
|
|
1455
1481
|
) }),
|
|
1456
1482
|
/* @__PURE__ */ a(
|
|
1457
|
-
|
|
1483
|
+
He,
|
|
1458
1484
|
{
|
|
1459
|
-
layout:
|
|
1485
|
+
layout: P,
|
|
1460
1486
|
className: H(
|
|
1461
1487
|
t,
|
|
1462
|
-
c &&
|
|
1488
|
+
c && u && n.collapsed && "pl-10"
|
|
1463
1489
|
)
|
|
1464
1490
|
},
|
|
1465
|
-
|
|
1491
|
+
O
|
|
1466
1492
|
),
|
|
1467
|
-
|
|
1468
|
-
|
|
1493
|
+
C && /* @__PURE__ */ a(ut, { open: g, onOpenChange: m, children: /* @__PURE__ */ h(
|
|
1494
|
+
dt,
|
|
1469
1495
|
{
|
|
1470
1496
|
side: "left",
|
|
1471
1497
|
className: "w-[85vw] max-w-sm p-0",
|
|
1472
1498
|
children: [
|
|
1473
|
-
/* @__PURE__ */ h(
|
|
1499
|
+
/* @__PURE__ */ h(pt, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
|
|
1474
1500
|
/* @__PURE__ */ h("div", { children: [
|
|
1475
|
-
/* @__PURE__ */ a(
|
|
1476
|
-
/* @__PURE__ */ a(
|
|
1501
|
+
/* @__PURE__ */ a(ft, { children: _ }),
|
|
1502
|
+
/* @__PURE__ */ a(mt, { className: "sr-only", children: "Responsive sidebar panel" })
|
|
1477
1503
|
] }),
|
|
1478
1504
|
c && /* @__PURE__ */ h(
|
|
1479
1505
|
J,
|
|
@@ -1481,10 +1507,10 @@ function Vt({
|
|
|
1481
1507
|
type: "button",
|
|
1482
1508
|
variant: "outline",
|
|
1483
1509
|
size: "sm",
|
|
1484
|
-
onClick:
|
|
1510
|
+
onClick: z,
|
|
1485
1511
|
"aria-label": "Pin sidebar open",
|
|
1486
1512
|
children: [
|
|
1487
|
-
/* @__PURE__ */ a(
|
|
1513
|
+
/* @__PURE__ */ a(lt, { className: "h-4 w-4" }),
|
|
1488
1514
|
"Pin"
|
|
1489
1515
|
]
|
|
1490
1516
|
}
|
|
@@ -1494,8 +1520,8 @@ function Vt({
|
|
|
1494
1520
|
"div",
|
|
1495
1521
|
{
|
|
1496
1522
|
className: "h-full min-h-0 overflow-auto",
|
|
1497
|
-
onClickCapture:
|
|
1498
|
-
children:
|
|
1523
|
+
onClickCapture: L,
|
|
1524
|
+
children: F ? /* @__PURE__ */ a(Je, { fallback: /* @__PURE__ */ a(Pe, {}), children: /* @__PURE__ */ a(F, {}) }) : /* @__PURE__ */ a(Pe, {})
|
|
1499
1525
|
}
|
|
1500
1526
|
)
|
|
1501
1527
|
]
|
|
@@ -1503,10 +1529,10 @@ function Vt({
|
|
|
1503
1529
|
) })
|
|
1504
1530
|
] });
|
|
1505
1531
|
}
|
|
1506
|
-
function
|
|
1532
|
+
function Pe() {
|
|
1507
1533
|
return /* @__PURE__ */ a("div", { className: "flex h-full min-h-[240px] items-center justify-center text-sm text-muted-foreground", children: "Loading sidebar..." });
|
|
1508
1534
|
}
|
|
1509
|
-
function
|
|
1535
|
+
function Gt(e = {}) {
|
|
1510
1536
|
const { sidebar: t = "filetree", center: r = "empty", right: n } = e, l = [
|
|
1511
1537
|
{
|
|
1512
1538
|
id: "sidebar",
|
|
@@ -1534,12 +1560,12 @@ function Qt(e = {}) {
|
|
|
1534
1560
|
constraints: { minWidth: 250 }
|
|
1535
1561
|
}), { version: "2.0", groups: l };
|
|
1536
1562
|
}
|
|
1537
|
-
function
|
|
1538
|
-
return /* @__PURE__ */ a(
|
|
1563
|
+
function pr(e) {
|
|
1564
|
+
return /* @__PURE__ */ a(jt, { layout: Gt(e), className: e.className });
|
|
1539
1565
|
}
|
|
1540
|
-
function
|
|
1566
|
+
function fr({ className: e, onOpenFile: t }) {
|
|
1541
1567
|
return /* @__PURE__ */ a(
|
|
1542
|
-
|
|
1568
|
+
Ie,
|
|
1543
1569
|
{
|
|
1544
1570
|
className: H("h-full border-0 text-muted-foreground", e),
|
|
1545
1571
|
title: "No file open",
|
|
@@ -1562,7 +1588,7 @@ function pr({ className: e, onOpenFile: t }) {
|
|
|
1562
1588
|
}
|
|
1563
1589
|
);
|
|
1564
1590
|
}
|
|
1565
|
-
class
|
|
1591
|
+
class mr extends Ye {
|
|
1566
1592
|
constructor() {
|
|
1567
1593
|
super(...arguments);
|
|
1568
1594
|
ne(this, "state", { hasError: !1, error: null });
|
|
@@ -1584,11 +1610,11 @@ class fr extends We {
|
|
|
1584
1610
|
render() {
|
|
1585
1611
|
var r;
|
|
1586
1612
|
return this.state.hasError ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ a(
|
|
1587
|
-
|
|
1613
|
+
gt,
|
|
1588
1614
|
{
|
|
1589
1615
|
className: "w-full max-w-md",
|
|
1590
1616
|
title: "Something went wrong",
|
|
1591
|
-
description: /* @__PURE__ */ h(
|
|
1617
|
+
description: /* @__PURE__ */ h(We, { children: [
|
|
1592
1618
|
"Panel ",
|
|
1593
1619
|
/* @__PURE__ */ a("code", { className: "rounded bg-muted px-1 py-0.5 text-xs", children: this.props.panelId }),
|
|
1594
1620
|
" ",
|
|
@@ -1600,7 +1626,7 @@ class fr extends We {
|
|
|
1600
1626
|
) }) : this.props.children;
|
|
1601
1627
|
}
|
|
1602
1628
|
}
|
|
1603
|
-
function
|
|
1629
|
+
function gr({
|
|
1604
1630
|
sessions: e,
|
|
1605
1631
|
activeId: t,
|
|
1606
1632
|
onSwitch: r,
|
|
@@ -1608,42 +1634,42 @@ function mr({
|
|
|
1608
1634
|
onDelete: l,
|
|
1609
1635
|
className: o
|
|
1610
1636
|
}) {
|
|
1611
|
-
const [
|
|
1612
|
-
|
|
1637
|
+
const [d, c] = V(null), s = I({}), i = ee(() => e.map((g) => g.id), [e]);
|
|
1638
|
+
Y(() => {
|
|
1613
1639
|
if (i.length === 0) {
|
|
1614
1640
|
c(null);
|
|
1615
1641
|
return;
|
|
1616
1642
|
}
|
|
1617
|
-
c((
|
|
1643
|
+
c((g) => g && i.includes(g) ? g : t && i.includes(t) ? t : i[0] ?? null);
|
|
1618
1644
|
}, [i, t]);
|
|
1619
|
-
const
|
|
1620
|
-
var
|
|
1621
|
-
c(
|
|
1622
|
-
}, []), x =
|
|
1623
|
-
(
|
|
1624
|
-
if (
|
|
1625
|
-
if (
|
|
1626
|
-
|
|
1645
|
+
const u = v((g) => {
|
|
1646
|
+
var m;
|
|
1647
|
+
c(g), (m = s.current[g]) == null || m.focus();
|
|
1648
|
+
}, []), x = v(
|
|
1649
|
+
(g, m) => {
|
|
1650
|
+
if (g.target !== g.currentTarget) return;
|
|
1651
|
+
if (g.key === "Enter" || g.key === " ") {
|
|
1652
|
+
g.preventDefault(), r == null || r(m);
|
|
1627
1653
|
return;
|
|
1628
1654
|
}
|
|
1629
|
-
const
|
|
1630
|
-
if (
|
|
1631
|
-
let
|
|
1632
|
-
if (
|
|
1633
|
-
|
|
1634
|
-
else if (
|
|
1635
|
-
|
|
1636
|
-
else if (
|
|
1637
|
-
|
|
1638
|
-
else if (
|
|
1639
|
-
|
|
1655
|
+
const C = i.indexOf(m);
|
|
1656
|
+
if (C < 0) return;
|
|
1657
|
+
let y = C;
|
|
1658
|
+
if (g.key === "ArrowDown")
|
|
1659
|
+
y = Math.min(C + 1, i.length - 1);
|
|
1660
|
+
else if (g.key === "ArrowUp")
|
|
1661
|
+
y = Math.max(C - 1, 0);
|
|
1662
|
+
else if (g.key === "Home")
|
|
1663
|
+
y = 0;
|
|
1664
|
+
else if (g.key === "End")
|
|
1665
|
+
y = i.length - 1;
|
|
1640
1666
|
else
|
|
1641
1667
|
return;
|
|
1642
|
-
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1668
|
+
g.preventDefault();
|
|
1669
|
+
const P = i[y];
|
|
1670
|
+
P && u(P);
|
|
1645
1671
|
},
|
|
1646
|
-
[
|
|
1672
|
+
[u, r, i]
|
|
1647
1673
|
);
|
|
1648
1674
|
return /* @__PURE__ */ h(
|
|
1649
1675
|
"div",
|
|
@@ -1655,7 +1681,7 @@ function mr({
|
|
|
1655
1681
|
children: [
|
|
1656
1682
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between border-b border-border px-3 py-2", children: [
|
|
1657
1683
|
/* @__PURE__ */ a("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Sessions" }),
|
|
1658
|
-
n && /* @__PURE__ */ a(
|
|
1684
|
+
n && /* @__PURE__ */ a(De, { type: "button", variant: "ghost", size: "icon-xs", onClick: n, "aria-label": "New session", children: /* @__PURE__ */ a(
|
|
1659
1685
|
"svg",
|
|
1660
1686
|
{
|
|
1661
1687
|
width: "16",
|
|
@@ -1671,35 +1697,35 @@ function mr({
|
|
|
1671
1697
|
] }),
|
|
1672
1698
|
/* @__PURE__ */ h("div", { className: "flex-1 overflow-y-auto", role: "list", "aria-label": "Session list", children: [
|
|
1673
1699
|
e.length === 0 && /* @__PURE__ */ a("div", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No sessions" }),
|
|
1674
|
-
e.map((
|
|
1675
|
-
|
|
1700
|
+
e.map((g) => /* @__PURE__ */ a(
|
|
1701
|
+
Qt,
|
|
1676
1702
|
{
|
|
1677
|
-
session:
|
|
1678
|
-
isActive:
|
|
1679
|
-
isFocused:
|
|
1703
|
+
session: g,
|
|
1704
|
+
isActive: g.id === t,
|
|
1705
|
+
isFocused: g.id === d,
|
|
1680
1706
|
onSwitch: r,
|
|
1681
1707
|
onDelete: l,
|
|
1682
|
-
onFocus: () => c(
|
|
1708
|
+
onFocus: () => c(g.id),
|
|
1683
1709
|
onKeyDown: x,
|
|
1684
|
-
rowRef: (
|
|
1685
|
-
s.current[
|
|
1710
|
+
rowRef: (m) => {
|
|
1711
|
+
s.current[g.id] = m;
|
|
1686
1712
|
}
|
|
1687
1713
|
},
|
|
1688
|
-
|
|
1714
|
+
g.id
|
|
1689
1715
|
))
|
|
1690
1716
|
] })
|
|
1691
1717
|
]
|
|
1692
1718
|
}
|
|
1693
1719
|
);
|
|
1694
1720
|
}
|
|
1695
|
-
function
|
|
1721
|
+
function Qt({
|
|
1696
1722
|
session: e,
|
|
1697
1723
|
isActive: t,
|
|
1698
1724
|
isFocused: r,
|
|
1699
1725
|
onSwitch: n,
|
|
1700
1726
|
onDelete: l,
|
|
1701
1727
|
onFocus: o,
|
|
1702
|
-
onKeyDown:
|
|
1728
|
+
onKeyDown: d,
|
|
1703
1729
|
rowRef: c
|
|
1704
1730
|
}) {
|
|
1705
1731
|
return /* @__PURE__ */ h(
|
|
@@ -1717,7 +1743,7 @@ function jt({
|
|
|
1717
1743
|
),
|
|
1718
1744
|
onClick: () => n == null ? void 0 : n(e.id),
|
|
1719
1745
|
onFocus: o,
|
|
1720
|
-
onKeyDown: (s) =>
|
|
1746
|
+
onKeyDown: (s) => d(s, e.id),
|
|
1721
1747
|
tabIndex: r ? 0 : -1,
|
|
1722
1748
|
"aria-current": t ? "true" : void 0,
|
|
1723
1749
|
children: [
|
|
@@ -1730,7 +1756,7 @@ function jt({
|
|
|
1730
1756
|
}
|
|
1731
1757
|
),
|
|
1732
1758
|
l && /* @__PURE__ */ a(
|
|
1733
|
-
|
|
1759
|
+
De,
|
|
1734
1760
|
{
|
|
1735
1761
|
type: "button",
|
|
1736
1762
|
variant: "ghost",
|
|
@@ -1761,124 +1787,124 @@ function jt({
|
|
|
1761
1787
|
);
|
|
1762
1788
|
}
|
|
1763
1789
|
export {
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1790
|
+
yr as ArtifactSurfacePane,
|
|
1791
|
+
br as CatalogRegistry,
|
|
1792
|
+
Fa as ChatLayout,
|
|
1793
|
+
Ba as CodeEditor,
|
|
1794
|
+
vr as CodeEditorPane,
|
|
1795
|
+
Nr as CommandPalette,
|
|
1770
1796
|
Sr as CommandRegistry,
|
|
1771
|
-
|
|
1797
|
+
sr as DATA_CATALOG_DEFAULT_TOOL_NAME,
|
|
1772
1798
|
ue as DATA_CATALOG_PLUGIN_ID,
|
|
1773
1799
|
de as DATA_CATALOG_ROW_SURFACE_KIND,
|
|
1774
1800
|
ie as DataExplorer,
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1801
|
+
He as DockviewShell,
|
|
1802
|
+
lr as EXPLORER_PLUGIN_ID,
|
|
1803
|
+
fr as EmptyPane,
|
|
1804
|
+
Ne as ExplorerView,
|
|
1805
|
+
Ka as FileTree,
|
|
1806
|
+
Cr as FileTreePane,
|
|
1807
|
+
Tr as FileTreeView,
|
|
1808
|
+
pr as IdeLayout,
|
|
1809
|
+
Pr as MAX_PANELS,
|
|
1810
|
+
ja as MarkdownEditor,
|
|
1811
|
+
kr as MarkdownEditorPane,
|
|
1812
|
+
mr as PanelErrorBoundary,
|
|
1813
|
+
Er as PanelRegistry,
|
|
1814
|
+
wr as PluginError,
|
|
1815
|
+
Ir as PluginErrorBoundary,
|
|
1790
1816
|
Mr as PluginErrorProvider,
|
|
1791
1817
|
Dr as RegistryProvider,
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1818
|
+
jt as ResponsiveDockviewShell,
|
|
1819
|
+
Rr as SessionBrowser,
|
|
1820
|
+
gr as SessionList,
|
|
1821
|
+
Or as SurfaceResolverRegistry,
|
|
1822
|
+
Fr as SurfaceShell,
|
|
1823
|
+
Lr as ThemeProvider,
|
|
1798
1824
|
Ma as Toaster,
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1825
|
+
La as TopBar,
|
|
1826
|
+
zr as WORKSPACE_OPEN_PATH_SURFACE_KIND,
|
|
1827
|
+
qr as WorkbenchLeftPane,
|
|
1828
|
+
za as WorkspaceLoadingState,
|
|
1829
|
+
_r as WorkspaceProvider,
|
|
1830
|
+
Br as agentMeta,
|
|
1831
|
+
ur as appendDataCatalogOutputs,
|
|
1832
|
+
Ar as bindStore,
|
|
1833
|
+
$r as bootstrap,
|
|
1834
|
+
qa as buildChatLayout,
|
|
1835
|
+
Gt as buildIdeLayout,
|
|
1836
|
+
Kr as closePanelSchema,
|
|
1811
1837
|
H as cn,
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1838
|
+
tr as composePlugins,
|
|
1839
|
+
Vr as createBridge,
|
|
1840
|
+
jr as createBridgeClient,
|
|
1841
|
+
dr as createDataCatalogCatalog,
|
|
1842
|
+
Ot as createDataCatalogOpenHandler,
|
|
1843
|
+
ze as createDataCatalogOutputs,
|
|
1844
|
+
ir as createDataCatalogPlugin,
|
|
1845
|
+
Lt as createDataCatalogSurfaceResolver,
|
|
1846
|
+
Et as createExplorerOutputs,
|
|
1847
|
+
or as createExplorerPlugin,
|
|
1848
|
+
Aa as createShadcnTheme,
|
|
1849
|
+
Gr as createWorkspaceStore,
|
|
1850
|
+
Rt as dataCatalogPanelInstanceId,
|
|
1825
1851
|
ae as defineFrontPlugin,
|
|
1826
|
-
|
|
1852
|
+
Re as definePanel,
|
|
1827
1853
|
Da as dismissToast,
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1854
|
+
Qr as emitAgentData,
|
|
1855
|
+
Hr as emitFilesystemAgentFileChange,
|
|
1856
|
+
Wr as events,
|
|
1857
|
+
Ur as expandToFileSchema,
|
|
1858
|
+
Xr as filesystemEvents,
|
|
1859
|
+
Jr as filesystemPlugin,
|
|
1860
|
+
Yr as formatShortcut,
|
|
1861
|
+
Zr as getFileIcon,
|
|
1862
|
+
ea as navigateToLineSchema,
|
|
1863
|
+
ta as notificationSchema,
|
|
1864
|
+
ra as onFilesystemChanged,
|
|
1865
|
+
Fe as openDataCatalogVisualization,
|
|
1866
|
+
aa as openFileSchema,
|
|
1867
|
+
na as openPanelSchema,
|
|
1868
|
+
Ve as postUiCommand,
|
|
1869
|
+
zt as readDataCatalogRow,
|
|
1870
|
+
qt as resolveDataCatalogControlledQuery,
|
|
1871
|
+
Le as resolveDataCatalogQuery,
|
|
1872
|
+
_t as resolveDataCatalogVisualizationState,
|
|
1873
|
+
Ra as toast,
|
|
1874
|
+
la as useActiveFile,
|
|
1875
|
+
oa as useActivePanel,
|
|
1876
|
+
rr as useActivePanels,
|
|
1877
|
+
ar as useArtifactPanels,
|
|
1878
|
+
nr as useArtifactRouting,
|
|
1879
|
+
sa as useAutoOpenAgentFiles,
|
|
1880
|
+
ca as useCatalogRegistry,
|
|
1881
|
+
ia as useCatalogs,
|
|
1882
|
+
ua as useCommandRegistry,
|
|
1883
|
+
da as useCommands,
|
|
1884
|
+
cr as useDataCatalogOpenVisualization,
|
|
1885
|
+
Bt as useDataCatalogQuery,
|
|
1886
|
+
At as useDataCatalogVisualizationState,
|
|
1887
|
+
pa as useDirtyFiles,
|
|
1888
|
+
fa as useDockviewApi,
|
|
1889
|
+
ma as useEditorLifecycle,
|
|
1890
|
+
ga as useEvent,
|
|
1891
|
+
vt as useExplorerState,
|
|
1892
|
+
ha as useHydrationComplete,
|
|
1893
|
+
xa as useKeyboardShortcuts,
|
|
1894
|
+
ya as useOpenPanels,
|
|
1895
|
+
ba as usePluginErrors,
|
|
1896
|
+
ke as useRegistry,
|
|
1897
|
+
va as useResetLayout,
|
|
1898
|
+
xt as useResponsiveSidebarCollapse,
|
|
1899
|
+
Qe as useSetSidebar,
|
|
1900
|
+
Ge as useSidebarState,
|
|
1901
|
+
Na as useSurfaceResolverRegistry,
|
|
1876
1902
|
Sa as useTheme,
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1903
|
+
Ca as useThemePreference,
|
|
1904
|
+
be as useViewportBreakpoint,
|
|
1905
|
+
Ta as useWorkspaceBridge,
|
|
1906
|
+
Pa as useWorkspaceChatPanel,
|
|
1907
|
+
ka as useWorkspaceContext,
|
|
1908
|
+
Ea as useWorkspaceContextOptional,
|
|
1909
|
+
wa as userMeta
|
|
1884
1910
|
};
|