@moveo-ai/web-client 0.109.0 → 0.110.0-true.10

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 (46) hide show
  1. package/README.md +209 -37
  2. package/dist/63.min.js.LICENSE.txt +1 -1
  3. package/dist/752.min.js.LICENSE.txt +1 -1
  4. package/dist/882.min.js.LICENSE.txt +1 -1
  5. package/dist/929.min.js.LICENSE.txt +1 -1
  6. package/dist/audio-client.min.js +1 -1
  7. package/dist/audio-client.min.js.LICENSE.txt +1 -1
  8. package/dist/iframe.min.js +1 -1
  9. package/dist/iframe.min.js.LICENSE.txt +1 -1
  10. package/dist/index.html +2 -6
  11. package/dist/preview/index.html +2 -2
  12. package/dist/preview.css.min.js.LICENSE.txt +1 -1
  13. package/dist/public/locales/ar.json +70 -41
  14. package/dist/public/locales/bg.json +70 -41
  15. package/dist/public/locales/cs.json +70 -41
  16. package/dist/public/locales/da.json +70 -41
  17. package/dist/public/locales/de.json +70 -41
  18. package/dist/public/locales/el.json +99 -58
  19. package/dist/public/locales/en.json +70 -44
  20. package/dist/public/locales/es.json +101 -60
  21. package/dist/public/locales/fr.json +70 -41
  22. package/dist/public/locales/id.json +70 -41
  23. package/dist/public/locales/it.json +70 -41
  24. package/dist/public/locales/ja.json +70 -41
  25. package/dist/public/locales/me.json +70 -41
  26. package/dist/public/locales/nl-be.json +70 -41
  27. package/dist/public/locales/nl.json +70 -41
  28. package/dist/public/locales/pl.json +70 -41
  29. package/dist/public/locales/pt-br.json +94 -53
  30. package/dist/public/locales/pt.json +70 -41
  31. package/dist/public/locales/ro.json +70 -41
  32. package/dist/public/locales/ru.json +70 -41
  33. package/dist/public/locales/sq.json +70 -41
  34. package/dist/public/locales/sr.json +70 -41
  35. package/dist/public/locales/sv.json +70 -41
  36. package/dist/public/locales/tl.json +70 -41
  37. package/dist/public/locales/tr.json +70 -41
  38. package/dist/public/locales/zh.json +70 -41
  39. package/dist/telnyx-client.min.js +1 -1
  40. package/dist/telnyx-client.min.js.LICENSE.txt +1 -1
  41. package/dist/web-client.min.js +1 -1
  42. package/dist/web-client.min.js.LICENSE.txt +1 -1
  43. package/dist/webrtc-client.min.js +1 -1
  44. package/dist/webrtc-client.min.js.LICENSE.txt +1 -1
  45. package/package.json +17 -8
  46. package/web-client.d.ts +1 -1
package/README.md CHANGED
@@ -121,9 +121,11 @@ into an analytics tool:
121
121
 
122
122
  ```javascript
123
123
  MoveoAI.init({ integrationId: 'YOUR_INTEGRATION_ID' }).then((controller) => {
124
- controller.onAnalyticsEvent(({ timestamp, event, session_id, properties }) => {
125
- console.debug('[moveo]', timestamp, event, session_id, properties);
126
- });
124
+ controller.onAnalyticsEvent(
125
+ ({ timestamp, event, session_id, properties }) => {
126
+ console.debug('[moveo]', timestamp, event, session_id, properties);
127
+ }
128
+ );
127
129
  });
128
130
  ```
129
131
 
