@medusajs/draft-order 2.10.3-preview-20250917150158 → 2.10.3-preview-20250917210146

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,74 +9763,6 @@ 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;
9775
- 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 })
9781
- ] });
9782
- };
9783
- const EmailForm = ({ order }) => {
9784
- const form = reactHookForm.useForm({
9785
- defaultValues: {
9786
- email: order.email ?? ""
9787
- },
9788
- resolver: zod.zodResolver(schema$4)
9789
- });
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
- ) });
9830
- };
9831
- const schema$4 = objectType({
9832
- email: stringType().email()
9833
- });
9834
9766
  const CustomItems = () => {
9835
9767
  return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9836
9768
  /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
@@ -9839,7 +9771,7 @@ const CustomItems = () => {
9839
9771
  };
9840
9772
  const CustomItemsForm = () => {
9841
9773
  const form = reactHookForm.useForm({
9842
- resolver: zod.zodResolver(schema$3)
9774
+ resolver: zod.zodResolver(schema$4)
9843
9775
  });
9844
9776
  return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9845
9777
  /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
@@ -9849,7 +9781,7 @@ const CustomItemsForm = () => {
9849
9781
  ] }) })
9850
9782
  ] }) });
9851
9783
  };
9852
- const schema$3 = objectType({
9784
+ const schema$4 = objectType({
9853
9785
  email: stringType().email()
9854
9786
  });
9855
9787
  const NumberInput = React.forwardRef(
@@ -10826,6 +10758,74 @@ const customItemSchema = objectType({
10826
10758
  quantity: numberType(),
10827
10759
  unit_price: unionType([numberType(), stringType()])
10828
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
+ });
10829
10829
  const InlineTip = React.forwardRef(
10830
10830
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10831
10831
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -13069,10 +13069,6 @@ const routeModule = {
13069
13069
  Component: BillingAddress,
13070
13070
  path: "/draft-orders/:id/billing-address"
13071
13071
  },
13072
- {
13073
- Component: Email,
13074
- path: "/draft-orders/:id/email"
13075
- },
13076
13072
  {
13077
13073
  Component: CustomItems,
13078
13074
  path: "/draft-orders/:id/custom-items"
@@ -13081,6 +13077,10 @@ const routeModule = {
13081
13077
  Component: Items,
13082
13078
  path: "/draft-orders/:id/items"
13083
13079
  },
13080
+ {
13081
+ Component: Email,
13082
+ path: "/draft-orders/:id/email"
13083
+ },
13084
13084
  {
13085
13085
  Component: Metadata,
13086
13086
  path: "/draft-orders/:id/metadata"
@@ -9757,74 +9757,6 @@ 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;
9769
- 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 })
9775
- ] });
9776
- };
9777
- const EmailForm = ({ order }) => {
9778
- const form = useForm({
9779
- defaultValues: {
9780
- email: order.email ?? ""
9781
- },
9782
- resolver: zodResolver(schema$4)
9783
- });
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
- ) });
9824
- };
9825
- const schema$4 = objectType({
9826
- email: stringType().email()
9827
- });
9828
9760
  const CustomItems = () => {
9829
9761
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9830
9762
  /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
@@ -9833,7 +9765,7 @@ const CustomItems = () => {
9833
9765
  };
9834
9766
  const CustomItemsForm = () => {
9835
9767
  const form = useForm({
9836
- resolver: zodResolver(schema$3)
9768
+ resolver: zodResolver(schema$4)
9837
9769
  });
9838
9770
  return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9839
9771
  /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
@@ -9843,7 +9775,7 @@ const CustomItemsForm = () => {
9843
9775
  ] }) })
9844
9776
  ] }) });
9845
9777
  };
