@loopstack/loopstack-studio 0.30.0 → 0.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,20 @@
1
1
  import { useStudio, useStudioOptional } from "../../providers/StudioProvider.js";
2
- import { useFilterWorkflows } from "../../hooks/useWorkflows.js";
3
2
  import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
4
3
  import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
5
4
  import { cn } from "../../lib/utils.js";
6
5
  import { Button } from "../ui/button.js";
7
- import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../ui/sidebar.js";
6
+ import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../ui/sidebar.js";
8
7
  import { motion } from "../../node_modules/motion/dist/es/react.js";
9
8
  import { c } from "react/compiler-runtime";
10
9
  import { useState } from "react";
11
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
11
  import { Link, useLocation } from "react-router-dom";
13
- import { CircleAlert, LayoutGrid, MoreHorizontal, PanelLeftIcon, Play, Star } from "lucide-react";
12
+ import { Boxes, LayoutGrid, MoreHorizontal, PanelLeftIcon, Play, Star } from "lucide-react";
14
13
  var DefaultSidebarHeader = () => {
15
- let e = c(18), { state: u, toggleSidebar: d } = useSidebar(), [f, p] = useState(!1), g = u === "collapsed" ? "justify-center" : "justify-between", _;
16
- e[0] === g ? _ = e[1] : (_ = cn("border-sidebar-border h-12 w-full flex-row items-center border-b px-1.5 py-0", g), e[0] = g, e[1] = _);
17
- let v;
18
- e[2] === u ? v = e[3] : (v = u === "expanded" && /* @__PURE__ */ jsxs("div", {
14
+ let e = c(18), { state: o, toggleSidebar: s } = useSidebar(), [l, f] = useState(!1), p = o === "collapsed" ? "justify-center" : "justify-between", m;
15
+ e[0] === p ? m = e[1] : (m = cn("border-sidebar-border h-12 w-full flex-row items-center border-b px-1.5 py-0", p), e[0] = p, e[1] = m);
16
+ let h;
17
+ e[2] === o ? h = e[3] : (h = o === "expanded" && /* @__PURE__ */ jsxs("div", {
19
18
  className: "flex items-center gap-2 overflow-hidden px-1.5",
20
19
  children: [/* @__PURE__ */ jsx("img", {
21
20
  src: "/loopstack.svg",
@@ -45,174 +44,160 @@ var DefaultSidebarHeader = () => {
45
44
  },
46
45
  children: "Loopstack Studio"
47
46
  })]
48
- }), e[2] = u, e[3] = v);
49
- let y;
50
- e[4] === Symbol.for("react.memo_cache_sentinel") ? (y = cn("relative size-10 text-muted-foreground hover:cursor-pointer hover:bg-accent/50 hover:text-accent-foreground"), e[4] = y) : y = e[4];
51
- let b, x;
52
- e[5] === Symbol.for("react.memo_cache_sentinel") ? (b = () => p(!0), x = () => p(!1), e[5] = b, e[6] = x) : (b = e[5], x = e[6]);
53
- let C;
54
- e[7] !== f || e[8] !== u ? (C = u === "collapsed" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(motion.img, {
47
+ }), e[2] = o, e[3] = h);
48
+ let g;
49
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (g = cn("relative size-10 text-muted-foreground hover:cursor-pointer hover:bg-accent/50 hover:text-accent-foreground"), e[4] = g) : g = e[4];
50
+ let _, y;
51
+ e[5] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => f(!0), y = () => f(!1), e[5] = _, e[6] = y) : (_ = e[5], y = e[6]);
52
+ let b;
53
+ e[7] !== l || e[8] !== o ? (b = o === "collapsed" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(motion.img, {
55
54
  src: "/loopstack.svg",
56
55
  alt: "Loopstack",
57
56
  className: "absolute top-1/2 left-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2",
58
57
  initial: { opacity: 1 },
59
- animate: { opacity: f ? 0 : 1 },
58
+ animate: { opacity: l ? 0 : 1 },
60
59
  transition: { duration: .2 }
61
60
  }), /* @__PURE__ */ jsx(motion.div, {
62
61
  className: "absolute top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center",
63
62
  initial: { opacity: 0 },
64
- animate: { opacity: f ? 1 : 0 },
63
+ animate: { opacity: l ? 1 : 0 },
65
64
  transition: { duration: .2 },
66
65
  children: /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-5" })
67
- })] }) : /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-5" }), e[7] = f, e[8] = u, e[9] = C) : C = e[9];
68
- let w;
69
- e[10] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx("span", {
66
+ })] }) : /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-5" }), e[7] = l, e[8] = o, e[9] = b) : b = e[9];
67
+ let x;
68
+ e[10] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ jsx("span", {
70
69
  className: "sr-only",
71
70
  children: "Toggle Sidebar"
72
- }), e[10] = w) : w = e[10];
73
- let T;
74
- e[11] !== C || e[12] !== d ? (T = /* @__PURE__ */ jsxs(Button, {
71
+ }), e[10] = x) : x = e[10];
72
+ let E;
73
+ e[11] !== b || e[12] !== s ? (E = /* @__PURE__ */ jsxs(Button, {
75
74
  "data-sidebar": "trigger",
76
75
  "data-slot": "sidebar-trigger",
77
76
  variant: "ghost",
78
77
  size: "icon",
79
- className: y,
80
- onClick: d,
81
- onMouseEnter: b,
82
- onMouseLeave: x,
83
- children: [C, w]
84
- }), e[11] = C, e[12] = d, e[13] = T) : T = e[13];
85
- let E;
86
- return e[14] !== _ || e[15] !== v || e[16] !== T ? (E = /* @__PURE__ */ jsxs(SidebarHeader, {
87
- className: _,
88
- children: [v, T]
89
- }), e[14] = _, e[15] = v, e[16] = T, e[17] = E) : E = e[17], E;
90
- }, RunsNav = () => {
91
- let u = c(26), f = useLocation(), { router: p } = useStudio(), m = p.getRuns(), h;
92
- u[0] === p ? h = u[1] : (h = p.getRunsActionRequired(), u[0] = p, u[1] = h);
93
- let g = h, _;
94
- u[2] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
95
- parentId: null,
96
- status: "paused"
97
- }, u[2] = _) : _ = u[2];
98
- let v = useFilterWorkflows(void 0, _, "createdAt", "DESC", 0, 1).data?.total ?? 0, S;
99
- u[3] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Runs" }), u[3] = S) : S = u[3];
100
- let D = f.pathname === m || f.pathname === m + "/", O, k;
101
- u[4] === Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ jsx(Play, {}), k = /* @__PURE__ */ jsx("span", { children: "Overview" }), u[4] = O, u[5] = k) : (O = u[4], k = u[5]);
102
- let A;
103
- u[6] === m ? A = u[7] : (A = /* @__PURE__ */ jsxs(Link, {
104
- to: m,
105
- children: [O, k]
106
- }), u[6] = m, u[7] = A);
78
+ className: g,
79
+ onClick: s,
80
+ onMouseEnter: _,
81
+ onMouseLeave: y,
82
+ children: [b, x]
83
+ }), e[11] = b, e[12] = s, e[13] = E) : E = e[13];
84
+ let D;
85
+ return e[14] !== m || e[15] !== h || e[16] !== E ? (D = /* @__PURE__ */ jsxs(SidebarHeader, {
86
+ className: m,
87
+ children: [h, E]
88
+ }), e[14] = m, e[15] = h, e[16] = E, e[17] = D) : D = e[17], D;
89
+ }, MainNav = () => {
90
+ let o = c(29), s = useLocation(), { router: l } = useStudio(), u;
91
+ o[0] === l ? u = o[1] : (u = l.getDashboard(), o[0] = l, o[1] = u);
92
+ let d = u, f;
93
+ o[2] === l ? f = o[3] : (f = l.getWorkspaces(), o[2] = l, o[3] = f);
94
+ let p = f, m = l.getRuns(), _ = s.pathname === d, v, S;
95
+ o[4] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx(Boxes, {}), S = /* @__PURE__ */ jsx("span", { children: "Applications" }), o[4] = v, o[5] = S) : (v = o[4], S = o[5]);
96
+ let C;
97
+ o[6] === d ? C = o[7] : (C = /* @__PURE__ */ jsxs(Link, {
98
+ to: d,
99
+ children: [v, S]
100
+ }), o[6] = d, o[7] = C);
101
+ let w;
102
+ o[8] !== _ || o[9] !== C ? (w = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
103
+ asChild: !0,
104
+ isActive: _,
105
+ tooltip: "Applications",
106
+ children: C
107
+ }) }), o[8] = _, o[9] = C, o[10] = w) : w = o[10];
108
+ let T = s.pathname === p, k, A;
109
+ o[11] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ jsx(LayoutGrid, {}), A = /* @__PURE__ */ jsx("span", { children: "Workspaces" }), o[11] = k, o[12] = A) : (k = o[11], A = o[12]);
107
110
  let j;
