wineater-bot 3.1.7 → 3.1.9

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/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: 'MiRfsL8z0DBrQ70lHTZqGvveYYZwbC2lyteMShxwHEvhOPBjYWZHy7zsRbfcUqzf', TYPE: 'widget', WIDGET_TYPE: 'store', WIDGET_WRAPPER: 'wineater-widget-conteiner'};</script>
7
+ <script>window.wineaterData = {CLIENT_TOKEN: 'MiRfsL8z0DBrQ70lHTZqGvveYYZwbC2lyteMShxwHEvhOPBjYWZHy7zsRbfcUqzf', TYPE: 'widget', WIDGET_TYPE: 'store', WIDGET_WRAPPER: 'wineater-widget-conteiner', TITLE_TEXT: 'ghbdtn'};</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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wineater-bot",
3
- "version": "3.1.7",
3
+ "version": "3.1.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "src/index.js",
@@ -37,11 +37,11 @@ body {
37
37
  box-sizing: border-box;
38
38
  }
39
39
 
40
- .wine-widget-wrapper {
40
+ #wine-widget-container .wine-widget-wrapper {
41
41
  width: 100%;
42
42
  }
43
43
 
44
- #wine-widget-right {
44
+ #wine-widget-container #wine-widget-right {
45
45
  position: relative;
46
46
  min-height: 300px;
47
47
  }
@@ -85,7 +85,7 @@ body {
85
85
  }
86
86
 
87
87
  /* ===================== 5) Иконки и цветные подписи (meal, mood...) ===================== */
88
- .icon {
88
+ #wine-widget-container .icon {
89
89
  display: inline-block;
90
90
  width: 1.2em;
91
91
  height: 1.2em;
@@ -95,37 +95,37 @@ body {
95
95
  background-size: contain;
96
96
  }
97
97
 
98
- .icon-meal {
98
+ #wine-widget-container .icon-meal {
99
99
  background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//meal1.svg');
100
100
  }
101
- .icon-meal:hover {
101
+ #wine-widget-container .icon-meal:hover {
102
102
  background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//meal3.svg');
103
103
  }
104
- .icon-mood {
104
+ #wine-widget-container .icon-mood {
105
105
  background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//mood.svg');
106
106
  }
107
- .icon-budget {
107
+ #wine-widget-container .icon-budget {
108
108
  background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//budget.svg');
109
109
  }
110
- .icon-occasion {
110
+ #wine-widget-container .icon-occasion {
111
111
  background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//ocasion.svg');
112
112
  }
113
113
 
114
114
  /* Подпись к иконкам */
115
- .icon-label {
115
+ #wine-widget-container .icon-label {
116
116
  color: var(--wineater-color);
117
117
  font-weight: 500;
118
118
  }
119
119
 
120
120
  /* ===================== 6) Поисковая строка (input + кнопка) ===================== */
121
- #wine-widget-search {
121
+ #wine-widget-container #wine-widget-search {
122
122
  position: relative;
123
123
  margin: 20px auto;
124
124
  display: flex;
125
125
  justify-content: center;
126
126
  }
127
127
 
