@liberfi.io/ui-predict 0.1.146 → 1.0.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/README.md +18 -0
- package/dist/index.d.mts +54 -10
- package/dist/index.d.ts +54 -10
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -67,6 +67,24 @@ These props enable framework-agnostic route link rendering and prefetching:
|
|
|
67
67
|
| `EventDetailUI` | `event`, `series`, `candlesticks`, `chartRange`, ... | Pure presentation for event detail. |
|
|
68
68
|
| `EventDetailSkeleton` | `marketCount?` | Loading skeleton for the detail page. |
|
|
69
69
|
|
|
70
|
+
### Components — Matches (cross-platform pairs, v1.1)
|
|
71
|
+
|
|
72
|
+
| Component | Key Props | Description |
|
|
73
|
+
| ----------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
74
|
+
| `MatchesPage` | `onSelectMatch`, `getMatchHref`, `onHover`, `LinkComponent`, `bgImageSrc` | Full Matches page (hero + filter bar + virtualized card list). v1.1 cards have **no Buy CTA**. |
|
|
75
|
+
| `MatchesWidget` | `sortBy`, `sortAsc`, `minVolume`, `signal`, `onSelectMatch`, `getMatchHref` | Container that wires `useInfiniteMatchMarkets` to the card list and surfaces the new `signal` filter param. |
|
|
76
|
+
| `MatchMarketCard` | `match: MatchMarketFlat`, `onSelectMatch`, `getMatchHref` | Single pair card. Body click → internal pair detail. Each leg renders a small external link icon to the original platform via `leg.external_url`. |
|
|
77
|
+
|
|
78
|
+
> v1.1 deprecates the old `onSelect` / `getMarketHref` props (they took a `(match, source)` pair and routed straight to the source platform). The new `onSelectMatch(match)` is the primary action; per-leg external links are intrinsic to the card and use `leg.external_url`.
|
|
79
|
+
|
|
80
|
+
#### v1.1 visual changes
|
|
81
|
+
|
|
82
|
+
- **GAP** label replaces "Spread" — represents `|A.best_price − B.best_price|` with no fee adjustment.
|
|
83
|
+
- **SignalBadge** (`liquid_gap` / `active_gap` / `stale_gap` / `stale_data`) replaces the old confidence tier dot.
|
|
84
|
+
- **Per-leg freshness dots** (`fresh` / `aging` / `stale`) appear next to each platform name based on `leg.age_seconds`.
|
|
85
|
+
- **Compact relative age** is shown in the card footer.
|
|
86
|
+
- **External link icon** per leg opens the source-platform URL in a new tab; no Buy CTA is rendered.
|
|
87
|
+
|
|
70
88
|
### Components — Trading
|
|
71
89
|
|
|
72
90
|
| Component | Description |
|
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ declare global {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
declare const _default: "0.
|
|
16
|
+
declare const _default: "1.0.0";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* A single category entry in the static navigation model.
|
|
@@ -831,18 +831,24 @@ type SearchWidgetProps = {
|
|
|
831
831
|
declare function SearchWidget({ onKeywordChange, onSelectEvent, getEventHref, LinkComponent, onHover, onEscape, source, }: SearchWidgetProps): react_jsx_runtime.JSX.Element;
|
|
832
832
|
|
|
833
833
|
interface MatchesPageProps {
|
|
834
|
-
|
|
834
|
+
/** v1.1: invoked when the user clicks the card body (internal pair detail). */
|
|
835
|
+
onSelectMatch?: (match: MatchMarketFlat) => void;
|
|
836
|
+
/** v1.1: returns the internal pair detail href for the card link. */
|
|
837
|
+
getMatchHref?: (match: MatchMarketFlat) => string | undefined;
|
|
835
838
|
onHover?: (match: MatchMarketFlat) => void;
|
|
839
|
+
/** @deprecated v1.1 — use `onSelectMatch`. */
|
|
840
|
+
onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
|
|
841
|
+
/** @deprecated v1.1 — fallback only; per-leg `external_url` is preferred. */
|
|
836
842
|
getMarketHref?: (match: MatchMarketFlat, source: ProviderSource) => string | undefined;
|
|
837
843
|
LinkComponent?: LinkComponentType;
|
|
838
844
|
/** Path to the hero background image (e.g. "/matches-bg.webp") */
|
|
839
845
|
bgImageSrc?: string;
|
|
840
|
-
/** @deprecated Use
|
|
846
|
+
/** @deprecated Use onSelectMatch instead */
|
|
841
847
|
onSelectEntry?: (event: never) => void;
|
|
842
|
-
/** @deprecated Use
|
|
848
|
+
/** @deprecated Use getMatchHref instead */
|
|
843
849
|
getEventHref?: (event: never) => string;
|
|
844
850
|
}
|
|
845
|
-
declare function MatchesPage({
|
|
851
|
+
declare function MatchesPage({ onSelectMatch, getMatchHref, onHover, onSelect, getMarketHref, LinkComponent, bgImageSrc, }: MatchesPageProps): react_jsx_runtime.JSX.Element;
|
|
846
852
|
|
|
847
853
|
interface MatchesHeroStats {
|
|
848
854
|
activePairs: number;
|
|
@@ -862,14 +868,25 @@ interface MatchesWidgetProps {
|
|
|
862
868
|
sortBy: MatchSortField;
|
|
863
869
|
sortAsc: boolean;
|
|
864
870
|
minVolume?: number;
|
|
865
|
-
|
|
871
|
+
/**
|
|
872
|
+
* v1.1: comma-separated `signal_tag` filter (e.g. `"liquid_gap,active_gap"`).
|
|
873
|
+
* Pass `"any"` or omit to disable signal filtering.
|
|
874
|
+
*/
|
|
875
|
+
signal?: string;
|
|
876
|
+
/** v1.1: card-body click → internal pair detail. */
|
|
877
|
+
onSelectMatch?: (match: MatchMarketFlat) => void;
|
|
878
|
+
/** v1.1: returns internal pair detail href. */
|
|
879
|
+
getMatchHref?: (match: MatchMarketFlat) => string | undefined;
|
|
866
880
|
onHover?: (match: MatchMarketFlat) => void;
|
|
881
|
+
/** @deprecated v1.1 — use `onSelectMatch`. */
|
|
882
|
+
onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
|
|
883
|
+
/** @deprecated v1.1 — fallback only when `leg.external_url` is missing. */
|
|
867
884
|
getMarketHref?: (match: MatchMarketFlat, source: ProviderSource) => string | undefined;
|
|
868
885
|
LinkComponent?: LinkComponentType;
|
|
869
886
|
onStatsChange?: (stats: MatchesHeroStats) => void;
|
|
870
|
-
/** @deprecated Use
|
|
887
|
+
/** @deprecated Use onSelectMatch instead */
|
|
871
888
|
onSelectEntry?: (event: never) => void;
|
|
872
|
-
/** @deprecated Use
|
|
889
|
+
/** @deprecated Use getMatchHref instead */
|
|
873
890
|
getEventHref?: (event: never) => string;
|
|
874
891
|
}
|
|
875
892
|
declare const MatchesWidget: react.ForwardRefExoticComponent<MatchesWidgetProps & react.RefAttributes<MatchesWidgetRef>>;
|
|
@@ -882,14 +899,41 @@ interface MatchGroupCardProps {
|
|
|
882
899
|
}
|
|
883
900
|
declare function MatchGroupCard({ group, onSelectEntry, getEventHref, LinkComponent, }: MatchGroupCardProps): react_jsx_runtime.JSX.Element;
|
|
884
901
|
|
|
902
|
+
/**
|
|
903
|
+
* Props for the v1.1 match card.
|
|
904
|
+
*
|
|
905
|
+
* v1.1 changes (PRD §5):
|
|
906
|
+
* - Card click now navigates to the internal pair detail page
|
|
907
|
+
* (`getMatchHref` / `onSelectMatch`); the legacy "Buy on Platform"
|
|
908
|
+
* CTA was removed because it implied execution which the platform
|
|
909
|
+
* does not perform.
|
|
910
|
+
* - Each leg renders a small external-link icon that deep-links to the
|
|
911
|
+
* original provider's market page (`leg.external_url`, with
|
|
912
|
+
* `getMarketHref(match, source)` as backward-compat fallback).
|
|
913
|
+
* - `SignalBadge` replaces the confidence-tier dot and is sourced from
|
|
914
|
+
* `match.signal_tag`.
|
|
915
|
+
*/
|
|
885
916
|
interface MatchMarketCardProps {
|
|
886
917
|
match: MatchMarketFlat;
|
|
887
|
-
|
|
918
|
+
/** v1.1: invoked when the user clicks the card body (internal detail). */
|
|
919
|
+
onSelectMatch?: (match: MatchMarketFlat) => void;
|
|
920
|
+
/** v1.1: returns the internal pair detail href; renders card as a link. */
|
|
921
|
+
getMatchHref?: (match: MatchMarketFlat) => string | undefined;
|
|
888
922
|
onHover?: (match: MatchMarketFlat) => void;
|
|
923
|
+
/**
|
|
924
|
+
* @deprecated v1.1 — kept for source compatibility. Used as a fallback
|
|
925
|
+
* when `match.legs[*].external_url` is missing.
|
|
926
|
+
*/
|
|
889
927
|
getMarketHref?: (match: MatchMarketFlat, source: ProviderSource) => string | undefined;
|
|
928
|
+
/**
|
|
929
|
+
* @deprecated v1.1 — the "buy on cheaper platform" affordance was
|
|
930
|
+
* removed (PRD §5.4). Per-leg clicks now open the provider page in a
|
|
931
|
+
* new tab via the external-link icon, no callback required.
|
|
932
|
+
*/
|
|
933
|
+
onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
|
|
890
934
|
LinkComponent?: LinkComponentType;
|
|
891
935
|
}
|
|
892
|
-
declare function MatchMarketCard({ match,
|
|
936
|
+
declare function MatchMarketCard({ match, onSelectMatch, getMatchHref, onHover, getMarketHref, LinkComponent, }: MatchMarketCardProps): react_jsx_runtime.JSX.Element | null;
|
|
893
937
|
|
|
894
938
|
interface MatchesStatsBarProps {
|
|
895
939
|
matches: MatchGroup[];
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare global {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
declare const _default: "0.
|
|
16
|
+
declare const _default: "1.0.0";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* A single category entry in the static navigation model.
|
|
@@ -831,18 +831,24 @@ type SearchWidgetProps = {
|
|
|
831
831
|
declare function SearchWidget({ onKeywordChange, onSelectEvent, getEventHref, LinkComponent, onHover, onEscape, source, }: SearchWidgetProps): react_jsx_runtime.JSX.Element;
|
|
832
832
|
|
|
833
833
|
interface MatchesPageProps {
|
|
834
|
-
|
|
834
|
+
/** v1.1: invoked when the user clicks the card body (internal pair detail). */
|
|
835
|
+
onSelectMatch?: (match: MatchMarketFlat) => void;
|
|
836
|
+
/** v1.1: returns the internal pair detail href for the card link. */
|
|
837
|
+
getMatchHref?: (match: MatchMarketFlat) => string | undefined;
|
|
835
838
|
onHover?: (match: MatchMarketFlat) => void;
|
|
839
|
+
/** @deprecated v1.1 — use `onSelectMatch`. */
|
|
840
|
+
onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
|
|
841
|
+
/** @deprecated v1.1 — fallback only; per-leg `external_url` is preferred. */
|
|
836
842
|
getMarketHref?: (match: MatchMarketFlat, source: ProviderSource) => string | undefined;
|
|
837
843
|
LinkComponent?: LinkComponentType;
|
|
838
844
|
/** Path to the hero background image (e.g. "/matches-bg.webp") */
|
|
839
845
|
bgImageSrc?: string;
|
|
840
|
-
/** @deprecated Use
|
|
846
|
+
/** @deprecated Use onSelectMatch instead */
|
|
841
847
|
onSelectEntry?: (event: never) => void;
|
|
842
|
-
/** @deprecated Use
|
|
848
|
+
/** @deprecated Use getMatchHref instead */
|
|
843
849
|
getEventHref?: (event: never) => string;
|
|
844
850
|
}
|
|
845
|
-
declare function MatchesPage({
|
|
851
|
+
declare function MatchesPage({ onSelectMatch, getMatchHref, onHover, onSelect, getMarketHref, LinkComponent, bgImageSrc, }: MatchesPageProps): react_jsx_runtime.JSX.Element;
|
|
846
852
|
|
|
847
853
|
interface MatchesHeroStats {
|
|
848
854
|
activePairs: number;
|
|
@@ -862,14 +868,25 @@ interface MatchesWidgetProps {
|
|
|
862
868
|
sortBy: MatchSortField;
|
|
863
869
|
sortAsc: boolean;
|
|
864
870
|
minVolume?: number;
|
|
865
|
-
|
|
871
|
+
/**
|
|
872
|
+
* v1.1: comma-separated `signal_tag` filter (e.g. `"liquid_gap,active_gap"`).
|
|
873
|
+
* Pass `"any"` or omit to disable signal filtering.
|
|
874
|
+
*/
|
|
875
|
+
signal?: string;
|
|
876
|
+
/** v1.1: card-body click → internal pair detail. */
|
|
877
|
+
onSelectMatch?: (match: MatchMarketFlat) => void;
|
|
878
|
+
/** v1.1: returns internal pair detail href. */
|
|
879
|
+
getMatchHref?: (match: MatchMarketFlat) => string | undefined;
|
|
866
880
|
onHover?: (match: MatchMarketFlat) => void;
|
|
881
|
+
/** @deprecated v1.1 — use `onSelectMatch`. */
|
|
882
|
+
onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
|
|
883
|
+
/** @deprecated v1.1 — fallback only when `leg.external_url` is missing. */
|
|
867
884
|
getMarketHref?: (match: MatchMarketFlat, source: ProviderSource) => string | undefined;
|
|
868
885
|
LinkComponent?: LinkComponentType;
|
|
869
886
|
onStatsChange?: (stats: MatchesHeroStats) => void;
|
|
870
|
-
/** @deprecated Use
|
|
887
|
+
/** @deprecated Use onSelectMatch instead */
|
|
871
888
|
onSelectEntry?: (event: never) => void;
|
|
872
|
-
/** @deprecated Use
|
|
889
|
+
/** @deprecated Use getMatchHref instead */
|
|
873
890
|
getEventHref?: (event: never) => string;
|
|
874
891
|
}
|
|
875
892
|
declare const MatchesWidget: react.ForwardRefExoticComponent<MatchesWidgetProps & react.RefAttributes<MatchesWidgetRef>>;
|
|
@@ -882,14 +899,41 @@ interface MatchGroupCardProps {
|
|
|
882
899
|
}
|
|
883
900
|
declare function MatchGroupCard({ group, onSelectEntry, getEventHref, LinkComponent, }: MatchGroupCardProps): react_jsx_runtime.JSX.Element;
|
|
884
901
|
|
|
902
|
+
/**
|
|
903
|
+
* Props for the v1.1 match card.
|
|
904
|
+
*
|
|
905
|
+
* v1.1 changes (PRD §5):
|
|
906
|
+
* - Card click now navigates to the internal pair detail page
|
|
907
|
+
* (`getMatchHref` / `onSelectMatch`); the legacy "Buy on Platform"
|
|
908
|
+
* CTA was removed because it implied execution which the platform
|
|
909
|
+
* does not perform.
|
|
910
|
+
* - Each leg renders a small external-link icon that deep-links to the
|
|
911
|
+
* original provider's market page (`leg.external_url`, with
|
|
912
|
+
* `getMarketHref(match, source)` as backward-compat fallback).
|
|
913
|
+
* - `SignalBadge` replaces the confidence-tier dot and is sourced from
|
|
914
|
+
* `match.signal_tag`.
|
|
915
|
+
*/
|
|
885
916
|
interface MatchMarketCardProps {
|
|
886
917
|
match: MatchMarketFlat;
|
|
887
|
-
|
|
918
|
+
/** v1.1: invoked when the user clicks the card body (internal detail). */
|
|
919
|
+
onSelectMatch?: (match: MatchMarketFlat) => void;
|
|
920
|
+
/** v1.1: returns the internal pair detail href; renders card as a link. */
|
|
921
|
+
getMatchHref?: (match: MatchMarketFlat) => string | undefined;
|
|
888
922
|
onHover?: (match: MatchMarketFlat) => void;
|
|
923
|
+
/**
|
|
924
|
+
* @deprecated v1.1 — kept for source compatibility. Used as a fallback
|
|
925
|
+
* when `match.legs[*].external_url` is missing.
|
|
926
|
+
*/
|
|
889
927
|
getMarketHref?: (match: MatchMarketFlat, source: ProviderSource) => string | undefined;
|
|
928
|
+
/**
|
|
929
|
+
* @deprecated v1.1 — the "buy on cheaper platform" affordance was
|
|
930
|
+
* removed (PRD §5.4). Per-leg clicks now open the provider page in a
|
|
931
|
+
* new tab via the external-link icon, no callback required.
|
|
932
|
+
*/
|
|
933
|
+
onSelect?: (match: MatchMarketFlat, source: ProviderSource) => void;
|
|
890
934
|
LinkComponent?: LinkComponentType;
|
|
891
935
|
}
|
|
892
|
-
declare function MatchMarketCard({ match,
|
|
936
|
+
declare function MatchMarketCard({ match, onSelectMatch, getMatchHref, onHover, getMarketHref, LinkComponent, }: MatchMarketCardProps): react_jsx_runtime.JSX.Element | null;
|
|
893
937
|
|
|
894
938
|
interface MatchesStatsBarProps {
|
|
895
939
|
matches: MatchGroup[];
|