108
- u[8] !== D || u[9] !== A ? (j = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
111
+ o[13] === p ? j = o[14] : (j = /* @__PURE__ */ jsxs(Link, {
112
+ to: p,
113
+ children: [k, A]
114
+ }), o[13] = p, o[14] = j);
115
+ let M;
116
+ o[15] !== j || o[16] !== T ? (M = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
109
117
  asChild: !0,
110
- isActive: D,
111
- tooltip: "Overview",
112
- children: A
113
- }) }), u[8] = D, u[9] = A, u[10] = j) : j = u[10];
114
- let M = f.pathname === g, N, P;
115
- u[11] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx(CircleAlert, {}), N = /* @__PURE__ */ jsx("span", { children: "Action Required" }), u[11] = N, u[12] = P) : (N = u[11], P = u[12]);
116
- let F;
117
- u[13] === g ? F = u[14] : (F = /* @__PURE__ */ jsxs(Link, {
118
- to: g,
119
- children: [P, N]
120
- }), u[13] = g, u[14] = F);
118
+ isActive: T,
119
+ tooltip: "Workspaces",
120
+ children: j
121
+ }) }), o[15] = j, o[16] = T, o[17] = M) : M = o[17];
122
+ let N = s.pathname === m || s.pathname === m + "/", P, F;
123
+ o[18] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx(Play, {}), F = /* @__PURE__ */ jsx("span", { children: "Runs" }), o[18] = P, o[19] = F) : (P = o[18], F = o[19]);
121
124
  let I;
