fansunited-frontend-components 0.0.38 → 0.0.39

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.
Files changed (28) hide show
  1. package/ChanceGame.js +5 -5
  2. package/ClassicQuizPlay.js +19 -18
  3. package/CollectLead.js +4 -4
  4. package/Discussion.js +1562 -1343
  5. package/EventGamePlay.js +528 -581
  6. package/MatchQuizPlay.js +808 -860
  7. package/PersonalityQuizPlay.js +142 -112
  8. package/PickThePair.js +6 -6
  9. package/PollVote.js +59 -58
  10. package/README.md +231 -0
  11. package/chunks/{AlertMessage-DZAXIV4L.js → AlertMessage-C2aBXCrl.js} +69 -72
  12. package/chunks/{ChanceGameEmbedVariant-B5jX_jMO.js → ChanceGameEmbedVariant-BvIKBhq_.js} +5 -5
  13. package/chunks/{Select-DSxMtwH4.js → CheckCircle-D-GH16Lb.js} +321 -317
  14. package/chunks/{CollectLeadForm-D7pLjJkA.js → CollectLeadForm-o9NdYQgu.js} +5 -5
  15. package/chunks/{ConstantsProvider-YKCgQ1mh.js → ConstantsProvider-BPJJz9fq.js} +390 -360
  16. package/chunks/{Snackbar-DIH2D4Gx.js → Notification-Bwcoljir.js} +294 -238
  17. package/chunks/{OverlayLeadAfterCollection-9i_et1r0.js → OverlayLeadAfterCollection-B3D5ct0J.js} +4 -4
  18. package/chunks/{OverlayScoreStateSkeleton-BEe63pWp.js → OverlayScoreStateSkeleton-xvq9lQEi.js} +3 -3
  19. package/chunks/{PickOneOfX-UVJCgkSX.js → PickOneOfX-C2YpLk40.js} +1 -1
  20. package/chunks/{Portal-CfeOliT5.js → Portal-DWAr8MhA.js} +7 -7
  21. package/chunks/{Spinner-kT93nizf.js → Spinner-m59ZJZ35.js} +55 -55
  22. package/chunks/{Tabs-B6f7vU-w.js → Tabs-BGihvj9C.js} +44 -44
  23. package/chunks/{Textarea-EApa88SY.js → Textarea-Bzlb89Zp.js} +2 -2
  24. package/chunks/{TimerOutlined-CtKZ9Yp9.js → TimerOutlined-DiX8hCoC.js} +1 -1
  25. package/chunks/{Error-ZEDfLj_t.js → chevron-right-Dlc9ZKhv.js} +56 -59
  26. package/chunks/{useImageVariant-BB7FL7DQ.js → useImageVariant-Do8kOVs2.js} +1 -1
  27. package/chunks/{useInfoPage-Cjw5ykNz.js → useInfoPage-v91yL5SS.js} +37 -37
  28. package/package.json +1 -1
package/PollVote.js CHANGED
@@ -1,16 +1,17 @@
1
1
  import { jsxs as x, Fragment as B, jsx as t } from "react/jsx-runtime";
2
2
  import Ie, { useState as J, useEffect as Be, useRef as ot, useMemo as Xe } from "react";
3
- import { e as N, u as Z, f as ee, v as _, w as Y, x as F, y as ze, W as V, B as l, T as h, a7 as at, a0 as G, a2 as je, a1 as Te, aj as Ae, a3 as We, a5 as p, aq as rt, c as ct, ao as st, i as dt } from "./chunks/ConstantsProvider-YKCgQ1mh.js";
4
- import { P as gt } from "./chunks/Portal-CfeOliT5.js";
5
- import { h as Ce, s as Ue, g as mt, e as Ve, d as he, a as be, u as ie, b as tt, n as ut } from "./chunks/useImageVariant-BB7FL7DQ.js";
6
- import { S as ft } from "./chunks/Spinner-kT93nizf.js";
3
+ import { e as N, u as Z, f as ee, v as _, w as Y, x as F, y as ze, W as V, B as l, T as h, a7 as at, a0 as G, a2 as Ee, a1 as Te, am as Ae, a3 as We, a5 as p, aq as rt, d as ct, ao as st, i as dt } from "./chunks/ConstantsProvider-BPJJz9fq.js";
4
+ import { P as gt } from "./chunks/Portal-DWAr8MhA.js";
5
+ import { h as Ce, s as Ue, g as mt, e as Ve, d as he, a as be, u as ie, b as tt, n as ut } from "./chunks/useImageVariant-Do8kOVs2.js";
6
+ import { S as ft } from "./chunks/Spinner-m59ZJZ35.js";
7
7
  import "react-dom";
