wineater-bot 3.4.3 → 3.4.4
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 +970 -967
- package/dist/wineater-chatbot.umd.js +37 -37
- package/index.html +1 -1
- package/package.json +1 -1
- package/src/js/widget.js +9 -1
package/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Chatbot</title>
|
|
7
|
-
<script>window.wineaterData = {CLIENT_TOKEN: '
|
|
7
|
+
<script>window.wineaterData = {CLIENT_TOKEN: 'OjvAprylAugk5pKTHRIzZxcPPb6HMPr9qHhrazG0sF3uHjkrvBzufPZ65igfRJJa', TYPE: 'widget', WIDGET_TYPE: 'bar', WIDGET_WRAPPER: 'wineater-widget-conteiner'};</script>
|
|
8
8
|
<!-- <script type="module" src="./dist/wineater-chatbot.umd.js"></script> -->
|
|
9
9
|
<script type="module" src="./src/index.js"></script>
|
|
10
10
|
</head>
|
package/package.json
CHANGED
package/src/js/widget.js
CHANGED
|
@@ -228,6 +228,14 @@ export class WineWidget {
|
|
|
228
228
|
${tags ? `<div class="popup-tags">${createTagHTML(tags)}</div>` : ''}
|
|
229
229
|
</div>`;
|
|
230
230
|
};
|
|
231
|
+
|
|
232
|
+
function formatPrice(price) {
|
|
233
|
+
if (typeof price !== 'number') {
|
|
234
|
+
price = Number(price);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return price.toLocaleString('en-US'); // e.g., 1000 -> "1,000"
|
|
238
|
+
}
|
|
231
239
|
|
|
232
240
|
wines.forEach((wine, index) => {
|
|
233
241
|
const title = getValue(wine, 'title');
|
|
@@ -248,7 +256,7 @@ export class WineWidget {
|
|
|
248
256
|
|
|
249
257
|
<div class="tile-top">
|
|
250
258
|
${image ? `<img src="${image}" alt="${title}" class="wine-image" />` : ''}
|
|
251
|
-
<div class="wine-price">${price} ${translator.getCurrency('label')}</div>
|
|
259
|
+
<div class="wine-price">${formatPrice(price)} ${translator.getCurrency('label')}</div>
|
|
252
260
|
<h3 class="wine-title">${title}</h3>
|
|
253
261
|
</div>
|
|
254
262
|
|