@dinghy-chat/widget 0.19.0 → 0.21.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.
- package/dist/index.js +1 -1
- package/dist/shared.d.ts +13 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ function forward(method, ...args) {
|
|
|
14
14
|
if (api === void 0) enqueue([method, ...args]);
|
|
15
15
|
else api[method](...args);
|
|
16
16
|
}
|
|
17
|
-
var NOT_READY = { ready: false, open: false, unread: 0 };
|
|
17
|
+
var NOT_READY = { ready: false, open: false, unread: 0, conversation: false };
|
|
18
18
|
var Dinghy = {
|
|
19
19
|
open: (options) => forward("open", ...options === void 0 ? [] : [options]),
|
|
20
20
|
close: () => forward("close"),
|
package/dist/shared.d.ts
CHANGED
|
@@ -35,6 +35,10 @@ export interface WidgetSettings {
|
|
|
35
35
|
emailAsk: "off" | "after_first" | "before_first";
|
|
36
36
|
/** The "Powered by Dinghy" line. */
|
|
37
37
|
branding: boolean;
|
|
38
|
+
/** A chime when a reply arrives and the visitor is not looking at the chat. */
|
|
39
|
+
sound: boolean;
|
|
40
|
+
/** The visitor gets the conversation by email when it closes. The widget does not use it. */
|
|
41
|
+
transcript: boolean;
|
|
38
42
|
}
|
|
39
43
|
/** A member the widget's header shows: a first name and a picture, never an email. */
|
|
40
44
|
export interface TeamFace {
|
|
@@ -46,6 +50,8 @@ export interface TeamFace {
|
|
|
46
50
|
}
|
|
47
51
|
/** The saved settings, as the widget's appearance route answers them. */
|
|
48
52
|
export interface SavedAppearance extends WidgetSettings {
|
|
53
|
+
/** The chat sends the visitor's unsent words, so operators see them as they type. */
|
|
54
|
+
typingPreview: boolean;
|
|
49
55
|
logoUrl: string | null;
|
|
50
56
|
/** Up to 3 members, the ones who sent the latest replies. */
|
|
51
57
|
team: TeamFace[];
|
|
@@ -79,6 +85,8 @@ export interface DinghyState {
|
|
|
79
85
|
ready: boolean;
|
|
80
86
|
open: boolean;
|
|
81
87
|
unread: number;
|
|
88
|
+
/** The visitor has an open conversation. Known once the chat has asked the server, false before. */
|
|
89
|
+
conversation: boolean;
|
|
82
90
|
}
|
|
83
91
|
/** Each event and what its callback receives. */
|
|
84
92
|
export interface DinghyEvents {
|
|
@@ -86,6 +94,8 @@ export interface DinghyEvents {
|
|
|
86
94
|
open: undefined;
|
|
87
95
|
close: undefined;
|
|
88
96
|
unread: number;
|
|
97
|
+
/** Whether the visitor has an open conversation, once at once and on each change. */
|
|
98
|
+
conversation: boolean;
|
|
89
99
|
/** The visitor's message reached the server. `body` is null for an image. */
|
|
90
100
|
"message:sent": {
|
|
91
101
|
body: string | null;
|
|
@@ -133,7 +143,7 @@ export type Listeners = {
|
|
|
133
143
|
* bundle: a tab keeps the loader it started with for days, and the chat bundle replaces a loader
|
|
134
144
|
* with another number instead of reading a context it does not know.
|
|
135
145
|
*/
|
|
136
|
-
export declare const CONTEXT_VERSION =
|
|
146
|
+
export declare const CONTEXT_VERSION = 2;
|
|
137
147
|
/** What the loader hands to the chat bundle. */
|
|
138
148
|
export interface WidgetContext {
|
|
139
149
|
/** CONTEXT_VERSION, as the loader knew it. Loaders before it set none. */
|
|
@@ -172,4 +182,6 @@ export declare function rememberOpen(publicKey: string, open: boolean): void;
|
|
|
172
182
|
* chatted.
|
|
173
183
|
*/
|
|
174
184
|
export declare function forgetVisitor(publicKey: string): void;
|
|
185
|
+
/** The longest message, in characters: the composers' limit, which the server checks too. */
|
|
186
|
+
export declare const MESSAGE_MAX = 10000;
|
|
175
187
|
export {};
|