@sensiblestats/widget-react 0.52.0 → 0.53.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.53.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Games data batch 2 (client surfaces):
8
+
9
+ - Beat the Grid: the cell search now uses the club player pool carried in ConfigJson (`playerPool`), threaded through `GameScreenHost` instead of an empty list — the search box was previously always empty.
10
+ - Mystery Tiger: each guess tile now shows the guessed player's own attribute value (e.g. "ST", a nationality flag, "22 ▲") instead of a bare glyph, falling back to the verdict glyph when no value is present.
11
+
3
12
  ## 0.52.0
4
13
 
5
14
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -4229,6 +4229,89 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, refresh }) {
4229
4229
 
4230
4230
  // src/components/games/MysteryTigerGame.tsx
4231
4231
  var import_react29 = require("react");
4232
+
4233
+ // src/components/games/nationFlags.ts
4234
+ var FLAGS = {
4235
+ england: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",
4236
+ scotland: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",
4237
+ wales: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}",
4238
+ "northern ireland": "\u{1F1EC}\u{1F1E7}",
4239
+ "republic of ireland": "\u{1F1EE}\u{1F1EA}",
4240
+ ireland: "\u{1F1EE}\u{1F1EA}",
4241
+ "united kingdom": "\u{1F1EC}\u{1F1E7}",
4242
+ france: "\u{1F1EB}\u{1F1F7}",
4243
+ spain: "\u{1F1EA}\u{1F1F8}",
4244
+ portugal: "\u{1F1F5}\u{1F1F9}",
4245
+ germany: "\u{1F1E9}\u{1F1EA}",
4246
+ italy: "\u{1F1EE}\u{1F1F9}",
4247
+ netherlands: "\u{1F1F3}\u{1F1F1}",
4248
+ belgium: "\u{1F1E7}\u{1F1EA}",
4249
+ switzerland: "\u{1F1E8}\u{1F1ED}",
4250
+ austria: "\u{1F1E6}\u{1F1F9}",
4251
+ denmark: "\u{1F1E9}\u{1F1F0}",
4252
+ sweden: "\u{1F1F8}\u{1F1EA}",
4253
+ norway: "\u{1F1F3}\u{1F1F4}",
4254
+ finland: "\u{1F1EB}\u{1F1EE}",
4255
+ iceland: "\u{1F1EE}\u{1F1F8}",
4256
+ poland: "\u{1F1F5}\u{1F1F1}",
4257
+ czechia: "\u{1F1E8}\u{1F1FF}",
4258
+ "czech republic": "\u{1F1E8}\u{1F1FF}",
4259
+ croatia: "\u{1F1ED}\u{1F1F7}",
4260
+ serbia: "\u{1F1F7}\u{1F1F8}",
4261
+ "bosnia and herzegovina": "\u{1F1E7}\u{1F1E6}",
4262
+ greece: "\u{1F1EC}\u{1F1F7}",
4263
+ romania: "\u{1F1F7}\u{1F1F4}",
4264
+ ukraine: "\u{1F1FA}\u{1F1E6}",
4265
+ russia: "\u{1F1F7}\u{1F1FA}",
4266
+ hungary: "\u{1F1ED}\u{1F1FA}",
4267
+ slovakia: "\u{1F1F8}\u{1F1F0}",
4268
+ slovenia: "\u{1F1F8}\u{1F1EE}",
4269
+ turkey: "\u{1F1F9}\u{1F1F7}",
4270
+ t\u00FCrkiye: "\u{1F1F9}\u{1F1F7}",
4271
+ albania: "\u{1F1E6}\u{1F1F1}",
4272
+ "north macedonia": "\u{1F1F2}\u{1F1F0}",
4273
+ brazil: "\u{1F1E7}\u{1F1F7}",
4274
+ argentina: "\u{1F1E6}\u{1F1F7}",
4275
+ uruguay: "\u{1F1FA}\u{1F1FE}",
4276
+ colombia: "\u{1F1E8}\u{1F1F4}",
4277
+ chile: "\u{1F1E8}\u{1F1F1}",
4278
+ peru: "\u{1F1F5}\u{1F1EA}",
4279
+ ecuador: "\u{1F1EA}\u{1F1E8}",
4280
+ paraguay: "\u{1F1F5}\u{1F1FE}",
4281
+ mexico: "\u{1F1F2}\u{1F1FD}",
4282
+ "united states": "\u{1F1FA}\u{1F1F8}",
4283
+ usa: "\u{1F1FA}\u{1F1F8}",
4284
+ canada: "\u{1F1E8}\u{1F1E6}",
4285
+ jamaica: "\u{1F1EF}\u{1F1F2}",
4286
+ nigeria: "\u{1F1F3}\u{1F1EC}",
4287
+ ghana: "\u{1F1EC}\u{1F1ED}",
4288
+ senegal: "\u{1F1F8}\u{1F1F3}",
4289
+ ivorycoast: "\u{1F1E8}\u{1F1EE}",
4290
+ "cote d'ivoire": "\u{1F1E8}\u{1F1EE}",
4291
+ "ivory coast": "\u{1F1E8}\u{1F1EE}",
4292
+ cameroon: "\u{1F1E8}\u{1F1F2}",
4293
+ egypt: "\u{1F1EA}\u{1F1EC}",
4294
+ morocco: "\u{1F1F2}\u{1F1E6}",
4295
+ algeria: "\u{1F1E9}\u{1F1FF}",
4296
+ tunisia: "\u{1F1F9}\u{1F1F3}",
4297
+ mali: "\u{1F1F2}\u{1F1F1}",
4298
+ "south africa": "\u{1F1FF}\u{1F1E6}",
4299
+ "dr congo": "\u{1F1E8}\u{1F1E9}",
4300
+ japan: "\u{1F1EF}\u{1F1F5}",
4301
+ "south korea": "\u{1F1F0}\u{1F1F7}",
4302
+ korea: "\u{1F1F0}\u{1F1F7}",
4303
+ australia: "\u{1F1E6}\u{1F1FA}",
4304
+ "saudi arabia": "\u{1F1F8}\u{1F1E6}",
4305
+ iran: "\u{1F1EE}\u{1F1F7}",
4306
+ "new zealand": "\u{1F1F3}\u{1F1FF}"
4307
+ };
4308
+ function nationalityFlag(nationality) {
4309
+ if (!nationality) return "\u{1F3F3}\uFE0F";
4310
+ const key = nationality.trim().toLowerCase();
4311
+ return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
4312
+ }
4313
+
4314
+ // src/components/games/MysteryTigerGame.tsx
4232
4315
  var import_jsx_runtime55 = require("react/jsx-runtime");
