@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 +6 -0
- package/dist/index.cjs +37 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -138,6 +138,18 @@ var STRINGS = {
|
|
|
138
138
|
alreadyPlayedTitle: "Played today",
|
|
139
139
|
guess: "Guess",
|
|
140
140
|
formatDayTime: (iso) => new Intl.DateTimeFormat("en-GB", { weekday: "short", hour: "2-digit", minute: "2-digit" }).format(new Date(iso)),
|
|
141
|
+
titles: {
|
|
142
|
+
"mystery-tiger": "Mystery Player",
|
|
143
|
+
"daily-quiz": "Daily Quiz",
|
|
144
|
+
"career-path": "Career Path",
|
|
145
|
+
"beat-the-grid": "Beat the Grid",
|
|
146
|
+
"guess-the-xi": "Guess the XI",
|
|
147
|
+
"higher-or-lower": "Higher or Lower",
|
|
148
|
+
"matchday-predictor": "Matchday Predictor",
|
|
149
|
+
"starting-xi": "Starting XI",
|
|
150
|
+
"stat-ladder": "Stat Ladder",
|
|
151
|
+
"fan-motm": "Fan MOTM"
|
|
152
|
+
},
|
|
141
153
|
taglines: {
|
|
142
154
|
"mystery-tiger": "One player. Six guesses.",
|
|
143
155
|
"higher-or-lower": "Who had more?",
|
|
@@ -421,6 +433,18 @@ var STRINGS = {
|
|
|
421
433
|
alreadyPlayedTitle: "Bug\xFCn oynad\u0131n",
|
|
422
434
|
guess: "Tahmin",
|
|
423
435
|
formatDayTime: (iso) => new Intl.DateTimeFormat("tr-TR", { weekday: "short", hour: "2-digit", minute: "2-digit" }).format(new Date(iso)),
|
|
436
|
+
titles: {
|
|
437
|
+
"mystery-tiger": "Gizemli Oyuncu",
|
|
438
|
+
"daily-quiz": "G\xFCn\xFCn Testi",
|
|
439
|
+
"career-path": "Kariyer Yolu",
|
|
440
|
+
"beat-the-grid": "Tabloyu Tamamla",
|
|
441
|
+
"guess-the-xi": "Bu 11 Kimin?",
|
|
442
|
+
"higher-or-lower": "Fazla m\u0131, Az m\u0131?",
|
|
443
|
+
"matchday-predictor": "Skor Tahmini",
|
|
444
|
+
"starting-xi": "\u0130lk 11 Tahmini",
|
|
445
|
+
"stat-ladder": "\u0130statistik Merdiveni",
|
|
446
|
+
"fan-motm": "Ma\xE7\u0131n Oyuncusu"
|
|
447
|
+
},
|
|
424
448
|
taglines: {
|
|
425
449
|
"mystery-tiger": "Bir oyuncu. Alt\u0131 tahmin.",
|
|
426
450
|
"higher-or-lower": "Kimin daha fazlas\u0131 var?",
|
|
@@ -4385,23 +4409,11 @@ function GamesLoginWall({ ui }) {
|
|
|
4385
4409
|
import { useEffect as useEffect13, useState as useState22 } from "react";
|
|
4386
4410
|
|
|
4387
4411
|
// src/components/games/ui/gameMeta.ts
|
|
4388
|
-
var GAME_TITLES = {
|
|
4389
|
-
"mystery-tiger": "Mystery Tiger",
|
|
4390
|
-
"daily-quiz": "Daily Quiz",
|
|
4391
|
-
"career-path": "Career Path",
|
|
4392
|
-
"beat-the-grid": "Beat the Grid",
|
|
4393
|
-
"guess-the-xi": "Guess the XI",
|
|
4394
|
-
"higher-or-lower": "Higher or Lower",
|
|
4395
|
-
"matchday-predictor": "Matchday Predictor",
|
|
4396
|
-
"starting-xi": "Starting XI",
|
|
4397
|
-
"stat-ladder": "Stat Ladder",
|
|
4398
|
-
"fan-motm": "Fan MOTM"
|
|
4399
|
-
};
|
|
4400
4412
|
function prettifyGameId(gameId) {
|
|
4401
4413
|
return gameId.split("-").map((w) => w ? w[0].toUpperCase() + w.slice(1) : w).join(" ");
|
|
4402
4414
|
}
|
|
4403
|
-
function gameTitle(g) {
|
|
4404
|
-
return g.title ??
|
|
4415
|
+
function gameTitle(g, titles) {
|
|
4416
|
+
return g.title ?? titles[g.gameId] ?? prettifyGameId(g.gameId);
|
|
4405
4417
|
}
|
|
4406
4418
|
function splitName(full) {
|
|
4407
4419
|
const parts = full.trim().split(/\s+/).filter(Boolean);
|
|
@@ -4534,7 +4546,7 @@ var DISABLED = /* @__PURE__ */ new Set(["locked", "voided"]);
|
|
|
4534
4546
|
function GameTile({ game, onOpen, ui, variant = "tile" }) {
|
|
4535
4547
|
const status = tileStatus(game, ui);
|
|
4536
4548
|
const disabled = DISABLED.has(game.status);
|
|
4537
|
-
const title = gameTitle(game);
|
|
4549
|
+
const title = gameTitle(game, ui.games.titles);
|
|
4538
4550
|
const body = variant === "hero" ? /* @__PURE__ */ jsxs49(Fragment9, { children: [
|
|
4539
4551
|
/* @__PURE__ */ jsxs49("span", { className: "ss-g-hero-text", children: [
|
|
4540
4552
|
/* @__PURE__ */ jsx56("span", { className: "ss-g-hero-eyebrow", children: ui.games.dailyChallenge }),
|
|
@@ -5069,7 +5081,7 @@ function MysteryTigerGame({
|
|
|
5069
5081
|
/* @__PURE__ */ jsx67(
|
|
5070
5082
|
GameHeader,
|
|
5071
5083
|
{
|
|
5072
|
-
title: gameTitle({ gameId: "mystery-tiger" }),
|
|
5084
|
+
title: gameTitle({ gameId: "mystery-tiger" }, ui.games.titles),
|
|
5073
5085
|
eyebrow: t.eyebrow,
|
|
5074
5086
|
right: headerRight,
|
|
5075
5087
|
onBack,
|
|
@@ -5241,7 +5253,7 @@ function HigherOrLowerGame({
|
|
|
5241
5253
|
/* @__PURE__ */ jsx68(
|
|
5242
5254
|
GameHeader,
|
|
5243
5255
|
{
|
|
5244
|
-
title: gameTitle({ gameId: "higher-or-lower" }),
|
|
5256
|
+
title: gameTitle({ gameId: "higher-or-lower" }, ui.games.titles),
|
|
5245
5257
|
eyebrow: t.eyebrow(POINTS_PER_CORRECT),
|
|
5246
5258
|
right: config ? /* @__PURE__ */ jsx68(StatStack, { value: runLength, label: t.streak }) : void 0,
|
|
5247
5259
|
onBack,
|
|
@@ -5342,7 +5354,7 @@ function CareerPathGame({
|
|
|
5342
5354
|
ui
|
|
5343
5355
|
}) {
|
|
5344
5356
|
const s = ui.games.careerPath;
|
|
5345
|
-
const title = gameTitle({ gameId: "career-path" });
|
|
5357
|
+
const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
|
|
5346
5358
|
const [query, setQuery] = useState27("");
|
|
5347
5359
|
const inputId = useId3();
|
|
5348
5360
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
@@ -5592,7 +5604,7 @@ function BeatTheGridGame({
|
|
|
5592
5604
|
playerPool
|
|
5593
5605
|
}) {
|
|
5594
5606
|
const s = ui.games.beatTheGrid;
|
|
5595
|
-
const title = gameTitle({ gameId: "beat-the-grid" });
|
|
5607
|
+
const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
|
|
5596
5608
|
const [activeCell, setActiveCell] = useState28(null);
|
|
5597
5609
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
5598
5610
|
const filledCells = clientState?.cells ?? [];
|
|
@@ -5846,7 +5858,7 @@ function GuessTheXiGame({
|
|
|
5846
5858
|
/* @__PURE__ */ jsx73(
|
|
5847
5859
|
GameHeader,
|
|
5848
5860
|
{
|
|
5849
|
-
title: gameTitle({ gameId: "guess-the-xi" }),
|
|
5861
|
+
title: gameTitle({ gameId: "guess-the-xi" }, ui.games.titles),
|
|
5850
5862
|
eyebrow: config?.poolLabel,
|
|
5851
5863
|
right: formation ? /* @__PURE__ */ jsx73(Chip, { variant: "accent", children: formation }) : void 0,
|
|
5852
5864
|
onBack,
|
|
@@ -5967,7 +5979,7 @@ function DailyQuizGame({
|
|
|
5967
5979
|
ui
|
|
5968
5980
|
}) {
|
|
5969
5981
|
const s = ui.games.dailyQuiz;
|
|
5970
|
-
const title = gameTitle({ gameId: "daily-quiz" });
|
|
5982
|
+
const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
|
|
5971
5983
|
const [selections, setSelections] = useState30(/* @__PURE__ */ new Map());
|
|
5972
5984
|
const [page, setPage] = useState30(0);
|
|
5973
5985
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
@@ -6183,7 +6195,7 @@ function MatchdayPredictorGame({
|
|
|
6183
6195
|
const header = /* @__PURE__ */ jsx75(
|
|
6184
6196
|
GameHeader,
|
|
6185
6197
|
{
|
|
6186
|
-
title: gameTitle({ gameId: "matchday-predictor" }),
|
|
6198
|
+
title: gameTitle({ gameId: "matchday-predictor" }, ui.games.titles),
|
|
6187
6199
|
eyebrow: config ? t.eyebrow(config.homeTeam.name, config.awayTeam.name) : void 0,
|
|
6188
6200
|
right: config ? /* @__PURE__ */ jsx75(Chip, { icon: /* @__PURE__ */ jsx75(IconLock, {}), children: ui.games.formatDayTime(config.kickoffUtc) }) : void 0,
|
|
6189
6201
|
onBack,
|
|
@@ -6397,7 +6409,7 @@ function StartingXiGame({
|
|
|
6397
6409
|
const header = /* @__PURE__ */ jsx76(
|
|
6398
6410
|
GameHeader,
|
|
6399
6411
|
{
|
|
6400
|
-
title: gameTitle({ gameId: "starting-xi" }),
|
|
6412
|
+
title: gameTitle({ gameId: "starting-xi" }, ui.games.titles),
|
|
6401
6413
|
eyebrow: t.eyebrow,
|
|
6402
6414
|
right: /* @__PURE__ */ jsx76(Chip, { variant: "accent", children: t.perStarter(POINTS_PER_STARTER) }),
|
|
6403
6415
|
onBack,
|
|
@@ -6572,7 +6584,7 @@ function StatLadderGame({
|
|
|
6572
6584
|
const searchId = useId8();
|
|
6573
6585
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
6574
6586
|
const revealed = clientState != null;
|
|
6575
|
-
const header = /* @__PURE__ */ jsx77(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
|
|
6587
|
+
const header = /* @__PURE__ */ jsx77(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }, ui.games.titles), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
|
|
6576
6588
|
if (!config) {
|
|
6577
6589
|
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-screen", "data-testid": "game-screen-stat-ladder", children: [
|
|
6578
6590
|
header,
|
|
@@ -6903,7 +6915,7 @@ function GameScreenHost({
|
|
|
6903
6915
|
}
|
|
6904
6916
|
);
|
|
6905
6917
|
default:
|
|
6906
|
-
return /* @__PURE__ */ jsx79("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ jsx79(GameHeader, { title: gameTitle({ gameId }), onBack, backLabel: ui.back }) });
|
|
6918
|
+
return /* @__PURE__ */ jsx79("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ jsx79(GameHeader, { title: gameTitle({ gameId }, ui.games.titles), onBack, backLabel: ui.back }) });
|
|
6907
6919
|
}
|
|
6908
6920
|
}
|
|
6909
6921
|
return /* @__PURE__ */ jsx79("div", { className: "ss-w-gscreen", "data-testid": "gscreen", "data-lock-at": lockAtUtc ?? void 0, children: renderScreen() });
|