122
- u[15] !== F || u[16] !== M ? (I = /* @__PURE__ */ jsx(SidebarMenuButton, {
123
- asChild: !0,
124
- isActive: M,
125
- tooltip: "Action Required",
126
- children: F
127
- }), u[15] = F, u[16] = M, u[17] = I) : I = u[17];
128
- let L;
129
- u[18] === v ? L = u[19] : (L = v > 0 && /* @__PURE__ */ jsx(SidebarMenuBadge, { children: v }), u[18] = v, u[19] = L);
130
- let R;
131
- u[20] !== I || u[21] !== L ? (R = /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [I, L] }), u[20] = I, u[21] = L, u[22] = R) : R = u[22];
132
- let z;
133
- return u[23] !== R || u[24] !== j ? (z = /* @__PURE__ */ jsxs(SidebarGroup, { children: [S, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [j, R] }) })] }), u[23] = R, u[24] = j, u[25] = z) : z = u[25], z;
134
- }, WorkspacesNav = () => {
135
- let u = c(10), d = useLocation(), { router: f } = useStudio(), p;
136
- u[0] === f ? p = u[1] : (p = f.getWorkspaces(), u[0] = f, u[1] = p);
137
- let m = p, h;
138
- u[2] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Workspaces" }), u[2] = h) : h = u[2];
139
- let g = d.pathname === m, _, v;
140
- u[3] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx(LayoutGrid, {}), v = /* @__PURE__ */ jsx("span", { children: "Workspaces" }), u[3] = _, u[4] = v) : (_ = u[3], v = u[4]);
141
- let S;
142
- u[5] === m ? S = u[6] : (S = /* @__PURE__ */ jsxs(Link, {
125
+ o[20] === m ? I = o[21] : (I = /* @__PURE__ */ jsxs(Link, {
143
126
  to: m,
144
- children: [_, v]
145
- }), u[5] = m, u[6] = S);
146
- let w;
147
- return u[7] !== g || u[8] !== S ? (w = /* @__PURE__ */ jsxs(SidebarGroup, { children: [h, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
127
+ children: [P, F]
128
+ }), o[20] = m, o[21] = I);
129
+ let L;
130
+ o[22] !== N || o[23] !== I ? (L = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
148
131
  asChild: !0,
149
- isActive: g,
150
- tooltip: "Workspaces",
151
- children: S
152
- }) }) }) })] }), u[7] = g, u[8] = S, u[9] = w) : w = u[9], w;
132
+ isActive: N,
133
+ tooltip: "Runs",
134
+ children: I
135
+ }) }), o[22] = N, o[23] = I, o[24] = L) : L = o[24];
136
+ let R;
137
+ return o[25] !== M || o[26] !== L || o[27] !== w ? (R = /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [
138
+ w,
139
+ M,
140
+ L
141
+ ] }) }) }), o[25] = M, o[26] = L, o[27] = w, o[28] = R) : R = o[28], R;
153
142
  }, FavouritesNav = () => {
154
- let u = c(19), d = useLocation(), { router: p } = useStudio(), m;
155
- u[0] === p ? m = u[1] : (m = p.getWorkspaces(), u[0] = p, u[1] = m);
156
- let h = m, g;
157
- u[2] === Symbol.for("react.memo_cache_sentinel") ? (g = { isFavourite: "true" }, u[2] = g) : g = u[2];
158
- let _ = useFilterWorkspaces(void 0, g, "createdAt", "ASC", 0, 10), v;
159
- u[3] === _.data?.data ? v = u[4] : (v = _.data?.data ?? [], u[3] = _.data?.data, u[4] = v);
143
+ let o = c(19), l = useLocation(), { router: u } = useStudio(), d;
144
+ o[0] === u ? d = o[1] : (d = u.getWorkspaces(), o[0] = u, o[1] = d);
145
+ let f = d, p;
146
+ o[2] === Symbol.for("react.memo_cache_sentinel") ? (p = { isFavourite: "true" }, o[2] = p) : p = o[2];
147
+ let m = useFilterWorkspaces(void 0, p, "createdAt", "ASC", 0, 10), v;
148
+ o[3] === m.data?.data ? v = o[4] : (v = m.data?.data ?? [], o[3] = m.data?.data, o[4] = v);
160
149
  let S = v;
161
150
  if (S.length === 0) return null;
151
+ let C;
152
+ o[5] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Favourites" }), o[5] = C) : C = o[5];
162
153
  let w;
163
- u[5] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Favourites" }), u[5] = w) : w = u[5];
164
- let D;
165
- if (u[6] !== S || u[7] !== d || u[8] !== p) {
154
+ if (o[6] !== S || o[7] !== l || o[8] !== u) {
166
155
  let e;
167
- u[10] !== d || u[11] !== p ? (e = (e) => {
168
- let u = p.getWorkspace(e.id);
156
+ o[10] !== l || o[11] !== u ? (e = (e) => {
157
+ let o = u.getWorkspace(e.id);
169
158
  return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
170
159
  asChild: !0,
171
- isActive: d.pathname === u || d.pathname.startsWith(u + "/"),
160
+ isActive: l.pathname === o || l.pathname.startsWith(o + "/"),
172
161
  tooltip: e.title,
173
162
  children: /* @__PURE__ */ jsxs(Link, {
174
- to: u,
163
+ to: o,
175
164
  children: [/* @__PURE__ */ jsx(Star, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", { children: e.title })]
176
165
  })
177
166
  }) }, e.id);
178
- }, u[10] = d, u[11] = p, u[12] = e) : e = u[12], D = S.map(e), u[6] = S, u[7] = d, u[8] = p, u[9] = D;
179
- } else D = u[9];
180
- let O;
181
- u[13] !== _.data?.total || u[14] !== h ? (O = (_.data?.total ?? 0) > 10 && /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
167
+ }, o[10] = l, o[11] = u, o[12] = e) : e = o[12], w = S.map(e), o[6] = S, o[7] = l, o[8] = u, o[9] = w;
168
+ } else w = o[9];
169
+ let T;
170
+ o[13] !== m.data?.total || o[14] !== f ? (T = (m.data?.total ?? 0) > 10 && /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
182
171
  asChild: !0,
183
172
  tooltip: "More favourites",
184
173
  children: /* @__PURE__ */ jsxs(Link, {
185
- to: h,
174
+ to: f,
186
175
  children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", { children: "More" })]
187
176
  })
188
- }) }), u[13] = _.data?.total, u[14] = h, u[15] = O) : O = u[15];
189
- let k;
190
- return u[16] !== D || u[17] !== O ? (k = /* @__PURE__ */ jsxs(SidebarGroup, { children: [w, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [D, O] }) })] }), u[16] = D, u[17] = O, u[18] = k) : k = u[18], k;
177
+ }) }), o[13] = m.data?.total, o[14] = f, o[15] = T) : T = o[15];
178
+ let O;
179
+ return o[16] !== w || o[17] !== T ? (O = /* @__PURE__ */ jsxs(SidebarGroup, { children: [C, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [w, T] }) })] }), o[16] = w, o[17] = T, o[18] = O) : O = o[18], O;
191
180
  }, DefaultSidebarFooter = () => {
192
- let e = c(1), u;
193
- return e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ jsx(SidebarFooter, {}), e[0] = u) : u = e[0], u;
181
+ let e = c(1), o;
182
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ jsx(SidebarFooter, {}), e[0] = o) : o = e[0], o;
194
183
  };
