@medusajs/draft-order 2.10.0-preview-20250828000308 → 2.10.0-preview-20250828060153

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.
@@ -11546,6 +11546,209 @@ const SalesChannelField = ({ control, order }) => {
11546
11546
  const schema$2 = objectType({
11547
11547
  sales_channel_id: stringType().min(1)
11548
11548
  });
11549
+ const ShippingAddress = () => {
11550
+ const { id } = reactRouterDom.useParams();
11551
+ const { order, isPending, isError, error } = useOrder(id, {
11552
+ fields: "+shipping_address"
11553
+ });
11554
+ if (isError) {
11555
+ throw error;
11556
+ }
11557
+ const isReady = !isPending && !!order;
11558
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
11559
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
11560
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Shipping Address" }) }),
11561
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
11562
+ ] }),
11563
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(ShippingAddressForm, { order })
11564
+ ] });
11565
+ };
11566
+ const ShippingAddressForm = ({ order }) => {
11567
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11568
+ const form = reactHookForm.useForm({
11569
+ defaultValues: {
11570
+ first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
11571
+ last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
11572
+ company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
11573
+ address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
11574
+ address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
11575
+ city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
11576
+ province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
11577
+ country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
11578
+ postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
11579
+ phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
11580
+ },
11581
+ resolver: zod.zodResolver(schema$1)
11582
+ });
11583
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11584
+ const { handleSuccess } = useRouteModal();
11585
+ const onSubmit = form.handleSubmit(async (data) => {
11586
+ await mutateAsync(
11587
+ {
11588
+ shipping_address: {
11589
+ first_name: data.first_name,
11590
+ last_name: data.last_name,
11591
+ company: data.company,
11592
+ address_1: data.address_1,
11593
+ address_2: data.address_2,
11594
+ city: data.city,
11595
+ province: data.province,
11596
+ country_code: data.country_code,
11597
+ postal_code: data.postal_code,
11598
+ phone: data.phone
11599
+ }
11600
+ },
11601
+ {
11602
+ onSuccess: () => {
11603
+ handleSuccess();
11604
+ },
11605
+ onError: (error) => {
11606
+ ui.toast.error(error.message);
11607
+ }
11608
+ }
11609
+ );
11610
+ });
11611
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
11612
+ KeyboundForm,
11613
+ {
11614
+ className: "flex flex-1 flex-col overflow-hidden",
11615
+ onSubmit,
11616
+ children: [
11617
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-4", children: [
11618
+ /* @__PURE__ */ jsxRuntime.jsx(
11619
+ Form$2.Field,
11620
+ {
11621
+ control: form.control,
11622
+ name: "country_code",
11623
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11624
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
11625
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
11626
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11627
+ ] })
11628
+ }
11629
+ ),
11630
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11631
+ /* @__PURE__ */ jsxRuntime.jsx(
11632
+ Form$2.Field,
11633
+ {
11634
+ control: form.control,
11635
+ name: "first_name",
11636
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11637
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
11638
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11639
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11640
+ ] })
11641
+ }
11642
+ ),
11643
+ /* @__PURE__ */ jsxRuntime.jsx(
11644
+ Form$2.Field,
11645
+ {
11646
+ control: form.control,
11647
+ name: "last_name",
11648
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11649
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
11650
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11651
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11652
+ ] })
11653
+ }
11654
+ )
11655
+ ] }),
11656
+ /* @__PURE__ */ jsxRuntime.jsx(
11657
+ Form$2.Field,
11658
+ {
11659
+ control: form.control,
11660
+ name: "company",
11661
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11662
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
11663
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11664
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11665
+ ] })
11666
+ }
11667
+ ),
11668
+ /* @__PURE__ */ jsxRuntime.jsx(
11669
+ Form$2.Field,
11670
+ {
11671
+ control: form.control,
11672
+ name: "address_1",
11673
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11674
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
11675
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11676
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11677
+ ] })
11678
+ }
11679
+ ),
11680
+ /* @__PURE__ */ jsxRuntime.jsx(
11681
+ Form$2.Field,
11682
+ {
11683
+ control: form.control,
11684
+ name: "address_2",
11685
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11686
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11687
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11688
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11689
+ ] })
11690
+ }
11691
+ ),
11692
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11693
+ /* @__PURE__ */ jsxRuntime.jsx(
11694
+ Form$2.Field,
11695
+ {
11696
+ control: form.control,
11697
+ name: "postal_code",
11698
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11699
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
11700
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11701
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11702
+ ] })
11703
+ }
11704
+ ),
11705
+ /* @__PURE__ */ jsxRuntime.jsx(
11706
+ Form$2.Field,
11707
+ {
11708
+ control: form.control,
11709
+ name: "city",
11710
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11711
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
11712
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11713
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11714
+ ] })
11715
+ }
11716
+ )
11717
+ ] }),
11718
+ /* @__PURE__ */ jsxRuntime.jsx(
11719
+ Form$2.Field,
11720
+ {
11721
+ control: form.control,
11722
+ name: "province",
11723
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11724
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11725
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11726
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11727
+ ] })
11728
+ }
11729
+ ),
11730
+ /* @__PURE__ */ jsxRuntime.jsx(
11731
+ Form$2.Field,
11732
+ {
11733
+ control: form.control,
11734
+ name: "phone",
11735
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11736
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
11737
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11738
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11739
+ ] })
11740
+ }
11741
+ )
11742
+ ] }) }),
11743
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
11744
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11745
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11746
+ ] }) })
11747
+ ]
11748
+ }
11749
+ ) });
11750
+ };
11751
+ const schema$1 = addressSchema;
11549
11752
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
11550
11753
  const Shipping = () => {
11551
11754
  var _a;
@@ -12353,209 +12556,6 @@ const CustomAmountField = ({
12353
12556
  }
12354
12557
  );
12355
12558
  };
