@sensiblestats/widget-react 0.61.0 → 0.61.2

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/dist/index.js CHANGED
@@ -4951,13 +4951,16 @@ function initialsOf(name) {
4951
4951
  if (parts.length === 1 || !last) return first.slice(0, 2).toUpperCase();
4952
4952
  return ((first[0] ?? "") + (last[0] ?? "")).toUpperCase();
4953
4953
  }
4954
+ function isPlaceholderImage(url) {
4955
+ return !!url && /\/placeholder\.(png|jpe?g|svg|webp)(\?|$)/i.test(url);
4956
+ }
4954
4957
  function PlayerAvatar({
4955
4958
  name,
4956
4959
  imagePath,
4957
4960
  className
4958
4961
  }) {
4959
4962
  const [failed, setFailed] = useState24(false);
4960
- const showImage = Boolean(imagePath) && !failed;
4963
+ const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
4961
4964
  return /* @__PURE__ */ jsx58("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ jsx58("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx58("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
4962
4965
  }
4963
4966
 
@@ -5454,7 +5457,7 @@ import { useState as useState26 } from "react";
5454
5457
  import { jsx as jsx69 } from "react/jsx-runtime";
5455
5458
  function CrestShield({ src, name, size = 28 }) {
5456
5459
  const [failed, setFailed] = useState26(false);
5457
- if (src && !failed) {
5460
+ if (src && !isPlaceholderImage(src) && !failed) {
5458
5461
  return /* @__PURE__ */ jsx69("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
5459
5462
  }
5460
5463
  return /* @__PURE__ */ jsx69("svg", { className: "ss-g-crest ss-g-crest--ph", width: size, height: size * 32 / 28, viewBox: "0 0 28 32", role: "img", "aria-label": name, children: /* @__PURE__ */ jsx69("path", { d: "M2 3h24v12c0 9-6 14-12 17C8 29 2 24 2 15z", fill: "currentColor" }) });
@@ -5637,7 +5640,7 @@ function CriterionIcon({ kind }) {
5637
5640
  return /* @__PURE__ */ jsx71(IconFlag, {});
5638
5641
  }
5639
5642
  }
5640
- function HeaderVisual({ label, key: iKey, meta }) {
5643
+ function HeaderVisual({ label, textKey: iKey, meta }) {
5641
5644
  if (!meta) {
5642
5645
  return /* @__PURE__ */ jsx71(CriterionIcon, { kind: criterionIconKind(label, iKey) });
5643
5646
  }
@@ -5814,7 +5817,7 @@ function BeatTheGridGame({
5814
5817
  cols.map((col, colIdx) => {
5815
5818
  const colMeta = config.colsMeta?.[colIdx];
5816
5819
  return /* @__PURE__ */ jsxs59("div", { className: "ss-g-btg-colhdr", "data-meta": colMeta ? "true" : void 0, children: [
5817
- /* @__PURE__ */ jsx71(HeaderVisual, { label: col, meta: colMeta }, config.colsI18n?.[colIdx]?.key),
5820
+ /* @__PURE__ */ jsx71(HeaderVisual, { label: col, textKey: config.colsI18n?.[colIdx]?.key, meta: colMeta }),
5818
5821
  /* @__PURE__ */ jsx71("span", { children: col })
5819
5822
  ] }, col);
5820
5823
  }),
@@ -5822,7 +5825,7 @@ function BeatTheGridGame({
5822
5825
  const rowMeta = config.rowsMeta?.[rowIdx];
5823
5826
  const abbr = rowAbbrev(rowLabel, s.rowAbbrev, config.rowsI18n?.[rowIdx]?.key);
5824
5827
  const rowHeaderContent = rowMeta ? /* @__PURE__ */ jsxs59(Fragment14, { children: [
5825
- /* @__PURE__ */ jsx71(HeaderVisual, { label: rowLabel, meta: rowMeta }, config.rowsI18n?.[rowIdx]?.key),
5828
+ /* @__PURE__ */ jsx71(HeaderVisual, { label: rowLabel, textKey: config.rowsI18n?.[rowIdx]?.key, meta: rowMeta }),
5826
5829
  /* @__PURE__ */ jsx71("span", { children: rowLabel })
5827
5830
  ] }) : abbr === rowLabel ? /* @__PURE__ */ jsx71("span", { children: rowLabel }) : /* @__PURE__ */ jsxs59(Fragment14, { children: [
5828
5831
  /* @__PURE__ */ jsx71("span", { "aria-hidden": "true", children: abbr }),