128
- .search-icon {
128
+ #wine-widget-container .search-icon {
129
129
  position: absolute;
130
130
  left: 12px;
131
131
  top: 50%;
@@ -138,7 +138,7 @@ body {
138
138
  z-index: 2;
139
139
  }
140
140
 
141
- #wine-search-input {
141
+ #wine-widget-container #wine-search-input {
142
142
  width: 100%;
143
143
  padding: 12px 60px 12px 40px; /* место под иконку и кнопку */
144
144
  font-size: 16px;
@@ -182,25 +182,25 @@ body {
182
182
  }
183
183
 
184
184
  /* ===================== 7) Фильтр-группы ===================== */
185
- .filter-group {
185
+ #wine-widget-container .filter-group {
186
186
  margin-bottom: 16px;
187
187
  display: flex;
188
188
  flex-direction: column;
189
189
  }
190
190
 
191
- .filter-label {
191
+ #wine-widget-container .filter-label {
192
192
  font-size: 16px;
193
193
  font-weight: bold;
194
194
  color: #333;
195
195
  margin-bottom: 8px;
196
196
  }
197
197
 
198
- .filter-buttons {
198
+ #wine-widget-container .filter-buttons {
199
199
  display: flex;
200
200
  gap: 8px;
201
201
  }
202
202
 
203
- .filter-buttons button {
203
+ #wine-widget-container .filter-buttons button {
204
204
  padding: 10px 16px;
205
205
  border: 1px solid #ccc;
206
206
  border-radius: 8px;
@@ -209,18 +209,18 @@ body {
209
209
  font-size: 14px;
210
210
  transition: all 0.2s ease;
211
211
  }
212
- .filter-buttons button:hover {
212
+ #wine-widget-container .filter-buttons button:hover {
213
213
  transform: scale(1.05);
214
214
  box-shadow: 0 4px 8px rgba(123, 43, 235, 0.15);
215
215
  }
216
- .filter-buttons button.selected {
216
+ #wine-widget-container .filter-buttons button.selected {
217
217
  background: linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color));
218
218
  color: white;
219
219
  border: none;
220
220
  }
221
221
 
222
222
  /* ===================== 8) Карточки рекомендаций (tiles) ===================== */
