@medusajs/draft-order 2.10.4-preview-20251013060155 → 2.10.4-preview-20251013090155
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 +85 -85
- package/.medusa/server/src/admin/index.mjs +85 -85
- package/package.json +16 -16
|
@@ -9763,23 +9763,70 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9763
9763
|
) });
|
|
9764
9764
|
};
|
|
9765
9765
|
const schema$5 = addressSchema;
|
|
9766
|
-
const
|
|
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;
|
|
9767
9775
|
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9768
|
-
/* @__PURE__ */ jsxRuntime.
|
|
9769
|
-
|
|
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 })
|
|
9770
9781
|
] });
|
|
9771
9782
|
};
|
|
9772
|
-
const
|
|
9783
|
+
const EmailForm = ({ order }) => {
|
|
9773
9784
|
const form = reactHookForm.useForm({
|
|
9785
|
+
defaultValues: {
|
|
9786
|
+
email: order.email ?? ""
|
|
9787
|
+
},
|
|
9774
9788
|
resolver: zod.zodResolver(schema$4)
|
|
9775
9789
|
});
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
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
|
+
) });
|
|
9783
9830
|
};
|
|
9784
9831
|
const schema$4 = objectType({
|
|
9785
9832
|
email: stringType().email()
|
|
@@ -10758,74 +10805,6 @@ const customItemSchema = objectType({
|
|
|
10758
10805
|
quantity: numberType(),
|
|
10759
10806
|
unit_price: unionType([numberType(), stringType()])
|
|
10760
10807
|
});
|
|
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
10808
|
const InlineTip = React.forwardRef(
|
|
10830
10809
|
({ variant = "tip", label, className, children, ...props }, ref) => {
|
|
10831
10810
|
const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
|
|
@@ -11453,6 +11432,27 @@ function getPromotionIds(items, shippingMethods) {
|
|
|
11453
11432
|
}
|
|
11454
11433
|
return Array.from(promotionIds);
|
|
11455
11434
|
}
|
|
11435
|
+
const CustomItems = () => {
|
|
11436
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
11437
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
11438
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
11439
|
+
] });
|
|
11440
|
+
};
|
|
11441
|
+
const CustomItemsForm = () => {
|
|
11442
|
+
const form = reactHookForm.useForm({
|
|
11443
|
+
resolver: zod.zodResolver(schema$3)
|
|
11444
|
+
});
|
|
11445
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
11446
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
11447
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
11448
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
11449
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
11450
|
+
] }) })
|
|
11451
|
+
] }) });
|
|
11452
|
+
};
|
|
11453
|
+
const schema$3 = objectType({
|
|
11454
|
+
email: stringType().email()
|
|
11455
|
+
});
|
|
11456
11456
|
const SalesChannel = () => {
|
|
11457
11457
|
const { id } = reactRouterDom.useParams();
|
|
11458
11458
|
const { draft_order, isPending, isError, error } = useDraftOrder(
|
|
@@ -13070,17 +13070,13 @@ const routeModule = {
|
|
|
13070
13070
|
path: "/draft-orders/:id/billing-address"
|
|
13071
13071
|
},
|
|
13072
13072
|
{
|
|
13073
|
-
Component:
|
|
13074
|
-
path: "/draft-orders/:id/
|
|
13073
|
+
Component: Email,
|
|
13074
|
+
path: "/draft-orders/:id/email"
|
|
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
|
-
},
|
|
13084
13080
|
{
|
|
13085
13081
|
Component: Metadata,
|
|
13086
13082
|
path: "/draft-orders/:id/metadata"
|
|
@@ -13089,6 +13085,10 @@ const routeModule = {
|
|
|
13089
13085
|
Component: Promotions,
|
|
13090
13086
|
path: "/draft-orders/:id/promotions"
|
|
13091
13087
|
},
|
|
13088
|
+
{
|
|
13089
|
+
Component: CustomItems,
|
|
13090
|
+
path: "/draft-orders/:id/custom-items"
|
|
13091
|
+
},
|
|
13092
13092
|
{
|
|
13093
13093
|
Component: SalesChannel,
|
|
13094
13094
|
path: "/draft-orders/:id/sales-channel"
|
|
@@ -9757,23 +9757,70 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9757
9757
|
) });
|
|
9758
9758
|
};
|
|
9759
9759
|
const schema$5 = addressSchema;
|
|
9760
|
-
const
|
|
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;
|
|
9761
9769
|
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
9762
|
-
/* @__PURE__ */
|
|
9763
|
-
|
|
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 })
|
|
9764
9775
|
] });
|
|
9765
9776
|
};
|
|
9766
|
-
const
|
|
9777
|
+
const EmailForm = ({ order }) => {
|
|
9767
9778
|
const form = useForm({
|
|
9779
|
+
defaultValues: {
|
|
9780
|
+
email: order.email ?? ""
|
|
9781
|
+
},
|
|
9768
9782
|
resolver: zodResolver(schema$4)
|
|
9769
9783
|
});
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
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
|
+
) });
|
|
9777
9824
|
};
|
|
9778
9825
|
const schema$4 = objectType({
|
|
9779
9826
|
email: stringType().email()
|
|
@@ -10752,74 +10799,6 @@ const customItemSchema = objectType({
|
|
|
10752
10799
|
quantity: numberType(),
|
|
10753
10800
|
unit_price: unionType([numberType(), stringType()])
|
|
10754
10801
|
});
|
|
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
10802
|
const InlineTip = forwardRef(
|
|
10824
10803
|
({ variant = "tip", label, className, children, ...props }, ref) => {
|
|
10825
10804
|
const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
|
|
@@ -11447,6 +11426,27 @@ function getPromotionIds(items, shippingMethods) {
|
|
|
11447
11426
|
}
|
|
11448
11427
|
return Array.from(promotionIds);
|
|
11449
11428
|
}
|
|
11429
|
+
const CustomItems = () => {
|
|
11430
|
+
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
11431
|
+
/* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
|
|
11432
|
+
/* @__PURE__ */ jsx(CustomItemsForm, {})
|
|
11433
|
+
] });
|
|
11434
|
+
};
|
|
11435
|
+
const CustomItemsForm = () => {
|
|
11436
|
+
const form = useForm({
|
|
11437
|
+
resolver: zodResolver(schema$3)
|
|
11438
|
+
});
|
|
11439
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
11440
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, {}),
|
|
11441
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
11442
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
11443
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
|
|
11444
|
+
] }) })
|
|
11445
|
+
] }) });
|
|
11446
|
+
};
|
|
11447
|
+
const schema$3 = objectType({
|
|
11448
|
+
email: stringType().email()
|
|
11449
|
+
});
|
|
11450
11450
|
const SalesChannel = () => {
|
|
11451
11451
|
const { id } = useParams();
|
|
11452
11452
|
const { draft_order, isPending, isError, error } = useDraftOrder(
|
|
@@ -13064,17 +13064,13 @@ const routeModule = {
|
|
|
13064
13064
|
path: "/draft-orders/:id/billing-address"
|
|
13065
13065
|
},
|
|
13066
13066
|
{
|
|
13067
|
-
Component:
|
|
13068
|
-
path: "/draft-orders/:id/
|
|
13067
|
+
Component: Email,
|
|
13068
|
+
path: "/draft-orders/:id/email"
|
|
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
|
-
},
|
|
13078
13074
|
{
|
|
13079
13075
|
Component: Metadata,
|
|
13080
13076
|
path: "/draft-orders/:id/metadata"
|
|
@@ -13083,6 +13079,10 @@ const routeModule = {
|
|
|
13083
13079
|
Component: Promotions,
|
|
13084
13080
|
path: "/draft-orders/:id/promotions"
|
|
13085
13081
|
},
|
|
13082
|
+
{
|
|
13083
|
+
Component: CustomItems,
|
|
13084
|
+
path: "/draft-orders/:id/custom-items"
|
|
13085
|
+
},
|
|
13086
13086
|
{
|
|
13087
13087
|
Component: SalesChannel,
|
|
13088
13088
|
path: "/draft-orders/:id/sales-channel"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/draft-order",
|
|
3
|
-
"version": "2.10.4-preview-
|
|
3
|
+
"version": "2.10.4-preview-20251013090155",
|
|
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-
|
|
39
|
+
"@medusajs/js-sdk": "2.10.4-preview-20251013090155",
|
|
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-
|
|
49
|
-
"@medusajs/cli": "2.10.4-preview-
|
|
50
|
-
"@medusajs/framework": "2.10.4-preview-
|
|
51
|
-
"@medusajs/icons": "2.10.4-preview-
|
|
52
|
-
"@medusajs/test-utils": "2.10.4-preview-
|
|
53
|
-
"@medusajs/types": "2.10.4-preview-
|
|
54
|
-
"@medusajs/ui": "4.0.24-preview-
|
|
55
|
-
"@medusajs/ui-preset": "2.10.4-preview-
|
|
48
|
+
"@medusajs/admin-sdk": "2.10.4-preview-20251013090155",
|
|
49
|
+
"@medusajs/cli": "2.10.4-preview-20251013090155",
|
|
50
|
+
"@medusajs/framework": "2.10.4-preview-20251013090155",
|
|
51
|
+
"@medusajs/icons": "2.10.4-preview-20251013090155",
|
|
52
|
+
"@medusajs/test-utils": "2.10.4-preview-20251013090155",
|
|
53
|
+
"@medusajs/types": "2.10.4-preview-20251013090155",
|
|
54
|
+
"@medusajs/ui": "4.0.24-preview-20251013090155",
|
|
55
|
+
"@medusajs/ui-preset": "2.10.4-preview-20251013090155",
|
|
56
56
|
"@swc/core": "1.5.7",
|
|
57
57
|
"@types/lodash": "^4.17.15",
|
|
58
58
|
"@types/node": "^20.0.0",
|
|
@@ -69,12 +69,12 @@
|
|
|
69
69
|
"yalc": "^1.0.0-pre.53"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@medusajs/admin-sdk": "2.10.4-preview-
|
|
73
|
-
"@medusajs/cli": "2.10.4-preview-
|
|
74
|
-
"@medusajs/framework": "2.10.4-preview-
|
|
75
|
-
"@medusajs/icons": "2.10.4-preview-
|
|
76
|
-
"@medusajs/test-utils": "2.10.4-preview-
|
|
77
|
-
"@medusajs/ui": "4.0.24-preview-
|
|
72
|
+
"@medusajs/admin-sdk": "2.10.4-preview-20251013090155",
|
|
73
|
+
"@medusajs/cli": "2.10.4-preview-20251013090155",
|
|
74
|
+
"@medusajs/framework": "2.10.4-preview-20251013090155",
|
|
75
|
+
"@medusajs/icons": "2.10.4-preview-20251013090155",
|
|
76
|
+
"@medusajs/test-utils": "2.10.4-preview-20251013090155",
|
|
77
|
+
"@medusajs/ui": "4.0.24-preview-20251013090155",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
79
|
"react-router-dom": "6.20.1"
|
|
80
80
|
},
|