@mercurjs/vendor 2.2.0-canary.41 → 2.2.0-canary.42
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/{address-XVBSNMFU.js → address-S5J77GB2.js} +17 -6
- package/dist/{edit-IRH2IGXB.js → edit-RA54O5XJ.js} +19 -7
- package/dist/extension-targets.d.ts +9 -9
- package/dist/index.js +8 -8
- package/dist/{payment-details-K2XFATEL.js → payment-details-MEUERL4T.js} +18 -7
- package/dist/{professional-details-WWZPTXSX.js → professional-details-ZTDNQO6F.js} +17 -6
- package/dist/{profile-5IADQ727.js → profile-SEF44YKY.js} +28 -12
- package/dist/{store-FK643K5M.js → store-LR3BGJJ6.js} +6 -6
- package/dist/{store-select-IWYWXESC.js → store-select-7M2JBJ7G.js} +2 -2
- package/package.json +6 -6
|
@@ -50,12 +50,11 @@ import { Heading } from "@medusajs/ui";
|
|
|
50
50
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
51
51
|
|
|
52
52
|
// src/pages/settings/store/address/store-address-form.tsx
|
|
53
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
54
53
|
import i18n from "i18next";
|
|
55
54
|
import { Button, Input, toast } from "@medusajs/ui";
|
|
56
|
-
import { useForm } from "react-hook-form";
|
|
57
55
|
import { useTranslation } from "react-i18next";
|
|
58
56
|
import * as zod from "zod";
|
|
57
|
+
import { FormExtensionZone, useExtendableForm } from "@mercurjs/dashboard-shared";
|
|
59
58
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
60
59
|
var StoreAddressSchema = zod.object({
|
|
61
60
|
name: zod.string().min(1, { message: i18n.t("store.address.validation.nameRequired") }),
|
|
@@ -70,7 +69,10 @@ var StoreAddressForm = ({ seller }) => {
|
|
|
70
69
|
const { t } = useTranslation();
|
|
71
70
|
const { handleSuccess } = useRouteModal();
|
|
72
71
|
const address = seller.address;
|
|
73
|
-
const form =
|
|
72
|
+
const form = useExtendableForm({
|
|
73
|
+
schema: StoreAddressSchema,
|
|
74
|
+
model: "seller",
|
|
75
|
+
data: seller,
|
|
74
76
|
defaultValues: {
|
|
75
77
|
name: address?.name ?? "",
|
|
76
78
|
address_1: address?.address_1 ?? "",
|
|
@@ -79,8 +81,7 @@ var StoreAddressForm = ({ seller }) => {
|
|
|
79
81
|
province: address?.province ?? "",
|
|
80
82
|
postal_code: address?.postal_code ?? "",
|
|
81
83
|
country_code: address?.country_code ?? ""
|
|
82
|
-
}
|
|
83
|
-
resolver: zodResolver(StoreAddressSchema)
|
|
84
|
+
}
|
|
84
85
|
});
|
|
85
86
|
const { mutateAsync, isPending } = useUpdateSellerAddress(seller.id);
|
|
86
87
|
const handleSubmit = form.handleSubmit(async (values) => {
|
|
@@ -92,7 +93,8 @@ var StoreAddressForm = ({ seller }) => {
|
|
|
92
93
|
city: values.city || null,
|
|
93
94
|
province: values.province || null,
|
|
94
95
|
postal_code: values.postal_code || null,
|
|
95
|
-
country_code: values.country_code
|
|
96
|
+
country_code: values.country_code,
|
|
97
|
+
additional_data: values.additional_data
|
|
96
98
|
},
|
|
97
99
|
{
|
|
98
100
|
onSuccess: () => {
|
|
@@ -197,6 +199,15 @@ var StoreAddressForm = ({ seller }) => {
|
|
|
197
199
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
198
200
|
] })
|
|
199
201
|
}
|
|
202
|
+
),
|
|
203
|
+
/* @__PURE__ */ jsx(
|
|
204
|
+
FormExtensionZone,
|
|
205
|
+
{
|
|
206
|
+
model: "seller",
|
|
207
|
+
zone: "address",
|
|
208
|
+
control: form.control,
|
|
209
|
+
data: seller
|
|
210
|
+
}
|
|
200
211
|
)
|
|
201
212
|
] }),
|
|
202
213
|
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
@@ -61,7 +61,6 @@ import { Heading as Heading2 } from "@medusajs/ui";
|
|
|
61
61
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
62
62
|
|
|
63
63
|
// src/pages/settings/store/edit/_components/edit-store-form.tsx
|
|
64
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
65
64
|
import i18n from "i18next";
|
|
66
65
|
import { InformationCircleSolid } from "@medusajs/icons";
|
|
67
66
|
import {
|
|
@@ -73,10 +72,11 @@ import {
|
|
|
73
72
|
Textarea,
|
|
74
73
|
toast
|
|
75
74
|
} from "@medusajs/ui";
|
|
76
|
-
import { useFieldArray
|
|
75
|
+
import { useFieldArray } from "react-hook-form";
|
|
77
76
|
import { useTranslation } from "react-i18next";
|
|
78
77
|
import * as zod from "zod";
|
|
79
78
|
import { useCallback } from "react";
|
|
79
|
+
import { FormExtensionZone, useExtendableForm } from "@mercurjs/dashboard-shared";
|
|
80
80
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
81
81
|
var EditStoreSchema = zod.object({
|
|
82
82
|
name: zod.string().min(1, { message: i18n.t("store.validation.nameRequired") }),
|
|
@@ -125,7 +125,10 @@ var ensureWebsiteProtocol = (url) => {
|
|
|
125
125
|
var EditStoreForm = ({ seller }) => {
|
|
126
126
|
const { t } = useTranslation();
|
|
127
127
|
const { handleSuccess } = useRouteModal();
|
|
128
|
-
const form =
|
|
128
|
+
const form = useExtendableForm({
|
|
129
|
+
schema: EditStoreSchema,
|
|
130
|
+
model: "seller",
|
|
131
|
+
data: seller,
|
|
129
132
|
defaultValues: {
|
|
130
133
|
name: seller.name ?? "",
|
|
131
134
|
handle: seller.handle ?? "",
|
|
@@ -135,8 +138,7 @@ var EditStoreForm = ({ seller }) => {
|
|
|
135
138
|
website_url: stripWebsiteProtocol(seller.website_url),
|
|
136
139
|
media: seller.logo ? [{ id: "existing-logo", url: seller.logo, isThumbnail: false, file: null }] : [],
|
|
137
140
|
bannerMedia: seller.banner ? [{ id: "existing-banner", url: seller.banner, isThumbnail: false, file: null }] : []
|
|
138
|
-
}
|
|
139
|
-
resolver: zodResolver(EditStoreSchema)
|
|
141
|
+
}
|
|
140
142
|
});
|
|
141
143
|
const { fields: logoFields } = useFieldArray({
|
|
142
144
|
name: "media",
|
|
@@ -186,7 +188,8 @@ var EditStoreForm = ({ seller }) => {
|
|
|
186
188
|
description: values.description || null,
|
|
187
189
|
website_url: ensureWebsiteProtocol(values.website_url),
|
|
188
190
|
logo: logoUrl,
|
|
189
|
-
banner: bannerUrl
|
|
191
|
+
banner: bannerUrl,
|
|
192
|
+
additional_data: values.additional_data
|
|
190
193
|
},
|
|
191
194
|
{
|
|
192
195
|
onSuccess: () => {
|
|
@@ -392,7 +395,16 @@ var EditStoreForm = ({ seller }) => {
|
|
|
392
395
|
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: t("store.edit.mediaTipBody") })
|
|
393
396
|
] })
|
|
394
397
|
] })
|
|
395
|
-
] })
|
|
398
|
+
] }),
|
|
399
|
+
/* @__PURE__ */ jsx(
|
|
400
|
+
FormExtensionZone,
|
|
401
|
+
{
|
|
402
|
+
model: "seller",
|
|
403
|
+
zone: "edit",
|
|
404
|
+
control: form.control,
|
|
405
|
+
data: seller
|
|
406
|
+
}
|
|
407
|
+
)
|
|
396
408
|
] }),
|
|
397
409
|
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
398
410
|
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.cancel") }) }),
|
|
@@ -148,6 +148,12 @@ declare module "@mercurjs/dashboard-sdk" {
|
|
|
148
148
|
displayZones: "attributes" | "general" | "locations" | "variants"
|
|
149
149
|
displayFieldIds: "available" | "in_stock" | "reserved" | "sku" | "title"
|
|
150
150
|
}
|
|
151
|
+
"member": {
|
|
152
|
+
formZones: "edit"
|
|
153
|
+
formTabs: Record<string, string>
|
|
154
|
+
displayZones: "general"
|
|
155
|
+
displayFieldIds: "first_name" | "language" | "last_name"
|
|
156
|
+
}
|
|
151
157
|
"offer": {
|
|
152
158
|
formZones: "create" | "edit"
|
|
153
159
|
formTabs: { "create": "catalogue" | "stockLevelsAndPrices" }
|
|
@@ -191,16 +197,10 @@ declare module "@mercurjs/dashboard-sdk" {
|
|
|
191
197
|
displayFieldIds: "available_quantity" | "description" | "line_item_id" | "location" | "reserved_quantity" | "stocked_quantity" | "title"
|
|
192
198
|
}
|
|
193
199
|
"seller": {
|
|
194
|
-
formZones: "onboarding"
|
|
200
|
+
formZones: "address" | "edit" | "onboarding" | "payment-details" | "professional-details"
|
|
195
201
|
formTabs: Record<string, string>
|
|
196
|
-
displayZones: "
|
|
197
|
-
displayFieldIds: "status"
|
|
198
|
-
}
|
|
199
|
-
"store": {
|
|
200
|
-
formZones: never
|
|
201
|
-
formTabs: Record<string, string>
|
|
202
|
-
displayZones: "general"
|
|
203
|
-
displayFieldIds: "currency_code" | "description" | "email" | "handle" | "phone" | "website_url"
|
|
202
|
+
displayZones: "general" | "seller-select"
|
|
203
|
+
displayFieldIds: "currency_code" | "description" | "email" | "handle" | "phone" | "status" | "website_url"
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
}
|
package/dist/index.js
CHANGED
|
@@ -3786,14 +3786,14 @@ function getRouteMap({
|
|
|
3786
3786
|
{
|
|
3787
3787
|
path: "",
|
|
3788
3788
|
lazy: async () => {
|
|
3789
|
-
const { ProfileDetailPage } = await import("./profile-
|
|
3789
|
+
const { ProfileDetailPage } = await import("./profile-SEF44YKY.js");
|
|
3790
3790
|
return { Component: ProfileDetailPage };
|
|
3791
3791
|
},
|
|
3792
3792
|
children: [
|
|
3793
3793
|
{
|
|
3794
3794
|
path: "edit",
|
|
3795
3795
|
lazy: async () => {
|
|
3796
|
-
const { ProfileEdit } = await import("./profile-
|
|
3796
|
+
const { ProfileEdit } = await import("./profile-SEF44YKY.js");
|
|
3797
3797
|
return { Component: ProfileEdit };
|
|
3798
3798
|
}
|
|
3799
3799
|
}
|
|
@@ -3812,25 +3812,25 @@ function getRouteMap({
|
|
|
3812
3812
|
{
|
|
3813
3813
|
path: "",
|
|
3814
3814
|
lazy: async () => {
|
|
3815
|
-
const { StoreDetailPage } = await import("./store-
|
|
3815
|
+
const { StoreDetailPage } = await import("./store-LR3BGJJ6.js");
|
|
3816
3816
|
return { Component: StoreDetailPage };
|
|
3817
3817
|
},
|
|
3818
3818
|
children: [
|
|
3819
3819
|
{
|
|
3820
3820
|
path: "edit",
|
|
3821
|
-
lazy: () => import("./edit-
|
|
3821
|
+
lazy: () => import("./edit-RA54O5XJ.js")
|
|
3822
3822
|
},
|
|
3823
3823
|
{
|
|
3824
3824
|
path: "address",
|
|
3825
|
-
lazy: () => import("./address-
|
|
3825
|
+
lazy: () => import("./address-S5J77GB2.js")
|
|
3826
3826
|
},
|
|
3827
3827
|
{
|
|
3828
3828
|
path: "payment-details",
|
|
3829
|
-
lazy: () => import("./payment-details-
|
|
3829
|
+
lazy: () => import("./payment-details-MEUERL4T.js")
|
|
3830
3830
|
},
|
|
3831
3831
|
{
|
|
3832
3832
|
path: "professional-details",
|
|
3833
|
-
lazy: () => import("./professional-details-
|
|
3833
|
+
lazy: () => import("./professional-details-ZTDNQO6F.js")
|
|
3834
3834
|
},
|
|
3835
3835
|
{
|
|
3836
3836
|
path: "store-closure",
|
|
@@ -4251,7 +4251,7 @@ function getRouteMap({
|
|
|
4251
4251
|
{
|
|
4252
4252
|
path: "/store-select",
|
|
4253
4253
|
lazy: async () => {
|
|
4254
|
-
const { StoreSelectPage } = await import("./store-select-
|
|
4254
|
+
const { StoreSelectPage } = await import("./store-select-7M2JBJ7G.js");
|
|
4255
4255
|
return { Component: StoreSelectPage };
|
|
4256
4256
|
}
|
|
4257
4257
|
},
|
|
@@ -49,12 +49,11 @@ import { Heading } from "@medusajs/ui";
|
|
|
49
49
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
50
50
|
|
|
51
51
|
// src/pages/settings/store/payment-details/store-payment-details-form.tsx
|
|
52
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
53
52
|
import i18n from "i18next";
|
|
54
53
|
import { Button, Input, toast } from "@medusajs/ui";
|
|
55
|
-
import { useForm } from "react-hook-form";
|
|
56
54
|
import { useTranslation } from "react-i18next";
|
|
57
55
|
import * as zod from "zod";
|
|
56
|
+
import { FormExtensionZone, useExtendableForm } from "@mercurjs/dashboard-shared";
|
|
58
57
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
59
58
|
var StorePaymentDetailsSchema = zod.object({
|
|
60
59
|
country_code: zod.string().min(1, {
|
|
@@ -74,7 +73,10 @@ var StorePaymentDetailsForm = ({
|
|
|
74
73
|
const { t } = useTranslation();
|
|
75
74
|
const { handleSuccess } = useRouteModal();
|
|
76
75
|
const details = seller.payment_details;
|
|
77
|
-
const form =
|
|
76
|
+
const form = useExtendableForm({
|
|
77
|
+
schema: StorePaymentDetailsSchema,
|
|
78
|
+
model: "seller",
|
|
79
|
+
data: seller,
|
|
78
80
|
defaultValues: {
|
|
79
81
|
country_code: details?.country_code ?? "",
|
|
80
82
|
holder_name: details?.holder_name ?? "",
|
|
@@ -82,8 +84,7 @@ var StorePaymentDetailsForm = ({
|
|
|
82
84
|
bic: details?.bic ?? "",
|
|
83
85
|
routing_number: details?.routing_number ?? "",
|
|
84
86
|
account_number: details?.account_number ?? ""
|
|
85
|
-
}
|
|
86
|
-
resolver: zodResolver(StorePaymentDetailsSchema)
|
|
87
|
+
}
|
|
87
88
|
});
|
|
88
89
|
const selectedCountry = form.watch("country_code");
|
|
89
90
|
const { mutateAsync, isPending } = useUpdateSellerPaymentDetails(seller.id);
|
|
@@ -96,7 +97,8 @@ var StorePaymentDetailsForm = ({
|
|
|
96
97
|
iban: isABA ? null : values.iban || null,
|
|
97
98
|
bic: isABA ? null : values.bic || null,
|
|
98
99
|
routing_number: isABA ? values.routing_number || null : null,
|
|
99
|
-
account_number: values.account_number || null
|
|
100
|
+
account_number: values.account_number || null,
|
|
101
|
+
additional_data: values.additional_data
|
|
100
102
|
},
|
|
101
103
|
{
|
|
102
104
|
onSuccess: () => {
|
|
@@ -204,7 +206,16 @@ var StorePaymentDetailsForm = ({
|
|
|
204
206
|
] })
|
|
205
207
|
}
|
|
206
208
|
)
|
|
207
|
-
] })
|
|
209
|
+
] }),
|
|
210
|
+
/* @__PURE__ */ jsx(
|
|
211
|
+
FormExtensionZone,
|
|
212
|
+
{
|
|
213
|
+
model: "seller",
|
|
214
|
+
zone: "payment-details",
|
|
215
|
+
control: form.control,
|
|
216
|
+
data: seller
|
|
217
|
+
}
|
|
218
|
+
)
|
|
208
219
|
] }),
|
|
209
220
|
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
210
221
|
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "small", children: t("actions.cancel") }) }),
|
|
@@ -45,11 +45,10 @@ import { Heading } from "@medusajs/ui";
|
|
|
45
45
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
46
46
|
|
|
47
47
|
// src/pages/settings/store/professional-details/store-professional-details-form.tsx
|
|
48
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
49
48
|
import { Button, Input, toast } from "@medusajs/ui";
|
|
50
|
-
import { useForm } from "react-hook-form";
|
|
51
49
|
import { useTranslation } from "react-i18next";
|
|
52
50
|
import * as zod from "zod";
|
|
51
|
+
import { FormExtensionZone, useExtendableForm } from "@mercurjs/dashboard-shared";
|
|
53
52
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
54
53
|
var StoreProfessionalDetailsSchema = zod.object({
|
|
55
54
|
corporate_name: zod.string().optional().or(zod.literal("")),
|
|
@@ -62,13 +61,15 @@ var StoreProfessionalDetailsForm = ({
|
|
|
62
61
|
const { t } = useTranslation();
|
|
63
62
|
const { handleSuccess } = useRouteModal();
|
|
64
63
|
const details = seller.professional_details;
|
|
65
|
-
const form =
|
|
64
|
+
const form = useExtendableForm({
|
|
65
|
+
schema: StoreProfessionalDetailsSchema,
|
|
66
|
+
model: "seller",
|
|
67
|
+
data: seller,
|
|
66
68
|
defaultValues: {
|
|
67
69
|
corporate_name: details?.corporate_name ?? "",
|
|
68
70
|
registration_number: details?.registration_number ?? "",
|
|
69
71
|
tax_id: details?.tax_id ?? ""
|
|
70
|
-
}
|
|
71
|
-
resolver: zodResolver(StoreProfessionalDetailsSchema)
|
|
72
|
+
}
|
|
72
73
|
});
|
|
73
74
|
const { mutateAsync, isPending } = useUpdateSellerProfessionalDetails(
|
|
74
75
|
seller.id
|
|
@@ -78,7 +79,8 @@ var StoreProfessionalDetailsForm = ({
|
|
|
78
79
|
{
|
|
79
80
|
corporate_name: values.corporate_name || null,
|
|
80
81
|
registration_number: values.registration_number || null,
|
|
81
|
-
tax_id: values.tax_id || null
|
|
82
|
+
tax_id: values.tax_id || null,
|
|
83
|
+
additional_data: values.additional_data
|
|
82
84
|
},
|
|
83
85
|
{
|
|
84
86
|
onSuccess: () => {
|
|
@@ -135,6 +137,15 @@ var StoreProfessionalDetailsForm = ({
|
|
|
135
137
|
/* @__PURE__ */ jsx(Form.ErrorMessage, {})
|
|
136
138
|
] })
|
|
137
139
|
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ jsx(
|
|
142
|
+
FormExtensionZone,
|
|
143
|
+
{
|
|
144
|
+
model: "seller",
|
|
145
|
+
zone: "professional-details",
|
|
146
|
+
control: form.control,
|
|
147
|
+
data: seller
|
|
148
|
+
}
|
|
138
149
|
)
|
|
139
150
|
] }),
|
|
140
151
|
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2", children: [
|
|
@@ -60,6 +60,10 @@ import { Children } from "react";
|
|
|
60
60
|
import { PencilSquare } from "@medusajs/icons";
|
|
61
61
|
import { Container, Heading, Text } from "@medusajs/ui";
|
|
62
62
|
import { useTranslation } from "react-i18next";
|
|
63
|
+
import {
|
|
64
|
+
DisplayExtensionZone,
|
|
65
|
+
DisplayField
|
|
66
|
+
} from "@mercurjs/dashboard-shared";
|
|
63
67
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
64
68
|
var ProfileGeneralSection = () => {
|
|
65
69
|
const { i18n, t } = useTranslation();
|
|
@@ -88,18 +92,19 @@ var ProfileGeneralSection = () => {
|
|
|
88
92
|
}
|
|
89
93
|
)
|
|
90
94
|
] }),
|
|
91
|
-
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
95
|
+
/* @__PURE__ */ jsx(DisplayField, { model: "member", zone: "general", id: "first_name", data: member, children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
92
96
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("profile.fields.firstName", "First name") }),
|
|
93
97
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: member?.first_name || "-" })
|
|
94
|
-
] }),
|
|
95
|
-
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
98
|
+
] }) }),
|
|
99
|
+
/* @__PURE__ */ jsx(DisplayField, { model: "member", zone: "general", id: "last_name", data: member, children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
96
100
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("profile.fields.lastName", "Last name") }),
|
|
97
101
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: member?.last_name || "-" })
|
|
98
|
-
] }),
|
|
99
|
-
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
102
|
+
] }) }),
|
|
103
|
+
/* @__PURE__ */ jsx(DisplayField, { model: "member", zone: "general", id: "language", data: member, children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
100
104
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("profile.fields.languageLabel") }),
|
|
101
105
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: languages.find((lang) => lang.code === i18n.language)?.display_name || "-" })
|
|
102
|
-
] })
|
|
106
|
+
] }) }),
|
|
107
|
+
/* @__PURE__ */ jsx(DisplayExtensionZone, { model: "member", zone: "general", data: member })
|
|
103
108
|
] });
|
|
104
109
|
};
|
|
105
110
|
|
|
@@ -117,11 +122,10 @@ import { Heading as Heading2 } from "@medusajs/ui";
|
|
|
117
122
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
118
123
|
|
|
119
124
|
// src/pages/settings/profile/profile-edit/components/edit-profile-form/edit-profile-form.tsx
|
|
120
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
121
125
|
import { Button, Input, Select, toast } from "@medusajs/ui";
|
|
122
|
-
import { useForm } from "react-hook-form";
|
|
123
126
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
124
127
|
import * as zod from "zod";
|
|
128
|
+
import { FormExtensionZone, useExtendableForm } from "@mercurjs/dashboard-shared";
|
|
125
129
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
126
130
|
var EditProfileSchema = zod.object({
|
|
127
131
|
first_name: zod.string().optional().or(zod.literal("")),
|
|
@@ -134,13 +138,15 @@ var EditProfileForm = () => {
|
|
|
134
138
|
const direction = useDocumentDirection();
|
|
135
139
|
const { seller_member } = useMe();
|
|
136
140
|
const member = seller_member?.member;
|
|
137
|
-
const form =
|
|
141
|
+
const form = useExtendableForm({
|
|
142
|
+
schema: EditProfileSchema,
|
|
143
|
+
model: "member",
|
|
144
|
+
data: member,
|
|
138
145
|
defaultValues: {
|
|
139
146
|
first_name: member?.first_name ?? "",
|
|
140
147
|
last_name: member?.last_name ?? "",
|
|
141
148
|
language: i18n.language
|
|
142
|
-
}
|
|
143
|
-
resolver: zodResolver(EditProfileSchema)
|
|
149
|
+
}
|
|
144
150
|
});
|
|
145
151
|
const sortedLanguages = languages.sort(
|
|
146
152
|
(a, b) => a.display_name.localeCompare(b.display_name)
|
|
@@ -150,7 +156,8 @@ var EditProfileForm = () => {
|
|
|
150
156
|
await updateMe(
|
|
151
157
|
{
|
|
152
158
|
first_name: values.first_name || null,
|
|
153
|
-
last_name: values.last_name || null
|
|
159
|
+
last_name: values.last_name || null,
|
|
160
|
+
additional_data: values.additional_data
|
|
154
161
|
},
|
|
155
162
|
{
|
|
156
163
|
onSuccess: async () => {
|
|
@@ -234,6 +241,15 @@ var EditProfileForm = () => {
|
|
|
234
241
|
] })
|
|
235
242
|
] })
|
|
236
243
|
}
|
|
244
|
+
),
|
|
245
|
+
/* @__PURE__ */ jsx3(
|
|
246
|
+
FormExtensionZone,
|
|
247
|
+
{
|
|
248
|
+
model: "member",
|
|
249
|
+
zone: "edit",
|
|
250
|
+
control: form.control,
|
|
251
|
+
data: member
|
|
252
|
+
}
|
|
237
253
|
)
|
|
238
254
|
] }) }),
|
|
239
255
|
/* @__PURE__ */ jsx3(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -401,7 +401,7 @@ var StoreGeneralSection = ({
|
|
|
401
401
|
/* @__PURE__ */ jsx4(
|
|
402
402
|
DisplayField,
|
|
403
403
|
{
|
|
404
|
-
model: "
|
|
404
|
+
model: "seller",
|
|
405
405
|
zone: "general",
|
|
406
406
|
id: "description",
|
|
407
407
|
data: seller,
|
|
@@ -411,22 +411,22 @@ var StoreGeneralSection = ({
|
|
|
411
411
|
] })
|
|
412
412
|
}
|
|
413
413
|
),
|
|
414
|
-
/* @__PURE__ */ jsx4(DisplayField, { model: "
|
|
414
|
+
/* @__PURE__ */ jsx4(DisplayField, { model: "seller", zone: "general", id: "handle", data: seller, children: /* @__PURE__ */ jsxs4("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
415
415
|
/* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", weight: "plus", children: t("fields.handle") }),
|
|
416
416
|
/* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", children: seller.handle ? `/${seller.handle}` : "-" })
|
|
417
417
|
] }) }),
|
|
418
|
-
/* @__PURE__ */ jsx4(DisplayField, { model: "
|
|
418
|
+
/* @__PURE__ */ jsx4(DisplayField, { model: "seller", zone: "general", id: "email", data: seller, children: /* @__PURE__ */ jsxs4("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
419
419
|
/* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", weight: "plus", children: t("fields.email") }),
|
|
420
420
|
/* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", children: seller.email || "-" })
|
|
421
421
|
] }) }),
|
|
422
|
-
/* @__PURE__ */ jsx4(DisplayField, { model: "
|
|
422
|
+
/* @__PURE__ */ jsx4(DisplayField, { model: "seller", zone: "general", id: "phone", data: seller, children: /* @__PURE__ */ jsxs4("div", { className: "text-ui-fg-subtle grid grid-cols-2 px-6 py-4", children: [
|
|
423
423
|
/* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", weight: "plus", children: t("fields.phone") }),
|
|
424
424
|
/* @__PURE__ */ jsx4(Text2, { size: "small", leading: "compact", children: seller.phone || "-" })
|
|
425
425
|
] }) }),
|
|
426
426
|
/* @__PURE__ */ jsx4(
|
|
427
427
|
DisplayField,
|
|
428
428
|
{
|
|
429
|
-
model: "
|
|
429
|
+
model: "seller",
|
|
430
430
|
zone: "general",
|
|
431
431
|
id: "website_url",
|
|
432
432
|
data: seller,
|
|
@@ -439,7 +439,7 @@ var StoreGeneralSection = ({
|
|
|
439
439
|
/* @__PURE__ */ jsx4(
|
|
440
440
|
DisplayField,
|
|
441
441
|
{
|
|
442
|
-
model: "
|
|
442
|
+
model: "seller",
|
|
443
443
|
zone: "general",
|
|
444
444
|
id: "currency_code",
|
|
445
445
|
data: seller,
|
|
@@ -127,7 +127,7 @@ var StoreSelectList = ({
|
|
|
127
127
|
DisplayField,
|
|
128
128
|
{
|
|
129
129
|
model: "seller",
|
|
130
|
-
zone: "
|
|
130
|
+
zone: "seller-select",
|
|
131
131
|
id: "status",
|
|
132
132
|
data: seller,
|
|
133
133
|
children: badge ? /* @__PURE__ */ jsx(StatusBadge, { color: badge.color, children: badge.label }) : null
|
|
@@ -137,7 +137,7 @@ var StoreSelectList = ({
|
|
|
137
137
|
DisplayExtensionZone,
|
|
138
138
|
{
|
|
139
139
|
model: "seller",
|
|
140
|
-
zone: "
|
|
140
|
+
zone: "seller-select",
|
|
141
141
|
data: seller
|
|
142
142
|
}
|
|
143
143
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/vendor",
|
|
3
|
-
"version": "2.2.0-canary.
|
|
3
|
+
"version": "2.2.0-canary.42",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mercurjs/mercur",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"lint": "oxlint --max-warnings 0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@mercurjs/dashboard-shared": "2.2.0-canary.
|
|
38
|
-
"@mercurjs/client": "2.2.0-canary.
|
|
37
|
+
"@mercurjs/dashboard-shared": "2.2.0-canary.42",
|
|
38
|
+
"@mercurjs/client": "2.2.0-canary.42",
|
|
39
39
|
"@ariakit/react": "^0.4.15",
|
|
40
40
|
"@babel/runtime": "^7.26.10",
|
|
41
41
|
"@dnd-kit/core": "^6.1.0",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"tsup": "^8.0.2",
|
|
89
89
|
"typescript": "5.9.3",
|
|
90
90
|
"@medusajs/types": "2.17.2",
|
|
91
|
-
"@mercurjs/core": "2.2.0-canary.
|
|
92
|
-
"@mercurjs/dashboard-sdk": "2.2.0-canary.
|
|
93
|
-
"@mercurjs/types": "2.2.0-canary.
|
|
91
|
+
"@mercurjs/core": "2.2.0-canary.42",
|
|
92
|
+
"@mercurjs/dashboard-sdk": "2.2.0-canary.42",
|
|
93
|
+
"@mercurjs/types": "2.2.0-canary.42"
|
|
94
94
|
}
|
|
95
95
|
}
|