4233
4316
  function parseClientState(json) {
4234
4317
  if (!json) return null;
@@ -4259,6 +4342,15 @@ function verdictGlyph(v) {
4259
4342
  if (v.direction === "down") return "\u2193";
4260
4343
  return "\u2248";
4261
4344
  }
4345
+ function directionArrow(v) {
4346
+ if (v.direction === "up") return "\u25B2";
4347
+ if (v.direction === "down") return "\u25BC";
4348
+ return "";
4349
+ }
4350
+ function tileFace(key, v) {
4351
+ if (!v.value) return verdictGlyph(v);
4352
+ return key === "nationality" ? nationalityFlag(v.value) : v.value;
4353
+ }
4262
4354
  function MysteryTigerGame({
4263
4355
  config,
4264
4356
  result,
@@ -4304,16 +4396,20 @@ function MysteryTigerGame({
4304
4396
  ] }),
4305
4397
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "ss-w-gtrow", children: ATTR_KEYS.map((key) => {
4306
4398
  const v = gr[key];
4399
+ const arrow = directionArrow(v);
4307
4400
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
4308
4401
  "div",
4309
4402
  {
4310
4403
  className: `ss-w-gtile ss-w-gtile--${v.verdict}`,
4311
4404
  "data-testid": `verdict-${key}-${i}`,
4312
4405
  "data-verdict": v.verdict,
4313
- "aria-label": `${ATTR_LABELS[key]}: ${v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
4406
+ "aria-label": `${ATTR_LABELS[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
4314
4407
  children: [
4315
4408
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "ss-w-gtile-lab", children: ATTR_LABELS[key] }),
4316
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: verdictGlyph(v) })
4409
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: [
4410
+ tileFace(key, v),
4411
+ arrow && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "ss-w-gtile-dir", children: arrow })
4412
+ ] })
4317
4413
  ]