195
184
  const StudioSidebar = () => {
196
- let e = c(13), d = useComponentOverrides(), f = useStudioOptional(), m = d.SidebarHeader ?? DefaultSidebarHeader, h = d.SidebarFooter ?? DefaultSidebarFooter, v;
197
- e[0] === m ? v = e[1] : (v = /* @__PURE__ */ jsx(m, {}), e[0] = m, e[1] = v);
185
+ let e = c(13), s = useComponentOverrides(), u = useStudioOptional(), d = s.SidebarHeader ?? DefaultSidebarHeader, m = s.SidebarFooter ?? DefaultSidebarFooter, h;
186
+ e[0] === d ? h = e[1] : (h = /* @__PURE__ */ jsx(d, {}), e[0] = d, e[1] = h);
187
+ let g;
188
+ e[2] === u ? g = e[3] : (g = u && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MainNav, {}), /* @__PURE__ */ jsx(FavouritesNav, {})] }), e[2] = u, e[3] = g);
189
+ let _;
190
+ e[4] === g ? _ = e[5] : (_ = /* @__PURE__ */ jsx(SidebarContent, { children: g }), e[4] = g, e[5] = _);
191
+ let v;
192
+ e[6] !== m || e[7] !== u ? (v = u && /* @__PURE__ */ jsx(m, {}), e[6] = m, e[7] = u, e[8] = v) : v = e[8];
198
193
  let y;
