wineater-bot 4.12.0 → 4.16.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 +3253 -3203
- package/dist/wineater-chatbot.umd.js +25 -24
- package/package.json +1 -1
- package/src/App.svelte +16 -4
- package/src/components/WineTile.svelte +3 -2
- package/src/services/ui-config/projects-config.ts +1 -1
- package/src/services/ui-config/projects-config 2.ts +0 -72
package/package.json
CHANGED
package/src/App.svelte
CHANGED
|
@@ -186,11 +186,23 @@
|
|
|
186
186
|
|
|
187
187
|
async function handleShowMore() {
|
|
188
188
|
if (isLoadingMore || !hasMore) return;
|
|
189
|
+
// Выдача заменяется целиком, поэтому держим предыдущую под рукой: если
|
|
190
|
+
// новых вин не нашлось или запрос упал, покупатель не должен остаться
|
|
191
|
+
// перед пустой сеткой.
|
|
192
|
+
const previousResults = results;
|
|
189
193
|
try {
|
|
190
194
|
isLoadingMore = true;
|
|
195
|
+
isLoading = true;
|
|
196
|
+
|
|
191
197
|
// Карточки заменяются, а не дописываются, поэтому исключать надо всё
|
|
192
198
|
// показанное за сессию — иначе следующий клик вернёт те же вина.
|
|
193
199
|
seenIds = [...new Set([...seenIds, ...results.map((w) => w.id)])];
|
|
200
|
+
|
|
201
|
+
// Тот же жест, что и при поиске: карточки уезжают вверх, дальше лоадер
|
|
202
|
+
await animateClearAll(220);
|
|
203
|
+
results = [];
|
|
204
|
+
isAnimating = false;
|
|
205
|
+
|
|
194
206
|
const { recommendations, hasMore: more } = await wineaterApi.getMoreWineRecommendations(
|
|
195
207
|
lastSearchedQuery,
|
|
196
208
|
seenIds
|
|
@@ -199,15 +211,15 @@
|
|
|
199
211
|
query: lastSearchedQuery,
|
|
200
212
|
results_count: recommendations.length
|
|
201
213
|
});
|
|
202
|
-
|
|
203
|
-
results = recommendations;
|
|
204
|
-
}
|
|
214
|
+
results = recommendations.length > 0 ? recommendations : previousResults;
|
|
205
215
|
hasMore = more;
|
|
206
216
|
} catch (error) {
|
|
207
|
-
console.error('[wineater]
|
|
217
|
+
console.error('[wineater] try again error:', error);
|
|
218
|
+
results = previousResults;
|
|
208
219
|
hasMore = false;
|
|
209
220
|
} finally {
|
|
210
221
|
isLoadingMore = false;
|
|
222
|
+
isLoading = false;
|
|
211
223
|
}
|
|
212
224
|
}
|
|
213
225
|
|
|
@@ -291,8 +291,9 @@
|
|
|
291
291
|
действует только на разметку этого компонента, иначе правило отбрасывается
|
|
292
292
|
как неиспользуемое. Цвет тот же, что у Buy; подчёркивание выезжает слева. */
|
|
293
293
|
:global(.wr-WineTile-action--similar) {
|
|
294
|
-
|
|
295
|
-
font-
|
|
294
|
+
/* Заметно легче кнопки Buy (14px/500) — это вторичное действие, не кнопка */
|
|
295
|
+
font-size: 12px;
|
|
296
|
+
font-weight: 400;
|
|
296
297
|
color: var(--wr-brand-color, #7b2beb);
|
|
297
298
|
text-decoration: none;
|
|
298
299
|
background: transparent;
|
|
@@ -124,7 +124,7 @@ export const projectConfigs: Record<string, ProjectUiConfig> = {
|
|
|
124
124
|
logoUrl: null,
|
|
125
125
|
brandColor: "#8bae98",
|
|
126
126
|
wineaterColor: "#8bae98",
|
|
127
|
-
titleText: "Looking for the perfect bottle? Ask our AI
|
|
127
|
+
titleText: "Looking for the perfect bottle? Ask our AI Wine Geek for personalised recommendations, whatever the meal, mood or occasion.",
|
|
128
128
|
customCss: `
|
|
129
129
|
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap');
|
|
130
130
|
:root { --wineater-font-primary: 'Montserrat', Verdana, Helvetica, Arial, sans-serif; }
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { ProjectUiConfig } from "./types";
|
|
2
|
-
|
|
3
|
-
export const projectConfigs: Record<string, ProjectUiConfig> = {
|
|
4
|
-
"0": {
|
|
5
|
-
logoUrl: null,
|
|
6
|
-
brandColor: "#7B2BEB",
|
|
7
|
-
},
|
|
8
|
-
"25": {
|
|
9
|
-
logoUrl: null,
|
|
10
|
-
brandColor: "#000000",
|
|
11
|
-
wineaterColor: "#000000",
|
|
12
|
-
buttonUppercase: true,
|
|
13
|
-
customCss: `
|
|
14
|
-
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
|
|
15
|
-
:root { --wineater-font-primary: 'Roboto', sans-serif; }
|
|
16
|
-
#wr-Custom {
|
|
17
|
-
.wr-Search-input {
|
|
18
|
-
border-color: #7c7c7c;
|
|
19
|
-
color: #7c7c7c;
|
|
20
|
-
}
|
|
21
|
-
.wr-Search-button:hover {
|
|
22
|
-
background: #E3BE8D;
|
|
23
|
-
opacity: 1;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.wr-WineTile-params {
|
|
27
|
-
color: #7c7c7c;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.wr-WineTilePopup-reason {
|
|
31
|
-
color: #000000;
|
|
32
|
-
}
|
|
33
|
-
.wr-WineTilePopup-tag {
|
|
34
|
-
color: #000000;
|
|
35
|
-
background: rgba(239,239,239,0.7);
|
|
36
|
-
border-color: transparent;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.wr-WineTile-action {
|
|
40
|
-
background: transparent;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.wr-WineTile-action:hover {
|
|
44
|
-
background: #000000;
|
|
45
|
-
color: #ffffff;
|
|
46
|
-
box-shadow: none;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
`,
|
|
50
|
-
translations: {
|
|
51
|
-
fr: {
|
|
52
|
-
"wineDetails.buy": "voir plus"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"21": {
|
|
57
|
-
logoUrl: "https://www.intermarche.com/images/logoIntermarche.svg",
|
|
58
|
-
brandColor: "#B81242",
|
|
59
|
-
wineaterColor: "#7B2BEB",
|
|
60
|
-
buttonUppercase: true,
|
|
61
|
-
customCss: "",
|
|
62
|
-
translations: {}
|
|
63
|
-
},
|
|
64
|
-
"26": {
|
|
65
|
-
logoUrl: "https://paladarlondon.com/wp-content/uploads/2021/05/cropped-cropped-Paladar-Logo-1473x464-min-768x219.png",
|
|
66
|
-
brandColor: "#B81242",
|
|
67
|
-
wineaterColor: "#7B2BEB",
|
|
68
|
-
buttonUppercase: true,
|
|
69
|
-
customCss: "",
|
|
70
|
-
translations: {}
|
|
71
|
-
}
|
|
72
|
-
};
|