wineater-bot 4.2.0 → 4.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wineater-bot",
3
- "version": "4.2.0",
3
+ "version": "4.2.5",
4
4
  "description": "",
5
5
  "main": "dist/wineater-chatbot.mjs",
6
6
  "module": "src/index.js",
package/src/App.svelte CHANGED
@@ -248,8 +248,11 @@
248
248
 
249
249
  // Set CSS variable from config reactively
250
250
  $effect(() => {
251
+ if (uiConfig?.brandColor) {
252
+ document.documentElement.style.setProperty('--wr-brand-color', uiConfig.brandColor);
253
+ }
251
254
  if (uiConfig?.wineaterColor) {
252
- document.documentElement.style.setProperty('--wineater-color', uiConfig.wineaterColor);
255
+ document.documentElement.style.setProperty('--wr-wineater-color', uiConfig.wineaterColor);
253
256
  }
254
257
  });
255
258
 
@@ -327,8 +330,8 @@
327
330
  /* ===================== 1) CSS Variables ===================== */
328
331
  :global(:root) {
329
332
  --wineater-corp-color: #0044ff;
330
- /* --wineater-color is set dynamically from uiConfig.wineaterColor */
331
- --wineater-color: #7b2beb; /* fallback value */
333
+ /* --wr-brand-color is set dynamically from uiConfig.brandColor */
334
+ --wr-brand-color: #7b2beb; /* fallback value */
332
335
  }
333
336
 
334
337
  /* ===================== 2) Global Styles ===================== */
@@ -77,9 +77,9 @@
77
77
  transform: translateY(-50%);
78
78
  padding: 4px;
79
79
  border-radius: 6px;
80
- border: 2px solid var(--wineater-color);
80
+ border: 2px solid var(--wr-brand-color);
81
81
  background-color: white;
82
- color: var(--wineater-color);
82
+ color: var(--wr-brand-color);
83
83
  font-weight: 500;
84
84
  font-size: 12px;
85
85
  cursor: pointer;
@@ -1,9 +1,14 @@
1
1
  <script lang="ts">
2
2
  import { getTranslation } from '../services/i18n/i18n';
3
3
  import { appStore } from '../services/store/app-store.svelte';
4
+ import Diamond from './icons/Diamond.svelte';
5
+ import Heart from './icons/Heart.svelte';
6
+ import Meat from './icons/Meat.svelte';
7
+ import Fish from './icons/Fish.svelte';
4
8
 
5
9
  let lang = $derived(appStore.getAppLanguage());
6
10
  const titleText = window?.wineaterData?.TITLE_TEXT || null;
11
+ let ShowedIcon = $state(Meat);
7
12
  </script>
8
13
 
9
14
  <div class="wr-Header">
@@ -12,13 +17,22 @@
12
17
  {:else}
13
18
  <h1 class="wr-Header-title">
14
19
  {getTranslation({ key: 'headerLine1', lang })}
15
- <span class="wr-Header-icon wr-Header-icon--meal"></span>
20
+ <!-- <span class="wr-Header-icon wr-Header-icon--meal"></span> -->
21
+ <!-- TODO: show fish on hover -->
22
+
23
+ <span onmouseenter={() => (ShowedIcon = Fish)} onmouseleave={() => (ShowedIcon = Meat)}>
24
+ <ShowedIcon className="wr-Header-icon" size="28" />
25
+ </span>
26
+
16
27
  <span class="wr-Header-label">{getTranslation({ key: 'headerMeal', lang })}</span>,
17
- <span class="wr-Header-icon wr-Header-icon--mood"></span>
28
+ <!-- <span class="wr-Header-icon wr-Header-icon--mood"></span> -->
29
+ <Heart className="wr-Header-icon" size="28" />
30
+
18
31
  <span class="wr-Header-label">{getTranslation({ key: 'headerMood', lang })}</span>
19
32
  <br />
20
33
  {getTranslation({ key: 'headerOr', lang })}
