@medusajs/draft-order 2.11.3-snapshot-20251103115905 → 2.12.0-preview-20251103150145
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 +30 -26
- package/.medusa/server/src/admin/index.mjs +31 -27
- package/package.json +31 -16
|
@@ -4654,6 +4654,9 @@ ZodReadonly.create = (type, params) => {
|
|
|
4654
4654
|
...processCreateParams(params)
|
|
4655
4655
|
});
|
|
4656
4656
|
};
|
|
4657
|
+
({
|
|
4658
|
+
object: ZodObject.lazycreate
|
|
4659
|
+
});
|
|
4657
4660
|
var ZodFirstPartyTypeKind;
|
|
4658
4661
|
(function(ZodFirstPartyTypeKind2) {
|
|
4659
4662
|
ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
|
|
@@ -4700,6 +4703,7 @@ const anyType = ZodAny.create;
|
|
|
4700
4703
|
ZodNever.create;
|
|
4701
4704
|
const arrayType = ZodArray.create;
|
|
4702
4705
|
const objectType = ZodObject.create;
|
|
4706
|
+
ZodObject.strictCreate;
|
|
4703
4707
|
const unionType = ZodUnion.create;
|
|
4704
4708
|
ZodIntersection.create;
|
|
4705
4709
|
ZodTuple.create;
|
|
@@ -9758,6 +9762,27 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9758
9762
|
) });
|
|
9759
9763
|
};
|
|
9760
9764
|
const schema$5 = addressSchema;
|
|
9765
|
+
const CustomItems = () => {
|
|
9766
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9767
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
9768
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
9769
|
+
] });
|
|
9770
|
+
};
|
|
9771
|
+
const CustomItemsForm = () => {
|
|
9772
|
+
const form = reactHookForm.useForm({
|
|
9773
|
+
resolver: zod.zodResolver(schema$4)
|
|
9774
|
+
});
|
|
9775
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9776
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
9777
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9778
|
+
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9779
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
9780
|
+
] }) })
|
|
9781
|
+
] }) });
|
|
9782
|
+
};
|
|
9783
|
+
const schema$4 = objectType({
|
|
9784
|
+
email: stringType().email()
|
|
9785
|
+
});
|
|
9761
9786
|
const Email = () => {
|
|
9762
9787
|
const { id } = reactRouterDom.useParams();
|
|
9763
9788
|
const { order, isPending, isError, error } = useOrder(id, {
|
|
@@ -9780,7 +9805,7 @@ const EmailForm = ({ order }) => {
|
|
|
9780
9805
|
defaultValues: {
|
|
9781
9806
|
email: order.email ?? ""
|
|
9782
9807
|
},
|
|
9783
|
-
resolver: zod.zodResolver(schema$
|
|
9808
|
+
resolver: zod.zodResolver(schema$3)
|
|
9784
9809
|
});
|
|
9785
9810
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9786
9811
|
const { handleSuccess } = useRouteModal();
|
|
@@ -9823,27 +9848,6 @@ const EmailForm = ({ order }) => {
|
|
|
9823
9848
|
}
|
|
9824
9849
|
) });
|
|
9825
9850
|
};
|
|
9826
|
-
const schema$4 = objectType({
|
|
9827
|
-
email: stringType().email()
|
|
9828
|
-
});
|
|
9829
|
-
const CustomItems = () => {
|
|
9830
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
|
|
9831
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
|
|
9832
|
-
/* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
|
|
9833
|
-
] });
|
|
9834
|
-
};
|
|
9835
|
-
const CustomItemsForm = () => {
|
|
9836
|
-
const form = reactHookForm.useForm({
|
|
9837
|
-
resolver: zod.zodResolver(schema$3)
|
|
9838
|
-
});
|
|
9839
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9840
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
|
|
9841
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9842
|
-
/* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9843
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
|
|
9844
|
-
] }) })
|
|
9845
|
-
] }) });
|
|
9846
|
-
};
|
|
9847
9851
|
const schema$3 = objectType({
|
|
9848
9852
|
email: stringType().email()
|
|
9849
9853
|
});
|
|
@@ -13064,14 +13068,14 @@ const routeModule = {
|
|
|
13064
13068
|
Component: BillingAddress,
|
|
13065
13069
|
path: "/draft-orders/:id/billing-address"
|
|
13066
13070
|
},
|
|
13067
|
-
{
|
|
13068
|
-
Component: Email,
|
|
13069
|
-
path: "/draft-orders/:id/email"
|
|
13070
|
-
},
|
|
13071
13071
|
{
|
|
13072
13072
|
Component: CustomItems,
|
|
13073
13073
|
path: "/draft-orders/:id/custom-items"
|
|
13074
13074
|
},
|
|
13075
|
+
{
|
|
13076
|
+
Component: Email,
|
|
13077
|
+
path: "/draft-orders/:id/email"
|
|
13078
|
+
},
|
|
13075
13079
|
{
|
|
13076
13080
|
Component: Items,
|
|
13077
13081
|
path: "/draft-orders/:id/items"
|
|
@@ -9,7 +9,7 @@ import Medusa from "@medusajs/js-sdk";
|
|
|
9
9
|
import { format, formatDistance, sub, subDays, subMonths } from "date-fns";
|
|
10
10
|
import { enUS } from "date-fns/locale";
|
|
11
11
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
12
|
-
import { FormProvider, useFormContext, useFormState,
|
|
12
|
+
import { FormProvider, Controller, useFormContext, useFormState, useForm, useWatch, useFieldArray } from "react-hook-form";
|
|
13
13
|
import { Slot, Collapsible, Accordion } from "radix-ui";
|
|
14
14
|
import { ComboboxProvider, Combobox as Combobox$1, ComboboxDisclosure, ComboboxPopover, ComboboxItem, ComboboxItemCheck, ComboboxItemValue, Separator } from "@ariakit/react";
|
|
15
15
|
import { matchSorter } from "match-sorter";
|
|
@@ -4647,6 +4647,9 @@ ZodReadonly.create = (type, params) => {
|
|
|
4647
4647
|
...processCreateParams(params)
|
|
4648
4648
|
});
|
|
4649
4649
|
};
|
|
4650
|
+
({
|
|
4651
|
+
object: ZodObject.lazycreate
|
|
4652
|
+
});
|
|
4650
4653
|
var ZodFirstPartyTypeKind;
|
|
4651
4654
|
(function(ZodFirstPartyTypeKind2) {
|
|
4652
4655
|
ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
|
|
@@ -4693,6 +4696,7 @@ const anyType = ZodAny.create;
|
|
|
4693
4696
|
ZodNever.create;
|
|
4694
4697
|
const arrayType = ZodArray.create;
|
|
4695
4698
|
const objectType = ZodObject.create;
|
|
4699
|
+
ZodObject.strictCreate;
|
|
4696
4700
|
const unionType = ZodUnion.create;
|
|
4697
4701
|
ZodIntersection.create;
|
|
4698
4702
|
ZodTuple.create;
|
|
@@ -9751,6 +9755,27 @@ const BillingAddressForm = ({ order }) => {
|
|
|
9751
9755
|
) });
|
|
9752
9756
|
};
|
|
9753
9757
|
const schema$5 = addressSchema;
|
|
9758
|
+
const CustomItems = () => {
|
|
9759
|
+
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
9760
|
+
/* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
|
|
9761
|
+
/* @__PURE__ */ jsx(CustomItemsForm, {})
|
|
9762
|
+
] });
|
|
9763
|
+
};
|
|
9764
|
+
const CustomItemsForm = () => {
|
|
9765
|
+
const form = useForm({
|
|
9766
|
+
resolver: zodResolver(schema$4)
|
|
9767
|
+
});
|
|
9768
|
+
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9769
|
+
/* @__PURE__ */ jsx(RouteDrawer.Body, {}),
|
|
9770
|
+
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9771
|
+
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9772
|
+
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
|
|
9773
|
+
] }) })
|
|
9774
|
+
] }) });
|
|
9775
|
+
};
|
|
9776
|
+
const schema$4 = objectType({
|
|
9777
|
+
email: stringType().email()
|
|
9778
|
+
});
|
|
9754
9779
|
const Email = () => {
|
|
9755
9780
|
const { id } = useParams();
|
|
9756
9781
|
const { order, isPending, isError, error } = useOrder(id, {
|
|
@@ -9773,7 +9798,7 @@ const EmailForm = ({ order }) => {
|
|
|
9773
9798
|
defaultValues: {
|
|
9774
9799
|
email: order.email ?? ""
|
|
9775
9800
|
},
|
|
9776
|
-
resolver: zodResolver(schema$
|
|
9801
|
+
resolver: zodResolver(schema$3)
|
|
9777
9802
|
});
|
|
9778
9803
|
const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
|
|
9779
9804
|
const { handleSuccess } = useRouteModal();
|
|
@@ -9816,27 +9841,6 @@ const EmailForm = ({ order }) => {
|
|
|
9816
9841
|
}
|
|
9817
9842
|
) });
|
|
9818
9843
|
};
|
|
9819
|
-
const schema$4 = objectType({
|
|
9820
|
-
email: stringType().email()
|
|
9821
|
-
});
|
|
9822
|
-
const CustomItems = () => {
|
|
9823
|
-
return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
|
|
9824
|
-
/* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
|
|
9825
|
-
/* @__PURE__ */ jsx(CustomItemsForm, {})
|
|
9826
|
-
] });
|
|
9827
|
-
};
|
|
9828
|
-
const CustomItemsForm = () => {
|
|
9829
|
-
const form = useForm({
|
|
9830
|
-
resolver: zodResolver(schema$3)
|
|
9831
|
-
});
|
|
9832
|
-
return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
|
|
9833
|
-
/* @__PURE__ */ jsx(RouteDrawer.Body, {}),
|
|
9834
|
-
/* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
9835
|
-
/* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
|
|
9836
|
-
/* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
|
|
9837
|
-
] }) })
|
|
9838
|
-
] }) });
|
|
9839
|
-
};
|
|
9840
9844
|
const schema$3 = objectType({
|
|
9841
9845
|
email: stringType().email()
|
|
9842
9846
|
});
|
|
@@ -13057,14 +13061,14 @@ const routeModule = {
|
|
|
13057
13061
|
Component: BillingAddress,
|
|
13058
13062
|
path: "/draft-orders/:id/billing-address"
|
|
13059
13063
|
},
|
|
13060
|
-
{
|
|
13061
|
-
Component: Email,
|
|
13062
|
-
path: "/draft-orders/:id/email"
|
|
13063
|
-
},
|
|
13064
13064
|
{
|
|
13065
13065
|
Component: CustomItems,
|
|
13066
13066
|
path: "/draft-orders/:id/custom-items"
|
|
13067
13067
|
},
|
|
13068
|
+
{
|
|
13069
|
+
Component: Email,
|
|
13070
|
+
path: "/draft-orders/:id/email"
|
|
13071
|
+
},
|
|
13068
13072
|
{
|
|
13069
13073
|
Component: Items,
|
|
13070
13074
|
path: "/draft-orders/:id/items"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/draft-order",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0-preview-20251103150145",
|
|
4
4
|
"description": "A starter for Medusa plugins.",
|
|
5
5
|
"author": "Medusa (https://medusajs.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@ariakit/react": "^0.4.15",
|
|
38
38
|
"@babel/runtime": "^7.26.10",
|
|
39
39
|
"@hookform/resolvers": "3.4.2",
|
|
40
|
-
"@medusajs/js-sdk": "2.
|
|
40
|
+
"@medusajs/js-sdk": "2.12.0-preview-20251103150145",
|
|
41
41
|
"@tanstack/react-query": "5.64.2",
|
|
42
42
|
"@uiw/react-json-view": "^2.0.0-alpha.17",
|
|
43
43
|
"date-fns": "^3.6.0",
|
|
@@ -48,22 +48,37 @@
|
|
|
48
48
|
"react-hook-form": "7.49.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@medusajs/admin-sdk": "2.
|
|
52
|
-
"@medusajs/cli": "2.
|
|
53
|
-
"@medusajs/framework": "2.
|
|
54
|
-
"@medusajs/icons": "2.
|
|
55
|
-
"@medusajs/test-utils": "2.
|
|
56
|
-
"@medusajs/types": "2.
|
|
57
|
-
"@medusajs/ui": "4.0.27-
|
|
58
|
-
"@medusajs/ui-preset": "2.
|
|
51
|
+
"@medusajs/admin-sdk": "2.12.0-preview-20251103150145",
|
|
52
|
+
"@medusajs/cli": "2.12.0-preview-20251103150145",
|
|
53
|
+
"@medusajs/framework": "2.12.0-preview-20251103150145",
|
|
54
|
+
"@medusajs/icons": "2.12.0-preview-20251103150145",
|
|
55
|
+
"@medusajs/test-utils": "2.12.0-preview-20251103150145",
|
|
56
|
+
"@medusajs/types": "2.12.0-preview-20251103150145",
|
|
57
|
+
"@medusajs/ui": "4.0.27-preview-20251103150145",
|
|
58
|
+
"@medusajs/ui-preset": "2.12.0-preview-20251103150145",
|
|
59
|
+
"@swc/core": "^1.7.28",
|
|
60
|
+
"@types/lodash": "^4.17.15",
|
|
61
|
+
"@types/lodash.debounce": "^4.0.9",
|
|
62
|
+
"@types/lodash.isequal": "^4.5.8",
|
|
63
|
+
"@types/node": "^20.12.11",
|
|
64
|
+
"@types/react": "^18.3.2",
|
|
65
|
+
"@types/react-dom": "^18.2.25",
|
|
66
|
+
"react": "^18.3.1",
|
|
67
|
+
"react-dom": "^18.3.1",
|
|
68
|
+
"react-router-dom": "6.20.1",
|
|
69
|
+
"ts-node": "^10.9.2",
|
|
70
|
+
"tsup": "^8.4.0",
|
|
71
|
+
"typescript": "^5.6.2",
|
|
72
|
+
"vite": "^5.4.14",
|
|
73
|
+
"yalc": "^1.0.0-pre.53"
|
|
59
74
|
},
|
|
60
75
|
"peerDependencies": {
|
|
61
|
-
"@medusajs/admin-sdk": "2.
|
|
62
|
-
"@medusajs/cli": "2.
|
|
63
|
-
"@medusajs/framework": "2.
|
|
64
|
-
"@medusajs/icons": "2.
|
|
65
|
-
"@medusajs/test-utils": "2.
|
|
66
|
-
"@medusajs/ui": "4.0.27-
|
|
76
|
+
"@medusajs/admin-sdk": "2.12.0-preview-20251103150145",
|
|
77
|
+
"@medusajs/cli": "2.12.0-preview-20251103150145",
|
|
78
|
+
"@medusajs/framework": "2.12.0-preview-20251103150145",
|
|
79
|
+
"@medusajs/icons": "2.12.0-preview-20251103150145",
|
|
80
|
+
"@medusajs/test-utils": "2.12.0-preview-20251103150145",
|
|
81
|
+
"@medusajs/ui": "4.0.27-preview-20251103150145",
|
|
67
82
|
"react": "^18.3.1",
|
|
68
83
|
"react-dom": "^18.3.1",
|
|
69
84
|
"react-router-dom": "6.20.1"
|