fansunited-frontend-components 0.0.82 → 0.0.83
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/Betslip.js +1 -1
- package/ClassicQuizPlay.js +1 -1
- package/EitherOrPlay.js +1 -1
- package/EventGamePlay.js +1 -1
- package/List.js +3 -3
- package/MatchQuizPlay.js +1 -1
- package/PersonalityQuizPlay.js +1 -1
- package/PollVote.js +1 -1
- package/Predictor.js +1 -1
- package/README.md +58 -7
- package/Standings.js +1 -1
- package/TopX.js +6 -4
- package/chunks/{Predictor-CLlVlURi.js → Predictor-Bb49X4ju.js} +6 -4
- package/chunks/index-5DY7v7lS.js +4 -0
- package/chunks/index-BHMoWAg1.js +4 -0
- package/chunks/index-BZMi93b8.js +4 -0
- package/chunks/index-CjFhnUwO.js +4 -0
- package/chunks/index-D-yn2UCo.js +1043 -0
- package/chunks/index-DJDpXJ-0.js +4 -0
- package/chunks/index-ZiJ5jIE6.js +4 -0
- package/chunks/{main-BA4r51Zz.js → main-Bnytk9nG.js} +1 -1
- package/chunks/{main-DugSDcr2.js → main-BzLHddJc.js} +1 -1
- package/chunks/{main-GIjYTHw6.js → main-CrjbWLB0.js} +557 -507
- package/chunks/{main-g2Pr00jt.js → main-D0j5AD7D.js} +1 -1
- package/chunks/{main-DlKrBoCB.js → main-D5mrx6Sz.js} +1 -1
- package/chunks/{main-BW8ZGosK.js → main-DU6faBHS.js} +1 -1
- package/chunks/{main-1ycVui8N.js → main-DtZ9jq8Y.js} +1 -1
- package/index.js +3 -3
- package/package.json +2 -2
- package/chunks/index-65ac64VA.js +0 -4
- package/chunks/index-B0GV9pN1.js +0 -4
- package/chunks/index-CXn9mhg1.js +0 -4
- package/chunks/index-CZMWqXNb.js +0 -4
- package/chunks/index-Ckc5sZOb.js +0 -4
- package/chunks/index-D8LNRIZH.js +0 -4
- package/chunks/index-YA7wEdrb.js +0 -845
package/Betslip.js
CHANGED
package/ClassicQuizPlay.js
CHANGED
package/EitherOrPlay.js
CHANGED
package/EventGamePlay.js
CHANGED
package/List.js
CHANGED
|
@@ -553,9 +553,9 @@ const jt = Mt("Users", [
|
|
|
553
553
|
]
|
|
554
554
|
}
|
|
555
555
|
);
|
|
556
|
-
}, Jt = j(() => import("./chunks/index-
|
|
557
|
-
() => import("./chunks/index-
|
|
558
|
-
), te = j(() => import("./chunks/index-
|
|
556
|
+
}, Jt = j(() => import("./chunks/index-5DY7v7lS.js")), Xt = j(
|
|
557
|
+
() => import("./chunks/index-DJDpXJ-0.js")
|
|
558
|
+
), te = j(() => import("./chunks/index-BHMoWAg1.js")), ee = j(() => import("./chunks/index-ZiJ5jIE6.js")), ne = j(() => import("./chunks/index-BZMi93b8.js")), oe = j(() => import("./chunks/index-CjFhnUwO.js")), re = ({
|
|
559
559
|
item: e,
|
|
560
560
|
open: n,
|
|
561
561
|
onClose: t,
|
package/MatchQuizPlay.js
CHANGED
package/PersonalityQuizPlay.js
CHANGED
package/PollVote.js
CHANGED
package/Predictor.js
CHANGED
package/README.md
CHANGED
|
@@ -4023,6 +4023,8 @@ const betslipConfig: PredictorBetslipConfig = {
|
|
|
4023
4023
|
| `currency` | `string` | `"€"` | Currency symbol |
|
|
4024
4024
|
| `ctaUrlTemplate` | `string` | — | Bookmaker deep-link URL with `{placeholder}` substitution |
|
|
4025
4025
|
| `brandingLogoUrl` | `string` | — | Operator logo URL |
|
|
4026
|
+
| `operatorId` | `string` | — | Operator config id the Betslip requests odds for, e.g. `"betano-bg"` |
|
|
4027
|
+
| `affiliateId` | `string` | — | Affiliate id substituted into the operator's URLs |
|
|
4026
4028
|
| `labels` | `BetslipLabels` | — | UI text overrides |
|
|
4027
4029
|
| `themeOptions` | `CustomThemeOptions` | — | Theme for the Betslip widget. Falls back to the Predictor's `themeOptions` when omitted |
|
|
4028
4030
|
|
|
@@ -4486,6 +4488,8 @@ const betslipConfig: TopXBetslipConfig = {
|
|
|
4486
4488
|
| `currency` | `string` | `"€"` | Currency symbol |
|
|
4487
4489
|
| `ctaUrlTemplate` | `string` | — | Bookmaker deep-link URL with `{placeholder}` substitution |
|
|
4488
4490
|
| `brandingLogoUrl` | `string` | — | Operator logo URL |
|
|
4491
|
+
| `operatorId` | `string` | — | Operator config id the Betslip requests odds for, e.g. `"betano-bg"` |
|
|
4492
|
+
| `affiliateId` | `string` | — | Affiliate id substituted into the operator's URLs |
|
|
4489
4493
|
| `labels` | `BetslipLabels` | — | UI text overrides |
|
|
4490
4494
|
| `themeOptions` | `CustomThemeOptions` | — | Theme for the Betslip widget. Falls back to the TopX `themeOptions` when omitted |
|
|
4491
4495
|
|
|
@@ -4668,8 +4672,10 @@ const App: React.FC = () => (
|
|
|
4668
4672
|
| `stakePresets` | `number[]` | `[5, 10, 20]` | Quick-select stake buttons shown in the footer |
|
|
4669
4673
|
| `oddsPollingInterval` | `number` | `30000` | Odds refresh interval in milliseconds |
|
|
4670
4674
|
| `currency` | `string` | `"€"` | Currency symbol shown next to stake and potential win |
|
|
4671
|
-
| `ctaUrlTemplate` | `string` | — |
|
|
4675
|
+
| `ctaUrlTemplate` | `string` | — | Overrides the CTA link; unset, the operator's own betslip link is used |
|
|
4672
4676
|
| `brandingLogoUrl` | `string` | — | Operator logo URL that overrides the bookmaker logo |
|
|
4677
|
+
| `operatorId` | `string` | — | Operator config id to request odds for. See [Choosing a Bookmaker](#choosing-a-bookmaker) below |
|
|
4678
|
+
| `affiliateId` | `string` | — | Affiliate id substituted into the operator's URLs |
|
|
4673
4679
|
| `labels` | `BetslipLabels` | — | UI text overrides. See [Labels](#labels) below |
|
|
4674
4680
|
| `themeOptions` | `CustomThemeOptions` | — | Theme tokens. See [Theming](#theming-1) below |
|
|
4675
4681
|
|
|
@@ -4799,19 +4805,35 @@ import { Predictor } from "fansunited-frontend-components";
|
|
|
4799
4805
|
| `"predictions-only"` | Each time the user changes a score prediction (before submitting) |
|
|
4800
4806
|
| `"odds-only"` | When the user clicks an odds button on the post-submit odds view |
|
|
4801
4807
|
|
|
4802
|
-
#### CTA
|
|
4808
|
+
#### The CTA Link
|
|
4803
4809
|
|
|
4804
|
-
The
|
|
4810
|
+
The CTA resolves in three steps, first match wins:
|
|
4811
|
+
|
|
4812
|
+
1. **`ctaUrlTemplate`**, if you set one — your own destination.
|
|
4813
|
+
2. **The operator's betslip deep link** from the odds response (`operator.betslip_url_template`), picked for the current device's app type. **This is the one that lands the user on a pre-filled betslip at the bookmaker, and it needs no configuration.**
|
|
4814
|
+
3. **The operator's homepage** — a last resort that opens the bookmaker with an empty slip.
|
|
4815
|
+
|
|
4816
|
+
So in the normal case you configure nothing. Set `ctaUrlTemplate` only when the CTA must go somewhere other than the operator's betslip.
|
|
4817
|
+
|
|
4818
|
+
The API resolves every placeholder in its own template except `{betslip_ids}`, which is left for the widget: it becomes the operator's selection ids (`operator_info.selection_id`) for the current selections, joined with the operator's own `betslip_id_separator`.
|
|
4819
|
+
|
|
4820
|
+
```
|
|
4821
|
+
template https://www.betano.bg/mybet/?selection_ids={betslip_ids}&aff=
|
|
4822
|
+
result https://www.betano.bg/mybet/?selection_ids=10184348244,10184348269&aff=
|
|
4823
|
+
```
|
|
4824
|
+
|
|
4825
|
+
**Affiliate attribution:** operator URLs carry an `{affiliate_id}` placeholder the API fills only when the request supplies one — otherwise the tag comes back empty, as in the `&aff=` above. Set `affiliateId` so CTA clicks are attributed to you:
|
|
4805
4826
|
|
|
4806
4827
|
```tsx
|
|
4807
|
-
|
|
4828
|
+
<Betslip sdk={sdk} language="en" operatorId="betano-bg" affiliateId="your-affiliate-id" />
|
|
4808
4829
|
```
|
|
4809
4830
|
|
|
4810
|
-
**Available placeholders
|
|
4831
|
+
**Available placeholders** — these work in `ctaUrlTemplate`, and in an operator template should one carry them:
|
|
4811
4832
|
|
|
4812
4833
|
| Placeholder | Value |
|
|
4813
4834
|
| ----------------- | ------------------------------------------------------------------------- |
|
|
4814
|
-
| `{
|
|
4835
|
+
| `{betslip_ids}` | Operator selection ids joined with the operator's separator |
|
|
4836
|
+
| `{selectionIds}` | Comma-separated selection ids, URI-encoded as a whole |
|
|
4815
4837
|
| `{stake}` | Current stake input value (float) |
|
|
4816
4838
|
| `{currentUrl}` | `window.location.href`, URI-encoded |
|
|
4817
4839
|
| `{eventId}` | `eventId` of the first selection |
|
|
@@ -4819,6 +4841,35 @@ ctaUrlTemplate="https://betano.bg/mybet/?selection_ids={selectionIds}&stake={sta
|
|
|
4819
4841
|
| `{market}` | Market code of the first selection |
|
|
4820
4842
|
| `{outcome}` | Outcome label of the first selection |
|
|
4821
4843
|
|
|
4844
|
+
#### Choosing a Bookmaker
|
|
4845
|
+
|
|
4846
|
+
`sdk.odds.getByMatchIds()` returns odds from every bookmaker the backend has configured for a match. The Betslip renders one bookmaker at a time, and without `operatorId` it uses whichever one the response lists first — which is not guaranteed to stay the same.
|
|
4847
|
+
|
|
4848
|
+
Set `operatorId` to the operator config id to pin the Betslip to that bookmaker:
|
|
4849
|
+
|
|
4850
|
+
```tsx
|
|
4851
|
+
<Betslip sdk={sdk} language="en" operatorId="betano-bg" />
|
|
4852
|
+
```
|
|
4853
|
+
|
|
4854
|
+
It is passed to the odds request as the SDK's `operators` filter, so the response is narrowed server-side rather than in the widget — the Betslip never downloads the other bookmakers' prices.
|
|
4855
|
+
|
|
4856
|
+
Everything the Betslip derives from the bookmaker follows — the odds themselves, the accent color, the header and CTA logo, and the deep links. Markets the chosen bookmaker does not price are dropped from the Betslip (see the odds behavior notes below), and if it prices nothing in the betslip, the panel stays hidden.
|
|
4857
|
+
|
|
4858
|
+
**Available operator ids:**
|
|
4859
|
+
|
|
4860
|
+
```
|
|
4861
|
+
betano-bg
|
|
4862
|
+
efbet-bg
|
|
4863
|
+
inbet-bg-online
|
|
4864
|
+
inbet-bg-offline
|
|
4865
|
+
betwild-bg
|
|
4866
|
+
bet-bg
|
|
4867
|
+
sesame-bg
|
|
4868
|
+
winbet-bg
|
|
4869
|
+
```
|
|
4870
|
+
|
|
4871
|
+
Operators are configured on the Fans United side, so this list can change — check with your account manager if the one you need is not here.
|
|
4872
|
+
|
|
4822
4873
|
#### Theming
|
|
4823
4874
|
|
|
4824
4875
|
The Betslip derives its primary accent color from a three-level priority chain:
|
|
@@ -4929,7 +4980,7 @@ Conflicts resolve automatically when the user removes one of the conflicting sel
|
|
|
4929
4980
|
|
|
4930
4981
|
- **Polling**: Odds are fetched from `sdk.odds.getByMatchIds()` on mount and refreshed every `oddsPollingInterval` ms (default 30 s)
|
|
4931
4982
|
- **Movement indicator**: A green ▲ or red ▼ is shown when the bookmaker response includes a `movement` field (`"UP"` or `"DOWN"`) on the matched selection. No indicator is shown when `movement` is absent
|
|
4932
|
-
- **Unavailable**:
|
|
4983
|
+
- **Unavailable**: A selection the bookmaker does not price at all is dropped from the Betslip once odds arrive, with a `console.warn` naming it — the bus accepts any selection id, so this is the first point at which it is knowable. While odds are still in flight, or when the event has no odds from anyone, the card shows `oddsUnavailableLabel` and the CTA is disabled
|
|
4933
4984
|
- **Suspended**: Selections with status `"suspended"` are highlighted and block the CTA
|
|
4934
4985
|
- **Settled states**: Cards display ✓ (won), ✗ (lost), or ≈ (void) once a selection is settled
|
|
4935
4986
|
|
package/Standings.js
CHANGED
|
@@ -4,7 +4,7 @@ import { g as D, u as F, d as $, B as x, z as q, y as Y, a as Q, f as H, b as Le
|
|
|
4
4
|
import { S as Ne } from "./chunks/Spinner-DY_zcnrD.js";
|
|
5
5
|
import { createPortal as pe } from "react-dom";
|
|
6
6
|
import { h as ee, b as Ie } from "./chunks/helpers-BMuk4hnl.js";
|
|
7
|
-
import {
|
|
7
|
+
import { l as le } from "./chunks/index-D-yn2UCo.js";
|
|
8
8
|
import { E as $e } from "./chunks/EmojiEvents-BEBKqTNQ.js";
|
|
9
9
|
import { T as k } from "./chunks/Typography-BpJiv43e.js";
|
|
10
10
|
import { C as Me } from "./chunks/Chip-kF883PQI.js";
|
package/TopX.js
CHANGED
|
@@ -4,10 +4,10 @@ import Pe, { createContext as en, useContext as tn, useState as P, useRef as je,
|
|
|
4
4
|
import { D as nn, _ as Ie, F as an, G as sn, H as ln, I as qt, P as U, J as Co, g as be, d as xe, B as r, a as We, f as ve, u as ke, z as eo, y as zr, b as zt, v as $t, i as yo, c as cn, m as $r, h as dn, A as Rr } from "./chunks/PrizeCard-DNkUxPP5.js";
|
|
5
5
|
import { createPortal as pn } from "react-dom";
|
|
6
6
|
import { P as un } from "./chunks/Portal-CoIVje0X.js";
|
|
7
|
-
import { b as Tr, M as mn } from "./chunks/main-
|
|
7
|
+
import { b as Tr, M as mn } from "./chunks/main-CrjbWLB0.js";
|
|
8
8
|
import { b as tt, h as Pt, c as fn } from "./chunks/helpers-BMuk4hnl.js";
|
|
9
9
|
import { N as to } from "./chunks/Notification-DTPs-cSl.js";
|
|
10
|
-
import {
|
|
10
|
+
import { c as xn, d as hn, u as gn, p as yn, n as bn } from "./chunks/index-D-yn2UCo.js";
|
|
11
11
|
import { S as Sn } from "./chunks/Stack-sKaojYXf.js";
|
|
12
12
|
import { F as Cn, C as vn } from "./chunks/FormControl-BgoE5GO2.js";
|
|
13
13
|
import { u as kn, a as er, e as vo, s as Rt, b as wn, c as Lt, i as In, d as Ln, T as S } from "./chunks/Typography-BpJiv43e.js";
|
|
@@ -18903,7 +18903,7 @@ const il = ({ template: t, loading: o }) => {
|
|
|
18903
18903
|
}
|
|
18904
18904
|
);
|
|
18905
18905
|
}, sl = (t) => {
|
|
18906
|
-
var o, a, s, c, n, l, d, i, f;
|
|
18906
|
+
var o, a, s, c, n, l, d, i, f, g, u;
|
|
18907
18907
|
return /* @__PURE__ */ p(Ee, { children: [
|
|
18908
18908
|
/* @__PURE__ */ e(un, { packageName: "top-x", ...t, children: /* @__PURE__ */ e(al, { ...t }) }),
|
|
18909
18909
|
/* @__PURE__ */ e(
|
|
@@ -18919,7 +18919,9 @@ const il = ({ template: t, loading: o }) => {
|
|
|
18919
18919
|
stakePresets: (l = t.betslip) == null ? void 0 : l.stakePresets,
|
|
18920
18920
|
ctaUrlTemplate: (d = t.betslip) == null ? void 0 : d.ctaUrlTemplate,
|
|
18921
18921
|
brandingLogoUrl: (i = t.betslip) == null ? void 0 : i.brandingLogoUrl,
|
|
18922
|
-
|
|
18922
|
+
operatorId: (f = t.betslip) == null ? void 0 : f.operatorId,
|
|
18923
|
+
affiliateId: (g = t.betslip) == null ? void 0 : g.affiliateId,
|
|
18924
|
+
labels: (u = t.betslip) == null ? void 0 : u.labels
|
|
18923
18925
|
}
|
|
18924
18926
|
)
|
|
18925
18927
|
] });
|
|
@@ -6,8 +6,8 @@ import Te, { createContext as Kr, useContext as qr, useRef as Fe, useCallback as
|
|
|
6
6
|
import { g as xe, d as ue, B as r, a as Le, f as Se, u as Ce, y as Tt, z as Et, b as It, v as Rt, i as lo, c as Zr, m as ir, h as sr, A as lr } from "./PrizeCard-DNkUxPP5.js";
|
|
7
7
|
import { createPortal as en } from "react-dom";
|
|
8
8
|
import { P as tn } from "./Portal-CoIVje0X.js";
|
|
9
|
-
import { b as qt, M as on } from "./main-
|
|
10
|
-
import {
|
|
9
|
+
import { b as qt, M as on } from "./main-CrjbWLB0.js";
|
|
10
|
+
import { c as rn, d as nn, u as sn, p as ln } from "./index-D-yn2UCo.js";
|
|
11
11
|
import { S as an } from "./Stack-sKaojYXf.js";
|
|
12
12
|
import { F as cn, C as dn } from "./FormControl-BgoE5GO2.js";
|
|
13
13
|
import { T as S } from "./Typography-BpJiv43e.js";
|
|
@@ -19551,7 +19551,7 @@ const wl = ({ template: t, loading: o }) => {
|
|
|
19551
19551
|
}
|
|
19552
19552
|
);
|
|
19553
19553
|
}, Ml = (t) => {
|
|
19554
|
-
var o, i, n, c, s, l, d, a, x;
|
|
19554
|
+
var o, i, n, c, s, l, d, a, x, y, p;
|
|
19555
19555
|
return /* @__PURE__ */ m(We, { children: [
|
|
19556
19556
|
/* @__PURE__ */ e(tn, { packageName: "predictor", ...t, template: void 0, children: t.template === "embed" ? /* @__PURE__ */ e(Al, { ...t }) : /* @__PURE__ */ e(Rl, { ...t }) }),
|
|
19557
19557
|
/* @__PURE__ */ e(
|
|
@@ -19567,7 +19567,9 @@ const wl = ({ template: t, loading: o }) => {
|
|
|
19567
19567
|
stakePresets: (l = t.betslip) == null ? void 0 : l.stakePresets,
|
|
19568
19568
|
ctaUrlTemplate: (d = t.betslip) == null ? void 0 : d.ctaUrlTemplate,
|
|
19569
19569
|
brandingLogoUrl: (a = t.betslip) == null ? void 0 : a.brandingLogoUrl,
|
|
19570
|
-
|
|
19570
|
+
operatorId: (x = t.betslip) == null ? void 0 : x.operatorId,
|
|
19571
|
+
affiliateId: (y = t.betslip) == null ? void 0 : y.affiliateId,
|
|
19572
|
+
labels: (p = t.betslip) == null ? void 0 : p.labels
|
|
19571
19573
|
}
|
|
19572
19574
|
)
|
|
19573
19575
|
] });
|