@medusajs/draft-order 2.10.4-preview-20250921120201 → 2.10.4-preview-20250921150154

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.
@@ -9763,70 +9763,23 @@ const BillingAddressForm = ({ order }) => {
9763
9763
  ) });
9764
9764
  };
9765
9765
  const schema$5 = addressSchema;
9766
- const Email = () => {
9767
- const { id } = reactRouterDom.useParams();
9768
- const { order, isPending, isError, error } = useOrder(id, {
9769
- fields: "+email"
9770
- });
9771
- if (isError) {
9772
- throw error;
9773
- }
9774
- const isReady = !isPending && !!order;
9766
+ const CustomItems = () => {
9775
9767
  return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9776
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9777
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
9778
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
9779
- ] }),
9780
- isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
9768
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
9769
+ /* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
9781
9770
  ] });
9782
9771
  };
9783
- const EmailForm = ({ order }) => {
9772
+ const CustomItemsForm = () => {
9784
9773
  const form = reactHookForm.useForm({
9785
- defaultValues: {
9786
- email: order.email ?? ""
9787
- },
9788
9774
  resolver: zod.zodResolver(schema$4)
9789
9775
  });
9790
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9791
- const { handleSuccess } = useRouteModal();
9792
- const onSubmit = form.handleSubmit(async (data) => {
9793
- await mutateAsync(
9794
- { email: data.email },
9795
- {
9796
- onSuccess: () => {
9797
- handleSuccess();
9798
- },
9799
- onError: (error) => {
9800
- ui.toast.error(error.message);
9801
- }
9802
- }
9803
- );
9804
- });
9805
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9806
- KeyboundForm,
9807
- {
9808
- className: "flex flex-1 flex-col overflow-hidden",
9809
- onSubmit,
9810
- children: [
9811
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
9812
- Form$2.Field,
9813
- {
9814
- control: form.control,
9815
- name: "email",
9816
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9817
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
9818
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9819
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9820
- ] })
9821
- }
9822
- ) }),
9823
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9824
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9825
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9826
- ] }) })
9827
- ]
9828
- }
9829
- ) });
9776
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9777
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
9778
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9779
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9780
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
9781
+ ] }) })
9782
+ ] }) });
9830
9783
  };
9831
9784
  const schema$4 = objectType({
9832
9785
  email: stringType().email()
@@ -10805,6 +10758,74 @@ const customItemSchema = objectType({
10805
10758
  quantity: numberType(),
10806
10759
  unit_price: unionType([numberType(), stringType()])
10807
10760
  });
10761
+ const Email = () => {
10762
+ const { id } = reactRouterDom.useParams();
10763
+ const { order, isPending, isError, error } = useOrder(id, {
10764
+ fields: "+email"
10765
+ });
10766
+ if (isError) {
10767
+ throw error;
10768
+ }
10769
+ const isReady = !isPending && !!order;
10770
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
10771
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
10772
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
10773
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
10774
+ ] }),
10775
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
10776
+ ] });
10777
+ };
10778
+ const EmailForm = ({ order }) => {
10779
+ const form = reactHookForm.useForm({
10780
+ defaultValues: {
10781
+ email: order.email ?? ""
10782
+ },
10783
+ resolver: zod.zodResolver(schema$3)
10784
+ });
10785
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10786
+ const { handleSuccess } = useRouteModal();
10787
+ const onSubmit = form.handleSubmit(async (data) => {
10788
+ await mutateAsync(
10789
+ { email: data.email },
10790
+ {
10791
+ onSuccess: () => {
10792
+ handleSuccess();
10793
+ },
10794
+ onError: (error) => {
10795
+ ui.toast.error(error.message);
10796
+ }
10797
+ }
10798
+ );
10799
+ });
10800
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
10801
+ KeyboundForm,
10802
+ {
10803
+ className: "flex flex-1 flex-col overflow-hidden",
10804
+ onSubmit,
10805
+ children: [
10806
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
10807
+ Form$2.Field,
10808
+ {
10809
+ control: form.control,
10810
+ name: "email",
10811
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10812
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
10813
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10814
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10815
+ ] })
10816
+ }
10817
+ ) }),
10818
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
10819
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10820
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10821
+ ] }) })
10822
+ ]
10823
+ }
10824
+ ) });
10825
+ };
10826
+ const schema$3 = objectType({
10827
+ email: stringType().email()
10828
+ });
10808
10829
  const InlineTip = React.forwardRef(
10809
10830
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10810
10831
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -11460,7 +11481,7 @@ const SalesChannelForm = ({ order }) => {
11460
11481
  defaultValues: {
11461
11482
  sales_channel_id: order.sales_channel_id || ""
11462
11483
  },
11463
- resolver: zod.zodResolver(schema$3)
11484
+ resolver: zod.zodResolver(schema$2)
11464
11485
  });
11465
11486
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11466
11487
  const { handleSuccess } = useRouteModal();
@@ -11535,7 +11556,7 @@ const SalesChannelField = ({ control, order }) => {
11535
11556
  }
11536
11557
  );
11537
11558
  };
11538
- const schema$3 = objectType({
11559
+ const schema$2 = objectType({
11539
11560
  sales_channel_id: stringType().min(1)
11540
11561
  });
11541
11562
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12377,7 +12398,7 @@ const ShippingAddressForm = ({ order }) => {
12377
12398
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12378
12399
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12379
12400
  },
12380
- resolver: zod.zodResolver(schema$2)
12401
+ resolver: zod.zodResolver(schema$1)
12381
12402
  });
12382
12403
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12383
12404
  const { handleSuccess } = useRouteModal();
@@ -12547,7 +12568,7 @@ const ShippingAddressForm = ({ order }) => {
12547
12568
  }
12548
12569
  ) });
12549
12570
  };
12550
- const schema$2 = addressSchema;
12571
+ const schema$1 = addressSchema;
12551
12572
  const TransferOwnership = () => {
12552
12573
  const { id } = reactRouterDom.useParams();
12553
12574
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12571,7 +12592,7 @@ const TransferOwnershipForm = ({ order }) => {
12571
12592
  defaultValues: {
12572
12593
  customer_id: order.customer_id || ""
12573
12594
  },
12574
- resolver: zod.zodResolver(schema$1)
12595
+ resolver: zod.zodResolver(schema)
12575
12596
  });
12576
12597
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12577
12598
  const { handleSuccess } = useRouteModal();
@@ -13021,29 +13042,8 @@ const Illustration = () => {
13021
13042
  }
13022
13043
  );
13023
13044
  };
13024
- const schema$1 = objectType({
13025
- customer_id: stringType().min(1)
13026
- });
13027
- const CustomItems = () => {
13028
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
13029
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
13030
- /* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
13031
- ] });
13032
- };
13033
- const CustomItemsForm = () => {
13034
- const form = reactHookForm.useForm({
13035
- resolver: zod.zodResolver(schema)
13036
- });
13037
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
13038
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
13039
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
13040
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13041
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
13042
- ] }) })
13043
- ] }) });
13044
- };
13045
13045
  const schema = objectType({
13046
- email: stringType().email()
13046
+ customer_id: stringType().min(1)
13047
13047
  });
13048
13048
  const widgetModule = { widgets: [] };
13049
13049
  const routeModule = {
@@ -13070,13 +13070,17 @@ const routeModule = {
13070
13070
  path: "/draft-orders/:id/billing-address"
13071
13071
  },
13072
13072
  {
13073
- Component: Email,
13074
- path: "/draft-orders/:id/email"
13073
+ Component: CustomItems,
13074
+ path: "/draft-orders/:id/custom-items"
13075
13075
  },
13076
13076
  {
13077
13077
  Component: Items,
13078
13078
  path: "/draft-orders/:id/items"
13079
13079
  },
13080
+ {
13081
+ Component: Email,
13082
+ path: "/draft-orders/:id/email"
13083
+ },
13080
13084
  {
13081
13085
  Component: Metadata,
13082
13086
  path: "/draft-orders/:id/metadata"
@@ -13100,10 +13104,6 @@ const routeModule = {
13100
13104
  {
13101
13105
  Component: TransferOwnership,
13102
13106
  path: "/draft-orders/:id/transfer-ownership"
13103
- },
13104
- {
13105
- Component: CustomItems,
13106
- path: "/draft-orders/:id/custom-items"
13107
13107
  }
13108
13108
  ]
13109
13109
  }
@@ -9757,70 +9757,23 @@ const BillingAddressForm = ({ order }) => {
9757
9757
  ) });
9758
9758
  };
9759
9759
  const schema$5 = addressSchema;
9760
- const Email = () => {
9761
- const { id } = useParams();
9762
- const { order, isPending, isError, error } = useOrder(id, {
9763
- fields: "+email"
9764
- });
9765
- if (isError) {
9766
- throw error;
9767
- }
9768
- const isReady = !isPending && !!order;
9760
+ const CustomItems = () => {
9769
9761
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9770
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9771
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
9772
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
9773
- ] }),
9774
- isReady && /* @__PURE__ */ jsx(EmailForm, { order })
9762
+ /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
9763
+ /* @__PURE__ */ jsx(CustomItemsForm, {})
9775
9764
  ] });
