wineater-bot 3.0.21 → 3.1.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/dist/wineater-chatbot.mjs +1907 -1654
- package/dist/wineater-chatbot.umd.js +545 -397
- package/index.html +3 -3
- package/package.json +1 -1
- package/src/js/i18n.js +96 -0
- package/src/js/styles.js +15 -11
- package/src/js/widget-styles.js +438 -334
- package/src/js/widget.js +115 -25
package/index.html
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
<script type="module" src="./src/index.js"></script>
|
|
7
|
+
<script>window.wineaterData = {CLIENT_TOKEN: 'HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG', TYPE: 'widget', WIDGET_TYPE: 'store', WIDGET_WRAPPER: 'wineater-widget-conteiner'};</script>
|
|
8
|
+
<script type="module" src="./dist/wineater-chatbot.umd.js"></script>
|
|
9
|
+
<!-- <script type="module" src="./src/index.js"></script> -->
|
|
10
10
|
</head>
|
|
11
11
|
<body style="margin: 0;">
|
|
12
12
|
<div id="wineater-widget-conteiner"></div> <!-- Контейнер для виджета -->
|
package/package.json
CHANGED
package/src/js/i18n.js
CHANGED
|
@@ -6,6 +6,7 @@ class Translator {
|
|
|
6
6
|
this.language = 'en'; // Default to English
|
|
7
7
|
this.translations = {
|
|
8
8
|
fr: {
|
|
9
|
+
lang: 'fr',
|
|
9
10
|
welcomeMessage: "Quel plat allez-vous déguster ? Décrivez-le-moi et je vous proposerai le vin qui l'accompagnera parfaitement.",
|
|
10
11
|
noResultsFound: "Aucun résultat trouvé.",
|
|
11
12
|
somethingWentWrong: "Désolé, quelque chose a mal tourné.",
|
|
@@ -60,8 +61,16 @@ class Translator {
|
|
|
60
61
|
"Parfait avec du poisson",
|
|
61
62
|
"Recommandé pour une soirée"
|
|
62
63
|
],
|
|
64
|
+
headerLine1: "Partagez tout ce qui vous passe par la tête —",
|
|
65
|
+
headerLine2: "— et obtenez des recommandations de vin parfait en quelques secondes",
|
|
66
|
+
headerMeal: "repas",
|
|
67
|
+
headerMood: "humeur",
|
|
68
|
+
headerBudget: "budget",
|
|
69
|
+
headerOccasion: "occasion",
|
|
70
|
+
headerOr: "ou",
|
|
63
71
|
},
|
|
64
72
|
es: {
|
|
73
|
+
lang: 'es',
|
|
65
74
|
welcomeMessage: "¿Qué vas a comer? Cuéntame tu plato y te recomendaré el maridaje perfecto.",
|
|
66
75
|
noResultsFound: "No se encontraron resultados.",
|
|
67
76
|
somethingWentWrong: "Lo sentimos, algo salió mal.",
|
|
@@ -116,8 +125,16 @@ class Translator {
|
|
|
116
125
|
"Perfecto con pescado",
|
|
117
126
|
"Recomendado para una fiesta"
|
|
118
127
|
],
|
|
128
|
+
headerLine1: "Comparte cualquier cosa que tengas en mente —",
|
|
129
|
+
headerLine2: "— y obtén recomendaciones del vino perfecto en cuestión de segundos",
|
|
130
|
+
headerMeal: "comida",
|
|
131
|
+
headerMood: "estado de ánimo",
|
|
132
|
+
headerBudget: "presupuesto",
|
|
133
|
+
headerOccasion: "ocasión",
|
|
134
|
+
headerOr: "o",
|
|
119
135
|
},
|
|
120
136
|
en: {
|
|
137
|
+
lang: 'en',
|
|
121
138
|
welcomeMessage: "What are you planning to eat? Share your dish and I'll recommend the perfect wine pairing for your meal.",
|
|
122
139
|
noResultsFound: "No results found.",
|
|
123
140
|
somethingWentWrong: "Sorry, something went wrong.",
|
|
@@ -172,8 +189,16 @@ class Translator {
|
|
|
172
189
|
"Perfect with fish",
|
|
173
190
|
"Recommended for a party"
|
|
174
191
|
],
|
|
192
|
+
headerLine1: "Share anything on your mind —",
|
|
193
|
+
headerLine2: "— and get recommendations of the perfect wine in seconds",
|
|
194
|
+
headerMeal: "meal",
|
|
195
|
+
headerMood: "mood",
|
|
196
|
+
headerBudget: "budget",
|
|
197
|
+
headerOccasion: "occasion",
|
|
198
|
+
headerOr: "or",
|
|
175
199
|
},
|
|
176
200
|
de: {
|
|
201
|
+
lang: 'de',
|
|
177
202
|
welcomeMessage: "Was möchten Sie essen? Beschreiben Sie Ihr Gericht und ich empfehle Ihnen den perfekten Wein dazu.",
|
|
178
203
|
noResultsFound: "Keine Ergebnisse gefunden.",
|
|
179
204
|
somethingWentWrong: "Entschuldigung, etwas ist schief gelaufen.",
|
|
@@ -227,6 +252,77 @@ class Translator {
|
|
|
227
252
|
barSendButton: "Senden",
|
|
228
253
|
barResetButton: "Zurücksetzen",
|
|
229
254
|
barName: "Name der Bar",
|
|
255
|
+
headerLine1: "Teilen Sie alles, was Ihnen durch den Kopf geht —",
|
|
256
|
+
headerLine2: "— und erhalten Sie in Sekundenschnelle Empfehlungen für den perfekten Wein",
|
|
257
|
+
headerMeal: "Mahlzeit",
|
|
258
|
+
headerMood: "Stimmung",
|
|
259
|
+
headerBudget: "Budget",
|
|
260
|
+
headerOccasion: "Anlass",
|
|
261
|
+
headerOr: "oder",
|
|
262
|
+
},
|
|
263
|
+
ru: {
|
|
264
|
+
lang: 'ru',
|
|
265
|
+
welcomeMessage: "Что вы планируете поесть? Напишите ваше блюдо, и я подберу идеальное вино к нему.",
|
|
266
|
+
noResultsFound: "Результаты не найдены.",
|
|
267
|
+
somethingWentWrong: "Извините, что-то пошло не так.",
|
|
268
|
+
chatButton1: "Найти сочетание",
|
|
269
|
+
chatButton2: "Подобрать вино",
|
|
270
|
+
chatButton3: "Получить совет",
|
|
271
|
+
chatTitle: "Ассистент по подбору вина 🍷",
|
|
272
|
+
chatSubtitle: "Опишите ваше блюдо и получите рекомендацию за 30 секунд",
|
|
273
|
+
inputPlaceholder: "например, Тунец с салатом",
|
|
274
|
+
sendButton: "Подобрать",
|
|
275
|
+
poweredBy: "Powered by",
|
|
276
|
+
price: "Цена",
|
|
277
|
+
region: "Регион",
|
|
278
|
+
type: "Тип",
|
|
279
|
+
reason: "Рекомендация",
|
|
280
|
+
moreInfo: "Подробнее",
|
|
281
|
+
winePairingIntro: "К этому вину подходят следующие блюда:",
|
|
282
|
+
askForDinner: "Что бы вы хотели на ужин?",
|
|
283
|
+
clearChatButton: "Очистить чат",
|
|
284
|
+
widgetTitle: "НАЙДИТЕ ИДЕАЛЬНОЕ ВИНО",
|
|
285
|
+
widgetSubtitle: "Поделитесь вашими предпочтениями — блюдом, настроением, бюджетом или случаем — и наш AI-сомелье подберёт идеальное вино за секунды",
|
|
286
|
+
searchPlaceholder: "Введите ключевое слово или описание",
|
|
287
|
+
wineDetails: {
|
|
288
|
+
price: "Цена",
|
|
289
|
+
region: "Регион",
|
|
290
|
+
type: "Тип",
|
|
291
|
+
moreInfo: "Подробнее",
|
|
292
|
+
reason: "Причина",
|
|
293
|
+
sommSelection: "Выбор сомелье",
|
|
294
|
+
code: "Код"
|
|
295
|
+
},
|
|
296
|
+
searchButton: "Поиск",
|
|
297
|
+
priceRange: "Диапазон цен",
|
|
298
|
+
wineColor: "Цвет вина",
|
|
299
|
+
intensity: "Интенсивность",
|
|
300
|
+
red: "Красное",
|
|
301
|
+
white: "Белое",
|
|
302
|
+
rose: "Розовое",
|
|
303
|
+
light: "Лёгкое",
|
|
304
|
+
medium: "Среднее",
|
|
305
|
+
full: "Полное",
|
|
306
|
+
|
|
307
|
+
/* -- Новые ключи для бара -- */
|
|
308
|
+
barTitle: "Закуски к вину",
|
|
309
|
+
barSubtitle: "Выберите блюда ниже и нажмите ‘Отправить’",
|
|
310
|
+
barSendButton: "Отправить",
|
|
311
|
+
barResetButton: "Сбросить",
|
|
312
|
+
barName: "Название бара",
|
|
313
|
+
barNotesPlaceholder: "Добавьте ваши пожелания здесь...",
|
|
314
|
+
placeholderSuggestions: [
|
|
315
|
+
"Вино для пасты",
|
|
316
|
+
"Идеально к рыбе",
|
|
317
|
+
"Рекомендуем для вечеринки"
|
|
318
|
+
],
|
|
319
|
+
headerLine1: "Поделитесь любыми вашими мыслями —",
|
|
320
|
+
headerLine2: "— и получите рекомендации по идеальному вину за считанные секунды",
|
|
321
|
+
headerMeal: "блюдо",
|
|
322
|
+
headerMood: "настроение",
|
|
323
|
+
headerBudget: "бюджет",
|
|
324
|
+
headerOccasion: "случай",
|
|
325
|
+
headerOr: "или",
|
|
230
326
|
}
|
|
231
327
|
};
|
|
232
328
|
}
|
package/src/js/styles.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
const css = `
|
|
2
|
+
:root {
|
|
3
|
+
--wineater-corp-color: #0044FF;
|
|
4
|
+
--wineater-color: #7B2BEB;
|
|
5
|
+
}
|
|
2
6
|
@font-face {
|
|
3
7
|
font-family: 'Poppins';
|
|
4
8
|
src: url('https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap');
|
|
@@ -21,7 +25,7 @@ const css = `
|
|
|
21
25
|
justify-content: center;
|
|
22
26
|
padding: 10px 20px;
|
|
23
27
|
border-radius: 25px;
|
|
24
|
-
background: linear-gradient(90deg,
|
|
28
|
+
background: linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color)); /* Фиолетовый к синему */
|
|
25
29
|
cursor: pointer;
|
|
26
30
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Тень */
|
|
27
31
|
color: white; /* Белый текст */
|
|
@@ -95,7 +99,7 @@ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
|
95
99
|
display: none;
|
|
96
100
|
overflow: hidden;
|
|
97
101
|
background: linear-gradient(white, white) padding-box,
|
|
98
|
-
linear-gradient(90deg,
|
|
102
|
+
linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color)) border-box;
|
|
99
103
|
|
|
100
104
|
}
|
|
101
105
|
|
|
@@ -194,7 +198,7 @@ linear-gradient(90deg, #7B2BEB, #0044FF) border-box;
|
|
|
194
198
|
transition: all 0.2s ease;
|
|
195
199
|
background:
|
|
196
200
|
linear-gradient(white, white) padding-box,
|
|
197
|
-
linear-gradient(90deg,
|
|
201
|
+
linear-gradient(90deg, var(--wineater-corp-color), var(--wineater-color)) border-box;
|
|
198
202
|
}
|
|
199
203
|
|
|
200
204
|
#user-input:focus {
|
|
@@ -204,7 +208,7 @@ linear-gradient(90deg, #7B2BEB, #0044FF) border-box;
|
|
|
204
208
|
|
|
205
209
|
/* Кнопка отправки */
|
|
206
210
|
#send-button {
|
|
207
|
-
background: linear-gradient(90deg,
|
|
211
|
+
background: linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color));
|
|
208
212
|
color: white;
|
|
209
213
|
border: none;
|
|
210
214
|
padding: 12px 24px;
|
|
@@ -283,7 +287,7 @@ linear-gradient(90deg, #7B2BEB, #0044FF) border-box;
|
|
|
283
287
|
|
|
284
288
|
/* Стили для сообщений API (бота) */
|
|
285
289
|
.message.api {
|
|
286
|
-
background: linear-gradient(90deg,
|
|
290
|
+
background: linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color));
|
|
287
291
|
color: white;
|
|
288
292
|
border-top-left-radius: 4px;
|
|
289
293
|
margin-right: auto;
|
|
@@ -325,7 +329,7 @@ border-top-left-radius: 4px;
|
|
|
325
329
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
|
326
330
|
background:
|
|
327
331
|
linear-gradient(white, white) padding-box,
|
|
328
|
-
linear-gradient(90deg,
|
|
332
|
+
linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color)) border-box;
|
|
329
333
|
}
|
|
330
334
|
|
|
331
335
|
.wine-item {
|
|
@@ -353,7 +357,7 @@ border-top-left-radius: 4px;
|
|
|
353
357
|
}
|
|
354
358
|
|
|
355
359
|
.wine-item-price {
|
|
356
|
-
color:
|
|
360
|
+
color: var(--wineater-color);
|
|
357
361
|
font-weight: 500;
|
|
358
362
|
margin-bottom: 4px;
|
|
359
363
|
}
|
|
@@ -365,7 +369,7 @@ border-top-left-radius: 4px;
|
|
|
365
369
|
}
|
|
366
370
|
|
|
367
371
|
.wine-item a {
|
|
368
|
-
color:
|
|
372
|
+
color: var(--wineater-corp-color); /* Синий цвет ссылки */
|
|
369
373
|
text-decoration: underline; /* Подчеркивание для эффекта ссылки */
|
|
370
374
|
font-size: 14px; /* Размер текста */
|
|
371
375
|
font-weight: 500; /* Полужирный текст */
|
|
@@ -388,7 +392,7 @@ border-bottom-right-radius: 15px;
|
|
|
388
392
|
|
|
389
393
|
font-size: 14px;
|
|
390
394
|
line-height: 1.5;
|
|
391
|
-
background: linear-gradient(90deg,
|
|
395
|
+
background: linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color));
|
|
392
396
|
box-shadow: 0 2px 8px rgba(123, 43, 235, 0.15);
|
|
393
397
|
}
|
|
394
398
|
|
|
@@ -403,7 +407,7 @@ border-bottom-right-radius: 15px;
|
|
|
403
407
|
width: 40px;
|
|
404
408
|
height: 40px;
|
|
405
409
|
margin: 20px auto;
|
|
406
|
-
background: conic-gradient(from 0deg,
|
|
410
|
+
background: conic-gradient(from 0deg, var(--wineater-color), var(--wineater-corp-color), var(--wineater-color));
|
|
407
411
|
border-radius: 50%;
|
|
408
412
|
animation: spin 1s linear infinite;
|
|
409
413
|
position: relative;
|
|
@@ -449,7 +453,7 @@ visibility: visible;
|
|
|
449
453
|
height: 8px;
|
|
450
454
|
margin: 0 3px;
|
|
451
455
|
border-radius: 50%;
|
|
452
|
-
background: linear-gradient(90deg,
|
|
456
|
+
background: linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color));
|
|
453
457
|
opacity: 0.7;
|
|
454
458
|
animation: typing 1s infinite;
|
|
455
459
|
}
|