@burdenoff/microfe-store 2026.623.1 → 2026.624.2
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/StoreRoutes.js +3 -3
- package/dist/StoreRoutes.js.map +1 -1
- package/dist/components/AccessDenied.js +3 -3
- package/dist/components/AccessDenied.js.map +1 -1
- package/dist/components/InstallAppModal.js +106 -119
- package/dist/components/InstallAppModal.js.map +1 -1
- package/dist/components/cart/CartDrawer.js +6 -6
- package/dist/components/cart/CartDrawer.js.map +1 -1
- package/dist/pages/AdminStoresPage.js +390 -372
- package/dist/pages/AdminStoresPage.js.map +1 -1
- package/dist/pages/InstalledAppsPage.js +110 -133
- package/dist/pages/InstalledAppsPage.js.map +1 -1
- package/dist/pages/MarketplaceHomePage.js +1 -1
- package/dist/pages/MarketplaceHomePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,8 +4,9 @@ import { ArrowLeft as i, Pencil as a, Plus as o, RefreshCw as s, Store as c, Tra
|
|
|
4
4
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
5
5
|
import { useNavigate as f } from "react-router-dom";
|
|
6
6
|
import { graphqlFetch as p } from "@burdenoff/fe-libs/shared/graphql";
|
|
7
|
+
import { AlertDialog as m, AlertDialogAction as h, AlertDialogCancel as g, AlertDialogContent as _, AlertDialogDescription as v, AlertDialogFooter as y, AlertDialogHeader as b, AlertDialogTitle as x } from "@burdenoff/fe-libs/ui";
|
|
7
8
|
//#region src/pages/AdminStoresPage.tsx
|
|
8
|
-
var
|
|
9
|
+
var S = "\n query AdminStores {\n stores {\n id\n slug\n name\n type\n tenantId\n isPublic\n requiresApproval\n allowUnverifiedPublishers\n currency\n logoUrl\n description\n createdAt\n }\n }\n", C = "\n mutation CreateStore($input: CreateStoreInput!) {\n createStore(input: $input) {\n id\n slug\n name\n type\n }\n }\n", w = "\n mutation UpdateStore($id: ID!, $input: UpdateStoreInput!) {\n updateStore(id: $id, input: $input) {\n id\n name\n isPublic\n requiresApproval\n }\n }\n", T = "\n mutation DeleteStore($id: ID!) {\n deleteStore(id: $id)\n }\n", E = {
|
|
9
10
|
slug: "",
|
|
10
11
|
name: "",
|
|
11
12
|
type: "PRIVATE",
|
|
@@ -15,30 +16,30 @@ var m = "\n query AdminStores {\n stores {\n id\n slug\n name
|
|
|
15
16
|
allowUnverifiedPublishers: !0,
|
|
16
17
|
currency: "USD",
|
|
17
18
|
description: ""
|
|
18
|
-
},
|
|
19
|
-
let
|
|
20
|
-
|
|
19
|
+
}, D = () => {
|
|
20
|
+
let D = f(), { authToken: O, basePath: k } = e(), [A, j] = r([]), [M, N] = r(!1), [P, F] = r(null), [I, L] = r(!1), [R, z] = r(E), [B, V] = r(null), [H, U] = r(null), W = t(async () => {
|
|
21
|
+
N(!0), F(null);
|
|
21
22
|
try {
|
|
22
23
|
let e = await p({
|
|
23
24
|
gateway: "global",
|
|
24
|
-
query:
|
|
25
|
-
authToken:
|
|
25
|
+
query: S,
|
|
26
|
+
authToken: O || void 0
|
|
26
27
|
});
|
|
27
28
|
if (e.errors?.length) throw Error(e.errors[0]?.message ?? "Failed to load stores");
|
|
28
|
-
|
|
29
|
+
j(e.data?.stores ?? []);
|
|
29
30
|
} catch (e) {
|
|
30
|
-
|
|
31
|
+
F(e instanceof Error ? e.message : "Failed to load stores");
|
|
31
32
|
} finally {
|
|
32
|
-
|
|
33
|
+
N(!1);
|
|
33
34
|
}
|
|
34
|
-
}, [
|
|
35
|
+
}, [O]);
|
|
35
36
|
n(() => {
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
let
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
37
|
+
W();
|
|
38
|
+
}, [W]);
|
|
39
|
+
let G = () => {
|
|
40
|
+
V(null), z(E), L(!0);
|
|
41
|
+
}, K = (e) => {
|
|
42
|
+
V(e.id), z({
|
|
42
43
|
slug: e.slug,
|
|
43
44
|
name: e.name,
|
|
44
45
|
type: e.type,
|
|
@@ -48,403 +49,420 @@ var m = "\n query AdminStores {\n stores {\n id\n slug\n name
|
|
|
48
49
|
allowUnverifiedPublishers: e.allowUnverifiedPublishers,
|
|
49
50
|
currency: e.currency,
|
|
50
51
|
description: e.description ?? ""
|
|
51
|
-
}),
|
|
52
|
-
},
|
|
53
|
-
if (!
|
|
54
|
-
|
|
52
|
+
}), L(!0);
|
|
53
|
+
}, q = async () => {
|
|
54
|
+
if (!R.slug.trim() || !R.name.trim()) {
|
|
55
|
+
F("Slug and name are required");
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
+
F(null);
|
|
58
59
|
try {
|
|
59
|
-
|
|
60
|
+
B ? await p({
|
|
60
61
|
gateway: "global",
|
|
61
|
-
query:
|
|
62
|
+
query: w,
|
|
62
63
|
variables: {
|
|
63
|
-
id:
|
|
64
|
+
id: B,
|
|
64
65
|
input: {
|
|
65
|
-
name:
|
|
66
|
-
isPublic:
|
|
67
|
-
requiresApproval:
|
|
68
|
-
allowUnverifiedPublishers:
|
|
69
|
-
currency:
|
|
70
|
-
description:
|
|
66
|
+
name: R.name,
|
|
67
|
+
isPublic: R.isPublic,
|
|
68
|
+
requiresApproval: R.requiresApproval,
|
|
69
|
+
allowUnverifiedPublishers: R.allowUnverifiedPublishers,
|
|
70
|
+
currency: R.currency,
|
|
71
|
+
description: R.description || null
|
|
71
72
|
}
|
|
72
73
|
},
|
|
73
|
-
authToken:
|
|
74
|
+
authToken: O || void 0
|
|
74
75
|
}) : await p({
|
|
75
76
|
gateway: "global",
|
|
76
|
-
query:
|
|
77
|
+
query: C,
|
|
77
78
|
variables: { input: {
|
|
78
|
-
slug:
|
|
79
|
-
name:
|
|
80
|
-
type:
|
|
81
|
-
tenantId:
|
|
82
|
-
isPublic:
|
|
83
|
-
requiresApproval:
|
|
84
|
-
allowUnverifiedPublishers:
|
|
85
|
-
currency:
|
|
86
|
-
description:
|
|
79
|
+
slug: R.slug,
|
|
80
|
+
name: R.name,
|
|
81
|
+
type: R.type,
|
|
82
|
+
tenantId: R.tenantId || null,
|
|
83
|
+
isPublic: R.isPublic,
|
|
84
|
+
requiresApproval: R.requiresApproval,
|
|
85
|
+
allowUnverifiedPublishers: R.allowUnverifiedPublishers,
|
|
86
|
+
currency: R.currency,
|
|
87
|
+
description: R.description || null
|
|
87
88
|
} },
|
|
88
|
-
authToken:
|
|
89
|
-
}),
|
|
89
|
+
authToken: O || void 0
|
|
90
|
+
}), L(!1), V(null), z(E), await W();
|
|
90
91
|
} catch (e) {
|
|
91
|
-
|
|
92
|
+
F(e instanceof Error ? e.message : "Save failed");
|
|
92
93
|
}
|
|
93
|
-
},
|
|
94
|
-
|
|
94
|
+
}, J = async (e) => {
|
|
95
|
+
try {
|
|
95
96
|
await p({
|
|
96
97
|
gateway: "global",
|
|
97
|
-
query:
|
|
98
|
+
query: T,
|
|
98
99
|
variables: { id: e },
|
|
99
|
-
authToken:
|
|
100
|
-
}), await
|
|
100
|
+
authToken: O || void 0
|
|
101
|
+
}), await W();
|
|
101
102
|
} catch (e) {
|
|
102
|
-
|
|
103
|
+
F(e instanceof Error ? e.message : "Delete failed");
|
|
103
104
|
}
|
|
104
105
|
};
|
|
105
106
|
return /* @__PURE__ */ d("div", {
|
|
106
107
|
className: "min-h-screen bg-surface-default",
|
|
107
|
-
children: [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ u("header", {
|
|
110
|
+
className: "border-b border-border-default bg-surface-raised",
|
|
111
|
+
children: /* @__PURE__ */ u("div", {
|
|
112
|
+
className: "mx-auto max-w-7xl px-6 py-4",
|
|
113
|
+
children: /* @__PURE__ */ d("div", {
|
|
114
|
+
className: "flex items-center justify-between",
|
|
115
|
+
children: [/* @__PURE__ */ d("div", {
|
|
116
|
+
className: "flex items-center gap-3",
|
|
117
|
+
children: [/* @__PURE__ */ d("button", {
|
|
118
|
+
type: "button",
|
|
119
|
+
onClick: () => D(`${k}/dashboard`),
|
|
120
|
+
className: "inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-sm text-text-secondary hover:bg-surface-hover hover:text-text-primary",
|
|
121
|
+
children: [/* @__PURE__ */ u(i, { className: "size-4" }), "Back"]
|
|
122
|
+
}), /* @__PURE__ */ d("div", {
|
|
123
|
+
className: "flex items-center gap-2",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ u(c, { className: "size-5 text-text-primary" }),
|
|
126
|
+
/* @__PURE__ */ u("h1", {
|
|
127
|
+
className: "text-xl font-semibold text-text-primary",
|
|
128
|
+
children: "Store registry"
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ u("span", {
|
|
131
|
+
className: "rounded-full bg-surface-accent-muted px-2 py-0.5 text-xs font-medium text-text-accent",
|
|
132
|
+
children: A.length
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})]
|
|
120
136
|
}), /* @__PURE__ */ d("div", {
|
|
121
|
-
className: "flex
|
|
122
|
-
children: [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}), /* @__PURE__ */ d("div", {
|
|
135
|
-
className: "flex gap-2",
|
|
136
|
-
children: [/* @__PURE__ */ d("button", {
|
|
137
|
-
type: "button",
|
|
138
|
-
onClick: () => void P(),
|
|
139
|
-
className: "inline-flex items-center gap-2 rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary hover:bg-surface-hover",
|
|
140
|
-
disabled: w,
|
|
141
|
-
children: [/* @__PURE__ */ u(s, { className: `size-4 ${w ? "animate-spin" : ""}` }), "Refresh"]
|
|
142
|
-
}), /* @__PURE__ */ d("button", {
|
|
143
|
-
type: "button",
|
|
144
|
-
onClick: F,
|
|
145
|
-
className: "inline-flex items-center gap-2 rounded-md bg-surface-accent px-3 py-1.5 text-sm font-medium text-text-on-accent hover:bg-surface-accent-hover",
|
|
146
|
-
children: [/* @__PURE__ */ u(o, { className: "size-4" }), "Create store"]
|
|
137
|
+
className: "flex gap-2",
|
|
138
|
+
children: [/* @__PURE__ */ d("button", {
|
|
139
|
+
type: "button",
|
|
140
|
+
onClick: () => void W(),
|
|
141
|
+
className: "inline-flex items-center gap-2 rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary hover:bg-surface-hover",
|
|
142
|
+
disabled: M,
|
|
143
|
+
children: [/* @__PURE__ */ u(s, { className: `size-4 ${M ? "animate-spin" : ""}` }), "Refresh"]
|
|
144
|
+
}), /* @__PURE__ */ d("button", {
|
|
145
|
+
type: "button",
|
|
146
|
+
onClick: G,
|
|
147
|
+
className: "inline-flex items-center gap-2 rounded-md bg-surface-accent px-3 py-1.5 text-sm font-medium text-text-on-accent hover:bg-surface-accent-hover",
|
|
148
|
+
children: [/* @__PURE__ */ u(o, { className: "size-4" }), "Create store"]
|
|
149
|
+
})]
|
|
147
150
|
})]
|
|
148
|
-
})
|
|
151
|
+
})
|
|
149
152
|
})
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}),
|
|
182
|
-
disabled: !!M,
|
|
183
|
-
required: !0,
|
|
184
|
-
"aria-required": "true",
|
|
185
|
-
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary disabled:opacity-60"
|
|
186
|
-
})]
|
|
187
|
-
}),
|
|
188
|
-
/* @__PURE__ */ d("label", {
|
|
189
|
-
className: "block",
|
|
190
|
-
children: [/* @__PURE__ */ u("span", {
|
|
191
|
-
className: "text-xs text-text-secondary",
|
|
192
|
-
children: "Name"
|
|
193
|
-
}), /* @__PURE__ */ u("input", {
|
|
194
|
-
type: "text",
|
|
195
|
-
"aria-label": "Name",
|
|
196
|
-
value: A.name,
|
|
197
|
-
onChange: (e) => j({
|
|
198
|
-
...A,
|
|
199
|
-
name: e.target.value
|
|
200
|
-
}),
|
|
201
|
-
required: !0,
|
|
202
|
-
"aria-required": "true",
|
|
203
|
-
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary"
|
|
204
|
-
})]
|
|
205
|
-
}),
|
|
206
|
-
/* @__PURE__ */ d("label", {
|
|
207
|
-
className: "block",
|
|
208
|
-
children: [/* @__PURE__ */ u("span", {
|
|
209
|
-
className: "text-xs text-text-secondary",
|
|
210
|
-
children: "Type"
|
|
211
|
-
}), /* @__PURE__ */ d("select", {
|
|
212
|
-
"aria-label": "Store type",
|
|
213
|
-
value: A.type,
|
|
214
|
-
onChange: (e) => j({
|
|
215
|
-
...A,
|
|
216
|
-
type: e.target.value
|
|
217
|
-
}),
|
|
218
|
-
disabled: !!M,
|
|
219
|
-
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary disabled:opacity-60",
|
|
220
|
-
children: [
|
|
221
|
-
/* @__PURE__ */ u("option", {
|
|
222
|
-
value: "PUBLIC",
|
|
223
|
-
children: "Public"
|
|
153
|
+
}),
|
|
154
|
+
/* @__PURE__ */ d("main", {
|
|
155
|
+
className: "mx-auto max-w-7xl p-6",
|
|
156
|
+
children: [
|
|
157
|
+
P && /* @__PURE__ */ u("div", {
|
|
158
|
+
role: "alert",
|
|
159
|
+
className: "mb-4 rounded-md border border-border-danger bg-surface-danger-muted px-4 py-3 text-sm text-text-danger",
|
|
160
|
+
children: P
|
|
161
|
+
}),
|
|
162
|
+
I && /* @__PURE__ */ d("div", {
|
|
163
|
+
className: "mb-6 rounded-lg border border-border-default bg-surface-raised p-4",
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ u("h2", {
|
|
166
|
+
className: "mb-3 text-sm font-semibold text-text-primary",
|
|
167
|
+
children: B ? "Edit store" : "Create store"
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ d("div", {
|
|
170
|
+
className: "grid grid-cols-1 gap-3 md:grid-cols-2",
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ d("label", {
|
|
173
|
+
className: "block",
|
|
174
|
+
children: [/* @__PURE__ */ u("span", {
|
|
175
|
+
className: "text-xs text-text-secondary",
|
|
176
|
+
children: "Slug"
|
|
177
|
+
}), /* @__PURE__ */ u("input", {
|
|
178
|
+
type: "text",
|
|
179
|
+
"aria-label": "Slug",
|
|
180
|
+
value: R.slug,
|
|
181
|
+
onChange: (e) => z({
|
|
182
|
+
...R,
|
|
183
|
+
slug: e.target.value
|
|
224
184
|
}),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
185
|
+
disabled: !!B,
|
|
186
|
+
required: !0,
|
|
187
|
+
"aria-required": "true",
|
|
188
|
+
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary disabled:opacity-60"
|
|
189
|
+
})]
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ d("label", {
|
|
192
|
+
className: "block",
|
|
193
|
+
children: [/* @__PURE__ */ u("span", {
|
|
194
|
+
className: "text-xs text-text-secondary",
|
|
195
|
+
children: "Name"
|
|
196
|
+
}), /* @__PURE__ */ u("input", {
|
|
197
|
+
type: "text",
|
|
198
|
+
"aria-label": "Name",
|
|
199
|
+
value: R.name,
|
|
200
|
+
onChange: (e) => z({
|
|
201
|
+
...R,
|
|
202
|
+
name: e.target.value
|
|
203
|
+
}),
|
|
204
|
+
required: !0,
|
|
205
|
+
"aria-required": "true",
|
|
206
|
+
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary"
|
|
207
|
+
})]
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ d("label", {
|
|
210
|
+
className: "block",
|
|
211
|
+
children: [/* @__PURE__ */ u("span", {
|
|
212
|
+
className: "text-xs text-text-secondary",
|
|
213
|
+
children: "Type"
|
|
214
|
+
}), /* @__PURE__ */ d("select", {
|
|
215
|
+
"aria-label": "Store type",
|
|
216
|
+
value: R.type,
|
|
217
|
+
onChange: (e) => z({
|
|
218
|
+
...R,
|
|
219
|
+
type: e.target.value
|
|
220
|
+
}),
|
|
221
|
+
disabled: !!B,
|
|
222
|
+
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary disabled:opacity-60",
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ u("option", {
|
|
225
|
+
value: "PUBLIC",
|
|
226
|
+
children: "Public"
|
|
227
|
+
}),
|
|
228
|
+
/* @__PURE__ */ u("option", {
|
|
229
|
+
value: "PRIVATE",
|
|
230
|
+
children: "Private (opt-in)"
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ u("option", {
|
|
233
|
+
value: "ENTERPRISE",
|
|
234
|
+
children: "Enterprise (tenant-scoped)"
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
})]
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ d("label", {
|
|
240
|
+
className: "block",
|
|
241
|
+
children: [/* @__PURE__ */ u("span", {
|
|
242
|
+
className: "text-xs text-text-secondary",
|
|
243
|
+
children: "Currency"
|
|
244
|
+
}), /* @__PURE__ */ u("input", {
|
|
245
|
+
type: "text",
|
|
246
|
+
"aria-label": "Currency",
|
|
247
|
+
value: R.currency,
|
|
248
|
+
onChange: (e) => z({
|
|
249
|
+
...R,
|
|
250
|
+
currency: e.target.value
|
|
251
|
+
}),
|
|
252
|
+
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary"
|
|
253
|
+
})]
|
|
254
|
+
}),
|
|
255
|
+
R.type !== "PUBLIC" && /* @__PURE__ */ d("label", {
|
|
256
|
+
className: "block md:col-span-2",
|
|
257
|
+
children: [/* @__PURE__ */ u("span", {
|
|
258
|
+
className: "text-xs text-text-secondary",
|
|
259
|
+
children: "Tenant ID (optional)"
|
|
260
|
+
}), /* @__PURE__ */ u("input", {
|
|
261
|
+
type: "text",
|
|
262
|
+
"aria-label": "Tenant ID",
|
|
263
|
+
value: R.tenantId,
|
|
264
|
+
onChange: (e) => z({
|
|
265
|
+
...R,
|
|
266
|
+
tenantId: e.target.value
|
|
228
267
|
}),
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
268
|
+
disabled: !!B,
|
|
269
|
+
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary disabled:opacity-60"
|
|
270
|
+
})]
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ d("label", {
|
|
273
|
+
className: "block md:col-span-2",
|
|
274
|
+
children: [/* @__PURE__ */ u("span", {
|
|
275
|
+
className: "text-xs text-text-secondary",
|
|
276
|
+
children: "Description"
|
|
277
|
+
}), /* @__PURE__ */ u("textarea", {
|
|
278
|
+
"aria-label": "Description",
|
|
279
|
+
value: R.description,
|
|
280
|
+
onChange: (e) => z({
|
|
281
|
+
...R,
|
|
282
|
+
description: e.target.value
|
|
283
|
+
}),
|
|
284
|
+
rows: 2,
|
|
285
|
+
className: "mt-1 w-full rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary"
|
|
286
|
+
})]
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ d("label", {
|
|
289
|
+
className: "flex items-center gap-2",
|
|
290
|
+
children: [/* @__PURE__ */ u("input", {
|
|
291
|
+
type: "checkbox",
|
|
292
|
+
"aria-label": "Publicly visible",
|
|
293
|
+
checked: R.isPublic,
|
|
294
|
+
onChange: (e) => z({
|
|
295
|
+
...R,
|
|
296
|
+
isPublic: e.target.checked
|
|
232
297
|
})
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
className: "
|
|
240
|
-
children: "
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}),
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
})
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
})
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
/* @__PURE__ */ d("
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
"aria-label": "Requires admin approval",
|
|
305
|
-
checked: A.requiresApproval,
|
|
306
|
-
onChange: (e) => j({
|
|
307
|
-
...A,
|
|
308
|
-
requiresApproval: e.target.checked
|
|
309
|
-
})
|
|
310
|
-
}), /* @__PURE__ */ u("span", {
|
|
311
|
-
className: "text-sm text-text-primary",
|
|
312
|
-
children: "Requires admin approval"
|
|
313
|
-
})]
|
|
314
|
-
}),
|
|
315
|
-
/* @__PURE__ */ d("label", {
|
|
316
|
-
className: "flex items-center gap-2 md:col-span-2",
|
|
317
|
-
children: [/* @__PURE__ */ u("input", {
|
|
318
|
-
type: "checkbox",
|
|
319
|
-
"aria-label": "Allow unverified publishers to submit",
|
|
320
|
-
checked: A.allowUnverifiedPublishers,
|
|
321
|
-
onChange: (e) => j({
|
|
322
|
-
...A,
|
|
323
|
-
allowUnverifiedPublishers: e.target.checked
|
|
324
|
-
})
|
|
325
|
-
}), /* @__PURE__ */ u("span", {
|
|
326
|
-
className: "text-sm text-text-primary",
|
|
327
|
-
children: "Allow unverified publishers to submit"
|
|
328
|
-
})]
|
|
329
|
-
})
|
|
330
|
-
]
|
|
331
|
-
}),
|
|
332
|
-
/* @__PURE__ */ d("div", {
|
|
333
|
-
className: "mt-4 flex justify-end gap-2",
|
|
334
|
-
children: [/* @__PURE__ */ u("button", {
|
|
335
|
-
type: "button",
|
|
336
|
-
onClick: () => {
|
|
337
|
-
k(!1), N(null), j(v);
|
|
338
|
-
},
|
|
339
|
-
className: "rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary hover:bg-surface-hover",
|
|
340
|
-
children: "Cancel"
|
|
341
|
-
}), /* @__PURE__ */ u("button", {
|
|
342
|
-
type: "button",
|
|
343
|
-
onClick: () => void L(),
|
|
344
|
-
className: "rounded-md bg-surface-accent px-3 py-1.5 text-sm font-medium text-text-on-accent hover:bg-surface-accent-hover",
|
|
345
|
-
children: M ? "Save changes" : "Create"
|
|
346
|
-
})]
|
|
347
|
-
})
|
|
348
|
-
]
|
|
349
|
-
}),
|
|
350
|
-
w && S.length === 0 ? /* @__PURE__ */ u("output", {
|
|
351
|
-
className: "block py-16 text-center text-text-secondary",
|
|
352
|
-
children: "Loading stores…"
|
|
353
|
-
}) : S.length === 0 ? /* @__PURE__ */ u("div", {
|
|
354
|
-
className: "py-16 text-center text-text-secondary",
|
|
355
|
-
children: "No stores yet."
|
|
356
|
-
}) : /* @__PURE__ */ u("div", {
|
|
357
|
-
className: "overflow-hidden rounded-lg border border-border-default",
|
|
358
|
-
children: /* @__PURE__ */ d("table", {
|
|
359
|
-
className: "w-full text-sm",
|
|
360
|
-
children: [/* @__PURE__ */ u("thead", {
|
|
361
|
-
className: "bg-surface-muted text-left text-xs uppercase tracking-wide text-text-secondary",
|
|
362
|
-
children: /* @__PURE__ */ d("tr", { children: [
|
|
363
|
-
/* @__PURE__ */ u("th", {
|
|
364
|
-
className: "px-4 py-2",
|
|
365
|
-
children: "Slug"
|
|
366
|
-
}),
|
|
367
|
-
/* @__PURE__ */ u("th", {
|
|
368
|
-
className: "px-4 py-2",
|
|
369
|
-
children: "Name"
|
|
370
|
-
}),
|
|
371
|
-
/* @__PURE__ */ u("th", {
|
|
372
|
-
className: "px-4 py-2",
|
|
373
|
-
children: "Type"
|
|
374
|
-
}),
|
|
375
|
-
/* @__PURE__ */ u("th", {
|
|
376
|
-
className: "px-4 py-2",
|
|
377
|
-
children: "Public"
|
|
378
|
-
}),
|
|
379
|
-
/* @__PURE__ */ u("th", {
|
|
380
|
-
className: "px-4 py-2",
|
|
381
|
-
children: "Approval"
|
|
382
|
-
}),
|
|
383
|
-
/* @__PURE__ */ u("th", {
|
|
384
|
-
className: "px-4 py-2",
|
|
385
|
-
children: "Currency"
|
|
386
|
-
}),
|
|
387
|
-
/* @__PURE__ */ u("th", {
|
|
388
|
-
className: "px-4 py-2 text-right",
|
|
389
|
-
children: "Actions"
|
|
390
|
-
})
|
|
391
|
-
] })
|
|
392
|
-
}), /* @__PURE__ */ u("tbody", {
|
|
393
|
-
className: "divide-y divide-border-default bg-surface-raised",
|
|
394
|
-
children: S.map((e) => /* @__PURE__ */ d("tr", {
|
|
395
|
-
className: "text-text-primary",
|
|
396
|
-
children: [
|
|
397
|
-
/* @__PURE__ */ u("td", {
|
|
398
|
-
className: "px-4 py-2 font-mono text-xs",
|
|
399
|
-
children: e.slug
|
|
298
|
+
}), /* @__PURE__ */ u("span", {
|
|
299
|
+
className: "text-sm text-text-primary",
|
|
300
|
+
children: "Publicly visible"
|
|
301
|
+
})]
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ d("label", {
|
|
304
|
+
className: "flex items-center gap-2",
|
|
305
|
+
children: [/* @__PURE__ */ u("input", {
|
|
306
|
+
type: "checkbox",
|
|
307
|
+
"aria-label": "Requires admin approval",
|
|
308
|
+
checked: R.requiresApproval,
|
|
309
|
+
onChange: (e) => z({
|
|
310
|
+
...R,
|
|
311
|
+
requiresApproval: e.target.checked
|
|
312
|
+
})
|
|
313
|
+
}), /* @__PURE__ */ u("span", {
|
|
314
|
+
className: "text-sm text-text-primary",
|
|
315
|
+
children: "Requires admin approval"
|
|
316
|
+
})]
|
|
317
|
+
}),
|
|
318
|
+
/* @__PURE__ */ d("label", {
|
|
319
|
+
className: "flex items-center gap-2 md:col-span-2",
|
|
320
|
+
children: [/* @__PURE__ */ u("input", {
|
|
321
|
+
type: "checkbox",
|
|
322
|
+
"aria-label": "Allow unverified publishers to submit",
|
|
323
|
+
checked: R.allowUnverifiedPublishers,
|
|
324
|
+
onChange: (e) => z({
|
|
325
|
+
...R,
|
|
326
|
+
allowUnverifiedPublishers: e.target.checked
|
|
327
|
+
})
|
|
328
|
+
}), /* @__PURE__ */ u("span", {
|
|
329
|
+
className: "text-sm text-text-primary",
|
|
330
|
+
children: "Allow unverified publishers to submit"
|
|
331
|
+
})]
|
|
332
|
+
})
|
|
333
|
+
]
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ d("div", {
|
|
336
|
+
className: "mt-4 flex justify-end gap-2",
|
|
337
|
+
children: [/* @__PURE__ */ u("button", {
|
|
338
|
+
type: "button",
|
|
339
|
+
onClick: () => {
|
|
340
|
+
L(!1), V(null), z(E);
|
|
341
|
+
},
|
|
342
|
+
className: "rounded-md border border-border-default bg-surface-default px-3 py-1.5 text-sm text-text-primary hover:bg-surface-hover",
|
|
343
|
+
children: "Cancel"
|
|
344
|
+
}), /* @__PURE__ */ u("button", {
|
|
345
|
+
type: "button",
|
|
346
|
+
onClick: () => void q(),
|
|
347
|
+
className: "rounded-md bg-surface-accent px-3 py-1.5 text-sm font-medium text-text-on-accent hover:bg-surface-accent-hover",
|
|
348
|
+
children: B ? "Save changes" : "Create"
|
|
349
|
+
})]
|
|
350
|
+
})
|
|
351
|
+
]
|
|
352
|
+
}),
|
|
353
|
+
M && A.length === 0 ? /* @__PURE__ */ u("output", {
|
|
354
|
+
className: "block py-16 text-center text-text-secondary",
|
|
355
|
+
children: "Loading stores…"
|
|
356
|
+
}) : A.length === 0 ? /* @__PURE__ */ u("div", {
|
|
357
|
+
className: "py-16 text-center text-text-secondary",
|
|
358
|
+
children: "No stores yet."
|
|
359
|
+
}) : /* @__PURE__ */ u("div", {
|
|
360
|
+
className: "overflow-hidden rounded-lg border border-border-default",
|
|
361
|
+
children: /* @__PURE__ */ d("table", {
|
|
362
|
+
className: "w-full text-sm",
|
|
363
|
+
children: [/* @__PURE__ */ u("thead", {
|
|
364
|
+
className: "bg-surface-muted text-left text-xs uppercase tracking-wide text-text-secondary",
|
|
365
|
+
children: /* @__PURE__ */ d("tr", { children: [
|
|
366
|
+
/* @__PURE__ */ u("th", {
|
|
367
|
+
className: "px-4 py-2",
|
|
368
|
+
children: "Slug"
|
|
400
369
|
}),
|
|
401
|
-
/* @__PURE__ */ u("
|
|
370
|
+
/* @__PURE__ */ u("th", {
|
|
402
371
|
className: "px-4 py-2",
|
|
403
|
-
children:
|
|
372
|
+
children: "Name"
|
|
404
373
|
}),
|
|
405
|
-
/* @__PURE__ */ u("
|
|
374
|
+
/* @__PURE__ */ u("th", {
|
|
406
375
|
className: "px-4 py-2",
|
|
407
|
-
children:
|
|
408
|
-
className: "rounded-full bg-surface-accent-muted px-2 py-0.5 text-xs font-medium text-text-accent",
|
|
409
|
-
children: e.type
|
|
410
|
-
})
|
|
376
|
+
children: "Type"
|
|
411
377
|
}),
|
|
412
|
-
/* @__PURE__ */ u("
|
|
413
|
-
className: "px-4 py-2
|
|
414
|
-
children:
|
|
378
|
+
/* @__PURE__ */ u("th", {
|
|
379
|
+
className: "px-4 py-2",
|
|
380
|
+
children: "Public"
|
|
415
381
|
}),
|
|
416
|
-
/* @__PURE__ */ u("
|
|
417
|
-
className: "px-4 py-2
|
|
418
|
-
children:
|
|
382
|
+
/* @__PURE__ */ u("th", {
|
|
383
|
+
className: "px-4 py-2",
|
|
384
|
+
children: "Approval"
|
|
419
385
|
}),
|
|
420
|
-
/* @__PURE__ */ u("
|
|
421
|
-
className: "px-4 py-2
|
|
422
|
-
children:
|
|
386
|
+
/* @__PURE__ */ u("th", {
|
|
387
|
+
className: "px-4 py-2",
|
|
388
|
+
children: "Currency"
|
|
423
389
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ u("th", {
|
|
425
391
|
className: "px-4 py-2 text-right",
|
|
426
|
-
children:
|
|
427
|
-
type: "button",
|
|
428
|
-
onClick: () => I(e),
|
|
429
|
-
className: "inline-flex items-center gap-1 rounded-md border border-border-default px-2 py-1 text-xs text-text-primary hover:bg-surface-hover",
|
|
430
|
-
children: [/* @__PURE__ */ u(a, { className: "size-3" }), "Edit"]
|
|
431
|
-
}), e.id !== "store_public_default" && /* @__PURE__ */ d("button", {
|
|
432
|
-
type: "button",
|
|
433
|
-
onClick: () => void R(e.id),
|
|
434
|
-
className: "ml-2 inline-flex items-center gap-1 rounded-md border border-border-danger px-2 py-1 text-xs text-text-danger hover:bg-surface-danger-muted",
|
|
435
|
-
children: [/* @__PURE__ */ u(l, { className: "size-3" }), "Delete"]
|
|
436
|
-
})]
|
|
392
|
+
children: "Actions"
|
|
437
393
|
})
|
|
438
|
-
]
|
|
439
|
-
},
|
|
440
|
-
|
|
394
|
+
] })
|
|
395
|
+
}), /* @__PURE__ */ u("tbody", {
|
|
396
|
+
className: "divide-y divide-border-default bg-surface-raised",
|
|
397
|
+
children: A.map((e) => /* @__PURE__ */ d("tr", {
|
|
398
|
+
className: "text-text-primary",
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ u("td", {
|
|
401
|
+
className: "px-4 py-2 font-mono text-xs",
|
|
402
|
+
children: e.slug
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ u("td", {
|
|
405
|
+
className: "px-4 py-2",
|
|
406
|
+
children: e.name
|
|
407
|
+
}),
|
|
408
|
+
/* @__PURE__ */ u("td", {
|
|
409
|
+
className: "px-4 py-2",
|
|
410
|
+
children: /* @__PURE__ */ u("span", {
|
|
411
|
+
className: "rounded-full bg-surface-accent-muted px-2 py-0.5 text-xs font-medium text-text-accent",
|
|
412
|
+
children: e.type
|
|
413
|
+
})
|
|
414
|
+
}),
|
|
415
|
+
/* @__PURE__ */ u("td", {
|
|
416
|
+
className: "px-4 py-2 text-xs",
|
|
417
|
+
children: e.isPublic ? "Yes" : "No"
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ u("td", {
|
|
420
|
+
className: "px-4 py-2 text-xs",
|
|
421
|
+
children: e.requiresApproval ? "Required" : "Auto-publish"
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ u("td", {
|
|
424
|
+
className: "px-4 py-2 text-xs",
|
|
425
|
+
children: e.currency
|
|
426
|
+
}),
|
|
427
|
+
/* @__PURE__ */ d("td", {
|
|
428
|
+
className: "px-4 py-2 text-right",
|
|
429
|
+
children: [/* @__PURE__ */ d("button", {
|
|
430
|
+
type: "button",
|
|
431
|
+
onClick: () => K(e),
|
|
432
|
+
className: "inline-flex items-center gap-1 rounded-md border border-border-default px-2 py-1 text-xs text-text-primary hover:bg-surface-hover",
|
|
433
|
+
children: [/* @__PURE__ */ u(a, { className: "size-3" }), "Edit"]
|
|
434
|
+
}), e.id !== "store_public_default" && /* @__PURE__ */ d("button", {
|
|
435
|
+
type: "button",
|
|
436
|
+
onClick: () => U(e.id),
|
|
437
|
+
className: "ml-2 inline-flex items-center gap-1 rounded-md border border-border-danger px-2 py-1 text-xs text-text-danger hover:bg-surface-danger-muted",
|
|
438
|
+
children: [/* @__PURE__ */ u(l, { className: "size-3" }), "Delete"]
|
|
439
|
+
})]
|
|
440
|
+
})
|
|
441
|
+
]
|
|
442
|
+
}, e.id))
|
|
443
|
+
})]
|
|
444
|
+
})
|
|
441
445
|
})
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
446
|
+
]
|
|
447
|
+
}),
|
|
448
|
+
/* @__PURE__ */ u(m, {
|
|
449
|
+
open: H !== null,
|
|
450
|
+
onOpenChange: (e) => !e && U(null),
|
|
451
|
+
children: /* @__PURE__ */ d(_, { children: [/* @__PURE__ */ d(b, { children: [/* @__PURE__ */ u(x, { children: "Delete this store?" }), /* @__PURE__ */ u(v, { children: "This is a soft delete." })] }), /* @__PURE__ */ d(y, { children: [/* @__PURE__ */ u(g, {
|
|
452
|
+
onClick: () => U(null),
|
|
453
|
+
children: "Cancel"
|
|
454
|
+
}), /* @__PURE__ */ u(h, {
|
|
455
|
+
className: "bg-surface-danger text-text-on-danger hover:bg-surface-danger-hover",
|
|
456
|
+
onClick: () => {
|
|
457
|
+
H && J(H), U(null);
|
|
458
|
+
},
|
|
459
|
+
children: "Delete"
|
|
460
|
+
})] })] })
|
|
461
|
+
})
|
|
462
|
+
]
|
|
445
463
|
});
|
|
446
464
|
};
|
|
447
465
|
//#endregion
|
|
448
|
-
export {
|
|
466
|
+
export { D as AdminStoresPage };
|
|
449
467
|
|
|
450
468
|
//# sourceMappingURL=AdminStoresPage.js.map
|