@wexio/messenger-widget-react 1.1.5 → 1.2.1

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 (58) hide show
  1. package/CHANGELOG.md +603 -0
  2. package/dist/widget-react--D5-TDqS.js +475 -0
  3. package/dist/{widget-react-D9b9f-j_2.js → widget-react-2tTH7-bO.js} +1 -1
  4. package/dist/{widget-react-GkCAcRz0.js → widget-react-B8rXZyxg.js} +1 -1
  5. package/dist/widget-react-B9X7Tn7t.js +125 -0
  6. package/dist/{widget-react-D7Q1S5E02.js → widget-react-BPNfTldJ.js} +134 -121
  7. package/dist/{widget-react-NffhFueH.js → widget-react-BlTmXnei.js} +2 -2
  8. package/dist/{widget-react-D_1wQTaz.js → widget-react-CIy9jXND.js} +2 -2
  9. package/dist/widget-react-CVLHwRZh.js +21619 -0
  10. package/dist/{widget-react-DWO5MXt62.js → widget-react-CtvdaJvy.js} +5 -5
  11. package/dist/widget-react-D8-Z8fvu.js +323 -0
  12. package/dist/{widget-react-NUWScxeE2.js → widget-react-DF5yY9sQ.js} +120 -108
  13. package/dist/widget-react-DNFROpaS.js +262 -0
  14. package/dist/{widget-react-BhdM1EXE2.js → widget-react-DXP6EOCM.js} +1 -1
  15. package/dist/{widget-react-BDd1HJHs.js → widget-react-DejnNTzJ.js} +36 -36
  16. package/dist/{widget-react-Br8qtj152.js → widget-react-DubCiNev.js} +5 -5
  17. package/dist/{widget-react-BVRYDaf5.js → widget-react-faSyVXFQ.js} +2 -2
  18. package/dist/{widget-react-BGCZpMUT.js → widget-react-krPPnv02.js} +1 -1
  19. package/dist/widget-react.js +14513 -6394
  20. package/package.json +3 -2
  21. package/dist/widget-react--A4IVF5N2.js +0 -359
  22. package/dist/widget-react-BFgpQWPW.js +0 -7733
  23. package/dist/widget-react-BGmjRit12.js +0 -359
  24. package/dist/widget-react-BJN4_XqD.js +0 -359
  25. package/dist/widget-react-BepZON2O.js +0 -359
  26. package/dist/widget-react-BirV4fjr.js +0 -359
  27. package/dist/widget-react-BjeN5jDi.js +0 -359
  28. package/dist/widget-react-Blj9taMI2.js +0 -359
  29. package/dist/widget-react-Bpjcku_E.js +0 -359
  30. package/dist/widget-react-Br-jpQBt.js +0 -359
  31. package/dist/widget-react-C4jVLX4O.js +0 -359
  32. package/dist/widget-react-CMn2M4G7.js +0 -359
  33. package/dist/widget-react-CPIqSc_J.js +0 -359
  34. package/dist/widget-react-CPnUEeex.js +0 -9907
  35. package/dist/widget-react-CVrATfkA.js +0 -359
  36. package/dist/widget-react-CeQaem4N2.js +0 -126
  37. package/dist/widget-react-CkDPMun5.js +0 -359
  38. package/dist/widget-react-Cp0KM0D6.js +0 -359
  39. package/dist/widget-react-Cs_ooZdD.js +0 -359
  40. package/dist/widget-react-Csr68eN1.js +0 -359
  41. package/dist/widget-react-CxzW4Bam.js +0 -359
  42. package/dist/widget-react-D00lhVJW.js +0 -359
  43. package/dist/widget-react-DM5ptbez2.js +0 -359
  44. package/dist/widget-react-DU5Wg6Cl.js +0 -359
  45. package/dist/widget-react-DYBhHaDC.js +0 -359
  46. package/dist/widget-react-DZxVgDlM2.js +0 -359
  47. package/dist/widget-react-Dhi-efUB2.js +0 -359
  48. package/dist/widget-react-DmQP1bcj.js +0 -4293
  49. package/dist/widget-react-Dvze5gXC.js +0 -359
  50. package/dist/widget-react-H0QV1X13.js +0 -359
  51. package/dist/widget-react-JcQ9Xwb6.js +0 -359
  52. package/dist/widget-react-LjYTh4EJ.js +0 -359
  53. package/dist/widget-react-M3D_BLuT.js +0 -359
  54. package/dist/widget-react-O_BU6qSC.js +0 -359
  55. package/dist/widget-react-TB2Eoyvi2.js +0 -263
  56. package/dist/widget-react-WSHbDgKs.js +0 -359
  57. package/dist/widget-react-_6vfCiAZ.js +0 -359
  58. package/dist/widget-react-e8MoPThS2.js +0 -359
