@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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.59.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Mystery Tiger: abbreviate long position names on the comparison tiles (e.g. "Centre Forward" → "CF", "Goalkeeper" → "GK") so they fit the square, and extend the legend to explain the amber "close" tile alongside the green "match" (colour swatches).
8
+
3
9
  ## 0.59.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -4393,9 +4393,49 @@ function directionArrow(v) {
4393
4393
  if (v.direction === "down") return "\u25BC";
4394
4394
  return "";
4395
4395
  }
4396
+ var POSITION_SHORT = {
4397
+ goalkeeper: "GK",
4398
+ keeper: "GK",
4399
+ defender: "DEF",
4400
+ "centre back": "CB",
4401
+ "center back": "CB",
4402
+ "centre-back": "CB",
4403
+ "center-back": "CB",
4404
+ "left back": "LB",
4405
+ "right back": "RB",
4406
+ "left wing-back": "LWB",
4407
+ "right wing-back": "RWB",
4408
+ sweeper: "SW",
4409
+ midfielder: "MID",
4410
+ "defensive midfield": "DM",
4411
+ "central midfield": "CM",
4412
+ "centre midfield": "CM",
4413
+ "attacking midfield": "AM",
4414
+ "left midfield": "LM",
4415
+ "right midfield": "RM",
4416
+ "left wing": "LW",
4417
+ "right wing": "RW",
4418
+ "left winger": "LW",
4419
+ "right winger": "RW",
4420
+ forward: "FWD",
4421
+ attacker: "FWD",
4422
+ striker: "ST",
4423
+ "second striker": "SS",
4424
+ "centre forward": "CF",
4425
+ "center forward": "CF",
4426
+ "centre-forward": "CF"
4427
+ };
4428
+ function shortPosition(value) {
4429
+ const mapped = POSITION_SHORT[value.trim().toLowerCase()];
4430
+ if (mapped) return mapped;
4431
+ if (value.length <= 3) return value.toUpperCase();
4432
+ return value.split(/[\s-]+/).filter(Boolean).map((w) => (w[0] ?? "").toUpperCase()).join("").slice(0, 3);
4433
+ }
4396
4434
  function tileFace(key, v) {
4397
4435
  if (!v.value) return verdictGlyph(v);
4398
- return key === "nationality" ? nationalityFlag(v.value) : v.value;
4436
+ if (key === "nationality") return nationalityFlag(v.value);
4437
+ if (key === "position") return shortPosition(v.value);
4438
+ return v.value;
4399
4439
  }
4400
4440
  function MysteryTigerGame({
4401
4441
  config,
@@ -4459,8 +4499,12 @@ function MysteryTigerGame({
4459
4499
  !isOver && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "ss-w-gt-lead", children: [
4460
4500
  guessResults.length === 0 ? "Guess a squad player \u2014 each guess compares it to the mystery player on Pos, Nat, Age, Shirt & Apps: " : "Tiles: ",
4461
4501
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "ss-w-gt-key", children: [
4462
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("b", { className: "ss-w-gt-key-ok", children: "\u2713" }),
4463
- " match \xB7 ",
4502
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-gt-sw ss-w-gt-sw--exact", "aria-hidden": "true" }),
4503
+ " match \xB7",
4504
+ " ",
4505
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "ss-w-gt-sw ss-w-gt-sw--near", "aria-hidden": "true" }),
4506
+ " close \xB7",
4507
+ " ",
4464
4508
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("b", { children: "\u25B2" }),
4465
4509
  " higher \xB7 ",
4466
4510
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("b", { children: "\u25BC" }),
@@ -7104,6 +7148,11 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
7104
7148
  .ss-w-gt-key { white-space: nowrap; }
7105
7149
  .ss-w-gt-key b { font-weight: 800; color: var(--ss-w-ink); }
7106
7150
  .ss-w-gt-key-ok { color: var(--ss-w-correct) !important; }
7151
+ /* Legend colour swatches \u2014 green = exact match, amber = close (same broad line / confederation
7152
+ / within tolerance). Mirrors .ss-w-gtile--exact / --near tile fills. */
7153
+ .ss-w-gt-sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; vertical-align: middle; }
7154
+ .ss-w-gt-sw--exact { background: var(--ss-w-correct); }
7155
+ .ss-w-gt-sw--near { background: var(--ss-w-accent); }
7107
7156
  /* Higher or Lower terminal score unit. */
7108
7157
  .ss-w-hl-over-unit { font-size: 14px; font-weight: 700; color: var(--ss-w-faint); }
7109
7158
  .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; }