@burdenoff/microfe-devportal 2026.1112.2 → 2026.1113.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/devportal/components/AppCard.js +73 -70
- package/dist/devportal/components/AppCard.js.map +1 -1
- package/dist/devportal/components/ImageUploadField.js +82 -80
- package/dist/devportal/components/ImageUploadField.js.map +1 -1
- package/dist/devportal/components/StoreImage.d.ts +15 -0
- package/dist/devportal/components/StoreImage.js +30 -0
- package/dist/devportal/components/StoreImage.js.map +1 -0
- package/dist/devportal/components/index.d.ts +1 -0
- package/dist/devportal/components/index.js +17 -16
- package/dist/devportal/hooks/usePackageUpload.d.ts +46 -4
- package/dist/devportal/hooks/usePackageUpload.js +90 -36
- package/dist/devportal/hooks/usePackageUpload.js.map +1 -1
- package/dist/devportal/pages/AdminReviewPage.js +205 -202
- package/dist/devportal/pages/AdminReviewPage.js.map +1 -1
- package/dist/devportal/pages/ApplicationDetailPage.js +2 -2
- package/dist/devportal/pages/ApplicationDetailPage.js.map +1 -1
- package/dist/devportal/pages/ApplicationsPage.js +201 -199
- package/dist/devportal/pages/ApplicationsPage.js.map +1 -1
- package/dist/devportal/pages/CreatePhysicalItemPage.js +2 -2
- package/dist/devportal/pages/CreatePhysicalItemPage.js.map +1 -1
- package/dist/devportal/pages/EditPhysicalItemPage.js +312 -307
- package/dist/devportal/pages/EditPhysicalItemPage.js.map +1 -1
- package/dist/devportal/pages/ListingPreviewPage.js +175 -171
- package/dist/devportal/pages/ListingPreviewPage.js.map +1 -1
- package/dist/devportal/pages/SellerDashboardPage.js +118 -116
- package/dist/devportal/pages/SellerDashboardPage.js.map +1 -1
- package/dist/devportal/pages/SellerItemsPage.js +202 -199
- package/dist/devportal/pages/SellerItemsPage.js.map +1 -1
- package/dist/devportal/pages/StoreSubmissionPage.js +133 -131
- package/dist/devportal/pages/StoreSubmissionPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { PageLayout as e } from "../components/PageLayout.js";
|
|
2
2
|
import { EmptyState as t } from "../components/EmptyState.js";
|
|
3
3
|
import { useDevportal as n } from "../providers/DevportalProvider.js";
|
|
4
|
-
import { PermissionGuard as r } from "../components/PermissionGuard.js";
|
|
5
4
|
import "../components/index.js";
|
|
6
|
-
import {
|
|
5
|
+
import { PermissionGuard as ee } from "../components/PermissionGuard.js";
|
|
6
|
+
import { resolveGlobalGraphqlEndpoint as r } from "../utils/graphqlEndpoint.js";
|
|
7
|
+
import { StoreImage as i } from "../components/StoreImage.js";
|
|
7
8
|
import { useEffect as a, useMemo as o, useState as s } from "react";
|
|
8
|
-
import { AlertCircle as c, Edit as l, Grid as u, List as
|
|
9
|
-
import { jsx as
|
|
10
|
-
import { useI18n as
|
|
11
|
-
import { EmphasisPanel as
|
|
9
|
+
import { AlertCircle as c, Edit as l, Grid as u, List as d, Loader2 as f, Package as p, Plus as m, Search as h, Tag as g } from "lucide-react";
|
|
10
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
11
|
+
import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
|
+
import { EmphasisPanel as ne, GlassCard as y } from "@burdenoff/fe-libs/ui";
|
|
12
13
|
// src/devportal/pages/SellerItemsPage.tsx
|
|
13
|
-
var
|
|
14
|
+
var re = /* @__PURE__ */ new Set([
|
|
14
15
|
"APP",
|
|
15
16
|
"NODE",
|
|
16
17
|
"WORKFLOW"
|
|
17
|
-
]),
|
|
18
|
+
]), b = {
|
|
18
19
|
MERCHANDISE: "Merchandise",
|
|
19
20
|
HARDWARE: "Hardware",
|
|
20
21
|
ACCESSORY: "Accessory",
|
|
@@ -23,7 +24,7 @@ var x = /* @__PURE__ */ new Set([
|
|
|
23
24
|
APPAREL: "Apparel",
|
|
24
25
|
COLLECTIBLE: "Collectible",
|
|
25
26
|
CONSUMABLE: "Consumable"
|
|
26
|
-
},
|
|
27
|
+
}, x = {
|
|
27
28
|
PUBLISHED: {
|
|
28
29
|
label: "Published",
|
|
29
30
|
className: "text-status-success-text bg-status-success-bg-subtle"
|
|
@@ -44,7 +45,7 @@ var x = /* @__PURE__ */ new Set([
|
|
|
44
45
|
label: "Inactive",
|
|
45
46
|
className: "text-text-muted bg-bg-muted"
|
|
46
47
|
}
|
|
47
|
-
},
|
|
48
|
+
}, S = [
|
|
48
49
|
{
|
|
49
50
|
value: "",
|
|
50
51
|
label: "All Status"
|
|
@@ -70,7 +71,7 @@ var x = /* @__PURE__ */ new Set([
|
|
|
70
71
|
label: "Inactive"
|
|
71
72
|
}
|
|
72
73
|
];
|
|
73
|
-
function
|
|
74
|
+
function C(e, t) {
|
|
74
75
|
let n = t || "USD";
|
|
75
76
|
return `${new Intl.NumberFormat("en-US", {
|
|
76
77
|
style: "currency",
|
|
@@ -79,60 +80,60 @@ function w(e, t) {
|
|
|
79
80
|
maximumFractionDigits: 2
|
|
80
81
|
}).format(e)} ${n}`;
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
return
|
|
83
|
+
function w(e) {
|
|
84
|
+
return b[e] ?? e.replace(/_/g, " ");
|
|
84
85
|
}
|
|
85
|
-
var
|
|
86
|
-
let { navigate:
|
|
87
|
-
let n =
|
|
86
|
+
var T = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\n", E = "\n query SellerItems($publisherId: String!) {\n products(filter: { publisherId: $publisherId, nature: PHYSICAL }, limit: 100, offset: 0) {\n id\n name\n slug\n type\n status\n price\n currency\n stockQuantity\n sku\n brand\n icon\n createdAt\n }\n }\n", D = () => {
|
|
87
|
+
let { navigate: g, basePath: b, apiGatewayUrl: D, authToken: k } = n(), { t: A } = te(), j = (e, t) => {
|
|
88
|
+
let n = A(e);
|
|
88
89
|
return n === e ? t : n;
|
|
89
|
-
},
|
|
90
|
-
|
|
90
|
+
}, M = r(D), [N, P] = s(!0), [F, I] = s(!1), [L, R] = s(null), [z, B] = s([]), [V, H] = s(null), [U, W] = s(0), [G, K] = s("grid"), [q, J] = s(""), [Y, ie] = s(""), X = (e) => {
|
|
91
|
+
g?.(`${b}${e}`);
|
|
91
92
|
};
|
|
92
93
|
a(() => {
|
|
93
94
|
let e = !1;
|
|
94
|
-
return
|
|
95
|
+
return P(!0), H(null), (async () => {
|
|
95
96
|
try {
|
|
96
|
-
let t = await fetch(
|
|
97
|
+
let t = await fetch(M, {
|
|
97
98
|
method: "POST",
|
|
98
99
|
headers: {
|
|
99
100
|
"Content-Type": "application/json",
|
|
100
|
-
Authorization: `Bearer ${
|
|
101
|
+
Authorization: `Bearer ${k ?? ""}`
|
|
101
102
|
},
|
|
102
|
-
body: JSON.stringify({ query:
|
|
103
|
+
body: JSON.stringify({ query: T })
|
|
103
104
|
});
|
|
104
105
|
if (e) return;
|
|
105
106
|
if (!t.ok) throw Error(`Request failed with status ${t.status}`);
|
|
106
107
|
let n = await t.json();
|
|
107
108
|
if (e) return;
|
|
108
109
|
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Unknown GraphQL error");
|
|
109
|
-
|
|
110
|
+
R(n.data?.myPublisher?.id ?? null);
|
|
110
111
|
} catch (t) {
|
|
111
|
-
e ||
|
|
112
|
+
e || H(t instanceof Error ? t.message : "Failed to load publisher");
|
|
112
113
|
} finally {
|
|
113
|
-
e ||
|
|
114
|
+
e || P(!1);
|
|
114
115
|
}
|
|
115
116
|
})(), () => {
|
|
116
117
|
e = !0;
|
|
117
118
|
};
|
|
118
119
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
M,
|
|
121
|
+
k,
|
|
122
|
+
U
|
|
122
123
|
]), a(() => {
|
|
123
|
-
if (!
|
|
124
|
+
if (!L) return;
|
|
124
125
|
let e = !1;
|
|
125
|
-
return
|
|
126
|
+
return I(!0), H(null), (async () => {
|
|
126
127
|
try {
|
|
127
|
-
let t = await fetch(
|
|
128
|
+
let t = await fetch(M, {
|
|
128
129
|
method: "POST",
|
|
129
130
|
headers: {
|
|
130
131
|
"Content-Type": "application/json",
|
|
131
|
-
Authorization: `Bearer ${
|
|
132
|
+
Authorization: `Bearer ${k ?? ""}`
|
|
132
133
|
},
|
|
133
134
|
body: JSON.stringify({
|
|
134
|
-
query:
|
|
135
|
-
variables: { publisherId:
|
|
135
|
+
query: E,
|
|
136
|
+
variables: { publisherId: L }
|
|
136
137
|
})
|
|
137
138
|
});
|
|
138
139
|
if (e) return;
|
|
@@ -140,30 +141,30 @@ var E = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\
|
|
|
140
141
|
let n = await t.json();
|
|
141
142
|
if (e) return;
|
|
142
143
|
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Unknown GraphQL error");
|
|
143
|
-
|
|
144
|
+
B((n.data?.products ?? []).map((e) => ({
|
|
144
145
|
...e,
|
|
145
146
|
status: e.status
|
|
146
147
|
})));
|
|
147
148
|
} catch (t) {
|
|
148
|
-
e ||
|
|
149
|
+
e || H(t instanceof Error ? t.message : "Failed to load items");
|
|
149
150
|
} finally {
|
|
150
|
-
e ||
|
|
151
|
+
e || I(!1);
|
|
151
152
|
}
|
|
152
153
|
})(), () => {
|
|
153
154
|
e = !0;
|
|
154
155
|
};
|
|
155
156
|
}, [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
L,
|
|
158
|
+
M,
|
|
159
|
+
k,
|
|
160
|
+
U
|
|
160
161
|
]);
|
|
161
|
-
let Z = o(() =>
|
|
162
|
-
let t = !
|
|
162
|
+
let Z = o(() => z.filter((e) => !re.has(e.type)), [z]), Q = o(() => Z.filter((e) => {
|
|
163
|
+
let t = !q || e.name.toLowerCase().includes(q.toLowerCase()), n = !Y || e.status === Y;
|
|
163
164
|
return t && n;
|
|
164
165
|
}), [
|
|
165
166
|
Z,
|
|
166
|
-
|
|
167
|
+
q,
|
|
167
168
|
Y
|
|
168
169
|
]), $ = o(() => ({
|
|
169
170
|
total: Z.length,
|
|
@@ -171,148 +172,148 @@ var E = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\
|
|
|
171
172
|
pendingReview: Z.filter((e) => e.status === "PENDING_REVIEW").length,
|
|
172
173
|
outOfStock: Z.filter((e) => e.stockQuantity === 0).length
|
|
173
174
|
}), [Z]);
|
|
174
|
-
if (
|
|
175
|
-
title:
|
|
176
|
-
description:
|
|
177
|
-
children: /* @__PURE__ */
|
|
175
|
+
if (N && z.length === 0 && !V) return /* @__PURE__ */ _(e, {
|
|
176
|
+
title: j("devportal.myItems", "My Items"),
|
|
177
|
+
description: j("devportal.manageYourPhysicalProductListings", "Manage your physical product listings."),
|
|
178
|
+
children: /* @__PURE__ */ v("div", {
|
|
178
179
|
className: "flex items-center justify-center py-12",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [/* @__PURE__ */ _(f, { className: "h-8 w-8 animate-spin text-text-secondary" }), /* @__PURE__ */ _("span", {
|
|
180
181
|
className: "ml-2 text-text-secondary",
|
|
181
|
-
children:
|
|
182
|
+
children: j("devportal.loadingItems", "Loading items...")
|
|
182
183
|
})]
|
|
183
184
|
})
|
|
184
185
|
});
|
|
185
|
-
if (
|
|
186
|
-
title:
|
|
187
|
-
description:
|
|
188
|
-
children: /* @__PURE__ */
|
|
186
|
+
if (V && z.length === 0) return /* @__PURE__ */ _(e, {
|
|
187
|
+
title: j("devportal.myItems", "My Items"),
|
|
188
|
+
description: j("devportal.manageYourPhysicalProductListings", "Manage your physical product listings."),
|
|
189
|
+
children: /* @__PURE__ */ v("div", {
|
|
189
190
|
className: "rounded-lg border border-status-error-border/50 bg-status-error-bg/10 p-6 text-center",
|
|
190
191
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ _(c, { className: "mx-auto h-8 w-8 text-status-error-text" }),
|
|
193
|
+
/* @__PURE__ */ _("h3", {
|
|
193
194
|
className: "mt-2 font-medium text-status-error-text",
|
|
194
|
-
children:
|
|
195
|
+
children: j("devportal.failedToLoadItems", "Failed to load items")
|
|
195
196
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ _("p", {
|
|
197
198
|
className: "mt-1 text-sm text-text-secondary",
|
|
198
|
-
children:
|
|
199
|
+
children: V
|
|
199
200
|
}),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
onClick: () =>
|
|
201
|
+
/* @__PURE__ */ _("button", {
|
|
202
|
+
onClick: () => W((e) => e + 1),
|
|
202
203
|
className: "mt-4 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
|
|
203
|
-
children:
|
|
204
|
+
children: j("devportal.tryAgain", "Try Again")
|
|
204
205
|
})
|
|
205
206
|
]
|
|
206
207
|
})
|
|
207
208
|
});
|
|
208
|
-
let
|
|
209
|
-
return /* @__PURE__ */
|
|
209
|
+
let ae = !!(q || Y);
|
|
210
|
+
return /* @__PURE__ */ _(ee, {
|
|
210
211
|
authOnly: !0,
|
|
211
|
-
children: /* @__PURE__ */
|
|
212
|
-
title:
|
|
213
|
-
description:
|
|
214
|
-
actions: /* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ v(e, {
|
|
213
|
+
title: j("devportal.myItems", "My Items"),
|
|
214
|
+
description: j("devportal.manageYourPhysicalProductListings", "Manage your physical product listings."),
|
|
215
|
+
actions: /* @__PURE__ */ v("button", {
|
|
215
216
|
onClick: () => X("/seller/items/new"),
|
|
216
217
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
218
|
+
children: [/* @__PURE__ */ _(m, {
|
|
218
219
|
size: 16,
|
|
219
220
|
"aria-hidden": "true"
|
|
220
|
-
}),
|
|
221
|
+
}), j("devportal.listAnItem", "List an Item")]
|
|
221
222
|
}),
|
|
222
223
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ _(ne, {
|
|
224
225
|
className: "mb-4",
|
|
225
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ v("div", {
|
|
226
227
|
className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
|
|
227
228
|
children: [
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ v(y, {
|
|
229
230
|
treatment: "metric",
|
|
230
231
|
className: "p-4",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ _("p", {
|
|
232
233
|
className: "text-sm text-text-secondary",
|
|
233
|
-
children:
|
|
234
|
-
}), /* @__PURE__ */
|
|
234
|
+
children: j("devportal.totalItems", "Total Items")
|
|
235
|
+
}), /* @__PURE__ */ _("p", {
|
|
235
236
|
className: "mt-1 text-2xl font-semibold tabular-nums",
|
|
236
|
-
children:
|
|
237
|
+
children: F ? /* @__PURE__ */ _(f, { className: "h-5 w-5 animate-spin text-text-secondary" }) : $.total
|
|
237
238
|
})]
|
|
238
239
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ v(y, {
|
|
240
241
|
treatment: "metric",
|
|
241
242
|
className: "p-4",
|
|
242
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ _("p", {
|
|
243
244
|
className: "text-sm text-status-success-text",
|
|
244
|
-
children:
|
|
245
|
-
}), /* @__PURE__ */
|
|
245
|
+
children: j("devportal.published", "Published")
|
|
246
|
+
}), /* @__PURE__ */ _("p", {
|
|
246
247
|
className: "mt-1 text-2xl font-semibold tabular-nums",
|
|
247
|
-
children:
|
|
248
|
+
children: F ? /* @__PURE__ */ _(f, { className: "h-5 w-5 animate-spin text-text-secondary" }) : $.published
|
|
248
249
|
})]
|
|
249
250
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ v(y, {
|
|
251
252
|
treatment: "metric",
|
|
252
253
|
className: "p-4",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ _("p", {
|
|
254
255
|
className: "text-sm text-status-warning-text",
|
|
255
|
-
children:
|
|
256
|
-
}), /* @__PURE__ */
|
|
256
|
+
children: j("devportal.pendingReview", "Pending Review")
|
|
257
|
+
}), /* @__PURE__ */ _("p", {
|
|
257
258
|
className: "mt-1 text-2xl font-semibold tabular-nums",
|
|
258
|
-
children:
|
|
259
|
+
children: F ? /* @__PURE__ */ _(f, { className: "h-5 w-5 animate-spin text-text-secondary" }) : $.pendingReview
|
|
259
260
|
})]
|
|
260
261
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ v(y, {
|
|
262
263
|
treatment: "metric",
|
|
263
264
|
className: "p-4",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ _("p", {
|
|
265
266
|
className: "text-sm text-status-error-text",
|
|
266
|
-
children:
|
|
267
|
-
}), /* @__PURE__ */
|
|
267
|
+
children: j("devportal.outOfStock", "Out of Stock")
|
|
268
|
+
}), /* @__PURE__ */ _("p", {
|
|
268
269
|
className: "mt-1 text-2xl font-semibold tabular-nums",
|
|
269
|
-
children:
|
|
270
|
+
children: F ? /* @__PURE__ */ _(f, { className: "h-5 w-5 animate-spin text-text-secondary" }) : $.outOfStock
|
|
270
271
|
})]
|
|
271
272
|
})
|
|
272
273
|
]
|
|
273
274
|
})
|
|
274
275
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ v("div", {
|
|
276
277
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ v("div", {
|
|
278
279
|
className: "flex flex-1 items-center gap-3",
|
|
279
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ v("div", {
|
|
280
281
|
className: "relative flex-1 max-w-md",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ _(h, {
|
|
282
283
|
size: 16,
|
|
283
284
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
|
|
284
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ _("input", {
|
|
285
286
|
type: "text",
|
|
286
|
-
placeholder:
|
|
287
|
-
value:
|
|
288
|
-
onChange: (e) =>
|
|
287
|
+
placeholder: j("devportal.searchItems", "Search items..."),
|
|
288
|
+
value: q,
|
|
289
|
+
onChange: (e) => J(e.target.value),
|
|
289
290
|
className: "w-full rounded-md border border-border-seam bg-bg-surface pl-9 pr-4 py-2 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-primary"
|
|
290
291
|
})]
|
|
291
|
-
}), /* @__PURE__ */
|
|
292
|
+
}), /* @__PURE__ */ _("select", {
|
|
292
293
|
value: Y,
|
|
293
|
-
onChange: (e) =>
|
|
294
|
+
onChange: (e) => ie(e.target.value),
|
|
294
295
|
className: "rounded-md border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
295
|
-
children:
|
|
296
|
+
children: S.map((e) => /* @__PURE__ */ _("option", {
|
|
296
297
|
value: e.value,
|
|
297
298
|
children: e.label
|
|
298
299
|
}, e.value))
|
|
299
300
|
})]
|
|
300
|
-
}), /* @__PURE__ */
|
|
301
|
+
}), /* @__PURE__ */ v("div", {
|
|
301
302
|
className: "flex items-center gap-1 rounded-md border border-border-seam p-1",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
303
|
-
onClick: () =>
|
|
304
|
-
className: `rounded p-1.5 transition-colors ${
|
|
305
|
-
title:
|
|
306
|
-
children: /* @__PURE__ */
|
|
307
|
-
}), /* @__PURE__ */
|
|
308
|
-
onClick: () =>
|
|
309
|
-
className: `rounded p-1.5 transition-colors ${
|
|
310
|
-
title:
|
|
311
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ _("button", {
|
|
304
|
+
onClick: () => K("grid"),
|
|
305
|
+
className: `rounded p-1.5 transition-colors ${G === "grid" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:bg-bg-sunken/50"}`,
|
|
306
|
+
title: j("devportal.gridView", "Grid view"),
|
|
307
|
+
children: /* @__PURE__ */ _(u, { size: 16 })
|
|
308
|
+
}), /* @__PURE__ */ _("button", {
|
|
309
|
+
onClick: () => K("list"),
|
|
310
|
+
className: `rounded p-1.5 transition-colors ${G === "list" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:bg-bg-sunken/50"}`,
|
|
311
|
+
title: j("devportal.listView", "List view"),
|
|
312
|
+
children: /* @__PURE__ */ _(d, { size: 16 })
|
|
312
313
|
})]
|
|
313
314
|
})]
|
|
314
315
|
}),
|
|
315
|
-
Z.length > 0 && /* @__PURE__ */
|
|
316
|
+
Z.length > 0 && /* @__PURE__ */ v("p", {
|
|
316
317
|
className: "text-sm text-text-secondary",
|
|
317
318
|
children: [
|
|
318
319
|
Q.length,
|
|
@@ -321,212 +322,214 @@ var E = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\
|
|
|
321
322
|
" found"
|
|
322
323
|
]
|
|
323
324
|
}),
|
|
324
|
-
!
|
|
325
|
+
!L && !N ? /* @__PURE__ */ _(t, {
|
|
325
326
|
illustration: "empty-generic",
|
|
326
|
-
icon: /* @__PURE__ */
|
|
327
|
-
title:
|
|
328
|
-
description:
|
|
329
|
-
action: /* @__PURE__ */
|
|
327
|
+
icon: /* @__PURE__ */ _(p, { size: 32 }),
|
|
328
|
+
title: j("devportal.noPublisherProfileYet", "No publisher profile yet"),
|
|
329
|
+
description: j("devportal.listAnItemToGetStarted", "List an item to get started. Your publisher profile will be created automatically."),
|
|
330
|
+
action: /* @__PURE__ */ v("button", {
|
|
330
331
|
onClick: () => X("/seller/items/new"),
|
|
331
332
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ _(m, { size: 16 }), j("devportal.listAnItem", "List an Item")]
|
|
333
334
|
})
|
|
334
|
-
}) :
|
|
335
|
+
}) : F ? /* @__PURE__ */ v("div", {
|
|
335
336
|
className: "flex items-center justify-center py-12",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ _(f, { className: "h-6 w-6 animate-spin text-text-secondary" }), /* @__PURE__ */ _("span", {
|
|
337
338
|
className: "ml-2 text-text-secondary",
|
|
338
|
-
children:
|
|
339
|
+
children: j("devportal.loadingItems", "Loading items...")
|
|
339
340
|
})]
|
|
340
|
-
}) : Q.length > 0 ?
|
|
341
|
+
}) : Q.length > 0 ? G === "grid" ? /* @__PURE__ */ _("div", {
|
|
341
342
|
className: "grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
|
|
342
|
-
children: Q.map((e) => /* @__PURE__ */
|
|
343
|
+
children: Q.map((e) => /* @__PURE__ */ _(O, {
|
|
343
344
|
item: e,
|
|
344
345
|
onEdit: () => X(`/seller/items/${e.id}`)
|
|
345
346
|
}, e.id))
|
|
346
|
-
}) : /* @__PURE__ */
|
|
347
|
+
}) : /* @__PURE__ */ _("div", {
|
|
347
348
|
className: "overflow-x-auto rounded-lg border border-border-seam",
|
|
348
|
-
children: /* @__PURE__ */
|
|
349
|
+
children: /* @__PURE__ */ v("table", {
|
|
349
350
|
className: "w-full text-sm",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ _("thead", { children: /* @__PURE__ */ v("tr", {
|
|
351
352
|
className: "border-b border-border-seam bg-bg-sunken",
|
|
352
353
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ _("th", {
|
|
354
355
|
className: "px-4 py-3 text-left font-medium text-text-secondary",
|
|
355
356
|
children: "Item"
|
|
356
357
|
}),
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ _("th", {
|
|
358
359
|
className: "px-4 py-3 text-left font-medium text-text-secondary",
|
|
359
360
|
children: "Type"
|
|
360
361
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
+
/* @__PURE__ */ _("th", {
|
|
362
363
|
className: "px-4 py-3 text-left font-medium text-text-secondary",
|
|
363
364
|
children: "Price"
|
|
364
365
|
}),
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ _("th", {
|
|
366
367
|
className: "px-4 py-3 text-left font-medium text-text-secondary",
|
|
367
368
|
children: "Stock"
|
|
368
369
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ _("th", {
|
|
370
371
|
className: "px-4 py-3 text-left font-medium text-text-secondary",
|
|
371
372
|
children: "Status"
|
|
372
373
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ _("th", {
|
|
374
375
|
className: "px-4 py-3 text-right font-medium text-text-secondary",
|
|
375
376
|
children: "Actions"
|
|
376
377
|
})
|
|
377
378
|
]
|
|
378
|
-
}) }), /* @__PURE__ */
|
|
379
|
-
let t =
|
|
380
|
-
return /* @__PURE__ */
|
|
379
|
+
}) }), /* @__PURE__ */ _("tbody", { children: Q.map((e) => {
|
|
380
|
+
let t = x[e.status] ?? x.DRAFT;
|
|
381
|
+
return /* @__PURE__ */ v("tr", {
|
|
381
382
|
className: "border-b border-border-subtle last:border-0 hover:bg-bg-sunken/50 transition-colors",
|
|
382
383
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ _("td", {
|
|
384
385
|
className: "px-4 py-3",
|
|
385
|
-
children: /* @__PURE__ */
|
|
386
|
+
children: /* @__PURE__ */ v("div", {
|
|
386
387
|
className: "flex items-center gap-3",
|
|
387
|
-
children: [
|
|
388
|
+
children: [/* @__PURE__ */ _(i, {
|
|
388
389
|
src: e.icon,
|
|
389
390
|
alt: e.name,
|
|
390
|
-
className: "h-8 w-8 rounded-lg object-cover shrink-0"
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
391
|
+
className: "h-8 w-8 rounded-lg object-cover shrink-0",
|
|
392
|
+
fallback: /* @__PURE__ */ _("div", {
|
|
393
|
+
className: "flex h-8 w-8 items-center justify-center rounded-lg bg-bg-sunken shrink-0",
|
|
394
|
+
children: /* @__PURE__ */ _(p, {
|
|
395
|
+
size: 14,
|
|
396
|
+
className: "text-text-muted"
|
|
397
|
+
})
|
|
396
398
|
})
|
|
397
|
-
}), /* @__PURE__ */
|
|
399
|
+
}), /* @__PURE__ */ v("div", {
|
|
398
400
|
className: "min-w-0",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
401
|
+
children: [/* @__PURE__ */ _("p", {
|
|
400
402
|
className: "font-medium text-text-primary truncate",
|
|
401
403
|
children: e.name
|
|
402
|
-
}), e.sku && /* @__PURE__ */
|
|
404
|
+
}), e.sku && /* @__PURE__ */ v("p", {
|
|
403
405
|
className: "text-xs text-text-muted",
|
|
404
406
|
children: ["SKU: ", e.sku]
|
|
405
407
|
})]
|
|
406
408
|
})]
|
|
407
409
|
})
|
|
408
410
|
}),
|
|
409
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ _("td", {
|
|
410
412
|
className: "px-4 py-3 text-text-secondary",
|
|
411
|
-
children:
|
|
413
|
+
children: w(e.type)
|
|
412
414
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ _("td", {
|
|
414
416
|
className: "px-4 py-3 text-text-primary tabular-nums",
|
|
415
|
-
children:
|
|
417
|
+
children: C(e.price, e.currency)
|
|
416
418
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ _("td", {
|
|
418
420
|
className: "px-4 py-3",
|
|
419
|
-
children: e.stockQuantity === 0 ? /* @__PURE__ */
|
|
421
|
+
children: e.stockQuantity === 0 ? /* @__PURE__ */ _("span", {
|
|
420
422
|
className: "text-status-error-text",
|
|
421
423
|
children: "Out of stock"
|
|
422
|
-
}) : /* @__PURE__ */
|
|
424
|
+
}) : /* @__PURE__ */ _("span", {
|
|
423
425
|
className: "text-text-primary tabular-nums",
|
|
424
426
|
children: e.stockQuantity
|
|
425
427
|
})
|
|
426
428
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ _("td", {
|
|
428
430
|
className: "px-4 py-3",
|
|
429
|
-
children: /* @__PURE__ */
|
|
431
|
+
children: /* @__PURE__ */ _("span", {
|
|
430
432
|
className: `rounded-full px-2.5 py-0.5 text-xs font-medium ${t.className}`,
|
|
431
433
|
children: t.label
|
|
432
434
|
})
|
|
433
435
|
}),
|
|
434
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ _("td", {
|
|
435
437
|
className: "px-4 py-3 text-right",
|
|
436
|
-
children: /* @__PURE__ */
|
|
438
|
+
children: /* @__PURE__ */ v("button", {
|
|
437
439
|
onClick: () => X(`/seller/items/${e.id}`),
|
|
438
440
|
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors",
|
|
439
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ _(l, { size: 12 }), j("devportal.edit", "Edit")]
|
|
440
442
|
})
|
|
441
443
|
})
|
|
442
444
|
]
|
|
443
445
|
}, e.id);
|
|
444
446
|
}) })]
|
|
445
447
|
})
|
|
446
|
-
}) : Z.length > 0 &&
|
|
448
|
+
}) : Z.length > 0 && ae ? /* @__PURE__ */ _(t, {
|
|
447
449
|
illustration: "empty-search",
|
|
448
|
-
title:
|
|
449
|
-
description:
|
|
450
|
-
}) : /* @__PURE__ */
|
|
450
|
+
title: j("devportal.noItemsMatchYourSearch", "No items match your search"),
|
|
451
|
+
description: j("devportal.tryAdjustingFilters", "Try adjusting your search or filters")
|
|
452
|
+
}) : /* @__PURE__ */ _(t, {
|
|
451
453
|
illustration: "empty-data",
|
|
452
|
-
icon: /* @__PURE__ */
|
|
453
|
-
title:
|
|
454
|
-
description:
|
|
455
|
-
action: /* @__PURE__ */
|
|
454
|
+
icon: /* @__PURE__ */ _(p, { size: 32 }),
|
|
455
|
+
title: j("devportal.noItemsYet", "No items yet"),
|
|
456
|
+
description: j("devportal.addYourFirstPhysicalProduct", "Add your first physical product listing to start selling"),
|
|
457
|
+
action: /* @__PURE__ */ v("button", {
|
|
456
458
|
onClick: () => X("/seller/items/new"),
|
|
457
459
|
className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
|
|
458
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ _(m, { size: 16 }), j("devportal.listAnItem", "List an Item")]
|
|
459
461
|
})
|
|
460
462
|
})
|
|
461
463
|
]
|
|
462
464
|
})
|
|
463
465
|
});
|
|
464
|
-
},
|
|
465
|
-
let n =
|
|
466
|
-
return /* @__PURE__ */
|
|
466
|
+
}, O = ({ item: e, onEdit: t }) => {
|
|
467
|
+
let n = x[e.status] ?? x.DRAFT;
|
|
468
|
+
return /* @__PURE__ */ v(y, {
|
|
467
469
|
treatment: "insight",
|
|
468
470
|
className: "flex flex-col gap-3 p-4",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
471
|
+
children: [/* @__PURE__ */ v("div", {
|
|
470
472
|
className: "flex items-start gap-3",
|
|
471
|
-
children: [
|
|
473
|
+
children: [/* @__PURE__ */ _(i, {
|
|
472
474
|
src: e.icon,
|
|
473
475
|
alt: e.name,
|
|
474
|
-
className: "h-20 w-20 rounded-xl object-cover shrink-0"
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
476
|
+
className: "h-20 w-20 rounded-xl object-cover shrink-0",
|
|
477
|
+
fallback: /* @__PURE__ */ _("div", {
|
|
478
|
+
className: "flex h-20 w-20 items-center justify-center rounded-xl bg-bg-sunken shrink-0",
|
|
479
|
+
children: /* @__PURE__ */ _(p, {
|
|
480
|
+
size: 32,
|
|
481
|
+
className: "text-text-muted"
|
|
482
|
+
})
|
|
480
483
|
})
|
|
481
|
-
}), /* @__PURE__ */
|
|
484
|
+
}), /* @__PURE__ */ v("div", {
|
|
482
485
|
className: "min-w-0 flex-1",
|
|
483
486
|
children: [
|
|
484
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ _("p", {
|
|
485
488
|
className: "font-semibold text-text-primary truncate",
|
|
486
489
|
children: e.name
|
|
487
490
|
}),
|
|
488
|
-
e.brand && /* @__PURE__ */
|
|
491
|
+
e.brand && /* @__PURE__ */ _("p", {
|
|
489
492
|
className: "text-xs text-text-muted mt-0.5",
|
|
490
493
|
children: e.brand
|
|
491
494
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ _("p", {
|
|
493
496
|
className: "text-sm text-text-secondary mt-1",
|
|
494
|
-
children:
|
|
497
|
+
children: C(e.price, e.currency)
|
|
495
498
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ v("div", {
|
|
497
500
|
className: "flex items-center gap-2 mt-2 flex-wrap",
|
|
498
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ _("span", {
|
|
499
502
|
className: `rounded-full px-2 py-0.5 text-xs font-medium ${n.className}`,
|
|
500
503
|
children: n.label
|
|
501
|
-
}), /* @__PURE__ */
|
|
504
|
+
}), /* @__PURE__ */ _("span", {
|
|
502
505
|
className: "rounded-full px-2 py-0.5 text-xs font-medium bg-bg-muted text-text-secondary",
|
|
503
|
-
children:
|
|
506
|
+
children: w(e.type)
|
|
504
507
|
})]
|
|
505
508
|
})
|
|
506
509
|
]
|
|
507
510
|
})]
|
|
508
|
-
}), /* @__PURE__ */
|
|
511
|
+
}), /* @__PURE__ */ v("div", {
|
|
509
512
|
className: "flex items-center justify-between pt-2 border-t border-border-subtle",
|
|
510
|
-
children: [/* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ v("div", {
|
|
511
514
|
className: "flex items-center gap-1.5 text-sm",
|
|
512
|
-
children: [/* @__PURE__ */ g
|
|
515
|
+
children: [/* @__PURE__ */ _(g, {
|
|
513
516
|
size: 12,
|
|
514
517
|
className: "text-text-muted shrink-0"
|
|
515
|
-
}), e.stockQuantity === 0 ? /* @__PURE__ */
|
|
518
|
+
}), e.stockQuantity === 0 ? /* @__PURE__ */ _("span", {
|
|
516
519
|
className: "text-status-error-text",
|
|
517
520
|
children: "Out of stock"
|
|
518
|
-
}) : /* @__PURE__ */
|
|
521
|
+
}) : /* @__PURE__ */ v("span", {
|
|
519
522
|
className: "text-text-secondary",
|
|
520
523
|
children: [e.stockQuantity, " in stock"]
|
|
521
524
|
})]
|
|
522
|
-
}), /* @__PURE__ */
|
|
525
|
+
}), /* @__PURE__ */ v("button", {
|
|
523
526
|
onClick: t,
|
|
524
527
|
className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-secondary hover:text-text-primary hover:bg-bg-sunken transition-colors",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ _(l, { size: 12 }), "Edit"]
|
|
526
529
|
})]
|
|
527
530
|
})]
|
|
528
531
|
});
|
|
529
532
|
};
|
|
530
|
-
export {
|
|
533
|
+
export { D as SellerItemsPage };
|
|
531
534
|
|
|
532
535
|
//# sourceMappingURL=SellerItemsPage.js.map
|