9846
- const schema$3 = objectType({
9778
+ const schema$4 = objectType({
9847
9779
  email: stringType().email()
9848
9780
  });
9849
9781
  const NumberInput = forwardRef(
@@ -10820,6 +10752,74 @@ const customItemSchema = objectType({
10820
10752
  quantity: numberType(),
10821
10753
  unit_price: unionType([numberType(), stringType()])
10822
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
+ });
10823
10823
  const InlineTip = forwardRef(
10824
10824
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10825
10825
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -13063,10 +13063,6 @@ const routeModule = {
13063
13063
  Component: BillingAddress,
13064
13064
  path: "/draft-orders/:id/billing-address"
13065
13065
  },
13066
- {
13067
- Component: Email,
13068
- path: "/draft-orders/:id/email"
13069
- },
13070
13066
  {
13071
13067
  Component: CustomItems,
13072
13068
  path: "/draft-orders/:id/custom-items"
@@ -13075,6 +13071,10 @@ const routeModule = {
13075
13071
  Component: Items,
13076
13072
  path: "/draft-orders/:id/items"
13077
13073
  },
13074
+ {
13075
+ Component: Email,
13076
+ path: "/draft-orders/:id/email"
13077
+ },
13078
13078
  {
13079
13079
  Component: Metadata,
13080
13080
  path: "/draft-orders/:id/metadata"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/draft-order",
3
- "version": "2.10.3-preview-20250917150158",
3
+ "version": "2.10.3-preview-20250917210146",
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.3-preview-20250917150158",
39
+ "@medusajs/js-sdk": "2.10.3-preview-20250917210146",
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.3-preview-20250917150158",
49
- "@medusajs/cli": "2.10.3-preview-20250917150158",
50
- "@medusajs/framework": "2.10.3-preview-20250917150158",
51
- "@medusajs/icons": "2.10.3-preview-20250917150158",
52
- "@medusajs/test-utils": "2.10.3-preview-20250917150158",
53
- "@medusajs/types": "2.10.3-preview-20250917150158",
54
- "@medusajs/ui": "4.0.23-preview-20250917150158",
55
- "@medusajs/ui-preset": "2.10.3-preview-20250917150158",
48
+ "@medusajs/admin-sdk": "2.10.3-preview-20250917210146",
49
+ "@medusajs/cli": "2.10.3-preview-20250917210146",
50
+ "@medusajs/framework": "2.10.3-preview-20250917210146",
51
+ "@medusajs/icons": "2.10.3-preview-20250917210146",
52
+ "@medusajs/test-utils": "2.10.3-preview-20250917210146",
53
+ "@medusajs/types": "2.10.3-preview-20250917210146",
54
+ "@medusajs/ui": "4.0.23-preview-20250917210146",
55
+ "@medusajs/ui-preset": "2.10.3-preview-20250917210146",
56
56
  "@mikro-orm/cli": "6.4.3",
57
57
  "@mikro-orm/core": "6.4.3",
58
58
  "@mikro-orm/knex": "6.4.3",
@@ -76,12 +76,12 @@
76
76
  "yalc": "^1.0.0-pre.53"
77
77
  },
78
78
  "peerDependencies": {
79
- "@medusajs/admin-sdk": "2.10.3-preview-20250917150158",
80
- "@medusajs/cli": "2.10.3-preview-20250917150158",
81
- "@medusajs/framework": "2.10.3-preview-20250917150158",
82
- "@medusajs/icons": "2.10.3-preview-20250917150158",
83
- "@medusajs/test-utils": "2.10.3-preview-20250917150158",
84
- "@medusajs/ui": "4.0.23-preview-20250917150158",
79
+ "@medusajs/admin-sdk": "2.10.3-preview-20250917210146",
80
+ "@medusajs/cli": "2.10.3-preview-20250917210146",
81
+ "@medusajs/framework": "2.10.3-preview-20250917210146",
82
+ "@medusajs/icons": "2.10.3-preview-20250917210146",
83
+ "@medusajs/test-utils": "2.10.3-preview-20250917210146",
84
+ "@medusajs/ui": "4.0.23-preview-20250917210146",
85
85
  "@mikro-orm/cli": "6.4.3",
86
86
  "@mikro-orm/core": "6.4.3",
87
87
  "@mikro-orm/knex": "6.4.3",