@sensiblestats/widget-react 0.134.0 → 0.135.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/dist/index.js CHANGED
@@ -81,6 +81,7 @@ var BUNDLED_EN_GB = {
81
81
  "widget.fullTimeLabel": "Full time",
82
82
  "widget.postponedLabel": "Postponed",
83
83
  "widget.ownGoalLabel": "OG",
84
+ "widget.penaltyLabel": "pen",
84
85
  "widget.inSlipLabel": "In slip",
85
86
  "widget.oddsUnavailable": "Odds unavailable right now",
86
87
  "widget.momentumLabel": "Momentum",
@@ -1297,7 +1298,7 @@ function parseOddsFormat(value) {
1297
1298
  }
1298
1299
 
1299
1300
  // src/version.generated.ts
1300
- var WIDGET_REACT_VERSION = "0.134.0";
1301
+ var WIDGET_REACT_VERSION = "0.135.0";
1301
1302
 
1302
1303
  // src/config.ts
1303
1304
  function hostTag(cfg) {
@@ -1545,6 +1546,7 @@ function normalizeUi(cfg, loaded) {
1545
1546
  fullTimeLabel: strings.fullTimeLabel,
1546
1547
  postponedLabel: strings.postponedLabel,
1547
1548
  ownGoalLabel: strings.ownGoalLabel,
1549
+ penaltyLabel: strings.penaltyLabel,
1548
1550
  inSlipLabel: strings.inSlipLabel,
1549
1551
  oddsUnavailable: strings.oddsUnavailable,
1550
1552
  momentumLabel: strings.momentumLabel,
@@ -10923,12 +10925,13 @@ function isPromoted(row, promotedPins) {
10923
10925
  if (!chip) return false;
10924
10926
  return promotedPins.some((pin) => pin.marketDeveloperName === chip.marketDeveloperName || chip.matchOddsId != null && pin.matchOddsId === chip.matchOddsId);
10925
10927
  }
10926
- function groupScorers(goals, ownGoalLabel) {
10928
+ function groupScorers(goals, ownGoalLabel, penaltyLabel) {
10927
10929
  const order = [];
10928
10930
  const minutesByPlayer = /* @__PURE__ */ new Map();
10929
10931
  for (const g of goals) {
10930
10932
  const name = g.player ?? "";
10931
- const minute = g.ownGoal ? `${g.minuteLabel} (${ownGoalLabel})` : g.minuteLabel;
10933
+ const marker = g.ownGoal ? ownGoalLabel : g.penalty ? penaltyLabel : null;
10934
+ const minute = marker ? `${g.minuteLabel} (${marker})` : g.minuteLabel;
10932
10935
  if (!minutesByPlayer.has(name)) {
10933
10936
  minutesByPlayer.set(name, []);
10934
10937
  order.push(name);
@@ -10944,8 +10947,8 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
10944
10947
  const { oddsFormat } = useOddsSettings();
10945
10948
  const live = match.phase === "live";
10946
10949
  const goals = match.events.filter((e) => e.type === "goal");
10947
- const homeScorers = groupScorers(goals.filter((e) => e.side === "home"), ui.ownGoalLabel);
10948
- const awayScorers = groupScorers(goals.filter((e) => e.side === "away"), ui.ownGoalLabel);
10950
+ const homeScorers = groupScorers(goals.filter((e) => e.side === "home"), ui.ownGoalLabel, ui.penaltyLabel);
10951
+ const awayScorers = groupScorers(goals.filter((e) => e.side === "away"), ui.ownGoalLabel, ui.penaltyLabel);
10949
10952
  const promotedRows = match.statRows.filter((row) => isPromoted(row, promotedPins));
10950
10953
  const otherRows = match.statRows.filter((row) => !isPromoted(row, promotedPins));
10951
10954
  const orderedRows = [...promotedRows, ...otherRows];