4318
4414
  },
4319
4415
  key
@@ -4828,89 +4924,6 @@ function BeatTheGridGame({
4828
4924
 
4829
4925
  // src/components/games/GuessTheXiGame.tsx
4830
4926
  var import_react32 = require("react");
4831
-
4832
- // src/components/games/nationFlags.ts
4833
- var FLAGS = {
4834
- england: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",
4835
- scotland: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",
4836
- wales: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}",
4837
- "northern ireland": "\u{1F1EC}\u{1F1E7}",
4838
- "republic of ireland": "\u{1F1EE}\u{1F1EA}",
4839
- ireland: "\u{1F1EE}\u{1F1EA}",
4840
- "united kingdom": "\u{1F1EC}\u{1F1E7}",
4841
- france: "\u{1F1EB}\u{1F1F7}",
4842
- spain: "\u{1F1EA}\u{1F1F8}",
4843
- portugal: "\u{1F1F5}\u{1F1F9}",
4844
- germany: "\u{1F1E9}\u{1F1EA}",
4845
- italy: "\u{1F1EE}\u{1F1F9}",
4846
- netherlands: "\u{1F1F3}\u{1F1F1}",
4847
- belgium: "\u{1F1E7}\u{1F1EA}",
4848
- switzerland: "\u{1F1E8}\u{1F1ED}",
4849
- austria: "\u{1F1E6}\u{1F1F9}",
4850
- denmark: "\u{1F1E9}\u{1F1F0}",
4851
- sweden: "\u{1F1F8}\u{1F1EA}",
4852
- norway: "\u{1F1F3}\u{1F1F4}",
4853
- finland: "\u{1F1EB}\u{1F1EE}",
4854
- iceland: "\u{1F1EE}\u{1F1F8}",
4855
- poland: "\u{1F1F5}\u{1F1F1}",
4856
- czechia: "\u{1F1E8}\u{1F1FF}",
4857
- "czech republic": "\u{1F1E8}\u{1F1FF}",
4858
- croatia: "\u{1F1ED}\u{1F1F7}",
4859
- serbia: "\u{1F1F7}\u{1F1F8}",
4860
- "bosnia and herzegovina": "\u{1F1E7}\u{1F1E6}",
4861
- greece: "\u{1F1EC}\u{1F1F7}",
4862
- romania: "\u{1F1F7}\u{1F1F4}",
4863
- ukraine: "\u{1F1FA}\u{1F1E6}",
4864
- russia: "\u{1F1F7}\u{1F1FA}",
4865
- hungary: "\u{1F1ED}\u{1F1FA}",
4866
- slovakia: "\u{1F1F8}\u{1F1F0}",
4867
- slovenia: "\u{1F1F8}\u{1F1EE}",
4868
- turkey: "\u{1F1F9}\u{1F1F7}",
4869
- t\u00FCrkiye: "\u{1F1F9}\u{1F1F7}",
4870
- albania: "\u{1F1E6}\u{1F1F1}",
4871
- "north macedonia": "\u{1F1F2}\u{1F1F0}",
4872
- brazil: "\u{1F1E7}\u{1F1F7}",
4873
- argentina: "\u{1F1E6}\u{1F1F7}",
4874
- uruguay: "\u{1F1FA}\u{1F1FE}",
4875
- colombia: "\u{1F1E8}\u{1F1F4}",
4876
- chile: "\u{1F1E8}\u{1F1F1}",
4877
- peru: "\u{1F1F5}\u{1F1EA}",
4878
- ecuador: "\u{1F1EA}\u{1F1E8}",
4879
- paraguay: "\u{1F1F5}\u{1F1FE}",
4880
- mexico: "\u{1F1F2}\u{1F1FD}",
4881
- "united states": "\u{1F1FA}\u{1F1F8}",
4882
- usa: "\u{1F1FA}\u{1F1F8}",
4883
- canada: "\u{1F1E8}\u{1F1E6}",
4884
- jamaica: "\u{1F1EF}\u{1F1F2}",
4885
- nigeria: "\u{1F1F3}\u{1F1EC}",
4886
- ghana: "\u{1F1EC}\u{1F1ED}",
4887
- senegal: "\u{1F1F8}\u{1F1F3}",
4888
- ivorycoast: "\u{1F1E8}\u{1F1EE}",
4889
- "cote d'ivoire": "\u{1F1E8}\u{1F1EE}",
4890
- "ivory coast": "\u{1F1E8}\u{1F1EE}",
4891
- cameroon: "\u{1F1E8}\u{1F1F2}",
4892
- egypt: "\u{1F1EA}\u{1F1EC}",
4893
- morocco: "\u{1F1F2}\u{1F1E6}",
4894
- algeria: "\u{1F1E9}\u{1F1FF}",
4895
- tunisia: "\u{1F1F9}\u{1F1F3}",
4896
- mali: "\u{1F1F2}\u{1F1F1}",
4897
- "south africa": "\u{1F1FF}\u{1F1E6}",
4898
- "dr congo": "\u{1F1E8}\u{1F1E9}",
4899
- japan: "\u{1F1EF}\u{1F1F5}",
4900
- "south korea": "\u{1F1F0}\u{1F1F7}",
4901
- korea: "\u{1F1F0}\u{1F1F7}",
4902
- australia: "\u{1F1E6}\u{1F1FA}",
4903
- "saudi arabia": "\u{1F1F8}\u{1F1E6}",
4904
- iran: "\u{1F1EE}\u{1F1F7}",
4905
- "new zealand": "\u{1F1F3}\u{1F1FF}"
4906
- };
4907
- function nationalityFlag(nationality) {
4908
- if (!nationality) return "\u{1F3F3}\uFE0F";
4909
- const key = nationality.trim().toLowerCase();
4910
- return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
4911
- }
4912
-
4913
- // src/components/games/GuessTheXiGame.tsx
4914
4927
  var import_jsx_runtime59 = require("react/jsx-runtime");
4915
4928
  function parseClientState5(json) {
4916
4929
  if (!json) return null;
@@ -5647,15 +5660,17 @@ function GameScreenHost({
5647
5660
  config: safeParseConfig(configJson)
5648
5661
  }
5649
5662
  );
5650
- case "beat-the-grid":
5663
+ case "beat-the-grid": {
5664
+ const btgConfig = safeParseConfig(configJson);
5651
5665
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5652
5666
  BeatTheGridGame,
5653
5667
  {
5654
5668
  ...sharedProps,
5655
- config: safeParseConfig(configJson),
5656
- playerPool: []
5669
+ config: btgConfig,
5670
+ playerPool: btgConfig?.playerPool ?? []
5657
5671
  }
5658
5672
  );
5673
+ }
5659
5674
  case "guess-the-xi":
5660
5675
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5661
5676
  GuessTheXiGame,
@@ -6984,7 +6999,8 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
6984
6999
  /* Verdict tiles: label on top, verdict glyph below */
6985
7000
  .ss-w-gtile { display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 8px; gap: 2px; min-width: 0; }
6986
7001
  .ss-w-gtile-lab { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
6987
- .ss-w-gtile-v { font-size: 15px; font-weight: 800; line-height: 1; }
7002
+ .ss-w-gtile-v { display: inline-flex; align-items: center; gap: 1px; font-size: 13px; font-weight: 800; line-height: 1; max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
7003
+ .ss-w-gtile-dir { font-size: 9px; line-height: 1; }
6988
7004
  .ss-w-gtile--exact { background: var(--ss-w-correct); color: #062611; }
6989
7005
  .ss-w-gtile--near { background: var(--ss-w-accent); color: #241700; }
6990
7006
  .ss-w-gtile--miss { background: var(--ss-w-bubble); color: var(--ss-w-faint); border: 1px solid var(--ss-w-line); }