@mercurjs/admin 2.3.2-canary.0 → 2.3.2-canary.2

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 (72) hide show
  1. package/dist/{add-campaign-promotions-S4HKMFU7.js → add-campaign-promotions-DAJLAYTG.js} +3 -3
  2. package/dist/{api-key-management-list-AHXOCLBO.js → api-key-management-list-P4FQQKIV.js} +1 -1
  3. package/dist/{attribute-list-6ELFWDHO.js → attribute-list-PVC4KUYQ.js} +1 -1
  4. package/dist/{campaign-detail-WPTZDDD5.js → campaign-detail-V6RISO2Y.js} +4 -4
  5. package/dist/{campaign-list-7L2DGBHW.js → campaign-list-WFFH3VPJ.js} +1 -1
  6. package/dist/{category-list-3IL2MERS.js → category-list-RBFOTJFJ.js} +1 -1
  7. package/dist/{chunk-CR7TRBEB.js → chunk-2YEBREEY.js} +2 -1
  8. package/dist/chunk-4F6SHS7A.js +83 -0
  9. package/dist/{chunk-EAZ6YM6D.js → chunk-5SDHNLEC.js} +2 -1
  10. package/dist/{chunk-NKZLCOFU.js → chunk-6DBL7KIL.js} +1 -1
  11. package/dist/{chunk-ZBRRK3Y6.js → chunk-AB34V74P.js} +3 -2
  12. package/dist/{chunk-6ZVRNI5K.js → chunk-AMKTWSOZ.js} +1 -1
  13. package/dist/{chunk-7PGZV6DQ.js → chunk-BNYVXSFC.js} +1 -1
  14. package/dist/{chunk-H7HNJFQA.js → chunk-CGT2IRFI.js} +1 -1
  15. package/dist/{chunk-N3ZYLAGA.js → chunk-GQ45JPQR.js} +3 -2
  16. package/dist/{chunk-VKVK5D2F.js → chunk-GVKW5SUK.js} +3 -2
  17. package/dist/{chunk-UGDC6FPU.js → chunk-JIVTFB67.js} +2 -1
  18. package/dist/{chunk-23KZGNNG.js → chunk-KHMHTJZG.js} +2 -1
  19. package/dist/{chunk-NN6PSWE4.js → chunk-MUSHUJHY.js} +56 -1
  20. package/dist/{chunk-LAIT7Y53.js → chunk-NO64DRH4.js} +25 -7
  21. package/dist/{chunk-AJNXQUOR.js → chunk-O56RWFFI.js} +3 -2
  22. package/dist/{chunk-OJQSOFYG.js → chunk-PC5GU4HP.js} +2 -1
  23. package/dist/{chunk-6XJUYY6G.js → chunk-R3E7BMQB.js} +1 -1
  24. package/dist/{chunk-IP5YNQ5R.js → chunk-RQCYGC2H.js} +3 -2
  25. package/dist/{chunk-EF23N7II.js → chunk-S4W3RVQV.js} +3 -2
  26. package/dist/{chunk-HBNQ3R3P.js → chunk-T36KFL5R.js} +2 -1
  27. package/dist/{chunk-CMBHUF6P.js → chunk-T3KB4DCM.js} +4 -1
  28. package/dist/{chunk-N5IUYCUZ.js → chunk-UYQY4B7J.js} +4 -2
  29. package/dist/{chunk-LIMG2EY2.js → chunk-VB4A2G7A.js} +3 -2
  30. package/dist/{chunk-PB24YMA4.js → chunk-VYD6M7TF.js} +2 -1
  31. package/dist/{chunk-73N66XQD.js → chunk-WCA5Z4MT.js} +2 -1
  32. package/dist/{chunk-43SWJ765.js → chunk-XBEI6JKV.js} +2 -1
  33. package/dist/{chunk-7ZY7R6PG.js → chunk-XVBLVV7Y.js} +1 -1
  34. package/dist/{chunk-HFMAEJN2.js → chunk-Y5T5NATQ.js} +2 -1
  35. package/dist/{chunk-WYRUCSGW.js → chunk-YS6DRI7V.js} +2 -1
  36. package/dist/{collection-list-LM5SH67K.js → collection-list-C2EQXJTN.js} +2 -2
  37. package/dist/{commissions-list-X54FEOEZ.js → commissions-list-VBQOQF2D.js} +1 -1
  38. package/dist/{customer-group-list-KBZBSGTQ.js → customer-group-list-NZ3D2ZAR.js} +1 -1
  39. package/dist/{customer-list-IJJEZDOZ.js → customer-list-DFONJE23.js} +1 -1
  40. package/dist/index.css +3 -0
  41. package/dist/index.d.ts +2 -0
  42. package/dist/index.js +1529 -1296
  43. package/dist/{order-edit-billing-address-2BSCXUTK.js → order-edit-billing-address-ZT7HAEXB.js} +1 -1
  44. package/dist/{order-list-GQ5IOA6I.js → order-list-WGQC2X2L.js} +1 -1
  45. package/dist/pages/index.d.ts +22 -22
  46. package/dist/pages/index.js +28 -28
  47. package/dist/{price-list-list-JC5EDBH6.js → price-list-list-UEEYIP5R.js} +1 -1
  48. package/dist/{product-create-A7774JYE.js → product-create-LBKJTFOY.js} +3 -3
  49. package/dist/{product-list-2FOZLWYH.js → product-list-YHJ7DW6D.js} +1 -1
  50. package/dist/{product-media-ROKDXANO.js → product-media-NEAAG6IC.js} +2 -2
  51. package/dist/{product-organization-XS62HARL.js → product-organization-SVOLE5TG.js} +1 -1
  52. package/dist/{product-tag-detail-7P7MI52E.js → product-tag-detail-2YR6TXZI.js} +1 -1
  53. package/dist/{product-tag-list-43NFD36I.js → product-tag-list-GDIVZYEB.js} +2 -2
  54. package/dist/{product-type-list-NNNFCCWS.js → product-type-list-VSCQHI3D.js} +1 -1
  55. package/dist/{promotion-detail-4WNHEOG4.js → promotion-detail-HVQKXMJL.js} +3 -3
  56. package/dist/{promotion-list-AJ5NBDZ2.js → promotion-list-KB2E4AEZ.js} +4 -4
  57. package/dist/{refund-reason-list-R573DHM7.js → refund-reason-list-ODOF3ZLM.js} +1 -1
  58. package/dist/{reservation-list-CRPRHIMT.js → reservation-list-APKRLKOF.js} +1 -1
  59. package/dist/{reset-password-7G75C4RO.js → reset-password-BIAORJOF.js} +1 -1
  60. package/dist/{return-reason-list-A2RABTGP.js → return-reason-list-IQ2JGNEN.js} +2 -2
  61. package/dist/{shipping-option-type-list-R4JPQOAA.js → shipping-option-type-list-VQ5UVOUU.js} +1 -1
  62. package/dist/{shipping-profiles-list-UKD47NUF.js → shipping-profiles-list-AK6KXUGF.js} +1 -1
  63. package/dist/{store-details-GOVF3KFW.js → store-details-KI5D4VSI.js} +1 -1
  64. package/dist/{store-edit-W6NHNE3S.js → store-edit-LXGZTR3G.js} +2 -2
  65. package/dist/{store-list-OKKZA7VO.js → store-list-XXRF6JAZ.js} +2 -2
  66. package/dist/{tax-region-create-P4IKQNTU.js → tax-region-create-SFRD4AJB.js} +1 -1
  67. package/dist/{tax-region-list-JC4QYF5B.js → tax-region-list-TM23Q4HH.js} +1 -1
  68. package/dist/{tax-region-tax-override-create-7O3KDBUJ.js → tax-region-tax-override-create-XZ5BU2FP.js} +1 -1
  69. package/dist/{tax-region-tax-override-edit-SUL5VZ5D.js → tax-region-tax-override-edit-R4EGIUIZ.js} +1 -1
  70. package/dist/{user-invite-WG57KWD3.js → user-invite-A7TBRKWI.js} +127 -27
  71. package/dist/{user-list-P7JCBIOR.js → user-list-ECF647TZ.js} +1 -1
  72. package/package.json +6 -6
