@medusajs/draft-order 2.10.0-snapshot-20250828112236 → 2.10.0-snapshot-20250828113245
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/.medusa/server/src/admin/index.js +91 -91
- package/.medusa/server/src/admin/index.mjs +91 -91
- package/package.json +18 -18
|
@@ -9750,23 +9750,70 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9750
9750
|
) });
|
|
9751
9751
|
};
|
|
9752
9752
|
const schema$5 = addressSchema;
|
|
9753
|
-
const
|
|
9753
|
+
const Email = () => {
|
|
9754
|
+
const { id } = reactRouterDom.useParams();
|
|
9755
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
9756
|
+
fields: "+email"
|
|
9757
|
+
});
|
|
9758
|
+
if (isError) {
|
|
9759
|
+
throw error;
|
|
9760
|
+
}
|
|
9761
|
+
const isReady = !isPending && !!order;
|
|
9754
9762
|
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9755
|
-
/* @__PURE__ */ jsxRuntime.
|
|
9756
|
-
|
|
9763
|
+
/* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
|
|
9764
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Email" }) }),
|
|
9765
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
|
|
9766
|
+
] }),
|
|
9767
|
+
isReady && /* @__PURE__ */ jsxRuntime.jsx(EmailForm, { order })
|
|
9757
9768
|
] });
|
|
9758
9769
|
};
|
|
9759
|
-
const
|
|
9770
|
+
const EmailForm = ({ order }) => {
|
|
9760
9771
|
const form = reactHookForm.useForm({
|
|
9772
|
+
defaultValues: {
|
|
9773
|
+
email: order.email ?? ""
|
|
9774
|
+
},
|
|
9761
9775
|
resolver: zod.zodResolver(schema$4)
|
|
9762
9776
|
});
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9777
|
+
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9778
|
+
const { handleSuccess } = useRouteModal();
|
|
9779
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
9780
|
+
await mutateAsync(
|
|
9781
|
+
{ email: data.email },
|
|
9782
|
+
{
|
|
9783
|
+
onSuccess: () => {
|
|
9784
|
+
handleSuccess();
|
|
9785
|
+
},
|
|
9786
|
+
onError: (error) => {
|
|
9787
|
+
ui.toast.error(error.message);
|
|
9788
|
+
}
|
|
9789
|
+
}
|
|
9790
|
+
);
|
|
9791
|
+
});
|
|
9792
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9793
|
+
KeyboundForm,
|
|
9794
|
+
{
|
|
9795
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
9796
|
+
onSubmit,
|
|
9797
|
+
children: [
|
|
9798
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9799
|
+
Form$2.Field,
|
|
9800
|
+
{
|
|
9801
|
+
control: form.control,
|
|
9802
|
+
name: "email",
|
|
9803
|
+
render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
|
|
9804
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Email" }),
|
|
9805
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
|
|
9806
|
+
/* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
|
|
9807
|
+
] })
|
|
9808
|
+
}
|
|
9809
|
+
) }),
|
|
9810
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9811
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9812
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
9813
|
+
] }) })
|
|
9814
|
+
]
|
|
9815
|
+
}
|
|
9816
|
+
) });
|
|
9770
9817
|
};
|
|
9771
9818
|
const schema$4 = objectType({
|
|
9772
9819
|
email: stringType().email()
|
|
@@ -10745,74 +10792,6 @@ const customItemSchema = objectType({
|
|
|
10745
10792
|
quantity: numberType(),
|
|
10746
10793
|
unit_price: unionType([numberType(), stringType()])
|
|
10747
10794
|
});
|
|
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
10795
|
const InlineTip = React.forwardRef(
|
|
10817
10796
|
({ variant = "tip", label, className, children, ...props }, ref) => {
|
|
10818
10797
|
const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
|
|
@@ -11468,7 +11447,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11468
11447
|
defaultValues: {
|
|
11469
11448
|
sales_channel_id: order.sales_channel_id || ""
|
|
11470
11449
|
},
|
|
11471
|
-
resolver: zod.zodResolver(schema$
|
|
11450
|
+
resolver: zod.zodResolver(schema$3)
|
|
11472
11451
|
});
|
|
11473
11452
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11474
11453
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11543,7 +11522,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11543
11522
|
}
|
|
11544
11523
|
);
|
|
11545
11524
|
};
|
|
11546
|
-
const schema$
|
|
11525
|
+
const schema$3 = objectType({
|
|
11547
11526
|
sales_channel_id: stringType().min(1)
|
|
11548
11527
|
});
|
|
11549
11528
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -12385,7 +12364,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12385
12364
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12386
12365
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12387
12366
|
},
|
|
12388
|
-
resolver: zod.zodResolver(schema$
|
|
12367
|
+
resolver: zod.zodResolver(schema$2)
|
|
12389
12368
|
});
|
|
12390
12369
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12391
12370
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12555,7 +12534,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12555
12534
|
}
|
|
12556
12535
|
) });
|
|
12557
12536
|
};
|
|
12558
|
-
const schema$
|
|
12537
|
+
const schema$2 = addressSchema;
|
|
12559
12538
|
const TransferOwnership = () => {
|
|
12560
12539
|
const { id } = reactRouterDom.useParams();
|
|
12561
12540
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12579,7 +12558,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12579
12558
|
defaultValues: {
|
|
12580
12559
|
customer_id: order.customer_id || ""
|
|
12581
12560
|
},
|
|
12582
|
-
resolver: zod.zodResolver(schema)
|
|
12561
|
+
resolver: zod.zodResolver(schema$1)
|
|
12583
12562
|
});
|
|
12584
12563
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12585
12564
|
const { handleSuccess } = useRouteModal();
|
|
@@ -13029,9 +13008,30 @@ const Illustration = () => {
|
|
|
13029
13008
|
}
|
|
13030
13009
|
);
|
|
13031
13010
|
};
|
|
13032
|
-
const schema = objectType({
|
|
13011
|
+
const schema$1 = objectType({
|
|
13033
13012
|
customer_id: stringType().min(1)
|
|
13034
13013
|
});
|
|
13014
|
+
const CustomItems = () => {
|
|
13015
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
13016
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
13017
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
13018
|
+
] });
|
|
13019
|
+
};
|
|
13020
|
+
const CustomItemsForm = () => {
|
|
13021
|
+
const form = reactHookForm.useForm({
|
|
13022
|
+
resolver: zod.zodResolver(schema)
|
|
13023
|
+
});
|
|
13024
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
13025
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
13026
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
13027
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
13028
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
13029
|
+
] }) })
|
|
13030
|
+
] }) });
|
|
13031
|
+
};
|
|
13032
|
+
const schema = objectType({
|
|
13033
|
+
email: stringType().email()
|
|
13034
|
+
});
|
|
13035
13035
|
const widgetModule = { widgets: [] };
|
|
13036
13036
|
const routeModule = {
|
|
13037
13037
|
routes: [
|
|
@@ -13057,17 +13057,13 @@ const routeModule = {
|
|
|
13057
13057
|
path: "/draft-orders/:id/billing-address"
|
|
13058
13058
|
},
|
|
13059
13059
|
{
|
|
13060
|
-
Component:
|
|
13061
|
-
path: "/draft-orders/:id/
|
|
13060
|
+
Component: Email,
|
|
13061
|
+
path: "/draft-orders/:id/email"
|
|
13062
13062
|
},
|
|
13063
13063
|
{
|
|
13064
13064
|
Component: Items,
|
|
13065
13065
|
path: "/draft-orders/:id/items"
|
|
13066
13066
|
},
|
|
13067
|
-
{
|
|
13068
|
-
Component: Email,
|
|
13069
|
-
path: "/draft-orders/:id/email"
|
|
13070
|
-
},
|
|
13071
13067
|
{
|
|
13072
13068
|
Component: Metadata,
|
|
13073
13069
|
path: "/draft-orders/:id/metadata"
|
|
@@ -13091,6 +13087,10 @@ const routeModule = {
|
|
|
13091
13087
|
{
|
|
13092
13088
|
Component: TransferOwnership,
|
|
13093
13089
|
path: "/draft-orders/:id/transfer-ownership"
|
|
13090
|
+
},
|
|
13091
|
+
{
|
|
13092
|
+
Component: CustomItems,
|
|
13093
|
+
path: "/draft-orders/:id/custom-items"
|
|
13094
13094
|
}
|
|
13095
13095
|
]
|
|
13096
13096
|
}
|
|
@@ -9744,23 +9744,70 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9744
9744
|
) });
|
|
9745
9745
|
};
|
|
9746
9746
|
const schema$5 = addressSchema;
|
|
9747
|
-
const
|
|
9747
|
+
const Email = () => {
|
|
9748
|
+
const { id } = useParams();
|
|
9749
|
+
const { order, isPending, isError, error } = useOrder(id, {
|
|
9750
|
+
fields: "+email"
|
|
9751
|
+
});
|
|
9752
|
+
if (isError) {
|
|
9753
|
+
throw error;
|
|
9754
|
+
}
|
|
9755
|
+
const isReady = !isPending && !!order;
|
|
9748
9756
|
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
9749
|
-
/* @__PURE__ */
|
|
9750
|
-
|
|
9757
|
+
/* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
|
|
9758
|
+
/* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
|
|
9759
|
+
/* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
|
|
9760
|
+
] }),
|
|
9761
|
+
isReady && /* @__PURE__ */ jsx(EmailForm, { order })
|
|
9751
9762
|
] });
|
|
9752
9763
|
};
|
|
9753
|
-
const
|
|
9764
|
+
const EmailForm = ({ order }) => {
|
|
9754
9765
|
const form = useForm({
|
|
9766
|
+
defaultValues: {
|
|
9767
|
+
email: order.email ?? ""
|
|
9768
|
+
},
|
|
9755
9769
|
resolver: zodResolver(schema$4)
|
|
9756
9770
|
});
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9771
|
+
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9772
|
+
const { handleSuccess } = useRouteModal();
|
|
9773
|
+
const onSubmit = form.handleSubmit(async (data) => {
|
|
9774
|
+
await mutateAsync(
|
|
9775
|
+
{ email: data.email },
|
|
9776
|
+
{
|
|
9777
|
+
onSuccess: () => {
|
|
9778
|
+
handleSuccess();
|
|
9779
|
+
},
|
|
9780
|
+
onError: (error) => {
|
|
9781
|
+
toast.error(error.message);
|
|
9782
|
+
}
|
|
9783
|
+
}
|
|
9784
|
+
);
|
|
9785
|
+
});
|
|
9786
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
|
|
9787
|
+
KeyboundForm,
|
|
9788
|
+
{
|
|
9789
|
+
className: "flex flex-1 flex-col overflow-hidden",
|
|
9790
|
+
onSubmit,
|
|
9791
|
+
children: [
|
|
9792
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
|
|
9793
|
+
Form$2.Field,
|
|
9794
|
+
{
|
|
9795
|
+
control: form.control,
|
|
9796
|
+
name: "email",
|
|
9797
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
|
|
9798
|
+
/* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
|
|
9799
|
+
/* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
|
|
9800
|
+
/* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
|
|
9801
|
+
] })
|
|
9802
|
+
}
|
|
9803
|
+
) }),
|
|
9804
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9805
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9806
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
|
|
9807
|
+
] }) })
|
|
9808
|
+
]
|
|
9809
|
+
}
|
|
9810
|
+
) });
|
|
9764
9811
|
};
|
|
9765
9812
|
const schema$4 = objectType({
|
|
9766
9813
|
email: stringType().email()
|
|
@@ -10739,74 +10786,6 @@ const customItemSchema = objectType({
|
|
|
10739
10786
|
quantity: numberType(),
|
|
10740
10787
|
unit_price: unionType([numberType(), stringType()])
|
|
10741
10788
|
});
|
|
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
10789
|
const InlineTip = forwardRef(
|
|
10811
10790
|
({ variant = "tip", label, className, children, ...props }, ref) => {
|
|
10812
10791
|
const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
|
|
@@ -11462,7 +11441,7 @@ const SalesChannelForm = ({ order }) => {
|
|
|
11462
11441
|
defaultValues: {
|
|
11463
11442
|
sales_channel_id: order.sales_channel_id || ""
|
|
11464
11443
|
},
|
|
11465
|
-
resolver: zodResolver(schema$
|
|
11444
|
+
resolver: zodResolver(schema$3)
|
|
11466
11445
|
});
|
|
11467
11446
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
11468
11447
|
const { handleSuccess } = useRouteModal();
|
|
@@ -11537,7 +11516,7 @@ const SalesChannelField = ({ control, order }) => {
|
|
|
11537
11516
|
}
|
|
11538
11517
|
);
|
|
11539
11518
|
};
|
|
11540
|
-
const schema$
|
|
11519
|
+
const schema$3 = objectType({
|
|
11541
11520
|
sales_channel_id: stringType().min(1)
|
|
11542
11521
|
});
|
|
11543
11522
|
const STACKED_FOCUS_MODAL_ID = "shipping-form";
|
|
@@ -12379,7 +12358,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12379
12358
|
postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
|
|
12380
12359
|
phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
|
|
12381
12360
|
},
|
|
12382
|
-
resolver: zodResolver(schema$
|
|
12361
|
+
resolver: zodResolver(schema$2)
|
|
12383
12362
|
});
|
|
12384
12363
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12385
12364
|
const { handleSuccess } = useRouteModal();
|
|
@@ -12549,7 +12528,7 @@ const ShippingAddressForm = ({ order }) => {
|
|
|
12549
12528
|
}
|
|
12550
12529
|
) });
|
|
12551
12530
|
};
|
|
12552
|
-
const schema$
|
|
12531
|
+
const schema$2 = addressSchema;
|
|
12553
12532
|
const TransferOwnership = () => {
|
|
12554
12533
|
const { id } = useParams();
|
|
12555
12534
|
const { draft_order, isPending, isError, error } = useDraftOrder(id, {
|
|
@@ -12573,7 +12552,7 @@ const TransferOwnershipForm = ({ order }) => {
|
|
|
12573
12552
|
defaultValues: {
|
|
12574
12553
|
customer_id: order.customer_id || ""
|
|
12575
12554
|
},
|
|
12576
|
-
resolver: zodResolver(schema)
|
|
12555
|
+
resolver: zodResolver(schema$1)
|
|
12577
12556
|
});
|
|
12578
12557
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
12579
12558
|
const { handleSuccess } = useRouteModal();
|
|
@@ -13023,9 +13002,30 @@ const Illustration = () => {
|
|
|
13023
13002
|
}
|
|
13024
13003
|
);
|
|
13025
13004
|
};
|
|
13026
|
-
const schema = objectType({
|
|
13005
|
+
const schema$1 = objectType({
|
|
13027
13006
|
customer_id: stringType().min(1)
|
|
13028
13007
|
});
|
|
13008
|
+
const CustomItems = () => {
|
|
13009
|
+
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
13010
|
+
/* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
|
|
13011
|
+
/* @__PURE__ */ jsx(CustomItemsForm, {})
|
|
13012
|
+
] });
|
|
13013
|
+
};
|
|
13014
|
+
const CustomItemsForm = () => {
|
|
13015
|
+
const form = useForm({
|
|
13016
|
+
resolver: zodResolver(schema)
|
|
13017
|
+
});
|
|
13018
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
13019
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, {}),
|
|
13020
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
13021
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
13022
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
|
|
13023
|
+
] }) })
|
|
13024
|
+
] }) });
|
|
13025
|
+
};
|
|
13026
|
+
const schema = objectType({
|
|
13027
|
+
email: stringType().email()
|
|
13028
|
+
});
|
|
13029
13029
|
const widgetModule = { widgets: [] };
|
|
13030
13030
|
const routeModule = {
|
|
13031
13031
|
routes: [
|
|
@@ -13051,17 +13051,13 @@ const routeModule = {
|
|
|
13051
13051
|
path: "/draft-orders/:id/billing-address"
|
|
13052
13052
|
},
|
|
13053
13053
|
{
|
|
13054
|
-
Component:
|
|
13055
|
-
path: "/draft-orders/:id/
|
|
13054
|
+
Component: Email,
|
|
13055
|
+
path: "/draft-orders/:id/email"
|
|
13056
13056
|
},
|
|
13057
13057
|
{
|
|
13058
13058
|
Component: Items,
|
|
13059
13059
|
path: "/draft-orders/:id/items"
|
|
13060
13060
|
},
|
|
13061
|
-
{
|
|
13062
|
-
Component: Email,
|
|
13063
|
-
path: "/draft-orders/:id/email"
|
|
13064
|
-
},
|
|
13065
13061
|
{
|
|
13066
13062
|
Component: Metadata,
|
|
13067
13063
|
path: "/draft-orders/:id/metadata"
|
|
@@ -13085,6 +13081,10 @@ const routeModule = {
|
|
|
13085
13081
|
{
|
|
13086
13082
|
Component: TransferOwnership,
|
|
13087
13083
|
path: "/draft-orders/:id/transfer-ownership"
|
|
13084
|
+
},
|
|
13085
|
+
{
|
|
13086
|
+
Component: CustomItems,
|
|
13087
|
+
path: "/draft-orders/:id/custom-items"
|
|
13088
13088
|
}
|
|
13089
13089
|
]
|
|
13090
13090
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/draft-order",
|
|
3
|
-
"version": "2.10.0-snapshot-
|
|
3
|
+
"version": "2.10.0-snapshot-20250828113245",
|
|
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-snapshot-
|
|
39
|
+
"@medusajs/js-sdk": "2.10.0-snapshot-20250828113245",
|
|
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,15 @@
|
|
|
45
45
|
"react-hook-form": "7.49.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@medusajs/admin-sdk": "2.10.0-snapshot-
|
|
49
|
-
"@medusajs/cli": "2.10.0-snapshot-
|
|
50
|
-
"@medusajs/framework": "2.10.0-snapshot-
|
|
51
|
-
"@medusajs/icons": "2.10.0-snapshot-
|
|
52
|
-
"@medusajs/medusa": "2.10.0-snapshot-
|
|
53
|
-
"@medusajs/test-utils": "2.10.0-snapshot-
|
|
54
|
-
"@medusajs/types": "2.10.0-snapshot-
|
|
55
|
-
"@medusajs/ui": "4.0.20-snapshot-
|
|
56
|
-
"@medusajs/ui-preset": "2.10.0-snapshot-
|
|
48
|
+
"@medusajs/admin-sdk": "2.10.0-snapshot-20250828113245",
|
|
49
|
+
"@medusajs/cli": "2.10.0-snapshot-20250828113245",
|
|
50
|
+
"@medusajs/framework": "2.10.0-snapshot-20250828113245",
|
|
51
|
+
"@medusajs/icons": "2.10.0-snapshot-20250828113245",
|
|
52
|
+
"@medusajs/medusa": "2.10.0-snapshot-20250828113245",
|
|
53
|
+
"@medusajs/test-utils": "2.10.0-snapshot-20250828113245",
|
|
54
|
+
"@medusajs/types": "2.10.0-snapshot-20250828113245",
|
|
55
|
+
"@medusajs/ui": "4.0.20-snapshot-20250828113245",
|
|
56
|
+
"@medusajs/ui-preset": "2.10.0-snapshot-20250828113245",
|
|
57
57
|
"@mikro-orm/cli": "6.4.3",
|
|
58
58
|
"@mikro-orm/core": "6.4.3",
|
|
59
59
|
"@mikro-orm/knex": "6.4.3",
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
"yalc": "^1.0.0-pre.53"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"@medusajs/admin-sdk": "2.10.0-snapshot-
|
|
81
|
-
"@medusajs/cli": "2.10.0-snapshot-
|
|
82
|
-
"@medusajs/framework": "2.10.0-snapshot-
|
|
83
|
-
"@medusajs/icons": "2.10.0-snapshot-
|
|
84
|
-
"@medusajs/medusa": "2.10.0-snapshot-
|
|
85
|
-
"@medusajs/test-utils": "2.10.0-snapshot-
|
|
86
|
-
"@medusajs/ui": "4.0.20-snapshot-
|
|
80
|
+
"@medusajs/admin-sdk": "2.10.0-snapshot-20250828113245",
|
|
81
|
+
"@medusajs/cli": "2.10.0-snapshot-20250828113245",
|
|
82
|
+
"@medusajs/framework": "2.10.0-snapshot-20250828113245",
|
|
83
|
+
"@medusajs/icons": "2.10.0-snapshot-20250828113245",
|
|
84
|
+
"@medusajs/medusa": "2.10.0-snapshot-20250828113245",
|
|
85
|
+
"@medusajs/test-utils": "2.10.0-snapshot-20250828113245",
|
|
86
|
+
"@medusajs/ui": "4.0.20-snapshot-20250828113245",
|
|
87
87
|
"@mikro-orm/cli": "6.4.3",
|
|
88
88
|
"@mikro-orm/core": "6.4.3",
|
|
89
89
|
"@mikro-orm/knex": "6.4.3",
|