@burdenoff/microfe-botmanor 2026.1120.3 → 2026.1120.4
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/components/BucketDialogs.d.ts +40 -0
- package/dist/botlit/components/BucketDialogs.js +258 -0
- package/dist/botlit/components/BucketDialogs.js.map +1 -0
- package/dist/botlit/components/StoreDialogs.d.ts +33 -0
- package/dist/botlit/components/StoreDialogs.js +139 -0
- package/dist/botlit/components/StoreDialogs.js.map +1 -0
- package/dist/botlit/hooks/index.d.ts +3 -3
- package/dist/botlit/hooks/index.js +6 -6
- package/dist/botlit/hooks/useBuckets.d.ts +48 -15
- package/dist/botlit/hooks/useBuckets.js +128 -85
- package/dist/botlit/hooks/useBuckets.js.map +1 -1
- package/dist/botlit/hooks/useStore.d.ts +4 -0
- package/dist/botlit/hooks/useStore.js +87 -60
- package/dist/botlit/hooks/useStore.js.map +1 -1
- package/dist/botlit/pages/BucketDetailPage.js +283 -209
- package/dist/botlit/pages/BucketDetailPage.js.map +1 -1
- package/dist/botlit/pages/BucketsPage.js +413 -545
- package/dist/botlit/pages/BucketsPage.js.map +1 -1
- package/dist/botlit/pages/InstalledPackagesPage.js +275 -275
- package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -1
- package/dist/botlit/pages/StorePackageDetailPage.js +165 -257
- package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -1
- package/dist/botlit/pages/StorePage.js +179 -184
- package/dist/botlit/pages/StorePage.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +216 -0
- package/dist/generated/wspace-operations.js +162 -93
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +49 -0
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,624 +1,492 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
2
|
import { isNative as t, nativeImpact as n, nativeNotify as r } from "../../utils/nativeBridge.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { useBotlit as i } from "../providers/BotlitProvider.js";
|
|
4
|
+
import { BOTMANOR_PERMISSIONS as a } from "../permissions/botmanorPermissions.js";
|
|
5
|
+
import { BotmanorPermissionGate as o, useBotmanorCan as s } from "../permissions/useBotmanorPermissions.js";
|
|
6
|
+
import { PageLayout as c } from "../components/PageLayout.js";
|
|
7
|
+
import { Card as l, CardContent as u, CardDescription as d, CardHeader as f, CardTitle as p } from "../components/Card.js";
|
|
8
|
+
import { Button as m } from "../components/Button.js";
|
|
9
|
+
import { Input as h } from "../components/Input.js";
|
|
10
|
+
import { EmptyState as g } from "../components/EmptyState.js";
|
|
11
|
+
import { ErrorState as _ } from "../components/ErrorState.js";
|
|
12
|
+
import { LoadMore as v } from "../components/LoadMore.js";
|
|
13
|
+
import { ActionMenu as y } from "../components/ActionMenu.js";
|
|
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";
|
|
11
16
|
import "../hooks/index.js";
|
|
12
|
-
import { formatRelativeTime as
|
|
13
|
-
import { useBucketTree as te, useBuckets as ne, useCreateBucket as re, useDeleteBucket as ie, useUpdateBucket as ae } from "../hooks/useBuckets.js";
|
|
17
|
+
import { formatRelativeTime as S } from "../utils/formatters.js";
|
|
14
18
|
import "../permissions/index.js";
|
|
15
|
-
import { useState as
|
|
16
|
-
import { GlassCard as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
import { Link as
|
|
19
|
-
import { ChevronDown as
|
|
20
|
-
import { toast as
|
|
19
|
+
import { useEffect as C, useMemo as w, useState as T } from "react";
|
|
20
|
+
import { GlassCard as E, PagePurpose as le } from "@burdenoff/fe-libs/ui";
|
|
21
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
22
|
+
import { Link as A } from "react-router";
|
|
23
|
+
import { ChevronDown as j, ChevronRight as M, Edit as N, Folder as P, FolderOpen as F, FolderTree as I, List as ue, Plus as L, Search as de, Trash2 as R } from "lucide-react";
|
|
24
|
+
import { toast as z } from "sonner";
|
|
21
25
|
// src/botlit/pages/BucketsPage.tsx
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
var B = "botmanor.buckets.view", fe = 300;
|
|
27
|
+
function pe() {
|
|
28
|
+
try {
|
|
29
|
+
return globalThis.localStorage?.getItem(B) === "list" ? "list" : "tree";
|
|
30
|
+
} catch {
|
|
31
|
+
return "tree";
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function me(e) {
|
|
35
|
+
try {
|
|
36
|
+
globalThis.localStorage?.setItem(B, e);
|
|
37
|
+
} catch {}
|
|
38
|
+
}
|
|
39
|
+
function he(e, t) {
|
|
40
|
+
let [n, r] = T(e);
|
|
41
|
+
return C(() => {
|
|
42
|
+
let n = setTimeout(() => r(e), t);
|
|
43
|
+
return () => clearTimeout(n);
|
|
44
|
+
}, [e, t]), n;
|
|
45
|
+
}
|
|
46
|
+
var V = ({ bucket: t, level: n, expanded: r, onToggle: o, highlight: c, children: l, onEdit: u, onDelete: d, onCreateChild: f }) => {
|
|
47
|
+
let p = e(), { getPath: m } = i(), h = s(), g = [];
|
|
48
|
+
h(a.BUCKET_CREATE) && g.push({
|
|
49
|
+
key: "add-child",
|
|
50
|
+
label: p("botlit.buckets.actions.addChild", "Add sub-bucket"),
|
|
51
|
+
icon: /* @__PURE__ */ O(L, { size: 14 }),
|
|
52
|
+
onSelect: () => f(t)
|
|
53
|
+
}), h(a.BUCKET_UPDATE) && g.push({
|
|
54
|
+
key: "edit",
|
|
55
|
+
label: p("botlit.buckets.actions.edit", "Edit or move"),
|
|
56
|
+
icon: /* @__PURE__ */ O(N, { size: 14 }),
|
|
57
|
+
onSelect: () => u(t)
|
|
58
|
+
}), h(a.BUCKET_DELETE) && g.push({
|
|
59
|
+
key: "delete",
|
|
60
|
+
label: p("botlit.buckets.actions.delete", "Delete"),
|
|
61
|
+
icon: /* @__PURE__ */ O(R, { size: 14 }),
|
|
62
|
+
destructive: !0,
|
|
63
|
+
onSelect: () => d(t)
|
|
64
|
+
});
|
|
65
|
+
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__ */ k("li", {
|
|
67
|
+
role: "treeitem",
|
|
68
|
+
"aria-level": n,
|
|
69
|
+
"aria-expanded": r,
|
|
70
|
+
"aria-selected": !1,
|
|
71
|
+
children: [/* @__PURE__ */ k("div", {
|
|
72
|
+
className: "group flex items-center gap-2 rounded-md px-3 py-2 transition-colors hover:bg-accent",
|
|
73
|
+
style: { paddingLeft: `${(n - 1) * 24 + 12}px` },
|
|
29
74
|
children: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
className: "p-0.5 hover:bg-bg-sunken
|
|
35
|
-
children:
|
|
75
|
+
/* @__PURE__ */ O("button", {
|
|
76
|
+
type: "button",
|
|
77
|
+
onClick: () => o(t.id),
|
|
78
|
+
"aria-label": _,
|
|
79
|
+
className: "rounded p-0.5 hover:bg-bg-sunken",
|
|
80
|
+
children: O(r ? j : M, {
|
|
36
81
|
size: 16,
|
|
37
|
-
className: "text-text-secondary"
|
|
82
|
+
className: "text-text-secondary",
|
|
83
|
+
"aria-hidden": "true"
|
|
38
84
|
})
|
|
39
|
-
})
|
|
40
|
-
|
|
85
|
+
}),
|
|
86
|
+
r ? /* @__PURE__ */ O(F, {
|
|
41
87
|
size: 18,
|
|
42
|
-
className: "text-primary"
|
|
43
|
-
|
|
88
|
+
className: "text-primary",
|
|
89
|
+
"aria-hidden": "true"
|
|
90
|
+
}) : /* @__PURE__ */ O(P, {
|
|
44
91
|
size: 18,
|
|
45
|
-
className: "text-text-secondary"
|
|
92
|
+
className: "text-text-secondary",
|
|
93
|
+
"aria-hidden": "true"
|
|
46
94
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
|
|
95
|
+
/* @__PURE__ */ O(A, {
|
|
96
|
+
to: m(`buckets/${t.id}`),
|
|
97
|
+
className: `flex-1 font-medium hover:text-primary ${c ? "text-primary" : ""}`,
|
|
98
|
+
children: t.name
|
|
50
99
|
}),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
size: "icon",
|
|
56
|
-
className: "h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
57
|
-
onClick: (t) => {
|
|
58
|
-
t.preventDefault(), t.stopPropagation(), f(g ? null : e.id);
|
|
59
|
-
},
|
|
60
|
-
children: /* @__PURE__ */ x(A, { size: 14 })
|
|
61
|
-
}), g && /* @__PURE__ */ S("div", {
|
|
62
|
-
className: "absolute right-0 top-8 bg-popover border rounded-md shadow-lg z-50 py-1 min-w-[160px]",
|
|
63
|
-
children: [
|
|
64
|
-
/* @__PURE__ */ x(a, {
|
|
65
|
-
permission: i.BUCKET_CREATE,
|
|
66
|
-
children: /* @__PURE__ */ S("button", {
|
|
67
|
-
className: "w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-accent text-left",
|
|
68
|
-
onClick: (t) => {
|
|
69
|
-
t.preventDefault(), t.stopPropagation(), u(e.id);
|
|
70
|
-
},
|
|
71
|
-
children: [/* @__PURE__ */ x(j, { size: 14 }), "Add Sub-Bucket"]
|
|
72
|
-
})
|
|
73
|
-
}),
|
|
74
|
-
/* @__PURE__ */ x(a, {
|
|
75
|
-
permission: i.BUCKET_UPDATE,
|
|
76
|
-
children: /* @__PURE__ */ S("button", {
|
|
77
|
-
className: "w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-accent text-left",
|
|
78
|
-
onClick: (t) => {
|
|
79
|
-
t.preventDefault(), t.stopPropagation(), c(e);
|
|
80
|
-
},
|
|
81
|
-
children: [/* @__PURE__ */ x(E, { size: 14 }), "Edit"]
|
|
82
|
-
})
|
|
83
|
-
}),
|
|
84
|
-
/* @__PURE__ */ x(a, {
|
|
85
|
-
permission: i.BUCKET_DELETE,
|
|
86
|
-
children: /* @__PURE__ */ S("button", {
|
|
87
|
-
className: "w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-accent text-status-error-text text-left",
|
|
88
|
-
onClick: (t) => {
|
|
89
|
-
t.preventDefault(), t.stopPropagation(), l(e.id);
|
|
90
|
-
},
|
|
91
|
-
children: [/* @__PURE__ */ x(N, { size: 14 }), "Delete"]
|
|
92
|
-
})
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
})]
|
|
96
|
-
})
|
|
100
|
+
g.length > 0 ? /* @__PURE__ */ O(y, {
|
|
101
|
+
label: p("botlit.buckets.actions.menu", "Actions for {{name}}", { name: t.name }),
|
|
102
|
+
items: g
|
|
103
|
+
}) : null
|
|
97
104
|
]
|
|
98
|
-
})
|
|
99
|
-
})
|
|
105
|
+
}), r ? l : null]
|
|
106
|
+
});
|
|
107
|
+
}, H = ({ parentBucketId: t, level: n, expanded: r, onToggle: i, refreshKey: a, ...o }) => {
|
|
108
|
+
let s = e(), c = b(t), { refetch: l } = c;
|
|
109
|
+
return C(() => {
|
|
110
|
+
a > 0 && l();
|
|
111
|
+
}, [a, l]), c.loading ? /* @__PURE__ */ O("p", {
|
|
112
|
+
className: "px-3 py-2 text-sm text-text-secondary",
|
|
113
|
+
style: { paddingLeft: `${n * 24}px` },
|
|
114
|
+
children: s("botlit.buckets.tree.loading", "Loading…")
|
|
115
|
+
}) : c.error ? /* @__PURE__ */ O(_, {
|
|
116
|
+
resource: "buckets",
|
|
117
|
+
error: c.error,
|
|
118
|
+
onRetry: () => void l()
|
|
119
|
+
}) : c.data.length === 0 && t ? /* @__PURE__ */ O("p", {
|
|
120
|
+
className: "px-3 py-1 text-xs text-text-secondary",
|
|
121
|
+
style: { paddingLeft: `${n * 24 + 12}px` },
|
|
122
|
+
children: s("botlit.buckets.tree.noChildren", "No sub-buckets")
|
|
123
|
+
}) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("ul", {
|
|
124
|
+
role: "group",
|
|
125
|
+
className: "space-y-0.5",
|
|
126
|
+
children: c.data.map((e) => /* @__PURE__ */ O(V, {
|
|
127
|
+
bucket: e,
|
|
128
|
+
level: n,
|
|
129
|
+
expanded: r.has(e.id),
|
|
130
|
+
onToggle: i,
|
|
131
|
+
...o,
|
|
132
|
+
children: /* @__PURE__ */ O(H, {
|
|
133
|
+
parentBucketId: e.id,
|
|
134
|
+
level: n + 1,
|
|
135
|
+
expanded: r,
|
|
136
|
+
onToggle: i,
|
|
137
|
+
refreshKey: a,
|
|
138
|
+
...o
|
|
139
|
+
})
|
|
140
|
+
}, e.id))
|
|
141
|
+
}), /* @__PURE__ */ O(v, {
|
|
142
|
+
hasMore: c.hasMore,
|
|
143
|
+
loadingMore: c.loadingMore,
|
|
144
|
+
onLoadMore: () => void c.loadMore(),
|
|
145
|
+
loadedCount: c.data.length
|
|
146
|
+
})] });
|
|
147
|
+
}, U = ({ nodes: e, level: t, matchIds: n, collapsed: r, onToggle: i, ...a }) => /* @__PURE__ */ O("ul", {
|
|
148
|
+
role: "group",
|
|
149
|
+
className: "space-y-0.5",
|
|
150
|
+
children: e.map((e) => /* @__PURE__ */ O(V, {
|
|
100
151
|
bucket: e,
|
|
101
|
-
level: t
|
|
102
|
-
expanded:
|
|
103
|
-
onToggle:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
152
|
+
level: t,
|
|
153
|
+
expanded: e.children.length > 0 && !r.has(e.id),
|
|
154
|
+
onToggle: i,
|
|
155
|
+
highlight: n.has(e.id),
|
|
156
|
+
...a,
|
|
157
|
+
children: e.children.length > 0 ? /* @__PURE__ */ O(U, {
|
|
158
|
+
nodes: e.children,
|
|
159
|
+
level: t + 1,
|
|
160
|
+
matchIds: n,
|
|
161
|
+
collapsed: r,
|
|
162
|
+
onToggle: i,
|
|
163
|
+
...a
|
|
164
|
+
}) : null
|
|
165
|
+
}, e.id))
|
|
166
|
+
}), ge = ({ bucket: e }) => {
|
|
167
|
+
let { getPath: t } = i();
|
|
168
|
+
return /* @__PURE__ */ O("li", { children: /* @__PURE__ */ O(A, {
|
|
169
|
+
to: t(`buckets/${e.id}`),
|
|
170
|
+
children: /* @__PURE__ */ k(l, {
|
|
171
|
+
className: "h-full cursor-pointer transition-colors hover:border-primary/50",
|
|
172
|
+
children: [/* @__PURE__ */ O(f, {
|
|
173
|
+
className: "pb-2",
|
|
174
|
+
children: /* @__PURE__ */ k("div", {
|
|
175
|
+
className: "flex items-center gap-3",
|
|
176
|
+
children: [/* @__PURE__ */ O(P, {
|
|
177
|
+
className: "h-5 w-5 text-primary",
|
|
178
|
+
"aria-hidden": "true"
|
|
179
|
+
}), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O(p, {
|
|
180
|
+
className: "text-base",
|
|
181
|
+
children: e.name
|
|
182
|
+
}), /* @__PURE__ */ O(d, {
|
|
183
|
+
className: "text-xs",
|
|
184
|
+
children: e.path
|
|
185
|
+
})] })]
|
|
186
|
+
})
|
|
187
|
+
}), /* @__PURE__ */ O(u, { children: /* @__PURE__ */ k("div", {
|
|
188
|
+
className: "flex items-center justify-between text-sm",
|
|
189
|
+
children: [/* @__PURE__ */ O("span", {
|
|
190
|
+
className: "text-text-secondary",
|
|
191
|
+
children: e.slug
|
|
192
|
+
}), /* @__PURE__ */ O("span", {
|
|
193
|
+
className: "text-xs text-text-secondary",
|
|
194
|
+
children: S(e.createdAt)
|
|
195
|
+
})]
|
|
196
|
+
}) })]
|
|
197
|
+
})
|
|
198
|
+
}) });
|
|
199
|
+
}, W = () => {
|
|
200
|
+
let i = e(), [s, y] = T(""), b = he(s.trim(), fe), S = b.length > 0, [C, A] = T(pe), [j, M] = T(() => /* @__PURE__ */ new Set()), [N, P] = T(() => /* @__PURE__ */ new Set()), [F, R] = T(0), [B, V] = T(null), [W, G] = T(null), K = x({}), q = x({ parentBucketId: null }), J = x({ search: b }), Y = ae(), X = ie(b), [_e, ve] = oe(), [ye, be] = ce(), [xe, Se] = se(), Z = w(() => ne(re(X.data)), [X.data]), Ce = w(() => new Set(X.data.map((e) => e.id)), [X.data]), Q = (e) => {
|
|
201
|
+
A(e), me(e);
|
|
202
|
+
}, we = () => {
|
|
203
|
+
R((e) => e + 1), K.refetch(), q.refetch(), Y.refetch(), S && (X.refetch(), J.refetch());
|
|
204
|
+
}, Te = (e) => {
|
|
205
|
+
let t = (t) => {
|
|
119
206
|
let n = new Set(t);
|
|
120
207
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
await
|
|
135
|
-
|
|
136
|
-
slug: W.name.toLowerCase().replace(/\s+/g, "-"),
|
|
137
|
-
description: W.description,
|
|
138
|
-
parentBucketId: W.parentBucketId,
|
|
139
|
-
metadata: { visibility: W.visibility }
|
|
140
|
-
});
|
|
141
|
-
} catch (e) {
|
|
142
|
-
F.error(e instanceof Error ? e.message : "Failed to create bucket");
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
F.success(`Bucket "${W.name}" created`), q(), Y(), R(!1), G({
|
|
146
|
-
name: "",
|
|
147
|
-
description: "",
|
|
148
|
-
visibility: "PRIVATE",
|
|
149
|
-
parentBucketId: void 0
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}, Ee = async () => {
|
|
153
|
-
if (V && W.name) {
|
|
154
|
-
try {
|
|
155
|
-
await ve({
|
|
156
|
-
bucketId: V.id,
|
|
208
|
+
};
|
|
209
|
+
S ? P(t) : M(t);
|
|
210
|
+
}, Ee = (e, t) => e instanceof Error ? e.message : t, De = async (e) => {
|
|
211
|
+
if (!B) return !1;
|
|
212
|
+
try {
|
|
213
|
+
if (B.mode === "create") await _e({
|
|
214
|
+
name: e.name,
|
|
215
|
+
slug: e.name,
|
|
216
|
+
description: e.description || void 0,
|
|
217
|
+
parentBucketId: e.parentBucketId ?? void 0
|
|
218
|
+
}), z.success(i("botlit.buckets.toast.created", "Bucket \"{{name}}\" created", { name: e.name })), e.parentBucketId && M((t) => new Set(t).add(e.parentBucketId));
|
|
219
|
+
else {
|
|
220
|
+
let { bucket: t } = B;
|
|
221
|
+
await ye({
|
|
222
|
+
bucketId: t.id,
|
|
157
223
|
input: {
|
|
158
|
-
name:
|
|
159
|
-
description:
|
|
224
|
+
name: e.name,
|
|
225
|
+
description: e.description,
|
|
226
|
+
...e.parentBucketId === (t.parentBucketId ?? null) ? {} : { parentBucketId: e.parentBucketId }
|
|
160
227
|
}
|
|
161
|
-
});
|
|
162
|
-
} catch (e) {
|
|
163
|
-
F.error(e instanceof Error ? e.message : "Failed to update bucket");
|
|
164
|
-
return;
|
|
228
|
+
}), z.success(i("botlit.buckets.toast.updated", "Bucket \"{{name}}\" saved", { name: e.name }));
|
|
165
229
|
}
|
|
166
|
-
|
|
230
|
+
} catch (e) {
|
|
231
|
+
return z.error(Ee(e, B.mode === "create" ? i("botlit.buckets.toast.createFailed", "Could not create the bucket.") : i("botlit.buckets.toast.updateFailed", "Could not save the bucket."))), !1;
|
|
167
232
|
}
|
|
168
|
-
|
|
233
|
+
return we(), !0;
|
|
234
|
+
}, Oe = async (e) => {
|
|
235
|
+
n("medium");
|
|
169
236
|
try {
|
|
170
|
-
await
|
|
237
|
+
await xe(e.id);
|
|
171
238
|
} catch (e) {
|
|
172
|
-
t() && r("error"),
|
|
239
|
+
t() && r("error"), z.error(Ee(e, i("botlit.buckets.toast.deleteFailed", "Could not delete the bucket.")));
|
|
173
240
|
return;
|
|
174
241
|
}
|
|
175
|
-
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
visibility: "PRIVATE",
|
|
181
|
-
parentBucketId: void 0
|
|
182
|
-
}), H(e), U(null);
|
|
183
|
-
}, $ = (e) => {
|
|
184
|
-
G({
|
|
185
|
-
name: "",
|
|
186
|
-
description: "",
|
|
187
|
-
visibility: "PRIVATE",
|
|
188
|
-
parentBucketId: e
|
|
189
|
-
}), R(!0);
|
|
190
|
-
};
|
|
191
|
-
return /* @__PURE__ */ x(s, {
|
|
192
|
-
title: "Buckets",
|
|
193
|
-
description: "Organize your agents, apps, and resources into hierarchical folders",
|
|
194
|
-
actions: /* @__PURE__ */ x(a, {
|
|
195
|
-
permission: i.BUCKET_CREATE,
|
|
196
|
-
children: /* @__PURE__ */ x(p, {
|
|
197
|
-
leftIcon: /* @__PURE__ */ x(j, { size: 16 }),
|
|
198
|
-
onClick: () => $(),
|
|
199
|
-
children: "Create Bucket"
|
|
200
|
-
})
|
|
242
|
+
t() && r("success"), z.success(i("botlit.buckets.toast.deleted", "Bucket \"{{name}}\" deleted", { name: e.name })), G(null), we();
|
|
243
|
+
}, ke = {
|
|
244
|
+
onEdit: (e) => V({
|
|
245
|
+
mode: "edit",
|
|
246
|
+
bucket: e
|
|
201
247
|
}),
|
|
202
|
-
|
|
248
|
+
onDelete: (e) => G(e),
|
|
249
|
+
onCreateChild: (e) => V({
|
|
250
|
+
mode: "create",
|
|
251
|
+
parentId: e.id
|
|
252
|
+
})
|
|
253
|
+
}, Ae = /* @__PURE__ */ O(o, {
|
|
254
|
+
permission: a.BUCKET_CREATE,
|
|
255
|
+
children: /* @__PURE__ */ O(m, {
|
|
256
|
+
leftIcon: /* @__PURE__ */ O(L, { size: 16 }),
|
|
257
|
+
onClick: () => V({
|
|
258
|
+
mode: "create",
|
|
259
|
+
parentId: null
|
|
260
|
+
}),
|
|
261
|
+
children: i("botlit.buckets.actions.create", "Create bucket")
|
|
262
|
+
})
|
|
263
|
+
}), je = K.data === 0, Me = /* @__PURE__ */ O(g, {
|
|
264
|
+
illustration: "empty-files",
|
|
265
|
+
title: i("botlit.buckets.empty.title", "No buckets yet"),
|
|
266
|
+
description: i("botlit.buckets.empty.description", "Create buckets to organise your BotManor resources."),
|
|
267
|
+
action: Ae
|
|
268
|
+
}), $ = /* @__PURE__ */ O(g, {
|
|
269
|
+
illustration: "empty-search",
|
|
270
|
+
title: i("botlit.buckets.search.noneTitle", "No buckets match \"{{search}}\"", { search: b }),
|
|
271
|
+
description: i("botlit.buckets.search.noneDescription", "Try another name, slug or description.")
|
|
272
|
+
});
|
|
273
|
+
return /* @__PURE__ */ O(c, {
|
|
274
|
+
title: i("botlit.buckets.title", "Buckets"),
|
|
275
|
+
description: i("botlit.buckets.description", "Organise your agents, bots and resources into hierarchical folders"),
|
|
276
|
+
actions: Ae,
|
|
277
|
+
children: /* @__PURE__ */ k("div", {
|
|
203
278
|
className: "space-y-6",
|
|
204
279
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
icon: /* @__PURE__ */
|
|
207
|
-
children: "Buckets are folders for
|
|
280
|
+
/* @__PURE__ */ O(le, {
|
|
281
|
+
icon: /* @__PURE__ */ O(I, { size: 18 }),
|
|
282
|
+
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.")
|
|
208
283
|
}),
|
|
209
|
-
K.
|
|
210
|
-
className: "grid grid-cols-2 gap-4
|
|
211
|
-
children: [/* @__PURE__ */
|
|
284
|
+
K.data !== null && K.data > 0 ? /* @__PURE__ */ k("div", {
|
|
285
|
+
className: "grid grid-cols-2 gap-4",
|
|
286
|
+
children: [/* @__PURE__ */ k(E, {
|
|
212
287
|
treatment: "glass",
|
|
213
288
|
glow: !0,
|
|
214
289
|
className: "p-4",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ O("p", {
|
|
216
291
|
className: "text-sm text-text-secondary",
|
|
217
|
-
children: "Total buckets"
|
|
218
|
-
}), /* @__PURE__ */
|
|
292
|
+
children: i("botlit.buckets.summary.total", "Total buckets")
|
|
293
|
+
}), /* @__PURE__ */ O("p", {
|
|
219
294
|
className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
|
|
220
|
-
children: K.
|
|
295
|
+
children: K.data
|
|
221
296
|
})]
|
|
222
|
-
}), /* @__PURE__ */
|
|
297
|
+
}), /* @__PURE__ */ k(E, {
|
|
223
298
|
treatment: "metric",
|
|
224
299
|
className: "p-4",
|
|
225
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ O("p", {
|
|
226
301
|
className: "text-sm text-text-secondary",
|
|
227
|
-
children: "Top-level buckets"
|
|
228
|
-
}), /* @__PURE__ */
|
|
302
|
+
children: i("botlit.buckets.summary.topLevel", "Top-level buckets")
|
|
303
|
+
}), /* @__PURE__ */ O("p", {
|
|
229
304
|
className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
|
|
230
|
-
children:
|
|
305
|
+
children: q.data ?? "…"
|
|
231
306
|
})]
|
|
232
307
|
})]
|
|
233
308
|
}) : null,
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
className: "flex items-center justify-between gap-4",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
237
|
-
className: "relative
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
309
|
+
/* @__PURE__ */ k("div", {
|
|
310
|
+
className: "flex flex-wrap items-center justify-between gap-4",
|
|
311
|
+
children: [/* @__PURE__ */ k("div", {
|
|
312
|
+
className: "relative min-w-0 max-w-md flex-1",
|
|
313
|
+
children: [/* @__PURE__ */ O(de, {
|
|
314
|
+
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary",
|
|
315
|
+
"aria-hidden": "true"
|
|
316
|
+
}), /* @__PURE__ */ O(h, {
|
|
317
|
+
type: "search",
|
|
318
|
+
"aria-label": i("botlit.buckets.search.label", "Search buckets"),
|
|
319
|
+
placeholder: i("botlit.buckets.search.placeholder", "Search buckets…"),
|
|
320
|
+
value: s,
|
|
321
|
+
onChange: (e) => y(e.target.value),
|
|
242
322
|
className: "pl-9"
|
|
243
323
|
})]
|
|
244
|
-
}), /* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ k("div", {
|
|
245
325
|
className: "flex items-center gap-2",
|
|
246
|
-
children: [
|
|
247
|
-
|
|
248
|
-
|
|
326
|
+
children: [C === "tree" && !S ? /* @__PURE__ */ O(m, {
|
|
327
|
+
variant: "outline",
|
|
328
|
+
size: "sm",
|
|
329
|
+
onClick: () => M(/* @__PURE__ */ new Set()),
|
|
330
|
+
children: i("botlit.buckets.tree.collapseAll", "Collapse all")
|
|
331
|
+
}) : null, /* @__PURE__ */ k("div", {
|
|
332
|
+
role: "group",
|
|
333
|
+
"aria-label": i("botlit.buckets.view.label", "View"),
|
|
334
|
+
className: "flex overflow-hidden rounded-md border border-border-subtle",
|
|
335
|
+
children: [/* @__PURE__ */ O(m, {
|
|
336
|
+
variant: C === "tree" ? "default" : "ghost",
|
|
249
337
|
size: "sm",
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
338
|
+
className: "rounded-none",
|
|
339
|
+
"aria-pressed": C === "tree",
|
|
340
|
+
"aria-label": i("botlit.buckets.view.tree", "Tree view"),
|
|
341
|
+
title: i("botlit.buckets.view.tree", "Tree view"),
|
|
342
|
+
onClick: () => Q("tree"),
|
|
343
|
+
children: /* @__PURE__ */ O(I, {
|
|
344
|
+
size: 16,
|
|
345
|
+
"aria-hidden": "true"
|
|
346
|
+
})
|
|
347
|
+
}), /* @__PURE__ */ O(m, {
|
|
348
|
+
variant: C === "list" ? "default" : "ghost",
|
|
255
349
|
size: "sm",
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
children:
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}), /* @__PURE__ */ x(p, {
|
|
268
|
-
variant: E === "list" ? "default" : "ghost",
|
|
269
|
-
size: "sm",
|
|
270
|
-
className: "rounded-none",
|
|
271
|
-
onClick: () => O("list"),
|
|
272
|
-
children: /* @__PURE__ */ x(le, { size: 16 })
|
|
273
|
-
})]
|
|
274
|
-
})
|
|
275
|
-
]
|
|
350
|
+
className: "rounded-none",
|
|
351
|
+
"aria-pressed": C === "list",
|
|
352
|
+
"aria-label": i("botlit.buckets.view.list", "List view"),
|
|
353
|
+
title: i("botlit.buckets.view.list", "List view"),
|
|
354
|
+
onClick: () => Q("list"),
|
|
355
|
+
children: /* @__PURE__ */ O(ue, {
|
|
356
|
+
size: 16,
|
|
357
|
+
"aria-hidden": "true"
|
|
358
|
+
})
|
|
359
|
+
})]
|
|
360
|
+
})]
|
|
276
361
|
})]
|
|
277
362
|
}),
|
|
278
|
-
|
|
363
|
+
S ? /* @__PURE__ */ O("p", {
|
|
364
|
+
className: "text-sm text-text-secondary",
|
|
365
|
+
"aria-live": "polite",
|
|
366
|
+
children: J.data === null ? i("botlit.buckets.search.searching", "Searching…") : i("botlit.buckets.search.count", "{{count}} bucket(s) match", { count: J.data })
|
|
367
|
+
}) : null,
|
|
368
|
+
C === "tree" ? /* @__PURE__ */ O(l, { children: /* @__PURE__ */ O(u, {
|
|
279
369
|
className: "p-2",
|
|
280
|
-
children: X ? /* @__PURE__ */
|
|
281
|
-
className: "
|
|
282
|
-
children:
|
|
283
|
-
|
|
284
|
-
2,
|
|
285
|
-
3,
|
|
286
|
-
4
|
|
287
|
-
].map((e) => /* @__PURE__ */ x("div", { className: "h-10 bg-bg-sunken motion-safe:animate-vc-shimmer rounded" }, e))
|
|
288
|
-
}) : Z ? /* @__PURE__ */ x(v, {
|
|
370
|
+
children: S ? X.loading ? /* @__PURE__ */ O("p", {
|
|
371
|
+
className: "p-4 text-sm text-text-secondary",
|
|
372
|
+
children: i("botlit.buckets.tree.loading", "Loading…")
|
|
373
|
+
}) : X.error ? /* @__PURE__ */ O(_, {
|
|
289
374
|
resource: "buckets",
|
|
290
|
-
error:
|
|
291
|
-
onRetry: () => void
|
|
292
|
-
}) :
|
|
375
|
+
error: X.error,
|
|
376
|
+
onRetry: () => void X.refetch()
|
|
377
|
+
}) : Z.length === 0 ? $ : /* @__PURE__ */ k("div", {
|
|
378
|
+
role: "tree",
|
|
379
|
+
"aria-label": i("botlit.buckets.tree.label", "Buckets"),
|
|
293
380
|
className: "py-2",
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
onToggle:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
}) : /* @__PURE__ */
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
})
|
|
319
|
-
})
|
|
320
|
-
}) }),
|
|
321
|
-
E === "list" && /* @__PURE__ */ x(se, { children: X ? /* @__PURE__ */ x("div", {
|
|
322
|
-
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
323
|
-
children: [
|
|
324
|
-
1,
|
|
325
|
-
2,
|
|
326
|
-
3
|
|
327
|
-
].map((e) => /* @__PURE__ */ x("div", { className: "h-32 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
|
|
328
|
-
}) : Z ? /* @__PURE__ */ x(v, {
|
|
329
|
-
resource: "buckets",
|
|
330
|
-
error: Z,
|
|
331
|
-
onRetry: () => void Q()
|
|
332
|
-
}) : K.length > 0 ? /* @__PURE__ */ x("div", {
|
|
333
|
-
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
334
|
-
children: K.map((e) => /* @__PURE__ */ x(C, {
|
|
335
|
-
to: o(`buckets/${e.id}`),
|
|
336
|
-
children: /* @__PURE__ */ S(c, {
|
|
337
|
-
className: "h-full hover:border-primary/50 transition-colors cursor-pointer",
|
|
338
|
-
children: [/* @__PURE__ */ x(d, {
|
|
339
|
-
className: "pb-2",
|
|
340
|
-
children: /* @__PURE__ */ x("div", {
|
|
341
|
-
className: "flex items-start justify-between",
|
|
342
|
-
children: /* @__PURE__ */ S("div", {
|
|
343
|
-
className: "flex items-center gap-3",
|
|
344
|
-
children: [/* @__PURE__ */ x(D, { className: "h-5 w-5 text-primary" }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x(f, {
|
|
345
|
-
className: "text-base",
|
|
346
|
-
children: e.name
|
|
347
|
-
}), /* @__PURE__ */ x(u, {
|
|
348
|
-
className: "text-xs",
|
|
349
|
-
children: e.path
|
|
350
|
-
})] })]
|
|
351
|
-
})
|
|
352
|
-
})
|
|
353
|
-
}), /* @__PURE__ */ x(l, { children: /* @__PURE__ */ S("div", {
|
|
354
|
-
className: "flex items-center justify-between text-sm",
|
|
355
|
-
children: [/* @__PURE__ */ x("span", {
|
|
356
|
-
className: "text-text-secondary",
|
|
357
|
-
children: e.slug
|
|
358
|
-
}), /* @__PURE__ */ x("span", {
|
|
359
|
-
className: "text-xs text-text-secondary",
|
|
360
|
-
children: ee(e.createdAt)
|
|
361
|
-
})]
|
|
362
|
-
}) })]
|
|
363
|
-
})
|
|
364
|
-
}, e.id))
|
|
365
|
-
}) : /* @__PURE__ */ x(_, {
|
|
366
|
-
illustration: "empty-search",
|
|
367
|
-
title: "No buckets found",
|
|
368
|
-
description: "Create buckets to organize your BotManor resources.",
|
|
369
|
-
action: /* @__PURE__ */ x(a, {
|
|
370
|
-
permission: i.BUCKET_CREATE,
|
|
371
|
-
children: /* @__PURE__ */ x(p, {
|
|
372
|
-
leftIcon: /* @__PURE__ */ x(j, { size: 16 }),
|
|
373
|
-
onClick: () => $(),
|
|
374
|
-
children: "Create Bucket"
|
|
381
|
+
children: [/* @__PURE__ */ O(U, {
|
|
382
|
+
nodes: Z,
|
|
383
|
+
level: 1,
|
|
384
|
+
matchIds: Ce,
|
|
385
|
+
collapsed: N,
|
|
386
|
+
onToggle: Te,
|
|
387
|
+
...ke
|
|
388
|
+
}), /* @__PURE__ */ O(v, {
|
|
389
|
+
hasMore: X.hasMore,
|
|
390
|
+
loadingMore: X.loadingMore,
|
|
391
|
+
onLoadMore: () => void X.loadMore(),
|
|
392
|
+
loadedCount: X.data.length
|
|
393
|
+
})]
|
|
394
|
+
}) : je ? Me : /* @__PURE__ */ O("div", {
|
|
395
|
+
role: "tree",
|
|
396
|
+
"aria-label": i("botlit.buckets.tree.label", "Buckets"),
|
|
397
|
+
className: "py-2",
|
|
398
|
+
children: /* @__PURE__ */ O(H, {
|
|
399
|
+
parentBucketId: null,
|
|
400
|
+
level: 1,
|
|
401
|
+
expanded: j,
|
|
402
|
+
onToggle: Te,
|
|
403
|
+
refreshKey: F,
|
|
404
|
+
...ke
|
|
375
405
|
})
|
|
376
406
|
})
|
|
377
|
-
}) })
|
|
378
|
-
|
|
407
|
+
}) }) : (() => {
|
|
408
|
+
let e = S ? X : Y;
|
|
409
|
+
return e.loading ? /* @__PURE__ */ O("div", {
|
|
410
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
411
|
+
children: [
|
|
412
|
+
1,
|
|
413
|
+
2,
|
|
414
|
+
3
|
|
415
|
+
].map((e) => /* @__PURE__ */ O("div", { className: "h-32 rounded-lg bg-bg-sunken motion-safe:animate-vc-shimmer" }, e))
|
|
416
|
+
}) : e.error ? /* @__PURE__ */ O(_, {
|
|
417
|
+
resource: "buckets",
|
|
418
|
+
error: e.error,
|
|
419
|
+
onRetry: () => void e.refetch()
|
|
420
|
+
}) : e.data.length === 0 ? S ? $ : Me : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("ul", {
|
|
421
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
422
|
+
children: e.data.map((e) => /* @__PURE__ */ O(ge, { bucket: e }, e.id))
|
|
423
|
+
}), /* @__PURE__ */ O(v, {
|
|
424
|
+
hasMore: e.hasMore,
|
|
425
|
+
loadingMore: e.loadingMore,
|
|
426
|
+
onLoadMore: () => void e.loadMore(),
|
|
427
|
+
loadedCount: e.data.length
|
|
428
|
+
})] });
|
|
429
|
+
})(),
|
|
430
|
+
/* @__PURE__ */ k(l, { children: [/* @__PURE__ */ k(f, { children: [/* @__PURE__ */ k(p, {
|
|
379
431
|
className: "flex items-center gap-2",
|
|
380
|
-
children: [/* @__PURE__ */
|
|
381
|
-
|
|
382
|
-
|
|
432
|
+
children: [/* @__PURE__ */ O(I, {
|
|
433
|
+
size: 18,
|
|
434
|
+
"aria-hidden": "true"
|
|
435
|
+
}), i("botlit.buckets.help.title", "Organising with buckets")]
|
|
436
|
+
}), /* @__PURE__ */ O(d, { children: i("botlit.buckets.help.description", "What buckets do today") })] }), /* @__PURE__ */ O(u, { children: /* @__PURE__ */ k("div", {
|
|
437
|
+
className: "grid grid-cols-1 gap-6 md:grid-cols-3",
|
|
383
438
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ k("div", {
|
|
385
440
|
className: "space-y-2",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
387
442
|
className: "font-medium",
|
|
388
|
-
children: "
|
|
389
|
-
}), /* @__PURE__ */
|
|
443
|
+
children: i("botlit.buckets.help.hierarchyTitle", "Nested folders")
|
|
444
|
+
}), /* @__PURE__ */ O("p", {
|
|
390
445
|
className: "text-sm text-text-secondary",
|
|
391
|
-
children: "
|
|
446
|
+
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.")
|
|
392
447
|
})]
|
|
393
448
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ k("div", {
|
|
395
450
|
className: "space-y-2",
|
|
396
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
397
452
|
className: "font-medium",
|
|
398
|
-
children: "
|
|
399
|
-
}), /* @__PURE__ */
|
|
453
|
+
children: i("botlit.buckets.help.moveTitle", "Move and rename")
|
|
454
|
+
}), /* @__PURE__ */ O("p", {
|
|
400
455
|
className: "text-sm text-text-secondary",
|
|
401
|
-
children: "
|
|
456
|
+
children: i("botlit.buckets.help.moveBody", "Edit a bucket to rename it or move it under another bucket. Everything inside moves with it.")
|
|
402
457
|
})]
|
|
403
458
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ k("div", {
|
|
405
460
|
className: "space-y-2",
|
|
406
|
-
children: [/* @__PURE__ */
|
|
461
|
+
children: [/* @__PURE__ */ O("h3", {
|
|
407
462
|
className: "font-medium",
|
|
408
|
-
children: "
|
|
409
|
-
}), /* @__PURE__ */
|
|
463
|
+
children: i("botlit.buckets.help.accessTitle", "Access and policies")
|
|
464
|
+
}), /* @__PURE__ */ O("p", {
|
|
410
465
|
className: "text-sm text-text-secondary",
|
|
411
|
-
children: "
|
|
466
|
+
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.")
|
|
412
467
|
})]
|
|
413
468
|
})
|
|
414
469
|
]
|
|
415
470
|
}) })] }),
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
variant: "ghost",
|
|
425
|
-
size: "icon",
|
|
426
|
-
onClick: () => R(!1),
|
|
427
|
-
children: /* @__PURE__ */ x(P, { size: 16 })
|
|
428
|
-
})]
|
|
429
|
-
}), /* @__PURE__ */ x(u, { children: W.parentBucketId ? "Create a new sub-bucket" : "Create a new root bucket" })] }),
|
|
430
|
-
/* @__PURE__ */ S(l, {
|
|
431
|
-
className: "space-y-4",
|
|
432
|
-
children: [
|
|
433
|
-
/* @__PURE__ */ x(m, {
|
|
434
|
-
label: "Bucket Name",
|
|
435
|
-
required: !0,
|
|
436
|
-
children: /* @__PURE__ */ x(h, {
|
|
437
|
-
placeholder: "e.g., Marketing Team",
|
|
438
|
-
value: W.name,
|
|
439
|
-
onChange: (e) => G({
|
|
440
|
-
...W,
|
|
441
|
-
name: e.target.value
|
|
442
|
-
})
|
|
443
|
-
})
|
|
444
|
-
}),
|
|
445
|
-
/* @__PURE__ */ x(m, {
|
|
446
|
-
label: "Description",
|
|
447
|
-
children: /* @__PURE__ */ x(g, {
|
|
448
|
-
placeholder: "What is this bucket for?",
|
|
449
|
-
value: W.description,
|
|
450
|
-
onChange: (e) => G({
|
|
451
|
-
...W,
|
|
452
|
-
description: e.target.value
|
|
453
|
-
}),
|
|
454
|
-
rows: 2
|
|
455
|
-
})
|
|
456
|
-
}),
|
|
457
|
-
/* @__PURE__ */ x(m, {
|
|
458
|
-
label: "Visibility",
|
|
459
|
-
children: /* @__PURE__ */ S("select", {
|
|
460
|
-
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
461
|
-
value: W.visibility,
|
|
462
|
-
onChange: (e) => G({
|
|
463
|
-
...W,
|
|
464
|
-
visibility: e.target.value
|
|
465
|
-
}),
|
|
466
|
-
children: [
|
|
467
|
-
/* @__PURE__ */ x("option", {
|
|
468
|
-
value: "PRIVATE",
|
|
469
|
-
children: "Private"
|
|
470
|
-
}),
|
|
471
|
-
/* @__PURE__ */ x("option", {
|
|
472
|
-
value: "WORKSPACE",
|
|
473
|
-
children: "Workspace"
|
|
474
|
-
}),
|
|
475
|
-
/* @__PURE__ */ x("option", {
|
|
476
|
-
value: "PUBLIC",
|
|
477
|
-
children: "Public"
|
|
478
|
-
})
|
|
479
|
-
]
|
|
480
|
-
})
|
|
481
|
-
})
|
|
482
|
-
]
|
|
483
|
-
}),
|
|
484
|
-
/* @__PURE__ */ S("div", {
|
|
485
|
-
className: "flex justify-end gap-2 p-4 border-t",
|
|
486
|
-
children: [/* @__PURE__ */ x(p, {
|
|
487
|
-
variant: "outline",
|
|
488
|
-
onClick: () => R(!1),
|
|
489
|
-
children: "Cancel"
|
|
490
|
-
}), /* @__PURE__ */ x(p, {
|
|
491
|
-
onClick: Te,
|
|
492
|
-
isLoading: _e.loading,
|
|
493
|
-
disabled: !W.name,
|
|
494
|
-
leftIcon: /* @__PURE__ */ x(M, { size: 16 }),
|
|
495
|
-
children: "Create Bucket"
|
|
496
|
-
})]
|
|
497
|
-
})
|
|
498
|
-
]
|
|
499
|
-
})
|
|
471
|
+
/* @__PURE__ */ O(ee, {
|
|
472
|
+
mode: B?.mode ?? "create",
|
|
473
|
+
open: B !== null,
|
|
474
|
+
bucket: B?.mode === "edit" ? B.bucket : null,
|
|
475
|
+
initialParentId: B?.mode === "create" ? B.parentId : null,
|
|
476
|
+
saving: ve.loading || be.loading,
|
|
477
|
+
onSubmit: De,
|
|
478
|
+
onClose: () => V(null)
|
|
500
479
|
}),
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
/* @__PURE__ */ S(d, { children: [/* @__PURE__ */ S(f, {
|
|
507
|
-
className: "flex items-center justify-between",
|
|
508
|
-
children: [/* @__PURE__ */ x("span", { children: "Edit Bucket" }), /* @__PURE__ */ x(p, {
|
|
509
|
-
variant: "ghost",
|
|
510
|
-
size: "icon",
|
|
511
|
-
onClick: () => H(null),
|
|
512
|
-
children: /* @__PURE__ */ x(P, { size: 16 })
|
|
513
|
-
})]
|
|
514
|
-
}), /* @__PURE__ */ x(u, { children: "Update bucket details" })] }),
|
|
515
|
-
/* @__PURE__ */ S(l, {
|
|
516
|
-
className: "space-y-4",
|
|
517
|
-
children: [
|
|
518
|
-
/* @__PURE__ */ x(m, {
|
|
519
|
-
label: "Bucket Name",
|
|
520
|
-
required: !0,
|
|
521
|
-
children: /* @__PURE__ */ x(h, {
|
|
522
|
-
placeholder: "e.g., Marketing Team",
|
|
523
|
-
value: W.name,
|
|
524
|
-
onChange: (e) => G({
|
|
525
|
-
...W,
|
|
526
|
-
name: e.target.value
|
|
527
|
-
})
|
|
528
|
-
})
|
|
529
|
-
}),
|
|
530
|
-
/* @__PURE__ */ x(m, {
|
|
531
|
-
label: "Description",
|
|
532
|
-
children: /* @__PURE__ */ x(g, {
|
|
533
|
-
placeholder: "What is this bucket for?",
|
|
534
|
-
value: W.description,
|
|
535
|
-
onChange: (e) => G({
|
|
536
|
-
...W,
|
|
537
|
-
description: e.target.value
|
|
538
|
-
}),
|
|
539
|
-
rows: 2
|
|
540
|
-
})
|
|
541
|
-
}),
|
|
542
|
-
/* @__PURE__ */ x(m, {
|
|
543
|
-
label: "Visibility",
|
|
544
|
-
children: /* @__PURE__ */ S("select", {
|
|
545
|
-
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
546
|
-
value: W.visibility,
|
|
547
|
-
onChange: (e) => G({
|
|
548
|
-
...W,
|
|
549
|
-
visibility: e.target.value
|
|
550
|
-
}),
|
|
551
|
-
children: [
|
|
552
|
-
/* @__PURE__ */ x("option", {
|
|
553
|
-
value: "PRIVATE",
|
|
554
|
-
children: "Private"
|
|
555
|
-
}),
|
|
556
|
-
/* @__PURE__ */ x("option", {
|
|
557
|
-
value: "WORKSPACE",
|
|
558
|
-
children: "Workspace"
|
|
559
|
-
}),
|
|
560
|
-
/* @__PURE__ */ x("option", {
|
|
561
|
-
value: "PUBLIC",
|
|
562
|
-
children: "Public"
|
|
563
|
-
})
|
|
564
|
-
]
|
|
565
|
-
})
|
|
566
|
-
})
|
|
567
|
-
]
|
|
568
|
-
}),
|
|
569
|
-
/* @__PURE__ */ S("div", {
|
|
570
|
-
className: "flex justify-end gap-2 p-4 border-t",
|
|
571
|
-
children: [/* @__PURE__ */ x(p, {
|
|
572
|
-
variant: "outline",
|
|
573
|
-
onClick: () => H(null),
|
|
574
|
-
children: "Cancel"
|
|
575
|
-
}), /* @__PURE__ */ x(p, {
|
|
576
|
-
onClick: Ee,
|
|
577
|
-
isLoading: ye.loading,
|
|
578
|
-
disabled: !W.name,
|
|
579
|
-
leftIcon: /* @__PURE__ */ x(M, { size: 16 }),
|
|
580
|
-
children: "Save Changes"
|
|
581
|
-
})]
|
|
582
|
-
})
|
|
583
|
-
]
|
|
584
|
-
})
|
|
585
|
-
}),
|
|
586
|
-
z && /* @__PURE__ */ x("div", {
|
|
587
|
-
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50",
|
|
588
|
-
children: /* @__PURE__ */ S(c, {
|
|
589
|
-
className: "w-full max-w-md mx-4",
|
|
590
|
-
children: [
|
|
591
|
-
/* @__PURE__ */ S(d, { children: [/* @__PURE__ */ S(f, {
|
|
592
|
-
className: "flex items-center gap-2 text-status-error-text",
|
|
593
|
-
children: [/* @__PURE__ */ x(N, { size: 18 }), "Delete Bucket"]
|
|
594
|
-
}), /* @__PURE__ */ x(u, { children: "Are you sure you want to delete this bucket? This action cannot be undone." })] }),
|
|
595
|
-
/* @__PURE__ */ x(l, { children: /* @__PURE__ */ x("p", {
|
|
596
|
-
className: "text-sm text-text-secondary",
|
|
597
|
-
children: "Note: Buckets with children or items cannot be deleted. You must delete or move all contents first."
|
|
598
|
-
}) }),
|
|
599
|
-
/* @__PURE__ */ S("div", {
|
|
600
|
-
className: "flex justify-end gap-2 p-4 border-t",
|
|
601
|
-
children: [/* @__PURE__ */ x(p, {
|
|
602
|
-
variant: "outline",
|
|
603
|
-
onClick: () => B(null),
|
|
604
|
-
children: "Cancel"
|
|
605
|
-
}), /* @__PURE__ */ x(p, {
|
|
606
|
-
variant: "destructive",
|
|
607
|
-
onClick: () => {
|
|
608
|
-
n("medium"), De(z);
|
|
609
|
-
},
|
|
610
|
-
isLoading: xe.loading,
|
|
611
|
-
leftIcon: /* @__PURE__ */ x(N, { size: 16 }),
|
|
612
|
-
children: "Delete Bucket"
|
|
613
|
-
})]
|
|
614
|
-
})
|
|
615
|
-
]
|
|
616
|
-
})
|
|
480
|
+
/* @__PURE__ */ O(te, {
|
|
481
|
+
bucket: W,
|
|
482
|
+
deleting: Se.loading,
|
|
483
|
+
onConfirm: (e) => void Oe(e),
|
|
484
|
+
onClose: () => G(null)
|
|
617
485
|
})
|
|
618
486
|
]
|
|
619
487
|
})
|
|
620
488
|
});
|
|
621
489
|
};
|
|
622
|
-
export {
|
|
490
|
+
export { W as BucketsPage };
|
|
623
491
|
|
|
624
492
|
//# sourceMappingURL=BucketsPage.js.map
|