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