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