@botpress/webchat 3.2.2 → 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.2 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.36 kB │ gzip: 8.71 kB
13
- dist/index.js 772.87 kB │ gzip: 212.53 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 23216ms.
17
+ [vite:dts] Declaration files built in 20058ms.
18
18
 
19
- dist/style.css  47.36 kB │ gzip: 8.71 kB
20
- dist/index.umd.cjs 517.24 kB │ gzip: 173.70 kB
21
- ✓ built in 31.52s
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, storageKey, ...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';
@@ -254,7 +254,7 @@ export declare const getUseWebchatClientStore: typeof WebchatClientStores.getIns
254
254
 
255
255
  export declare const handleIntegrationError: (thrown: unknown) => WebchatError;
256
256
 
257
- 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;
258
258
 
259
259
  declare type HeaderProps = {
260
260
  defaultOpen?: boolean;
@@ -263,6 +263,7 @@ declare type HeaderProps = {
263
263
  onOpenChange?(open: boolean): void;
264
264
  restartConversation?: () => void;
265
265
  closeWindow?: () => void;
266
+ triggerNetworkError?: (errorType?: 'network' | 'timeout' | 'server', delay?: number) => Promise<never>;
266
267
  configuration: Pick<Configuration, 'email' | 'phone' | 'privacyPolicy' | 'website' | 'termsOfService' | 'botAvatar' | 'botDescription' | 'botName'>;
267
268
  };
268
269
 
@@ -318,6 +319,7 @@ export declare const Message: MemoExoticComponent<ForwardRefExoticComponent<{
318
319
  addMessageFeedback?: (messageId: string, feedback: Feedback) => void;
319
320
  isReadOnly?: boolean;
320
321
  isLastDeliveredMessage?: boolean;
322
+ showAvatar?: boolean;
321
323
  } & BlockMessage<GenericBlock> & {
322
324
  direction: "incoming" | "outgoing" | "system";
323
325
  sender: {
@@ -326,7 +328,7 @@ export declare const Message: MemoExoticComponent<ForwardRefExoticComponent<{
326
328
  };
327
329
  } & RefAttributes<HTMLDivElement>>>;
328
330
 
329
- 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>;
330
332
 
331
333
  declare type MessageListProps = {
332
334
  messages?: RichBlockMessage[];
@@ -339,6 +341,10 @@ declare type MessageListProps = {
339
341
  sendMessage?: (payload: IntegrationMessage['payload']) => void;
340
342
  addMessageFeedback?: (messageId: string, feedback: Feedback) => void;
341
343
  showMarquee?: boolean;
344
+ showDateSystemMessage?: boolean;
345
+ showMessageStatus?: boolean;
346
+ showIncomingMessageAvatar?: boolean;
347
+ showOutgoingMessageAvatar?: boolean;
342
348
  };
343
349
 
344
350
  export declare const MISSING_API_URL = "The API url is required to initialize the webchat.";
@@ -414,6 +420,7 @@ export declare type Props = {
414
420
  type: FileType;
415
421
  }>;
416
422
  addMessageFeedback?: (messageId: string, feedback: Feedback) => void;
423
+ triggerNetworkError?: (errorType?: 'network' | 'timeout' | 'server', delay?: number) => Promise<never>;
417
424
  error?: WebchatError;
418
425
  storageKey?: string;
419
426
  };
@@ -510,6 +517,12 @@ declare type ScopedClient = {
510
517
  addMessageFeedback: (messageId: string, feedback: Feedback) => Promise<void>;
511
518
  getUser: () => Promise<UserResponse>;
512
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>;
513
526
  };
514
527
 
515
528
  export declare const SSE_DISCONNECTED_ERROR = "You've been disconnected from the conversation.\nPlease refresh the page.";
@@ -525,7 +538,7 @@ export declare type StyleOptions = {
525
538
  * StylesheetProvider component that manages theme styles and font loading
526
539
  * Handles both default fonts and custom Google Fonts
527
540
  */
528
- 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;
529
542
 
530
543
  export declare type TextBlock = {
531
544
  type: 'text';
@@ -1035,7 +1048,12 @@ export declare const webchatClasses: {
1035
1048
  readonly className: "bpErrorId";
1036
1049
  };
1037
1050
  readonly header: {
1038
- readonly className: "bpErrorHeader";
1051
+ readonly container: {
1052
+ readonly className: "bpErrorHeader";
1053
+ };
1054
+ readonly actions: {
1055
+ readonly className: "bpErrorHeaderActions";
1056
+ };
1039
1057
  };
1040
1058
  readonly content: {
1041
1059
  readonly className: "bpErrorContent";