@medusajs/draft-order 2.10.2-preview-20250901150144 → 2.10.2-preview-20250901180147

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.
@@ -9560,6 +9560,196 @@ const ID = () => {
9560
9560
  /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
9561
9561
  ] });
9562
9562
  };
9563
+ const BillingAddress = () => {
9564
+ const { id } = reactRouterDom.useParams();
9565
+ const { order, isPending, isError, error } = useOrder(id, {
9566
+ fields: "+billing_address"
9567
+ });
9568
+ if (isError) {
9569
+ throw error;
9570
+ }
9571
+ const isReady = !isPending && !!order;
9572
+ return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
9573
+ /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
9574
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
9575
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9576
+ ] }),
9577
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
9578
+ ] });
9579
+ };
9580
+ const BillingAddressForm = ({ order }) => {
9581
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9582
+ const form = reactHookForm.useForm({
9583
+ defaultValues: {
9584
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9585
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9586
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9587
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9588
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9589
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9590
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9591
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9592
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9593
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9594
+ },
9595
+ resolver: zod.zodResolver(schema$5)
9596
+ });
9597
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9598
+ const { handleSuccess } = useRouteModal();
9599
+ const onSubmit = form.handleSubmit(async (data) => {
9600
+ await mutateAsync(
9601
+ { billing_address: data },
9602
+ {
9603
+ onSuccess: () => {
9604
+ handleSuccess();
9605
+ },
9606
+ onError: (error) => {
9607
+ ui.toast.error(error.message);
9608
+ }
9609
+ }
9610
+ );
9611
+ });
9612
+ return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
9613
+ KeyboundForm,
9614
+ {
9615
+ className: "flex flex-1 flex-col overflow-hidden",
9616
+ onSubmit,
9617
+ children: [
9618
+ /* @__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: [
9619
+ /* @__PURE__ */ jsxRuntime.jsx(
9620
+ Form$2.Field,
9621
+ {
9622
+ control: form.control,
9623
+ name: "country_code",
9624
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9625
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
9626
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
9627
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9628
+ ] })
9629
+ }
9630
+ ),
9631
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9632
+ /* @__PURE__ */ jsxRuntime.jsx(
9633
+ Form$2.Field,
9634
+ {
9635
+ control: form.control,
9636
+ name: "first_name",
9637
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9638
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
9639
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9640
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9641
+ ] })
9642
+ }
9643
+ ),
9644
+ /* @__PURE__ */ jsxRuntime.jsx(
9645
+ Form$2.Field,
9646
+ {
9647
+ control: form.control,
9648
+ name: "last_name",
9649
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9650
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
9651
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9652
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9653
+ ] })
9654
+ }
9655
+ )
9656
+ ] }),
9657
+ /* @__PURE__ */ jsxRuntime.jsx(
9658
+ Form$2.Field,
9659
+ {
9660
+ control: form.control,
9661
+ name: "company",
9662
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9663
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
9664
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9665
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9666
+ ] })
9667
+ }
9668
+ ),
9669
+ /* @__PURE__ */ jsxRuntime.jsx(
9670
+ Form$2.Field,
9671
+ {
9672
+ control: form.control,
9673
+ name: "address_1",
9674
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9675
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
9676
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9677
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9678
+ ] })
9679
+ }
9680
+ ),
9681
+ /* @__PURE__ */ jsxRuntime.jsx(
9682
+ Form$2.Field,
9683
+ {
9684
+ control: form.control,
9685
+ name: "address_2",
9686
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9687
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9688
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9689
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9690
+ ] })
9691
+ }
9692
+ ),
9693
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9694
+ /* @__PURE__ */ jsxRuntime.jsx(
9695
+ Form$2.Field,
9696
+ {
9697
+ control: form.control,
9698
+ name: "postal_code",
9699
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9700
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
9701
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9702
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9703
+ ] })
9704
+ }
9705
+ ),
9706
+ /* @__PURE__ */ jsxRuntime.jsx(
9707
+ Form$2.Field,
9708
+ {
9709
+ control: form.control,
9710
+ name: "city",
9711
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9712
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
9713
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9714
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9715
+ ] })
9716
+ }
9717
+ )
9718
+ ] }),
9719
+ /* @__PURE__ */ jsxRuntime.jsx(
9720
+ Form$2.Field,
9721
+ {
9722
+ control: form.control,
9723
+ name: "province",
9724
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9725
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9726
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9727
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9728
+ ] })
9729
+ }
9730
+ ),
9731
+ /* @__PURE__ */ jsxRuntime.jsx(
9732
+ Form$2.Field,
9733
+ {
9734
+ control: form.control,
9735
+ name: "phone",
9736
+ render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
9737
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
9738
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
9739
+ /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
9740
+ ] })
9741
+ }
9742
+ )
9743
+ ] }) }),
9744
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
9745
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9746
+ /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9747
+ ] }) })
9748
+ ]
9749
+ }
9750
+ ) });
9751
+ };
9752
+ const schema$5 = addressSchema;
9563
9753
  const Email = () => {
9564
9754
  const { id } = reactRouterDom.useParams();
9565
9755
  const { order, isPending, isError, error } = useOrder(id, {
@@ -9582,7 +9772,7 @@ const EmailForm = ({ order }) => {
9582
9772
  defaultValues: {
9583
9773
  email: order.email ?? ""
9584
9774
  },
9585
- resolver: zod.zodResolver(schema$5)
9775
+ resolver: zod.zodResolver(schema$4)
9586
9776
  });
9587
9777
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9588
9778
  const { handleSuccess } = useRouteModal();
@@ -9625,7 +9815,7 @@ const EmailForm = ({ order }) => {
9625
9815
  }
9626
9816
  ) });
