@dinghy-chat/widget 0.21.0 → 0.23.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/dist/shared.d.ts +21 -1
  2. package/package.json +1 -1
package/dist/shared.d.ts CHANGED
@@ -39,6 +39,14 @@ export interface WidgetSettings {
39
39
  sound: boolean;
40
40
  /** The visitor gets the conversation by email when it closes. The widget does not use it. */
41
41
  transcript: boolean;
42
+ /** Whose faces the header shows. `online` falls back to the latest repliers when nobody is. */
43
+ headerFaces: "online" | "repliers" | "chosen" | "none";
44
+ /** How many faces, 1 to HEADER_FACES_MAX. */
45
+ headerFaceCount: number;
46
+ /** A green dot on the face of each member who is online now. */
47
+ headerDot: boolean;
48
+ /** Under the title while someone is online: "Online", or the usual reply time. */
49
+ headerStatus: "presence" | "reply_time";
42
50
  }
43
51
  /** A member the widget's header shows: a first name and a picture, never an email. */
44
52
  export interface TeamFace {
@@ -53,13 +61,20 @@ export interface SavedAppearance extends WidgetSettings {
53
61
  /** The chat sends the visitor's unsent words, so operators see them as they type. */
54
62
  typingPreview: boolean;
55
63
  logoUrl: string | null;
56
- /** Up to 3 members, the ones who sent the latest replies. */
64
+ /** Up to HEADER_FACES_MAX members, the ones who sent the latest replies, newest first. */
57
65
  team: TeamFace[];
66
+ /**
67
+ * The header's candidates, in order: every member for `online`, which the widget cuts to the
68
+ * members online now, the latest repliers for `repliers`, the chosen members for `chosen`.
69
+ */
70
+ faces: TeamFace[];
58
71
  }
59
72
  /** The longest title an owner can save. */
60
73
  export declare const TITLE_MAX = 40;
61
74
  /** The longest greeting or away text. */
62
75
  export declare const TEXT_MAX = 200;
76
+ /** The most faces the header shows. */
77
+ export declare const HEADER_FACES_MAX = 5;
63
78
  /** The roundest corners an owner can save. */
64
79
  export declare const RADIUS_MAX_PX = 24;
65
80
  /** The widget's own colors, which a null color in the settings keeps. */
@@ -69,6 +84,11 @@ export declare const DEFAULT_COLORS: {
69
84
  };
70
85
  /** What a new workspace saves, and what the widget shows when the server cannot answer. */
71
86
  export declare const WIDGET_DEFAULTS: SavedAppearance;
87
+ /**
88
+ * The saved settings over the defaults. A tab that loaded before an upgrade, or the five-minute
89
+ * cache, can hand over an answer without the fields that came later.
90
+ */
91
+ export declare const withDefaults: (answer: Partial<SavedAppearance> | null | undefined) => SavedAppearance;
72
92
  /**
73
93
  * The first word of a name, which is all a visitor learns of an operator. It stops at an @ too, so
74
94
  * a name typed as an email never shows one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dinghy-chat/widget",
3
- "version": "0.21.0",
3
+ "version": "0.23.0",
4
4
  "description": "Add the Dinghy chat to your site from code, with a typed API.",
5
5
  "type": "module",
6
6
  "license": "MIT",