@mercurjs/vendor 2.0.0-canary.0
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/[id]-23D3HY3G.js +444 -0
- package/dist/[id]-2VBOAZM4.js +1215 -0
- package/dist/[id]-A4FSDRER.js +325 -0
- package/dist/[id]-E45G2SDA.js +213 -0
- package/dist/[id]-FXKSI52D.js +477 -0
- package/dist/[id]-HHZ3BSXV.js +1166 -0
- package/dist/[id]-MIV4U5UW.js +137 -0
- package/dist/[id]-QSRIPPIP.js +612 -0
- package/dist/[id]-RGDXOC7T.js +499 -0
- package/dist/[id]-TI2MOR2C.js +377 -0
- package/dist/[id]-U5DT2ZLS.js +301 -0
- package/dist/[id]-UMFGLDM2.js +354 -0
- package/dist/[id]-VTFOP3BF.js +97 -0
- package/dist/[id]-ZYF75L6G.js +479 -0
- package/dist/[location_id]-4UIEW5KM.js +685 -0
- package/dist/[province_id]-ZCHPXXQN.js +205 -0
- package/dist/add-KNDQL6YN.js +660 -0
- package/dist/add-customer-groups-JA346MTF.js +275 -0
- package/dist/add-products-2VB57KXV.js +273 -0
- package/dist/add-promotions-KVKEP6EO.js +260 -0
- package/dist/add-to-campaign-V6D7JKRS.js +44 -0
- package/dist/additional-attributes-E36EZX4V.js +219 -0
- package/dist/adjust-inventory-P7AB7VIB.js +228 -0
- package/dist/allocate-items-QAS5PZLR.js +529 -0
- package/dist/areas-Y7VDWH7G.js +151 -0
- package/dist/attributes-UEM2VJKV.js +277 -0
- package/dist/breadcrumb-3QTVWXZB.js +27 -0
- package/dist/breadcrumb-5OTOCYNL.js +38 -0
- package/dist/breadcrumb-6NAAOPIY.js +11 -0
- package/dist/breadcrumb-ASB2YCNV.js +25 -0
- package/dist/breadcrumb-CIGKLKKS.js +28 -0
- package/dist/breadcrumb-EOYLR3IQ.js +22 -0
- package/dist/breadcrumb-LENACUAA.js +22 -0
- package/dist/breadcrumb-LIXGWUQF.js +44 -0
- package/dist/breadcrumb-MOQ7GI3Z.js +27 -0
- package/dist/breadcrumb-NCBGPQML.js +23 -0
- package/dist/breadcrumb-OVMEC5OZ.js +33 -0
- package/dist/breadcrumb-RIXJ5QSX.js +45 -0
- package/dist/breadcrumb-TZB6EWNC.js +31 -0
- package/dist/breadcrumb-WP34OXGQ.js +23 -0
- package/dist/campaigns-PMVKUFEA.js +28 -0
- package/dist/categories-CKKIUMYG.js +27 -0
- package/dist/chunk-26OOAKQ6.js +18 -0
- package/dist/chunk-2C3HUJ3Z.js +222 -0
- package/dist/chunk-2F3H6ORE.js +36 -0
- package/dist/chunk-2ZFELO2L.js +13 -0
- package/dist/chunk-3CK6OINO.js +448 -0
- package/dist/chunk-3EF54XFY.js +64 -0
- package/dist/chunk-3LPVUPZZ.js +74 -0
- package/dist/chunk-3QSRE5LS.js +161 -0
- package/dist/chunk-3SIDRPKT.js +185 -0
- package/dist/chunk-4F5GP7J7.js +45 -0
- package/dist/chunk-4GPAS5GW.js +36 -0
- package/dist/chunk-4MFMCZEJ.js +70 -0
- package/dist/chunk-4TBDDMFP.js +425 -0
- package/dist/chunk-4TLP3TAA.js +34 -0
- package/dist/chunk-54TMLQH3.js +9 -0
- package/dist/chunk-5NF4OTVV.js +169 -0
- package/dist/chunk-66V3GFSW.js +138 -0
- package/dist/chunk-6EYGH3TB.js +26 -0
- package/dist/chunk-6IJMSVC6.js +16 -0
- package/dist/chunk-6YA3C4NB.js +55 -0
- package/dist/chunk-7AV5EJJ5.js +29 -0
- package/dist/chunk-7RPRNVBS.js +45 -0
- package/dist/chunk-A2SY5L5G.js +183 -0
- package/dist/chunk-A5DJIOHN.js +4 -0
- package/dist/chunk-AIFLEWO2.js +56 -0
- package/dist/chunk-ASVMGV2B.js +80 -0
- package/dist/chunk-AW77UWCZ.js +363 -0
- package/dist/chunk-AYUG34XF.js +84 -0
- package/dist/chunk-AYVH6Q5O.js +31 -0
- package/dist/chunk-B2RVONU7.js +160 -0
- package/dist/chunk-BCU3FKP2.js +18 -0
- package/dist/chunk-BDGZ4EQO.js +86 -0
- package/dist/chunk-BDZOSMAX.js +23 -0
- package/dist/chunk-C6SUTRP2.js +13 -0
- package/dist/chunk-CDIZEXFJ.js +145 -0
- package/dist/chunk-CFETU5BI.js +261 -0
- package/dist/chunk-CMHI2RPL.js +20 -0
- package/dist/chunk-CP5IL4P6.js +98 -0
- package/dist/chunk-CUO22GTM.js +96 -0
- package/dist/chunk-CVVYQI5F.js +41 -0
- package/dist/chunk-DARJTN4I.js +60 -0
- package/dist/chunk-DB6ANJBO.js +35 -0
- package/dist/chunk-DC2K6CFQ.js +86 -0
- package/dist/chunk-DDEIH66R.js +123 -0
- package/dist/chunk-DY3XQPHC.js +31 -0
- package/dist/chunk-DYUTYBAQ.js +67 -0
- package/dist/chunk-E3MNEQID.js +24 -0
- package/dist/chunk-FBZHM2QZ.js +247 -0
- package/dist/chunk-FDZC3TFZ.js +717 -0
- package/dist/chunk-FGCKXH45.js +263 -0
- package/dist/chunk-FMFVTERD.js +0 -0
- package/dist/chunk-FOMEBUX6.js +89 -0
- package/dist/chunk-FQERBIVS.js +0 -0
- package/dist/chunk-GC33DBKG.js +143 -0
- package/dist/chunk-GDMNHL7E.js +144 -0
- package/dist/chunk-GTUR4HSV.js +53 -0
- package/dist/chunk-H35HHFTB.js +225 -0
- package/dist/chunk-HB3BP55W.js +25 -0
- package/dist/chunk-HHD2VUED.js +29 -0
- package/dist/chunk-HUNGNEPY.js +312 -0
- package/dist/chunk-HUZG6A3X.js +127 -0
- package/dist/chunk-INNFZYX2.js +183 -0
- package/dist/chunk-IQPN4PZJ.js +749 -0
- package/dist/chunk-IZ5RG5XI.js +72 -0
- package/dist/chunk-J2XP7VRG.js +1080 -0
- package/dist/chunk-JHIMVLB2.js +42 -0
- package/dist/chunk-JKXAL7WR.js +92 -0
- package/dist/chunk-JRTZWK77.js +1764 -0
- package/dist/chunk-JVBLYMY2.js +268 -0
- package/dist/chunk-JXP5YZ77.js +86 -0
- package/dist/chunk-KAZ5BYTQ.js +132 -0
- package/dist/chunk-KHHY7EEM.js +267 -0
- package/dist/chunk-LAVHRER2.js +17 -0
- package/dist/chunk-LQSLDDPT.js +67 -0
- package/dist/chunk-LWVBKUUL.js +77 -0
- package/dist/chunk-LYUCDASZ.js +115 -0
- package/dist/chunk-LZ7QV42C.js +37 -0
- package/dist/chunk-MAEP2UCK.js +110 -0
- package/dist/chunk-MG4GKUJW.js +31 -0
- package/dist/chunk-N2TQXB44.js +1280 -0
- package/dist/chunk-N3T24SEK.js +32 -0
- package/dist/chunk-NANYVBFI.js +106 -0
- package/dist/chunk-NCMUZ6BQ.js +0 -0
- package/dist/chunk-NCYTM57J.js +160 -0
- package/dist/chunk-NX26QE2O.js +47 -0
- package/dist/chunk-NYDJTWRL.js +389 -0
- package/dist/chunk-O5LRZEG6.js +253 -0
- package/dist/chunk-O6PRBSFL.js +115 -0
- package/dist/chunk-OJCDB3N5.js +539 -0
- package/dist/chunk-OSFOX7MG.js +176 -0
- package/dist/chunk-OVPAOBZB.js +110 -0
- package/dist/chunk-PADOWAXM.js +118 -0
- package/dist/chunk-PHOCVOZ5.js +9 -0
- package/dist/chunk-PKBMQBKP.js +7 -0
- package/dist/chunk-PLSJ74T2.js +298 -0
- package/dist/chunk-PVZBDWLK.js +41 -0
- package/dist/chunk-PWZKFTJS.js +247 -0
- package/dist/chunk-PXYDR7WQ.js +48 -0
- package/dist/chunk-PYQJ5N25.js +191 -0
- package/dist/chunk-Q4UVXS46.js +14 -0
- package/dist/chunk-QDPLZDMX.js +17 -0
- package/dist/chunk-QSGR43JM.js +30 -0
- package/dist/chunk-QUNDGPF7.js +92801 -0
- package/dist/chunk-R65A4P4H.js +136 -0
- package/dist/chunk-RE7YXVFG.js +128 -0
- package/dist/chunk-RETT6WME.js +37 -0
- package/dist/chunk-RHKRREUU.js +15 -0
- package/dist/chunk-RIILGKYR.js +32 -0
- package/dist/chunk-RM5RSDYP.js +353 -0
- package/dist/chunk-RNC4NFVK.js +170 -0
- package/dist/chunk-RSMZHZI2.js +2078 -0
- package/dist/chunk-RXM4B6HR.js +8 -0
- package/dist/chunk-S2WEYEQR.js +14 -0
- package/dist/chunk-S3PQKKNV.js +49 -0
- package/dist/chunk-S5GQ2SES.js +276 -0
- package/dist/chunk-SECZTXSU.js +31 -0
- package/dist/chunk-SI4ALL7W.js +180 -0
- package/dist/chunk-SID3COTK.js +21 -0
- package/dist/chunk-SMQT3ZNO.js +8 -0
- package/dist/chunk-SOZMJA7V.js +61 -0
- package/dist/chunk-TG3TCIL6.js +207 -0
- package/dist/chunk-THHRRYRS.js +16 -0
- package/dist/chunk-TKGWSUEI.js +0 -0
- package/dist/chunk-TTFCO5HU.js +173 -0
- package/dist/chunk-TXEPCJEQ.js +430 -0
- package/dist/chunk-U2EI2ZLM.js +32 -0
- package/dist/chunk-U2ZFCAPX.js +34 -0
- package/dist/chunk-U3X4DNV6.js +179 -0
- package/dist/chunk-UXKKD4AD.js +437 -0
- package/dist/chunk-UYJ65N46.js +261 -0
- package/dist/chunk-VDWGP2U6.js +71 -0
- package/dist/chunk-VGJTARSA.js +89 -0
- package/dist/chunk-VHMGJUYN.js +28 -0
- package/dist/chunk-VKC3XKFF.js +283 -0
- package/dist/chunk-VKOE5J66.js +31 -0
- package/dist/chunk-VOHEQ7B5.js +31 -0
- package/dist/chunk-VW56KWO2.js +9 -0
- package/dist/chunk-W4KHJ4D6.js +74 -0
- package/dist/chunk-W6Y3PPU5.js +73 -0
- package/dist/chunk-W6ZVQJYB.js +311 -0
- package/dist/chunk-WA3IVAUC.js +123 -0
- package/dist/chunk-WHTS4G5K.js +1551 -0
- package/dist/chunk-WIYFXWRI.js +30 -0
- package/dist/chunk-WPFTRRWV.js +455 -0
- package/dist/chunk-WQZ4ONQV.js +6 -0
- package/dist/chunk-WS652CCV.js +893 -0
- package/dist/chunk-XG4PTPRM.js +0 -0
- package/dist/chunk-XRNDVICA.js +85 -0
- package/dist/chunk-XXZJISPX.js +48 -0
- package/dist/chunk-Y224F4UU.js +81 -0
- package/dist/chunk-Y3FR5JC7.js +437 -0
- package/dist/chunk-Y4VBOHAP.js +111 -0
- package/dist/chunk-Y7QKP6QU.js +35 -0
- package/dist/chunk-YVCBMOJG.js +50 -0
- package/dist/chunk-Z2WPXJ6J.js +146 -0
- package/dist/chunk-ZA2KFUFR.js +19 -0
- package/dist/chunk-ZEKV7LGF.js +6 -0
- package/dist/chunk-ZFFA36DB.js +186 -0
- package/dist/chunk-ZPGWTLF2.js +499 -0
- package/dist/chunk-ZVT2QSWR.js +263 -0
- package/dist/chunk-ZZ7VKT2S.js +4113 -0
- package/dist/collections-TREF67TO.js +63 -0
- package/dist/configuration-KWAL2QZ5.js +152 -0
- package/dist/configuration-RNWBTRAH.js +205 -0
- package/dist/create-7UEEO5TM.js +125 -0
- package/dist/create-DTCDJMIT.js +634 -0
- package/dist/create-DYDRAY6V.js +622 -0
- package/dist/create-EJM5C2XP.js +27 -0
- package/dist/create-F7OMPGZV.js +853 -0
- package/dist/create-G4UJOJJ6.js +69 -0
- package/dist/create-IE6MYOIY.js +170 -0
- package/dist/create-L23TGTBH.js +225 -0
- package/dist/create-LOBCFTCT.js +583 -0
- package/dist/create-MKBBF2V3.js +150 -0
- package/dist/create-TFDUNJSI.js +163 -0
- package/dist/create-TMTZDKII.js +711 -0
- package/dist/create-XGF6DB5F.js +239 -0
- package/dist/create-YAAK7JQ3.js +1052 -0
- package/dist/create-YPCVTXAK.js +194 -0
- package/dist/create-ZU362U3B.js +310 -0
- package/dist/customers-4QWR5UOL.js +27 -0
- package/dist/edit-2QA5BVOY.js +735 -0
- package/dist/edit-47I7VVNB.js +167 -0
- package/dist/edit-5BUGSOTL.js +255 -0
- package/dist/edit-7LQATDUD.js +193 -0
- package/dist/edit-AQAPYMDY.js +260 -0
- package/dist/edit-BQLSTFTQ.js +138 -0
- package/dist/edit-BYXHU3IG.js +308 -0
- package/dist/edit-DG3MY3ZH.js +244 -0
- package/dist/edit-J3LD76JS.js +192 -0
- package/dist/edit-J6WCPHDS.js +205 -0
- package/dist/edit-KCZVZLSZ.js +131 -0
- package/dist/edit-LOKLQGM2.js +181 -0
- package/dist/edit-MDTTTB33.js +104 -0
- package/dist/edit-NFSU2K3O.js +413 -0
- package/dist/edit-RHNZWNXD.js +89 -0
- package/dist/edit-XU33IVZH.js +204 -0
- package/dist/edit-ZMINDMGM.js +116 -0
- package/dist/edit-budget-Z5USV462.js +145 -0
- package/dist/edit-inventory-item-YFW2AFRD.js +128 -0
- package/dist/edit-inventory-item-attributes-IYAMJDTB.js +278 -0
- package/dist/fulfillment-SKXAF3BZ.js +545 -0
- package/dist/fulfillment-providers-ACERVITQ.js +279 -0
- package/dist/home-PP7YYCSB.js +16 -0
- package/dist/index.css +6 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +3656 -0
- package/dist/inventory-AIRQ2KNS.js +26 -0
- package/dist/locations-SQKM7JWN.js +23 -0
- package/dist/login-LKFCRHXN.js +35 -0
- package/dist/manage-locations-4PQS4QY7.js +195 -0
- package/dist/media-PL477QJO.js +703 -0
- package/dist/metadata-42MU3H7T.js +60 -0
- package/dist/metadata-DIJTVDF7.js +45 -0
- package/dist/metadata-NX3LEEB3.js +64 -0
- package/dist/metadata-RBDSM567.js +65 -0
- package/dist/metadata-VZTWNZPG.js +66 -0
- package/dist/metadata-X3XGQ563.js +67 -0
- package/dist/no-match-BO2NNLCM.js +33 -0
- package/dist/orders-2KHCHNO5.js +59 -0
- package/dist/organization-VQXCKHCN.js +233 -0
- package/dist/organize-3F5ZUIGB.js +23 -0
- package/dist/organize-WPWEPCF7.js +23 -0
- package/dist/pages/index.d.ts +1153 -0
- package/dist/pages/index.js +198 -0
- package/dist/payouts-3BY73LZ3.js +27 -0
- package/dist/price-lists-G256JJN7.js +34 -0
- package/dist/prices-EW7KBY6R.js +269 -0
- package/dist/pricing-3PUJDOZN.js +313 -0
- package/dist/product-tags-PI3RENEX.js +80 -0
- package/dist/product-types-WJPLJI7H.js +32 -0
- package/dist/product-variant-detail-EYTE7PHL.js +377 -0
- package/dist/product-variant-edit-PW7W5J5E.js +402 -0
- package/dist/products-GSN4I7BT.js +272 -0
- package/dist/products-RFYNEY57.js +85 -0
- package/dist/promotions-CIZIDQ64.js +31 -0
- package/dist/reset-password-OFUSH363.js +299 -0
- package/dist/return-reasons-4V2KVSRI.js +52 -0
- package/dist/sales-channels-MBWVM3X2.js +184 -0
- package/dist/sales-channels-ZKA62EAW.js +156 -0
- package/dist/seller-ZFDLKF5Y.js +36 -0
- package/dist/settings-NP2IAID5.js +111 -0
- package/dist/shipping-profile-7FTHSPY2.js +145 -0
- package/dist/shipping-profiles-7R6L65WG.js +43 -0
- package/dist/stock-ENMBCZRY.js +502 -0
- package/dist/stock-VYDJY46S.js +278 -0
- package/dist/tax-regions-V6G6244H.js +87 -0
- package/package.json +87 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SwitchBox
|
|
3
|
+
} from "./chunk-YVCBMOJG.js";
|
|
4
|
+
import "./chunk-TKGWSUEI.js";
|
|
5
|
+
import {
|
|
6
|
+
KeyboundForm
|
|
7
|
+
} from "./chunk-U2ZFCAPX.js";
|
|
8
|
+
import {
|
|
9
|
+
RouteDrawer,
|
|
10
|
+
useRouteModal
|
|
11
|
+
} from "./chunk-3CK6OINO.js";
|
|
12
|
+
import {
|
|
13
|
+
Form
|
|
14
|
+
} from "./chunk-3QSRE5LS.js";
|
|
15
|
+
import {
|
|
16
|
+
useProduct,
|
|
17
|
+
useUpdateProduct
|
|
18
|
+
} from "./chunk-WPFTRRWV.js";
|
|
19
|
+
import "./chunk-A5DJIOHN.js";
|
|
20
|
+
import "./chunk-RHKRREUU.js";
|
|
21
|
+
import "./chunk-ZA2KFUFR.js";
|
|
22
|
+
import "./chunk-Y224F4UU.js";
|
|
23
|
+
import "./chunk-PKBMQBKP.js";
|
|
24
|
+
|
|
25
|
+
// src/pages/products/[id]/edit/index.tsx
|
|
26
|
+
import { Heading } from "@medusajs/ui";
|
|
27
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
28
|
+
import { useParams } from "react-router-dom";
|
|
29
|
+
|
|
30
|
+
// src/pages/products/[id]/edit/edit-product-form/edit-product-form.tsx
|
|
31
|
+
import { Button, Input, Text, Textarea, toast } from "@medusajs/ui";
|
|
32
|
+
import { useTranslation } from "react-i18next";
|
|
33
|
+
import * as zod from "zod";
|
|
34
|
+
import { useForm } from "react-hook-form";
|
|
35
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
36
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
+
var EditProductSchema = zod.object({
|
|
38
|
+
title: zod.string().min(1),
|
|
39
|
+
handle: zod.string().min(1),
|
|
40
|
+
description: zod.string().optional(),
|
|
41
|
+
discountable: zod.boolean()
|
|
42
|
+
});
|
|
43
|
+
var EditProductForm = ({ product }) => {
|
|
44
|
+
const { t } = useTranslation();
|
|
45
|
+
const { handleSuccess } = useRouteModal();
|
|
46
|
+
const form = useForm({
|
|
47
|
+
defaultValues: {
|
|
48
|
+
title: product.title,
|
|
49
|
+
handle: product.handle || "",
|
|
50
|
+
description: product.description || "",
|
|
51
|
+
discountable: product.discountable
|
|
52
|
+
},
|
|
53
|
+
resolver: zodResolver(EditProductSchema)
|
|
54
|
+
});
|
|
55
|
+
const { mutateAsync, isPending } = useUpdateProduct(product.id);
|
|
56
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
57
|
+
const { description, discountable, handle, title } = data;
|
|
58
|
+
await mutateAsync(
|
|
59
|
+
{
|
|
60
|
+
description,
|
|
61
|
+
discountable,
|
|
62
|
+
handle,
|
|
63
|
+
title
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
onSuccess: ({ product: product2 }) => {
|
|
67
|
+
toast.success(
|
|
68
|
+
t("products.edit.successToast", {
|
|
69
|
+
title: product2.title
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
handleSuccess(`/products/${product2.id}`);
|
|
73
|
+
},
|
|
74
|
+
onError: (e) => {
|
|
75
|
+
toast.error(e.message);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
|
|
81
|
+
KeyboundForm,
|
|
82
|
+
{
|
|
83
|
+
onSubmit: handleSubmit,
|
|
84
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-1 flex-col gap-y-8 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-8", children: [
|
|
87
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
Form.Field,
|
|
90
|
+
{
|
|
91
|
+
control: form.control,
|
|
92
|
+
name: "title",
|
|
93
|
+
render: ({ field }) => {
|
|
94
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
95
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.title") }),
|
|
96
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
97
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
Form.Field,
|
|
104
|
+
{
|
|
105
|
+
control: form.control,
|
|
106
|
+
name: "handle",
|
|
107
|
+
render: ({ field }) => {
|
|
108
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.handle") }),
|
|
110
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
111
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-y-0 left-0 z-10 flex w-8 items-center justify-center border-r", children: /* @__PURE__ */ jsx(
|
|
112
|
+
Text,
|
|
113
|
+
{
|
|
114
|
+
className: "text-ui-fg-muted",
|
|
115
|
+
size: "small",
|
|
116
|
+
leading: "compact",
|
|
117
|
+
weight: "plus",
|
|
118
|
+
children: "/"
|
|
119
|
+
}
|
|
120
|
+
) }),
|
|
121
|
+
/* @__PURE__ */ jsx(Input, { ...field, className: "pl-10" })
|
|
122
|
+
] }) }),
|
|
123
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
Form.Field,
|
|
130
|
+
{
|
|
131
|
+
control: form.control,
|
|
132
|
+
name: "description",
|
|
133
|
+
render: ({ field }) => {
|
|
134
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
135
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.description") }),
|
|
136
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Textarea, { ...field }) }),
|
|
137
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
138
|
+
] });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
SwitchBox,
|
|
145
|
+
{
|
|
146
|
+
control: form.control,
|
|
147
|
+
name: "discountable",
|
|
148
|
+
label: t("fields.discountable"),
|
|
149
|
+
description: t("products.discountableHint")
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
] }) }),
|
|
153
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
154
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
155
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
|
|
156
|
+
] }) })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
) });
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// src/pages/products/[id]/edit/index.tsx
|
|
163
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
164
|
+
var Component = () => {
|
|
165
|
+
const { id } = useParams();
|
|
166
|
+
const { t } = useTranslation2();
|
|
167
|
+
const { product, isLoading, isError, error } = useProduct(id);
|
|
168
|
+
if (isError) {
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
172
|
+
/* @__PURE__ */ jsxs2(RouteDrawer.Header, { children: [
|
|
173
|
+
/* @__PURE__ */ jsx2(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx2(Heading, { children: t("products.edit.header") }) }),
|
|
174
|
+
/* @__PURE__ */ jsx2(RouteDrawer.Description, { className: "sr-only", children: t("products.edit.description") })
|
|
175
|
+
] }),
|
|
176
|
+
!isLoading && product && /* @__PURE__ */ jsx2(EditProductForm, { product })
|
|
177
|
+
] });
|
|
178
|
+
};
|
|
179
|
+
export {
|
|
180
|
+
Component
|
|
181
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PriceListPricesEditForm
|
|
3
|
+
} from "./chunk-PWZKFTJS.js";
|
|
4
|
+
import {
|
|
5
|
+
usePriceListCurrencyData
|
|
6
|
+
} from "./chunk-TTFCO5HU.js";
|
|
7
|
+
import "./chunk-XRNDVICA.js";
|
|
8
|
+
import "./chunk-6IJMSVC6.js";
|
|
9
|
+
import "./chunk-ZZ7VKT2S.js";
|
|
10
|
+
import "./chunk-IQPN4PZJ.js";
|
|
11
|
+
import "./chunk-SMQT3ZNO.js";
|
|
12
|
+
import "./chunk-TKGWSUEI.js";
|
|
13
|
+
import "./chunk-U2ZFCAPX.js";
|
|
14
|
+
import {
|
|
15
|
+
RouteFocusModal
|
|
16
|
+
} from "./chunk-3CK6OINO.js";
|
|
17
|
+
import "./chunk-3QSRE5LS.js";
|
|
18
|
+
import "./chunk-WIYFXWRI.js";
|
|
19
|
+
import "./chunk-LAVHRER2.js";
|
|
20
|
+
import "./chunk-Y7QKP6QU.js";
|
|
21
|
+
import "./chunk-INNFZYX2.js";
|
|
22
|
+
import "./chunk-OSFOX7MG.js";
|
|
23
|
+
import "./chunk-W4KHJ4D6.js";
|
|
24
|
+
import "./chunk-VGJTARSA.js";
|
|
25
|
+
import "./chunk-DYUTYBAQ.js";
|
|
26
|
+
import "./chunk-Y4VBOHAP.js";
|
|
27
|
+
import "./chunk-JKXAL7WR.js";
|
|
28
|
+
import "./chunk-DC2K6CFQ.js";
|
|
29
|
+
import "./chunk-VDWGP2U6.js";
|
|
30
|
+
import {
|
|
31
|
+
usePriceList
|
|
32
|
+
} from "./chunk-RE7YXVFG.js";
|
|
33
|
+
import "./chunk-HUNGNEPY.js";
|
|
34
|
+
import "./chunk-PADOWAXM.js";
|
|
35
|
+
import "./chunk-LWVBKUUL.js";
|
|
36
|
+
import "./chunk-RIILGKYR.js";
|
|
37
|
+
import "./chunk-6EYGH3TB.js";
|
|
38
|
+
import "./chunk-GTUR4HSV.js";
|
|
39
|
+
import "./chunk-SI4ALL7W.js";
|
|
40
|
+
import "./chunk-ZFFA36DB.js";
|
|
41
|
+
import "./chunk-VHMGJUYN.js";
|
|
42
|
+
import "./chunk-ASVMGV2B.js";
|
|
43
|
+
import {
|
|
44
|
+
useProducts
|
|
45
|
+
} from "./chunk-WPFTRRWV.js";
|
|
46
|
+
import "./chunk-A5DJIOHN.js";
|
|
47
|
+
import "./chunk-RHKRREUU.js";
|
|
48
|
+
import "./chunk-ZA2KFUFR.js";
|
|
49
|
+
import "./chunk-Y224F4UU.js";
|
|
50
|
+
import "./chunk-PKBMQBKP.js";
|
|
51
|
+
|
|
52
|
+
// src/pages/price-lists/[id]/products/edit/index.tsx
|
|
53
|
+
import { useParams, useSearchParams } from "react-router-dom";
|
|
54
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
55
|
+
var Component = () => {
|
|
56
|
+
const { id } = useParams();
|
|
57
|
+
const [searchParams] = useSearchParams();
|
|
58
|
+
const ids = searchParams.get("ids[]");
|
|
59
|
+
const { price_list, isLoading, isError, error } = usePriceList(id, {
|
|
60
|
+
fields: "*prices,prices.price_set.variant.id,prices.price_rules.attribute,prices.price_rules.value"
|
|
61
|
+
});
|
|
62
|
+
const productIds = ids?.split(",");
|
|
63
|
+
const {
|
|
64
|
+
products,
|
|
65
|
+
isLoading: isProductsLoading,
|
|
66
|
+
isError: isProductsError,
|
|
67
|
+
error: productError
|
|
68
|
+
} = useProducts({
|
|
69
|
+
id: productIds,
|
|
70
|
+
limit: productIds?.length || 9999,
|
|
71
|
+
// Temporary until we support lazy loading in the DataGrid
|
|
72
|
+
price_list_id: [id],
|
|
73
|
+
// TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config
|
|
74
|
+
fields: "title,thumbnail,*variants,-type,-collection,-options,-tags,-images,-sales_channels"
|
|
75
|
+
});
|
|
76
|
+
const { isReady, regions, currencies, pricePreferences } = usePriceListCurrencyData();
|
|
77
|
+
const ready = !isLoading && !!price_list && !isProductsLoading && !!products && isReady;
|
|
78
|
+
if (isError) {
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
if (isProductsError) {
|
|
82
|
+
throw productError;
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ jsxs(RouteFocusModal, { children: [
|
|
85
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
|
|
86
|
+
"Edit Prices for ",
|
|
87
|
+
price_list?.title
|
|
88
|
+
] }) }),
|
|
89
|
+
/* @__PURE__ */ jsx(RouteFocusModal.Description, { className: "sr-only", children: "Update prices for products in the price list" }),
|
|
90
|
+
ready && /* @__PURE__ */ jsx(
|
|
91
|
+
PriceListPricesEditForm,
|
|
92
|
+
{
|
|
93
|
+
priceList: price_list,
|
|
94
|
+
products,
|
|
95
|
+
regions,
|
|
96
|
+
currencies,
|
|
97
|
+
pricePreferences
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] });
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
Component
|
|
104
|
+
};
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FileUpload,
|
|
3
|
+
MediaSchema
|
|
4
|
+
} from "./chunk-VKC3XKFF.js";
|
|
5
|
+
import "./chunk-IZ5RG5XI.js";
|
|
6
|
+
import "./chunk-SMQT3ZNO.js";
|
|
7
|
+
import {
|
|
8
|
+
CountrySelect
|
|
9
|
+
} from "./chunk-S3PQKKNV.js";
|
|
10
|
+
import "./chunk-QUNDGPF7.js";
|
|
11
|
+
import "./chunk-TKGWSUEI.js";
|
|
12
|
+
import {
|
|
13
|
+
KeyboundForm
|
|
14
|
+
} from "./chunk-U2ZFCAPX.js";
|
|
15
|
+
import {
|
|
16
|
+
RouteDrawer,
|
|
17
|
+
useRouteModal
|
|
18
|
+
} from "./chunk-3CK6OINO.js";
|
|
19
|
+
import {
|
|
20
|
+
Form
|
|
21
|
+
} from "./chunk-3QSRE5LS.js";
|
|
22
|
+
import "./chunk-JRTZWK77.js";
|
|
23
|
+
import {
|
|
24
|
+
useMe,
|
|
25
|
+
useUpdateMe
|
|
26
|
+
} from "./chunk-OSFOX7MG.js";
|
|
27
|
+
import "./chunk-W4KHJ4D6.js";
|
|
28
|
+
import "./chunk-VGJTARSA.js";
|
|
29
|
+
import "./chunk-DYUTYBAQ.js";
|
|
30
|
+
import "./chunk-Y4VBOHAP.js";
|
|
31
|
+
import "./chunk-JKXAL7WR.js";
|
|
32
|
+
import "./chunk-DC2K6CFQ.js";
|
|
33
|
+
import "./chunk-VDWGP2U6.js";
|
|
34
|
+
import "./chunk-RE7YXVFG.js";
|
|
35
|
+
import "./chunk-HUNGNEPY.js";
|
|
36
|
+
import "./chunk-PADOWAXM.js";
|
|
37
|
+
import "./chunk-LWVBKUUL.js";
|
|
38
|
+
import "./chunk-RIILGKYR.js";
|
|
39
|
+
import "./chunk-6EYGH3TB.js";
|
|
40
|
+
import "./chunk-GTUR4HSV.js";
|
|
41
|
+
import "./chunk-SI4ALL7W.js";
|
|
42
|
+
import "./chunk-ZFFA36DB.js";
|
|
43
|
+
import "./chunk-VHMGJUYN.js";
|
|
44
|
+
import "./chunk-ASVMGV2B.js";
|
|
45
|
+
import "./chunk-WPFTRRWV.js";
|
|
46
|
+
import "./chunk-A5DJIOHN.js";
|
|
47
|
+
import "./chunk-RHKRREUU.js";
|
|
48
|
+
import "./chunk-ZA2KFUFR.js";
|
|
49
|
+
import {
|
|
50
|
+
uploadFilesQuery
|
|
51
|
+
} from "./chunk-Y224F4UU.js";
|
|
52
|
+
import "./chunk-PKBMQBKP.js";
|
|
53
|
+
|
|
54
|
+
// src/pages/settings/seller/edit/index.tsx
|
|
55
|
+
import { Heading } from "@medusajs/ui";
|
|
56
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
57
|
+
|
|
58
|
+
// src/pages/settings/seller/edit/_components/edit-seller-form.tsx
|
|
59
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
60
|
+
import { Button, Input, toast } from "@medusajs/ui";
|
|
61
|
+
import { useFieldArray, useForm } from "react-hook-form";
|
|
62
|
+
import { useTranslation } from "react-i18next";
|
|
63
|
+
import * as zod from "zod";
|
|
64
|
+
import { useCallback } from "react";
|
|
65
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
66
|
+
var EditSellerSchema = zod.object({
|
|
67
|
+
name: zod.string().min(1),
|
|
68
|
+
handle: zod.string().min(1),
|
|
69
|
+
email: zod.string().email().optional().or(zod.literal("")),
|
|
70
|
+
phone: zod.string().optional().or(zod.literal("")),
|
|
71
|
+
address: zod.object({
|
|
72
|
+
address_1: zod.string().optional().or(zod.literal("")),
|
|
73
|
+
address_2: zod.string().optional().or(zod.literal("")),
|
|
74
|
+
city: zod.string().optional().or(zod.literal("")),
|
|
75
|
+
province: zod.string().optional().or(zod.literal("")),
|
|
76
|
+
postal_code: zod.string().optional().or(zod.literal("")),
|
|
77
|
+
country_code: zod.string().optional().or(zod.literal(""))
|
|
78
|
+
}),
|
|
79
|
+
media: zod.array(MediaSchema).optional(),
|
|
80
|
+
coverMedia: zod.array(MediaSchema).optional()
|
|
81
|
+
});
|
|
82
|
+
var SUPPORTED_FORMATS = [
|
|
83
|
+
"image/jpeg",
|
|
84
|
+
"image/png",
|
|
85
|
+
"image/gif",
|
|
86
|
+
"image/webp",
|
|
87
|
+
"image/heic",
|
|
88
|
+
"image/svg+xml"
|
|
89
|
+
];
|
|
90
|
+
var SUPPORTED_FORMATS_FILE_EXTENSIONS = [
|
|
91
|
+
".jpeg",
|
|
92
|
+
".png",
|
|
93
|
+
".gif",
|
|
94
|
+
".webp",
|
|
95
|
+
".heic",
|
|
96
|
+
".svg"
|
|
97
|
+
];
|
|
98
|
+
var EditSellerForm = ({ seller }) => {
|
|
99
|
+
const { t } = useTranslation();
|
|
100
|
+
const { handleSuccess } = useRouteModal();
|
|
101
|
+
const form = useForm({
|
|
102
|
+
defaultValues: {
|
|
103
|
+
name: seller.name ?? "",
|
|
104
|
+
handle: seller.handle ?? "",
|
|
105
|
+
email: seller.email ?? "",
|
|
106
|
+
phone: seller.phone ?? "",
|
|
107
|
+
address: {
|
|
108
|
+
address_1: seller.address_1 ?? "",
|
|
109
|
+
address_2: seller.address_2 ?? "",
|
|
110
|
+
city: seller.city ?? "",
|
|
111
|
+
province: seller.province ?? "",
|
|
112
|
+
postal_code: seller.postal_code ?? "",
|
|
113
|
+
country_code: seller.country_code ?? ""
|
|
114
|
+
},
|
|
115
|
+
media: [],
|
|
116
|
+
coverMedia: []
|
|
117
|
+
},
|
|
118
|
+
resolver: zodResolver(EditSellerSchema)
|
|
119
|
+
});
|
|
120
|
+
const { fields: logoFields } = useFieldArray({
|
|
121
|
+
name: "media",
|
|
122
|
+
control: form.control,
|
|
123
|
+
keyName: "field_id"
|
|
124
|
+
});
|
|
125
|
+
const { fields: coverFields } = useFieldArray({
|
|
126
|
+
name: "coverMedia",
|
|
127
|
+
control: form.control,
|
|
128
|
+
keyName: "field_id"
|
|
129
|
+
});
|
|
130
|
+
const { mutateAsync, isPending } = useUpdateMe();
|
|
131
|
+
const handleSubmit = form.handleSubmit(async (values) => {
|
|
132
|
+
let logoUrl = seller.logo || "";
|
|
133
|
+
let coverImageUrl = seller.cover_image || "";
|
|
134
|
+
try {
|
|
135
|
+
if (values.media?.length) {
|
|
136
|
+
const uploaded = await uploadFilesQuery(values.media);
|
|
137
|
+
logoUrl = uploaded.files?.[0]?.url || logoUrl;
|
|
138
|
+
}
|
|
139
|
+
if (values.coverMedia?.length) {
|
|
140
|
+
const uploaded = await uploadFilesQuery(values.coverMedia);
|
|
141
|
+
coverImageUrl = uploaded.files?.[0]?.url || coverImageUrl;
|
|
142
|
+
}
|
|
143
|
+
} catch (error) {
|
|
144
|
+
if (error instanceof Error) {
|
|
145
|
+
toast.error(error.message);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
await mutateAsync(
|
|
149
|
+
{
|
|
150
|
+
name: values.name,
|
|
151
|
+
handle: values.handle,
|
|
152
|
+
email: values.email || void 0,
|
|
153
|
+
phone: values.phone || null,
|
|
154
|
+
logo: logoUrl || null,
|
|
155
|
+
cover_image: coverImageUrl || null,
|
|
156
|
+
address_1: values.address.address_1 || null,
|
|
157
|
+
address_2: values.address.address_2 || null,
|
|
158
|
+
city: values.address.city || null,
|
|
159
|
+
province: values.address.province || null,
|
|
160
|
+
postal_code: values.address.postal_code || null,
|
|
161
|
+
country_code: values.address.country_code || null
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
onSuccess: () => {
|
|
165
|
+
toast.success(t("app.menus.seller.sellerSettings"));
|
|
166
|
+
handleSuccess();
|
|
167
|
+
},
|
|
168
|
+
onError: (error) => {
|
|
169
|
+
toast.error(error.message);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
const hasInvalidFiles = useCallback(
|
|
175
|
+
(fileList) => {
|
|
176
|
+
const invalidFile = fileList.find(
|
|
177
|
+
(f) => !SUPPORTED_FORMATS.includes(f.file.type)
|
|
178
|
+
);
|
|
179
|
+
if (invalidFile) {
|
|
180
|
+
form.setError("media", {
|
|
181
|
+
type: "invalid_file",
|
|
182
|
+
message: t("products.media.invalidFileType", {
|
|
183
|
+
name: invalidFile.file.name,
|
|
184
|
+
types: SUPPORTED_FORMATS_FILE_EXTENSIONS.join(", ")
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
},
|
|
191
|
+
[form, t]
|
|
192
|
+
);
|
|
193
|
+
const onLogoUploaded = (files) => {
|
|
194
|
+
form.clearErrors("media");
|
|
195
|
+
if (hasInvalidFiles(files)) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
form.setValue("media", [{ ...files[0], isThumbnail: false }]);
|
|
199
|
+
};
|
|
200
|
+
const onCoverUploaded = (files) => {
|
|
201
|
+
form.clearErrors("coverMedia");
|
|
202
|
+
if (hasInvalidFiles(files)) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
form.setValue("coverMedia", [{ ...files[0], isThumbnail: false }]);
|
|
206
|
+
};
|
|
207
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
|
|
208
|
+
KeyboundForm,
|
|
209
|
+
{
|
|
210
|
+
onSubmit: handleSubmit,
|
|
211
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-8 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4", children: [
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
215
|
+
Form.Field,
|
|
216
|
+
{
|
|
217
|
+
name: "media",
|
|
218
|
+
control: form.control,
|
|
219
|
+
render: () => {
|
|
220
|
+
const previewUrl = logoFields[0]?.url || seller.logo;
|
|
221
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
222
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("store.logo", "Logo") }),
|
|
223
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
224
|
+
FileUpload,
|
|
225
|
+
{
|
|
226
|
+
uploadedImage: previewUrl,
|
|
227
|
+
multiple: false,
|
|
228
|
+
label: t("products.media.uploadImagesLabel"),
|
|
229
|
+
hint: t("products.media.uploadImagesHint"),
|
|
230
|
+
hasError: !!form.formState.errors.media,
|
|
231
|
+
formats: SUPPORTED_FORMATS,
|
|
232
|
+
onUploaded: onLogoUploaded
|
|
233
|
+
}
|
|
234
|
+
) }),
|
|
235
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
236
|
+
] });
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ jsx(
|
|
241
|
+
Form.Field,
|
|
242
|
+
{
|
|
243
|
+
name: "coverMedia",
|
|
244
|
+
control: form.control,
|
|
245
|
+
render: () => {
|
|
246
|
+
const previewUrl = coverFields[0]?.url || seller.cover_image;
|
|
247
|
+
return /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
248
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("store.coverImage", "Cover image") }),
|
|
249
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
250
|
+
FileUpload,
|
|
251
|
+
{
|
|
252
|
+
uploadedImage: previewUrl,
|
|
253
|
+
multiple: false,
|
|
254
|
+
label: t("products.media.uploadImagesLabel"),
|
|
255
|
+
hint: t("products.media.uploadImagesHint"),
|
|
256
|
+
hasError: !!form.formState.errors.coverMedia,
|
|
257
|
+
formats: SUPPORTED_FORMATS,
|
|
258
|
+
onUploaded: onCoverUploaded
|
|
259
|
+
}
|
|
260
|
+
) }),
|
|
261
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
262
|
+
] });
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ jsx(
|
|
267
|
+
Form.Field,
|
|
268
|
+
{
|
|
269
|
+
control: form.control,
|
|
270
|
+
name: "name",
|
|
271
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
272
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.name") }),
|
|
273
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
274
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
275
|
+
] })
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
/* @__PURE__ */ jsx(
|
|
279
|
+
Form.Field,
|
|
280
|
+
{
|
|
281
|
+
control: form.control,
|
|
282
|
+
name: "handle",
|
|
283
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
284
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.handle") }),
|
|
285
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
286
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
287
|
+
] })
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
/* @__PURE__ */ jsx(
|
|
291
|
+
Form.Field,
|
|
292
|
+
{
|
|
293
|
+
control: form.control,
|
|
294
|
+
name: "email",
|
|
295
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
296
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.email") }),
|
|
297
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", type: "email", ...field }) }),
|
|
298
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
299
|
+
] })
|
|
300
|
+
}
|
|
301
|
+
),
|
|
302
|
+
/* @__PURE__ */ jsx(
|
|
303
|
+
Form.Field,
|
|
304
|
+
{
|
|
305
|
+
control: form.control,
|
|
306
|
+
name: "phone",
|
|
307
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
308
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.phone") }),
|
|
309
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
310
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
311
|
+
] })
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
/* @__PURE__ */ jsx(
|
|
315
|
+
Form.Field,
|
|
316
|
+
{
|
|
317
|
+
control: form.control,
|
|
318
|
+
name: "address.address_1",
|
|
319
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
320
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.address") }),
|
|
321
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
322
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
323
|
+
] })
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
/* @__PURE__ */ jsx(
|
|
327
|
+
Form.Field,
|
|
328
|
+
{
|
|
329
|
+
control: form.control,
|
|
330
|
+
name: "address.address_2",
|
|
331
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
332
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.address2") }),
|
|
333
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
334
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
335
|
+
] })
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ jsx(
|
|
339
|
+
Form.Field,
|
|
340
|
+
{
|
|
341
|
+
control: form.control,
|
|
342
|
+
name: "address.city",
|
|
343
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
344
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.city") }),
|
|
345
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
346
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
347
|
+
] })
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
/* @__PURE__ */ jsx(
|
|
351
|
+
Form.Field,
|
|
352
|
+
{
|
|
353
|
+
control: form.control,
|
|
354
|
+
name: "address.province",
|
|
355
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
356
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.state") }),
|
|
357
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
358
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
359
|
+
] })
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
/* @__PURE__ */ jsx(
|
|
363
|
+
Form.Field,
|
|
364
|
+
{
|
|
365
|
+
control: form.control,
|
|
366
|
+
name: "address.postal_code",
|
|
367
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
368
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.postalCode") }),
|
|
369
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(Input, { size: "small", ...field }) }),
|
|
370
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
371
|
+
] })
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
/* @__PURE__ */ jsx(
|
|
375
|
+
Form.Field,
|
|
376
|
+
{
|
|
377
|
+
control: form.control,
|
|
378
|
+
name: "address.country_code",
|
|
379
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
380
|
+
/* @__PURE__ */ jsx(Form.Label, { optional: true, children: t("fields.country") }),
|
|
381
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
|
|
382
|
+
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
383
|
+
] })
|
|
384
|
+
}
|
|
385
|
+
)
|
|
386
|
+
] }) }),
|
|
387
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
388
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
389
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: t("actions.save") })
|
|
390
|
+
] }) })
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
) });
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
// src/pages/settings/seller/edit/index.tsx
|
|
397
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
398
|
+
var SellerEdit = () => {
|
|
399
|
+
const { t } = useTranslation2();
|
|
400
|
+
const { seller, isPending, isError, error } = useMe();
|
|
401
|
+
const ready = !isPending && !!seller;
|
|
402
|
+
if (isError) {
|
|
403
|
+
throw error;
|
|
404
|
+
}
|
|
405
|
+
return /* @__PURE__ */ jsxs2(RouteDrawer, { children: [
|
|
406
|
+
/* @__PURE__ */ jsx2(RouteDrawer.Header, { children: /* @__PURE__ */ jsx2(Heading, { className: "capitalize", children: t("app.menus.seller.editSeller") }) }),
|
|
407
|
+
ready && /* @__PURE__ */ jsx2(EditSellerForm, { seller })
|
|
408
|
+
] });
|
|
409
|
+
};
|
|
410
|
+
var Component = SellerEdit;
|
|
411
|
+
export {
|
|
412
|
+
Component
|
|
413
|
+
};
|