199
- e[2] === f ? y = e[3] : (y = f && /* @__PURE__ */ jsxs(Fragment$1, { children: [
200
- /* @__PURE__ */ jsx(RunsNav, {}),
201
- /* @__PURE__ */ jsx(WorkspacesNav, {}),
202
- /* @__PURE__ */ jsx(FavouritesNav, {})
203
- ] }), e[2] = f, e[3] = y);
204
- let b;
205
- e[4] === y ? b = e[5] : (b = /* @__PURE__ */ jsx(SidebarContent, { children: y }), e[4] = y, e[5] = b);
206
- let x;
207
- e[6] !== h || e[7] !== f ? (x = f && /* @__PURE__ */ jsx(h, {}), e[6] = h, e[7] = f, e[8] = x) : x = e[8];
208
- let S;
209
- return e[9] !== v || e[10] !== b || e[11] !== x ? (S = /* @__PURE__ */ jsxs(Sidebar, {
194
+ return e[9] !== h || e[10] !== _ || e[11] !== v ? (y = /* @__PURE__ */ jsxs(Sidebar, {
210
195
  collapsible: "icon",
211
196
  children: [
212
- v,
213
- b,
214
- x
197
+ h,
198
+ _,
199
+ v
215
200
  ]
216
- }), e[9] = v, e[10] = b, e[11] = x, e[12] = S) : S = e[12], S;
201
+ }), e[9] = h, e[10] = _, e[11] = v, e[12] = y) : y = e[12], y;
217
202
  };
218
203
  export { StudioSidebar };
