@mercurjs/vendor 2.2.0-canary.47 → 2.2.0-canary.49

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.
@@ -72,6 +72,7 @@ var StoreAddressForm = ({ seller }) => {
72
72
  const form = useExtendableForm({
73
73
  schema: StoreAddressSchema,
74
74
  model: "seller",
75
+ zone: "address",
75
76
  data: seller,
76
77
  defaultValues: {
77
78
  name: address?.name ?? "",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthLayout
3
- } from "./chunk-HXGLPDZW.js";
3
+ } from "./chunk-IMVZFBCM.js";
4
4
  import {
5
5
  AvatarBox
6
6
  } from "./chunk-CP5IL4P6.js";
@@ -7,25 +7,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  var AuthLayout = ({ children }) => {
8
8
  return /* @__PURE__ */ jsxs("div", { className: "flex h-dvh w-dvw overflow-hidden", children: [
9
9
  /* @__PURE__ */ jsx("div", { className: "bg-ui-bg-base border-ui-border-base flex h-full w-full flex-col overflow-y-auto border-r lg:w-[584px] lg:shrink-0", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col p-8 lg:px-14 lg:py-12", children }) }),
10
- /* @__PURE__ */ jsx(
11
- "div",
10
+ /* @__PURE__ */ jsx("div", { className: "relative hidden flex-1 overflow-hidden lg:flex", children: /* @__PURE__ */ jsx(
11
+ "img",
12
12
  {
13
- className: "relative hidden flex-1 items-center justify-center overflow-hidden lg:flex",
14
- style: {
15
- backgroundImage: `url(${assetUrl("/onboarding/bg.svg")})`,
16
- backgroundSize: "cover",
17
- backgroundPosition: "center"
18
- },
19
- children: /* @__PURE__ */ jsx(
20
- "img",
21
- {
22
- src: assetUrl("/onboarding/0.png"),
23
- alt: "",
24
- className: "max-h-[75%] w-[75%] object-contain"
25
- }
26
- )
13
+ src: assetUrl("/onboarding/illustration.svg"),
14
+ alt: "",
15
+ className: "h-full w-full object-cover"
27
16
  }
28
- )
17
+ ) })
29
18
  ] });
30
19
  };
31
20
 
@@ -45,6 +45,7 @@ var EditCustomerGroupForm = ({
45
45
  const form = useExtendableForm({
46
46
  schema: EditCustomerGroupSchema,
47
47
  model: "customer_group",
48
+ zone: "edit",
48
49
  data: group,
49
50
  defaultValues: {
50
51
  name: group.name || ""
@@ -64,13 +64,12 @@ import { useTranslation as useTranslation2 } from "react-i18next";
64
64
 
65
65
  // src/pages/settings/store/edit/_components/edit-store-form.tsx
66
66
  import i18n from "i18next";
67
- import { InformationCircleSolid } from "@medusajs/icons";
68
67
  import {
69
68
  Button,
70
69
  Heading,
70
+ Hint,
71
71
  Input,
72
72
  Select,
73
- Text,
74
73
  Textarea,
75
74
  toast
76
75
  } from "@medusajs/ui";
@@ -78,7 +77,10 @@ import { useFieldArray } from "react-hook-form";
78
77
  import { useTranslation } from "react-i18next";
79
78
  import * as zod from "zod";
80
79
  import { useCallback } from "react";
81
- import { FormExtensionZone, useExtendableForm } from "@mercurjs/dashboard-shared";
80
+ import {
81
+ FormExtensionZone,
82
+ useExtendableForm
83
+ } from "@mercurjs/dashboard-shared";
82
84
  import { jsx, jsxs } from "react/jsx-runtime";
83
85
  var EditStoreSchema = zod.object({
84
86
  name: zod.string().min(1, { message: i18n.t("store.validation.nameRequired") }),
@@ -130,6 +132,7 @@ var EditStoreForm = ({ seller }) => {
130
132
  const form = useExtendableForm({
131
133
  schema: EditStoreSchema,
132
134
  model: "seller",
135
+ zone: "edit",
133
136
  data: seller,
134
137
  defaultValues: {
135
138
  name: seller.name ?? "",
@@ -138,8 +141,22 @@ var EditStoreForm = ({ seller }) => {
138
141
  phone: seller.phone ?? "",
139
142
  description: seller.description ?? "",
140
143
  website_url: stripWebsiteProtocol(seller.website_url),
141
- media: seller.logo ? [{ id: "existing-logo", url: seller.logo, isThumbnail: false, file: null }] : [],
142
- bannerMedia: seller.banner ? [{ id: "existing-banner", url: seller.banner, isThumbnail: false, file: null }] : []
144
+ media: seller.logo ? [
145
+ {
146
+ id: "existing-logo",
147
+ url: seller.logo,
148
+ isThumbnail: false,
149
+ file: null
150
+ }
151
+ ] : [],
152
+ bannerMedia: seller.banner ? [
153
+ {
154
+ id: "existing-banner",
155
+ url: seller.banner,
156
+ isThumbnail: false,
157
+ file: null
158
+ }
159
+ ] : []
143
160
  }
144
161
  });
145
162
  const { fields: logoFields } = useFieldArray({
@@ -390,13 +407,7 @@ var EditStoreForm = ({ seller }) => {
390
407
  }
391
408
  }
392
409
  ),
393
- /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-component shadow-elevation-card-rest flex items-start gap-x-2 rounded-lg px-4 py-3", children: [
394
- /* @__PURE__ */ jsx(InformationCircleSolid, { className: "text-ui-fg-interactive mt-[2px]" }),
395
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-0.5", children: [
396
- /* @__PURE__ */ jsx(Text, { size: "small", weight: "plus", className: "text-ui-fg-base", children: t("store.edit.mediaTipLabel") }),
397
- /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: t("store.edit.mediaTipBody") })
398
- ] })
399
- ] })
410
+ /* @__PURE__ */ jsx(Hint, { children: t("store.edit.mediaTipBody") })
400
411
  ] }),
401
412
  /* @__PURE__ */ jsx(
402
413
  FormExtensionZone,
@@ -49,6 +49,7 @@ var EditCampaignForm = ({ campaign }) => {
49
49
  const form = useExtendableForm({
50
50
  schema: EditCampaignSchema,
51
51
  model: "campaign",
52
+ zone: "edit",
52
53
  data: campaign,
53
54
  defaultValues: {
54
55
  name: campaign.name || "",
@@ -59,6 +59,7 @@ var PriceListEditForm = ({ priceList }) => {
59
59
  const form = useExtendableForm({
60
60
  schema: PriceListEditSchema,
61
61
  model: "price_list",
62
+ zone: "edit",
62
63
  data: priceList,
63
64
  defaultValues: {
64
65
  type: priceList.type,
@@ -81,6 +81,7 @@ var EditProductForm = ({ product }) => {
81
81
  const form = useExtendableForm({
82
82
  schema: EditProductSchema,
83
83
  model: "product",
84
+ zone: "edit",
84
85
  data: product,
85
86
  defaultValues: {
86
87
  title: product.title,
@@ -50,6 +50,7 @@ var EditPromotionDetailsForm = ({ promotion }) => {
50
50
  const form = useExtendableForm({
51
51
  schema: EditPromotionSchema,
52
52
  model: "promotion",
53
+ zone: "edit",
53
54
  data: promotion,
54
55
  defaultValues: {
55
56
  is_automatic: promotion.is_automatic.toString(),
@@ -50,6 +50,7 @@ var EditInventoryItemForm = ({ item }) => {
50
50
  const form = useExtendableForm({
51
51
  schema: EditInventoryItemSchema,
52
52
  model: "inventory_item",
53
+ zone: "edit",
53
54
  data: item,
54
55
  defaultValues: getDefaultValues(item)
55
56
  });
package/dist/index.css CHANGED
@@ -1797,9 +1797,6 @@ video {
1797
1797
  .max-h-\[612px\] {
1798
1798
  max-height: 612px;
1799
1799
  }
1800
- .max-h-\[75\%\] {
1801
- max-height: 75%;
1802
- }
1803
1800
  .max-h-\[80vh\] {
1804
1801
  max-height: 80vh;
1805
1802
  }
@@ -1986,9 +1983,6 @@ video {
1986
1983
  .w-\[720px\] {
1987
1984
  width: 720px;
1988
1985
  }
1989
- .w-\[75\%\] {
1990
- width: 75%;
1991
- }
1992
1986
  .w-\[calc\(100\%-16px\)\] {
1993
1987
  width: calc(100% - 16px);
1994
1988
  }
package/dist/index.js CHANGED
@@ -2968,7 +2968,7 @@ function getRouteMap({
2968
2968
  children: [
2969
2969
  {
2970
2970
  path: "edit",
2971
- lazy: () => import("./edit-QAEVZCLC.js")
2971
+ lazy: () => import("./edit-X4DFAW7S.js")
2972
2972
  },
2973
2973
  {
2974
2974
  path: "edit-variant",
@@ -3369,7 +3369,7 @@ function getRouteMap({
3369
3369
  children: [
3370
3370
  {
3371
3371
  path: "edit",
3372
- lazy: () => import("./customer-group-edit-5HHG26RH.js")
3372
+ lazy: () => import("./customer-group-edit-UA36663R.js")
3373
3373
  },
3374
3374
  {
3375
3375
  path: "add-customers",
@@ -3526,7 +3526,7 @@ function getRouteMap({
3526
3526
  children: [
3527
3527
  {
3528
3528
  path: "edit",
3529
- lazy: () => import("./edit-inventory-item-3TRMI5NI.js")
3529
+ lazy: () => import("./edit-inventory-item-NHSXZ7UB.js")
3530
3530
  },
3531
3531
  {
3532
3532
  path: "attributes",
@@ -3596,7 +3596,7 @@ function getRouteMap({
3596
3596
  children: [
3597
3597
  {
3598
3598
  path: "edit",
3599
- lazy: () => import("./edit-S3RDU3Z3.js")
3599
+ lazy: () => import("./edit-YLWMEXUS.js")
3600
3600
  },
3601
3601
  {
3602
3602
  path: "add-to-campaign",
@@ -3658,7 +3658,7 @@ function getRouteMap({
3658
3658
  children: [
3659
3659
  {
3660
3660
  path: "edit",
3661
- lazy: () => import("./edit-YDAGY756.js")
3661
+ lazy: () => import("./edit-JT4OKP5H.js")
3662
3662
  },
3663
3663
  {
3664
3664
  path: "configuration",
@@ -3725,7 +3725,7 @@ function getRouteMap({
3725
3725
  children: [
3726
3726
  {
3727
3727
  path: "edit",
3728
- lazy: () => import("./edit-PQ56RFZD.js")
3728
+ lazy: () => import("./edit-UYYI6HIT.js")
3729
3729
  },
3730
3730
  {
3731
3731
  path: "configuration",
@@ -3786,14 +3786,14 @@ function getRouteMap({
3786
3786
  {
3787
3787
  path: "",
3788
3788
  lazy: async () => {
3789
- const { ProfileDetailPage } = await import("./profile-L373WUQS.js");
3789
+ const { ProfileDetailPage } = await import("./profile-HYJJLO63.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-L373WUQS.js");
3796
+ const { ProfileEdit } = await import("./profile-HYJJLO63.js");
3797
3797
  return { Component: ProfileEdit };
3798
3798
  }
3799
3799
  }
@@ -3818,19 +3818,19 @@ function getRouteMap({
3818
3818
  children: [
3819
3819
  {
3820
3820
  path: "edit",
3821
- lazy: () => import("./edit-JLU7XI3X.js")
3821
+ lazy: () => import("./edit-2VECG7VL.js")
3822
3822
  },
3823
3823
  {
3824
3824
  path: "address",
3825
- lazy: () => import("./address-MGVOVZEW.js")
3825
+ lazy: () => import("./address-ZR4EM2QA.js")
3826
3826
  },
3827
3827
  {
3828
3828
  path: "payment-details",
3829
- lazy: () => import("./payment-details-7NCQIWZ6.js")
3829
+ lazy: () => import("./payment-details-T7CKYYQR.js")
3830
3830
  },
3831
3831
  {
3832
3832
  path: "professional-details",
3833
- lazy: () => import("./professional-details-B3RHBR23.js")
3833
+ lazy: () => import("./professional-details-UVRM7GID.js")
3834
3834
  },
3835
3835
  {
3836
3836
  path: "store-closure",
@@ -4225,7 +4225,7 @@ function getRouteMap({
4225
4225
  {
4226
4226
  path: "/login",
4227
4227
  lazy: async () => {
4228
- const { LoginPage } = await import("./login-FOJP63UB.js");
4228
+ const { LoginPage } = await import("./login-Z43XSPNR.js");
4229
4229
  return { Component: LoginPage };
4230
4230
  }
4231
4231
  },
@@ -4236,22 +4236,22 @@ function getRouteMap({
4236
4236
  {
4237
4237
  path: "/register",
4238
4238
  lazy: async () => {
4239
- const { RegisterPage } = await import("./register-GPQVBTLZ.js");
4239
+ const { RegisterPage } = await import("./register-SAHRSTMJ.js");
4240
4240
  return { Component: RegisterPage };
4241
4241
  }
4242
4242
  },
4243
4243
  {
4244
4244
  path: "/onboarding",
4245
- lazy: () => import("./onboarding-433IKWZF.js")
4245
+ lazy: () => import("./onboarding-EHKVCM6M.js")
4246
4246
  },
4247
4247
  {
4248
4248
  path: "/invite",
4249
- lazy: () => import("./invite-6EDS7MS7.js")
4249
+ lazy: () => import("./invite-CQEODMVX.js")
4250
4250
  },
4251
4251
  {
4252
4252
  path: "/store-select",
4253
4253
  lazy: async () => {
4254
- const { StoreSelectPage } = await import("./store-select-VDFMT3KZ.js");
4254
+ const { StoreSelectPage } = await import("./store-select-SARJSWL4.js");
4255
4255
  return { Component: StoreSelectPage };
4256
4256
  }
4257
4257
  },
@@ -139,25 +139,14 @@ var Invite = () => {
139
139
  },
140
140
  "form"
141
141
  ) }) }),
142
- /* @__PURE__ */ jsx(
143
- "div",
142
+ /* @__PURE__ */ jsx("div", { className: "hidden lg:flex flex-1 relative overflow-hidden", children: /* @__PURE__ */ jsx(
143
+ "img",
144
144
  {
145
- className: "hidden lg:flex flex-1 relative overflow-hidden items-center justify-center",
146
- style: {
147
- backgroundImage: `url(${assetUrl("/onboarding/bg.svg")})`,
148
- backgroundSize: "cover",
149
- backgroundPosition: "center"
150
- },
151
- children: /* @__PURE__ */ jsx(
152
- "img",
153
- {
154
- src: assetUrl("/onboarding/0.png"),
155
- alt: "",
156
- className: "w-[75%] max-h-[75%] object-contain"
157
- }
158
- )
145
+ src: assetUrl("/onboarding/illustration.svg"),
146
+ alt: "",
147
+ className: "h-full w-full object-cover"
159
148
  }
160
- )
149
+ ) })
161
150
  ] });
162
151
  };
163
152
  var SuccessView = ({ sellerName }) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LoginPage
3
- } from "./chunk-4YM7N6OQ.js";
4
- import "./chunk-HXGLPDZW.js";
3
+ } from "./chunk-ICKOFNHF.js";
4
+ import "./chunk-IMVZFBCM.js";
5
5
  import "./chunk-CP5IL4P6.js";
6
6
  import "./chunk-KVKO6N4G.js";
7
7
  import "./chunk-C6SUTRP2.js";
@@ -61,12 +61,13 @@ var onboardingLoader = async () => {
61
61
  };
62
62
 
63
63
  // src/pages/onboarding/onboarding.tsx
64
- import { useEffect as useEffect2 } from "react";
64
+ import { useEffect } from "react";
65
65
  import { Navigate, useLocation } from "react-router-dom";
66
66
 
67
67
  // src/components/onboarding-wizard/onboarding-wizard.tsx
68
68
  import { AnimatePresence } from "motion/react";
69
69
  import { useNavigate as useNavigate2 } from "react-router-dom";
70
+ import { linkFields, useExtension } from "@mercurjs/dashboard-shared";
70
71
 
71
72
  // src/components/onboarding-wizard/wizard-sidebar.tsx
72
73
  import { ChevronLeft } from "@medusajs/icons";
@@ -129,38 +130,16 @@ var WizardSidebar = ({
129
130
  };
130
131
 
131
132
  // src/components/onboarding-wizard/wizard-preview.tsx
132
- import { useEffect } from "react";
133
133
  import { jsx as jsx2 } from "react/jsx-runtime";
134
- var STEP_IMAGES = {
135
- 0: assetUrl("/onboarding/1.png"),
136
- 1: assetUrl("/onboarding/2.png"),
137
- 2: assetUrl("/onboarding/3.png"),
138
- 3: assetUrl("/onboarding/4.png")
139
- };
140
- var preloadImages = () => {
141
- Object.values(STEP_IMAGES).forEach((src) => {
142
- const img = new Image();
143
- img.src = src;
144
- });
145
- };
146
- var WizardPreview = ({ currentStep }) => {
147
- useEffect(preloadImages, []);
148
- const image = STEP_IMAGES[currentStep];
149
- return /* @__PURE__ */ jsx2(
150
- "div",
134
+ var WizardPreview = () => {
135
+ return /* @__PURE__ */ jsx2("div", { className: "hidden lg:flex flex-1 relative overflow-hidden", children: /* @__PURE__ */ jsx2(
136
+ "img",
151
137
  {
152
- className: "hidden lg:flex flex-1 relative overflow-hidden items-center justify-center",
153
- style: { backgroundImage: `url(${assetUrl("/onboarding/bg.svg")})`, backgroundSize: "cover", backgroundPosition: "center" },
154
- children: /* @__PURE__ */ jsx2(
155
- "img",
156
- {
157
- src: image,
158
- alt: "",
159
- className: "w-[75%] max-h-[75%] object-contain"
160
- }
161
- )
138
+ src: assetUrl("/onboarding/illustration.svg"),
139
+ alt: "",
140
+ className: "h-full w-full object-cover"
162
141
  }
163
- );
142
+ ) });
164
143
  };
165
144
 
166
145
  // src/components/onboarding-wizard/wizard-step.tsx
@@ -366,6 +345,7 @@ var StoreStep = ({ onSubmit, isPending }) => {
366
345
  const form = useExtendableForm({
367
346
  schema: StoreStepSchema,
368
347
  model: "seller",
348
+ zone: "onboarding",
369
349
  data: store,
370
350
  defaultValues: {
371
351
  name: "",
@@ -870,7 +850,10 @@ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
870
850
  var OnboardingWizard = ({ memberEmail }) => {
871
851
  const navigate = useNavigate2();
872
852
  const { mutateAsync: logoutMutation } = useLogout();
873
- const { seller_members } = useSellers();
853
+ const links = useExtension().getLinks("seller");
854
+ const { seller_members } = useSellers(
855
+ links.length ? { fields: linkFields(links) } : void 0
856
+ );
874
857
  const hasStores = (seller_members?.length ?? 0) > 0;
875
858
  const {
876
859
  currentStep,
@@ -945,7 +928,7 @@ var OnboardingWizard = ({ memberEmail }) => {
945
928
  children: /* @__PURE__ */ jsx8(AnimatePresence, { mode: "wait", children: renderStep() })
946
929
  }
947
930
  ),
948
- /* @__PURE__ */ jsx8(WizardPreview, { currentStep })
931
+ /* @__PURE__ */ jsx8(WizardPreview, {})
949
932
  ] });
950
933
  };
951
934
 
@@ -955,7 +938,7 @@ var ONBOARDING_EMAIL_KEY = "mercur_onboarding_email";
955
938
  var Onboarding = () => {
956
939
  const location = useLocation();
957
940
  const stateEmail = location.state?.email;
958
- useEffect2(() => {
941
+ useEffect(() => {
959
942
  if (stateEmail) {
960
943
  sessionStorage.setItem(ONBOARDING_EMAIL_KEY, stateEmail);
961
944
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  LoginPage
3
- } from "../chunk-4YM7N6OQ.js";
4
- import "../chunk-HXGLPDZW.js";
3
+ } from "../chunk-ICKOFNHF.js";
4
+ import "../chunk-IMVZFBCM.js";
5
5
  import "../chunk-CP5IL4P6.js";
6
6
  import "../chunk-KVKO6N4G.js";
7
7
  import {
@@ -76,6 +76,7 @@ var StorePaymentDetailsForm = ({
76
76
  const form = useExtendableForm({
77
77
  schema: StorePaymentDetailsSchema,
78
78
  model: "seller",
79
+ zone: "payment-details",
79
80
  data: seller,
80
81
  defaultValues: {
81
82
  country_code: details?.country_code ?? "",
@@ -64,6 +64,7 @@ var StoreProfessionalDetailsForm = ({
64
64
  const form = useExtendableForm({
65
65
  schema: StoreProfessionalDetailsSchema,
66
66
  model: "seller",
67
+ zone: "professional-details",
67
68
  data: seller,
68
69
  defaultValues: {
69
70
  corporate_name: details?.corporate_name ?? "",
@@ -158,6 +158,7 @@ var EditProfileForm = () => {
158
158
  const form = useExtendableForm({
159
159
  schema: EditProfileSchema,
160
160
  model: "member",
161
+ zone: "edit",
161
162
  data: member,
162
163
  defaultValues: {
163
164
  first_name: member?.first_name ?? "",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthLayout
3
- } from "./chunk-HXGLPDZW.js";
3
+ } from "./chunk-IMVZFBCM.js";
4
4
  import {
5
5
  AvatarBox
6
6
  } from "./chunk-CP5IL4P6.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthLayout
3
- } from "./chunk-HXGLPDZW.js";
3
+ } from "./chunk-IMVZFBCM.js";
4
4
  import {
5
5
  AvatarBox
6
6
  } from "./chunk-CP5IL4P6.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/vendor",
3
- "version": "2.2.0-canary.47",
3
+ "version": "2.2.0-canary.49",
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.47",
38
- "@mercurjs/client": "2.2.0-canary.47",
37
+ "@mercurjs/dashboard-shared": "2.2.0-canary.49",
38
+ "@mercurjs/client": "2.2.0-canary.49",
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.47",
92
- "@mercurjs/dashboard-sdk": "2.2.0-canary.47",
93
- "@mercurjs/types": "2.2.0-canary.47"
91
+ "@mercurjs/core": "2.2.0-canary.49",
92
+ "@mercurjs/dashboard-sdk": "2.2.0-canary.49",
93
+ "@mercurjs/types": "2.2.0-canary.49"
94
94
  }
95
95
  }