@liberfi.io/ui-predict 1.0.3 → 1.0.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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { EventSortField, ProviderSource, PredictEvent, PredictMarket, TagSlugSelection as TagSlugSelection$1, EventStatus, ResolveEventsParamsInput, EventStats, ChartRangeType as ChartRangeType$1, ListCandlesticksParams, Candlestick, PredictPosition, PredictPage, MatchMarketFlat, MatchSortField, MatchGroup } from '@liberfi.io/react-predict';
2
+ import { EventSortField, ProviderSource, PredictEvent, PredictMarket, TagSlugSelection as TagSlugSelection$1, EventStatus, ResolveEventsParamsInput, EventStats, ChartRangeType as ChartRangeType$1, ListCandlesticksParams, Candlestick, PredictPosition, PredictPage, MatchMarketFlat, MatchLeg, MatchSortField, MatchGroup } from '@liberfi.io/react-predict';
3
3
  export { BalanceResponse, CancelOrderResult, Candlestick, CreateOrderInput, DFlowKYCStatus, DFlowOrderContext, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, EventSummary, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, MarketOutcome, MarketResult, MarketStatus, MarketSummary, MatchConfidenceTier, MatchGroup, MatchGroupEntry, MatchGroupMarket, MatchGroupPage, MatchMarketFlat, MatchMarketPage, MatchMarketParams, MatchSortField, MatchStatus, MatchesParams, MatchesStats, OrderSide, OrderStatus, Orderbook, OrderbookLevel, PolymarketOrderType, PolymarketRedeemInput, PolymarketRedeemResponse, PositionsResponse, PredictClient, PredictContext, PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictPosition, PredictProvider, PredictProviderProps, PredictTag, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, PricePoint, ProviderMeta, ProviderSource, ResolveEventsParamsInput, SettlementSource, SimilarEventsParams, TradeType, createPredictClient, createPredictWsClient, eventStatsQueryKey, fetchMatchMarketsPage, fetchMatchesPage, matchMarketsQueryKey, matchQueryKey, matchesQueryKey, useBalance, useCancelOrder, useCandlesticks, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrders, usePositions, usePredictClient, usePriceHistory, useRedeemPosition, useSearchEvents, useSimilarEvents, useTrades } from '@liberfi.io/react-predict';
4
4
  import { LinkComponentType } from '@liberfi.io/ui';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
@@ -13,7 +13,7 @@ declare global {
13
13
  };
14
14
  }
15
15
  }
16
- declare const _default: "1.0.3";
16
+ declare const _default: "1.0.4";
17
17
 
18
18
  /**
19
19
  * A single category entry in the static navigation model.
@@ -881,6 +881,17 @@ interface MatchesPageProps {
881
881
  onSelectMatch?: (match: MatchMarketFlat) => void;
882
882
  /** v1.1: returns the internal pair detail href for the card link. */
883
883
  getMatchHref?: (match: MatchMarketFlat) => string | undefined;
884
+ /**
885
+ * v1.2: invoked when the user clicks an individual platform row, so the
886
+ * host can route to that platform's own internal detail page (Polymarket
887
+ * vs. Kalshi) instead of always landing on the recommended/cheaper leg.
888
+ */
889
+ onSelectLeg?: (match: MatchMarketFlat, leg: MatchLeg) => void;
890
+ /**
891
+ * v1.2: returns the per-leg internal href used to render each row as a
892
+ * `<LinkComponent>` for SPA-friendly routing and prefetching.
893
+ */
894
+ getLegHref?: (match: MatchMarketFlat, leg: MatchLeg) => string | undefined;
884
895
  onHover?: (match: MatchMarketFlat) => void;
885
896
  /** @deprecated v1.1 — use `onSelectMatch`. */
886
897
  onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
@@ -894,7 +905,7 @@ interface MatchesPageProps {
894
905
  /** @deprecated Use getMatchHref instead */
895
906
  getEventHref?: (event: never) => string;
896
907
  }
897
- declare function MatchesPage({ onSelectMatch, getMatchHref, onHover, onSelect, getMarketHref, LinkComponent, bgImageSrc, }: MatchesPageProps): react_jsx_runtime.JSX.Element;
908
+ declare function MatchesPage({ onSelectMatch, getMatchHref, onSelectLeg, getLegHref, onHover, onSelect, getMarketHref, LinkComponent, bgImageSrc, }: MatchesPageProps): react_jsx_runtime.JSX.Element;
898
909
 