21
- <span class="wr-Header-icon wr-Header-icon--occasion"></span>
34
+ <!-- <span class="wr-Header-icon wr-Header-icon--occasion"></span> -->
35
+ <Diamond className="wr-Header-icon" size="28" />
22
36
  <span class="wr-Header-label">{getTranslation({ key: 'headerOccasion', lang })}</span>
23
37
  {getTranslation({ key: 'headerLine2', lang })}
24
38
  </h1>
@@ -33,41 +47,18 @@
33
47
  line-height: 1.3;
34
48
  color: #333;
35
49
  text-align: center;
50
+
51
+ /* TODO: add wineater-color to svg */
36
52
  }
37
53
 
38
- .wr-Header-icon {
54
+ :global(.wr-Header-icon) {
39
55
  display: inline-block;
40
- width: 1.2em;
41
- height: 1.2em;
42
56
  vertical-align: middle;
43
- margin: 0 4px 0 2px;
44
- background-repeat: no-repeat;
45
- background-size: contain;
46
- }
47
-
48
- .wr-Header-icon--meal {
49
- background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//meal1.svg');
50
- }
51
-
52
- .wr-Header-icon--meal:hover {
53
- background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//meal3.svg');
54
- }
55
-
56
- .wr-Header-icon--mood {
57
- background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//mood.svg');
58
- }
59
-
60
- /* Not used, old icon */
61
- .wr-Header-icon--budget {
62
- background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//budget.svg');
63
- }
64
-
65
- .wr-Header-icon--occasion {
66
- background-image: url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//ocasion.svg');
57
+ color: var(--wr-wineater-color);
67
58
  }
68
59
 
69
60
  .wr-Header-label {
70
- color: #7B2BEB;
61
+ color: var(--wr-wineater-color);
71
62
  font-weight: 500;
72
63
  }
73
64
 
@@ -31,7 +31,7 @@
31
31
  height: 8px;
32
32
  margin: 0 3px;
33
33
  border-radius: 50%;
34
- background: linear-gradient(90deg, var(--wineater-color), var(--wineater-corp-color));
34
+ background: linear-gradient(90deg, var(--wr-brand-color), var(--wineater-corp-color));
35
35
  opacity: 0.7;
36
36
  animation: typing 1s infinite;
37
37
  }
@@ -156,7 +156,7 @@
156
156
  }
157
157
 
158
158
  .wr-Search-input::placeholder {
159
- color: #7B2BEB;
159
+ color: var(--wr-wineater-color);
160
160
  opacity: 1;
161
161
  transition:
162
162
  color 0.3s ease,
@@ -164,7 +164,7 @@
164
164
  }
165
165
 
166
166
  .wr-Search-input:focus {
167
- border-color: var(--wineater-color);
167
+ border-color: var(--wr-brand-color);
168
168
  }
169
169
 
170
170
  .wr-Search-input:focus::placeholder {
@@ -209,6 +209,7 @@
209
209
  flex-direction: column;
210
210
  align-items: center;
211
211
  justify-content: flex-start;
212
+ background-color: transparent;
212
213
  }
213
214
 
