@wexio/messenger-widget-react 1.3.0 → 1.3.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.
- package/CHANGELOG.md +10 -0
- package/dist/widget-react-BS9kUSRS.js +255 -0
- package/dist/{widget-react-vXfa9GKf.js → widget-react-BfO-uP4o.js} +45 -73
- package/dist/{widget-react-l5oryxYk.js → widget-react-Bop75Z1t.js} +83 -83
- package/dist/widget-react-BxEjM2it.js +118 -0
- package/dist/{widget-react-Dtx_fW3V.js → widget-react-C6lzldez.js} +1618 -1578
- package/dist/{widget-react-DWgRcZF7.js → widget-react-DRER1XF_.js} +80 -80
- package/dist/{widget-react-CuphoFsN.js → widget-react-DSAyUf2U.js} +3 -3
- package/dist/{widget-react-CHSNuztJ.js → widget-react-MXOCL3Mg.js} +129 -129
- package/dist/{widget-react-BZ-SHa2o.js → widget-react-bPokx9L5.js} +10 -10
- package/dist/widget-react.js +4012 -4019
- package/package.json +1 -1
- package/dist/widget-react-D8Z8cGhJ.js +0 -254
- package/dist/widget-react-DSUX0aJn.js +0 -117
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @wexio/messenger-widget-react
|
|
2
2
|
|
|
3
|
+
## 1.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 231e345: Fix the widget when it runs embedded inside a host app (the dashboard's live preview / the React-component embed).
|
|
8
|
+
|
|
9
|
+
- **Demo content no longer breaks the host page.** In demo/preview mode the mock threads, help articles and news are now read straight from the widget's bundled demo content instead of next-intl's lazy `demo` namespace. Inside an embedded host (Turbopack) that lazy namespace was not visible to the demo builders, so previews rendered empty and logged `MISSING_MESSAGE` for every key, and the thread-list builder crashed the whole host page with "map is not a function". The builders are also guarded so a not-yet-resolved value degrades to empty instead of throwing.
|
|
10
|
+
- **Pickers and menus are clickable inside the Shadow DOM embed.** The GIF and emoji pickers, the conversation-header overflow menu, the language selector and the composer commands popover used a document-level click-outside check against `event.target`. In the Shadow DOM embed that target is retargeted to the shadow host, so every in-picker click read as "outside" and closed the popover on mousedown before the click landed (a GIF/sticker/emoji tap "fell through"). They now test `event.composedPath()`, which pierces the shadow boundary and is unchanged for the iframe / standalone embeds.
|
|
11
|
+
- **team-status "online" dot alignment.** The status dot is now aligned to the title's first line instead of drifting above it when operator avatars make the row taller.
|
|
12
|
+
|
|
3
13
|
## 1.3.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
globalThis.process === void 0 && (globalThis.process = {
|
|
2
|
+
env: {},
|
|
3
|
+
nextTick: function(e) {
|
|
4
|
+
setTimeout(e, 0);
|
|
5
|
+
},
|
|
6
|
+
emit: function() {
|
|
7
|
+
return !1;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-dom";
|
|
12
|
+
import "react/jsx-runtime";
|
|
13
|
+
import "react-dom/client";
|
|
14
|
+
//#region messages/demo.en.json
|
|
15
|
+
var e = {
|
|
16
|
+
sender: "Gaia",
|
|
17
|
+
preview: "Hi there 👋 Thanks for reaching out. I'll get back to you shortly…",
|
|
18
|
+
ageLabel: "4h"
|
|
19
|
+
}, t = {
|
|
20
|
+
"demo-news-1": {
|
|
21
|
+
title: "Pioneer 2026: save the date",
|
|
22
|
+
excerpt: "We're back in San Francisco on October 8. Doors at 9, keynote at 10.",
|
|
23
|
+
body: "## What to expect\n\nThis year's keynote is all about what we shipped in the open and what's coming next. Live demos, not slides.\n\n- **The Gaia roadmap** - where our AI is headed over the next two quarters.\n- **Customer stories** - three teams share how they halved first-response time.\n- **Hands-on labs** - bring a laptop and build a flow with our engineers.\n\n## Getting there\n\nThe venue is the Pier 27 Cruise Terminal, right on the Embarcadero. Closest BART stop is Embarcadero, a 12-minute walk along the water.\n\n## Tickets\n\nEarly-bird seats are limited and go live next week. Existing customers get first dibs, so keep an eye on your inbox.\n\n> Can't make it in person? The keynote streams live and the recordings land here the same evening."
|
|
24
|
+
},
|
|
25
|
+
"demo-news-2": {
|
|
26
|
+
title: "What shipped in April",
|
|
27
|
+
excerpt: "Three new automation triggers and a much faster inbox search.",
|
|
28
|
+
body: "<p>April was a big month. Here's everything that shipped, at a glance:</p>\n<table>\n<thead><tr><th>Area</th><th>What changed</th><th>Why it matters</th></tr></thead>\n<tbody>\n<tr><td>Inbox search</td><td>Instant, as-you-type results</td><td>50k conversations, under 100ms</td></tr>\n<tr><td>Automation</td><td>Three new triggers</td><td>Cart abandoned, page revisited, quiet visitor</td></tr>\n<tr><td>Composer</td><td>Draft survives a tab switch</td><td>No more lost half-typed replies</td></tr>\n<tr><td>Dark mode</td><td>No white flash on first paint</td><td>Cleaner load on dark sites</td></tr>\n</tbody>\n</table>\n<p>Here's the new search in action - results land before you finish typing:</p>\n<img src=\"https://picsum.photos/seed/wexio-search/1024/576\" alt=\"Inbox search returning results instantly\" />\n<p>Tap the image to take a closer look. Got a request? Reply here - we read every one.</p>"
|
|
29
|
+
},
|
|
30
|
+
"demo-news-3": {
|
|
31
|
+
title: "Gaia now speaks 28 languages",
|
|
32
|
+
excerpt: "Auto-detect the visitor's language or pin one. No extra setup.",
|
|
33
|
+
body: "<p>Gaia now replies in 28 languages, detected automatically from the visitor's first message. The questions we hear most:</p>\n<details><summary>How does language detection work?</summary><p>Gaia reads the opening message and replies in the same language. If your help articles exist in that language it cites them; otherwise it answers from the closest match and flags the gap to you.</p></details>\n<details><summary>Can I force a single language?</summary><p>Yes. Pin one in <strong>Settings → AI → Language</strong> and Gaia sticks to it no matter what the visitor types.</p></details>\n<details><summary>What do operators see?</summary><p>Transcripts stay in your team's language, with the original message kept alongside the translation.</p></details>\n<p>A quick look at Gaia switching languages mid-thread:</p>\n<img src=\"https://picsum.photos/seed/wexio-lang/1024/576\" alt=\"Gaia replying across several languages\" />"
|
|
34
|
+
},
|
|
35
|
+
"demo-news-4": {
|
|
36
|
+
title: "Pipe conversations straight into Slack",
|
|
37
|
+
excerpt: "Connect any incoming webhook to a Slack channel. No glue code.",
|
|
38
|
+
body: "## Connect in two clicks\n\nHead to **Integrations → Slack**, hit *Connect*, and approve the scopes. Pick the channel new conversations should land in - most teams use `#support`.\n\n## What you get\n\n- A Slack message the moment a chat starts, with a link back to the inbox.\n- Operator replies threaded under the original message.\n- Reply right from Slack and we post it back to the visitor in real time.\n\n## Webhooks too\n\nAlready pushing events from your own systems? Point any webhook at your Slack channel and skip the custom integration entirely."
|
|
39
|
+
},
|
|
40
|
+
"demo-news-5": {
|
|
41
|
+
title: "Inbox 2.0: triage without the mouse",
|
|
42
|
+
excerpt: "New shortcuts for assigning, snoozing, and resolving - all from the keyboard.",
|
|
43
|
+
body: "<p>Inbox 2.0 is keyboard-first. Here's the cheat sheet, grouped by what you're doing:</p>\n<div data-type=\"tabs\">\n<div data-type=\"tab\"><div data-tab-label>Navigate</div><ul><li><code>j</code> / <code>k</code> - next / previous conversation</li><li><code>g</code> then <code>i</code> - jump to the inbox</li></ul></div>\n<div data-type=\"tab\"><div data-tab-label>Act</div><ul><li><code>e</code> - resolve</li><li><code>a</code> - assign to me</li><li><code>s</code> - snooze</li></ul></div>\n<div data-type=\"tab\"><div data-tab-label>Compose</div><ul><li><code>Cmd+Enter</code> - send</li><li><code>/</code> - saved replies</li><li><code>Cmd+K</code> - command palette</li></ul></div>\n</div>\n<p>The redesigned inbox - everything within a key's reach:</p>\n<img src=\"https://picsum.photos/seed/wexio-inbox/1024/576\" alt=\"The redesigned keyboard-first inbox\" />"
|
|
44
|
+
},
|
|
45
|
+
"demo-news-6": {
|
|
46
|
+
title: "Self-serve data exports and deletion",
|
|
47
|
+
excerpt: "Handle visitor data requests in a click. GDPR-ready out of the box.",
|
|
48
|
+
body: "## Export\n\nFrom any visitor's profile, hit **Export data** to generate a JSON bundle of every message, event, and attribute we hold for them. It downloads instantly and logs the request for your records.\n\n## Delete\n\n**Delete data** removes the visitor and scrubs their messages from the inbox, search, and any connected CRM through the same webhook bridge. The action is logged and irreversible.\n\n## For your DPO\n\n- Every export and deletion is timestamped and attributed.\n- Retention windows are configurable per workspace.\n- A data-processing agreement is available on request."
|
|
49
|
+
},
|
|
50
|
+
"demo-news-7": {
|
|
51
|
+
title: "Mobile SDK beta: iOS and Android",
|
|
52
|
+
excerpt: "Bring the same conversation into your native app. Beta seats open now.",
|
|
53
|
+
body: "## One conversation, every surface\n\nA visitor who starts a chat on your website can pick it up in your app, signed in, with full history. Same Gaia, same operators, same inbox.\n\n## What's in the beta\n\n- Native launcher for SwiftUI and Jetpack Compose.\n- Push notifications for new replies.\n- Offline queue, so messages send when the connection comes back.\n\n## Join\n\nWe're onboarding a handful of teams each week. Reply here with your platform and rough monthly active users and we'll send you a key.\n\n> Beta means rough edges. We ship fixes weekly and read every bug report."
|
|
54
|
+
},
|
|
55
|
+
"demo-news-8": {
|
|
56
|
+
title: "See which AI answers actually worked",
|
|
57
|
+
excerpt: "Track whether each Gaia reply led to a resolution, a handoff, or a bounce.",
|
|
58
|
+
body: "## The new view\n\n**Analytics → AI outcomes** breaks down every Gaia reply by what happened next:\n\n- **Resolved** - the visitor got what they needed and left happy.\n- **Handed off** - Gaia passed the conversation to a human.\n- **Bounced** - the visitor closed the widget without resolving.\n\n## Per-article insight\n\nDrill into any help article to see how often Gaia cites it and whether those citations resolve. Low resolution on a high-traffic article usually means the content needs a rewrite, not the AI.\n\n## Act on it\n\nSort by bounce rate to find the questions Gaia struggles with most, then add a flow or a sharper article to close the gap."
|
|
59
|
+
},
|
|
60
|
+
tags: {
|
|
61
|
+
events: "Events",
|
|
62
|
+
product: "Product",
|
|
63
|
+
release: "Release",
|
|
64
|
+
ai: "AI",
|
|
65
|
+
languages: "Languages",
|
|
66
|
+
integrations: "Integrations",
|
|
67
|
+
slack: "Slack",
|
|
68
|
+
inbox: "Inbox",
|
|
69
|
+
privacy: "Privacy",
|
|
70
|
+
security: "Security",
|
|
71
|
+
mobile: "Mobile",
|
|
72
|
+
beta: "Beta",
|
|
73
|
+
analytics: "Analytics"
|
|
74
|
+
},
|
|
75
|
+
categories: {
|
|
76
|
+
company: "Company",
|
|
77
|
+
product: "Product",
|
|
78
|
+
engineering: "Engineering"
|
|
79
|
+
}
|
|
80
|
+
}, n = {
|
|
81
|
+
categories: {
|
|
82
|
+
"demo-cat-getting-started": {
|
|
83
|
+
title: "Getting started",
|
|
84
|
+
description: "Install the widget and configure your first conversation."
|
|
85
|
+
},
|
|
86
|
+
"demo-cat-automation": {
|
|
87
|
+
title: "Automation",
|
|
88
|
+
description: "Flows, triggers, and the AI auto-reply."
|
|
89
|
+
},
|
|
90
|
+
"demo-cat-integrations": {
|
|
91
|
+
title: "Integrations",
|
|
92
|
+
description: "Connect your CRM, Slack, and CMS."
|
|
93
|
+
},
|
|
94
|
+
"demo-cat-billing": {
|
|
95
|
+
title: "Billing & plans",
|
|
96
|
+
description: "Pricing tiers, invoices, and seat management."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
articles: {
|
|
100
|
+
"demo-article-install": {
|
|
101
|
+
title: "Install the Wexio widget on your site",
|
|
102
|
+
excerpt: "A 30-second snippet you paste before the closing </body> tag.",
|
|
103
|
+
body: "## Add the loader script\n\nPaste this snippet into every page where you want the widget to appear:\n\n```html\n<script\n src=\"https://cdn.wexio.io/widget/loader.js\"\n data-public-key=\"pk_live_YOUR_KEY\"\n><\/script>\n```\n\nThe loader injects a floating launcher in the bottom-right corner. Click it to open the chat panel.\n\n## Verify the install\n\n- Visit a page that includes the snippet.\n- Open the browser console.\n- You should see `[wexio] widget mounted`.\n\n## Customise the look\n\nThe widget reads brand colours from your dashboard. Update them in **Settings → Brand**.\n\n> Need a hand? Tap \"Still need help? Message us\" below and we'll walk you through it."
|
|
104
|
+
},
|
|
105
|
+
"demo-article-flows": {
|
|
106
|
+
title: "Build your first automation flow",
|
|
107
|
+
excerpt: "Drag, drop, and ship a welcome bot in under five minutes.",
|
|
108
|
+
body: "## What's a flow?\n\nA flow is a tiny tree of conversation steps - questions, replies, and conditions - that runs whenever a visitor matches a trigger.\n\n## Three trigger types\n\n1. **Visitor opened the widget** - greet first-timers.\n2. **Visitor asked a question** - Gaia (AI) tries to answer; if it can't, the flow takes over.\n3. **Webhook received** - your CMS or e-commerce platform pushes an event; the flow kicks off in the right chat.\n\n## Best practices\n\n- Keep first replies under 80 characters.\n- Offer 2-3 quick-reply chips, not a free-text question.\n- Always provide an escape hatch - *\"Talk to a human\"*."
|
|
109
|
+
},
|
|
110
|
+
"demo-article-slack": {
|
|
111
|
+
title: "Forward chats to Slack",
|
|
112
|
+
excerpt: "Mirror every new conversation into a Slack channel of your choice.",
|
|
113
|
+
body: "## Connect your workspace\n\nIn **Integrations → Slack** click *Connect*. You'll be redirected to Slack's OAuth screen - approve the requested scopes (`chat:write`, `channels:read`).\n\n## Pick a channel\n\nAfter authorising, choose the target channel (or create a new one like `#support`).\n\n## What gets forwarded\n\n- The opening message, with a deeplink back to the wexio inbox.\n- Operator replies as threaded messages.\n- Visitor replies in real time via the SSE bridge.\n\n## Reverse direction\n\nOperators can reply *from* Slack - wexio listens for Slack thread replies and posts them back to the widget."
|
|
114
|
+
},
|
|
115
|
+
"demo-article-billing": {
|
|
116
|
+
title: "Update your plan and billing details",
|
|
117
|
+
excerpt: "Switch tiers, change card, or download invoices.",
|
|
118
|
+
body: "## Plans\n\n- **Free** - 1 widget, basic features, \"Powered by Wexio\" badge.\n- **Standard** - unlimited widgets, automations, integrations.\n- **Enterprise** - white-label, SLA, dedicated support.\n\n## Change plan\n\n**Settings → Billing → Change plan**. Upgrades take effect immediately; downgrades apply at the end of the current cycle.\n\n## Invoices\n\nDownload every invoice as PDF from **Billing → History**. We also email a copy on each renewal."
|
|
119
|
+
},
|
|
120
|
+
"demo-article-theme": {
|
|
121
|
+
title: "Customise the widget theme",
|
|
122
|
+
excerpt: "Match the widget to your brand - colours, radii, dark mode.",
|
|
123
|
+
body: "## Brand colours\n\nIn **Settings → Brand**, set:\n\n- **Primary** - drives the launcher, send button, focus rings.\n- **Background** - the panel surface (light) and dark-mode pair.\n\n## Radii\n\nPick from `sm`, `md`, `lg` for a tighter or softer look. The change applies live to every widget on every page.\n\n## Dark mode\n\nDefault = follow the visitor's system preference. Pin to **always light** or **always dark** if your site doesn't support dark mode itself."
|
|
124
|
+
},
|
|
125
|
+
"demo-article-handoff": {
|
|
126
|
+
title: "Hand off from Gaia to a human operator",
|
|
127
|
+
excerpt: "When AI isn't enough - route the visitor to a teammate.",
|
|
128
|
+
body: "## Triggers\n\nGaia hands off automatically when:\n\n- The visitor types *\"talk to a human\"* (or any localised variant).\n- The same question is asked twice with no resolution.\n- The visitor's intent matches a routing rule (e.g., billing → finance team).\n\n## Routing\n\nSet up **Routing → Rules** to direct certain intents to specific teams or operators. Round-robin and least-loaded are both supported.\n\n## Out-of-hours\n\nIf no operator is online, Gaia offers a callback or email-handoff form instead of pretending someone's available."
|
|
129
|
+
},
|
|
130
|
+
"demo-article-crm": {
|
|
131
|
+
title: "Sync conversations to your CRM",
|
|
132
|
+
excerpt: "Push every chat into HubSpot, Salesforce, or Pipedrive.",
|
|
133
|
+
body: "## Supported CRMs\n\n- HubSpot (OAuth)\n- Salesforce (OAuth)\n- Pipedrive (API token)\n- Custom via webhooks\n\n## What syncs\n\n- New conversations create a contact (if not already present) and a note.\n- Operator replies append to the contact timeline.\n- Tags applied in wexio mirror to the CRM.\n\n## Two-way\n\nOperator notes added in the CRM can post back to wexio via the webhook receiver - see *Integrations → Webhooks → Inbound*."
|
|
134
|
+
},
|
|
135
|
+
"demo-article-shortcuts": {
|
|
136
|
+
title: "Operator keyboard shortcuts",
|
|
137
|
+
excerpt: "Triage twice as fast - no mouse required.",
|
|
138
|
+
body: "## Inbox navigation\n\n- `j` / `k` - next / previous conversation\n- `e` - resolve\n- `a` - assign to me\n- `s` - snooze\n\n## Composer\n\n- `Cmd+Enter` - send\n- `/` - open saved-reply picker\n- `Cmd+K` - command palette (everything)\n\n## Tip\n\nHover any button in the dashboard - the tooltip shows its shortcut."
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
tags: {
|
|
142
|
+
setup: "Setup",
|
|
143
|
+
install: "Install",
|
|
144
|
+
automation: "Automation",
|
|
145
|
+
flows: "Flows",
|
|
146
|
+
integrations: "Integrations",
|
|
147
|
+
slack: "Slack",
|
|
148
|
+
billing: "Billing",
|
|
149
|
+
plans: "Plans",
|
|
150
|
+
design: "Design",
|
|
151
|
+
ai: "AI",
|
|
152
|
+
crm: "CRM",
|
|
153
|
+
productivity: "Productivity",
|
|
154
|
+
inbox: "Inbox"
|
|
155
|
+
}
|
|
156
|
+
}, r = {
|
|
157
|
+
visitorName: "You",
|
|
158
|
+
messages: {
|
|
159
|
+
"m-demo-1": {
|
|
160
|
+
text: "Hi there 👋 I'm Gaia, the Wexio AI. What can I help you with?",
|
|
161
|
+
ageLabel: "9:41 AM",
|
|
162
|
+
buttons: [
|
|
163
|
+
"How does pricing work?",
|
|
164
|
+
"What can it do?",
|
|
165
|
+
"Talk to a human"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"m-demo-2": {
|
|
169
|
+
text: "Can you show me what the widget looks like?",
|
|
170
|
+
ageLabel: "9:41 AM"
|
|
171
|
+
},
|
|
172
|
+
"m-demo-3": {
|
|
173
|
+
text: "",
|
|
174
|
+
ageLabel: "9:42 AM",
|
|
175
|
+
mediaAlts: ["Product screenshot"]
|
|
176
|
+
},
|
|
177
|
+
"m-demo-4": {
|
|
178
|
+
text: "",
|
|
179
|
+
ageLabel: "9:42 AM",
|
|
180
|
+
mediaAlts: ["Spinning globe"]
|
|
181
|
+
},
|
|
182
|
+
"m-demo-5": {
|
|
183
|
+
text: "Nice one! 😄 Here are a few views from our team.",
|
|
184
|
+
ageLabel: "9:43 AM"
|
|
185
|
+
},
|
|
186
|
+
"m-demo-6": {
|
|
187
|
+
text: "A few dashboard highlights",
|
|
188
|
+
ageLabel: "9:43 AM",
|
|
189
|
+
mediaAlts: [
|
|
190
|
+
"Dashboard overview",
|
|
191
|
+
"Analytics",
|
|
192
|
+
"Inbox",
|
|
193
|
+
"Reports"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"m-demo-7": {
|
|
197
|
+
text: "",
|
|
198
|
+
ageLabel: "9:44 AM",
|
|
199
|
+
mediaAlts: ["Quick walkthrough"]
|
|
200
|
+
},
|
|
201
|
+
"m-demo-8": {
|
|
202
|
+
text: "",
|
|
203
|
+
ageLabel: "9:44 AM",
|
|
204
|
+
mediaAlts: ["Voice note"]
|
|
205
|
+
},
|
|
206
|
+
"m-demo-9": {
|
|
207
|
+
text: "",
|
|
208
|
+
ageLabel: "9:45 AM",
|
|
209
|
+
mediaAlts: ["Getting started guide"]
|
|
210
|
+
},
|
|
211
|
+
"m-demo-10": {
|
|
212
|
+
text: "Ready to try it yourself?",
|
|
213
|
+
ageLabel: "9:45 AM",
|
|
214
|
+
buttons: [
|
|
215
|
+
"Open sandbox",
|
|
216
|
+
"Book a call",
|
|
217
|
+
"Keep chatting"
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}, i = {
|
|
222
|
+
welcome: {
|
|
223
|
+
system: "You're now chatting with Gaia, our AI assistant.",
|
|
224
|
+
hint: "Tip: attach a file or record a voice note any time.",
|
|
225
|
+
greeting: "Hi there 👋 I'm Gaia, the Wexio AI. Ask me anything, or pick a quick action to get started."
|
|
226
|
+
},
|
|
227
|
+
replies: {
|
|
228
|
+
pricing: {
|
|
229
|
+
text: "Wexio is free for one widget; paid plans start at $39/mo and unlock automations, integrations, and white-label.",
|
|
230
|
+
planBtn: "Show plan tiers",
|
|
231
|
+
salesBtn: "Talk to sales"
|
|
232
|
+
},
|
|
233
|
+
gaia: {
|
|
234
|
+
text: "Gaia is the AI agent that answers visitor questions instantly. It learns from your help articles and hands off to a human when it can't help.",
|
|
235
|
+
handoffBtn: "How does handoff work?"
|
|
236
|
+
},
|
|
237
|
+
human: { text: "Of course - looping in Alex from the team. They'll respond within a few minutes during business hours." },
|
|
238
|
+
fallback: { text: "Got it - let me check on that and circle back in a moment." }
|
|
239
|
+
}
|
|
240
|
+
}, a = {
|
|
241
|
+
main: "Ready to try it yourself?",
|
|
242
|
+
billing: "Thanks! I flagged your invoice question to the billing team.",
|
|
243
|
+
integrations: "How do I connect WhatsApp to my account?"
|
|
244
|
+
}, o = {
|
|
245
|
+
recentMessage: e,
|
|
246
|
+
news: t,
|
|
247
|
+
help: n,
|
|
248
|
+
conversation: r,
|
|
249
|
+
messenger: i,
|
|
250
|
+
threads: a
|
|
251
|
+
};
|
|
252
|
+
//#endregion
|
|
253
|
+
export { r as conversation, o as default, n as help, i as messenger, t as news, e as recentMessage, a as threads };
|
|
254
|
+
|
|
255
|
+
//# sourceMappingURL=widget-react-BS9kUSRS.js.map
|
|
@@ -12,7 +12,7 @@ import "react-dom";
|
|
|
12
12
|
import "react/jsx-runtime";
|
|
13
13
|
import "react-dom/client";
|
|
14
14
|
import { t as e } from "./widget-react-DbOJZl9F.js";
|
|
15
|
-
import {
|
|
15
|
+
import { D as t, Dt as n, H as r, O as i, R as a, T as o, V as s, a as c, i as l, n as u, t as d } from "./widget-react-C6lzldez.js";
|
|
16
16
|
import { i as f, n as p } from "./widget-react-krPPnv02.js";
|
|
17
17
|
import { n as m } from "./widget-react-wSc9gIfG.js";
|
|
18
18
|
import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
@@ -38,44 +38,16 @@ function T(e, t) {
|
|
|
38
38
|
}, [e, t]);
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
|
-
//#region lib/use-demo-translator.ts
|
|
42
|
-
var E = ["en", "uk"];
|
|
43
|
-
async function D(e) {
|
|
44
|
-
switch (e) {
|
|
45
|
-
case "uk": return (await import("./widget-react-DSUX0aJn.js")).default;
|
|
46
|
-
default: return (await import("./widget-react-D8Z8cGhJ.js")).default;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function O(e) {
|
|
50
|
-
return (t) => {
|
|
51
|
-
let n = e;
|
|
52
|
-
for (let e of t.split(".")) if (n && typeof n == "object" && e in n) n = n[e];
|
|
53
|
-
else return;
|
|
54
|
-
return n;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function k(e, t) {
|
|
58
|
-
let [n, r] = y(null);
|
|
59
|
-
return g(() => {
|
|
60
|
-
let t = !0;
|
|
61
|
-
return D(e).then((e) => {
|
|
62
|
-
t && r({ raw: O(e) });
|
|
63
|
-
}), () => {
|
|
64
|
-
t = !1;
|
|
65
|
-
};
|
|
66
|
-
}, [e]), n ?? t;
|
|
67
|
-
}
|
|
68
|
-
//#endregion
|
|
69
41
|
//#region lib/article-prose.ts
|
|
70
|
-
var
|
|
42
|
+
var E = (/* @__PURE__ */ "prose max-w-none text-sm leading-relaxed text-wx-fg,[&_p]:my-3 [&_strong]:font-semibold [&_em]:italic,[&_a]:text-wx-primary [&_a]:underline [&_a]:underline-offset-2,[&_a]:transition-opacity [&_a:hover]:opacity-70,[&_code]:rounded-[6px] [&_code]:bg-wx-bg-elevated [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.85em],[&_pre]:my-4 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:border [&_pre]:border-wx-border,[&_pre]:bg-[#0f1115] [&_pre]:text-zinc-100 [&_pre]:p-4 [&_pre]:text-[12.5px] [&_pre]:leading-relaxed,[&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-zinc-100,[&_.hljs-keyword]:text-violet-300 [&_.hljs-built_in]:text-violet-300 [&_.hljs-type]:text-violet-300,[&_.hljs-string]:text-emerald-300,[&_.hljs-number]:text-amber-300 [&_.hljs-literal]:text-amber-300,[&_.hljs-comment]:text-zinc-500 [&_.hljs-comment]:italic,[&_.hljs-attr]:text-sky-300 [&_.hljs-attribute]:text-sky-300,[&_.hljs-title]:text-zinc-100 [&_.hljs-title]:font-medium,[&_.hljs-tag]:text-rose-300 [&_.hljs-name]:text-rose-300,[&_h1]:mt-6 [&_h1]:mb-3 [&_h1]:text-xl [&_h1]:font-semibold [&_h1]:tracking-tight,[&_h2]:mt-5 [&_h2]:mb-2 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:tracking-tight,[&_h3]:mt-4 [&_h3]:mb-1.5 [&_h3]:text-sm [&_h3]:font-semibold,[&_h1]:scroll-mt-16 [&_h2]:scroll-mt-16 [&_h3]:scroll-mt-16,[&_ul]:my-3 [&_ul]:list-disc [&_ul]:pl-5 [&_ul]:marker:text-wx-fg-subtle,[&_ol]:my-3 [&_ol]:list-decimal [&_ol]:pl-5 [&_ol]:marker:text-wx-fg-subtle,[&_li]:my-1,[&_ul[data-type=taskList]]:list-none! [&_ul[data-type=taskList]]:pl-0!,[&_ul[data-type=taskList]_li]:my-1.5 [&_ul[data-type=taskList]_li]:flex! [&_ul[data-type=taskList]_li]:items-start [&_ul[data-type=taskList]_li]:gap-2 [&_ul[data-type=taskList]_li]:pl-0,[&_ul[data-type=taskList]_li]:marker:content-none,[&_ul[data-type=taskList]_li>label]:m-0 [&_ul[data-type=taskList]_li>label]:inline-flex [&_ul[data-type=taskList]_li>label]:h-5 [&_ul[data-type=taskList]_li>label]:items-center [&_ul[data-type=taskList]_li>label]:shrink-0 [&_ul[data-type=taskList]_li>label]:select-none,[&_ul[data-type=taskList]_li>label]:pointer-events-none [&_ul[data-type=taskList]_li>label]:cursor-default,[&_ul[data-type=taskList]_input]:accent-wx-primary [&_ul[data-type=taskList]_input]:h-3.5 [&_ul[data-type=taskList]_input]:w-3.5,[&_ul[data-type=taskList]_li>label>span]:hidden,[&_ul[data-type=taskList]_li>div]:min-w-0 [&_ul[data-type=taskList]_li>div]:flex-1,[&_ul[data-type=taskList]_li>div>p]:my-0! [&_ul[data-type=taskList]_li>div>p]:leading-snug,[&_ul[data-type=taskList]_li[data-checked=true]>div]:text-wx-fg-muted [&_ul[data-type=taskList]_li[data-checked=true]>div]:line-through,[&_blockquote]:my-4 [&_blockquote]:border-l-2 [&_blockquote]:border-wx-primary/40,[&_blockquote]:pl-3 [&_blockquote]:italic [&_blockquote]:text-wx-fg-muted,[&_hr]:my-6 [&_hr]:border-wx-border,[&_img]:my-3 [&_img]:mx-auto [&_img]:block [&_img]:max-w-full,[&_figure]:my-5 [&_figure]:flex [&_figure]:flex-col [&_figure]:items-center [&_figure]:text-center,[&_figure_img]:my-0,[&_figcaption]:mt-2 [&_figcaption]:text-xs [&_figcaption]:italic [&_figcaption]:text-wx-fg-muted,[&_table]:my-3 [&_table]:w-full [&_table]:table-fixed [&_table]:border-collapse [&_table]:text-xs,[&_table]:overflow-hidden [&_table]:rounded-lg [&_table]:border [&_table]:border-wx-border,[&_thead]:bg-wx-bg-elevated,[&_th]:px-2.5 [&_th]:py-1.5 [&_th]:text-left [&_th]:font-medium [&_th]:text-wx-fg,[&_th]:border-b [&_th]:border-wx-border,[&_th+th]:border-l [&_th+th]:border-wx-border,[&_td]:px-2.5 [&_td]:py-1.5 [&_td]:text-wx-fg [&_td]:align-top,[&_td+td]:border-l [&_td+td]:border-wx-border,[&_tbody_tr]:border-t [&_tbody_tr]:border-wx-border,[&_tbody_tr:nth-child(odd)]:bg-wx-bg-elevated/40,[&_th_p]:my-0 [&_td_p]:my-0 [&_th_p]:inline [&_td_p]:inline,[&_details]:my-2 [&_details]:overflow-hidden [&_details]:rounded-lg [&_details]:border [&_details]:border-wx-border [&_details]:bg-wx-bg-elevated/40,[&_details+details]:mt-2,[&_summary]:relative [&_summary]:cursor-pointer [&_summary]:list-none [&_summary]:px-4 [&_summary]:py-3,[&_summary]:pr-10 [&_summary]:text-sm [&_summary]:font-medium [&_summary]:text-wx-fg,[&_summary::-webkit-details-marker]:hidden [&_summary::marker]:hidden,[&_summary]:after:absolute [&_summary]:after:right-4 [&_summary]:after:top-1/2,[&_summary]:after:-translate-y-1/2 [&_summary]:after:text-wx-fg-subtle,[&_summary]:after:text-base [&_summary]:after:leading-none,[&_summary]:after:transition-transform [&_summary]:after:content-['\\203A'],[&_details[open]_summary]:after:rotate-90,[&_details[open]_summary]:border-b [&_details[open]_summary]:border-wx-border,[&_details]:[&>:not(summary)]:px-4 [&_details]:[&>:not(summary)]:py-3,[&_details]:[&>:not(summary):first-of-type]:pt-3".split(",")).join(" ");
|
|
71
43
|
//#endregion
|
|
72
44
|
//#region components/widget/article-body.tsx
|
|
73
|
-
function
|
|
45
|
+
function D({ content: e, isHtml: t, markdownMarginClass: n }) {
|
|
74
46
|
return t ? /* @__PURE__ */ b(u, {
|
|
75
47
|
html: e,
|
|
76
|
-
className: `mt-0 ${
|
|
48
|
+
className: `mt-0 ${E}`
|
|
77
49
|
}) : /* @__PURE__ */ b("div", {
|
|
78
|
-
className: `${n} ${
|
|
50
|
+
className: `${n} ${E}`,
|
|
79
51
|
children: /* @__PURE__ */ b(c, {
|
|
80
52
|
remarkPlugins: [l],
|
|
81
53
|
children: e
|
|
@@ -84,12 +56,12 @@ function j({ content: e, isHtml: t, markdownMarginClass: n }) {
|
|
|
84
56
|
}
|
|
85
57
|
//#endregion
|
|
86
58
|
//#region components/widget/language-selector/index.tsx
|
|
87
|
-
function
|
|
59
|
+
function O({ currentLocale: n, locales: r, allowedLocales: a, onSelect: s, className: c }) {
|
|
88
60
|
let l = f("languageSelector"), [u, h] = y(!1), _ = v(null);
|
|
89
61
|
g(() => {
|
|
90
62
|
if (!u) return;
|
|
91
63
|
let e = (e) => {
|
|
92
|
-
_.current && !
|
|
64
|
+
_.current && !e.composedPath().includes(_.current) && h(!1);
|
|
93
65
|
}, t = (e) => {
|
|
94
66
|
e.key === "Escape" && h(!1);
|
|
95
67
|
};
|
|
@@ -99,7 +71,7 @@ function M({ currentLocale: t, locales: r, allowedLocales: a, onSelect: o, class
|
|
|
99
71
|
}, [u]);
|
|
100
72
|
let S = a && a.length > 0 ? new Set(a.map((e) => e.split("-")[0].toLowerCase())) : null, C = Array.from(new Set(r.filter(Boolean))).filter((e) => !S || S.has(e.split("-")[0].toLowerCase()));
|
|
101
73
|
if (C.length <= 1) return null;
|
|
102
|
-
let w =
|
|
74
|
+
let w = n.split("-")[0].toLowerCase();
|
|
103
75
|
return /* @__PURE__ */ x("div", {
|
|
104
76
|
ref: _,
|
|
105
77
|
className: p("relative", c),
|
|
@@ -116,15 +88,15 @@ function M({ currentLocale: t, locales: r, allowedLocales: a, onSelect: o, class
|
|
|
116
88
|
"aria-label": l("ariaLabel"),
|
|
117
89
|
className: p("flex w-full items-center gap-2 rounded-wx-sm border border-wx-border bg-wx-bg px-3 py-2", "text-sm font-medium text-wx-fg transition-colors hover:bg-wx-bg-elevated", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-wx-primary"),
|
|
118
90
|
children: [
|
|
119
|
-
/* @__PURE__ */ b(
|
|
91
|
+
/* @__PURE__ */ b(o, {
|
|
120
92
|
size: 15,
|
|
121
93
|
className: "shrink-0 text-wx-fg-muted"
|
|
122
94
|
}),
|
|
123
95
|
/* @__PURE__ */ b("span", {
|
|
124
96
|
className: "min-w-0 flex-1 truncate text-left",
|
|
125
|
-
children: d(
|
|
97
|
+
children: d(n)
|
|
126
98
|
}),
|
|
127
|
-
/* @__PURE__ */ b(
|
|
99
|
+
/* @__PURE__ */ b(t, {
|
|
128
100
|
size: 15,
|
|
129
101
|
className: p("shrink-0 text-wx-fg-subtle transition-transform", u && "rotate-180")
|
|
130
102
|
})
|
|
@@ -153,7 +125,7 @@ function M({ currentLocale: t, locales: r, allowedLocales: a, onSelect: o, class
|
|
|
153
125
|
role: "option",
|
|
154
126
|
"aria-selected": t,
|
|
155
127
|
onClick: () => {
|
|
156
|
-
|
|
128
|
+
s(e), h(!1);
|
|
157
129
|
},
|
|
158
130
|
className: p("flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors", t ? "font-semibold text-wx-primary" : "text-wx-fg hover:bg-wx-bg-elevated"),
|
|
159
131
|
children: [/* @__PURE__ */ b("span", {
|
|
@@ -171,7 +143,7 @@ function M({ currentLocale: t, locales: r, allowedLocales: a, onSelect: o, class
|
|
|
171
143
|
}
|
|
172
144
|
//#endregion
|
|
173
145
|
//#region components/widget/reaction-bar.tsx
|
|
174
|
-
var
|
|
146
|
+
var k = (e, t) => `wexio:reaction:${e}:${t}`, A = [
|
|
175
147
|
{
|
|
176
148
|
slotIndex: 0,
|
|
177
149
|
emoji: "🎉"
|
|
@@ -184,70 +156,70 @@ var N = (e, t) => `wexio:reaction:${e}:${t}`, P = [
|
|
|
184
156
|
slotIndex: 2,
|
|
185
157
|
emoji: "👍"
|
|
186
158
|
}
|
|
187
|
-
],
|
|
159
|
+
], j = {
|
|
188
160
|
[w.NEWS]: "NewsPost",
|
|
189
161
|
[w.HELP]: "HelpArticle"
|
|
190
162
|
};
|
|
191
|
-
function
|
|
192
|
-
let S = f("reactions"), C =
|
|
193
|
-
variables: { surface:
|
|
163
|
+
function M({ surface: t, itemId: i, reactionCounts: o, viewerReaction: c, groupItemIds: l, readonly: u = !1, showCounts: d = !0, isDummy: m = !1, className: v }) {
|
|
164
|
+
let S = f("reactions"), C = n(), { data: w, loading: T } = r({
|
|
165
|
+
variables: { surface: t },
|
|
194
166
|
fetchPolicy: "cache-first",
|
|
195
167
|
skip: m
|
|
196
|
-
}), [E, { loading: D }] =
|
|
168
|
+
}), [E, { loading: D }] = s(), O = a(), M = _(() => m ? A : w?.visitorReactionSet?.slots ?? [], [m, w]), N = m ? !0 : w?.visitorReactionSet?.enabled ?? !0, P = k(t, i), [F, I] = y(null);
|
|
197
169
|
g(() => {
|
|
198
170
|
if (!m) {
|
|
199
171
|
I(c ?? null);
|
|
200
172
|
return;
|
|
201
173
|
}
|
|
202
174
|
if (typeof window > "u") return;
|
|
203
|
-
let e = window.localStorage.getItem(
|
|
175
|
+
let e = window.localStorage.getItem(P);
|
|
204
176
|
I(e === null ? null : Number(e));
|
|
205
177
|
}, [
|
|
206
178
|
m,
|
|
207
|
-
|
|
179
|
+
P,
|
|
208
180
|
c
|
|
209
181
|
]);
|
|
210
|
-
let [L, R] = y({}), z = (e) => (
|
|
211
|
-
let r =
|
|
212
|
-
for (let
|
|
182
|
+
let [L, R] = y({}), z = (e) => (o?.[String(e)] ?? 0) + (m ? L[e] ?? 0 : 0), B = h((e, n) => {
|
|
183
|
+
let r = j[t], a = l?.length ? l : [i];
|
|
184
|
+
for (let t of a) {
|
|
213
185
|
let i = C.cache.identify({
|
|
214
186
|
__typename: r,
|
|
215
|
-
_id:
|
|
187
|
+
_id: t
|
|
216
188
|
});
|
|
217
189
|
i && C.cache.modify({
|
|
218
190
|
id: i,
|
|
219
191
|
fields: {
|
|
220
|
-
viewerReaction: () =>
|
|
221
|
-
reactionCounts: (
|
|
222
|
-
let r = { ...
|
|
223
|
-
return
|
|
192
|
+
viewerReaction: () => n,
|
|
193
|
+
reactionCounts: (t) => {
|
|
194
|
+
let r = { ...t ?? {} };
|
|
195
|
+
return n !== null && (r[n] = (r[n] ?? 0) + 1), e !== null && (r[e] = Math.max(0, (r[e] ?? 0) - 1)), r;
|
|
224
196
|
}
|
|
225
197
|
}
|
|
226
198
|
});
|
|
227
199
|
}
|
|
228
200
|
}, [
|
|
229
201
|
C,
|
|
230
|
-
|
|
202
|
+
t,
|
|
231
203
|
l,
|
|
232
204
|
i
|
|
233
205
|
]), V = async (e) => {
|
|
234
|
-
if (u || D ||
|
|
235
|
-
let
|
|
206
|
+
if (u || D || F === e) return;
|
|
207
|
+
let n = F;
|
|
236
208
|
if (I(e), m) {
|
|
237
|
-
typeof window < "u" && window.localStorage.setItem(
|
|
238
|
-
...
|
|
239
|
-
[e]: (
|
|
240
|
-
...
|
|
209
|
+
typeof window < "u" && window.localStorage.setItem(P, String(e)), R((t) => ({
|
|
210
|
+
...t,
|
|
211
|
+
[e]: (t[e] ?? 0) + 1,
|
|
212
|
+
...n === null ? {} : { [n]: (t[n] ?? 0) - 1 }
|
|
241
213
|
}));
|
|
242
214
|
return;
|
|
243
215
|
}
|
|
244
|
-
if (B(
|
|
216
|
+
if (B(n, e), O) {
|
|
245
217
|
O.enqueue({
|
|
246
218
|
op: "reaction",
|
|
247
219
|
semantics: "convergence",
|
|
248
|
-
convergenceKey: `reaction:${
|
|
220
|
+
convergenceKey: `reaction:${t}:${i}`,
|
|
249
221
|
payload: {
|
|
250
|
-
surface:
|
|
222
|
+
surface: t,
|
|
251
223
|
itemId: i,
|
|
252
224
|
slotIndex: e
|
|
253
225
|
}
|
|
@@ -256,20 +228,20 @@ function I({ surface: n, itemId: i, reactionCounts: s, viewerReaction: c, groupI
|
|
|
256
228
|
}
|
|
257
229
|
try {
|
|
258
230
|
await E({ variables: { input: {
|
|
259
|
-
surface:
|
|
231
|
+
surface: t,
|
|
260
232
|
itemId: i,
|
|
261
233
|
slotIndex: e
|
|
262
234
|
} } });
|
|
263
235
|
} catch {
|
|
264
|
-
B(e,
|
|
236
|
+
B(e, n), I(n);
|
|
265
237
|
}
|
|
266
238
|
};
|
|
267
|
-
return T || !
|
|
239
|
+
return T || !N || M.length === 0 ? null : /* @__PURE__ */ b("div", {
|
|
268
240
|
className: p("flex flex-wrap items-center justify-center gap-2", v),
|
|
269
241
|
role: "group",
|
|
270
242
|
"aria-label": S("ariaLabel"),
|
|
271
|
-
children:
|
|
272
|
-
let n =
|
|
243
|
+
children: M.map((t) => {
|
|
244
|
+
let n = F === t.slotIndex, r = z(t.slotIndex);
|
|
273
245
|
return /* @__PURE__ */ x(e.button, {
|
|
274
246
|
type: "button",
|
|
275
247
|
disabled: u || D,
|
|
@@ -296,6 +268,6 @@ function I({ surface: n, itemId: i, reactionCounts: s, viewerReaction: c, groupI
|
|
|
296
268
|
});
|
|
297
269
|
}
|
|
298
270
|
//#endregion
|
|
299
|
-
export {
|
|
271
|
+
export { C as a, T as i, O as n, w as o, D as r, S as s, M as t };
|
|
300
272
|
|
|
301
|
-
//# sourceMappingURL=widget-react-
|
|
273
|
+
//# sourceMappingURL=widget-react-BfO-uP4o.js.map
|