899
910
  interface MatchesHeroStats {
900
911
  activePairs: number;
@@ -923,6 +934,10 @@ interface MatchesWidgetProps {
923
934
  onSelectMatch?: (match: MatchMarketFlat) => void;
924
935
  /** v1.1: returns internal pair detail href. */
925
936
  getMatchHref?: (match: MatchMarketFlat) => string | undefined;
937
+ /** v1.2: per-leg row click → that platform's own internal detail. */
938
+ onSelectLeg?: (match: MatchMarketFlat, leg: MatchLeg) => void;
939
+ /** v1.2: returns the per-leg internal href for the row link. */
940
+ getLegHref?: (match: MatchMarketFlat, leg: MatchLeg) => string | undefined;
926
941
  onHover?: (match: MatchMarketFlat) => void;
927
942
  /** @deprecated v1.1 — use `onSelectMatch`. */
928
943
  onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
@@ -965,6 +980,19 @@ interface MatchMarketCardProps {
965
980
  onSelectMatch?: (match: MatchMarketFlat) => void;
966
981
  /** v1.1: returns the internal pair detail href; renders card as a link. */
967
982
  getMatchHref?: (match: MatchMarketFlat) => string | undefined;
983
+ /**
984
+ * v1.2: invoked when the user clicks an individual platform row. Lets the
985
+ * host route to that specific leg's internal detail page (e.g. the
986
+ * Polymarket-side or Kalshi-side event detail) instead of always
987
+ * navigating to the recommended/cheaper leg.
988
+ */
989
+ onSelectLeg?: (match: MatchMarketFlat, leg: MatchLeg) => void;
990
+ /**
991
+ * v1.2: returns the internal href for a single leg. When provided
992
+ * together with `LinkComponent`, the row renders as a `<Link>` so the
993
+ * router can prefetch and the user gets cmd-click / middle-click.
994
+ */
995
+ getLegHref?: (match: MatchMarketFlat, leg: MatchLeg) => string | undefined;
968
996
  onHover?: (match: MatchMarketFlat) => void;
969
997
  /**
970
998
  * @deprecated v1.1 — kept for source compatibility. Used as a fallback
@@ -979,7 +1007,7 @@ interface MatchMarketCardProps {
979
1007
  onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
980
1008
  LinkComponent?: LinkComponentType;
981
1009
  }
982
- declare function MatchMarketCard({ match, onSelectMatch, getMatchHref, onHover, getMarketHref, LinkComponent, }: MatchMarketCardProps): react_jsx_runtime.JSX.Element | null;
1010
+ declare function MatchMarketCard({ match, onSelectMatch, getMatchHref, onSelectLeg, getLegHref, onHover, getMarketHref, LinkComponent, }: MatchMarketCardProps): react_jsx_runtime.JSX.Element | null;
983
1011
 
984
1012
  interface MatchesStatsBarProps {
985
1013
  matches: MatchGroup[];
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { EventSortField, ProviderSource, PredictEvent, PredictMarket, TagSlugSelection as TagSlugSelection$1, EventStatus, ResolveEventsParamsInput, EventStats, ChartRangeType as ChartRangeType$1, ListCandlesticksParams, Candlestick, PredictPosition, PredictPage, MatchMarketFlat, MatchSortField, MatchGroup } from '@liberfi.io/react-predict';
2
+ import { EventSortField, ProviderSource, PredictEvent, PredictMarket, TagSlugSelection as TagSlugSelection$1, EventStatus, ResolveEventsParamsInput, EventStats, ChartRangeType as ChartRangeType$1, ListCandlesticksParams, Candlestick, PredictPosition, PredictPage, MatchMarketFlat, MatchLeg, MatchSortField, MatchGroup } from '@liberfi.io/react-predict';
3
3
  export { BalanceResponse, CancelOrderResult, Candlestick, CreateOrderInput, DFlowKYCStatus, DFlowOrderContext, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, EventSummary, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, MarketOutcome, MarketResult, MarketStatus, MarketSummary, MatchConfidenceTier, MatchGroup, MatchGroupEntry, MatchGroupMarket, MatchGroupPage, MatchMarketFlat, MatchMarketPage, MatchMarketParams, MatchSortField, MatchStatus, MatchesParams, MatchesStats, OrderSide, OrderStatus, Orderbook, OrderbookLevel, PolymarketOrderType, PolymarketRedeemInput, PolymarketRedeemResponse, PositionsResponse, PredictClient, PredictContext, PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictPosition, PredictProvider, PredictProviderProps, PredictTag, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, PricePoint, ProviderMeta, ProviderSource, ResolveEventsParamsInput, SettlementSource, SimilarEventsParams, TradeType, createPredictClient, createPredictWsClient, eventStatsQueryKey, fetchMatchMarketsPage, fetchMatchesPage, matchMarketsQueryKey, matchQueryKey, matchesQueryKey, useBalance, useCancelOrder, useCandlesticks, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrders, usePositions, usePredictClient, usePriceHistory, useRedeemPosition, useSearchEvents, useSimilarEvents, useTrades } from '@liberfi.io/react-predict';
4
4
  import { LinkComponentType } from '@liberfi.io/ui';
5
5
  import * as _tanstack_react_query from '@tanstack/react-query';
@@ -13,7 +13,7 @@ declare global {
13
13
  };
14
14
  }
15
15
  }
16
- declare const _default: "1.0.3";
16
+ declare const _default: "1.0.4";
17
17
 
18
18
  /**
19
19
  * A single category entry in the static navigation model.
@@ -881,6 +881,17 @@ interface MatchesPageProps {
881
881
  onSelectMatch?: (match: MatchMarketFlat) => void;
882
882
  /** v1.1: returns the internal pair detail href for the card link. */
883
883
  getMatchHref?: (match: MatchMarketFlat) => string | undefined;
884
+ /**
885
+ * v1.2: invoked when the user clicks an individual platform row, so the
886
+ * host can route to that platform's own internal detail page (Polymarket
887
+ * vs. Kalshi) instead of always landing on the recommended/cheaper leg.
888
+ */
889
+ onSelectLeg?: (match: MatchMarketFlat, leg: MatchLeg) => void;
890
+ /**
891
+ * v1.2: returns the per-leg internal href used to render each row as a
892
+ * `<LinkComponent>` for SPA-friendly routing and prefetching.
893
+ */
894
+ getLegHref?: (match: MatchMarketFlat, leg: MatchLeg) => string | undefined;
884
895
  onHover?: (match: MatchMarketFlat) => void;
885
896
  /** @deprecated v1.1 — use `onSelectMatch`. */
886
897
  onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
@@ -894,7 +905,7 @@ interface MatchesPageProps {
894
905
  /** @deprecated Use getMatchHref instead */
895
906
  getEventHref?: (event: never) => string;
896
907
  }
897
- declare function MatchesPage({ onSelectMatch, getMatchHref, onHover, onSelect, getMarketHref, LinkComponent, bgImageSrc, }: MatchesPageProps): react_jsx_runtime.JSX.Element;
908
+ declare function MatchesPage({ onSelectMatch, getMatchHref, onSelectLeg, getLegHref, onHover, onSelect, getMarketHref, LinkComponent, bgImageSrc, }: MatchesPageProps): react_jsx_runtime.JSX.Element;
898
909
 
899
910
  interface MatchesHeroStats {
900
911
  activePairs: number;
@@ -923,6 +934,10 @@ interface MatchesWidgetProps {
923
934
  onSelectMatch?: (match: MatchMarketFlat) => void;
924
935
  /** v1.1: returns internal pair detail href. */
925
936
  getMatchHref?: (match: MatchMarketFlat) => string | undefined;
937
+ /** v1.2: per-leg row click → that platform's own internal detail. */
938
+ onSelectLeg?: (match: MatchMarketFlat, leg: MatchLeg) => void;
939
+ /** v1.2: returns the per-leg internal href for the row link. */
940
+ getLegHref?: (match: MatchMarketFlat, leg: MatchLeg) => string | undefined;
926
941
  onHover?: (match: MatchMarketFlat) => void;
927
942
  /** @deprecated v1.1 — use `onSelectMatch`. */
928
943
  onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
@@ -965,6 +980,19 @@ interface MatchMarketCardProps {
965
980
  onSelectMatch?: (match: MatchMarketFlat) => void;
966
981
  /** v1.1: returns the internal pair detail href; renders card as a link. */
967
982
  getMatchHref?: (match: MatchMarketFlat) => string | undefined;
983
+ /**
984
+ * v1.2: invoked when the user clicks an individual platform row. Lets the
985
+ * host route to that specific leg's internal detail page (e.g. the
986
+ * Polymarket-side or Kalshi-side event detail) instead of always
987
+ * navigating to the recommended/cheaper leg.
988
+ */
989
+ onSelectLeg?: (match: MatchMarketFlat, leg: MatchLeg) => void;
990
+ /**
991
+ * v1.2: returns the internal href for a single leg. When provided
992
+ * together with `LinkComponent`, the row renders as a `<Link>` so the
993
+ * router can prefetch and the user gets cmd-click / middle-click.
994
+ */
995
+ getLegHref?: (match: MatchMarketFlat, leg: MatchLeg) => string | undefined;
968
996
  onHover?: (match: MatchMarketFlat) => void;
969
997
  /**
970
998
  * @deprecated v1.1 — kept for source compatibility. Used as a fallback
@@ -979,7 +1007,7 @@ interface MatchMarketCardProps {
979
1007
  onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
980
1008
  LinkComponent?: LinkComponentType;
981
1009
  }
982
- declare function MatchMarketCard({ match, onSelectMatch, getMatchHref, onHover, getMarketHref, LinkComponent, }: MatchMarketCardProps): react_jsx_runtime.JSX.Element | null;
1010
+ declare function MatchMarketCard({ match, onSelectMatch, getMatchHref, onSelectLeg, getLegHref, onHover, getMarketHref, LinkComponent, }: MatchMarketCardProps): react_jsx_runtime.JSX.Element | null;
983
1011
 
984
1012
  interface MatchesStatsBarProps {
985
1013
  matches: MatchGroup[];