@loopstack/loopstack-studio 0.30.0 → 0.31.0

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.
@@ -6,80 +6,101 @@ import { Badge } from "../../components/ui/badge.js";
6
6
  import { Dialog, DialogContent } from "../../components/ui/dialog.js";
7
7
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../components/ui/tooltip.js";
8
8
  import ListView_default from "../../components/lists/ListView.js";
9
- import { useDebounce } from "../../hooks/useDebounce.js";
10
9
  import CreateWorkspace_default from "./components/CreateWorkspace.js";
10
+ import { useDebounce } from "../../hooks/useDebounce.js";
11
11
  import { c } from "react/compiler-runtime";
12
12
  import { useEffect, useMemo, useState } from "react";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
14
  import { useSearchParams } from "react-router-dom";
15
15
  import { Star } from "lucide-react";
16
16
  var Workspaces_default = () => {
17
- let n = c(67), { CreateWorkspace: ke, EditWorkspace: Ae } = useComponentOverrides(), je = ke ?? CreateWorkspace_default, Me = Ae ?? CreateWorkspace_default, { router: Ne } = useStudio(), [r] = useSearchParams(), [i, Pe] = useState(0), [a, Fe] = useState(10), [o, Ie] = useState("createdAt"), [s, Le] = useState("ASC"), [l, Re] = useState(), u;
17
+ let n = c(68), { CreateWorkspace: ke, EditWorkspace: Ae } = useComponentOverrides(), je = ke ?? CreateWorkspace_default, Me = Ae ?? CreateWorkspace_default, { router: Ne } = useStudio(), [r] = useSearchParams(), [i, Pe] = useState(0), [a, Fe] = useState(10), [o, Ie] = useState("createdAt"), [s, Le] = useState("ASC"), [l, Re] = useState(), u;
18
18
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (u = {}, n[0] = u) : u = n[0];
19
- let [d, ze] = useState(u), Be = useDebounce(l, 500), [f, p] = useState(!1), [m, Ve] = useState(void 0), h, g;
20
- n[1] === r ? (h = n[2], g = n[3]) : (h = () => {
21
- r.get("create") === "true" && p(!0);
22
- }, g = [r], n[1] = r, n[2] = h, n[3] = g), useEffect(h, g);
23
- let _ = useAppsConfig(), v;
24
- n[4] === _.data ? v = n[5] : (v = _.data ?? [], n[4] = _.data, n[5] = v);
25
- let y;
26
- n[6] === v ? y = n[7] : (y = v.map(_temp), n[6] = v, n[7] = y);
27
- let b = y, x = useFilterWorkspaces(Be, d, o, s, i, a), S = useDeleteWorkspace(), C = useBatchDeleteWorkspaces(), w = useSetFavouriteWorkspace(), T;
28
- n[8] === S ? T = n[9] : (T = (e) => {
29
- S.mutate(e);
30
- }, n[8] = S, n[9] = T);
31
- let E = T, D;
32
- n[10] === C ? D = n[11] : (D = (e) => {
19
+ let [d, f] = useState(u), ze = useDebounce(l, 500), [p, m] = useState(!1), [h, Be] = useState(void 0), g, _;
20
+ n[1] === r ? (g = n[2], _ = n[3]) : (g = () => {
21
+ r.get("create") === "true" && m(!0);
22
+ let e = r.get("appName");
23
+ e && f((t) => ({
24
+ ...t,
25
+ appName: e
26
+ }));
27
+ }, _ = [r], n[1] = r, n[2] = g, n[3] = _), useEffect(g, _);
28
+ let v = useAppsConfig(), y;
29
+ n[4] === v.data ? y = n[5] : (y = v.data ?? [], n[4] = v.data, n[5] = y);
30
+ let b;
31
+ n[6] === y ? b = n[7] : (b = y.map(_temp), n[6] = y, n[7] = b);
32
+ let x = b, S = useFilterWorkspaces(ze, d, o, s, i, a), C = useDeleteWorkspace(), w = useBatchDeleteWorkspaces(), T = useSetFavouriteWorkspace(), E;
33
+ n[8] === C ? E = n[9] : (E = (e) => {
33
34
  C.mutate(e);
34
- }, n[10] = C, n[11] = D);
35
- let O = D, k;
36
- n[12] === Symbol.for("react.memo_cache_sentinel") ? (k = () => {
37
- p(!0);
38
- }, n[12] = k) : k = n[12];
39
- let He = k, A;
40
- n[13] === Symbol.for("react.memo_cache_sentinel") ? (A = () => {
41
- p(!1);
42
- }, n[13] = A) : A = n[13];
43
- let Ue = A, j;
44
- n[14] === Ne ? j = n[15] : (j = (e) => {
35
+ }, n[8] = C, n[9] = E);
36
+ let D = E, O;
37
+ n[10] === w ? O = n[11] : (O = (e) => {
38
+ w.mutate(e);
39
+ }, n[10] = w, n[11] = O);
40
+ let k = O, A;
41
+ n[12] === Symbol.for("react.memo_cache_sentinel") ? (A = () => {
42
+ m(!0);
43
+ }, n[12] = A) : A = n[12];
44
+ let Ve = A, j;
45
+ n[13] === Symbol.for("react.memo_cache_sentinel") ? (j = () => {
46
+ m(!1);
47
+ }, n[13] = j) : j = n[13];
48
+ let He = j, M;
49
+ n[14] === Ne ? M = n[15] : (M = (e) => {
45
50
  Ne.navigateToWorkspace(e);
46
- }, n[14] = Ne, n[15] = j);
47
- let M = j, N;
48
- n[16] === Symbol.for("react.memo_cache_sentinel") ? (N = (e) => {
49
- Ve(e);
50
- }, n[16] = N) : N = n[16];
51
- let We = N, P;
52
- n[17] === Symbol.for("react.memo_cache_sentinel") ? (P = () => {
53
- p(!1), Ve(void 0);
54
- }, n[17] = P) : P = n[17];
55
- let Ge = P, F = _.isPending || x.isPending, I = x.error ?? _.error ?? null, L;
56
- n[18] === x.data?.data ? L = n[19] : (L = x.data?.data ?? [], n[18] = x.data?.data, n[19] = L);
57
- let Ke = x.data?.total ?? 0, R;
58
- n[20] === Symbol.for("react.memo_cache_sentinel") ? (R = {
51
+ }, n[14] = Ne, n[15] = M);
52
+ let N = M, P;
53
+ n[16] === Symbol.for("react.memo_cache_sentinel") ? (P = (e) => {
54
+ Be(e);
55
+ }, n[16] = P) : P = n[16];
56
+ let Ue = P, F;
57
+ n[17] === Symbol.for("react.memo_cache_sentinel") ? (F = () => {
58
+ m(!1), Be(void 0);
59
+ }, n[17] = F) : F = n[17];
60
+ let We = F, Ge = v.isPending || S.isPending, Ke = S.error ?? v.error ?? null, I;
61
+ n[18] === S.data?.data ? I = n[19] : (I = S.data?.data ?? [], n[18] = S.data?.data, n[19] = I);
62
+ let qe = S.data?.total ?? 0, L;
63
+ n[20] === Symbol.for("react.memo_cache_sentinel") ? (L = {
59
64
  id: "id",
60
65
  label: "ID",
61
66
  minWidth: 30,
62
67
  format: _temp2
63
- }, n[20] = R) : R = n[20];
68
+ }, n[20] = L) : L = n[20];
69
+ let R;
70
+ n[21] === Symbol.for("react.memo_cache_sentinel") ? (R = {
71
+ id: "title",
72
+ label: "Title",
73
+ minWidth: 100,
74
+ format: (e) => /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
75
+ asChild: !0,
76
+ children: /* @__PURE__ */ jsx(Badge, {
77
+ variant: "outline",
78
+ className: "hover:bg-primary/10 cursor-pointer",
79
+ onClick: () => f((t) => ({
80
+ ...t,
81
+ appName: e
82
+ })),
83
+ children: e.length > 25 ? e.slice(0, 25) + "..." : e
84
+ })
85
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: e }) })] }) })
86
+ }, n[21] = R) : R = n[21];
64
87
  let z;
