@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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.135.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Show scored penalties in the live scorer strip with a "(pen)" marker: `LiveMonitorEvent.penalty` and the `widget.penaltyLabel` row.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @sensiblestats/widget-sdk@0.97.0
13
+
3
14
  ## 0.134.0
4
15
 
5
16
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -120,6 +120,7 @@ var BUNDLED_EN_GB = {
120
120
  "widget.fullTimeLabel": "Full time",
121
121
  "widget.postponedLabel": "Postponed",
122
122
  "widget.ownGoalLabel": "OG",
123
+ "widget.penaltyLabel": "pen",
123
124
  "widget.inSlipLabel": "In slip",
124
125
  "widget.oddsUnavailable": "Odds unavailable right now",
125
126
  "widget.momentumLabel": "Momentum",
@@ -1336,7 +1337,7 @@ function parseOddsFormat(value) {
1336
1337
  }
1337
1338
 
1338
1339
  // src/version.generated.ts
1339
- var WIDGET_REACT_VERSION = "0.134.0";
1340
+ var WIDGET_REACT_VERSION = "0.135.0";
1340
1341
 
1341
1342
  // src/config.ts
1342
1343
  function hostTag(cfg) {
@@ -1584,6 +1585,7 @@ function normalizeUi(cfg, loaded) {
1584
1585
  fullTimeLabel: strings.fullTimeLabel,
1585
1586
  postponedLabel: strings.postponedLabel,
1586
1587
  ownGoalLabel: strings.ownGoalLabel,
1588
+ penaltyLabel: strings.penaltyLabel,
1587
1589
  inSlipLabel: strings.inSlipLabel,
1588
1590
  oddsUnavailable: strings.oddsUnavailable,
1589
1591
  momentumLabel: strings.momentumLabel,
@@ -10962,12 +10964,13 @@ function isPromoted(row, promotedPins) {
10962
10964
  if (!chip) return false;
10963
10965
  return promotedPins.some((pin) => pin.marketDeveloperName === chip.marketDeveloperName || chip.matchOddsId != null && pin.matchOddsId === chip.matchOddsId);
10964
10966
  }
10965
- function groupScorers(goals, ownGoalLabel) {
10967
+ function groupScorers(goals, ownGoalLabel, penaltyLabel) {
10966
10968
  const order = [];
10967
10969
  const minutesByPlayer = /* @__PURE__ */ new Map();
10968
10970
  for (const g of goals) {
10969
10971
  const name = g.player ?? "";
10970
- const minute = g.ownGoal ? `${g.minuteLabel} (${ownGoalLabel})` : g.minuteLabel;
10972
+ const marker = g.ownGoal ? ownGoalLabel : g.penalty ? penaltyLabel : null;
10973
+ const minute = marker ? `${g.minuteLabel} (${marker})` : g.minuteLabel;
10971
10974
  if (!minutesByPlayer.has(name)) {
10972
10975
  minutesByPlayer.set(name, []);
10973
10976
  order.push(name);
@@ -10983,8 +10986,8 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
10983
10986
  const { oddsFormat } = useOddsSettings();
10984
10987
  const live = match.phase === "live";
10985
10988
  const goals = match.events.filter((e) => e.type === "goal");
10986
- const homeScorers = groupScorers(goals.filter((e) => e.side === "home"), ui.ownGoalLabel);
10987
- const awayScorers = groupScorers(goals.filter((e) => e.side === "away"), ui.ownGoalLabel);
10989
+ const homeScorers = groupScorers(goals.filter((e) => e.side === "home"), ui.ownGoalLabel, ui.penaltyLabel);
10990
+ const awayScorers = groupScorers(goals.filter((e) => e.side === "away"), ui.ownGoalLabel, ui.penaltyLabel);
10988
10991
  const promotedRows = match.statRows.filter((row) => isPromoted(row, promotedPins));
10989
10992
  const otherRows = match.statRows.filter((row) => !isPromoted(row, promotedPins));
10990
10993
  const orderedRows = [...promotedRows, ...otherRows];