@botpress/webchat 3.2.0 → 3.2.4

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @botpress/webchat@3.2.0 build /home/runner/work/genisys/genisys/packages/webchat-components
2
+ > @botpress/webchat@3.2.4 build /home/runner/work/genisys/genisys/packages/webchat-components
3
3
  > vite build
4
4
 
5
5
  vite v5.4.8 building for production...
@@ -9,13 +9,13 @@ rendering chunks...
9
9
 
10
10
  [vite:dts] Start generate declaration files...
11
11
  computing gzip size...
12
- dist/style.css  47.29 kB │ gzip: 8.69 kB
13
- dist/index.js 771.34 kB │ gzip: 212.14 kB
12
+ dist/style.css  47.53 kB │ gzip: 8.72 kB
13
+ dist/index.js 776.04 kB │ gzip: 213.46 kB
14
14
  [vite:dts] Start rollup declaration files...
15
15
  Analysis will use the bundled TypeScript version 5.4.2
16
16
  *** The target project appears to use TypeScript 5.6.2 which is newer than the bundled compiler engine; consider upgrading API Extractor.
17
- [vite:dts] Declaration files built in 21868ms.
17
+ [vite:dts] Declaration files built in 20058ms.
18
18
 
19
- dist/style.css  47.29 kB │ gzip: 8.69 kB
20
- dist/index.umd.cjs 516.29 kB │ gzip: 173.38 kB
21
- ✓ built in 29.78s
19
+ dist/style.css  47.53 kB │ gzip: 8.72 kB
20
+ dist/index.umd.cjs 519.33 kB │ gzip: 174.43 kB
21
+ ✓ built in 26.42s
package/dist/index.d.ts CHANGED
@@ -128,7 +128,7 @@ export declare type CarouselBlock = {
128
128
  blocks: GenericBlock[];
129
129
  };
130
130
 
131
- export declare const Chat: ({ connected, configuration, isTyping, messages, user, isLoading, renderers, isReadOnly, disableComposer, allowFileUpload, error, participants, closeWindow, sendMessage, uploadFile, addMessageFeedback, restartConversation, ...props }: Props) => JSX_3.Element;
131
+ export declare const Chat: ({ connected, configuration, isTyping, messages, user, isLoading, renderers, isReadOnly, disableComposer, allowFileUpload, error, participants, closeWindow, sendMessage, uploadFile, addMessageFeedback, triggerNetworkError, restartConversation, storageKey, ...props }: Props) => JSX_3.Element;
132
132
 
