@gengage/assistant-fe 0.1.2 → 0.1.3
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/README.md +30 -0
- package/dist/chat/session-persistence.d.ts +1 -1
- package/dist/chat/types.d.ts +1 -1
- package/dist/chat.iife.js.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/common/api-paths.d.ts +1 -1
- package/dist/common/api-paths.d.ts.map +1 -1
- package/dist/common/index.d.ts +0 -2
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.cjs.map +1 -1
- package/dist/common.js +288 -520
- package/dist/common.js.map +1 -1
- package/dist/{index-CXbH-cw8.js → index-DC0Bo9EA.js} +2 -2
- package/dist/index-DC0Bo9EA.js.map +1 -0
- package/dist/index-DHfTHscz.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -26
- package/dist/qna.cjs.map +1 -1
- package/dist/qna.iife.js.map +1 -1
- package/dist/qna.js +2 -2
- package/dist/qna.js.map +1 -1
- package/dist/schemas-CPkzbgia.js.map +1 -1
- package/dist/schemas-tCxs1sED.cjs.map +1 -1
- package/dist/simrel.iife.js.map +1 -1
- package/package.json +3 -1
- package/dist/common/merchant-configs.d.ts +0 -22
- package/dist/common/merchant-configs.d.ts.map +0 -1
- package/dist/index-CXbH-cw8.js.map +0 -1
package/README.md
CHANGED
|
@@ -20,6 +20,9 @@ contextual Q&A buttons, and a similar-products grid.
|
|
|
20
20
|
| **QNA** | `@gengage/assistant-fe/qna` | Contextual action buttons for product pages |
|
|
21
21
|
| **SimRel** | `@gengage/assistant-fe/simrel` | Similar / related product grid |
|
|
22
22
|
|
|
23
|
+
> **`middlewareUrl` is required.** Set it in your initialization script to point to your
|
|
24
|
+
> Gengage backend. The SDK has no built-in default — you must always provide it explicitly.
|
|
25
|
+
|
|
23
26
|
---
|
|
24
27
|
|
|
25
28
|
## Quick Start (CDN embed)
|
|
@@ -132,6 +135,10 @@ gengage-assistant-fe/
|
|
|
132
135
|
│ ├── react/ # React CDN + IIFE bundles
|
|
133
136
|
│ ├── nextjs/ # Next.js integration guide
|
|
134
137
|
│ └── native/ # Mobile WebView overlay
|
|
138
|
+
├── catalog/ # Visual component catalog (no backend needed)
|
|
139
|
+
│ ├── index.html # SPA shell
|
|
140
|
+
│ ├── vite.config.ts # Resolves @gengage/assistant-fe → dist/
|
|
141
|
+
│ └── src/ # Router, layout, mock data, sections
|
|
135
142
|
├── scripts/
|
|
136
143
|
│ └── dev.ts # Dev server entry point (npm run dev)
|
|
137
144
|
├── docs/
|
|
@@ -158,6 +165,7 @@ gengage-assistant-fe/
|
|
|
158
165
|
| `npm run lint` | ESLint `src/` |
|
|
159
166
|
| `npm run test` | Vitest unit tests |
|
|
160
167
|
| `npm run test:e2e` | Playwright smoke tests |
|
|
168
|
+
| `npm run catalog` | Visual component catalog at `http://localhost:3002` |
|
|
161
169
|
| `npm run docs:dev` | VitePress docs server |
|
|
162
170
|
|
|
163
171
|
### `npm run dev` — Local Widget Test Server
|
|
@@ -192,6 +200,28 @@ HMR is active — editing `src/` files updates the page without a full reload.
|
|
|
192
200
|
> The dev server serves the account's demo page from `demos/<accountId>/index.html`,
|
|
193
201
|
> generating fresh session/user/view IDs on each start.
|
|
194
202
|
|
|
203
|
+
### Component Catalog (`npm run catalog`)
|
|
204
|
+
|
|
205
|
+
A visual catalog that renders every component with mock data — no backend needed.
|
|
206
|
+
Imports from `dist/` (validates the npm package as consumers would see it).
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
npm run build && npm run catalog # Build first, then serve at :3002
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Open `http://localhost:3002` to see:
|
|
213
|
+
|
|
214
|
+
- **25+ components** grouped by widget (Chat, QNA, SimRel) in realistic frames
|
|
215
|
+
- **Global theme selector** — switch between 12 merchant color presets (Koçtaş, n11, Hepsiburada, Trendyol, etc.)
|
|
216
|
+
- **Chat components** shown inside a chat-drawer frame (dark header, avatar, message area)
|
|
217
|
+
- **QNA components** shown inside a PDP-like frame (product title, price)
|
|
218
|
+
- **SimRel components** shown inside a product section frame ("Benzer Ürünler" header)
|
|
219
|
+
- **Full Widgets** section with mock fetch backend (NDJSON interception)
|
|
220
|
+
- **Theme Comparison** — same component rendered across all 12 merchant themes
|
|
221
|
+
- **Responsive Preview** — mobile / tablet / desktop viewport frames
|
|
222
|
+
|
|
223
|
+
The catalog lives in `catalog/` and is excluded from npm publish (`files: ["dist/"]`).
|
|
224
|
+
|
|
195
225
|
---
|
|
196
226
|
|
|
197
227
|
## Customization
|
|
@@ -33,7 +33,7 @@ export declare class SessionPersistence {
|
|
|
33
33
|
* Sends an 'openURLInNewTab' bridge message so the host page can intercept
|
|
34
34
|
* (e.g. for SPA routing), then navigates directly as fallback.
|
|
35
35
|
*
|
|
36
|
-
* Legacy compatibility:
|
|
36
|
+
* Legacy compatibility: the prior engine navigated via window.location.href
|
|
37
37
|
* after posting saveSessionAndOpenURL to the iframe. The clean-room runs in
|
|
38
38
|
* the same window (Shadow DOM, not iframe), so it navigates directly.
|
|
39
39
|
*/
|
package/dist/chat/types.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export interface ChatWidgetConfig extends BaseWidgetConfig {
|
|
|
77
77
|
voiceEnabled?: boolean;
|
|
78
78
|
/**
|
|
79
79
|
* Backend type:
|
|
80
|
-
* - 'v1' :
|
|
80
|
+
* - 'v1' : standard backend (default) — /chat/process_action
|
|
81
81
|
* - 'acap' : ACAP platform backend — /api/chat/:siteId/message
|
|
82
82
|
*/
|
|
83
83
|
backendType?: import('../common/api-paths.js').BackendType;
|