9627
9817
  };
9628
- const schema$5 = objectType({
9818
+ const schema$4 = objectType({
9629
9819
  email: stringType().email()
9630
9820
  });
9631
9821
  const NumberInput = React.forwardRef(
@@ -10602,27 +10792,6 @@ const customItemSchema = objectType({
10602
10792
  quantity: numberType(),
10603
10793
  unit_price: unionType([numberType(), stringType()])
10604
10794
  });
10605
- const CustomItems = () => {
10606
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
10607
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Custom Items" }) }) }),
10608
- /* @__PURE__ */ jsxRuntime.jsx(CustomItemsForm, {})
10609
- ] });
10610
- };
10611
- const CustomItemsForm = () => {
10612
- const form = reactHookForm.useForm({
10613
- resolver: zod.zodResolver(schema$4)
10614
- });
10615
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
10616
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Body, {}),
10617
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
10618
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10619
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", children: "Save" })
10620
- ] }) })
10621
- ] }) });
10622
- };
10623
- const schema$4 = objectType({
10624
- email: stringType().email()
10625
- });
10626
10795
  const InlineTip = React.forwardRef(
10627
10796
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10628
10797
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -11356,209 +11525,6 @@ const SalesChannelField = ({ control, order }) => {
11356
11525
  const schema$3 = objectType({
11357
11526
  sales_channel_id: stringType().min(1)
11358
11527
  });
11359
- const ShippingAddress = () => {
11360
- const { id } = reactRouterDom.useParams();
11361
- const { order, isPending, isError, error } = useOrder(id, {
11362
- fields: "+shipping_address"
11363
- });
11364
- if (isError) {
11365
- throw error;
11366
- }
11367
- const isReady = !isPending && !!order;
11368
- return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
11369
- /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
11370
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Shipping Address" }) }),
11371
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
11372
- ] }),
11373
- isReady && /* @__PURE__ */ jsxRuntime.jsx(ShippingAddressForm, { order })
11374
- ] });
11375
- };
11376
- const ShippingAddressForm = ({ order }) => {
11377
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11378
- const form = reactHookForm.useForm({
11379
- defaultValues: {
11380
- first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
11381
- last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
11382
- company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
11383
- address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
11384
- address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
11385
- city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
11386
- province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
11387
- country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
11388
- postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
11389
- phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
11390
- },
11391
- resolver: zod.zodResolver(schema$2)
11392
- });
11393
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11394
- const { handleSuccess } = useRouteModal();
11395
- const onSubmit = form.handleSubmit(async (data) => {
11396
- await mutateAsync(
11397
- {
11398
- shipping_address: {
11399
- first_name: data.first_name,
11400
- last_name: data.last_name,
11401
- company: data.company,
11402
- address_1: data.address_1,
11403
- address_2: data.address_2,
11404
- city: data.city,
11405
- province: data.province,
11406
- country_code: data.country_code,
11407
- postal_code: data.postal_code,
11408
- phone: data.phone
11409
- }
11410
- },
11411
- {
11412
- onSuccess: () => {
11413
- handleSuccess();
11414
- },
11415
- onError: (error) => {
11416
- ui.toast.error(error.message);
11417
- }
11418
- }
11419
- );
11420
- });
11421
- return /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxRuntime.jsxs(
11422
- KeyboundForm,
11423
- {
11424
- className: "flex flex-1 flex-col overflow-hidden",
11425
- onSubmit,
11426
- children: [
11427
- /* @__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: [
11428
- /* @__PURE__ */ jsxRuntime.jsx(
11429
- Form$2.Field,
11430
- {
11431
- control: form.control,
11432
- name: "country_code",
11433
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11434
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Country" }),
11435
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(CountrySelect, { ...field }) }),
11436
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11437
- ] })
11438
- }
11439
- ),
11440
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11441
- /* @__PURE__ */ jsxRuntime.jsx(
11442
- Form$2.Field,
11443
- {
11444
- control: form.control,
11445
- name: "first_name",
11446
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11447
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "First name" }),
11448
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11449
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11450
- ] })
11451
- }
11452
- ),
11453
- /* @__PURE__ */ jsxRuntime.jsx(
11454
- Form$2.Field,
11455
- {
11456
- control: form.control,
11457
- name: "last_name",
11458
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11459
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Last name" }),
11460
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11461
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11462
- ] })
11463
- }
11464
- )
11465
- ] }),
11466
- /* @__PURE__ */ jsxRuntime.jsx(
11467
- Form$2.Field,
11468
- {
11469
- control: form.control,
11470
- name: "company",
11471
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11472
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Company" }),
11473
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11474
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11475
- ] })
11476
- }
11477
- ),
11478
- /* @__PURE__ */ jsxRuntime.jsx(
11479
- Form$2.Field,
11480
- {
11481
- control: form.control,
11482
- name: "address_1",
11483
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11484
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Address" }),
11485
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11486
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11487
- ] })
11488
- }
11489
- ),
11490
- /* @__PURE__ */ jsxRuntime.jsx(
11491
- Form$2.Field,
11492
- {
11493
- control: form.control,
11494
- name: "address_2",
11495
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11496
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11497
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11498
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11499
- ] })
11500
- }
11501
- ),
11502
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11503
- /* @__PURE__ */ jsxRuntime.jsx(
11504
- Form$2.Field,
11505
- {
11506
- control: form.control,
11507
- name: "postal_code",
11508
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11509
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "Postal code" }),
11510
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11511
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11512
- ] })
11513
- }
11514
- ),
11515
- /* @__PURE__ */ jsxRuntime.jsx(
11516
- Form$2.Field,
11517
- {
11518
- control: form.control,
11519
- name: "city",
11520
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11521
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { children: "City" }),
11522
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11523
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11524
- ] })
11525
- }
11526
- )
11527
- ] }),
11528
- /* @__PURE__ */ jsxRuntime.jsx(
11529
- Form$2.Field,
11530
- {
11531
- control: form.control,
11532
- name: "province",
11533
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11534
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11535
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11536
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11537
- ] })
11538
- }
11539
- ),
11540
- /* @__PURE__ */ jsxRuntime.jsx(
11541
- Form$2.Field,
11542
- {
11543
- control: form.control,
11544
- name: "phone",
11545
- render: ({ field }) => /* @__PURE__ */ jsxRuntime.jsxs(Form$2.Item, { children: [
11546
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Label, { optional: true, children: "Phone" }),
11547
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Input, { ...field }) }),
11548
- /* @__PURE__ */ jsxRuntime.jsx(Form$2.ErrorMessage, {})
11549
- ] })
11550
- }
11551
- )
11552
- ] }) }),
11553
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
11554
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11555
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11556
- ] }) })
11557
- ]
11558
- }
11559
- ) });
11560
- };
11561
- const schema$2 = addressSchema;
11562
11528
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
11563
11529
  const Shipping = () => {
11564
11530
  var _a;
@@ -12389,7 +12355,7 @@ const TransferOwnershipForm = ({ order }) => {
12389
12355
  defaultValues: {
12390
12356
  customer_id: order.customer_id || ""
12391
12357
  },
12392
- resolver: zod.zodResolver(schema$1)
12358
+ resolver: zod.zodResolver(schema$2)
12393
12359
  });