9776
9765
  };
9777
- const EmailForm = ({ order }) => {
9766
+ const CustomItemsForm = () => {
9778
9767
  const form = useForm({
9779
- defaultValues: {
9780
- email: order.email ?? ""
9781
- },
9782
9768
  resolver: zodResolver(schema$4)
9783
9769
  });
9784
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9785
- const { handleSuccess } = useRouteModal();
9786
- const onSubmit = form.handleSubmit(async (data) => {
9787
- await mutateAsync(
9788
- { email: data.email },
9789
- {
9790
- onSuccess: () => {
9791
- handleSuccess();
9792
- },
9793
- onError: (error) => {
9794
- toast.error(error.message);
9795
- }
9796
- }
9797
- );
9798
- });
9799
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9800
- KeyboundForm,
9801
- {
9802
- className: "flex flex-1 flex-col overflow-hidden",
9803
- onSubmit,
9804
- children: [
9805
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
9806
- Form$2.Field,
9807
- {
9808
- control: form.control,
9809
- name: "email",
9810
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9811
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
9812
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9813
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9814
- ] })
9815
- }
9816
- ) }),
9817
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9818
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9819
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9820
- ] }) })
9821
- ]
9822
- }
9823
- ) });
9770
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9771
+ /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
9772
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9773
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9774
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
9775
+ ] }) })
9776
+ ] }) });
9824
9777
  };