133
133
  export declare type ColumnBlock = {
134
134
  type: 'column';
@@ -165,7 +165,7 @@ export declare const CONFIG_ACCESS_DENIED = "Access denied to configuration file
165
165
  export { Configuration }
166
166
 
167
167
  export declare const Container: {
168
- ({ children, className, connected, uploadFile, allowFileUpload, ...props }: Props_4): JSX_3.Element;
168
+ ({ children, className, connected, uploadFile, allowFileUpload, storageKey, ...props }: Props_4): JSX_3.Element;
169
169
  displayName: string;
170
170
  };
171
171
 
@@ -211,9 +211,10 @@ export declare function enrichMessage(messages: BlockMessage[], participants: Us
211
211
  declare type ErrorProps = {
212
212
  error: WebchatError;
213
213
  restartConversation?: () => void;
214
+ closeWindow?: () => void;
214
215
  };
215
216
 
216
- export declare function ErrorState({ error, restartConversation }: ErrorProps): JSX_3.Element;
217
+ export declare function ErrorState({ error, restartConversation, closeWindow }: ErrorProps): JSX_3.Element;
217
218
 
218
219
  declare type EventError = Error & {
219
220
  type: 'error';
@@ -243,6 +244,8 @@ export declare type FileType = (typeof fileTypes)[number];
243
244
 
244
245
  export declare const fileTypes: readonly ["audio", "file", "image", "video"];
245
246
 
247
+ export declare function generateThemeOverride(theme: LatestWebchatTheme): Record<string, string>;
248
+
246
249
  export declare function generateThemeStylesheet(theme: LatestWebchatTheme): string;
247
250
 
248
251
  export declare type GenericBlock = AudioBlock | BubbleBlock | ButtonBlock | CarouselBlock | ColumnBlock | DropdownBlock | FileBlock | ImageBlock | LocationBlock | RowBlock | TextBlock | VideoBlock | CustomBlock;
@@ -251,7 +254,7 @@ export declare const getUseWebchatClientStore: typeof WebchatClientStores.getIns
251
254
 
252
255
  export declare const handleIntegrationError: (thrown: unknown) => WebchatError;
253
256
 
254
- export declare const Header: ({ defaultOpen, closeWindow, configuration, restartConversation, disabled, ...props }: HeaderProps) => JSX_3.Element;
257
+ export declare const Header: ({ defaultOpen, closeWindow, configuration, restartConversation, triggerNetworkError, disabled, ...props }: HeaderProps) => JSX_3.Element;
255
258
 
256
259
  declare type HeaderProps = {
257
260
  defaultOpen?: boolean;
@@ -260,6 +263,7 @@ declare type HeaderProps = {
260
263
  onOpenChange?(open: boolean): void;
261
264
  restartConversation?: () => void;
262
265
  closeWindow?: () => void;
266
+ triggerNetworkError?: (errorType?: 'network' | 'timeout' | 'server', delay?: number) => Promise<never>;
263
267
  configuration: Pick<Configuration, 'email' | 'phone' | 'privacyPolicy' | 'website' | 'termsOfService' | 'botAvatar' | 'botDescription' | 'botName'>;
264
268
  };
265
269
 
@@ -315,6 +319,7 @@ export declare const Message: MemoExoticComponent<ForwardRefExoticComponent<{
315
319
  addMessageFeedback?: (messageId: string, feedback: Feedback) => void;
316
320
  isReadOnly?: boolean;
317
321
  isLastDeliveredMessage?: boolean;
322
+ showAvatar?: boolean;
318
323
  } & BlockMessage<GenericBlock> & {
319
324
  direction: "incoming" | "outgoing" | "system";
320
325
  sender: {
@@ -323,7 +328,7 @@ export declare const Message: MemoExoticComponent<ForwardRefExoticComponent<{
323
328
  };
324
329
  } & RefAttributes<HTMLDivElement>>>;
325
330
 
326
- export declare const MessageList: MemoExoticComponent<({ className, messages, isTyping, headerMessage, renderers, botAvatar, botDescription, botName, sendMessage, addMessageFeedback, showMarquee, ...props }: ComponentProps<"ul"> & MessageListProps) => JSX_3.Element>;
331
+ export declare const MessageList: MemoExoticComponent<({ className, messages, isTyping, headerMessage, renderers, botAvatar, botDescription, botName, sendMessage, addMessageFeedback, showMarquee, showDateSystemMessage, showMessageStatus, showIncomingMessageAvatar, showOutgoingMessageAvatar, ...props }: ComponentProps<"ul"> & MessageListProps) => JSX_3.Element>;
327
332
 
328
333
  declare type MessageListProps = {
329
334
  messages?: RichBlockMessage[];
@@ -336,6 +341,10 @@ declare type MessageListProps = {
336
341
  sendMessage?: (payload: IntegrationMessage['payload']) => void;
337
342
  addMessageFeedback?: (messageId: string, feedback: Feedback) => void;
338
343
  showMarquee?: boolean;
344
+ showDateSystemMessage?: boolean;
345
+ showMessageStatus?: boolean;
346
+ showIncomingMessageAvatar?: boolean;
347
+ showOutgoingMessageAvatar?: boolean;
339
348
  };
340
349
 
341
350
  export declare const MISSING_API_URL = "The API url is required to initialize the webchat.";
@@ -411,10 +420,13 @@ export declare type Props = {
411
420
  type: FileType;
412
421
  }>;
413
422
  addMessageFeedback?: (messageId: string, feedback: Feedback) => void;
423
+ triggerNetworkError?: (errorType?: 'network' | 'timeout' | 'server', delay?: number) => Promise<never>;
414
424
  error?: WebchatError;
425
+ storageKey?: string;
415
426
  };
416
427
 
417
428
  declare type Props_2 = {
429
+ adminKey?: string;
418
430
  user?: UserCredentials;
419
431
  conversationId?: string;
420
432
  clientId: string;
@@ -436,6 +448,7 @@ declare type Props_3 = ComponentProps<'div'> & {
436
448
  name: string;
437
449
  type: FileType;
438
450
  }>;
451
+ storageKey?: string;
439
452
  } & Pick<Configuration, 'composerPlaceholder' | 'footer'>;
440
453
 
441
454
  declare type Props_4 = ComponentProps<'div'> & {
@@ -446,6 +459,7 @@ declare type Props_4 = ComponentProps<'div'> & {
446
459
  type: FileType;
447
460
  }>;
448
461
  allowFileUpload?: boolean;
462
+ storageKey?: string;
449
463
  };
450
464
 
451
465
  declare type Props_5 = {
@@ -503,6 +517,12 @@ declare type ScopedClient = {
503
517
  addMessageFeedback: (messageId: string, feedback: Feedback) => Promise<void>;
504
518
  getUser: () => Promise<UserResponse>;
505
519
  updateUser: (user: UserProfile) => Promise<User>;
520
+ /**
521
+ * Development-only method to trigger network errors for testing purposes
522
+ * @param errorType - Type of error to simulate ('network', 'timeout', 'server')
523
+ * @param delay - Optional delay in milliseconds before throwing the error
524
+ */
525
+ triggerNetworkError: (errorType?: 'network' | 'timeout' | 'server', delay?: number) => Promise<never>;
506
526
  };
507
527
 
508
528
  export declare const SSE_DISCONNECTED_ERROR = "You've been disconnected from the conversation.\nPlease refresh the page.";
@@ -518,7 +538,7 @@ export declare type StyleOptions = {
518
538
  * StylesheetProvider component that manages theme styles and font loading
519
539
  * Handles both default fonts and custom Google Fonts
520
540
  */
521
- export declare const StylesheetProvider: ({ color, fontFamily, radius, themeMode, variant, headerVariant }: Props_7) => JSX_3.Element;
541
+ export declare const StylesheetProvider: ({ color, fontFamily, radius, themeMode, variant, headerVariant, additionalStylesheetUrl, }: Props_7) => JSX_3.Element;
522
542
 
523
543
  export declare type TextBlock = {
524
544
  type: 'text';
@@ -543,7 +563,7 @@ declare type UserProfile = Omit<User, 'id' | 'createdAt' | 'updatedAt'>;
543
563
 
544
564
  declare type UserResponse = Awaited<ReturnType<Client['getUser']>>['user'];
545
565
 
546
- export declare function useWebchat({ apiUrl, clientId, storageKey, storageLocation, ...props }: Props_2): UseWebchatReturn;
566
+ export declare function useWebchat({ apiUrl, clientId, storageKey, storageLocation, adminKey, ...props }: Props_2): UseWebchatReturn;
547
567
 
548
568
  declare type UseWebchatReturn = {
549
569
  clientState: 'connected' | 'disconnected' | 'error';
@@ -1028,7 +1048,12 @@ export declare const webchatClasses: {
1028
1048
  readonly className: "bpErrorId";
1029
1049
  };
1030
1050
  readonly header: {
1031
- readonly className: "bpErrorHeader";
1051
+ readonly container: {
1052
+ readonly className: "bpErrorHeader";
1053
+ };
1054
+ readonly actions: {
1055
+ readonly className: "bpErrorHeaderActions";
1056
+ };
1032
1057
  };
1033
1058
  readonly content: {
1034
1059
  readonly className: "bpErrorContent";