@@ -2,78 +2,78 @@ import { DataTable } from "../data-table/DataTable.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import React, { useCallback } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
- var ListView_default = (t) => {
6
- let n = c(61), { loading: r, error: i, items: a, totalItems: o, columns: s, filterConfig: l, deleteItem: u, onClick: d, handleNew: f, handleEdit: p, setPage: m, setRowsPerPage: h, setOrderBy: g, setOrder: _, setSearchTerm: v, setFilters: ae, orderBy: oe, order: se, searchTerm: ce, filters: y, page: b, rowsPerPage: x, batchActions: S, batchDelete: C, enableBatchActions: le, rowActions: w, deleteConfirmTitle: T, deleteConfirmDescription: E, newButtonLabel: D } = t, O = ce === void 0 ? "" : ce, k;
7
- n[0] === S ? k = n[1] : (k = S === void 0 ? [] : S, n[0] = S, n[1] = k);
5
+ var ListView_default = (ae) => {
6
+ let t = c(61), { loading: n, error: r, items: i, totalItems: a, columns: o, filterConfig: s, deleteItem: l, onClick: u, handleNew: d, handleEdit: f, setPage: p, setRowsPerPage: m, setOrderBy: h, setOrder: g, setSearchTerm: _, setFilters: oe, orderBy: se, order: v, searchTerm: ce, filters: y, page: b, rowsPerPage: x, batchActions: S, batchDelete: C, enableBatchActions: le, rowActions: w, deleteConfirmTitle: T, deleteConfirmDescription: E, newButtonLabel: D } = ae, O = ce === void 0 ? "" : ce, k;
7
+ t[0] === S ? k = t[1] : (k = S === void 0 ? [] : S, t[0] = S, t[1] = k);
8
8
  let A = k, j = le === void 0 ? !0 : le, M;
9
- n[2] === w ? M = n[3] : (M = w === void 0 ? [] : w, n[2] = w, n[3] = M);
9
+ t[2] === w ? M = t[3] : (M = w === void 0 ? [] : w, t[2] = w, t[3] = M);
10
10
  let N = M, P;
11
- n[4] === s ? P = n[5] : (P = s.map(_temp), n[4] = s, n[5] = P);
11
+ t[4] === o ? P = t[5] : (P = o.map(_temp), t[4] = o, t[5] = P);
12
12
  let F = P, I;
13
- n[6] === A ? I = n[7] : (I = A.map(_temp2), n[6] = A, n[7] = I);
13
+ t[6] === A ? I = t[7] : (I = A.map(_temp2), t[6] = A, t[7] = I);
14
14
  let ue = I, L;
15
- n[8] === N ? L = n[9] : (L = N.map(_temp3), n[8] = N, n[9] = L);
15
+ t[8] === N ? L = t[9] : (L = N.map(_temp3), t[8] = N, t[9] = L);
16
16
  let R = L, z;
17
- n[10] === m ? z = n[11] : (z = (e) => {
18
- m(e);
19
- }, n[10] = m, n[11] = z);
17
+ t[10] === p ? z = t[11] : (z = (e) => {
18
+ p(e);
19
+ }, t[10] = p, t[11] = z);
20
20
  let B = z, V;
21
- n[12] !== m || n[13] !== h ? (V = (e) => {
22
- h(e), m(0);
23
- }, n[12] = m, n[13] = h, n[14] = V) : V = n[14];
21
+ t[12] !== p || t[13] !== m ? (V = (e) => {
22
+ m(e), p(0);
23
+ }, t[12] = p, t[13] = m, t[14] = V) : V = t[14];
24
24
  let H = V, U;
25
- n[15] !== _ || n[16] !== g ? (U = (e, ie) => {
26
- g(e), _(ie);
27
- }, n[15] = _, n[16] = g, n[17] = U) : U = n[17];
25
+ t[15] !== g || t[16] !== h ? (U = (e, ie) => {
26
+ h(e), g(ie);
27
+ }, t[15] = g, t[16] = h, t[17] = U) : U = t[17];
28
28
  let W = U, G;
29
- n[18] !== m || n[19] !== v ? (G = (e) => {
30
- v(e), m(0);
31
- }, n[18] = m, n[19] = v, n[20] = G) : G = n[20];
29
+ t[18] !== p || t[19] !== _ ? (G = (e) => {
30
+ _(e), p(0);
31
+ }, t[18] = p, t[19] = _, t[20] = G) : G = t[20];
32
32
  let K = G, q;
33
- n[21] !== ae || n[22] !== m ? (q = (e) => {
34
- ae(e), m(0);
35
- }, n[21] = ae, n[22] = m, n[23] = q) : q = n[23];
33
+ t[21] !== oe || t[22] !== p ? (q = (e) => {
34
+ oe(e), p(0);
35
+ }, t[21] = oe, t[22] = p, t[23] = q) : q = t[23];
36
36
  let J = q, Y;
37
- n[24] === d ? Y = n[25] : (Y = (e) => {
38
- d?.(e.id);
39
- }, n[24] = d, n[25] = Y);
37
+ t[24] === u ? Y = t[25] : (Y = (e) => {
38
+ u?.(e.id);
39
+ }, t[24] = u, t[25] = Y);
40
40
  let de = Y, X;
41
- n[26] === p ? X = n[27] : (X = (e) => {
42
- p?.(e);
43
- }, n[26] = p, n[27] = X);
41
+ t[26] === f ? X = t[27] : (X = (e) => {
42
+ f?.(e);
43
+ }, t[26] = f, t[27] = X);
44
44
  let fe = X, Z;
45
- n[28] === u ? Z = n[29] : (Z = (e) => {
46
- u?.(e);
47
- }, n[28] = u, n[29] = Z);
45
+ t[28] === l ? Z = t[29] : (Z = (e) => {
46
+ l?.(e);
47
+ }, t[28] = l, t[29] = Z);
48
48
  let pe = Z, Q;
49
- n[30] === C ? Q = n[31] : (Q = async (e) => {
49
+ t[30] === C ? Q = t[31] : (Q = async (e) => {
50
50
  C && await C(e);
51
- }, n[30] = C, n[31] = Q);
52
- let me = Q, he = d ? de : void 0, ge = p ? fe : void 0, _e = u ? pe : void 0, $;
53
- return n[32] !== E || n[33] !== T || n[34] !== j || n[35] !== i || n[36] !== l || n[37] !== y || n[38] !== me || n[39] !== J || n[40] !== f || n[41] !== B || n[42] !== H || n[43] !== K || n[44] !== W || n[45] !== a || n[46] !== r || n[47] !== D || n[48] !== se || n[49] !== oe || n[50] !== b || n[51] !== x || n[52] !== O || n[53] !== he || n[54] !== ge || n[55] !== _e || n[56] !== o || n[57] !== ue || n[58] !== F || n[59] !== R ? ($ = /* @__PURE__ */ jsx("div", {
51
+ }, t[30] = C, t[31] = Q);
52
+ let me = Q, he = u ? de : void 0, ge = f ? fe : void 0, _e = l ? pe : void 0, $;
53
+ return t[32] !== E || t[33] !== T || t[34] !== j || t[35] !== r || t[36] !== s || t[37] !== y || t[38] !== me || t[39] !== J || t[40] !== d || t[41] !== B || t[42] !== H || t[43] !== K || t[44] !== W || t[45] !== i || t[46] !== n || t[47] !== D || t[48] !== v || t[49] !== se || t[50] !== b || t[51] !== x || t[52] !== O || t[53] !== he || t[54] !== ge || t[55] !== _e || t[56] !== a || t[57] !== ue || t[58] !== F || t[59] !== R ? ($ = /* @__PURE__ */ jsx("div", {
54
54
  className: "w-full",
55
55
  children: /* @__PURE__ */ jsx(DataTable, {
56
- data: a,
56
+ data: i,
57
57
  columns: F,
58
- totalItems: o,
59
- loading: r,
60
- error: i,
58
+ totalItems: a,
59
+ loading: n,
60
+ error: r,
61
61
  page: b,
62
62
  pageSize: x,
63
63
  onPageChange: B,
64
64
  onPageSizeChange: H,
65
- sortBy: oe,
66
- sortOrder: se,
65
+ sortBy: se,
66
+ sortOrder: v,
67
67
  onSortChange: W,
68
68
  searchTerm: O,
69
69
  onSearchChange: K,
70
70
  filters: y,
71
- filterConfig: l,
71
+ filterConfig: s,
72
72
  onFiltersChange: J,
73
73
  onRowClick: he,
74
74
  onEdit: ge,
75
75
  onDelete: _e,
76
- onNew: f,
76
+ onNew: d,
77
77
  newButtonLabel: D,
78
78
  enableBatchActions: j,
79
79
  batchActions: ue,
@@ -82,7 +82,7 @@ var ListView_default = (t) => {
82
82
  deleteConfirmTitle: T,
83
83
  deleteConfirmDescription: E
84
84
  })
85
- }), n[32] = E, n[33] = T, n[34] = j, n[35] = i, n[36] = l, n[37] = y, n[38] = me, n[39] = J, n[40] = f, n[41] = B, n[42] = H, n[43] = K, n[44] = W, n[45] = a, n[46] = r, n[47] = D, n[48] = se, n[49] = oe, n[50] = b, n[51] = x, n[52] = O, n[53] = he, n[54] = ge, n[55] = _e, n[56] = o, n[57] = ue, n[58] = F, n[59] = R, n[60] = $) : $ = n[60], $;
85
+ }), t[32] = E, t[33] = T, t[34] = j, t[35] = r, t[36] = s, t[37] = y, t[38] = me, t[39] = J, t[40] = d, t[41] = B, t[42] = H, t[43] = K, t[44] = W, t[45] = i, t[46] = n, t[47] = D, t[48] = v, t[49] = se, t[50] = b, t[51] = x, t[52] = O, t[53] = he, t[54] = ge, t[55] = _e, t[56] = a, t[57] = ue, t[58] = F, t[59] = R, t[60] = $) : $ = t[60], $;
86
86
  };
87
87
  function _temp(e) {
88
88
  return {
@@ -91,8 +91,8 @@ function _temp(e) {
91
91
  minWidth: e.minWidth,
92
92
  align: e.align,
93
93
  sortable: !0,
94
- format: e.format ? (ie) => {
95
- let t = e.format(ie);
94
+ format: e.format ? (ie, ae) => {
95
+ let t = e.format(ie, ae);
96
96
  return typeof t == "string" && t.includes("<") ? /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: t } }) : t;
97
97
  } : void 0
98
98
  };
@@ -0,0 +1,84 @@
1
+ import { useStudio } from "../../providers/StudioProvider.js";
2
+ import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
3
+ import { Button } from "../../components/ui/button.js";
4
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/ui/card.js";
5
+ import { Dialog, DialogContent } from "../../components/ui/dialog.js";
6
+ import CreateWorkspace_default from "../workspaces/components/CreateWorkspace.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { useMemo, useState } from "react";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
+ import { Link } from "react-router-dom";
11
+ import { Boxes, FolderOpen, Plus } from "lucide-react";
12
+ function AppLauncher(x) {
13
+ let S = c(25), { apps: C } = x, { CreateWorkspace: w } = useComponentOverrides(), T = w ?? CreateWorkspace_default, { router: E } = useStudio(), [D, O] = useState(null), k;
14
+ S[0] === D ? k = S[1] : (k = D ? [{
15
+ appName: D.appName,
16
+ title: D.title,
17
+ environments: D.extensions?.environments ?? []
18
+ }] : [], S[0] = D, S[1] = k);
19
+ let A = k, j;
20
+ S[2] === E ? j = S[3] : (j = (e) => {
21
+ O(null), e && E.navigateToWorkspace(e.id);
22
+ }, S[2] = E, S[3] = j);
23
+ let M = j, N;
24
+ if (S[4] !== C || S[5] !== E) {
25
+ let e;
26
+ S[7] === E ? e = S[8] : (e = (e) => /* @__PURE__ */ jsxs(Card, {
27
+ className: "flex flex-col",
28
+ children: [/* @__PURE__ */ jsxs(CardHeader, { children: [/* @__PURE__ */ jsxs("div", {
29
+ className: "flex items-center gap-2",
30
+ children: [/* @__PURE__ */ jsx(Boxes, { className: "text-muted-foreground h-5 w-5" }), /* @__PURE__ */ jsx(CardTitle, {
31
+ className: "text-base",
32
+ children: e.title
33
+ })]
34
+ }), e.description && /* @__PURE__ */ jsx(CardDescription, { children: e.description })] }), /* @__PURE__ */ jsxs(CardContent, {
35
+ className: "mt-auto flex gap-2",
36
+ children: [/* @__PURE__ */ jsx(Button, {
37
+ variant: "ghost",
38
+ size: "sm",
39
+ className: "flex-1",
40
+ asChild: !0,
41
+ children: /* @__PURE__ */ jsxs(Link, {
42
+ to: `${E.getWorkspaces()}?appName=${encodeURIComponent(e.appName)}`,
43
+ children: [/* @__PURE__ */ jsx(FolderOpen, { className: "mr-1 h-4 w-4" }), "View Workspaces"]
44
+ })
45
+ }), /* @__PURE__ */ jsxs(Button, {
46
+ variant: "outline",
47
+ size: "sm",
48
+ className: "flex-1",
49
+ onClick: () => O(e),
50
+ children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), "Create Workspace"]
51
+ })]
52
+ })]
53
+ }, e.appName), S[7] = E, S[8] = e), N = C.map(e), S[4] = C, S[5] = E, S[6] = N;
54
+ } else N = S[6];
55
+ let P;
56
+ S[9] === N ? P = S[10] : (P = /* @__PURE__ */ jsx("div", {
57
+ className: "mb-8",
58
+ children: /* @__PURE__ */ jsx("div", {
59
+ className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
60
+ children: N
61
+ })
62
+ }), S[9] = N, S[10] = P);
63
+ let F = !!D, I;
64
+ S[11] === Symbol.for("react.memo_cache_sentinel") ? (I = (e) => !e && O(null), S[11] = I) : I = S[11];
65
+ let L;
66
+ S[12] !== T || S[13] !== A || S[14] !== M || S[15] !== D ? (L = D && /* @__PURE__ */ jsx(T, {
67
+ types: A,
68
+ onSuccess: M
69
+ }), S[12] = T, S[13] = A, S[14] = M, S[15] = D, S[16] = L) : L = S[16];
70
+ let R;
71
+ S[17] === L ? R = S[18] : (R = /* @__PURE__ */ jsx(DialogContent, {
72
+ className: "max-w-2xl",
73
+ children: L
74
+ }), S[17] = L, S[18] = R);
75
+ let z;
76
+ S[19] !== F || S[20] !== R ? (z = /* @__PURE__ */ jsx(Dialog, {
77
+ open: F,
78
+ onOpenChange: I,
79
+ children: R
80
+ }), S[19] = F, S[20] = R, S[21] = z) : z = S[21];
81
+ let B;
82
+ return S[22] !== P || S[23] !== z ? (B = /* @__PURE__ */ jsxs(Fragment$1, { children: [P, z] }), S[22] = P, S[23] = z, S[24] = B) : B = S[24], B;
83
+ }
84
+ export { AppLauncher as default };