12356
- const ShippingAddress = () => {
12357
- const { id } = reactRouterDom.useParams();
12358
- const { order, isPending, isError, error } = useOrder(id, {
12359
- fields: "+shipping_address"
12360
- });
12361
- if (isError) {
12362
- throw error;
12363
- }
12364
- const isReady = !isPending && !!order;
12365
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
12366
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
12367
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Shipping Address" }) }),
12368
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12369
- ] }),
12370
- isReady && /* @__PURE__ */ jsxRuntime.jsx(ShippingAddressForm, { order })
12371
- ] });
12372
- };
12373
- const ShippingAddressForm = ({ order }) => {
12374
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12375
- const form = reactHookForm.useForm({
12376
- defaultValues: {
12377
- first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12378
- last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12379
- company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12380
- address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12381
- address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12382
- city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12383
- province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12384
- country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12385
- postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12386
- phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12387
- },
12388
- resolver: zod.zodResolver(schema$1)
12389
- });
12390
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12391
- const { handleSuccess } = useRouteModal();
12392
- const onSubmit = form.handleSubmit(async (data) => {
12393
- await mutateAsync(
12394
- {
12395
- shipping_address: {
12396
- first_name: data.first_name,
12397
- last_name: data.last_name,
12398
- company: data.company,
12399
- address_1: data.address_1,
12400
- address_2: data.address_2,
12401
- city: data.city,
12402
- province: data.province,
12403
- country_code: data.country_code,
12404
- postal_code: data.postal_code,
12405
- phone: data.phone
12406
- }
12407
- },
12408
- {
12409
- onSuccess: () => {
12410
- handleSuccess();
12411
- },
12412
- onError: (error) => {
12413
- ui.toast.error(error.message);
12414
- }
12415
- }
12416
- );
12417
- });
12418
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
12419
- KeyboundForm,
12420
- {
12421
- className: "flex flex-1 flex-col overflow-hidden",
12422
- onSubmit,
12423
- children: [
12424
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-y-4", children: [
12425
- /* @__PURE__ */ jsxRuntime.jsx(
12426
- Form$2.Field,
12427
- {
12428
- control: form.control,
12429
- name: "country_code",
12430
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12431
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
12432
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
12433
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12434
- ] })
12435
- }
12436
- ),
12437
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12438
- /* @__PURE__ */ jsxRuntime.jsx(
12439
- Form$2.Field,
12440
- {
12441
- control: form.control,
12442
- name: "first_name",
12443
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12444
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
12445
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12446
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12447
- ] })
12448
- }
12449
- ),
12450
- /* @__PURE__ */ jsxRuntime.jsx(
12451
- Form$2.Field,
12452
- {
12453
- control: form.control,
12454
- name: "last_name",
12455
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12456
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
12457
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12458
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12459
- ] })
12460
- }
12461
- )
12462
- ] }),
12463
- /* @__PURE__ */ jsxRuntime.jsx(
12464
- Form$2.Field,
12465
- {
12466
- control: form.control,
12467
- name: "company",
12468
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12469
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
12470
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12471
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12472
- ] })
12473
- }
12474
- ),
12475
- /* @__PURE__ */ jsxRuntime.jsx(
12476
- Form$2.Field,
12477
- {
12478
- control: form.control,
12479
- name: "address_1",
12480
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12481
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
12482
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12483
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12484
- ] })
12485
- }
12486
- ),
12487
- /* @__PURE__ */ jsxRuntime.jsx(
12488
- Form$2.Field,
12489
- {
12490
- control: form.control,
12491
- name: "address_2",
12492
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12493
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12494
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12495
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12496
- ] })
12497
- }
12498
- ),
12499
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12500
- /* @__PURE__ */ jsxRuntime.jsx(
12501
- Form$2.Field,
12502
- {
12503
- control: form.control,
12504
- name: "postal_code",
12505
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12506
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
12507
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12508
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12509
- ] })
12510
- }
12511
- ),
12512
- /* @__PURE__ */ jsxRuntime.jsx(
12513
- Form$2.Field,
12514
- {
12515
- control: form.control,
12516
- name: "city",
12517
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12518
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
12519
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12520
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12521
- ] })
12522
- }
12523
- )
12524
- ] }),
12525
- /* @__PURE__ */ jsxRuntime.jsx(
12526
- Form$2.Field,
12527
- {
12528
- control: form.control,
12529
- name: "province",
12530
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12531
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
12532
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12533
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12534
- ] })
12535
- }
12536
- ),
12537
- /* @__PURE__ */ jsxRuntime.jsx(
12538
- Form$2.Field,
12539
- {
12540
- control: form.control,
12541
- name: "phone",
12542
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
12543
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
12544
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
12545
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
12546
- ] })
12547
- }
12548
- )
12549
- ] }) }),
12550
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
12551
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
12552
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
12553
- ] }) })
12554
- ]
12555
- }
12556
- ) });
12557
- };
12558
- const schema$1 = addressSchema;
12559
12559
  const TransferOwnership = () => {
12560
12560
  const { id } = reactRouterDom.useParams();
12561
12561
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -13080,14 +13080,14 @@ const routeModule = {
13080
13080
  Component: SalesChannel,
13081
13081
  path: "/draft-orders/:id/sales-channel"
13082
13082
  },
13083
- {
13084
- Component: Shipping,
13085
- path: "/draft-orders/:id/shipping"
13086
- },
13087
13083
  {
13088
13084
  Component: ShippingAddress,
13089
13085
  path: "/draft-orders/:id/shipping-address"
13090
13086
  },
13087
+ {
13088
+ Component: Shipping,
13089
+ path: "/draft-orders/:id/shipping"
13090
+ },
13091
13091
  {
13092
13092
  Component: TransferOwnership,
13093
13093
  path: "/draft-orders/:id/transfer-ownership"
@@ -11540,6 +11540,209 @@ const SalesChannelField = ({ control, order }) => {
11540
11540
  const schema$2 = objectType({
11541
11541
  sales_channel_id: stringType().min(1)
11542
11542
  });
11543
+ const ShippingAddress = () => {
11544
+ const { id } = useParams();
11545
+ const { order, isPending, isError, error } = useOrder(id, {
11546
+ fields: "+shipping_address"
11547
+ });
11548
+ if (isError) {
11549
+ throw error;
11550
+ }
11551
+ const isReady = !isPending && !!order;
11552
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
11553
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
11554
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
11555
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
11556
+ ] }),
11557
+ isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
11558
+ ] });
11559
+ };
11560
+ const ShippingAddressForm = ({ order }) => {
11561
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11562
+ const form = useForm({
11563
+ defaultValues: {
11564
+ first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
11565
+ last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
11566
+ company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
11567
+ address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
11568
+ address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
11569
+ city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
11570
+ province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
11571
+ country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
11572
+ postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
11573
+ phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
11574
+ },
11575
+ resolver: zodResolver(schema$1)
11576
+ });
11577
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11578
+ const { handleSuccess } = useRouteModal();
11579
+ const onSubmit = form.handleSubmit(async (data) => {
11580
+ await mutateAsync(
11581
+ {
11582
+ shipping_address: {
11583
+ first_name: data.first_name,
11584
+ last_name: data.last_name,
11585
+ company: data.company,
11586
+ address_1: data.address_1,
11587
+ address_2: data.address_2,
11588
+ city: data.city,
11589
+ province: data.province,
11590
+ country_code: data.country_code,
11591
+ postal_code: data.postal_code,
11592
+ phone: data.phone
11593
+ }
11594
+ },
11595
+ {
11596
+ onSuccess: () => {
11597
+ handleSuccess();
11598
+ },
11599
+ onError: (error) => {
11600
+ toast.error(error.message);
11601
+ }
11602
+ }
11603
+ );
11604
+ });
11605
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11606
+ KeyboundForm,
11607
+ {
11608
+ className: "flex flex-1 flex-col overflow-hidden",
11609
+ onSubmit,
11610
+ children: [
11611
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
11612
+ /* @__PURE__ */ jsx(
11613
+ Form$2.Field,
11614
+ {
11615
+ control: form.control,
11616
+ name: "country_code",
11617
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11618
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
11619
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
11620
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11621
+ ] })
11622
+ }
11623
+ ),
11624
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11625
+ /* @__PURE__ */ jsx(
11626
+ Form$2.Field,
11627
+ {
11628
+ control: form.control,
11629
+ name: "first_name",
11630
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11631
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
11632
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11633
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11634
+ ] })
11635
+ }
11636
+ ),
11637
+ /* @__PURE__ */ jsx(
11638
+ Form$2.Field,
11639
+ {
11640
+ control: form.control,
11641
+ name: "last_name",
11642
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11643
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
11644
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11645
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11646
+ ] })
11647
+ }
11648
+ )
11649
+ ] }),
11650
+ /* @__PURE__ */ jsx(
11651
+ Form$2.Field,
11652
+ {
11653
+ control: form.control,
11654
+ name: "company",
11655
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11656
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
11657
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11658
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11659
+ ] })
11660
+ }
11661
+ ),
11662
+ /* @__PURE__ */ jsx(
11663
+ Form$2.Field,
11664
+ {
11665
+ control: form.control,
11666
+ name: "address_1",
11667
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11668
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
11669
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11670
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11671
+ ] })
11672
+ }
11673
+ ),
11674
+ /* @__PURE__ */ jsx(
11675
+ Form$2.Field,
11676
+ {
11677
+ control: form.control,
11678
+ name: "address_2",
11679
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11680
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11681
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11682
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11683
+ ] })
11684
+ }
11685
+ ),
11686
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11687
+ /* @__PURE__ */ jsx(
11688
+ Form$2.Field,
11689
+ {
11690
+ control: form.control,
11691
+ name: "postal_code",
11692
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11693
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
11694
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11695
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11696
+ ] })
11697
+ }
11698
+ ),
11699
+ /* @__PURE__ */ jsx(
11700
+ Form$2.Field,
11701
+ {
11702
+ control: form.control,
11703
+ name: "city",
11704
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11705
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
11706
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11707
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11708
+ ] })
11709
+ }
11710
+ )
11711
+ ] }),
11712
+ /* @__PURE__ */ jsx(
11713
+ Form$2.Field,
11714
+ {
11715
+ control: form.control,
11716
+ name: "province",
11717
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11718
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11719
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11720
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11721
+ ] })
11722
+ }
11723
+ ),
11724
+ /* @__PURE__ */ jsx(
11725
+ Form$2.Field,
11726
+ {
11727
+ control: form.control,
11728
+ name: "phone",
11729
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11730
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
11731
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11732
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11733
+ ] })
11734
+ }
11735
+ )
11736
+ ] }) }),
11737
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
11738
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11739
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11740
+ ] }) })
11741
+ ]
11742
+ }
11743
+ ) });
11744
+ };
11745
+ const schema$1 = addressSchema;
11543
11746
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
11544
11747
  const Shipping = () => {
11545
11748
  var _a;
@@ -12347,209 +12550,6 @@ const CustomAmountField = ({
12347
12550
  }
12348
12551
  );
12349
12552
  };
