@medusajs/draft-order 2.10.0-preview-20250828090201 → 2.10.0-preview-20250828135607

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.
@@ -9771,6 +9771,74 @@ const CustomItemsForm = () => {
9771
9771
  const schema$4 = objectType({
9772
9772
  email: stringType().email()
9773
9773
  });
9774
+ const Email = () => {
9775
+ const { id } = reactRouterDom.useParams();
9776
+ const { order, isPending, isError, error } = useOrder(id, {
9777
+ fields: "+email"
9778
+ });
9779
+ if (isError) {
9780
+ throw error;
9781
+ }
9782
+ const isReady = !isPending && !!order;
9783
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9784
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9785
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
9786
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
9787
+ ] }),
9788
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
9789
+ ] });
9790
+ };
9791
+ const EmailForm = ({ order }) => {
9792
+ const form = reactHookForm.useForm({
9793
+ defaultValues: {
9794
+ email: order.email ?? ""
9795
+ },
9796
+ resolver: zod.zodResolver(schema$3)
9797
+ });
9798
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9799
+ const { handleSuccess } = useRouteModal();
9800
+ const onSubmit = form.handleSubmit(async (data) => {
9801
+ await mutateAsync(
9802
+ { email: data.email },
9803
+ {
9804
+ onSuccess: () => {
9805
+ handleSuccess();
9806
+ },
9807
+ onError: (error) => {
9808
+ ui.toast.error(error.message);
9809
+ }
9810
+ }
9811
+ );
9812
+ });
9813
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9814
+ KeyboundForm,
9815
+ {
9816
+ className: "flex flex-1 flex-col overflow-hidden",
9817
+ onSubmit,
9818
+ children: [
9819
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
9820
+ Form$2.Field,
9821
+ {
9822
+ control: form.control,
9823
+ name: "email",
9824
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9825
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
9826
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9827
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9828
+ ] })
9829
+ }
9830
+ ) }),
9831
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9832
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9833
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9834
+ ] }) })
9835
+ ]
9836
+ }
9837
+ ) });
9838
+ };
9839
+ const schema$3 = objectType({
9840
+ email: stringType().email()
9841
+ });
9774
9842
  const NumberInput = React.forwardRef(
9775
9843
  ({
9776
9844
  value,
@@ -10745,74 +10813,6 @@ const customItemSchema = objectType({
10745
10813
  quantity: numberType(),
10746
10814
  unit_price: unionType([numberType(), stringType()])
10747
10815
  });
10748
- const Email = () => {
10749
- const { id } = reactRouterDom.useParams();
10750
- const { order, isPending, isError, error } = useOrder(id, {
10751
- fields: "+email"
10752
- });
10753
- if (isError) {
10754
- throw error;
10755
- }
10756
- const isReady = !isPending && !!order;
10757
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
10758
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
10759
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
10760
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
10761
- ] }),
10762
- isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
10763
- ] });
10764
- };
10765
- const EmailForm = ({ order }) => {
10766
- const form = reactHookForm.useForm({
10767
- defaultValues: {
10768
- email: order.email ?? ""
10769
- },
10770
- resolver: zod.zodResolver(schema$3)
10771
- });
10772
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10773
- const { handleSuccess } = useRouteModal();
10774
- const onSubmit = form.handleSubmit(async (data) => {
10775
- await mutateAsync(
10776
- { email: data.email },
10777
- {
10778
- onSuccess: () => {
10779
- handleSuccess();
10780
- },
10781
- onError: (error) => {
10782
- ui.toast.error(error.message);
10783
- }
10784
- }
10785
- );
10786
- });
10787
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
10788
- KeyboundForm,
10789
- {
10790
- className: "flex flex-1 flex-col overflow-hidden",
10791
- onSubmit,
10792
- children: [
10793
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
10794
- Form$2.Field,
10795
- {
10796
- control: form.control,
10797
- name: "email",
10798
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
10799
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
10800
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
10801
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
10802
- ] })
10803
- }
10804
- ) }),
10805
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
10806
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10807
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10808
- ] }) })
10809
- ]
10810
- }
10811
- ) });
10812
- };
10813
- const schema$3 = objectType({
10814
- email: stringType().email()
10815
- });
10816
10816
  const InlineTip = React.forwardRef(
10817
10817
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10818
10818
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -13060,14 +13060,14 @@ const routeModule = {
13060
13060
  Component: CustomItems,
13061
13061
  path: "/draft-orders/:id/custom-items"
13062
13062
  },
13063
- {
13064
- Component: Items,
13065
- path: "/draft-orders/:id/items"
13066
- },
13067
13063
  {
13068
13064
  Component: Email,
13069
13065
  path: "/draft-orders/:id/email"
13070
13066
  },
13067
+ {
13068
+ Component: Items,
13069
+ path: "/draft-orders/:id/items"
13070
+ },
13071
13071
  {
13072
13072
  Component: Metadata,
13073
13073
  path: "/draft-orders/:id/metadata"
@@ -9765,6 +9765,74 @@ const CustomItemsForm = () => {
9765
9765
  const schema$4 = objectType({
9766
9766
  email: stringType().email()
9767
9767
  });
9768
+ const Email = () => {
9769
+ const { id } = useParams();
9770
+ const { order, isPending, isError, error } = useOrder(id, {
9771
+ fields: "+email"
9772
+ });
9773
+ if (isError) {
9774
+ throw error;
9775
+ }
9776
+ const isReady = !isPending && !!order;
9777
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9778
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9779
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
9780
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
9781
+ ] }),
9782
+ isReady && /* @__PURE__ */ jsx(EmailForm, { order })
9783
+ ] });
9784
+ };
9785
+ const EmailForm = ({ order }) => {
9786
+ const form = useForm({
9787
+ defaultValues: {
9788
+ email: order.email ?? ""
9789
+ },
9790
+ resolver: zodResolver(schema$3)
9791
+ });
9792
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9793
+ const { handleSuccess } = useRouteModal();
9794
+ const onSubmit = form.handleSubmit(async (data) => {
9795
+ await mutateAsync(
9796
+ { email: data.email },
9797
+ {
9798
+ onSuccess: () => {
9799
+ handleSuccess();
9800
+ },
9801
+ onError: (error) => {
9802
+ toast.error(error.message);
9803
+ }
9804
+ }
9805
+ );
9806
+ });
9807
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9808
+ KeyboundForm,
9809
+ {
9810
+ className: "flex flex-1 flex-col overflow-hidden",
9811
+ onSubmit,
9812
+ children: [
9813
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
9814
+ Form$2.Field,
9815
+ {
9816
+ control: form.control,
9817
+ name: "email",
9818
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9819
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
9820
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9821
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9822
+ ] })
9823
+ }
9824
+ ) }),
9825
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9826
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9827
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9828
+ ] }) })
9829
+ ]
9830
+ }
9831
+ ) });
9832
+ };
9833
+ const schema$3 = objectType({
9834
+ email: stringType().email()
9835
+ });
9768
9836
  const NumberInput = forwardRef(
9769
9837
  ({
9770
9838
  value,
@@ -10739,74 +10807,6 @@ const customItemSchema = objectType({
10739
10807
  quantity: numberType(),
10740
10808
  unit_price: unionType([numberType(), stringType()])
10741
10809
  });
10742
- const Email = () => {
10743
- const { id } = useParams();
10744
- const { order, isPending, isError, error } = useOrder(id, {
10745
- fields: "+email"
10746
- });
10747
- if (isError) {
10748
- throw error;
10749
- }
10750
- const isReady = !isPending && !!order;
10751
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
10752
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
10753
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
10754
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
10755
- ] }),
10756
- isReady && /* @__PURE__ */ jsx(EmailForm, { order })
10757
- ] });
10758
- };
10759
- const EmailForm = ({ order }) => {
10760
- const form = useForm({
10761
- defaultValues: {
10762
- email: order.email ?? ""
10763
- },
10764
- resolver: zodResolver(schema$3)
10765
- });
10766
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
10767
- const { handleSuccess } = useRouteModal();
10768
- const onSubmit = form.handleSubmit(async (data) => {
10769
- await mutateAsync(
10770
- { email: data.email },
10771
- {
10772
- onSuccess: () => {
10773
- handleSuccess();
10774
- },
10775
- onError: (error) => {
10776
- toast.error(error.message);
10777
- }
10778
- }
10779
- );
10780
- });
10781
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
10782
- KeyboundForm,
10783
- {
10784
- className: "flex flex-1 flex-col overflow-hidden",
10785
- onSubmit,
10786
- children: [
10787
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
10788
- Form$2.Field,
10789
- {
10790
- control: form.control,
10791
- name: "email",
10792
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
10793
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
10794
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
10795
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
10796
- ] })
10797
- }
10798
- ) }),
10799
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
10800
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10801
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
10802
- ] }) })
10803
- ]
10804
- }
10805
- ) });
10806
- };
10807
- const schema$3 = objectType({
10808
- email: stringType().email()
10809
- });
10810
10810
  const InlineTip = forwardRef(
10811
10811
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10812
10812
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -13054,14 +13054,14 @@ const routeModule = {
13054
13054
  Component: CustomItems,
13055
13055
  path: "/draft-orders/:id/custom-items"
13056
13056
  },
13057
- {
13058
- Component: Items,
13059
- path: "/draft-orders/:id/items"
13060
- },
13061
13057
  {
13062
13058
  Component: Email,
13063
13059
  path: "/draft-orders/:id/email"
13064
13060
  },
13061
+ {
13062
+ Component: Items,
13063
+ path: "/draft-orders/:id/items"
13064
+ },
13065
13065
  {
13066
13066
  Component: Metadata,
13067
13067
  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.0-preview-20250828090201",
3
+ "version": "2.10.0-preview-20250828135607",
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.0-preview-20250828090201",
39
+ "@medusajs/js-sdk": "2.10.0-preview-20250828135607",
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,15 +45,14 @@
45
45
  "react-hook-form": "7.49.1"
46
46
  },
47
47
  "devDependencies": {
48
- "@medusajs/admin-sdk": "2.10.0-preview-20250828090201",
49
- "@medusajs/cli": "2.10.0-preview-20250828090201",
50
- "@medusajs/framework": "2.10.0-preview-20250828090201",
51
- "@medusajs/icons": "2.10.0-preview-20250828090201",
52
- "@medusajs/medusa": "2.10.0-preview-20250828090201",
53
- "@medusajs/test-utils": "2.10.0-preview-20250828090201",
54
- "@medusajs/types": "2.10.0-preview-20250828090201",
55
- "@medusajs/ui": "4.0.20-preview-20250828090201",
56
- "@medusajs/ui-preset": "2.10.0-preview-20250828090201",
48
+ "@medusajs/admin-sdk": "2.10.0-preview-20250828135607",
49
+ "@medusajs/cli": "2.10.0-preview-20250828135607",
50
+ "@medusajs/framework": "2.10.0-preview-20250828135607",
51
+ "@medusajs/icons": "2.10.0-preview-20250828135607",
52
+ "@medusajs/test-utils": "2.10.0-preview-20250828135607",
53
+ "@medusajs/types": "2.10.0-preview-20250828135607",
54
+ "@medusajs/ui": "4.0.20-preview-20250828135607",
55
+ "@medusajs/ui-preset": "2.10.0-preview-20250828135607",
57
56
  "@mikro-orm/cli": "6.4.3",
58
57
  "@mikro-orm/core": "6.4.3",
59
58
  "@mikro-orm/knex": "6.4.3",
@@ -77,13 +76,12 @@
77
76
  "yalc": "^1.0.0-pre.53"
78
77
  },
79
78
  "peerDependencies": {
80
- "@medusajs/admin-sdk": "2.10.0-preview-20250828090201",
81
- "@medusajs/cli": "2.10.0-preview-20250828090201",
82
- "@medusajs/framework": "2.10.0-preview-20250828090201",
83
- "@medusajs/icons": "2.10.0-preview-20250828090201",
84
- "@medusajs/medusa": "2.10.0-preview-20250828090201",
85
- "@medusajs/test-utils": "2.10.0-preview-20250828090201",
86
- "@medusajs/ui": "4.0.20-preview-20250828090201",
79
+ "@medusajs/admin-sdk": "2.10.0-preview-20250828135607",
80
+ "@medusajs/cli": "2.10.0-preview-20250828135607",
81
+ "@medusajs/framework": "2.10.0-preview-20250828135607",
82
+ "@medusajs/icons": "2.10.0-preview-20250828135607",
83
+ "@medusajs/test-utils": "2.10.0-preview-20250828135607",
84
+ "@medusajs/ui": "4.0.20-preview-20250828135607",
87
85
  "@mikro-orm/cli": "6.4.3",
88
86
  "@mikro-orm/core": "6.4.3",
89
87
  "@mikro-orm/knex": "6.4.3",