package/CHANGELOG.md ADDED
@@ -0,0 +1,603 @@
1
+ # @wexio/messenger-widget-react
2
+
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 717679b: Ship `CHANGELOG.md` in the published package (added to each package's `files`) and into the per-package dist repos, so consumers can see release notes on npm and GitHub.
8
+
9
+ ## 1.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 972e218: Visitor activity tracking, AI reply Sources, Markdown rendering, and navigation fixes.
14
+
15
+ **Visitor activity tracking**
16
+
17
+ - Website page views (initial load + SPA navigation) and in-widget link clicks (help / news / CTA / external) are reported when the operator's `trackWebsitePages` / `trackWidgetLinks` flags are on. Events queue before the visitor handshake and flush once the session lands.
18
+ - iframe embeds capture host-page navigation in `loader.js` and forward it to the widget; web-component / React embeds read history directly.
19
+ - Help/news open-tracking now fires from the article detail view keyed on the post `_id` — so it covers every entry path (search, category, related, home blocks) and matches the id used by reactions.
20
+ - The detected visitor locale is sent in the handshake `contextSnapshot` so the operator's profile LANGUAGE resolves accurately.
21
+
22
+ **AI replies**
23
+
24
+ - **Sources block** under AI answers: a collapsible `Sources · N` pill (with a stacked favicon preview) that expands to source rows with a hover tooltip (title + description). Internal `/help` · `/news` sources open in-widget; absolute URLs open in a new tab. Sourced from both the realtime event and chat history.
25
+ - **Markdown replies** are now rendered (bold, lists, links, code, headings) with the exact same styling as HTML replies; links route the same way. Fixes large gaps between list items in AI HTML lists.
26
+
27
+ **Navigation & misc**
28
+
29
+ - "Back" now returns to the view the visitor drilled in from (home, messages, a category, another article) instead of a fixed section index.
30
+ - The home "Latest news" block opens the tapped post directly instead of the News tab.
31
+ - Tap a message bubble to reveal its sender + time.
32
+
33
+ ## 1.1.5
34
+
35
+ ### Patch Changes
36
+
37
+ - 8041e58: Show the operator ETA while a handoff is pending. When an operator is assigned but hasn't joined yet, the widget now shows the estimated time to the first reply instead of a generic "please wait": a minutes figure (`operator_load`), a soft "we usually reply within a few minutes", or — when the team is offline / out of hours — an honest "the team will be back at {time}" (localized to the visitor's timezone). The `visitorChatAssignment` query and the realtime `assignment` event both carry the `estimate`, so the line is correct on first paint and stays current. New i18n keys added across all supported locales.
38
+
39
+ ## 1.1.4
40
+
41
+ ### Patch Changes
42
+
43
+ - 3e10bb5: Render inline HTML in AI chat messages. AI replies embed `<a>` / `<ul>` / `<pre>` fragments mid-text (not wrapped in a block tag), which previously showed as literal tags because the renderer only treated a message as HTML when it started with a tag. The message body now detects HTML anywhere and renders it through the same `html-react-parser` pipeline the article / operator HTML uses (markup becomes a React tree, `<script>` inert), while preserving the plain-text line breaks. External links open in a new tab; internal `/help/…` links keep routing inside the widget.
44
+
45
+ ## 1.1.3
46
+
47
+ ### Patch Changes
48
+
49
+ - 38321be: fix: don't run the demo unread-peek while the config is still loading. The base
50
+ state is `isDummy: true` until the BE config lands, so on live that transient
51
+ window rendered demo content and logged `MISSING_MESSAGE: demo.*` (demo strings
52
+ are intentionally omitted from live for perf). The peek now waits for the config
53
+ to resolve — live stays demo-free, no console error.
54
+
55
+ ## 1.1.2
56
+
57
+ ### Patch Changes
58
+
59
+ - 5a6d67d: a11y: fix "aria-hidden element must not contain focusable elements" — the closed
60
+ panel is now `inert` (its nav/links leave the tab order + a11y tree while hidden),
61
+ and the launcher's unread-count badge is `aria-hidden` so it no longer mismatches
62
+ the button's accessible name.
63
+
64
+ ## 1.1.1
65
+
66
+ ### Patch Changes
67
+
68
+ - d09ab70: Flow button fixes.
69
+
70
+ - **Resume flow by value**: quick-reply clicks now send the button's `value` (`buttonValue`) so the BE resumes the flow deterministically instead of matching the raw label — fixes "sometimes the button works, sometimes the AI answers".
71
+ - **Button types**: `url` buttons open the link in a new tab and `phone` buttons dial `tel:` — neither posts to the chat (previously every button was treated as a callback, so a `url` tap silently ended the flow). `type` / `url` / `phoneNumber` now carry through both the history and live-SSE mappers.
72
+ - **Always-render link buttons**: `url` / `phone` buttons render regardless of whether the message is the active flow step; `callback` buttons stay gated to the active step.
73
+ - **Affordance**: `url` / `phone` buttons show an external-link / phone glyph.
74
+
75
+ ## 1.1.0
76
+
77
+ ### Minor Changes
78
+
79
+ - db2d14c: Operator handoff status in the visitor widget, a news read/unread indicator, and a message-persistence fix.
80
+
81
+ - **Operator handoff**: the visitor now sees the live state of a human handoff — a "an operator has been assigned, please wait…" line while pending, a centered system message with the operator's name + avatar when connected (survives reload), and a "resolve conversation" action in the header. Resolution is attributed ("resolved by you" / "by {operator}") and driven by a new `visitorChatAssignment` query, a `kind: "assignment"` realtime event, and a `resolveVisitorChat` mutation.
82
+ - **News unread indicator**: a countless dot on the launcher and the News tab when the newest post hasn't been seen (tracked in localStorage; visiting the News tab clears it). On the launcher it folds into the message count (+1) when there are also unread messages. Only shown when the News tab is enabled and posts exist.
83
+ - **Fix**: in-session messages no longer disappear when the widget unmounts/remounts on an SPA re-navigation — the chat-history query now refetches on mount instead of serving a stale cache-first page.
84
+ - New handoff/news i18n keys added across all supported locales.
85
+
86
+ ## 1.0.29
87
+
88
+ ### Patch Changes
89
+
90
+ - 7aeb4e6: Fix mobile file uploads and false "microphone access denied".
91
+
92
+ **File uploads (mobile).** The upload allow-list rejected iOS camera
93
+ captures — photos default to HEIC/HEIF, videos to QuickTime (`.mov`),
94
+ voice memos to `audio/mp4` (`.m4a`) — and any file the browser reported
95
+ with an empty `File.type` (common on mobile). The client and backend
96
+ allow-lists now cover HEIC/HEIF, QuickTime, 3GPP and WebM video, plus
97
+ `audio/mp4`/`audio/wav`; an empty `File.type` now falls back to the
98
+ filename extension, and the resolved MIME is sent to the backend so it
99
+ no longer 415s on an empty type.
100
+
101
+ **Microphone.** The iframe loader was missing `microphone` in its `allow`
102
+ attribute, so the browser blocked `getUserMedia` via Permissions-Policy
103
+ and the recorder reported "microphone access denied" even when the
104
+ visitor never denied it. Added `microphone` to the iframe `allow`, and
105
+ the recorder now separates a real permission denial from missing-device,
106
+ busy-device and insecure-context failures.
107
+
108
+ ## 1.0.28
109
+
110
+ ### Patch Changes
111
+
112
+ - 844d503: v1.0.28 — Real fix for missing input borders + other styling regressions in Shadow DOM contexts. v1.0.27's `:host` mirror block was insufficient.
113
+
114
+ **Diagnosis (now actually correct).** Tailwind v4 removed the explicit `*, ::before, ::after { --tw-border-style: solid; … }` reset block that v3 used. Instead it relies on `@property --tw-border-style { initial-value: solid; }` declarations to provide the same defaults globally.
115
+
116
+ The CSS spec says `@property` registers properties at the document level, and the registered `initial-value` applies wherever the property isn't explicitly set — including inside Shadow DOM. In practice, Chromium's implementation of `@property` resolution from **adopted stylesheets** does NOT propagate initial-values into Shadow DOM children. So `var(--tw-border-style)` resolves to empty string inside the widget's Shadow DOM, `border-style: ""` evaluates to `none`, and every `border` utility paints an invisible border.
117
+
118
+ Same root cause hits every Tailwind utility implemented as `var(--tw-*)`: shadows, gradients, scale/rotate transforms, ring widths, leading, tracking, drop-shadows, backdrop filters. The visible-only-some-styling-broken pattern users reported was exactly the set of utilities NOT using `--tw-*` vars (basic colors via `--color-wx-*`, basic spacing) rendering fine, while the variable-driven ones broke.
119
+
120
+ The iframe-mount path (cdn-loader) was unaffected because its CSS lives in the iframe's actual document where `@property` registration works normally.
121
+
122
+ **Fix.** A `:host *, :host ::before, :host ::after { … }` block in `globals.css` explicitly sets every Tailwind v4 default that the `@property` system was supposed to provide. The full list is mirrored from Tailwind's own `::backdrop` defaults block (which Tailwind emits for the `::backdrop` pseudo-element specifically — apparently they hit the same Chromium limitation there).
123
+
124
+ This block needs to stay in lockstep with Tailwind v4's evolution — if Tailwind adds a new internal CSS variable, we need to mirror its default here too. The comment block in `globals.css` flags the maintenance contract.
125
+
126
+ **Verified locally** — both `widget.js` (web-component bundle, consumed by Vue / Angular / Ember / loader) and `widget-react.js` (React-direct bundle, consumed by the React npm package) now contain the explicit `:host *` reset.
127
+
128
+ **Note on language switcher.** Previously reported as "broken" alongside the styling issues — likely a downstream symptom of the same Shadow DOM CSS variable issue: the dropdown's clickable area was invisible because `border` / `ring` / `shadow` utilities had no effect, so users were clicking on a styled-by-text-only target. After this fix the dropdown UI should be tappable normally. If language still doesn't switch after v1.0.28 retest, that's a separate bug to chase.
129
+
130
+ ## 1.0.27
131
+
132
+ ### Patch Changes
133
+
134
+ - efc87a5: v1.0.27 — Three critical fixes that v1.0.24-v1.0.26 missed.
135
+
136
+ **1. Shadow DOM CSS variables — the real cause of "missing input borders, broken styling" reports.**
137
+
138
+ Tailwind v4's `@theme inline` block emits `--color-wx-bg`, `--color-wx-border`, etc. ONLY under the `:root` selector. When the widget's stylesheet is adopted into a Shadow DOM (via `adoptedStyleSheets` — used by the `<wexio-widget>` direct embed AND the `<WexioWidget />` React portal), `:root` doesn't match anything inside that scope. Every Tailwind utility class that resolves to `var(--color-wx-*)` (which is most of them) falls back to its undefined-variable default — invisible borders, transparent surfaces, broken focus rings.
139
+
140
+ The iframe-mount path (cdn-loader) was unaffected because its CSS lives in the iframe's actual document where `:root` matches `<html>`.
141
+
142
+ Fix:
143
+
144
+ - A `:host { … }` mirror block in `app/globals.css` duplicates every variable mapping for Shadow DOM consumers.
145
+ - The dark-mode block is now `:host([data-theme="dark"]), [data-theme="dark"] { … }` so the variable overrides apply when `data-theme="dark"` is set on either `<html>` (iframe path) or the `<wexio-widget>` host element (Shadow DOM path).
146
+ - The Tailwind dark variant is extended to `&:where([data-theme="dark"], [data-theme="dark"] *, :host([data-theme="dark"]) *)` so dark-mode utility classes (`dark:bg-wx-bg`, etc.) fire on Shadow DOM children when the host has the data-attribute.
147
+
148
+ **2. `loader.js` fixes from v1.0.24 reapplied.**
149
+
150
+ The `pk_demo` short-circuit + conditional iframe chrome (`applyChromeForSize`) that shipped in v1.0.24's release notes never actually landed in the deployed bundle — a `git checkout -- public/widget/` to discard locally-rebuilt artifacts also reverted the loader.js edits, and only the changeset file made it into the commit. v1.0.25/v1.0.26 published with the same broken loader. v1.0.27 ships the actual fix:
151
+
152
+ - `pk_demo` short-circuit: skip the BE round-trip + 404 entirely.
153
+ - `applyChromeForSize(width, height)`: bare iframe at launcher size (72×72), card chrome at panel size (400×640), runs on initial mount AND on every `wexio:widget:resize:v1` postMessage.
154
+ - `app/globals.css` `html, body` `background: transparent` (was `var(--wx-bg)`): the iframe document background no longer paints a white square BEHIND the dark launcher button. The panel surface itself stays opaque via `bg-wx-bg` on `<WidgetShell>`'s panel container.
155
+
156
+ **3. Ember addon misdetection defenses.**
157
+
158
+ User reports of `An addon must define a 'name' property` persisted through v1.0.25's `ember-addon` keyword removal (verified via `npm view ... keywords` — the published manifest is clean). Belt-and-braces:
159
+
160
+ - Drop the optional `ember-source` peer dep (we use vanilla DOM APIs; no actual dependency).
161
+ - Drop the `ember` keyword (could trigger heuristic detection in some ember-cli versions).
162
+ - Add a `name: "@wexio/messenger-widget-ember"` field to the CJS module.exports as a safety net — if ember-cli still decides to introspect our package as an addon for any reason, the missing-name check at least doesn't blow up.
163
+
164
+ If the user still sees the error after v1.0.27, StackBlitz's npm cache is serving a stale older version (possible workaround: bump the example's package.json to `^1.0.27` to force-refresh).
165
+
166
+ ## 1.0.26
167
+
168
+ ### Patch Changes
169
+
170
+ - 7cfd905: v1.0.26 — `@wexio/messenger-widget-vue` switches to runtime-inject pattern (matches Angular + Ember in v1.0.24).
171
+
172
+ **Background.** v1.0.23 / v1.0.24 of the Vue wrapper static-imported `./widget.js` (the web-component runtime bundle) at the top of the package's entry file. That bundles the runtime into the consumer's Vite app via Vite's automatic dependency pre-bundling — esbuild walks `node_modules/@wexio/messenger-widget-vue/dist/widget.js`, re-processes it, and produces a flattened chunk that ships alongside the consumer's app code.
173
+
174
+ That round-trip appears to mangle the widget's inlined Tailwind v4 stylesheet string. Symptoms reported on real StackBlitz sandboxes: input borders missing, language switcher inert, partial styling on the visitor's profile tab. The exact same `widget.js` runs cleanly when loaded directly from `cdn.wexio.io/widget/widget.js` (the iframe / `<wexio-widget>` direct embed path) — so the bundle's build output isn't broken, the round-trip through consumer's esbuild is.
175
+
176
+ **Fix.** Vue wrapper now matches the Angular + Ember v1.0.24 pattern: an `ensureRuntime()` helper appends `<script type="module" src="https://cdn.wexio.io/widget/widget.js">` to `<head>` on first `onMounted`, idempotent via a marker attribute. The widget loads from its native origin (where its build output is untouched), the browser caches the module for subsequent components, and Vite's pre-bundling never sees the runtime.
177
+
178
+ **Package size:** drops from ~688 KB (3 MB unpacked) to ~6 KB (~12 KB unpacked). The widget bundle itself isn't smaller — it just lives on the CDN now, where it always did for the iframe / web-component paths.
179
+
180
+ **No prop / event API changes.** Consumers' Vue templates and event handlers work unchanged.
181
+
182
+ **React is unchanged in this patch.** The `@wexio/messenger-widget-react` bundle is the React tree itself (not a wrapper around a web component), so the same fix doesn't apply — it'd require an architectural split. A user report of partial styling in React tracks under follow-up investigation; tracked separately.
183
+
184
+ ## 1.0.25
185
+
186
+ ### Patch Changes
187
+
188
+ - afc092e: v1.0.25 — fix(ember): drop `ember-addon` keyword so ember-cli stops trying to instantiate it as an addon.
189
+
190
+ v1.0.24 carried `"keywords": ["ember-addon", …]` over from the initial scaffold. Ember CLI scans every installed package's `keywords` array for `ember-addon` and tries to construct an addon object from packages that have it — calling the addon's `index.js` as a constructor and reading a `name` property. The Wexio Ember package is a plain library (just exports `WexioWidgetService`), so the construct path fails:
191
+
192
+ ```
193
+ An addon must define a `name` property
194
+ (found at .../node_modules/@wexio/messenger-widget-ember/dist).
195
+ ```
196
+
197
+ Removing the keyword lets ember-cli treat the package as a regular dependency. The remaining keywords still surface the package in relevant npm searches (`wexio`, `chat`, `ember`, `custom-element`).
198
+
199
+ No code changes — keyword-only. Fixed group means React/Vue/Angular get a no-op version bump for consistency.
200
+
201
+ ## 1.0.24
202
+
203
+ ### Patch Changes
204
+
205
+ - bc1914e: v1.0.24 — Five fixes, four packages affected, one bundle untouched.
206
+
207
+ **1. `loader.js` `pk_demo` short-circuit.** When `data-public-key="pk_demo"` (or `?pk=pk_demo` forwarded into the loader's bootstrap), the loader now SKIPS the `GET /api/web/config/:pk` BE round-trip entirely and mounts the iframe immediately. The iframe app already recognised the sentinel (v1.0.23) and rendered `DEMO_CONFIG`, so the fetch was a noisy 404 that delayed the launcher mount for zero benefit.
208
+
209
+ **2. `loader.js` conditional iframe chrome.** The loader used to paint `border-radius` + `box-shadow` + opaque background on the iframe unconditionally. Correct at 400×640 panel dimensions (looks like a floating card), wrong at 72×72 launcher dimensions (stacks a "white card" behind the dark launcher button — visible in iframe mode, invisible in web-component mode). New `applyChromeForSize(width, height)` helper toggles chrome on a 200 px threshold and runs on initial mount AND every `wexio:widget:resize:v1` postMessage, so the transition fires the instant the visitor opens / closes the panel. Net: `<script src=".../loader.js" data-public-key="pk_demo">` now renders a launcher pixel-identical to `<wexio-widget public-key="pk_demo">`.
210
+
211
+ **3. `@wexio/messenger-widget-angular` rebuilt with `ng-packagr`.** v1.0.23 used `ts.transpileModule` (lightweight, no `@angular/core` resolution at publish time) which emitted `__decorate(Component({...}))` calls. That worked in JIT dev mode but Angular's AOT compiler couldn't read `standalone: true` from those calls — StackBlitz reproduced as `TS-992012: Component imports must be standalone components`. ng-packagr is the only sustainable path for an Angular library on npm: it produces FESM2022 bundles + Angular Package Format partial-compilation `.d.ts` with `ɵɵComponentDeclaration<…, true, never>` (the `true` = standalone) that AOT recognises. The `widget.js` runtime is no longer bundled in the package — the component runtime-injects a `<script type="module">` on first `ngAfterViewInit` (idempotent via marker attribute). Net: drops the package from ~3 MB to 13.6 KB AND fixes the AOT failure.
212
+
213
+ **4. `@wexio/messenger-widget-ember` dual-build ESM + CJS, no widget runtime in package.** v1.0.23 shipped only ESM (`type: "module"`), which broke `ember serve` for every consumer — Ember CLI's `package-info-cache` scan uses synchronous `require()` to read every installed package, and `require()` of pure ESM throws `require() of ES Module … not supported`. v1.0.24 ships both `dist/index.js` (ESM) and `dist/index.cjs` (CJS) routed via the package.json `exports` map. The `widget.js` runtime was removed from the bundle (CJS-can't-require-ESM means re-introducing the side-effect import would re-introduce the bug); the `WexioWidgetService` class now runtime-injects the script on first construction, mirroring the Angular pattern.
214
+
215
+ **5. CI dist-repo sync layout commentary.** `release.yml` Angular sync step keeps the same `dist/` nesting it had before — ng-packagr's output lives at `packages/angular/dist/` root (FESM + esm2022 + .d.ts), and the source `package.json` paths now use `./dist/fesm2022/…` so the published tarball + dist-repo mirror agree.
216
+
217
+ **Examples repo follow-up** — `wexiohub/web-widget-examples` got matching updates:
218
+
219
+ - Angular example `src/index.html` adds a `<script type="module" src="https://cdn.wexio.io/widget/widget.js"></script>` to load the runtime in parallel with Angular bootstrap (runtime-inject by the component is a fallback for consumers who don't add the script).
220
+ - Ember example same: `<script>` tag added to `app/index.html`, side-effect import removed from `app/app.js`.
221
+ - README reordered to put **StackBlitz first for framework examples** (where it works reliably) and **CodeSandbox first for static examples** (where Pitcher-microVM isn't needed).
222
+
223
+ Net: all 6 examples now have at least one working sandbox provider after this release.
224
+
225
+ ## 1.0.23
226
+
227
+ ### Patch Changes
228
+
229
+ - 5435f8b: `pk_demo` documentation sentinel — `publicKey="pk_demo"` now short-circuits to demo mode (same effect as omitting `publicKey` entirely, but self-documenting).
230
+
231
+ Until this change, the only way to render the bundled demo content was to omit `publicKey` from the component / web-component / loader. That's fine for production code where the value is dynamic, but in **examples, Storybook stories, and marketing pages** it reads ambiguously: `publicKey={undefined}` could mean "demo on purpose" or "I forgot to wire the env var".
232
+
233
+ After this change:
234
+
235
+ ```tsx
236
+ <WexioWidget publicKey="pk_demo" /> // ← reads "this is intentionally demo"
237
+ <wexio-widget public-key="pk_demo" /> // ← same on the web component
238
+ ```
239
+
240
+ The resolver in `lib/use-widget-config.ts` treats `"pk_demo"` as if `publicKey` were unset:
241
+
242
+ 1. Mode resolution falls through to `"demo"`.
243
+ 2. `fetchWebConfig` is NOT called — the BE never sees the sentinel, so no rejection round-trip.
244
+ 3. The bundled `DEMO_CONFIG` (operator-mode mock data) renders.
245
+
246
+ Backwards compatible — existing demos that omit `publicKey` continue to work unchanged.
247
+
248
+ Surfaces affected (single resolver change covers all of them):
249
+
250
+ - `@wexio/messenger-widget-react` — `<WexioWidget publicKey="pk_demo" />`
251
+ - `@wexio/messenger-widget-vue` — `<WexioWidget public-key="pk_demo" />`
252
+ - `@wexio/messenger-widget-angular` — `<wexio-widget-ng publicKey="pk_demo" />`
253
+ - `@wexio/messenger-widget-ember` — `<wexio-widget public-key="pk_demo">` in `.hbs`
254
+ - Web component (`widget.js`) — `<wexio-widget public-key="pk_demo">`
255
+ - Loader (`loader.js`) — `<script data-public-key="pk_demo">`
256
+ - URL param — `?pk=pk_demo`
257
+
258
+ The published examples at [`wexiohub/web-widget-examples`](https://github.com/wexiohub/web-widget-examples) now use this sentinel uniformly.
259
+
260
+ - 5435f8b: v1.0.23 — Native Vue 3, Angular, and Ember integrations alongside the existing React package.
261
+
262
+ All three new packages consume the same `widget.js` web-component bundle the React package already ships; the wrappers are intentionally thin (camelCase → kebab-attr binding, `CustomEvent` re-emit, imperative `identify()` passthrough). Same `WidgetShell` runtime, same Shadow-DOM isolation, same visitor-handshake flow.
263
+
264
+ - **`@wexio/messenger-widget-vue`** — `defineComponent({ ... })` wrapper with reactive `props.user` watch. Pure ESM JS, no SFC compilation step required. Consumers configure their Vue compiler's `isCustomElement` for `wexio-widget` (one-line Vite / Vue CLI / Nuxt snippet in the README).
265
+ - **`@wexio/messenger-widget-angular`** — Standalone `WexioWidgetComponent` (selector `wexio-widget-ng`) with `@Input()` / `@Output()` / `@ViewChild` plumbing and `CUSTOM_ELEMENTS_SCHEMA`. Drop into any standalone component's `imports`. Prepack uses `ts.transpileModule` (isolated-module pattern, no @angular/core resolution at publish time) to emit ES2022 JS with `__decorate` calls via `tslib`.
266
+ - **`@wexio/messenger-widget-ember`** — Tiny side-effect import + optional `WexioWidgetService` helper. Glimmer renders `<wexio-widget>` as a native DOM element, so no wrapper component needed — consumers use the element directly in `.hbs` templates with `{{on}}` for event binding.
267
+
268
+ All four wrapper packages are now in the changesets fixed-version group with `@wexio/widget-private`, so they version + publish together on every release (matching bundle hash → matching package version → no drift).
269
+
270
+ Public-boundary types match across all four wrappers: `VisitorIdentity`, `WexioWidgetProps`/`Inputs`, `WexioWidgetEmits`/`Outputs`. Each package hand-rolls its own `.d.ts` (no shared package — keeps each wrapper installable without pulling in the others). The CI boundary check (`scripts/check-public-boundary.mjs`) already covers them since the symbol allow-list is type-name-based, not package-bound.
271
+
272
+ ## 1.0.22
273
+
274
+ ### Patch Changes
275
+
276
+ - d215d27: v1.0.22 — Demo mode preference changes now propagate widget-wide (no more GraphQL mutations, no more tab-switch resets).
277
+
278
+ In v1.0.20 the Profile-tab demo got rendered but every preference change still fired the `UpdateVisitorProfile` GraphQL mutation, and the change was only visible inside the Profile tab itself — switching to another tab reset the language to the browser default and the theme to operator config. Two reasons:
279
+
280
+ 1. `useApplyPref` always called the Apollo mutation, no `isDummy` branch.
281
+ 2. The demo preference state lived inside `ProfileTab`'s local `useState`; `useThemeMode` / `useVisitorProfilePreferences` / `RuntimeIntlProvider` never saw it.
282
+
283
+ Fixes:
284
+
285
+ - **`useApplyPref`** now takes an optional `onDemoApply` callback. When provided (demo mode), the GraphQL mutation is SKIPPED entirely; the callback writes the change to a global bus + `setRuntimeLocale` still fires for language switches so the live `RuntimeIntlProvider` swap works the same as in live mode.
286
+ - **New `lib/runtime-demo-prefs.ts`** — module-level singleton bus (`setDemoPref` / `useDemoPrefs`) for visitor prefs in demo mode. Same pattern as `runtime-locale.ts`. Holds `themeMode`, `language`, `desktopNotifications`.
287
+ - **`useVisitorProfilePreferences`** accepts an `isDummy` flag. In demo mode it reads from the demo bus instead of the Apollo query (which is skipped). Theme + language + notification consumers across the widget shell see the visitor's demo selections via the same path they use in live mode.
288
+ - **Profile tab** — `applyDemoPref` writes through to `setDemoPref(key, value)` rather than a local `useState`. The `profile` memo merges the demo profile shell with the live bus snapshot so the Profile tab's own preference rows reflect the current bus state on re-mount.
289
+ - **`handleSave` + `handleAvatarFile`** — `isDummy` guards added. In demo mode "Save" flashes the saved chip + clears the edit flag without firing the mutation; avatar upload reads the file as a data URL for local preview only.
290
+
291
+ Net effect: changing language / theme / desktop-notifications in the demo Profile tab now flips the chrome immediately and the change persists across tab switches, with zero network calls. Identity-field edits ("Name", "Email", "Phone") commit locally too — save chip flashes, no mutation.
292
+
293
+ ## 1.0.21
294
+
295
+ ### Patch Changes
296
+
297
+ - 07b73e1: v1.0.21 — Hotfix the Profile-tab demo-mode render loop (regression in v1.0.20).
298
+
299
+ Opening the Profile tab in demo mode crashed the entire widget with React error #185 (`Maximum update depth exceeded`). The v1.0.20 demo-mode profile injection called `buildDemoVisitorProfile()` inline in the render body, creating a fresh object identity on every render. The downstream `useEffect([profile, hasEdits])` saw `profile` as "changed" every tick, called `setValues(seedValues(profile))`, triggered a re-render, the inline call produced another fresh object, and the loop never settled.
300
+
301
+ Memoised the demo profile via `useMemo([isDummy, locale])` — stable identity per locale, the seeding effect runs once on first paint and stays put.
302
+
303
+ ## 1.0.20
304
+
305
+ ### Patch Changes
306
+
307
+ - 371833d: v1.0.20 — Search input layout, Profile-tab demo mode, web-component lightbox styles, and demo FAQ URL update.
308
+
309
+ **Search input misalignment** — `StickySearchHeader` used an absolutely-positioned icon overlay, which in some Shadow DOM scroll contexts let the icon escape the containing block + pushed the placeholder text onto a second visual line. Switched to a clean flex layout — icon and input now sit on the same row regardless of scroll state or parent positioning. Same code path on Help, News, and any other tab using the header.
310
+
311
+ **Profile tab was a title-only placeholder in demo mode** — the `isDummy` short-circuit returned `<h1>{tabName}<p>{subtitle}` and bailed, hiding the avatar hero + field rows + preferences entirely. Now synthesises a `VisitorProfile` (`Avatar`, `Name`, `Email`, `Phone` fields + standard preferences) so the demo tab renders the full UI. Save / mutations are no-ops in demo (existing `isDummy` guards in the mutation paths handle it).
312
+
313
+ **Web-component lightbox rendered unstyled** — `<wexio-widget>` never set `env.themeRoot`, so `MediaLightbox`'s portal fell through to `document.body`. Tailwind classes (`bg-black/85`, `fixed`, `z-2147483647`) live in the Shadow DOM's adopted stylesheet and don't reach light-DOM nodes, leaving the lightbox as unstyled inline content visible below the widget panel. Now sets `themeRoot` to the Shadow DOM mount point — portal stays inside the widget's stylesheet scope, lightbox renders correctly. Same root cause as the v1.0.11 React-component fix.
314
+
315
+ **Demo FAQ snippet** — the bundled "Install the Wexio widget" article had `https://cdn.wexio.io/loader.js` in the code sample. Updated to the namespaced `https://cdn.wexio.io/widget/loader.js` to match the v1.0.15 CDN restructure. Both `demo.en.json` and `demo.uk.json` updated.
316
+
317
+ ## 1.0.19
318
+
319
+ ### Patch Changes
320
+
321
+ - a6e6fe7: v1.0.19 — `<wexio-widget mode="demo">` escape hatch + process polyfill on the React-component bundle.
322
+
323
+ **`widget-demo.html` was still hitting the API even with no `public-key`** — the web-component bundle has `NEXT_PUBLIC_WEXIO_DEMO_PK` inlined at widget-CI build time as the fallback PK. The bundle was auto-applying it and hitting `/api/web/config/pk_live_…`, turning the public demo into a hidden marketing-integration embed. Two fixes:
324
+
325
+ 1. **New `<wexio-widget mode="demo">` attribute** — forces the bundled mock content regardless of any PK that would otherwise auto-resolve (env-baked fallback, `?pk=` URL param, even a `public-key` attribute the host left on). When set, `useWidgetConfig` short-circuits the entire PK resolution chain (`env.publicKeyOverride`, `pkFromUrl`, `pkFromEnv` all suppressed) and falls straight through to `DEMO_CONFIG`. `widget-demo.html` now sets `mode="demo"` so the visible demo on `cdn.wexio.io` is a true visitor experience.
326
+ 2. **Process polyfill banner on the React-component bundle** — `widget-react-demo.html` was throwing `ReferenceError: process is not defined` at `widget-react-<hash>.js:17:262`. Same polyfill banner the web-component got in v1.0.18 is now on the React bundle too — adds `globalThis.process = { env: {}, nextTick, emit }` at the top of every output file if missing. Transitive deps that touch `process.env.X` / `process.nextTick` / `process.emit` no longer crash on ESM-CDN standalone loads (the npm + Next consumer path is unaffected; Next polyfills `process` itself before reaching this banner).
327
+
328
+ The React-component public surface still doesn't accept `mode` — that was deliberately removed in v1.0.6 for the public type surface. The new attribute is web-component only. The React-component standalone ESM-CDN path also relies on the chain working differently: `process.env.NEXT_PUBLIC_WEXIO_DEMO_PK` is NOT pre-substituted by Vite (since v1.0.17), so `readEnvOverride()`'s try/catch returns empty when no consumer bundler ran → `pkFromEnv` is empty → `publicKey` is undefined → demo mode auto-applies. `widget-react-demo.html` now renders the bundled demo without an explicit mode flag.
329
+
330
+ ## 1.0.18
331
+
332
+ ### Patch Changes
333
+
334
+ - 721874c: v1.0.18 — Vercel deploy recovery + `process is not defined` polyfill for the web-component bundle.
335
+
336
+ **Vercel deploys have been failing silently since v1.0.15** — every commit since June 10 deployed-failed, so `cdn.wexio.io` has been serving 14+ hour stale content (loader-demo.html that should have been deleted in v1.0.16 was still served; widget-react-demo.html was still showing pre-restructure URLs; the `/widget/v1.0.17/` directory 404'd). Three causes, all fixed:
337
+
338
+ 1. **Invalid `vercel.json` schema** — the chunk-rewrite block I added in v1.0.16 had a freeform `"comment"` field. Vercel's schema validator is strict (`Invalid vercel.json - rewrites[5] should NOT have additional property 'comment'`). The comment is gone; the rewrite still works.
339
+ 2. **151 MB of sourcemaps in `public/`** — the release workflow was copying `widget.js.map` into every `public/widget/v<ver>/` directory on each release. Each map is ~8 MB, 17+ versions = 151 MB of accumulated maps. The workflow now skips copying maps to pinned-version dirs (latest `widget.js.map` still ships on the CDN for debugging the current release; pinned older versions don't get one). 17 historical map files purged from git in this commit.
340
+ 3. **`bot@wexio.io` was rejected as a commit author** by Vercel's GitHub-user attribution (`GitHub user not found`). Workflow now uses `github-actions[bot]` + the matching `41898282+github-actions[bot]@users.noreply.github.com` no-reply address, which Vercel recognises cleanly.
341
+
342
+ **`process is not defined` crash on standalone widget.js** — transitive deps (Next runtime checks, EventEmitter shims) touch `process.env.X` / `process.nextTick` / `process.emit` with `X` not covered by our `define` block. The web-component bundle now has a one-line banner injected at the top: `if(typeof globalThis.process==="undefined"){globalThis.process={env:{},nextTick:fn=>setTimeout(fn,0),emit:()=>false}};` — runs once at module load, no perf cost, every dependency that touches `process` gets a safe stub.
343
+
344
+ After this release, the existing v1.0.15+ deploys that piled up on Vercel will all roll forward. The demo HTML pages (`widget-demo.html`, `widget-react-demo.html`) and the deleted `loader-demo.html` will reflect their actual repo state instead of pre-v1.0.15 content from the last successful deploy.
345
+
346
+ ## 1.0.17
347
+
348
+ ### Patch Changes
349
+
350
+ - d31bff9: v1.0.17 — Restore consumer-side env-var propagation for the React package (staging override regression from v1.0.16).
351
+
352
+ **Bug**: After v1.0.16 added Vite-side inlining of `process.env.NEXT_PUBLIC_WEXIO_API_URL` to fix the standalone web-component bundle's `ReferenceError: process is not defined`, the SAME inlining accidentally applied to the React-component bundle too. That burned in whatever the widget-CI build env had (almost always empty) BEFORE the consumer's Next/webpack could substitute from THEIR `.env`. Staging deployments setting `NEXT_PUBLIC_WEXIO_API_URL=https://staging.api.wexio.io` saw the var silently ignored — widget hit production API instead, got 404s on staging-only `pk_live_*` keys.
353
+
354
+ **Fix**: split the two Vite configs.
355
+
356
+ - **`widget.js`** (web-component, script-tag standalone) — Vite still inlines `NEXT_PUBLIC_*` so the bundle is safe to execute in a browser with no `process` global. Build-time env from widget-CI applies (empty → falls through to hostname auto-detect / production default, which is the right behaviour).
357
+ - **`widget-react.js`** (npm package consumed via Next/webpack) — Vite NO LONGER inlines `NEXT_PUBLIC_*`. The literal `process.env.NEXT_PUBLIC_WEXIO_API_URL` survives into `packages/react/dist/` so the deploying app's Next inlines from THEIR `.env` at THEIR build time. Vercel `NEXT_PUBLIC_WEXIO_API_URL` env vars now flow through.
358
+ - **Standalone ESM-CDN load** of `widget-react.js` (no consumer bundler ever ran) — `readEnvOverride()` in `lib/api.ts` wraps `process.env.*` reads in try/catch so the `ReferenceError` is caught and the resolver falls through to hostname auto-detect instead of crashing.
359
+
360
+ **Net effect**: `NEXT_PUBLIC_WEXIO_API_URL=https://staging.api.wexio.io` in Vercel's staging env now reaches the widget. The four lower precedence levels (`local.*.wexio.io`, `*.wexio.io` derived `api.*`, plain `localhost`, prod fallback) are unchanged.
361
+
362
+ ## 1.0.16
363
+
364
+ ### Patch Changes
365
+
366
+ - b4f35d9: v1.0.16 — Followups to the 1.0.15 CDN restructure.
367
+
368
+ **`process is not defined` runtime crash in the web-component bundle** — `widget.js` is loaded directly by host browsers via `<script type="module">`, with no Next.js / webpack to inline `process.env.NEXT_PUBLIC_*` at consume time. Two source references (`process.env.NEXT_PUBLIC_WEXIO_API_URL` in `apiBase()`, `process.env.NEXT_PUBLIC_WEXIO_DEMO_PK` in `useWidgetConfig`) were surviving into the bundle and crashing on first call. Vite's `define` block in both library configs (web-component + React-component) now stringifies both vars so they're statically replaced at build time. Same fix for `widget-react.js` so the ESM CDN path also runs standalone.
369
+
370
+ **Demo HTML pages were 404'ing chunks** — `widget-react-demo.html` imported from the legacy flat URL `/widget-react.js`. The Vercel rewrite served the main bundle, but the bundle's internal dynamic-import chunks resolve relative to the URL it was LOADED FROM (`cdn.wexio.io/widget-react-<hash>.js`) — and those flat-path chunks 404 because the files live under `/widget/`. Two fixes: (1) Demo pages now import from `/widget/widget-react.js` and `/widget/widget.js` directly (no rewrite hop, chunks resolve correctly). (2) Added chunk-level rewrites to `vercel.json` (`/widget-react-:hash.js` → `/widget/widget-react-:hash.js`) so existing customer embeds pinned to the legacy URL keep working without their host needing to update.
371
+
372
+ **`loader-demo.html` deleted** — it was a `next dev`-only harness (`data-public-key="demo"` against a BE key that doesn't exist + `data-origin="http://localhost:3000"`) that couldn't possibly work on the production CDN. Customers visiting `cdn.wexio.io/widget/loader-demo.html` saw a localhost iframe target + a 404 from the BE config endpoint.
373
+
374
+ **Welcome page generalised** — `cdn.wexio.io/` will host non-widget Wexio products too, so the welcome blurb no longer reads as widget-specific. Now says "Static asset host for Wexio products" + mentions the per-product namespacing (`/widget/…`).
375
+
376
+ **.gitignore cleanup** — the 1.0.15 commit accidentally tracked the React-component build outputs (chunks + main + sourcemap) because `.gitignore` still referenced the old `/public/widget.js` paths. Updated to match the new `/public/widget/...` layout; previously-tracked outputs were removed with `git rm --cached`. CI rebuilds these on every deploy, so removing them from the repo doesn't affect production — just stops bloating commits.
377
+
378
+ - 1187cd7: `apiBase()` default fallback is now `https://api.wexio.io` instead of `http://localhost:3001`.
379
+
380
+ Customer sites embedding the widget (any origin that isn't `*.wexio.io`, `localhost`, or `127.0.0.1`) without an explicit `NEXT_PUBLIC_WEXIO_API_URL` override were falling through to the localhost fallback — a BE the customer obviously isn't running. Every config / GraphQL call from the widget on their host page failed silently.
381
+
382
+ New resolution chain:
383
+
384
+ 1. `NEXT_PUBLIC_WEXIO_API_URL` env override (wins outright)
385
+ 2. `local.*.wexio.io` host → cert-backed `https://local.api.wexio.io:3443`
386
+ 3. Any `*.wexio.io` host → derived `api.<rest>.wexio.io` (e.g. `staging.app.wexio.io` → `staging.api.wexio.io`)
387
+ 4. Plain `localhost` / `127.0.0.1` → `http://localhost:3001` (next dev / Storybook / CI)
388
+ 5. Anything else → `https://api.wexio.io` (production)
389
+
390
+ Bucket 5 is new — previously it was the localhost fallback. SSR fallback also bumped from localhost to prod (safer default; the widget never fetches during SSR anyway, but tooling that touches this code is happier with a real URL).
391
+
392
+ ## 1.0.15
393
+
394
+ ### Patch Changes
395
+
396
+ - 9bb3b97: v1.0.15 — CDN URL restructure.
397
+
398
+ All script bundles now live under a dedicated `/widget/` namespace on the CDN. **Existing customer embeds keep working unchanged** — Vercel rewrites alias every legacy flat URL onto the new structure.
399
+
400
+ **New canonical URLs:**
401
+
402
+ | Surface | URL |
403
+ | --------------------------------- | ----------------------------------------------- |
404
+ | Script-tag loader (iframe) | `https://cdn.wexio.io/widget/loader.js` |
405
+ | Web Component | `https://cdn.wexio.io/widget/widget.js` |
406
+ | ESM CDN of React component | `https://cdn.wexio.io/widget/widget-react.js` |
407
+ | Pinned version (any of the above) | `https://cdn.wexio.io/widget/v1.0.15/loader.js` |
408
+
409
+ **Legacy URLs (still serve the same files, via rewrites):**
410
+
411
+ - `cdn.wexio.io/loader.js` → `/widget/loader.js`
412
+ - `cdn.wexio.io/widget.js` → `/widget/widget.js`
413
+ - `cdn.wexio.io/widget-react.js` → `/widget/widget-react.js`
414
+ - `cdn.wexio.io/loader@1.0.15.js` → `/widget/v1.0.15/loader.js`
415
+ - `cdn.wexio.io/widget@1.0.15.js` → `/widget/v1.0.15/widget.js`
416
+
417
+ **What changed on disk:**
418
+
419
+ - `public/loader.js` → `public/widget/loader.js` (source)
420
+ - `public/loader@1.0.X.js` + `public/widget@1.0.X.js{,.map}` → `public/widget/v1.0.X/{loader,widget}.js{,.map}` (committed pinned versions, ~50 historical files migrated)
421
+ - `public/*-demo.html` → `public/widget/*-demo.html`
422
+ - Build outputs land in `public/widget/` instead of `public/` — both Vite configs updated.
423
+ - Release sync step in `.github/workflows/release.yml` writes pinned copies to `public/widget/v<ver>/` going forward.
424
+ - Runtime assets (`sounds/`, `logo-*.png`, `marketing/`) STAY at `public/` root — they're version-independent and `assetUrl()` references them via unversioned URLs.
425
+
426
+ No widget API / behaviour change. Pure infrastructure cleanup.
427
+
428
+ ## 1.0.14
429
+
430
+ ### Patch Changes
431
+
432
+ - e68f4c4: v1.0.14 — Strip demo content from production bundle path + CDN cleanup.
433
+
434
+ **Demo translations are now fully lazy** — `messages/demo.{en,uk}.json` (~52 KB raw / ~16 KB gzipped) was statically imported by the React-component and web-component entry points and baked into `LOCALE_MESSAGES` for every supported locale. Production visitors with a real `publicKey` never run any code that READS the demo namespace, but the JSON content was still downloaded because the static import made it an eager dependency. Now the entry points ship an empty `demo: {}` stub (just enough to satisfy `useTranslations("demo")`'s hook contract); the real demo namespace is dynamic-imported by `<DemoMessages>` ONLY when `isDummy === true` (no `publicKey` → marketing-page demo flow). Demo-mode visitors pay a one-time ~7 KB gzipped chunk fetch on widget open.
435
+
436
+ **CDN home page no longer paints a widget** — `cdn.wexio.io/` (bare visit, no query params) previously rendered `<WidgetShell />` regardless of whether anyone meant to embed a widget. Curious visitors arriving directly at the CDN domain saw a stray chat panel with no context. Now bare `/` serves a small server-rendered welcome blurb with links to `wexio.io` / docs. `/?pk=…` and `/?mode=preview` (the iframe-loader and dashboard-preview targets) keep rendering the widget tree as before — no embed behaviour change.
437
+
438
+ **Three dev-harness routes removed** — `/auth`, `/inject`, `/live` were `next dev`-only harnesses for testing JWT/HMAC auth flows + the `configBase` injection path + the BE-fetch config path. None of them ship behaviour useful in production. Deletions trim the deploy and remove three SSR routes from Vercel's function surface.
439
+
440
+ ## 1.0.13
441
+
442
+ ### Patch Changes
443
+
444
+ - 577fcd0: v1.0.13 — Quick-actions inline layout polish.
445
+
446
+ **Cap raised from 4 → 8** to match the dashboard's max-buttons setting. With 5–8 tiles the layout wraps to a second row at 4 columns so per-tile size stays consistent.
447
+
448
+ **Fixed tile height** — was `aspect-square` (tile height = tile width), which ballooned to 150–200px tall when only 2–3 tiles shared a row. Now a fixed `h-24` (96px) regardless of count — comfortable room for the 36px icon chip + caption + chrome padding without towering over the home tab.
449
+
450
+ ## 1.0.12
451
+
452
+ ### Patch Changes
453
+
454
+ - bd8647c: v1.0.12 — Home-block item caps now honour operator intent.
455
+
456
+ **`help-search` in manual mode** — the explicit `articleIds[]` list was being silently sliced by the abstract `maxItems` knob. An operator who listed 8 articles + had `maxItems: 4` (a leftover default from when the mode was popular/recent/category) saw only the first 4 rendered. The block now treats the explicit list as the source of truth in manual mode and ignores `maxItems` entirely; `maxItems` still controls the popular / recent / category modes (where there's no operator-supplied list and the BE returns a sorted feed). Sanity-capped at 10.
457
+
458
+ **`pinned-articles`** — hardcoded `slice(0, 5)` raised to 10 so longer pinned lists render in full.
459
+
460
+ **`news-preview`** — cap raised from 6 to 10 for consistency.
461
+
462
+ 10 is the "home tab shouldn't fill with hundreds of rows on a config typo" sanity ceiling; well above the 3–8 range operators actually use. Operators with longer feeds should link visitors into the dedicated Help / News tab via the block's "See all" affordance.
463
+
464
+ ## 1.0.11
465
+
466
+ ### Patch Changes
467
+
468
+ - d8f7fc2: v1.0.11 — Lightbox stacking fix in React-component embed.
469
+
470
+ The v1.0.9 launcher-position fix flipped `env.embedded` from `true` → `false` for production React embeds. The lightbox was using `embedded` to decide its portal target — `false` portaled the overlay to `document.body`, OUTSIDE the widget's Shadow DOM where the Tailwind stylesheet lives. As a result the overlay's `position: fixed`, `z-2147483647`, and `bg-black/85` classes silently became no-ops, and the lightbox rendered as plain unstyled inline content — visible behind the host page's sticky header and the widget panel.
471
+
472
+ Fix: decouple the portal target from the `embedded` layout flag. The overlay now portals into `env.themeRoot` (the Shadow DOM root) whenever one is available — Tailwind classes resolve to real CSS, `position: fixed` still anchors to the viewport from inside the Shadow tree, and `z-2147483647` puts the overlay above the host page chrome and the widget panel (at z-2147483601). Iframe build keeps falling through to `document.body` (no Shadow DOM there, but the iframe body owns the stylesheet anyway).
473
+
474
+ No API surface change — visitors who tap an image in a chat now see the dark full-viewport overlay correctly.
475
+
476
+ ## 1.0.10
477
+
478
+ ### Patch Changes
479
+
480
+ - b60a0d9: v1.0.10 — Retry flicker fix, dropdown stacking + scroll-lock fix, `onResize` loop fix.
481
+
482
+ **Retry no longer reloads the widget** — clicking the auth-error popup's Retry button used to clear `session.error` and set `isAuthenticating=true` in the same tick, which tripped the `authReady` gate (`!!token || !!error`) and unmounted the entire widget for a moment. Now `authReady` is a one-way latch (`useRef`) — once we've ever reached ready, we stay ready for the rest of the mount. Visitors see just the launcher spinning during retries, not a full widget reload.
483
+
484
+ **Profile-tab language picker opens correctly + host scroll stays alive** — two related Radix Select issues in the Shadow-DOM React-component embed:
485
+
486
+ - Dropdown was opening but rendering behind the widget panel (panel z-index `2147483601`, dropdown z-index `10000`). Bumped dropdown to `2147483602`.
487
+ - Radix `Select.Root` defaults to `modal={true}`, which writes `overflow: hidden` to `document.body` — that lock LEAKED through the Shadow DOM to the host page, freezing the visitor's scroll. The `<Select>` wrapper now defaults to `modal={false}` (outside-click + Escape still close the dropdown via Radix's non-modal path).
488
+
489
+ **`onResize` no longer fires on every host re-render** — the resize effect's deps included the whole `env` object. Hosts that pass inline `user={…}` / `configOverride={…}` props to `<WexioWidget>` churn the env's `useMemo` on every render, including window-resize-triggered re-renders, so `onResize` was firing on every host repaint with unchanged dimensions. Switched to a `useRef` for the callback; effect now fires only when widget dimensions actually change (open ↔ closed ↔ expanded).
490
+
491
+ ## 1.0.9
492
+
493
+ ### Patch Changes
494
+
495
+ - d615857: v1.0.9 — Launcher anchoring fix, invalid-publicKey hide, z-index lift.
496
+
497
+ **Launcher position** — React-component embed in `production` / `demo` mode now anchors the launcher + panel to the viewport (`fixed`), matching standard chat-widget conventions. Previously every React embed was treated as "embedded" (container-anchored via `absolute`) so the launcher could land mid-page next to the host's own header. Dashboard preview pane keeps the container-anchored behaviour via `mode === "preview"`.
498
+
499
+ **Invalid publicKey hides the widget** — when the BE returns 404 / 403 for `GET /api/web/config/:pk`, the widget now renders nothing instead of silently falling back to bundled demo content. A real visitor browsing a misconfigured host page sees an empty rectangle (the operator's signal to fix the key) instead of a working-looking messenger that talks to no one. Legitimate no-`publicKey` marketing demos still show bundled content as before.
500
+
501
+ **Z-index lift** — launcher, panel, launcher-peek bubble, and auth-error popup all moved into the `2147483599 – 2147483601` range so they reliably float above sticky host headers, full-page modals, cookie banners, and other top-layer host chrome. Previously the launcher sat at `z-50` and the panel had no `z-index` at all, so a host `<header class="z-50 sticky">` could clip the widget.
502
+
503
+ **New surface field** — `useWidgetConfig()` returns an additional `error: "publicKeyInvalid" | null` discriminator (private surface). Public package consumers don't see it on the type — the widget self-hides via the shell.
504
+
505
+ ## 1.0.8
506
+
507
+ ### Patch Changes
508
+
509
+ - 0fc6dd0: v1.0.8 — Locale UX overhaul, greeting / block-title localization, brand-icon expansion.
510
+
511
+ **Locale picker UX** — always visible in the Profile tab and always lists the full 33-locale set; dropped the gates on `localeStrategy === "DEFAULT"` and `config.supportedLocales` (the operator's `supportedLocales` only filters article-language variants, not UI chrome). The visitor's saved choice already wins over operator strategy via the cookie precedence chain — that resolution is unchanged.
512
+
513
+ **Immediate locale switch** — both the React-component and web-component embeds now subscribe to the runtime-locale bus so a Profile-tab language save flips the UI live (no remount, no reload). Previously only the iframe path's `RuntimeIntlProvider` heard the signal.
514
+
515
+ **Operator-text localization (greeting + block titles)** — when the visitor's UI locale doesn't share a base language with the integration's `defaultLocale`, the widget swaps operator-written strings for bundled per-locale translations. An English-only operator greeting no longer leaks into a French / Japanese / Arabic session. Affects `config.greeting.{headline,subheadline}` and `block.title` / `block.subtitle` on Quick Actions, Help Search, Pinned Articles, News Preview, Featured Article, Ask Question, Recent Message. New helper: `localizeConfigText` / `useConfigLocalizer` in `lib/localize-config-text.ts`.
516
+
517
+ **Brand icons** — 6 new real brand SVGs added: `line`, `facebook`, `twitter` (current X glyph), `linkedin`, `reddit`, `tiktok`. Discord + Slack also got real SVGs (previously only had lucide fallbacks). `HomeQuickActionIcon` gained an optional `colored?: boolean` flag — `false` (default) renders monochrome via `currentColor` so the icon inherits the widget palette; `true` renders official brand colours, with full radial-gradient for Instagram, 4-quadrant multi-fill for Slack, and the cyan/magenta/black layered glyph for TikTok.
518
+
519
+ **Surface additions**: `HomeNamedIcon` extended with `line`, `facebook`, `twitter`, `linkedin`, `reddit`, `tiktok`. `HomeQuickActionIcon.colored?: boolean` (optional, defaults to `false` — backwards-compatible). Public `.d.ts` updated. Dashboard FE needs to update the icon picker to surface the new names + the colored toggle (see release notes / repo doc).
520
+
521
+ ## 1.0.7
522
+
523
+ ### Patch Changes
524
+
525
+ - 5e02004: Switch npm publish auth to OIDC Trusted Publisher. The release workflow no longer needs a long-lived `NPM_TOKEN` secret — GitHub Actions exchanges a short-lived OIDC token for a single-use publish credential, scoped to this repo + `release.yml`. No source / API changes; this is a CI / supply-chain hygiene release.
526
+
527
+ ## 1.0.6
528
+
529
+ ### Patch Changes
530
+
531
+ - 973358a: Drop `mode` from the public React-component surface. The hand-rolled `.d.ts` previously exposed `mode?: "production" | "demo"`, contradicting `entries/public.ts` which declares `PublicWidgetMode = "production"` only. The widget already auto-resolves to `production` when `publicKey` is set and `demo` (bundled mock content) otherwise — no host needs to force the mode explicitly. Hosts who want a marketing-page demo simply omit `publicKey`. The `preview` / `demo` modes remain on the private surface for the dashboard preview pane.
532
+
533
+ ## 1.0.5
534
+
535
+ ### Patch Changes
536
+
537
+ - 77c6b95: v1.0.5 — Locales, Cloudflare Turnstile, and live-preview correctness.
538
+
539
+ **32 new UI locales** — German, Spanish (+ `es-MX`), French, Italian, Dutch, Portuguese (+ `pt-BR`), Swedish, Danish, Norwegian, Finnish, Polish, Czech, Slovak, Turkish, Romanian, Hungarian, Greek, Arabic, Hebrew, Hindi, Thai, Vietnamese, Indonesian, Japanese, Korean, Chinese (`zh` + `zh-TW`), plus regional English variants `en-US` / `en-GB`. Region-tagged codes (`pt-BR`, `zh-TW`) now match exactly before falling back to the base language.
540
+
541
+ **Cloudflare Turnstile end-to-end** — config plumbing (`botProtection.turnstile`), lazy CF script loader, container anchored at the launcher corner, handshake gated on the resulting token, retry popup floating above the launcher on challenge failure. Hosts wire nothing — operator-controlled from the Wexio dashboard.
542
+
543
+ **Live-preview fixes** —
544
+
545
+ - `localeStrategy` / `defaultLocale` now reflect live in the dashboard preview (bypasses visitor `?lang=` / cookie escape hatches in `preview` mode so the operator's draft strategy actually wins).
546
+ - Theme tokens apply via `useLayoutEffect` (no flash on theme switch).
547
+ - Profile field re-order via `messenger.profile.fields[]`.
548
+ - `supportedLocales` allow-list filters the below-article language picker.
549
+ - `contentLocaleFallback: false` renders an empty "not translated" state instead of the default-locale body when the visitor's locale has no translation.
550
+ - Forced `themeMode: "light" | "dark"` hides the Profile-tab theme row entirely.
551
+ - All four `NextIntlClientProvider` instances pass `timeZone` (silences next-intl `ENVIRONMENT_FALLBACK` warnings).
552
+
553
+ **Public surface narrowed** — `locale`, `prefill`, `lightboxViewport` props removed from the React component (operator-side config + Profile-tab language switcher are now the source of truth). `onOpen` callback added. See the package README for the current prop table.
554
+
555
+ **Internal cleanups** — slim GraphQL queries for Home-block previews (just id/title, not full fragments); dropdown popovers now portal to the Shadow DOM root (fixes transparent background under React-component embed); sourcemaps excluded from npm tarball (~9 MB → ~3 MB install).
556
+
557
+ ## 1.0.4
558
+
559
+ ### Patch Changes
560
+
561
+ - d33b6f7: Catch-up release. v1.0.3 published to npm but the dist-repo sync steps were skipped on rerun (Changesets reports `published: false` once a version is already on the registry, even if downstream sync steps failed). This release re-runs the full pipeline on the now-correct PAT-based dist-repo sync. No source changes.
562
+
563
+ ## 1.0.3
564
+
565
+ ### Patch Changes
566
+
567
+ - 9a3fe35: Validate end-to-end release pipeline on the new PAT-based dist-repo sync (replaces the previous SSH deploy-key approach, which couldn't be reused across multiple dist repos in the same GitHub org). No source changes.
568
+
569
+ ## 1.0.2
570
+
571
+ ### Patch Changes
572
+
573
+ - 7f1c40d: **Public package polish:**
574
+
575
+ - Removed the `mode` prop from `WexioWidgetProps`. It was always locked to `"production"` so it served no purpose on the public surface — preview + demo modes were always dashboard-only. If you had `mode="production"` in your code, just delete it.
576
+ - `lightboxViewport` now defaults to `true` (full-viewport overlay). The previous default contained the gallery inside the widget's host box, which was too small for most floating-launcher embeds. Pass `lightboxViewport={false}` to keep the gallery contained.
577
+ - README: dropped the architecture aside about which fields `InjectableWidgetConfig` excludes (was internal context, not useful to public consumers). Docs URL switched to `learn.wexio.io`.
578
+
579
+ **New: `@wexio/widget-private`.** Phase 2 of the distribution split. Same JS runtime as `@wexio/messenger-widget-react`, but the emitted `.d.ts` exposes the dashboard-only props (`mode: "preview" | "demo"`, `configOverride` over the full `WidgetConfig`, `useDummyData`, `previewData`, `WidgetBranding`, `WidgetSecurity`). Not on npm — consumed by the operator dashboard via a git dependency on the private GitHub dist repo (`wexiohub/widget-private`). Versions stay in lock-step with the public package via the Changesets fixed group.
580
+
581
+ ## 1.0.1
582
+
583
+ ### Patch Changes
584
+
585
+ - bae143e: **Docs + dist-repo layout.** No public API change. Two improvements:
586
+
587
+ - **README rewritten** in a more Intercom-style structure: table-of-contents, expanded `window.WexioWidget` method reference (`show` / `hide` / `update` / `shutdown` / `showSpace` / `showMessages` / `showNewMessage` / `showArticle` / `showNews` / `onShow` / `onHide` / `onUnreadCountChange` / `hideNotifications` / `whoami` / `getVisitorId` / `setLocale`), troubleshooting section, multi-framework note, and an author/support footer. License badge swapped to a static MIT badge so it stops showing "Package not found" while the npm registry's aggregate endpoint is still propagating.
588
+ - **Dist repo layout** (`wexiohub/messenger-widget-react`) now nests built artefacts under `dist/` to match the published npm tarball. Top-level: `README.md`, `LICENSE`, `package.json`; chunks + types under `dist/`. Makes the dist repo cleaner to browse and lets consumers install directly via git URL if they need to pin a version that hasn't reached npm yet.
589
+
590
+ ## 1.0.0
591
+
592
+ ### Major Changes
593
+
594
+ - 68cd830: **Package renamed:** `@wexio/widget-react` is now `@wexio/messenger-widget-react`. Migrate by updating your `package.json` dependency name and changing the import path:
595
+
596
+ ```diff
597
+ - import { WexioWidget } from "@wexio/widget-react";
598
+ + import { WexioWidget } from "@wexio/messenger-widget-react";
599
+ ```
600
+
601
+ No prop API changes for the public surface in this release. Internally the public/private boundary is now enforced via a separate `entries/public.ts` entry point, so the emitted `.d.ts` no longer leaks dashboard-only props (`mode: "preview" | "demo"`, `configOverride` over the full `WidgetConfig`, `useDummyData`, `previewData`). Operators who only use the documented public props are unaffected. Operators who relied on the leaked private props (which were never documented) need to remove them — they were never intended to ship.
602
+
603
+ License changed from `UNLICENSED` to `MIT`.