9825
9778
  const schema$4 = objectType({
9826
9779
  email: stringType().email()
@@ -10799,6 +10752,74 @@ const customItemSchema = objectType({
10799
10752
  quantity: numberType(),
10800
10753
  unit_price: unionType([numberType(), stringType()])
10801
10754
  });
10755
+ const Email = () => {
10756
+ const { id } = useParams();
10757
+ const { order, isPending, isError, error } = useOrder(id, {
10758
+ fields: "+email"
10759
+ });
10760
+ if (isError) {
10761
+ throw error;
10762
+ }
10763
+ const isReady = !isPending && !!order;
10764
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
10765
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
10766
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
10767
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
10768
+ ] }),
10769
+ isReady && /* @__PURE__ */ jsx(EmailForm, { order })
10770
+ ] });
10771
+ };
10772
+ const EmailForm = ({ order }) => {
10773
+ const form = useForm({
10774
+ defaultValues: {
10775
+ email: order.email ?? ""
10776
+ },
10777
+ resolver: zodResolver(schema$3)
10778
+ });
10779
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10780
+ const { handleSuccess } = useRouteModal();
10781
+ const onSubmit = form.handleSubmit(async (data) => {
10782
+ await mutateAsync(
10783
+ { email: data.email },
10784
+ {
10785
+ onSuccess: () => {
10786
+ handleSuccess();
10787
+ },
10788
+ onError: (error) => {
10789
+ toast.error(error.message);
10790
+ }
10791
+ }
10792
+ );
10793
+ });
10794
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
10795
+ KeyboundForm,
10796
+ {
10797
+ className: "flex flex-1 flex-col overflow-hidden",
10798
+ onSubmit,
10799
+ children: [
10800
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
10801
+ Form$2.Field,
10802
+ {
10803
+ control: form.control,
10804
+ name: "email",
10805
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10806
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
10807
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10808
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10809
+ ] })
10810
+ }
10811
+ ) }),
10812
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
10813
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10814
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10815
+ ] }) })
10816
+ ]
10817
+ }
10818
+ ) });
10819
+ };
10820
+ const schema$3 = objectType({
10821
+ email: stringType().email()
10822
+ });
10802
10823
  const InlineTip = forwardRef(
10803
10824
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10804
10825
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -11454,7 +11475,7 @@ const SalesChannelForm = ({ order }) => {
11454
11475
  defaultValues: {
11455
11476
  sales_channel_id: order.sales_channel_id || ""
11456
11477
  },
11457
- resolver: zodResolver(schema$3)
11478
+ resolver: zodResolver(schema$2)
11458
11479
  });
