@sensiblestats/widget-react 0.75.0 → 0.76.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 +6 -0
- package/dist/index.cjs +18 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.76.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- The greeting bubble offers "3 picks, max 1.50" and "Standout matches today" ("Bugünün öne çıkan maçları") instead of the two price asks; a combo is never offered in the bubble. A tap on an ask shows the ask's own label as the user's message.
|
|
8
|
+
|
|
3
9
|
## 0.75.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -192,7 +192,8 @@ var STRINGS = {
|
|
|
192
192
|
marketRow: "{market} picks today",
|
|
193
193
|
marketName: "Market",
|
|
194
194
|
marketShort: (dev, market, sel) => ({ BOTH_TEAMS_TO_SCORE: "BTTS", DOUBLE_CHANCE: "Double chance", FULLTIME_RESULT: "Match winner" })[dev] ?? (dev === "GOALS_OVER_UNDER" && sel ? sel : sel ? `${market} ${sel}` : market),
|
|
195
|
-
marketMessage: (market, sel, count) => `Show me ${count} ${sel ? `${market} \u2013 ${sel}` : market} picks
|
|
195
|
+
marketMessage: (market, sel, count) => `Show me ${count} ${sel ? `${market} \u2013 ${sel}` : market} picks.`,
|
|
196
|
+
standoutAsk: "Standout matches today"
|
|
196
197
|
},
|
|
197
198
|
games: {
|
|
198
199
|
lang: "en",
|
|
@@ -531,7 +532,8 @@ var STRINGS = {
|
|
|
531
532
|
marketRow: "Bug\xFCnk\xFC {market} se\xE7imleri",
|
|
532
533
|
marketName: "Bahis t\xFCr\xFC",
|
|
533
534
|
marketShort: (dev, market, sel) => ({ BOTH_TEAMS_TO_SCORE: "KG Var", DOUBLE_CHANCE: "\xC7ifte \u015Fans", FULLTIME_RESULT: "Ma\xE7 sonucu" })[dev] ?? (dev === "GOALS_OVER_UNDER" && sel ? sel : sel ? `${market} ${sel}` : market),
|
|
534
|
-
marketMessage: (market, sel, count) => `${count} ${sel ? `${market} \u2013 ${sel}` : market} se\xE7imi g\xF6ster
|
|
535
|
+
marketMessage: (market, sel, count) => `${count} ${sel ? `${market} \u2013 ${sel}` : market} se\xE7imi g\xF6ster.`,
|
|
536
|
+
standoutAsk: "Bug\xFCn\xFCn \xF6ne \xE7\u0131kan ma\xE7lar\u0131"
|
|
535
537
|
},
|
|
536
538
|
games: {
|
|
537
539
|
lang: "tr",
|
|
@@ -1992,18 +1994,23 @@ function tileDisplayText(tile) {
|
|
|
1992
1994
|
const subtitle = tile.subtitle?.trim();
|
|
1993
1995
|
return isPriceTile(tile) && subtitle ? subtitle : tile.title;
|
|
1994
1996
|
}
|
|
1995
|
-
var
|
|
1996
|
-
|
|
1997
|
+
var MAX_PRICE_TILE_ID = "goal-preset-max-price";
|
|
1998
|
+
var STANDOUT_TILE_ID = "goal-standout-matches";
|
|
1999
|
+
function bubbleAsks(messages, standoutLabel) {
|
|
1997
2000
|
for (let i = messages.length - 1; i >= 0; i--) {
|
|
1998
2001
|
const m = messages[i];
|
|
1999
2002
|
if (!m || m.role !== "assistant" || !m.isGreeting) continue;
|
|
2000
2003
|
const dashboard = m.greetingDashboard;
|
|
2001
|
-
if (!dashboard) return [];
|
|
2004
|
+
if (!dashboard || !dashboard.tiles.some(isPriceTile)) return [];
|
|
2002
2005
|
const asks = [];
|
|
2003
|
-
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2006
|
-
|
|
2006
|
+
const add = (entityId, labelOf) => {
|
|
2007
|
+
const index = dashboard.tiles.findIndex((tile2) => tile2.signal?.entityId === entityId);
|
|
2008
|
+
const tile = dashboard.tiles[index];
|
|
2009
|
+
const label = tile ? labelOf(tile)?.trim() : void 0;
|
|
2010
|
+
if (tile && label) asks.push({ tile, index, position: asks.length, layout: dashboard.layout, label });
|
|
2011
|
+
};
|
|
2012
|
+
add(MAX_PRICE_TILE_ID, (tile) => tile.subtitle ?? void 0);
|
|
2013
|
+
add(STANDOUT_TILE_ID, () => standoutLabel);
|
|
2007
2014
|
return asks;
|
|
2008
2015
|
}
|
|
2009
2016
|
return [];
|
|
@@ -2012,7 +2019,7 @@ function runBubbleAsk(ask, deps) {
|
|
|
2012
2019
|
deps.log?.log({ name: "popup_ask_tap", outcome: String(ask.position) });
|
|
2013
2020
|
deps.open();
|
|
2014
2021
|
deps.setActiveTab("chat");
|
|
2015
|
-
const displayText =
|
|
2022
|
+
const displayText = ask.label;
|
|
2016
2023
|
deps.send(ask.tile.actionValue, ask.tile.actionRef ? { actionRef: ask.tile.actionRef, displayText } : { displayText });
|
|
2017
2024
|
deps.onDashboardTap?.(ask.tile, ask.index, ask.layout);
|
|
2018
2025
|
}
|
|
@@ -11168,7 +11175,7 @@ function StatsWidget(props) {
|
|
|
11168
11175
|
[built, logger]
|
|
11169
11176
|
);
|
|
11170
11177
|
const dismissPopup = usePopupTelemetry(logger, controller.state.isOpen, controller.state.popupText, controller.dismissPopup);
|
|
11171
|
-
const asks = bubbleAsks(controller.state.messages).map((ask) => ({
|
|
11178
|
+
const asks = bubbleAsks(controller.state.messages, ui.presets.standoutAsk).map((ask) => ({
|
|
11172
11179
|
label: ask.label,
|
|
11173
11180
|
onTap: () => runBubbleAsk(ask, {
|
|
11174
11181
|
open: controller.open,
|