65
- n[21] === Symbol.for("react.memo_cache_sentinel") ? (z = [
88
+ n[22] === Symbol.for("react.memo_cache_sentinel") ? (z = [
89
+ L,
66
90
  R,
67
91
  {
68
- id: "title",
69
- label: "Title",
92
+ id: "appName",
93
+ label: "App",
70
94
  minWidth: 100,
71
- format: (e) => /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
72
- asChild: !0,
73
- children: /* @__PURE__ */ jsx(Badge, {
74
- variant: "outline",
75
- className: "hover:bg-primary/10 cursor-pointer",
76
- onClick: () => ze((t) => ({
77
- ...t,
78
- appName: e
79
- })),
80
- children: e.length > 25 ? e.slice(0, 25) + "..." : e
81
- })
82
- }), /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: e }) })] }) })
95
+ format: (e) => /* @__PURE__ */ jsx(Badge, {
96
+ variant: "outline",
97
+ className: "hover:bg-primary/10 cursor-pointer",
98
+ onClick: () => f((t) => ({
99
+ ...t,
100
+ appName: e
101
+ })),
102
+ children: e
103
+ })
83
104
  },
84
105
  {
85
106
  id: "environments",
@@ -93,108 +114,108 @@ var Workspaces_default = () => {
93
114
  minWidth: 100,
94
115
  format: _temp5
95
116
  }
96
- ], n[21] = z) : z = n[21];
117
+ ], n[22] = z) : z = n[22];
97
118
  let B;
