@burdenoff/microfe-devportal 2026.716.2 → 2026.720.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/PermissionGuard.d.ts +14 -1
- package/dist/devportal/components/PermissionGuard.d.ts.map +1 -1
- package/dist/devportal/components/PermissionGuard.js +16 -13
- package/dist/devportal/components/PermissionGuard.js.map +1 -1
- package/dist/devportal/hooks/usePackageUpload.d.ts.map +1 -1
- package/dist/devportal/hooks/usePackageUpload.js.map +1 -1
- package/dist/devportal/pages/AdminReviewPage.js +9 -9
- package/dist/devportal/pages/ApiKeysPage.js +180 -181
- package/dist/devportal/pages/ApiKeysPage.js.map +1 -1
- package/dist/devportal/pages/ApplicationDetailPage.js +3 -3
- package/dist/devportal/pages/ApplicationVersionsPage.js +4 -4
- package/dist/devportal/pages/ApplicationVersionsPage.js.map +1 -1
- package/dist/devportal/pages/ApplicationsPage.js +4 -4
- package/dist/devportal/pages/ApplicationsPage.js.map +1 -1
- package/dist/devportal/pages/CreateApiKeyPage.js +1 -1
- package/dist/devportal/pages/CreateApplicationPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreateApplicationPage.js.map +1 -1
- package/dist/devportal/pages/CreateOAuthClientPage.js +1 -1
- package/dist/devportal/pages/CreateOrganizationPage.js +1 -1
- package/dist/devportal/pages/CreatePhysicalItemPage.d.ts.map +1 -1
- package/dist/devportal/pages/CreatePhysicalItemPage.js +147 -116
- package/dist/devportal/pages/CreatePhysicalItemPage.js.map +1 -1
- package/dist/devportal/pages/CreateWebhookPage.js +25 -25
- package/dist/devportal/pages/DashboardPage.d.ts.map +1 -1
- package/dist/devportal/pages/DashboardPage.js +110 -111
- package/dist/devportal/pages/DashboardPage.js.map +1 -1
- package/dist/devportal/pages/DelegationsPage.js +1 -1
- package/dist/devportal/pages/EditApplicationPage.d.ts.map +1 -1
- package/dist/devportal/pages/EditApplicationPage.js +4 -4
- package/dist/devportal/pages/EditApplicationPage.js.map +1 -1
- package/dist/devportal/pages/ListingPreviewPage.d.ts.map +1 -1
- package/dist/devportal/pages/ListingPreviewPage.js +160 -161
- package/dist/devportal/pages/ListingPreviewPage.js.map +1 -1
- package/dist/devportal/pages/OAuthClientDetailPage.d.ts.map +1 -1
- package/dist/devportal/pages/OAuthClientDetailPage.js +166 -167
- package/dist/devportal/pages/OAuthClientDetailPage.js.map +1 -1
- package/dist/devportal/pages/OAuthClientsPage.d.ts.map +1 -1
- package/dist/devportal/pages/OAuthClientsPage.js +121 -122
- package/dist/devportal/pages/OAuthClientsPage.js.map +1 -1
- package/dist/devportal/pages/OrganizationDetailPage.js +3 -3
- package/dist/devportal/pages/OrganizationMembersPage.js +4 -4
- package/dist/devportal/pages/OrganizationsPage.js +1 -1
- package/dist/devportal/pages/PublishPage.d.ts.map +1 -1
- package/dist/devportal/pages/PublishPage.js +246 -246
- package/dist/devportal/pages/PublishPage.js.map +1 -1
- package/dist/devportal/pages/PublisherProfilePage.js +4 -4
- package/dist/devportal/pages/PublisherProfilePage.js.map +1 -1
- package/dist/devportal/pages/SellerDashboardPage.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/devportal/pages/StoreSubmissionPage.js +3 -3
- package/dist/devportal/pages/WebhookDetailPage.js +3 -3
- package/dist/devportal/pages/WebhooksPage.js +129 -129
- package/dist/devportal/pages/WebhooksPage.js.map +1 -1
- 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,8 +2,8 @@ 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 { useCallback as
|
|
6
|
-
import { Info as
|
|
5
|
+
import { useCallback as ee, useRef as c, useState as l } from "react";
|
|
6
|
+
import { Info as u, Loader2 as d, Upload as f, X as p } from "lucide-react";
|
|
7
7
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
8
|
//#region src/devportal/pages/CreatePhysicalItemPage.tsx
|
|
9
9
|
var _ = [
|
|
@@ -40,6 +40,27 @@ var _ = [
|
|
|
40
40
|
label: "Consumable"
|
|
41
41
|
}
|
|
42
42
|
], v = [
|
|
43
|
+
{
|
|
44
|
+
value: "agri-seeds",
|
|
45
|
+
label: "Agri-Inputs — Seeds"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: "agri-fertilizer",
|
|
49
|
+
label: "Agri-Inputs — Organic Fertilizer"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: "agri-biopesticide",
|
|
53
|
+
label: "Agri-Inputs — Bio-Pesticides"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
value: "agri-tools",
|
|
57
|
+
label: "Agri-Inputs — Tools"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
value: "agri-irrigation",
|
|
61
|
+
label: "Agri-Inputs — Irrigation"
|
|
62
|
+
}
|
|
63
|
+
], y = [
|
|
43
64
|
{
|
|
44
65
|
value: "USD",
|
|
45
66
|
label: "USD — US Dollar"
|
|
@@ -64,7 +85,7 @@ var _ = [
|
|
|
64
85
|
value: "AED",
|
|
65
86
|
label: "AED — UAE Dirham"
|
|
66
87
|
}
|
|
67
|
-
],
|
|
88
|
+
], b = [
|
|
68
89
|
"name",
|
|
69
90
|
"slug",
|
|
70
91
|
"type",
|
|
@@ -72,21 +93,22 @@ var _ = [
|
|
|
72
93
|
"price",
|
|
73
94
|
"currency",
|
|
74
95
|
"stockQuantity"
|
|
75
|
-
],
|
|
76
|
-
function
|
|
96
|
+
], x = "\n query SellerMyPublisher {\n myPublisher {\n id\n }\n }\n", S = "\n query SellerOrgForPublisher {\n developerOrganizations(limit: 1, offset: 0) {\n edges {\n node {\n name\n contactEmail\n websiteUrl\n legalEntityName\n taxCountry\n }\n }\n }\n }\n", C = "\n mutation RegisterPublisher($input: RegisterPublisherInput!) {\n registerPublisher(input: $input) {\n id\n name\n email\n }\n }\n", w = "\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", T = "\n mutation SubmitProduct($id: ID!, $notes: String) {\n submitProduct(id: $id, notes: $notes) {\n id\n status\n }\n }\n";
|
|
97
|
+
function E(e) {
|
|
77
98
|
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
78
99
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
100
|
+
function D(e) {
|
|
101
|
+
return b.every((t) => {
|
|
81
102
|
let n = e[t];
|
|
82
103
|
return typeof n == "boolean" ? !0 : n.trim() !== "";
|
|
83
104
|
});
|
|
84
105
|
}
|
|
85
|
-
var
|
|
86
|
-
let { navigate:
|
|
106
|
+
var O = () => {
|
|
107
|
+
let { navigate: b, basePath: O, apiGatewayUrl: k, authToken: A } = e(), [j, M] = l({
|
|
87
108
|
name: "",
|
|
88
109
|
slug: "",
|
|
89
110
|
type: "",
|
|
111
|
+
category: "",
|
|
90
112
|
shortDescription: "",
|
|
91
113
|
longDescription: "",
|
|
92
114
|
price: "",
|
|
@@ -101,44 +123,44 @@ var D = () => {
|
|
|
101
123
|
countryOfOrigin: "",
|
|
102
124
|
warrantyInfo: "",
|
|
103
125
|
returnPolicy: ""
|
|
104
|
-
}), [
|
|
105
|
-
|
|
126
|
+
}), [N, P] = l([]), [F, I] = l(!1), L = c(null), [R, z] = l(!1), [B, V] = l(null), [H, U] = l(!1), W = D(j), G = `${k || ""}/global/graphql`, K = (e, t) => {
|
|
127
|
+
M((n) => ({
|
|
106
128
|
...n,
|
|
107
129
|
[e]: t
|
|
108
130
|
}));
|
|
109
|
-
},
|
|
131
|
+
}, q = (e) => {
|
|
110
132
|
let t = e.target.value;
|
|
111
|
-
|
|
133
|
+
M((e) => ({
|
|
112
134
|
...e,
|
|
113
135
|
name: t,
|
|
114
|
-
slug:
|
|
136
|
+
slug: E(t)
|
|
115
137
|
}));
|
|
116
|
-
},
|
|
117
|
-
|
|
118
|
-
},
|
|
138
|
+
}, J = (e) => (t) => {
|
|
139
|
+
K(e, t.target.checked);
|
|
140
|
+
}, Y = ee((e) => {
|
|
119
141
|
let t = Array.from(e).filter((e) => e.type.startsWith("image/")).map((e) => ({
|
|
120
142
|
file: e,
|
|
121
143
|
url: URL.createObjectURL(e)
|
|
122
144
|
}));
|
|
123
|
-
|
|
124
|
-
}, []),
|
|
125
|
-
e.target.files &&
|
|
126
|
-
}, X = (e) => {
|
|
127
|
-
e.preventDefault(), F(!1), e.dataTransfer.files && J(e.dataTransfer.files);
|
|
145
|
+
P((e) => [...e, ...t]);
|
|
146
|
+
}, []), X = (e) => {
|
|
147
|
+
e.target.files && Y(e.target.files), e.target.value = "";
|
|
128
148
|
}, Z = (e) => {
|
|
129
|
-
e.preventDefault(),
|
|
130
|
-
}, Q = (
|
|
131
|
-
|
|
149
|
+
e.preventDefault(), I(!1), e.dataTransfer.files && Y(e.dataTransfer.files);
|
|
150
|
+
}, Q = (e) => {
|
|
151
|
+
e.preventDefault(), I(!0);
|
|
152
|
+
}, te = () => I(!1), ne = (e) => {
|
|
153
|
+
P((t) => {
|
|
132
154
|
let n = [...t];
|
|
133
155
|
return URL.revokeObjectURL(n[e].url), n.splice(e, 1), n;
|
|
134
156
|
});
|
|
135
157
|
};
|
|
136
158
|
async function $(e, t) {
|
|
137
|
-
let n = await (await fetch(
|
|
159
|
+
let n = await (await fetch(G, {
|
|
138
160
|
method: "POST",
|
|
139
161
|
headers: {
|
|
140
162
|
"Content-Type": "application/json",
|
|
141
|
-
...
|
|
163
|
+
...A ? { Authorization: `Bearer ${A}` } : {}
|
|
142
164
|
},
|
|
143
165
|
credentials: "include",
|
|
144
166
|
body: JSON.stringify({
|
|
@@ -157,13 +179,13 @@ var D = () => {
|
|
|
157
179
|
children: /* @__PURE__ */ g("div", {
|
|
158
180
|
className: "space-y-8 max-w-3xl",
|
|
159
181
|
children: [
|
|
160
|
-
|
|
182
|
+
H && /* @__PURE__ */ h("div", {
|
|
161
183
|
className: "rounded-card border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
|
|
162
184
|
children: "Your listing has been submitted for review! Redirecting..."
|
|
163
185
|
}),
|
|
164
|
-
|
|
186
|
+
B && /* @__PURE__ */ h("div", {
|
|
165
187
|
className: "rounded-card border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
166
|
-
children:
|
|
188
|
+
children: B
|
|
167
189
|
}),
|
|
168
190
|
/* @__PURE__ */ h(r, {
|
|
169
191
|
title: "Basic Information",
|
|
@@ -174,40 +196,48 @@ var D = () => {
|
|
|
174
196
|
/* @__PURE__ */ h(a, {
|
|
175
197
|
label: "Name",
|
|
176
198
|
required: !0,
|
|
177
|
-
value:
|
|
178
|
-
onChange:
|
|
199
|
+
value: j.name,
|
|
200
|
+
onChange: q,
|
|
179
201
|
placeholder: "e.g. Wireless Ergonomic Keyboard",
|
|
180
202
|
maxLength: 120
|
|
181
203
|
}),
|
|
182
204
|
/* @__PURE__ */ h(a, {
|
|
183
205
|
label: "Slug",
|
|
184
206
|
required: !0,
|
|
185
|
-
value:
|
|
186
|
-
onChange: (e) =>
|
|
207
|
+
value: j.slug,
|
|
208
|
+
onChange: (e) => K("slug", e.target.value),
|
|
187
209
|
placeholder: "auto-derived-from-name",
|
|
188
210
|
hint: "URL-friendly identifier. Auto-derived from name; you can edit it."
|
|
189
211
|
}),
|
|
190
212
|
/* @__PURE__ */ h(o, {
|
|
191
|
-
label: "Product
|
|
213
|
+
label: "Product Type",
|
|
192
214
|
required: !0,
|
|
193
|
-
value:
|
|
194
|
-
onChange: (e) =>
|
|
215
|
+
value: j.type,
|
|
216
|
+
onChange: (e) => K("type", e.target.value),
|
|
195
217
|
options: _,
|
|
196
|
-
placeholder: "Select a
|
|
218
|
+
placeholder: "Select a type"
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ h(o, {
|
|
221
|
+
label: "Store Category",
|
|
222
|
+
value: j.category,
|
|
223
|
+
onChange: (e) => K("category", e.target.value),
|
|
224
|
+
options: v,
|
|
225
|
+
placeholder: "General / uncategorised",
|
|
226
|
+
hint: "Pick an Agri-Inputs category to list this item in the HealthyBowl Agri-Inputs Store. Leave blank for a general store listing."
|
|
197
227
|
}),
|
|
198
228
|
/* @__PURE__ */ h(a, {
|
|
199
229
|
label: "Short Description",
|
|
200
230
|
required: !0,
|
|
201
|
-
value:
|
|
202
|
-
onChange: (e) =>
|
|
231
|
+
value: j.shortDescription,
|
|
232
|
+
onChange: (e) => K("shortDescription", e.target.value),
|
|
203
233
|
placeholder: "One-line summary shown on the store card",
|
|
204
234
|
maxLength: 160,
|
|
205
|
-
hint: `${
|
|
235
|
+
hint: `${j.shortDescription.length}/160`
|
|
206
236
|
}),
|
|
207
237
|
/* @__PURE__ */ h(s, {
|
|
208
238
|
label: "Long Description",
|
|
209
|
-
value:
|
|
210
|
-
onChange: (e) =>
|
|
239
|
+
value: j.longDescription,
|
|
240
|
+
onChange: (e) => K("longDescription", e.target.value),
|
|
211
241
|
rows: 5,
|
|
212
242
|
placeholder: "Detailed product description, features, specs…"
|
|
213
243
|
})
|
|
@@ -221,15 +251,15 @@ var D = () => {
|
|
|
221
251
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 space-y-4",
|
|
222
252
|
children: [
|
|
223
253
|
/* @__PURE__ */ g("div", {
|
|
224
|
-
onDrop:
|
|
225
|
-
onDragOver:
|
|
226
|
-
onDragLeave:
|
|
227
|
-
onClick: () =>
|
|
228
|
-
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",
|
|
254
|
+
onDrop: Z,
|
|
255
|
+
onDragOver: Q,
|
|
256
|
+
onDragLeave: te,
|
|
257
|
+
onClick: () => L.current?.click(),
|
|
258
|
+
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", F ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-subtle hover:border-border-strong"),
|
|
229
259
|
children: [
|
|
230
|
-
/* @__PURE__ */ h(
|
|
260
|
+
/* @__PURE__ */ h(f, {
|
|
231
261
|
size: 28,
|
|
232
|
-
className:
|
|
262
|
+
className: F ? "text-action-primary-bg" : "text-text-muted"
|
|
233
263
|
}),
|
|
234
264
|
/* @__PURE__ */ g("div", {
|
|
235
265
|
className: "text-center space-y-1",
|
|
@@ -242,18 +272,18 @@ var D = () => {
|
|
|
242
272
|
})]
|
|
243
273
|
}),
|
|
244
274
|
/* @__PURE__ */ h("input", {
|
|
245
|
-
ref:
|
|
275
|
+
ref: L,
|
|
246
276
|
type: "file",
|
|
247
277
|
accept: "image/*",
|
|
248
278
|
multiple: !0,
|
|
249
279
|
className: "sr-only",
|
|
250
|
-
onChange:
|
|
280
|
+
onChange: X
|
|
251
281
|
})
|
|
252
282
|
]
|
|
253
283
|
}),
|
|
254
|
-
|
|
284
|
+
N.length > 0 && /* @__PURE__ */ h("div", {
|
|
255
285
|
className: "flex flex-wrap gap-3",
|
|
256
|
-
children:
|
|
286
|
+
children: N.map((e, t) => /* @__PURE__ */ g("div", {
|
|
257
287
|
className: "relative group",
|
|
258
288
|
children: [
|
|
259
289
|
/* @__PURE__ */ h("img", {
|
|
@@ -268,7 +298,7 @@ var D = () => {
|
|
|
268
298
|
/* @__PURE__ */ h("button", {
|
|
269
299
|
type: "button",
|
|
270
300
|
onClick: (e) => {
|
|
271
|
-
e.stopPropagation(),
|
|
301
|
+
e.stopPropagation(), ne(t);
|
|
272
302
|
},
|
|
273
303
|
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",
|
|
274
304
|
"aria-label": "Remove image",
|
|
@@ -279,7 +309,7 @@ var D = () => {
|
|
|
279
309
|
}),
|
|
280
310
|
/* @__PURE__ */ g("p", {
|
|
281
311
|
className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
282
|
-
children: [/* @__PURE__ */ h(
|
|
312
|
+
children: [/* @__PURE__ */ h(u, {
|
|
283
313
|
size: 13,
|
|
284
314
|
className: "mt-0.5 shrink-0 text-text-muted"
|
|
285
315
|
}), "At least 1 image helps buyers — high quality photos increase conversions."]
|
|
@@ -297,23 +327,23 @@ var D = () => {
|
|
|
297
327
|
label: "Price",
|
|
298
328
|
required: !0,
|
|
299
329
|
type: "number",
|
|
300
|
-
value:
|
|
301
|
-
onChange: (e) =>
|
|
330
|
+
value: j.price,
|
|
331
|
+
onChange: (e) => K("price", e.target.value),
|
|
302
332
|
placeholder: "0.00",
|
|
303
333
|
min: .01,
|
|
304
334
|
step: "0.01"
|
|
305
335
|
}), /* @__PURE__ */ h(o, {
|
|
306
336
|
label: "Currency",
|
|
307
337
|
required: !0,
|
|
308
|
-
value:
|
|
309
|
-
onChange: (e) =>
|
|
310
|
-
options:
|
|
338
|
+
value: j.currency,
|
|
339
|
+
onChange: (e) => K("currency", e.target.value),
|
|
340
|
+
options: y,
|
|
311
341
|
placeholder: "Select currency"
|
|
312
342
|
})]
|
|
313
343
|
}), /* @__PURE__ */ h(a, {
|
|
314
344
|
label: "Tags",
|
|
315
|
-
value:
|
|
316
|
-
onChange: (e) =>
|
|
345
|
+
value: j.tags,
|
|
346
|
+
onChange: (e) => K("tags", e.target.value),
|
|
317
347
|
placeholder: "mechanical, wireless, ergonomic",
|
|
318
348
|
hint: "Comma-separated keywords to help buyers find your item."
|
|
319
349
|
})]
|
|
@@ -329,22 +359,22 @@ var D = () => {
|
|
|
329
359
|
label: "Stock Quantity",
|
|
330
360
|
required: !0,
|
|
331
361
|
type: "number",
|
|
332
|
-
value:
|
|
333
|
-
onChange: (e) =>
|
|
362
|
+
value: j.stockQuantity,
|
|
363
|
+
onChange: (e) => K("stockQuantity", e.target.value),
|
|
334
364
|
min: 0,
|
|
335
365
|
step: 1
|
|
336
366
|
}), /* @__PURE__ */ h(a, {
|
|
337
367
|
label: "SKU",
|
|
338
|
-
value:
|
|
339
|
-
onChange: (e) =>
|
|
368
|
+
value: j.sku,
|
|
369
|
+
onChange: (e) => K("sku", e.target.value),
|
|
340
370
|
placeholder: "e.g. KB-WL-001",
|
|
341
371
|
hint: "Your internal stock-keeping unit reference."
|
|
342
372
|
})]
|
|
343
373
|
}), /* @__PURE__ */ h(i, {
|
|
344
374
|
label: "Track Inventory",
|
|
345
375
|
description: "Automatically reduce stock when orders are placed.",
|
|
346
|
-
checked:
|
|
347
|
-
onChange:
|
|
376
|
+
checked: j.trackInventory,
|
|
377
|
+
onChange: J("trackInventory")
|
|
348
378
|
})]
|
|
349
379
|
})
|
|
350
380
|
}),
|
|
@@ -356,14 +386,14 @@ var D = () => {
|
|
|
356
386
|
/* @__PURE__ */ h(i, {
|
|
357
387
|
label: "Requires Shipping",
|
|
358
388
|
description: "This item will be physically shipped to the buyer.",
|
|
359
|
-
checked:
|
|
360
|
-
onChange:
|
|
389
|
+
checked: j.requiresShipping,
|
|
390
|
+
onChange: J("requiresShipping")
|
|
361
391
|
}),
|
|
362
|
-
|
|
392
|
+
j.requiresShipping && /* @__PURE__ */ h(a, {
|
|
363
393
|
label: "Weight (kg)",
|
|
364
394
|
type: "number",
|
|
365
|
-
value:
|
|
366
|
-
onChange: (e) =>
|
|
395
|
+
value: j.weightKg,
|
|
396
|
+
onChange: (e) => K("weightKg", e.target.value),
|
|
367
397
|
placeholder: "0.0",
|
|
368
398
|
min: 0,
|
|
369
399
|
step: "0.01",
|
|
@@ -371,7 +401,7 @@ var D = () => {
|
|
|
371
401
|
}),
|
|
372
402
|
/* @__PURE__ */ g("p", {
|
|
373
403
|
className: "flex items-start gap-2 rounded-input border border-border-subtle bg-bg-sunken px-3 py-2 text-xs text-text-secondary",
|
|
374
|
-
children: [/* @__PURE__ */ h(
|
|
404
|
+
children: [/* @__PURE__ */ h(u, {
|
|
375
405
|
size: 13,
|
|
376
406
|
className: "mt-0.5 shrink-0 text-text-muted"
|
|
377
407
|
}), "Delivery fees are configured at the organization level in store settings."]
|
|
@@ -389,26 +419,26 @@ var D = () => {
|
|
|
389
419
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-2",
|
|
390
420
|
children: [/* @__PURE__ */ h(a, {
|
|
391
421
|
label: "Brand",
|
|
392
|
-
value:
|
|
393
|
-
onChange: (e) =>
|
|
422
|
+
value: j.brand,
|
|
423
|
+
onChange: (e) => K("brand", e.target.value),
|
|
394
424
|
placeholder: "e.g. Logitech"
|
|
395
425
|
}), /* @__PURE__ */ h(a, {
|
|
396
426
|
label: "Country of Origin",
|
|
397
|
-
value:
|
|
398
|
-
onChange: (e) =>
|
|
427
|
+
value: j.countryOfOrigin,
|
|
428
|
+
onChange: (e) => K("countryOfOrigin", e.target.value),
|
|
399
429
|
placeholder: "e.g. China"
|
|
400
430
|
})]
|
|
401
431
|
}),
|
|
402
432
|
/* @__PURE__ */ h(a, {
|
|
403
433
|
label: "Warranty Info",
|
|
404
|
-
value:
|
|
405
|
-
onChange: (e) =>
|
|
434
|
+
value: j.warrantyInfo,
|
|
435
|
+
onChange: (e) => K("warrantyInfo", e.target.value),
|
|
406
436
|
placeholder: "e.g. 1-year limited manufacturer warranty"
|
|
407
437
|
}),
|
|
408
438
|
/* @__PURE__ */ h(s, {
|
|
409
439
|
label: "Return Policy",
|
|
410
|
-
value:
|
|
411
|
-
onChange: (e) =>
|
|
440
|
+
value: j.returnPolicy,
|
|
441
|
+
onChange: (e) => K("returnPolicy", e.target.value),
|
|
412
442
|
rows: 3,
|
|
413
443
|
placeholder: "e.g. 30-day returns accepted"
|
|
414
444
|
})
|
|
@@ -419,7 +449,7 @@ var D = () => {
|
|
|
419
449
|
className: "flex items-center gap-3 pb-8",
|
|
420
450
|
children: [/* @__PURE__ */ h("button", {
|
|
421
451
|
type: "button",
|
|
422
|
-
onClick: () =>
|
|
452
|
+
onClick: () => b?.(`${O}/seller/items`),
|
|
423
453
|
className: "rounded-button border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken transition-colors",
|
|
424
454
|
children: "Cancel"
|
|
425
455
|
}), /* @__PURE__ */ h("div", {
|
|
@@ -427,13 +457,13 @@ var D = () => {
|
|
|
427
457
|
children: /* @__PURE__ */ h("button", {
|
|
428
458
|
type: "button",
|
|
429
459
|
onClick: async () => {
|
|
430
|
-
if (!(!
|
|
431
|
-
|
|
460
|
+
if (!(!W || R)) {
|
|
461
|
+
z(!0), V(null);
|
|
432
462
|
try {
|
|
433
|
-
let e = (await $(
|
|
463
|
+
let e = (await $(x)).myPublisher?.id ?? null;
|
|
434
464
|
if (!e) {
|
|
435
|
-
let t = (await $(
|
|
436
|
-
e = (await $(
|
|
465
|
+
let t = (await $(S)).developerOrganizations.edges[0]?.node ?? null;
|
|
466
|
+
e = (await $(C, { input: {
|
|
437
467
|
name: t?.legalEntityName ?? t?.name ?? "My Store",
|
|
438
468
|
email: t?.contactEmail ?? "seller@burdenoff.com",
|
|
439
469
|
websiteUrl: t?.websiteUrl ?? null,
|
|
@@ -442,43 +472,44 @@ var D = () => {
|
|
|
442
472
|
contactEmail: t?.contactEmail ?? null
|
|
443
473
|
} })).registerPublisher.id;
|
|
444
474
|
}
|
|
445
|
-
let t =
|
|
446
|
-
name:
|
|
447
|
-
slug:
|
|
448
|
-
type:
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
475
|
+
let t = j.tags.split(",").map((e) => e.trim()).filter(Boolean), n = (await $(w, { input: {
|
|
476
|
+
name: j.name.trim(),
|
|
477
|
+
slug: j.slug.trim(),
|
|
478
|
+
type: j.type,
|
|
479
|
+
category: j.category.trim() || null,
|
|
480
|
+
description: j.shortDescription.trim(),
|
|
481
|
+
longDescription: j.longDescription.trim() || null,
|
|
482
|
+
price: parseFloat(j.price),
|
|
483
|
+
currency: j.currency,
|
|
453
484
|
tags: t.length > 0 ? t : null,
|
|
454
|
-
stockQuantity: parseInt(
|
|
455
|
-
sku:
|
|
456
|
-
trackInventory:
|
|
457
|
-
requiresShipping:
|
|
458
|
-
weight:
|
|
459
|
-
brand:
|
|
460
|
-
countryOfOrigin:
|
|
461
|
-
warrantyInfo:
|
|
462
|
-
returnPolicy:
|
|
485
|
+
stockQuantity: parseInt(j.stockQuantity, 10),
|
|
486
|
+
sku: j.sku.trim() || null,
|
|
487
|
+
trackInventory: j.trackInventory,
|
|
488
|
+
requiresShipping: j.requiresShipping,
|
|
489
|
+
weight: j.requiresShipping && j.weightKg.trim() ? parseFloat(j.weightKg) : null,
|
|
490
|
+
brand: j.brand.trim() || null,
|
|
491
|
+
countryOfOrigin: j.countryOfOrigin.trim() || null,
|
|
492
|
+
warrantyInfo: j.warrantyInfo.trim() || null,
|
|
493
|
+
returnPolicy: j.returnPolicy.trim() || null
|
|
463
494
|
} })).createPhysicalProduct.id;
|
|
464
|
-
await $(
|
|
495
|
+
await $(T, {
|
|
465
496
|
id: n,
|
|
466
497
|
notes: "Submitted from seller portal"
|
|
467
|
-
}),
|
|
468
|
-
|
|
498
|
+
}), U(!0), setTimeout(() => {
|
|
499
|
+
b?.(`${O}/seller/items`);
|
|
469
500
|
}, 2e3);
|
|
470
501
|
} catch (e) {
|
|
471
|
-
|
|
502
|
+
V(e instanceof Error ? e.message : "Submission failed. Please try again.");
|
|
472
503
|
} finally {
|
|
473
|
-
|
|
504
|
+
z(!1);
|
|
474
505
|
}
|
|
475
506
|
}
|
|
476
507
|
},
|
|
477
|
-
disabled: !
|
|
478
|
-
"aria-disabled": !
|
|
479
|
-
title:
|
|
508
|
+
disabled: !W || R,
|
|
509
|
+
"aria-disabled": !W || R,
|
|
510
|
+
title: W ? void 0 : "Fill in all required fields to continue",
|
|
480
511
|
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"),
|
|
481
|
-
children:
|
|
512
|
+
children: R ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(d, {
|
|
482
513
|
size: 15,
|
|
483
514
|
className: "animate-spin"
|
|
484
515
|
}), "Submitting..."] }) : "Create & Submit for Review"
|
|
@@ -490,6 +521,6 @@ var D = () => {
|
|
|
490
521
|
});
|
|
491
522
|
};
|
|
492
523
|
//#endregion
|
|
493
|
-
export {
|
|
524
|
+
export { O as CreatePhysicalItemPage };
|
|
494
525
|
|
|
495
526
|
//# sourceMappingURL=CreatePhysicalItemPage.js.map
|