11459
11480
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11460
11481
  const { handleSuccess } = useRouteModal();
@@ -11529,7 +11550,7 @@ const SalesChannelField = ({ control, order }) => {
11529
11550
  }
11530
11551
  );
11531
11552
  };
11532
- const schema$3 = objectType({
11553
+ const schema$2 = objectType({
11533
11554
  sales_channel_id: stringType().min(1)
11534
11555
  });
11535
11556
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
@@ -12371,7 +12392,7 @@ const ShippingAddressForm = ({ order }) => {
12371
12392
  postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12372
12393
  phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12373
12394
  },
12374
- resolver: zodResolver(schema$2)
12395
+ resolver: zodResolver(schema$1)
12375
12396
  });
12376
12397
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12377
12398
  const { handleSuccess } = useRouteModal();
@@ -12541,7 +12562,7 @@ const ShippingAddressForm = ({ order }) => {
12541
12562
  }
12542
12563
  ) });
12543
12564
  };
12544
- const schema$2 = addressSchema;
12565
+ const schema$1 = addressSchema;
12545
12566
  const TransferOwnership = () => {
12546
12567
  const { id } = useParams();
12547
12568
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12565,7 +12586,7 @@ const TransferOwnershipForm = ({ order }) => {
12565
12586
  defaultValues: {
12566
12587
  customer_id: order.customer_id || ""
12567
12588
  },
12568
- resolver: zodResolver(schema$1)
12589
+ resolver: zodResolver(schema)
12569
12590
  });
12570
12591
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12571
12592
  const { handleSuccess } = useRouteModal();
@@ -13015,29 +13036,8 @@ const Illustration = () => {
13015
13036
  }
13016
13037
  );
13017
13038
  };
13018
- const schema$1 = objectType({
13019
- customer_id: stringType().min(1)
13020
- });
13021
- const CustomItems = () => {
13022
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
13023
- /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
13024
- /* @__PURE__ */ jsx(CustomItemsForm, {})
13025
- ] });
13026
- };
13027
- const CustomItemsForm = () => {
13028
- const form = useForm({
13029
- resolver: zodResolver(schema)
13030
- });
13031
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
13032
- /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
13033
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
13034
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13035
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
13036
- ] }) })
13037
- ] }) });
13038
- };
13039
13039
  const schema = objectType({
13040
- email: stringType().email()
13040
+ customer_id: stringType().min(1)
13041
13041
  });
13042
13042
  const widgetModule = { widgets: [] };