12394
12360
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12395
12361
  const { handleSuccess } = useRouteModal();
@@ -12839,13 +12805,13 @@ const Illustration = () => {
12839
12805
  }
12840
12806
  );
12841
12807
  };
12842
- const schema$1 = objectType({
12808
+ const schema$2 = objectType({
12843
12809
  customer_id: stringType().min(1)
12844
12810
  });
12845
- const BillingAddress = () => {
12811
+ const ShippingAddress = () => {
12846
12812
  const { id } = reactRouterDom.useParams();
12847
12813
  const { order, isPending, isError, error } = useOrder(id, {
12848
- fields: "+billing_address"
12814
+ fields: "+shipping_address"
12849
12815
  });
12850
12816
  if (isError) {
12851
12817
  throw error;
@@ -12853,34 +12819,47 @@ const BillingAddress = () => {
12853
12819
  const isReady = !isPending && !!order;
12854
12820
  return /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer, { children: [
12855
12821
  /* @__PURE__ */ jsxRuntime.jsxs(RouteDrawer.Header, { children: [
12856
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Billing Address" }) }),
12857
- /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12822
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Heading, { children: "Edit Shipping Address" }) }),
12823
+ /* @__PURE__ */ jsxRuntime.jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12858
12824
  ] }),
12859
- isReady && /* @__PURE__ */ jsxRuntime.jsx(BillingAddressForm, { order })
12825
+ isReady && /* @__PURE__ */ jsxRuntime.jsx(ShippingAddressForm, { order })
12860
12826
  ] });
12861
12827
  };
12862
- const BillingAddressForm = ({ order }) => {
12828
+ const ShippingAddressForm = ({ order }) => {
12863
12829
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12864
12830
  const form = reactHookForm.useForm({
12865
12831
  defaultValues: {
12866
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12867
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12868
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12869
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12870
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12871
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12872
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12873
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12874
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12875
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12832
+ first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12833
+ last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12834
+ company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12835
+ address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12836
+ address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12837
+ city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12838
+ province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12839
+ country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12840
+ postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12841
+ phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12876
12842
  },
12877
- resolver: zod.zodResolver(schema)
12843
+ resolver: zod.zodResolver(schema$1)
12878
12844
  });
12879
12845
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12880
12846
  const { handleSuccess } = useRouteModal();
12881
12847
  const onSubmit = form.handleSubmit(async (data) => {
12882
12848
  await mutateAsync(
12883
- { billing_address: data },
12849
+ {
12850
+ shipping_address: {
12851
+ first_name: data.first_name,
12852
+ last_name: data.last_name,
12853
+ company: data.company,
12854
+ address_1: data.address_1,
12855
+ address_2: data.address_2,
12856
+ city: data.city,
12857
+ province: data.province,
12858
+ country_code: data.country_code,
12859
+ postal_code: data.postal_code,
12860
+ phone: data.phone
12861
+ }
12862
+ },
12884
12863
  {
12885
12864
  onSuccess: () => {
12886
12865
  handleSuccess();
@@ -13031,7 +13010,28 @@ const BillingAddressForm = ({ order }) => {
13031
13010
  }
13032
13011
  ) });
13033
13012
  };
13034
- const schema = addressSchema;
13013
+ const schema$1 = addressSchema;
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: [
@@ -13052,6 +13052,10 @@ const routeModule = {
13052
13052
  handle,
13053
13053
  loader,
13054
13054
  children: [
13055
+ {
13056
+ Component: BillingAddress,
13057
+ path: "/draft-orders/:id/billing-address"
13058
+ },
13055
13059
  {
13056
13060
  Component: Email,
13057
13061
  path: "/draft-orders/:id/email"
@@ -13060,10 +13064,6 @@ const routeModule = {
13060
13064
  Component: Items,
13061
13065
  path: "/draft-orders/:id/items"
13062
13066
  },
13063
- {
13064
- Component: CustomItems,
13065
- path: "/draft-orders/:id/custom-items"
13066
- },
13067
13067
  {
13068
13068
  Component: Metadata,
13069
13069
  path: "/draft-orders/:id/metadata"
@@ -13076,10 +13076,6 @@ const routeModule = {
13076
13076
  Component: SalesChannel,
13077
13077
  path: "/draft-orders/:id/sales-channel"
13078
13078
  },
13079
- {
13080
- Component: ShippingAddress,
13081
- path: "/draft-orders/:id/shipping-address"
13082
- },
13083
13079
  {
13084
13080
  Component: Shipping,
13085
13081
  path: "/draft-orders/:id/shipping"
@@ -13089,8 +13085,12 @@ const routeModule = {
13089
13085
  path: "/draft-orders/:id/transfer-ownership"
13090
13086
  },
13091
13087
  {
13092
- Component: BillingAddress,
13093
- path: "/draft-orders/:id/billing-address"
13088
+ Component: ShippingAddress,
13089
+ path: "/draft-orders/:id/shipping-address"
13090
+ },
13091
+ {
13092
+ Component: CustomItems,
13093
+ path: "/draft-orders/:id/custom-items"
13094
13094
  }
13095
13095
  ]
13096
13096
  }
@@ -9554,6 +9554,196 @@ const ID = () => {
9554
9554
  /* @__PURE__ */ jsx(Outlet, {})
9555
9555
  ] });
9556
9556
  };
9557
+ const BillingAddress = () => {
9558
+ const { id } = useParams();
9559
+ const { order, isPending, isError, error } = useOrder(id, {
9560
+ fields: "+billing_address"
9561
+ });
9562
+ if (isError) {
9563
+ throw error;
9564
+ }
9565
+ const isReady = !isPending && !!order;
9566
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9567
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9568
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
9569
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9570
+ ] }),
9571
+ isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
9572
+ ] });
9573
+ };
9574
+ const BillingAddressForm = ({ order }) => {
9575
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9576
+ const form = useForm({
9577
+ defaultValues: {
9578
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9579
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9580
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9581
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9582
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9583
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9584
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9585
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9586
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9587
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9588
+ },
9589
+ resolver: zodResolver(schema$5)
9590
+ });
9591
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9592
+ const { handleSuccess } = useRouteModal();
9593
+ const onSubmit = form.handleSubmit(async (data) => {
9594
+ await mutateAsync(
9595
+ { billing_address: data },
9596
+ {
9597
+ onSuccess: () => {
9598
+ handleSuccess();
9599
+ },
9600
+ onError: (error) => {
9601
+ toast.error(error.message);
9602
+ }
9603
+ }
9604
+ );
9605
+ });
9606
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9607
+ KeyboundForm,
9608
+ {
9609
+ className: "flex flex-1 flex-col overflow-hidden",
9610
+ onSubmit,
9611
+ children: [
9612
+ /* @__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: [
9613
+ /* @__PURE__ */ jsx(
9614
+ Form$2.Field,
9615
+ {
9616
+ control: form.control,
9617
+ name: "country_code",
9618
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9619
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
9620
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
9621
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9622
+ ] })
9623
+ }
9624
+ ),
9625
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9626
+ /* @__PURE__ */ jsx(
9627
+ Form$2.Field,
9628
+ {
9629
+ control: form.control,
9630
+ name: "first_name",
9631
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9632
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
9633
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9634
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9635
+ ] })
9636
+ }
9637
+ ),
9638
+ /* @__PURE__ */ jsx(
9639
+ Form$2.Field,
9640
+ {
9641
+ control: form.control,
9642
+ name: "last_name",
9643
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9644
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
9645
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9646
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9647
+ ] })
9648
+ }
9649
+ )
9650
+ ] }),
9651
+ /* @__PURE__ */ jsx(
9652
+ Form$2.Field,
9653
+ {
9654
+ control: form.control,
9655
+ name: "company",
9656
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9657
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
9658
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9659
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9660
+ ] })
9661
+ }
9662
+ ),
9663
+ /* @__PURE__ */ jsx(
9664
+ Form$2.Field,
9665
+ {
9666
+ control: form.control,
9667
+ name: "address_1",
9668
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9669
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
9670
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9671
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9672
+ ] })
9673
+ }
9674
+ ),
9675
+ /* @__PURE__ */ jsx(
9676
+ Form$2.Field,
9677
+ {
9678
+ control: form.control,
9679
+ name: "address_2",
9680
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9681
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9682
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9683
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9684
+ ] })
9685
+ }
9686
+ ),
9687
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9688
+ /* @__PURE__ */ jsx(
9689
+ Form$2.Field,
9690
+ {
9691
+ control: form.control,
9692
+ name: "postal_code",
9693
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9694
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
9695
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9696
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9697
+ ] })
9698
+ }
9699
+ ),
9700
+ /* @__PURE__ */ jsx(
9701
+ Form$2.Field,
9702
+ {
9703
+ control: form.control,
9704
+ name: "city",
9705
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9706
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
9707
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9708
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9709
+ ] })
9710
+ }
9711
+ )
9712
+ ] }),
9713
+ /* @__PURE__ */ jsx(
9714
+ Form$2.Field,
9715
+ {
9716
+ control: form.control,
9717
+ name: "province",
9718
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9719
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9720
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9721
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9722
+ ] })
9723
+ }
9724
+ ),
9725
+ /* @__PURE__ */ jsx(
9726
+ Form$2.Field,
9727
+ {
9728
+ control: form.control,
9729
+ name: "phone",
9730
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9731
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
9732
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9733
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9734
+ ] })
9735
+ }
9736
+ )
9737
+ ] }) }),
9738
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9739
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9740
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9741
+ ] }) })
9742
+ ]
9743
+ }
9744
+ ) });
9745
+ };
9746
+ const schema$5 = addressSchema;
9557
9747
  const Email = () => {
9558
9748
  const { id } = useParams();
9559
9749
  const { order, isPending, isError, error } = useOrder(id, {
@@ -9576,7 +9766,7 @@ const EmailForm = ({ order }) => {
9576
9766
  defaultValues: {
9577
9767
  email: order.email ?? ""
9578
9768
  },
9579
- resolver: zodResolver(schema$5)
9769
+ resolver: zodResolver(schema$4)
9580
9770
  });
9581
9771
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9582
9772
  const { handleSuccess } = useRouteModal();
@@ -9619,7 +9809,7 @@ const EmailForm = ({ order }) => {
9619
9809
  }
9620
9810
  ) });
