@burdenoff/microfe-devportal 2026.914.5 → 2026.914.6
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/pages/CreatePhysicalItemPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreatePhysicalItemPage.js +237 -236
- package/dist/devportal/pages/CreatePhysicalItemPage.js.map +1 -1
- package/dist/devportal/providers/DevportalProvider.d.ts.map +1 -1
- package/dist/devportal/providers/DevportalProvider.js +31 -30
- package/dist/devportal/providers/DevportalProvider.js.map +1 -1
- package/dist/devportal/types/index.d.ts +9 -0
- package/dist/devportal/types/index.d.ts.map +1 -1
- package/dist/devportal/types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,13 +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 { usePackageUpload as
|
|
6
|
-
import { useSellerOrganization as
|
|
7
|
-
import { useCallback as l, useRef as
|
|
8
|
-
import { AlertTriangle as
|
|
9
|
-
import { Fragment as
|
|
5
|
+
import { usePackageUpload as ee } from "../hooks/usePackageUpload.js";
|
|
6
|
+
import { useSellerOrganization as c } from "../hooks/useSellerOrganization.js";
|
|
7
|
+
import { useCallback as l, useRef as u, useState as d } from "react";
|
|
8
|
+
import { AlertTriangle as f, Info as p, Loader2 as m, RotateCw as te, Upload as h, X as g } from "lucide-react";
|
|
9
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
10
10
|
//#region src/devportal/pages/CreatePhysicalItemPage.tsx
|
|
11
|
-
var
|
|
11
|
+
var b = [
|
|
12
12
|
{
|
|
13
13
|
value: "MERCHANDISE",
|
|
14
14
|
label: "Merchandise"
|
|
@@ -41,7 +41,7 @@ var v = [
|
|
|
41
41
|
value: "CONSUMABLE",
|
|
42
42
|
label: "Consumable"
|
|
43
43
|
}
|
|
44
|
-
],
|
|
44
|
+
], ne = [
|
|
45
45
|
{
|
|
46
46
|
value: "agri-seeds",
|
|
47
47
|
label: "Agri-Inputs — Seeds"
|
|
@@ -62,7 +62,7 @@ var v = [
|
|
|
62
62
|
value: "agri-irrigation",
|
|
63
63
|
label: "Agri-Inputs — Irrigation"
|
|
64
64
|
}
|
|
65
|
-
],
|
|
65
|
+
], re = [
|
|
66
66
|
{
|
|
67
67
|
value: "USD",
|
|
68
68
|
label: "USD — US Dollar"
|
|
@@ -87,7 +87,7 @@ var v = [
|
|
|
87
87
|
value: "AED",
|
|
88
88
|
label: "AED — UAE Dirham"
|
|
89
89
|
}
|
|
90
|
-
],
|
|
90
|
+
], ie = [
|
|
91
91
|
{
|
|
92
92
|
value: "GRAM",
|
|
93
93
|
label: "Grams (g)"
|
|
@@ -104,7 +104,7 @@ var v = [
|
|
|
104
104
|
value: "POUND",
|
|
105
105
|
label: "Pounds (lb)"
|
|
106
106
|
}
|
|
107
|
-
],
|
|
107
|
+
], ae = [
|
|
108
108
|
{
|
|
109
109
|
value: "CENTIMETER",
|
|
110
110
|
label: "Centimeters (cm)"
|
|
@@ -125,18 +125,18 @@ var v = [
|
|
|
125
125
|
"price",
|
|
126
126
|
"currency",
|
|
127
127
|
"stockQuantity"
|
|
128
|
-
],
|
|
129
|
-
function
|
|
128
|
+
], oe = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\n", se = "\n mutation RegisterPublisher($input: RegisterPublisherInput!) {\n registerPublisher(input: $input) {\n id\n name\n email\n }\n }\n", ce = "\n mutation CreatePhysicalProduct($input: CreatePhysicalProductInput!) {\n createPhysicalProduct(input: $input) {\n id\n name\n slug\n status\n nature\n type\n price\n currency\n }\n }\n", S = "\n mutation SubmitProduct($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
|
|
129
|
+
function C(e) {
|
|
130
130
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function w(e) {
|
|
133
133
|
return x.every((t) => {
|
|
134
134
|
let n = e[t];
|
|
135
135
|
return typeof n == "boolean" ? !0 : n.trim() !== "";
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
var
|
|
139
|
-
let { navigate: x, basePath:
|
|
138
|
+
var T = () => {
|
|
139
|
+
let { navigate: x, basePath: T, productId: E, apiGatewayUrl: D, authToken: O, workspacesGatewayUrl: k, workspaceId: le, getWorkspaceToken: ue } = e(), { organization: A, organizations: j, loading: M, error: N, selectOrganization: P } = c(), [F, I] = d({
|
|
140
140
|
name: "",
|
|
141
141
|
slug: "",
|
|
142
142
|
type: "",
|
|
@@ -163,68 +163,68 @@ var O = () => {
|
|
|
163
163
|
countryOfOrigin: "",
|
|
164
164
|
warrantyInfo: "",
|
|
165
165
|
returnPolicy: ""
|
|
166
|
-
}), [
|
|
167
|
-
|
|
166
|
+
}), [L, R] = d([]), [z, B] = d(!1), V = u(null), { upload: H } = ee(k, O, le, ue, "/DevPortal/Assets"), [U, W] = d(!1), [G, K] = d(null), [de, fe] = d(!1), pe = L.some((e) => e.uploading), q = w(F) && !!A && !pe, me = `${D || ""}/global/graphql`, J = (e, t) => {
|
|
167
|
+
I((n) => ({
|
|
168
168
|
...n,
|
|
169
169
|
[e]: t
|
|
170
170
|
}));
|
|
171
|
-
},
|
|
171
|
+
}, Y = (e) => {
|
|
172
172
|
let t = e.target.value;
|
|
173
|
-
|
|
173
|
+
I((e) => ({
|
|
174
174
|
...e,
|
|
175
175
|
name: t,
|
|
176
|
-
slug:
|
|
176
|
+
slug: C(t)
|
|
177
177
|
}));
|
|
178
178
|
}, X = (e) => (t) => {
|
|
179
|
-
|
|
179
|
+
J(e, t.target.checked);
|
|
180
180
|
}, Z = l((e, t) => {
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
H(t).then((t) => {
|
|
182
|
+
R((n) => n.map((n) => n.id === e ? {
|
|
183
183
|
...n,
|
|
184
184
|
uploading: !1,
|
|
185
185
|
downloadUrl: t.downloadUrl,
|
|
186
186
|
error: void 0
|
|
187
187
|
} : n));
|
|
188
188
|
}).catch((t) => {
|
|
189
|
-
|
|
189
|
+
R((n) => n.map((n) => n.id === e ? {
|
|
190
190
|
...n,
|
|
191
191
|
uploading: !1,
|
|
192
192
|
error: t instanceof Error ? t.message : "Upload failed"
|
|
193
193
|
} : n));
|
|
194
194
|
});
|
|
195
|
-
}, [
|
|
195
|
+
}, [H]), Q = l((e) => {
|
|
196
196
|
let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
|
|
197
197
|
id: crypto.randomUUID(),
|
|
198
198
|
file: e,
|
|
199
199
|
url: URL.createObjectURL(e),
|
|
200
200
|
uploading: !0
|
|
201
201
|
}));
|
|
202
|
-
|
|
203
|
-
}, [Z]),
|
|
202
|
+
R((e) => [...e, ...t]), t.forEach((e) => Z(e.id, e.file));
|
|
203
|
+
}, [Z]), he = (e) => {
|
|
204
204
|
e.target.files && Q(e.target.files), e.target.value = "";
|
|
205
|
-
}, he = (e) => {
|
|
206
|
-
e.preventDefault(), V(!1), e.dataTransfer.files && Q(e.dataTransfer.files);
|
|
207
205
|
}, ge = (e) => {
|
|
208
|
-
e.preventDefault(),
|
|
209
|
-
}, _e = (
|
|
210
|
-
|
|
206
|
+
e.preventDefault(), B(!1), e.dataTransfer.files && Q(e.dataTransfer.files);
|
|
207
|
+
}, _e = (e) => {
|
|
208
|
+
e.preventDefault(), B(!0);
|
|
209
|
+
}, ve = () => B(!1), ye = (e) => {
|
|
210
|
+
R((t) => {
|
|
211
211
|
let n = t.find((t) => t.id === e);
|
|
212
212
|
return n && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
|
|
213
213
|
});
|
|
214
|
-
},
|
|
215
|
-
let t =
|
|
216
|
-
t && (
|
|
214
|
+
}, be = (e) => {
|
|
215
|
+
let t = L.find((t) => t.id === e);
|
|
216
|
+
t && (R((t) => t.map((t) => t.id === e ? {
|
|
217
217
|
...t,
|
|
218
218
|
uploading: !0,
|
|
219
219
|
error: void 0
|
|
220
220
|
} : t)), Z(e, t.file));
|
|
221
221
|
};
|
|
222
222
|
async function $(e, t) {
|
|
223
|
-
let n = await (await fetch(
|
|
223
|
+
let n = await (await fetch(me, {
|
|
224
224
|
method: "POST",
|
|
225
225
|
headers: {
|
|
226
226
|
"Content-Type": "application/json",
|
|
227
|
-
...
|
|
227
|
+
...O ? { Authorization: `Bearer ${O}` } : {}
|
|
228
228
|
},
|
|
229
229
|
credentials: "include",
|
|
230
230
|
body: JSON.stringify({
|
|
@@ -235,188 +235,188 @@ var O = () => {
|
|
|
235
235
|
if (n.errors?.length) throw Error(n.errors.map((e) => e.message).join("; "));
|
|
236
236
|
return n.data;
|
|
237
237
|
}
|
|
238
|
-
return /* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ v(n, {
|
|
239
239
|
title: "List a Physical Item",
|
|
240
240
|
description: "Fill in all required details. Your listing will be reviewed before it appears in the store.",
|
|
241
241
|
backLink: "/seller/items",
|
|
242
242
|
backLabel: "Back to My Items",
|
|
243
|
-
children: /* @__PURE__ */
|
|
243
|
+
children: /* @__PURE__ */ y("div", {
|
|
244
244
|
className: "space-y-8 max-w-3xl",
|
|
245
245
|
children: [
|
|
246
|
-
|
|
246
|
+
de && /* @__PURE__ */ v("div", {
|
|
247
247
|
className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
|
|
248
248
|
children: "Your listing has been submitted for review! Redirecting..."
|
|
249
249
|
}),
|
|
250
|
-
|
|
250
|
+
G && /* @__PURE__ */ v("div", {
|
|
251
251
|
className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
252
|
-
children:
|
|
252
|
+
children: G
|
|
253
253
|
}),
|
|
254
|
-
|
|
254
|
+
N && /* @__PURE__ */ y("div", {
|
|
255
255
|
className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
256
|
-
children: ["Couldn't set up your seller organization: ",
|
|
256
|
+
children: ["Couldn't set up your seller organization: ", N]
|
|
257
257
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ v(r, {
|
|
259
259
|
title: "Seller Organization",
|
|
260
260
|
description: "The seller organization this item will be listed under.",
|
|
261
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ v("div", {
|
|
262
262
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-3",
|
|
263
|
-
children: /* @__PURE__ */
|
|
263
|
+
children: /* @__PURE__ */ v(o, {
|
|
264
264
|
label: "Organization",
|
|
265
265
|
required: !0,
|
|
266
|
-
value:
|
|
267
|
-
onChange: (e) =>
|
|
268
|
-
options:
|
|
266
|
+
value: A?.id ?? "",
|
|
267
|
+
onChange: (e) => P(e.target.value),
|
|
268
|
+
options: j.map((e) => ({
|
|
269
269
|
value: e.id,
|
|
270
270
|
label: e.name
|
|
271
271
|
})),
|
|
272
|
-
placeholder:
|
|
273
|
-
disabled:
|
|
274
|
-
hint:
|
|
272
|
+
placeholder: M ? "Resolving your seller organization…" : "Select an organization",
|
|
273
|
+
disabled: M || j.length <= 1,
|
|
274
|
+
hint: j.length > 1 ? "You have more than one seller organization — pick the one this item belongs to." : A ? `Automatically set to your only seller organization, "${A.name}".` : void 0
|
|
275
275
|
})
|
|
276
276
|
})
|
|
277
277
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ v(r, {
|
|
279
279
|
title: "Basic Information",
|
|
280
280
|
description: "Core details shown in the store listing.",
|
|
281
|
-
children: /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */ y("div", {
|
|
282
282
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
283
283
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ v(a, {
|
|
285
285
|
label: "Name",
|
|
286
286
|
required: !0,
|
|
287
|
-
value:
|
|
288
|
-
onChange:
|
|
287
|
+
value: F.name,
|
|
288
|
+
onChange: Y,
|
|
289
289
|
placeholder: "e.g. Wireless Ergonomic Keyboard",
|
|
290
290
|
maxLength: 120
|
|
291
291
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ v(a, {
|
|
293
293
|
label: "Slug",
|
|
294
294
|
required: !0,
|
|
295
|
-
value:
|
|
296
|
-
onChange: (e) =>
|
|
295
|
+
value: F.slug,
|
|
296
|
+
onChange: (e) => J("slug", e.target.value),
|
|
297
297
|
placeholder: "auto-derived-from-name",
|
|
298
298
|
hint: "URL-friendly identifier. Auto-derived from name; you can edit it."
|
|
299
299
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ v(o, {
|
|
301
301
|
label: "Product Type",
|
|
302
302
|
required: !0,
|
|
303
|
-
value:
|
|
304
|
-
onChange: (e) =>
|
|
305
|
-
options:
|
|
303
|
+
value: F.type,
|
|
304
|
+
onChange: (e) => J("type", e.target.value),
|
|
305
|
+
options: b,
|
|
306
306
|
placeholder: "Select a type"
|
|
307
307
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ v(o, {
|
|
309
309
|
label: "Store Category",
|
|
310
|
-
value:
|
|
311
|
-
onChange: (e) =>
|
|
312
|
-
options:
|
|
310
|
+
value: F.category,
|
|
311
|
+
onChange: (e) => J("category", e.target.value),
|
|
312
|
+
options: ne,
|
|
313
313
|
placeholder: "General / uncategorised",
|
|
314
314
|
hint: "Pick an Agri-Inputs category to list this item in the HealthyBowl Agri-Inputs Store. Leave blank for a general store listing."
|
|
315
315
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ v(a, {
|
|
317
317
|
label: "Short Description",
|
|
318
318
|
required: !0,
|
|
319
|
-
value:
|
|
320
|
-
onChange: (e) =>
|
|
319
|
+
value: F.shortDescription,
|
|
320
|
+
onChange: (e) => J("shortDescription", e.target.value),
|
|
321
321
|
placeholder: "One-line summary shown on the store card",
|
|
322
322
|
maxLength: 160,
|
|
323
|
-
hint: `${
|
|
323
|
+
hint: `${F.shortDescription.length}/160`
|
|
324
324
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ v(s, {
|
|
326
326
|
label: "Long Description",
|
|
327
|
-
value:
|
|
328
|
-
onChange: (e) =>
|
|
327
|
+
value: F.longDescription,
|
|
328
|
+
onChange: (e) => J("longDescription", e.target.value),
|
|
329
329
|
rows: 5,
|
|
330
330
|
placeholder: "Detailed product description, features, specs…"
|
|
331
331
|
})
|
|
332
332
|
]
|
|
333
333
|
})
|
|
334
334
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ v(r, {
|
|
336
336
|
title: "Product Images",
|
|
337
337
|
description: "The first image is used as the main icon.",
|
|
338
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ y("div", {
|
|
339
339
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
|
|
340
340
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
onDrop:
|
|
343
|
-
onDragOver:
|
|
344
|
-
onDragLeave:
|
|
345
|
-
onClick: () =>
|
|
346
|
-
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",
|
|
341
|
+
/* @__PURE__ */ y("div", {
|
|
342
|
+
onDrop: ge,
|
|
343
|
+
onDragOver: _e,
|
|
344
|
+
onDragLeave: ve,
|
|
345
|
+
onClick: () => V.current?.click(),
|
|
346
|
+
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", z ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
|
|
347
347
|
children: [
|
|
348
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ v(h, {
|
|
349
349
|
size: 28,
|
|
350
|
-
className:
|
|
350
|
+
className: z ? "text-action-primary-bg" : "text-text-muted"
|
|
351
351
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ y("div", {
|
|
353
353
|
className: "text-center space-y-1",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ v("p", {
|
|
355
355
|
className: "text-sm font-medium text-text-primary",
|
|
356
356
|
children: "Drag and drop images here"
|
|
357
|
-
}), /* @__PURE__ */
|
|
357
|
+
}), /* @__PURE__ */ v("p", {
|
|
358
358
|
className: "text-xs text-text-muted",
|
|
359
359
|
children: "or click to browse — accepts any image format, multiple files"
|
|
360
360
|
})]
|
|
361
361
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
ref:
|
|
362
|
+
/* @__PURE__ */ v("input", {
|
|
363
|
+
ref: V,
|
|
364
364
|
type: "file",
|
|
365
365
|
accept: "image/*",
|
|
366
366
|
multiple: !0,
|
|
367
367
|
className: "sr-only",
|
|
368
|
-
onChange:
|
|
368
|
+
onChange: he
|
|
369
369
|
})
|
|
370
370
|
]
|
|
371
371
|
}),
|
|
372
|
-
|
|
372
|
+
L.length > 0 && /* @__PURE__ */ v("div", {
|
|
373
373
|
className: "flex flex-wrap gap-3",
|
|
374
374
|
children: (() => {
|
|
375
|
-
let e =
|
|
376
|
-
return
|
|
375
|
+
let e = L.find((e) => e.downloadUrl)?.id;
|
|
376
|
+
return L.map((n, r) => /* @__PURE__ */ y("div", {
|
|
377
377
|
className: "relative group",
|
|
378
378
|
children: [
|
|
379
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ v("img", {
|
|
380
380
|
src: n.url,
|
|
381
381
|
alt: `Product image ${r + 1}`,
|
|
382
382
|
className: t("h-20 w-20 rounded-input object-cover border", n.error ? "border-status-error-text/50" : "border-border-subtle")
|
|
383
383
|
}),
|
|
384
|
-
n.uploading && /* @__PURE__ */
|
|
384
|
+
n.uploading && /* @__PURE__ */ v("div", {
|
|
385
385
|
className: "absolute inset-0 flex items-center justify-center rounded-input bg-bg-overlay",
|
|
386
|
-
children: /* @__PURE__ */
|
|
386
|
+
children: /* @__PURE__ */ v(m, {
|
|
387
387
|
size: 16,
|
|
388
388
|
className: "animate-spin text-white"
|
|
389
389
|
})
|
|
390
390
|
}),
|
|
391
|
-
n.error && /* @__PURE__ */
|
|
391
|
+
n.error && /* @__PURE__ */ y("button", {
|
|
392
392
|
type: "button",
|
|
393
393
|
onClick: (e) => {
|
|
394
|
-
e.stopPropagation(),
|
|
394
|
+
e.stopPropagation(), be(n.id);
|
|
395
395
|
},
|
|
396
396
|
title: `${n.error} — click to retry`,
|
|
397
397
|
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",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ v(f, { size: 14 }), /* @__PURE__ */ v(te, { size: 11 })]
|
|
399
399
|
}),
|
|
400
|
-
n.id === e && /* @__PURE__ */
|
|
400
|
+
n.id === e && /* @__PURE__ */ v("span", {
|
|
401
401
|
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",
|
|
402
402
|
children: "Main"
|
|
403
403
|
}),
|
|
404
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ v("button", {
|
|
405
405
|
type: "button",
|
|
406
406
|
onClick: (e) => {
|
|
407
|
-
e.stopPropagation(),
|
|
407
|
+
e.stopPropagation(), ye(n.id);
|
|
408
408
|
},
|
|
409
409
|
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",
|
|
410
410
|
"aria-label": "Remove image",
|
|
411
|
-
children: /* @__PURE__ */ g
|
|
411
|
+
children: /* @__PURE__ */ v(g, { size: 11 })
|
|
412
412
|
})
|
|
413
413
|
]
|
|
414
414
|
}, n.id));
|
|
415
415
|
})()
|
|
416
416
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ y("p", {
|
|
418
418
|
className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
419
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ v(p, {
|
|
420
420
|
size: 13,
|
|
421
421
|
className: "mt-0.5 shrink-0 text-text-muted"
|
|
422
422
|
}), "At least 1 image helps buyers — high quality photos increase conversions. The first image becomes the main icon."]
|
|
@@ -424,159 +424,159 @@ var O = () => {
|
|
|
424
424
|
]
|
|
425
425
|
})
|
|
426
426
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ v(r, {
|
|
428
428
|
title: "Pricing",
|
|
429
|
-
children: /* @__PURE__ */
|
|
429
|
+
children: /* @__PURE__ */ y("div", {
|
|
430
430
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ y("div", {
|
|
432
432
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
433
|
-
children: [/* @__PURE__ */
|
|
433
|
+
children: [/* @__PURE__ */ v(a, {
|
|
434
434
|
label: "Price",
|
|
435
435
|
required: !0,
|
|
436
436
|
type: "number",
|
|
437
|
-
value:
|
|
438
|
-
onChange: (e) =>
|
|
437
|
+
value: F.price,
|
|
438
|
+
onChange: (e) => J("price", e.target.value),
|
|
439
439
|
placeholder: "0.00",
|
|
440
440
|
min: .01,
|
|
441
441
|
step: "0.01"
|
|
442
|
-
}), /* @__PURE__ */
|
|
442
|
+
}), /* @__PURE__ */ v(o, {
|
|
443
443
|
label: "Currency",
|
|
444
444
|
required: !0,
|
|
445
|
-
value:
|
|
446
|
-
onChange: (e) =>
|
|
447
|
-
options:
|
|
445
|
+
value: F.currency,
|
|
446
|
+
onChange: (e) => J("currency", e.target.value),
|
|
447
|
+
options: re,
|
|
448
448
|
placeholder: "Select currency"
|
|
449
449
|
})]
|
|
450
|
-
}), /* @__PURE__ */
|
|
450
|
+
}), /* @__PURE__ */ v(a, {
|
|
451
451
|
label: "Tags",
|
|
452
|
-
value:
|
|
453
|
-
onChange: (e) =>
|
|
452
|
+
value: F.tags,
|
|
453
|
+
onChange: (e) => J("tags", e.target.value),
|
|
454
454
|
placeholder: "mechanical, wireless, ergonomic",
|
|
455
455
|
hint: "Comma-separated keywords to help buyers find your item."
|
|
456
456
|
})]
|
|
457
457
|
})
|
|
458
458
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ v(r, {
|
|
460
460
|
title: "Inventory",
|
|
461
|
-
children: /* @__PURE__ */
|
|
461
|
+
children: /* @__PURE__ */ y("div", {
|
|
462
462
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
463
463
|
children: [
|
|
464
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ y("div", {
|
|
465
465
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
466
|
-
children: [/* @__PURE__ */
|
|
466
|
+
children: [/* @__PURE__ */ v(a, {
|
|
467
467
|
label: "Stock Quantity",
|
|
468
468
|
required: !0,
|
|
469
469
|
type: "number",
|
|
470
|
-
value:
|
|
471
|
-
onChange: (e) =>
|
|
470
|
+
value: F.stockQuantity,
|
|
471
|
+
onChange: (e) => J("stockQuantity", e.target.value),
|
|
472
472
|
min: 0,
|
|
473
473
|
step: 1
|
|
474
|
-
}), /* @__PURE__ */
|
|
474
|
+
}), /* @__PURE__ */ v(a, {
|
|
475
475
|
label: "SKU",
|
|
476
|
-
value:
|
|
477
|
-
onChange: (e) =>
|
|
476
|
+
value: F.sku,
|
|
477
|
+
onChange: (e) => J("sku", e.target.value),
|
|
478
478
|
placeholder: "e.g. KB-WL-001",
|
|
479
479
|
hint: "Your internal stock-keeping unit reference."
|
|
480
480
|
})]
|
|
481
481
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ v(a, {
|
|
483
483
|
label: "Low Stock Threshold",
|
|
484
484
|
type: "number",
|
|
485
|
-
value:
|
|
486
|
-
onChange: (e) =>
|
|
485
|
+
value: F.lowStockThreshold,
|
|
486
|
+
onChange: (e) => J("lowStockThreshold", e.target.value),
|
|
487
487
|
placeholder: "e.g. 5",
|
|
488
488
|
min: 0,
|
|
489
489
|
step: 1,
|
|
490
490
|
hint: "Get flagged when stock falls to or below this number."
|
|
491
491
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ v(i, {
|
|
493
493
|
label: "Track Inventory",
|
|
494
494
|
description: "Automatically reduce stock when orders are placed.",
|
|
495
|
-
checked:
|
|
495
|
+
checked: F.trackInventory,
|
|
496
496
|
onChange: X("trackInventory")
|
|
497
497
|
}),
|
|
498
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ v(i, {
|
|
499
499
|
label: "Allow Backorder",
|
|
500
500
|
description: "Let buyers order even when stock quantity is zero.",
|
|
501
|
-
checked:
|
|
501
|
+
checked: F.allowBackorder,
|
|
502
502
|
onChange: X("allowBackorder")
|
|
503
503
|
})
|
|
504
504
|
]
|
|
505
505
|
})
|
|
506
506
|
}),
|
|
507
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ v(r, {
|
|
508
508
|
title: "Shipping",
|
|
509
|
-
children: /* @__PURE__ */
|
|
509
|
+
children: /* @__PURE__ */ y("div", {
|
|
510
510
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
511
511
|
children: [
|
|
512
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ v(i, {
|
|
513
513
|
label: "Requires Shipping",
|
|
514
514
|
description: "This item will be physically shipped to the buyer.",
|
|
515
|
-
checked:
|
|
515
|
+
checked: F.requiresShipping,
|
|
516
516
|
onChange: X("requiresShipping")
|
|
517
517
|
}),
|
|
518
|
-
|
|
519
|
-
/* @__PURE__ */
|
|
518
|
+
F.requiresShipping && /* @__PURE__ */ y(_, { children: [
|
|
519
|
+
/* @__PURE__ */ y("div", {
|
|
520
520
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
521
|
-
children: [/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ v(a, {
|
|
522
522
|
label: "Weight",
|
|
523
523
|
type: "number",
|
|
524
|
-
value:
|
|
525
|
-
onChange: (e) =>
|
|
524
|
+
value: F.weightKg,
|
|
525
|
+
onChange: (e) => J("weightKg", e.target.value),
|
|
526
526
|
placeholder: "0.0",
|
|
527
527
|
min: 0,
|
|
528
528
|
step: "0.01",
|
|
529
529
|
hint: "Used to calculate shipping costs."
|
|
530
|
-
}), /* @__PURE__ */
|
|
530
|
+
}), /* @__PURE__ */ v(o, {
|
|
531
531
|
label: "Weight Unit",
|
|
532
|
-
value:
|
|
533
|
-
onChange: (e) =>
|
|
534
|
-
options:
|
|
532
|
+
value: F.weightUnit,
|
|
533
|
+
onChange: (e) => J("weightUnit", e.target.value),
|
|
534
|
+
options: ie
|
|
535
535
|
})]
|
|
536
536
|
}),
|
|
537
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ y("div", {
|
|
538
538
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
|
|
539
539
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ v(a, {
|
|
541
541
|
label: "Length",
|
|
542
542
|
type: "number",
|
|
543
|
-
value:
|
|
544
|
-
onChange: (e) =>
|
|
543
|
+
value: F.length,
|
|
544
|
+
onChange: (e) => J("length", e.target.value),
|
|
545
545
|
placeholder: "0.0",
|
|
546
546
|
min: 0,
|
|
547
547
|
step: "0.01"
|
|
548
548
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ v(a, {
|
|
550
550
|
label: "Width",
|
|
551
551
|
type: "number",
|
|
552
|
-
value:
|
|
553
|
-
onChange: (e) =>
|
|
552
|
+
value: F.width,
|
|
553
|
+
onChange: (e) => J("width", e.target.value),
|
|
554
554
|
placeholder: "0.0",
|
|
555
555
|
min: 0,
|
|
556
556
|
step: "0.01"
|
|
557
557
|
}),
|
|
558
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ v(a, {
|
|
559
559
|
label: "Height",
|
|
560
560
|
type: "number",
|
|
561
|
-
value:
|
|
562
|
-
onChange: (e) =>
|
|
561
|
+
value: F.height,
|
|
562
|
+
onChange: (e) => J("height", e.target.value),
|
|
563
563
|
placeholder: "0.0",
|
|
564
564
|
min: 0,
|
|
565
565
|
step: "0.01"
|
|
566
566
|
})
|
|
567
567
|
]
|
|
568
568
|
}),
|
|
569
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ v(o, {
|
|
570
570
|
label: "Dimension Unit",
|
|
571
|
-
value:
|
|
572
|
-
onChange: (e) =>
|
|
573
|
-
options:
|
|
571
|
+
value: F.dimensionUnit,
|
|
572
|
+
onChange: (e) => J("dimensionUnit", e.target.value),
|
|
573
|
+
options: ae,
|
|
574
574
|
hint: "Applies to length, width, and height above."
|
|
575
575
|
})
|
|
576
576
|
] }),
|
|
577
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ y("p", {
|
|
578
578
|
className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
579
|
-
children: [/* @__PURE__ */
|
|
579
|
+
children: [/* @__PURE__ */ v(p, {
|
|
580
580
|
size: 13,
|
|
581
581
|
className: "mt-0.5 shrink-0 text-text-muted"
|
|
582
582
|
}), "Delivery fees are configured at the organization level in store settings."]
|
|
@@ -584,124 +584,125 @@ var O = () => {
|
|
|
584
584
|
]
|
|
585
585
|
})
|
|
586
586
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ v(r, {
|
|
588
588
|
title: "Product Details",
|
|
589
589
|
description: "Optional supplemental information for buyers.",
|
|
590
|
-
children: /* @__PURE__ */
|
|
590
|
+
children: /* @__PURE__ */ y("div", {
|
|
591
591
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-5",
|
|
592
592
|
children: [
|
|
593
|
-
/* @__PURE__ */
|
|
593
|
+
/* @__PURE__ */ y("div", {
|
|
594
594
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
595
|
-
children: [/* @__PURE__ */
|
|
595
|
+
children: [/* @__PURE__ */ v(a, {
|
|
596
596
|
label: "Brand",
|
|
597
|
-
value:
|
|
598
|
-
onChange: (e) =>
|
|
597
|
+
value: F.brand,
|
|
598
|
+
onChange: (e) => J("brand", e.target.value),
|
|
599
599
|
placeholder: "e.g. Logitech"
|
|
600
|
-
}), /* @__PURE__ */
|
|
600
|
+
}), /* @__PURE__ */ v(a, {
|
|
601
601
|
label: "Manufacturer",
|
|
602
|
-
value:
|
|
603
|
-
onChange: (e) =>
|
|
602
|
+
value: F.manufacturer,
|
|
603
|
+
onChange: (e) => J("manufacturer", e.target.value),
|
|
604
604
|
placeholder: "e.g. Logitech Manufacturing Ltd."
|
|
605
605
|
})]
|
|
606
606
|
}),
|
|
607
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ v(a, {
|
|
608
608
|
label: "Country of Origin",
|
|
609
|
-
value:
|
|
610
|
-
onChange: (e) =>
|
|
609
|
+
value: F.countryOfOrigin,
|
|
610
|
+
onChange: (e) => J("countryOfOrigin", e.target.value),
|
|
611
611
|
placeholder: "e.g. China"
|
|
612
612
|
}),
|
|
613
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ v(a, {
|
|
614
614
|
label: "Warranty Info",
|
|
615
|
-
value:
|
|
616
|
-
onChange: (e) =>
|
|
615
|
+
value: F.warrantyInfo,
|
|
616
|
+
onChange: (e) => J("warrantyInfo", e.target.value),
|
|
617
617
|
placeholder: "e.g. 1-year limited manufacturer warranty"
|
|
618
618
|
}),
|
|
619
|
-
/* @__PURE__ */
|
|
619
|
+
/* @__PURE__ */ v(s, {
|
|
620
620
|
label: "Return Policy",
|
|
621
|
-
value:
|
|
622
|
-
onChange: (e) =>
|
|
621
|
+
value: F.returnPolicy,
|
|
622
|
+
onChange: (e) => J("returnPolicy", e.target.value),
|
|
623
623
|
rows: 3,
|
|
624
624
|
placeholder: "e.g. 30-day returns accepted"
|
|
625
625
|
})
|
|
626
626
|
]
|
|
627
627
|
})
|
|
628
628
|
}),
|
|
629
|
-
/* @__PURE__ */
|
|
629
|
+
/* @__PURE__ */ y("div", {
|
|
630
630
|
className: "flex items-center gap-3 pb-8",
|
|
631
|
-
children: [/* @__PURE__ */
|
|
631
|
+
children: [/* @__PURE__ */ v("button", {
|
|
632
632
|
type: "button",
|
|
633
|
-
onClick: () => x?.(`${
|
|
633
|
+
onClick: () => x?.(`${T}/seller/items`),
|
|
634
634
|
className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
635
635
|
children: "Cancel"
|
|
636
|
-
}), /* @__PURE__ */
|
|
636
|
+
}), /* @__PURE__ */ v("div", {
|
|
637
637
|
className: "relative",
|
|
638
|
-
children: /* @__PURE__ */
|
|
638
|
+
children: /* @__PURE__ */ v("button", {
|
|
639
639
|
type: "button",
|
|
640
640
|
onClick: async () => {
|
|
641
|
-
if (!(!
|
|
642
|
-
|
|
641
|
+
if (!(!q || U || !A)) {
|
|
642
|
+
W(!0), K(null);
|
|
643
643
|
try {
|
|
644
|
-
let e = (await $(
|
|
645
|
-
e ||= (await $(
|
|
646
|
-
name:
|
|
647
|
-
email:
|
|
648
|
-
websiteUrl:
|
|
649
|
-
legalName:
|
|
650
|
-
country:
|
|
651
|
-
contactEmail:
|
|
644
|
+
let e = (await $(oe)).myPublisher?.id ?? null;
|
|
645
|
+
e ||= (await $(se, { input: {
|
|
646
|
+
name: A.legalEntityName ?? A.name,
|
|
647
|
+
email: A.contactEmail ?? "seller@burdenoff.com",
|
|
648
|
+
websiteUrl: A.websiteUrl ?? null,
|
|
649
|
+
legalName: A.legalEntityName ?? A.name,
|
|
650
|
+
country: A.taxCountry ?? null,
|
|
651
|
+
contactEmail: A.contactEmail ?? null
|
|
652
652
|
} })).registerPublisher.id;
|
|
653
|
-
let t =
|
|
654
|
-
name:
|
|
655
|
-
slug:
|
|
656
|
-
type:
|
|
657
|
-
category:
|
|
658
|
-
description:
|
|
659
|
-
longDescription:
|
|
660
|
-
price: parseFloat(
|
|
661
|
-
currency:
|
|
653
|
+
let t = F.tags.split(",").map((e) => e.trim()).filter(Boolean), n = L.map((e) => e.downloadUrl).filter((e) => !!e), r = F.length.trim() || F.width.trim() || F.height.trim(), i = (await $(ce, { input: {
|
|
654
|
+
name: F.name.trim(),
|
|
655
|
+
slug: F.slug.trim(),
|
|
656
|
+
type: F.type,
|
|
657
|
+
category: F.category.trim() || null,
|
|
658
|
+
description: F.shortDescription.trim(),
|
|
659
|
+
longDescription: F.longDescription.trim() || null,
|
|
660
|
+
price: parseFloat(F.price),
|
|
661
|
+
currency: F.currency,
|
|
662
662
|
tags: t.length > 0 ? t : null,
|
|
663
|
-
stockQuantity: parseInt(
|
|
664
|
-
sku:
|
|
665
|
-
trackInventory:
|
|
666
|
-
allowBackorder:
|
|
667
|
-
lowStockThreshold:
|
|
668
|
-
requiresShipping:
|
|
669
|
-
weight:
|
|
670
|
-
weightUnit:
|
|
671
|
-
length:
|
|
672
|
-
width:
|
|
673
|
-
height:
|
|
674
|
-
dimensionUnit:
|
|
675
|
-
brand:
|
|
676
|
-
manufacturer:
|
|
677
|
-
countryOfOrigin:
|
|
678
|
-
warrantyInfo:
|
|
679
|
-
returnPolicy:
|
|
663
|
+
stockQuantity: parseInt(F.stockQuantity, 10),
|
|
664
|
+
sku: F.sku.trim() || null,
|
|
665
|
+
trackInventory: F.trackInventory,
|
|
666
|
+
allowBackorder: F.allowBackorder,
|
|
667
|
+
lowStockThreshold: F.lowStockThreshold.trim() ? parseInt(F.lowStockThreshold, 10) : null,
|
|
668
|
+
requiresShipping: F.requiresShipping,
|
|
669
|
+
weight: F.requiresShipping && F.weightKg.trim() ? parseFloat(F.weightKg) : null,
|
|
670
|
+
weightUnit: F.requiresShipping && F.weightKg.trim() ? F.weightUnit : null,
|
|
671
|
+
length: F.requiresShipping && F.length.trim() ? parseFloat(F.length) : null,
|
|
672
|
+
width: F.requiresShipping && F.width.trim() ? parseFloat(F.width) : null,
|
|
673
|
+
height: F.requiresShipping && F.height.trim() ? parseFloat(F.height) : null,
|
|
674
|
+
dimensionUnit: F.requiresShipping && r ? F.dimensionUnit : null,
|
|
675
|
+
brand: F.brand.trim() || null,
|
|
676
|
+
manufacturer: F.manufacturer.trim() || null,
|
|
677
|
+
countryOfOrigin: F.countryOfOrigin.trim() || null,
|
|
678
|
+
warrantyInfo: F.warrantyInfo.trim() || null,
|
|
679
|
+
returnPolicy: F.returnPolicy.trim() || null,
|
|
680
680
|
icon: n[0] ?? null,
|
|
681
681
|
screenshots: n.length > 1 ? n.slice(1) : null,
|
|
682
|
-
|
|
682
|
+
compatibleProducts: E ? [E] : null,
|
|
683
|
+
organizationId: A.id
|
|
683
684
|
} })).createPhysicalProduct.id;
|
|
684
|
-
await $(
|
|
685
|
+
await $(S, {
|
|
685
686
|
id: i,
|
|
686
687
|
notes: "Submitted from seller portal"
|
|
687
|
-
}),
|
|
688
|
-
x?.(`${
|
|
688
|
+
}), fe(!0), setTimeout(() => {
|
|
689
|
+
x?.(`${T}/seller/items`);
|
|
689
690
|
}, 2e3);
|
|
690
691
|
} catch (e) {
|
|
691
|
-
|
|
692
|
+
K(e instanceof Error ? e.message : "Submission failed. Please try again.");
|
|
692
693
|
} finally {
|
|
693
|
-
|
|
694
|
+
W(!1);
|
|
694
695
|
}
|
|
695
696
|
}
|
|
696
697
|
},
|
|
697
|
-
disabled: !
|
|
698
|
-
"aria-disabled": !
|
|
699
|
-
title:
|
|
698
|
+
disabled: !q || U,
|
|
699
|
+
"aria-disabled": !q || U,
|
|
700
|
+
title: M ? "Setting up your seller organization..." : q ? void 0 : "Fill in all required fields to continue",
|
|
700
701
|
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", "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"),
|
|
701
|
-
children:
|
|
702
|
+
children: U ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(m, {
|
|
702
703
|
size: 15,
|
|
703
704
|
className: "animate-spin"
|
|
704
|
-
}), "Submitting..."] }) :
|
|
705
|
+
}), "Submitting..."] }) : M ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(m, {
|
|
705
706
|
size: 15,
|
|
706
707
|
className: "animate-spin"
|
|
707
708
|
}), "Setting up your store..."] }) : "Create & Submit for Review"
|
|
@@ -713,6 +714,6 @@ var O = () => {
|
|
|
713
714
|
});
|
|
714
715
|
};
|
|
715
716
|
//#endregion
|
|
716
|
-
export {
|
|
717
|
+
export { T as CreatePhysicalItemPage };
|
|
717
718
|
|
|
718
719
|
//# sourceMappingURL=CreatePhysicalItemPage.js.map
|