@wexio/messenger-widget-react 1.2.4 → 1.3.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/CHANGELOG.md +51 -1
- package/README.md +15 -1
- package/dist/{widget-react-DubCiNev.js → widget-react--IUy5lNt.js} +21 -20
- package/dist/{widget-react-CIy9jXND.js → widget-react-B7es3n1-.js} +1 -1
- package/dist/{widget-react-2tTH7-bO.js → widget-react-BAUpSGhZ.js} +1 -1
- package/dist/{widget-react-CtvdaJvy.js → widget-react-BXf2Ty8d.js} +4 -4
- package/dist/{widget-react-AwEaD0v2.js → widget-react-BZ-SHa2o.js} +169 -273
- package/dist/{widget-react-faSyVXFQ.js → widget-react-BgALABDe.js} +1 -1
- package/dist/{widget-react-DXP6EOCM.js → widget-react-BkXA6ytR.js} +1 -1
- package/dist/{widget-react-DV3UnggB.js → widget-react-CHSNuztJ.js} +137 -226
- package/dist/widget-react-CN_FIvMD.js +834 -0
- package/dist/widget-react-CuphoFsN.js +229 -0
- package/dist/{widget-react-DNFROpaS.js → widget-react-D8Z8cGhJ.js} +40 -48
- package/dist/{widget-react-B9X7Tn7t.js → widget-react-DSUX0aJn.js} +42 -50
- package/dist/{widget-react-CAsPo1rw.js → widget-react-DWgRcZF7.js} +127 -127
- package/dist/{widget-react-B9XrHKqv.js → widget-react-DbOJZl9F.js} +1238 -2052
- package/dist/{widget-react-BlTmXnei.js → widget-react-DgIxSjv7.js} +1 -1
- package/dist/widget-react-Ds5J9FbQ.js +27 -0
- package/dist/{widget-react-CK8xTxwO.js → widget-react-Dtx_fW3V.js} +4895 -4454
- package/dist/{widget-react-B8rXZyxg.js → widget-react-SI7deQTE.js} +1 -1
- package/dist/{widget-react-yTVzOzaU.js → widget-react-l5oryxYk.js} +87 -87
- package/dist/{widget-react-DDEFbIbU.js → widget-react-vXfa9GKf.js} +95 -117
- package/dist/widget-react-wSc9gIfG.js +198 -0
- package/dist/widget-react.d.ts +2 -2
- package/dist/widget-react.js +9370 -4672
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @wexio/messenger-widget-react
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 037c210: Full two-way messaging: multi-topic threads, offline outbox, blocked visitors, richer composer, and transcript download.
|
|
8
|
+
|
|
9
|
+
**Multi-topic conversation threads**
|
|
10
|
+
|
|
11
|
+
- A multi-topic conversation list: the visitor can keep several topics side by side, each with its own preview, unread count, and status (open / pending / resolved). Starting a new question opens a fresh thread instead of overwriting the current one.
|
|
12
|
+
- The launcher badge, peek, thread list, and open thread now share one unread source, so reading a message clears it everywhere at once. Quick-reply chips render inside the launcher peek so a visitor can answer without opening the panel.
|
|
13
|
+
- Per-thread realtime: typing, unread, operator-handoff and status changes update the right thread live.
|
|
14
|
+
|
|
15
|
+
**Blocked visitors**
|
|
16
|
+
|
|
17
|
+
- Two levels of blocking are now honored on the client. **Thread-level**: the visitor can't reply in that thread but can still start a new one. **Global (contact-level)**: no composer anywhere and no new conversations, with friendly copy. The block is enforced on first paint (so a blocked visitor never sees a live composer) and kept current via the realtime stream. Blocked sends are dropped from the offline queue instead of retrying forever.
|
|
18
|
+
|
|
19
|
+
**Offline outbox**
|
|
20
|
+
|
|
21
|
+
- A generic IndexedDB queue backs the visitor's outbound actions — message sends, reactions, read receipts, profile changes, and activity tracking. Actions taken offline (or mid-reconnect) are persisted and converge automatically when the connection returns, so nothing is silently lost.
|
|
22
|
+
|
|
23
|
+
**Composer**
|
|
24
|
+
|
|
25
|
+
- Rich-text editing (bold / lists / links, Markdown-aware) and a GIF / sticker picker join the existing emoji picker, file attachments, and voice recorder.
|
|
26
|
+
|
|
27
|
+
**Conversation lifecycle**
|
|
28
|
+
|
|
29
|
+
- Download a conversation transcript from the header.
|
|
30
|
+
- A clearer "conversation closed" state with a one-tap "start a new conversation".
|
|
31
|
+
- A connection-status footer replaces the old branding footer, so a dropped connection is visible in-thread.
|
|
32
|
+
|
|
33
|
+
**Reliability**
|
|
34
|
+
|
|
35
|
+
- A code-split chunk that can't be fetched (for example the voice-note player while offline) now degrades gracefully to a fallback instead of breaking the whole conversation.
|
|
36
|
+
|
|
37
|
+
**Captured visitors (lazy inbox)**
|
|
38
|
+
|
|
39
|
+
- A drive-by visitor no longer opens a conversation until they actually engage. When there is nothing in the inbox yet, a configured welcome message shows as a default thread the visitor can read and reply in, rather than an empty "no conversations" screen — and the proactive welcome peek + badge appear once, then clear after it is read.
|
|
40
|
+
- A first message (or an operator's proactive message) creates the conversation on the fly and its reply, greeting, and typing now render live in-thread — no reload, and no double launcher peek when a greeting flow is active.
|
|
41
|
+
- Sent-message stability: the visitor's own bubble no longer flickers (animate out then back in) when the thread refetches after a send, and switching a thread's conversation id no longer remounts the open thread.
|
|
42
|
+
|
|
43
|
+
**Media message previews**
|
|
44
|
+
|
|
45
|
+
- A thread whose last message is a photo, video, gif, sticker, voice note, audio, or file now shows a typed label + thumbnail in the thread list and launcher peek, instead of a blank row.
|
|
46
|
+
|
|
47
|
+
**i18n**
|
|
48
|
+
|
|
49
|
+
- New conversation, thread, block, and transcript strings across all supported UI locales.
|
|
50
|
+
|
|
51
|
+
No breaking changes to the package API — `publicKey`, `user`, `config`, and the `onOpen` / `onClose` / `onResize` callbacks are unchanged.
|
|
52
|
+
|
|
3
53
|
## 1.2.4
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
|
@@ -608,7 +658,7 @@
|
|
|
608
658
|
|
|
609
659
|
- bae143e: **Docs + dist-repo layout.** No public API change. Two improvements:
|
|
610
660
|
|
|
611
|
-
- **README rewritten**
|
|
661
|
+
- **README rewritten** with a clearer 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.
|
|
612
662
|
- **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.
|
|
613
663
|
|
|
614
664
|
## 1.0.0
|
package/README.md
CHANGED
|
@@ -9,8 +9,22 @@ Native React component for the [Wexio](https://wexio.io) web messenger. Renders
|
|
|
9
9
|
🏠 [Website](https://wexio.io)
|
|
10
10
|
📚 [Developer Docs](https://learn.wexio.io/docs/web-widget)
|
|
11
11
|
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
The messenger is a full two-way support surface, not just a contact form:
|
|
15
|
+
|
|
16
|
+
- **Conversations & threads** — real-time chat with history, read receipts and delivery states, plus multi-topic threads so a visitor can keep several questions side by side.
|
|
17
|
+
- **Rich messages** — images and galleries (with a lightbox), GIFs, inline video, voice notes, and file / PDF attachments; AI replies cite their sources.
|
|
18
|
+
- **Composer** — rich-text editing, emoji and GIF pickers, file attachments, and an in-widget voice recorder.
|
|
19
|
+
- **Home, Help & News** — a configurable Home tab (team status, quick actions, help search, news), a searchable help center, and a news feed — all driven by the operator's dashboard.
|
|
20
|
+
- **Identity** — anonymous by default, or log a known visitor in with a Google, JWT, or HMAC proof.
|
|
21
|
+
- **Resilient & offline-aware** — an offline outbox queues sends, reactions, read-acks and profile changes and converges on reconnect; a dropped connection is shown in-thread.
|
|
22
|
+
- **Themed & localized** — follows the operator's brand theme (light / dark) and ships 33 UI locales; visitors can switch language in-widget.
|
|
23
|
+
- **Demo mode** — omit the public key to render a self-contained preview with bundled mock content (great for landing pages and Storybook).
|
|
24
|
+
|
|
12
25
|
## 📂 Description
|
|
13
26
|
|
|
27
|
+
- [Features](#features)
|
|
14
28
|
- [Installation](#installation)
|
|
15
29
|
- [Quick start](#quick-start)
|
|
16
30
|
- [Identifying users](#identifying-users)
|
|
@@ -60,7 +74,7 @@ That's it — the widget mounts a floating launcher, handles its own theme/local
|
|
|
60
74
|
|
|
61
75
|
## Identifying users
|
|
62
76
|
|
|
63
|
-
Pass a verified `user` to log a known visitor in (
|
|
77
|
+
Pass a verified `user` to log a known visitor in (a known-user login / boot). Provide ONE proof — a Google FedCM `id_token`, a host-signed `jwt`, or the legacy `userId` + `userHash` HMAC pair:
|
|
64
78
|
|
|
65
79
|
```tsx
|
|
66
80
|
<WexioWidget
|
|
@@ -11,14 +11,15 @@ import "react";
|
|
|
11
11
|
import "react-dom";
|
|
12
12
|
import "react/jsx-runtime";
|
|
13
13
|
import "react-dom/client";
|
|
14
|
-
import {
|
|
15
|
-
import { i
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
14
|
+
import { t as e } from "./widget-react-DbOJZl9F.js";
|
|
15
|
+
import { i as t, n, t as r } from "./widget-react-krPPnv02.js";
|
|
16
|
+
import { l as i, o as a, s as o } from "./widget-react-CN_FIvMD.js";
|
|
17
|
+
import { t as s } from "./widget-react-DgIxSjv7.js";
|
|
18
|
+
import { t as c } from "./widget-react-SI7deQTE.js";
|
|
19
|
+
import { t as l } from "./widget-react-BAUpSGhZ.js";
|
|
19
20
|
import { useEffect as u, useRef as d, useState as f } from "react";
|
|
20
21
|
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
21
|
-
var g =
|
|
22
|
+
var g = r("square", [["rect", {
|
|
22
23
|
width: "18",
|
|
23
24
|
height: "18",
|
|
24
25
|
x: "3",
|
|
@@ -297,8 +298,8 @@ function D(e) {
|
|
|
297
298
|
let t = e?.name ?? "", n = e?.message ?? "";
|
|
298
299
|
return t === "NotAllowedError" || t === "PermissionDeniedError" ? "denied" : t === "NotFoundError" || t === "NotReadableError" || t === "OverconstrainedError" || t === "SecurityError" || t === "AbortError" || t === "TypeError" || /not found|could not start|secure origin|not readable|in use/i.test(n) ? "failed" : /permission|denied|not allowed/i.test(n) ? "denied" : "failed";
|
|
299
300
|
}
|
|
300
|
-
function O({ onComplete:
|
|
301
|
-
let v =
|
|
301
|
+
function O({ onComplete: r, onCancel: c, onError: _ }) {
|
|
302
|
+
let v = t("messages"), y = d(null), b = d(null), x = d(null), S = d(null), O = d([]), A = d(null), [j, M] = f("recording"), [N, P] = f(0), [F, I] = f(!1), L = d(null), R = d(!1);
|
|
302
303
|
return u(() => {
|
|
303
304
|
let e = y.current;
|
|
304
305
|
if (!e) return;
|
|
@@ -398,10 +399,10 @@ function O({ onComplete: o, onCancel: c, onError: _ }) {
|
|
|
398
399
|
y: 0
|
|
399
400
|
},
|
|
400
401
|
transition: { duration: .18 },
|
|
401
|
-
className:
|
|
402
|
+
className: n("flex items-center gap-1.5 rounded-wx-lg border border-wx-border bg-wx-bg px-2 py-2"),
|
|
402
403
|
children: [
|
|
403
404
|
/* @__PURE__ */ m(k, {
|
|
404
|
-
Icon:
|
|
405
|
+
Icon: i,
|
|
405
406
|
onClick: () => {
|
|
406
407
|
R.current = !0;
|
|
407
408
|
try {
|
|
@@ -428,7 +429,7 @@ function O({ onComplete: o, onCancel: c, onError: _ }) {
|
|
|
428
429
|
/* @__PURE__ */ m("div", {
|
|
429
430
|
ref: y,
|
|
430
431
|
"aria-hidden": "true",
|
|
431
|
-
className:
|
|
432
|
+
className: n("min-w-0 flex-1 overflow-hidden", j !== "preview" && "pointer-events-none")
|
|
432
433
|
}),
|
|
433
434
|
/* @__PURE__ */ m("span", {
|
|
434
435
|
className: "shrink-0 font-mono text-xs tabular-nums text-wx-fg-muted",
|
|
@@ -451,11 +452,11 @@ function O({ onComplete: o, onCancel: c, onError: _ }) {
|
|
|
451
452
|
stiffness: 400,
|
|
452
453
|
damping: 22
|
|
453
454
|
},
|
|
454
|
-
className:
|
|
455
|
+
className: n("flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors", "text-wx-fg-muted hover:bg-wx-bg-elevated hover:text-wx-fg"),
|
|
455
456
|
children: /* @__PURE__ */ m(g, { size: 14 })
|
|
456
457
|
}),
|
|
457
458
|
j === "preview" && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(k, {
|
|
458
|
-
Icon: F ?
|
|
459
|
+
Icon: F ? a : o,
|
|
459
460
|
onClick: () => {
|
|
460
461
|
let e = b.current;
|
|
461
462
|
e && (e.isPlaying() ? e.pause() : e.play());
|
|
@@ -466,7 +467,7 @@ function O({ onComplete: o, onCancel: c, onError: _ }) {
|
|
|
466
467
|
type: "button",
|
|
467
468
|
onClick: () => {
|
|
468
469
|
let e = L.current;
|
|
469
|
-
e &&
|
|
470
|
+
e && r(e);
|
|
470
471
|
},
|
|
471
472
|
"aria-label": v("sendCta"),
|
|
472
473
|
whileHover: { scale: 1.08 },
|
|
@@ -476,18 +477,18 @@ function O({ onComplete: o, onCancel: c, onError: _ }) {
|
|
|
476
477
|
stiffness: 400,
|
|
477
478
|
damping: 22
|
|
478
479
|
},
|
|
479
|
-
className:
|
|
480
|
+
className: n("flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors", "bg-wx-primary text-wx-primary-fg hover:bg-wx-primary-hover"),
|
|
480
481
|
children: /* @__PURE__ */ m(s, { size: 14 })
|
|
481
482
|
})] })
|
|
482
483
|
]
|
|
483
484
|
}, "voice-recorder");
|
|
484
485
|
}
|
|
485
|
-
function k({ Icon: t, onClick:
|
|
486
|
+
function k({ Icon: t, onClick: r, ariaLabel: i, intent: a, size: o = 16 }) {
|
|
486
487
|
let s = c();
|
|
487
488
|
return /* @__PURE__ */ m(e.button, {
|
|
488
489
|
type: "button",
|
|
489
|
-
onClick:
|
|
490
|
-
"aria-label":
|
|
490
|
+
onClick: r,
|
|
491
|
+
"aria-label": i,
|
|
491
492
|
whileHover: { scale: 1.08 },
|
|
492
493
|
whileTap: { scale: .9 },
|
|
493
494
|
transition: {
|
|
@@ -496,7 +497,7 @@ function k({ Icon: t, onClick: n, ariaLabel: r, intent: i, size: o = 16 }) {
|
|
|
496
497
|
damping: 22
|
|
497
498
|
},
|
|
498
499
|
...s.parentHandlers,
|
|
499
|
-
className:
|
|
500
|
+
className: n("flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors", a === "primary" ? "bg-wx-primary text-wx-primary-fg hover:bg-wx-primary-hover" : "text-wx-fg-muted hover:bg-wx-bg-elevated hover:text-wx-fg"),
|
|
500
501
|
children: /* @__PURE__ */ m(t, {
|
|
501
502
|
ref: s.iconRef,
|
|
502
503
|
size: o
|
|
@@ -506,4 +507,4 @@ function k({ Icon: t, onClick: n, ariaLabel: r, intent: i, size: o = 16 }) {
|
|
|
506
507
|
//#endregion
|
|
507
508
|
export { O as VoiceRecorderBar };
|
|
508
509
|
|
|
509
|
-
//# sourceMappingURL=widget-react
|
|
510
|
+
//# sourceMappingURL=widget-react--IUy5lNt.js.map
|
|
@@ -12,9 +12,9 @@ import "react-dom";
|
|
|
12
12
|
import "react/jsx-runtime";
|
|
13
13
|
import "react-dom/client";
|
|
14
14
|
import { i as e, n as t } from "./widget-react-krPPnv02.js";
|
|
15
|
-
import { t as n } from "./widget-react-
|
|
16
|
-
import { n as r, r as i, t as a } from "./widget-react-
|
|
17
|
-
import { t as o } from "./widget-react-
|
|
15
|
+
import { t as n } from "./widget-react-B7es3n1-.js";
|
|
16
|
+
import { n as r, r as i, t as a } from "./widget-react-BgALABDe.js";
|
|
17
|
+
import { t as o } from "./widget-react-BAUpSGhZ.js";
|
|
18
18
|
import { memo as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
19
19
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
20
20
|
//#region node_modules/@wavesurfer/react/dist/index.js
|
|
@@ -361,4 +361,4 @@ function A(e, t) {
|
|
|
361
361
|
//#endregion
|
|
362
362
|
export { O as AudioBubblePlayer };
|
|
363
363
|
|
|
364
|
-
//# sourceMappingURL=widget-react-
|
|
364
|
+
//# sourceMappingURL=widget-react-BXf2Ty8d.js.map
|