@agg-build/ui 2.7.2 → 2.8.0
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-7R2SMMAG.mjs → chunk-2QCNDFNC.mjs} +193 -103
- package/dist/{chunk-EDQ64EKO.mjs → chunk-AKLGQ6AB.mjs} +254 -53
- package/dist/{chunk-FMYYPNZZ.mjs → chunk-KO6VTRV6.mjs} +101 -27
- package/dist/{chunk-AHQA3B7D.mjs → chunk-KX3TQ7WC.mjs} +1 -1
- package/dist/{chunk-EKUH3265.mjs → chunk-MKU5Q6PN.mjs} +51 -13
- package/dist/{chunk-O27JUYCF.mjs → chunk-R5S2QOYL.mjs} +495 -289
- package/dist/{chunk-JQKJDSTW.mjs → chunk-VR5ZRDQT.mjs} +3 -2
- package/dist/events.js +198 -91
- package/dist/events.mjs +3 -3
- package/dist/index.js +1350 -751
- package/dist/index.mjs +7 -7
- package/dist/modals.js +941 -418
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +1008 -609
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +94 -26
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +1403 -902
- package/dist/trading.mjs +4 -4
- package/dist/types/events/orderbook/orderbook.utils.d.mts +1 -1
- package/dist/types/events/orderbook/orderbook.utils.d.ts +1 -1
- package/dist/types/pages/user-profile/components/open-order-row.d.mts +1 -0
- package/dist/types/pages/user-profile/components/open-order-row.d.ts +1 -0
- package/dist/types/pages/user-profile/position-view-model.d.mts +15 -4
- package/dist/types/pages/user-profile/position-view-model.d.ts +15 -4
- package/dist/types/primitives/select/index.d.mts +1 -1
- package/dist/types/primitives/select/index.d.ts +1 -1
- package/dist/types/primitives/select/select.types.d.mts +8 -0
- package/dist/types/primitives/select/select.types.d.ts +8 -0
- package/dist/types/profile/profile-modal.constants.d.mts +2 -1
- package/dist/types/profile/profile-modal.constants.d.ts +2 -1
- package/dist/types/profile/tabs/balance-management-tab.d.mts +3 -0
- package/dist/types/profile/tabs/balance-management-tab.d.ts +3 -0
- package/dist/types/trading/place-order/index.place-order.constants.d.mts +2 -1
- package/dist/types/trading/place-order/index.place-order.constants.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +6 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +6 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +10 -2
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +10 -2
- package/package.json +2 -2
|
@@ -8528,7 +8528,13 @@ NumberValue.displayName = "NumberValue";
|
|
|
8528
8528
|
|
|
8529
8529
|
// src/primitives/select/index.tsx
|
|
8530
8530
|
import { useLabels as useLabels14, useSdkUiConfig as useSdkUiConfig14 } from "@agg-build/hooks";
|
|
8531
|
-
import {
|
|
8531
|
+
import {
|
|
8532
|
+
useCallback as useCallback4,
|
|
8533
|
+
useEffect as useEffect7,
|
|
8534
|
+
useLayoutEffect as useLayoutEffect2,
|
|
8535
|
+
useRef as useRef7,
|
|
8536
|
+
useState as useState8
|
|
8537
|
+
} from "react";
|
|
8532
8538
|
import { createPortal } from "react-dom";
|
|
8533
8539
|
|
|
8534
8540
|
// src/primitives/select/select.constants.ts
|
|
@@ -8565,7 +8571,11 @@ var Select = ({
|
|
|
8565
8571
|
triggerClassName,
|
|
8566
8572
|
contentClassName,
|
|
8567
8573
|
itemClassName,
|
|
8568
|
-
disabled = SELECT_DEFAULT_IS_DISABLED
|
|
8574
|
+
disabled = SELECT_DEFAULT_IS_DISABLED,
|
|
8575
|
+
variant = "default",
|
|
8576
|
+
openOnHover = false,
|
|
8577
|
+
contentAlign = "start",
|
|
8578
|
+
contentSideOffset = 8
|
|
8569
8579
|
}) => {
|
|
8570
8580
|
var _a;
|
|
8571
8581
|
const labels = useLabels14();
|
|
@@ -8576,17 +8586,30 @@ var Select = ({
|
|
|
8576
8586
|
const isDisabled = resolveIsSelectDisabled({ disabled, items });
|
|
8577
8587
|
const selectedItem = resolveSelectedItem(items, value);
|
|
8578
8588
|
const [isOpen, setIsOpen] = useState8(false);
|
|
8579
|
-
const [menuRect, setMenuRect] = useState8(
|
|
8580
|
-
null
|
|
8581
|
-
);
|
|
8589
|
+
const [menuRect, setMenuRect] = useState8(null);
|
|
8582
8590
|
const containerRef = useRef7(null);
|
|
8583
8591
|
const portalRef = useRef7(null);
|
|
8584
|
-
const
|
|
8592
|
+
const closeTimerRef = useRef7(null);
|
|
8593
|
+
const openedByHoverRef = useRef7(false);
|
|
8594
|
+
const handleClose = useCallback4(() => {
|
|
8595
|
+
setIsOpen(false);
|
|
8596
|
+
openedByHoverRef.current = false;
|
|
8597
|
+
}, []);
|
|
8585
8598
|
const updateMenuRect = useCallback4(() => {
|
|
8586
8599
|
const el = containerRef.current;
|
|
8587
8600
|
if (!el) return;
|
|
8588
8601
|
const r = el.getBoundingClientRect();
|
|
8589
|
-
setMenuRect({
|
|
8602
|
+
setMenuRect({
|
|
8603
|
+
top: r.bottom + contentSideOffset,
|
|
8604
|
+
left: r.left,
|
|
8605
|
+
right: r.right,
|
|
8606
|
+
width: r.width
|
|
8607
|
+
});
|
|
8608
|
+
}, [contentSideOffset]);
|
|
8609
|
+
useEffect7(() => {
|
|
8610
|
+
return () => {
|
|
8611
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
8612
|
+
};
|
|
8590
8613
|
}, []);
|
|
8591
8614
|
useLayoutEffect2(() => {
|
|
8592
8615
|
if (!isOpen) {
|
|
@@ -8624,7 +8647,33 @@ var Select = ({
|
|
|
8624
8647
|
document.addEventListener("keydown", handleKeyDown);
|
|
8625
8648
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
8626
8649
|
}, [isOpen, handleClose]);
|
|
8627
|
-
const
|
|
8650
|
+
const handlePointerEnter = (event) => {
|
|
8651
|
+
if (!openOnHover || isDisabled || event.pointerType === "touch") return;
|
|
8652
|
+
if (closeTimerRef.current) {
|
|
8653
|
+
clearTimeout(closeTimerRef.current);
|
|
8654
|
+
closeTimerRef.current = null;
|
|
8655
|
+
}
|
|
8656
|
+
if (isOpen) return;
|
|
8657
|
+
openedByHoverRef.current = true;
|
|
8658
|
+
setIsOpen(true);
|
|
8659
|
+
};
|
|
8660
|
+
const handlePointerLeave = (event) => {
|
|
8661
|
+
if (!openOnHover || event.pointerType === "touch") return;
|
|
8662
|
+
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
8663
|
+
closeTimerRef.current = setTimeout(() => {
|
|
8664
|
+
handleClose();
|
|
8665
|
+
closeTimerRef.current = null;
|
|
8666
|
+
}, 120);
|
|
8667
|
+
};
|
|
8668
|
+
const handleTriggerClick = () => {
|
|
8669
|
+
if (openedByHoverRef.current && isOpen) {
|
|
8670
|
+
openedByHoverRef.current = false;
|
|
8671
|
+
return;
|
|
8672
|
+
}
|
|
8673
|
+
setIsOpen((previousValue) => !previousValue);
|
|
8674
|
+
};
|
|
8675
|
+
const isInline = variant === "inline";
|
|
8676
|
+
const triggerRadiusClass = triggerClassName != null ? triggerClassName : isInline ? "rounded-agg-sm" : "rounded-agg-md";
|
|
8628
8677
|
const listbox = menuRect ? /* @__PURE__ */ jsx129(
|
|
8629
8678
|
"div",
|
|
8630
8679
|
{
|
|
@@ -8635,16 +8684,20 @@ var Select = ({
|
|
|
8635
8684
|
style: {
|
|
8636
8685
|
position: "fixed",
|
|
8637
8686
|
top: menuRect.top,
|
|
8638
|
-
left: menuRect.left,
|
|
8687
|
+
left: contentAlign === "start" ? menuRect.left : void 0,
|
|
8688
|
+
right: contentAlign === "end" ? window.innerWidth - menuRect.right : void 0,
|
|
8639
8689
|
width: menuRect.width,
|
|
8640
8690
|
zIndex: SELECT_DROPDOWN_Z
|
|
8641
8691
|
},
|
|
8642
8692
|
className: cn(
|
|
8643
8693
|
AGG_ROOT_CLASS_NAME,
|
|
8644
8694
|
rootClassName,
|
|
8645
|
-
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto
|
|
8695
|
+
"agg-select-content pointer-events-auto max-h-[min(20rem,calc(100vh-4rem))] overflow-y-auto border border-agg-separator bg-agg-secondary flex flex-col",
|
|
8696
|
+
isInline ? "min-w-[120px] gap-0 rounded-agg-lg py-1 shadow-[0_8px_16px_rgba(0,0,0,0.12)]" : "gap-1 rounded-[12px] p-2 shadow-[0_8px_16px_rgba(0,0,0,0.1)]",
|
|
8646
8697
|
contentClassName
|
|
8647
8698
|
),
|
|
8699
|
+
onPointerEnter: handlePointerEnter,
|
|
8700
|
+
onPointerLeave: handlePointerLeave,
|
|
8648
8701
|
children: items.map((item) => {
|
|
8649
8702
|
const isSelected = item.value === value;
|
|
8650
8703
|
const isHidden = item.hidden === true;
|
|
@@ -8658,9 +8711,10 @@ var Select = ({
|
|
|
8658
8711
|
disabled: item.disabled,
|
|
8659
8712
|
className: cn(
|
|
8660
8713
|
"agg-select-item",
|
|
8661
|
-
"relative flex w-full items-center
|
|
8714
|
+
"relative flex w-full items-center text-left text-agg-sm leading-agg-5 outline-none",
|
|
8715
|
+
isInline ? "gap-2 px-4 py-2" : "gap-3 rounded-[6px] py-3 pl-3 pr-5",
|
|
8662
8716
|
"hover:bg-agg-secondary-hover focus-visible:bg-agg-secondary-hover",
|
|
8663
|
-
isSelected ? "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
8717
|
+
isSelected ? isInline ? "font-agg-bold text-agg-foreground" : "bg-agg-primary/10 font-agg-normal text-agg-primary" : "font-agg-normal text-agg-foreground",
|
|
8664
8718
|
item.disabled && "cursor-not-allowed opacity-60",
|
|
8665
8719
|
itemClassName
|
|
8666
8720
|
),
|
|
@@ -8672,6 +8726,13 @@ var Select = ({
|
|
|
8672
8726
|
handleClose();
|
|
8673
8727
|
},
|
|
8674
8728
|
children: [
|
|
8729
|
+
isInline && isSelected ? /* @__PURE__ */ jsx129(
|
|
8730
|
+
"span",
|
|
8731
|
+
{
|
|
8732
|
+
className: "agg-select-item-indicator absolute bottom-2 left-0 top-2 w-1 bg-agg-primary",
|
|
8733
|
+
"aria-hidden": true
|
|
8734
|
+
}
|
|
8735
|
+
) : null,
|
|
8675
8736
|
item.icon ? /* @__PURE__ */ jsx129(
|
|
8676
8737
|
"span",
|
|
8677
8738
|
{
|
|
@@ -8701,7 +8762,11 @@ var Select = ({
|
|
|
8701
8762
|
"div",
|
|
8702
8763
|
{
|
|
8703
8764
|
ref: containerRef,
|
|
8704
|
-
className: cn(
|
|
8765
|
+
className: cn(
|
|
8766
|
+
"group/agg-select relative inline-flex",
|
|
8767
|
+
isInline ? "w-auto" : "w-full",
|
|
8768
|
+
className
|
|
8769
|
+
),
|
|
8705
8770
|
children: [
|
|
8706
8771
|
/* @__PURE__ */ jsxs122(
|
|
8707
8772
|
"button",
|
|
@@ -8713,19 +8778,19 @@ var Select = ({
|
|
|
8713
8778
|
disabled: isDisabled,
|
|
8714
8779
|
className: cn(
|
|
8715
8780
|
"agg-select-trigger",
|
|
8716
|
-
"flex
|
|
8717
|
-
"
|
|
8781
|
+
"flex cursor-pointer items-center gap-2 font-agg-sans text-agg-foreground outline-none disabled:cursor-not-allowed disabled:opacity-60",
|
|
8782
|
+
isInline ? "h-auto w-auto bg-transparent px-2 py-1 pr-8 text-left text-agg-base leading-agg-6" : "h-10 w-full border border-agg-separator bg-agg-secondary px-3 py-[9px] pr-10 text-left text-agg-sm leading-agg-5",
|
|
8718
8783
|
triggerRadiusClass,
|
|
8719
|
-
getMotionClassName(
|
|
8784
|
+
!isInline && getMotionClassName(
|
|
8720
8785
|
enableAnimations,
|
|
8721
8786
|
"transition-[border-color,box-shadow] duration-200 ease-in-out"
|
|
8722
8787
|
),
|
|
8723
|
-
isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
8724
|
-
"hover:border-agg-primary"
|
|
8725
|
-
"focus:border-agg-primary focus:ring-0",
|
|
8726
|
-
"disabled:cursor-not-allowed disabled:opacity-60"
|
|
8788
|
+
!isInline && isOpen && "border-2 border-agg-primary px-[11px] py-2 ring-0",
|
|
8789
|
+
!isInline && "hover:border-agg-primary focus:border-agg-primary focus:ring-0"
|
|
8727
8790
|
),
|
|
8728
|
-
onClick:
|
|
8791
|
+
onClick: handleTriggerClick,
|
|
8792
|
+
onPointerEnter: handlePointerEnter,
|
|
8793
|
+
onPointerLeave: handlePointerLeave,
|
|
8729
8794
|
children: [
|
|
8730
8795
|
(selectedItem == null ? void 0 : selectedItem.icon) ? /* @__PURE__ */ jsx129("span", { className: "h-4 w-4 shrink-0 [&_svg]:h-full [&_svg]:w-full", children: selectedItem.icon }) : (selectedItem == null ? void 0 : selectedItem.iconUrl) ? /* @__PURE__ */ jsx129(
|
|
8731
8796
|
RemoteImage,
|
|
@@ -8739,14 +8804,23 @@ var Select = ({
|
|
|
8739
8804
|
]
|
|
8740
8805
|
}
|
|
8741
8806
|
),
|
|
8742
|
-
/* @__PURE__ */ jsx129(
|
|
8743
|
-
|
|
8807
|
+
/* @__PURE__ */ jsx129(
|
|
8808
|
+
"span",
|
|
8744
8809
|
{
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8810
|
+
className: cn(
|
|
8811
|
+
"agg-select-chevron pointer-events-none absolute inset-y-0 inline-flex items-center justify-center",
|
|
8812
|
+
isInline ? "right-2 text-agg-foreground" : "right-3 text-agg-muted-foreground"
|
|
8813
|
+
),
|
|
8814
|
+
children: /* @__PURE__ */ jsx129(
|
|
8815
|
+
Icon,
|
|
8816
|
+
{
|
|
8817
|
+
name: isOpen ? "chevron-up" : "chevron-down-thin",
|
|
8818
|
+
size: "small",
|
|
8819
|
+
color: "currentColor"
|
|
8820
|
+
}
|
|
8821
|
+
)
|
|
8748
8822
|
}
|
|
8749
|
-
)
|
|
8823
|
+
),
|
|
8750
8824
|
isOpen && typeof document !== "undefined" && listbox ? createPortal(listbox, resolveSelectPortalContainer(containerRef.current)) : null
|
|
8751
8825
|
]
|
|
8752
8826
|
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
resolveUnifiedOrderBookEntries,
|
|
25
25
|
sortOutcomeSelectorOutcomes,
|
|
26
26
|
useEventTradingContext
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VR5ZRDQT.mjs";
|
|
28
28
|
import {
|
|
29
29
|
AutocompleteSelect,
|
|
30
30
|
Badge,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
sortCategoriesForNavigation,
|
|
77
77
|
sortOutcomes,
|
|
78
78
|
splitEventsByLifecycle
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-KO6VTRV6.mjs";
|
|
80
80
|
|
|
81
81
|
// src/events/item/index.tsx
|
|
82
82
|
import {
|
|
@@ -1068,6 +1068,17 @@ var matchesSelectedOutcomeLabel = (outcome, selectedOutcomeLabel) => {
|
|
|
1068
1068
|
return normalizedCandidate === normalizedSelectedLabel || toSemanticOutcomeLabel(candidate) === semanticSelectedLabel;
|
|
1069
1069
|
});
|
|
1070
1070
|
};
|
|
1071
|
+
var isTeamFramedMarket = (market) => {
|
|
1072
|
+
var _a;
|
|
1073
|
+
const outcomes = (_a = market.venueMarketOutcomes) != null ? _a : [];
|
|
1074
|
+
if (outcomes.length < 2) return false;
|
|
1075
|
+
return outcomes.every(
|
|
1076
|
+
(outcome) => getOutcomeLabelCandidates(outcome).some((candidate) => {
|
|
1077
|
+
const semanticCandidate = toSemanticOutcomeLabel(candidate);
|
|
1078
|
+
return semanticCandidate !== "" && semanticCandidate !== "yes" && semanticCandidate !== "no";
|
|
1079
|
+
})
|
|
1080
|
+
);
|
|
1081
|
+
};
|
|
1071
1082
|
var isValidLevel = (level) => {
|
|
1072
1083
|
return level != null && Number.isFinite(level.price) && Number.isFinite(level.size) && level.price >= 0 && level.price <= 1 && level.size > 0;
|
|
1073
1084
|
};
|
|
@@ -1212,6 +1223,7 @@ var collectEligibleVenueOutcomes = ({
|
|
|
1212
1223
|
const seenMarketIds = /* @__PURE__ */ new Set();
|
|
1213
1224
|
const seenOutcomeIds = /* @__PURE__ */ new Set();
|
|
1214
1225
|
const result = [];
|
|
1226
|
+
let selectedAnchorMarket = null;
|
|
1215
1227
|
if (selectedOutcomeId) {
|
|
1216
1228
|
for (const market of venueMarkets) {
|
|
1217
1229
|
const outcome = market.venueMarketOutcomes.find((o) => o.id === selectedOutcomeId);
|
|
@@ -1265,6 +1277,16 @@ var collectEligibleVenueOutcomes = ({
|
|
|
1265
1277
|
});
|
|
1266
1278
|
return result;
|
|
1267
1279
|
}
|
|
1280
|
+
selectedAnchorMarket = market;
|
|
1281
|
+
seenMarketIds.add(market.id);
|
|
1282
|
+
seenOutcomeIds.add(outcome.id);
|
|
1283
|
+
result.push({
|
|
1284
|
+
venue: market.venue,
|
|
1285
|
+
market,
|
|
1286
|
+
outcome,
|
|
1287
|
+
outcomeId: outcome.id,
|
|
1288
|
+
semanticLabel
|
|
1289
|
+
});
|
|
1268
1290
|
break;
|
|
1269
1291
|
}
|
|
1270
1292
|
}
|
|
@@ -1307,10 +1329,18 @@ var collectEligibleVenueOutcomes = ({
|
|
|
1307
1329
|
}
|
|
1308
1330
|
for (const market of venueMarkets) {
|
|
1309
1331
|
if (seenMarketIds.has(market.id)) continue;
|
|
1332
|
+
if (selectedAnchorMarket && result.some(
|
|
1333
|
+
(entry) => entry.venue === market.venue && entry.market.question.trim() !== market.question.trim()
|
|
1334
|
+
)) {
|
|
1335
|
+
continue;
|
|
1336
|
+
}
|
|
1310
1337
|
const matchedOutcome = sortOutcomes(market.venueMarketOutcomes).find(
|
|
1311
1338
|
(outcome) => matchesSelectedOutcomeLabel(outcome, selectedOutcomeLabel)
|
|
1312
1339
|
);
|
|
1313
1340
|
if (!matchedOutcome || seenOutcomeIds.has(matchedOutcome.id)) continue;
|
|
1341
|
+
if (selectedAnchorMarket && isTeamFramedMarket(market) !== isTeamFramedMarket(selectedAnchorMarket)) {
|
|
1342
|
+
continue;
|
|
1343
|
+
}
|
|
1314
1344
|
const candidateRefs = (_c = matchedOutcome.matchedVenueMarketOutcomes) != null ? _c : [];
|
|
1315
1345
|
if (candidateRefs.length > 0) {
|
|
1316
1346
|
const sharesAnchor = candidateRefs.some(
|
|
@@ -2319,7 +2349,7 @@ var EventListItemDetailsGraphSection = ({
|
|
|
2319
2349
|
}, [chartOutcomeLabel, (_d = tradingContext == null ? void 0 : tradingContext.selectedOutcome) == null ? void 0 : _d.label]);
|
|
2320
2350
|
const {
|
|
2321
2351
|
chart: { selectedChartTimeRange },
|
|
2322
|
-
formatting: { formatPercent },
|
|
2352
|
+
formatting: { formatPercent, formatPrice },
|
|
2323
2353
|
general: { theme }
|
|
2324
2354
|
} = useSdkUiConfig2();
|
|
2325
2355
|
const isDarkTheme = theme === "dark";
|
|
@@ -2594,8 +2624,8 @@ var EventListItemDetailsGraphSection = ({
|
|
|
2594
2624
|
});
|
|
2595
2625
|
return {
|
|
2596
2626
|
value: outcome.id,
|
|
2597
|
-
label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price)}`,
|
|
2598
|
-
ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price)}`
|
|
2627
|
+
label: `${(_d3 = outcome.title) != null ? _d3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
2628
|
+
ariaLabel: `${(_e2 = outcome.title) != null ? _e2 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`
|
|
2599
2629
|
};
|
|
2600
2630
|
})
|
|
2601
2631
|
}
|
|
@@ -3195,6 +3225,7 @@ var OrderbookRow = ({
|
|
|
3195
3225
|
entry,
|
|
3196
3226
|
formatNumber,
|
|
3197
3227
|
formatCurrency,
|
|
3228
|
+
formatPrice,
|
|
3198
3229
|
enableAnimations,
|
|
3199
3230
|
showBadge,
|
|
3200
3231
|
badgeLabel
|
|
@@ -3263,7 +3294,7 @@ var OrderbookRow = ({
|
|
|
3263
3294
|
"w-9 min-w-9 md:min-w-10 md:w-10 text-agg-sm font-agg-bold leading-agg-5",
|
|
3264
3295
|
priceClassName
|
|
3265
3296
|
),
|
|
3266
|
-
children: formatProbabilityCents(entry.row.price)
|
|
3297
|
+
children: formatProbabilityCents(entry.row.price, formatPrice)
|
|
3267
3298
|
}
|
|
3268
3299
|
),
|
|
3269
3300
|
/* @__PURE__ */ jsx6(OrderbookVenueLogos, { venues })
|
|
@@ -3285,7 +3316,10 @@ var Orderbook = ({
|
|
|
3285
3316
|
className
|
|
3286
3317
|
}) => {
|
|
3287
3318
|
var _a, _b, _c, _d, _e;
|
|
3288
|
-
const {
|
|
3319
|
+
const {
|
|
3320
|
+
enableWebsocketsLogs,
|
|
3321
|
+
formatting: { formatPrice }
|
|
3322
|
+
} = useAggUiConfig();
|
|
3289
3323
|
const labels = __spreadValues(__spreadValues({}, orderbookDefaultLabels), labelsProp);
|
|
3290
3324
|
const scrollContainerRef = useRef5(null);
|
|
3291
3325
|
const spreadRowRef = useRef5(null);
|
|
@@ -3350,6 +3384,7 @@ var Orderbook = ({
|
|
|
3350
3384
|
entry,
|
|
3351
3385
|
formatNumber,
|
|
3352
3386
|
formatCurrency,
|
|
3387
|
+
formatPrice,
|
|
3353
3388
|
enableAnimations,
|
|
3354
3389
|
showBadge: index === askEntries.length - 1,
|
|
3355
3390
|
badgeLabel: labels.asks
|
|
@@ -3362,7 +3397,7 @@ var Orderbook = ({
|
|
|
3362
3397
|
ref: spreadRowRef,
|
|
3363
3398
|
className: "agg-orderbook-spread flex items-center border-y border-agg-separator h-9 px-5 py-2 gap-3 md:gap-10",
|
|
3364
3399
|
role: "separator",
|
|
3365
|
-
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
3400
|
+
"aria-label": `${labels.midPrice}: ${formatProbabilityCents((_b = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _b : null, formatPrice)}, ${labels.spread}: ${formatProbabilityCents((_c = spreadEntry == null ? void 0 : spreadEntry.spread) != null ? _c : null)}`,
|
|
3366
3401
|
children: [
|
|
3367
3402
|
/* @__PURE__ */ jsxs5(
|
|
3368
3403
|
Typography,
|
|
@@ -3372,7 +3407,7 @@ var Orderbook = ({
|
|
|
3372
3407
|
children: [
|
|
3373
3408
|
"Last: ",
|
|
3374
3409
|
labels.lastOutcome ? `${labels.lastOutcome} ` : "",
|
|
3375
|
-
formatProbabilityCents((_d = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _d : null)
|
|
3410
|
+
formatProbabilityCents((_d = spreadEntry == null ? void 0 : spreadEntry.midPrice) != null ? _d : null, formatPrice)
|
|
3376
3411
|
]
|
|
3377
3412
|
}
|
|
3378
3413
|
),
|
|
@@ -3399,6 +3434,7 @@ var Orderbook = ({
|
|
|
3399
3434
|
entry,
|
|
3400
3435
|
formatNumber,
|
|
3401
3436
|
formatCurrency,
|
|
3437
|
+
formatPrice,
|
|
3402
3438
|
enableAnimations,
|
|
3403
3439
|
showBadge: index === 0,
|
|
3404
3440
|
badgeLabel: labels.bids
|
|
@@ -3569,6 +3605,7 @@ var buildVenueMarketIdByVenue = (venueMarkets) => {
|
|
|
3569
3605
|
};
|
|
3570
3606
|
|
|
3571
3607
|
// src/events/market-details/market-details-outcome-button.tsx
|
|
3608
|
+
import { useAggUiConfig as useAggUiConfig2 } from "@agg-build/hooks";
|
|
3572
3609
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3573
3610
|
var marketDetailsOutcomeButtonToneClasses = {
|
|
3574
3611
|
positive: {
|
|
@@ -3619,6 +3656,7 @@ var OutcomePriceContent = ({
|
|
|
3619
3656
|
value,
|
|
3620
3657
|
textClassName
|
|
3621
3658
|
}) => {
|
|
3659
|
+
const { formatPrice } = useAggUiConfig2().formatting;
|
|
3622
3660
|
if (isLoading) {
|
|
3623
3661
|
return /* @__PURE__ */ jsx8(
|
|
3624
3662
|
"span",
|
|
@@ -3637,7 +3675,7 @@ var OutcomePriceContent = ({
|
|
|
3637
3675
|
as: "span",
|
|
3638
3676
|
variant: isSelected ? "body-strong" : "body",
|
|
3639
3677
|
className: cn("shrink-0 whitespace-nowrap", textClassName),
|
|
3640
|
-
children: formatProbabilityCents(value)
|
|
3678
|
+
children: formatProbabilityCents(value, formatPrice)
|
|
3641
3679
|
}
|
|
3642
3680
|
);
|
|
3643
3681
|
};
|
|
@@ -3756,7 +3794,7 @@ var MarketDetailsGraphPanel = ({
|
|
|
3756
3794
|
var _a, _b, _c;
|
|
3757
3795
|
const config = useSdkUiConfig3();
|
|
3758
3796
|
const {
|
|
3759
|
-
formatting: { formatPercent, formatCompactCurrency },
|
|
3797
|
+
formatting: { formatPercent, formatCompactCurrency, formatPrice },
|
|
3760
3798
|
general: { theme }
|
|
3761
3799
|
} = config;
|
|
3762
3800
|
const isDarkTheme = theme === "dark";
|
|
@@ -3970,8 +4008,8 @@ var MarketDetailsGraphPanel = ({
|
|
|
3970
4008
|
const price = outcome.probability;
|
|
3971
4009
|
return {
|
|
3972
4010
|
value: outcome.id,
|
|
3973
|
-
label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price)}`,
|
|
3974
|
-
ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price)}`
|
|
4011
|
+
label: `${(_a3 = outcome == null ? void 0 : outcome.title) != null ? _a3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`,
|
|
4012
|
+
ariaLabel: `${(_b3 = outcome == null ? void 0 : outcome.title) != null ? _b3 : outcome.label} ${formatProbabilityCents(price, formatPrice)}`
|
|
3975
4013
|
};
|
|
3976
4014
|
})
|
|
3977
4015
|
}
|