9621
9811
  };
9622
- const schema$5 = objectType({
9812
+ const schema$4 = objectType({
9623
9813
  email: stringType().email()
9624
9814
  });
9625
9815
  const NumberInput = forwardRef(
@@ -10596,27 +10786,6 @@ const customItemSchema = objectType({
10596
10786
  quantity: numberType(),
10597
10787
  unit_price: unionType([numberType(), stringType()])
10598
10788
  });
10599
- const CustomItems = () => {
10600
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
10601
- /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
10602
- /* @__PURE__ */ jsx(CustomItemsForm, {})
10603
- ] });
10604
- };
10605
- const CustomItemsForm = () => {
10606
- const form = useForm({
10607
- resolver: zodResolver(schema$4)
10608
- });
10609
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
10610
- /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
10611
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
10612
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
10613
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", children: "Save" })
10614
- ] }) })
10615
- ] }) });
10616
- };
10617
- const schema$4 = objectType({
10618
- email: stringType().email()
10619
- });
10620
10789
  const InlineTip = forwardRef(
10621
10790
  ({ variant = "tip", label, className, children, ...props }, ref) => {
10622
10791
  const labelValue = label || (variant === "warning" ? "Warning" : "Tip");
@@ -11350,209 +11519,6 @@ const SalesChannelField = ({ control, order }) => {
11350
11519
  const schema$3 = objectType({
11351
11520
  sales_channel_id: stringType().min(1)
11352
11521
  });
11353
- const ShippingAddress = () => {
11354
- const { id } = useParams();
11355
- const { order, isPending, isError, error } = useOrder(id, {
11356
- fields: "+shipping_address"
11357
- });
11358
- if (isError) {
11359
- throw error;
11360
- }
11361
- const isReady = !isPending && !!order;
11362
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
11363
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
11364
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
11365
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
11366
- ] }),
11367
- isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
11368
- ] });
11369
- };
11370
- const ShippingAddressForm = ({ order }) => {
11371
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11372
- const form = useForm({
11373
- defaultValues: {
11374
- first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
11375
- last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
11376
- company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
11377
- address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
11378
- address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
11379
- city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
11380
- province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
11381
- country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
11382
- postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
11383
- phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
11384
- },
11385
- resolver: zodResolver(schema$2)
11386
- });
11387
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11388
- const { handleSuccess } = useRouteModal();
11389
- const onSubmit = form.handleSubmit(async (data) => {
11390
- await mutateAsync(
11391
- {
11392
- shipping_address: {
11393
- first_name: data.first_name,
11394
- last_name: data.last_name,
11395
- company: data.company,
11396
- address_1: data.address_1,
11397
- address_2: data.address_2,
11398
- city: data.city,
11399
- province: data.province,
11400
- country_code: data.country_code,
11401
- postal_code: data.postal_code,
11402
- phone: data.phone
11403
- }
11404
- },
11405
- {
11406
- onSuccess: () => {
11407
- handleSuccess();
11408
- },
11409
- onError: (error) => {
11410
- toast.error(error.message);
11411
- }
11412
- }
11413
- );
11414
- });
11415
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11416
- KeyboundForm,
11417
- {
11418
- className: "flex flex-1 flex-col overflow-hidden",
11419
- onSubmit,
11420
- children: [
11421
- /* @__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: [
11422
- /* @__PURE__ */ jsx(
11423
- Form$2.Field,
11424
- {
11425
- control: form.control,
11426
- name: "country_code",
11427
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11428
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
11429
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
11430
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11431
- ] })
11432
- }
11433
- ),
11434
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11435
- /* @__PURE__ */ jsx(
11436
- Form$2.Field,
11437
- {
11438
- control: form.control,
11439
- name: "first_name",
11440
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11441
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
11442
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11443
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11444
- ] })
11445
- }
11446
- ),
11447
- /* @__PURE__ */ jsx(
11448
- Form$2.Field,
11449
- {
11450
- control: form.control,
11451
- name: "last_name",
11452
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11453
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
11454
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11455
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11456
- ] })
11457
- }
11458
- )
11459
- ] }),
11460
- /* @__PURE__ */ jsx(
11461
- Form$2.Field,
11462
- {
11463
- control: form.control,
11464
- name: "company",
11465
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11466
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
11467
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11468
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11469
- ] })
11470
- }
11471
- ),
11472
- /* @__PURE__ */ jsx(
11473
- Form$2.Field,
11474
- {
11475
- control: form.control,
11476
- name: "address_1",
11477
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11478
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
11479
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11480
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11481
- ] })
11482
- }
11483
- ),
11484
- /* @__PURE__ */ jsx(
11485
- Form$2.Field,
11486
- {
11487
- control: form.control,
11488
- name: "address_2",
11489
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11490
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11491
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11492
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11493
- ] })
11494
- }
11495
- ),
11496
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11497
- /* @__PURE__ */ jsx(
11498
- Form$2.Field,
11499
- {
11500
- control: form.control,
11501
- name: "postal_code",
11502
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11503
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
11504
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11505
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11506
- ] })
11507
- }
11508
- ),
11509
- /* @__PURE__ */ jsx(
11510
- Form$2.Field,
11511
- {
11512
- control: form.control,
11513
- name: "city",
11514
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11515
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
11516
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11517
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11518
- ] })
11519
- }
11520
- )
11521
- ] }),
11522
- /* @__PURE__ */ jsx(
11523
- Form$2.Field,
11524
- {
11525
- control: form.control,
11526
- name: "province",
11527
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11528
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11529
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11530
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11531
- ] })
11532
- }
11533
- ),
11534
- /* @__PURE__ */ jsx(
11535
- Form$2.Field,
11536
- {
11537
- control: form.control,
11538
- name: "phone",
11539
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11540
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
11541
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11542
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11543
- ] })
11544
- }
11545
- )
11546
- ] }) }),
11547
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
11548
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11549
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11550
- ] }) })
11551
- ]
11552
- }
11553
- ) });
11554
- };
11555
- const schema$2 = addressSchema;
11556
11522
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
11557
11523
  const Shipping = () => {
11558
11524
  var _a;
@@ -12383,7 +12349,7 @@ const TransferOwnershipForm = ({ order }) => {
12383
12349
  defaultValues: {
12384
12350
  customer_id: order.customer_id || ""
12385
12351
  },
12386
- resolver: zodResolver(schema$1)
12352
+ resolver: zodResolver(schema$2)
12387
12353
  });
