@burdenoff/microfe-vibecontrols 2026.528.7 → 2026.528.8
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/VibeControlsRoot.js +1 -0
- package/dist/VibeControlsRoot.js.map +1 -1
- package/dist/components/audit/AuditLogFilters.js +71 -47
- package/dist/components/audit/AuditLogFilters.js.map +1 -1
- package/dist/components/shared/AgentSetupBanner.js +50 -45
- package/dist/components/shared/AgentSetupBanner.js.map +1 -1
- package/dist/components/shared/LinkToVibePanel.js +97 -0
- package/dist/components/shared/LinkToVibePanel.js.map +1 -0
- package/dist/components/shared/index.js +1 -0
- package/dist/components/vibe/VibeLinkedEntitiesPanel.js +60 -0
- package/dist/components/vibe/VibeLinkedEntitiesPanel.js.map +1 -0
- package/dist/components/vibedeck/VibeDeckButtonTile.js +25 -23
- package/dist/components/vibedeck/VibeDeckButtonTile.js.map +1 -1
- package/dist/components/vibedeck/VibeDeckGrid.js +2 -2
- package/dist/components/vibedeck/VibeDeckGrid.js.map +1 -1
- package/dist/microfe-vibecontrols.css +1 -1
- package/dist/pages/AgentDetailsPage.js +2 -2
- package/dist/pages/AgentDetailsPage.js.map +1 -1
- package/dist/pages/AnalyticsPage.js +255 -204
- package/dist/pages/AnalyticsPage.js.map +1 -1
- package/dist/pages/OverviewPage.js +1 -11
- package/dist/pages/OverviewPage.js.map +1 -1
- package/dist/pages/SessionsPage.js +825 -629
- package/dist/pages/SessionsPage.js.map +1 -1
- package/dist/pages/VibeAuditPage.js +184 -153
- package/dist/pages/VibeAuditPage.js.map +1 -1
- package/dist/pages/VibeDeckPage.js +416 -379
- package/dist/pages/VibeDeckPage.js.map +1 -1
- package/dist/pages/VibeDetailsPage.js +621 -557
- package/dist/pages/VibeDetailsPage.js.map +1 -1
- package/dist/pages/tunnels/TunnelsTab.js +115 -90
- package/dist/pages/tunnels/TunnelsTab.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,169 +5,172 @@ import { useCreateVibeDeckButtonMutation as i, useCreateVibeDeckMutation as ee,
|
|
|
5
5
|
import { useVibeNavigate as fe } from "../providers/VibeControlsProvider.js";
|
|
6
6
|
import { useVibeControlsStore as pe } from "../store/vibeControlsStore.js";
|
|
7
7
|
import { PageHeader as me } from "../components/shared/PageHeader.js";
|
|
8
|
-
import { LoadingState as
|
|
9
|
-
import { ErrorState as
|
|
10
|
-
import { EntityTagPicker as
|
|
11
|
-
import { useDraftEntityTags as
|
|
12
|
-
import { isNative as
|
|
13
|
-
import { EmptyState as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
8
|
+
import { LoadingState as he } from "../components/shared/LoadingState.js";
|
|
9
|
+
import { ErrorState as ge } from "../components/shared/ErrorState.js";
|
|
10
|
+
import { EntityTagPicker as _e } from "../components/shared/EntityTagPicker.js";
|
|
11
|
+
import { useDraftEntityTags as ve } from "../hooks/useDraftEntityTags.js";
|
|
12
|
+
import { isNative as ye, nativeNotify as be } from "../utils/nativeBridge.js";
|
|
13
|
+
import { EmptyState as xe } from "../components/shared/EmptyState.js";
|
|
14
|
+
import { LINK_TO_VIBE_DEFAULT as a, LinkToVibePanel as Se } from "../components/shared/LinkToVibePanel.js";
|
|
15
|
+
import { GetHelpButton as Ce } from "../components/shared/GetHelpButton.js";
|
|
16
|
+
import { SelectionCheckbox as we } from "../components/shared/SelectionCheckbox.js";
|
|
16
17
|
import "../components/shared/index.js";
|
|
17
18
|
import { VIBE_PERMISSIONS as o } from "../constants/permissions.js";
|
|
18
|
-
import { VibeDeckGrid as
|
|
19
|
-
import { VibeDeckSwitcher as
|
|
20
|
-
import { VibeDeckForm as
|
|
21
|
-
import { VibeDeckButtonForm as
|
|
22
|
-
import { VibeDeckShareDialog as
|
|
23
|
-
import { VibeDeckExecutionLog as
|
|
19
|
+
import { VibeDeckGrid as Te } from "../components/vibedeck/VibeDeckGrid.js";
|
|
20
|
+
import { VibeDeckSwitcher as Ee } from "../components/vibedeck/VibeDeckSwitcher.js";
|
|
21
|
+
import { VibeDeckForm as De } from "../components/vibedeck/VibeDeckForm.js";
|
|
22
|
+
import { VibeDeckButtonForm as Oe } from "../components/vibedeck/VibeDeckButtonForm.js";
|
|
23
|
+
import { VibeDeckShareDialog as ke } from "../components/vibedeck/VibeDeckShareDialog.js";
|
|
24
|
+
import { VibeDeckExecutionLog as Ae } from "../components/vibedeck/VibeDeckExecutionLog.js";
|
|
24
25
|
import "../components/vibedeck/index.js";
|
|
25
|
-
import { useCallback as s, useEffect as
|
|
26
|
-
import { useI18n as
|
|
27
|
-
import { Copy as
|
|
28
|
-
import { usePermissions as
|
|
29
|
-
import { AnimatePresence as
|
|
26
|
+
import { useCallback as s, useEffect as je, useMemo as Me, useRef as Ne, useState as c } from "react";
|
|
27
|
+
import { useI18n as Pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
28
|
+
import { Copy as Fe, Eye as Ie, Pencil as Le, Play as Re, RefreshCw as ze, Share2 as Be, Star as Ve, Trash2 as He } from "lucide-react";
|
|
29
|
+
import { usePermissions as Ue } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
30
|
+
import { AnimatePresence as We } from "framer-motion";
|
|
30
31
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
31
32
|
import { MotionPage as d } from "@burdenoff/fe-libs/shared/motion";
|
|
32
|
-
import { AccessDenied as
|
|
33
|
+
import { AccessDenied as Ge } from "@burdenoff/fe-libs/shared/components";
|
|
33
34
|
//#region src/pages/VibeDeckPage.tsx
|
|
34
|
-
function
|
|
35
|
-
let
|
|
35
|
+
function Ke() {
|
|
36
|
+
let Ke = fe(), { hasPermission: f, isLoading: qe, permissions: p } = Ue(), m = ((e) => (t, n) => {
|
|
36
37
|
let r = e.t(t);
|
|
37
38
|
return r === t ? n : r;
|
|
38
|
-
})(
|
|
39
|
-
|
|
40
|
-
let e =
|
|
39
|
+
})(Pe()), h = (Array.isArray(p) ? p : p?.permissionStrings)?.some?.((e) => e.startsWith("vibedeck:")), Je = h ? f(o.VIBEDECK_LIST) : !0, Ye = h ? f(o.VIBEDECK_CREATE) : !0, Xe = h ? f(o.VIBEDECK_UPDATE) : !0, Ze = h ? f(o.VIBEDECK_DELETE) : !0, Qe = h ? f(o.VIBEDECK_EXECUTE) : !0, $e = qe, { activeVibeDeckId: g, setActiveVibeDeckId: _, vibeDeckMode: et, setVibeDeckMode: tt } = pe(), v = et === "preview", nt = v ? !1 : Ye, rt = v ? !1 : Xe, it = v ? !1 : Ze, [y, b] = c({ type: "none" }), [at, ot] = c(null), [x, st] = c(/* @__PURE__ */ new Set()), [S, C] = c(/* @__PURE__ */ new Set()), [ct, lt] = c(null), [ut, w] = c(null), [T, E] = c(null), [dt, D] = c([]), O = Ne(/* @__PURE__ */ new Map()), [k, A] = c(a), [ft, j] = c([]), [pt, mt] = c(!0), [ht, gt] = c(/* @__PURE__ */ new Map()), [M, _t] = c(null), N = Ne(/* @__PURE__ */ new Map());
|
|
40
|
+
je(() => {
|
|
41
|
+
let e = N.current;
|
|
41
42
|
return () => {
|
|
42
43
|
for (let t of e.values()) clearTimeout(t);
|
|
43
44
|
};
|
|
44
45
|
}, []);
|
|
45
|
-
let
|
|
46
|
+
let vt = s((e) => {
|
|
46
47
|
let t = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`, n = {
|
|
47
48
|
...e,
|
|
48
49
|
id: t
|
|
49
50
|
};
|
|
50
|
-
return
|
|
51
|
-
}, []),
|
|
52
|
-
|
|
51
|
+
return j((e) => [...e.slice(-49), n]), t;
|
|
52
|
+
}, []), P = s((e, t) => {
|
|
53
|
+
j((n) => n.map((n) => n.id === e ? {
|
|
53
54
|
...n,
|
|
54
55
|
...t
|
|
55
56
|
} : n));
|
|
56
|
-
}, []),
|
|
57
|
-
if (
|
|
57
|
+
}, []), F = s((e, t) => {
|
|
58
|
+
if (gt((n) => {
|
|
58
59
|
let r = new Map(n);
|
|
59
60
|
return r.set(e, t), r;
|
|
60
61
|
}), t === "success" || t === "error") {
|
|
61
62
|
let n = setTimeout(() => {
|
|
62
|
-
|
|
63
|
+
gt((n) => {
|
|
63
64
|
let r = new Map(n);
|
|
64
65
|
return r.get(e) === t && r.delete(e), r;
|
|
65
|
-
}),
|
|
66
|
-
}, 3e3), r =
|
|
67
|
-
r && clearTimeout(r),
|
|
66
|
+
}), N.current.delete(e);
|
|
67
|
+
}, 3e3), r = N.current.get(e);
|
|
68
|
+
r && clearTimeout(r), N.current.set(e, n);
|
|
68
69
|
}
|
|
69
70
|
}, []);
|
|
70
|
-
|
|
71
|
-
let e =
|
|
71
|
+
je(() => {
|
|
72
|
+
let e = O.current;
|
|
72
73
|
return () => {
|
|
73
74
|
for (let t of e.values()) clearTimeout(t);
|
|
74
75
|
};
|
|
75
76
|
}, []);
|
|
76
|
-
let
|
|
77
|
+
let I = s((e, t, n, r) => {
|
|
77
78
|
let i = Date.now() + Math.random();
|
|
78
|
-
|
|
79
|
+
D((r) => [...r, {
|
|
79
80
|
message: e,
|
|
80
81
|
variant: t,
|
|
81
82
|
detail: n,
|
|
82
83
|
id: i
|
|
83
84
|
}]);
|
|
84
85
|
let ee = setTimeout(() => {
|
|
85
|
-
|
|
86
|
+
D((e) => e.filter((e) => e.id !== i)), O.current.delete(i);
|
|
86
87
|
}, r ?? (t === "success" ? 1e4 : 3e4));
|
|
87
|
-
|
|
88
|
-
}, []),
|
|
89
|
-
|
|
90
|
-
let t =
|
|
91
|
-
t && (clearTimeout(t),
|
|
92
|
-
}, []),
|
|
93
|
-
r(),
|
|
88
|
+
O.current.set(i, ee);
|
|
89
|
+
}, []), yt = s((e) => {
|
|
90
|
+
D((t) => t.filter((t) => t.id !== e));
|
|
91
|
+
let t = O.current.get(e);
|
|
92
|
+
t && (clearTimeout(t), O.current.delete(e));
|
|
93
|
+
}, []), L = s((e, t) => {
|
|
94
|
+
r(), _t({
|
|
94
95
|
title: e,
|
|
95
96
|
message: t
|
|
96
97
|
});
|
|
97
|
-
}, []), { data:
|
|
98
|
+
}, []), { data: bt, loading: xt, error: St, refetch: R } = se({
|
|
98
99
|
variables: { pagination: { limit: 50 } },
|
|
99
|
-
skip:
|
|
100
|
-
}),
|
|
101
|
-
variables: { id:
|
|
102
|
-
skip: !
|
|
103
|
-
}), V =
|
|
100
|
+
skip: $e
|
|
101
|
+
}), z = Me(() => bt?.vibeDecks?.items || [], [bt]), B = g || z.find((e) => e.isDefault)?.id || z[0]?.id || null, { data: Ct, loading: wt, refetch: Tt } = ae({
|
|
102
|
+
variables: { id: B },
|
|
103
|
+
skip: !B || $e
|
|
104
|
+
}), V = Ct?.vibeDeck, H = Me(() => z.filter((e) => x.has(e.id)), [z, x]), U = Me(() => V?.buttons?.filter((e) => S.has(e.id)) ?? [], [V?.buttons, S]), Et = z.length > 0 && z.every((e) => x.has(e.id)), Dt = z.some((e) => x.has(e.id)) && !Et, Ot = (V?.buttons?.length ?? 0) > 0 && (V?.buttons ?? []).every((e) => S.has(e.id)), kt = (V?.buttons ?? []).some((e) => S.has(e.id)) && !Ot, { data: At } = oe({
|
|
104
105
|
variables: { pagination: { limit: 100 } },
|
|
105
106
|
fetchPolicy: "cache-and-network",
|
|
106
|
-
skip:
|
|
107
|
-
}),
|
|
107
|
+
skip: $e
|
|
108
|
+
}), jt = (At?.vibecontrolsAgents ?? []).map((e) => ({
|
|
108
109
|
id: e.id,
|
|
109
110
|
name: e.name,
|
|
110
111
|
isActive: e.isActive
|
|
111
|
-
})), [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}, [
|
|
115
|
-
let
|
|
116
|
-
|
|
112
|
+
})), [Mt, { loading: Nt }] = ee({ refetchQueries: ["ListVibeDecks"] }), { setDraftTagIds: Pt, flushTags: Ft } = ve("VIBECONTROLS_VIBEDECK"), [It, { loading: Lt }] = de({ refetchQueries: ["ListVibeDecks", "GetVibeDeck"] }), [W] = ne({ refetchQueries: ["ListVibeDecks"] }), [G] = le({ refetchQueries: ["ListVibeDecks", "GetVibeDeck"] }), [K] = re({ refetchQueries: ["ListVibeDecks"] }), [Rt, { loading: zt }] = i({ refetchQueries: ["GetVibeDeck"] }), [Bt, { loading: Vt }] = ue({ refetchQueries: ["GetVibeDeck"] }), [q] = te({ refetchQueries: ["GetVibeDeck"] }), [Ht] = ce({ refetchQueries: ["GetVibeDeck"] }), [J] = ie();
|
|
113
|
+
je(() => {
|
|
114
|
+
C(/* @__PURE__ */ new Set());
|
|
115
|
+
}, [B]);
|
|
116
|
+
let Ut = s((e, t) => {
|
|
117
|
+
st((n) => {
|
|
117
118
|
let r = new Set(n);
|
|
118
119
|
return t ? r.add(e) : r.delete(e), r;
|
|
119
120
|
});
|
|
120
|
-
}, []),
|
|
121
|
-
|
|
121
|
+
}, []), Wt = s((e) => {
|
|
122
|
+
st((t) => {
|
|
122
123
|
let n = new Set(t);
|
|
123
|
-
return
|
|
124
|
+
return z.forEach((t) => {
|
|
124
125
|
e ? n.add(t.id) : n.delete(t.id);
|
|
125
126
|
}), n;
|
|
126
127
|
});
|
|
127
|
-
}, [
|
|
128
|
-
|
|
128
|
+
}, [z]), Y = s(() => {
|
|
129
|
+
st(/* @__PURE__ */ new Set());
|
|
129
130
|
}, []);
|
|
130
131
|
s((e, t) => {
|
|
131
|
-
|
|
132
|
+
C((n) => {
|
|
132
133
|
let r = new Set(n);
|
|
133
134
|
return t ? r.add(e) : r.delete(e), r;
|
|
134
135
|
});
|
|
135
136
|
}, []);
|
|
136
|
-
let
|
|
137
|
-
|
|
137
|
+
let Gt = s((e) => {
|
|
138
|
+
C((t) => {
|
|
138
139
|
let n = new Set(t);
|
|
139
140
|
return (V?.buttons ?? []).forEach((t) => {
|
|
140
141
|
e ? n.add(t.id) : n.delete(t.id);
|
|
141
142
|
}), n;
|
|
142
143
|
});
|
|
143
144
|
}, [V?.buttons]), X = s(() => {
|
|
144
|
-
|
|
145
|
-
}, []),
|
|
145
|
+
C(/* @__PURE__ */ new Set());
|
|
146
|
+
}, []), Kt = s(async (e) => {
|
|
146
147
|
try {
|
|
147
|
-
let t =
|
|
148
|
+
let t = {
|
|
148
149
|
name: e.name,
|
|
149
150
|
description: e.description || null,
|
|
150
151
|
colorTheme: e.colorTheme || null,
|
|
151
152
|
gridColumns: e.gridColumns,
|
|
152
153
|
gridRows: e.gridRows
|
|
153
|
-
}
|
|
154
|
-
|
|
154
|
+
};
|
|
155
|
+
k.vibeId && (t.vibeId = k.vibeId, t.visibility = k.visibility);
|
|
156
|
+
let n = (await Mt({ variables: { input: t } })).data?.createVibeDeck?.id;
|
|
157
|
+
b({ type: "none" }), I("Deck created", "success"), A(a), n && await Ft(n);
|
|
155
158
|
} catch (e) {
|
|
156
159
|
if (n(e)) {
|
|
157
|
-
|
|
160
|
+
b({ type: "none" }), L("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to create more decks.");
|
|
158
161
|
return;
|
|
159
162
|
}
|
|
160
|
-
|
|
163
|
+
I(e instanceof Error ? e.message : "Failed to create deck", "error");
|
|
161
164
|
}
|
|
162
165
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
]),
|
|
168
|
-
if (
|
|
169
|
-
await
|
|
170
|
-
id:
|
|
166
|
+
Mt,
|
|
167
|
+
Ft,
|
|
168
|
+
L,
|
|
169
|
+
I
|
|
170
|
+
]), qt = s(async (e) => {
|
|
171
|
+
if (y.type === "editDeck") try {
|
|
172
|
+
await It({ variables: {
|
|
173
|
+
id: y.deckId,
|
|
171
174
|
input: {
|
|
172
175
|
name: e.name,
|
|
173
176
|
description: e.description || null,
|
|
@@ -175,31 +178,31 @@ function We() {
|
|
|
175
178
|
gridColumns: e.gridColumns,
|
|
176
179
|
gridRows: e.gridRows
|
|
177
180
|
}
|
|
178
|
-
} }),
|
|
181
|
+
} }), b({ type: "none" }), I("Deck updated", "success");
|
|
179
182
|
} catch (e) {
|
|
180
|
-
|
|
183
|
+
I(e instanceof Error ? e.message : "Failed to update deck", "error");
|
|
181
184
|
}
|
|
182
185
|
}, [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
]),
|
|
187
|
-
if (
|
|
188
|
-
|
|
186
|
+
It,
|
|
187
|
+
y,
|
|
188
|
+
I
|
|
189
|
+
]), Jt = s(async () => {
|
|
190
|
+
if (y.type === "confirmDelete") try {
|
|
191
|
+
y.target === "deck" ? (await W({ variables: { id: y.id } }), g === y.id && _(null), I("Deck deleted", "success")) : (await q({ variables: { id: y.id } }), I("Button deleted", "success")), b({ type: "none" }), ye() && be("success");
|
|
189
192
|
} catch (e) {
|
|
190
|
-
|
|
193
|
+
I(e instanceof Error ? e.message : "Failed to delete", "error"), ye() && be("error");
|
|
191
194
|
}
|
|
192
195
|
}, [
|
|
193
|
-
|
|
196
|
+
y,
|
|
194
197
|
W,
|
|
195
198
|
q,
|
|
199
|
+
g,
|
|
196
200
|
_,
|
|
197
|
-
|
|
198
|
-
F
|
|
201
|
+
I
|
|
199
202
|
]), Z = s(async (e) => {
|
|
200
203
|
let t = V?.buttons?.find((t) => t.id === e);
|
|
201
204
|
if (!t || !t.action) return;
|
|
202
|
-
let r = t.action, i =
|
|
205
|
+
let r = t.action, i = vt({
|
|
203
206
|
buttonId: e,
|
|
204
207
|
buttonLabel: t.label,
|
|
205
208
|
actionType: r.actionType,
|
|
@@ -207,12 +210,12 @@ function We() {
|
|
|
207
210
|
status: "running",
|
|
208
211
|
startedAt: /* @__PURE__ */ new Date()
|
|
209
212
|
});
|
|
210
|
-
|
|
213
|
+
ot(e), F(e, "executing");
|
|
211
214
|
try {
|
|
212
215
|
let t = (await J({ variables: { id: e } })).data?.executeVibeDeckButton;
|
|
213
216
|
if (t) {
|
|
214
217
|
let n = t.status === "success";
|
|
215
|
-
|
|
218
|
+
F(e, n ? "success" : "error"), P(i, {
|
|
216
219
|
status: n ? "success" : "error",
|
|
217
220
|
output: t.output,
|
|
218
221
|
exitCode: t.exitCode,
|
|
@@ -222,35 +225,35 @@ function We() {
|
|
|
222
225
|
}
|
|
223
226
|
} catch (t) {
|
|
224
227
|
if (n(t)) {
|
|
225
|
-
|
|
228
|
+
F(e, "error"), P(i, {
|
|
226
229
|
status: "error",
|
|
227
230
|
error: "Usage quota exhausted",
|
|
228
231
|
completedAt: /* @__PURE__ */ new Date()
|
|
229
|
-
}),
|
|
232
|
+
}), L("Execution Quota Reached", "You have used the execution quota for your current plan. Upgrade to continue running Vibe Deck actions.");
|
|
230
233
|
return;
|
|
231
234
|
}
|
|
232
235
|
let r = t instanceof Error ? t.message : "Execution failed";
|
|
233
|
-
|
|
236
|
+
F(e, "error"), P(i, {
|
|
234
237
|
status: "error",
|
|
235
238
|
error: r,
|
|
236
239
|
completedAt: /* @__PURE__ */ new Date()
|
|
237
240
|
});
|
|
238
241
|
} finally {
|
|
239
|
-
|
|
242
|
+
ot(null);
|
|
240
243
|
}
|
|
241
244
|
}, [
|
|
242
245
|
V,
|
|
243
246
|
J,
|
|
244
|
-
|
|
245
|
-
N,
|
|
247
|
+
vt,
|
|
246
248
|
P,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
F,
|
|
250
|
+
L
|
|
251
|
+
]), Yt = s(async (e) => {
|
|
249
252
|
let t = V?.buttons?.find((t) => t.id === e);
|
|
250
253
|
if (t) {
|
|
251
254
|
if (t.confirmationRequired) {
|
|
252
255
|
let n = t.action, r = n?.actionType === "WEBHOOK" ? `POST ${n.webhookUrl || ""}` : n?.command || "";
|
|
253
|
-
|
|
256
|
+
b({
|
|
254
257
|
type: "confirmExecute",
|
|
255
258
|
buttonId: e,
|
|
256
259
|
label: t.label,
|
|
@@ -260,37 +263,37 @@ function We() {
|
|
|
260
263
|
}
|
|
261
264
|
await Z(e);
|
|
262
265
|
}
|
|
263
|
-
}, [V, Z]),
|
|
264
|
-
if (
|
|
265
|
-
let e =
|
|
266
|
-
|
|
267
|
-
}, [
|
|
268
|
-
if (!(
|
|
269
|
-
await
|
|
270
|
-
vibeDeckId:
|
|
266
|
+
}, [V, Z]), Xt = s(async () => {
|
|
267
|
+
if (y.type !== "confirmExecute") return;
|
|
268
|
+
let e = y.buttonId;
|
|
269
|
+
b({ type: "none" }), await Z(e);
|
|
270
|
+
}, [y, Z]), Zt = s(async (e) => {
|
|
271
|
+
if (!(y.type !== "createButton" || !B)) try {
|
|
272
|
+
await Rt({ variables: { input: {
|
|
273
|
+
vibeDeckId: B,
|
|
271
274
|
label: e.label,
|
|
272
275
|
actionId: e.actionId,
|
|
273
|
-
row:
|
|
274
|
-
column:
|
|
276
|
+
row: y.row,
|
|
277
|
+
column: y.column,
|
|
275
278
|
rowSpan: e.rowSpan,
|
|
276
279
|
colSpan: e.colSpan,
|
|
277
280
|
color: e.color || null,
|
|
278
281
|
category: e.category || null,
|
|
279
282
|
keyboardShortcut: e.keyboardShortcut || null,
|
|
280
283
|
confirmationRequired: e.confirmationRequired
|
|
281
|
-
} } }),
|
|
284
|
+
} } }), b({ type: "none" }), I("Button created", "success");
|
|
282
285
|
} catch (e) {
|
|
283
|
-
|
|
286
|
+
I(e instanceof Error ? e.message : "Failed to create button", "error");
|
|
284
287
|
}
|
|
285
288
|
}, [
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
]),
|
|
291
|
-
if (
|
|
292
|
-
await
|
|
293
|
-
id:
|
|
289
|
+
y,
|
|
290
|
+
Rt,
|
|
291
|
+
B,
|
|
292
|
+
I
|
|
293
|
+
]), Qt = s(async (e) => {
|
|
294
|
+
if (y.type === "editButton") try {
|
|
295
|
+
await Bt({ variables: {
|
|
296
|
+
id: y.buttonId,
|
|
294
297
|
input: {
|
|
295
298
|
label: e.label,
|
|
296
299
|
actionId: e.actionId,
|
|
@@ -301,17 +304,17 @@ function We() {
|
|
|
301
304
|
rowSpan: e.rowSpan,
|
|
302
305
|
colSpan: e.colSpan
|
|
303
306
|
}
|
|
304
|
-
} }),
|
|
307
|
+
} }), b({ type: "none" }), I("Button updated", "success");
|
|
305
308
|
} catch (e) {
|
|
306
|
-
|
|
309
|
+
I(e instanceof Error ? e.message : "Failed to update button", "error");
|
|
307
310
|
}
|
|
308
311
|
}, [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
]),
|
|
312
|
+
y,
|
|
313
|
+
Bt,
|
|
314
|
+
I
|
|
315
|
+
]), $t = s(async (e, t, n) => {
|
|
313
316
|
try {
|
|
314
|
-
await
|
|
317
|
+
await Ht({ variables: {
|
|
315
318
|
id: e,
|
|
316
319
|
input: {
|
|
317
320
|
row: t,
|
|
@@ -319,154 +322,154 @@ function We() {
|
|
|
319
322
|
}
|
|
320
323
|
} });
|
|
321
324
|
} catch (e) {
|
|
322
|
-
|
|
325
|
+
I(e instanceof Error ? e.message : "Failed to move button", "error");
|
|
323
326
|
}
|
|
324
|
-
}, [
|
|
325
|
-
let t =
|
|
327
|
+
}, [Ht, I]), en = s(async (e) => {
|
|
328
|
+
let t = z.find((t) => t.id === e);
|
|
326
329
|
if (t) try {
|
|
327
330
|
await K({ variables: {
|
|
328
331
|
id: e,
|
|
329
332
|
name: `${t.name} (Copy)`
|
|
330
|
-
} }),
|
|
333
|
+
} }), I("Deck duplicated", "success");
|
|
331
334
|
} catch (e) {
|
|
332
335
|
if (n(e)) {
|
|
333
|
-
|
|
336
|
+
L("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
|
|
334
337
|
return;
|
|
335
338
|
}
|
|
336
|
-
|
|
339
|
+
I(e instanceof Error ? e.message : "Failed to duplicate deck", "error");
|
|
337
340
|
}
|
|
338
341
|
}, [
|
|
339
|
-
|
|
342
|
+
z,
|
|
340
343
|
K,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
]),
|
|
344
|
+
L,
|
|
345
|
+
I
|
|
346
|
+
]), tn = s(async (e) => {
|
|
344
347
|
try {
|
|
345
|
-
await G({ variables: { id: e } }),
|
|
348
|
+
await G({ variables: { id: e } }), I("Default deck set", "success");
|
|
346
349
|
} catch (e) {
|
|
347
|
-
|
|
350
|
+
I(e instanceof Error ? e.message : "Failed to set default", "error");
|
|
348
351
|
}
|
|
349
|
-
}, [G,
|
|
352
|
+
}, [G, I]), nn = s(async () => {
|
|
350
353
|
if (H.length === 1) {
|
|
351
|
-
|
|
354
|
+
E("setDefaultDeck");
|
|
352
355
|
try {
|
|
353
|
-
await G({ variables: { id: H[0].id } }),
|
|
356
|
+
await G({ variables: { id: H[0].id } }), I("Default deck set", "success"), Y(), await R();
|
|
354
357
|
} catch (e) {
|
|
355
|
-
|
|
358
|
+
I(e instanceof Error ? e.message : "Failed to set default deck", "error");
|
|
356
359
|
} finally {
|
|
357
|
-
|
|
360
|
+
E(null);
|
|
358
361
|
}
|
|
359
362
|
}
|
|
360
363
|
}, [
|
|
361
364
|
H,
|
|
362
365
|
G,
|
|
363
|
-
|
|
366
|
+
I,
|
|
364
367
|
Y,
|
|
365
|
-
|
|
366
|
-
]),
|
|
368
|
+
R
|
|
369
|
+
]), rn = s(async () => {
|
|
367
370
|
if (H.length !== 0) {
|
|
368
|
-
|
|
371
|
+
E("duplicateDeck");
|
|
369
372
|
try {
|
|
370
373
|
let e = await Promise.allSettled(H.map((e) => K({ variables: {
|
|
371
374
|
id: e.id,
|
|
372
375
|
name: `${e.name} (Copy)`
|
|
373
376
|
} })));
|
|
374
377
|
if (e.some((e) => e.status === "rejected" && n(e.reason))) {
|
|
375
|
-
|
|
378
|
+
L("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
|
|
376
379
|
return;
|
|
377
380
|
}
|
|
378
381
|
let t = e.filter((e) => e.status === "fulfilled").length, r = e.length - t;
|
|
379
|
-
|
|
382
|
+
I(`Duplicated ${t} deck${t === 1 ? "" : "s"}${r > 0 ? ` • ${r} failed` : ""}`, r > 0 ? "error" : "success"), Y(), await R();
|
|
380
383
|
} catch (e) {
|
|
381
384
|
if (n(e)) {
|
|
382
|
-
|
|
385
|
+
L("Vibe Deck Quota Reached", "You have reached the Vibe Deck limit for your current plan. Upgrade to duplicate more decks.");
|
|
383
386
|
return;
|
|
384
387
|
}
|
|
385
|
-
|
|
388
|
+
I(e instanceof Error ? e.message : "Failed to duplicate decks", "error");
|
|
386
389
|
} finally {
|
|
387
|
-
|
|
390
|
+
E(null);
|
|
388
391
|
}
|
|
389
392
|
}
|
|
390
393
|
}, [
|
|
391
394
|
H,
|
|
392
395
|
K,
|
|
396
|
+
L,
|
|
393
397
|
I,
|
|
394
|
-
F,
|
|
395
398
|
Y,
|
|
396
|
-
|
|
397
|
-
]),
|
|
399
|
+
R
|
|
400
|
+
]), an = s(async () => {
|
|
398
401
|
if (H.length !== 0) {
|
|
399
|
-
|
|
402
|
+
E("deleteDeck");
|
|
400
403
|
try {
|
|
401
404
|
let e = await Promise.allSettled(H.map((e) => W({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
|
|
402
|
-
H.some((e) => e.id ===
|
|
405
|
+
H.some((e) => e.id === g) && _(null), I(`Deleted ${t} deck${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`, n > 0 ? "error" : "success"), Y(), lt(null), await R();
|
|
403
406
|
} catch (e) {
|
|
404
|
-
|
|
407
|
+
I(e instanceof Error ? e.message : "Failed to delete decks", "error");
|
|
405
408
|
} finally {
|
|
406
|
-
|
|
409
|
+
E(null);
|
|
407
410
|
}
|
|
408
411
|
}
|
|
409
412
|
}, [
|
|
410
413
|
H,
|
|
411
414
|
W,
|
|
415
|
+
g,
|
|
412
416
|
_,
|
|
413
|
-
|
|
414
|
-
F,
|
|
417
|
+
I,
|
|
415
418
|
Y,
|
|
416
|
-
|
|
417
|
-
]),
|
|
419
|
+
R
|
|
420
|
+
]), on = s(async () => {
|
|
418
421
|
if (U.length === 0) return;
|
|
419
|
-
|
|
422
|
+
E("executeButton");
|
|
420
423
|
let e = 0, t = 0;
|
|
421
424
|
try {
|
|
422
425
|
for (let r of U) try {
|
|
423
426
|
(await J({ variables: { id: r.id } })).data?.executeVibeDeckButton?.status === "success" ? e += 1 : t += 1;
|
|
424
427
|
} catch (e) {
|
|
425
428
|
if (n(e)) {
|
|
426
|
-
|
|
429
|
+
w(null), L("Execution Quota Reached", "You have used the execution quota for your current plan. Upgrade to continue running Vibe Deck actions.");
|
|
427
430
|
return;
|
|
428
431
|
}
|
|
429
432
|
t += 1;
|
|
430
433
|
}
|
|
431
|
-
|
|
434
|
+
I(`Executed ${e} button${e === 1 ? "" : "s"}${t > 0 ? ` • ${t} failed` : ""}`, t > 0 ? "error" : "success"), X(), w(null);
|
|
432
435
|
} catch (e) {
|
|
433
|
-
|
|
436
|
+
I(e instanceof Error ? e.message : "Failed to execute buttons", "error");
|
|
434
437
|
} finally {
|
|
435
|
-
|
|
438
|
+
E(null);
|
|
436
439
|
}
|
|
437
440
|
}, [
|
|
438
441
|
U,
|
|
439
442
|
J,
|
|
443
|
+
L,
|
|
440
444
|
I,
|
|
441
|
-
F,
|
|
442
445
|
X
|
|
443
|
-
]),
|
|
446
|
+
]), sn = s(async () => {
|
|
444
447
|
if (U.length !== 0) {
|
|
445
|
-
|
|
448
|
+
E("deleteButton");
|
|
446
449
|
try {
|
|
447
450
|
let e = await Promise.allSettled(U.map((e) => q({ variables: { id: e.id } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.length - t;
|
|
448
|
-
|
|
451
|
+
I(`Deleted ${t} button${t === 1 ? "" : "s"}${n > 0 ? ` • ${n} failed` : ""}`, n > 0 ? "error" : "success"), X(), w(null), await Tt();
|
|
449
452
|
} catch (e) {
|
|
450
|
-
|
|
453
|
+
I(e instanceof Error ? e.message : "Failed to delete buttons", "error");
|
|
451
454
|
} finally {
|
|
452
|
-
|
|
455
|
+
E(null);
|
|
453
456
|
}
|
|
454
457
|
}
|
|
455
458
|
}, [
|
|
456
459
|
U,
|
|
457
460
|
q,
|
|
458
|
-
|
|
461
|
+
I,
|
|
459
462
|
X,
|
|
460
|
-
|
|
463
|
+
Tt
|
|
461
464
|
]);
|
|
462
|
-
if (
|
|
463
|
-
if (p && (p.permissionStrings?.length ?? 0) > 0 && !
|
|
464
|
-
if (
|
|
465
|
-
if (
|
|
466
|
-
message:
|
|
467
|
-
onRetry: () =>
|
|
465
|
+
if (qe) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(he, { message: "Loading permissions..." }) });
|
|
466
|
+
if (p && (p.permissionStrings?.length ?? 0) > 0 && !Je) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(Ge, {}) });
|
|
467
|
+
if (xt) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(he, { message: "Loading Vibe Decks..." }) });
|
|
468
|
+
if (St) return /* @__PURE__ */ l(d, { children: /* @__PURE__ */ l(ge, {
|
|
469
|
+
message: St.message,
|
|
470
|
+
onRetry: () => R()
|
|
468
471
|
}) });
|
|
469
|
-
let Q =
|
|
472
|
+
let Q = y.type === "editButton" ? V?.buttons?.find((e) => e.id === y.buttonId) : null, $ = y.type === "editDeck" ? z.find((e) => e.id === y.deckId) : null;
|
|
470
473
|
return /* @__PURE__ */ u(d, {
|
|
471
474
|
className: "p-4 sm:p-6 space-y-6",
|
|
472
475
|
children: [
|
|
@@ -480,42 +483,44 @@ function We() {
|
|
|
480
483
|
className: "flex items-center rounded-lg border border-border-default bg-bg-secondary p-0.5",
|
|
481
484
|
children: [/* @__PURE__ */ u("button", {
|
|
482
485
|
type: "button",
|
|
483
|
-
onClick: () =>
|
|
484
|
-
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${
|
|
485
|
-
title: "Preview mode — execute only",
|
|
486
|
-
|
|
486
|
+
onClick: () => tt("preview"),
|
|
487
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${v ? "bg-action-primary-bg text-action-primary-text shadow-sm" : "text-text-tertiary hover:text-text-primary"}`,
|
|
488
|
+
title: v ? "Preview mode — execute only" : "Switch to Preview mode",
|
|
489
|
+
"aria-pressed": v,
|
|
490
|
+
children: [/* @__PURE__ */ l(Ie, { size: 14 }), "Preview"]
|
|
487
491
|
}), /* @__PURE__ */ u("button", {
|
|
488
492
|
type: "button",
|
|
489
|
-
onClick: () =>
|
|
490
|
-
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${
|
|
491
|
-
title: "Edit mode — full editing",
|
|
492
|
-
|
|
493
|
+
onClick: () => tt("edit"),
|
|
494
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${v ? "text-text-tertiary hover:text-text-primary" : "bg-action-primary-bg text-action-primary-text shadow-sm"}`,
|
|
495
|
+
title: v ? "Switch to Edit mode" : "Edit mode — full editing",
|
|
496
|
+
"aria-pressed": !v,
|
|
497
|
+
children: [/* @__PURE__ */ l(Le, { size: 14 }), "Edit"]
|
|
493
498
|
})]
|
|
494
499
|
}),
|
|
495
|
-
|
|
500
|
+
B && V && /* @__PURE__ */ l("button", {
|
|
496
501
|
type: "button",
|
|
497
|
-
onClick: () =>
|
|
502
|
+
onClick: () => b({
|
|
498
503
|
type: "shareDeck",
|
|
499
|
-
deckId:
|
|
504
|
+
deckId: B,
|
|
500
505
|
deckName: V.name
|
|
501
506
|
}),
|
|
502
507
|
className: "p-2 rounded-lg hover:bg-bg-tertiary text-text-tertiary hover:text-text-primary transition-colors",
|
|
503
508
|
title: "Share deck",
|
|
504
|
-
children: /* @__PURE__ */ l(
|
|
509
|
+
children: /* @__PURE__ */ l(Be, { size: 16 })
|
|
505
510
|
}),
|
|
506
511
|
/* @__PURE__ */ l("button", {
|
|
507
512
|
type: "button",
|
|
508
513
|
onClick: () => {
|
|
509
|
-
|
|
514
|
+
R(), B && Tt();
|
|
510
515
|
},
|
|
511
516
|
className: "p-2 rounded-lg hover:bg-bg-tertiary text-text-tertiary hover:text-text-primary transition-colors",
|
|
512
517
|
title: "Refresh",
|
|
513
|
-
children: /* @__PURE__ */ l(
|
|
518
|
+
children: /* @__PURE__ */ l(ze, { size: 16 })
|
|
514
519
|
})
|
|
515
520
|
]
|
|
516
521
|
})
|
|
517
522
|
}),
|
|
518
|
-
!
|
|
523
|
+
!v && z.length > 0 && /* @__PURE__ */ l("div", {
|
|
519
524
|
className: "rounded-lg border border-border-default bg-bg-surface p-4",
|
|
520
525
|
children: /* @__PURE__ */ u("div", {
|
|
521
526
|
className: "flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",
|
|
@@ -523,16 +528,16 @@ function We() {
|
|
|
523
528
|
className: "flex flex-wrap items-center gap-3",
|
|
524
529
|
children: [/* @__PURE__ */ u("div", {
|
|
525
530
|
className: "flex items-center gap-2",
|
|
526
|
-
children: [/* @__PURE__ */ l(
|
|
527
|
-
checked:
|
|
528
|
-
indeterminate:
|
|
529
|
-
onChange:
|
|
531
|
+
children: [/* @__PURE__ */ l(we, {
|
|
532
|
+
checked: Et,
|
|
533
|
+
indeterminate: Dt,
|
|
534
|
+
onChange: Wt,
|
|
530
535
|
ariaLabel: "Select all vibe decks"
|
|
531
536
|
}), /* @__PURE__ */ l("span", {
|
|
532
537
|
className: "text-sm font-medium text-text-primary",
|
|
533
538
|
children: "Select all decks"
|
|
534
539
|
})]
|
|
535
|
-
}),
|
|
540
|
+
}), x.size > 0 && /* @__PURE__ */ l("button", {
|
|
536
541
|
type: "button",
|
|
537
542
|
onClick: Y,
|
|
538
543
|
className: "text-sm text-text-secondary hover:text-text-primary",
|
|
@@ -543,27 +548,27 @@ function We() {
|
|
|
543
548
|
children: [
|
|
544
549
|
/* @__PURE__ */ u("span", {
|
|
545
550
|
className: "rounded-full bg-bg-sunken px-3 py-1 text-sm font-medium text-text-secondary",
|
|
546
|
-
children: [
|
|
551
|
+
children: [x.size, " selected"]
|
|
547
552
|
}),
|
|
548
553
|
/* @__PURE__ */ l("button", {
|
|
549
554
|
type: "button",
|
|
550
|
-
onClick:
|
|
551
|
-
disabled: H.length !== 1 || H[0]?.isDefault ||
|
|
555
|
+
onClick: nn,
|
|
556
|
+
disabled: H.length !== 1 || H[0]?.isDefault || T !== null,
|
|
552
557
|
className: "rounded-md border border-status-warning-border px-3 py-2 text-sm font-medium text-status-warning-text hover:bg-status-warning-bg-subtle disabled:cursor-not-allowed disabled:opacity-50",
|
|
553
558
|
children: /* @__PURE__ */ u("span", {
|
|
554
559
|
className: "inline-flex items-center gap-2",
|
|
555
|
-
children: [/* @__PURE__ */ l(
|
|
560
|
+
children: [/* @__PURE__ */ l(Ve, { size: 14 }), "Set Selected Default"]
|
|
556
561
|
})
|
|
557
562
|
}),
|
|
558
563
|
/* @__PURE__ */ l("button", {
|
|
559
564
|
type: "button",
|
|
560
|
-
onClick:
|
|
561
|
-
disabled: H.length === 0 ||
|
|
565
|
+
onClick: rn,
|
|
566
|
+
disabled: H.length === 0 || T !== null,
|
|
562
567
|
className: "rounded-md border border-border-default px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50",
|
|
563
568
|
children: /* @__PURE__ */ u("span", {
|
|
564
569
|
className: "inline-flex items-center gap-2",
|
|
565
570
|
children: [
|
|
566
|
-
/* @__PURE__ */ l(
|
|
571
|
+
/* @__PURE__ */ l(Fe, { size: 14 }),
|
|
567
572
|
"Duplicate Selected",
|
|
568
573
|
H.length > 0 ? ` (${H.length})` : ""
|
|
569
574
|
]
|
|
@@ -571,13 +576,13 @@ function We() {
|
|
|
571
576
|
}),
|
|
572
577
|
/* @__PURE__ */ l("button", {
|
|
573
578
|
type: "button",
|
|
574
|
-
onClick: () =>
|
|
575
|
-
disabled: H.length === 0 ||
|
|
579
|
+
onClick: () => lt("delete"),
|
|
580
|
+
disabled: H.length === 0 || T !== null,
|
|
576
581
|
className: "rounded-md border border-status-error-border px-3 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg disabled:cursor-not-allowed disabled:opacity-50",
|
|
577
582
|
children: /* @__PURE__ */ u("span", {
|
|
578
583
|
className: "inline-flex items-center gap-2",
|
|
579
584
|
children: [
|
|
580
|
-
/* @__PURE__ */ l(
|
|
585
|
+
/* @__PURE__ */ l(He, { size: 14 }),
|
|
581
586
|
"Delete Selected",
|
|
582
587
|
H.length > 0 ? ` (${H.length})` : ""
|
|
583
588
|
]
|
|
@@ -587,64 +592,64 @@ function We() {
|
|
|
587
592
|
})]
|
|
588
593
|
})
|
|
589
594
|
}),
|
|
590
|
-
/* @__PURE__ */ l(
|
|
591
|
-
decks:
|
|
595
|
+
/* @__PURE__ */ l(Ee, {
|
|
596
|
+
decks: z.map((e) => ({
|
|
592
597
|
id: e.id,
|
|
593
598
|
name: e.name,
|
|
594
599
|
icon: e.icon || null,
|
|
595
600
|
colorTheme: e.colorTheme || null,
|
|
596
601
|
isDefault: e.isDefault
|
|
597
602
|
})),
|
|
598
|
-
activeDeckId:
|
|
599
|
-
selectedDeckIds:
|
|
600
|
-
onSelectDeck: (e) =>
|
|
601
|
-
onToggleSelectDeck:
|
|
602
|
-
onCreateDeck: () =>
|
|
603
|
-
onSetDefault:
|
|
604
|
-
onDuplicate: (e) =>
|
|
603
|
+
activeDeckId: B,
|
|
604
|
+
selectedDeckIds: x,
|
|
605
|
+
onSelectDeck: (e) => _(e),
|
|
606
|
+
onToggleSelectDeck: Ut,
|
|
607
|
+
onCreateDeck: () => b({ type: "createDeck" }),
|
|
608
|
+
onSetDefault: tn,
|
|
609
|
+
onDuplicate: (e) => en(e),
|
|
605
610
|
onDelete: (e) => {
|
|
606
|
-
|
|
611
|
+
b({
|
|
607
612
|
type: "confirmDelete",
|
|
608
613
|
target: "deck",
|
|
609
614
|
id: e,
|
|
610
|
-
name:
|
|
615
|
+
name: z.find((t) => t.id === e)?.name || "this deck"
|
|
611
616
|
});
|
|
612
617
|
},
|
|
613
|
-
onEdit: (e) =>
|
|
618
|
+
onEdit: (e) => b({
|
|
614
619
|
type: "editDeck",
|
|
615
620
|
deckId: e
|
|
616
621
|
}),
|
|
617
622
|
onShare: (e) => {
|
|
618
|
-
let t =
|
|
619
|
-
t &&
|
|
623
|
+
let t = z.find((t) => t.id === e);
|
|
624
|
+
t && b({
|
|
620
625
|
type: "shareDeck",
|
|
621
626
|
deckId: e,
|
|
622
627
|
deckName: t.name
|
|
623
628
|
});
|
|
624
629
|
},
|
|
625
|
-
canCreate:
|
|
626
|
-
canUpdate:
|
|
627
|
-
canDelete:
|
|
630
|
+
canCreate: Ye,
|
|
631
|
+
canUpdate: rt,
|
|
632
|
+
canDelete: it
|
|
628
633
|
}),
|
|
629
|
-
/* @__PURE__ */ u(
|
|
634
|
+
/* @__PURE__ */ u(We, {
|
|
630
635
|
mode: "wait",
|
|
631
|
-
children: [!V && !
|
|
636
|
+
children: [!V && !wt && z.length === 0 && /* @__PURE__ */ l(xe, {
|
|
632
637
|
title: "No Vibe Decks yet",
|
|
633
638
|
description: "Create your first Vibe Deck to start organizing your commands and webhooks",
|
|
634
639
|
action: /* @__PURE__ */ u("div", {
|
|
635
640
|
className: "flex items-center gap-2",
|
|
636
|
-
children: [
|
|
641
|
+
children: [Ye && /* @__PURE__ */ l("button", {
|
|
637
642
|
type: "button",
|
|
638
|
-
onClick: () =>
|
|
643
|
+
onClick: () => b({ type: "createDeck" }),
|
|
639
644
|
className: "px-4 py-2 rounded-lg bg-action-primary-bg text-action-primary-text hover:opacity-90 text-sm font-medium",
|
|
640
645
|
children: "Create Vibe Deck"
|
|
641
|
-
}), /* @__PURE__ */ l(
|
|
646
|
+
}), /* @__PURE__ */ l(Ce, { prompt: "What is a VibeDeck and how do I use it to organise controls?" })]
|
|
642
647
|
})
|
|
643
|
-
}),
|
|
648
|
+
}), wt && /* @__PURE__ */ l(he, { message: "Loading deck..." })]
|
|
644
649
|
}),
|
|
645
650
|
V && /* @__PURE__ */ u("div", {
|
|
646
651
|
className: "space-y-4",
|
|
647
|
-
children: [!
|
|
652
|
+
children: [!v && (V.buttons?.length ?? 0) > 0 && /* @__PURE__ */ l("div", {
|
|
648
653
|
className: "rounded-lg border border-border-default bg-bg-surface p-4",
|
|
649
654
|
children: /* @__PURE__ */ u("div", {
|
|
650
655
|
className: "flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",
|
|
@@ -652,16 +657,16 @@ function We() {
|
|
|
652
657
|
className: "flex flex-wrap items-center gap-3",
|
|
653
658
|
children: [/* @__PURE__ */ u("div", {
|
|
654
659
|
className: "flex items-center gap-2",
|
|
655
|
-
children: [/* @__PURE__ */ l(
|
|
656
|
-
checked:
|
|
657
|
-
indeterminate:
|
|
658
|
-
onChange:
|
|
660
|
+
children: [/* @__PURE__ */ l(we, {
|
|
661
|
+
checked: Ot,
|
|
662
|
+
indeterminate: kt,
|
|
663
|
+
onChange: Gt,
|
|
659
664
|
ariaLabel: "Select all buttons in active deck"
|
|
660
665
|
}), /* @__PURE__ */ l("span", {
|
|
661
666
|
className: "text-sm font-medium text-text-primary",
|
|
662
667
|
children: "Select all buttons in this deck"
|
|
663
668
|
})]
|
|
664
|
-
}),
|
|
669
|
+
}), S.size > 0 && /* @__PURE__ */ l("button", {
|
|
665
670
|
type: "button",
|
|
666
671
|
onClick: X,
|
|
667
672
|
className: "text-sm text-text-secondary hover:text-text-primary",
|
|
@@ -672,17 +677,17 @@ function We() {
|
|
|
672
677
|
children: [
|
|
673
678
|
/* @__PURE__ */ u("span", {
|
|
674
679
|
className: "rounded-full bg-bg-sunken px-3 py-1 text-sm font-medium text-text-secondary",
|
|
675
|
-
children: [
|
|
680
|
+
children: [S.size, " selected"]
|
|
676
681
|
}),
|
|
677
682
|
/* @__PURE__ */ l("button", {
|
|
678
683
|
type: "button",
|
|
679
|
-
onClick: () =>
|
|
680
|
-
disabled: U.length === 0 ||
|
|
684
|
+
onClick: () => w("execute"),
|
|
685
|
+
disabled: U.length === 0 || T !== null,
|
|
681
686
|
className: "rounded-md border border-status-success-border px-3 py-2 text-sm font-medium text-status-success-text hover:bg-status-success-bg disabled:cursor-not-allowed disabled:opacity-50",
|
|
682
687
|
children: /* @__PURE__ */ u("span", {
|
|
683
688
|
className: "inline-flex items-center gap-2",
|
|
684
689
|
children: [
|
|
685
|
-
/* @__PURE__ */ l(
|
|
690
|
+
/* @__PURE__ */ l(Re, { size: 14 }),
|
|
686
691
|
"Execute Selected",
|
|
687
692
|
U.length > 0 ? ` (${U.length})` : ""
|
|
688
693
|
]
|
|
@@ -690,13 +695,13 @@ function We() {
|
|
|
690
695
|
}),
|
|
691
696
|
/* @__PURE__ */ l("button", {
|
|
692
697
|
type: "button",
|
|
693
|
-
onClick: () =>
|
|
694
|
-
disabled: U.length === 0 ||
|
|
698
|
+
onClick: () => w("delete"),
|
|
699
|
+
disabled: U.length === 0 || T !== null,
|
|
695
700
|
className: "rounded-md border border-status-error-border px-3 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg disabled:cursor-not-allowed disabled:opacity-50",
|
|
696
701
|
children: /* @__PURE__ */ u("span", {
|
|
697
702
|
className: "inline-flex items-center gap-2",
|
|
698
703
|
children: [
|
|
699
|
-
/* @__PURE__ */ l(
|
|
704
|
+
/* @__PURE__ */ l(He, { size: 14 }),
|
|
700
705
|
"Delete Selected",
|
|
701
706
|
U.length > 0 ? ` (${U.length})` : ""
|
|
702
707
|
]
|
|
@@ -705,76 +710,100 @@ function We() {
|
|
|
705
710
|
]
|
|
706
711
|
})]
|
|
707
712
|
})
|
|
708
|
-
}), /* @__PURE__ */
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
713
|
+
}), /* @__PURE__ */ u("div", {
|
|
714
|
+
className: "relative",
|
|
715
|
+
children: [/* @__PURE__ */ l(Te, {
|
|
716
|
+
gridColumns: V.gridColumns,
|
|
717
|
+
gridRows: V.gridRows,
|
|
718
|
+
buttons: (V.buttons || []).map((e) => ({
|
|
719
|
+
id: e.id,
|
|
720
|
+
label: e.label,
|
|
721
|
+
icon: e.icon || null,
|
|
722
|
+
color: e.color || null,
|
|
723
|
+
category: e.category || null,
|
|
724
|
+
confirmationRequired: e.confirmationRequired,
|
|
725
|
+
keyboardShortcut: e.keyboardShortcut || null,
|
|
726
|
+
actionId: e.actionId || null,
|
|
727
|
+
action: e.action ? {
|
|
728
|
+
id: e.action.id,
|
|
729
|
+
name: e.action.name,
|
|
730
|
+
displayName: e.action.displayName || null,
|
|
731
|
+
actionType: e.action.actionType,
|
|
732
|
+
command: e.action.command || null,
|
|
733
|
+
script: e.action.script || null,
|
|
734
|
+
webhookUrl: e.action.webhookUrl || null,
|
|
735
|
+
targetAgentId: e.action.targetAgentId || null
|
|
736
|
+
} : null,
|
|
737
|
+
row: e.row,
|
|
738
|
+
column: e.column,
|
|
739
|
+
rowSpan: e.rowSpan,
|
|
740
|
+
colSpan: e.colSpan
|
|
741
|
+
})),
|
|
742
|
+
onExecuteButton: Yt,
|
|
743
|
+
onEditButton: (e) => b({
|
|
744
|
+
type: "editButton",
|
|
745
|
+
buttonId: e
|
|
746
|
+
}),
|
|
747
|
+
onDeleteButton: (e) => {
|
|
748
|
+
let t = V.buttons?.find((t) => t.id === e);
|
|
749
|
+
b({
|
|
750
|
+
type: "confirmDelete",
|
|
751
|
+
target: "button",
|
|
752
|
+
id: e,
|
|
753
|
+
name: t?.label || "this button"
|
|
754
|
+
});
|
|
755
|
+
},
|
|
756
|
+
onDropButton: $t,
|
|
757
|
+
onAddButton: (e, t) => b({
|
|
758
|
+
type: "createButton",
|
|
759
|
+
row: e,
|
|
760
|
+
column: t
|
|
761
|
+
}),
|
|
762
|
+
executingButtonId: at,
|
|
763
|
+
canCreate: nt,
|
|
764
|
+
canUpdate: rt,
|
|
765
|
+
canDelete: it,
|
|
766
|
+
canExecute: Qe
|
|
767
|
+
}), (V.buttons?.length ?? 0) === 0 && v && /* @__PURE__ */ l("div", {
|
|
768
|
+
className: "absolute inset-0 flex items-center justify-center pointer-events-none",
|
|
769
|
+
children: /* @__PURE__ */ u("div", {
|
|
770
|
+
className: "bg-bg-elevated/90 backdrop-blur-md border border-border-default rounded-lg p-6 max-w-md pointer-events-auto shadow-xl text-center",
|
|
771
|
+
children: [
|
|
772
|
+
/* @__PURE__ */ l("h3", {
|
|
773
|
+
className: "text-lg font-semibold text-text-primary",
|
|
774
|
+
children: m("vibeDeck.emptyDeckTitle", "This deck is empty")
|
|
775
|
+
}),
|
|
776
|
+
/* @__PURE__ */ l("p", {
|
|
777
|
+
className: "text-sm text-text-secondary mt-2",
|
|
778
|
+
children: m("vibeDeck.emptyDeckDescription", "Switch to Edit mode to add buttons.")
|
|
779
|
+
}),
|
|
780
|
+
Xe && /* @__PURE__ */ l("button", {
|
|
781
|
+
type: "button",
|
|
782
|
+
onClick: () => tt("edit"),
|
|
783
|
+
className: "mt-4 inline-flex items-center gap-2 px-4 py-2 rounded-md bg-action-primary-bg text-action-primary-text text-sm font-medium hover:opacity-90 transition-opacity",
|
|
784
|
+
children: m("vibeDeck.editDeck", "Edit deck")
|
|
785
|
+
})
|
|
786
|
+
]
|
|
787
|
+
})
|
|
788
|
+
})]
|
|
760
789
|
})]
|
|
761
790
|
}),
|
|
762
|
-
|
|
763
|
-
entries:
|
|
764
|
-
expanded:
|
|
765
|
-
onToggleExpanded: () =>
|
|
766
|
-
onClear: () =>
|
|
791
|
+
ft.length > 0 && /* @__PURE__ */ l(Ae, {
|
|
792
|
+
entries: ft,
|
|
793
|
+
expanded: pt,
|
|
794
|
+
onToggleExpanded: () => mt((e) => !e),
|
|
795
|
+
onClear: () => j([])
|
|
767
796
|
}),
|
|
768
|
-
/* @__PURE__ */ l(
|
|
797
|
+
/* @__PURE__ */ l(We, { children: dt.length > 0 && /* @__PURE__ */ l("div", {
|
|
769
798
|
className: "fixed bottom-4 left-4 right-4 sm:left-auto sm:bottom-6 sm:right-6 z-50 flex flex-col gap-2 max-w-[calc(100vw-2rem)] sm:max-w-md",
|
|
770
|
-
children:
|
|
799
|
+
children: dt.slice(-3).map((e) => /* @__PURE__ */ u("div", {
|
|
771
800
|
role: "button",
|
|
772
801
|
tabIndex: 0,
|
|
773
802
|
onKeyDown: (t) => {
|
|
774
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(),
|
|
803
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), yt(e.id));
|
|
775
804
|
},
|
|
776
805
|
className: `p-4 rounded-xl shadow-lg border cursor-pointer ${e.variant === "success" ? "bg-status-success-bg/10 border-status-success-border/30 text-status-success-text" : "bg-status-error-bg/10 border-status-error-border/30 text-status-error-text"}`,
|
|
777
|
-
onClick: () =>
|
|
806
|
+
onClick: () => yt(e.id),
|
|
778
807
|
children: [/* @__PURE__ */ l("div", {
|
|
779
808
|
className: "font-medium text-sm",
|
|
780
809
|
children: e.message
|
|
@@ -784,20 +813,28 @@ function We() {
|
|
|
784
813
|
})]
|
|
785
814
|
}, e.id))
|
|
786
815
|
}) }),
|
|
787
|
-
|
|
816
|
+
y.type === "createDeck" && /* @__PURE__ */ l(De, {
|
|
788
817
|
title: "Create Vibe Deck",
|
|
789
|
-
onSubmit:
|
|
790
|
-
onCancel: () =>
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
818
|
+
onSubmit: Kt,
|
|
819
|
+
onCancel: () => {
|
|
820
|
+
b({ type: "none" }), A(a);
|
|
821
|
+
},
|
|
822
|
+
isLoading: Nt,
|
|
823
|
+
extraSection: /* @__PURE__ */ u("div", {
|
|
824
|
+
className: "space-y-4",
|
|
825
|
+
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
|
|
826
|
+
className: "text-sm font-medium text-text-secondary mb-2",
|
|
827
|
+
children: m("vibeDeck.tags", "Tags")
|
|
828
|
+
}), /* @__PURE__ */ l(_e, {
|
|
829
|
+
entityType: "VIBECONTROLS_VIBEDECK",
|
|
830
|
+
onDraftChange: Pt
|
|
831
|
+
})] }), /* @__PURE__ */ l(Se, {
|
|
832
|
+
value: k,
|
|
833
|
+
onChange: A
|
|
834
|
+
})]
|
|
835
|
+
})
|
|
799
836
|
}),
|
|
800
|
-
|
|
837
|
+
y.type === "editDeck" && $ && /* @__PURE__ */ l(De, {
|
|
801
838
|
title: "Edit Vibe Deck",
|
|
802
839
|
initialData: {
|
|
803
840
|
name: $.name,
|
|
@@ -806,29 +843,29 @@ function We() {
|
|
|
806
843
|
gridColumns: $.gridColumns,
|
|
807
844
|
gridRows: $.gridRows
|
|
808
845
|
},
|
|
809
|
-
onSubmit:
|
|
810
|
-
onCancel: () =>
|
|
811
|
-
isLoading:
|
|
846
|
+
onSubmit: qt,
|
|
847
|
+
onCancel: () => b({ type: "none" }),
|
|
848
|
+
isLoading: Lt,
|
|
812
849
|
extraSection: /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", {
|
|
813
850
|
className: "text-sm font-medium text-text-secondary mb-2",
|
|
814
851
|
children: m("vibeDeck.tags", "Tags")
|
|
815
|
-
}), /* @__PURE__ */ l(
|
|
852
|
+
}), /* @__PURE__ */ l(_e, {
|
|
816
853
|
entityType: "VIBECONTROLS_VIBEDECK",
|
|
817
854
|
entityId: $.id
|
|
818
855
|
})] })
|
|
819
856
|
}),
|
|
820
|
-
|
|
857
|
+
y.type === "createButton" && /* @__PURE__ */ l(Oe, {
|
|
821
858
|
title: "Add Button",
|
|
822
|
-
agents:
|
|
823
|
-
onSubmit:
|
|
824
|
-
onCancel: () =>
|
|
825
|
-
isLoading:
|
|
859
|
+
agents: jt,
|
|
860
|
+
onSubmit: Zt,
|
|
861
|
+
onCancel: () => b({ type: "none" }),
|
|
862
|
+
isLoading: zt,
|
|
826
863
|
gridColumns: V?.gridColumns,
|
|
827
864
|
gridRows: V?.gridRows,
|
|
828
|
-
buttonRow:
|
|
829
|
-
buttonColumn:
|
|
865
|
+
buttonRow: y.row,
|
|
866
|
+
buttonColumn: y.column
|
|
830
867
|
}),
|
|
831
|
-
|
|
868
|
+
y.type === "editButton" && Q && /* @__PURE__ */ l(Oe, {
|
|
832
869
|
title: "Edit Button",
|
|
833
870
|
initialData: {
|
|
834
871
|
label: Q.label,
|
|
@@ -840,81 +877,81 @@ function We() {
|
|
|
840
877
|
rowSpan: Q.rowSpan,
|
|
841
878
|
colSpan: Q.colSpan
|
|
842
879
|
},
|
|
843
|
-
agents:
|
|
844
|
-
onSubmit:
|
|
845
|
-
onCancel: () =>
|
|
846
|
-
isLoading:
|
|
880
|
+
agents: jt,
|
|
881
|
+
onSubmit: Qt,
|
|
882
|
+
onCancel: () => b({ type: "none" }),
|
|
883
|
+
isLoading: Vt,
|
|
847
884
|
gridColumns: V?.gridColumns,
|
|
848
885
|
gridRows: V?.gridRows,
|
|
849
886
|
buttonRow: Q.row,
|
|
850
887
|
buttonColumn: Q.column
|
|
851
888
|
}),
|
|
852
|
-
|
|
889
|
+
y.type === "confirmDelete" && /* @__PURE__ */ l(e, {
|
|
853
890
|
isOpen: !0,
|
|
854
|
-
title: `Delete ${
|
|
855
|
-
message: `Are you sure you want to delete "${
|
|
891
|
+
title: `Delete ${y.target === "deck" ? "Vibe Deck" : "Button"}`,
|
|
892
|
+
message: `Are you sure you want to delete "${y.name}"?${y.target === "deck" ? " All buttons in this deck will also be deleted." : ""}`,
|
|
856
893
|
confirmLabel: "Delete",
|
|
857
894
|
variant: "danger",
|
|
858
|
-
onConfirm:
|
|
859
|
-
onClose: () =>
|
|
895
|
+
onConfirm: Jt,
|
|
896
|
+
onClose: () => b({ type: "none" })
|
|
860
897
|
}),
|
|
861
|
-
|
|
898
|
+
y.type === "confirmExecute" && /* @__PURE__ */ l(e, {
|
|
862
899
|
isOpen: !0,
|
|
863
|
-
title: `Execute: ${
|
|
864
|
-
message: `Are you sure you want to execute this action?\n\n${
|
|
900
|
+
title: `Execute: ${y.label}`,
|
|
901
|
+
message: `Are you sure you want to execute this action?\n\n${y.detail}`,
|
|
865
902
|
confirmLabel: "Execute",
|
|
866
903
|
variant: "warning",
|
|
867
|
-
onConfirm:
|
|
868
|
-
onClose: () =>
|
|
904
|
+
onConfirm: Xt,
|
|
905
|
+
onClose: () => b({ type: "none" })
|
|
869
906
|
}),
|
|
870
907
|
/* @__PURE__ */ l(e, {
|
|
871
|
-
isOpen:
|
|
908
|
+
isOpen: ct === "delete",
|
|
872
909
|
title: "Delete Vibe Decks",
|
|
873
910
|
message: `Are you sure you want to delete ${H.length} selected deck${H.length === 1 ? "" : "s"}? All buttons in those decks will also be deleted.`,
|
|
874
911
|
confirmLabel: "Delete Decks",
|
|
875
912
|
variant: "danger",
|
|
876
|
-
onConfirm:
|
|
877
|
-
onClose: () =>
|
|
878
|
-
isLoading:
|
|
913
|
+
onConfirm: an,
|
|
914
|
+
onClose: () => lt(null),
|
|
915
|
+
isLoading: T === "deleteDeck"
|
|
879
916
|
}),
|
|
880
917
|
/* @__PURE__ */ l(e, {
|
|
881
|
-
isOpen:
|
|
918
|
+
isOpen: ut === "execute",
|
|
882
919
|
title: "Execute Vibe Deck Buttons",
|
|
883
920
|
message: `Execute ${U.length} selected button${U.length === 1 ? "" : "s"}? This may trigger commands, scripts, or webhooks immediately.`,
|
|
884
921
|
confirmLabel: "Execute Buttons",
|
|
885
922
|
variant: "warning",
|
|
886
|
-
onConfirm:
|
|
887
|
-
onClose: () =>
|
|
888
|
-
isLoading:
|
|
923
|
+
onConfirm: on,
|
|
924
|
+
onClose: () => w(null),
|
|
925
|
+
isLoading: T === "executeButton"
|
|
889
926
|
}),
|
|
890
927
|
/* @__PURE__ */ l(e, {
|
|
891
|
-
isOpen:
|
|
928
|
+
isOpen: ut === "delete",
|
|
892
929
|
title: "Delete Vibe Deck Buttons",
|
|
893
930
|
message: `Delete ${U.length} selected button${U.length === 1 ? "" : "s"}? This cannot be undone.`,
|
|
894
931
|
confirmLabel: "Delete Buttons",
|
|
895
932
|
variant: "danger",
|
|
896
|
-
onConfirm:
|
|
897
|
-
onClose: () =>
|
|
898
|
-
isLoading:
|
|
933
|
+
onConfirm: sn,
|
|
934
|
+
onClose: () => w(null),
|
|
935
|
+
isLoading: T === "deleteButton"
|
|
899
936
|
}),
|
|
900
|
-
|
|
901
|
-
vibeDeckId:
|
|
902
|
-
vibeDeckName:
|
|
903
|
-
onClose: () =>
|
|
937
|
+
y.type === "shareDeck" && /* @__PURE__ */ l(ke, {
|
|
938
|
+
vibeDeckId: y.deckId,
|
|
939
|
+
vibeDeckName: y.deckName,
|
|
940
|
+
onClose: () => b({ type: "none" })
|
|
904
941
|
}),
|
|
905
942
|
/* @__PURE__ */ l(t, {
|
|
906
|
-
isOpen:
|
|
907
|
-
onClose: () =>
|
|
943
|
+
isOpen: M !== null,
|
|
944
|
+
onClose: () => _t(null),
|
|
908
945
|
onConfirm: () => {
|
|
909
|
-
|
|
946
|
+
_t(null), Ke("/billing");
|
|
910
947
|
},
|
|
911
|
-
title:
|
|
912
|
-
message:
|
|
948
|
+
title: M?.title || "Quota Reached",
|
|
949
|
+
message: M?.message || "Upgrade your plan to continue."
|
|
913
950
|
})
|
|
914
951
|
]
|
|
915
952
|
});
|
|
916
953
|
}
|
|
917
954
|
//#endregion
|
|
918
|
-
export {
|
|
955
|
+
export { Ke as VibeDeckPage };
|
|
919
956
|
|
|
920
957
|
//# sourceMappingURL=VibeDeckPage.js.map
|