wineater-bot 4.9.7 → 4.9.8
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/wineater-chatbot.mjs +2032 -2019
- package/dist/wineater-chatbot.umd.js +22 -22
- package/package.json +1 -1
- package/src/App.svelte +10 -0
- package/src/components/WineTile.svelte +3 -0
- package/src/components/ui/Action.svelte +1 -1
package/package.json
CHANGED
package/src/App.svelte
CHANGED
|
@@ -200,6 +200,15 @@
|
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
function handleBuyLinkClick(wine: Wine | RecommendedWine, index: number) {
|
|
204
|
+
trackWidgetEvent(WIDGET_EVENTS.BUY_BUTTON_CLICKED, storeId, {
|
|
205
|
+
wine_id: wine.id,
|
|
206
|
+
wine_title: wine.title,
|
|
207
|
+
wine_url: wine.url,
|
|
208
|
+
is_mobile: window.innerWidth <= 768
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
203
212
|
function closePopup() {
|
|
204
213
|
const wine = results.find((w) => w.id === selectedWineId);
|
|
205
214
|
trackWidgetEvent(WIDGET_EVENTS.WINE_DETAILS_CLOSED, storeId, {
|
|
@@ -314,6 +323,7 @@
|
|
|
314
323
|
{isAnimating}
|
|
315
324
|
translatedPopup={translatedPopups[index]}
|
|
316
325
|
onBuyClick={handleBuyBtnClick}
|
|
326
|
+
onBuyLinkClick={handleBuyLinkClick}
|
|
317
327
|
onPopupClose={closePopup}
|
|
318
328
|
{onTileEnter}
|
|
319
329
|
{onTileLeave}
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
onTileLeave,
|
|
18
18
|
onTileClick,
|
|
19
19
|
onBuyClick,
|
|
20
|
+
onBuyLinkClick,
|
|
20
21
|
onPopupClose,
|
|
21
22
|
isAnimating,
|
|
22
23
|
translatedPopup
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
onTileLeave: (wine: Wine | RecommendedWine) => void;
|
|
30
31
|
onTileClick: (event: MouseEvent, wine: Wine | RecommendedWine) => void;
|
|
31
32
|
onBuyClick: (wine: Wine | RecommendedWine, index: number) => void;
|
|
33
|
+
onBuyLinkClick: (wine: Wine | RecommendedWine, index: number) => void;
|
|
32
34
|
onPopupClose: () => void;
|
|
33
35
|
isAnimating: boolean;
|
|
34
36
|
translatedPopup: Partial<RecommendedWine> | null;
|
|
@@ -114,6 +116,7 @@
|
|
|
114
116
|
{#if wine.url}
|
|
115
117
|
<Action
|
|
116
118
|
href={wine.url}
|
|
119
|
+
handleClick={() => onBuyLinkClick(wine, index)}
|
|
117
120
|
className="wr-WineTile-action wr-WineTile-action--link js-WineTileAction"
|
|
118
121
|
target="_blank"
|
|
119
122
|
variant="outlined"
|