98
- n[22] === Symbol.for("react.memo_cache_sentinel") ? (B = {}, n[22] = B) : B = n[22];
119
+ n[23] === Symbol.for("react.memo_cache_sentinel") ? (B = {}, n[23] = B) : B = n[23];
99
120
  let V;
100
- n[23] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsx(Star, { className: "h-4 w-4" }), n[23] = V) : V = n[23];
121
+ n[24] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsx(Star, { className: "h-4 w-4" }), n[24] = V) : V = n[24];
101
122
  let H;
102
- n[24] === w ? H = n[25] : (H = {
123
+ n[25] === T ? H = n[26] : (H = {
103
124
  id: "add-favourite",
104
125
  label: "Add to favourites",
105
126
  icon: V,
106
127
  condition: _temp6,
107
128
  action: (e) => {
108
- w.mutate({
129
+ T.mutate({
109
130
  id: e.id,
110
131
  isFavourite: !0
111
132
  });
112
133
  }
113
- }, n[24] = w, n[25] = H);
134
+ }, n[25] = T, n[26] = H);
114
135
  let U;
115
- n[26] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsx(Star, { className: "h-4 w-4 fill-current" }), n[26] = U) : U = n[26];
136
+ n[27] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsx(Star, { className: "h-4 w-4 fill-current" }), n[27] = U) : U = n[27];
116
137
  let W;
