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