12350
- const ShippingAddress = () => {
12351
- const { id } = useParams();
12352
- const { order, isPending, isError, error } = useOrder(id, {
12353
- fields: "+shipping_address"
12354
- });
12355
- if (isError) {
12356
- throw error;
12357
- }
12358
- const isReady = !isPending && !!order;
12359
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12360
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12361
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
12362
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12363
- ] }),
12364
- isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
12365
- ] });
12366
- };
12367
- const ShippingAddressForm = ({ order }) => {
12368
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12369
- const form = useForm({
12370
- defaultValues: {
12371
- first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12372
- last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12373
- company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12374
- address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12375
- address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12376
- city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12377
- province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12378
- country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12379
- postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12380
- phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12381
- },
12382
- resolver: zodResolver(schema$1)
12383
- });
12384
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12385
- const { handleSuccess } = useRouteModal();
12386
- const onSubmit = form.handleSubmit(async (data) => {
12387
- await mutateAsync(
12388
- {
12389
- shipping_address: {
12390
- first_name: data.first_name,
12391
- last_name: data.last_name,
12392
- company: data.company,
12393
- address_1: data.address_1,
12394
- address_2: data.address_2,
12395
- city: data.city,
12396
- province: data.province,
12397
- country_code: data.country_code,
12398
- postal_code: data.postal_code,
12399
- phone: data.phone
12400
- }
12401
- },
12402
- {
12403
- onSuccess: () => {
12404
- handleSuccess();
12405
- },
12406
- onError: (error) => {
12407
- toast.error(error.message);
12408
- }
12409
- }
12410
- );
12411
- });
12412
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12413
- KeyboundForm,
12414
- {
12415
- className: "flex flex-1 flex-col overflow-hidden",
12416
- onSubmit,
12417
- children: [
12418
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
12419
- /* @__PURE__ */ jsx(
12420
- Form$2.Field,
12421
- {
12422
- control: form.control,
12423
- name: "country_code",
12424
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12425
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
12426
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
12427
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12428
- ] })
12429
- }
12430
- ),
12431
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12432
- /* @__PURE__ */ jsx(
12433
- Form$2.Field,
12434
- {
12435
- control: form.control,
12436
- name: "first_name",
12437
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12438
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
12439
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12440
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12441
- ] })
12442
- }
12443
- ),
12444
- /* @__PURE__ */ jsx(
12445
- Form$2.Field,
12446
- {
12447
- control: form.control,
12448
- name: "last_name",
12449
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12450
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
12451
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12452
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12453
- ] })
12454
- }
12455
- )
12456
- ] }),
12457
- /* @__PURE__ */ jsx(
12458
- Form$2.Field,
12459
- {
12460
- control: form.control,
12461
- name: "company",
12462
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12463
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
12464
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12465
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12466
- ] })
12467
- }
12468
- ),
12469
- /* @__PURE__ */ jsx(
12470
- Form$2.Field,
12471
- {
12472
- control: form.control,
12473
- name: "address_1",
12474
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12475
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
12476
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12477
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12478
- ] })
12479
- }
12480
- ),
12481
- /* @__PURE__ */ jsx(
12482
- Form$2.Field,
12483
- {
12484
- control: form.control,
12485
- name: "address_2",
12486
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12487
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12488
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12489
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12490
- ] })
12491
- }
12492
- ),
12493
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12494
- /* @__PURE__ */ jsx(
12495
- Form$2.Field,
12496
- {
12497
- control: form.control,
12498
- name: "postal_code",
12499
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12500
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
12501
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12502
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12503
- ] })
12504
- }
12505
- ),
12506
- /* @__PURE__ */ jsx(
12507
- Form$2.Field,
12508
- {
12509
- control: form.control,
12510
- name: "city",
12511
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12512
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
12513
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12514
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12515
- ] })
12516
- }
12517
- )
12518
- ] }),
12519
- /* @__PURE__ */ jsx(
12520
- Form$2.Field,
12521
- {
12522
- control: form.control,
12523
- name: "province",
12524
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12525
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
12526
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12527
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12528
- ] })
12529
- }
12530
- ),
12531
- /* @__PURE__ */ jsx(
12532
- Form$2.Field,
12533
- {
12534
- control: form.control,
12535
- name: "phone",
12536
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12537
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
12538
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12539
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12540
- ] })
12541
- }
12542
- )
12543
- ] }) }),
12544
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
12545
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
12546
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
12547
- ] }) })
12548
- ]
12549
- }
12550
- ) });
12551
- };
12552
- const schema$1 = addressSchema;
12553
12553
  const TransferOwnership = () => {
12554
12554
  const { id } = useParams();
12555
12555
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -13074,14 +13074,14 @@ const routeModule = {
13074
13074
  Component: SalesChannel,
13075
13075
  path: "/draft-orders/:id/sales-channel"
13076
13076
  },
13077
- {
13078
- Component: Shipping,
13079
- path: "/draft-orders/:id/shipping"
13080
- },
13081
13077
  {
13082
13078
  Component: ShippingAddress,
13083
13079
  path: "/draft-orders/:id/shipping-address"
13084
13080
  },
13081
+ {
13082
+ Component: Shipping,
13083
+ path: "/draft-orders/:id/shipping"
13084
+ },
13085
13085
  {
13086
13086
  Component: TransferOwnership,
13087
13087
  path: "/draft-orders/:id/transfer-ownership"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/draft-order",
3
- "version": "2.10.0-preview-20250828000308",
3
+ "version": "2.10.0-preview-20250828060153",
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-20250828000308",
39
+ "@medusajs/js-sdk": "2.10.0-preview-20250828060153",
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-preview-20250828000308",
49
- "@medusajs/cli": "2.10.0-preview-20250828000308",
50
- "@medusajs/framework": "2.10.0-preview-20250828000308",
51
- "@medusajs/icons": "2.10.0-preview-20250828000308",
52
- "@medusajs/medusa": "2.10.0-preview-20250828000308",
53
- "@medusajs/test-utils": "2.10.0-preview-20250828000308",
54
- "@medusajs/types": "2.10.0-preview-20250828000308",
55
- "@medusajs/ui": "4.0.20-preview-20250828000308",
56
- "@medusajs/ui-preset": "2.10.0-preview-20250828000308",
48
+ "@medusajs/admin-sdk": "2.10.0-preview-20250828060153",
49
+ "@medusajs/cli": "2.10.0-preview-20250828060153",
50
+ "@medusajs/framework": "2.10.0-preview-20250828060153",
51
+ "@medusajs/icons": "2.10.0-preview-20250828060153",
52
+ "@medusajs/medusa": "2.10.0-preview-20250828060153",
53
+ "@medusajs/test-utils": "2.10.0-preview-20250828060153",
54
+ "@medusajs/types": "2.10.0-preview-20250828060153",
55
+ "@medusajs/ui": "4.0.20-preview-20250828060153",
56
+ "@medusajs/ui-preset": "2.10.0-preview-20250828060153",
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-preview-20250828000308",
81
- "@medusajs/cli": "2.10.0-preview-20250828000308",
82
- "@medusajs/framework": "2.10.0-preview-20250828000308",
83
- "@medusajs/icons": "2.10.0-preview-20250828000308",
84
- "@medusajs/medusa": "2.10.0-preview-20250828000308",
85
- "@medusajs/test-utils": "2.10.0-preview-20250828000308",
86
- "@medusajs/ui": "4.0.20-preview-20250828000308",
80
+ "@medusajs/admin-sdk": "2.10.0-preview-20250828060153",
81
+ "@medusajs/cli": "2.10.0-preview-20250828060153",
82
+ "@medusajs/framework": "2.10.0-preview-20250828060153",
83
+ "@medusajs/icons": "2.10.0-preview-20250828060153",
84
+ "@medusajs/medusa": "2.10.0-preview-20250828060153",
85
+ "@medusajs/test-utils": "2.10.0-preview-20250828060153",
86
+ "@medusajs/ui": "4.0.20-preview-20250828060153",
87
87
  "@mikro-orm/cli": "6.4.3",
88
88
  "@mikro-orm/core": "6.4.3",
89
89
  "@mikro-orm/knex": "6.4.3",