117
- n[27] === w ? W = n[28] : (W = {
138
+ n[28] === T ? W = n[29] : (W = {
118
139
  id: "remove-favourite",
119
140
  label: "Remove from favourites",
120
141
  icon: U,
121
142
  condition: _temp7,
122
143
  action: (e) => {
123
- w.mutate({
144
+ T.mutate({
124
145
  id: e.id,
125
146
  isFavourite: !1
126
147
  });
127
148
  }
128
- }, n[27] = w, n[28] = W);
149
+ }, n[28] = T, n[29] = W);
129
150
  let G;
130
- n[29] !== H || n[30] !== W ? (G = [H, W], n[29] = H, n[30] = W, n[31] = G) : G = n[31];
131
- let qe = G, K;
132
- n[32] !== d || n[33] !== O || n[34] !== E || n[35] !== M || n[36] !== s || n[37] !== o || n[38] !== i || n[39] !== a || n[40] !== l || n[41] !== F || n[42] !== I || n[43] !== L || n[44] !== Ke || n[45] !== qe ? (K = /* @__PURE__ */ jsx(ListView_default, {
133
- loading: F,
134
- error: I,
135
- items: L,
136
- totalItems: Ke,
151
+ n[30] !== H || n[31] !== W ? (G = [H, W], n[30] = H, n[31] = W, n[32] = G) : G = n[32];
152
+ let Je = G, K;
153
+ n[33] !== d || n[34] !== k || n[35] !== D || n[36] !== N || n[37] !== s || n[38] !== o || n[39] !== i || n[40] !== a || n[41] !== l || n[42] !== Ge || n[43] !== Ke || n[44] !== I || n[45] !== qe || n[46] !== Je ? (K = /* @__PURE__ */ jsx(ListView_default, {
154
+ loading: Ge,
155
+ error: Ke,
156
+ items: I,
157
+ totalItems: qe,
137
158
  setPage: Pe,
138
159
  setRowsPerPage: Fe,
139
160
  setOrderBy: Ie,
140
161
  setOrder: Le,
141
162
  setSearchTerm: Re,
142
- setFilters: ze,
163
+ setFilters: f,
143
164
  orderBy: o,
144
165
  order: s,
145
166
  searchTerm: l,
146
167
  filters: d,
147
168
  page: i,
148
169
  rowsPerPage: a,
149
- deleteItem: E,
150
- onClick: M,
151
- handleNew: He,
152
- handleEdit: We,
170
+ deleteItem: D,
171
+ onClick: N,
172
+ handleNew: Ve,
173
+ handleEdit: Ue,
153
174
  enableBatchActions: !0,
154
- batchDelete: O,
175
+ batchDelete: k,
155
176
  columns: z,
156
177
  filterConfig: B,
157
- rowActions: qe
158
- }), n[32] = d, n[33] = O, n[34] = E, n[35] = M, n[36] = s, n[37] = o, n[38] = i, n[39] = a, n[40] = l, n[41] = F, n[42] = I, n[43] = L, n[44] = Ke, n[45] = qe, n[46] = K) : K = n[46];
178
+ rowActions: Je
179
+ }), n[33] = d, n[34] = k, n[35] = D, n[36] = N, n[37] = s, n[38] = o, n[39] = i, n[40] = a, n[41] = l, n[42] = Ge, n[43] = Ke, n[44] = I, n[45] = qe, n[46] = Je, n[47] = K) : K = n[47];
159
180
  let q;
160
- n[47] !== je || n[48] !== b ? (q = /* @__PURE__ */ jsx(DialogContent, {
181
+ n[48] !== je || n[49] !== x ? (q = /* @__PURE__ */ jsx(DialogContent, {
161
182
  className: "max-w-2xl",
162
183
  children: /* @__PURE__ */ jsx(je, {
163
- types: b,
164
- onSuccess: Ue
184
+ types: x,
185
+ onSuccess: He
165
186
  })
166
- }), n[47] = je, n[48] = b, n[49] = q) : q = n[49];
187
+ }), n[48] = je, n[49] = x, n[50] = q) : q = n[50];
167
188
  let J;
168
- n[50] !== f || n[51] !== q ? (J = /* @__PURE__ */ jsx(Dialog, {
169
- open: f,
170
- onOpenChange: p,
189
+ n[51] !== p || n[52] !== q ? (J = /* @__PURE__ */ jsx(Dialog, {
190
+ open: p,
191
+ onOpenChange: m,
171
192
  children: q
172
- }), n[50] = f, n[51] = q, n[52] = J) : J = n[52];
173
- let Je = !!m, Y;
174
- n[53] === Symbol.for("react.memo_cache_sentinel") ? (Y = (e) => !e && Ge(), n[53] = Y) : Y = n[53];
193
+ }), n[51] = p, n[52] = q, n[53] = J) : J = n[53];
194
+ let Ye = !!h, Y;
195
+ n[54] === Symbol.for("react.memo_cache_sentinel") ? (Y = (e) => !e && We(), n[54] = Y) : Y = n[54];
175
196
  let X;
176
- n[54] !== Me || n[55] !== b || n[56] !== m ? (X = m && /* @__PURE__ */ jsx(Me, {
177
- types: b,
178
- workspace: m,
179
- onSuccess: Ge
180
- }), n[54] = Me, n[55] = b, n[56] = m, n[57] = X) : X = n[57];
197
+ n[55] !== Me || n[56] !== x || n[57] !== h ? (X = h && /* @__PURE__ */ jsx(Me, {
198
+ types: x,
199
+ workspace: h,
200
+ onSuccess: We
201
+ }), n[55] = Me, n[56] = x, n[57] = h, n[58] = X) : X = n[58];
181
202
  let Z;
182
- n[58] === X ? Z = n[59] : (Z = /* @__PURE__ */ jsx(DialogContent, {
203
+ n[59] === X ? Z = n[60] : (Z = /* @__PURE__ */ jsx(DialogContent, {
183
204
  className: "max-w-2xl",
184
205
  children: X
185
- }), n[58] = X, n[59] = Z);
206
+ }), n[59] = X, n[60] = Z);
186
207
  let Q;
187
- n[60] !== Je || n[61] !== Z ? (Q = /* @__PURE__ */ jsx(Dialog, {
188
- open: Je,
208
+ n[61] !== Ye || n[62] !== Z ? (Q = /* @__PURE__ */ jsx(Dialog, {
209
+ open: Ye,
189
210
  onOpenChange: Y,
190
211
  children: Z
191
- }), n[60] = Je, n[61] = Z, n[62] = Q) : Q = n[62];
212
+ }), n[61] = Ye, n[62] = Z, n[63] = Q) : Q = n[63];
192
213
  let $;
193
- return n[63] !== K || n[64] !== J || n[65] !== Q ? ($ = /* @__PURE__ */ jsxs(Fragment$1, { children: [
214
+ return n[64] !== K || n[65] !== J || n[66] !== Q ? ($ = /* @__PURE__ */ jsxs(Fragment$1, { children: [
194
215
  K,
195
216
  J,
196
217
  Q
197
- ] }), n[63] = K, n[64] = J, n[65] = Q, n[66] = $) : $ = n[66], $;
218
+ ] }), n[64] = K, n[65] = J, n[66] = Q, n[67] = $) : $ = n[67], $;
198
219
  };
199
220
  function _temp(e) {
200
221
  return {
@@ -106,7 +106,7 @@ var CreateWorkspace_default = (xe) => {
106
106
  isFavourite: h
107
107
  }
108
108
  }, { onSuccess: async (e) => {
109
- await P(e.id), l();
109
+ await P(e.id), l(e);
110
110
  } });
111
111
  }, a[32] = h, a[33] = l, a[34] = P, a[35] = d, a[36] = s, a[37] = F) : F = a[37];
