@burdenoff/microfe-devportal 2026.914.3 → 2026.914.5
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/hooks/useSellerOrganization.d.ts.map +1 -1
- package/dist/devportal/hooks/useSellerOrganization.js +2 -2
- package/dist/devportal/hooks/useSellerOrganization.js.map +1 -1
- package/dist/devportal/pages/CreateApplicationPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreateApplicationPage.js +5 -1
- package/dist/devportal/pages/CreateApplicationPage.js.map +1 -1
- package/dist/devportal/pages/CreateOrganizationPage.d.ts +3 -2
- package/dist/devportal/pages/CreateOrganizationPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreateOrganizationPage.js +224 -122
- package/dist/devportal/pages/CreateOrganizationPage.js.map +1 -1
- package/dist/devportal/pages/CreatePhysicalItemPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreatePhysicalItemPage.js +377 -191
- package/dist/devportal/pages/CreatePhysicalItemPage.js.map +1 -1
- package/dist/devportal/pages/DashboardPage.d.ts.map +1 -1
- package/dist/devportal/pages/DashboardPage.js +1 -1
- package/dist/devportal/pages/DashboardPage.js.map +1 -1
- package/dist/devportal/pages/EditPhysicalItemPage.d.ts.map +1 -1
- package/dist/devportal/pages/EditPhysicalItemPage.js +427 -168
- package/dist/devportal/pages/EditPhysicalItemPage.js.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.d.ts.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.js +22 -20
- package/dist/devportal/pages/OrganizationDetailPage.js.map +1 -1
- package/dist/devportal/pages/SettingsPage.d.ts.map +1 -1
- package/dist/devportal/pages/SettingsPage.js +1 -1
- package/dist/devportal/pages/SettingsPage.js.map +1 -1
- package/dist/devportal/types/index.d.ts +1 -0
- package/dist/devportal/types/index.d.ts.map +1 -1
- package/dist/devportal/types/index.js.map +1 -1
- 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
|
@@ -2,12 +2,13 @@ import { useDevportal as e } from "../providers/DevportalProvider.js";
|
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { PageLayout as n, PageSection as r } from "../components/PageLayout.js";
|
|
4
4
|
import { CheckboxField as i, InputField as a, SelectField as o, TextareaField as s } from "../components/FormField.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { usePackageUpload as ee } from "../hooks/usePackageUpload.js";
|
|
6
|
+
import { useCallback as c, useEffect as te, useRef as ne, useState as l } from "react";
|
|
7
|
+
import { AlertCircle as u, AlertTriangle as d, Info as re, Loader2 as f, RotateCw as ie, Upload as ae, X as oe } from "lucide-react";
|
|
8
|
+
import { useParams as se } from "react-router";
|
|
9
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
9
10
|
//#region src/devportal/pages/EditPhysicalItemPage.tsx
|
|
10
|
-
var
|
|
11
|
+
var g = [
|
|
11
12
|
{
|
|
12
13
|
value: "USD",
|
|
13
14
|
label: "USD — US Dollar"
|
|
@@ -32,21 +33,51 @@ var _ = [
|
|
|
32
33
|
value: "AED",
|
|
33
34
|
label: "AED — UAE Dirham"
|
|
34
35
|
}
|
|
36
|
+
], _ = [
|
|
37
|
+
{
|
|
38
|
+
value: "GRAM",
|
|
39
|
+
label: "Grams (g)"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: "KILOGRAM",
|
|
43
|
+
label: "Kilograms (kg)"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
value: "OUNCE",
|
|
47
|
+
label: "Ounces (oz)"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: "POUND",
|
|
51
|
+
label: "Pounds (lb)"
|
|
52
|
+
}
|
|
35
53
|
], v = [
|
|
54
|
+
{
|
|
55
|
+
value: "CENTIMETER",
|
|
56
|
+
label: "Centimeters (cm)"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
value: "INCH",
|
|
60
|
+
label: "Inches (in)"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
value: "METER",
|
|
64
|
+
label: "Meters (m)"
|
|
65
|
+
}
|
|
66
|
+
], y = [
|
|
36
67
|
"name",
|
|
37
68
|
"shortDescription",
|
|
38
69
|
"price",
|
|
39
70
|
"currency",
|
|
40
71
|
"stockQuantity"
|
|
41
|
-
],
|
|
42
|
-
function
|
|
43
|
-
return
|
|
72
|
+
], b = "\n query GetPhysicalProduct($id: ID!) {\n product(id: $id) {\n id\n name\n slug\n type\n status\n nature\n description\n longDescription\n price\n currency\n tags\n stockQuantity\n sku\n trackInventory\n allowBackorder\n lowStockThreshold\n requiresShipping\n weight\n weightUnit\n length\n width\n height\n dimensionUnit\n brand\n manufacturer\n countryOfOrigin\n warrantyInfo\n returnPolicy\n icon\n screenshots\n }\n }\n", x = "\n mutation UpdatePhysicalProduct(\n $id: ID!\n $input: UpdatePhysicalProductInput!\n ) {\n updatePhysicalProduct(id: $id, input: $input) {\n id\n name\n status\n }\n }\n", S = "\n mutation SubmitProductForReview($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
|
|
73
|
+
function ce(e) {
|
|
74
|
+
return y.every((t) => {
|
|
44
75
|
let n = e[t];
|
|
45
76
|
return typeof n == "boolean" ? !0 : String(n).trim() !== "";
|
|
46
77
|
});
|
|
47
78
|
}
|
|
48
79
|
var C = () => {
|
|
49
|
-
let { navigate:
|
|
80
|
+
let { navigate: y, basePath: C, apiGatewayUrl: le, authToken: w, workspacesGatewayUrl: ue, workspaceId: de, getWorkspaceToken: fe } = e(), { itemId: T } = se(), E = `${le || ""}/global/graphql`, [pe, D] = l(!0), [O, k] = l(null), [A, j] = l(null), [M, N] = l({
|
|
50
81
|
name: "",
|
|
51
82
|
shortDescription: "",
|
|
52
83
|
longDescription: "",
|
|
@@ -56,19 +87,27 @@ var C = () => {
|
|
|
56
87
|
stockQuantity: "0",
|
|
57
88
|
sku: "",
|
|
58
89
|
trackInventory: !0,
|
|
90
|
+
allowBackorder: !1,
|
|
91
|
+
lowStockThreshold: "",
|
|
59
92
|
requiresShipping: !0,
|
|
60
93
|
weightKg: "",
|
|
94
|
+
weightUnit: "KILOGRAM",
|
|
95
|
+
length: "",
|
|
96
|
+
width: "",
|
|
97
|
+
height: "",
|
|
98
|
+
dimensionUnit: "CENTIMETER",
|
|
61
99
|
brand: "",
|
|
100
|
+
manufacturer: "",
|
|
62
101
|
countryOfOrigin: "",
|
|
63
102
|
warrantyInfo: "",
|
|
64
103
|
returnPolicy: ""
|
|
65
|
-
}), [I, L] = l(!1),
|
|
66
|
-
async function
|
|
67
|
-
let n = await (await fetch(
|
|
104
|
+
}), [P, F] = l([]), [I, L] = l(!1), R = ne(null), { upload: z } = ee(ue, w, de, fe, "/DevPortal/Assets"), [B, V] = l(!1), [H, U] = l(null), [me, W] = l(!1), he = P.some((e) => e.uploading), G = ce(M) && !he;
|
|
105
|
+
async function K(e, t) {
|
|
106
|
+
let n = await (await fetch(E, {
|
|
68
107
|
method: "POST",
|
|
69
108
|
headers: {
|
|
70
109
|
"Content-Type": "application/json",
|
|
71
|
-
...
|
|
110
|
+
...w ? { Authorization: `Bearer ${w}` } : {}
|
|
72
111
|
},
|
|
73
112
|
credentials: "include",
|
|
74
113
|
body: JSON.stringify({
|
|
@@ -79,19 +118,19 @@ var C = () => {
|
|
|
79
118
|
if (n.errors?.length) throw Error(n.errors.map((e) => e.message).join("; "));
|
|
80
119
|
return n.data;
|
|
81
120
|
}
|
|
82
|
-
|
|
83
|
-
if (!
|
|
121
|
+
te(() => {
|
|
122
|
+
if (!T) return;
|
|
84
123
|
let e = !1;
|
|
85
|
-
return
|
|
124
|
+
return D(!0), k(null), (async () => {
|
|
86
125
|
try {
|
|
87
|
-
let t = await
|
|
126
|
+
let t = await K(b, { id: T });
|
|
88
127
|
if (e) return;
|
|
89
128
|
let n = t.product;
|
|
90
129
|
if (!n) {
|
|
91
|
-
|
|
130
|
+
k("Product not found.");
|
|
92
131
|
return;
|
|
93
132
|
}
|
|
94
|
-
|
|
133
|
+
j(n.status), N({
|
|
95
134
|
name: n.name,
|
|
96
135
|
shortDescription: n.description ?? "",
|
|
97
136
|
longDescription: n.longDescription ?? "",
|
|
@@ -101,309 +140,529 @@ var C = () => {
|
|
|
101
140
|
stockQuantity: String(n.stockQuantity),
|
|
102
141
|
sku: n.sku ?? "",
|
|
103
142
|
trackInventory: n.trackInventory ?? !0,
|
|
143
|
+
allowBackorder: n.allowBackorder ?? !1,
|
|
144
|
+
lowStockThreshold: n.lowStockThreshold == null ? "" : String(n.lowStockThreshold),
|
|
104
145
|
requiresShipping: n.requiresShipping ?? !0,
|
|
105
146
|
weightKg: n.weight == null ? "" : String(n.weight),
|
|
147
|
+
weightUnit: n.weightUnit ?? "KILOGRAM",
|
|
148
|
+
length: n.length == null ? "" : String(n.length),
|
|
149
|
+
width: n.width == null ? "" : String(n.width),
|
|
150
|
+
height: n.height == null ? "" : String(n.height),
|
|
151
|
+
dimensionUnit: n.dimensionUnit ?? "CENTIMETER",
|
|
106
152
|
brand: n.brand ?? "",
|
|
153
|
+
manufacturer: n.manufacturer ?? "",
|
|
107
154
|
countryOfOrigin: n.countryOfOrigin ?? "",
|
|
108
155
|
warrantyInfo: n.warrantyInfo ?? "",
|
|
109
156
|
returnPolicy: n.returnPolicy ?? ""
|
|
110
|
-
})
|
|
157
|
+
}), F([n.icon, ...n.screenshots ?? []].filter((e) => !!e).map((e) => ({
|
|
158
|
+
id: crypto.randomUUID(),
|
|
159
|
+
url: e,
|
|
160
|
+
downloadUrl: e,
|
|
161
|
+
uploading: !1
|
|
162
|
+
})));
|
|
111
163
|
} catch (t) {
|
|
112
|
-
e ||
|
|
164
|
+
e || k(t instanceof Error ? t.message : "Failed to load product");
|
|
113
165
|
} finally {
|
|
114
|
-
e ||
|
|
166
|
+
e || D(!1);
|
|
115
167
|
}
|
|
116
168
|
})(), () => {
|
|
117
169
|
e = !0;
|
|
118
170
|
};
|
|
119
171
|
}, [
|
|
172
|
+
T,
|
|
120
173
|
E,
|
|
121
|
-
|
|
122
|
-
T
|
|
174
|
+
w
|
|
123
175
|
]);
|
|
124
|
-
let
|
|
125
|
-
|
|
176
|
+
let q = (e, t) => {
|
|
177
|
+
N((n) => ({
|
|
126
178
|
...n,
|
|
127
179
|
[e]: t
|
|
128
180
|
}));
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
181
|
+
}, J = (e) => (t) => {
|
|
182
|
+
q(e, t.target.checked);
|
|
183
|
+
}, Y = c((e, t) => {
|
|
184
|
+
z(t).then((t) => {
|
|
185
|
+
F((n) => n.map((n) => n.id === e ? {
|
|
186
|
+
...n,
|
|
187
|
+
uploading: !1,
|
|
188
|
+
downloadUrl: t.downloadUrl,
|
|
189
|
+
error: void 0
|
|
190
|
+
} : n));
|
|
191
|
+
}).catch((t) => {
|
|
192
|
+
F((n) => n.map((n) => n.id === e ? {
|
|
193
|
+
...n,
|
|
194
|
+
uploading: !1,
|
|
195
|
+
error: t instanceof Error ? t.message : "Upload failed"
|
|
196
|
+
} : n));
|
|
197
|
+
});
|
|
198
|
+
}, [z]), X = c((e) => {
|
|
199
|
+
let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
|
|
200
|
+
id: crypto.randomUUID(),
|
|
201
|
+
file: e,
|
|
202
|
+
url: URL.createObjectURL(e),
|
|
203
|
+
uploading: !0
|
|
204
|
+
}));
|
|
205
|
+
F((e) => [...e, ...t]), t.forEach((e) => Y(e.id, e.file));
|
|
206
|
+
}, [Y]), ge = (e) => {
|
|
207
|
+
e.target.files && X(e.target.files), e.target.value = "";
|
|
208
|
+
}, _e = (e) => {
|
|
209
|
+
e.preventDefault(), L(!1), e.dataTransfer.files && X(e.dataTransfer.files);
|
|
210
|
+
}, ve = (e) => {
|
|
211
|
+
e.preventDefault(), L(!0);
|
|
212
|
+
}, Z = () => L(!1), ye = (e) => {
|
|
213
|
+
F((t) => {
|
|
214
|
+
let n = t.find((t) => t.id === e);
|
|
215
|
+
return n?.file && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
|
|
216
|
+
});
|
|
217
|
+
}, be = (e) => {
|
|
218
|
+
let t = P.find((t) => t.id === e);
|
|
219
|
+
t?.file && (F((t) => t.map((t) => t.id === e ? {
|
|
220
|
+
...t,
|
|
221
|
+
uploading: !0,
|
|
222
|
+
error: void 0
|
|
223
|
+
} : t)), Y(e, t.file));
|
|
224
|
+
}, Q = async (e = !1) => {
|
|
225
|
+
if (!(!G || B || !T)) {
|
|
226
|
+
V(!0), U(null), W(!1);
|
|
134
227
|
try {
|
|
135
|
-
let t =
|
|
136
|
-
await
|
|
137
|
-
id:
|
|
228
|
+
let t = M.tags.split(",").map((e) => e.trim()).filter(Boolean), n = P.map((e) => e.downloadUrl).filter((e) => !!e), r = M.length.trim() || M.width.trim() || M.height.trim();
|
|
229
|
+
await K(x, {
|
|
230
|
+
id: T,
|
|
138
231
|
input: {
|
|
139
|
-
name:
|
|
140
|
-
description:
|
|
141
|
-
longDescription:
|
|
142
|
-
price: parseFloat(
|
|
143
|
-
currency:
|
|
232
|
+
name: M.name.trim(),
|
|
233
|
+
description: M.shortDescription.trim(),
|
|
234
|
+
longDescription: M.longDescription.trim() || null,
|
|
235
|
+
price: parseFloat(M.price),
|
|
236
|
+
currency: M.currency,
|
|
144
237
|
tags: t.length > 0 ? t : null,
|
|
145
|
-
stockQuantity: parseInt(
|
|
146
|
-
sku:
|
|
147
|
-
trackInventory:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
238
|
+
stockQuantity: parseInt(M.stockQuantity, 10),
|
|
239
|
+
sku: M.sku.trim() || null,
|
|
240
|
+
trackInventory: M.trackInventory,
|
|
241
|
+
allowBackorder: M.allowBackorder,
|
|
242
|
+
lowStockThreshold: M.lowStockThreshold.trim() ? parseInt(M.lowStockThreshold, 10) : null,
|
|
243
|
+
requiresShipping: M.requiresShipping,
|
|
244
|
+
weight: M.requiresShipping && M.weightKg.trim() ? parseFloat(M.weightKg) : null,
|
|
245
|
+
weightUnit: M.requiresShipping && M.weightKg.trim() ? M.weightUnit : null,
|
|
246
|
+
length: M.requiresShipping && M.length.trim() ? parseFloat(M.length) : null,
|
|
247
|
+
width: M.requiresShipping && M.width.trim() ? parseFloat(M.width) : null,
|
|
248
|
+
height: M.requiresShipping && M.height.trim() ? parseFloat(M.height) : null,
|
|
249
|
+
dimensionUnit: M.requiresShipping && r ? M.dimensionUnit : null,
|
|
250
|
+
brand: M.brand.trim() || null,
|
|
251
|
+
manufacturer: M.manufacturer.trim() || null,
|
|
252
|
+
countryOfOrigin: M.countryOfOrigin.trim() || null,
|
|
253
|
+
warrantyInfo: M.warrantyInfo.trim() || null,
|
|
254
|
+
returnPolicy: M.returnPolicy.trim() || null,
|
|
255
|
+
icon: n[0] ?? null,
|
|
256
|
+
screenshots: n.length > 1 ? n.slice(1) : null
|
|
154
257
|
}
|
|
155
|
-
}), e && await
|
|
156
|
-
id:
|
|
258
|
+
}), e && await K(S, {
|
|
259
|
+
id: T,
|
|
157
260
|
notes: "Resubmitted after edits"
|
|
158
|
-
}),
|
|
159
|
-
|
|
261
|
+
}), W(!0), setTimeout(() => {
|
|
262
|
+
y?.(`${C}/seller/items`);
|
|
160
263
|
}, 1500);
|
|
161
264
|
} catch (e) {
|
|
162
|
-
|
|
265
|
+
U(e instanceof Error ? e.message : "Save failed. Please try again.");
|
|
163
266
|
} finally {
|
|
164
|
-
|
|
267
|
+
V(!1);
|
|
165
268
|
}
|
|
166
269
|
}
|
|
167
270
|
};
|
|
168
|
-
if (
|
|
271
|
+
if (pe) return /* @__PURE__ */ m(n, {
|
|
169
272
|
title: "Edit Item",
|
|
170
273
|
backLink: "/seller/items",
|
|
171
274
|
backLabel: "Back to My Items",
|
|
172
|
-
children: /* @__PURE__ */
|
|
275
|
+
children: /* @__PURE__ */ m("div", {
|
|
173
276
|
className: "flex items-center justify-center py-20",
|
|
174
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ m(f, { className: "h-8 w-8 animate-spin text-text-secondary" })
|
|
175
278
|
})
|
|
176
279
|
});
|
|
177
|
-
if (
|
|
280
|
+
if (O) return /* @__PURE__ */ m(n, {
|
|
178
281
|
title: "Edit Item",
|
|
179
282
|
backLink: "/seller/items",
|
|
180
283
|
backLabel: "Back to My Items",
|
|
181
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ h("div", {
|
|
182
285
|
className: "flex items-center gap-3 rounded-lg border border-status-error-border/50 bg-status-error-bg/10 px-4 py-3 text-sm",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
286
|
+
children: [/* @__PURE__ */ m(u, {
|
|
184
287
|
size: 16,
|
|
185
288
|
className: "shrink-0 text-status-error-text"
|
|
186
|
-
}), /* @__PURE__ */
|
|
289
|
+
}), /* @__PURE__ */ m("span", {
|
|
187
290
|
className: "text-status-error-text",
|
|
188
|
-
children:
|
|
291
|
+
children: O
|
|
189
292
|
})]
|
|
190
293
|
})
|
|
191
294
|
});
|
|
192
|
-
let
|
|
193
|
-
return /* @__PURE__ */
|
|
194
|
-
title: `Edit: ${
|
|
295
|
+
let $ = A === "DRAFT" || A === "REJECTED";
|
|
296
|
+
return /* @__PURE__ */ m(n, {
|
|
297
|
+
title: `Edit: ${M.name || "Item"}`,
|
|
195
298
|
description: "Update your listing details. Changes take effect immediately for drafts; published items may require re-review.",
|
|
196
299
|
backLink: "/seller/items",
|
|
197
300
|
backLabel: "Back to My Items",
|
|
198
|
-
children: /* @__PURE__ */
|
|
301
|
+
children: /* @__PURE__ */ h("div", {
|
|
199
302
|
className: "space-y-8 max-w-3xl",
|
|
200
303
|
children: [
|
|
201
|
-
|
|
304
|
+
me && /* @__PURE__ */ m("div", {
|
|
202
305
|
className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
|
|
203
306
|
children: "Saved successfully! Redirecting to your items..."
|
|
204
307
|
}),
|
|
205
|
-
|
|
308
|
+
H && /* @__PURE__ */ m("div", {
|
|
206
309
|
className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
207
|
-
children:
|
|
310
|
+
children: H
|
|
208
311
|
}),
|
|
209
|
-
|
|
312
|
+
A && /* @__PURE__ */ h("div", {
|
|
210
313
|
className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
211
314
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ m(re, {
|
|
213
316
|
size: 13,
|
|
214
317
|
className: "mt-0.5 shrink-0 text-text-muted"
|
|
215
318
|
}),
|
|
216
319
|
"Current status:",
|
|
217
320
|
" ",
|
|
218
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ m("span", {
|
|
219
322
|
className: "font-medium text-text-primary",
|
|
220
|
-
children:
|
|
323
|
+
children: A.replace(/_/g, " ")
|
|
221
324
|
}),
|
|
222
|
-
|
|
325
|
+
$ && /* @__PURE__ */ m("span", {
|
|
223
326
|
className: "ml-1",
|
|
224
327
|
children: "— use \"Save & Resubmit\" to send it for review again."
|
|
225
328
|
})
|
|
226
329
|
]
|
|
227
330
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ m(r, {
|
|
229
332
|
title: "Basic Information",
|
|
230
333
|
description: "Core details shown in the store listing.",
|
|
231
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ h("div", {
|
|
232
335
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
233
336
|
children: [
|
|
234
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ m(a, {
|
|
235
338
|
label: "Name",
|
|
236
339
|
required: !0,
|
|
237
|
-
value:
|
|
238
|
-
onChange: (e) =>
|
|
340
|
+
value: M.name,
|
|
341
|
+
onChange: (e) => q("name", e.target.value),
|
|
239
342
|
placeholder: "e.g. Wireless Ergonomic Keyboard",
|
|
240
343
|
maxLength: 120
|
|
241
344
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ m(a, {
|
|
243
346
|
label: "Short Description",
|
|
244
347
|
required: !0,
|
|
245
|
-
value:
|
|
246
|
-
onChange: (e) =>
|
|
348
|
+
value: M.shortDescription,
|
|
349
|
+
onChange: (e) => q("shortDescription", e.target.value),
|
|
247
350
|
placeholder: "One-line summary shown on the store card",
|
|
248
351
|
maxLength: 160,
|
|
249
|
-
hint: `${
|
|
352
|
+
hint: `${M.shortDescription.length}/160`
|
|
250
353
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ m(s, {
|
|
252
355
|
label: "Long Description",
|
|
253
|
-
value:
|
|
254
|
-
onChange: (e) =>
|
|
356
|
+
value: M.longDescription,
|
|
357
|
+
onChange: (e) => q("longDescription", e.target.value),
|
|
255
358
|
rows: 5,
|
|
256
359
|
placeholder: "Detailed product description, features, specs…"
|
|
257
360
|
})
|
|
258
361
|
]
|
|
259
362
|
})
|
|
260
363
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ m(r, {
|
|
365
|
+
title: "Product Images",
|
|
366
|
+
description: "The first image is used as the main icon.",
|
|
367
|
+
children: /* @__PURE__ */ h("div", {
|
|
368
|
+
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
|
|
369
|
+
children: [/* @__PURE__ */ h("div", {
|
|
370
|
+
onDrop: _e,
|
|
371
|
+
onDragOver: ve,
|
|
372
|
+
onDragLeave: Z,
|
|
373
|
+
onClick: () => R.current?.click(),
|
|
374
|
+
className: t("flex flex-col items-center justify-center gap-3 rounded-input border-2 border-dashed px-6 py-10 cursor-pointer transition-colors", I ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
|
|
375
|
+
children: [
|
|
376
|
+
/* @__PURE__ */ m(ae, {
|
|
377
|
+
size: 28,
|
|
378
|
+
className: I ? "text-action-primary-bg" : "text-text-muted"
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ h("div", {
|
|
381
|
+
className: "text-center space-y-1",
|
|
382
|
+
children: [/* @__PURE__ */ m("p", {
|
|
383
|
+
className: "text-sm font-medium text-text-primary",
|
|
384
|
+
children: "Drag and drop images here"
|
|
385
|
+
}), /* @__PURE__ */ m("p", {
|
|
386
|
+
className: "text-xs text-text-muted",
|
|
387
|
+
children: "or click to browse — accepts any image format, multiple files"
|
|
388
|
+
})]
|
|
389
|
+
}),
|
|
390
|
+
/* @__PURE__ */ m("input", {
|
|
391
|
+
ref: R,
|
|
392
|
+
type: "file",
|
|
393
|
+
accept: "image/*",
|
|
394
|
+
multiple: !0,
|
|
395
|
+
className: "sr-only",
|
|
396
|
+
onChange: ge
|
|
397
|
+
})
|
|
398
|
+
]
|
|
399
|
+
}), P.length > 0 && /* @__PURE__ */ m("div", {
|
|
400
|
+
className: "flex flex-wrap gap-3",
|
|
401
|
+
children: (() => {
|
|
402
|
+
let e = P.find((e) => e.downloadUrl)?.id;
|
|
403
|
+
return P.map((n, r) => /* @__PURE__ */ h("div", {
|
|
404
|
+
className: "relative group",
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ m("img", {
|
|
407
|
+
src: n.url,
|
|
408
|
+
alt: `Product image ${r + 1}`,
|
|
409
|
+
className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
|
|
410
|
+
}),
|
|
411
|
+
n.uploading && /* @__PURE__ */ m("div", {
|
|
412
|
+
className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
|
|
413
|
+
children: /* @__PURE__ */ m(f, {
|
|
414
|
+
size: 16,
|
|
415
|
+
className: "animate-spin text-white"
|
|
416
|
+
})
|
|
417
|
+
}),
|
|
418
|
+
n.error && /* @__PURE__ */ h("button", {
|
|
419
|
+
type: "button",
|
|
420
|
+
onClick: (e) => {
|
|
421
|
+
e.stopPropagation(), be(n.id);
|
|
422
|
+
},
|
|
423
|
+
title: `${n.error} — click to retry`,
|
|
424
|
+
className: "absolute inset-0 flex flex-col items-center justify-center gap-0.5 rounded-input bg-status-error-bg/80 text-status-error-text",
|
|
425
|
+
children: [/* @__PURE__ */ m(d, { size: 14 }), /* @__PURE__ */ m(ie, { size: 11 })]
|
|
426
|
+
}),
|
|
427
|
+
n.id === e && /* @__PURE__ */ m("span", {
|
|
428
|
+
className: "absolute bottom-0 left-0 right-0 rounded-b-input bg-bg-surface/80 text-center text-[10px] font-medium py-0.5 text-text-secondary",
|
|
429
|
+
children: "Main"
|
|
430
|
+
}),
|
|
431
|
+
/* @__PURE__ */ m("button", {
|
|
432
|
+
type: "button",
|
|
433
|
+
onClick: (e) => {
|
|
434
|
+
e.stopPropagation(), ye(n.id);
|
|
435
|
+
},
|
|
436
|
+
className: "absolute -top-1.5 -right-1.5 hidden group-hover:flex h-5 w-5 items-center justify-center rounded-full bg-bg-surface border border-border-subtle text-text-muted hover:text-status-error-text hover:border-status-error-text/40 transition-colors",
|
|
437
|
+
"aria-label": "Remove image",
|
|
438
|
+
children: /* @__PURE__ */ m(oe, { size: 11 })
|
|
439
|
+
})
|
|
440
|
+
]
|
|
441
|
+
}, n.id));
|
|
442
|
+
})()
|
|
443
|
+
})]
|
|
444
|
+
})
|
|
445
|
+
}),
|
|
446
|
+
/* @__PURE__ */ m(r, {
|
|
262
447
|
title: "Pricing",
|
|
263
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ h("div", {
|
|
264
449
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ h("div", {
|
|
266
451
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ m(a, {
|
|
268
453
|
label: "Price",
|
|
269
454
|
required: !0,
|
|
270
455
|
type: "number",
|
|
271
|
-
value:
|
|
272
|
-
onChange: (e) =>
|
|
456
|
+
value: M.price,
|
|
457
|
+
onChange: (e) => q("price", e.target.value),
|
|
273
458
|
placeholder: "0.00",
|
|
274
459
|
min: .01,
|
|
275
460
|
step: "0.01"
|
|
276
|
-
}), /* @__PURE__ */
|
|
461
|
+
}), /* @__PURE__ */ m(o, {
|
|
277
462
|
label: "Currency",
|
|
278
463
|
required: !0,
|
|
279
|
-
value:
|
|
280
|
-
onChange: (e) =>
|
|
281
|
-
options:
|
|
464
|
+
value: M.currency,
|
|
465
|
+
onChange: (e) => q("currency", e.target.value),
|
|
466
|
+
options: g,
|
|
282
467
|
placeholder: "Select currency"
|
|
283
468
|
})]
|
|
284
|
-
}), /* @__PURE__ */
|
|
469
|
+
}), /* @__PURE__ */ m(a, {
|
|
285
470
|
label: "Tags",
|
|
286
|
-
value:
|
|
287
|
-
onChange: (e) =>
|
|
471
|
+
value: M.tags,
|
|
472
|
+
onChange: (e) => q("tags", e.target.value),
|
|
288
473
|
placeholder: "mechanical, wireless, ergonomic",
|
|
289
474
|
hint: "Comma-separated keywords."
|
|
290
475
|
})]
|
|
291
476
|
})
|
|
292
477
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ m(r, {
|
|
294
479
|
title: "Inventory",
|
|
295
|
-
children: /* @__PURE__ */
|
|
480
|
+
children: /* @__PURE__ */ h("div", {
|
|
296
481
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
297
|
-
children: [
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
482
|
+
children: [
|
|
483
|
+
/* @__PURE__ */ h("div", {
|
|
484
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
485
|
+
children: [/* @__PURE__ */ m(a, {
|
|
486
|
+
label: "Stock Quantity",
|
|
487
|
+
required: !0,
|
|
488
|
+
type: "number",
|
|
489
|
+
value: M.stockQuantity,
|
|
490
|
+
onChange: (e) => q("stockQuantity", e.target.value),
|
|
491
|
+
min: 0,
|
|
492
|
+
step: 1
|
|
493
|
+
}), /* @__PURE__ */ m(a, {
|
|
494
|
+
label: "SKU",
|
|
495
|
+
value: M.sku,
|
|
496
|
+
onChange: (e) => q("sku", e.target.value),
|
|
497
|
+
placeholder: "e.g. KB-WL-001",
|
|
498
|
+
hint: "Your internal stock-keeping unit reference."
|
|
499
|
+
})]
|
|
500
|
+
}),
|
|
501
|
+
/* @__PURE__ */ m(a, {
|
|
502
|
+
label: "Low Stock Threshold",
|
|
302
503
|
type: "number",
|
|
303
|
-
value:
|
|
304
|
-
onChange: (e) =>
|
|
504
|
+
value: M.lowStockThreshold,
|
|
505
|
+
onChange: (e) => q("lowStockThreshold", e.target.value),
|
|
506
|
+
placeholder: "e.g. 5",
|
|
305
507
|
min: 0,
|
|
306
|
-
step: 1
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
508
|
+
step: 1,
|
|
509
|
+
hint: "Get flagged when stock falls to or below this number."
|
|
510
|
+
}),
|
|
511
|
+
/* @__PURE__ */ m(i, {
|
|
512
|
+
label: "Track Inventory",
|
|
513
|
+
description: "Automatically reduce stock when orders are placed.",
|
|
514
|
+
checked: M.trackInventory,
|
|
515
|
+
onChange: J("trackInventory")
|
|
516
|
+
}),
|
|
517
|
+
/* @__PURE__ */ m(i, {
|
|
518
|
+
label: "Allow Backorder",
|
|
519
|
+
description: "Let buyers order even when stock quantity is zero.",
|
|
520
|
+
checked: M.allowBackorder,
|
|
521
|
+
onChange: J("allowBackorder")
|
|
522
|
+
})
|
|
523
|
+
]
|
|
320
524
|
})
|
|
321
525
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ m(r, {
|
|
323
527
|
title: "Shipping",
|
|
324
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ h("div", {
|
|
325
529
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
530
|
+
children: [/* @__PURE__ */ m(i, {
|
|
327
531
|
label: "Requires Shipping",
|
|
328
532
|
description: "This item will be physically shipped to the buyer.",
|
|
329
|
-
checked:
|
|
330
|
-
onChange:
|
|
331
|
-
}),
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
533
|
+
checked: M.requiresShipping,
|
|
534
|
+
onChange: J("requiresShipping")
|
|
535
|
+
}), M.requiresShipping && /* @__PURE__ */ h(p, { children: [
|
|
536
|
+
/* @__PURE__ */ h("div", {
|
|
537
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
538
|
+
children: [/* @__PURE__ */ m(a, {
|
|
539
|
+
label: "Weight",
|
|
540
|
+
type: "number",
|
|
541
|
+
value: M.weightKg,
|
|
542
|
+
onChange: (e) => q("weightKg", e.target.value),
|
|
543
|
+
placeholder: "0.0",
|
|
544
|
+
min: 0,
|
|
545
|
+
step: "0.01",
|
|
546
|
+
hint: "Used to calculate shipping costs."
|
|
547
|
+
}), /* @__PURE__ */ m(o, {
|
|
548
|
+
label: "Weight Unit",
|
|
549
|
+
value: M.weightUnit,
|
|
550
|
+
onChange: (e) => q("weightUnit", e.target.value),
|
|
551
|
+
options: _
|
|
552
|
+
})]
|
|
553
|
+
}),
|
|
554
|
+
/* @__PURE__ */ h("div", {
|
|
555
|
+
className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
|
|
556
|
+
children: [
|
|
557
|
+
/* @__PURE__ */ m(a, {
|
|
558
|
+
label: "Length",
|
|
559
|
+
type: "number",
|
|
560
|
+
value: M.length,
|
|
561
|
+
onChange: (e) => q("length", e.target.value),
|
|
562
|
+
placeholder: "0.0",
|
|
563
|
+
min: 0,
|
|
564
|
+
step: "0.01"
|
|
565
|
+
}),
|
|
566
|
+
/* @__PURE__ */ m(a, {
|
|
567
|
+
label: "Width",
|
|
568
|
+
type: "number",
|
|
569
|
+
value: M.width,
|
|
570
|
+
onChange: (e) => q("width", e.target.value),
|
|
571
|
+
placeholder: "0.0",
|
|
572
|
+
min: 0,
|
|
573
|
+
step: "0.01"
|
|
574
|
+
}),
|
|
575
|
+
/* @__PURE__ */ m(a, {
|
|
576
|
+
label: "Height",
|
|
577
|
+
type: "number",
|
|
578
|
+
value: M.height,
|
|
579
|
+
onChange: (e) => q("height", e.target.value),
|
|
580
|
+
placeholder: "0.0",
|
|
581
|
+
min: 0,
|
|
582
|
+
step: "0.01"
|
|
583
|
+
})
|
|
584
|
+
]
|
|
585
|
+
}),
|
|
586
|
+
/* @__PURE__ */ m(o, {
|
|
587
|
+
label: "Dimension Unit",
|
|
588
|
+
value: M.dimensionUnit,
|
|
589
|
+
onChange: (e) => q("dimensionUnit", e.target.value),
|
|
590
|
+
options: v,
|
|
591
|
+
hint: "Applies to length, width, and height above."
|
|
592
|
+
})
|
|
593
|
+
] })]
|
|
341
594
|
})
|
|
342
595
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ m(r, {
|
|
344
597
|
title: "Product Details",
|
|
345
598
|
description: "Optional supplemental information for buyers.",
|
|
346
|
-
children: /* @__PURE__ */
|
|
599
|
+
children: /* @__PURE__ */ h("div", {
|
|
347
600
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
348
601
|
children: [
|
|
349
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ h("div", {
|
|
350
603
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
604
|
+
children: [/* @__PURE__ */ m(a, {
|
|
352
605
|
label: "Brand",
|
|
353
|
-
value:
|
|
354
|
-
onChange: (e) =>
|
|
606
|
+
value: M.brand,
|
|
607
|
+
onChange: (e) => q("brand", e.target.value),
|
|
355
608
|
placeholder: "e.g. Logitech"
|
|
356
|
-
}), /* @__PURE__ */
|
|
357
|
-
label: "
|
|
358
|
-
value:
|
|
359
|
-
onChange: (e) =>
|
|
360
|
-
placeholder: "e.g.
|
|
609
|
+
}), /* @__PURE__ */ m(a, {
|
|
610
|
+
label: "Manufacturer",
|
|
611
|
+
value: M.manufacturer,
|
|
612
|
+
onChange: (e) => q("manufacturer", e.target.value),
|
|
613
|
+
placeholder: "e.g. Logitech Manufacturing Ltd."
|
|
361
614
|
})]
|
|
362
615
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ m(a, {
|
|
617
|
+
label: "Country of Origin",
|
|
618
|
+
value: M.countryOfOrigin,
|
|
619
|
+
onChange: (e) => q("countryOfOrigin", e.target.value),
|
|
620
|
+
placeholder: "e.g. China"
|
|
621
|
+
}),
|
|
622
|
+
/* @__PURE__ */ m(a, {
|
|
364
623
|
label: "Warranty Info",
|
|
365
|
-
value:
|
|
366
|
-
onChange: (e) =>
|
|
624
|
+
value: M.warrantyInfo,
|
|
625
|
+
onChange: (e) => q("warrantyInfo", e.target.value),
|
|
367
626
|
placeholder: "e.g. 1-year limited manufacturer warranty"
|
|
368
627
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ m(s, {
|
|
370
629
|
label: "Return Policy",
|
|
371
|
-
value:
|
|
372
|
-
onChange: (e) =>
|
|
630
|
+
value: M.returnPolicy,
|
|
631
|
+
onChange: (e) => q("returnPolicy", e.target.value),
|
|
373
632
|
rows: 3,
|
|
374
633
|
placeholder: "e.g. 30-day returns accepted"
|
|
375
634
|
})
|
|
376
635
|
]
|
|
377
636
|
})
|
|
378
637
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ h("div", {
|
|
380
639
|
className: "flex flex-wrap items-center gap-3 pb-8",
|
|
381
640
|
children: [
|
|
382
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ m("button", {
|
|
383
642
|
type: "button",
|
|
384
|
-
onClick: () =>
|
|
643
|
+
onClick: () => y?.(`${C}/seller/items`),
|
|
385
644
|
className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
386
645
|
children: "Cancel"
|
|
387
646
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ m("button", {
|
|
389
648
|
type: "button",
|
|
390
|
-
onClick: () => void
|
|
391
|
-
disabled: !
|
|
392
|
-
"aria-disabled": !
|
|
393
|
-
title:
|
|
649
|
+
onClick: () => void Q(!1),
|
|
650
|
+
disabled: !G || B,
|
|
651
|
+
"aria-disabled": !G || B,
|
|
652
|
+
title: G ? void 0 : "Fill in all required fields to continue",
|
|
394
653
|
className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "border border-border-strong bg-bg-surface text-text-primary", "hover:bg-bg-sunken", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
395
|
-
children:
|
|
654
|
+
children: B ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
|
|
396
655
|
size: 15,
|
|
397
656
|
className: "animate-spin"
|
|
398
657
|
}), "Saving..."] }) : "Save Changes"
|
|
399
658
|
}),
|
|
400
|
-
|
|
659
|
+
$ && /* @__PURE__ */ m("button", {
|
|
401
660
|
type: "button",
|
|
402
|
-
onClick: () => void
|
|
403
|
-
disabled: !
|
|
404
|
-
"aria-disabled": !
|
|
661
|
+
onClick: () => void Q(!0),
|
|
662
|
+
disabled: !G || B,
|
|
663
|
+
"aria-disabled": !G || B,
|
|
405
664
|
className: t("inline-flex items-center gap-2 rounded-button px-5 py-2 text-sm font-medium transition-colors", "bg-action-primary-bg text-action-primary-text", "hover:bg-action-primary-bg/90", "disabled:opacity-50 disabled:cursor-not-allowed"),
|
|
406
|
-
children:
|
|
665
|
+
children: B ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(f, {
|
|
407
666
|
size: 15,
|
|
408
667
|
className: "animate-spin"
|
|
409
668
|
}), "Saving..."] }) : "Save & Resubmit for Review"
|