@sensiblestats/widget-react 0.59.0 → 0.59.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 +52 -3
- 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 +52 -3
- package/dist/index.js.map +1 -1
- package/dist/styles.css +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4356,9 +4356,49 @@ function directionArrow(v) {
|
|
|
4356
4356
|
if (v.direction === "down") return "\u25BC";
|
|
4357
4357
|
return "";
|
|
4358
4358
|
}
|
|
4359
|
+
var POSITION_SHORT = {
|
|
4360
|
+
goalkeeper: "GK",
|
|
4361
|
+
keeper: "GK",
|
|
4362
|
+
defender: "DEF",
|
|
4363
|
+
"centre back": "CB",
|
|
4364
|
+
"center back": "CB",
|
|
4365
|
+
"centre-back": "CB",
|
|
4366
|
+
"center-back": "CB",
|
|
4367
|
+
"left back": "LB",
|
|
4368
|
+
"right back": "RB",
|
|
4369
|
+
"left wing-back": "LWB",
|
|
4370
|
+
"right wing-back": "RWB",
|
|
4371
|
+
sweeper: "SW",
|
|
4372
|
+
midfielder: "MID",
|
|
4373
|
+
"defensive midfield": "DM",
|
|
4374
|
+
"central midfield": "CM",
|
|
4375
|
+
"centre midfield": "CM",
|
|
4376
|
+
"attacking midfield": "AM",
|
|
4377
|
+
"left midfield": "LM",
|
|
4378
|
+
"right midfield": "RM",
|
|
4379
|
+
"left wing": "LW",
|
|
4380
|
+
"right wing": "RW",
|
|
4381
|
+
"left winger": "LW",
|
|
4382
|
+
"right winger": "RW",
|
|
4383
|
+
forward: "FWD",
|
|
4384
|
+
attacker: "FWD",
|
|
4385
|
+
striker: "ST",
|
|
4386
|
+
"second striker": "SS",
|
|
4387
|
+
"centre forward": "CF",
|
|
4388
|
+
"center forward": "CF",
|
|
4389
|
+
"centre-forward": "CF"
|
|
4390
|
+
};
|
|
4391
|
+
function shortPosition(value) {
|
|
4392
|
+
const mapped = POSITION_SHORT[value.trim().toLowerCase()];
|
|
4393
|
+
if (mapped) return mapped;
|
|
4394
|
+
if (value.length <= 3) return value.toUpperCase();
|
|
4395
|
+
return value.split(/[\s-]+/).filter(Boolean).map((w) => (w[0] ?? "").toUpperCase()).join("").slice(0, 3);
|
|
4396
|
+
}
|
|
4359
4397
|
function tileFace(key, v) {
|
|
4360
4398
|
if (!v.value) return verdictGlyph(v);
|
|
4361
|
-
|
|
4399
|
+
if (key === "nationality") return nationalityFlag(v.value);
|
|
4400
|
+
if (key === "position") return shortPosition(v.value);
|
|
4401
|
+
return v.value;
|
|
4362
4402
|
}
|
|
4363
4403
|
function MysteryTigerGame({
|
|
4364
4404
|
config,
|
|
@@ -4422,8 +4462,12 @@ function MysteryTigerGame({
|
|
|
4422
4462
|
!isOver && /* @__PURE__ */ jsxs49("div", { className: "ss-w-gt-lead", children: [
|
|
4423
4463
|
guessResults.length === 0 ? "Guess a squad player \u2014 each guess compares it to the mystery player on Pos, Nat, Age, Shirt & Apps: " : "Tiles: ",
|
|
4424
4464
|
/* @__PURE__ */ jsxs49("span", { className: "ss-w-gt-key", children: [
|
|
4425
|
-
/* @__PURE__ */ jsx56("
|
|
4426
|
-
" match \xB7
|
|
4465
|
+
/* @__PURE__ */ jsx56("span", { className: "ss-w-gt-sw ss-w-gt-sw--exact", "aria-hidden": "true" }),
|
|
4466
|
+
" match \xB7",
|
|
4467
|
+
" ",
|
|
4468
|
+
/* @__PURE__ */ jsx56("span", { className: "ss-w-gt-sw ss-w-gt-sw--near", "aria-hidden": "true" }),
|
|
4469
|
+
" close \xB7",
|
|
4470
|
+
" ",
|
|
4427
4471
|
/* @__PURE__ */ jsx56("b", { children: "\u25B2" }),
|
|
4428
4472
|
" higher \xB7 ",
|
|
4429
4473
|
/* @__PURE__ */ jsx56("b", { children: "\u25BC" }),
|
|
@@ -7067,6 +7111,11 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
7067
7111
|
.ss-w-gt-key { white-space: nowrap; }
|
|
7068
7112
|
.ss-w-gt-key b { font-weight: 800; color: var(--ss-w-ink); }
|
|
7069
7113
|
.ss-w-gt-key-ok { color: var(--ss-w-correct) !important; }
|
|
7114
|
+
/* Legend colour swatches \u2014 green = exact match, amber = close (same broad line / confederation
|
|
7115
|
+
/ within tolerance). Mirrors .ss-w-gtile--exact / --near tile fills. */
|
|
7116
|
+
.ss-w-gt-sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; vertical-align: middle; }
|
|
7117
|
+
.ss-w-gt-sw--exact { background: var(--ss-w-correct); }
|
|
7118
|
+
.ss-w-gt-sw--near { background: var(--ss-w-accent); }
|
|
7070
7119
|
/* Higher or Lower terminal score unit. */
|
|
7071
7120
|
.ss-w-hl-over-unit { font-size: 14px; font-weight: 700; color: var(--ss-w-faint); }
|
|
7072
7121
|
.ss-w-gscreen-back { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: var(--ss-w-accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0 10px; align-self: flex-start; }
|