@dinghy-chat/widget 0.18.0 → 0.20.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 +5 -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
|
@@ -79,6 +79,8 @@ export interface DinghyState {
|
|
|
79
79
|
ready: boolean;
|
|
80
80
|
open: boolean;
|
|
81
81
|
unread: number;
|
|
82
|
+
/** The visitor has an open conversation. Known once the chat has asked the server, false before. */
|
|
83
|
+
conversation: boolean;
|
|
82
84
|
}
|
|
83
85
|
/** Each event and what its callback receives. */
|
|
84
86
|
export interface DinghyEvents {
|
|
@@ -86,6 +88,8 @@ export interface DinghyEvents {
|
|
|
86
88
|
open: undefined;
|
|
87
89
|
close: undefined;
|
|
88
90
|
unread: number;
|
|
91
|
+
/** Whether the visitor has an open conversation, once at once and on each change. */
|
|
92
|
+
conversation: boolean;
|
|
89
93
|
/** The visitor's message reached the server. `body` is null for an image. */
|
|
90
94
|
"message:sent": {
|
|
91
95
|
body: string | null;
|
|
@@ -133,7 +137,7 @@ export type Listeners = {
|
|
|
133
137
|
* bundle: a tab keeps the loader it started with for days, and the chat bundle replaces a loader
|
|
134
138
|
* with another number instead of reading a context it does not know.
|
|
135
139
|
*/
|
|
136
|
-
export declare const CONTEXT_VERSION =
|
|
140
|
+
export declare const CONTEXT_VERSION = 2;
|
|
137
141
|
/** What the loader hands to the chat bundle. */
|
|
138
142
|
export interface WidgetContext {
|
|
139
143
|
/** CONTEXT_VERSION, as the loader knew it. Loaders before it set none. */
|