@burdenoff/microfe-botmanor 2026.1123.8 → 2026.1124.1
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/botlit/BotlitRoutes.js +142 -138
- package/dist/botlit/BotlitRoutes.js.map +1 -1
- package/dist/botlit/hooks/useKnowledgeBases.js +16 -18
- package/dist/botlit/hooks/useKnowledgeBases.js.map +1 -1
- package/dist/botlit/pages/BucketsPage.js +164 -158
- package/dist/botlit/pages/BucketsPage.js.map +1 -1
- package/dist/botlit/pages/bucketCreateDialog.d.ts +17 -0
- package/dist/botlit/pages/bucketCreateDialog.js +17 -0
- package/dist/botlit/pages/bucketCreateDialog.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +39 -36
- package/dist/generated/wspace-operations.js +24 -21
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +18 -0
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,124 +12,125 @@ import { ErrorState as _ } from "../components/ErrorState.js";
|
|
|
12
12
|
import { LoadMore as v } from "../components/LoadMore.js";
|
|
13
13
|
import { ActionMenu as y } from "../components/ActionMenu.js";
|
|
14
14
|
import { BucketFormDialog as ee, DeleteBucketDialog as te } from "../components/BucketDialogs.js";
|
|
15
|
-
import { buildBucketTree as ne, searchTreeRows as re, useBucketBranch as b, useBucketCount as x, useBucketSearch as ie, useBuckets as ae, useCreateBucket as oe, useDeleteBucket as se, useUpdateBucket as ce } from "../hooks/useBuckets.js";
|
|
16
15
|
import "../hooks/index.js";
|
|
17
|
-
import {
|
|
16
|
+
import { buildBucketTree as ne, searchTreeRows as re, useBucketBranch as ie, useBucketCount as b, useBucketSearch as ae, useBuckets as oe, useCreateBucket as se, useDeleteBucket as ce, useUpdateBucket as le } from "../hooks/useBuckets.js";
|
|
17
|
+
import { formatRelativeTime as x } from "../utils/formatters.js";
|
|
18
18
|
import "../permissions/index.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
19
|
+
import { useBucketCreateRequest as ue } from "./bucketCreateDialog.js";
|
|
20
|
+
import { useEffect as S, useMemo as C, useState as w } from "react";
|
|
21
|
+
import { GlassCard as T, PagePurpose as de } from "@burdenoff/fe-libs/ui";
|
|
22
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
23
|
+
import { Link as k } from "react-router";
|
|
24
|
+
import { ChevronDown as A, ChevronRight as j, Edit as M, Folder as N, FolderOpen as P, FolderTree as F, List as fe, Plus as I, Search as pe, Trash2 as L } from "lucide-react";
|
|
25
|
+
import { toast as R } from "sonner";
|
|
25
26
|
// src/botlit/pages/BucketsPage.tsx
|
|
26
|
-
var
|
|
27
|
-
function
|
|
27
|
+
var z = "botmanor.buckets.view", me = 300;
|
|
28
|
+
function he() {
|
|
28
29
|
try {
|
|
29
|
-
return globalThis.localStorage?.getItem(
|
|
30
|
+
return globalThis.localStorage?.getItem(z) === "list" ? "list" : "tree";
|
|
30
31
|
} catch {
|
|
31
32
|
return "tree";
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function ge(e) {
|
|
35
36
|
try {
|
|
36
|
-
globalThis.localStorage?.setItem(
|
|
37
|
+
globalThis.localStorage?.setItem(z, e);
|
|
37
38
|
} catch {}
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
-
let [n, r] =
|
|
41
|
-
return
|
|
40
|
+
function _e(e, t) {
|
|
41
|
+
let [n, r] = w(e);
|
|
42
|
+
return S(() => {
|
|
42
43
|
let n = setTimeout(() => r(e), t);
|
|
43
44
|
return () => clearTimeout(n);
|
|
44
45
|
}, [e, t]), n;
|
|
45
46
|
}
|
|
46
|
-
var
|
|
47
|
+
var B = ({ bucket: t, level: n, expanded: r, onToggle: o, highlight: c, children: l, onEdit: u, onDelete: d, onCreateChild: f }) => {
|
|
47
48
|
let p = e(), { getPath: m } = i(), h = s(), g = [];
|
|
48
49
|
h(a.BUCKET_CREATE) && g.push({
|
|
49
50
|
key: "add-child",
|
|
50
51
|
label: p("botlit.buckets.actions.addChild", "Add sub-bucket"),
|
|
51
|
-
icon: /* @__PURE__ */
|
|
52
|
+
icon: /* @__PURE__ */ D(I, { size: 14 }),
|
|
52
53
|
onSelect: () => f(t)
|
|
53
54
|
}), h(a.BUCKET_UPDATE) && g.push({
|
|
54
55
|
key: "edit",
|
|
55
56
|
label: p("botlit.buckets.actions.edit", "Edit or move"),
|
|
56
|
-
icon: /* @__PURE__ */
|
|
57
|
+
icon: /* @__PURE__ */ D(M, { size: 14 }),
|
|
57
58
|
onSelect: () => u(t)
|
|
58
59
|
}), h(a.BUCKET_DELETE) && g.push({
|
|
59
60
|
key: "delete",
|
|
60
61
|
label: p("botlit.buckets.actions.delete", "Delete"),
|
|
61
|
-
icon: /* @__PURE__ */
|
|
62
|
+
icon: /* @__PURE__ */ D(L, { size: 14 }),
|
|
62
63
|
destructive: !0,
|
|
63
64
|
onSelect: () => d(t)
|
|
64
65
|
});
|
|
65
66
|
let _ = r ? p("botlit.buckets.tree.collapse", "Collapse {{name}}", { name: t.name }) : p("botlit.buckets.tree.expand", "Expand {{name}}", { name: t.name });
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ O("li", {
|
|
67
68
|
role: "treeitem",
|
|
68
69
|
"aria-level": n,
|
|
69
70
|
"aria-expanded": r,
|
|
70
71
|
"aria-selected": !1,
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ O("div", {
|
|
72
73
|
className: "group flex items-center gap-2 rounded-md px-3 py-2 transition-colors hover:bg-accent",
|
|
73
74
|
style: { paddingLeft: `${(n - 1) * 24 + 12}px` },
|
|
74
75
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ D("button", {
|
|
76
77
|
type: "button",
|
|
77
78
|
onClick: () => o(t.id),
|
|
78
79
|
"aria-label": _,
|
|
79
80
|
className: "rounded p-0.5 hover:bg-bg-sunken",
|
|
80
|
-
children:
|
|
81
|
+
children: D(r ? A : j, {
|
|
81
82
|
size: 16,
|
|
82
83
|
className: "text-text-secondary",
|
|
83
84
|
"aria-hidden": "true"
|
|
84
85
|
})
|
|
85
86
|
}),
|
|
86
|
-
r ? /* @__PURE__ */
|
|
87
|
+
r ? /* @__PURE__ */ D(P, {
|
|
87
88
|
size: 18,
|
|
88
89
|
className: "text-primary",
|
|
89
90
|
"aria-hidden": "true"
|
|
90
|
-
}) : /* @__PURE__ */
|
|
91
|
+
}) : /* @__PURE__ */ D(N, {
|
|
91
92
|
size: 18,
|
|
92
93
|
className: "text-text-secondary",
|
|
93
94
|
"aria-hidden": "true"
|
|
94
95
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ D(k, {
|
|
96
97
|
to: m(`buckets/${t.id}`),
|
|
97
98
|
className: `flex-1 font-medium hover:text-primary ${c ? "text-primary" : ""}`,
|
|
98
99
|
children: t.name
|
|
99
100
|
}),
|
|
100
|
-
g.length > 0 ? /* @__PURE__ */
|
|
101
|
+
g.length > 0 ? /* @__PURE__ */ D(y, {
|
|
101
102
|
label: p("botlit.buckets.actions.menu", "Actions for {{name}}", { name: t.name }),
|
|
102
103
|
items: g
|
|
103
104
|
}) : null
|
|
104
105
|
]
|
|
105
106
|
}), r ? l : null]
|
|
106
107
|
});
|
|
107
|
-
},
|
|
108
|
-
let s = e(), c =
|
|
109
|
-
return
|
|
108
|
+
}, V = ({ parentBucketId: t, level: n, expanded: r, onToggle: i, refreshKey: a, ...o }) => {
|
|
109
|
+
let s = e(), c = ie(t), { refetch: l } = c;
|
|
110
|
+
return S(() => {
|
|
110
111
|
a > 0 && l();
|
|
111
|
-
}, [a, l]), c.loading ? /* @__PURE__ */
|
|
112
|
+
}, [a, l]), c.loading ? /* @__PURE__ */ D("p", {
|
|
112
113
|
className: "px-3 py-2 text-sm text-text-secondary",
|
|
113
114
|
style: { paddingLeft: `${n * 24}px` },
|
|
114
115
|
children: s("botlit.buckets.tree.loading", "Loading…")
|
|
115
|
-
}) : c.error ? /* @__PURE__ */
|
|
116
|
+
}) : c.error ? /* @__PURE__ */ D(_, {
|
|
116
117
|
resource: s("botlit.buckets.resource", "buckets"),
|
|
117
118
|
error: c.error,
|
|
118
119
|
onRetry: () => void l()
|
|
119
|
-
}) : c.data.length === 0 && t ? /* @__PURE__ */
|
|
120
|
+
}) : c.data.length === 0 && t ? /* @__PURE__ */ D("p", {
|
|
120
121
|
className: "px-3 py-1 text-xs text-text-secondary",
|
|
121
122
|
style: { paddingLeft: `${n * 24 + 12}px` },
|
|
122
123
|
children: s("botlit.buckets.tree.noChildren", "No sub-buckets")
|
|
123
|
-
}) : /* @__PURE__ */
|
|
124
|
+
}) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("ul", {
|
|
124
125
|
role: "group",
|
|
125
126
|
className: "space-y-0.5",
|
|
126
|
-
children: c.data.map((e) => /* @__PURE__ */
|
|
127
|
+
children: c.data.map((e) => /* @__PURE__ */ D(B, {
|
|
127
128
|
bucket: e,
|
|
128
129
|
level: n,
|
|
129
130
|
expanded: r.has(e.id),
|
|
130
131
|
onToggle: i,
|
|
131
132
|
...o,
|
|
132
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ D(V, {
|
|
133
134
|
parentBucketId: e.id,
|
|
134
135
|
level: n + 1,
|
|
135
136
|
expanded: r,
|
|
@@ -138,23 +139,23 @@ var V = ({ bucket: t, level: n, expanded: r, onToggle: o, highlight: c, children
|
|
|
138
139
|
...o
|
|
139
140
|
})
|
|
140
141
|
}, e.id))
|
|
141
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ D(v, {
|
|
142
143
|
hasMore: c.hasMore,
|
|
143
144
|
loadingMore: c.loadingMore,
|
|
144
145
|
onLoadMore: () => void c.loadMore(),
|
|
145
146
|
loadedCount: c.data.length
|
|
146
147
|
})] });
|
|
147
|
-
},
|
|
148
|
+
}, H = ({ nodes: e, level: t, matchIds: n, collapsed: r, onToggle: i, ...a }) => /* @__PURE__ */ D("ul", {
|
|
148
149
|
role: "group",
|
|
149
150
|
className: "space-y-0.5",
|
|
150
|
-
children: e.map((e) => /* @__PURE__ */
|
|
151
|
+
children: e.map((e) => /* @__PURE__ */ D(B, {
|
|
151
152
|
bucket: e,
|
|
152
153
|
level: t,
|
|
153
154
|
expanded: e.children.length > 0 && !r.has(e.id),
|
|
154
155
|
onToggle: i,
|
|
155
156
|
highlight: n.has(e.id),
|
|
156
157
|
...a,
|
|
157
|
-
children: e.children.length > 0 ? /* @__PURE__ */
|
|
158
|
+
children: e.children.length > 0 ? /* @__PURE__ */ D(H, {
|
|
158
159
|
nodes: e.children,
|
|
159
160
|
level: t + 1,
|
|
160
161
|
matchIds: n,
|
|
@@ -163,196 +164,199 @@ var V = ({ bucket: t, level: n, expanded: r, onToggle: o, highlight: c, children
|
|
|
163
164
|
...a
|
|
164
165
|
}) : null
|
|
165
166
|
}, e.id))
|
|
166
|
-
}),
|
|
167
|
+
}), ve = ({ bucket: e }) => {
|
|
167
168
|
let { getPath: t } = i();
|
|
168
|
-
return /* @__PURE__ */
|
|
169
|
+
return /* @__PURE__ */ D("li", { children: /* @__PURE__ */ D(k, {
|
|
169
170
|
to: t(`buckets/${e.id}`),
|
|
170
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ O(l, {
|
|
171
172
|
className: "h-full cursor-pointer transition-colors hover:border-primary/50",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ D(f, {
|
|
173
174
|
className: "pb-2",
|
|
174
|
-
children: /* @__PURE__ */
|
|
175
|
+
children: /* @__PURE__ */ O("div", {
|
|
175
176
|
className: "flex items-center gap-3",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ D(N, {
|
|
177
178
|
className: "h-5 w-5 text-primary",
|
|
178
179
|
"aria-hidden": "true"
|
|
179
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D(p, {
|
|
180
181
|
className: "text-base",
|
|
181
182
|
children: e.name
|
|
182
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ D(d, {
|
|
183
184
|
className: "text-xs",
|
|
184
185
|
children: e.path
|
|
185
186
|
})] })]
|
|
186
187
|
})
|
|
187
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ D(u, { children: /* @__PURE__ */ O("div", {
|
|
188
189
|
className: "flex items-center justify-between text-sm",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ D("span", {
|
|
190
191
|
className: "text-text-secondary",
|
|
191
192
|
children: e.slug
|
|
192
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ D("span", {
|
|
193
194
|
className: "text-xs text-text-secondary",
|
|
194
|
-
children:
|
|
195
|
+
children: x(e.createdAt)
|
|
195
196
|
})]
|
|
196
197
|
}) })]
|
|
197
198
|
})
|
|
198
199
|
}) });
|
|
199
|
-
},
|
|
200
|
-
let i = e(), [
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
}, U = () => {
|
|
201
|
+
let i = e(), [y, ie] = w(""), x = _e(y.trim(), me), S = x.length > 0, [k, A] = w(he), [j, M] = w(() => /* @__PURE__ */ new Set()), [N, P] = w(() => /* @__PURE__ */ new Set()), [L, z] = w(0), [B, U] = w(null), ye = s(), be = ue(), W = B ?? (be.requested && ye(a.BUCKET_CREATE) ? {
|
|
202
|
+
mode: "create",
|
|
203
|
+
parentId: null
|
|
204
|
+
} : null), [xe, G] = w(null), K = b({}), q = b({ parentBucketId: null }), J = b({ search: x }), Y = oe(), X = ae(x), [Se, Ce] = se(), [we, Te] = le(), [Ee, De] = ce(), Z = C(() => ne(re(X.data)), [X.data]), Oe = C(() => new Set(X.data.map((e) => e.id)), [X.data]), Q = (e) => {
|
|
205
|
+
A(e), ge(e);
|
|
206
|
+
}, ke = () => {
|
|
207
|
+
z((e) => e + 1), K.refetch(), q.refetch(), Y.refetch(), S && (X.refetch(), J.refetch());
|
|
208
|
+
}, Ae = (e) => {
|
|
205
209
|
let t = (t) => {
|
|
206
210
|
let n = new Set(t);
|
|
207
211
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
208
212
|
};
|
|
209
213
|
S ? P(t) : M(t);
|
|
210
|
-
},
|
|
211
|
-
if (!
|
|
214
|
+
}, je = (e, t) => e instanceof Error ? e.message : t, Me = async (e) => {
|
|
215
|
+
if (!W) return !1;
|
|
212
216
|
try {
|
|
213
|
-
if (
|
|
217
|
+
if (W.mode === "create") await Se({
|
|
214
218
|
name: e.name,
|
|
215
219
|
slug: e.name,
|
|
216
220
|
description: e.description || void 0,
|
|
217
221
|
parentBucketId: e.parentBucketId ?? void 0
|
|
218
|
-
}),
|
|
222
|
+
}), R.success(i("botlit.buckets.toast.created", "Bucket \"{{name}}\" created", { name: e.name })), e.parentBucketId && M((t) => new Set(t).add(e.parentBucketId));
|
|
219
223
|
else {
|
|
220
|
-
let { bucket: t } =
|
|
221
|
-
await
|
|
224
|
+
let { bucket: t } = W;
|
|
225
|
+
await we({
|
|
222
226
|
bucketId: t.id,
|
|
223
227
|
input: {
|
|
224
228
|
name: e.name,
|
|
225
229
|
description: e.description,
|
|
226
230
|
...e.parentBucketId === (t.parentBucketId ?? null) ? {} : { parentBucketId: e.parentBucketId }
|
|
227
231
|
}
|
|
228
|
-
}),
|
|
232
|
+
}), R.success(i("botlit.buckets.toast.updated", "Bucket \"{{name}}\" saved", { name: e.name }));
|
|
229
233
|
}
|
|
230
234
|
} catch (e) {
|
|
231
|
-
return
|
|
235
|
+
return R.error(je(e, W.mode === "create" ? i("botlit.buckets.toast.createFailed", "Could not create the bucket.") : i("botlit.buckets.toast.updateFailed", "Could not save the bucket."))), !1;
|
|
232
236
|
}
|
|
233
|
-
return
|
|
234
|
-
},
|
|
237
|
+
return ke(), !0;
|
|
238
|
+
}, Ne = async (e) => {
|
|
235
239
|
n("medium");
|
|
236
240
|
try {
|
|
237
|
-
await
|
|
241
|
+
await Ee(e.id);
|
|
238
242
|
} catch (e) {
|
|
239
|
-
t() && r("error"),
|
|
243
|
+
t() && r("error"), R.error(je(e, i("botlit.buckets.toast.deleteFailed", "Could not delete the bucket.")));
|
|
240
244
|
return;
|
|
241
245
|
}
|
|
242
|
-
t() && r("success"),
|
|
243
|
-
},
|
|
244
|
-
onEdit: (e) =>
|
|
246
|
+
t() && r("success"), R.success(i("botlit.buckets.toast.deleted", "Bucket \"{{name}}\" deleted", { name: e.name })), G(null), ke();
|
|
247
|
+
}, Pe = {
|
|
248
|
+
onEdit: (e) => U({
|
|
245
249
|
mode: "edit",
|
|
246
250
|
bucket: e
|
|
247
251
|
}),
|
|
248
252
|
onDelete: (e) => G(e),
|
|
249
|
-
onCreateChild: (e) =>
|
|
253
|
+
onCreateChild: (e) => U({
|
|
250
254
|
mode: "create",
|
|
251
255
|
parentId: e.id
|
|
252
256
|
})
|
|
253
|
-
},
|
|
257
|
+
}, Fe = /* @__PURE__ */ D(o, {
|
|
254
258
|
permission: a.BUCKET_CREATE,
|
|
255
|
-
children: /* @__PURE__ */
|
|
256
|
-
leftIcon: /* @__PURE__ */
|
|
257
|
-
onClick: () =>
|
|
259
|
+
children: /* @__PURE__ */ D(m, {
|
|
260
|
+
leftIcon: /* @__PURE__ */ D(I, { size: 16 }),
|
|
261
|
+
onClick: () => U({
|
|
258
262
|
mode: "create",
|
|
259
263
|
parentId: null
|
|
260
264
|
}),
|
|
261
265
|
children: i("botlit.buckets.actions.create", "Create bucket")
|
|
262
266
|
})
|
|
263
|
-
}),
|
|
267
|
+
}), Ie = K.data === 0, Le = /* @__PURE__ */ D(g, {
|
|
264
268
|
illustration: "empty-files",
|
|
265
269
|
title: i("botlit.buckets.empty.title", "No buckets yet"),
|
|
266
270
|
description: i("botlit.buckets.empty.description", "Create buckets to organise your BotManor resources."),
|
|
267
|
-
action:
|
|
268
|
-
}), $ = /* @__PURE__ */
|
|
271
|
+
action: Fe
|
|
272
|
+
}), $ = /* @__PURE__ */ D(g, {
|
|
269
273
|
illustration: "empty-search",
|
|
270
|
-
title: i("botlit.buckets.search.noneTitle", "No buckets match \"{{search}}\"", { search:
|
|
274
|
+
title: i("botlit.buckets.search.noneTitle", "No buckets match \"{{search}}\"", { search: x }),
|
|
271
275
|
description: i("botlit.buckets.search.noneDescription", "Try another name, slug or description.")
|
|
272
276
|
});
|
|
273
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ D(c, {
|
|
274
278
|
title: i("botlit.buckets.title", "Buckets"),
|
|
275
279
|
description: i("botlit.buckets.description", "Organise your agents, bots and resources into hierarchical folders"),
|
|
276
|
-
actions:
|
|
277
|
-
children: /* @__PURE__ */
|
|
280
|
+
actions: Fe,
|
|
281
|
+
children: /* @__PURE__ */ O("div", {
|
|
278
282
|
className: "space-y-6",
|
|
279
283
|
children: [
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
icon: /* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ D(de, {
|
|
285
|
+
icon: /* @__PURE__ */ D(F, { size: 18 }),
|
|
282
286
|
children: i("botlit.buckets.purpose", "Buckets are folders for what you build in BotManor (bots, agents, policies, skills, prompt templates and more), arranged in a hierarchy that mirrors how your team works. Group resources by team, project or environment so they stay organised and easy to find.")
|
|
283
287
|
}),
|
|
284
|
-
K.data !== null && K.data > 0 ? /* @__PURE__ */
|
|
288
|
+
K.data !== null && K.data > 0 ? /* @__PURE__ */ O("div", {
|
|
285
289
|
className: "grid grid-cols-2 gap-4",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ O(T, {
|
|
287
291
|
treatment: "glass",
|
|
288
292
|
glow: !0,
|
|
289
293
|
className: "p-4",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ D("p", {
|
|
291
295
|
className: "text-sm text-text-secondary",
|
|
292
296
|
children: i("botlit.buckets.summary.total", "Total buckets")
|
|
293
|
-
}), /* @__PURE__ */
|
|
297
|
+
}), /* @__PURE__ */ D("p", {
|
|
294
298
|
className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
|
|
295
299
|
children: K.data
|
|
296
300
|
})]
|
|
297
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ O(T, {
|
|
298
302
|
treatment: "metric",
|
|
299
303
|
className: "p-4",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
304
|
+
children: [/* @__PURE__ */ D("p", {
|
|
301
305
|
className: "text-sm text-text-secondary",
|
|
302
306
|
children: i("botlit.buckets.summary.topLevel", "Top-level buckets")
|
|
303
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ D("p", {
|
|
304
308
|
className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
|
|
305
309
|
children: q.data ?? "…"
|
|
306
310
|
})]
|
|
307
311
|
})]
|
|
308
312
|
}) : null,
|
|
309
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ O("div", {
|
|
310
314
|
className: "flex flex-wrap items-center justify-between gap-4",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ O("div", {
|
|
312
316
|
className: "relative min-w-0 max-w-md flex-1",
|
|
313
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ D(pe, {
|
|
314
318
|
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary",
|
|
315
319
|
"aria-hidden": "true"
|
|
316
|
-
}), /* @__PURE__ */
|
|
320
|
+
}), /* @__PURE__ */ D(h, {
|
|
317
321
|
type: "search",
|
|
318
322
|
"aria-label": i("botlit.buckets.search.label", "Search buckets"),
|
|
319
323
|
placeholder: i("botlit.buckets.search.placeholder", "Search buckets…"),
|
|
320
|
-
value:
|
|
321
|
-
onChange: (e) =>
|
|
324
|
+
value: y,
|
|
325
|
+
onChange: (e) => ie(e.target.value),
|
|
322
326
|
className: "pl-9"
|
|
323
327
|
})]
|
|
324
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ O("div", {
|
|
325
329
|
className: "flex items-center gap-2",
|
|
326
|
-
children: [
|
|
330
|
+
children: [k === "tree" && !S ? /* @__PURE__ */ D(m, {
|
|
327
331
|
variant: "outline",
|
|
328
332
|
size: "sm",
|
|
329
333
|
onClick: () => M(/* @__PURE__ */ new Set()),
|
|
330
334
|
children: i("botlit.buckets.tree.collapseAll", "Collapse all")
|
|
331
|
-
}) : null, /* @__PURE__ */
|
|
335
|
+
}) : null, /* @__PURE__ */ O("div", {
|
|
332
336
|
role: "group",
|
|
333
337
|
"aria-label": i("botlit.buckets.view.label", "View"),
|
|
334
338
|
className: "flex overflow-hidden rounded-md border border-border-subtle",
|
|
335
|
-
children: [/* @__PURE__ */
|
|
336
|
-
variant:
|
|
339
|
+
children: [/* @__PURE__ */ D(m, {
|
|
340
|
+
variant: k === "tree" ? "default" : "ghost",
|
|
337
341
|
size: "sm",
|
|
338
342
|
className: "rounded-none",
|
|
339
|
-
"aria-pressed":
|
|
343
|
+
"aria-pressed": k === "tree",
|
|
340
344
|
"aria-label": i("botlit.buckets.view.tree", "Tree view"),
|
|
341
345
|
title: i("botlit.buckets.view.tree", "Tree view"),
|
|
342
346
|
onClick: () => Q("tree"),
|
|
343
|
-
children: /* @__PURE__ */
|
|
347
|
+
children: /* @__PURE__ */ D(F, {
|
|
344
348
|
size: 16,
|
|
345
349
|
"aria-hidden": "true"
|
|
346
350
|
})
|
|
347
|
-
}), /* @__PURE__ */
|
|
348
|
-
variant:
|
|
351
|
+
}), /* @__PURE__ */ D(m, {
|
|
352
|
+
variant: k === "list" ? "default" : "ghost",
|
|
349
353
|
size: "sm",
|
|
350
354
|
className: "rounded-none",
|
|
351
|
-
"aria-pressed":
|
|
355
|
+
"aria-pressed": k === "list",
|
|
352
356
|
"aria-label": i("botlit.buckets.view.list", "List view"),
|
|
353
357
|
title: i("botlit.buckets.view.list", "List view"),
|
|
354
358
|
onClick: () => Q("list"),
|
|
355
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ D(fe, {
|
|
356
360
|
size: 16,
|
|
357
361
|
"aria-hidden": "true"
|
|
358
362
|
})
|
|
@@ -360,133 +364,135 @@ var V = ({ bucket: t, level: n, expanded: r, onToggle: o, highlight: c, children
|
|
|
360
364
|
})]
|
|
361
365
|
})]
|
|
362
366
|
}),
|
|
363
|
-
S ? /* @__PURE__ */
|
|
367
|
+
S ? /* @__PURE__ */ D("p", {
|
|
364
368
|
className: "text-sm text-text-secondary",
|
|
365
369
|
"aria-live": "polite",
|
|
366
370
|
children: J.data === null ? i("botlit.buckets.search.searching", "Searching…") : i("botlit.buckets.search.count", "{{count}} bucket(s) match", { count: J.data })
|
|
367
371
|
}) : null,
|
|
368
|
-
|
|
372
|
+
k === "tree" ? /* @__PURE__ */ D(l, { children: /* @__PURE__ */ D(u, {
|
|
369
373
|
className: "p-2",
|
|
370
|
-
children: S ? X.loading ? /* @__PURE__ */
|
|
374
|
+
children: S ? X.loading ? /* @__PURE__ */ D("p", {
|
|
371
375
|
className: "p-4 text-sm text-text-secondary",
|
|
372
376
|
children: i("botlit.buckets.tree.loading", "Loading…")
|
|
373
|
-
}) : X.error ? /* @__PURE__ */
|
|
377
|
+
}) : X.error ? /* @__PURE__ */ D(_, {
|
|
374
378
|
resource: i("botlit.buckets.resource", "buckets"),
|
|
375
379
|
error: X.error,
|
|
376
380
|
onRetry: () => void X.refetch()
|
|
377
|
-
}) : Z.length === 0 ? $ : /* @__PURE__ */
|
|
381
|
+
}) : Z.length === 0 ? $ : /* @__PURE__ */ O("div", {
|
|
378
382
|
role: "tree",
|
|
379
383
|
"aria-label": i("botlit.buckets.tree.label", "Buckets"),
|
|
380
384
|
className: "py-2",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ D(H, {
|
|
382
386
|
nodes: Z,
|
|
383
387
|
level: 1,
|
|
384
|
-
matchIds:
|
|
388
|
+
matchIds: Oe,
|
|
385
389
|
collapsed: N,
|
|
386
|
-
onToggle:
|
|
387
|
-
...
|
|
388
|
-
}), /* @__PURE__ */
|
|
390
|
+
onToggle: Ae,
|
|
391
|
+
...Pe
|
|
392
|
+
}), /* @__PURE__ */ D(v, {
|
|
389
393
|
hasMore: X.hasMore,
|
|
390
394
|
loadingMore: X.loadingMore,
|
|
391
395
|
onLoadMore: () => void X.loadMore(),
|
|
392
396
|
loadedCount: X.data.length
|
|
393
397
|
})]
|
|
394
|
-
}) :
|
|
398
|
+
}) : Ie ? Le : /* @__PURE__ */ D("div", {
|
|
395
399
|
role: "tree",
|
|
396
400
|
"aria-label": i("botlit.buckets.tree.label", "Buckets"),
|
|
397
401
|
className: "py-2",
|
|
398
|
-
children: /* @__PURE__ */
|
|
402
|
+
children: /* @__PURE__ */ D(V, {
|
|
399
403
|
parentBucketId: null,
|
|
400
404
|
level: 1,
|
|
401
405
|
expanded: j,
|
|
402
|
-
onToggle:
|
|
403
|
-
refreshKey:
|
|
404
|
-
...
|
|
406
|
+
onToggle: Ae,
|
|
407
|
+
refreshKey: L,
|
|
408
|
+
...Pe
|
|
405
409
|
})
|
|
406
410
|
})
|
|
407
411
|
}) }) : (() => {
|
|
408
412
|
let e = S ? X : Y;
|
|
409
|
-
return e.loading ? /* @__PURE__ */
|
|
413
|
+
return e.loading ? /* @__PURE__ */ D("div", {
|
|
410
414
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
411
415
|
children: [
|
|
412
416
|
1,
|
|
413
417
|
2,
|
|
414
418
|
3
|
|
415
|
-
].map((e) => /* @__PURE__ */
|
|
416
|
-
}) : e.error ? /* @__PURE__ */
|
|
419
|
+
].map((e) => /* @__PURE__ */ D("div", { className: "h-32 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer" }, e))
|
|
420
|
+
}) : e.error ? /* @__PURE__ */ D(_, {
|
|
417
421
|
resource: i("botlit.buckets.resource", "buckets"),
|
|
418
422
|
error: e.error,
|
|
419
423
|
onRetry: () => void e.refetch()
|
|
420
|
-
}) : e.data.length === 0 ? S ? $ :
|
|
424
|
+
}) : e.data.length === 0 ? S ? $ : Le : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("ul", {
|
|
421
425
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
422
|
-
children: e.data.map((e) => /* @__PURE__ */
|
|
423
|
-
}), /* @__PURE__ */
|
|
426
|
+
children: e.data.map((e) => /* @__PURE__ */ D(ve, { bucket: e }, e.id))
|
|
427
|
+
}), /* @__PURE__ */ D(v, {
|
|
424
428
|
hasMore: e.hasMore,
|
|
425
429
|
loadingMore: e.loadingMore,
|
|
426
430
|
onLoadMore: () => void e.loadMore(),
|
|
427
431
|
loadedCount: e.data.length
|
|
428
432
|
})] });
|
|
429
433
|
})(),
|
|
430
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ O(l, { children: [/* @__PURE__ */ O(f, { children: [/* @__PURE__ */ O(p, {
|
|
431
435
|
className: "flex items-center gap-2",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ D(F, {
|
|
433
437
|
size: 18,
|
|
434
438
|
"aria-hidden": "true"
|
|
435
439
|
}), i("botlit.buckets.help.title", "Organising with buckets")]
|
|
436
|
-
}), /* @__PURE__ */
|
|
440
|
+
}), /* @__PURE__ */ D(d, { children: i("botlit.buckets.help.description", "What buckets do today") })] }), /* @__PURE__ */ D(u, { children: /* @__PURE__ */ O("div", {
|
|
437
441
|
className: "grid grid-cols-1 gap-6 md:grid-cols-3",
|
|
438
442
|
children: [
|
|
439
|
-
/* @__PURE__ */
|
|
443
|
+
/* @__PURE__ */ O("div", {
|
|
440
444
|
className: "space-y-2",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
445
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
442
446
|
className: "font-medium",
|
|
443
447
|
children: i("botlit.buckets.help.hierarchyTitle", "Nested folders")
|
|
444
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ D("p", {
|
|
445
449
|
className: "text-sm text-text-secondary",
|
|
446
450
|
children: i("botlit.buckets.help.hierarchyBody", "Nest buckets up to 10 levels deep. Names only need to be unique among buckets with the same parent, so each product can have its own \"dev\" bucket.")
|
|
447
451
|
})]
|
|
448
452
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ O("div", {
|
|
450
454
|
className: "space-y-2",
|
|
451
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
452
456
|
className: "font-medium",
|
|
453
457
|
children: i("botlit.buckets.help.moveTitle", "Move and rename")
|
|
454
|
-
}), /* @__PURE__ */
|
|
458
|
+
}), /* @__PURE__ */ D("p", {
|
|
455
459
|
className: "text-sm text-text-secondary",
|
|
456
460
|
children: i("botlit.buckets.help.moveBody", "Edit a bucket to rename it or move it under another bucket. Everything inside moves with it.")
|
|
457
461
|
})]
|
|
458
462
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ O("div", {
|
|
460
464
|
className: "space-y-2",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
465
|
+
children: [/* @__PURE__ */ D("h3", {
|
|
462
466
|
className: "font-medium",
|
|
463
467
|
children: i("botlit.buckets.help.accessTitle", "Access and policies")
|
|
464
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ D("p", {
|
|
465
469
|
className: "text-sm text-text-secondary",
|
|
466
470
|
children: i("botlit.buckets.help.accessBody", "Buckets organise resources; they do not grant access. Who can see and change a resource, and which policies apply, is set by workspace roles and policies.")
|
|
467
471
|
})]
|
|
468
472
|
})
|
|
469
473
|
]
|
|
470
474
|
}) })] }),
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
mode:
|
|
473
|
-
open:
|
|
474
|
-
bucket:
|
|
475
|
-
initialParentId:
|
|
476
|
-
saving:
|
|
477
|
-
onSubmit:
|
|
478
|
-
onClose: () =>
|
|
475
|
+
/* @__PURE__ */ D(ee, {
|
|
476
|
+
mode: W?.mode ?? "create",
|
|
477
|
+
open: W !== null,
|
|
478
|
+
bucket: W?.mode === "edit" ? W.bucket : null,
|
|
479
|
+
initialParentId: W?.mode === "create" ? W.parentId : null,
|
|
480
|
+
saving: Ce.loading || Te.loading,
|
|
481
|
+
onSubmit: Me,
|
|
482
|
+
onClose: () => {
|
|
483
|
+
U(null), be.clear();
|
|
484
|
+
}
|
|
479
485
|
}),
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
bucket:
|
|
482
|
-
deleting:
|
|
483
|
-
onConfirm: (e) => void
|
|
486
|
+
/* @__PURE__ */ D(te, {
|
|
487
|
+
bucket: xe,
|
|
488
|
+
deleting: De.loading,
|
|
489
|
+
onConfirm: (e) => void Ne(e),
|
|
484
490
|
onClose: () => G(null)
|
|
485
491
|
})
|
|
486
492
|
]
|
|
487
493
|
})
|
|
488
494
|
});
|
|
489
495
|
};
|
|
490
|
-
export {
|
|
496
|
+
export { U as BucketsPage };
|
|
491
497
|
|
|
492
498
|
//# sourceMappingURL=BucketsPage.js.map
|