@botpress/webchat 4.5.2 → 5.5.1
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/.storybook/preview.tsx +7 -0
- package/.turbo/turbo-build.log +6 -8
- package/check-bundle-size.js +6 -2
- package/dist/index.d.ts +615 -832
- package/dist/index.js +66064 -17680
- package/dist/index.umd.cjs +1077 -191
- package/package.json +30 -25
- package/vitest.config.ts +1 -1
- package/dist/style.css +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,43 +3,57 @@ import { ClassAttributes } from '../../../node_modules/@types/react';
|
|
|
3
3
|
import { Client } from '@botpress/webchat-client';
|
|
4
4
|
import { ComponentProps } from '../../../node_modules/@types/react';
|
|
5
5
|
import { ComponentProps as ComponentProps_2 } from '../../node_modules/@types/react';
|
|
6
|
-
import { ComponentPropsWithRef } from '../../node_modules/@types/react';
|
|
7
6
|
import { LatestWebchatConfig as Configuration } from '@bpinternal/shared';
|
|
8
7
|
import { Context } from '../../node_modules/@types/react';
|
|
8
|
+
import { ConversationStarter } from '@bpinternal/shared';
|
|
9
|
+
import { ConversationStarterDisplayStyle } from '@bpinternal/shared';
|
|
9
10
|
import { createEventEmitter } from '@bpinternal/shared';
|
|
10
11
|
import { CSSProperties } from '../../node_modules/@types/react';
|
|
11
12
|
import * as Dialog from '@radix-ui/react-dialog';
|
|
12
13
|
import { Dispatch } from '../../node_modules/@types/react';
|
|
13
14
|
import { EventEmitter } from '@bpinternal/shared';
|
|
14
|
-
import {
|
|
15
|
-
import { ForwardRefExoticComponent } from '
|
|
16
|
-
import { ForwardRefExoticComponent as
|
|
17
|
-
import { ForwardRefExoticComponent as ForwardRefExoticComponent_3 } from 'react';
|
|
15
|
+
import { ForwardRefExoticComponent } from '../../../node_modules/@types/react';
|
|
16
|
+
import { ForwardRefExoticComponent as ForwardRefExoticComponent_2 } from 'react';
|
|
17
|
+
import { ForwardRefExoticComponent as ForwardRefExoticComponent_3 } from '../../../../node_modules/@types/react';
|
|
18
18
|
import { HTMLAttributes } from '../../../node_modules/@types/react';
|
|
19
19
|
import { IntegrationError } from '@botpress/webchat-client';
|
|
20
|
-
import { JSX } from '
|
|
21
|
-
import { JSX as JSX_2 } from 'react
|
|
20
|
+
import { JSX } from 'react/jsx-runtime';
|
|
21
|
+
import { JSX as JSX_2 } from '../../node_modules/@types/react';
|
|
22
22
|
import { LatestWebchatTheme } from '@bpinternal/shared';
|
|
23
23
|
import { ListConversationsResponse } from '@botpress/webchat-client';
|
|
24
|
+
import { LucideIcon } from 'lucide-react';
|
|
24
25
|
import { MemoExoticComponent } from '../../../node_modules/@types/react';
|
|
25
26
|
import { Message as Message_2 } from '@botpress/webchat-client';
|
|
27
|
+
import { MessageStreamAbort } from '@botpress/webchat-client';
|
|
28
|
+
import { MessageStreamComplete } from '@botpress/webchat-client';
|
|
29
|
+
import { MessageStreamDelta } from '@botpress/webchat-client';
|
|
30
|
+
import { MessageStreamSnapshot } from '@botpress/webchat-client';
|
|
26
31
|
import { NamedExoticComponent } from '../../../node_modules/@types/react';
|
|
27
32
|
import { PersistOptions } from 'zustand/middleware';
|
|
28
|
-
import {
|
|
29
|
-
import { ReactNode } from '../../../node_modules/@types/react';
|
|
30
|
-
import { ReactNode as ReactNode_2 } from '../../node_modules/@types/react';
|
|
33
|
+
import { ReactNode } from '../../node_modules/@types/react';
|
|
34
|
+
import { ReactNode as ReactNode_2 } from '../../../node_modules/@types/react';
|
|
31
35
|
import { Ref } from '../../../node_modules/@types/react';
|
|
32
|
-
import { RefAttributes } from '
|
|
33
|
-
import { RefAttributes as RefAttributes_2 } from '
|
|
34
|
-
import { RefAttributes as RefAttributes_3 } from 'react';
|
|
36
|
+
import { RefAttributes } from '../../../node_modules/@types/react';
|
|
37
|
+
import { RefAttributes as RefAttributes_2 } from 'react';
|
|
38
|
+
import { RefAttributes as RefAttributes_3 } from '../../../../node_modules/@types/react';
|
|
35
39
|
import { RefObject } from '../../node_modules/@types/react';
|
|
36
|
-
import { RotateCcw } from 'lucide-react';
|
|
37
40
|
import { SetStateAction } from '../../node_modules/@types/react';
|
|
41
|
+
import { StateStorage } from 'zustand/middleware';
|
|
38
42
|
import { StoreApi } from 'zustand';
|
|
39
43
|
import { UseBoundStore } from 'zustand';
|
|
40
44
|
import { User } from '@botpress/webchat-client';
|
|
41
45
|
import { UserCredentials } from '@botpress/webchat-client';
|
|
42
46
|
|
|
47
|
+
declare type Action = {
|
|
48
|
+
label: string;
|
|
49
|
+
value: string;
|
|
50
|
+
variant: 'action' | 'link';
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export declare const ActionButton: ({ text, buttonValue, variant, groupId, reusable, sendMessage, isReadOnly }: Props_7) => JSX.Element;
|
|
54
|
+
|
|
55
|
+
export declare const ActionButtons: ({ actions, groupId, reusable, sendMessage, isReadOnly }: Props_8) => JSX.Element | null;
|
|
56
|
+
|
|
43
57
|
declare type AnyEvent = ValueOf<{
|
|
44
58
|
[K in keyof WebchatEvents]: {
|
|
45
59
|
type: K;
|
|
@@ -49,63 +63,67 @@ declare type AnyEvent = ValueOf<{
|
|
|
49
63
|
|
|
50
64
|
export declare const ar: WebchatTranslations;
|
|
51
65
|
|
|
66
|
+
declare const Audio_2: ({ url, isReadOnly }: Props_12) => JSX.Element;
|
|
67
|
+
export { Audio_2 as Audio }
|
|
68
|
+
|
|
52
69
|
export declare type AudioBlock = {
|
|
53
70
|
type: 'audio';
|
|
54
71
|
url: string;
|
|
55
72
|
};
|
|
56
73
|
|
|
57
|
-
export declare const Avatar:
|
|
74
|
+
export declare const Avatar: ({ userId, src, containerClassName, imageClassName, fallbackClassName, children, }: AvatarProps) => JSX.Element;
|
|
58
75
|
|
|
59
76
|
declare type AvatarProps = {
|
|
60
77
|
userId?: string;
|
|
61
78
|
src?: string;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
containerClassName?: string;
|
|
80
|
+
imageClassName?: string;
|
|
81
|
+
fallbackClassName?: string;
|
|
82
|
+
children?: ReactNode;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export declare const Bloc: ({ items, ctx }: Props_19) => JSX.Element;
|
|
86
|
+
|
|
87
|
+
export declare type BlocBlock = {
|
|
88
|
+
type: 'bloc';
|
|
89
|
+
items: LeafBlock[];
|
|
90
|
+
};
|
|
72
91
|
|
|
73
92
|
export declare type BlocIntegrationMessageItems = Extract<IntegrationMessage['payload'], {
|
|
74
93
|
type: 'bloc';
|
|
75
94
|
}>['items'];
|
|
76
95
|
|
|
77
|
-
|
|
96
|
+
/** Context passed through the block rendering tree */
|
|
97
|
+
export declare type BlockContext = {
|
|
98
|
+
direction: 'incoming' | 'outgoing' | 'system';
|
|
99
|
+
messageId: string;
|
|
100
|
+
isStreaming?: boolean;
|
|
101
|
+
isReadOnly?: boolean;
|
|
102
|
+
sendMessage?: ScopedClient['sendMessage'];
|
|
103
|
+
/** All citation entries on the message (`metadata.citations`); renderers pick
|
|
104
|
+
* the entries whose `path` matches their own field via `citationPath`. */
|
|
105
|
+
citations?: CitationEntry[];
|
|
106
|
+
/** Pre-built Sources footer for cited messages. Renderers that carry both
|
|
107
|
+
* prompt text AND interactive controls (choice, dropdown) place this between
|
|
108
|
+
* the text and the controls so Sources sits under the answer, above the
|
|
109
|
+
* pills; other blocks let `Message` append it after the content. */
|
|
110
|
+
footer?: ReactNode;
|
|
111
|
+
};
|
|
78
112
|
|
|
79
|
-
export declare type BlockMessage
|
|
113
|
+
export declare type BlockMessage = {
|
|
80
114
|
id: string;
|
|
81
115
|
timestamp: Date;
|
|
82
|
-
block:
|
|
116
|
+
block: MessageBlock;
|
|
83
117
|
conversationId?: string;
|
|
84
118
|
authorId?: string;
|
|
85
119
|
disableInput?: boolean;
|
|
86
120
|
status?: 'pending' | 'processing' | 'processed' | 'failed' | 'skipped';
|
|
121
|
+
feedback?: 'positive' | 'negative';
|
|
87
122
|
metadata?: {
|
|
88
123
|
clientMessageId?: string;
|
|
89
124
|
delivered?: boolean;
|
|
90
125
|
[k: string]: any;
|
|
91
126
|
};
|
|
92
|
-
feedback?: Feedback['value'];
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
declare type BlockMessagePayload = {
|
|
96
|
-
payload: GenericBlock;
|
|
97
|
-
disableInput?: boolean;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export declare type BlockObjects = {
|
|
101
|
-
[T in GenericBlock['type']]: Extract<GenericBlock, {
|
|
102
|
-
type: T;
|
|
103
|
-
}> & CommonBlockProps;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
declare type BlockProps<T extends GenericBlock['type']> = {
|
|
107
|
-
block: BlockObjects[T];
|
|
108
|
-
renderers?: Partial<Renderers>;
|
|
109
127
|
};
|
|
110
128
|
|
|
111
129
|
export declare const BOT_IS_BLOCKED = "This bot has temporarily paused.\nPlease check back later.";
|
|
@@ -114,23 +132,10 @@ declare type BoundChatSoundStore = ReturnType<typeof createChatSoundStore>;
|
|
|
114
132
|
|
|
115
133
|
declare type BoundWebchatClientStore = ReturnType<typeof createWebchatClientStore>;
|
|
116
134
|
|
|
117
|
-
export declare
|
|
118
|
-
type: 'bubble';
|
|
119
|
-
block: GenericBlock;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export declare type BubbleOf<T extends GenericBlock> = Omit<BubbleBlock, 'block'> & {
|
|
123
|
-
block: T;
|
|
124
|
-
};
|
|
135
|
+
export declare const Bubble: ({ ctx, children }: Props_9) => JSX.Element;
|
|
125
136
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
variant: 'action' | 'link';
|
|
129
|
-
reusable?: boolean;
|
|
130
|
-
groupId?: string;
|
|
131
|
-
text: string;
|
|
132
|
-
buttonValue: string;
|
|
133
|
-
};
|
|
137
|
+
/** @deprecated Use ActionButton */
|
|
138
|
+
export declare const Button: ({ text, buttonValue, variant, groupId, reusable, sendMessage, isReadOnly }: Props_7) => JSX.Element;
|
|
134
139
|
|
|
135
140
|
declare type ByType<M extends {
|
|
136
141
|
type: string;
|
|
@@ -140,12 +145,64 @@ declare type ByType<M extends {
|
|
|
140
145
|
}>;
|
|
141
146
|
};
|
|
142
147
|
|
|
148
|
+
export declare const Card: ({ imageUrl, title, subtitle, actions, ctx, citationBasePath }: Props_17) => JSX.Element;
|
|
149
|
+
|
|
150
|
+
export declare type CardAction = {
|
|
151
|
+
label: string;
|
|
152
|
+
value: string;
|
|
153
|
+
variant: 'action' | 'link';
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export declare type CardBlock = {
|
|
157
|
+
type: 'card';
|
|
158
|
+
imageUrl?: string;
|
|
159
|
+
title?: string;
|
|
160
|
+
subtitle?: string;
|
|
161
|
+
actions: CardAction[];
|
|
162
|
+
/** Payload dot-path of this card ("root" for a standalone card,
|
|
163
|
+
* "root.items.N" inside a carousel) — citation paths derive from it. */
|
|
164
|
+
citationBasePath?: string;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export declare const Carousel: ({ cards, ctx }: Props_14) => JSX.Element;
|
|
168
|
+
|
|
143
169
|
export declare type CarouselBlock = {
|
|
144
170
|
type: 'carousel';
|
|
145
|
-
|
|
171
|
+
cards: CardBlock[];
|
|
146
172
|
};
|
|
147
173
|
|
|
148
|
-
export declare const Chat: ({ connected, configuration, isTyping, messages, user, isLoading,
|
|
174
|
+
export declare const Chat: ({ connected, configuration, isTyping, messages, user, isLoading, isReadOnly, disableComposer, error, participants, closeWindow, sendMessage, addMessageFeedback, uploadFile, listConversations, restartConversation, clientId, storageKey, soundOn, toggleSound, disableSendButton, conversationId, expanded, onToggleExpand, locale, onComposerTextChange, ...props }: ChatProps) => JSX.Element;
|
|
175
|
+
|
|
176
|
+
export declare type ChatProps = {
|
|
177
|
+
className?: string;
|
|
178
|
+
configuration: Configuration;
|
|
179
|
+
messages: BlockMessage[];
|
|
180
|
+
participants: User[];
|
|
181
|
+
connected?: boolean;
|
|
182
|
+
disableComposer?: boolean;
|
|
183
|
+
isReadOnly?: boolean;
|
|
184
|
+
isLoading?: boolean;
|
|
185
|
+
isTyping?: boolean;
|
|
186
|
+
clientId?: string;
|
|
187
|
+
closeWindow?: () => void;
|
|
188
|
+
restartConversation?: (conversationid?: string) => void;
|
|
189
|
+
user?: UserCredentials;
|
|
190
|
+
sendMessage?: ScopedClient['sendMessage'];
|
|
191
|
+
addMessageFeedback?: (messageId: string, feedback: Feedback) => Promise<void>;
|
|
192
|
+
uploadFile?: ScopedClient['uploadFile'];
|
|
193
|
+
listConversations?: ScopedClient['listConversations'];
|
|
194
|
+
error?: WebchatError;
|
|
195
|
+
soundOn?: boolean;
|
|
196
|
+
toggleSound?: () => void;
|
|
197
|
+
storageKey?: string;
|
|
198
|
+
disableSendButton?: boolean;
|
|
199
|
+
conversationId?: string;
|
|
200
|
+
expanded?: boolean;
|
|
201
|
+
onToggleExpand?: () => void;
|
|
202
|
+
locale?: Partial<WebchatTranslations>;
|
|
203
|
+
/** Fired on every composer keystroke; used to report the end user's typing upstream. */
|
|
204
|
+
onComposerTextChange?: (text: string) => void;
|
|
205
|
+
};
|
|
149
206
|
|
|
150
207
|
declare type ChatSoundStore = {
|
|
151
208
|
soundOn: boolean;
|
|
@@ -153,32 +210,47 @@ declare type ChatSoundStore = {
|
|
|
153
210
|
toggleSound: () => void;
|
|
154
211
|
};
|
|
155
212
|
|
|
156
|
-
export declare
|
|
213
|
+
export declare const Choice: ({ text, options, groupId, ctx }: Props_18) => JSX.Element;
|
|
157
214
|
|
|
158
|
-
declare type
|
|
215
|
+
export declare type ChoiceBlock = {
|
|
216
|
+
type: 'choice';
|
|
217
|
+
text: string;
|
|
218
|
+
options: {
|
|
219
|
+
label: string;
|
|
220
|
+
value: string;
|
|
221
|
+
}[];
|
|
222
|
+
groupId: string;
|
|
223
|
+
disableFreeText?: boolean;
|
|
224
|
+
};
|
|
159
225
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
226
|
+
declare type Citation = {
|
|
227
|
+
id: number;
|
|
228
|
+
source: CitationSource;
|
|
229
|
+
tag?: string;
|
|
230
|
+
offset?: number;
|
|
165
231
|
};
|
|
166
232
|
|
|
167
|
-
|
|
168
|
-
|
|
233
|
+
/** One entry of `metadata.citations`. */
|
|
234
|
+
declare type CitationEntry = {
|
|
235
|
+
path: string;
|
|
236
|
+
citation: Citation;
|
|
169
237
|
};
|
|
170
238
|
|
|
171
|
-
|
|
172
|
-
|
|
239
|
+
declare type CitationSource = {
|
|
240
|
+
url?: string;
|
|
241
|
+
title?: string;
|
|
242
|
+
favicon?: string;
|
|
243
|
+
file?: string;
|
|
244
|
+
knowledgeBase?: string;
|
|
245
|
+
[k: string]: unknown;
|
|
173
246
|
};
|
|
174
247
|
|
|
175
|
-
export declare type
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
addMessageFeedback?: (messageId: string, feedback: Feedback) => void;
|
|
248
|
+
export declare type ClientStates = 'connecting' | 'connected' | 'error' | 'disconnected';
|
|
249
|
+
|
|
250
|
+
declare type ClientStates_2 = 'connecting' | 'connected' | 'error' | 'disconnected';
|
|
251
|
+
|
|
252
|
+
export declare const commonApiErrorMap: {
|
|
253
|
+
[key in 'MethodNotFound' | 'QuotaExceeded' | 'Forbidden']: WebchatError;
|
|
182
254
|
};
|
|
183
255
|
|
|
184
256
|
declare type CommonWebchatProps = {
|
|
@@ -196,19 +268,19 @@ export declare type ComposableIntegrationMessagePayload = Extract<IntegrationMes
|
|
|
196
268
|
|
|
197
269
|
declare type ComposableIntegrationMessageTypes = 'audio' | 'bloc' | 'file' | 'image' | 'location' | 'markdown' | 'text' | 'video';
|
|
198
270
|
|
|
199
|
-
export declare const Composer: NamedExoticComponent<Omit<
|
|
271
|
+
export declare const Composer: NamedExoticComponent<Omit<Props_2, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
200
272
|
|
|
201
273
|
export declare const CONFIG_ACCESS_DENIED = "Access denied to configuration file. Please check your credentials or your configuration URL and try again.";
|
|
202
274
|
|
|
203
275
|
export { Configuration }
|
|
204
276
|
|
|
205
277
|
export declare const Container: {
|
|
206
|
-
({ children, className, uploadFile, allowFileUpload, storageKey, conversationId, ...props }:
|
|
278
|
+
({ children, className, uploadFile, allowFileUpload, storageKey, conversationId, ...props }: Props_3): JSX.Element;
|
|
207
279
|
displayName: string;
|
|
208
280
|
};
|
|
209
281
|
|
|
210
282
|
export declare const ConversationHistory: {
|
|
211
|
-
({ className, onConversationClick, onNewConversation, onClose,
|
|
283
|
+
({ className, onConversationClick, onNewConversation, onClose, isLoading, conversations, botAvatar, botName, ...props }: ComponentProps<"div"> & ConversationHistoryProps): JSX.Element;
|
|
212
284
|
displayName: string;
|
|
213
285
|
};
|
|
214
286
|
|
|
@@ -216,7 +288,6 @@ declare type ConversationHistoryProps = {
|
|
|
216
288
|
onConversationClick?: (conversationId: string) => void;
|
|
217
289
|
onNewConversation?: () => void;
|
|
218
290
|
onClose?: () => void;
|
|
219
|
-
currentConversationId?: string;
|
|
220
291
|
isLoading?: boolean;
|
|
221
292
|
conversations: Conversations;
|
|
222
293
|
botAvatar?: string;
|
|
@@ -233,42 +304,97 @@ declare type ConversationWithLastMessage = ListConversationsResponse['conversati
|
|
|
233
304
|
};
|
|
234
305
|
};
|
|
235
306
|
|
|
236
|
-
declare const createChatSoundStore: (storeName: string) => UseBoundStore<Omit<Omit<StoreApi<ChatSoundStore>, "setState"> & {
|
|
237
|
-
setState<
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
307
|
+
declare const createChatSoundStore: (storeName: string) => UseBoundStore<Omit<Omit<StoreApi<ChatSoundStore>, "setState" | "devtools"> & {
|
|
308
|
+
setState(partial: ChatSoundStore | Partial<ChatSoundStore> | ((state: ChatSoundStore) => ChatSoundStore | Partial<ChatSoundStore>), replace?: false | undefined, action?: (string | {
|
|
309
|
+
[x: string]: unknown;
|
|
310
|
+
[x: number]: unknown;
|
|
311
|
+
[x: symbol]: unknown;
|
|
312
|
+
type: string;
|
|
313
|
+
}) | undefined): void;
|
|
314
|
+
setState(state: ChatSoundStore | ((state: ChatSoundStore) => ChatSoundStore), replace: true, action?: (string | {
|
|
315
|
+
[x: string]: unknown;
|
|
316
|
+
[x: number]: unknown;
|
|
317
|
+
[x: symbol]: unknown;
|
|
318
|
+
type: string;
|
|
319
|
+
}) | undefined): void;
|
|
320
|
+
devtools: {
|
|
321
|
+
cleanup: () => void;
|
|
322
|
+
};
|
|
323
|
+
}, "setState" | "persist"> & {
|
|
324
|
+
setState(partial: ChatSoundStore | Partial<ChatSoundStore> | ((state: ChatSoundStore) => ChatSoundStore | Partial<ChatSoundStore>), replace?: false | undefined, action?: (string | {
|
|
325
|
+
[x: string]: unknown;
|
|
326
|
+
[x: number]: unknown;
|
|
327
|
+
[x: symbol]: unknown;
|
|
328
|
+
type: string;
|
|
329
|
+
}) | undefined): unknown;
|
|
330
|
+
setState(state: ChatSoundStore | ((state: ChatSoundStore) => ChatSoundStore), replace: true, action?: (string | {
|
|
331
|
+
[x: string]: unknown;
|
|
332
|
+
[x: number]: unknown;
|
|
333
|
+
[x: symbol]: unknown;
|
|
334
|
+
type: string;
|
|
335
|
+
}) | undefined): unknown;
|
|
241
336
|
persist: {
|
|
242
|
-
setOptions: (options: Partial<PersistOptions<ChatSoundStore, ChatSoundStore>>) => void;
|
|
337
|
+
setOptions: (options: Partial<PersistOptions<ChatSoundStore, ChatSoundStore, unknown>>) => void;
|
|
243
338
|
clearStorage: () => void;
|
|
244
339
|
rehydrate: () => Promise<void> | void;
|
|
245
340
|
hasHydrated: () => boolean;
|
|
246
341
|
onHydrate: (fn: (state: ChatSoundStore) => void) => () => void;
|
|
247
342
|
onFinishHydration: (fn: (state: ChatSoundStore) => void) => () => void;
|
|
248
|
-
getOptions: () => Partial<PersistOptions<ChatSoundStore, ChatSoundStore>>;
|
|
343
|
+
getOptions: () => Partial<PersistOptions<ChatSoundStore, ChatSoundStore, unknown>>;
|
|
249
344
|
};
|
|
250
345
|
}>;
|
|
251
346
|
|
|
252
|
-
declare const
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
347
|
+
export declare const createCookieStorage: (cookieDomain?: string) => StateStorage;
|
|
348
|
+
|
|
349
|
+
declare const createWebchatClientStore: (storeName: string, storageLocation?: StorageLocation, cookieDomain?: string) => UseBoundStore<Omit<Omit<StoreApi<WebchatClientStore>, "setState" | "devtools"> & {
|
|
350
|
+
setState(partial: WebchatClientStore | Partial<WebchatClientStore> | ((state: WebchatClientStore) => WebchatClientStore | Partial<WebchatClientStore>), replace?: false | undefined, action?: (string | {
|
|
351
|
+
[x: string]: unknown;
|
|
352
|
+
[x: number]: unknown;
|
|
353
|
+
[x: symbol]: unknown;
|
|
354
|
+
type: string;
|
|
355
|
+
}) | undefined): void;
|
|
356
|
+
setState(state: WebchatClientStore | ((state: WebchatClientStore) => WebchatClientStore), replace: true, action?: (string | {
|
|
357
|
+
[x: string]: unknown;
|
|
358
|
+
[x: number]: unknown;
|
|
359
|
+
[x: symbol]: unknown;
|
|
360
|
+
type: string;
|
|
361
|
+
}) | undefined): void;
|
|
362
|
+
devtools: {
|
|
363
|
+
cleanup: () => void;
|
|
364
|
+
};
|
|
365
|
+
}, "setState" | "persist"> & {
|
|
366
|
+
setState(partial: WebchatClientStore | Partial<WebchatClientStore> | ((state: WebchatClientStore) => WebchatClientStore | Partial<WebchatClientStore>), replace?: false | undefined, action?: (string | {
|
|
367
|
+
[x: string]: unknown;
|
|
368
|
+
[x: number]: unknown;
|
|
369
|
+
[x: symbol]: unknown;
|
|
370
|
+
type: string;
|
|
371
|
+
}) | undefined): unknown;
|
|
372
|
+
setState(state: WebchatClientStore | ((state: WebchatClientStore) => WebchatClientStore), replace: true, action?: (string | {
|
|
373
|
+
[x: string]: unknown;
|
|
374
|
+
[x: number]: unknown;
|
|
375
|
+
[x: symbol]: unknown;
|
|
376
|
+
type: string;
|
|
377
|
+
}) | undefined): unknown;
|
|
257
378
|
persist: {
|
|
258
|
-
setOptions: (options: Partial<PersistOptions<WebchatClientStore, unknown>>) => void;
|
|
379
|
+
setOptions: (options: Partial<PersistOptions<WebchatClientStore, unknown, unknown>>) => void;
|
|
259
380
|
clearStorage: () => void;
|
|
260
381
|
rehydrate: () => Promise<void> | void;
|
|
261
382
|
hasHydrated: () => boolean;
|
|
262
383
|
onHydrate: (fn: (state: WebchatClientStore) => void) => () => void;
|
|
263
384
|
onFinishHydration: (fn: (state: WebchatClientStore) => void) => () => void;
|
|
264
|
-
getOptions: () => Partial<PersistOptions<WebchatClientStore, unknown>>;
|
|
385
|
+
getOptions: () => Partial<PersistOptions<WebchatClientStore, unknown, unknown>>;
|
|
265
386
|
};
|
|
266
387
|
}>;
|
|
267
388
|
|
|
268
389
|
export declare type CustomBlock = {
|
|
269
390
|
type: 'custom';
|
|
270
|
-
url: string;
|
|
271
391
|
name: string;
|
|
392
|
+
url: string;
|
|
393
|
+
data?: unknown;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
export declare type CustomRendererProps = CustomBlock & {
|
|
397
|
+
direction: 'incoming' | 'outgoing' | 'system';
|
|
272
398
|
};
|
|
273
399
|
|
|
274
400
|
export declare const de: WebchatTranslations;
|
|
@@ -279,6 +405,7 @@ export declare const defaultTranslations: {
|
|
|
279
405
|
readonly 'composer.voiceButton.ariaLabel': "Voice Input Button";
|
|
280
406
|
readonly 'composer.fileButton.ariaLabel': "Upload File Button";
|
|
281
407
|
readonly 'composer.messageInput.ariaLabel': "Message Input";
|
|
408
|
+
readonly 'composer.emojiButton.ariaLabel': "Emoji Picker Button";
|
|
282
409
|
readonly 'fileAttachment.uploadError': "Upload Error";
|
|
283
410
|
readonly 'fileAttachment.fallbackExtension': "File";
|
|
284
411
|
readonly 'fileAttachment.removeButton.ariaLabel': "Remove File Button";
|
|
@@ -286,6 +413,11 @@ export declare const defaultTranslations: {
|
|
|
286
413
|
readonly 'header.expandButton.ariaLabel': "Expand Header Button";
|
|
287
414
|
readonly 'header.sound.enable': "Enable chat sounds";
|
|
288
415
|
readonly 'header.sound.disable': "Disable chat sounds";
|
|
416
|
+
readonly 'header.menu.ariaLabel': "More options";
|
|
417
|
+
readonly 'header.expand': "Expand window";
|
|
418
|
+
readonly 'header.collapse': "Collapse window";
|
|
419
|
+
readonly 'header.mute': "Mute";
|
|
420
|
+
readonly 'header.unmute': "Unmute";
|
|
289
421
|
readonly 'conversationHistory.title': "Conversations";
|
|
290
422
|
readonly 'conversationHistory.empty': "No conversation started yet";
|
|
291
423
|
readonly 'conversationHistory.newConversation': "New conversation";
|
|
@@ -311,7 +443,32 @@ export declare const defaultTranslations: {
|
|
|
311
443
|
readonly 'message.status.delivered': "Delivered";
|
|
312
444
|
readonly 'date.today': "Today";
|
|
313
445
|
readonly 'date.yesterday': "Yesterday";
|
|
314
|
-
|
|
446
|
+
readonly 'hitl.passedToTeam': "Passed to the support team";
|
|
447
|
+
readonly 'hitl.findingAgent': "Finding you an agent…";
|
|
448
|
+
readonly 'hitl.supportAgent': "Support agent";
|
|
449
|
+
readonly 'hitl.defaultAgentName': "An agent";
|
|
450
|
+
readonly 'hitl.agentJoined': "{name} joined the conversation";
|
|
451
|
+
readonly 'hitl.agentTransferred': "Transferred to {name}";
|
|
452
|
+
readonly 'hitl.agentLabel': "{name} · Support";
|
|
453
|
+
readonly 'hitl.ticketClosedBy': "{name} closed the ticket";
|
|
454
|
+
readonly 'hitl.ticketClosed': "Ticket closed";
|
|
455
|
+
readonly 'hitl.waiting.title': "Waiting for an agent…";
|
|
456
|
+
readonly 'hitl.waiting.sub': "Usually a few minutes. Replies arrive here.";
|
|
457
|
+
readonly 'hitl.waiting.longTitle': "Still waiting — this is taking longer than usual";
|
|
458
|
+
readonly 'hitl.waiting.longSub': "You can close this window — the reply will land right here.";
|
|
459
|
+
readonly 'csat.question': "How did {name} do?";
|
|
460
|
+
readonly 'csat.questionGeneric': "How did we do?";
|
|
461
|
+
readonly 'csat.sub': "One tap — optional. You can keep typing below.";
|
|
462
|
+
readonly 'csat.rate': "Rate this chat";
|
|
463
|
+
readonly 'csat.commentPlaceholder': "Add a comment — optional";
|
|
464
|
+
readonly 'csat.sendComment': "Send comment";
|
|
465
|
+
readonly 'csat.thanks': "Thanks — sent to the team";
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
export declare function deriveHitlStatus(messages: {
|
|
469
|
+
metadata?: Record<string, any>;
|
|
470
|
+
timestamp: Date;
|
|
471
|
+
}[]): HitlStatus;
|
|
315
472
|
|
|
316
473
|
export declare function detectLocale(language?: string): WebchatTranslations;
|
|
317
474
|
|
|
@@ -320,14 +477,16 @@ export declare type Dimensions = {
|
|
|
320
477
|
height: number;
|
|
321
478
|
};
|
|
322
479
|
|
|
480
|
+
export declare const Dropdown: ({ text, options, reusable, ctx }: Props_15) => JSX.Element;
|
|
481
|
+
|
|
323
482
|
export declare type DropdownBlock = {
|
|
324
|
-
label?: string;
|
|
325
483
|
type: 'dropdown';
|
|
326
|
-
|
|
484
|
+
text?: string;
|
|
327
485
|
options: {
|
|
328
486
|
label: string;
|
|
329
487
|
value: string;
|
|
330
488
|
}[];
|
|
489
|
+
reusable?: boolean;
|
|
331
490
|
};
|
|
332
491
|
|
|
333
492
|
export declare function enrichMessage(messages: BlockMessage[], participants: User[], currentUserId: string, botName?: string, botAvatar?: string): RichBlockMessage[];
|
|
@@ -338,7 +497,7 @@ declare type ErrorProps = {
|
|
|
338
497
|
closeWindow?: () => void;
|
|
339
498
|
};
|
|
340
499
|
|
|
341
|
-
export declare function ErrorState({ error, restartConversation, closeWindow }: ErrorProps):
|
|
500
|
+
export declare function ErrorState({ error, restartConversation, closeWindow }: ErrorProps): JSX.Element;
|
|
342
501
|
|
|
343
502
|
export declare const es: WebchatTranslations;
|
|
344
503
|
|
|
@@ -354,12 +513,15 @@ declare type Events_2 = {
|
|
|
354
513
|
[key: string]: string;
|
|
355
514
|
};
|
|
356
515
|
|
|
357
|
-
export declare const Fab:
|
|
516
|
+
export declare const Fab: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
|
|
358
517
|
imgUrl?: string;
|
|
359
|
-
}, "ref"> &
|
|
518
|
+
}, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
360
519
|
|
|
361
520
|
export declare type Feedback = AddMessageFeedbackBody;
|
|
362
521
|
|
|
522
|
+
declare const File_2: ({ title, url, isReadOnly }: Props_16) => JSX.Element;
|
|
523
|
+
export { File_2 as File }
|
|
524
|
+
|
|
363
525
|
export declare type FileBlock = {
|
|
364
526
|
type: 'file';
|
|
365
527
|
url: string;
|
|
@@ -376,34 +538,57 @@ export declare function generateThemeOverride(theme: LatestWebchatTheme): Record
|
|
|
376
538
|
|
|
377
539
|
export declare function generateThemeStylesheet(theme: LatestWebchatTheme): string;
|
|
378
540
|
|
|
379
|
-
export declare type GenericBlock = AudioBlock | BubbleBlock | ButtonBlock | CarouselBlock | ColumnBlock | DropdownBlock | FileBlock | ImageBlock | LocationBlock | RowBlock | TextBlock | VideoBlock | CustomBlock;
|
|
380
|
-
|
|
381
541
|
export declare const getUseChatSoundStore: (name?: string) => BoundChatSoundStore;
|
|
382
542
|
|
|
383
|
-
export declare const getUseWebchatClientStore: (name?: string, storageLocation?: StorageLocation) => BoundWebchatClientStore;
|
|
543
|
+
export declare const getUseWebchatClientStore: (name?: string, storageLocation?: StorageLocation, cookieDomain?: string) => BoundWebchatClientStore;
|
|
384
544
|
|
|
385
|
-
export declare const Header: ({
|
|
545
|
+
export declare const Header: ({ closeWindow, configuration, showConversationHistory, soundOn, toggleSound, clientId, expanded, onToggleExpand, hitlStatus, }: HeaderProps) => JSX.Element;
|
|
386
546
|
|
|
387
547
|
declare type HeaderProps = {
|
|
388
|
-
defaultOpen?: boolean;
|
|
389
|
-
open?: boolean;
|
|
390
|
-
disabled?: boolean;
|
|
391
548
|
showConversationHistory?: () => void;
|
|
392
|
-
onOpenChange?(open: boolean): void;
|
|
393
|
-
restartConversation?: () => void;
|
|
394
549
|
closeWindow?: () => void;
|
|
395
550
|
clientId?: string;
|
|
396
551
|
soundOn?: boolean;
|
|
397
552
|
toggleSound?: () => void;
|
|
398
|
-
configuration: Pick<Configuration, '
|
|
553
|
+
configuration: Pick<Configuration, 'botAvatar' | 'botName' | 'botDescription' | 'soundEnabled'>;
|
|
554
|
+
expanded?: boolean;
|
|
555
|
+
onToggleExpand?: () => void;
|
|
556
|
+
/** Live handoff state: 'waiting' pulses an amber "finding you an agent"
|
|
557
|
+
* status line; 'agent' swaps the header identity to the assigned agent
|
|
558
|
+
* while the ticket is active. */
|
|
559
|
+
hitlStatus?: HitlStatus;
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* The widget's live handoff state, derived from the lifecycle markers in the
|
|
564
|
+
* message stream (in order):
|
|
565
|
+
* ticket_opened → waiting · agent_assigned → agent · ticket_closed → bot.
|
|
566
|
+
* Drives the header (amber "finding an agent" pulse / agent identity) and the
|
|
567
|
+
* in-stream waiting block.
|
|
568
|
+
*/
|
|
569
|
+
export declare type HitlStatus = {
|
|
570
|
+
mode: 'bot';
|
|
571
|
+
} | {
|
|
572
|
+
mode: 'waiting';
|
|
573
|
+
since: Date;
|
|
574
|
+
message?: string;
|
|
575
|
+
hidden?: boolean;
|
|
576
|
+
} | {
|
|
577
|
+
mode: 'agent';
|
|
578
|
+
agentName?: string;
|
|
579
|
+
agentAvatarUrl?: string;
|
|
399
580
|
};
|
|
400
581
|
|
|
582
|
+
export declare const IconButton: ({ icon: Icon, label, onClick, className, style, size }: Props_4) => JSX.Element;
|
|
583
|
+
|
|
401
584
|
export declare type ImageBlock = {
|
|
402
585
|
type: 'image';
|
|
403
|
-
orientation?: 'portrait' | 'landscape' | 'square' | 'auto';
|
|
404
586
|
url: string;
|
|
587
|
+
orientation?: 'portrait' | 'landscape' | 'square' | 'auto';
|
|
405
588
|
};
|
|
406
589
|
|
|
590
|
+
export declare const ImageComponent: ForwardRefExoticComponent_3<Props_10 & RefAttributes_3<HTMLImageElement>>;
|
|
591
|
+
|
|
407
592
|
export declare type InputModalProps<T> = {
|
|
408
593
|
title?: string;
|
|
409
594
|
description?: string;
|
|
@@ -415,15 +600,13 @@ export declare type InputModalProps<T> = {
|
|
|
415
600
|
Content?: ({ setValue }: {
|
|
416
601
|
value: T | undefined;
|
|
417
602
|
setValue: (value: T) => void;
|
|
418
|
-
}) =>
|
|
603
|
+
}) => ReactNode;
|
|
419
604
|
};
|
|
420
605
|
|
|
421
606
|
export declare type IntegrationMessage = Message_2;
|
|
422
607
|
|
|
423
608
|
export declare type IntegrationMessagePayloadByType = ByType<IntegrationMessage['payload']>;
|
|
424
609
|
|
|
425
|
-
export declare const integrationMessagePayloadToBlockPayload: (message: IntegrationMessage["payload"]) => BlockMessagePayload;
|
|
426
|
-
|
|
427
610
|
export declare function integrationMessageToBlockMessage(message: IntegrationMessage): BlockMessage;
|
|
428
611
|
|
|
429
612
|
declare type IntegrationMessageTypes = IntegrationMessage['payload']['type'];
|
|
@@ -456,6 +639,12 @@ export declare const ja: WebchatTranslations;
|
|
|
456
639
|
|
|
457
640
|
export declare const ko: WebchatTranslations;
|
|
458
641
|
|
|
642
|
+
/** Leaf block types that can appear inside a bloc */
|
|
643
|
+
export declare type LeafBlock = TextBlock | ImageBlock | VideoBlock | AudioBlock | FileBlock | LocationBlock;
|
|
644
|
+
|
|
645
|
+
declare const Location_2: ({ latitude, longitude, title, isReadOnly }: Props_13) => JSX.Element;
|
|
646
|
+
export { Location_2 as Location }
|
|
647
|
+
|
|
459
648
|
export declare type LocationBlock = {
|
|
460
649
|
type: 'location';
|
|
461
650
|
latitude: number;
|
|
@@ -463,23 +652,21 @@ export declare type LocationBlock = {
|
|
|
463
652
|
title?: string;
|
|
464
653
|
};
|
|
465
654
|
|
|
655
|
+
export declare const MainCard: ({ title, subtitle, botAvatar, botName, onClick }: MainCardProps) => JSX.Element;
|
|
656
|
+
|
|
657
|
+
declare type MainCardProps = {
|
|
658
|
+
title: string;
|
|
659
|
+
subtitle?: string;
|
|
660
|
+
botAvatar?: string;
|
|
661
|
+
botName?: string;
|
|
662
|
+
onClick?: () => void;
|
|
663
|
+
};
|
|
664
|
+
|
|
466
665
|
export declare const mapToWebchatError: (thrown: unknown) => WebchatError;
|
|
467
666
|
|
|
468
|
-
export declare const Message:
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
sendMessage?: (payload: IntegrationMessage["payload"]) => void;
|
|
472
|
-
addMessageFeedback?: (messageId: string, feedback: Feedback) => void;
|
|
473
|
-
isReadOnly?: boolean;
|
|
474
|
-
isLastDeliveredMessage?: boolean;
|
|
475
|
-
showAvatar?: boolean;
|
|
476
|
-
} & BlockMessage<GenericBlock> & {
|
|
477
|
-
direction: "incoming" | "outgoing" | "system";
|
|
478
|
-
sender: {
|
|
479
|
-
name: string;
|
|
480
|
-
avatar?: string;
|
|
481
|
-
};
|
|
482
|
-
} & RefAttributes_2<HTMLDivElement>>;
|
|
667
|
+
export declare const Message: ({ direction, block, disableInput, children, sender, id, authorId, isReadOnly, isLastDeliveredMessage, isLastMessage, sendMessage, showAvatar, renderers, addMessageFeedback, feedback, timestamp, metadata, citationsEnabled, }: MessageProps) => JSX.Element;
|
|
668
|
+
|
|
669
|
+
export declare type MessageBlock = TextBlock | ImageBlock | VideoBlock | AudioBlock | FileBlock | LocationBlock | CardBlock | CarouselBlock | ChoiceBlock | DropdownBlock | BlocBlock | CustomBlock;
|
|
483
670
|
|
|
484
671
|
export declare const MessageContext: Context<MessageContextVaue | null>;
|
|
485
672
|
|
|
@@ -488,32 +675,78 @@ declare type MessageContextVaue = {
|
|
|
488
675
|
setIsLoading: Dispatch<SetStateAction<string[]>>;
|
|
489
676
|
};
|
|
490
677
|
|
|
491
|
-
export declare const MessageList: MemoExoticComponent<({ className, messages, isTyping,
|
|
678
|
+
export declare const MessageList: MemoExoticComponent<({ className, messages, isTyping, botAvatar, botName, botDescription, sendMessage, hitlWaiting, addMessageFeedback, citationsEnabled, showMarquee, showDateSystemMessage, showMessageStatus, showIncomingMessageAvatar, showOutgoingMessageAvatar, homePageEnabled, welcomeHeading, welcomeSubtitle, mainCardEnabled, mainCardTitle, mainCardSubtitle, onMainCardClick, conversationStartersEnabled, conversationStarters, conversationStartersDisplayStyle, renderers, ...props }: ComponentProps<"div"> & MessageListProps) => JSX.Element>;
|
|
492
679
|
|
|
493
680
|
declare type MessageListProps = {
|
|
494
681
|
messages?: RichBlockMessage[];
|
|
495
682
|
isTyping?: boolean;
|
|
496
|
-
headerMessage?: string;
|
|
497
|
-
renderers?: Partial<Renderers>;
|
|
498
683
|
botAvatar?: string;
|
|
499
|
-
botDescription?: string;
|
|
500
684
|
botName?: string;
|
|
501
|
-
|
|
502
|
-
|
|
685
|
+
botDescription?: string;
|
|
686
|
+
sendMessage?: ScopedClient['sendMessage'];
|
|
687
|
+
/** Set while a HITL ticket is waiting for an agent — renders the in-stream
|
|
688
|
+
* waiting block under the messages (dots + "you're in line"). */
|
|
689
|
+
hitlWaiting?: {
|
|
690
|
+
since: Date;
|
|
691
|
+
message?: string;
|
|
692
|
+
};
|
|
693
|
+
addMessageFeedback?: (messageId: string, feedback: Feedback) => Promise<void>;
|
|
694
|
+
/** Inline citation pills + Sources footer (undefined = enabled). */
|
|
695
|
+
citationsEnabled?: boolean;
|
|
503
696
|
showMarquee?: boolean;
|
|
504
697
|
showDateSystemMessage?: boolean;
|
|
505
698
|
showMessageStatus?: boolean;
|
|
506
699
|
showIncomingMessageAvatar?: boolean;
|
|
507
700
|
showOutgoingMessageAvatar?: boolean;
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
701
|
+
homePageEnabled?: boolean;
|
|
702
|
+
welcomeHeading?: string;
|
|
703
|
+
welcomeSubtitle?: string;
|
|
704
|
+
mainCardEnabled?: boolean;
|
|
705
|
+
mainCardTitle?: string;
|
|
706
|
+
mainCardSubtitle?: string;
|
|
707
|
+
onMainCardClick?: () => void;
|
|
708
|
+
conversationStartersEnabled?: boolean;
|
|
709
|
+
conversationStarters?: ConversationStarter[];
|
|
710
|
+
conversationStartersDisplayStyle?: ConversationStarterDisplayStyle;
|
|
711
|
+
renderers?: MessageRenderers;
|
|
712
|
+
};
|
|
713
|
+
|
|
714
|
+
export declare const MessagePreview: ForwardRefExoticComponent<Omit<ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
|
|
512
715
|
avatarUrl?: string;
|
|
513
716
|
botName?: string;
|
|
514
717
|
description?: string;
|
|
515
718
|
onClose?: () => void;
|
|
516
|
-
}, "ref"> &
|
|
719
|
+
}, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
720
|
+
|
|
721
|
+
declare type MessageProps = {
|
|
722
|
+
children?: ReactNode_2;
|
|
723
|
+
sendMessage?: ScopedClient['sendMessage'];
|
|
724
|
+
isReadOnly?: boolean;
|
|
725
|
+
isLastDeliveredMessage?: boolean;
|
|
726
|
+
/** False when a newer message exists — an unanswered CSAT card collapses to its quiet row. */
|
|
727
|
+
isLastMessage?: boolean;
|
|
728
|
+
showAvatar?: boolean;
|
|
729
|
+
renderers?: MessageRenderers;
|
|
730
|
+
addMessageFeedback?: (messageId: string, feedback: Feedback) => Promise<void>;
|
|
731
|
+
/** Inline citation pills + Sources footer. Undefined = enabled at the
|
|
732
|
+
* component level; Chat passes the config gate (`citationsEnabled === true`,
|
|
733
|
+
* off by default so unversioned existing bots keep their behavior). */
|
|
734
|
+
citationsEnabled?: boolean;
|
|
735
|
+
} & Omit<RichBlockMessage, 'block'> & {
|
|
736
|
+
block?: RichBlockMessage['block'];
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
export declare type MessageRenderers = {
|
|
740
|
+
custom?: React.FC<CustomRendererProps>;
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
export { MessageStreamAbort }
|
|
744
|
+
|
|
745
|
+
export { MessageStreamComplete }
|
|
746
|
+
|
|
747
|
+
export { MessageStreamDelta }
|
|
748
|
+
|
|
749
|
+
export { MessageStreamSnapshot }
|
|
517
750
|
|
|
518
751
|
export declare const MISSING_API_URL = "The API url is required to initialize the webchat.";
|
|
519
752
|
|
|
@@ -526,12 +759,12 @@ export declare const MISSING_CONFIG_URL = "No config URL provided.";
|
|
|
526
759
|
export declare function Modal({ open, onOpenChange, children, }: {
|
|
527
760
|
open?: boolean;
|
|
528
761
|
onOpenChange?: (open: boolean) => void;
|
|
529
|
-
children:
|
|
530
|
-
}):
|
|
762
|
+
children: ReactNode_2;
|
|
763
|
+
}): JSX.Element;
|
|
531
764
|
|
|
532
765
|
export declare namespace Modal {
|
|
533
|
-
var Button:
|
|
534
|
-
var Close:
|
|
766
|
+
var Button: ForwardRefExoticComponent_2<Dialog.DialogTriggerProps & RefAttributes_2<HTMLButtonElement>>;
|
|
767
|
+
var Close: ForwardRefExoticComponent_2<Dialog.DialogCloseProps & RefAttributes_2<HTMLButtonElement>>;
|
|
535
768
|
var Content: typeof ModalContent;
|
|
536
769
|
}
|
|
537
770
|
|
|
@@ -542,8 +775,8 @@ declare function ModalContent({ title, description, onConfirm, onCancel, confirm
|
|
|
542
775
|
onCancel?: () => void;
|
|
543
776
|
confirmButtonText?: string;
|
|
544
777
|
cancelButtonText?: string;
|
|
545
|
-
children:
|
|
546
|
-
}):
|
|
778
|
+
children: ReactNode_2;
|
|
779
|
+
}): JSX.Element;
|
|
547
780
|
|
|
548
781
|
export declare const ModalContext: Context<ModalContextValue>;
|
|
549
782
|
|
|
@@ -552,8 +785,12 @@ declare type ModalContextValue = {
|
|
|
552
785
|
};
|
|
553
786
|
|
|
554
787
|
export declare const ModalProvider: ({ children }: {
|
|
555
|
-
children:
|
|
556
|
-
}) =>
|
|
788
|
+
children: ReactNode;
|
|
789
|
+
}) => JSX.Element;
|
|
790
|
+
|
|
791
|
+
export declare const MotionProvider: ({ children }: {
|
|
792
|
+
children: ReactNode;
|
|
793
|
+
}) => JSX.Element;
|
|
557
794
|
|
|
558
795
|
export declare const NETWORK_ERROR = "Please check your internet connection and refresh the page.";
|
|
559
796
|
|
|
@@ -563,36 +800,7 @@ export declare type Options = {
|
|
|
563
800
|
timeout?: number;
|
|
564
801
|
};
|
|
565
802
|
|
|
566
|
-
|
|
567
|
-
className?: string;
|
|
568
|
-
renderers?: Partial<Renderers>;
|
|
569
|
-
configuration: Configuration;
|
|
570
|
-
messages: BlockMessage[];
|
|
571
|
-
participants: User[];
|
|
572
|
-
connected?: boolean;
|
|
573
|
-
disableComposer?: boolean;
|
|
574
|
-
isReadOnly?: boolean;
|
|
575
|
-
isLoading?: boolean;
|
|
576
|
-
isTyping?: boolean;
|
|
577
|
-
clientId?: string;
|
|
578
|
-
closeWindow?: () => void;
|
|
579
|
-
restartConversation?: (conversationid?: string) => void;
|
|
580
|
-
user?: UserCredentials;
|
|
581
|
-
sendMessage?: ScopedClient['sendMessage'];
|
|
582
|
-
uploadFile?: ScopedClient['uploadFile'];
|
|
583
|
-
addMessageFeedback?: ScopedClient['addMessageFeedback'];
|
|
584
|
-
listConversations?: ScopedClient['listConversations'];
|
|
585
|
-
error?: WebchatError;
|
|
586
|
-
soundOn?: boolean;
|
|
587
|
-
toggleSound?: () => void;
|
|
588
|
-
storageKey?: string;
|
|
589
|
-
disableSendButton?: boolean;
|
|
590
|
-
conversationId?: string;
|
|
591
|
-
locale?: Partial<WebchatTranslations>;
|
|
592
|
-
isOpen?: boolean;
|
|
593
|
-
};
|
|
594
|
-
|
|
595
|
-
declare type Props_2 = {
|
|
803
|
+
declare type Props = {
|
|
596
804
|
adminSecret?: string;
|
|
597
805
|
user?: UserCredentials;
|
|
598
806
|
conversationId?: string;
|
|
@@ -605,7 +813,63 @@ declare type Props_2 = {
|
|
|
605
813
|
clientHeaders?: Record<string, string>;
|
|
606
814
|
};
|
|
607
815
|
|
|
608
|
-
declare type
|
|
816
|
+
declare type Props_10 = {
|
|
817
|
+
url: string;
|
|
818
|
+
orientation?: ImageBlock['orientation'];
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
declare type Props_11 = {
|
|
822
|
+
url: string;
|
|
823
|
+
isReadOnly?: boolean;
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
declare type Props_12 = {
|
|
827
|
+
url: string;
|
|
828
|
+
isReadOnly?: boolean;
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
declare type Props_13 = {
|
|
832
|
+
latitude: number;
|
|
833
|
+
longitude: number;
|
|
834
|
+
title?: string;
|
|
835
|
+
isReadOnly?: boolean;
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
declare type Props_14 = {
|
|
839
|
+
cards: CardBlock[];
|
|
840
|
+
ctx: BlockContext;
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
declare type Props_15 = {
|
|
844
|
+
text?: string;
|
|
845
|
+
options: {
|
|
846
|
+
label: string;
|
|
847
|
+
value: string;
|
|
848
|
+
}[];
|
|
849
|
+
reusable?: boolean;
|
|
850
|
+
ctx: BlockContext;
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
declare type Props_16 = {
|
|
854
|
+
url: string;
|
|
855
|
+
title?: string;
|
|
856
|
+
isReadOnly?: boolean;
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
declare type Props_17 = CardBlock & {
|
|
860
|
+
ctx: BlockContext;
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
declare type Props_18 = ChoiceBlock & {
|
|
864
|
+
ctx: BlockContext;
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
declare type Props_19 = {
|
|
868
|
+
items: LeafBlock[];
|
|
869
|
+
ctx: BlockContext;
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
declare type Props_2 = ComponentProps<'div'> & {
|
|
609
873
|
inputRef?: Ref<HTMLTextAreaElement>;
|
|
610
874
|
disableComposer?: boolean;
|
|
611
875
|
isReadOnly?: boolean;
|
|
@@ -616,52 +880,92 @@ declare type Props_3 = ComponentProps<'div'> & {
|
|
|
616
880
|
uploadFile?: ScopedClient['uploadFile'];
|
|
617
881
|
storageKey?: string;
|
|
618
882
|
conversationId?: string;
|
|
883
|
+
onTextChange?: (text: string) => void;
|
|
884
|
+
statusText?: ReactNode_2;
|
|
619
885
|
} & Pick<Configuration, 'composerPlaceholder' | 'footer'>;
|
|
620
886
|
|
|
621
|
-
declare type
|
|
622
|
-
|
|
887
|
+
declare type Props_20 = Partial<LatestWebchatTheme>;
|
|
888
|
+
|
|
889
|
+
declare type Props_3 = ComponentProps<'div'> & {
|
|
623
890
|
uploadFile?: ScopedClient['uploadFile'];
|
|
624
891
|
allowFileUpload?: boolean;
|
|
625
892
|
storageKey?: string;
|
|
626
893
|
conversationId?: string;
|
|
627
894
|
};
|
|
628
895
|
|
|
629
|
-
declare type
|
|
630
|
-
|
|
631
|
-
|
|
896
|
+
declare type Props_4 = {
|
|
897
|
+
icon: LucideIcon;
|
|
898
|
+
label: string;
|
|
899
|
+
onClick?: (e: React.SyntheticEvent) => void;
|
|
900
|
+
className?: string;
|
|
901
|
+
style?: React.CSSProperties;
|
|
902
|
+
size?: number;
|
|
903
|
+
};
|
|
632
904
|
|
|
633
|
-
declare type
|
|
905
|
+
declare type Props_5 = {
|
|
634
906
|
clientId: string;
|
|
635
907
|
apiUrl?: string;
|
|
636
908
|
storageKey?: string;
|
|
637
909
|
user?: UserCredentials;
|
|
638
910
|
conversationId?: string;
|
|
639
911
|
configuration?: Configuration;
|
|
640
|
-
soundOn?: boolean;
|
|
641
|
-
toggleSound?: () => void;
|
|
642
|
-
/** @deprecated This prop is no longer used, pass the allowFileUpload via the configuration object */
|
|
643
|
-
allowFileUpload?: boolean;
|
|
644
|
-
renderers?: Partial<Renderers>;
|
|
645
|
-
locale?: Partial<WebchatTranslations>;
|
|
646
912
|
} & ComponentProps_2<'div'>;
|
|
647
913
|
|
|
648
|
-
declare type
|
|
914
|
+
declare type Props_6 = {
|
|
915
|
+
text: string;
|
|
916
|
+
ctx: BlockContext;
|
|
917
|
+
/** When true, render without bubble wrapper (used inside Card/Choice) */
|
|
918
|
+
bare?: boolean;
|
|
919
|
+
/** Payload dot-path of this text (e.g. "root.text") — selects the citation
|
|
920
|
+
* entries from `ctx.citations` whose pills splice into THIS text. */
|
|
921
|
+
citationPath?: string;
|
|
922
|
+
/** Added to citation offsets when the rendered text was prefixed after the
|
|
923
|
+
* offsets were recorded (e.g. a card title rendered as `#### ${title}`). */
|
|
924
|
+
citationOffsetShift?: number;
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
declare type Props_7 = {
|
|
928
|
+
text: string;
|
|
929
|
+
buttonValue: string;
|
|
930
|
+
variant: 'action' | 'link';
|
|
931
|
+
reusable?: boolean;
|
|
932
|
+
groupId?: string;
|
|
933
|
+
sendMessage?: ScopedClient['sendMessage'];
|
|
934
|
+
isReadOnly?: boolean;
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
declare type Props_8 = {
|
|
938
|
+
actions: Action[];
|
|
939
|
+
groupId?: string;
|
|
940
|
+
reusable?: boolean;
|
|
941
|
+
sendMessage?: ScopedClient['sendMessage'];
|
|
942
|
+
isReadOnly?: boolean;
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
declare type Props_9 = {
|
|
946
|
+
ctx: BlockContext;
|
|
947
|
+
children: ReactNode_2;
|
|
948
|
+
};
|
|
649
949
|
|
|
650
950
|
export declare const pt: WebchatTranslations;
|
|
651
951
|
|
|
652
952
|
export declare const QUOTA_EXCEEDED = "This bot has temporarily paused.\nPlease check back later.";
|
|
653
953
|
|
|
654
|
-
export declare
|
|
655
|
-
[T in GenericBlock['type']]: FC<BlockObjects[T]>;
|
|
656
|
-
};
|
|
954
|
+
export declare function renderBlock(block: MessageBlock, ctx: BlockContext): JSX_2.Element;
|
|
657
955
|
|
|
658
|
-
export declare const
|
|
956
|
+
export declare const resolveStarterIcon: (icon?: string) => LucideIcon;
|
|
659
957
|
|
|
660
|
-
|
|
958
|
+
/**
|
|
959
|
+
* Resolves the translation map for the webchat: pick the base bundle for `language`
|
|
960
|
+
* (or auto-detect from navigator.language when omitted), then merge any custom string
|
|
961
|
+
* `overrides` on top. Overrides win per-key, so a site can localize into an unsupported
|
|
962
|
+
* language or tweak individual strings on top of a built-in bundle.
|
|
963
|
+
*/
|
|
964
|
+
export declare function resolveTranslations(language?: string, overrides?: Partial<WebchatTranslations>): WebchatTranslations;
|
|
661
965
|
|
|
662
966
|
export declare const retryWithBackoff: <T>(fn: () => Promise<T>, maxAttempts?: number, delayMs?: number) => Promise<T>;
|
|
663
967
|
|
|
664
|
-
export declare type RichBlockMessage
|
|
968
|
+
export declare type RichBlockMessage = BlockMessage & {
|
|
665
969
|
direction: 'incoming' | 'outgoing' | 'system';
|
|
666
970
|
sender: {
|
|
667
971
|
name: string;
|
|
@@ -669,19 +973,8 @@ export declare type RichBlockMessage<T = GenericBlock> = BlockMessage<T> & {
|
|
|
669
973
|
};
|
|
670
974
|
};
|
|
671
975
|
|
|
672
|
-
export declare type RowBlock = {
|
|
673
|
-
type: 'row';
|
|
674
|
-
blocks: GenericBlock[];
|
|
675
|
-
horizontalAlignment?: 'left' | 'center' | 'right' | 'stretch';
|
|
676
|
-
verticalAlignment?: 'top' | 'center' | 'bottom';
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
export declare type RowOf<T extends GenericBlock> = Omit<RowBlock, 'blocks'> & {
|
|
680
|
-
blocks: T[];
|
|
681
|
-
};
|
|
682
|
-
|
|
683
976
|
export declare type ScopedClient = {
|
|
684
|
-
sendMessage: (payload: IntegrationMessage['payload']) => Promise<void>;
|
|
977
|
+
sendMessage: (payload: IntegrationMessage['payload'], metadata?: Record<string, string>) => Promise<void>;
|
|
685
978
|
sendEvent: (event: Record<string, any>, options?: {
|
|
686
979
|
bindConversation?: boolean;
|
|
687
980
|
bindUser?: boolean;
|
|
@@ -692,7 +985,6 @@ export declare type ScopedClient = {
|
|
|
692
985
|
type: FileType;
|
|
693
986
|
fileId: string;
|
|
694
987
|
}>;
|
|
695
|
-
addMessageFeedback: (messageId: string, feedback: Feedback) => Promise<void>;
|
|
696
988
|
getUser: () => Promise<UserResponse>;
|
|
697
989
|
updateUser: (user: UserProfile) => Promise<User>;
|
|
698
990
|
listConversations: () => ReturnType<Client['listConversations']>;
|
|
@@ -708,7 +1000,18 @@ export declare const SOUND_EFFECTS: {
|
|
|
708
1000
|
|
|
709
1001
|
export declare const SSE_DISCONNECTED_ERROR = "You've been disconnected from the conversation.\nPlease refresh the page.";
|
|
710
1002
|
|
|
711
|
-
export declare
|
|
1003
|
+
export declare const STARTER_ICON_NAMES: string[];
|
|
1004
|
+
|
|
1005
|
+
export declare const Starters: MemoExoticComponent<({ enabled, starters, displayStyle, sendMessage }: StartersProps) => JSX.Element | null>;
|
|
1006
|
+
|
|
1007
|
+
declare type StartersProps = {
|
|
1008
|
+
enabled?: boolean;
|
|
1009
|
+
starters?: ConversationStarter[];
|
|
1010
|
+
displayStyle?: ConversationStarterDisplayStyle;
|
|
1011
|
+
sendMessage?: ScopedClient['sendMessage'];
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
export declare type StorageLocation = 'sessionStorage' | 'localStorage' | 'cookieStorage';
|
|
712
1015
|
|
|
713
1016
|
export declare type StyleOptions = {
|
|
714
1017
|
className?: string;
|
|
@@ -718,12 +1021,18 @@ export declare type StyleOptions = {
|
|
|
718
1021
|
/**
|
|
719
1022
|
* StylesheetProvider component that manages theme styles and font loading
|
|
720
1023
|
*/
|
|
721
|
-
export declare const StylesheetProvider: ({ color, fontFamily,
|
|
1024
|
+
export declare const StylesheetProvider: ({ color, fontFamily, themeMode, headerVariant }: Props_20) => JSX.Element;
|
|
1025
|
+
|
|
1026
|
+
declare const Text_2: ({ text, ctx, bare, citationPath, citationOffsetShift }: Props_6) => JSX.Element;
|
|
1027
|
+
export { Text_2 as Text }
|
|
722
1028
|
|
|
723
1029
|
export declare type TextBlock = {
|
|
724
1030
|
type: 'text';
|
|
725
1031
|
text: string;
|
|
726
1032
|
value?: string;
|
|
1033
|
+
/** Dot-path of this text in the original message payload (e.g. "root.text",
|
|
1034
|
+
* "root.markdown", "root.items.0.payload.text") — matches citation entries. */
|
|
1035
|
+
citationPath?: string;
|
|
727
1036
|
};
|
|
728
1037
|
|
|
729
1038
|
declare type ToPayloadType<T extends IntegrationMessageTypes> = {
|
|
@@ -734,9 +1043,7 @@ declare type ToPayloadType<T extends IntegrationMessageTypes> = {
|
|
|
734
1043
|
|
|
735
1044
|
declare let _trackFn: ((event: string, properties?: Record<string, unknown>) => void) | null;
|
|
736
1045
|
|
|
737
|
-
export declare const
|
|
738
|
-
|
|
739
|
-
export declare const TypingIndicator: MemoExoticComponent<({ ...props }: ComponentProps<"div">) => JSX_2.Element>;
|
|
1046
|
+
export declare const TypingIndicator: MemoExoticComponent<({ ...props }: ComponentProps<"div">) => JSX.Element>;
|
|
740
1047
|
|
|
741
1048
|
export declare function useActiveConversation(): UseActiveConversationReturn;
|
|
742
1049
|
|
|
@@ -744,23 +1051,18 @@ declare type UseActiveConversationReturn = {
|
|
|
744
1051
|
conversationId?: string;
|
|
745
1052
|
messages: BlockMessage[];
|
|
746
1053
|
participants: User[];
|
|
747
|
-
sendMessage:
|
|
1054
|
+
sendMessage: ScopedClient['sendMessage'];
|
|
748
1055
|
saveMessageFeedback: (messageId: string, feedback: Feedback) => Promise<void>;
|
|
749
|
-
sendEvent:
|
|
750
|
-
|
|
751
|
-
bindUser?: boolean;
|
|
752
|
-
}) => Promise<void>;
|
|
753
|
-
uploadFile: (file: File) => Promise<{
|
|
754
|
-
fileUrl: string;
|
|
755
|
-
name: string;
|
|
756
|
-
type: FileType;
|
|
757
|
-
fileId: string;
|
|
758
|
-
}>;
|
|
1056
|
+
sendEvent: ScopedClient['sendEvent'];
|
|
1057
|
+
uploadFile: ScopedClient['uploadFile'];
|
|
759
1058
|
status: ClientStates;
|
|
760
1059
|
on: ReturnType<typeof createEventEmitter<Events>>['on'];
|
|
761
1060
|
error?: WebchatError;
|
|
762
1061
|
isTyping: boolean;
|
|
763
1062
|
isAwaitingResponse: boolean;
|
|
1063
|
+
upsertMessageStream: (input: MessageStreamDelta) => void;
|
|
1064
|
+
completeMessageStream: (input: MessageStreamComplete) => void;
|
|
1065
|
+
abortMessageStream: (input: MessageStreamAbort) => void;
|
|
764
1066
|
};
|
|
765
1067
|
|
|
766
1068
|
export declare function useConversationList({ userCredentials, listConversations, clientId, }: UseConversationListParams): UseConversationListReturn;
|
|
@@ -794,13 +1096,59 @@ export declare function useMessageContext(): MessageContextVaue;
|
|
|
794
1096
|
|
|
795
1097
|
export declare function useModalContext(): ModalContextValue;
|
|
796
1098
|
|
|
1099
|
+
/**
|
|
1100
|
+
* Reports the end user's presence to the conversation as a `userPresence` custom event so a
|
|
1101
|
+
* human agent (e.g. in Desk) can tell whether the visitor is around:
|
|
1102
|
+
* - `online` — stream connected, tab present, active within the last AWAY_MS
|
|
1103
|
+
* - `away` — connected but the tab has been blurred or idle for AWAY_MS
|
|
1104
|
+
* - `offline` — stream disconnected, or the tab is being closed
|
|
1105
|
+
* Only the transitions are emitted (deduped against the last reported state).
|
|
1106
|
+
*/
|
|
1107
|
+
export declare function usePresenceEmitter({ enabled, connected }: UsePresenceEmitterProps): void;
|
|
1108
|
+
|
|
1109
|
+
declare type UsePresenceEmitterProps = {
|
|
1110
|
+
/** Gate — only emit when the bot reports presence upstream (agentPresenceEnabled). */
|
|
1111
|
+
enabled?: boolean;
|
|
1112
|
+
/** Whether the webchat client's event stream is connected (drives online vs offline). */
|
|
1113
|
+
connected?: boolean;
|
|
1114
|
+
};
|
|
1115
|
+
|
|
797
1116
|
export { User }
|
|
798
1117
|
|
|
1118
|
+
export declare function useReadIndicator(): {
|
|
1119
|
+
onMessageReceived: (messageId: string) => void;
|
|
1120
|
+
};
|
|
1121
|
+
|
|
799
1122
|
export declare type UserProfile = Omit<User, 'id' | 'createdAt' | 'updatedAt'>;
|
|
800
1123
|
|
|
801
1124
|
export declare type UserResponse = Awaited<ReturnType<Client['getUser']>>['user'];
|
|
802
1125
|
|
|
803
|
-
export declare function
|
|
1126
|
+
export declare function useSound({ storageKey, soundEnabled }: UseSoundProps): UseSoundReturn;
|
|
1127
|
+
|
|
1128
|
+
declare type UseSoundProps = {
|
|
1129
|
+
storageKey?: string;
|
|
1130
|
+
soundEnabled?: boolean;
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
declare type UseSoundReturn = {
|
|
1134
|
+
soundOn: boolean;
|
|
1135
|
+
toggleSound: () => void;
|
|
1136
|
+
playNotificationSound: () => void;
|
|
1137
|
+
};
|
|
1138
|
+
|
|
1139
|
+
/**
|
|
1140
|
+
* Reports the end user's typing to the conversation as a `userTyping` custom event so a human
|
|
1141
|
+
* agent (e.g. in Desk) can see when the visitor is composing. Returns an `onTextChange` handler
|
|
1142
|
+
* to wire to the composer; it is `undefined` when disabled so nothing is emitted.
|
|
1143
|
+
*/
|
|
1144
|
+
export declare function useTypingEmitter({ enabled }: UseTypingEmitterProps): {
|
|
1145
|
+
onTextChange: ((text: string) => void) | undefined;
|
|
1146
|
+
};
|
|
1147
|
+
|
|
1148
|
+
declare type UseTypingEmitterProps = {
|
|
1149
|
+
/** Gate — only emit when the bot reports presence upstream (agentPresenceEnabled). */
|
|
1150
|
+
enabled?: boolean;
|
|
1151
|
+
};
|
|
804
1152
|
|
|
805
1153
|
export declare const useUser: () => UseUserReturn;
|
|
806
1154
|
|
|
@@ -826,7 +1174,7 @@ declare type UseUserReturn = {
|
|
|
826
1174
|
* </WebchatProvider>
|
|
827
1175
|
* ```
|
|
828
1176
|
*/
|
|
829
|
-
export declare function useWebchat({ apiUrl, clientId, storageKey, storageLocation, adminSecret, soundEnabled, clientHeaders, ...props }:
|
|
1177
|
+
export declare function useWebchat({ apiUrl, clientId, storageKey, storageLocation, adminSecret, soundEnabled, clientHeaders, ...props }: Props): UseWebchatReturn;
|
|
830
1178
|
|
|
831
1179
|
export declare function useWebchatContext(): WebchatContextValue;
|
|
832
1180
|
|
|
@@ -847,610 +1195,34 @@ declare type UseWebchatReturn = (CommonWebchatProps & {
|
|
|
847
1195
|
isTyping: undefined;
|
|
848
1196
|
});
|
|
849
1197
|
|
|
850
|
-
export declare const useWebchatStore: UseBoundStore<Omit<StoreApi<WebchatStore>, "setState"> & {
|
|
851
|
-
setState<
|
|
852
|
-
|
|
853
|
-
|
|
1198
|
+
export declare const useWebchatStore: UseBoundStore<Omit<StoreApi<WebchatStore>, "setState" | "devtools"> & {
|
|
1199
|
+
setState(partial: WebchatStore | Partial<WebchatStore> | ((state: WebchatStore) => WebchatStore | Partial<WebchatStore>), replace?: false | undefined, action?: (string | {
|
|
1200
|
+
[x: string]: unknown;
|
|
1201
|
+
[x: number]: unknown;
|
|
1202
|
+
[x: symbol]: unknown;
|
|
1203
|
+
type: string;
|
|
1204
|
+
}) | undefined): void;
|
|
1205
|
+
setState(state: WebchatStore | ((state: WebchatStore) => WebchatStore), replace: true, action?: (string | {
|
|
1206
|
+
[x: string]: unknown;
|
|
1207
|
+
[x: number]: unknown;
|
|
1208
|
+
[x: symbol]: unknown;
|
|
1209
|
+
type: string;
|
|
1210
|
+
}) | undefined): void;
|
|
1211
|
+
devtools: {
|
|
1212
|
+
cleanup: () => void;
|
|
1213
|
+
};
|
|
854
1214
|
}>;
|
|
855
1215
|
|
|
856
1216
|
declare type ValueOf<T> = T[keyof T];
|
|
857
1217
|
|
|
1218
|
+
export declare const Video: ({ url, isReadOnly }: Props_11) => JSX.Element;
|
|
1219
|
+
|
|
858
1220
|
export declare type VideoBlock = {
|
|
859
1221
|
type: 'video';
|
|
860
1222
|
url: string;
|
|
861
1223
|
};
|
|
862
1224
|
|
|
863
|
-
export declare const Webchat: ({ clientId, storageKey, configuration, apiUrl, user: userCredentials, conversationId, ...props }:
|
|
864
|
-
|
|
865
|
-
export declare const webchatClasses: {
|
|
866
|
-
readonly container: {
|
|
867
|
-
readonly className: "bpReset bpContainer bpFont";
|
|
868
|
-
readonly dropzone: {
|
|
869
|
-
readonly overlay: {
|
|
870
|
-
readonly className: "bpDropzoneOverlay";
|
|
871
|
-
};
|
|
872
|
-
};
|
|
873
|
-
};
|
|
874
|
-
readonly loader: {
|
|
875
|
-
readonly className: "bpReset bpLoader";
|
|
876
|
-
};
|
|
877
|
-
readonly modal: {
|
|
878
|
-
readonly overlay: {
|
|
879
|
-
readonly className: "bpModalOverlay";
|
|
880
|
-
};
|
|
881
|
-
readonly dialog: {
|
|
882
|
-
readonly container: {
|
|
883
|
-
readonly className: "bpReset bpModalContainer";
|
|
884
|
-
};
|
|
885
|
-
readonly title: {
|
|
886
|
-
readonly className: "bpModalTitle";
|
|
887
|
-
};
|
|
888
|
-
readonly description: {
|
|
889
|
-
readonly className: "bpModalDescription";
|
|
890
|
-
};
|
|
891
|
-
readonly content: {
|
|
892
|
-
readonly container: {
|
|
893
|
-
readonly className: "bpModalContentContainer";
|
|
894
|
-
};
|
|
895
|
-
readonly textarea: {
|
|
896
|
-
readonly className: "bpModalContentTextArea";
|
|
897
|
-
};
|
|
898
|
-
};
|
|
899
|
-
readonly button: {
|
|
900
|
-
readonly container: {
|
|
901
|
-
readonly className: "bpModalButtonContainer";
|
|
902
|
-
};
|
|
903
|
-
readonly confirm: {
|
|
904
|
-
readonly className: "bpModalButtonConfirm";
|
|
905
|
-
};
|
|
906
|
-
readonly cancel: {
|
|
907
|
-
readonly className: "bpModalButtonCancel";
|
|
908
|
-
};
|
|
909
|
-
};
|
|
910
|
-
};
|
|
911
|
-
};
|
|
912
|
-
readonly messagePreview: {
|
|
913
|
-
readonly container: {
|
|
914
|
-
readonly className: "bpMessagePreviewContainer";
|
|
915
|
-
};
|
|
916
|
-
readonly message: {
|
|
917
|
-
readonly className: "bpMessagePreviewMessage";
|
|
918
|
-
};
|
|
919
|
-
readonly description: {
|
|
920
|
-
readonly className: "bpMessagePreviewDescription";
|
|
921
|
-
};
|
|
922
|
-
readonly closeButton: {
|
|
923
|
-
readonly className: "bpMessagePreviewCloseButton";
|
|
924
|
-
};
|
|
925
|
-
readonly avatar: {
|
|
926
|
-
readonly container: {
|
|
927
|
-
readonly className: "bpMessagePreviewAvatarContainer";
|
|
928
|
-
};
|
|
929
|
-
readonly image: {
|
|
930
|
-
readonly className: "bpMessagePreviewAvatarImage";
|
|
931
|
-
};
|
|
932
|
-
readonly fallback: {
|
|
933
|
-
readonly className: "bpMessagePreviewAvatarFallback";
|
|
934
|
-
};
|
|
935
|
-
};
|
|
936
|
-
};
|
|
937
|
-
readonly fab: {
|
|
938
|
-
readonly container: {
|
|
939
|
-
readonly className: "bpReset bpFabContainer";
|
|
940
|
-
};
|
|
941
|
-
readonly icon: {
|
|
942
|
-
readonly className: "bpFabIcon";
|
|
943
|
-
};
|
|
944
|
-
readonly image: {
|
|
945
|
-
readonly className: "bpFabImage";
|
|
946
|
-
};
|
|
947
|
-
};
|
|
948
|
-
readonly notification: {
|
|
949
|
-
readonly container: {
|
|
950
|
-
readonly className: "bpReset bpNotificationContainer";
|
|
951
|
-
};
|
|
952
|
-
readonly title: {
|
|
953
|
-
readonly className: "bpNotificationTitle";
|
|
954
|
-
};
|
|
955
|
-
readonly description: {
|
|
956
|
-
readonly className: "bpNotificationDescription";
|
|
957
|
-
};
|
|
958
|
-
readonly icon: {
|
|
959
|
-
readonly className: "bpNotificationIcon";
|
|
960
|
-
};
|
|
961
|
-
readonly closeIcon: {
|
|
962
|
-
readonly className: "bpNotificationCloseIcon";
|
|
963
|
-
};
|
|
964
|
-
};
|
|
965
|
-
readonly header: {
|
|
966
|
-
readonly container: {
|
|
967
|
-
readonly className: "bpReset bpHeaderContainer bpFont";
|
|
968
|
-
};
|
|
969
|
-
readonly content: {
|
|
970
|
-
readonly container: {
|
|
971
|
-
readonly className: "bpReset bpHeaderContentContainer";
|
|
972
|
-
};
|
|
973
|
-
readonly conversationHistory: {
|
|
974
|
-
readonly className: "bpHeaderConversationHistoryButton";
|
|
975
|
-
};
|
|
976
|
-
readonly title: {
|
|
977
|
-
readonly className: "bpHeaderContentTitle";
|
|
978
|
-
};
|
|
979
|
-
readonly description: {
|
|
980
|
-
readonly className: "bpHeaderContentDescription";
|
|
981
|
-
};
|
|
982
|
-
readonly avatar: {
|
|
983
|
-
readonly container: {
|
|
984
|
-
readonly className: "bpReset bpHeaderContentAvatarContainer";
|
|
985
|
-
};
|
|
986
|
-
readonly image: {
|
|
987
|
-
readonly className: "bpHeaderContentAvatarImage";
|
|
988
|
-
};
|
|
989
|
-
readonly fallback: {
|
|
990
|
-
readonly className: "bpHeaderContentAvatarFallback";
|
|
991
|
-
};
|
|
992
|
-
};
|
|
993
|
-
readonly toggleSound: {
|
|
994
|
-
readonly className: "bpHeaderSoundToggleButton";
|
|
995
|
-
};
|
|
996
|
-
readonly actions: {
|
|
997
|
-
readonly container: {
|
|
998
|
-
readonly className: "bpReset bpHeaderContentActionsContainer";
|
|
999
|
-
};
|
|
1000
|
-
readonly icons: {
|
|
1001
|
-
readonly className: "bpHeaderContentActionsIcons";
|
|
1002
|
-
};
|
|
1003
|
-
};
|
|
1004
|
-
};
|
|
1005
|
-
readonly expandedContent: {
|
|
1006
|
-
readonly container: {
|
|
1007
|
-
readonly className: "bpReset bpHeaderExpandedContentContainer";
|
|
1008
|
-
};
|
|
1009
|
-
readonly descriptionItems: {
|
|
1010
|
-
readonly container: {
|
|
1011
|
-
readonly className: "bpReset bpHeaderExpandedContentDescriptionItemsContainer";
|
|
1012
|
-
};
|
|
1013
|
-
readonly icon: {
|
|
1014
|
-
readonly className: "bpHeaderExpandedContentDescriptionItemsIcon";
|
|
1015
|
-
};
|
|
1016
|
-
readonly text: {
|
|
1017
|
-
readonly className: "bpHeaderExpandedContentDescriptionItemsText";
|
|
1018
|
-
};
|
|
1019
|
-
readonly link: {
|
|
1020
|
-
readonly className: "bpHeaderExpandedContentDescriptionItemsLink";
|
|
1021
|
-
};
|
|
1022
|
-
};
|
|
1023
|
-
readonly group: {
|
|
1024
|
-
readonly className: "bpHeaderExpandedContentGroup";
|
|
1025
|
-
};
|
|
1026
|
-
};
|
|
1027
|
-
readonly newConversationIcon: {
|
|
1028
|
-
readonly className: "bpHeaderNewConversationIcon";
|
|
1029
|
-
};
|
|
1030
|
-
};
|
|
1031
|
-
readonly composer: {
|
|
1032
|
-
readonly wrapper: {
|
|
1033
|
-
readonly className: "bpReset bpComposerWrapper";
|
|
1034
|
-
};
|
|
1035
|
-
readonly container: {
|
|
1036
|
-
readonly className: "bpReset bpComposerContainer bpFont";
|
|
1037
|
-
};
|
|
1038
|
-
readonly footer: {
|
|
1039
|
-
readonly className: "bpComposerFooter";
|
|
1040
|
-
};
|
|
1041
|
-
readonly inputContainer: {
|
|
1042
|
-
readonly className: "bpComposerInputContainer";
|
|
1043
|
-
};
|
|
1044
|
-
readonly input: {
|
|
1045
|
-
readonly className: "bpComposerInput";
|
|
1046
|
-
};
|
|
1047
|
-
readonly inputLoader: {
|
|
1048
|
-
readonly className: "bpComposerInputLoader";
|
|
1049
|
-
};
|
|
1050
|
-
readonly sendbutton: {
|
|
1051
|
-
readonly className: "bpComposerSendButton";
|
|
1052
|
-
};
|
|
1053
|
-
readonly uploadButton: {
|
|
1054
|
-
readonly className: "bpComposerUploadButton";
|
|
1055
|
-
};
|
|
1056
|
-
readonly voiceButton: {
|
|
1057
|
-
readonly className: "bpComposerVoiceButton";
|
|
1058
|
-
};
|
|
1059
|
-
readonly fileContainer: {
|
|
1060
|
-
readonly className: "bpComposerFileContainer";
|
|
1061
|
-
};
|
|
1062
|
-
readonly fileWidget: {
|
|
1063
|
-
readonly container: {
|
|
1064
|
-
readonly className: "bpComposerFileAttachement";
|
|
1065
|
-
};
|
|
1066
|
-
readonly loader: {
|
|
1067
|
-
readonly className: "bpComposerFileLoader";
|
|
1068
|
-
};
|
|
1069
|
-
readonly fileIcon: {
|
|
1070
|
-
readonly container: {
|
|
1071
|
-
readonly className: "bpComposerFileIconWrapper";
|
|
1072
|
-
};
|
|
1073
|
-
readonly icon: {
|
|
1074
|
-
readonly className: "bpComposerFileIcon";
|
|
1075
|
-
};
|
|
1076
|
-
};
|
|
1077
|
-
readonly metadata: {
|
|
1078
|
-
readonly container: {
|
|
1079
|
-
readonly className: "bpComposerFileMetadata";
|
|
1080
|
-
};
|
|
1081
|
-
readonly name: {
|
|
1082
|
-
readonly className: "bpComposerFileName";
|
|
1083
|
-
};
|
|
1084
|
-
readonly type: {
|
|
1085
|
-
readonly className: "bpComposerFileExtension";
|
|
1086
|
-
};
|
|
1087
|
-
};
|
|
1088
|
-
readonly removeIcon: {
|
|
1089
|
-
readonly className: "bpComposerFileRemoveIcon";
|
|
1090
|
-
};
|
|
1091
|
-
readonly errorIcon: {
|
|
1092
|
-
readonly className: "bpComposerFileErrorIcon";
|
|
1093
|
-
};
|
|
1094
|
-
readonly previewImage: {
|
|
1095
|
-
readonly className: "bpComposerFilePreviewImage";
|
|
1096
|
-
};
|
|
1097
|
-
};
|
|
1098
|
-
};
|
|
1099
|
-
readonly messageList: {
|
|
1100
|
-
readonly scrollDownButton: {
|
|
1101
|
-
readonly className: "bpMessageListScrollDownButton";
|
|
1102
|
-
};
|
|
1103
|
-
readonly container: {
|
|
1104
|
-
readonly className: "bpReset bpMessageListContainer bpFont";
|
|
1105
|
-
};
|
|
1106
|
-
readonly viewPort: {
|
|
1107
|
-
readonly className: "bpMessageListViewport";
|
|
1108
|
-
};
|
|
1109
|
-
readonly marquee: {
|
|
1110
|
-
readonly container: {
|
|
1111
|
-
readonly className: "bpReset bpMessageListMarqueeContainer";
|
|
1112
|
-
};
|
|
1113
|
-
readonly content: {
|
|
1114
|
-
readonly className: "bpMessageListMarqueeContent";
|
|
1115
|
-
};
|
|
1116
|
-
readonly title: {
|
|
1117
|
-
readonly className: "bpMessageListMarqueeTitle";
|
|
1118
|
-
};
|
|
1119
|
-
readonly description: {
|
|
1120
|
-
readonly className: "bpMessageListMarqueeDescription";
|
|
1121
|
-
};
|
|
1122
|
-
readonly avatar: {
|
|
1123
|
-
readonly container: {
|
|
1124
|
-
readonly className: "bpReset bpMessageListMarqueeAvatarContainer";
|
|
1125
|
-
};
|
|
1126
|
-
readonly image: {
|
|
1127
|
-
readonly className: "bpMessageListMarqueeAvatarImage";
|
|
1128
|
-
};
|
|
1129
|
-
readonly fallback: {
|
|
1130
|
-
readonly className: "bpMessageListMarqueeAvatarFallback";
|
|
1131
|
-
};
|
|
1132
|
-
};
|
|
1133
|
-
};
|
|
1134
|
-
readonly headerMessage: {
|
|
1135
|
-
readonly className: "bpMessageListHeaderMessage";
|
|
1136
|
-
};
|
|
1137
|
-
};
|
|
1138
|
-
readonly message: {
|
|
1139
|
-
readonly container: {
|
|
1140
|
-
readonly className: "bpReset bpMessageContainer";
|
|
1141
|
-
};
|
|
1142
|
-
readonly avatar: {
|
|
1143
|
-
readonly container: {
|
|
1144
|
-
readonly className: "bpReset bpMessageAvatarContainer";
|
|
1145
|
-
};
|
|
1146
|
-
readonly image: {
|
|
1147
|
-
readonly className: "bpMessageAvatarImage";
|
|
1148
|
-
};
|
|
1149
|
-
readonly fallback: {
|
|
1150
|
-
readonly className: "bpMessageAvatarFallback";
|
|
1151
|
-
};
|
|
1152
|
-
};
|
|
1153
|
-
readonly deliveryStatus: {
|
|
1154
|
-
readonly className: "bpMessageDeliveryStatus";
|
|
1155
|
-
};
|
|
1156
|
-
readonly deliveryStatusLabel: {
|
|
1157
|
-
readonly className: "bpMessageDeliveryStatusLabel";
|
|
1158
|
-
};
|
|
1159
|
-
readonly blocks: {
|
|
1160
|
-
readonly text: {
|
|
1161
|
-
readonly heading1: {
|
|
1162
|
-
readonly className: "bpMessageBlocksTextHeading1";
|
|
1163
|
-
};
|
|
1164
|
-
readonly heading2: {
|
|
1165
|
-
readonly className: "bpMessageBlocksTextHeading2";
|
|
1166
|
-
};
|
|
1167
|
-
readonly heading3: {
|
|
1168
|
-
readonly className: "bpMessageBlocksTextHeading3";
|
|
1169
|
-
};
|
|
1170
|
-
readonly heading4: {
|
|
1171
|
-
readonly className: "bpMessageBlocksTextHeading4";
|
|
1172
|
-
};
|
|
1173
|
-
readonly unorderedList: {
|
|
1174
|
-
readonly className: "bpMessageBlocksTextUnorderedList";
|
|
1175
|
-
};
|
|
1176
|
-
readonly orderedList: {
|
|
1177
|
-
readonly className: "bpMessageBlocksTextOrderedList";
|
|
1178
|
-
};
|
|
1179
|
-
readonly listItem: {
|
|
1180
|
-
readonly className: "bpMessageBlocksTextListItem";
|
|
1181
|
-
};
|
|
1182
|
-
readonly link: {
|
|
1183
|
-
readonly className: "bpMessageBlocksTextLink";
|
|
1184
|
-
};
|
|
1185
|
-
readonly italic: {
|
|
1186
|
-
readonly className: "bpMessageBlocksTextItalic";
|
|
1187
|
-
};
|
|
1188
|
-
readonly bold: {
|
|
1189
|
-
readonly className: "bpMessageBlocksTextBold";
|
|
1190
|
-
};
|
|
1191
|
-
readonly text: {
|
|
1192
|
-
readonly className: "bpMessageBlocksTextText";
|
|
1193
|
-
};
|
|
1194
|
-
readonly image: {
|
|
1195
|
-
readonly className: "bpMessageBlocksTextImage";
|
|
1196
|
-
};
|
|
1197
|
-
readonly imageError: {
|
|
1198
|
-
readonly className: "bpMessageBlocksTextImageError";
|
|
1199
|
-
};
|
|
1200
|
-
readonly horizontalRule: {
|
|
1201
|
-
readonly className: "bpMessageBlocksTextHorizontalRule";
|
|
1202
|
-
};
|
|
1203
|
-
readonly lineBreak: {
|
|
1204
|
-
readonly className: "bpMessageBlocksTextLineBreak";
|
|
1205
|
-
};
|
|
1206
|
-
readonly input: {
|
|
1207
|
-
readonly className: "bpMessageBlocksTextInput";
|
|
1208
|
-
};
|
|
1209
|
-
readonly codeBlockContainer: {
|
|
1210
|
-
readonly className: "bpMessageBlocksTextCodeBlockContainer";
|
|
1211
|
-
};
|
|
1212
|
-
readonly codeBlockTitle: {
|
|
1213
|
-
readonly className: "bpMessageBlocksTextCodeBlockTitle";
|
|
1214
|
-
};
|
|
1215
|
-
readonly codeBlockCopyIcon: {
|
|
1216
|
-
readonly className: "bpMessageBlocksTextCodeBlockCopyIcon";
|
|
1217
|
-
};
|
|
1218
|
-
readonly codeBlock: {
|
|
1219
|
-
readonly className: "bpMessageBlocksTextCodeBlock";
|
|
1220
|
-
};
|
|
1221
|
-
readonly code: {
|
|
1222
|
-
readonly className: "bpMessageBlocksTextCode";
|
|
1223
|
-
};
|
|
1224
|
-
readonly tableContainer: {
|
|
1225
|
-
readonly className: "bpMessageBlocksTextTableContainer";
|
|
1226
|
-
};
|
|
1227
|
-
readonly table: {
|
|
1228
|
-
readonly className: "bpMessageBlocksTextTable";
|
|
1229
|
-
};
|
|
1230
|
-
readonly tableHeader: {
|
|
1231
|
-
readonly className: "bpMessageBlocksTextTableHeader";
|
|
1232
|
-
};
|
|
1233
|
-
readonly tableData: {
|
|
1234
|
-
readonly className: "bpMessageBlocksTextTableData";
|
|
1235
|
-
};
|
|
1236
|
-
readonly tableRow: {
|
|
1237
|
-
readonly className: "bpMessageBlocksTextTableRow";
|
|
1238
|
-
};
|
|
1239
|
-
};
|
|
1240
|
-
readonly audio: {
|
|
1241
|
-
readonly className: "bpMessageBlocksAudio";
|
|
1242
|
-
};
|
|
1243
|
-
readonly image: {
|
|
1244
|
-
readonly image: {
|
|
1245
|
-
readonly className: "bpMessageBlocksImageImage";
|
|
1246
|
-
};
|
|
1247
|
-
readonly placeholder: {
|
|
1248
|
-
readonly className: "bpMessageBlocksImagePlaceholder";
|
|
1249
|
-
};
|
|
1250
|
-
readonly skeleton: {
|
|
1251
|
-
readonly className: "bpSkeleton";
|
|
1252
|
-
};
|
|
1253
|
-
};
|
|
1254
|
-
readonly video: {
|
|
1255
|
-
readonly className: "bpMessageBlocksVideo";
|
|
1256
|
-
};
|
|
1257
|
-
readonly location: {
|
|
1258
|
-
readonly container: {
|
|
1259
|
-
readonly className: "bpMessageBlocksLocationContainer";
|
|
1260
|
-
};
|
|
1261
|
-
readonly title: {
|
|
1262
|
-
readonly className: "bpMessageBlocksLocationTitle";
|
|
1263
|
-
};
|
|
1264
|
-
readonly icon: {
|
|
1265
|
-
readonly className: "bpMessageBlocksLocationIcon";
|
|
1266
|
-
};
|
|
1267
|
-
};
|
|
1268
|
-
readonly file: {
|
|
1269
|
-
readonly container: {
|
|
1270
|
-
readonly className: "bpMessageBlocksFileContainer";
|
|
1271
|
-
};
|
|
1272
|
-
readonly title: {
|
|
1273
|
-
readonly className: "bpMessageBlocksFileTitle";
|
|
1274
|
-
};
|
|
1275
|
-
readonly icon: {
|
|
1276
|
-
readonly className: "bpMessageBlocksFileIcon";
|
|
1277
|
-
};
|
|
1278
|
-
};
|
|
1279
|
-
readonly row: {
|
|
1280
|
-
readonly className: "bpMessageBlocksRow";
|
|
1281
|
-
};
|
|
1282
|
-
readonly column: {
|
|
1283
|
-
readonly className: "bpMessageBlocksColumn";
|
|
1284
|
-
};
|
|
1285
|
-
readonly bubble: {
|
|
1286
|
-
readonly container: {
|
|
1287
|
-
readonly className: "bpMessageBlocksBubble";
|
|
1288
|
-
};
|
|
1289
|
-
readonly feedbackContainer: {
|
|
1290
|
-
readonly className: "bpMessageBlocksBubbleFeedbackContainer";
|
|
1291
|
-
};
|
|
1292
|
-
readonly feedbackIcon: {
|
|
1293
|
-
readonly className: "bpMessageBlocksBubbleFeedbackIcon";
|
|
1294
|
-
};
|
|
1295
|
-
};
|
|
1296
|
-
readonly carousel: {
|
|
1297
|
-
readonly container: {
|
|
1298
|
-
readonly className: "bpMessageBlocksCarouselContainer";
|
|
1299
|
-
};
|
|
1300
|
-
readonly slidesContainer: {
|
|
1301
|
-
readonly className: "bpMessageBlocksCarouselSlidesContainer";
|
|
1302
|
-
};
|
|
1303
|
-
readonly backButton: {
|
|
1304
|
-
readonly className: "bpMessageBlocksCarouselBackButton";
|
|
1305
|
-
};
|
|
1306
|
-
readonly nextButton: {
|
|
1307
|
-
readonly className: "bpMessageBlocksCarouselNextButton";
|
|
1308
|
-
};
|
|
1309
|
-
};
|
|
1310
|
-
readonly dropdown: {
|
|
1311
|
-
readonly button: {
|
|
1312
|
-
readonly container: {
|
|
1313
|
-
readonly className: "bpMessageBlocksDropdownButtonContainer";
|
|
1314
|
-
};
|
|
1315
|
-
readonly text: {
|
|
1316
|
-
readonly className: "bpMessageBlocksDropdownButtonText";
|
|
1317
|
-
};
|
|
1318
|
-
readonly icon: {
|
|
1319
|
-
readonly className: "bpMessageBlocksDropdownButtonIcon";
|
|
1320
|
-
};
|
|
1321
|
-
};
|
|
1322
|
-
readonly content: {
|
|
1323
|
-
readonly container: {
|
|
1324
|
-
readonly className: "bpMessageBlocksDropdownContentContainer";
|
|
1325
|
-
};
|
|
1326
|
-
readonly item: {
|
|
1327
|
-
readonly className: "bpMessageBlocksDropdownContentItem";
|
|
1328
|
-
};
|
|
1329
|
-
};
|
|
1330
|
-
};
|
|
1331
|
-
readonly button: {
|
|
1332
|
-
readonly className: "bpMessageBlocksButton";
|
|
1333
|
-
};
|
|
1334
|
-
};
|
|
1335
|
-
};
|
|
1336
|
-
readonly error: {
|
|
1337
|
-
readonly container: {
|
|
1338
|
-
readonly className: "bpReset bpErrorContainer";
|
|
1339
|
-
};
|
|
1340
|
-
readonly id: {
|
|
1341
|
-
readonly className: "bpErrorId";
|
|
1342
|
-
};
|
|
1343
|
-
readonly header: {
|
|
1344
|
-
readonly container: {
|
|
1345
|
-
readonly className: "bpErrorHeader";
|
|
1346
|
-
};
|
|
1347
|
-
readonly actions: {
|
|
1348
|
-
readonly className: "bpErrorHeaderActions";
|
|
1349
|
-
};
|
|
1350
|
-
};
|
|
1351
|
-
readonly content: {
|
|
1352
|
-
readonly className: "bpErrorContent";
|
|
1353
|
-
};
|
|
1354
|
-
readonly errorTitle: {
|
|
1355
|
-
readonly className: "bpErrorTitle";
|
|
1356
|
-
};
|
|
1357
|
-
readonly errorMessage: {
|
|
1358
|
-
readonly className: "bpErrorMessage";
|
|
1359
|
-
};
|
|
1360
|
-
readonly icon: {
|
|
1361
|
-
readonly className: "bpErrorIcon";
|
|
1362
|
-
};
|
|
1363
|
-
};
|
|
1364
|
-
readonly typingIndicator: {
|
|
1365
|
-
readonly container: {
|
|
1366
|
-
readonly className: "bpTypingIndicatorContainer";
|
|
1367
|
-
};
|
|
1368
|
-
readonly loader: {
|
|
1369
|
-
readonly className: "bpTypingIndicatorLoader";
|
|
1370
|
-
};
|
|
1371
|
-
};
|
|
1372
|
-
readonly proactiveBubble: {
|
|
1373
|
-
readonly container: {
|
|
1374
|
-
readonly className: "bpProactiveBubbleContainer";
|
|
1375
|
-
};
|
|
1376
|
-
readonly content: {
|
|
1377
|
-
readonly className: "bpProactiveBubbleContent";
|
|
1378
|
-
};
|
|
1379
|
-
readonly layout: {
|
|
1380
|
-
readonly className: "bpProactiveBubbleLayout";
|
|
1381
|
-
};
|
|
1382
|
-
readonly icon: {
|
|
1383
|
-
readonly className: "bpProactiveBubbleIcon";
|
|
1384
|
-
};
|
|
1385
|
-
readonly message: {
|
|
1386
|
-
readonly className: "bpProactiveBubbleMessage";
|
|
1387
|
-
};
|
|
1388
|
-
readonly closeButton: {
|
|
1389
|
-
readonly className: "bpProactiveBubbleCloseButton";
|
|
1390
|
-
};
|
|
1391
|
-
readonly arrow: {
|
|
1392
|
-
readonly className: "bpProactiveBubbleArrow";
|
|
1393
|
-
};
|
|
1394
|
-
};
|
|
1395
|
-
readonly conversationHistory: {
|
|
1396
|
-
readonly container: {
|
|
1397
|
-
readonly className: "bpReset bpConversationHistoryContainer bpFont";
|
|
1398
|
-
};
|
|
1399
|
-
readonly header: {
|
|
1400
|
-
readonly className: "bpConversationHistoryHeader";
|
|
1401
|
-
};
|
|
1402
|
-
readonly closeButton: {
|
|
1403
|
-
readonly className: "bpConversationHistoryCloseButton";
|
|
1404
|
-
};
|
|
1405
|
-
readonly scrollContainer: {
|
|
1406
|
-
readonly className: "bpConversationHistoryScrollContainer";
|
|
1407
|
-
};
|
|
1408
|
-
readonly loaderContainer: {
|
|
1409
|
-
readonly className: "bpConversationHistoryLoaderContainer";
|
|
1410
|
-
};
|
|
1411
|
-
readonly conversation: {
|
|
1412
|
-
readonly container: {
|
|
1413
|
-
readonly className: "bpConversationHistoryConversationContainer";
|
|
1414
|
-
};
|
|
1415
|
-
readonly chevron: {
|
|
1416
|
-
readonly className: "bpConversationHistoryConversationChevron";
|
|
1417
|
-
};
|
|
1418
|
-
readonly userAvatar: {
|
|
1419
|
-
readonly className: {
|
|
1420
|
-
readonly className: "bpConversationHistoryConversationUserAvatarFallback";
|
|
1421
|
-
};
|
|
1422
|
-
};
|
|
1423
|
-
readonly avatar: {
|
|
1424
|
-
readonly container: {
|
|
1425
|
-
readonly className: "bpReset bpConversationHistoryConversationAvatarContainer";
|
|
1426
|
-
};
|
|
1427
|
-
readonly image: {
|
|
1428
|
-
readonly className: "bpConversationHistoryConversationAvatarImage";
|
|
1429
|
-
};
|
|
1430
|
-
readonly fallback: {
|
|
1431
|
-
readonly className: "bpConversationHistoryConversationAvatarFallback";
|
|
1432
|
-
};
|
|
1433
|
-
};
|
|
1434
|
-
readonly content: {
|
|
1435
|
-
readonly className: "bpConversationHistoryConversationContent";
|
|
1436
|
-
};
|
|
1437
|
-
readonly name: {
|
|
1438
|
-
readonly className: "bpConversationHistoryConversationName";
|
|
1439
|
-
};
|
|
1440
|
-
readonly timestamp: {
|
|
1441
|
-
readonly className: "bpConversationHistoryConversationTimestamp";
|
|
1442
|
-
};
|
|
1443
|
-
};
|
|
1444
|
-
readonly newConversation: {
|
|
1445
|
-
readonly button: {
|
|
1446
|
-
readonly className: "bpConversationHistoryNewConversationButton";
|
|
1447
|
-
};
|
|
1448
|
-
readonly icon: {
|
|
1449
|
-
readonly className: "bpConversationHistoryNewConversationButtonIcon";
|
|
1450
|
-
};
|
|
1451
|
-
};
|
|
1452
|
-
};
|
|
1453
|
-
};
|
|
1225
|
+
export declare const Webchat: ({ clientId, storageKey, configuration, apiUrl, user: userCredentials, conversationId, ...props }: Props_5) => JSX.Element;
|
|
1454
1226
|
|
|
1455
1227
|
declare type WebchatClientActions = {
|
|
1456
1228
|
setUser: (userId?: UserCredentials) => void;
|
|
@@ -1480,6 +1252,9 @@ export declare type WebchatContextValue = {
|
|
|
1480
1252
|
isTyping: boolean;
|
|
1481
1253
|
isAwaitingResponse: boolean;
|
|
1482
1254
|
setAwaitingResponse: (state: boolean, timeout?: number) => void;
|
|
1255
|
+
upsertMessageStream: (input: MessageStreamDelta) => void;
|
|
1256
|
+
completeMessageStream: (input: MessageStreamComplete) => void;
|
|
1257
|
+
abortMessageStream: (input: MessageStreamAbort) => void;
|
|
1483
1258
|
emitter: ReturnType<typeof createEventEmitter<Events>>;
|
|
1484
1259
|
};
|
|
1485
1260
|
|
|
@@ -1502,6 +1277,7 @@ export declare type WebchatError = ({
|
|
|
1502
1277
|
export declare type WebchatEvents = {
|
|
1503
1278
|
conversation: string | undefined;
|
|
1504
1279
|
message: BlockMessage;
|
|
1280
|
+
messageUpdated: BlockMessage;
|
|
1505
1281
|
messageSent: IntegrationMessage['payload'];
|
|
1506
1282
|
error: Error;
|
|
1507
1283
|
webchatVisibility: 'show' | 'hide' | 'toggle';
|
|
@@ -1515,7 +1291,7 @@ export declare type WebchatEvents = {
|
|
|
1515
1291
|
participantRemoved: string;
|
|
1516
1292
|
};
|
|
1517
1293
|
|
|
1518
|
-
export declare function WebchatProvider({ clientId, apiUrl, storageKey, storageLocation, adminSecret, clientHeaders, children, ...props }: WebchatProviderProps):
|
|
1294
|
+
export declare function WebchatProvider({ clientId, apiUrl, storageKey, storageLocation, adminSecret, clientHeaders, children, ...props }: WebchatProviderProps): JSX.Element;
|
|
1519
1295
|
|
|
1520
1296
|
declare type WebchatProviderProps = {
|
|
1521
1297
|
clientId: string;
|
|
@@ -1526,7 +1302,7 @@ declare type WebchatProviderProps = {
|
|
|
1526
1302
|
storageKey?: string;
|
|
1527
1303
|
storageLocation?: StorageLocation;
|
|
1528
1304
|
clientHeaders?: Record<string, string>;
|
|
1529
|
-
children:
|
|
1305
|
+
children: ReactNode;
|
|
1530
1306
|
};
|
|
1531
1307
|
|
|
1532
1308
|
declare type WebchatStore = {
|
|
@@ -1545,4 +1321,11 @@ export declare const webhookHandlerErrorMap: {
|
|
|
1545
1321
|
[key in 'ResourceNotFound' | 'Forbidden']: WebchatError;
|
|
1546
1322
|
};
|
|
1547
1323
|
|
|
1324
|
+
export declare const WelcomeHero: ({ heading, subtitle }: WelcomeHeroProps) => JSX.Element;
|
|
1325
|
+
|
|
1326
|
+
declare type WelcomeHeroProps = {
|
|
1327
|
+
heading: string;
|
|
1328
|
+
subtitle?: string;
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1548
1331
|
export { }
|