@mercurjs/vendor 2.2.0-canary.40 → 2.2.0-canary.42
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.
- package/dist/{[id]-3LNKC5OJ.js → [id]-5OOWGWHL.js} +51 -16
- package/dist/{[id]-XB45DY2D.js → [id]-5RQ7NFL7.js} +98 -23
- package/dist/{[id]-5P5LTATX.js → [id]-ARHFE7ID.js} +28 -10
- package/dist/{[id]-AQUUZFRX.js → [id]-BGOV2BKI.js} +123 -29
- package/dist/{[id]-IEBZ6V3W.js → [id]-KUVSIFMW.js} +5 -5
- package/dist/{[id]-U6FKX5UQ.js → [id]-LFYUX6ON.js} +40 -18
- package/dist/{[id]-5EECCIRP.js → [id]-M6DVHCGK.js} +31 -14
- package/dist/{[id]-4HO4S2PX.js → [id]-MFEOWOHY.js} +240 -150
- package/dist/{[id]-4LIIFGET.js → [id]-TF35KIFE.js} +118 -36
- package/dist/{[id]-CUBGVODE.js → [id]-WG6ZEK3I.js} +61 -24
- package/dist/{[id]-DCGPICT3.js → [id]-YDR5VTPB.js} +5 -5
- package/dist/{[id]-XP5KEMNX.js → [id]-ZV36X6E6.js} +51 -16
- package/dist/{add-3T4GBFMM.js → add-PUXNN6CE.js} +5 -5
- package/dist/{add-RPRJWCYU.js → add-TCNRAUZF.js} +2 -2
- package/dist/{add-products-F243SWGD.js → add-products-DGJ6LFWC.js} +5 -5
- package/dist/{address-XVBSNMFU.js → address-S5J77GB2.js} +17 -6
- package/dist/{campaigns-DZKRNCA4.js → campaigns-OVHA6HH2.js} +1 -1
- package/dist/{categories-JZJA2IBQ.js → categories-XVD4SWIS.js} +1 -1
- package/dist/{chunk-JDNXS37G.js → chunk-2K3RNFEC.js} +1 -1
- package/dist/{chunk-UNE4VD5U.js → chunk-3EF326ZJ.js} +15 -4
- package/dist/{chunk-ZTOYVPGA.js → chunk-3F4MUPGR.js} +1 -1
- package/dist/{chunk-6Q3J6ZMM.js → chunk-3N3K55NN.js} +33 -12
- package/dist/{chunk-RTMMO6IU.js → chunk-4TGDYJMA.js} +17 -6
- package/dist/{chunk-3ALBZK4M.js → chunk-4YM7N6OQ.js} +4 -1
- package/dist/{chunk-KG2NUK4J.js → chunk-5CHFC47S.js} +41 -10
- package/dist/{chunk-WBCWER26.js → chunk-7HLAOLG7.js} +1 -1
- package/dist/{chunk-GSH6ZGI6.js → chunk-BUQXFADV.js} +26 -5
- package/dist/{chunk-DQ7LZZJX.js → chunk-CSZ6RV7N.js} +12 -5
- package/dist/{chunk-CUAGC54B.js → chunk-E5BSLZR5.js} +8 -2
- package/dist/{chunk-H6LZ77GX.js → chunk-QGZH3D2P.js} +4 -1
- package/dist/{chunk-EDV4MTTT.js → chunk-T7OX3EOG.js} +57 -28
- package/dist/{chunk-MUGQQY6P.js → chunk-TB3B7NEX.js} +48 -10
- package/dist/{chunk-WFHGJGCW.js → chunk-TRUC5GIG.js} +14 -3
- package/dist/{chunk-LWFBBTJ3.js → chunk-UEJJFJVX.js} +14 -4
- package/dist/{chunk-KTJLJTFO.js → chunk-UWZVAW6K.js} +5 -3
- package/dist/{chunk-EAAZV3B7.js → chunk-VMHLOWKL.js} +15 -5
- package/dist/{chunk-DSTHXHJ5.js → chunk-VYSB4CTB.js} +1356 -1356
- package/dist/{chunk-FDKFUIYV.js → chunk-WQQMCV7M.js} +1 -1
- package/dist/{chunk-WCXFUBEF.js → chunk-WTYASKLY.js} +3 -3
- package/dist/{chunk-2KA4TGBQ.js → chunk-YD43PVVT.js} +14 -3
- package/dist/{chunk-RPU4UOQK.js → chunk-ZOJP2DHA.js} +1 -1
- package/dist/{chunk-JK4M3ZKY.js → chunk-ZZUJHLFM.js} +1 -1
- package/dist/{collections-XIHCTMSJ.js → collections-PRMRAQSQ.js} +4 -4
- package/dist/{create-3AMFYYI6.js → create-5S3GWAUX.js} +2 -2
- package/dist/{create-XLYGW5PN.js → create-EAIGKLSC.js} +1 -1
- package/dist/{create-FHIFVCSG.js → create-KM5HXMYT.js} +6 -6
- package/dist/{create-PJVLJ7T6.js → create-QU45XB4S.js} +5 -5
- package/dist/{create-AMNH3WXL.js → create-QZDRRIB6.js} +4 -4
- package/dist/{customer-group-detail-AOQYYAOG.js → customer-group-detail-3UR5AUY3.js} +1 -1
- package/dist/{customer-group-edit-N77RCW6I.js → customer-group-edit-WMGWG2OH.js} +40 -25
- package/dist/{customer-groups-GNFV7VMT.js → customer-groups-2T2HEYQ6.js} +24 -7
- package/dist/{customers-HNINO6YL.js → customers-NVTX4FK2.js} +1 -1
- package/dist/{edit-BSD6667Q.js → edit-4PMUQMTL.js} +2 -2
- package/dist/{edit-7CLOJ3UZ.js → edit-GE2UOMBI.js} +6 -6
- package/dist/{edit-UNN3QTEJ.js → edit-HK6HAYZW.js} +18 -5
- package/dist/{edit-IJ6DCBUU.js → edit-JDYB3U7H.js} +21 -7
- package/dist/{edit-7SBPHN6P.js → edit-KEUVWNLU.js} +18 -5
- package/dist/{edit-ZORE6RUD.js → edit-NR3WDBFF.js} +29 -13
- package/dist/{edit-3DUCWSLA.js → edit-RA54O5XJ.js} +21 -9
- package/dist/{edit-inventory-item-QMYWEBZ3.js → edit-inventory-item-UKBKVTYI.js} +18 -5
- package/dist/extension-targets.d.ts +206 -0
- package/dist/extension-targets.js +1 -0
- package/dist/{fulfillment-providers-CMU2JB5X.js → fulfillment-providers-SJRXA3EC.js} +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +136 -109
- package/dist/{inventory-FKEXULLT.js → inventory-MFA4C6TO.js} +1 -1
- package/dist/{invite-MNAX6EUC.js → invite-WTFQ6UV2.js} +2 -2
- package/dist/{login-YUWOWICV.js → login-2CQ6RYIE.js} +1 -1
- package/dist/{media-P6WSFHY4.js → media-QIWRWMSV.js} +3 -3
- package/dist/{media-YB4G5CMV.js → media-XFZNEQCY.js} +1 -1
- package/dist/{offer-create-page-ACPKTNHA.js → offer-create-page-JP5Z2CAG.js} +6 -4
- package/dist/{offer-detail-page-S4R4N5GL.js → offer-detail-page-FF7SJX7E.js} +69 -15
- package/dist/{offer-variant-detail-page-XUMDXZUD.js → offer-variant-detail-page-KURNVWYU.js} +12 -4
- package/dist/{offers-OTZJBW43.js → offers-XDLT2AEJ.js} +4 -4
- package/dist/{onboarding-TUGXFOA6.js → onboarding-BXFZZHIW.js} +31 -16
- package/dist/{orders-PJSJNGZS.js → orders-ML36IAEE.js} +3 -3
- package/dist/{organization-YIOAVFHN.js → organization-2BZGUGLM.js} +1 -1
- package/dist/pages/index.d.ts +17 -2
- package/dist/pages/index.js +24 -22
- package/dist/{payment-details-K2XFATEL.js → payment-details-MEUERL4T.js} +18 -7
- package/dist/{payouts-K5IDTJV3.js → payouts-WFLYAMEU.js} +1 -1
- package/dist/{price-lists-DNPIPDAW.js → price-lists-PG33QKVZ.js} +1 -1
- package/dist/{product-tags-SJYIGXEV.js → product-tags-WBERDKIH.js} +5 -5
- package/dist/{product-variant-edit-55TAIBZO.js → product-variant-edit-TUIVXPXO.js} +2 -2
- package/dist/{products-EQMANSO6.js → products-CZMAHOE3.js} +5 -5
- package/dist/{products-XM57LXJK.js → products-ZFB35IHK.js} +13 -11
- package/dist/{professional-details-WWZPTXSX.js → professional-details-ZTDNQO6F.js} +17 -6
- package/dist/{profile-5IADQ727.js → profile-SEF44YKY.js} +28 -12
- package/dist/{promotions-BYW6TZ5B.js → promotions-APUOIWRR.js} +1 -1
- package/dist/{register-U5PQZATC.js → register-MQDAUF64.js} +1 -1
- package/dist/{return-reasons-QDPSIJG3.js → return-reasons-ZX7KIFTS.js} +4 -4
- package/dist/{settings-ZUBBFS67.js → settings-AYPJWXFO.js} +5 -5
- package/dist/{store-XWOALZ5Q.js → store-LR3BGJJ6.js} +52 -25
- package/dist/{store-select-E77E3ZY7.js → store-select-7M2JBJ7G.js} +20 -2
- package/dist/{team-N2C5JPSU.js → team-DZHLNPCO.js} +2 -2
- package/package.json +17 -12
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
import "./chunk-6IJMSVC6.js";
|
|
12
12
|
import {
|
|
13
13
|
useProductTableColumns
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-WQQMCV7M.js";
|
|
15
|
+
import "./chunk-7HLAOLG7.js";
|
|
16
16
|
import {
|
|
17
17
|
useProductTableQuery
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QGZH3D2P.js";
|
|
19
19
|
import "./chunk-FWPGOIFA.js";
|
|
20
20
|
import {
|
|
21
21
|
useProductTableFilters
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZZUJHLFM.js";
|
|
23
23
|
import "./chunk-DB6ANJBO.js";
|
|
24
24
|
import "./chunk-PHOCVOZ5.js";
|
|
25
25
|
import "./chunk-SMQT3ZNO.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./chunk-YV6MK4PZ.js";
|
|
37
37
|
import "./chunk-THHRRYRS.js";
|
|
38
38
|
import "./chunk-LRD242C7.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-VYSB4CTB.js";
|
|
40
40
|
import "./chunk-WIYFXWRI.js";
|
|
41
41
|
import {
|
|
42
42
|
TwoColumnPageSkeleton
|
|
@@ -101,11 +101,13 @@ var loader = async ({ params }) => {
|
|
|
101
101
|
// src/pages/price-lists/[id]/price-list-detail-page.tsx
|
|
102
102
|
import { Children } from "react";
|
|
103
103
|
import { useLoaderData, useParams } from "react-router-dom";
|
|
104
|
+
import { WidgetZone } from "@mercurjs/dashboard-shared";
|
|
104
105
|
|
|
105
106
|
// src/pages/price-lists/[id]/_components/price-list-configuration-section/price-list-configuration-section.tsx
|
|
106
107
|
import { PencilSquare } from "@medusajs/icons";
|
|
107
108
|
import { Container, Heading } from "@medusajs/ui";
|
|
108
109
|
import { useTranslation } from "react-i18next";
|
|
110
|
+
import { DisplayExtensionZone } from "@mercurjs/dashboard-shared";
|
|
109
111
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
110
112
|
var PriceListConfigurationSection = ({
|
|
111
113
|
priceList
|
|
@@ -138,6 +140,14 @@ var PriceListConfigurationSection = ({
|
|
|
138
140
|
startsAt: priceList.starts_at,
|
|
139
141
|
showTime: true
|
|
140
142
|
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ jsx(
|
|
145
|
+
DisplayExtensionZone,
|
|
146
|
+
{
|
|
147
|
+
model: "price_list",
|
|
148
|
+
zone: "configuration",
|
|
149
|
+
data: priceList
|
|
150
|
+
}
|
|
141
151
|
)
|
|
142
152
|
] });
|
|
143
153
|
};
|
|
@@ -146,6 +156,7 @@ var PriceListConfigurationSection = ({
|
|
|
146
156
|
import { PencilSquare as PencilSquare2, Trash } from "@medusajs/icons";
|
|
147
157
|
import { Container as Container2, Heading as Heading2, StatusBadge, Text } from "@medusajs/ui";
|
|
148
158
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
159
|
+
import { DisplayExtensionZone as DisplayExtensionZone2, DisplayField } from "@mercurjs/dashboard-shared";
|
|
149
160
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
150
161
|
var PriceListGeneralSection = ({
|
|
151
162
|
priceList
|
|
@@ -157,9 +168,9 @@ var PriceListGeneralSection = ({
|
|
|
157
168
|
const type = priceList.type === "sale" ? t("priceLists.fields.type.options.sale.label") : t("priceLists.fields.type.options.override.label");
|
|
158
169
|
return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
|
|
159
170
|
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
160
|
-
/* @__PURE__ */ jsx2(Heading2, { children: priceList.title }),
|
|
171
|
+
/* @__PURE__ */ jsx2(DisplayField, { model: "price_list", zone: "general", id: "title", data: priceList, children: /* @__PURE__ */ jsx2(Heading2, { children: priceList.title }) }),
|
|
161
172
|
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-x-4", children: [
|
|
162
|
-
/* @__PURE__ */ jsx2(StatusBadge, { color, children: text }),
|
|
173
|
+
/* @__PURE__ */ jsx2(DisplayField, { model: "price_list", zone: "general", id: "status", data: priceList, children: /* @__PURE__ */ jsx2(StatusBadge, { color, children: text }) }),
|
|
163
174
|
/* @__PURE__ */ jsx2(
|
|
164
175
|
ActionMenu,
|
|
165
176
|
{
|
|
@@ -187,18 +198,33 @@ var PriceListGeneralSection = ({
|
|
|
187
198
|
)
|
|
188
199
|
] })
|
|
189
200
|
] }),
|
|
190
|
-
/* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
201
|
+
/* @__PURE__ */ jsx2(DisplayField, { model: "price_list", zone: "general", id: "type", data: priceList, children: /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
191
202
|
/* @__PURE__ */ jsx2(Text, { leading: "compact", size: "small", weight: "plus", children: t("fields.type") }),
|
|
192
203
|
/* @__PURE__ */ jsx2(Text, { size: "small", className: "text-pretty", children: type })
|
|
193
|
-
] }),
|
|
194
|
-
/* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
204
|
+
] }) }),
|
|
205
|
+
/* @__PURE__ */ jsx2(DisplayField, { model: "price_list", zone: "general", id: "description", data: priceList, children: /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
195
206
|
/* @__PURE__ */ jsx2(Text, { leading: "compact", size: "small", weight: "plus", children: t("fields.description") }),
|
|
196
207
|
/* @__PURE__ */ jsx2(Text, { size: "small", className: "text-pretty", children: priceList.description })
|
|
197
|
-
] }),
|
|
198
|
-
/* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
208
|
+
] }) }),
|
|
209
|
+
/* @__PURE__ */ jsx2(DisplayField, { model: "price_list", zone: "general", id: "price_overrides", data: priceList, children: /* @__PURE__ */ jsxs2("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
199
210
|
/* @__PURE__ */ jsx2(Text, { leading: "compact", size: "small", weight: "plus", children: t("priceLists.fields.priceOverrides.label") }),
|
|
200
211
|
/* @__PURE__ */ jsx2(Text, { size: "small", className: "text-pretty", children: overrideCount || "-" })
|
|
201
|
-
] })
|
|
212
|
+
] }) }),
|
|
213
|
+
/* @__PURE__ */ jsx2(
|
|
214
|
+
DisplayExtensionZone2,
|
|
215
|
+
{
|
|
216
|
+
model: "price_list",
|
|
217
|
+
zone: "general",
|
|
218
|
+
data: priceList,
|
|
219
|
+
builtInFieldIds: [
|
|
220
|
+
"title",
|
|
221
|
+
"status",
|
|
222
|
+
"type",
|
|
223
|
+
"description",
|
|
224
|
+
"price_overrides"
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
)
|
|
202
228
|
] });
|
|
203
229
|
};
|
|
204
230
|
|
|
@@ -210,6 +236,7 @@ import { createColumnHelper } from "@tanstack/react-table";
|
|
|
210
236
|
import { useMemo, useState } from "react";
|
|
211
237
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
212
238
|
import { useNavigate } from "react-router-dom";
|
|
239
|
+
import { DisplayExtensionZone as DisplayExtensionZone3 } from "@mercurjs/dashboard-shared";
|
|
213
240
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
214
241
|
var PAGE_SIZE = 10;
|
|
215
242
|
var PREFIX = "p";
|
|
@@ -345,6 +372,14 @@ var PriceListProductSection = ({
|
|
|
345
372
|
prefix: PREFIX,
|
|
346
373
|
queryObject: raw
|
|
347
374
|
}
|
|
375
|
+
),
|
|
376
|
+
/* @__PURE__ */ jsx3(
|
|
377
|
+
DisplayExtensionZone3,
|
|
378
|
+
{
|
|
379
|
+
model: "price_list",
|
|
380
|
+
zone: "products",
|
|
381
|
+
data: priceList
|
|
382
|
+
}
|
|
348
383
|
)
|
|
349
384
|
] });
|
|
350
385
|
};
|
|
@@ -465,11 +500,11 @@ var Root = ({ children }) => {
|
|
|
465
500
|
throw error;
|
|
466
501
|
}
|
|
467
502
|
return /* @__PURE__ */ jsx4(Fragment, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs4(TwoColumnPage, { hasOutlet: true, data: price_list, children: [
|
|
468
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ jsx4(TwoColumnPage.Main, { children: /* @__PURE__ */ jsxs4(WidgetZone, { id: "price-lists.detail.main", data: price_list, children: [
|
|
469
504
|
/* @__PURE__ */ jsx4(PriceListGeneralSection, { priceList: price_list }),
|
|
470
505
|
/* @__PURE__ */ jsx4(PriceListProductSection, { priceList: price_list })
|
|
471
|
-
] }),
|
|
472
|
-
/* @__PURE__ */ jsx4(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsx4(PriceListConfigurationSection, { priceList: price_list }) })
|
|
506
|
+
] }) }),
|
|
507
|
+
/* @__PURE__ */ jsx4(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsx4(WidgetZone, { id: "price-lists.detail.side", data: price_list, children: /* @__PURE__ */ jsx4(PriceListConfigurationSection, { priceList: price_list }) }) })
|
|
473
508
|
] }) });
|
|
474
509
|
};
|
|
475
510
|
var PriceListDetailPage = Object.assign(Root, {
|
|
@@ -77,11 +77,13 @@ var loader = async ({ params }) => {
|
|
|
77
77
|
// src/pages/campaigns/[id]/campaign-detail-page.tsx
|
|
78
78
|
import { Children } from "react";
|
|
79
79
|
import { useLoaderData, useParams } from "react-router-dom";
|
|
80
|
+
import { WidgetZone } from "@mercurjs/dashboard-shared";
|
|
80
81
|
|
|
81
82
|
// src/pages/campaigns/[id]/_components/campaign-budget/campaign-budget.tsx
|
|
82
83
|
import { ChartPie, PencilSquare } from "@medusajs/icons";
|
|
83
84
|
import { Container, Heading, Text } from "@medusajs/ui";
|
|
84
85
|
import { Trans, useTranslation } from "react-i18next";
|
|
86
|
+
import { DisplayExtensionZone } from "@mercurjs/dashboard-shared";
|
|
85
87
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
86
88
|
var CampaignBudget = ({ campaign }) => {
|
|
87
89
|
const { t } = useTranslation();
|
|
@@ -148,7 +150,8 @@ var CampaignBudget = ({ campaign }) => {
|
|
|
148
150
|
}
|
|
149
151
|
)
|
|
150
152
|
}
|
|
151
|
-
) })
|
|
153
|
+
) }),
|
|
154
|
+
/* @__PURE__ */ jsx(DisplayExtensionZone, { model: "campaign", zone: "budget", data: campaign })
|
|
152
155
|
] });
|
|
153
156
|
};
|
|
154
157
|
|
|
@@ -156,6 +159,7 @@ var CampaignBudget = ({ campaign }) => {
|
|
|
156
159
|
import { Container as Container2, Heading as Heading2 } from "@medusajs/ui";
|
|
157
160
|
import { PencilSquare as PencilSquare2 } from "@medusajs/icons";
|
|
158
161
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
162
|
+
import { DisplayExtensionZone as DisplayExtensionZone2 } from "@mercurjs/dashboard-shared";
|
|
159
163
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
160
164
|
var CampaignConfigurationSection = ({
|
|
161
165
|
campaign
|
|
@@ -188,6 +192,14 @@ var CampaignConfigurationSection = ({
|
|
|
188
192
|
endsAt: campaign.ends_at,
|
|
189
193
|
showTime: true
|
|
190
194
|
}
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ jsx2(
|
|
197
|
+
DisplayExtensionZone2,
|
|
198
|
+
{
|
|
199
|
+
model: "campaign",
|
|
200
|
+
zone: "configuration",
|
|
201
|
+
data: campaign
|
|
202
|
+
}
|
|
191
203
|
)
|
|
192
204
|
] });
|
|
193
205
|
};
|
|
@@ -205,6 +217,7 @@ import {
|
|
|
205
217
|
} from "@medusajs/ui";
|
|
206
218
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
207
219
|
import { useNavigate } from "react-router-dom";
|
|
220
|
+
import { DisplayExtensionZone as DisplayExtensionZone3, DisplayField } from "@mercurjs/dashboard-shared";
|
|
208
221
|
|
|
209
222
|
// src/pages/campaigns/common/utils/campaign-status.ts
|
|
210
223
|
import { isAfter, isBefore } from "date-fns";
|
|
@@ -272,9 +285,18 @@ var CampaignGeneralSection = ({
|
|
|
272
285
|
const status = campaignStatus(campaign);
|
|
273
286
|
return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
|
|
274
287
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
275
|
-
/* @__PURE__ */ jsx3(Heading3, { children: campaign.name }),
|
|
288
|
+
/* @__PURE__ */ jsx3(DisplayField, { model: "campaign", zone: "general", id: "name", data: campaign, children: /* @__PURE__ */ jsx3(Heading3, { children: campaign.name }) }),
|
|
276
289
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-x-4", children: [
|
|
277
|
-
/* @__PURE__ */ jsx3(
|
|
290
|
+
/* @__PURE__ */ jsx3(
|
|
291
|
+
DisplayField,
|
|
292
|
+
{
|
|
293
|
+
model: "campaign",
|
|
294
|
+
zone: "general",
|
|
295
|
+
id: "status",
|
|
296
|
+
data: campaign,
|
|
297
|
+
children: /* @__PURE__ */ jsx3(StatusBadge, { color: statusColor(status), children: t(`campaigns.status.${status}`) })
|
|
298
|
+
}
|
|
299
|
+
),
|
|
278
300
|
/* @__PURE__ */ jsx3(
|
|
279
301
|
ActionMenu,
|
|
280
302
|
{
|
|
@@ -302,21 +324,63 @@ var CampaignGeneralSection = ({
|
|
|
302
324
|
)
|
|
303
325
|
] })
|
|
304
326
|
] }),
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
327
|
+
/* @__PURE__ */ jsx3(
|
|
328
|
+
DisplayField,
|
|
329
|
+
{
|
|
330
|
+
model: "campaign",
|
|
331
|
+
zone: "general",
|
|
332
|
+
id: "campaign_identifier",
|
|
333
|
+
data: campaign,
|
|
334
|
+
children: /* @__PURE__ */ jsxs3("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
335
|
+
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("campaigns.fields.identifier") }),
|
|
336
|
+
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: campaign.campaign_identifier })
|
|
337
|
+
] })
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
/* @__PURE__ */ jsx3(
|
|
341
|
+
DisplayField,
|
|
342
|
+
{
|
|
343
|
+
model: "campaign",
|
|
344
|
+
zone: "general",
|
|
345
|
+
id: "description",
|
|
346
|
+
data: campaign,
|
|
347
|
+
children: /* @__PURE__ */ jsxs3("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
348
|
+
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("fields.description") }),
|
|
349
|
+
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", children: campaign.description || "-" })
|
|
350
|
+
] })
|
|
351
|
+
}
|
|
352
|
+
),
|
|
353
|
+
campaign?.budget && campaign.budget.type === "spend" && /* @__PURE__ */ jsx3(
|
|
354
|
+
DisplayField,
|
|
355
|
+
{
|
|
356
|
+
model: "campaign",
|
|
357
|
+
zone: "general",
|
|
358
|
+
id: "currency_code",
|
|
359
|
+
data: campaign,
|
|
360
|
+
children: /* @__PURE__ */ jsxs3("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
361
|
+
/* @__PURE__ */ jsx3(Text2, { size: "small", leading: "compact", weight: "plus", children: t("fields.currency") }),
|
|
362
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
363
|
+
/* @__PURE__ */ jsx3(Badge, { size: "xsmall", children: campaign?.budget.currency_code }),
|
|
364
|
+
/* @__PURE__ */ jsx3(Text2, { className: "inline pl-3", size: "small", leading: "compact", children: currencies[campaign?.budget.currency_code?.toUpperCase()]?.name })
|
|
365
|
+
] })
|
|
366
|
+
] })
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
/* @__PURE__ */ jsx3(
|
|
370
|
+
DisplayExtensionZone3,
|
|
371
|
+
{
|
|
372
|
+
model: "campaign",
|
|
373
|
+
zone: "general",
|
|
374
|
+
data: campaign,
|
|
375
|
+
builtInFieldIds: [
|
|
376
|
+
"name",
|
|
377
|
+
"status",
|
|
378
|
+
"campaign_identifier",
|
|
379
|
+
"description",
|
|
380
|
+
"currency_code"
|
|
381
|
+
]
|
|
382
|
+
}
|
|
383
|
+
)
|
|
320
384
|
] });
|
|
321
385
|
};
|
|
322
386
|
|
|
@@ -327,6 +391,7 @@ import { createColumnHelper } from "@tanstack/react-table";
|
|
|
327
391
|
import { useMemo, useState } from "react";
|
|
328
392
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
329
393
|
import { Link } from "react-router-dom";
|
|
394
|
+
import { DisplayExtensionZone as DisplayExtensionZone4 } from "@mercurjs/dashboard-shared";
|
|
330
395
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
331
396
|
var PAGE_SIZE = 10;
|
|
332
397
|
var CampaignPromotionSection = ({
|
|
@@ -428,6 +493,14 @@ var CampaignPromotionSection = ({
|
|
|
428
493
|
message: t("campaigns.promotions.list.noRecordsMessage")
|
|
429
494
|
}
|
|
430
495
|
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ jsx4(
|
|
498
|
+
DisplayExtensionZone4,
|
|
499
|
+
{
|
|
500
|
+
model: "campaign",
|
|
501
|
+
zone: "promotions",
|
|
502
|
+
data: campaign
|
|
503
|
+
}
|
|
431
504
|
)
|
|
432
505
|
] });
|
|
433
506
|
};
|
|
@@ -522,6 +595,7 @@ var useColumns = () => {
|
|
|
522
595
|
import { CurrencyDollar } from "@medusajs/icons";
|
|
523
596
|
import { Container as Container5, Heading as Heading5, Text as Text3 } from "@medusajs/ui";
|
|
524
597
|
import { Trans as Trans2, useTranslation as useTranslation5 } from "react-i18next";
|
|
598
|
+
import { DisplayExtensionZone as DisplayExtensionZone5 } from "@mercurjs/dashboard-shared";
|
|
525
599
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
526
600
|
var CampaignSpend = ({ campaign }) => {
|
|
527
601
|
const { t } = useTranslation5();
|
|
@@ -563,7 +637,8 @@ var CampaignSpend = ({ campaign }) => {
|
|
|
563
637
|
}
|
|
564
638
|
)
|
|
565
639
|
}
|
|
566
|
-
) })
|
|
640
|
+
) }),
|
|
641
|
+
/* @__PURE__ */ jsx5(DisplayExtensionZone5, { model: "campaign", zone: "spend", data: campaign })
|
|
567
642
|
] });
|
|
568
643
|
};
|
|
569
644
|
|
|
@@ -587,15 +662,15 @@ var Root = ({ children }) => {
|
|
|
587
662
|
throw error;
|
|
588
663
|
}
|
|
589
664
|
return /* @__PURE__ */ jsx6(Fragment, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs6(TwoColumnPage, { hasOutlet: true, data: campaign, children: [
|
|
590
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ jsx6(TwoColumnPage.Main, { children: /* @__PURE__ */ jsxs6(WidgetZone, { id: "campaigns.detail.main", data: campaign, children: [
|
|
591
666
|
/* @__PURE__ */ jsx6(CampaignGeneralSection, { campaign }),
|
|
592
667
|
/* @__PURE__ */ jsx6(CampaignPromotionSection, { campaign })
|
|
593
|
-
] }),
|
|
594
|
-
/* @__PURE__ */
|
|
668
|
+
] }) }),
|
|
669
|
+
/* @__PURE__ */ jsx6(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsxs6(WidgetZone, { id: "campaigns.detail.side", data: campaign, children: [
|
|
595
670
|
/* @__PURE__ */ jsx6(CampaignConfigurationSection, { campaign }),
|
|
596
671
|
/* @__PURE__ */ jsx6(CampaignSpend, { campaign }),
|
|
597
672
|
/* @__PURE__ */ jsx6(CampaignBudget, { campaign })
|
|
598
|
-
] })
|
|
673
|
+
] }) })
|
|
599
674
|
] }) });
|
|
600
675
|
};
|
|
601
676
|
var CampaignDetailPage = Object.assign(Root, {
|
|
@@ -18,11 +18,20 @@ import "./chunk-NBMM2TZK.js";
|
|
|
18
18
|
// src/pages/payouts/[id]/payout-detail-page.tsx
|
|
19
19
|
import { Children } from "react";
|
|
20
20
|
import { useParams } from "react-router-dom";
|
|
21
|
+
import { WidgetZone } from "@mercurjs/dashboard-shared";
|
|
21
22
|
|
|
22
23
|
// src/pages/payouts/[id]/_components/payout-general-section.tsx
|
|
23
24
|
import { Container, Heading, StatusBadge, Text } from "@medusajs/ui";
|
|
25
|
+
import { DisplayExtensionZone, DisplayField } from "@mercurjs/dashboard-shared";
|
|
24
26
|
import { useTranslation } from "react-i18next";
|
|
25
27
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
var GENERAL_FIELD_IDS = [
|
|
29
|
+
"display_id",
|
|
30
|
+
"status",
|
|
31
|
+
"amount",
|
|
32
|
+
"created_at",
|
|
33
|
+
"updated_at"
|
|
34
|
+
];
|
|
26
35
|
var payoutStatusColor = (status) => {
|
|
27
36
|
switch (status) {
|
|
28
37
|
case "paid":
|
|
@@ -45,17 +54,17 @@ var PayoutGeneralSection = ({ payout }) => {
|
|
|
45
54
|
});
|
|
46
55
|
return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
|
|
47
56
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
48
|
-
/* @__PURE__ */ jsxs(Heading, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(DisplayField, { model: "payout", zone: "general", id: "display_id", data: payout, children: /* @__PURE__ */ jsxs(Heading, { children: [
|
|
49
58
|
"#",
|
|
50
59
|
payout.display_id
|
|
51
|
-
] }),
|
|
52
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-2", children: /* @__PURE__ */ jsx(StatusBadge, { color: payoutStatusColor(payout.status), children: statusText }) })
|
|
60
|
+
] }) }),
|
|
61
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-x-2", children: /* @__PURE__ */ jsx(DisplayField, { model: "payout", zone: "general", id: "status", data: payout, children: /* @__PURE__ */ jsx(StatusBadge, { color: payoutStatusColor(payout.status), children: statusText }) }) })
|
|
53
62
|
] }),
|
|
54
|
-
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
63
|
+
/* @__PURE__ */ jsx(DisplayField, { model: "payout", zone: "general", id: "amount", data: payout, children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
55
64
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.amount") }),
|
|
56
65
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: getStylizedAmount(payout.amount, payout.currency_code) })
|
|
57
|
-
] }),
|
|
58
|
-
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
66
|
+
] }) }),
|
|
67
|
+
/* @__PURE__ */ jsx(DisplayField, { model: "payout", zone: "general", id: "created_at", data: payout, children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
59
68
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.createdAt") }),
|
|
60
69
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: new Date(payout.created_at).toLocaleDateString(void 0, {
|
|
61
70
|
year: "numeric",
|
|
@@ -64,8 +73,8 @@ var PayoutGeneralSection = ({ payout }) => {
|
|
|
64
73
|
hour: "2-digit",
|
|
65
74
|
minute: "2-digit"
|
|
66
75
|
}) })
|
|
67
|
-
] }),
|
|
68
|
-
/* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
76
|
+
] }) }),
|
|
77
|
+
/* @__PURE__ */ jsx(DisplayField, { model: "payout", zone: "general", id: "updated_at", data: payout, children: /* @__PURE__ */ jsxs("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
69
78
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", weight: "plus", children: t("fields.updatedAt") }),
|
|
70
79
|
/* @__PURE__ */ jsx(Text, { size: "small", leading: "compact", children: new Date(payout.updated_at).toLocaleDateString(void 0, {
|
|
71
80
|
year: "numeric",
|
|
@@ -74,7 +83,16 @@ var PayoutGeneralSection = ({ payout }) => {
|
|
|
74
83
|
hour: "2-digit",
|
|
75
84
|
minute: "2-digit"
|
|
76
85
|
}) })
|
|
77
|
-
] })
|
|
86
|
+
] }) }),
|
|
87
|
+
/* @__PURE__ */ jsx(
|
|
88
|
+
DisplayExtensionZone,
|
|
89
|
+
{
|
|
90
|
+
model: "payout",
|
|
91
|
+
zone: "general",
|
|
92
|
+
data: payout,
|
|
93
|
+
builtInFieldIds: GENERAL_FIELD_IDS
|
|
94
|
+
}
|
|
95
|
+
)
|
|
78
96
|
] });
|
|
79
97
|
};
|
|
80
98
|
|
|
@@ -89,7 +107,7 @@ var Root = ({ children }) => {
|
|
|
89
107
|
if (isError) {
|
|
90
108
|
throw error;
|
|
91
109
|
}
|
|
92
|
-
return /* @__PURE__ */ jsx2(SingleColumnPage, { showMetadata: true, children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx2(PayoutGeneralSection, { payout }) });
|
|
110
|
+
return /* @__PURE__ */ jsx2(SingleColumnPage, { showMetadata: true, children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsx2(WidgetZone, { id: "payouts.detail.main", data: payout, children: /* @__PURE__ */ jsx2(PayoutGeneralSection, { payout }) }) });
|
|
93
111
|
};
|
|
94
112
|
var PayoutDetailPage = Object.assign(Root, {
|
|
95
113
|
GeneralSection: PayoutGeneralSection
|