@medusajs/draft-order 2.10.0-snapshot-20250827150653 → 2.10.0-snapshot-20250827161638

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.
@@ -9750,27 +9750,6 @@ const BillingAddressForm = ({ order }) => {
9750
9750
  ) });
9751
9751
  };
9752
9752
  const schema$5 = addressSchema;
9753
- const CustomItems = () => {
9754
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9755
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
9756
- /* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
9757
- ] });
9758
- };
9759
- const CustomItemsForm = () => {
9760
- const form = reactHookForm.useForm({
9761
- resolver: zod.zodResolver(schema$4)
9762
- });
9763
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9764
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
9765
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9766
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9767
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
9768
- ] }) })
9769
- ] }) });
9770
- };
9771
- const schema$4 = objectType({
9772
- email: stringType().email()
9773
- });
9774
9753
  const Email = () => {
9775
9754
  const { id } = reactRouterDom.useParams();
9776
9755
  const { order, isPending, isError, error } = useOrder(id, {
@@ -9793,7 +9772,7 @@ const EmailForm = ({ order }) => {
9793
9772
  defaultValues: {
9794
9773
  email: order.email ?? ""
9795
9774
  },
9796
- resolver: zod.zodResolver(schema$3)
9775
+ resolver: zod.zodResolver(schema$4)
9797
9776
  });
9798
9777
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9799
9778
  const { handleSuccess } = useRouteModal();
@@ -9836,7 +9815,7 @@ const EmailForm = ({ order }) => {
9836
9815
  }
9837
9816
  ) });
9838
9817
  };
9839
- const schema$3 = objectType({
9818
+ const schema$4 = objectType({
9840
9819
  email: stringType().email()
9841
9820
  });
9842
9821
  const NumberInput = React.forwardRef(
@@ -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$2)
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$2 = objectType({
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$1)
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$1 = addressSchema;
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: [
@@ -13056,10 +13056,6 @@ const routeModule = {
13056
13056
  Component: BillingAddress,
13057
13057
  path: "/draft-orders/:id/billing-address"
13058
13058
  },
13059
- {
13060
- Component: CustomItems,
13061
- path: "/draft-orders/:id/custom-items"
13062
- },
13063
13059
  {
13064
13060
  Component: Email,
13065
13061
  path: "/draft-orders/:id/email"
@@ -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,27 +9744,6 @@ const BillingAddressForm = ({ order }) => {
9744
9744
  ) });
9745
9745
  };
9746
9746
  const schema$5 = addressSchema;
9747
- const CustomItems = () => {
9748
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9749
- /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
9750
- /* @__PURE__ */ jsx(CustomItemsForm, {})
9751
- ] });
9752
- };
9753
- const CustomItemsForm = () => {
9754
- const form = useForm({
9755
- resolver: zodResolver(schema$4)
9756
- });
9757
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9758
- /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
9759
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9760
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9761
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
9762
- ] }) })
9763
- ] }) });
9764
- };
9765
- const schema$4 = objectType({
9766
- email: stringType().email()
9767
- });
9768
9747
  const Email = () => {
9769
9748
  const { id } = useParams();
9770
9749
  const { order, isPending, isError, error } = useOrder(id, {
@@ -9787,7 +9766,7 @@ const EmailForm = ({ order }) => {
9787
9766
  defaultValues: {
9788
9767
  email: order.email ?? ""
9789
9768
  },
9790
- resolver: zodResolver(schema$3)
9769
+ resolver: zodResolver(schema$4)
9791
9770
  });
9792
9771
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9793
9772
  const { handleSuccess } = useRouteModal();
@@ -9830,7 +9809,7 @@ const EmailForm = ({ order }) => {
9830
9809
  }
9831
9810
  ) });
9832
9811
  };
9833
- const schema$3 = objectType({
9812
+ const schema$4 = objectType({
9834
9813
  email: stringType().email()
9835
9814
  });
9836
9815
  const NumberInput = forwardRef(
@@ -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$2)
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$2 = objectType({
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$1)
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$1 = addressSchema;
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: [
@@ -13050,10 +13050,6 @@ const routeModule = {
13050
13050
  Component: BillingAddress,
13051
13051
  path: "/draft-orders/:id/billing-address"
13052
13052
  },
13053
- {
13054
- Component: CustomItems,
13055
- path: "/draft-orders/:id/custom-items"
13056
- },
13057
13053
  {
13058
13054
  Component: Email,
13059
13055
  path: "/draft-orders/:id/email"
@@ -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-20250827150653",
3
+ "version": "2.10.0-snapshot-20250827161638",
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-20250827150653",
39
+ "@medusajs/js-sdk": "2.10.0-snapshot-20250827161638",
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-20250827150653",
49
- "@medusajs/cli": "2.10.0-snapshot-20250827150653",
50
- "@medusajs/framework": "2.10.0-snapshot-20250827150653",
51
- "@medusajs/icons": "2.10.0-snapshot-20250827150653",
52
- "@medusajs/medusa": "2.10.0-snapshot-20250827150653",
53
- "@medusajs/test-utils": "2.10.0-snapshot-20250827150653",
54
- "@medusajs/types": "2.10.0-snapshot-20250827150653",
55
- "@medusajs/ui": "4.0.20-snapshot-20250827150653",
56
- "@medusajs/ui-preset": "2.10.0-snapshot-20250827150653",
48
+ "@medusajs/admin-sdk": "2.10.0-snapshot-20250827161638",
49
+ "@medusajs/cli": "2.10.0-snapshot-20250827161638",
50
+ "@medusajs/framework": "2.10.0-snapshot-20250827161638",
51
+ "@medusajs/icons": "2.10.0-snapshot-20250827161638",
52
+ "@medusajs/medusa": "2.10.0-snapshot-20250827161638",
53
+ "@medusajs/test-utils": "2.10.0-snapshot-20250827161638",
54
+ "@medusajs/types": "2.10.0-snapshot-20250827161638",
55
+ "@medusajs/ui": "4.0.20-snapshot-20250827161638",
56
+ "@medusajs/ui-preset": "2.10.0-snapshot-20250827161638",
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-20250827150653",
81
- "@medusajs/cli": "2.10.0-snapshot-20250827150653",
82
- "@medusajs/framework": "2.10.0-snapshot-20250827150653",
83
- "@medusajs/icons": "2.10.0-snapshot-20250827150653",
84
- "@medusajs/medusa": "2.10.0-snapshot-20250827150653",
85
- "@medusajs/test-utils": "2.10.0-snapshot-20250827150653",
86
- "@medusajs/ui": "4.0.20-snapshot-20250827150653",
80
+ "@medusajs/admin-sdk": "2.10.0-snapshot-20250827161638",
81
+ "@medusajs/cli": "2.10.0-snapshot-20250827161638",
82
+ "@medusajs/framework": "2.10.0-snapshot-20250827161638",
83
+ "@medusajs/icons": "2.10.0-snapshot-20250827161638",
84
+ "@medusajs/medusa": "2.10.0-snapshot-20250827161638",
85
+ "@medusajs/test-utils": "2.10.0-snapshot-20250827161638",
86
+ "@medusajs/ui": "4.0.20-snapshot-20250827161638",
87
87
  "@mikro-orm/cli": "6.4.3",
88
88
  "@mikro-orm/core": "6.4.3",
89
89
  "@mikro-orm/knex": "6.4.3",