13043
13043
  const routeModule = {
@@ -13064,13 +13064,17 @@ const routeModule = {
13064
13064
  path: "/draft-orders/:id/billing-address"
13065
13065
  },
13066
13066
  {
13067
- Component: Email,
13068
- path: "/draft-orders/:id/email"
13067
+ Component: CustomItems,
13068
+ path: "/draft-orders/:id/custom-items"
13069
13069
  },
13070
13070
  {
13071
13071
  Component: Items,
13072
13072
  path: "/draft-orders/:id/items"
13073
13073
  },
13074
+ {
13075
+ Component: Email,
13076
+ path: "/draft-orders/:id/email"
13077
+ },
13074
13078
  {
13075
13079
  Component: Metadata,
13076
13080
  path: "/draft-orders/:id/metadata"
@@ -13094,10 +13098,6 @@ const routeModule = {
13094
13098
  {
13095
13099
  Component: TransferOwnership,
13096
13100
  path: "/draft-orders/:id/transfer-ownership"
13097
- },
13098
- {
13099
- Component: CustomItems,
13100
- path: "/draft-orders/:id/custom-items"
13101
13101
  }
13102
13102
  ]
13103
13103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/draft-order",
3
- "version": "2.10.4-preview-20250921120201",
3
+ "version": "2.10.4-preview-20250921150154",
4
4
  "description": "A starter for Medusa plugins.",
5
5
  "author": "Medusa (https://medusajs.com)",
6
6
  "license": "MIT",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "@ariakit/react": "^0.4.15",
38
38
  "@hookform/resolvers": "3.4.2",
39
- "@medusajs/js-sdk": "2.10.4-preview-20250921120201",
39
+ "@medusajs/js-sdk": "2.10.4-preview-20250921150154",
40
40
  "@tanstack/react-query": "5.64.2",
41
41
  "@uiw/react-json-view": "^2.0.0-alpha.17",
42
42
  "date-fns": "^3.6.0",
@@ -45,14 +45,14 @@
45
45
  "react-hook-form": "7.49.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@medusajs/admin-sdk": "2.10.4-preview-20250921120201",
49
- "@medusajs/cli": "2.10.4-preview-20250921120201",
50
- "@medusajs/framework": "2.10.4-preview-20250921120201",
51
- "@medusajs/icons": "2.10.4-preview-20250921120201",
52
- "@medusajs/test-utils": "2.10.4-preview-20250921120201",
53
- "@medusajs/types": "2.10.4-preview-20250921120201",
54
- "@medusajs/ui": "4.0.24-preview-20250921120201",
55
- "@medusajs/ui-preset": "2.10.4-preview-20250921120201",
48
+ "@medusajs/admin-sdk": "2.10.4-preview-20250921150154",
49
+ "@medusajs/cli": "2.10.4-preview-20250921150154",
50
+ "@medusajs/framework": "2.10.4-preview-20250921150154",
51
+ "@medusajs/icons": "2.10.4-preview-20250921150154",
52
+ "@medusajs/test-utils": "2.10.4-preview-20250921150154",
53
+ "@medusajs/types": "2.10.4-preview-20250921150154",
54
+ "@medusajs/ui": "4.0.24-preview-20250921150154",
55
+ "@medusajs/ui-preset": "2.10.4-preview-20250921150154",
56
56
  "@mikro-orm/cli": "6.5.4",
57
57
  "@mikro-orm/core": "6.5.4",
58
58
  "@mikro-orm/knex": "6.5.4",
@@ -76,12 +76,12 @@
76
76
  "yalc": "^1.0.0-pre.53"
77
77
  },
78
78
  "peerDependencies": {
79
- "@medusajs/admin-sdk": "2.10.4-preview-20250921120201",
80
- "@medusajs/cli": "2.10.4-preview-20250921120201",
81
- "@medusajs/framework": "2.10.4-preview-20250921120201",
82
- "@medusajs/icons": "2.10.4-preview-20250921120201",
83
- "@medusajs/test-utils": "2.10.4-preview-20250921120201",
84
- "@medusajs/ui": "4.0.24-preview-20250921120201",
79
+ "@medusajs/admin-sdk": "2.10.4-preview-20250921150154",
80
+ "@medusajs/cli": "2.10.4-preview-20250921150154",
81
+ "@medusajs/framework": "2.10.4-preview-20250921150154",
82
+ "@medusajs/icons": "2.10.4-preview-20250921150154",
83
+ "@medusajs/test-utils": "2.10.4-preview-20250921150154",
84
+ "@medusajs/ui": "4.0.24-preview-20250921150154",
85
85
  "@mikro-orm/cli": "6.5.4",
86
86
  "@mikro-orm/core": "6.5.4",
87
87
  "@mikro-orm/knex": "6.5.4",