112
112
  let Ae = F, I;
@@ -118,7 +118,7 @@ var CreateWorkspace_default = (xe) => {
118
118
  appName: m,
119
119
  isFavourite: h || void 0
120
120
  } }, { onSuccess: async (e) => {
121
- await P(e.id), l();
121
+ await P(e.id), l(e);
122
122
  } });
123
123
  }, a[38] = u, a[39] = h, a[40] = l, a[41] = P, a[42] = m, a[43] = I) : I = a[43];
124
124
  let je = I, L = u.isPending || d.isPending || f.isPending, R;
package/dist/index.d.ts CHANGED
@@ -203,7 +203,7 @@ export declare interface Column {
203
203
  label: string;
204
204
  minWidth?: number;
205
205
  align?: 'right' | 'left' | 'center';
206
- format?: (value: unknown) => default_2.ReactNode;
206
+ format?: (value: unknown, row?: unknown) => default_2.ReactNode;
207
207
  }
208
208
 
209
209
  export declare const CompletionMessagePaper: default_2.FC<CompletionMessagePaperProps>;
@@ -440,7 +440,7 @@ export declare const CreateWorkspace: ({ types, workspace, onSuccess }: CreateWo
440
440
  export declare interface CreateWorkspaceProps {
441
441
  types: AppConfigInterface[];
442
442
  workspace?: WorkspaceItemInterface;
443
- onSuccess: () => void;
443
+ onSuccess: (workspace?: WorkspaceItemInterface) => void;
444
444
  }
445
445
 
446
446
  export declare const CustomItemListView: <T extends Item_2>({ loading, error, items, totalItems, filterConfig, onClick, handleNew, setPage, setRowsPerPage, setSearchTerm, setFilters, searchTerm, filters, page, rowsPerPage, batchActions, batchDelete, enableBatchActions, rowActions, itemRenderer, newButtonLabel, }: ListViewProps_2<T>) => JSX.Element;
@@ -667,7 +667,7 @@ export declare function DropdownMenuTrigger({ ...props }: React_2.ComponentProps
667
667
  export declare interface EditWorkspaceProps {
668
668
  types: AppConfigInterface[];
669
669
  workspace: WorkspaceItemInterface;
670
- onSuccess: () => void;
670
+ onSuccess: (workspace?: WorkspaceItemInterface) => void;
671
671
  }
672
672
 
673
673
  export declare function EmbedWorkbenchPage(): JSX.Element;
package/dist/index.js CHANGED
@@ -64,9 +64,9 @@ import ErrorSnackbar_default from "./components/feedback/ErrorSnackbar.js";
64
64
  import ErrorAlert_default from "./components/feedback/ErrorAlert.js";
65
65
  import "./components/index.js";
66
66
  import DebugPage_default from "./pages/DebugPage.js";
67
- import DashboardPage from "./pages/DashboardPage.js";
68
67
  import { EnvironmentSlotSelector } from "./features/workspaces/components/EnvironmentSlotSelector.js";
69
68
  import CreateWorkspace_default from "./features/workspaces/components/CreateWorkspace.js";
69
+ import DashboardPage from "./pages/DashboardPage.js";
70
70
  import WorkspacesPage from "./pages/WorkspacesPage.js";
71
71
  import "./features/workspaces/index.js";
72
72
  import { fileExplorerFeature } from "./features/file-explorer/file-explorer-feature.js";
@@ -1,85 +1,31 @@
1
- import { Button } from "../components/ui/button.js";
2
- import { Alert, AlertDescription, AlertTitle } from "../components/ui/alert.js";
1
+ import { useAppsConfig } from "../hooks/useConfig.js";
3
2
  import MainLayout_default from "../components/layout/MainLayout.js";
4
3
  import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
5
- import Dashboard from "../features/dashboard/Dashboard.js";
6
- import { useDashboardStats } from "../hooks/useDashboard.js";
4
+ import AppLauncher from "../features/dashboard/AppLauncher.js";
7
5
  import { c } from "react/compiler-runtime";
8
6
  import { jsx, jsxs } from "react/jsx-runtime";
9
- import { TriangleAlert } from "lucide-react";
10
7
  function DashboardPage() {
11
- let p = c(22), { data: m, isLoading: h, error: g, refetch: _, isRefetching: v } = useDashboardStats();
12
- if (h) {
8
+ let s = c(8), { data: l, isLoading: u } = useAppsConfig();
9
+ if (u) {
13
10
  let e;
14
- return p[0] === h ? e = p[1] : (e = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: h }), p[0] = h, p[1] = e), e;
11
+ return s[0] === u ? e = s[1] : (e = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: u }), s[0] = u, s[1] = e), e;
15
12
  }
