@sensiblestats/widget-react 0.60.0 → 0.60.1

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,11 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.60.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Localize game display names for Turkish operators; rename mystery-tiger display name to Mystery Player
8
+
3
9
  ## 0.60.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -175,6 +175,18 @@ var STRINGS = {
175
175
  alreadyPlayedTitle: "Played today",
176
176
  guess: "Guess",
177
177
  formatDayTime: (iso) => new Intl.DateTimeFormat("en-GB", { weekday: "short", hour: "2-digit", minute: "2-digit" }).format(new Date(iso)),
178
+ titles: {
179
+ "mystery-tiger": "Mystery Player",
180
+ "daily-quiz": "Daily Quiz",
181
+ "career-path": "Career Path",
182
+ "beat-the-grid": "Beat the Grid",
183
+ "guess-the-xi": "Guess the XI",
184
+ "higher-or-lower": "Higher or Lower",
185
+ "matchday-predictor": "Matchday Predictor",
186
+ "starting-xi": "Starting XI",
187
+ "stat-ladder": "Stat Ladder",
188
+ "fan-motm": "Fan MOTM"
189
+ },
178
190
  taglines: {
179
191
  "mystery-tiger": "One player. Six guesses.",
180
192
  "higher-or-lower": "Who had more?",
@@ -458,6 +470,18 @@ var STRINGS = {
458
470
  alreadyPlayedTitle: "Bug\xFCn oynad\u0131n",
459
471
  guess: "Tahmin",
460
472
  formatDayTime: (iso) => new Intl.DateTimeFormat("tr-TR", { weekday: "short", hour: "2-digit", minute: "2-digit" }).format(new Date(iso)),
473
+ titles: {
474
+ "mystery-tiger": "Gizemli Oyuncu",
475
+ "daily-quiz": "G\xFCn\xFCn Testi",
476
+ "career-path": "Kariyer Yolu",
477
+ "beat-the-grid": "Tabloyu Tamamla",
478
+ "guess-the-xi": "Bu 11 Kimin?",
479
+ "higher-or-lower": "Fazla m\u0131, Az m\u0131?",
480
+ "matchday-predictor": "Skor Tahmini",
481
+ "starting-xi": "\u0130lk 11 Tahmini",
482
+ "stat-ladder": "\u0130statistik Merdiveni",
483
+ "fan-motm": "Ma\xE7\u0131n Oyuncusu"
484
+ },
461
485
  taglines: {
462
486
  "mystery-tiger": "Bir oyuncu. Alt\u0131 tahmin.",
463
487
  "higher-or-lower": "Kimin daha fazlas\u0131 var?",
@@ -4422,23 +4446,11 @@ function GamesLoginWall({ ui }) {
4422
4446
  var import_react28 = require("react");
4423
4447
 
4424
4448
  // src/components/games/ui/gameMeta.ts
4425
- var GAME_TITLES = {
4426
- "mystery-tiger": "Mystery Tiger",
4427
- "daily-quiz": "Daily Quiz",
4428
- "career-path": "Career Path",
4429
- "beat-the-grid": "Beat the Grid",
4430
- "guess-the-xi": "Guess the XI",
4431
- "higher-or-lower": "Higher or Lower",
4432
- "matchday-predictor": "Matchday Predictor",
4433
- "starting-xi": "Starting XI",
4434
- "stat-ladder": "Stat Ladder",
4435
- "fan-motm": "Fan MOTM"
4436
- };
4437
4449
  function prettifyGameId(gameId) {
4438
4450
  return gameId.split("-").map((w) => w ? w[0].toUpperCase() + w.slice(1) : w).join(" ");
4439
4451
  }
4440
- function gameTitle(g) {
4441
- return g.title ?? GAME_TITLES[g.gameId] ?? prettifyGameId(g.gameId);
4452
+ function gameTitle(g, titles) {
4453
+ return g.title ?? titles[g.gameId] ?? prettifyGameId(g.gameId);
4442
4454
  }
4443
4455
  function splitName(full) {
4444
4456
  const parts = full.trim().split(/\s+/).filter(Boolean);
@@ -4571,7 +4583,7 @@ var DISABLED = /* @__PURE__ */ new Set(["locked", "voided"]);
4571
4583
  function GameTile({ game, onOpen, ui, variant = "tile" }) {
4572
4584
  const status = tileStatus(game, ui);
4573
4585
  const disabled = DISABLED.has(game.status);
4574
- const title = gameTitle(game);
4586
+ const title = gameTitle(game, ui.games.titles);
4575
4587
  const body = variant === "hero" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
4576
4588
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "ss-g-hero-text", children: [
4577
4589
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-g-hero-eyebrow", children: ui.games.dailyChallenge }),
@@ -5106,7 +5118,7 @@ function MysteryTigerGame({
5106
5118
  /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5107
5119
  GameHeader,
5108
5120
  {
5109
- title: gameTitle({ gameId: "mystery-tiger" }),
5121
+ title: gameTitle({ gameId: "mystery-tiger" }, ui.games.titles),
5110
5122
  eyebrow: t.eyebrow,
5111
5123
  right: headerRight,
5112
5124
  onBack,
@@ -5278,7 +5290,7 @@ function HigherOrLowerGame({
5278
5290
  /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5279
5291
  GameHeader,
5280
5292
  {
5281
- title: gameTitle({ gameId: "higher-or-lower" }),
5293
+ title: gameTitle({ gameId: "higher-or-lower" }, ui.games.titles),
5282
5294
  eyebrow: t.eyebrow(POINTS_PER_CORRECT),
5283
5295
  right: config ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(StatStack, { value: runLength, label: t.streak }) : void 0,
5284
5296
  onBack,
@@ -5379,7 +5391,7 @@ function CareerPathGame({
5379
5391
  ui
5380
5392
  }) {
5381
5393
  const s = ui.games.careerPath;
5382
- const title = gameTitle({ gameId: "career-path" });
5394
+ const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
5383
5395
  const [query, setQuery] = (0, import_react33.useState)("");
5384
5396
  const inputId = (0, import_react33.useId)();
5385
5397
  const clientState = parseClientState3(result?.clientStateJson);
@@ -5629,7 +5641,7 @@ function BeatTheGridGame({
5629
5641
  playerPool
5630
5642
  }) {
5631
5643
  const s = ui.games.beatTheGrid;
5632
- const title = gameTitle({ gameId: "beat-the-grid" });
5644
+ const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
5633
5645
  const [activeCell, setActiveCell] = (0, import_react34.useState)(null);
5634
5646
  const clientState = parseClientState4(result?.clientStateJson);
5635
5647
  const filledCells = clientState?.cells ?? [];
@@ -5883,7 +5895,7 @@ function GuessTheXiGame({
5883
5895
  /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5884
5896
  GameHeader,
5885
5897
  {
5886
- title: gameTitle({ gameId: "guess-the-xi" }),
5898
+ title: gameTitle({ gameId: "guess-the-xi" }, ui.games.titles),
5887
5899
  eyebrow: config?.poolLabel,
5888
5900
  right: formation ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Chip, { variant: "accent", children: formation }) : void 0,
5889
5901
  onBack,
@@ -6004,7 +6016,7 @@ function DailyQuizGame({
6004
6016
  ui
6005
6017
  }) {
6006
6018
  const s = ui.games.dailyQuiz;
6007
- const title = gameTitle({ gameId: "daily-quiz" });
6019
+ const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
6008
6020
  const [selections, setSelections] = (0, import_react36.useState)(/* @__PURE__ */ new Map());
6009
6021
  const [page, setPage] = (0, import_react36.useState)(0);
6010
6022
  const clientState = parseClientState6(result?.clientStateJson);
@@ -6220,7 +6232,7 @@ function MatchdayPredictorGame({
6220
6232
  const header = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
6221
6233
  GameHeader,
6222
6234
  {
6223
- title: gameTitle({ gameId: "matchday-predictor" }),
6235
+ title: gameTitle({ gameId: "matchday-predictor" }, ui.games.titles),
6224
6236
  eyebrow: config ? t.eyebrow(config.homeTeam.name, config.awayTeam.name) : void 0,
6225
6237
  right: config ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Chip, { icon: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(IconLock, {}), children: ui.games.formatDayTime(config.kickoffUtc) }) : void 0,
6226
6238
  onBack,
@@ -6434,7 +6446,7 @@ function StartingXiGame({
6434
6446
  const header = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
6435
6447
  GameHeader,
6436
6448
  {
6437
- title: gameTitle({ gameId: "starting-xi" }),
6449
+ title: gameTitle({ gameId: "starting-xi" }, ui.games.titles),
6438
6450
  eyebrow: t.eyebrow,
6439
6451
  right: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Chip, { variant: "accent", children: t.perStarter(POINTS_PER_STARTER) }),
6440
6452
  onBack,
@@ -6609,7 +6621,7 @@ function StatLadderGame({
6609
6621
  const searchId = (0, import_react39.useId)();
6610
6622
  const clientState = parseClientState9(result?.clientStateJson);
6611
6623
  const revealed = clientState != null;
6612
- const header = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
6624
+ const header = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }, ui.games.titles), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
6613
6625
  if (!config) {
6614
6626
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "ss-g-screen", "data-testid": "game-screen-stat-ladder", children: [
6615
6627
  header,
@@ -6940,7 +6952,7 @@ function GameScreenHost({
6940
6952
  }
6941
6953
  );
6942
6954
  default:
6943
- return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GameHeader, { title: gameTitle({ gameId }), onBack, backLabel: ui.back }) });
6955
+ return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(GameHeader, { title: gameTitle({ gameId }, ui.games.titles), onBack, backLabel: ui.back }) });
6944
6956
  }
6945
6957
  }
6946
6958
  return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ss-w-gscreen", "data-testid": "gscreen", "data-lock-at": lockAtUtc ?? void 0, children: renderScreen() });