@agg-build/ui 2.1.2 → 2.1.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-ZOECARZW.mjs → chunk-BW7S2YR3.mjs} +798 -312
- package/dist/{chunk-7ZR5JYB3.mjs → chunk-FLESSOSU.mjs} +2077 -533
- package/dist/{chunk-5RBHMMY3.mjs → chunk-R2YNZJZ3.mjs} +69 -27
- package/dist/{chunk-75AMJAWR.mjs → chunk-T4YZGAYS.mjs} +22 -1
- package/dist/{chunk-JJDYOBVG.mjs → chunk-TBZWRUFB.mjs} +654 -560
- package/dist/{chunk-TBD3N4T4.mjs → chunk-VP76G6PN.mjs} +41 -41
- package/dist/{chunk-NRNBJPYK.mjs → chunk-XHE2VO3S.mjs} +4 -21
- package/dist/events.js +776 -638
- package/dist/events.mjs +5 -3
- package/dist/index.js +5665 -3867
- package/dist/index.mjs +112 -455
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +8330 -6452
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +40 -41
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +652 -415
- package/dist/trading.mjs +4 -4
- package/dist/types/events/item/event-list-item.utils.d.mts +1 -25
- package/dist/types/events/item/event-list-item.utils.d.ts +1 -25
- package/dist/types/events/item-details/index.d.mts +2 -1
- package/dist/types/events/item-details/index.d.ts +2 -1
- package/dist/types/events/market-details/market-details-graph-panel.d.mts +39 -0
- package/dist/types/events/market-details/market-details-graph-panel.d.ts +39 -0
- package/dist/types/events/market-details/market-details-outcome-button.d.mts +2 -1
- package/dist/types/events/market-details/market-details-outcome-button.d.ts +2 -1
- package/dist/types/events/market-details/market-details.types.d.mts +31 -0
- package/dist/types/events/market-details/market-details.types.d.ts +31 -0
- package/dist/types/events/market-details/market-details.utils.d.mts +3 -16
- package/dist/types/events/market-details/market-details.utils.d.ts +3 -16
- package/dist/types/events/shared/format-event-title.d.mts +1 -2
- package/dist/types/events/shared/format-event-title.d.ts +1 -2
- package/dist/types/events/shared/format-sports-event-time.d.mts +2 -0
- package/dist/types/events/shared/format-sports-event-time.d.ts +2 -0
- package/dist/types/notifications/agg-notification-events-provider.d.mts +10 -1
- package/dist/types/notifications/agg-notification-events-provider.d.ts +10 -1
- package/dist/types/pages/event-market/event-market.shared.d.mts +30 -0
- package/dist/types/pages/event-market/event-market.shared.d.ts +30 -0
- package/dist/types/pages/event-market/sports-event-market-page.d.mts +8 -0
- package/dist/types/pages/event-market/sports-event-market-page.d.ts +8 -0
- package/dist/types/pages/event-market/sports-event-market.fixtures.d.mts +13 -0
- package/dist/types/pages/event-market/sports-event-market.fixtures.d.ts +13 -0
- package/dist/types/pages/event-market/sports-event-market.utils.d.mts +156 -0
- package/dist/types/pages/event-market/sports-event-market.utils.d.ts +156 -0
- package/dist/types/pages/event-market/sports-line-rail.d.mts +17 -0
- package/dist/types/pages/event-market/sports-line-rail.d.ts +17 -0
- package/dist/types/pages/event-market/sports-market-card.d.mts +22 -0
- package/dist/types/pages/event-market/sports-market-card.d.ts +22 -0
- package/dist/types/pages/event-market/sports-markets.d.mts +13 -0
- package/dist/types/pages/event-market/sports-markets.d.ts +13 -0
- package/dist/types/primitives/search/search.utils.d.mts +1 -3
- package/dist/types/primitives/search/search.utils.d.ts +1 -3
- package/dist/types/primitives/state-message/index.d.mts +1 -1
- package/dist/types/primitives/state-message/index.d.ts +1 -1
- package/dist/types/primitives/state-message/state-message.types.d.mts +1 -1
- package/dist/types/primitives/state-message/state-message.types.d.ts +1 -1
- package/dist/types/trading/place-order/index.d.mts +1 -1
- package/dist/types/trading/place-order/index.d.ts +1 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +7 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +7 -0
- package/dist/types/trading/settlement/settlement-text.utils.d.mts +5 -2
- package/dist/types/trading/settlement/settlement-text.utils.d.ts +5 -2
- package/package.json +3 -3
package/dist/trading.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
parseVenue,
|
|
9
9
|
useClaimWinnings,
|
|
10
10
|
useResolvedMarketClaim
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BW7S2YR3.mjs";
|
|
12
12
|
import {
|
|
13
13
|
SETTLEMENT_SECTION_ID,
|
|
14
14
|
Settlement,
|
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
getTradingValueLabel,
|
|
24
24
|
getTradingVenueLabel,
|
|
25
25
|
useEventTradingContext
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-R2YNZJZ3.mjs";
|
|
27
|
+
import "./chunk-T4YZGAYS.mjs";
|
|
28
|
+
import "./chunk-VP76G6PN.mjs";
|
|
29
29
|
export {
|
|
30
30
|
PlaceOrder,
|
|
31
31
|
PlaceOrderFailureView,
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import type { AggUiLabels, VenueMarket, VenueMarketOutcome } from "@agg-build/hooks";
|
|
2
2
|
import type { EventListItemEvent, EventListItemVenueInfoMap, VenueEventWithMarkets } from "./event-list-item.types";
|
|
3
|
-
/**
|
|
4
|
-
* Filter a list of venue strings against a runtime-derived set of
|
|
5
|
-
* tradeable venues. When `tradableVenues` is null (loading / unknown)
|
|
6
|
-
* the input is returned unchanged so callers can optimistically show
|
|
7
|
-
* all venues until the orderbook signal arrives. When `tradableVenues`
|
|
8
|
-
* is a Set, only venues present in it are kept.
|
|
9
|
-
*
|
|
10
|
-
* The Set is typically produced by `useTradableVenues(venueMarkets)`
|
|
11
|
-
* from `@agg-build/hooks`, which observes per-outcome midpoints from the
|
|
12
|
-
* engine and treats a venue as tradeable iff at least one of its
|
|
13
|
-
* outcomes has a non-null midpoint.
|
|
14
|
-
*/
|
|
15
|
-
export declare const filterVenuesByTradable: <T extends string>(venues: readonly T[], tradableVenues: ReadonlySet<string> | null | undefined) => T[];
|
|
16
3
|
export declare const resolveEventListItemEvent: (fetchedEvent: VenueEventWithMarkets | undefined) => EventListItemEvent | undefined;
|
|
17
4
|
export declare const normalizeProbability: (value: number | null | undefined) => number | undefined;
|
|
18
5
|
export declare const isYesLabel: (label: string) => boolean;
|
|
@@ -59,18 +46,7 @@ export declare const selectPrimaryVenueMarket: (venueMarkets: VenueMarket[]) =>
|
|
|
59
46
|
export declare const resolveTileTitle: (event: VenueEventWithMarkets, primaryVenueMarket: VenueMarket | undefined, titleOverride: string | undefined) => string;
|
|
60
47
|
export declare const resolveTileImage: (event: VenueEventWithMarkets, primaryVenueMarket: VenueMarket | undefined, imageOverride: string | null | undefined) => string | undefined;
|
|
61
48
|
export declare const formatCountLabel: (count: number, singular: string, plural: string) => string;
|
|
62
|
-
export declare const getVenueSummary: (venueMarkets: VenueMarket[]
|
|
63
|
-
/**
|
|
64
|
-
* Runtime-derived set of venues that have a live orderbook (typically
|
|
65
|
-
* sourced from `useTradableVenues`). When provided as a Set, only
|
|
66
|
-
* venues in the set count toward `venueCount` and `singleVenue`.
|
|
67
|
-
* When `null` (loading) or `undefined` (caller doesn't have the
|
|
68
|
-
* signal), no filter is applied and all venues count — callers
|
|
69
|
-
* showing a "X venues" badge accept that the count may briefly
|
|
70
|
-
* include non-tradeable venues until midpoints resolve.
|
|
71
|
-
*/
|
|
72
|
-
tradableVenues?: ReadonlySet<string> | null;
|
|
73
|
-
}) => {
|
|
49
|
+
export declare const getVenueSummary: (venueMarkets: VenueMarket[]) => {
|
|
74
50
|
marketCount: number;
|
|
75
51
|
venueCount: number;
|
|
76
52
|
singleVenue: import("@agg-build/hooks").Venue | undefined;
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
import type { AggUiLabels, VenueMarket, VenueMarketOutcome } from "@agg-build/hooks";
|
|
2
2
|
import type { EventListItemEvent, EventListItemVenueInfoMap, VenueEventWithMarkets } from "./event-list-item.types";
|
|
3
|
-
/**
|
|
4
|
-
* Filter a list of venue strings against a runtime-derived set of
|
|
5
|
-
* tradeable venues. When `tradableVenues` is null (loading / unknown)
|
|
6
|
-
* the input is returned unchanged so callers can optimistically show
|
|
7
|
-
* all venues until the orderbook signal arrives. When `tradableVenues`
|
|
8
|
-
* is a Set, only venues present in it are kept.
|
|
9
|
-
*
|
|
10
|
-
* The Set is typically produced by `useTradableVenues(venueMarkets)`
|
|
11
|
-
* from `@agg-build/hooks`, which observes per-outcome midpoints from the
|
|
12
|
-
* engine and treats a venue as tradeable iff at least one of its
|
|
13
|
-
* outcomes has a non-null midpoint.
|
|
14
|
-
*/
|
|
15
|
-
export declare const filterVenuesByTradable: <T extends string>(venues: readonly T[], tradableVenues: ReadonlySet<string> | null | undefined) => T[];
|
|
16
3
|
export declare const resolveEventListItemEvent: (fetchedEvent: VenueEventWithMarkets | undefined) => EventListItemEvent | undefined;
|
|
17
4
|
export declare const normalizeProbability: (value: number | null | undefined) => number | undefined;
|
|
18
5
|
export declare const isYesLabel: (label: string) => boolean;
|
|
@@ -59,18 +46,7 @@ export declare const selectPrimaryVenueMarket: (venueMarkets: VenueMarket[]) =>
|
|
|
59
46
|
export declare const resolveTileTitle: (event: VenueEventWithMarkets, primaryVenueMarket: VenueMarket | undefined, titleOverride: string | undefined) => string;
|
|
60
47
|
export declare const resolveTileImage: (event: VenueEventWithMarkets, primaryVenueMarket: VenueMarket | undefined, imageOverride: string | null | undefined) => string | undefined;
|
|
61
48
|
export declare const formatCountLabel: (count: number, singular: string, plural: string) => string;
|
|
62
|
-
export declare const getVenueSummary: (venueMarkets: VenueMarket[]
|
|
63
|
-
/**
|
|
64
|
-
* Runtime-derived set of venues that have a live orderbook (typically
|
|
65
|
-
* sourced from `useTradableVenues`). When provided as a Set, only
|
|
66
|
-
* venues in the set count toward `venueCount` and `singleVenue`.
|
|
67
|
-
* When `null` (loading) or `undefined` (caller doesn't have the
|
|
68
|
-
* signal), no filter is applied and all venues count — callers
|
|
69
|
-
* showing a "X venues" badge accept that the count may briefly
|
|
70
|
-
* include non-tradeable venues until midpoints resolve.
|
|
71
|
-
*/
|
|
72
|
-
tradableVenues?: ReadonlySet<string> | null;
|
|
73
|
-
}) => {
|
|
49
|
+
export declare const getVenueSummary: (venueMarkets: VenueMarket[]) => {
|
|
74
50
|
marketCount: number;
|
|
75
51
|
venueCount: number;
|
|
76
52
|
singleVenue: import("@agg-build/hooks").Venue | undefined;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { EventListItemDetailsProps } from "./event-list-item-details.types";
|
|
1
|
+
import type { EventListItemDetailsContentProps, EventListItemDetailsProps } from "./event-list-item-details.types";
|
|
2
2
|
export type { EventListItemDetailsClassNames, EventListItemDetailsEvent, EventListItemDetailsProps, EventListItemDetailsStat, EventListItemDetailsTimeRange, EventListItemDetailsWithEventIdProps, } from "./event-list-item-details.types";
|
|
3
3
|
export { SettlementSummary } from "./settlement-summary";
|
|
4
4
|
export type { SettlementSummaryProps } from "./settlement-summary";
|
|
5
|
+
export declare const resolveEventDetailsSyncKey: (event: EventListItemDetailsContentProps["event"]) => string;
|
|
5
6
|
export declare const EventListItemDetails: {
|
|
6
7
|
(props: EventListItemDetailsProps): JSX.Element;
|
|
7
8
|
displayName: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { EventListItemDetailsProps } from "./event-list-item-details.types";
|
|
1
|
+
import type { EventListItemDetailsContentProps, EventListItemDetailsProps } from "./event-list-item-details.types";
|
|
2
2
|
export type { EventListItemDetailsClassNames, EventListItemDetailsEvent, EventListItemDetailsProps, EventListItemDetailsStat, EventListItemDetailsTimeRange, EventListItemDetailsWithEventIdProps, } from "./event-list-item-details.types";
|
|
3
3
|
export { SettlementSummary } from "./settlement-summary";
|
|
4
4
|
export type { SettlementSummaryProps } from "./settlement-summary";
|
|
5
|
+
export declare const resolveEventDetailsSyncKey: (event: EventListItemDetailsContentProps["event"]) => string;
|
|
5
6
|
export declare const EventListItemDetails: {
|
|
6
7
|
(props: EventListItemDetailsProps): JSX.Element;
|
|
7
8
|
displayName: string;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { VenueMarket } from "@agg-build/hooks";
|
|
2
|
+
import type { MarketDetailsHeaderOutcomeItem } from "./market-details.types";
|
|
3
|
+
export interface MarketDetailsGraphPanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* The card's own cross-venue cluster (`model.market.venueMarkets`), NOT the
|
|
6
|
+
* full event market set. Scoping here keeps the chart's outcome resolution +
|
|
7
|
+
* WS subscription limited to this market.
|
|
8
|
+
*/
|
|
9
|
+
venueMarkets: VenueMarket[];
|
|
10
|
+
selectedOutcomeLabel: string | null;
|
|
11
|
+
selectedOutcomeId: string | null;
|
|
12
|
+
/** Merged REST+WS live prices, used to rank/scope chart venue outcomes. */
|
|
13
|
+
livePrices: Map<string, number>;
|
|
14
|
+
/** WS-only per-outcome midpoints, used for the per-venue chart badges. */
|
|
15
|
+
wsLivePrices: Map<string, number>;
|
|
16
|
+
headerOutcomeItems: MarketDetailsHeaderOutcomeItem[];
|
|
17
|
+
isResolvedMarket: boolean;
|
|
18
|
+
isOutcomeSelectionLocked: boolean;
|
|
19
|
+
volume: number | null | undefined;
|
|
20
|
+
live?: boolean;
|
|
21
|
+
classNames?: {
|
|
22
|
+
graph?: string;
|
|
23
|
+
footer?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Self-contained chart panel for an expanded market card.
|
|
28
|
+
*
|
|
29
|
+
* IMPORTANT: every chart data hook (`useMarketChart`, `useRollingChartWindow`)
|
|
30
|
+
* and all chart-local state live HERE, not in the parent `MarketDetails`. The
|
|
31
|
+
* parent renders this component only while the card is open AND the Graph tab
|
|
32
|
+
* is active, so inactive/closed cards never mount these hooks — no `/charts/bars`
|
|
33
|
+
* request, no chart query-cache entries, and no 1s rolling-window timer are
|
|
34
|
+
* created for markets the user isn't actively charting.
|
|
35
|
+
*/
|
|
36
|
+
export declare const MarketDetailsGraphPanel: {
|
|
37
|
+
({ venueMarkets, selectedOutcomeLabel, selectedOutcomeId, livePrices, wsLivePrices, headerOutcomeItems, isResolvedMarket, isOutcomeSelectionLocked, volume, live, classNames, }: MarketDetailsGraphPanelProps): JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { VenueMarket } from "@agg-build/hooks";
|
|
2
|
+
import type { MarketDetailsHeaderOutcomeItem } from "./market-details.types";
|
|
3
|
+
export interface MarketDetailsGraphPanelProps {
|
|
4
|
+
/**
|
|
5
|
+
* The card's own cross-venue cluster (`model.market.venueMarkets`), NOT the
|
|
6
|
+
* full event market set. Scoping here keeps the chart's outcome resolution +
|
|
7
|
+
* WS subscription limited to this market.
|
|
8
|
+
*/
|
|
9
|
+
venueMarkets: VenueMarket[];
|
|
10
|
+
selectedOutcomeLabel: string | null;
|
|
11
|
+
selectedOutcomeId: string | null;
|
|
12
|
+
/** Merged REST+WS live prices, used to rank/scope chart venue outcomes. */
|
|
13
|
+
livePrices: Map<string, number>;
|
|
14
|
+
/** WS-only per-outcome midpoints, used for the per-venue chart badges. */
|
|
15
|
+
wsLivePrices: Map<string, number>;
|
|
16
|
+
headerOutcomeItems: MarketDetailsHeaderOutcomeItem[];
|
|
17
|
+
isResolvedMarket: boolean;
|
|
18
|
+
isOutcomeSelectionLocked: boolean;
|
|
19
|
+
volume: number | null | undefined;
|
|
20
|
+
live?: boolean;
|
|
21
|
+
classNames?: {
|
|
22
|
+
graph?: string;
|
|
23
|
+
footer?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Self-contained chart panel for an expanded market card.
|
|
28
|
+
*
|
|
29
|
+
* IMPORTANT: every chart data hook (`useMarketChart`, `useRollingChartWindow`)
|
|
30
|
+
* and all chart-local state live HERE, not in the parent `MarketDetails`. The
|
|
31
|
+
* parent renders this component only while the card is open AND the Graph tab
|
|
32
|
+
* is active, so inactive/closed cards never mount these hooks — no `/charts/bars`
|
|
33
|
+
* request, no chart query-cache entries, and no 1s rolling-window timer are
|
|
34
|
+
* created for markets the user isn't actively charting.
|
|
35
|
+
*/
|
|
36
|
+
export declare const MarketDetailsGraphPanel: {
|
|
37
|
+
({ venueMarkets, selectedOutcomeLabel, selectedOutcomeId, livePrices, wsLivePrices, headerOutcomeItems, isResolvedMarket, isOutcomeSelectionLocked, volume, live, classNames, }: MarketDetailsGraphPanelProps): JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
@@ -2,12 +2,13 @@ import type { MarketDetailsHeaderOutcomeItem } from "./market-details.types";
|
|
|
2
2
|
type MarketDetailsOutcomeButtonProps = {
|
|
3
3
|
ariaControls?: string;
|
|
4
4
|
enableAnimations: boolean;
|
|
5
|
+
enforceFixedWidth?: boolean;
|
|
5
6
|
isSelected: boolean;
|
|
6
7
|
item: MarketDetailsHeaderOutcomeItem;
|
|
7
8
|
onSelect: (label: string) => void;
|
|
8
9
|
};
|
|
9
10
|
export declare const MarketDetailsOutcomeButton: {
|
|
10
|
-
({ ariaControls, enableAnimations, isSelected, item, onSelect, }: MarketDetailsOutcomeButtonProps): JSX.Element;
|
|
11
|
+
({ ariaControls, enableAnimations, enforceFixedWidth, isSelected, item, onSelect, }: MarketDetailsOutcomeButtonProps): JSX.Element;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
export {};
|
|
@@ -2,12 +2,13 @@ import type { MarketDetailsHeaderOutcomeItem } from "./market-details.types";
|
|
|
2
2
|
type MarketDetailsOutcomeButtonProps = {
|
|
3
3
|
ariaControls?: string;
|
|
4
4
|
enableAnimations: boolean;
|
|
5
|
+
enforceFixedWidth?: boolean;
|
|
5
6
|
isSelected: boolean;
|
|
6
7
|
item: MarketDetailsHeaderOutcomeItem;
|
|
7
8
|
onSelect: (label: string) => void;
|
|
8
9
|
};
|
|
9
10
|
export declare const MarketDetailsOutcomeButton: {
|
|
10
|
-
({ ariaControls, enableAnimations, isSelected, item, onSelect, }: MarketDetailsOutcomeButtonProps): JSX.Element;
|
|
11
|
+
({ ariaControls, enableAnimations, enforceFixedWidth, isSelected, item, onSelect, }: MarketDetailsOutcomeButtonProps): JSX.Element;
|
|
11
12
|
displayName: string;
|
|
12
13
|
};
|
|
13
14
|
export {};
|
|
@@ -43,6 +43,35 @@ export type MarketDetailsBaseProps = {
|
|
|
43
43
|
classNames?: MarketDetailsClassNames;
|
|
44
44
|
/** Custom content rendered in the "other" tab. */
|
|
45
45
|
otherContent?: React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Optional content rendered between the card header (title + outcome pills)
|
|
48
|
+
* and the collapsible details body — visible whether or not the card is
|
|
49
|
+
* expanded. Used by the sports view to mount a spread/total line-selector
|
|
50
|
+
* rail on the same card that drives the order book / graph. Regular event
|
|
51
|
+
* markets omit it, so their layout is unchanged.
|
|
52
|
+
*/
|
|
53
|
+
headerAccessory?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Compact header treatment used by the sports view: hides the leading market
|
|
56
|
+
* thumbnail and the headline probability so the card reads as
|
|
57
|
+
* "{title} · {meta}" + outcome pills (matching the sports design). Defaults
|
|
58
|
+
* to `false`, so regular event markets keep the image + headline.
|
|
59
|
+
*/
|
|
60
|
+
compactHeader?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Optional subtitle override for custom surfaces (for example the sports
|
|
63
|
+
* compact header, which needs selected-option venue / volume metadata).
|
|
64
|
+
*/
|
|
65
|
+
subtitleOverride?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Optional header pill layout override. Sports cards use this to keep the
|
|
68
|
+
* market-specific sizing and line-label treatment isolated from the default
|
|
69
|
+
* market details header.
|
|
70
|
+
*/
|
|
71
|
+
headerOutcomeVariant?: "outcome" | "line" | "yes_no";
|
|
72
|
+
/** Optional prebuilt header pills used when the card should render a custom
|
|
73
|
+
* market selection surface while keeping the regular details body. */
|
|
74
|
+
headerOutcomeItemsOverride?: MarketDetailsHeaderOutcomeItem[];
|
|
46
75
|
/** Whether the market details should render a loading state. */
|
|
47
76
|
isLoading?: boolean;
|
|
48
77
|
/**
|
|
@@ -154,6 +183,8 @@ export type MarketDetailsHeaderOutcomeItem = {
|
|
|
154
183
|
probability: number | undefined;
|
|
155
184
|
tone: MarketDetailsOutcomeTone;
|
|
156
185
|
venue: VenueLogoName;
|
|
186
|
+
variant?: "outcome" | "line" | "yes_no";
|
|
187
|
+
lineLabel?: string | null;
|
|
157
188
|
};
|
|
158
189
|
export type MarketDetailsOrderBookRow = {
|
|
159
190
|
id: string;
|
|
@@ -43,6 +43,35 @@ export type MarketDetailsBaseProps = {
|
|
|
43
43
|
classNames?: MarketDetailsClassNames;
|
|
44
44
|
/** Custom content rendered in the "other" tab. */
|
|
45
45
|
otherContent?: React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Optional content rendered between the card header (title + outcome pills)
|
|
48
|
+
* and the collapsible details body — visible whether or not the card is
|
|
49
|
+
* expanded. Used by the sports view to mount a spread/total line-selector
|
|
50
|
+
* rail on the same card that drives the order book / graph. Regular event
|
|
51
|
+
* markets omit it, so their layout is unchanged.
|
|
52
|
+
*/
|
|
53
|
+
headerAccessory?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* Compact header treatment used by the sports view: hides the leading market
|
|
56
|
+
* thumbnail and the headline probability so the card reads as
|
|
57
|
+
* "{title} · {meta}" + outcome pills (matching the sports design). Defaults
|
|
58
|
+
* to `false`, so regular event markets keep the image + headline.
|
|
59
|
+
*/
|
|
60
|
+
compactHeader?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Optional subtitle override for custom surfaces (for example the sports
|
|
63
|
+
* compact header, which needs selected-option venue / volume metadata).
|
|
64
|
+
*/
|
|
65
|
+
subtitleOverride?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Optional header pill layout override. Sports cards use this to keep the
|
|
68
|
+
* market-specific sizing and line-label treatment isolated from the default
|
|
69
|
+
* market details header.
|
|
70
|
+
*/
|
|
71
|
+
headerOutcomeVariant?: "outcome" | "line" | "yes_no";
|
|
72
|
+
/** Optional prebuilt header pills used when the card should render a custom
|
|
73
|
+
* market selection surface while keeping the regular details body. */
|
|
74
|
+
headerOutcomeItemsOverride?: MarketDetailsHeaderOutcomeItem[];
|
|
46
75
|
/** Whether the market details should render a loading state. */
|
|
47
76
|
isLoading?: boolean;
|
|
48
77
|
/**
|
|
@@ -154,6 +183,8 @@ export type MarketDetailsHeaderOutcomeItem = {
|
|
|
154
183
|
probability: number | undefined;
|
|
155
184
|
tone: MarketDetailsOutcomeTone;
|
|
156
185
|
venue: VenueLogoName;
|
|
186
|
+
variant?: "outcome" | "line" | "yes_no";
|
|
187
|
+
lineLabel?: string | null;
|
|
157
188
|
};
|
|
158
189
|
export type MarketDetailsOrderBookRow = {
|
|
159
190
|
id: string;
|
|
@@ -46,34 +46,21 @@ export declare const resolveScopedSelectedOutcome: ({ venueMarkets, selectedOutc
|
|
|
46
46
|
export declare const resolveAverageProbabilityByLabel: (venueMarkets: VenueMarket[], labels: string[]) => Map<string, number | undefined>;
|
|
47
47
|
export declare const formatProbabilityPercent: (value: number | null | undefined, formatPercent?: (value: number) => string) => string;
|
|
48
48
|
export declare const resolveOutcomeTone: (label: string, index: number) => MarketDetailsOrderBookTone;
|
|
49
|
-
export declare const resolveHeaderOutcomeItems: (venueMarkets: VenueMarket[], scopedMarket?: VenueMarket | null) => MarketDetailsHeaderOutcomeItem[];
|
|
50
|
-
export declare const resolveSubtitle: ({ venueMarkets, volume, formatCompactCurrency, labels,
|
|
49
|
+
export declare const resolveHeaderOutcomeItems: (venueMarkets: VenueMarket[], scopedMarket?: VenueMarket | null, variant?: MarketDetailsHeaderOutcomeItem["variant"]) => MarketDetailsHeaderOutcomeItem[];
|
|
50
|
+
export declare const resolveSubtitle: ({ venueMarkets, volume, formatCompactCurrency, labels, }: {
|
|
51
51
|
venueMarkets: VenueMarket[];
|
|
52
52
|
volume: number | undefined;
|
|
53
53
|
formatCompactCurrency: (value: number) => string;
|
|
54
54
|
labels: AggUiLabels;
|
|
55
|
-
/**
|
|
56
|
-
* Optional runtime-derived set of venues that have a live orderbook.
|
|
57
|
-
* Forwarded to `getVenueSummary` to filter `venueCount` to only
|
|
58
|
-
* tradeable venues. When omitted the count includes all venues
|
|
59
|
-
* regardless of orderbook availability.
|
|
60
|
-
*/
|
|
61
|
-
tradableVenues?: ReadonlySet<string> | null;
|
|
62
55
|
}) => string;
|
|
63
56
|
export declare const resolveOtherTabRows: (market: ResolvedMarket, labels: AggUiLabels) => MarketDetailsMetaRow[];
|
|
64
|
-
export declare const buildMarketDetailsModel: ({ venueMarkets, marketId, title, image, formatCompactCurrency, labels,
|
|
57
|
+
export declare const buildMarketDetailsModel: ({ venueMarkets, marketId, title, image, formatCompactCurrency, labels, }: {
|
|
65
58
|
venueMarkets: VenueMarket[];
|
|
66
59
|
marketId: string | undefined;
|
|
67
60
|
title: string | undefined;
|
|
68
61
|
image: string | null | undefined;
|
|
69
62
|
formatCompactCurrency: (value: number) => string;
|
|
70
63
|
labels: AggUiLabels;
|
|
71
|
-
/**
|
|
72
|
-
* Forwarded to `resolveSubtitle` → `getVenueSummary` so the "X venues"
|
|
73
|
-
* subtitle reflects only venues with a live orderbook. Optional;
|
|
74
|
-
* subtitle counts all cluster venues when omitted.
|
|
75
|
-
*/
|
|
76
|
-
tradableVenues?: ReadonlySet<string> | null;
|
|
77
64
|
}) => {
|
|
78
65
|
market: ResolvedMarket;
|
|
79
66
|
primaryVenueMarket: VenueMarket;
|
|
@@ -46,34 +46,21 @@ export declare const resolveScopedSelectedOutcome: ({ venueMarkets, selectedOutc
|
|
|
46
46
|
export declare const resolveAverageProbabilityByLabel: (venueMarkets: VenueMarket[], labels: string[]) => Map<string, number | undefined>;
|
|
47
47
|
export declare const formatProbabilityPercent: (value: number | null | undefined, formatPercent?: (value: number) => string) => string;
|
|
48
48
|
export declare const resolveOutcomeTone: (label: string, index: number) => MarketDetailsOrderBookTone;
|
|
49
|
-
export declare const resolveHeaderOutcomeItems: (venueMarkets: VenueMarket[], scopedMarket?: VenueMarket | null) => MarketDetailsHeaderOutcomeItem[];
|
|
50
|
-
export declare const resolveSubtitle: ({ venueMarkets, volume, formatCompactCurrency, labels,
|
|
49
|
+
export declare const resolveHeaderOutcomeItems: (venueMarkets: VenueMarket[], scopedMarket?: VenueMarket | null, variant?: MarketDetailsHeaderOutcomeItem["variant"]) => MarketDetailsHeaderOutcomeItem[];
|
|
50
|
+
export declare const resolveSubtitle: ({ venueMarkets, volume, formatCompactCurrency, labels, }: {
|
|
51
51
|
venueMarkets: VenueMarket[];
|
|
52
52
|
volume: number | undefined;
|
|
53
53
|
formatCompactCurrency: (value: number) => string;
|
|
54
54
|
labels: AggUiLabels;
|
|
55
|
-
/**
|
|
56
|
-
* Optional runtime-derived set of venues that have a live orderbook.
|
|
57
|
-
* Forwarded to `getVenueSummary` to filter `venueCount` to only
|
|
58
|
-
* tradeable venues. When omitted the count includes all venues
|
|
59
|
-
* regardless of orderbook availability.
|
|
60
|
-
*/
|
|
61
|
-
tradableVenues?: ReadonlySet<string> | null;
|
|
62
55
|
}) => string;
|
|
63
56
|
export declare const resolveOtherTabRows: (market: ResolvedMarket, labels: AggUiLabels) => MarketDetailsMetaRow[];
|
|
64
|
-
export declare const buildMarketDetailsModel: ({ venueMarkets, marketId, title, image, formatCompactCurrency, labels,
|
|
57
|
+
export declare const buildMarketDetailsModel: ({ venueMarkets, marketId, title, image, formatCompactCurrency, labels, }: {
|
|
65
58
|
venueMarkets: VenueMarket[];
|
|
66
59
|
marketId: string | undefined;
|
|
67
60
|
title: string | undefined;
|
|
68
61
|
image: string | null | undefined;
|
|
69
62
|
formatCompactCurrency: (value: number) => string;
|
|
70
63
|
labels: AggUiLabels;
|
|
71
|
-
/**
|
|
72
|
-
* Forwarded to `resolveSubtitle` → `getVenueSummary` so the "X venues"
|
|
73
|
-
* subtitle reflects only venues with a live orderbook. Optional;
|
|
74
|
-
* subtitle counts all cluster venues when omitted.
|
|
75
|
-
*/
|
|
76
|
-
tradableVenues?: ReadonlySet<string> | null;
|
|
77
64
|
}) => {
|
|
78
65
|
market: ResolvedMarket;
|
|
79
66
|
primaryVenueMarket: VenueMarket;
|
|
@@ -19,7 +19,6 @@ type FormatEventTitleWithDateSuffixParams = {
|
|
|
19
19
|
*/
|
|
20
20
|
gameStartTime?: string | null;
|
|
21
21
|
endDate?: string | null;
|
|
22
|
-
locale?: string;
|
|
23
22
|
};
|
|
24
|
-
export declare const formatEventTitleWithDateSuffix: ({ title, categories, structureType, gameStartTime, endDate,
|
|
23
|
+
export declare const formatEventTitleWithDateSuffix: ({ title, categories, structureType, gameStartTime, endDate, }: FormatEventTitleWithDateSuffixParams) => string;
|
|
25
24
|
export {};
|
|
@@ -19,7 +19,6 @@ type FormatEventTitleWithDateSuffixParams = {
|
|
|
19
19
|
*/
|
|
20
20
|
gameStartTime?: string | null;
|
|
21
21
|
endDate?: string | null;
|
|
22
|
-
locale?: string;
|
|
23
22
|
};
|
|
24
|
-
export declare const formatEventTitleWithDateSuffix: ({ title, categories, structureType, gameStartTime, endDate,
|
|
23
|
+
export declare const formatEventTitleWithDateSuffix: ({ title, categories, structureType, gameStartTime, endDate, }: FormatEventTitleWithDateSuffixParams) => string;
|
|
25
24
|
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { useAggLabels } from "@agg-build/hooks";
|
|
2
|
+
import type { WsOrderEvent } from "@agg-build/sdk";
|
|
1
3
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type ToastContextValue } from "../primitives/toast";
|
|
4
|
+
import { type ToastContextValue, type ToastTone } from "../primitives/toast";
|
|
3
5
|
interface AggNotificationEventsProviderProps {
|
|
4
6
|
children?: ReactNode;
|
|
5
7
|
/**
|
|
@@ -32,4 +34,11 @@ interface AggNotificationEventsProviderProps {
|
|
|
32
34
|
* so signing out / in cannot leak toasts from a prior session.
|
|
33
35
|
*/
|
|
34
36
|
export declare function AggNotificationEventsProvider({ children, enabled, depositActivityLimit, }: AggNotificationEventsProviderProps): JSX.Element;
|
|
37
|
+
export declare function resetOrderNotificationDedupe(): void;
|
|
38
|
+
interface HandleOrderArgs {
|
|
39
|
+
event: WsOrderEvent;
|
|
40
|
+
labels: ReturnType<typeof useAggLabels>;
|
|
41
|
+
fireOnce: (key: string, tone: ToastTone, title: string, message: string, detail?: string) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare function handleOrderEvent({ event, labels, fireOnce }: HandleOrderArgs): void;
|
|
35
44
|
export type { ToastContextValue };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { useAggLabels } from "@agg-build/hooks";
|
|
2
|
+
import type { WsOrderEvent } from "@agg-build/sdk";
|
|
1
3
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type ToastContextValue } from "../primitives/toast";
|
|
4
|
+
import { type ToastContextValue, type ToastTone } from "../primitives/toast";
|
|
3
5
|
interface AggNotificationEventsProviderProps {
|
|
4
6
|
children?: ReactNode;
|
|
5
7
|
/**
|
|
@@ -32,4 +34,11 @@ interface AggNotificationEventsProviderProps {
|
|
|
32
34
|
* so signing out / in cannot leak toasts from a prior session.
|
|
33
35
|
*/
|
|
34
36
|
export declare function AggNotificationEventsProvider({ children, enabled, depositActivityLimit, }: AggNotificationEventsProviderProps): JSX.Element;
|
|
37
|
+
export declare function resetOrderNotificationDedupe(): void;
|
|
38
|
+
interface HandleOrderArgs {
|
|
39
|
+
event: WsOrderEvent;
|
|
40
|
+
labels: ReturnType<typeof useAggLabels>;
|
|
41
|
+
fireOnce: (key: string, tone: ToastTone, title: string, message: string, detail?: string) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare function handleOrderEvent({ event, labels, fireOnce }: HandleOrderArgs): void;
|
|
35
44
|
export type { ToastContextValue };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { resolveEventTradingState, type UseMidpointsResult } from "@agg-build/hooks";
|
|
2
|
+
import type { EventMarketPageProps } from "./event-market.types";
|
|
3
|
+
export declare const MOBILE_EVENT_MARKET_MEDIA_QUERY = "(max-width: 1023px)";
|
|
4
|
+
export declare const SPORTS_EVENT_MARKET_MEDIA_QUERY = "(max-width: 1279px)";
|
|
5
|
+
export type EventMarketPlaceOrderClassNames = {
|
|
6
|
+
root?: string;
|
|
7
|
+
body?: string;
|
|
8
|
+
content?: string;
|
|
9
|
+
footer?: string;
|
|
10
|
+
header?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const getIsMobileEventMarketViewport: (mediaQuery?: string) => boolean;
|
|
13
|
+
export declare const useIsMobileEventMarketViewport: (mediaQuery?: string) => boolean;
|
|
14
|
+
export declare const resolveDesktopTradePlaceOrderClassNames: (classNames?: EventMarketPageProps["classNames"]) => EventMarketPlaceOrderClassNames | undefined;
|
|
15
|
+
export declare const resolveMobileTradePlaceOrderClassNames: (classNames?: EventMarketPageProps["classNames"]) => EventMarketPlaceOrderClassNames;
|
|
16
|
+
type EventMarketPageMobileTradeProps = {
|
|
17
|
+
classNames?: EventMarketPageProps["classNames"];
|
|
18
|
+
eventTradingState: ReturnType<typeof resolveEventTradingState>;
|
|
19
|
+
executionMode?: EventMarketPageProps["executionMode"];
|
|
20
|
+
showPlaceOrder?: boolean;
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
onOpenChange: (nextOpen: boolean) => void;
|
|
23
|
+
midpointsResult?: UseMidpointsResult;
|
|
24
|
+
onBeforePrimaryAction?: EventMarketPageProps["onBeforePrimaryAction"];
|
|
25
|
+
};
|
|
26
|
+
export declare const EventMarketPageMobileTrade: ({ classNames, eventTradingState, executionMode, showPlaceOrder, isOpen, onOpenChange, midpointsResult, onBeforePrimaryAction, }: EventMarketPageMobileTradeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
export declare const EventMarketPageUnavailableState: ({ ariaLabel: _ariaLabel, }: Pick<EventMarketPageProps, "ariaLabel">) => JSX.Element;
|
|
28
|
+
export declare const EventMarketPageNotFoundState: ({ ariaLabel: _ariaLabel, }: Pick<EventMarketPageProps, "ariaLabel">) => JSX.Element;
|
|
29
|
+
export declare const EventMarketPageLoadingState: ({ classNames, stickyOrderPanel, }: Pick<EventMarketPageProps, "classNames" | "stickyOrderPanel">) => JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { resolveEventTradingState, type UseMidpointsResult } from "@agg-build/hooks";
|
|
2
|
+
import type { EventMarketPageProps } from "./event-market.types";
|
|
3
|
+
export declare const MOBILE_EVENT_MARKET_MEDIA_QUERY = "(max-width: 1023px)";
|
|
4
|
+
export declare const SPORTS_EVENT_MARKET_MEDIA_QUERY = "(max-width: 1279px)";
|
|
5
|
+
export type EventMarketPlaceOrderClassNames = {
|
|
6
|
+
root?: string;
|
|
7
|
+
body?: string;
|
|
8
|
+
content?: string;
|
|
9
|
+
footer?: string;
|
|
10
|
+
header?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const getIsMobileEventMarketViewport: (mediaQuery?: string) => boolean;
|
|
13
|
+
export declare const useIsMobileEventMarketViewport: (mediaQuery?: string) => boolean;
|
|
14
|
+
export declare const resolveDesktopTradePlaceOrderClassNames: (classNames?: EventMarketPageProps["classNames"]) => EventMarketPlaceOrderClassNames | undefined;
|
|
15
|
+
export declare const resolveMobileTradePlaceOrderClassNames: (classNames?: EventMarketPageProps["classNames"]) => EventMarketPlaceOrderClassNames;
|
|
16
|
+
type EventMarketPageMobileTradeProps = {
|
|
17
|
+
classNames?: EventMarketPageProps["classNames"];
|
|
18
|
+
eventTradingState: ReturnType<typeof resolveEventTradingState>;
|
|
19
|
+
executionMode?: EventMarketPageProps["executionMode"];
|
|
20
|
+
showPlaceOrder?: boolean;
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
onOpenChange: (nextOpen: boolean) => void;
|
|
23
|
+
midpointsResult?: UseMidpointsResult;
|
|
24
|
+
onBeforePrimaryAction?: EventMarketPageProps["onBeforePrimaryAction"];
|
|
25
|
+
};
|
|
26
|
+
export declare const EventMarketPageMobileTrade: ({ classNames, eventTradingState, executionMode, showPlaceOrder, isOpen, onOpenChange, midpointsResult, onBeforePrimaryAction, }: EventMarketPageMobileTradeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
export declare const EventMarketPageUnavailableState: ({ ariaLabel: _ariaLabel, }: Pick<EventMarketPageProps, "ariaLabel">) => JSX.Element;
|
|
28
|
+
export declare const EventMarketPageNotFoundState: ({ ariaLabel: _ariaLabel, }: Pick<EventMarketPageProps, "ariaLabel">) => JSX.Element;
|
|
29
|
+
export declare const EventMarketPageLoadingState: ({ classNames, stickyOrderPanel, }: Pick<EventMarketPageProps, "classNames" | "stickyOrderPanel">) => JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VenueEventWithMarkets } from "../../events/item/event-list-item.types";
|
|
2
|
+
import type { EventMarketPageProps } from "./event-market.types";
|
|
3
|
+
export declare const SportsEventMarketPage: {
|
|
4
|
+
({ event, defaultMarketId, defaultOutcomeId, classNames, ariaLabel, showPlaceOrder, executionMode, stickyOrderPanel, resolvedClaim, onBeforePrimaryAction, }: Extract<EventMarketPageProps, {
|
|
5
|
+
event: VenueEventWithMarkets;
|
|
6
|
+
}>): JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VenueEventWithMarkets } from "../../events/item/event-list-item.types";
|
|
2
|
+
import type { EventMarketPageProps } from "./event-market.types";
|
|
3
|
+
export declare const SportsEventMarketPage: {
|
|
4
|
+
({ event, defaultMarketId, defaultOutcomeId, classNames, ariaLabel, showPlaceOrder, executionMode, stickyOrderPanel, resolvedClaim, onBeforePrimaryAction, }: Extract<EventMarketPageProps, {
|
|
5
|
+
event: VenueEventWithMarkets;
|
|
6
|
+
}>): JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VenueEventWithMarkets, type VenueMarket } from "@agg-build/hooks";
|
|
2
|
+
export declare const sportsSectionMarketsByTab: {
|
|
3
|
+
game_lines: VenueMarket[];
|
|
4
|
+
halves: readonly [VenueMarket, VenueMarket, VenueMarket];
|
|
5
|
+
exact_score: readonly [VenueMarket];
|
|
6
|
+
corners: readonly [VenueMarket, VenueMarket];
|
|
7
|
+
goals: VenueMarket[];
|
|
8
|
+
assists: readonly [VenueMarket];
|
|
9
|
+
shots: readonly [VenueMarket];
|
|
10
|
+
other: readonly [VenueMarket];
|
|
11
|
+
};
|
|
12
|
+
export declare const sportsEventPageFixture: VenueEventWithMarkets;
|
|
13
|
+
export declare const sportsLikeEsportsEventFixture: VenueEventWithMarkets;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type VenueEventWithMarkets, type VenueMarket } from "@agg-build/hooks";
|
|
2
|
+
export declare const sportsSectionMarketsByTab: {
|
|
3
|
+
game_lines: VenueMarket[];
|
|
4
|
+
halves: readonly [VenueMarket, VenueMarket, VenueMarket];
|
|
5
|
+
exact_score: readonly [VenueMarket];
|
|
6
|
+
corners: readonly [VenueMarket, VenueMarket];
|
|
7
|
+
goals: VenueMarket[];
|
|
8
|
+
assists: readonly [VenueMarket];
|
|
9
|
+
shots: readonly [VenueMarket];
|
|
10
|
+
other: readonly [VenueMarket];
|
|
11
|
+
};
|
|
12
|
+
export declare const sportsEventPageFixture: VenueEventWithMarkets;
|
|
13
|
+
export declare const sportsLikeEsportsEventFixture: VenueEventWithMarkets;
|