214
215
  .wr-WineTile-image {
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ export let className: string = '';
3
+ export let size: number = 20;
4
+ </script>
5
+
6
+ <svg
7
+ class={className}
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width={size}
10
+ height={size}
11
+ viewBox="0 0 37 37"
12
+ fill="none"
13
+ >
14
+ <path
15
+ d="M29.3014 7.96326C27.0206 7.96326 25.0439 10.092 24.7398 11.0044C19.4179 8.72353 8.01376 10.5482 8.01376 18.6071C8.01376 21.3441 8.01376 23.1687 11.0549 25.4496V30.7715H17.1371V27.7304H21.6987V30.7715H27.7809V24.6893C29.3014 23.929 30.3658 23.1687 30.822 21.6482H33.8631V15.566H30.822C30.822 14.0455 30.0617 13.2852 29.3014 12.5249V7.96326Z"
16
+ stroke="currentColor"
17
+ stroke-width="3.0411"
18
+ stroke-linecap="round"
19
+ stroke-linejoin="round"
20
+ />
21
+ <path
22
+ d="M3.45209 14.0455V15.5661C3.45209 17.2387 4.82058 18.6072 6.49318 18.6072H8.01373"
23
+ stroke="currentColor"
24
+ stroke-width="3.0411"
25
+ stroke-linecap="round"
26
+ stroke-linejoin="round"
27
+ />
28
+ <path
29
+ d="M24.7398 17.0867H24.7544"
30
+ stroke="currentColor"
31
+ stroke-width="3.0411"
32
+ stroke-linecap="round"
33
+ stroke-linejoin="round"
34
+ />
35
+ </svg>
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ export let className: string = '';
3
+ export let size: number = 20;
4
+ </script>
5
+
6
+ <svg
7
+ class={className}
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width={size}
10
+ height={size}
11
+ viewBox="0 0 38 38"
12
+ fill="none"
13
+ >
14
+ <path
15
+ d="M10.036 4.96326H28.2826L34.3648 14.0865L19.1593 33.8537L3.95381 14.0865L10.036 4.96326Z"
16
+ stroke="currentColor"
17
+ stroke-width="3.0411"
18
+ stroke-linecap="round"
19
+ stroke-linejoin="round"
20
+ />
21
+ <path
22
+ d="M17.6388 4.96326L13.0771 14.0865L19.1593 33.8537L25.2415 14.0865L20.6799 4.96326"
23
+ stroke="currentColor"
24
+ stroke-width="3.0411"
25
+ stroke-linecap="round"
26
+ stroke-linejoin="round"
27
+ />
28
+ <path
29
+ d="M3.95381 14.0867H34.3648"
30
+ stroke="currentColor"
31
+ stroke-width="3.0411"
32
+ stroke-linecap="round"
33
+ stroke-linejoin="round"
34
+ />
35
+ </svg>
@@ -0,0 +1,56 @@
1
+ <script lang="ts">
2
+ export let className: string = '';
3
+ export let size: number = 20;
4
+ </script>
5
+
6
+ <svg
7
+ class={className}
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width={size}
10
+ height={size}
11
+ viewBox="0 0 34 34"
12
+ fill="none"
13
+ >
14
+ <path
15
+ d="M9.03846 17.0001C10.3456 12.1888 15.9077 8.65686 20.858 8.65686C25.8083 8.65686 29.2846 12.1888 30.5917 17.0001C29.2846 21.8252 25.8083 25.3432 20.858 25.3432C15.9077 25.3432 10.3456 21.8252 9.03846 17.0001Z"
16
+ stroke="currentColor"
17
+ stroke-width="2.78106"
18
+ stroke-linecap="round"
19
+ stroke-linejoin="round"
20
+ />
21
+ <path
22
+ d="M25.0296 17V17.6953"
23
+ stroke="currentColor"
24
+ stroke-width="2.78106"
25
+ stroke-linecap="round"
26
+ stroke-linejoin="round"
27
+ />
28
+ <path
29
+ d="M22.2485 25.2457C20.4397 22.8774 19.4599 19.98 19.4599 16.9999C19.4599 14.0198 20.4397 11.1224 22.2485 8.75403"
30
+ stroke="currentColor"
31
+ stroke-width="2.78106"
32
+ stroke-linecap="round"
33
+ stroke-linejoin="round"
34
+ />
35
+ <path
36
+ d="M9.73372 15.1506C9.73372 11.4379 7.75916 8.6151 3.79615 7.96155C2.40562 10.0473 2.40562 14.9142 4.11597 17C2.39171 19.0858 2.39171 23.9527 3.79615 26.0385C7.75916 25.3849 9.73372 22.5621 9.73372 18.8494"
37
+ stroke="currentColor"
38
+ stroke-width="2.78106"
39
+ stroke-linecap="round"
40
+ stroke-linejoin="round"
41
+ />
42
+ <path
43
+ d="M14.545 10.4089C14.1834 8.48998 12.7512 6.20951 11.1243 4.48525H19.1893C19.8491 4.4828 20.4883 4.71502 20.9927 5.14042C21.497 5.56582 21.8337 6.15668 21.9426 6.80744L22.2624 8.75418"
44
+ stroke="currentColor"
45
+ stroke-width="2.78106"
46
+ stroke-linecap="round"
47
+ stroke-linejoin="round"
48
+ />
49
+ <path
50
+ d="M22.2624 25.2459L21.9426 27.1926C21.8337 27.8434 21.497 28.4342 20.9927 28.8596C20.4883 29.285 19.8491 29.5172 19.1893 29.5148H13.2101C14.5573 27.9873 15.2948 26.0172 15.2819 23.9805"
51
+ stroke="currentColor"
52
+ stroke-width="2.78106"
53
+ stroke-linecap="round"
54
+ stroke-linejoin="round"
55
+ />
56
+ </svg>
@@ -0,0 +1,28 @@
1
+ <script lang="ts">
2
+ export let className: string = '';
3
+ export let size: number = 20;
4
+ </script>
5
+
6
+ <svg
7
+ class={className}
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ width={size}
10
+ height={size}
11
+ viewBox="0 0 38 38"
12
+ fill="none"
13
+ >
14
+ <path
15
+ d="M29.533 21.4034C31.7986 19.1834 34.0946 16.5224 34.0946 13.0404C34.0946 10.8224 33.2135 8.69521 31.6451 7.12684C30.0768 5.55847 27.9496 4.67737 25.7316 4.67737C23.0554 4.67737 21.1699 5.43764 18.8891 7.71847C16.6083 5.43764 14.7228 4.67737 12.0467 4.67737C9.82865 4.67737 7.70148 5.55847 6.13311 7.12684C4.56474 8.69521 3.68364 10.8224 3.68364 13.0404C3.68364 16.5376 5.96446 19.1986 8.24528 21.4034L18.8891 32.0472L29.533 21.4034Z"
16
+ stroke="currentColor"
17
+ stroke-width="3.0411"
18
+ stroke-linecap="round"
19
+ stroke-linejoin="round"
20
+ />
21
+ <path
22
+ d="M18.8891 19.8829L17.3686 18.3623L20.4097 15.3212L15.848 10.7596L18.8891 7.71851"
23
+ stroke="currentColor"
24
+ stroke-width="3.0411"
25
+ stroke-linecap="round"
26
+ stroke-linejoin="round"
27
+ />
28
+ </svg>
@@ -0,0 +1,32 @@
1
+ <script lang="ts">
2
+ export let className: string = '';
3
+ export let size: number = 20;
4
+ </script>
5
+
6
+ <svg
7
+ class={className}
8
+ viewBox="0 0 38 38"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ width={size}
11
+ height={size}
12
+ fill="none"
13
+ ><path
14
+ stroke="currentColor"
15
+ stroke-linecap="round"
16
+ stroke-linejoin="round"
17
+ stroke-width="3.041"
18
+ d="M19.57 17.655a3.801 3.801 0 1 0 0-7.602 3.801 3.801 0 0 0 0 7.602Z"
19
+ /><path
20
+ stroke="currentColor"
21
+ stroke-linecap="round"
22
+ stroke-linejoin="round"
23
+ stroke-width="3.041"
24
+ d="M19.57 3.97a9.884 9.884 0 0 0-9.458 6.995c-1.673 4.76-1.186 5.93-4.835 9.245a4.562 4.562 0 0 0 2.889 8.09c6.082 0 12.772-2.738 17.334-6.54a9.885 9.885 0 0 0-5.93-17.79Z"
25
+ /><path
26
+ stroke="currentColor"
27
+ stroke-linecap="round"
28
+ stroke-linejoin="round"
29
+ stroke-width="3.041"
30
+ d="m28.693 10.053 3.33 6.842c.316.983.475 2.009.471 3.041a9.867 9.867 0 0 1-3.953 7.907c-4.562 3.801-11.252 6.538-17.334 6.538a4.562 4.562 0 0 1-4.075-2.524l-2.92-5.839"
31
+ /></svg
32
+ >
@@ -49,7 +49,7 @@
49
49
  }
