@mercurjs/vendor 2.3.4 → 2.3.5

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.
@@ -580,6 +580,7 @@ import { DisplayExtensionZone as DisplayExtensionZone5 } from "@mercurjs/dashboa
580
580
  // src/pages/orders/[id]/_components/order-activity-section/hooks/use-activity-items.tsx
581
581
  import { useMemo as useMemo3 } from "react";
582
582
  import { useTranslation as useTranslation14 } from "react-i18next";
583
+ import { useExtensionActivity } from "@mercurjs/dashboard-shared";
583
584
  import { Text as Text15 } from "@medusajs/ui";
584
585
 
585
586
  // src/components/common/user-link/user-link.tsx
@@ -1055,6 +1056,7 @@ var OrderActivityCollapsible = ({
1055
1056
  import { jsx as jsx14, jsxs as jsxs15 } from "react/jsx-runtime";
1056
1057
  var useActivityItems = (order) => {
1057
1058
  const { t } = useTranslation14();
1059
+ const extensionActivity = useExtensionActivity("order", order);
1058
1060
  const { order_changes: orderChanges = [] } = useOrderChanges(order.id);
1059
1061
  const itemsMap = useMemo3(() => {
1060
1062
  return new Map(
@@ -1339,6 +1341,7 @@ var useActivityItems = (order) => {
1339
1341
  timestamp: order.canceled_at
1340
1342
  });
1341
1343
  }
1344
+ items.push(...extensionActivity);
1342
1345
  const sortedActivities = items.sort((a, b) => {
1343
1346
  return new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime();
1344
1347
  });
@@ -1354,7 +1357,8 @@ var useActivityItems = (order) => {
1354
1357
  orderChanges,
1355
1358
  payments,
1356
1359
  isLoading,
1357
- itemsMap
1360
+ itemsMap,
1361
+ extensionActivity
1358
1362
  ]);
1359
1363
  };
1360
1364
 
@@ -2268,7 +2272,11 @@ import {
2268
2272
  Text as Text21,
2269
2273
  Tooltip as Tooltip5
2270
2274
  } from "@medusajs/ui";
2271
- import { DisplayExtensionZone as DisplayExtensionZone10, WidgetZone } from "@mercurjs/dashboard-shared";
2275
+ import {
2276
+ DisplayExtensionZone as DisplayExtensionZone10,
2277
+ useActionLocks,
2278
+ WidgetZone
2279
+ } from "@mercurjs/dashboard-shared";
2272
2280
  import { isOrderAwaitingAction as isOrderAwaitingAction2 } from "@mercurjs/dashboard-shared";
2273
2281
 
2274
2282
  // src/pages/orders/[id]/_components/order-summary-section/return-info-popover.tsx
@@ -2503,6 +2511,11 @@ var Header3 = ({
2503
2511
  orderPreview
2504
2512
  }) => {
2505
2513
  const { t } = useTranslation23();
2514
+ const lock = useActionLocks("order", order);
2515
+ const editLock = lock("edit");
2516
+ const returnLock = lock("return");
2517
+ const exchangeLock = lock("exchange");
2518
+ const claimLock = lock("claim");
2506
2519
  const isAwaitingAction = isOrderAwaitingAction2(order);
2507
2520
  const isLocked = !!order.canceled_at || isAwaitingAction;
2508
2521
  const awaitingActionTooltip = isAwaitingAction ? t("orders.requiresAction.actionUnavailable") : void 0;
@@ -2535,8 +2548,8 @@ var Header3 = ({
2535
2548
  isOrderEditPending ? "orders.summary.editOrderContinue" : "orders.edits.create"
2536
2549
  ),
2537
2550
  to: "edit",
2538
- disabled: editDisabled,
2539
- disabledTooltip: awaitingActionTooltip,
2551
+ disabled: editDisabled || !!editLock,
2552
+ disabledTooltip: editLock ?? awaitingActionTooltip,
2540
2553
  icon: /* @__PURE__ */ jsx24(PencilSquare, {})
2541
2554
  }
2542
2555
  ]
@@ -2546,8 +2559,8 @@ var Header3 = ({
2546
2559
  {
2547
2560
  label: t("orders.returns.create"),
2548
2561
  to: "returns/create",
2549
- disabled: isLocked || returnOutOfPolicy || shouldDisableReturn || returnDisabledByChange,
2550
- disabledTooltip: awaitingActionTooltip ?? (returnOutOfPolicy ? t("orders.returns.outOfPolicy", {
2562
+ disabled: isLocked || returnOutOfPolicy || shouldDisableReturn || returnDisabledByChange || !!returnLock,
2563
+ disabledTooltip: returnLock ?? awaitingActionTooltip ?? (returnOutOfPolicy ? t("orders.returns.outOfPolicy", {
2551
2564
  days: RETURN_POLICY_DAYS
2552
2565
  }) : void 0),
2553
2566
  icon: /* @__PURE__ */ jsx24(ArrowUturnLeft2, {})
@@ -2555,8 +2568,8 @@ var Header3 = ({
2555
2568
  {
2556
2569
  label: orderChange?.id && orderChange?.exchange_id ? t("orders.exchanges.manage") : t("orders.exchanges.create"),
2557
2570
  to: "exchanges/create",
2558
- disabled: isLocked || exchangeOutOfPolicy || shouldDisableReturn || exchangeDisabledByChange,
2559
- disabledTooltip: awaitingActionTooltip ?? (exchangeOutOfPolicy ? t("orders.exchanges.outOfPolicy", {
2571
+ disabled: isLocked || exchangeOutOfPolicy || shouldDisableReturn || exchangeDisabledByChange || !!exchangeLock,
2572
+ disabledTooltip: exchangeLock ?? awaitingActionTooltip ?? (exchangeOutOfPolicy ? t("orders.exchanges.outOfPolicy", {
2560
2573
  days: EXCHANGE_POLICY_DAYS
2561
2574
  }) : void 0),
2562
2575
  icon: /* @__PURE__ */ jsx24(ArrowPath2, {})
@@ -2564,8 +2577,8 @@ var Header3 = ({
2564
2577
  {
2565
2578
  label: orderChange?.id && orderChange?.claim_id ? t("orders.claims.manage") : t("orders.claims.create"),
2566
2579
  to: "claims/create",
2567
- disabled: isLocked || claimOutOfPolicy || shouldDisableReturn || claimDisabledByChange,
2568
- disabledTooltip: awaitingActionTooltip ?? (claimOutOfPolicy ? t("orders.claims.outOfPolicy", {
2580
+ disabled: isLocked || claimOutOfPolicy || shouldDisableReturn || claimDisabledByChange || !!claimLock,
2581
+ disabledTooltip: claimLock ?? awaitingActionTooltip ?? (claimOutOfPolicy ? t("orders.claims.outOfPolicy", {
2569
2582
  days: CLAIM_POLICY_DAYS
2570
2583
  }) : void 0),
2571
2584
  icon: /* @__PURE__ */ jsx24(ExclamationCircle2, {})
@@ -2578,6 +2591,7 @@ var Header3 = ({
2578
2591
  ] });
2579
2592
  };
2580
2593
  var Item = ({
2594
+ order,
2581
2595
  item,
2582
2596
  currencyCode,
2583
2597
  returns,
@@ -2627,14 +2641,17 @@ var Item = ({
2627
2641
  /* @__PURE__ */ jsx24("span", { className: "tabular-nums", children: item.quantity }),
2628
2642
  "x"
2629
2643
  ] }) }),
2630
- /* @__PURE__ */ jsx24("div", { className: "overflow-visible", children: isInventoryManaged && hasUnfulfilledItems && /* @__PURE__ */ jsx24(
2631
- StatusBadge4,
2632
- {
2633
- color: reservation ? "green" : "orange",
2634
- className: "text-nowrap",
2635
- children: reservation ? t("orders.reservations.allocatedLabel") : t("orders.reservations.notAllocatedLabel")
2636
- }
2637
- ) })
2644
+ /* @__PURE__ */ jsxs25("div", { className: "overflow-visible", children: [
2645
+ isInventoryManaged && hasUnfulfilledItems && /* @__PURE__ */ jsx24(
2646
+ StatusBadge4,
2647
+ {
2648
+ color: reservation ? "green" : "orange",
2649
+ className: "text-nowrap",
2650
+ children: reservation ? t("orders.reservations.allocatedLabel") : t("orders.reservations.notAllocatedLabel")
2651
+ }
2652
+ ),
2653
+ /* @__PURE__ */ jsx24(WidgetZone, { id: "orders.detail.item", data: { order, item } })
2654
+ ] })
2638
2655
  ] }),
2639
2656
  /* @__PURE__ */ jsx24("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx24(Text21, { size: "small", className: "pt-[1px]", children: getLocaleAmount(item.original_total || 0, currencyCode) }) })
2640
2657
  ] })
@@ -2665,6 +2682,7 @@ var ItemBreakdown = ({
2665
2682
  return /* @__PURE__ */ jsx24(
2666
2683
  Item,
2667
2684
  {
2685
+ order,
2668
2686
  item,
2669
2687
  currencyCode: order.currency_code,
2670
2688
  returns,
@@ -58,6 +58,8 @@ declare module "@mercurjs/dashboard-sdk" {
58
58
  "offers.detail.side.before": true
59
59
  "offers.list.after": true
60
60
  "offers.list.before": true
61
+ "orders.detail.item.after": true
62
+ "orders.detail.item.before": true
61
63
  "orders.detail.main.after": true
62
64
  "orders.detail.main.before": true
63
65
  "orders.detail.side.after": true
package/dist/index.js CHANGED
@@ -3213,7 +3213,7 @@ function getRouteMap({
3213
3213
  {
3214
3214
  path: ":id",
3215
3215
  lazy: async () => {
3216
- const { loader } = await import("./[id]-QMNKZKT4.js");
3216
+ const { loader } = await import("./[id]-HP4YGPRA.js");
3217
3217
  const { Breadcrumb } = await import("./breadcrumb-RQ52GELM.js");
3218
3218
  return {
3219
3219
  Component: Outlet4,
@@ -3227,7 +3227,7 @@ function getRouteMap({
3227
3227
  {
3228
3228
  path: "",
3229
3229
  lazy: async () => {
3230
- const { OrderDetailPage } = await import("./[id]-QMNKZKT4.js");
3230
+ const { OrderDetailPage } = await import("./[id]-HP4YGPRA.js");
3231
3231
  return { Component: OrderDetailPage };
3232
3232
  },
3233
3233
  children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/vendor",
3
- "version": "2.3.4",
3
+ "version": "2.3.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",
@@ -37,8 +37,8 @@
37
37
  "lint": "oxlint --max-warnings 0"
38
38
  },
39
39
  "dependencies": {
40
- "@mercurjs/dashboard-shared": "2.3.4",
41
- "@mercurjs/client": "2.3.4",
40
+ "@mercurjs/dashboard-shared": "2.3.5",
41
+ "@mercurjs/client": "2.3.5",
42
42
  "@ariakit/react": "^0.4.15",
43
43
  "@babel/runtime": "^8.0.0",
44
44
  "@dnd-kit/core": "^6.1.0",
@@ -91,9 +91,9 @@
91
91
  "tsup": "^8.0.2",
92
92
  "typescript": "5.9.3",
93
93
  "@medusajs/types": "2.20.1",
94
- "@mercurjs/core": "2.3.4",
95
- "@mercurjs/dashboard-sdk": "2.3.4",
96
- "@mercurjs/types": "2.3.4",
94
+ "@mercurjs/core": "2.3.5",
95
+ "@mercurjs/dashboard-sdk": "2.3.5",
96
+ "@mercurjs/types": "2.3.5",
97
97
  "react-router-dom": "7.18.1"
98
98
  }
99
99
  }