16
- if (g) {
17
- let l;
18
- p[2] === Symbol.for("react.memo_cache_sentinel") ? (l = [{
19
- label: "Dashboard",
20
- current: !0
21
- }], p[2] = l) : l = p[2];
22
- let u = l, d;
23
- p[3] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx("h1", {
24
- className: "mb-4 text-3xl font-bold tracking-tight",
25
- children: "Dashboard"
26
- }), p[3] = d) : d = p[3];
27
- let f, m;
28
- p[4] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ jsx(TriangleAlert, {}), m = /* @__PURE__ */ jsx(AlertTitle, { children: "Failed to load dashboard" }), p[4] = f, p[5] = m) : (f = p[4], m = p[5]);
29
- let h;
30
- p[6] === g.message ? h = p[7] : (h = /* @__PURE__ */ jsxs("p", {
31
- className: "wrap-break-word",
32
- children: ["Please try again. ", g.message]
33
- }), p[6] = g.message, p[7] = h);
34
- let y;
35
- p[8] === _ ? y = p[9] : (y = () => void _(), p[8] = _, p[9] = y);
36
- let b = v ? "Reloading…" : "Retry", x;
37
- p[10] !== v || p[11] !== y || p[12] !== b ? (x = /* @__PURE__ */ jsx("div", {
38
- className: "mt-3 flex flex-wrap gap-2",
39
- children: /* @__PURE__ */ jsx(Button, {
40
- variant: "destructive",
41
- onClick: y,
42
- disabled: v,
43
- children: b
44
- })
45
- }), p[10] = v, p[11] = y, p[12] = b, p[13] = x) : x = p[13];
46
- let S;
47
- return p[14] !== h || p[15] !== x ? (S = /* @__PURE__ */ jsxs(MainLayout_default, {
48
- breadcrumbsData: u,
49
- children: [d, /* @__PURE__ */ jsx("div", {
50
- className: "mx-auto w-full max-w-2xl",
51
- children: /* @__PURE__ */ jsxs(Alert, {
52
- variant: "destructive",
53
- children: [
54
- f,
55
- m,
56
- /* @__PURE__ */ jsxs(AlertDescription, { children: [h, x] })
57
- ]
58
- })
59
- })]
60
- }), p[14] = h, p[15] = x, p[16] = S) : S = p[16], S;
61
- }
62
- if (!m) {
63
- let e;
64
- return p[17] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("div", {
65
- className: "p-4",
66
- children: "No data available"
67
- }), p[17] = e) : e = p[17], e;
68
- }
69
- let y;
70
- p[18] === Symbol.for("react.memo_cache_sentinel") ? (y = [{
71
- label: "Dashboard",
13
+ let d;
14
+ s[2] === Symbol.for("react.memo_cache_sentinel") ? (d = [{
15
+ label: "Applications",
72
16
  current: !0
73
- }], p[18] = y) : y = p[18];
74
- let b = y, x;
75
- p[19] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ jsx("h1", {
17
+ }], s[2] = d) : d = s[2];
18
+ let f = d, p;
19
+ s[3] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ jsx("h1", {
76
20
  className: "mb-4 text-3xl font-bold tracking-tight",
77
- children: "Dashboard"
78
- }), p[19] = x) : x = p[19];
79
- let S;
80
- return p[20] === m ? S = p[21] : (S = /* @__PURE__ */ jsxs(MainLayout_default, {
81
- breadcrumbsData: b,
82
- children: [x, /* @__PURE__ */ jsx(Dashboard, { dashboardStats: m })]
83
- }), p[20] = m, p[21] = S), S;
21
+ children: "Applications"
22
+ }), s[3] = p) : p = s[3];
23
+ let m;
24
+ s[4] === l ? m = s[5] : (m = l && l.length > 0 && /* @__PURE__ */ jsx(AppLauncher, { apps: l }), s[4] = l, s[5] = m);
25
+ let h;
26
+ return s[6] === m ? h = s[7] : (h = /* @__PURE__ */ jsxs(MainLayout_default, {
27
+ breadcrumbsData: f,
28
+ children: [p, m]
29
+ }), s[6] = m, s[7] = h), h;
84
30
  }
