@agg-build/ui 2.2.3 → 2.2.4
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/{chunk-QM3WWPCV.mjs → chunk-3R2CQTNM.mjs} +71 -37
- package/dist/{chunk-ZRYHWHTD.mjs → chunk-44GSDH2Y.mjs} +2 -2
- package/dist/{chunk-UTXQUOU3.mjs → chunk-6Z5GQ3KL.mjs} +60 -14
- package/dist/{chunk-4QGZ3FWI.mjs → chunk-7OVSGWI7.mjs} +1 -1
- package/dist/{chunk-JOZPXDNZ.mjs → chunk-MXM5PM4A.mjs} +3 -3
- package/dist/{chunk-LPIAEKSZ.mjs → chunk-SG573ODC.mjs} +1 -1
- package/dist/{chunk-TDLI6F55.mjs → chunk-XJTNK3DS.mjs} +127 -17
- package/dist/events.js +125 -45
- package/dist/events.mjs +3 -3
- package/dist/index.js +250 -60
- package/dist/index.mjs +7 -7
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +250 -60
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +59 -13
- package/dist/primitives.mjs +1 -1
- package/dist/trading.mjs +4 -4
- package/dist/types/events/shared/format-event-title.d.mts +21 -6
- package/dist/types/events/shared/format-event-title.d.ts +21 -6
- package/dist/types/pages/event-market/sports-event-market.utils.d.mts +19 -1
- package/dist/types/pages/event-market/sports-event-market.utils.d.ts +19 -1
- package/package.json +3 -3
package/dist/events.js
CHANGED
|
@@ -5616,23 +5616,69 @@ var isSportEvent = (categories, structureType) => {
|
|
|
5616
5616
|
return isSportCategoryToken(categoryEntry.id) || isSportCategoryToken((_a2 = categoryEntry.category) == null ? void 0 : _a2.id) || isSportCategoryToken((_b = categoryEntry.category) == null ? void 0 : _b.name) || isSportCategoryToken((_c = categoryEntry.category) == null ? void 0 : _c.displayName) || isSportCategoryToken((_d = categoryEntry.category) == null ? void 0 : _d.parentId);
|
|
5617
5617
|
})) != null ? _a : false;
|
|
5618
5618
|
};
|
|
5619
|
-
var
|
|
5620
|
-
|
|
5619
|
+
var hasFixtureMarketMetadata = (venueMarkets) => {
|
|
5620
|
+
var _a;
|
|
5621
|
+
return (_a = venueMarkets == null ? void 0 : venueMarkets.some((venueMarket) => {
|
|
5622
|
+
var _a2, _b, _c, _d;
|
|
5623
|
+
return Boolean(
|
|
5624
|
+
((_a2 = venueMarket.sportsMarketType) == null ? void 0 : _a2.trim()) || ((_b = venueMarket.marketCategory) == null ? void 0 : _b.trim()) || ((_c = venueMarket.marketSubtype) == null ? void 0 : _c.trim()) || ((_d = venueMarket.period) == null ? void 0 : _d.trim()) || venueMarket.lineValue != null
|
|
5625
|
+
);
|
|
5626
|
+
})) != null ? _a : false;
|
|
5627
|
+
};
|
|
5628
|
+
var shouldDisplaySportsEventTimestamp = ({
|
|
5621
5629
|
categories,
|
|
5622
5630
|
structureType,
|
|
5631
|
+
venueMarkets
|
|
5632
|
+
}) => {
|
|
5633
|
+
if (!isSportEvent(categories, structureType)) return false;
|
|
5634
|
+
if (structureType === "sport") {
|
|
5635
|
+
return true;
|
|
5636
|
+
}
|
|
5637
|
+
if (typeof structureType === "string" && structureType.trim()) {
|
|
5638
|
+
return false;
|
|
5639
|
+
}
|
|
5640
|
+
return hasFixtureMarketMetadata(venueMarkets);
|
|
5641
|
+
};
|
|
5642
|
+
var resolveSportsEventTimestamp = ({
|
|
5623
5643
|
gameStartTime,
|
|
5624
5644
|
endDate
|
|
5645
|
+
}) => {
|
|
5646
|
+
return (gameStartTime == null ? void 0 : gameStartTime.trim()) || (endDate == null ? void 0 : endDate.trim()) || null;
|
|
5647
|
+
};
|
|
5648
|
+
var resolveEventTimestampLabel = ({
|
|
5649
|
+
categories,
|
|
5650
|
+
structureType,
|
|
5651
|
+
gameStartTime,
|
|
5652
|
+
endDate,
|
|
5653
|
+
venueMarkets
|
|
5654
|
+
}) => {
|
|
5655
|
+
if (!shouldDisplaySportsEventTimestamp({ categories, structureType, venueMarkets })) {
|
|
5656
|
+
return null;
|
|
5657
|
+
}
|
|
5658
|
+
const timestamp = resolveSportsEventTimestamp({ gameStartTime, endDate });
|
|
5659
|
+
if (!timestamp) return null;
|
|
5660
|
+
return formatSportsEventTimeEt(timestamp);
|
|
5661
|
+
};
|
|
5662
|
+
var resolveEventHeading = ({
|
|
5663
|
+
title: title2,
|
|
5664
|
+
categories,
|
|
5665
|
+
structureType,
|
|
5666
|
+
gameStartTime,
|
|
5667
|
+
endDate,
|
|
5668
|
+
venueMarkets
|
|
5625
5669
|
}) => {
|
|
5626
5670
|
const resolvedTitle = title2.trim();
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5671
|
+
return {
|
|
5672
|
+
title: resolvedTitle,
|
|
5673
|
+
timestampLabel: resolveEventTimestampLabel({
|
|
5674
|
+
title: resolvedTitle,
|
|
5675
|
+
categories,
|
|
5676
|
+
structureType,
|
|
5677
|
+
gameStartTime,
|
|
5678
|
+
endDate,
|
|
5679
|
+
venueMarkets
|
|
5680
|
+
})
|
|
5681
|
+
};
|
|
5636
5682
|
};
|
|
5637
5683
|
|
|
5638
5684
|
// src/events/item/event-list-item.utils.ts
|
|
@@ -7546,13 +7592,16 @@ var EventListItemContent = ({
|
|
|
7546
7592
|
const config = (0, import_hooks31.useSdkUiConfig)();
|
|
7547
7593
|
const labels = (0, import_hooks31.useLabels)();
|
|
7548
7594
|
const allVenueMarkets = (0, import_react10.useMemo)(() => event.venueMarkets, [event.venueMarkets]);
|
|
7549
|
-
const
|
|
7595
|
+
const eventHeading = resolveEventHeading({
|
|
7550
7596
|
title: event.title,
|
|
7551
7597
|
categories: event.categories,
|
|
7552
7598
|
structureType: event.structureType,
|
|
7553
7599
|
gameStartTime: event.gameStartTime,
|
|
7554
|
-
endDate: event.endDate
|
|
7600
|
+
endDate: event.endDate,
|
|
7601
|
+
venueMarkets: event.venueMarkets
|
|
7555
7602
|
});
|
|
7603
|
+
const resolvedTitle = eventHeading.title;
|
|
7604
|
+
const resolvedTimestamp = eventHeading.timestampLabel;
|
|
7556
7605
|
const resolvedImage = event.image;
|
|
7557
7606
|
const visibleVenueLogos = (0, import_react10.useMemo)(() => {
|
|
7558
7607
|
var _a2;
|
|
@@ -7858,10 +7907,10 @@ var EventListItemContent = ({
|
|
|
7858
7907
|
href,
|
|
7859
7908
|
onClick: handleClick,
|
|
7860
7909
|
onKeyDown: handleKeyDown,
|
|
7861
|
-
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
7910
|
+
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle, resolvedTimestamp].filter(Boolean).join(" "),
|
|
7862
7911
|
withGradient: true,
|
|
7863
7912
|
children: [
|
|
7864
|
-
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: cn("agg-event-card-header flex
|
|
7913
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: cn("agg-event-card-header flex items-center gap-4", classNames == null ? void 0 : classNames.header), children: [
|
|
7865
7914
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7866
7915
|
RemoteImage,
|
|
7867
7916
|
{
|
|
@@ -7873,19 +7922,32 @@ var EventListItemContent = ({
|
|
|
7873
7922
|
}
|
|
7874
7923
|
}
|
|
7875
7924
|
),
|
|
7876
|
-
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7925
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "min-w-0 flex-1 self-stretch", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)("div", { className: "flex h-12 min-w-0 flex-col justify-center", children: [
|
|
7926
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7927
|
+
Typography,
|
|
7928
|
+
{
|
|
7929
|
+
variant: "body-strong",
|
|
7930
|
+
className: cn(
|
|
7931
|
+
"agg-event-title",
|
|
7932
|
+
"min-w-0 text-agg-base font-agg-bold leading-agg-6",
|
|
7933
|
+
resolvedTimestamp ? "truncate whitespace-nowrap" : "text-wrap wrap-break-word line-clamp-2",
|
|
7934
|
+
classNames == null ? void 0 : classNames.title
|
|
7935
|
+
),
|
|
7936
|
+
children: resolvedTitle
|
|
7937
|
+
}
|
|
7938
|
+
),
|
|
7939
|
+
resolvedTimestamp ? /* @__PURE__ */ (0, import_jsx_runtime119.jsx)("div", { className: "agg-event-timestamp-row mt-0.5 h-5 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
7940
|
+
Typography,
|
|
7941
|
+
{
|
|
7942
|
+
variant: "body",
|
|
7943
|
+
className: cn(
|
|
7944
|
+
"agg-event-timestamp min-w-0 truncate",
|
|
7945
|
+
"text-agg-sm leading-agg-5 text-agg-muted-foreground"
|
|
7946
|
+
),
|
|
7947
|
+
children: resolvedTimestamp
|
|
7948
|
+
}
|
|
7949
|
+
) }) : null
|
|
7950
|
+
] }) })
|
|
7889
7951
|
] }),
|
|
7890
7952
|
/* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
7891
7953
|
"div",
|
|
@@ -10836,19 +10898,27 @@ var EventListItemDetailsContent = ({
|
|
|
10836
10898
|
return `${config.formatting.formatCompactCurrency(resolvedVolume)} ${labels.eventItemDetails.volumeSuffix}`;
|
|
10837
10899
|
}, [config, event.volume, labels.eventItemDetails.volumeSuffix, venueMarkets]);
|
|
10838
10900
|
const resolvedTitle = (0, import_react16.useMemo)(() => {
|
|
10839
|
-
return
|
|
10901
|
+
return resolveEventHeading({
|
|
10840
10902
|
title: event.title,
|
|
10841
10903
|
categories: event.categories,
|
|
10842
10904
|
structureType: event.structureType,
|
|
10843
10905
|
gameStartTime: event.gameStartTime,
|
|
10844
|
-
endDate: event.endDate
|
|
10906
|
+
endDate: event.endDate,
|
|
10907
|
+
venueMarkets: event.venueMarkets
|
|
10845
10908
|
});
|
|
10846
|
-
}, [
|
|
10909
|
+
}, [
|
|
10910
|
+
event.categories,
|
|
10911
|
+
event.endDate,
|
|
10912
|
+
event.gameStartTime,
|
|
10913
|
+
event.structureType,
|
|
10914
|
+
event.title,
|
|
10915
|
+
event.venueMarkets
|
|
10916
|
+
]);
|
|
10847
10917
|
return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
10848
10918
|
Card,
|
|
10849
10919
|
{
|
|
10850
10920
|
className: cn("group/agg-event-details", detailsBaseCardClassName, classNames == null ? void 0 : classNames.root),
|
|
10851
|
-
"aria-label": ariaLabel != null ? ariaLabel : resolvedTitle,
|
|
10921
|
+
"aria-label": ariaLabel != null ? ariaLabel : [resolvedTitle.title, resolvedTitle.timestampLabel].filter(Boolean).join(" "),
|
|
10852
10922
|
onClick: () => {
|
|
10853
10923
|
onClick == null ? void 0 : onClick(event);
|
|
10854
10924
|
},
|
|
@@ -10873,19 +10943,29 @@ var EventListItemDetailsContent = ({
|
|
|
10873
10943
|
}
|
|
10874
10944
|
),
|
|
10875
10945
|
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
10876
|
-
/* @__PURE__ */ (0, import_jsx_runtime125.
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10946
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { className: "min-w-0", children: [
|
|
10947
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
10948
|
+
Typography,
|
|
10949
|
+
{
|
|
10950
|
+
variant: "body-strong",
|
|
10951
|
+
className: cn(
|
|
10952
|
+
"agg-event-title",
|
|
10953
|
+
"min-w-0 text-agg-base font-agg-bold! leading-agg-6 md:text-agg-2xl md:leading-agg-8",
|
|
10954
|
+
resolvedTitle.timestampLabel ? "truncate whitespace-nowrap" : "truncate text-wrap wrap-break-word line-clamp-2",
|
|
10955
|
+
classNames == null ? void 0 : classNames.title
|
|
10956
|
+
),
|
|
10957
|
+
children: resolvedTitle.title
|
|
10958
|
+
}
|
|
10959
|
+
),
|
|
10960
|
+
resolvedTitle.timestampLabel ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
10961
|
+
Typography,
|
|
10962
|
+
{
|
|
10963
|
+
variant: "body",
|
|
10964
|
+
className: "agg-event-timestamp mt-0.5 min-w-0 truncate text-agg-sm leading-agg-5 text-agg-muted-foreground",
|
|
10965
|
+
children: resolvedTitle.timestampLabel
|
|
10966
|
+
}
|
|
10967
|
+
) : null
|
|
10968
|
+
] }),
|
|
10889
10969
|
venueMarkets.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
10890
10970
|
EventListItemDetailsMarketSelector,
|
|
10891
10971
|
{
|
package/dist/events.mjs
CHANGED
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
orderbookRowLimitDefault,
|
|
17
17
|
resolveEventDetailsSyncKey,
|
|
18
18
|
useCenterOrderbookSpread
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3R2CQTNM.mjs";
|
|
20
20
|
import {
|
|
21
21
|
formatProbabilityCents,
|
|
22
22
|
resolveOrderBookRows,
|
|
23
23
|
resolveUnifiedOrderBookEntries
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
} from "./chunk-SG573ODC.mjs";
|
|
25
|
+
import "./chunk-6Z5GQ3KL.mjs";
|
|
26
26
|
export {
|
|
27
27
|
EventList,
|
|
28
28
|
EventListItem,
|