@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 +9 -0
- package/dist/index.cjs +105 -89
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +105 -89
- package/dist/index.js.map +1 -1
- package/dist/styles.css +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4192,6 +4192,89 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, refresh }) {
|
|
|
4192
4192
|
|
|
4193
4193
|
// src/components/games/MysteryTigerGame.tsx
|
|
4194
4194
|
import { useState as useState23, useId as useId2 } from "react";
|
|
4195
|
+
|
|
4196
|
+
// src/components/games/nationFlags.ts
|
|
4197
|
+
var FLAGS = {
|
|
4198
|
+
england: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",
|
|
4199
|
+
scotland: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",
|
|
4200
|
+
wales: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}",
|
|
4201
|
+
"northern ireland": "\u{1F1EC}\u{1F1E7}",
|
|
4202
|
+
"republic of ireland": "\u{1F1EE}\u{1F1EA}",
|
|
4203
|
+
ireland: "\u{1F1EE}\u{1F1EA}",
|
|
4204
|
+
"united kingdom": "\u{1F1EC}\u{1F1E7}",
|
|
4205
|
+
france: "\u{1F1EB}\u{1F1F7}",
|
|
4206
|
+
spain: "\u{1F1EA}\u{1F1F8}",
|
|
4207
|
+
portugal: "\u{1F1F5}\u{1F1F9}",
|
|
4208
|
+
germany: "\u{1F1E9}\u{1F1EA}",
|
|
4209
|
+
italy: "\u{1F1EE}\u{1F1F9}",
|
|
4210
|
+
netherlands: "\u{1F1F3}\u{1F1F1}",
|
|
4211
|
+
belgium: "\u{1F1E7}\u{1F1EA}",
|
|
4212
|
+
switzerland: "\u{1F1E8}\u{1F1ED}",
|
|
4213
|
+
austria: "\u{1F1E6}\u{1F1F9}",
|
|
4214
|
+
denmark: "\u{1F1E9}\u{1F1F0}",
|
|
4215
|
+
sweden: "\u{1F1F8}\u{1F1EA}",
|
|
4216
|
+
norway: "\u{1F1F3}\u{1F1F4}",
|
|
4217
|
+
finland: "\u{1F1EB}\u{1F1EE}",
|
|
4218
|
+
iceland: "\u{1F1EE}\u{1F1F8}",
|
|
4219
|
+
poland: "\u{1F1F5}\u{1F1F1}",
|
|
4220
|
+
czechia: "\u{1F1E8}\u{1F1FF}",
|
|
4221
|
+
"czech republic": "\u{1F1E8}\u{1F1FF}",
|
|
4222
|
+
croatia: "\u{1F1ED}\u{1F1F7}",
|
|
4223
|
+
serbia: "\u{1F1F7}\u{1F1F8}",
|
|
4224
|
+
"bosnia and herzegovina": "\u{1F1E7}\u{1F1E6}",
|
|
4225
|
+
greece: "\u{1F1EC}\u{1F1F7}",
|
|
4226
|
+
romania: "\u{1F1F7}\u{1F1F4}",
|
|
4227
|
+
ukraine: "\u{1F1FA}\u{1F1E6}",
|
|
4228
|
+
russia: "\u{1F1F7}\u{1F1FA}",
|
|
4229
|
+
hungary: "\u{1F1ED}\u{1F1FA}",
|
|
4230
|
+
slovakia: "\u{1F1F8}\u{1F1F0}",
|
|
4231
|
+
slovenia: "\u{1F1F8}\u{1F1EE}",
|
|
4232
|
+
turkey: "\u{1F1F9}\u{1F1F7}",
|
|
4233
|
+
t\u00FCrkiye: "\u{1F1F9}\u{1F1F7}",
|
|
4234
|
+
albania: "\u{1F1E6}\u{1F1F1}",
|
|
4235
|
+
"north macedonia": "\u{1F1F2}\u{1F1F0}",
|
|
4236
|
+
brazil: "\u{1F1E7}\u{1F1F7}",
|
|
4237
|
+
argentina: "\u{1F1E6}\u{1F1F7}",
|
|
4238
|
+
uruguay: "\u{1F1FA}\u{1F1FE}",
|
|
4239
|
+
colombia: "\u{1F1E8}\u{1F1F4}",
|
|
4240
|
+
chile: "\u{1F1E8}\u{1F1F1}",
|
|
4241
|
+
peru: "\u{1F1F5}\u{1F1EA}",
|
|
4242
|
+
ecuador: "\u{1F1EA}\u{1F1E8}",
|
|
4243
|
+
paraguay: "\u{1F1F5}\u{1F1FE}",
|
|
4244
|
+
mexico: "\u{1F1F2}\u{1F1FD}",
|
|
4245
|
+
"united states": "\u{1F1FA}\u{1F1F8}",
|
|
4246
|
+
usa: "\u{1F1FA}\u{1F1F8}",
|
|
4247
|
+
canada: "\u{1F1E8}\u{1F1E6}",
|
|
4248
|
+
jamaica: "\u{1F1EF}\u{1F1F2}",
|
|
4249
|
+
nigeria: "\u{1F1F3}\u{1F1EC}",
|
|
4250
|
+
ghana: "\u{1F1EC}\u{1F1ED}",
|
|
4251
|
+
senegal: "\u{1F1F8}\u{1F1F3}",
|
|
4252
|
+
ivorycoast: "\u{1F1E8}\u{1F1EE}",
|
|
4253
|
+
"cote d'ivoire": "\u{1F1E8}\u{1F1EE}",
|
|
4254
|
+
"ivory coast": "\u{1F1E8}\u{1F1EE}",
|
|
4255
|
+
cameroon: "\u{1F1E8}\u{1F1F2}",
|
|
4256
|
+
egypt: "\u{1F1EA}\u{1F1EC}",
|
|
4257
|
+
morocco: "\u{1F1F2}\u{1F1E6}",
|
|
4258
|
+
algeria: "\u{1F1E9}\u{1F1FF}",
|
|
4259
|
+
tunisia: "\u{1F1F9}\u{1F1F3}",
|
|
4260
|
+
mali: "\u{1F1F2}\u{1F1F1}",
|
|
4261
|
+
"south africa": "\u{1F1FF}\u{1F1E6}",
|
|
4262
|
+
"dr congo": "\u{1F1E8}\u{1F1E9}",
|
|
4263
|
+
japan: "\u{1F1EF}\u{1F1F5}",
|
|
4264
|
+
"south korea": "\u{1F1F0}\u{1F1F7}",
|
|
4265
|
+
korea: "\u{1F1F0}\u{1F1F7}",
|
|
4266
|
+
australia: "\u{1F1E6}\u{1F1FA}",
|
|
4267
|
+
"saudi arabia": "\u{1F1F8}\u{1F1E6}",
|
|
4268
|
+
iran: "\u{1F1EE}\u{1F1F7}",
|
|
4269
|
+
"new zealand": "\u{1F1F3}\u{1F1FF}"
|
|
4270
|
+
};
|
|
4271
|
+
function nationalityFlag(nationality) {
|
|
4272
|
+
if (!nationality) return "\u{1F3F3}\uFE0F";
|
|
4273
|
+
const key = nationality.trim().toLowerCase();
|
|
4274
|
+
return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
|
|
4275
|
+
}
|
|
4276
|
+
|
|
4277
|
+
// src/components/games/MysteryTigerGame.tsx
|
|
4195
4278
|
import { Fragment as Fragment9, jsx as jsx55, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4196
4279
|
function parseClientState(json) {
|
|
4197
4280
|
if (!json) return null;
|
|
@@ -4222,6 +4305,15 @@ function verdictGlyph(v) {
|
|
|
4222
4305
|
if (v.direction === "down") return "\u2193";
|
|
4223
4306
|
return "\u2248";
|
|
4224
4307
|
}
|
|
4308
|
+
function directionArrow(v) {
|
|
4309
|
+
if (v.direction === "up") return "\u25B2";
|
|
4310
|
+
if (v.direction === "down") return "\u25BC";
|
|
4311
|
+
return "";
|
|
4312
|
+
}
|
|
4313
|
+
function tileFace(key, v) {
|
|
4314
|
+
if (!v.value) return verdictGlyph(v);
|
|
4315
|
+
return key === "nationality" ? nationalityFlag(v.value) : v.value;
|
|
4316
|
+
}
|
|
4225
4317
|
function MysteryTigerGame({
|
|
4226
4318
|
config,
|
|
4227
4319
|
result,
|
|
@@ -4267,16 +4359,20 @@ function MysteryTigerGame({
|
|
|
4267
4359
|
] }),
|
|
4268
4360
|
/* @__PURE__ */ jsx55("div", { className: "ss-w-gtrow", children: ATTR_KEYS.map((key) => {
|
|
4269
4361
|
const v = gr[key];
|
|
4362
|
+
const arrow = directionArrow(v);
|
|
4270
4363
|
return /* @__PURE__ */ jsxs49(
|
|
4271
4364
|
"div",
|
|
4272
4365
|
{
|
|
4273
4366
|
className: `ss-w-gtile ss-w-gtile--${v.verdict}`,
|
|
4274
4367
|
"data-testid": `verdict-${key}-${i}`,
|
|
4275
4368
|
"data-verdict": v.verdict,
|
|
4276
|
-
"aria-label": `${ATTR_LABELS[key]}: ${v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
|
|
4369
|
+
"aria-label": `${ATTR_LABELS[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
|
|
4277
4370
|
children: [
|
|
4278
4371
|
/* @__PURE__ */ jsx55("span", { className: "ss-w-gtile-lab", children: ATTR_LABELS[key] }),
|
|
4279
|
-
/* @__PURE__ */
|
|
4372
|
+
/* @__PURE__ */ jsxs49("span", { className: "ss-w-gtile-v", "aria-hidden": "true", children: [
|
|
4373
|
+
tileFace(key, v),
|
|
4374
|
+
arrow && /* @__PURE__ */ jsx55("span", { className: "ss-w-gtile-dir", children: arrow })
|
|
4375
|
+
] })
|
|
4280
4376
|
]
|
|
4281
4377
|
},
|
|
4282
4378
|
key
|
|
@@ -4791,89 +4887,6 @@ function BeatTheGridGame({
|
|
|
4791
4887
|
|
|
4792
4888
|
// src/components/games/GuessTheXiGame.tsx
|
|
4793
4889
|
import { useState as useState26, useId as useId5 } from "react";
|
|
4794
|
-
|
|
4795
|
-
// src/components/games/nationFlags.ts
|
|
4796
|
-
var FLAGS = {
|
|
4797
|
-
england: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",
|
|
4798
|
-
scotland: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",
|
|
4799
|
-
wales: "\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}",
|
|
4800
|
-
"northern ireland": "\u{1F1EC}\u{1F1E7}",
|
|
4801
|
-
"republic of ireland": "\u{1F1EE}\u{1F1EA}",
|
|
4802
|
-
ireland: "\u{1F1EE}\u{1F1EA}",
|
|
4803
|
-
"united kingdom": "\u{1F1EC}\u{1F1E7}",
|
|
4804
|
-
france: "\u{1F1EB}\u{1F1F7}",
|
|
4805
|
-
spain: "\u{1F1EA}\u{1F1F8}",
|
|
4806
|
-
portugal: "\u{1F1F5}\u{1F1F9}",
|
|
4807
|
-
germany: "\u{1F1E9}\u{1F1EA}",
|
|
4808
|
-
italy: "\u{1F1EE}\u{1F1F9}",
|
|
4809
|
-
netherlands: "\u{1F1F3}\u{1F1F1}",
|
|
4810
|
-
belgium: "\u{1F1E7}\u{1F1EA}",
|
|
4811
|
-
switzerland: "\u{1F1E8}\u{1F1ED}",
|
|
4812
|
-
austria: "\u{1F1E6}\u{1F1F9}",
|
|
4813
|
-
denmark: "\u{1F1E9}\u{1F1F0}",
|
|
4814
|
-
sweden: "\u{1F1F8}\u{1F1EA}",
|
|
4815
|
-
norway: "\u{1F1F3}\u{1F1F4}",
|
|
4816
|
-
finland: "\u{1F1EB}\u{1F1EE}",
|
|
4817
|
-
iceland: "\u{1F1EE}\u{1F1F8}",
|
|
4818
|
-
poland: "\u{1F1F5}\u{1F1F1}",
|
|
4819
|
-
czechia: "\u{1F1E8}\u{1F1FF}",
|
|
4820
|
-
"czech republic": "\u{1F1E8}\u{1F1FF}",
|
|
4821
|
-
croatia: "\u{1F1ED}\u{1F1F7}",
|
|
4822
|
-
serbia: "\u{1F1F7}\u{1F1F8}",
|
|
4823
|
-
"bosnia and herzegovina": "\u{1F1E7}\u{1F1E6}",
|
|
4824
|
-
greece: "\u{1F1EC}\u{1F1F7}",
|
|
4825
|
-
romania: "\u{1F1F7}\u{1F1F4}",
|
|
4826
|
-
ukraine: "\u{1F1FA}\u{1F1E6}",
|
|
4827
|
-
russia: "\u{1F1F7}\u{1F1FA}",
|
|
4828
|
-
hungary: "\u{1F1ED}\u{1F1FA}",
|
|
4829
|
-
slovakia: "\u{1F1F8}\u{1F1F0}",
|
|
4830
|
-
slovenia: "\u{1F1F8}\u{1F1EE}",
|
|
4831
|
-
turkey: "\u{1F1F9}\u{1F1F7}",
|
|
4832
|
-
t\u00FCrkiye: "\u{1F1F9}\u{1F1F7}",
|
|
4833
|
-
albania: "\u{1F1E6}\u{1F1F1}",
|
|
4834
|
-
"north macedonia": "\u{1F1F2}\u{1F1F0}",
|
|
4835
|
-
brazil: "\u{1F1E7}\u{1F1F7}",
|
|
4836
|
-
argentina: "\u{1F1E6}\u{1F1F7}",
|
|
4837
|
-
uruguay: "\u{1F1FA}\u{1F1FE}",
|
|
4838
|
-
colombia: "\u{1F1E8}\u{1F1F4}",
|
|
4839
|
-
chile: "\u{1F1E8}\u{1F1F1}",
|
|
4840
|
-
peru: "\u{1F1F5}\u{1F1EA}",
|
|
4841
|
-
ecuador: "\u{1F1EA}\u{1F1E8}",
|
|
4842
|
-
paraguay: "\u{1F1F5}\u{1F1FE}",
|
|
4843
|
-
mexico: "\u{1F1F2}\u{1F1FD}",
|
|
4844
|
-
"united states": "\u{1F1FA}\u{1F1F8}",
|
|
4845
|
-
usa: "\u{1F1FA}\u{1F1F8}",
|
|
4846
|
-
canada: "\u{1F1E8}\u{1F1E6}",
|
|
4847
|
-
jamaica: "\u{1F1EF}\u{1F1F2}",
|
|
4848
|
-
nigeria: "\u{1F1F3}\u{1F1EC}",
|
|
4849
|
-
ghana: "\u{1F1EC}\u{1F1ED}",
|
|
4850
|
-
senegal: "\u{1F1F8}\u{1F1F3}",
|
|
4851
|
-
ivorycoast: "\u{1F1E8}\u{1F1EE}",
|
|
4852
|
-
"cote d'ivoire": "\u{1F1E8}\u{1F1EE}",
|
|
4853
|
-
"ivory coast": "\u{1F1E8}\u{1F1EE}",
|
|
4854
|
-
cameroon: "\u{1F1E8}\u{1F1F2}",
|
|
4855
|
-
egypt: "\u{1F1EA}\u{1F1EC}",
|
|
4856
|
-
morocco: "\u{1F1F2}\u{1F1E6}",
|
|
4857
|
-
algeria: "\u{1F1E9}\u{1F1FF}",
|
|
4858
|
-
tunisia: "\u{1F1F9}\u{1F1F3}",
|
|
4859
|
-
mali: "\u{1F1F2}\u{1F1F1}",
|
|
4860
|
-
"south africa": "\u{1F1FF}\u{1F1E6}",
|
|
4861
|
-
"dr congo": "\u{1F1E8}\u{1F1E9}",
|
|
4862
|
-
japan: "\u{1F1EF}\u{1F1F5}",
|
|
4863
|
-
"south korea": "\u{1F1F0}\u{1F1F7}",
|
|
4864
|
-
korea: "\u{1F1F0}\u{1F1F7}",
|
|
4865
|
-
australia: "\u{1F1E6}\u{1F1FA}",
|
|
4866
|
-
"saudi arabia": "\u{1F1F8}\u{1F1E6}",
|
|
4867
|
-
iran: "\u{1F1EE}\u{1F1F7}",
|
|
4868
|
-
"new zealand": "\u{1F1F3}\u{1F1FF}"
|
|
4869
|
-
};
|
|
4870
|
-
function nationalityFlag(nationality) {
|
|
4871
|
-
if (!nationality) return "\u{1F3F3}\uFE0F";
|
|
4872
|
-
const key = nationality.trim().toLowerCase();
|
|
4873
|
-
return FLAGS[key] ?? nationality.slice(0, 3).toUpperCase();
|
|
4874
|
-
}
|
|
4875
|
-
|
|
4876
|
-
// src/components/games/GuessTheXiGame.tsx
|
|
4877
4890
|
import { Fragment as Fragment14, jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4878
4891
|
function parseClientState5(json) {
|
|
4879
4892
|
if (!json) return null;
|
|
@@ -5610,15 +5623,17 @@ function GameScreenHost({
|
|
|
5610
5623
|
config: safeParseConfig(configJson)
|
|
5611
5624
|
}
|
|
5612
5625
|
);
|
|
5613
|
-
case "beat-the-grid":
|
|
5626
|
+
case "beat-the-grid": {
|
|
5627
|
+
const btgConfig = safeParseConfig(configJson);
|
|
5614
5628
|
return /* @__PURE__ */ jsx65(
|
|
5615
5629
|
BeatTheGridGame,
|
|
5616
5630
|
{
|
|
5617
5631
|
...sharedProps,
|
|
5618
|
-
config:
|
|
5619
|
-
playerPool: []
|
|
5632
|
+
config: btgConfig,
|
|
5633
|
+
playerPool: btgConfig?.playerPool ?? []
|
|
5620
5634
|
}
|
|
5621
5635
|
);
|
|
5636
|
+
}
|
|
5622
5637
|
case "guess-the-xi":
|
|
5623
5638
|
return /* @__PURE__ */ jsx65(
|
|
5624
5639
|
GuessTheXiGame,
|
|
@@ -6947,7 +6962,8 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
6947
6962
|
/* Verdict tiles: label on top, verdict glyph below */
|
|
6948
6963
|
.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; }
|
|
6949
6964
|
.ss-w-gtile-lab { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
|
|
6950
|
-
.ss-w-gtile-v { font-size:
|
|
6965
|
+
.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; }
|
|
6966
|
+
.ss-w-gtile-dir { font-size: 9px; line-height: 1; }
|
|
6951
6967
|
.ss-w-gtile--exact { background: var(--ss-w-correct); color: #062611; }
|
|
6952
6968
|
.ss-w-gtile--near { background: var(--ss-w-accent); color: #241700; }
|
|
6953
6969
|
.ss-w-gtile--miss { background: var(--ss-w-bubble); color: var(--ss-w-faint); border: 1px solid var(--ss-w-line); }
|