85
31
  export { DashboardPage as default };
@@ -23,7 +23,7 @@ var LocalRouter = class {
23
23
  return "/runs/action-required";
24
24
  }
25
25
  getDashboard() {
26
- return "/dashboard";
26
+ return "/applications";
27
27
  }
28
28
  async navigateToDashboard() {
29
29
  await this.navigate(this.getDashboard());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loopstack/loopstack-studio",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "repository": "loopstack-ai/loopstack-studio",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,125 +0,0 @@
1
- import { useStudio } from "../../providers/StudioProvider.js";
2
- import { Card, CardContent, CardHeader, CardTitle } from "../../components/ui/card.js";
3
- import RunList_default from "./RunList.js";
4
- import { c } from "react/compiler-runtime";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { Link } from "react-router-dom";
7
- function Dashboard(f) {
8
- let p = c(43), { dashboardStats: m } = f, { router: h } = useStudio();
9
- if (!m) {
10
- let t;
11
- return p[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ jsx("div", {
12
- className: "p-4",
13
- children: "No data available"
14
- }), p[0] = t) : t = p[0], t;
15
- }
16
- let g;
17
- p[1] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, {
18
- className: "text-lg",
19
- children: "Quick Links"
20
- }) }), p[1] = g) : g = p[1];
21
- let _;
22
- p[2] === h ? _ = p[3] : (_ = h.getWorkspaces(), p[2] = h, p[3] = _);
23
- let v;
24
- p[4] === _ ? v = p[5] : (v = /* @__PURE__ */ jsx(CardContent, {
25
- className: "space-y-3",
26
- children: /* @__PURE__ */ jsx(Link, {
27
- to: _,
28
- className: "text-primary hover:text-primary/80 hover:bg-muted block rounded p-2 text-sm font-medium transition-colors",
29
- children: "My Workspaces"
30
- })
31
- }), p[4] = _, p[5] = v);
32
- let y;
33
- p[6] === h ? y = p[7] : (y = h.getDebugWorkflows(), p[6] = h, p[7] = y);
34
- let b;
35
- p[8] === y ? b = p[9] : (b = /* @__PURE__ */ jsx(CardContent, {
36
- className: "space-y-3",
37
- children: /* @__PURE__ */ jsx(Link, {
38
- to: y,
39
- className: "text-primary hover:text-primary/80 hover:bg-muted block rounded p-2 text-sm font-medium transition-colors",
40
- children: "Debug Workflows"
41
- })
42
- }), p[8] = y, p[9] = b);
43
- let x;
44
- p[10] !== v || p[11] !== b ? (x = /* @__PURE__ */ jsx("div", {
45
- className: "md:col-span-1",
46
- children: /* @__PURE__ */ jsxs(Card, {
47
- className: "h-full",
48
- children: [
49
- g,
50
- v,
51
- b
52
- ]
53
- })
54
- }), p[10] = v, p[11] = b, p[12] = x) : x = p[12];
55
- let S;
56
- p[13] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, {
57
- className: "text-lg",
58
- children: "Executions"
59
- }) }), p[13] = S) : S = p[13];
60
- let C;
61
- p[14] === m.totalAutomationRuns ? C = p[15] : (C = /* @__PURE__ */ jsxs(Card, { children: [S, /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("p", {
62
- className: "text-3xl font-bold",
63
- children: m.totalAutomationRuns
64
- }) })] }), p[14] = m.totalAutomationRuns, p[15] = C);
65
- let w;
66
- p[16] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, {
67
- className: "text-lg",
68
- children: "Completed"
69
- }) }), p[16] = w) : w = p[16];
70
- let T;
71
- p[17] === m.completedRuns ? T = p[18] : (T = /* @__PURE__ */ jsxs(Card, { children: [w, /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("p", {
72
- className: "text-3xl font-bold text-green-600",
73
- children: m.completedRuns
74
- }) })] }), p[17] = m.completedRuns, p[18] = T);
75
- let E;
76
- p[19] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, {
77
- className: "text-lg",
78
- children: "Failed"
79
- }) }), p[19] = E) : E = p[19];
80
- let D;
81
- p[20] === m.errorRuns ? D = p[21] : (D = /* @__PURE__ */ jsxs(Card, { children: [E, /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("p", {
82
- className: "text-destructive text-3xl font-bold",
83
- children: m.errorRuns
84
- }) })] }), p[20] = m.errorRuns, p[21] = D);
85
- let O;
86
- p[22] !== T || p[23] !== D || p[24] !== C ? (O = /* @__PURE__ */ jsxs("div", {
87
- className: "grid grid-cols-1 gap-4 md:col-span-3 md:grid-cols-3",
88
- children: [
89
- C,
90
- T,
91
- D
92
- ]
93
- }), p[22] = T, p[23] = D, p[24] = C, p[25] = O) : O = p[25];
94
- let k;
95
- p[26] !== O || p[27] !== x ? (k = /* @__PURE__ */ jsxs("div", {
96
- className: "mb-8 grid grid-cols-1 gap-6 md:grid-cols-4",
97
- children: [x, O]
98
- }), p[26] = O, p[27] = x, p[28] = k) : k = p[28];
99
- let A;
100
- p[29] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Recently Completed" }) }), p[29] = A) : A = p[29];
101
- let j;
102
- p[30] !== m.recentRuns || p[31] !== h ? (j = /* @__PURE__ */ jsxs(Card, { children: [A, /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(RunList_default, {
103
- type: "runs",
104
- runs: m.recentRuns,
105
- router: h,
106
- emptyMessage: "No recent runs."
107
- }) })] }), p[30] = m.recentRuns, p[31] = h, p[32] = j) : j = p[32];
108
- let M;
109
- p[33] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: "Recently Failed" }) }), p[33] = M) : M = p[33];
110
- let N;
111
- p[34] !== m.recentErrors || p[35] !== h ? (N = /* @__PURE__ */ jsxs(Card, { children: [M, /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(RunList_default, {
112
- type: "errors",
113
- runs: m.recentErrors,
114
- router: h,
115
- emptyMessage: "No recent errors."
116
- }) })] }), p[34] = m.recentErrors, p[35] = h, p[36] = N) : N = p[36];
117
- let P;
118
- p[37] !== j || p[38] !== N ? (P = /* @__PURE__ */ jsxs("div", {
119
- className: "grid grid-cols-1 gap-6 md:grid-cols-2",
120
- children: [j, N]
121
- }), p[37] = j, p[38] = N, p[39] = P) : P = p[39];
122
- let F;
123
- return p[40] !== k || p[41] !== P ? (F = /* @__PURE__ */ jsxs(Fragment, { children: [k, P] }), p[40] = k, p[41] = P, p[42] = F) : F = p[42], F;
124
- }
125
- export { Dashboard as default };