@gengage/assistant-fe 0.3.21 → 0.3.22

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.
Files changed (47) hide show
  1. package/README.md +18 -6
  2. package/dist/{chat-CuPO9t-Z.cjs → chat-BF5pt6iX.cjs} +5 -5
  3. package/dist/{chat-yAf9OADM.js → chat-CHAi6Xej.js} +476 -480
  4. package/dist/chat.cjs +1 -1
  5. package/dist/chat.iife.js +17 -17
  6. package/dist/chat.js +1 -1
  7. package/dist/common/client.d.ts +4 -0
  8. package/dist/common/config-schema.d.ts +4 -0
  9. package/dist/common/overlay.d.ts +4 -0
  10. package/dist/common/widget-base.d.ts +6 -0
  11. package/dist/{common-C8NRcP7O.js → common-Ct6r0F2s.js} +35 -26
  12. package/dist/common-DXdLT4e0.cjs +1 -0
  13. package/dist/common.cjs +1 -1
  14. package/dist/common.js +6 -6
  15. package/dist/{connection-warning-CVZzlGJt.js → connection-warning-CHHi3BAf.js} +1 -1
  16. package/dist/{connection-warning-CL1CReZo.cjs → connection-warning-YQiIRXrz.cjs} +1 -1
  17. package/dist/{ga-datalayer-DkfsAHf9.cjs → ga-datalayer-BVppFxqk.cjs} +1 -1
  18. package/dist/{ga-datalayer-CgI6Kb_i.js → ga-datalayer-BwxWX-cr.js} +35 -32
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +9 -9
  21. package/dist/native-webview-BaW1H_nZ.cjs +1 -0
  22. package/dist/{native-webview-B8vOoxns.js → native-webview-Cf5WtlIH.js} +72 -69
  23. package/dist/native.cjs +1 -1
  24. package/dist/native.iife.js +11 -11
  25. package/dist/native.js +1 -1
  26. package/dist/{qna-YSaIDxjs.js → qna-DXCQtwLq.js} +3 -3
  27. package/dist/{qna-KizG_W1J.cjs → qna-DwG8AJJf.cjs} +1 -1
  28. package/dist/qna.cjs +1 -1
  29. package/dist/qna.iife.js +1 -1
  30. package/dist/qna.js +1 -1
  31. package/dist/{schemas-B6RjqKrg.cjs → schemas-B7jnyzQI.cjs} +1 -1
  32. package/dist/{schemas-PkedCk_-.js → schemas-CTbgsvNJ.js} +1 -1
  33. package/dist/simbut/index.d.ts +3 -0
  34. package/dist/{simbut-BI054QK0.js → simbut-BBXTlzOg.js} +28 -20
  35. package/dist/simbut-D_ycY_MQ.cjs +1 -0
  36. package/dist/simbut.cjs +1 -1
  37. package/dist/simbut.iife.js +8 -8
  38. package/dist/simbut.js +1 -1
  39. package/dist/{simrel-C-DKpfVB.js → simrel-DP2EMyua.js} +3 -3
  40. package/dist/{simrel-vL0woDkE.cjs → simrel-DdP4lur9.cjs} +1 -1
  41. package/dist/simrel.cjs +1 -1
  42. package/dist/simrel.iife.js +1 -1
  43. package/dist/simrel.js +1 -1
  44. package/package.json +1 -1
  45. package/dist/common-BzegEdJs.cjs +0 -1
  46. package/dist/native-webview-D2lDXTh3.cjs +0 -1
  47. package/dist/simbut-B2jXtckF.cjs +0 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![tests](https://img.shields.io/badge/tests-passing-brightgreen)]()
5
5
  [![license](https://img.shields.io/badge/license-source--available-blue)](LICENSE)
6
6
 
7
- Embeddable AI shopping assistant widgets for e-commerce — **chat**, **contextual Q&A**, and **similar products** — built with vanilla TypeScript, zero framework dependencies.
7
+ Embeddable AI shopping assistant widgets for e-commerce — **chat**, **contextual Q&A**, **similar products**, and an optional **find-similar PDP image overlay** — built with vanilla TypeScript, zero framework dependencies.
8
8
 
9
9
  > Backend services require a [gengage.ai](https://gengage.ai) subscription.
10
10
  > See [LEGAL.md](./LEGAL.md) and [TRADEMARKS.md](./TRADEMARKS.md).
@@ -16,10 +16,10 @@ Embeddable AI shopping assistant widgets for e-commerce — **chat**, **contextu
16
16
  ### CDN Script Tag (fastest)
17
17
 
18
18
  ```html
19
- <script src="https://unpkg.com/@gengage/assistant-fe/dist/gengage-assistant.iife.js"></script>
19
+ <script src="https://unpkg.com/@gengage/assistant-fe/dist/chat.iife.js"></script>
20
20
  <script>
21
- GengageAssistant.initFromConfig({
22
- version: '1',
21
+ const chat = new window.Gengage.GengageChat();
22
+ chat.init({
23
23
  accountId: 'YOUR_ACCOUNT_ID',
24
24
  middlewareUrl: 'https://YOUR_BACKEND_URL',
25
25
  });
@@ -57,6 +57,7 @@ await chat.init({
57
57
  chat: { variant: 'floating' },
58
58
  qna: { mountTarget: '#qna-section' },
59
59
  simrel: { mountTarget: '#similar-products' },
60
+ simbut: { mountTarget: '#product-gallery' },
60
61
  });
61
62
  </script>
62
63
  ```
@@ -87,6 +88,7 @@ See [docs/native-mobile-sdk.md](docs/native-mobile-sdk.md) for iOS WKWebView, An
87
88
  | **Chat** | `@gengage/assistant-fe/chat` | Floating AI drawer with streaming responses, product cards, comparison tables |
88
89
  | **QNA** | `@gengage/assistant-fe/qna` | Contextual action buttons for product pages |
89
90
  | **SimRel** | `@gengage/assistant-fe/simrel` | AI-powered similar/related product grid |
91
+ | **SimBut** | `@gengage/assistant-fe/simbut` | PDP image-overlay pill that opens a `findSimilar` flow for the current product |
90
92
  | **Native** | `@gengage/assistant-fe/native` | Android/iOS WebView bridge + overlay bootstrap |
91
93
 
92
94
  ---
@@ -102,9 +104,11 @@ chat.init({
102
104
 
103
105
  **Component overrides** — swap any UI component via the json-render registry.
104
106
 
107
+ **SimBut customization** — use theme tokens, `i18n.findSimilarLabel`, and `onFindSimilar` for the PDP image-overlay pill.
108
+
105
109
  **Full fork** — replace `src/chat/components/` entirely; keep `catalog.ts` + `index.ts`.
106
110
 
107
- See [CUSTOMIZATION-GUIDE.md](CUSTOMIZATION-GUIDE.md) for the full playbook.
111
+ See [docs/customization.md](docs/customization.md) for the fork and merchant-customization playbook.
108
112
 
109
113
  ---
110
114
 
@@ -117,6 +121,7 @@ npm run typecheck # TypeScript strict check
117
121
  npm run test # Unit tests
118
122
  npm run build # Build to dist/
119
123
  npm run catalog # Visual component catalog at :3002
124
+ npm run docs:build # Build contributor docs with VitePress
120
125
  ```
121
126
 
122
127
  **Using a local backend:**
@@ -137,14 +142,20 @@ MIDDLEWARE_URL=http://localhost:7860 npm run dev -- koctascomtr --sku=1000465056
137
142
 
138
143
  | Doc | Description |
139
144
  |-----|-------------|
145
+ | [Docs Index](docs/index.md) | Full documentation map |
146
+ | [API Reference](docs/api-reference.md) | Public entry points and config surfaces |
140
147
  | [Architecture](docs/architecture.md) | System design, widget lifecycle, data flows |
141
148
  | [Wire Protocol](docs/wire-protocol.md) | Backend NDJSON streaming contract |
142
149
  | [Customization](docs/customization.md) | CSS tokens, component overrides, XSS rules |
150
+ | [i18n](docs/i18n.md) | Locale resolution and string overrides |
151
+ | [Error Handling](docs/error-handling.md) | Offline, retry, and recovery behavior |
143
152
  | [GTM Quickstart](docs/gtm-quickstart.md) | Copy-paste GTM embedding patterns |
144
153
  | [Security](docs/security-production.md) | Production CSP, postMessage origins, sanitization |
145
154
  | [Analytics](docs/analytics-contract.md) | Event taxonomy and attribution |
146
155
  | [Mobile SDK](docs/native-mobile-sdk.md) | Android/iOS/React Native integration |
147
156
  | [New Account](docs/new-account-guide.md) | Adding a new merchant demo |
157
+ | [AGENTS](AGENTS.md) | Coding-agent architecture and code-path index |
158
+ | [Contributing](CONTRIBUTING.md) | Shared SDK contribution workflow |
148
159
 
149
160
  ---
150
161
 
@@ -156,8 +167,9 @@ src/
156
167
  chat/ # Chat widget (GengageChat class + components)
157
168
  qna/ # QNA widget (GengageQNA class + components)
158
169
  simrel/ # Similar products widget (GengageSimRel class + components)
170
+ simbut/ # PDP image overlay pill widget (GengageSimBut class)
159
171
  native/ # Native WebView bridge exports
160
- demos/ # 12 merchant-branded demo pages
172
+ demos/ # Merchant-branded demo pages and framework integration examples
161
173
  catalog/ # Visual component catalog (mock data, no backend)
162
174
  docs/ # Architecture, wire protocol, customization, analytics
163
175
  tests/ # Vitest unit tests + Playwright E2E