wineater-bot 4.16.0 → 4.19.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/.claude/settings.local.json +4 -1
- package/CLAUDE.md +11 -2
- package/dist/wineater-chatbot.mjs +38 -10204
- package/dist/wineater-chatbot.umd.js +28 -41
- package/package.json +4 -6
- package/src/App.svelte +90 -43
- package/src/components/Footer.svelte +2 -0
- package/src/components/Search.svelte +1 -1
- package/src/components/SkeletonTiles.svelte +94 -0
- package/src/components/WineTile.svelte +12 -2
- package/src/services/api/api.ts +11 -1
- package/src/services/cache.ts +28 -0
- package/src/services/store/app-store.svelte.ts +36 -13
- package/src/services/ui-config/utils.ts +30 -2
- package/vite.config.js +20 -1
- package/src/components/Loader.svelte +0 -62
package/CLAUDE.md
CHANGED
|
@@ -36,11 +36,12 @@ src/
|
|
|
36
36
|
│ ├── Search.svelte # Animated placeholder cycling search bar
|
|
37
37
|
│ ├── WineTile.svelte # Wine card: hover popup (desktop), click modal (mobile)
|
|
38
38
|
│ ├── WinePopup.svelte # Full wine detail modal
|
|
39
|
-
│ ├──
|
|
39
|
+
│ ├── SkeletonTiles.svelte # Placeholder cards (initial load + while searching)
|
|
40
40
|
│ ├── ui/Action.svelte # Reusable button/link
|
|
41
41
|
│ └── icons/ # SVG icon components (Budget, Diamond, Fish, Meat, Heart)
|
|
42
42
|
└── services/
|
|
43
43
|
├── api/api.ts # WineaterApi class → Wineater backend
|
|
44
|
+
├── cache.ts # localStorage stale-while-revalidate helpers
|
|
44
45
|
├── api/deserialize.ts # API response → Wine / RecommendedWine types
|
|
45
46
|
├── analytics/analytics.ts # Event tracking → admin-api.wineater.com
|
|
46
47
|
├── analytics/constants.ts # Widget event type constants
|
|
@@ -79,11 +80,19 @@ CSS variables at runtime: `--wr-brand-color`, `--wr-wineater-color`, `--wineater
|
|
|
79
80
|
```
|
|
80
81
|
Note the intentional typo in "conteiner" — it is used in production, do not fix it.
|
|
81
82
|
|
|
83
|
+
## Performance Notes
|
|
84
|
+
|
|
85
|
+
- Store config (24h) and instant recommendations (6h) are cached in localStorage (`wineater:v1:<token-hash>:…`); cached data paints immediately, the network response only refreshes the cache for the next visit
|
|
86
|
+
- Config and instant requests start in parallel; search/more/similar requests start before the 220 ms card-slide animation
|
|
87
|
+
- The `es` bundle is minified by the `minify-esm-bundle` plugin in `vite.config.js` (Vite skips whitespace minification for `es` lib builds)
|
|
88
|
+
- `@import` in project `customCss` is converted to `<link rel="stylesheet">` by `generateInlineStyle`
|
|
89
|
+
|
|
82
90
|
## Important Gotchas
|
|
83
91
|
|
|
92
|
+
|
|
84
93
|
- `#wineater-widget-conteiner` — this typo is intentional and load-bearing
|
|
85
94
|
- Wine translations use OpenAI and require `open_ai_key` from store config (only in `bar` mode)
|
|
86
|
-
- Analytics
|
|
95
|
+
- Analytics is only the first-party `trackWidgetEvent` (admin-api.wineater.com); OpenReplay session replay was removed
|
|
87
96
|
- Per-project configs are hardcoded (not fetched) — changes require rebuild + redeploy
|
|
88
97
|
- `dist/` files are committed to the repo (clients reference them directly or via npm)
|
|
89
98
|
- Package manager: **pnpm**
|