@burdenoff/microfe-store 2026.625.4 → 2026.625.5
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/components/InstallAppModal.js +240 -173
- package/dist/components/InstallAppModal.js.map +1 -1
- package/dist/pages/InstalledAppsPage.js +285 -105
- package/dist/pages/InstalledAppsPage.js.map +1 -1
- package/dist/pages/ProductDetailPage.js +193 -192
- package/dist/pages/ProductDetailPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useStore as e } from "../providers/StoreProvider.js";
|
|
2
2
|
import { useCallback as t, useEffect as n, useReducer as r, useState as i } from "react";
|
|
3
|
-
import { AlertCircle as a, Building2 as o, CheckCircle as s, Info as c, Loader2 as l,
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { graphqlFetch as
|
|
3
|
+
import { AlertCircle as a, Building2 as o, CheckCircle as s, Info as c, Loader2 as l, ShieldCheck as u, X as d } from "lucide-react";
|
|
4
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
5
|
+
import { graphqlFetch as h } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
6
|
//#region src/components/InstallAppModal.tsx
|
|
7
|
-
var
|
|
7
|
+
var g = "query MyWorkspaces { myWorkspaces { items { id name slug type status organizationId } total } }", _ = "mutation InstallWorkspaceApps($workspaceIds: [ID!]!, $input: InstallWorkspaceAppInput!) { installWorkspaceApps(workspaceIds: $workspaceIds, input: $input) { successCount failedCount results { success workspaceId error } } }", v = "mutation RecordAppInstallation($input: RecordAppInstallationInput!) { recordAppInstallation(input: $input) { id status workspaceId version } }", y = "mutation InstallPurchasedApp($orderId: ID, $productId: String!, $workspaceId: String!) { installPurchasedApp(orderId: $orderId, productId: $productId, workspaceId: $workspaceId) { success alreadyInstalled installation { id productId workspaceId status version } error message } }", b = "mutation CreateProductEntitlement($input: CreateProductEntitlementInput!) { createProductEntitlement(input: $input) { id status productId workspaceId } }", x = new Set([
|
|
8
8
|
"VIBEMODULE",
|
|
9
9
|
"NODE",
|
|
10
10
|
"CONSOLE",
|
|
11
11
|
"DASHBOARD",
|
|
12
12
|
"PARSER",
|
|
13
13
|
"DATASINK"
|
|
14
|
-
]),
|
|
14
|
+
]), S = {
|
|
15
15
|
ALREADY_INSTALLED: "This app is already installed in the selected workspace.",
|
|
16
16
|
QUOTA_EXCEEDED: "Installation limit reached. Please upgrade your plan or contact support.",
|
|
17
17
|
PERMISSION_DENIED: "You do not have permission to install apps in this workspace.",
|
|
@@ -20,19 +20,19 @@ var h = "query MyWorkspaces { myWorkspaces { items { id name slug type status or
|
|
|
20
20
|
ENTITLEMENT_EXPIRED: "Your license for this app has expired.",
|
|
21
21
|
UNSUPPORTED_TYPE: "This product type cannot be installed in the selected workspace."
|
|
22
22
|
};
|
|
23
|
-
function
|
|
24
|
-
for (let [t, n] of Object.entries(
|
|
23
|
+
function C(e) {
|
|
24
|
+
for (let [t, n] of Object.entries(S)) if (e.toUpperCase().includes(t)) return n;
|
|
25
25
|
return "Installation failed. Please try again or contact support.";
|
|
26
26
|
}
|
|
27
|
-
var
|
|
27
|
+
var w = {
|
|
28
28
|
selectedWorkspace: null,
|
|
29
29
|
installing: !1,
|
|
30
30
|
installError: null,
|
|
31
31
|
installInfo: null
|
|
32
32
|
};
|
|
33
|
-
function
|
|
33
|
+
function T(e, t) {
|
|
34
34
|
switch (t.type) {
|
|
35
|
-
case "reset": return
|
|
35
|
+
case "reset": return w;
|
|
36
36
|
case "selectWorkspace": return {
|
|
37
37
|
...e,
|
|
38
38
|
selectedWorkspace: t.workspaceId
|
|
@@ -58,14 +58,14 @@ function w(e, t) {
|
|
|
58
58
|
default: return e;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function E(r) {
|
|
62
62
|
let { authToken: a } = e(), [o, s] = i([]), [c, l] = i(!1), [u, d] = i(null), f = t(async () => {
|
|
63
63
|
if (!r) {
|
|
64
64
|
l(!0), d(null);
|
|
65
65
|
try {
|
|
66
|
-
let e = await
|
|
66
|
+
let e = await h({
|
|
67
67
|
gateway: "global",
|
|
68
|
-
query:
|
|
68
|
+
query: g,
|
|
69
69
|
authToken: a || void 0
|
|
70
70
|
});
|
|
71
71
|
if (e.errors?.length) throw Error(e.errors[0]?.message ?? "GraphQL error");
|
|
@@ -86,268 +86,335 @@ function T(r) {
|
|
|
86
86
|
refetch: f
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
var
|
|
90
|
-
let { authToken:
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
var D = ({ isOpen: t, onClose: g, app: S, orderId: D, purchaseState: O = "free", onInstallSuccess: k, onInstallError: A }) => {
|
|
90
|
+
let { authToken: j, user: M } = e(), [N, P] = r(T, w), { selectedWorkspace: F, installing: I, installError: L, installInfo: R } = N, z = S.requiredPermissions ?? [], [B, V] = i(z.length > 0 ? "permissions" : "workspace");
|
|
91
|
+
n(() => {
|
|
92
|
+
t && (V(z.length > 0 ? "permissions" : "workspace"), P({ type: "reset" }));
|
|
93
|
+
}, [t, z.length]);
|
|
94
|
+
let { workspaces: H, loading: U, error: W } = E(!t || B === "permissions"), G = H.filter((e) => e.status === "ACTIVE"), K = async () => {
|
|
95
|
+
if (!F) return;
|
|
96
|
+
let e = G.find((e) => e.id === F);
|
|
93
97
|
if (!e) return;
|
|
94
|
-
let t =
|
|
95
|
-
|
|
98
|
+
let t = M?.id;
|
|
99
|
+
P({ type: "startInstall" });
|
|
96
100
|
try {
|
|
97
|
-
if (!
|
|
101
|
+
if (!D && O !== "purchased") {
|
|
98
102
|
if (!t) throw Error("Unable to identify the current user for license creation");
|
|
99
|
-
await
|
|
103
|
+
await h({
|
|
100
104
|
gateway: "global",
|
|
101
|
-
query:
|
|
105
|
+
query: b,
|
|
102
106
|
variables: { input: {
|
|
103
|
-
productId:
|
|
107
|
+
productId: S.id,
|
|
104
108
|
purchasedBy: t,
|
|
105
109
|
workspaceId: e.id,
|
|
106
110
|
metadata: {
|
|
107
111
|
source: "store-ui",
|
|
108
|
-
productType:
|
|
112
|
+
productType: S.type
|
|
109
113
|
}
|
|
110
114
|
} },
|
|
111
|
-
authToken:
|
|
115
|
+
authToken: j || void 0
|
|
112
116
|
});
|
|
113
117
|
}
|
|
114
|
-
let
|
|
118
|
+
let n = await h({
|
|
115
119
|
gateway: "global",
|
|
116
|
-
query:
|
|
120
|
+
query: y,
|
|
117
121
|
variables: {
|
|
118
|
-
orderId:
|
|
119
|
-
productId:
|
|
122
|
+
orderId: D ?? null,
|
|
123
|
+
productId: S.id,
|
|
120
124
|
workspaceId: e.id
|
|
121
125
|
},
|
|
122
|
-
authToken:
|
|
126
|
+
authToken: j || void 0
|
|
123
127
|
});
|
|
124
|
-
if (
|
|
125
|
-
let
|
|
126
|
-
if (
|
|
128
|
+
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Installation failed");
|
|
129
|
+
let r = n.data?.installPurchasedApp;
|
|
130
|
+
if (r?.success) r.alreadyInstalled ? P({
|
|
127
131
|
type: "setInfo",
|
|
128
|
-
info:
|
|
129
|
-
}) : (
|
|
132
|
+
info: r.message || "Already installed on this workspace"
|
|
133
|
+
}) : (k?.(e.id, e.name), g());
|
|
130
134
|
else {
|
|
131
|
-
let e =
|
|
132
|
-
|
|
135
|
+
let e = r?.error || "Installation failed";
|
|
136
|
+
P({
|
|
133
137
|
type: "setError",
|
|
134
|
-
error:
|
|
135
|
-
}),
|
|
138
|
+
error: C(e)
|
|
139
|
+
}), A?.(Error(e));
|
|
136
140
|
}
|
|
137
141
|
} catch (e) {
|
|
138
142
|
let t = e instanceof Error ? e.message : "Installation failed";
|
|
139
|
-
|
|
143
|
+
P({
|
|
140
144
|
type: "setError",
|
|
141
|
-
error:
|
|
142
|
-
}),
|
|
145
|
+
error: C(t)
|
|
146
|
+
}), A?.(Error(t));
|
|
143
147
|
} finally {
|
|
144
|
-
|
|
148
|
+
P({ type: "finishInstall" });
|
|
145
149
|
}
|
|
146
|
-
},
|
|
147
|
-
if (!
|
|
148
|
-
let e =
|
|
150
|
+
}, q = async () => {
|
|
151
|
+
if (!F) return;
|
|
152
|
+
let e = G.find((e) => e.id === F);
|
|
149
153
|
if (e) {
|
|
150
|
-
|
|
154
|
+
P({ type: "startInstall" });
|
|
151
155
|
try {
|
|
152
|
-
let t = await
|
|
156
|
+
let t = await h({
|
|
153
157
|
gateway: "workspace",
|
|
154
|
-
query:
|
|
158
|
+
query: _,
|
|
155
159
|
variables: {
|
|
156
160
|
workspaceIds: [e.id],
|
|
157
161
|
input: {
|
|
158
|
-
appName:
|
|
159
|
-
displayName:
|
|
160
|
-
version:
|
|
161
|
-
type:
|
|
162
|
+
appName: S.slug || S.name.toLowerCase().replace(/\s+/g, "-"),
|
|
163
|
+
displayName: S.name,
|
|
164
|
+
version: S.version || "1.0.0",
|
|
165
|
+
type: S.type || "app",
|
|
162
166
|
manifest: {
|
|
163
|
-
productId:
|
|
164
|
-
icon:
|
|
167
|
+
productId: S.id,
|
|
168
|
+
icon: S.icon
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
171
|
},
|
|
168
|
-
authToken:
|
|
172
|
+
authToken: j || void 0,
|
|
169
173
|
workspaceId: e.id,
|
|
170
174
|
workspaceToken: !0
|
|
171
175
|
});
|
|
172
176
|
if (t.errors?.length) throw Error(t.errors[0]?.message ?? "Installation failed");
|
|
173
|
-
let
|
|
174
|
-
if (
|
|
177
|
+
let n = t.data?.installWorkspaceApps;
|
|
178
|
+
if (n?.successCount && n.successCount > 0) {
|
|
175
179
|
try {
|
|
176
|
-
await
|
|
180
|
+
await h({
|
|
177
181
|
gateway: "global",
|
|
178
|
-
query:
|
|
182
|
+
query: v,
|
|
179
183
|
variables: { input: {
|
|
180
|
-
productId:
|
|
184
|
+
productId: S.id,
|
|
181
185
|
workspaceId: e.id,
|
|
182
186
|
workspaceName: e.name,
|
|
183
187
|
workspaceType: e.type,
|
|
184
188
|
organizationId: e.organizationId,
|
|
185
|
-
version:
|
|
189
|
+
version: S.version || "1.0.0",
|
|
186
190
|
manifest: {
|
|
187
|
-
productId:
|
|
188
|
-
icon:
|
|
189
|
-
slug:
|
|
190
|
-
type:
|
|
191
|
+
productId: S.id,
|
|
192
|
+
icon: S.icon,
|
|
193
|
+
slug: S.slug,
|
|
194
|
+
type: S.type
|
|
191
195
|
}
|
|
192
196
|
} },
|
|
193
|
-
authToken:
|
|
197
|
+
authToken: j || void 0
|
|
194
198
|
});
|
|
195
199
|
} catch {}
|
|
196
|
-
|
|
200
|
+
k?.(e.id, e.name), g();
|
|
197
201
|
} else {
|
|
198
|
-
let e =
|
|
199
|
-
|
|
202
|
+
let e = n?.results?.[0]?.error || "Installation failed";
|
|
203
|
+
P({
|
|
200
204
|
type: "setError",
|
|
201
|
-
error:
|
|
202
|
-
}),
|
|
205
|
+
error: C(e)
|
|
206
|
+
}), A?.(Error(e));
|
|
203
207
|
}
|
|
204
208
|
} catch (e) {
|
|
205
209
|
let t = e instanceof Error ? e.message : "Installation failed";
|
|
206
|
-
|
|
210
|
+
P({
|
|
207
211
|
type: "setError",
|
|
208
|
-
error:
|
|
209
|
-
}),
|
|
212
|
+
error: C(t)
|
|
213
|
+
}), A?.(Error(t));
|
|
210
214
|
} finally {
|
|
211
|
-
|
|
215
|
+
P({ type: "finishInstall" });
|
|
212
216
|
}
|
|
213
217
|
}
|
|
218
|
+
}, J = async () => {
|
|
219
|
+
let e = S.type?.toUpperCase() ?? "";
|
|
220
|
+
O === "purchased" || D || x.has(e) ? await K() : await q();
|
|
214
221
|
};
|
|
215
|
-
|
|
222
|
+
if (!t) return null;
|
|
223
|
+
let Y = B === "permissions" ? "Review Permissions" : "Install App";
|
|
224
|
+
return /* @__PURE__ */ m("div", {
|
|
216
225
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ p("button", {
|
|
218
227
|
type: "button",
|
|
219
228
|
"aria-label": "Close modal",
|
|
220
229
|
className: "absolute inset-0 bg-bg-overlay/50 backdrop-blur-sm",
|
|
221
|
-
onClick:
|
|
222
|
-
}), /* @__PURE__ */
|
|
230
|
+
onClick: g
|
|
231
|
+
}), /* @__PURE__ */ m("dialog", {
|
|
223
232
|
open: !0,
|
|
224
233
|
"aria-modal": "true",
|
|
225
234
|
"aria-labelledby": "install-app-modal-title",
|
|
226
235
|
className: "relative z-10 mx-4 w-full max-w-lg rounded-2xl border border-border-default bg-bg-surface shadow-2xl",
|
|
227
236
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ m("div", {
|
|
229
238
|
className: "flex items-center justify-between border-b border-border-default px-6 py-4",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ m("div", {
|
|
231
240
|
className: "flex items-center gap-3",
|
|
232
|
-
children: [
|
|
233
|
-
src:
|
|
234
|
-
alt:
|
|
241
|
+
children: [S.icon ? /* @__PURE__ */ p("img", {
|
|
242
|
+
src: S.icon,
|
|
243
|
+
alt: S.name,
|
|
235
244
|
className: "size-10 rounded-lg object-cover"
|
|
236
|
-
}) : /* @__PURE__ */
|
|
245
|
+
}) : /* @__PURE__ */ p("div", {
|
|
237
246
|
className: "flex size-10 items-center justify-center rounded-lg bg-bg-sunken text-lg font-bold text-text-muted",
|
|
238
|
-
children:
|
|
239
|
-
}), /* @__PURE__ */
|
|
247
|
+
children: S.name.charAt(0)
|
|
248
|
+
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h2", {
|
|
240
249
|
id: "install-app-modal-title",
|
|
241
250
|
className: "text-lg font-semibold text-text-primary",
|
|
242
|
-
children:
|
|
243
|
-
}), /* @__PURE__ */
|
|
251
|
+
children: Y
|
|
252
|
+
}), /* @__PURE__ */ p("p", {
|
|
244
253
|
className: "text-sm text-text-muted",
|
|
245
|
-
children:
|
|
254
|
+
children: S.name
|
|
246
255
|
})] })]
|
|
247
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ p("button", {
|
|
248
257
|
type: "button",
|
|
249
|
-
onClick:
|
|
258
|
+
onClick: g,
|
|
250
259
|
"aria-label": "Close install dialog",
|
|
251
260
|
className: "cursor-pointer rounded-lg p-2 text-text-muted transition-colors hover:bg-bg-sunken hover:text-text-primary",
|
|
252
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ p(d, { className: "size-5" })
|
|
253
262
|
})]
|
|
254
263
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
264
|
+
B === "permissions" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", {
|
|
256
265
|
className: "px-6 py-4",
|
|
257
|
-
children: [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
className: "
|
|
267
|
-
children:
|
|
268
|
-
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
className: "text-sm text-
|
|
271
|
-
children:
|
|
272
|
-
})
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
})
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
266
|
+
children: [
|
|
267
|
+
/* @__PURE__ */ m("p", {
|
|
268
|
+
className: "mb-1 text-sm text-text-secondary",
|
|
269
|
+
children: [/* @__PURE__ */ p("span", {
|
|
270
|
+
className: "font-medium text-text-primary",
|
|
271
|
+
children: S.name
|
|
272
|
+
}), " requests access to the following data in your workspace. You must accept to continue."]
|
|
273
|
+
}),
|
|
274
|
+
/* @__PURE__ */ p("div", {
|
|
275
|
+
className: "mt-4 max-h-72 overflow-y-auto space-y-2",
|
|
276
|
+
children: z.map((e) => /* @__PURE__ */ m("div", {
|
|
277
|
+
className: "flex items-center gap-3 rounded-lg bg-bg-sunken px-4 py-3",
|
|
278
|
+
children: [/* @__PURE__ */ p(u, { className: "size-5 flex-shrink-0 text-status-success-text" }), /* @__PURE__ */ p("span", {
|
|
279
|
+
className: "text-sm text-text-primary",
|
|
280
|
+
children: e
|
|
281
|
+
})]
|
|
282
|
+
}, e))
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ p("p", {
|
|
285
|
+
className: "mt-3 text-xs text-text-muted",
|
|
286
|
+
children: "These permissions will be recorded. You will be notified if they change in a future version."
|
|
287
|
+
})
|
|
288
|
+
]
|
|
289
|
+
}), /* @__PURE__ */ m("div", {
|
|
290
|
+
className: "border-t border-border-default px-6 py-4 flex items-center justify-end gap-3",
|
|
291
|
+
children: [/* @__PURE__ */ p("button", {
|
|
292
|
+
type: "button",
|
|
293
|
+
onClick: g,
|
|
294
|
+
className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
295
|
+
children: "Cancel"
|
|
296
|
+
}), /* @__PURE__ */ m("button", {
|
|
297
|
+
type: "button",
|
|
298
|
+
onClick: () => V("workspace"),
|
|
299
|
+
className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 inline-flex items-center gap-2",
|
|
300
|
+
children: [/* @__PURE__ */ p(s, { className: "size-4" }), "Accept & Continue"]
|
|
301
|
+
})]
|
|
302
|
+
})] }),
|
|
303
|
+
B === "workspace" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", {
|
|
304
|
+
className: "px-6 py-4",
|
|
305
|
+
children: [
|
|
306
|
+
z.length > 0 && /* @__PURE__ */ m("div", {
|
|
307
|
+
className: "mb-3 flex items-center gap-2 rounded-lg bg-status-success-bg-subtle px-3 py-2 text-sm text-status-success-text",
|
|
308
|
+
children: [/* @__PURE__ */ p(s, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ m("span", { children: [
|
|
309
|
+
"Permissions accepted (",
|
|
310
|
+
z.length,
|
|
311
|
+
" permission",
|
|
312
|
+
z.length === 1 ? "" : "s",
|
|
313
|
+
")"
|
|
314
|
+
] })]
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ p("p", {
|
|
317
|
+
className: "mb-4 text-text-secondary",
|
|
318
|
+
children: "Select the workspace where you want to install this app:"
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ p("div", {
|
|
321
|
+
className: "max-h-64 overflow-y-auto rounded-lg border border-border-default",
|
|
322
|
+
children: U ? /* @__PURE__ */ p("div", {
|
|
323
|
+
className: "flex items-center justify-center py-12",
|
|
324
|
+
children: /* @__PURE__ */ p(l, { className: "size-8 animate-spin text-text-muted" })
|
|
325
|
+
}) : W ? /* @__PURE__ */ m("div", {
|
|
326
|
+
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
293
327
|
children: [
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
/* @__PURE__ */ p("div", {
|
|
299
|
-
className: "flex-1 min-w-0",
|
|
300
|
-
children: [/* @__PURE__ */ f("p", {
|
|
301
|
-
className: "font-medium text-text-primary truncate",
|
|
302
|
-
children: e.name
|
|
303
|
-
}), e.slug ? /* @__PURE__ */ p("p", {
|
|
304
|
-
className: "text-xs text-text-muted truncate",
|
|
305
|
-
children: ["/", e.slug]
|
|
306
|
-
}) : null]
|
|
328
|
+
/* @__PURE__ */ p(a, { className: "mb-2 size-8 text-status-error-text" }),
|
|
329
|
+
/* @__PURE__ */ p("p", {
|
|
330
|
+
className: "text-sm text-status-error-text",
|
|
331
|
+
children: "Failed to load workspaces"
|
|
307
332
|
}),
|
|
308
|
-
|
|
333
|
+
/* @__PURE__ */ p("p", {
|
|
334
|
+
className: "text-xs text-text-muted mt-1",
|
|
335
|
+
children: W.message
|
|
336
|
+
})
|
|
309
337
|
]
|
|
310
|
-
},
|
|
338
|
+
}) : G.length === 0 ? /* @__PURE__ */ m("div", {
|
|
339
|
+
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
340
|
+
children: [/* @__PURE__ */ p(o, { className: "mb-2 size-8 text-text-muted" }), /* @__PURE__ */ p("p", {
|
|
341
|
+
className: "text-sm text-text-muted",
|
|
342
|
+
children: "No workspaces available"
|
|
343
|
+
})]
|
|
344
|
+
}) : /* @__PURE__ */ p("div", {
|
|
345
|
+
className: "divide-y divide-border-default",
|
|
346
|
+
children: G.map((e) => /* @__PURE__ */ m("button", {
|
|
347
|
+
type: "button",
|
|
348
|
+
onClick: () => P({
|
|
349
|
+
type: "selectWorkspace",
|
|
350
|
+
workspaceId: e.id
|
|
351
|
+
}),
|
|
352
|
+
className: `w-full cursor-pointer flex items-center gap-3 px-4 py-3 text-left transition-colors ${F === e.id ? "bg-action-primary-bg/10" : "transition-colors hover:bg-bg-sunken"}`,
|
|
353
|
+
children: [
|
|
354
|
+
/* @__PURE__ */ p("div", {
|
|
355
|
+
className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10 text-text-link",
|
|
356
|
+
children: /* @__PURE__ */ p(o, { className: "size-5" })
|
|
357
|
+
}),
|
|
358
|
+
/* @__PURE__ */ m("div", {
|
|
359
|
+
className: "flex-1 min-w-0",
|
|
360
|
+
children: [/* @__PURE__ */ p("p", {
|
|
361
|
+
className: "font-medium text-text-primary truncate",
|
|
362
|
+
children: e.name
|
|
363
|
+
}), e.slug ? /* @__PURE__ */ m("p", {
|
|
364
|
+
className: "text-xs text-text-muted truncate",
|
|
365
|
+
children: ["/", e.slug]
|
|
366
|
+
}) : null]
|
|
367
|
+
}),
|
|
368
|
+
F === e.id && /* @__PURE__ */ p(s, { className: "size-5 flex-shrink-0 text-action-primary-bg" })
|
|
369
|
+
]
|
|
370
|
+
}, e.id))
|
|
371
|
+
})
|
|
311
372
|
})
|
|
312
|
-
|
|
313
|
-
}),
|
|
314
|
-
/* @__PURE__ */ p("div", {
|
|
373
|
+
]
|
|
374
|
+
}), /* @__PURE__ */ m("div", {
|
|
315
375
|
className: "border-t border-border-default px-6 py-4",
|
|
316
376
|
children: [
|
|
317
|
-
|
|
377
|
+
R && /* @__PURE__ */ m("div", {
|
|
318
378
|
className: "mb-3 flex items-center gap-2 rounded-lg bg-status-info-bg-subtle px-3 py-2 text-sm text-status-info-text",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ p(c, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ p("span", { children: R })]
|
|
320
380
|
}),
|
|
321
|
-
|
|
381
|
+
L && /* @__PURE__ */ m("div", {
|
|
322
382
|
className: "mb-3 flex items-center gap-2 rounded-lg bg-status-error-bg-subtle/10 px-3 py-2 text-sm text-status-error-text",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ p(a, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ p("span", { children: L })]
|
|
324
384
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ m("div", {
|
|
326
386
|
className: "flex items-center justify-end gap-3",
|
|
327
|
-
children: [
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
387
|
+
children: [
|
|
388
|
+
z.length > 0 && /* @__PURE__ */ p("button", {
|
|
389
|
+
type: "button",
|
|
390
|
+
onClick: () => V("permissions"),
|
|
391
|
+
disabled: I,
|
|
392
|
+
className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
|
|
393
|
+
children: "Back"
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ p("button", {
|
|
396
|
+
type: "button",
|
|
397
|
+
onClick: g,
|
|
398
|
+
disabled: I,
|
|
399
|
+
className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
|
|
400
|
+
children: "Cancel"
|
|
401
|
+
}),
|
|
402
|
+
/* @__PURE__ */ p("button", {
|
|
403
|
+
type: "button",
|
|
404
|
+
onClick: J,
|
|
405
|
+
disabled: !F || I,
|
|
406
|
+
className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2",
|
|
407
|
+
children: I ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(l, { className: "size-4 animate-spin" }), "Installing…"] }) : "Install App"
|
|
408
|
+
})
|
|
409
|
+
]
|
|
343
410
|
})
|
|
344
411
|
]
|
|
345
|
-
})
|
|
412
|
+
})] })
|
|
346
413
|
]
|
|
347
414
|
})]
|
|
348
|
-
})
|
|
415
|
+
});
|
|
349
416
|
};
|
|
350
417
|
//#endregion
|
|
351
|
-
export {
|
|
418
|
+
export { D as InstallAppModal };
|
|
352
419
|
|
|
353
420
|
//# sourceMappingURL=InstallAppModal.js.map
|