@mercurjs/admin 2.0.0-canary.49 → 2.0.0-canary.51

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.
Files changed (22) hide show
  1. package/dist/{chunk-QEKAZOEP.js → chunk-35NDMIYZ.js} +1 -1
  2. package/dist/{chunk-RSD4YTV4.js → chunk-ENFPVLPQ.js} +1 -1
  3. package/dist/{chunk-YPNZSNDC.js → chunk-RZRNNY37.js} +4 -1
  4. package/dist/{chunk-FNXSMFGL.js → chunk-W2EXLFNP.js} +2 -2
  5. package/dist/{constants-RstItOZv.d.ts → constants-CAwtRicB.d.ts} +2 -2
  6. package/dist/{customer-detail-NIWR7ZG6.js → customer-detail-LDGJH3CY.js} +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +24 -16
  9. package/dist/pages/index.d.ts +2 -2
  10. package/dist/pages/index.js +4 -4
  11. package/dist/{product-attributes-NG4OSBIV.js → product-attributes-FBATOL6Z.js} +4 -1
  12. package/dist/{product-create-option-AHDAKWNR.js → product-create-option-QOSF45LU.js} +4 -1
  13. package/dist/{product-create-variant-FYKETHK6.js → product-create-variant-GCMWR5HY.js} +2 -1
  14. package/dist/{product-detail-ZILZCBHP.js → product-detail-YRNJ7DIG.js} +2 -2
  15. package/dist/{product-edit-QGRKGJ3H.js → product-edit-H53OL43R.js} +4 -1
  16. package/dist/{product-edit-option-JEEROY34.js → product-edit-option-QDZEXWI4.js} +4 -1
  17. package/dist/{product-media-YMFP6Q6A.js → product-media-2OWIHPR3.js} +4 -1
  18. package/dist/{product-metadata-2MTZOLJO.js → product-metadata-DEWKK4BN.js} +4 -1
  19. package/dist/{product-organization-EFXWECYB.js → product-organization-K5URWNAI.js} +1 -1
  20. package/dist/{product-sales-channels-2PVBPK6W.js → product-sales-channels-GRVDE7YZ.js} +4 -1
  21. package/dist/{product-shipping-profile-LOWLCB56.js → product-shipping-profile-XK3DQBDT.js} +4 -1
  22. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  // src/pages/products/constants.ts
2
- var PRODUCT_DETAIL_FIELDS = "*seller,*categories";
2
+ var PRODUCT_DETAIL_FIELDS = "*seller,*categories,*shipping_profile,-variants";
3
3
  var PRODUCT_DETAIL_QUERY = { fields: PRODUCT_DETAIL_FIELDS };
4
4
 
5
5
  export {
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-3XPXUIK3.js";
16
16
  import {
17
17
  PRODUCT_DETAIL_QUERY
18
- } from "./chunk-QEKAZOEP.js";
18
+ } from "./chunk-35NDMIYZ.js";
19
19
  import {
20
20
  TwoColumnPage
21
21
  } from "./chunk-V5J73NPW.js";