8
- import { g as xt, M as yt, S as ht, A as Ge, R as pe, a as bt, O as nt, b as lt, c as it, C as Ze, d as et } from "./chunks/ChanceGameEmbedVariant-B5jX_jMO.js";
9
- import { R as Oe, A as Me, O as Ct, S as St, N as It } from "./chunks/useInfoPage-Cjw5ykNz.js";
10
- import { C as Tt } from "./chunks/CollectLeadForm-D7pLjJkA.js";
11
- import { e as At, d as Pt, f as kt, W as vt, C as Ft } from "./chunks/AlertMessage-DZAXIV4L.js";
12
- import { O as Dt } from "./chunks/OverlayScoreStateSkeleton-BEe63pWp.js";
13
- import { S as Lt, a as Rt, O as wt, b as Bt, c as zt, d as Wt } from "./chunks/OverlayLeadAfterCollection-9i_et1r0.js";
8
+ import { g as xt, M as yt, S as ht, A as Ge, R as pe, a as bt, O as nt, b as lt, c as it, C as Ze, d as et } from "./chunks/ChanceGameEmbedVariant-BvIKBhq_.js";
9
+ import { R as Oe, A as Me, O as Ct, S as St, N as It } from "./chunks/useInfoPage-v91yL5SS.js";
10
+ import { C as Tt } from "./chunks/CollectLeadForm-o9NdYQgu.js";
11
+ import { C as At } from "./chunks/CheckCircle-D-GH16Lb.js";
12
+ import { e as Pt, d as kt, f as vt, W as Ft } from "./chunks/AlertMessage-C2aBXCrl.js";
13
+ import { O as Dt } from "./chunks/OverlayScoreStateSkeleton-xvq9lQEi.js";
14
+ import { S as Lt, a as Rt, O as wt, b as Bt, c as zt, d as Wt } from "./chunks/OverlayLeadAfterCollection-B3D5ct0J.js";
14
15
  const Vt = (e) => {
15
16
  var n, o, i;
16
17
  return {
@@ -548,7 +549,7 @@ const Vt = (e) => {
548
549
  isSubmittingParticipation: A
549
550
  }
550
551
  );
551
- }, Ee = (e) => {
552
+ }, je = (e) => {
552
553
  const n = ot(null);
553
554
  return Be(() => {
554
555
  var o;
@@ -573,7 +574,7 @@ const Vt = (e) => {
573
574
  n.current && (n.current.innerHTML = "");
574
575
  };
575
576
  }, [e]), n;
576
- }, jt = (e) => ({
577
+ }, Et = (e) => ({
577
578
  // Main content section (non-filter screen)
578
579
  mainContentSection: {
579
580
  display: "flex",
@@ -676,7 +677,7 @@ const Vt = (e) => {
676
677
  }
677
678
  }), qe = (e) => {
678
679
  var b;
679
- const n = Z(), o = F(), i = Y().sm, s = _().primary, c = Y().xs, a = ee(), u = je().size, g = Ee(e.option.embedCode || ""), y = !!e.option.embedCode, d = ((b = e.brandingColors) == null ? void 0 : b.primaryColor) || o.palette.primary.plainColor, m = o.palette.primary.onPrimary, f = e.selectedOptions.includes(e.option.id) ? m : n.colorSchemes.light.textColor, k = e.optionsImages.get(e.option.id), I = () => {
680
+ const n = Z(), o = F(), i = Y().sm, s = _().primary, c = Y().xs, a = ee(), u = Ee().size, g = je(e.option.embedCode || ""), y = !!e.option.embedCode, d = ((b = e.brandingColors) == null ? void 0 : b.primaryColor) || o.palette.primary.plainColor, m = o.palette.primary.onPrimary, f = e.selectedOptions.includes(e.option.id) ? m : n.colorSchemes.light.textColor, k = e.optionsImages.get(e.option.id), I = () => {
680
681
  e.multipleChoice ? e.answerPoll([e.option.id]) : e.answerPoll([e.option.id]);
681
682
  }, r = e.selectedOptions.includes(e.option.id), A = e.isVoting || e.multipleChoice && !r && e.selectedOptions.length >= (e.maxChoices || 1), S = () => y ? /* @__PURE__ */ x(B, { children: [
682
683
  /* @__PURE__ */ t(
@@ -875,8 +876,8 @@ const Vt = (e) => {
875
876
  const c = (o ? (a = i.images) == null ? void 0 : a.mobile : (u = i.images) == null ? void 0 : u.main) || "";
876
877
  n.set(i.id, c);
877
878
  }), n;
878
- }, Et = (e) => {
879
- var U, R, O, W, M, K, Q, j, q, w, te, oe, ae, re, ce, se, de, ge, ne, me, ue, fe, xe, ye, ve, Fe;
879
+ }, jt = (e) => {
880
+ var U, R, O, W, M, K, Q, E, q, w, te, oe, ae, re, ce, se, de, ge, ne, me, ue, fe, xe, ye, ve, Fe;
880
881
  const [n, o] = Ie.useState(
881
882
  ((U = e.leads) == null ? void 0 : U.position) === "before" && e.poll.authRequirement === "LEAD"
882
883
  );
@@ -886,13 +887,13 @@ const Vt = (e) => {
886
887
  ((le = e.leads) == null ? void 0 : le.position) === "before" && e.poll.authRequirement === "LEAD" || !1
887
888
  );
888
889
  }, [(R = e.leads) == null ? void 0 : R.position, e.poll.authRequirement]);
889
- const { optionsLayout: i } = Te(Ae), s = ee(), c = Z(), a = ke(e.options), { t: u } = G(), g = N(), y = We(), d = Ee(e.poll.embedCode), m = !n && !!e.poll.embedCode, f = ((O = e.leads) == null ? void 0 : O.position) === "after" ? u("poll.buttons.continue") : u("poll.buttons.vote"), { brandingImage: k, brandingColors: I, brandingLogo: r } = Ve(e.poll.branding || null), A = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : N() ? he : be, S = k || ie(
890
+ const { optionsLayout: i } = Te(Ae), s = ee(), c = Z(), a = ke(e.options), { t: u } = G(), g = N(), y = We(), d = je(e.poll.embedCode), m = !n && !!e.poll.embedCode, f = ((O = e.leads) == null ? void 0 : O.position) === "after" ? u("poll.buttons.continue") : u("poll.buttons.vote"), { brandingImage: k, brandingColors: I, brandingLogo: r } = Ve(e.poll.branding || null), A = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : N() ? he : be, S = k || ie(
890
891
  {
891
892
  images: e.poll.images,
892
893
  imagePlaceholder: A
893
894
  },
894
895
  V.OVERLAY
895
- ), b = c.customRadius.dark.sm, P = (I == null ? void 0 : I.backgroundColor) || ((M = (W = c.colorSchemes) == null ? void 0 : W.dark) == null ? void 0 : M.surfaceVariant), D = (Q = (K = c.customRadius) == null ? void 0 : K.light) == null ? void 0 : Q.xl, T = (I == null ? void 0 : I.primaryColor) || ((te = (w = (q = (j = c.colorSchemes) == null ? void 0 : j.light) == null ? void 0 : q.palette) == null ? void 0 : w.primary) == null ? void 0 : te.plainColor), C = (ce = (re = (ae = (oe = c.colorSchemes) == null ? void 0 : oe.light) == null ? void 0 : ae.palette) == null ? void 0 : re.primary) == null ? void 0 : ce.onPrimary, z = c.customFontFamily.dark.primary, L = c.colorSchemes.dark.textColor, v = jt({
896
+ ), b = c.customRadius.dark.sm, P = (I == null ? void 0 : I.backgroundColor) || ((M = (W = c.colorSchemes) == null ? void 0 : W.dark) == null ? void 0 : M.surfaceVariant), D = (Q = (K = c.customRadius) == null ? void 0 : K.light) == null ? void 0 : Q.xl, T = (I == null ? void 0 : I.primaryColor) || ((te = (w = (q = (E = c.colorSchemes) == null ? void 0 : E.light) == null ? void 0 : q.palette) == null ? void 0 : w.primary) == null ? void 0 : te.plainColor), C = (ce = (re = (ae = (oe = c.colorSchemes) == null ? void 0 : oe.light) == null ? void 0 : ae.palette) == null ? void 0 : re.primary) == null ? void 0 : ce.onPrimary, z = c.customFontFamily.dark.primary, L = c.colorSchemes.dark.textColor, v = Et({
896
897
  spacingScale: s,
897
898
  smBorderRadius: b,
898
899
  contentBgColor: P,
@@ -904,7 +905,7 @@ const Vt = (e) => {
904
905
  isMobile: g
905
906
  }), H = () => {
906
907
  o(!1);
907
- }, E = () => {
908
+ }, j = () => {
908
909
  var le, He, De, Le, Re;
909
910
  return /* @__PURE__ */ t(
910
911
  $,
@@ -970,7 +971,7 @@ const Vt = (e) => {
970
971
  )
971
972
  ] }) }),
972
973
  /* @__PURE__ */ x(l, { sx: v.bottomFooterContainer, children: [
973
- E(),
974
+ j(),
974
975
  !n && /* @__PURE__ */ t(
975
976
  p,
976
977
  {
@@ -1055,7 +1056,7 @@ const Vt = (e) => {
1055
1056
  brandingBorderColor: n,
1056
1057
  state: o
1057
1058
  }) => {
1058
- const i = N(), s = We(), c = o === "play" ? s : i, a = Y().md, u = n || F().secondaryContainer, y = je().size + " solid " + u;
1059
+ const i = N(), s = We(), c = o === "play" ? s : i, a = Y().md, u = n || F().secondaryContainer, y = Ee().size + " solid " + u;
1059
1060
  return /* @__PURE__ */ t(
1060
1061
  l,
1061
1062
  {
@@ -1163,7 +1164,7 @@ const Vt = (e) => {
1163
1164
  alignItems: "center"
1164
1165
  }
1165
1166
  }), qt = (e) => {
1166
- var v, H, E, U, R, O, W, M, K, Q, j, q, w, te, oe, ae, re, ce, se, de, ge;
1167
+ var v, H, j, U, R, O, W, M, K, Q, E, q, w, te, oe, ae, re, ce, se, de, ge;
1167
1168
  const [n, o] = Ie.useState(
1168
1169
  ((v = e.leads) == null ? void 0 : v.position) === "before" && e.poll.authRequirement === "LEAD"
1169
1170
  );
@@ -1173,7 +1174,7 @@ const Vt = (e) => {
1173
1174
  ((ne = e.leads) == null ? void 0 : ne.position) === "before" && e.poll.authRequirement === "LEAD" || !1
1174
1175
  );
1175
1176
  }, [(H = e.leads) == null ? void 0 : H.position, e.poll.authRequirement]);
1176
- const { optionsLayout: i } = Te(Ae), s = Ee(e.poll.embedCode), c = !n && !!e.poll.embedCode, a = ke(e.options), { t: u } = G(), g = N(), y = rt(), d = ((E = e.poll.branding) == null ? void 0 : E.colors) || null, m = g ? ((R = (U = e.poll.branding) == null ? void 0 : U.images) == null ? void 0 : R.mobileLogo) || ((W = (O = e.poll.branding) == null ? void 0 : O.images) == null ? void 0 : W.mainLogo) || "" : ((K = (M = e.poll.branding) == null ? void 0 : M.images) == null ? void 0 : K.mainLogo) || "", f = e.imagePosition || "left", k = ie(
1177
+ const { optionsLayout: i } = Te(Ae), s = je(e.poll.embedCode), c = !n && !!e.poll.embedCode, a = ke(e.options), { t: u } = G(), g = N(), y = rt(), d = ((j = e.poll.branding) == null ? void 0 : j.colors) || null, m = g ? ((R = (U = e.poll.branding) == null ? void 0 : U.images) == null ? void 0 : R.mobileLogo) || ((W = (O = e.poll.branding) == null ? void 0 : O.images) == null ? void 0 : W.mainLogo) || "" : ((K = (M = e.poll.branding) == null ? void 0 : M.images) == null ? void 0 : K.mainLogo) || "", f = e.imagePosition || "left", k = ie(
1177
1178
  {
1178
1179
  images: e.poll.images,
1179
1180
  imagePlaceholder: e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : ""
@@ -1219,7 +1220,7 @@ const Vt = (e) => {
1219
1220
  startGame: z,
1220
1221
  contentId: e.poll.id,
1221
1222
  contentName: e.poll.title,
1222
- brandingColors: (j = e.poll.branding) == null ? void 0 : j.colors,
1223
+ brandingColors: (E = e.poll.branding) == null ? void 0 : E.colors,
1223
1224
  brandingUrls: (q = e.poll.branding) == null ? void 0 : q.urls,
1224
1225
  campaignId: (w = e.leads) == null ? void 0 : w.campaignId,
1225
1226
  campaignName: (te = e.leads) == null ? void 0 : te.campaignName,
@@ -1603,7 +1604,7 @@ const Vt = (e) => {
1603
1604
  }
1604
1605
  };
1605
1606
  }, Nt = (e) => {
1606
- var M, K, Q, j, q, w, te, oe, ae, re, ce, se, de, ge, ne, me, ue, fe, xe, ye, ve, Fe;
1607
+ var M, K, Q, E, q, w, te, oe, ae, re, ce, se, de, ge, ne, me, ue, fe, xe, ye, ve, Fe;
1607
1608
  const [n, o] = Ie.useState(
1608
1609
  ((M = e.leads) == null ? void 0 : M.position) === "before" && e.poll.authRequirement === "LEAD"
1609
1610
  );
@@ -1619,7 +1620,7 @@ const Vt = (e) => {
1619
1620
  imagePlaceholder: u
1620
1621
  },
1621
1622
  V.SPLIT
1622
- ), y = ke(e.options), { t: d } = G(), m = ((Q = e.poll.branding) == null ? void 0 : Q.colors) || null, f = c ? ((j = e.poll.branding) == null ? void 0 : j.images.mobileLogo) || ((q = e.poll.branding) == null ? void 0 : q.images.mainLogo) || "" : ((w = e.poll.branding) == null ? void 0 : w.images.mainLogo) || "", k = Ee(e.poll.embedCode), I = !n && !!e.poll.embedCode, r = ((te = e.leads) == null ? void 0 : te.position) === "after" ? d("poll.buttons.continue") : d("poll.buttons.vote"), A = (m == null ? void 0 : m.contentColor) || F().textColor, S = _().secondary, b = "60%", P = _().primary, D = Y().xl, T = (m == null ? void 0 : m.backgroundColor) || F().surfaceVariant, C = (m == null ? void 0 : m.primaryColor) || ((ae = (oe = F().palette) == null ? void 0 : oe.primary) == null ? void 0 : ae.plainColor), z = (ce = (re = F().palette) == null ? void 0 : re.primary) == null ? void 0 : ce.onPrimary, L = F().textColor, v = ee(), H = Y(), E = ze(
1623
+ ), y = ke(e.options), { t: d } = G(), m = ((Q = e.poll.branding) == null ? void 0 : Q.colors) || null, f = c ? ((E = e.poll.branding) == null ? void 0 : E.images.mobileLogo) || ((q = e.poll.branding) == null ? void 0 : q.images.mainLogo) || "" : ((w = e.poll.branding) == null ? void 0 : w.images.mainLogo) || "", k = je(e.poll.embedCode), I = !n && !!e.poll.embedCode, r = ((te = e.leads) == null ? void 0 : te.position) === "after" ? d("poll.buttons.continue") : d("poll.buttons.vote"), A = (m == null ? void 0 : m.contentColor) || F().textColor, S = _().secondary, b = "60%", P = _().primary, D = Y().xl, T = (m == null ? void 0 : m.backgroundColor) || F().surfaceVariant, C = (m == null ? void 0 : m.primaryColor) || ((ae = (oe = F().palette) == null ? void 0 : oe.primary) == null ? void 0 : ae.plainColor), z = (ce = (re = F().palette) == null ? void 0 : re.primary) == null ? void 0 : ce.onPrimary, L = F().textColor, v = ee(), H = Y(), j = ze(
1623
1624
  V.SPLIT
1624
1625
  ), U = Ce(T || ""), R = $t({
1625
1626
  finalImage: g,
@@ -1636,7 +1637,7 @@ const Vt = (e) => {
1636
1637
  textColor: L,
1637
1638
  brandingColors: m,
1638
1639
  darkTextColor: s.colorSchemes.dark.textColor,
1639
- imageBackgroundGradient: E,
1640
+ imageBackgroundGradient: j,
1640
1641
  isLarge: a
1641
1642
  }), O = () => {
1642
1643
  o(!1);
@@ -1806,7 +1807,7 @@ const Vt = (e) => {
1806
1807
  }
1807
1808
  );
1808
1809
  }, Gt = (e) => {
1809
- const n = Y(), o = N(), i = je().size, s = F(), c = _(), a = s.palette.primary.plainColor, u = s.textPrimary, g = s.textSecondary, y = s.secondaryContainer, d = s.surface, m = s.onSurface, f = `rgba(${Ce(s.surfaceVariant)}, 0.5)`;
1810
+ const n = Y(), o = N(), i = Ee().size, s = F(), c = _(), a = s.palette.primary.plainColor, u = s.textPrimary, g = s.textSecondary, y = s.secondaryContainer, d = s.surface, m = s.onSurface, f = `rgba(${Ce(s.surfaceVariant)}, 0.5)`;
1810
1811
  return {
1811
1812
  // Question area
1812
1813
  questionArea: {
@@ -1959,11 +1960,11 @@ const Vt = (e) => {
1959
1960
  }, pt = (e, n) => {
1960
1961
  switch (e) {
1961
1962
  case "success":
1962
- return /* @__PURE__ */ t(Ft, {});
1963
+ return /* @__PURE__ */ t(At, {});
1963
1964
  case "error":
1964
- return /* @__PURE__ */ t(vt, { sx: { color: n } });
1965
+ return /* @__PURE__ */ t(Ft, { sx: { color: n } });
1965
1966
  case "info":
1966
- return /* @__PURE__ */ t(kt, {});
1967
+ return /* @__PURE__ */ t(vt, {});
1967
1968
  }
1968
1969
  }, _t = (e) => {
1969
1970
  switch (e) {
@@ -1982,7 +1983,7 @@ const Vt = (e) => {
1982
1983
  }) => {
1983
1984
  const s = Z(), c = Y(), a = _().secondary, u = _t(e);
1984
1985
  return /* @__PURE__ */ t(
1985
- At,
1986
+ Pt,
1986
1987
  {
1987
1988
  variant: "soft",
1988
1989
  color: u,
@@ -1997,7 +1998,7 @@ const Vt = (e) => {
1997
1998
  "--Icon-fontSize": "1.25em"
1998
1999
  },
1999
2000
  children: /* @__PURE__ */ x(
2000
- Pt,
2001
+ kt,
2001
2002
  {
2002
2003
  sx: {
2003
2004
  fontSize: "1.5em"
@@ -2281,7 +2282,7 @@ const Vt = (e) => {
2281
2282
  e.option.id
2282
2283
  );
2283
2284
  }, Ke = (e) => {
2284
- const { t: n } = G(), o = ee(), i = F(), s = _(), c = je().size, u = e.options.reduce(
2285
+ const { t: n } = G(), o = ee(), i = F(), s = _(), c = Ee().size, u = e.options.reduce(
2285
2286
  (g, y) => g + (y.votes || 0),
2286
2287
  0
2287
2288
  );
@@ -2772,14 +2773,14 @@ const Vt = (e) => {
2772
2773
  p: e.spacingScale.lg
2773
2774
  }
2774
2775
  }), Qt = (e) => {
2775
- var L, v, H, E;
2776
+ var L, v, H, j;
2776
2777
  const n = Z(), o = N(), i = st(), s = We(), c = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : o ? he : be, a = ie(
2777
2778
  {
2778
2779
  images: e.poll.images,
2779
2780
  imagePlaceholder: c
2780
2781
  },
2781
2782
  V.SPLIT
2782
- ), u = ke(e.poll.options), { t: g } = G(), { optionsLayout: y } = Te(Ae), d = ((L = e.poll.branding) == null ? void 0 : L.colors) || null, m = F().textPrimary, f = (d == null ? void 0 : d.secondaryColor) || F().textSecondary, k = F().secondaryContainer, I = _().primary, r = (d == null ? void 0 : d.backgroundColor) || F().surfaceVariant, A = F().surface, S = F().onSurface, b = Y(), P = F().textColor, D = ee(), T = o ? ((v = e.poll.branding) == null ? void 0 : v.images.mobileLogo) || ((H = e.poll.branding) == null ? void 0 : H.images.mainLogo) || "" : ((E = e.poll.branding) == null ? void 0 : E.images.mainLogo) || "", C = Kt({
2783
+ ), u = ke(e.poll.options), { t: g } = G(), { optionsLayout: y } = Te(Ae), d = ((L = e.poll.branding) == null ? void 0 : L.colors) || null, m = F().textPrimary, f = (d == null ? void 0 : d.secondaryColor) || F().textSecondary, k = F().secondaryContainer, I = _().primary, r = (d == null ? void 0 : d.backgroundColor) || F().surfaceVariant, A = F().surface, S = F().onSurface, b = Y(), P = F().textColor, D = ee(), T = o ? ((v = e.poll.branding) == null ? void 0 : v.images.mobileLogo) || ((H = e.poll.branding) == null ? void 0 : H.images.mainLogo) || "" : ((j = e.poll.branding) == null ? void 0 : j.images.mainLogo) || "", C = Kt({
2783
2784
  spacingScale: D,
2784
2785
  borderRadius: b,
2785
2786
  fontFamilyPrimary: I,
@@ -3567,8 +3568,8 @@ const Vt = (e) => {
3567
3568
  primaryColor: d,
3568
3569
  onPrimaryColor: m
3569
3570
  }), D = () => {
3570
- var H, E, U, R;
3571
- return e.signInCTA ? (H = e.signInCTA) != null && H.component ? e.signInCTA.component : (E = e.signInCTA) != null && E.onClick ? /* @__PURE__ */ t(
3571
+ var H, j, U, R;
3572
+ return e.signInCTA ? (H = e.signInCTA) != null && H.component ? e.signInCTA.component : (j = e.signInCTA) != null && j.onClick ? /* @__PURE__ */ t(
3572
3573
  p,
3573
3574
  {
3574
3575
  variant: "soft",
@@ -3834,7 +3835,7 @@ const Vt = (e) => {
3834
3835
  alignItems: "center"
3835
3836
  }
3836
3837
  }), dn = (e) => {
3837
- var S, b, P, D, T, C, z, L, v, H, E;
3838
+ var S, b, P, D, T, C, z, L, v, H, j;
3838
3839
  const n = Z(), { t: o } = G(), i = N(), s = ze(
3839
3840
  V.OVERLAY
3840
3841
  ), { brandingImage: c, brandingColors: a, brandingLogo: u } = Ve(e.poll.branding || null), g = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : i ? he : be, y = c || ie(
@@ -3927,7 +3928,7 @@ const Vt = (e) => {
3927
3928
  {
3928
3929
  brandingLogo: u,
3929
3930
  textColor: n.colorSchemes.dark.textColor,
3930
- label: ((E = e.poll.labels) == null ? void 0 : E.sponsor) || null
3931
+ label: ((j = e.poll.labels) == null ? void 0 : j.sponsor) || null
3931
3932
  }
3932
3933
  )
3933
3934
  }
@@ -4042,7 +4043,7 @@ const fn = (e) => {
4042
4043
  rulesDisplay: e.rulesDisplay
4043
4044
  }
4044
4045
  );
4045
- const E = () => {
4046
+ const j = () => {
4046
4047
  C(!1), z(""), L(!1), g(!u);
4047
4048
  };
4048
4049
  if (P || D)
@@ -4054,7 +4055,7 @@ const fn = (e) => {
4054
4055
  defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4055
4056
  isApiError: D,
4056
4057
  apiErrorMessage: T,
4057
- toggleTryAgain: E,
4058
+ toggleTryAgain: j,
4058
4059
  rulesDisplay: e.rulesDisplay
4059
4060
  }
4060
4061
  ) : e.template === V.OVERLAY ? /* @__PURE__ */ t(
@@ -4064,7 +4065,7 @@ const fn = (e) => {
4064
4065
  defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4065
4066
  isApiError: D,
4066
4067
  apiErrorMessage: T,
4067
- toggleTryAgain: E,
4068
+ toggleTryAgain: j,
4068
4069
  rulesDisplay: e.rulesDisplay
4069
4070
  }
4070
4071
  ) : /* @__PURE__ */ t(
@@ -4074,20 +4075,20 @@ const fn = (e) => {
4074
4075
  defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
4075
4076
  isApiError: D,
4076
4077
  apiErrorMessage: T,
4077
- toggleTryAgain: E,
4078
+ toggleTryAgain: j,
4078
4079
  rulesDisplay: e.rulesDisplay
4079
4080
  }
4080
4081
  );
4081
- const U = r.multipleChoice && r.maxMultipleChoiceOptions || 1, R = (j) => {
4082
+ const U = r.multipleChoice && r.maxMultipleChoiceOptions || 1, R = (E) => {
4082
4083
  if (U === 1)
4083
- o(j);
4084
+ o(E);
4084
4085
  else {
4085
- const q = j[0];
4086
+ const q = E[0];
4086
4087
  o((w) => w.includes(q) ? w.filter((te) => te !== q) : w.length < U ? [...w, q] : w);
4087
4088
  }
4088
4089
  }, O = async () => {
4089
- var j;
4090
- if (((j = e.leads) == null ? void 0 : j.position) === "after" && r.authRequirement === "LEAD" && !m) {
4090
+ var E;
4091
+ if (((E = e.leads) == null ? void 0 : E.position) === "after" && r.authRequirement === "LEAD" && !m) {
4091
4092
  I(!0);
4092
4093
  return;
4093
4094
  }
@@ -4095,20 +4096,20 @@ const fn = (e) => {
4095
4096
  }, W = async () => {
4096
4097
  a(!0);
4097
4098
  try {
4098
- const j = await e.sdk.voting.voteForPoll(
4099
+ const E = await e.sdk.voting.voteForPoll(
4099
4100
  e.entityId,
4100
4101
  n
4101
4102
  ), q = { ...r };
4102
4103
  q.options = r.options.map((w) => n.includes(w.id) ? {
4103
4104
  ...w,
4104
4105
  votes: w.votes + 1
4105
- } : w), q.totalVotes = (r.totalVotes || 0) + n.length, A(q), b(j), s(!0);
4106
- } catch (j) {
4106
+ } : w), q.totalVotes = (r.totalVotes || 0) + n.length, A(q), b(E), s(!0);
4107
+ } catch (E) {
4107
4108
  if (e.sdk.helpers.getSDKConfiguration().errorHandlingMode === "standard") {
4108
- const w = j;
4109
+ const w = E;
4109
4110
  w.error.code === 401 || w.error.code === 403 ? L(!0) : (C(!0), z(w.error.message));
4110
4111
  } else {
4111
- const w = j;
4112
+ const w = E;
4112
4113
  w.data.error.code === 401 || w.data.error.code === 403 ? L(!0) : (C(!0), z(w.data.error.message));
4113
4114
  }
4114
4115
  } finally {
@@ -4119,7 +4120,7 @@ const fn = (e) => {
4119
4120
  }, K = () => {
4120
4121
  s(!1), o([]), d(!1), f(!1), I(!1);
4121
4122
  }, Q = () => e.template === V.OVERLAY ? /* @__PURE__ */ t(
4122
- Et,
4123
+ jt,
4123
4124
  {
4124
4125
  sdk: e.sdk,
4125
4126
  leads: e.leads,
@@ -4199,7 +4200,7 @@ const fn = (e) => {
4199
4200
  }
4200
4201
  );
4201
4202
  if (i || v) {
4202
- const j = H ? /* @__PURE__ */ t(Ze, { entityId: H, sdk: e.sdk, children: (w) => /* @__PURE__ */ t(et, { infoPage: w, variant: e.chanceGameVariant }) }) : void 0, q = H ? /* @__PURE__ */ t(Ze, { entityId: H, sdk: e.sdk, children: (w) => /* @__PURE__ */ t(et, { infoPage: w, variant: e.chanceGameVariant, forceMobile: !0 }) }) : void 0;
4203
+ const E = H ? /* @__PURE__ */ t(Ze, { entityId: H, sdk: e.sdk, children: (w) => /* @__PURE__ */ t(et, { infoPage: w, variant: e.chanceGameVariant }) }) : void 0, q = H ? /* @__PURE__ */ t(Ze, { entityId: H, sdk: e.sdk, children: (w) => /* @__PURE__ */ t(et, { infoPage: w, variant: e.chanceGameVariant, forceMobile: !0 }) }) : void 0;
4203
4204
  return e.template === V.OVERLAY ? /* @__PURE__ */ t(
4204
4205
  Xt,
4205
4206
  {
@@ -4213,7 +4214,7 @@ const fn = (e) => {
4213
4214
  isUnauthorized: P,
4214
4215
  additionalCTA: e.additionalCTA,
4215
4216
  rulesDisplay: e.rulesDisplay,
4216
- chanceGameContent: j
4217
+ chanceGameContent: E
4217
4218
  }
4218
4219
  ) : Se(e) ? /* @__PURE__ */ t(
4219
4220
  Yt,
@@ -4249,7 +4250,7 @@ const fn = (e) => {
4249
4250
  );
4250
4251
  }
4251
4252
  return Q();
4252
- }, xn = (e) => /* @__PURE__ */ t(gt, { packageName: "poll-vote", ...e, children: /* @__PURE__ */ t(fn, { ...e }) }), Ln = xn;
4253
+ }, xn = (e) => /* @__PURE__ */ t(gt, { packageName: "poll-vote", ...e, children: /* @__PURE__ */ t(fn, { ...e }) }), Rn = xn;
4253
4254
  export {
4254
- Ln as PollVote
4255
+ Rn as PollVote
4255
4256
  };
package/README.md CHANGED
@@ -130,6 +130,7 @@ const themeOptions: CustomThemeOptions = {
130
130
  },
131
131
  textPrimary: "#212121",
132
132
  textSecondary: "#212121",
133
+ textBody: "#424242",
133
134
  textColor: "#212121",
134
135
  textDisabled: "#212121",
135
136
  surface: "#FFFFFF",
@@ -165,6 +166,7 @@ const themeOptions: CustomThemeOptions = {
165
166
  },
166
167
  textPrimary: "#FAFAFA",
167
168
  textSecondary: "#FAFAFA",
169
+ textBody: "#FAFAFA",
168
170
  textColor: "#FAFAFA",
169
171
  textDisabled: "#FAFAFA",
170
172
  surface: "#424242",
@@ -2207,6 +2209,234 @@ import { WidgetTemplate } from "fansunited-frontend-core";
2207
2209
  />
2208
2210
  ```
2209
2211
 
2212
+ ### Discussion
2213
+
2214
+ Interactive discussion/commenting component that enables threaded conversations on any piece of content. Features real-time post creation, nested replies, reactions, reporting, moderation awareness, and multi-language support.
2215
+
2216
+ **Key Features:**
2217
+
2218
+ - Threaded 2-level comments (posts and replies)
2219
+ - Four sort modes: Latest, Oldest, Popular, Most Replied
2220
+ - Cursor-based pagination with configurable posts-per-page
2221
+ - Post reporting with reason and optional details
2222
+ - Delete own posts with confirmation dialog
2223
+ - Authentication-aware UI (sign-in prompt for unauthenticated users)
2224
+ - Moderated and deleted post handling
2225
+ - Custom theming and multi-language support
2226
+
2227
+ #### Required Props
2228
+
2229
+ | Prop | Type | Description |
2230
+ | ------------------ | -------------------- | -------------------------------------------------------------- |
2231
+ | `entityId` | `string` | Unique identifier for this discussion (e.g. article ID) |
2232
+ | `sdk` | `FansUnitedSDKModel` | SDK instance |
2233
+ | `language` | `LanguageType` | Display language |
2234
+
2235
+ #### Optional Props
2236
+
2237
+ | Prop | Type | Default | Description |
2238
+ | ----------------- | ---------------------- | ------------ | ------------------------------------------------------- |
2239
+ | `themeOptions` | `CustomThemeOptions` | — | Theme configuration |
2240
+ | `discussionLabel` | `string` | — | Title/label used when the discussion is created for the first time |
2241
+ | `discussionUrl` | `string` | — | URL associated with the discussion content |
2242
+ | `defaultSort` | `DiscussionSortType` | `"LATEST"` | Initial sort order for posts |
2243
+ | `postsPerPage` | `number` | `20` | Number of posts loaded per page |
2244
+ | `showReactions` | `boolean` | `true` | Show/hide reaction buttons on posts |
2245
+ | `showReplies` | `boolean` | `true` | Enable/disable reply functionality |
2246
+ | `showReportPost` | `boolean` | `true` | Show/hide the report option in the post menu |
2247
+ | `showModeratedPosts` | `boolean` | `false` | When `true`, moderated posts are fetched and displayed with a masked design — the original content is replaced by the moderation reason |
2248
+ | `infiniteScroll` | `boolean` | `false` | Load more posts automatically on scroll instead of showing a "Load More" button |
2249
+ | `userIsLoggedIn` | `boolean` | `false` | Whether the current user is authenticated |
2250
+ | `onSignInClick` | `() => void` | — | Callback triggered when the sign-in prompt is clicked |
2251
+
2252
+ #### Sort Modes
2253
+
2254
+ ```tsx
2255
+ import { DiscussionSortType } from "fansunited-frontend-core";
2256
+
2257
+ // Sort options
2258
+ type DiscussionSortType = "LATEST" | "OLDEST" | "POPULAR" | "INTERACTED";
2259
+ // ^newest ^oldest ^most ^most
2260
+ // first first reactions replies
2261
+ ```
2262
+
2263
+ #### Authentication & Sign-in
2264
+
2265
+ Control user access and the sign-in prompt using the `userIsLoggedIn` and `onSignInClick` props.
2266
+
2267
+ ```tsx
2268
+ <Discussion
2269
+ {...otherProps}
2270
+ userIsLoggedIn={false}
2271
+ onSignInClick={() => {
2272
+ // Handle sign-in navigation or modal
2273
+ console.log("Sign in clicked");
2274
+ }}
2275
+ />
2276
+ ```
2277
+
2278
+ **Behavior:**
2279
+
2280
+ - When `userIsLoggedIn` is `false`, the post composer is replaced with a sign-in prompt
2281
+ - Reactions, replies, and delete/report actions are also gated behind authentication
2282
+ - Passing `onSignInClick` makes the sign-in button active; omitting it renders a disabled button
2283
+
2284
+ #### Reactions
2285
+
2286
+ Eight reaction types are available when `showReactions={true}` (the default):
2287
+
2288
+ ```tsx
2289
+ // Reaction types available on every post
2290
+ type ReactionType = "LIKE" | "DISLIKE" | "LOVE" | "LAUGH" | "CARE" | "WOW" | "SAD" | "ANGRY";
2291
+ ```
2292
+
2293
+ Users can toggle their reaction by clicking an emoji. Re-clicking the same reaction removes it. Only authenticated users can react.
2294
+
2295
+ #### Theming
2296
+
2297
+ Customize the appearance using the same `CustomThemeOptions` interface shared across all components:
2298
+
2299
+ ```tsx
2300
+ import { CustomThemeOptions } from "fansunited-frontend-core";
2301
+
2302
+ const themeOptions: CustomThemeOptions = {
2303
+ mode: "dark",
2304
+ colorSchemes: {
2305
+ dark: {
2306
+ surface: "#1a1a1a",
2307
+ surfaceVariant: "#2a2a2a",
2308
+ outlineEnabledBorder: "#3a3a3a",
2309
+ textPrimary: "#FAFAFA",
2310
+ textSecondary: "#9E9E9E",
2311
+ textBody: "#E0E0E0",
2312
+ palette: {
2313
+ primary: {
2314
+ plainColor: "#1A77D2",
2315
+ onPrimary: "#FAFAFA",
2316
+ },
2317
+ },
2318
+ },
2319
+ },
2320
+ };
2321
+
2322
+ <Discussion {...otherProps} themeOptions={themeOptions} />;
2323
+ ```
2324
+
2325
+ #### TypeScript Support
2326
+
2327
+ Import types from `fansunited-frontend-core`:
2328
+
2329
+ ```tsx
2330
+ import {
2331
+ DiscussionProps,
2332
+ DiscussionSortType,
2333
+ CustomThemeOptions,
2334
+ LanguageType,
2335
+ } from "fansunited-frontend-core";
2336
+ ```
2337
+
2338
+ #### Examples
2339
+
2340
+ ##### Basic Discussion
2341
+
2342
+ ```tsx
2343
+ import { Discussion } from "fansunited-frontend-components";
2344
+
2345
+ <Discussion
2346
+ entityId="article-123"
2347
+ sdk={sdkInstance}
2348
+ language="en"
2349
+ discussionLabel="Liverpool vs Man City — Match Reaction"
2350
+ />;
2351
+ ```
2352
+
2353
+ ##### Authenticated User with All Features
2354
+
2355
+ ```tsx
2356
+ <Discussion
2357
+ entityId="article-123"
2358
+ sdk={sdkInstance}
2359
+ language="en"
2360
+ discussionLabel="Liverpool vs Man City — Match Reaction"
2361
+ discussionUrl="https://your-site.com/articles/liverpool-vs-man-city"
2362
+ userIsLoggedIn={true}
2363
+ defaultSort="POPULAR"
2364
+ postsPerPage={10}
2365
+ showReactions={true}
2366
+ showReplies={true}
2367
+ showReportPost={true}
2368
+ themeOptions={{
2369
+ mode: "light",
2370
+ }}
2371
+ />
2372
+ ```
2373
+
2374
+ ##### Show Moderated Posts
2375
+
2376
+ Fetch and display moderated comments with a masked design. The original content is replaced by the moderation reason (or a localised fallback). All other post elements — avatar, username, timestamp, reactions, and reply button — remain visible.
2377
+
2378
+ ```tsx
2379
+ <Discussion
2380
+ entityId="article-123"
2381
+ sdk={sdkInstance}
2382
+ language="en"
2383
+ discussionLabel="Post Comments"
2384
+ userIsLoggedIn={true}
2385
+ showModeratedPosts={true}
2386
+ />
2387
+ ```
2388
+
2389
+ ##### Minimal Read-Only Style
2390
+
2391
+ Disable reactions, replies, and reporting for a simplified read-only-like experience:
2392
+
2393
+ ```tsx
2394
+ <Discussion
2395
+ entityId="article-123"
2396
+ sdk={sdkInstance}
2397
+ language="en"
2398
+ discussionLabel="Post Comments"
2399
+ userIsLoggedIn={false}
2400
+ showReactions={false}
2401
+ showReplies={false}
2402
+ showReportPost={false}
2403
+ onSignInClick={() => openSignInModal()}
2404
+ />
2405
+ ```
2406
+
2407
+ ##### Dark Theme with Sign-in Integration
2408
+
2409
+ ```tsx
2410
+ <Discussion
2411
+ entityId="match-456"
2412
+ sdk={sdkInstance}
2413
+ language="en"
2414
+ discussionLabel="Match Day Chat"
2415
+ userIsLoggedIn={isUserLoggedIn}
2416
+ onSignInClick={() => router.push("/login")}
2417
+ defaultSort="LATEST"
2418
+ postsPerPage={20}
2419
+ themeOptions={{
2420
+ mode: "dark",
2421
+ colorSchemes: {
2422
+ dark: {
2423
+ surface: "#212121",
2424
+ textPrimary: "#FAFAFA",
2425
+ palette: {
2426
+ primary: {
2427
+ plainColor: "#2397F3",
2428
+ primaryContainer: "#1A77D2",
2429
+ onPrimary: "#FFFFFF",
2430
+ },
2431
+ },
2432
+ },
2433
+ },
2434
+ }}
2435
+ />
2436
+ ```
2437
+
2438
+ ---
2439
+
2210
2440
  ### ChanceGame
2211
2441
 
2212
2442
  Interactive chance-based game component featuring three distinct game variants — Prize Wheel, Penalty Shootout, and Pick One of X. Driven entirely by InfoPage configuration, it supports flexible selection modes, configurable animation speed, per-segment result screens with CTAs, and optional visual decorations.
@@ -2513,6 +2743,7 @@ This package exports the following components:
2513
2743
  - **`MatchQuizPlay`** - Football match prediction quiz with multiple markets
2514
2744
  - **`EventGamePlay`** - Event prediction game with flexible outcome types
2515
2745
  - **`ChanceGame`** - Chance-based game with Prize Wheel, Penalty Shootout, and Pick One of X variants
2746
+ - **`Discussion`** - Threaded comments with reactions, replies, reporting, and authentication support
2516
2747
 
2517
2748
  ## Related Packages
2518
2749