@@ -168,14 +170,14 @@ MoveoAI.init({ integrationId: 'YOUR_INTEGRATION_ID' }).then((controller) => {
168
170
 
169
171
  Initializes the chat widget.
170
172
 
171
- | Parameter | Type | Required | Description |
172
- | --------------- | ----------------------- | -------- | -------------------------------------------------------- |
173
- | `integrationId` | `string` | Yes | Your Moveo.ai integration ID |
174
- | `host` | `string` | No | Regional channels host, when it differs from the default |
175
- | `element` | `HTMLElement \| string` | No | Embed target, required for the `embed` widget position |
176
- | `identityToken` | `string` | No | Signed token that verifies the user's identity on the session |
177
- | `voiceIntegrationId` | `string` | No | Voice pairing override for the in-widget call |
178
- | `variant` | `'default' \| 'nbg' \| 'alpha' \| 'fiserv'` | No | Visual variant |
173
+ | Parameter | Type | Required | Description |
174
+ | -------------------- | ------------------------------------------- | -------- | ------------------------------------------------------------- |
175
+ | `integrationId` | `string` | Yes | Your Moveo.ai integration ID |
176
+ | `host` | `string` | No | Regional channels host, when it differs from the default |
177
+ | `element` | `HTMLElement \| string` | No | Embed target, required for the `embed` widget position |
178
+ | `identityToken` | `string` | No | Signed token that verifies the user's identity on the session |
179
+ | `voiceIntegrationId` | `string` | No | Voice pairing override for the in-widget call |
180
+ | `variant` | `'default' \| 'nbg' \| 'alpha' \| 'fiserv'` | No | Visual variant |
179
181
 
180
182
  Any other key passes through as a widget-config override for the loaded integration.
181
183
 
@@ -183,43 +185,70 @@ Any other key passes through as a widget-config override for the loaded integrat
183
185
 
184
186
  ### WidgetController Methods
185
187
 
186
- | Method | Description |
187
- | ------------------------------- | ------------------------------------------------------ |
188
- | `openWindow()` | Opens the chat window |
189
- | `closeWindow()` | Closes the chat window |
190
- | `closeConversation({ hide })` | Ends the conversation; the widget hides unless `hide: false` |
191
- | `sendMessage({ text })` | Sends a message to the agent |
192
- | `showTeaserMessage(message?)` | Shows the teaser bubble |
193
- | `updateContext(ctx)` | Updates the conversation context |
194
- | `setCSSVariables(vars)` | Overrides widget CSS variables |
195
- | `setLocale(locale)` | Switches the widget language |
196
- | `destroy()` | Removes the widget from the page |
188
+ | Method | Description |
189
+ | ----------------------------- | ------------------------------------------------------------ |
190
+ | `openWindow()` | Opens the chat window |
191
+ | `closeWindow()` | Closes the chat window |
192
+ | `closeConversation({ hide })` | Ends the conversation; the widget hides unless `hide: false` |
193
+ | `sendMessage({ text })` | Sends a message to the agent |
194
+ | `showTeaserMessage(message?)` | Shows the teaser bubble |
195
+ | `updateContext(ctx)` | Updates the conversation context |
196
+ | `setCSSVariables(vars)` | Overrides widget CSS variables |
197
+ | `setLocale(locale)` | Switches the widget language |
198
+ | `destroy()` | Removes the widget from the page |
197
199
 
198
200
  ### WidgetController Events
199
201
 
200
202
  Register a callback per event. Every callback returns nothing and receives the
201
203
  payload listed below.
202
204
 
203
- | Method | Fires when | Payload |
204
- | ----------------------------- | ---------------------------------------------- | ---------------------------------------------------- |
205
- | `onSessionCreated(cb)` | A new session opens | `{ user_id, session_id, display_name }` |
206
- | `onSessionReconnected(cb)` | An existing session reconnects | `{ user_id, session_id, display_name }` |
207
- | `onSessionClosed(cb)` | The session closes | — |
208
- | `onConversationClosed(cb)` | The user ends the conversation | — |
209
- | `onWebchatOpened(cb)` | The user opens the widget | `{ isFull, is_mobile? }` |
210
- | `onWebchatClosed(cb)` | The user closes the widget | `{ isFull }` |
211
- | `onLinkClicked(cb)` | The user clicks a link inside the chat | `{ url }` |
212
- | `onUnreadMessages(cb)` | Unread messages exist while the widget is shut | — |
213
- | `onNoUnreadMessages(cb)` | The unread indicator clears | — |
214
- | `onUserActivity(cb)` | The visitor interacts with the widget | — |
215
- | `onMemberLeave(cb)` | An agent leaves the conversation | — |
216
- | `onAnalyticsEvent(cb)` | Any interaction event (see below) | `{ timestamp, event, session_id?, properties }` |
205
+ | Method | Fires when | Payload |
206
+ | -------------------------- | ---------------------------------------------- | ----------------------------------------------- |
207
+ | `onSessionCreated(cb)` | A new session opens | `{ user_id, session_id, display_name }` |
208
+ | `onSessionReconnected(cb)` | An existing session reconnects | `{ user_id, session_id, display_name }` |
209
+ | `onSessionClosed(cb)` | The session closes | — |
210
+ | `onConversationClosed(cb)` | The user ends the conversation | — |
211
+ | `onWebchatOpened(cb)` | The user opens the widget | `{ isFull, is_mobile? }` |
212
+ | `onWebchatClosed(cb)` | The user closes the widget | `{ isFull }` |
213
+ | `onLinkClicked(cb)` | The user clicks a link inside the chat | `{ url }` |
214
+ | `onUnreadMessages(cb)` | Unread messages exist while the widget is shut | — |
215
+ | `onNoUnreadMessages(cb)` | The unread indicator clears | — |
216
+ | `onUserActivity(cb)` | The visitor interacts with the widget | — |
217
+ | `onMemberLeave(cb)` | An agent leaves the conversation | — |
218
+ | `onAnalyticsEvent(cb)` | The widget loads, and every interaction | `{ timestamp, event, session_id?, properties }` |
217
219
 
218
220
  `onAnalyticsEvent` receives every interaction the widget tracks, identified by
219
221
  the `event` field: `session_start`, `session_end`, `message_sent` (the user sent
220
222
  a message — never carries the text), `launcher_clicked`, `rating_submitted`, and
221
223
  the rest of the `AnalyticsEvent` enum in `src/hooks/useAnalytics.ts`.
222
224
 
225
+ It also receives one event that is not an interaction: **`widget_loaded`**,
226
+ raised as soon as the widget renders on the page. It carries no `session_id`,
227
+ because a session opens only when the visitor opens the chat. Register the
228
+ callback at any time — a callback added after the widget loaded still receives
229
+ `widget_loaded` on registration, so the event cannot be missed in the race
230
+ between `init()` resolving and your `.then()` running.
231
+
232
+ #### Header control changes
233
+
234
+ The header no longer carries a separate minimize button. The close button hides
235
+ the panel and leaves the conversation open, and **Restart** moved into the
236
+ header menu, where it asks before it ends the conversation. Three consequences
237
+ for anything you already bind:
238
+
239
+ - **`minimize_icon_clicked` no longer exists.** It left the `AnalyticsEventName`
240
+ union with the button. A filter on that name now matches nothing, silently.
241
+ There is no replacement: the close button reports `close_icon_clicked`.
242
+ - **`close_icon_clicked` no longer implies the conversation ended.** It now
243
+ means the visitor hid the panel. Counting it as an end overstates your
244
+ conversation count.
245
+ - **`restart_conversation_clicked` is new.** It fires when the visitor opens
246
+ Restart from the header menu, before the confirmation. `onConversationClosed`
247
+ still fires only if they confirm, so the two are not interchangeable.
248
+
249
+ During a voice call the close button keeps its old meaning and ends the call,
250
+ after a confirmation.
251
+
223
252
  ### Forward widget events into your analytics
224
253
 
225
254
  The widget never writes into your analytics tools. If you want chat activity in
@@ -230,9 +259,17 @@ and where. With Quantum Metric, for example:
230
259
  MoveoAI.init({ integrationId: 'YOUR_INTEGRATION_ID' }).then((controller) => {
231
260
  // Event ids must exist in your Quantum Metric configuration first:
232
261
  // sendEvent() silently drops ids that are not defined for the page.
233
- const QM_MOVEO_SESSION = 901; // example ids — define your own
262
+ const QM_MOVEO_LOADED = 900; // example ids — define your own
263
+ const QM_MOVEO_SESSION = 901;
234
264
  const QM_MOVEO_MESSAGE = 902;
235
265
 
266
+ controller.onAnalyticsEvent(({ event }) => {
267
+ if (event === 'widget_loaded') {
268
+ // Fires on every page that carries the widget, with no visitor action.
269
+ window.QuantumMetricAPI?.sendEvent(QM_MOVEO_LOADED, 0, '');
270
+ }
271
+ });
272
+
236
273
  controller.onSessionCreated(({ session_id }) => {
237
274
  // The Moveo session id becomes searchable on the QM session,
238
275
  // joining every replay to its Moveo conversation.
@@ -276,6 +313,141 @@ MoveoAI.init({
276
313
  });
277
314
  ```
278
315
 
316
+ ### Inactivity Timeout
317
+
318
+ The widget opens an inactivity modal once the visitor goes quiet, and asks
319
+ whether to keep the conversation. Set `inactivity_timeout` in minutes to change
320
+ when it appears. Set it in the integration's configuration, or override it on
321
+ `init()`:
322
+
323
+ ```javascript
324
+ MoveoAI.init({
325
+ integrationId: 'YOUR_INTEGRATION_ID',
326
+ inactivity_timeout: 20, // minutes; 0 turns the modal off
327
+ });
328
+ ```
329
+
330
+ | Value | Effect |
331
+ | --------------------------------- | ------------------------------------------ |
332
+ | `0` | No modal. The widget still tracks activity |
333
+ | `3` to `30` | The modal opens after that many minutes |
334
+ | Below `3`, or above `30` | Clamped into the 3 to 30 minute range |
335
+ | Absent, negative, or not a number | The default, 10 minutes |
336
+
337
+ Below 3 minutes the modal interrupts a visitor who only stopped to read. Above
338
+ 30 it holds a dead session open for hours. A negative value falls back to the
339
+ default rather than to `0`, so a malformed configuration cannot switch the
340
+ modal off without anyone noticing.
341
+
342
+ Only activity inside the widget counts. A visitor who scrolls your page but
343
+ does not touch the chat is inactive.
344
+
345
+ ### CSS Variables
346
+
347
+ Pass any of these to `setCSSVariables()` to restyle the widget. Every value is
348
+ a plain CSS value, applied inside the widget iframe.
349
+
350
+ ```javascript
351
+ const widget = await MoveoAI.init({ integrationId: 'YOUR_INTEGRATION_ID' });
352
+
353
+ widget.setCSSVariables({
354
+ '--moveo-border-radius-surface': '8px',
355
+ '--moveo-font-primary': "'Roboto', sans-serif",
356
+ });
357
+ ```
358
+
359
+ | Variable | Default | Controls |
360
+ | ------------------------------- | ---------------------------- | -------------------------------------------------------------- |
361
+ | `--moveo-font-primary` | unset, see below | The widget font family |
362
+ | `--moveo-border-radius-surface` | `16px` | Corner radius of the chat panel, dialogs and the webview sheet |
363
+ | `--moveo-border-radius-base` | `5px` | Corner radius of inline media and the launcher teaser pill |
364
+ | `--moveo-header-height` | `68px` | Header height, and the offset every screen below it starts at |
365
+ | `--moveo-header-background` | from the theme | Header background; `theme_colors.header_color` sets it too |
366
+ | `--moveo-header-text-color` | from the theme | Header text and icon colour |
367
+ | `--moveo-shadow-bubble` | `0px 0px 10px 0px #10182824` | Launcher bubble shadow |
368
+ | `--moveo-loadingIcon-size` | `1rem` | Size of the loading spinner |
369
+ | `--moveo-modal-tall-height` | `min(600px, 100%)` | Height of a `tall` webview dialog; never exceeds the widget |
370
+ | `--moveo-modal-tall-width` | `min(400px, 100%)` | Width of a `tall` webview dialog; never exceeds the widget |
371
+ | `--moveo-expanded-chat-width` | `672px` | Panel width in the expanded layout |
372
+ | `--moveo-chat-width` | from the config | Panel width; the `chatWindow` config sets it |
373
+ | `--moveo-chat-height` | from the config | Panel height; the `chatWindow` config sets it |
374
+ | `--moveo-z-index` | `10022` | Stacking of the widget against your page. See below |
375
+
376
+ #### Fonts
377
+
378
+ `--moveo-font-primary` is unset by default. The widget then uses the font its
379
+ configuration loads — the `font_family` setting, or the font that ships with
380
+ your variant. Set the variable to override that, at any time and from either
381
+ `setCSSVariables()` or your own stylesheet. The widget never writes it back, so
382
+ your value survives a font that finishes loading later.
383
+
384
+ #### Stacking order
385
+
386
+ The widget renders in an iframe on your page, so its stacking is decided by
387
+ your document, not by anything inside the widget. Raise it above a header or a
388
+ cookie banner either from your own stylesheet:
389
+
390
+ ```css
391
+ :root {
392
+ --moveo-z-index: 999999;
393
+ }
394
+ ```
395
+
396
+ or through the API, which applies it to the iframe on your page:
397
+
398
+ ```javascript
399
+ widget.setCSSVariables({ '--moveo-z-index': '999999' });
400
+ ```
401
+
402
+ Every other variable in the table applies inside the widget iframe.
403
+
404
+ `--nbg-bg` also exists, for one account's variant styling. It is not part of
405
+ the supported surface.
406
+
407
+ #### Colours
408
+
409
+ Set colours in the integration's `theme_colors` config, which carries a `light`
410
+ and a `dark` set. Each key writes one CSS variable, so the same colours can be
411
+ overridden at runtime through `setCSSVariables()`, which wins over the config.
412
+
413
+ | `theme_colors` key | CSS variable | Controls |
414
+ | ---------------------- | ----------------------------------- | ----------------------------------------------------------- |
415
+ | `accent_color` | `--color-accent` | The accent, and the default for every colour marked below |
416
+ | `background_color` | `--color-background` | The widget surface, and the area behind the messages |
417
+ | `border_color` | `--color-border` | Panel, composer and card borders |
418
+ | `header_color` | `--moveo-header-background` | Header background |
419
+ | `text_color_header` | `--moveo-header-text-color` | Header text and icons |
420
+ | `text_color_user` | `--color-text-primary-foreground` | Text inside the visitor's own bubbles |
421
+ | `text_color_agent` | `--color-text-secondary-foreground` | Text inside the agent's bubbles |
422
+ | `launcher_background` | `--color-launcher-background` | Launcher bubble; defaults to the accent |
423
+ | `launcher_foreground` | `--color-launcher-foreground` | Launcher icon; defaults to the widget background |
424
+ | `link_color` | `--color-link` | Links in messages; defaults to the accent |
425
+ | `rating_background` | `--color-rating-background` | Selected rating button; defaults to the accent |
426
+ | `send_icon_color` | `--color-send-icon` | Send icon in the composer; defaults to the accent |
427
+ | `swimmlane_background` | `--color-swimmlane-background` | System message pill background |
428
+ | `swimmlane_foreground` | `--color-swimmlane-foreground` | System message pill text; defaults to the agent text colour |
429
+
430
+ A colour that says "defaults to" follows `--color-accent` — or the colour named
431
+ — until you set it. So an accent alone restyles the links, the rating, the send
432
+ icon and the launcher, and `--color-chat-background` follows the background.
433
+
434
+ Four more colours have no `theme_colors` key, so they are set through
435
+ `setCSSVariables()` only:
436
+
437
+ | Variable | Controls |
438
+ | ---------------------------- | ---------------------------------------------------- |
439
+ | `--color-chat-background` | The area behind the messages; follows the background |
440
+ | `--color-options-background` | Quick reply button background |
441
+ | `--color-options-foreground` | Quick reply button label; defaults to the accent |
442
+ | `--color-options-border` | Quick reply button border; defaults to the accent |
443
+
444
+ #### Renamed variables
445
+
446
+ `--moveo-new-header-height` and `--moveo-new-border-radius-base` are the former
447
+ names of `--moveo-header-height` and `--moveo-border-radius-surface`. Setting
448
+ either still works, so existing integrations need no change, but use the names
449
+ in the table above.
450
+
279
451
  ### Supported Languages
280
452
 
281
453
  The widget supports 26 locales including: English, Spanish, French, German, Italian, Portuguese, Dutch, Greek, Arabic, Hebrew, and more.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.109.0
3
+ * @moveo-ai/web-client v0.110.0-true.10
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.109.0
3
+ * @moveo-ai/web-client v0.110.0-true.10
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.109.0
3
+ * @moveo-ai/web-client v0.110.0-true.10
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.109.0
3
+ * @moveo-ai/web-client v0.110.0-true.10
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */