wineater-bot 4.1.1 → 4.2.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 +3792 -3838
- package/dist/wineater-chatbot.umd.js +30 -28
- package/index.html +1 -1
- package/package.json +1 -1
- package/src/App.svelte +9 -5
- package/src/components/Header.svelte +1 -1
- package/src/components/Search.svelte +1 -1
- package/src/services/ui-config/projects-config.ts +8 -0
- package/src/services/ui-config/types.ts +1 -0
package/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<title>Chatbot</title>
|
|
8
8
|
<!-- TODO: replace later with __WINEATER_WIDGET_DATA__ -->
|
|
9
|
-
<script>window.wineaterData = { CLIENT_TOKEN: 'l3yovIe7qdAkOCO9ZJMb0sOZLWJArwQkHkeC5Fj7IBox5GPGJoaL32dC4WRQ4Yli', WIDGET_TYPE: '
|
|
9
|
+
<script>window.wineaterData = { CLIENT_TOKEN: 'l3yovIe7qdAkOCO9ZJMb0sOZLWJArwQkHkeC5Fj7IBox5GPGJoaL32dC4WRQ4Yli', WIDGET_TYPE: 'store' };</script>
|
|
10
10
|
<!-- Production build checks -->
|
|
11
11
|
<!-- <script type="module" src="./dist/wineater-chatbot.mjs"></script> -->
|
|
12
12
|
<!-- Production CDN -->
|
package/package.json
CHANGED
package/src/App.svelte
CHANGED
|
@@ -246,6 +246,13 @@
|
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
// Set CSS variable from config reactively
|
|
250
|
+
$effect(() => {
|
|
251
|
+
if (uiConfig?.wineaterColor) {
|
|
252
|
+
document.documentElement.style.setProperty('--wineater-color', uiConfig.wineaterColor);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
|
|
249
256
|
onMount(async () => {
|
|
250
257
|
// initialize store first
|
|
251
258
|
await appStore.initializeStore();
|
|
@@ -255,9 +262,6 @@
|
|
|
255
262
|
if (uiConfig.customCss) {
|
|
256
263
|
generateInlineStyle(uiConfig.customCss);
|
|
257
264
|
}
|
|
258
|
-
// Set dynamic color variable from widget data
|
|
259
|
-
const customColor = window?.wineaterData?.COLOR || '#7B2BEB';
|
|
260
|
-
document.documentElement.style.setProperty('--wineater-color', customColor);
|
|
261
265
|
|
|
262
266
|
await loadInstantRecommendations();
|
|
263
267
|
trackWidgetEvent(WIDGET_EVENTS.WIDGET_INITIALIZED, storeId);
|
|
@@ -323,8 +327,8 @@
|
|
|
323
327
|
/* ===================== 1) CSS Variables ===================== */
|
|
324
328
|
:global(:root) {
|
|
325
329
|
--wineater-corp-color: #0044ff;
|
|
326
|
-
/*
|
|
327
|
-
--wineater-color: #7b2beb;
|
|
330
|
+
/* --wineater-color is set dynamically from uiConfig.wineaterColor */
|
|
331
|
+
--wineater-color: #7b2beb; /* fallback value */
|
|
328
332
|
}
|
|
329
333
|
|
|
330
334
|
/* ===================== 2) Global Styles ===================== */
|
|
@@ -58,5 +58,13 @@ export const projectConfigs: Record<string, ProjectUiConfig> = {
|
|
|
58
58
|
"wineDetails.buy": "voir plus"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
},
|
|
62
|
+
"21": {
|
|
63
|
+
logoUrl: "https://www.intermarche.com/images/logoIntermarche.svg",
|
|
64
|
+
wineaterColor: "#B81242",
|
|
65
|
+
brandColor: "#7B2BEB",
|
|
66
|
+
buttonUppercase: true,
|
|
67
|
+
customCss: "",
|
|
68
|
+
translations: {}
|
|
61
69
|
}
|
|
62
70
|
};
|
|
@@ -4,6 +4,7 @@ export type ProjectId = string;
|
|
|
4
4
|
export type ProjectUiConfig = {
|
|
5
5
|
logoUrl: string | null;
|
|
6
6
|
brandColor: string;
|
|
7
|
+
wineaterColor?: string;
|
|
7
8
|
customCss?: string | null;
|
|
8
9
|
buttonUppercase?: boolean;
|
|
9
10
|
translations?: Partial<Record<LanguageCode, Record<string, string>>>;
|