fansunited-frontend-components 0.0.96 → 0.0.98

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 CHANGED
@@ -353,6 +353,7 @@ Every event also carries `context`.
353
353
  | Engagement | `odds_click` | `match_id`, `outcome`, `odd_value`, `operator` |
354
354
  | | `leaderboard_page_change` | `page`, `total_pages` |
355
355
  | | `embed_success_cta_click` | `match_id`, `cta_label`, `url` |
356
+ | | `embed_submit_cta_click` | `match_id`, `markets`, `url` |
356
357
  | Private leagues | `private_league_created` / `_joined` / `_view` / `_invite_shared` / `_invitation_accepted` / `_invitation_declined` / `_left` / `_deleted` | `league_id`, `league_name` |
357
358
 
358
359
  **Match descriptors** are `match_id`, `home_team`, `home_team_id`, `away_team`, `away_team_id`,
@@ -3841,11 +3842,31 @@ interface PredictorEmbedConfig {
3841
3842
  description?: string;
3842
3843
  cta: OnSuccessCTADetails; // required — priority is onClick → url (no `component` support here)
3843
3844
  };
3845
+ submitCTA?: {
3846
+ defaultLabel?: string; // replaces "Submit"
3847
+ url?: string | null; // set → draft handoff to this page (see below); unset → submit saves as usual
3848
+ target?: LinkTargetType; // default: "_self"
3849
+ onClick?: (handoffUrl: string) => void; // replaces the navigation, e.g. for client-side routing
3850
+ };
3844
3851
  }
3845
3852
  ```
3846
3853
 
3847
3854
  **Embed layout:** a gradient background (top to bottom, from the theme's primary color) wraps a branding/title/description block next to an optional image (position set by `imagePosition`), a white match card with team crests and centered score steppers showing the always-visible full 1X2 odds market, and a fixed-size submit button below the card. When `embed.successMessage` is configured, submitting a prediction swaps that button for the same-styled CTA button (using `successMessage.cta`) followed by a success alert with a pop-in animation; omit `successMessage` to show nothing extra after submission.
3848
3855
 
3856
+ **Submit CTA and draft handoff:** `embed.submitCTA.defaultLabel` relabels the submit button. With `embed.submitCTA.url` set, submit doesn't save. It takes the user straight to that URL with their picks prefilled on that match, and they submit there in one click. `submitCTA.onClick`, if given, replaces the navigation and receives the handoff URL as its only argument. Logged-out users get the button too, and sign in on that page. `successMessage` is never shown in this mode. A standard-template Predictor with the same `entityId` on that page reads the picks on load, opens Play on that match's matchweek, and scrolls to the card.
3857
+
3858
+ The handoff URL is `submitCTA.url` resolved to an absolute URL, with its own query string and hash kept and these params added (URL-encoded):
3859
+
3860
+ | Param | Value |
3861
+ | --- | --- |
3862
+ | `fu_match` | The match id |
3863
+ | `fu_kickoff` | Kickoff time, ISO 8601 |
3864
+ | `fu_pick_<MARKET>` | One per answered market: `home:away` for scorelines (0–20 each), `1` / `x` / `2` for 1X2, `true` / `false` for yes/no markets, a whole number 0–30 for `CORNERS_MATCH` |
3865
+
3866
+ ```
3867
+ https://your-site.com/predictor?fu_match=fb%3Am%3A451634&fu_kickoff=2026-11-08T15%3A00%3A00Z&fu_pick_CORRECT_SCORE_ADVANCED=3%3A1
3868
+ ```
3869
+
3849
3870
  ```tsx
3850
3871
  import { Predictor } from "fansunited-frontend-components";
3851
3872
  import { PredictorProps } from "fansunited-frontend-core";
@@ -4187,6 +4208,7 @@ import {
4187
4208
  PredictorTab,
4188
4209
  PredictorTemplateType,
4189
4210
  PredictorEmbedConfig,
4211
+ PredictorEmbedSubmitCTA,
4190
4212
  PredictorHeaderConfig,
4191
4213
  PredictorBetslipConfig,
4192
4214
  PredictorBetslipTrigger,
package/Standings.js CHANGED
@@ -7,7 +7,7 @@ import { MatchFilters as de } from "fansunited-sdk-esm/models";
7
7
  import Ge from "@mui/icons-material/EmojiEvents";
8
8
  import { createPortal as we } from "react-dom";
9
9
  import { CacheProvider as je } from "@emotion/react";
10
- import { w as Ze } from "./chunks/withVersionStamp-B6nArAj4.js";
10
+ import { w as Ze } from "./chunks/withVersionStamp-T8seRk9h.js";
11
11
  const Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().replace(
12
12
  /\S+/g,
13
13
  (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()
package/TopX.js CHANGED
@@ -60,7 +60,7 @@ import Rn from "@mui/icons-material/KeyboardArrowDown";
60
60
  import Tn from "@mui/icons-material/ArrowBackIosNew";
61
61
  import Fn from "@mui/icons-material/ArrowForwardIos";
62
62
  import En from "@mui/icons-material/WarningAmber";
63
- import { w as Pn } from "./chunks/withVersionStamp-B6nArAj4.js";
63
+ import { w as Pn } from "./chunks/withVersionStamp-T8seRk9h.js";
64
64
  const Ir = Hr(null), Wn = ({ children: t, ...r }) => /* @__PURE__ */ e(Ir.Provider, { value: r, children: t }), pt = () => {
65
65
  const t = jr(Ir);
66
66
  if (!t)
@@ -4,7 +4,7 @@ import { version as i } from "fansunited-frontend-core";
4
4
  let o = !1;
5
5
  const m = () => {
6
6
  o || typeof window > "u" || (o = !0, window.fansUnitedComponentsVersions = {
7
- components: "0.0.96",
7
+ components: "0.0.98",
8
8
  core: i
9
9
  });
10
10
  }, d = (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fansunited-frontend-components",
3
- "version": "0.0.96",
3
+ "version": "0.0.98",
4
4
  "description": "Various user centric components for Fans United features",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -106,7 +106,7 @@
106
106
  "@mui/icons-material": "^6.1.6",
107
107
  "@mui/joy": "^5.0.0-beta.52",
108
108
  "@mui/material": "^6.1.6",
109
- "fansunited-frontend-core": "0.0.96",
109
+ "fansunited-frontend-core": "0.0.98",
110
110
  "i18next": "^25.2.1",
111
111
  "i18next-browser-languagedetector": "^8.1.0",
112
112
  "react-i18next": "^15.5.2"