50
50
 
51
51
  .wr-Action.primary {
52
- background: var(--wineater-color);
52
+ background: var(--wr-brand-color);
53
53
  color: #fff;
54
54
  border-radius: 6px;
55
55
  padding: 8px 16px;
@@ -63,8 +63,8 @@
63
63
 
64
64
  .wr-Action.outlined {
65
65
  background: transparent;
66
- color: var(--wineater-color);
67
- border: 2px solid var(--wineater-color);
66
+ color: var(--wr-brand-color);
67
+ border: 2px solid var(--wr-brand-color);
68
68
  border-radius: 6px;
69
69
  padding: 8px 16px;
70
70
  font-size: 14px;
@@ -72,7 +72,7 @@
72
72
 
73
73
  &:hover {
74
74
  box-shadow: 0 4px 8px rgba(123, 43, 235, 0.25);
75
- background-color: var(--wineater-color);
75
+ background-color: var(--wr-brand-color);
76
76
  color: #fff;
77
77
  }
78
78
  }
@@ -4,7 +4,10 @@ import { UiConfig } from "./types";
4
4
  export function getProjectUiConfig(projectId: string): UiConfig {
5
5
  const defaultConfig = {
6
6
  logoUrl: null,
7
+ // Brand color is used for shop branding
7
8
  brandColor: "#7B2BEB",
9
+ // Wineater color is brand color of Wineater
10
+ // It should be changed if client wants to remove Wineater branding
8
11
  wineaterColor: "#7B2BEB",
9
12
  customCss: `
10
13
  @import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');
@@ -7,20 +7,17 @@ export const projectConfigs: Record<string, ProjectUiConfig> = {
7
7
  },
8
8
  "25": {
9
9
  logoUrl: null,
10
- brandColor: "#7B2BEB",
10
+ brandColor: "#000000",
11
+ wineaterColor: "#000000",
11
12
  buttonUppercase: true,
12
13
  customCss: `
13
- @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
14
- :root { --wineater-font-primary: 'Roboto', sans-serif; }
14
+ @import url('https://use.typekit.net/qao2vak.css');
15
+ :root { --wineater-font-primary: 'termina', sans-serif; }
15
16
  #wr-Custom {
16
17
  .wr-Search-input {
17
18
  border-color: #7c7c7c;
18
19
  color: #7c7c7c;
19
- }
20
- .wr-Search-input::placeholder { color: #000000; }
21
- .wr-Search-button {
22
- background: #000000;
23
- }
20
+ }
24
21
  .wr-Search-button:hover {
25
22
  background: #E3BE8D;
26
23
  opacity: 1;
@@ -33,7 +30,6 @@ export const projectConfigs: Record<string, ProjectUiConfig> = {
33
30
  .wr-WineTilePopup-reason {
34
31
  color: #000000;
35
32
  }
36
-
37
33
  .wr-WineTilePopup-tag {
38
34
  color: #000000;
39
35
  background: rgba(239,239,239,0.7);
@@ -41,8 +37,6 @@ export const projectConfigs: Record<string, ProjectUiConfig> = {
41
37
  }
42
38
 
43
39
  .wr-WineTile-action {
44
- color: #000000;
45
- border-color: #000000;
46
40
  background: transparent;
47
41
  }
48
42
 
@@ -61,8 +55,8 @@ export const projectConfigs: Record<string, ProjectUiConfig> = {
61
55
  },
62
56
  "21": {
63
57
  logoUrl: "https://www.intermarche.com/images/logoIntermarche.svg",
64
- wineaterColor: "#B81242",
65
- brandColor: "#7B2BEB",
58
+ brandColor: "#B81242",
59
+ wineaterColor: "#7B2BEB",
66
60
  buttonUppercase: true,
67
61
  customCss: "",
68
62
  translations: {}