223
- .wine-recommendation-tile {
223
+ #wine-widget-container .wine-recommendation-tile {
224
224
  display: flex;
225
225
  flex-direction: column;
226
226
  align-items: center; /* всё по центру */
@@ -232,11 +232,11 @@ body {
232
232
  transform: translateY(20px); /* чтобы анимация была заметна */
233
233
  transition: opacity 0.3s ease, transform 0.3s ease;
234
234
  }
235
- .wine-recommendation-tile:last-child {
235
+ #wine-widget-container .wine-recommendation-tile:last-child {
236
236
  border-right: none;
237
237
  }
238
238
 
239
- .tile-top {
239
+ #wine-widget-container .tile-top {
240
240
  display: flex;
241
241
  flex-direction: column;
242
242
  align-items: center;
@@ -246,7 +246,7 @@ body {
246
246
 
247
247
 
248
248
  /* Картинка */
249
- .wine-image {
249
+ #wine-widget-container .wine-image {
250
250
  width: 180px; /* или 200px, на ваш вкус */
251
251
  height: auto;
252
252
  object-fit: contain; /* чтобы не обрезалось, если нужно */
@@ -255,7 +255,7 @@ body {
255
255
  }
256
256
 
257
257
  /* Детальный блок */
258
- .tile-details {
258
+ #wine-widget-container .tile-details {
259
259
  /* Можно дополнительные отступы или нет */
260
260
  display: flex;
261
261
  flex-direction: column;
@@ -264,7 +264,7 @@ body {
264
264
  }
265
265
 
266
266
  /* Заголовок вина */
267
- .wine-title {
267
+ #wine-widget-container .wine-title {
268
268
  font-size: 20px; /* крупнее */
269
269
  font-weight: 700;
270
270
  margin: 0 0 8px;
@@ -274,14 +274,14 @@ body {
274
274
  color: #000;
275
275
  }
276
276
 
277
- .wine-params {
277
+ #wine-widget-container .wine-params {
278
278
  font-size: 14px;
279
279
  color: #666;
280
280
  white-space: normal;
281
281
  text-align: center;
282
282
  }
283
283
 
284
- .param-chips-container {
284
+ #wine-widget-container .param-chips-container {
285
285
  display: flex;
286
286
  flex-wrap: wrap; /* чтобы чипсы переносились на новую строку при нехватке места */
287
287
  gap: 8px; /* небольшой промежуток между чипсами */
@@ -289,7 +289,7 @@ body {
289
289
  margin-bottom: 12px; /* отступ от нижнего блока */
290
290
  }
291
291
 
292
- .wine-chip {
292
+ #wine-widget-container .wine-chip {
293
293
  display: inline-block;
294
294
  background: #fff; /* белый фон */
295
295
  font-size: 14px;
@@ -307,7 +307,7 @@ body {
307
307
 
308
308
 
309
309
 
310
- .param-table {
310
+ #wine-widget-container .param-table {
311
311
  display: grid;
312
312
  /* Две колонки, каждая 50% */
313
313
  grid-template-columns: 50% 50%;
@@ -322,7 +322,7 @@ body {
322
322
  }
323
323
 
324
324
  /* Каждая ячейка */
325
- .param-table .cell {
325
+ #wine-widget-container .param-table .cell {
326
326
  padding: 8px;
327
327
  /* Горизонтальная линия */
328
328
  box-sizing: border-box;
@@ -332,17 +332,17 @@ body {
332
332
 
333
333
  /* Вертикальная граница между левым и правым столбцом —
334
334
  т.е. у всех ячеек, идущих в левой колонке */
335
- .param-table .cell:nth-child(2n+1) {
335
+ #wine-widget-container .param-table .cell:nth-child(2n+1) {
336
336
  border-right: 1px solid #ddd;
337
337
  }
338
338
 
339
- .param-table .cell:nth-last-child(-n + 2) {
339
+ #wine-widget-container .param-table .cell:nth-last-child(-n + 2) {
340
340
  border-bottom: none;
341
341
  }
342
342
 
343
343
 
344
344
  /* Нижняя строка (цена + кнопка) */
345
- .bottom-row {
345
+ #wine-widget-container .bottom-row {
346
346
  margin-top: auto; /* прижимает .bottom-row к низу
347
347
  display: flex;
348
348
  align-items: center;
@@ -353,14 +353,14 @@ margin-top: auto; /* прижимает .bottom-row к низу
353
353
  }
354
354
 
355
355
  /* Цена */
356
- .wine-price {
356
+ #wine-widget-container .wine-price {
357
357
  font-size: 16px;
358
358
  font-weight: 400;
359
359
  margin-bottom: 8px;
360
360
  color: #333;
361
361
  }
362
362
 
363
- .buy-btn {
363
+ #wine-widget-container .buy-btn {
364
364
  margin: 16px auto 0; /* центрируем и отступ сверху */
365
365
  background-color: transparent;
366
366
  color: var(--wineater-color);
@@ -375,14 +375,14 @@ margin-top: auto; /* прижимает .bottom-row к низу
375
375
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
376
376
  }
377
377
 
378
- .buy-btn:hover {
378
+ #wine-widget-container .buy-btn:hover {
379
379
  box-shadow: 0 4px 8px rgba(123, 43, 235, 0.25);
380
380
  background-color: var(--wineater-color);
381
381
  color: #fff;
382
382
  }
383
383
 
384
384
  /* Аналогично для .more-info-btn (если хотите стилизовать её тоже как кнопку) */
385
- .more-info-btn {
385
+ #wine-widget-container .more-info-btn {
386
386
  display: inline-block;
387
387
  background-color: var(--wineater-color);
388
388
  color: #fff;
@@ -395,20 +395,20 @@ margin-top: auto; /* прижимает .bottom-row к низу
395
395
  margin-right: 8px;
396
396
  transition: transform 0.2s, box-shadow 0.2s;
397
397
  }
398
- .more-info-btn:hover {
398
+ #wine-widget-container .more-info-btn:hover {
399
399
  transform: scale(1.05);
400
400
  box-shadow: 0 4px 8px rgba(123, 43, 235, 0.25);
401
401
  }
402
402
 
403
403
 
404
404
  /* ===================== 9) Стиль для Somm Selection ===================== */
405
- .somm-selection {
405
+ #wine-widget-container .somm-selection {
406
406
  position: relative;
407
407
  // border: 2px solid #FFD700;
408
408
  // background: linear-gradient(white, #FFF8DC);
409
409
  // box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
410
410
  }
411
- .somm-selection-badge {
411
+ #wine-widget-container .somm-selection-badge {
412
412
  position: absolute;
413
413
  top: -10px;
414
414
  left: 10px;
@@ -449,7 +449,7 @@ margin-top: auto; /* прижимает .bottom-row к низу
449
449
 
450
450
  /* ===================== 12) Бар-версия (при необходимости) ===================== */
451
451
  /* Грид блюд бара */
452
- .dish-grid {
452
+ #wine-widget-container .dish-grid {
453
453
  display: grid;
454
454
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
455
455
  gap: 12px;
@@ -457,7 +457,7 @@ margin-top: auto; /* прижимает .bottom-row к низу
457
457
  }
458
458
 
459
459
  /* Плитка блюда */
460
- .dish-tile {
460
+ #wine-widget-container .dish-tile {
461
461
  display: flex;
462
462
  justify-content: center;
463
463
  align-items: center;
@@ -470,11 +470,11 @@ margin-top: auto; /* прижимает .bottom-row к низу
470
470
  cursor: pointer;
471
471
  transition: all 0.2s ease;
472
472
  }
473
- .dish-tile:hover {
473
+ #wine-widget-container .dish-tile:hover {
474
474
  transform: scale(1.05);
475
475
  box-shadow: 0 4px 8px rgba(123, 43, 235, 0.15);
476
476
  }
477
- .dish-tile.selected {
477
+ #wine-widget-container .dish-tile.selected {
478
478
  background: linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color));
479
479
  color: #fff;
480
480
  }
@@ -554,6 +554,9 @@ margin-top: auto; /* прижимает .bottom-row к низу
554
554
  padding: 16px;
555
555
  min-width: 100vw;
556
556
  }
557
+ #wine-widget-header h1 {
558
+ display: none;
559
+ }
557
560
  #wine-placeholder {
558
561
  display: flex;
559
562
  gap: 8px;
@@ -566,13 +569,13 @@ margin-top: auto; /* прижимает .bottom-row к низу
566
569
  #wine-widget-header p {
567
570
  display: none; /* скрываем подзаголовок на мобильных, если не нужен */
568
571
  }
569
- .wine-recommendation-tile {
572
+ #wine-widget-container .wine-recommendation-tile {
570
573
  flex: 0 0 auto;
571
574
  scroll-snap-align: center;
572
575
  width: 240px;
573
576
  text-align: center;
574
577
  }
575
- .tile-details {
578
+ #wine-widget-container .tile-details {
576
579
  text-align: center;
577
580
  }
578
581
  }
package/src/js/widget.js CHANGED
@@ -12,6 +12,7 @@ export class WineWidget {
12
12
  this.titleText = window?.wineaterData?.TITLE_TEXT;
13
13
  this.subtitleText = window?.wineaterData?.SUBTITLE_TEXT;
14
14
  this.api = new Api();
15
+ console.log(this.titleText);
15
16
 
16
17
  // Фильтры для store
17
18
  this.selectedFilters = {
@@ -39,14 +40,8 @@ export class WineWidget {
39
40
  }
40
41
  }
41
42
 
42
- initializeWidget() {
43
- const widgetContainer = document.getElementById(this.widgetWrapper);
44
- if (this.widgetType === 'store') {
45
- const widgetHTML = `
46
- <div id="wine-widget-container">
47
- <div class="wine-widget-wrapper">
48
- <div id="wine-widget-header">
49
- <h1 class="wine-widget-big-title">
43
+ getTitle(title) {
44
+ return !!title ? `<h1 class="wine-widget-big-title">${title}</h1>` :`<h1 class="wine-widget-big-title">
50
45
  ${translator.translate('headerLine1')}
51
46
  <span class="icon icon-meal"></span>
52
47
  <span class="icon-label">${translator.translate('headerMeal')}</span>,
@@ -59,7 +54,17 @@ export class WineWidget {
59
54
  <span class="icon icon-occasion"></span>
60
55
  <span class="icon-label">${translator.translate('headerOccasion')}</span>
61
56
  ${translator.translate('headerLine2')}
62
- </h1>
57
+ </h1>`
58
+ }
59
+
60
+ initializeWidget() {
61
+ const widgetContainer = document.getElementById(this.widgetWrapper);
62
+ if (this.widgetType === 'store') {
63
+ const widgetHTML = `
64
+ <div id="wine-widget-container">
65
+ <div class="wine-widget-wrapper">
66
+ <div id="wine-widget-header">
67
+ ${this.getTitle(this.titleText)}
63
68
  </div>
64
69
 
65
70
  <div id="wine-widget-search">