@xapp/stentor-chat-widget 1.100.0 → 1.101.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.
Files changed (2) hide show
  1. package/lib/WidgetEnv.d.ts +42 -0
  2. package/package.json +1 -1
@@ -258,6 +258,10 @@ export interface WidgetEnv extends WidgetEnvDeprecated {
258
258
  * Optional, custom header configuration including messages for the widget.
259
259
  */
260
260
  readonly header?: WidgetHeaderConfig;
261
+ /**
262
+ * Pop the embedded chat out into a floating window when it is scrolled off-screen.
263
+ */
264
+ readonly popOut?: WidgetPopOutConfig;
261
265
  /**
262
266
  * Optional, configure aspects of the footer.
263
267
  */
@@ -342,6 +346,44 @@ export interface WidgetUrlPolicy {
342
346
  readonly pattern: string;
343
347
  readonly behavior: WidgetUrlBehavior;
344
348
  }
349
+ /**
350
+ * Pop the chat out into a floating window while its place on the page is scrolled out of view,
351
+ * then put it back when the visitor scrolls to it again.
352
+ *
353
+ * Only for an embedded (`docked`) widget, and only once there is a conversation worth following
354
+ * the visitor: an untouched chat stays on the page rather than chasing them down the article.
355
+ */
356
+ export interface WidgetPopOutConfig {
357
+ readonly enabled?: boolean;
358
+ /**
359
+ * When the chat starts following the visitor.
360
+ *
361
+ * - `"seen"` (default): as soon as they scroll past it, whether or not they have chatted.
362
+ * - `"message"`: only after they have sent a message, so a chat nobody has spoken to stays
363
+ * on the page. The assistant's greeting does not count - it arrives before anyone types.
364
+ *
365
+ * Either way the chat has to have been on screen once first, so a chat below the fold never
366
+ * floats in front of someone who has not reached it.
367
+ */
368
+ readonly after?: "seen" | "message";
369
+ /**
370
+ * Narrowest viewport, in pixels, that opens the floating window. Below this the chat offers
371
+ * its entry point instead of covering most of a phone screen - see `mobile`.
372
+ *
373
+ * @default 640
374
+ */
375
+ readonly minWidth?: number;
376
+ /**
377
+ * What a visitor below `minWidth` gets once they scroll past the chat. Tapping it opens the
378
+ * conversation where they left it; closing that returns to this rather than to nothing.
379
+ *
380
+ * - `"auto"` (default): the action bar if the app has one, otherwise the chat button.
381
+ * - `"actionBar"`: the action bar, falling back to the chat button if none is configured.
382
+ * - `"button"`: the chat button, even where an action bar is configured.
383
+ * - `"none"`: nothing. The conversation waits where it sits on the page.
384
+ */
385
+ readonly mobile?: "auto" | "actionBar" | "button" | "none";
386
+ }
345
387
  export interface WidgetHeaderConfig {
346
388
  /**
347
389
  * Hide the header when the widget is embedded in a page (`docked` or `static` mode),
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.100.0",
7
+ "version": "1.101.0",
8
8
  "description": "Chat Widget channel for stentor",
9
9
  "types": "lib/index",
10
10
  "main": "lib/index",