@@ -1,3 +1,6 @@
1
+ import {
2
+ PRODUCT_DETAIL_QUERY
3
+ } from "./chunk-35NDMIYZ.js";
1
4
  import {
2
5
  DataGrid,
3
6
  createDataGridHelper,
@@ -650,7 +653,7 @@ var CreateProductVariantForm = ({
650
653
  import { jsx as jsx5 } from "react/jsx-runtime";
651
654
  var Root = ({ children }) => {
652
655
  const { id } = useParams();
653
- const { product, isLoading, isError, error } = useProduct(id);
656
+ const { product, isLoading, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
654
657
  if (isError) {
655
658
  throw error;
656
659
  }
@@ -494,9 +494,9 @@ var CustomerOrderSection = ({
494
494
  });
495
495
  const { orders, count, isLoading, isError, error } = useOrders(
496
496
  {
497
+ ...searchParams,
497
498
  customer_id: customer.id,
498
- fields: DEFAULT_FIELDS + "," + DEFAULT_RELATIONS,
499
- ...searchParams
499
+ fields: DEFAULT_FIELDS + "," + DEFAULT_RELATIONS
500
500
  },
501
501
  {
502
502
  placeholderData: keepPreviousData2
@@ -34,9 +34,9 @@ declare const defineTabMeta: <T extends FieldValues = FieldValues>(meta: TabDefi
34
34
  * Missing from Medusa defaults: *categories
35
35
  * Mercur custom links: *seller
36
36
  */
37
- declare const PRODUCT_DETAIL_FIELDS = "*seller,*categories";
37
+ declare const PRODUCT_DETAIL_FIELDS = "*seller,*categories,*shipping_profile,-variants";
38
38
  declare const PRODUCT_DETAIL_QUERY: {
39
- readonly fields: "*seller,*categories";
39
+ readonly fields: "*seller,*categories,*shipping_profile,-variants";
40
40
  };
41
41
 
42
42
  export { PRODUCT_DETAIL_FIELDS as P, type TabDefinition as T, PRODUCT_DETAIL_QUERY as a, defineTabMeta as d };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CustomerDetailPage
3
- } from "./chunk-FNXSMFGL.js";
3
+ } from "./chunk-W2EXLFNP.js";
4
4
  import "./chunk-DBYUB2YI.js";
5
5
  import "./chunk-54EPH67T.js";
6
6
  import "./chunk-NOWUEJ74.js";
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ import * as react from 'react';
3
3
  import react__default, { ReactNode, PropsWithChildren } from 'react';
4
4
  import * as react_hook_form from 'react-hook-form';
5
5
  import { FieldValues, UseFormReturn, FieldPath, ControllerProps } from 'react-hook-form';
6
- import { T as TabDefinition } from './constants-RstItOZv.js';
7
- export { P as PRODUCT_DETAIL_FIELDS, a as PRODUCT_DETAIL_QUERY, d as defineTabMeta } from './constants-RstItOZv.js';
6
+ import { T as TabDefinition } from './constants-CAwtRicB.js';
7
+ export { P as PRODUCT_DETAIL_FIELDS, a as PRODUCT_DETAIL_QUERY, d as defineTabMeta } from './constants-CAwtRicB.js';
8
8
  import { Label, Slot } from 'radix-ui';
9
9
  import * as _tanstack_react_table from '@tanstack/react-table';
10
10
  import { Table, ColumnDef, Row, RowSelectionState, OnChangeFn } from '@tanstack/react-table';
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import "./chunk-JRTZWK77.js";
16
16
  import {
17
17
  PRODUCT_DETAIL_FIELDS,
18
18
  PRODUCT_DETAIL_QUERY
19
- } from "./chunk-QEKAZOEP.js";
19
+ } from "./chunk-35NDMIYZ.js";
20
20
  import {
21
21
  Thumbnail
22
22
  } from "./chunk-WIYFXWRI.js";
@@ -1629,6 +1629,14 @@ var NavItem = ({
1629
1629
  }) => {
1630
1630
  if (["core", "setting"].includes(type)) {
1631
1631
  isActive = pathname.startsWith(to2);
1632
+ if (isActive && !isNested && items?.length) {
1633
+ const nestedMatch = items.some(
1634
+ (item) => pathname.startsWith(item.to)
1635
+ );
1636
+ if (nestedMatch) {
1637
+ isActive = false;
1638
+ }
1639
+ }
1632
1640
  }
1633
1641
  return clx2(BASE_NAV_LINK_CLASSES, {
1634
1642
  [NESTED_NAV_LINK_CLASSES]: isNested,
@@ -1636,7 +1644,7 @@ var NavItem = ({
1636
1644
  [SETTING_NAV_LINK_CLASSES]: isSetting2
1637
1645
  });
1638
1646
  },
1639
- [type, pathname]
1647
+ [type, pathname, items]
1640
1648
  );
1641
1649
  const isSetting = type === "setting";
1642
1650
  return /* @__PURE__ */ jsxs3(
@@ -3315,7 +3323,7 @@ function getRouteMap({
3315
3323
  path: ":id",
3316
3324
  errorElement: /* @__PURE__ */ jsx15(ErrorBoundary, {}),
3317
3325
  lazy: async () => {
3318
- const { Breadcrumb, loader } = await import("./product-detail-ZILZCBHP.js");
3326
+ const { Breadcrumb, loader } = await import("./product-detail-YRNJ7DIG.js");
3319
3327
  return {
3320
3328
  Component: Outlet4,
3321
3329
  loader,
@@ -3327,11 +3335,11 @@ function getRouteMap({
3327
3335
  children: [
3328
3336
  {
3329
3337
  path: "",
3330
- lazy: () => import("./product-detail-ZILZCBHP.js"),
3338
+ lazy: () => import("./product-detail-YRNJ7DIG.js"),
3331
3339
  children: [
3332
3340
  {
3333
3341
  path: "edit",
3334
- lazy: () => import("./product-edit-QGRKGJ3H.js")
3342
+ lazy: () => import("./product-edit-H53OL43R.js")
3335
3343
  },
3336
3344
  {
3337
3345
  path: "edit-variant",
@@ -3339,23 +3347,23 @@ function getRouteMap({
3339
3347
  },
3340
3348
  {
3341
3349
  path: "sales-channels",
3342
- lazy: () => import("./product-sales-channels-2PVBPK6W.js")
3350
+ lazy: () => import("./product-sales-channels-GRVDE7YZ.js")
3343
3351
  },
3344
3352
  {
3345
3353
  path: "attributes",
3346
- lazy: () => import("./product-attributes-NG4OSBIV.js")
3354
+ lazy: () => import("./product-attributes-FBATOL6Z.js")
3347
3355
  },
3348
3356
  {
3349
3357
  path: "organization",
3350
- lazy: () => import("./product-organization-EFXWECYB.js")
3358
+ lazy: () => import("./product-organization-K5URWNAI.js")
3351
3359
  },
3352
3360
  {
3353
3361
  path: "shipping-profile",
3354
- lazy: () => import("./product-shipping-profile-LOWLCB56.js")
3362
+ lazy: () => import("./product-shipping-profile-XK3DQBDT.js")
3355
3363
  },
3356
3364
  {
3357
3365
  path: "media",
3358
- lazy: () => import("./product-media-YMFP6Q6A.js")
3366
+ lazy: () => import("./product-media-2OWIHPR3.js")
3359
3367
  },
3360
3368
  {
3361
3369
  path: "prices",
@@ -3363,15 +3371,15 @@ function getRouteMap({
3363
3371
  },
3364
3372
  {
3365
3373
  path: "options/create",
3366
- lazy: () => import("./product-create-option-AHDAKWNR.js")
3374
+ lazy: () => import("./product-create-option-QOSF45LU.js")
3367
3375
  },
3368
3376
  {
3369
3377
  path: "options/:option_id/edit",
3370
- lazy: () => import("./product-edit-option-JEEROY34.js")
3378
+ lazy: () => import("./product-edit-option-QDZEXWI4.js")
3371
3379
  },
3372
3380
  {
3373
3381
  path: "variants/create",
3374
- lazy: () => import("./product-create-variant-FYKETHK6.js")
3382
+ lazy: () => import("./product-create-variant-GCMWR5HY.js")
3375
3383
  },
3376
3384
  {
3377
3385
  path: "stock",
@@ -3379,7 +3387,7 @@ function getRouteMap({
3379
3387
  },
3380
3388
  {
3381
3389
  path: "metadata/edit",
3382
- lazy: () => import("./product-metadata-2MTZOLJO.js")
3390
+ lazy: () => import("./product-metadata-DEWKK4BN.js")
3383
3391
  }
3384
3392
  ]
3385
3393
  },
@@ -3807,7 +3815,7 @@ function getRouteMap({
3807
3815
  {
3808
3816
  path: ":id",
3809
3817
  lazy: async () => {
3810
- const { Breadcrumb, loader } = await import("./customer-detail-NIWR7ZG6.js");
3818
+ const { Breadcrumb, loader } = await import("./customer-detail-LDGJH3CY.js");
3811
3819
  return {
3812
3820
  Component: Outlet4,
3813
3821
  loader,
@@ -3819,7 +3827,7 @@ function getRouteMap({
3819
3827
  children: [
3820
3828
  {
3821
3829
  path: "",
3822
- lazy: () => import("./customer-detail-NIWR7ZG6.js"),
3830
+ lazy: () => import("./customer-detail-LDGJH3CY.js"),
3823
3831
  children: [
3824
3832
  {
3825
3833
  path: "edit",
@@ -5,8 +5,8 @@ import * as _medusajs_types from '@medusajs/types';
5
5
  import { HttpTypes } from '@medusajs/types';
6
6
  import * as react_hook_form from 'react-hook-form';
7
7
  import { DeepPartial } from 'react-hook-form';
8
- import { T as TabDefinition } from '../constants-RstItOZv.js';
9
- export { P as PRODUCT_DETAIL_FIELDS, a as PRODUCT_DETAIL_QUERY } from '../constants-RstItOZv.js';
8
+ import { T as TabDefinition } from '../constants-CAwtRicB.js';
9
+ export { P as PRODUCT_DETAIL_FIELDS, a as PRODUCT_DETAIL_QUERY } from '../constants-CAwtRicB.js';
10
10
  import * as zod from 'zod';
11
11
  import { z } from 'zod';
12
12
  import * as _mercurjs_types from '@mercurjs/types';
@@ -146,7 +146,7 @@ import {
146
146
  import "../chunk-QG6PLWNH.js";
147
147
  import {
148
148
  CustomerDetailPage
149
- } from "../chunk-FNXSMFGL.js";
149
+ } from "../chunk-W2EXLFNP.js";
150
150
  import "../chunk-DBYUB2YI.js";
151
151
  import {
152
152
  PriceListListPage
@@ -239,7 +239,7 @@ import "../chunk-Y456KVIN.js";
239
239
  import {
240
240
  CreateProductVariantSchema,
241
241
  ProductCreateVariantPage
242
- } from "../chunk-YPNZSNDC.js";
242
+ } from "../chunk-RZRNNY37.js";
243
243
  import {
244
244
  ProductVariantDetailPage
245
245
  } from "../chunk-NXKCVD5F.js";
@@ -248,7 +248,7 @@ import "../chunk-7AV5EJJ5.js";
248
248
  import "../chunk-WCEMRNW4.js";
249
249
  import {
250
250
  ProductDetailPage
251
- } from "../chunk-RSD4YTV4.js";
251
+ } from "../chunk-ENFPVLPQ.js";
252
252
  import "../chunk-4GPAS5GW.js";
253
253
  import "../chunk-U2EI2ZLM.js";
254
254
  import "../chunk-W6Y3PPU5.js";
@@ -264,7 +264,7 @@ import "../chunk-JRTZWK77.js";
264
264
  import {
265
265
  PRODUCT_DETAIL_FIELDS,
266
266
  PRODUCT_DETAIL_QUERY
267
- } from "../chunk-QEKAZOEP.js";
267
+ } from "../chunk-35NDMIYZ.js";
268
268
  import {
269
269
  ProductListPage
270
270
  } from "../chunk-XHVYNMTA.js";
@@ -3,6 +3,9 @@ import {
3
3
  CountrySelect
4
4
  } from "./chunk-V74Y5NIV.js";
5
5
  import "./chunk-JRTZWK77.js";
6
+ import {
7
+ PRODUCT_DETAIL_QUERY
8
+ } from "./chunk-35NDMIYZ.js";
6
9
  import "./chunk-TKGWSUEI.js";
7
10
  import {
8
11
  KeyboundForm
@@ -338,7 +341,7 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
338
341
  var ProductAttributes = () => {
339
342
  const { id } = useParams();
340
343
  const { t } = useTranslation2();
341
- const { product, isLoading, isError, error } = useProduct(id);
344
+ const { product, isLoading, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
342
345
  if (isError) {
343
346
  throw error;
344
347
  }
@@ -1,3 +1,6 @@
1
+ import {
2
+ PRODUCT_DETAIL_QUERY
3
+ } from "./chunk-35NDMIYZ.js";
1
4
  import {
2
5
  ChipInput
3
6
  } from "./chunk-NCYTM57J.js";
@@ -131,7 +134,7 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
131
134
  var ProductCreateOption = () => {
132
135
  const { id } = useParams();
133
136
  const { t } = useTranslation2();
134
- const { product, isLoading, isError, error } = useProduct(id);
137
+ const { product, isLoading, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
135
138
  if (isError) {
136
139
  throw error;
137
140
  }
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  ProductCreateVariant
3
- } from "./chunk-YPNZSNDC.js";
3
+ } from "./chunk-RZRNNY37.js";
4
+ import "./chunk-35NDMIYZ.js";
4
5
  import "./chunk-U3OWJE7V.js";
5
6
  import "./chunk-IQPN4PZJ.js";
6
7
  import "./chunk-AEFDAU3Y.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ProductDetailPage
3
- } from "./chunk-RSD4YTV4.js";
3
+ } from "./chunk-ENFPVLPQ.js";
4
4
  import "./chunk-4GPAS5GW.js";
5
5
  import "./chunk-U2EI2ZLM.js";
6
6
  import "./chunk-W6Y3PPU5.js";
@@ -11,7 +11,7 @@ import "./chunk-3XPXUIK3.js";
11
11
  import "./chunk-JRTZWK77.js";
12
12
  import {
13
13
  PRODUCT_DETAIL_QUERY
14
- } from "./chunk-QEKAZOEP.js";
14
+ } from "./chunk-35NDMIYZ.js";
15
15
  import "./chunk-V5J73NPW.js";
16
16
  import "./chunk-XIZLPYEE.js";
17
17
  import "./chunk-54RTJBYO.js";
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  transformNullableFormData
3
3
  } from "./chunk-7RPRNVBS.js";
4
+ import {
5
+ PRODUCT_DETAIL_QUERY
6
+ } from "./chunk-35NDMIYZ.js";
4
7
  import "./chunk-SMQT3ZNO.js";
5
8
  import {
6
9
  SwitchBox
@@ -374,7 +377,7 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
374
377
  var ProductEdit = () => {
375
378
  const { id } = useParams();
376
379
  const { t } = useTranslation2();
377
- const { product, isLoading, isError, error } = useProduct(id);
380
+ const { product, isLoading, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
378
381
  if (isError) {
379
382
  throw error;
380
383
  }
@@ -1,3 +1,6 @@
1
+ import {
2
+ PRODUCT_DETAIL_QUERY
3
+ } from "./chunk-35NDMIYZ.js";
1
4
  import {
2
5
  ChipInput
3
6
  } from "./chunk-NCYTM57J.js";
@@ -135,7 +138,7 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
135
138
  var ProductEditOption = () => {
136
139
  const { id, option_id } = useParams();
137
140
  const { t } = useTranslation2();
138
- const { product, isPending, isFetching, isError, error } = useProduct(id);
141
+ const { product, isPending, isFetching, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
139
142
  const option = product?.options?.find((o) => o.id === option_id);
140
143
  if (!isPending && !isFetching && !option) {
141
144
  throw new Response(JSON.stringify({ message: `An option with ID ${option_id} was not found` }), { status: 404, headers: { "Content-Type": "application/json" } });
@@ -1,3 +1,6 @@
1
+ import {
2
+ PRODUCT_DETAIL_QUERY
3
+ } from "./chunk-35NDMIYZ.js";
1
4
  import {
2
5
  EditProductMediaSchema,
3
6
  UploadMediaFormItem
@@ -864,7 +867,7 @@ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
864
867
  var ProductMedia = () => {
865
868
  const { t } = useTranslation3();
866
869
  const { id } = useParams();
867
- const { product, isLoading, isError, error } = useProduct(id);
870
+ const { product, isLoading, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
868
871
  const ready = !isLoading && product;
869
872
  if (isError) {
870
873
  throw error;
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  MetadataForm
3
3
  } from "./chunk-B44E3LJT.js";
4
+ import {
5
+ PRODUCT_DETAIL_QUERY
6
+ } from "./chunk-35NDMIYZ.js";
4
7
  import "./chunk-TKGWSUEI.js";
5
8
  import "./chunk-U2ZFCAPX.js";
6
9
  import "./chunk-INNFZYX2.js";
@@ -51,7 +54,7 @@ import { ClientError } from "@mercurjs/client";
51
54
  import { jsx } from "react/jsx-runtime";
52
55
  var ProductMetadata = () => {
53
56
  const { id } = useParams();
54
- const { product, isPending, isError, error } = useProduct(id);
57
+ const { product, isPending, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
55
58
  const { mutateAsync, isPending: isMutating } = useUpdateProduct(id);
56
59
  if (isError) {
57
60
  throw error;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PRODUCT_DETAIL_QUERY
3
- } from "./chunk-QEKAZOEP.js";
3
+ } from "./chunk-35NDMIYZ.js";
4
4
  import {
5
5
  CategoryCombobox
6
6
  } from "./chunk-P7G4RY2J.js";
@@ -1,3 +1,6 @@
1
+ import {
2
+ PRODUCT_DETAIL_QUERY
3
+ } from "./chunk-35NDMIYZ.js";
1
4
  import {
2
5
  useSalesChannelTableColumns,
3
6
  useSalesChannelTableEmptyState,
@@ -147,7 +150,7 @@ var useColumns = () => {
147
150
  import { jsx as jsx2 } from "react/jsx-runtime";
148
151
  var ProductSalesChannels = () => {
149
152
  const { id } = useParams();
150
- const { product, isLoading, isError, error } = useProduct(id);
153
+ const { product, isLoading, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
151
154
  if (isError) {
152
155
  throw error;
153
156
  }
@@ -1,3 +1,6 @@
1
+ import {
2
+ PRODUCT_DETAIL_QUERY
3
+ } from "./chunk-35NDMIYZ.js";
1
4
  import {
2
5
  useComboboxData
3
6
  } from "./chunk-AEFDAU3Y.js";
@@ -126,7 +129,7 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
126
129
  var ProductShippingProfile = () => {
127
130
  const { id } = useParams();
128
131
  const { t } = useTranslation2();
129
- const { product, isLoading, isError, error } = useProduct(id);
132
+ const { product, isLoading, isError, error } = useProduct(id, PRODUCT_DETAIL_QUERY);
130
133
  if (isError) {
131
134
  throw error;
132
135
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/admin",
3
- "version": "2.0.0-canary.49",
3
+ "version": "2.0.0-canary.51",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",