wineater-bot 3.0.20 → 3.0.22
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 +116 -115
- package/dist/wineater-chatbot.umd.js +17 -17
- package/index.html +1 -1
- package/package.json +1 -1
- package/src/js/widget.js +9 -5
package/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Chatbot</title>
|
|
7
7
|
<!-- <script type="module" src="./dist/wineater-chatbot.umd.js"></script> -->
|
|
8
|
-
<script>window.wineaterData = {CLIENT_TOKEN: '
|
|
8
|
+
<script>window.wineaterData = {CLIENT_TOKEN: 'BrB2YDr8ksFKXP3RXSW4YubF0MEVJryO8EfRiQBIZoVOyUZZSsm9xdh2tkLlOJM3', position: 'right-center', TYPE: 'widget', WIDGET_TYPE: 'bar'};</script>
|
|
9
9
|
<script type="module" src="./src/index.js"></script>
|
|
10
10
|
</head>
|
|
11
11
|
<body style="margin: 0;">
|
package/package.json
CHANGED
package/src/js/widget.js
CHANGED
|
@@ -209,15 +209,19 @@ export class WineWidget {
|
|
|
209
209
|
resultsContainer.innerHTML = '';
|
|
210
210
|
|
|
211
211
|
wines.forEach((wine, index) => {
|
|
212
|
+
if ((index === wines.length - 1) && this.widgetType === 'store') {
|
|
213
|
+
wine['isSommSelection'] = true;
|
|
214
|
+
}
|
|
215
|
+
console.log(wine)
|
|
212
216
|
const wineHTML = `
|
|
213
217
|
<div class="wine-recommendation-tile ${wine.isSommSelection ? 'somm-selection' : ''}">
|
|
214
218
|
${wine.isSommSelection ? `<div class="somm-selection-badge">${translator.translate('wineDetails.sommSelection')}</div>` : ''}
|
|
215
|
-
${!!wine.image ? `<img src="${wine.image}" alt="${wine.title}" />` : '' }
|
|
219
|
+
${(!!wine.image || !!wine.Image) ? `<img src="${wine.image || wine.Image}" alt="${wine.title || wine.Title}" />` : '' }
|
|
216
220
|
<div class="tile-details">
|
|
217
|
-
<strong>${wine.title}</strong>
|
|
218
|
-
<p>${translator.translate('wineDetails.price')}: ${wine.price ||
|
|
219
|
-
<p>${translator.translate('wineDetails.region')}: ${wine.region ||
|
|
220
|
-
<p>${translator.translate('wineDetails.type')}: ${wine.type ||
|
|
221
|
+
<strong>${wine.title || wine.Title}</strong>
|
|
222
|
+
<p>${translator.translate('wineDetails.price')}: ${wine.price || wine.Price}</p>
|
|
223
|
+
<p>${translator.translate('wineDetails.region')}: ${wine.region || wine.Region}</p>
|
|
224
|
+
<p>${translator.translate('wineDetails.type')}: ${wine.type || wine.Type}</p>
|
|
221
225
|
${this.widgetType === 'bar' ? `<p>${translator.translate('wineDetails.reason')}: ${wine.pairing_recommendation || 'N/A'}</p>` : ''}
|
|
222
226
|
${this.widgetType === 'bar'
|
|
223
227
|
? `<p>${translator.translate('wineDetails.code')}: ${wine.url || 'N/A'}</p>`
|