@moveo-ai/web-client 0.112.0 → 0.113.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.112.0
3
+ * @moveo-ai/web-client v0.113.0
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moveo-ai/web-client",
3
- "version": "0.112.0",
3
+ "version": "0.113.0",
4
4
  "description": "Client side library to load the moveo chat widget and connect it with your agent",
5
5
  "main": "dist/web-client.min.js",
6
6
  "types": "web-client.d.ts",
@@ -55,9 +55,8 @@
55
55
  "@babel/preset-env": "^7.29.7",
56
56
  "@babel/preset-react": "^7.29.7",
57
57
  "@babel/preset-typescript": "^7.29.7",
58
- "@chromatic-com/storybook": "^4.1.3",
59
- "@commitlint/cli": "^20.5.3",
60
- "@commitlint/config-conventional": "^20.5.3",
58
+ "@commitlint/cli": "^21.2.2",
59
+ "@commitlint/config-conventional": "^21.2.2",
61
60
  "@playwright/test": "^1.62.1",
62
61
  "@radix-ui/react-checkbox": "^1.3.11",
63
62
  "@radix-ui/react-dialog": "^1.1.23",
@@ -81,10 +80,10 @@
81
80
  "@twilio/voice-sdk": "^2.18.3",
82
81
  "@types/debug": "^4.1.13",
83
82
  "@types/lodash-es": "^4.17.12",
84
- "@types/node": "^24.13.3",
83
+ "@types/node": "^22.20.1",
85
84
  "@types/react": "^19.2.18",
86
85
  "@types/react-dom": "^19.2.4",
87
- "@vitejs/plugin-react": "^5.2.0",
86
+ "@vitejs/plugin-react": "^6.1.0",
88
87
  "@vitest/coverage-v8": "^4.1.10",
89
88
  "@vitest/ui": "^4.1.10",
90
89
  "anchorme": "^3.0.8",
@@ -114,14 +113,14 @@
114
113
  "html-webpack-plugin": "^5.6.8",
115
114
  "http-server": "^14.1.1",
116
115
  "husky": "^9.1.7",
117
- "i18next": "^25.10.10",
116
+ "i18next": "^26.4.0",
118
117
  "i18next-browser-languagedetector": "^8.2.1",
119
118
  "i18next-http-backend": "^4.0.1",
120
119
  "isbot": "^5.2.1",
121
120
  "jotai": "^2.20.2",
122
121
  "jotai-family": "^1.1.0",
123
- "jsdom": "^28.1.0",
124
- "lint-staged": "^16.4.0",
122
+ "jsdom": "^30.0.1",
123
+ "lint-staged": "^17.3.0",
125
124
  "lodash-es": "^4.18.1",
126
125
  "lucide-react": "^1.28.0",
127
126
  "marked": "^18.0.9",
package/web-client.d.ts CHANGED
@@ -16,6 +16,8 @@ export type AnalyticsEventName =
16
16
  | 'shrink_icon_clicked'
17
17
  | 'close_icon_clicked'
18
18
  | 'close_opening_message_click'
19
+ | 'teaser_quick_reply_clicked'
20
+ | 'teaser_composer_submitted'
19
21
  | 'download_conversation_clicked'
20
22
  | 'restart_conversation_clicked'
21
23
  | 'session_start'
@@ -133,6 +135,77 @@ export interface WidgetController {
133
135
  onAnalyticsEvent(callback: (data: AnalyticsEventData) => void): void;
134
136
  }
135
137
 
138
+ /** Which invitation the closed launcher shows. See `TeaserConfig`. */
139
+ export type TeaserVariant = 'callout' | 'question_chips' | 'composer' | 'none';
140
+
141
+ /**
142
+ * Controls the invitation shown beside the closed launcher.
143
+ *
144
+ * One member per shape, each declaring only the fields it renders: a
145
+ * placeholder on a variant with no input, or `question_chips` with nothing to
146
+ * offer, is a compile error rather than a silent no-op.
147
+ *
148
+ * `variant` is optional on the first two, so replies mean chips and their
149
+ * absence means the line — `{ quick_replies: [...] }` is a whole config.
150
+ *
151
+ * `message` supersedes the deprecated top-level `welcome_message`, which is
152
+ * still read when `message` is absent, and `page_triggers[].opening_message`
153
+ * still wins over both, so no integration has to move.
154
+ */
155
+ export type TeaserConfig =
156
+ /** The line alone, in the bubble beside the launcher. */
157
+ | { variant?: 'callout' | null; message?: string | null }
158
+ /** Tappable questions in place of the line. At most three render. */
159
+ | { variant?: 'question_chips' | null; quick_replies: string[] }
160
+ /** The line, and an input the visitor types their own question into. */
161
+ | {
162
+ variant: 'composer';
163
+ message?: string | null;
164
+ placeholder?: string | null;
165
+ }
166
+ /** Launcher only. */
167
+ | { variant: 'none' };
168
+
169
+ /**
170
+ * One `pages[]` entry: a teaser, plus the URL it belongs to.
171
+ *
172
+ * `url` is a hint, not a pattern — it matches when it appears anywhere in the
173
+ * host page's URL, compared case-insensitively. Nothing is escaped and nothing
174
+ * is compiled, so a stray `.` or `(` cannot change what matches or throw.
175
+ */
176
+ export type TeaserPage = TeaserConfig & { url: string };
177
+
178
+ /**
179
+ * The `teaser` block: the teaser the visitor gets, and optionally a different
180
+ * one per page.
181
+ *
182
+ * The block itself is the teaser used everywhere, so the shorthand
183
+ * `teaser: { quick_replies: [...] }` needs nothing else. `pages[]` overrides it
184
+ * on the URLs that match, and is an array rather than a map keyed by URL so
185
+ * precedence is something the author can see: the **first** entry whose `url`
186
+ * matches wins, which means specific paths belong above general ones.
187
+ */
188
+ export type TeaserBlock = TeaserConfig & {
189
+ /** Checked in order; the first match wins, and overrides the block above. */
190
+ pages?: TeaserPage[] | null;
191
+ /**
192
+ * Seconds to wait before the teaser appears, counted from the moment it has
193
+ * something to say. Absent or `0` shows it straight away, which is what every
194
+ * integration does today. A positive value is clamped to 1–60 seconds.
195
+ */
196
+ show_after?: number | null;
197
+ /**
198
+ * Seconds the teaser stays before it retires for the rest of the visit.
199
+ * Absent or `0` keeps it up, which is what every integration does today. A
200
+ * positive value is clamped to 5–300 seconds.
201
+ *
202
+ * This counts time the teaser is actually on screen: the clock pauses while
203
+ * the visitor scrolls it out of the way, so a visitor who spent the budget
204
+ * scrolling has not spent it ignoring the teaser.
205
+ */
206
+ hide_after?: number | null;
207
+ };
208
+
136
209
  export interface UserConfig {
137
210
  integrationId: string;
138
211
  /** Regional channels host, when it differs from the default. */
@@ -144,6 +217,8 @@ export interface UserConfig {
144
217
  variant?: 'default' | 'nbg' | 'alpha' | 'fiserv';
145
218
  /** Initial conversation context, same shape as `updateContext`. */
146
219
  context?: Context;
220
+ /** Overrides the integration's teaser, per URL. See "Teaser" in the README. */
221
+ teaser?: TeaserBlock | null;
147
222
  /** Widget-config overrides pass through to the loaded integration config. */
148
223
  [key: string]: unknown;
149
224
  }