@@ -241,6 +241,9 @@ var useReservationTableFilters = () => {
241
241
  return filters;
242
242
  };
243
243
 
244
+ // src/pages/reservations/reservation-list/components/reservation-list-table/reservation-list-table.tsx
245
+ import { PermissionGuard } from "@mercurjs/dashboard-shared";
246
+
244
247
  // src/pages/reservations/reservation-list/components/reservation-list-table/use-reservation-table-query.tsx
245
248
  var useReservationTableQuery = ({
246
249
  pageSize = 20,
@@ -288,7 +291,7 @@ var ReservationListTitle = () => {
288
291
  };
289
292
  var ReservationListCreateButton = () => {
290
293
  const { t } = useTranslation4();
291
- return /* @__PURE__ */ jsx3(Button, { variant: "secondary", size: "small", asChild: true, children: /* @__PURE__ */ jsx3(Link, { to: "create", children: t("actions.create") }) });
294
+ return /* @__PURE__ */ jsx3(PermissionGuard, { resource: "reservation_item", operation: "create", children: /* @__PURE__ */ jsx3(Button, { variant: "secondary", size: "small", asChild: true, children: /* @__PURE__ */ jsx3(Link, { to: "create", children: t("actions.create") }) }) });
292
295
  };
293
296
  var ReservationListActions = ({ children }) => {
294
297
  return /* @__PURE__ */ jsx3("div", { className: "flex items-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx3(ReservationListCreateButton, {}) });
@@ -5,7 +5,8 @@ import {
5
5
  // src/hooks/table/query/use-user-invite-table-query.tsx
6
6
  var useUserInviteTableQuery = ({
7
7
  prefix,
8
- pageSize = 20
8
+ pageSize = 20,
9
+ fields
9
10
  }) => {
10
11
  const queryObject = useQueryParams(
11
12
  ["offset", "q", "order", "created_at", "updated_at"],
@@ -18,7 +19,8 @@ var useUserInviteTableQuery = ({
18
19
  order,
19
20
  created_at: created_at ? JSON.parse(created_at) : void 0,
20
21
  updated_at: updated_at ? JSON.parse(updated_at) : void 0,
21
- q
22
+ q,
23
+ fields
22
24
  };
23
25
  return {
24
26
  searchParams,
@@ -338,6 +338,7 @@ var AttributeListDataTable = () => {
338
338
  import { Children } from "react";
339
339
  import { Button, Heading } from "@medusajs/ui";
340
340
  import { useTranslation as useTranslation3 } from "react-i18next";
341
+ import { PermissionGuard } from "@mercurjs/dashboard-shared";
341
342
  import { Link } from "react-router-dom";
342
343
  import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
343
344
  var AttributeListTitle = () => {
@@ -348,7 +349,7 @@ var AttributeListActions = ({
348
349
  children
349
350
  }) => {
350
351
  const { t } = useTranslation3();
351
- return /* @__PURE__ */ jsx3("div", { className: "flex items-center justify-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx3(
352
+ return /* @__PURE__ */ jsx3("div", { className: "flex items-center justify-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx3(PermissionGuard, { resource: "product_attribute", operation: "create", children: /* @__PURE__ */ jsx3(
352
353
  Button,
353
354
  {
354
355
  variant: "secondary",
@@ -357,7 +358,7 @@ var AttributeListActions = ({
357
358
  "data-testid": "attribute-list-table-create-button",
358
359
  children: /* @__PURE__ */ jsx3(Link, { to: "create", children: t("actions.create") })
359
360
  }
360
- ) });
361
+ ) }) });
361
362
  };
362
363
  var AttributeListHeader = ({
363
364
  children
@@ -345,13 +345,14 @@ var useColumns = (names) => {
345
345
  // src/pages/commissions/commissions-list/components/commission-rules-table/commission-rules-header.tsx
346
346
  import { Button, Heading as Heading2 } from "@medusajs/ui";
347
347
  import { useTranslation as useTranslation4 } from "react-i18next";
348
+ import { PermissionGuard } from "@mercurjs/dashboard-shared";
348
349
  import { Link } from "react-router-dom";
349
350
  import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
350
351
  var CommissionRulesHeader = () => {
351
352
  const { t } = useTranslation4();
352
353
  return /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
353
354
  /* @__PURE__ */ jsx3(Heading2, { children: t("commissions.rules.title") }),
354
- /* @__PURE__ */ jsx3(Button, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx3(Link, { to: "create", children: t("actions.create") }) })
355
+ /* @__PURE__ */ jsx3(PermissionGuard, { resource: "commission_rate", operation: "create", children: /* @__PURE__ */ jsx3(Button, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx3(Link, { to: "create", children: t("actions.create") }) }) })
355
356
  ] });
356
357
  };
357
358
 
@@ -41,6 +41,7 @@ import { createColumnHelper } from "@tanstack/react-table";
41
41
  import { Children, useCallback, useMemo } from "react";
42
42
  import { useTranslation } from "react-i18next";
43
43
  import { Link } from "react-router-dom";
44
+ import { PermissionGuard } from "@mercurjs/dashboard-shared";
44
45
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
45
46
  var PAGE_SIZE = 10;
46
47
  var CustomerGroupListTitle = () => {
@@ -49,7 +50,7 @@ var CustomerGroupListTitle = () => {
49
50
  };
50
51
  var CustomerGroupListCreateButton = () => {
51
52
  const { t } = useTranslation();
52
- return /* @__PURE__ */ jsx(Link, { to: "/customer-groups/create", children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.create") }) });
53
+ return /* @__PURE__ */ jsx(PermissionGuard, { resource: "customer_group", operation: "create", children: /* @__PURE__ */ jsx(Link, { to: "/customer-groups/create", children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: t("actions.create") }) }) });
53
54
  };
54
55
  var CustomerGroupListActions = ({ children }) => {
55
56
  return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx(CustomerGroupListCreateButton, {}) });
@@ -31,6 +31,7 @@ import { createColumnHelper } from "@tanstack/react-table";
31
31
  import { useMemo } from "react";
32
32
  import { useTranslation as useTranslation2 } from "react-i18next";
33
33
  import { Link } from "react-router-dom";
34
+ import { PermissionGuard } from "@mercurjs/dashboard-shared";
34
35
 
35
36
  // src/pages/return-reasons/common/hooks/use-delete-return-reason-action.tsx
36
37
  import { toast, usePrompt } from "@medusajs/ui";
@@ -97,7 +98,7 @@ var ReturnReasonListTable = () => {
97
98
  /* @__PURE__ */ jsx(Heading, { "data-testid": "return-reason-list-table-heading", children: t("returnReasons.domain") }),
98
99
  /* @__PURE__ */ jsx(Text, { className: "text-ui-fg-subtle", size: "small", "data-testid": "return-reason-list-table-subtitle", children: t("returnReasons.subtitle") })
99
100
  ] }),
100
- /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "small", asChild: true, "data-testid": "return-reason-list-table-create-button", children: /* @__PURE__ */ jsx(Link, { to: "create", children: t("actions.create") }) })
101
+ /* @__PURE__ */ jsx(PermissionGuard, { resource: "return_reason", operation: "create", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "small", asChild: true, "data-testid": "return-reason-list-table-create-button", children: /* @__PURE__ */ jsx(Link, { to: "create", children: t("actions.create") }) }) })
101
102
  ] }),
102
103
  /* @__PURE__ */ jsx(
103
104
  _DataTable,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getPromotionStatus,
3
3
  getPromotionType
4
- } from "./chunk-NKZLCOFU.js";
4
+ } from "./chunk-6DBL7KIL.js";
5
5
  import {
6
6
  TextCell,
7
7
  TextHeader
@@ -84,6 +84,7 @@ var useCampaignTableFilters = () => {
84
84
  };
85
85
 
86
86
  // src/pages/campaigns/campaign-list/components/campaign-list-table.tsx
87
+ import { PermissionGuard } from "@mercurjs/dashboard-shared";
87
88
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
88
89
  var PAGE_SIZE = 20;
89
90
  var CampaignListTitle = () => {
@@ -92,7 +93,7 @@ var CampaignListTitle = () => {
92
93
  };
93
94
  var CampaignListCreateButton = () => {
94
95
  const { t } = useTranslation2();
95
- return /* @__PURE__ */ jsx(Link, { to: "/campaigns/create", children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", "data-testid": "campaign-list-table-create-button", children: t("actions.create") }) });
96
+ return /* @__PURE__ */ jsx(PermissionGuard, { resource: "campaign", operation: "create", children: /* @__PURE__ */ jsx(Link, { to: "/campaigns/create", children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", "data-testid": "campaign-list-table-create-button", children: t("actions.create") }) }) });
96
97
  };
97
98
  var CampaignListActions = ({ children }) => {
98
99
  return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx(CampaignListCreateButton, {}) });
@@ -317,6 +317,7 @@ import { Children } from "react";
317
317
  import { Button, Heading, Text } from "@medusajs/ui";
318
318
  import { useTranslation as useTranslation5 } from "react-i18next";
319
319
  import { Link, useLocation as useLocation2 } from "react-router-dom";
320
+ import { PermissionGuard } from "@mercurjs/dashboard-shared";
320
321
  import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
321
322
  var ApiKeyManagementListTitle = () => {
322
323
  const { t } = useTranslation5();
@@ -341,7 +342,7 @@ var ApiKeyManagementListActions = ({
341
342
  const { t } = useTranslation5();
342
343
  const { pathname } = useLocation2();
343
344
  const keyType = getApiKeyTypeFromPathname(pathname);
344
- return /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx4(Link, { to: "create", "data-testid": `${keyType}-api-keys-create-button`, children: /* @__PURE__ */ jsx4(Button, { variant: "secondary", size: "small", children: t("actions.create") }) }) });
345
+ return /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-center gap-x-2", children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx4(PermissionGuard, { resource: "api_key", operation: "create", children: /* @__PURE__ */ jsx4(Link, { to: "create", "data-testid": `${keyType}-api-keys-create-button`, children: /* @__PURE__ */ jsx4(Button, { variant: "secondary", size: "small", children: t("actions.create") }) }) }) });
345
346
  };
346
347
  var ApiKeyManagementListHeader = ({
347
348
  children
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CollectionListPage
3
- } from "./chunk-OJQSOFYG.js";
3
+ } from "./chunk-PC5GU4HP.js";
4
4
  import "./chunk-JW4YZDH6.js";
5
5
  import "./chunk-KOURHC2N.js";
6
6
  import "./chunk-2ZFELO2L.js";
@@ -15,7 +15,7 @@ import "./chunk-ANDTD5VV.js";
15
15
  import "./chunk-MG4GKUJW.js";
16
16
  import "./chunk-AYVH6Q5O.js";
17
17
  import "./chunk-VOHEQ7B5.js";
18
- import "./chunk-N5IUYCUZ.js";
18
+ import "./chunk-UYQY4B7J.js";
19
19
  import "./chunk-7SVLKK6Q.js";
20
20
  import "./chunk-GR6JUIRU.js";
21
21
  import "./chunk-GRH7C3QN.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CommissionsPage
3
- } from "./chunk-PB24YMA4.js";
3
+ } from "./chunk-VYD6M7TF.js";
4
4
  import "./chunk-JL3NKSLJ.js";
5
5
  import "./chunk-CGIVQ7D2.js";
6
6
  import "./chunk-JHIMVLB2.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CustomerGroupListPage
3
- } from "./chunk-73N66XQD.js";
3
+ } from "./chunk-WCA5Z4MT.js";
4
4
  import "./chunk-CFQX7HAW.js";
5
5
  import "./chunk-3XOE4NV5.js";
6
6
  import "./chunk-E74OUNA3.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CustomerListPage
3
- } from "./chunk-HBNQ3R3P.js";
3
+ } from "./chunk-T36KFL5R.js";
4
4
  import "./chunk-QG6PLWNH.js";
5
5
  import "./chunk-R22UAHRF.js";
6
6
  import "./chunk-GRH7C3QN.js";
package/dist/index.css CHANGED
@@ -2162,6 +2162,9 @@ video {
2162
2162
  .max-w-full {
2163
2163
  max-width: 100%;
2164
2164
  }
2165
+ .max-w-md {
2166
+ max-width: 28rem;
2167
+ }
2165
2168
  .flex-1 {
2166
2169
  flex: 1 1 0%;
2167
2170
  }
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export { P as PRODUCT_DETAIL_FIELDS, a as PRODUCT_DETAIL_QUERY, d as defineTabMe
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';
11
+ export { PermissionGuard, PermissionGuardProps, PermissionsProvider, PermissionsRequirement, PermissionsRequirementProps, PermissionsRequirementsProvider, RequiredPermissionsSection, RoutePermissionGuard, usePermissions, useRegisterPermissions, useRequiredPermissions, useResourcePermissions } from '@mercurjs/dashboard-shared';
12
+ export { Permission, PermissionOperation, PermissionRequirement, PermissionResource, RouteHandle, UserPolicy } from '@mercurjs/dashboard-sdk';
11
13
 
12
14
  declare function App(): react_jsx_runtime.JSX.Element;
13
15