12388
12354
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12389
12355
  const { handleSuccess } = useRouteModal();
@@ -12833,13 +12799,13 @@ const Illustration = () => {
12833
12799
  }
12834
12800
  );
12835
12801
  };
12836
- const schema$1 = objectType({
12802
+ const schema$2 = objectType({
12837
12803
  customer_id: stringType().min(1)
12838
12804
  });
12839
- const BillingAddress = () => {
12805
+ const ShippingAddress = () => {
12840
12806
  const { id } = useParams();
12841
12807
  const { order, isPending, isError, error } = useOrder(id, {
12842
- fields: "+billing_address"
12808
+ fields: "+shipping_address"
12843
12809
  });
12844
12810
  if (isError) {
12845
12811
  throw error;
@@ -12847,34 +12813,47 @@ const BillingAddress = () => {
12847
12813
  const isReady = !isPending && !!order;
12848
12814
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12849
12815
  /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12850
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
12851
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12816
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
12817
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12852
12818
  ] }),
12853
- isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
12819
+ isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
12854
12820
  ] });
12855
12821
  };
12856
- const BillingAddressForm = ({ order }) => {
12822
+ const ShippingAddressForm = ({ order }) => {
12857
12823
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12858
12824
  const form = useForm({
12859
12825
  defaultValues: {
12860
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12861
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12862
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12863
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12864
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12865
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12866
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12867
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12868
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12869
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12826
+ first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12827
+ last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12828
+ company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12829
+ address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12830
+ address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12831
+ city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12832
+ province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12833
+ country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12834
+ postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12835
+ phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12870
12836
  },
12871
- resolver: zodResolver(schema)
12837
+ resolver: zodResolver(schema$1)
12872
12838
  });
12873
12839
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12874
12840
  const { handleSuccess } = useRouteModal();
12875
12841
  const onSubmit = form.handleSubmit(async (data) => {
12876
12842
  await mutateAsync(
12877
- { billing_address: data },
12843
+ {
12844
+ shipping_address: {
12845
+ first_name: data.first_name,
12846
+ last_name: data.last_name,
12847
+ company: data.company,
12848
+ address_1: data.address_1,
12849
+ address_2: data.address_2,
12850
+ city: data.city,
12851
+ province: data.province,
12852
+ country_code: data.country_code,
12853
+ postal_code: data.postal_code,
12854
+ phone: data.phone
12855
+ }
12856
+ },
12878
12857
  {
12879
12858
  onSuccess: () => {
12880
12859
  handleSuccess();
@@ -13025,7 +13004,28 @@ const BillingAddressForm = ({ order }) => {
13025
13004
  }
13026
13005
  ) });
13027
13006
  };
13028
- const schema = addressSchema;
13007
+ const schema$1 = addressSchema;
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: [
@@ -13046,6 +13046,10 @@ const routeModule = {
13046
13046
  handle,
13047
13047
  loader,
13048
13048
  children: [
13049
+ {
13050
+ Component: BillingAddress,
13051
+ path: "/draft-orders/:id/billing-address"
13052
+ },
13049
13053
  {
13050
13054
  Component: Email,
13051
13055
  path: "/draft-orders/:id/email"
@@ -13054,10 +13058,6 @@ const routeModule = {
13054
13058
  Component: Items,
13055
13059
  path: "/draft-orders/:id/items"
13056
13060
  },
13057
- {
13058
- Component: CustomItems,
13059
- path: "/draft-orders/:id/custom-items"
13060
- },
13061
13061
  {
13062
13062
  Component: Metadata,
13063
13063
  path: "/draft-orders/:id/metadata"
@@ -13070,10 +13070,6 @@ const routeModule = {
13070
13070
  Component: SalesChannel,
13071
13071
  path: "/draft-orders/:id/sales-channel"
13072
13072
  },
13073
- {
13074
- Component: ShippingAddress,
13075
- path: "/draft-orders/:id/shipping-address"
13076
- },
13077
13073
  {
13078
13074
  Component: Shipping,
13079
13075
  path: "/draft-orders/:id/shipping"
@@ -13083,8 +13079,12 @@ const routeModule = {
13083
13079
  path: "/draft-orders/:id/transfer-ownership"
13084
13080
  },
13085
13081
  {
13086
- Component: BillingAddress,
13087
- path: "/draft-orders/:id/billing-address"
13082
+ Component: ShippingAddress,
13083
+ path: "/draft-orders/:id/shipping-address"
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.2-preview-20250901150144",
3
+ "version": "2.10.2-preview-20250901180147",
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.2-preview-20250901150144",
39
+ "@medusajs/js-sdk": "2.10.2-preview-20250901180147",
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.2-preview-20250901150144",
49
- "@medusajs/cli": "2.10.2-preview-20250901150144",
50
- "@medusajs/framework": "2.10.2-preview-20250901150144",
51
- "@medusajs/icons": "2.10.2-preview-20250901150144",
52
- "@medusajs/test-utils": "2.10.2-preview-20250901150144",
53
- "@medusajs/types": "2.10.2-preview-20250901150144",
54
- "@medusajs/ui": "4.0.22-preview-20250901150144",
55
- "@medusajs/ui-preset": "2.10.2-preview-20250901150144",
48
+ "@medusajs/admin-sdk": "2.10.2-preview-20250901180147",
49
+ "@medusajs/cli": "2.10.2-preview-20250901180147",
50
+ "@medusajs/framework": "2.10.2-preview-20250901180147",
51
+ "@medusajs/icons": "2.10.2-preview-20250901180147",
52
+ "@medusajs/test-utils": "2.10.2-preview-20250901180147",
53
+ "@medusajs/types": "2.10.2-preview-20250901180147",
54
+ "@medusajs/ui": "4.0.22-preview-20250901180147",
55
+ "@medusajs/ui-preset": "2.10.2-preview-20250901180147",
56
56
  "@mikro-orm/cli": "6.4.3",
57
57
  "@mikro-orm/core": "6.4.3",
58
58
  "@mikro-orm/knex": "6.4.3",
@@ -76,12 +76,12 @@
76
76
  "yalc": "^1.0.0-pre.53"
77
77
  },
78
78
  "peerDependencies": {
79
- "@medusajs/admin-sdk": "2.10.2-preview-20250901150144",
80
- "@medusajs/cli": "2.10.2-preview-20250901150144",
81
- "@medusajs/framework": "2.10.2-preview-20250901150144",
82
- "@medusajs/icons": "2.10.2-preview-20250901150144",
83
- "@medusajs/test-utils": "2.10.2-preview-20250901150144",
84
- "@medusajs/ui": "4.0.22-preview-20250901150144",
79
+ "@medusajs/admin-sdk": "2.10.2-preview-20250901180147",
80
+ "@medusajs/cli": "2.10.2-preview-20250901180147",
81
+ "@medusajs/framework": "2.10.2-preview-20250901180147",
82
+ "@medusajs/icons": "2.10.2-preview-20250901180147",
83
+ "@medusajs/test-utils": "2.10.2-preview-20250901180147",
84
+ "@medusajs/ui": "4.0.22-preview-20250901180147",
85
85
  "@mikro-orm/cli": "6.4.3",
86
86
  "@mikro-orm/core": "6.4.3",
87
87
  "@mikro-orm/knex": "6.4.3",