wineater-bot 4.1.0 → 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/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: 'bar' };</script>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wineater-bot",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "",
5
5
  "main": "dist/wineater-chatbot.mjs",
6
6
  "module": "src/index.js",
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
- /* TODO: get color from config */
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 ===================== */
@@ -67,7 +67,7 @@
67
67
  }
68
68
 
69
69
  .wr-Header-label {
70
- color: var(--wineater-color);
70
+ color: #7B2BEB;
71
71
  font-weight: 500;
72
72
  }
73
73
 
@@ -156,7 +156,7 @@
156
156
  }
157
157
 
158
158
  .wr-Search-input::placeholder {
159
- color: var(--wineater-color);
159
+ color: #7B2BEB;
160
160
  opacity: 1;
161
161
  transition:
162
162
  color 0.3s ease,
@@ -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>>>;