@flowengage/react-chatbot 3.0.9 → 4.0.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/README.md +0 -61
- package/dist/flowengage-embed.js +19 -19
- package/dist/flowengage-react-chatbot.cjs +18 -18
- package/dist/flowengage-react-chatbot.mjs +5913 -5891
- package/package.json +1 -1
- package/dist/navFeedback-DfScMGBH.mjs +0 -33
- package/dist/navFeedback-sUJfoGrs.js +0 -1
- package/dist/navLog-CFMQ4ZYH.mjs +0 -45
- package/dist/navLog-DcdVdf44.js +0 -1
- package/dist/reload-H8LF3bZU.mjs +0 -13
- package/dist/reload-QLoC5roX.js +0 -1
- package/dist/spa-AtFQKJ1w.mjs +0 -71
- package/dist/spa-C8SSgJtr.js +0 -1
- package/dist/urlGuards-DAIyNQW3.js +0 -1
- package/dist/urlGuards-DbG5voWk.mjs +0 -128
package/README.md
CHANGED
|
@@ -281,67 +281,6 @@ Backend URLs are resolved by FlowEngage; you normally do not set them unless usi
|
|
|
281
281
|
|
|
282
282
|
---
|
|
283
283
|
|
|
284
|
-
## Navigation Architecture
|
|
285
|
-
|
|
286
|
-
The widget uses a three-strategy navigation system that selects the best approach per site and per route, determined at crawl time by a backend classifier.
|
|
287
|
-
|
|
288
|
-
### Strategies
|
|
289
|
-
|
|
290
|
-
| Strategy | When | Voice survives | Description |
|
|
291
|
-
|----------|------|----------------|-------------|
|
|
292
|
-
| `bodyswap` | Server-rendered CMS (Drupal, WordPress, Webflow) | Yes | Swaps `<body>` content, replays scripts, re-initializes frameworks |
|
|
293
|
-
| `spa` | SPA hosts (Next.js, React Router, Vue, Angular) | Yes via router | Calls the host framework's router directly for instant navigation |
|
|
294
|
-
| `reload` | AJAX-heavy routes (forms, reCAPTCHA, payment widgets) | Transcript persists + auto-resumes | Full `location.assign` — always works, slower UX |
|
|
295
|
-
|
|
296
|
-
### How Strategy Is Chosen
|
|
297
|
-
|
|
298
|
-
1. **Session override** — if a previous navigation failed on this URL, widget auto-promoted it to `reload` for this session
|
|
299
|
-
2. **Per-route override** — backend config flags specific paths (e.g. `/contact` with a Webform) for `reload`
|
|
300
|
-
3. **Site default** — classifier detected the site framework at crawl time (`spa`, `bodyswap`, or `reload`)
|
|
301
|
-
4. **Runtime fallback** — if no config exists (pre-classifier customers), runtime SPA detection → bodyswap default
|
|
302
|
-
|
|
303
|
-
### Self-Correction
|
|
304
|
-
|
|
305
|
-
If a strategy fails (hydration timeout, script error), the widget:
|
|
306
|
-
1. Promotes that URL to `reload` in `sessionStorage` (immediate fix for current visitor)
|
|
307
|
-
2. Reports the failure to `POST /api/widget/nav-feedback` (backend aggregates across visitors)
|
|
308
|
-
3. After enough distinct visitors hit the same failure, backend auto-adds a permanent route override
|
|
309
|
-
|
|
310
|
-
### Module Layout
|
|
311
|
-
|
|
312
|
-
```
|
|
313
|
-
src/navigation/
|
|
314
|
-
index.js Strategy dispatcher (public API)
|
|
315
|
-
resolver.js Per-URL strategy resolution
|
|
316
|
-
strategyLoader.js Dynamic import cache
|
|
317
|
-
strategies/
|
|
318
|
-
bodySwap.js Body-swap with script replay + hydration probe
|
|
319
|
-
reload.js Full reload with voice resume
|
|
320
|
-
spa.js Framework router calls (Next.js, Remix, etc.)
|
|
321
|
-
shared/
|
|
322
|
-
findElement.js DOM element targeting for highlights
|
|
323
|
-
highlightEngine.js Section highlighting
|
|
324
|
-
voiceNavResume.js Voice transcript persistence + resume
|
|
325
|
-
pendingSection.js Post-navigation section scroll
|
|
326
|
-
sectionPersist.js Form state + scroll position persistence
|
|
327
|
-
navLog.js Debug logging (FE_DEBUG_NAV flag)
|
|
328
|
-
urlGuards.js URL validation
|
|
329
|
-
feedback/
|
|
330
|
-
navFeedback.js Failure reporting to backend
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
### Feature Flags
|
|
334
|
-
|
|
335
|
-
Set via `localStorage.flowengage_flags` JSON blob:
|
|
336
|
-
|
|
337
|
-
| Flag | Default | Effect |
|
|
338
|
-
|------|---------|--------|
|
|
339
|
-
| `FE_NAV_RELOAD_ENABLED` | `false` | Enables reload strategy selection |
|
|
340
|
-
| `FE_NAV_SPA_ENABLED` | `false` | Enables SPA strategy selection |
|
|
341
|
-
| `FE_DEBUG_NAV` | `false` | Verbose navigation decision logging |
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
284
|
## Getting Your Site ID
|
|
346
285
|
|
|
347
286
|
1. Log in to the [FlowEngage Dashboard](https://app.flowengage.com)
|