@botpress/webchat 4.4.9 → 4.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.
@@ -1,21 +1,21 @@
1
1
 
2
- > @botpress/webchat@4.4.9 build /home/runner/work/genisys/genisys/packages/webchat-components
2
+ > @botpress/webchat@4.5.1 build /home/runner/work/genisys/genisys/packages/webchat-components
3
3
  > vite build
4
4
 
5
5
  vite v5.4.8 building for production...
6
6
  transforming...
7
- ✓ 2410 modules transformed.
7
+ ✓ 2420 modules transformed.
8
8
  rendering chunks...
9
9
 
10
10
  [vite:dts] Start generate declaration files...
11
11
  computing gzip size...
12
- dist/style.css  56.94 kB │ gzip: 9.46 kB
13
- dist/index.js 871.74 kB │ gzip: 229.92 kB
12
+ dist/style.css  56.97 kB │ gzip: 9.47 kB
13
+ dist/index.js 890.92 kB │ gzip: 235.63 kB
14
14
  [vite:dts] Start rollup declaration files...
15
15
  Analysis will use the bundled TypeScript version 5.8.2
16
16
  *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
17
- [vite:dts] Declaration files built in 21305ms.
17
+ [vite:dts] Declaration files built in 20212ms.
18
18
 
19
- dist/style.css  56.94 kB │ gzip: 9.46 kB
20
- dist/index.umd.cjs 534.39 kB │ gzip: 174.95 kB
21
- ✓ built in 26.79s
19
+ dist/style.css  56.97 kB │ gzip: 9.47 kB
20
+ dist/index.umd.cjs 551.64 kB │ gzip: 180.55 kB
21
+ ✓ built in 25.58s
package/dist/index.d.ts CHANGED
@@ -25,6 +25,7 @@ import { MemoExoticComponent } from '../../../node_modules/@types/react';
25
25
  import { Message as Message_2 } from '@botpress/webchat-client';
26
26
  import { NamedExoticComponent } from '../../../node_modules/@types/react';
27
27
  import { PersistOptions } from 'zustand/middleware';
28
+ import { Provider } from '../../node_modules/@types/react';
28
29
  import { ReactNode } from '../../../node_modules/@types/react';
29
30
  import { ReactNode as ReactNode_2 } from '../../node_modules/@types/react';
30
31
  import { Ref } from '../../../node_modules/@types/react';
@@ -46,6 +47,8 @@ declare type AnyEvent = ValueOf<{
46
47
  };
47
48
  }>;
48
49
 
50
+ export declare const ar: WebchatTranslations;
51
+
49
52
  export declare type AudioBlock = {
50
53
  type: 'audio';
51
54
  url: string;
@@ -142,7 +145,7 @@ export declare type CarouselBlock = {
142
145
  blocks: GenericBlock[];
143
146
  };
144
147
 
145
- export declare const Chat: ({ connected, configuration, isTyping, messages, user, isLoading, renderers, isReadOnly, disableComposer, error, participants, closeWindow, sendMessage, uploadFile, addMessageFeedback, listConversations, restartConversation, clientId, storageKey, soundOn, toggleSound, disableSendButton, conversationId, ...props }: Props) => JSX_2.Element;
148
+ export declare const Chat: ({ connected, configuration, isTyping, messages, user, isLoading, renderers, isReadOnly, disableComposer, error, participants, closeWindow, sendMessage, uploadFile, addMessageFeedback, listConversations, restartConversation, clientId, storageKey, soundOn, toggleSound, disableSendButton, conversationId, locale, ...props }: Props) => JSX_2.Element;
146
149
 
147
150
  declare type ChatSoundStore = {
148
151
  soundOn: boolean;
@@ -268,6 +271,50 @@ export declare type CustomBlock = {
268
271
  name: string;
269
272
  };
270
273
 
274
+ export declare const de: WebchatTranslations;
275
+
276
+ export declare const defaultTranslations: {
277
+ readonly 'composer.placeholder': "Type your message...";
278
+ readonly 'composer.sendButton.ariaLabel': "Send Message Button";
279
+ readonly 'composer.voiceButton.ariaLabel': "Voice Input Button";
280
+ readonly 'composer.fileButton.ariaLabel': "Upload File Button";
281
+ readonly 'composer.messageInput.ariaLabel': "Message Input";
282
+ readonly 'fileAttachment.uploadError': "Upload Error";
283
+ readonly 'fileAttachment.fallbackExtension': "File";
284
+ readonly 'fileAttachment.removeButton.ariaLabel': "Remove File Button";
285
+ readonly 'header.defaultBotName': "Bot";
286
+ readonly 'header.expandButton.ariaLabel': "Expand Header Button";
287
+ readonly 'header.sound.enable': "Enable chat sounds";
288
+ readonly 'header.sound.disable': "Disable chat sounds";
289
+ readonly 'conversationHistory.title': "Conversations";
290
+ readonly 'conversationHistory.empty': "No conversation started yet";
291
+ readonly 'conversationHistory.newConversation': "New conversation";
292
+ readonly 'conversationHistory.sentAttachment': "Sent an attachment";
293
+ readonly 'conversationHistory.showButton.ariaLabel': "Show Recent Conversations Button";
294
+ readonly 'restartConversation.title': "Create New Conversation";
295
+ readonly 'restartConversation.description': "This will clear the current conversation and start a new one.";
296
+ readonly 'restartConversation.confirm': "New conversation";
297
+ readonly 'restartConversation.cancel': "Cancel";
298
+ readonly 'restartConversation.button.ariaLabel': "Restart Conversation Button";
299
+ readonly 'closeButton.ariaLabel': "Close Chatbot Button";
300
+ readonly 'feedback.title': "Help us improve";
301
+ readonly 'feedback.description': "Please provide feedback to help us improve.";
302
+ readonly 'feedback.confirm': "Send feedback";
303
+ readonly 'feedback.cancel': "Cancel";
304
+ readonly 'feedback.placeholder': "Let us know what went wrong...";
305
+ readonly 'error.configuration': "Configuration error";
306
+ readonly 'error.bot': "Bot error";
307
+ readonly 'error.network': "Network error";
308
+ readonly 'error.disconnected': "Disconnected";
309
+ readonly 'error.unexpected': "Unexpected error";
310
+ readonly 'dropdown.placeholder': "Select...";
311
+ readonly 'message.status.delivered': "Delivered";
312
+ readonly 'date.today': "Today";
313
+ readonly 'date.yesterday': "Yesterday";
314
+ };
315
+
316
+ export declare function detectLocale(language?: string): WebchatTranslations;
317
+
271
318
  export declare type Dimensions = {
272
319
  width: number;
273
320
  height: number;
@@ -293,6 +340,8 @@ declare type ErrorProps = {
293
340
 
294
341
  export declare function ErrorState({ error, restartConversation, closeWindow }: ErrorProps): JSX_2.Element;
295
342
 
343
+ export declare const es: WebchatTranslations;
344
+
296
345
  declare type EventError = Error & {
297
346
  type: 'error';
298
347
  };
@@ -321,6 +370,8 @@ export declare type FileType = (typeof fileTypes)[number];
321
370
 
322
371
  export declare const fileTypes: readonly ["audio", "file", "image", "video"];
323
372
 
373
+ export declare const fr: WebchatTranslations;
374
+
324
375
  export declare function generateThemeOverride(theme: LatestWebchatTheme): Record<string, string>;
325
376
 
326
377
  export declare function generateThemeStylesheet(theme: LatestWebchatTheme): string;
@@ -399,6 +450,12 @@ export declare function isIntegrationError(thrown: unknown): thrown is Integrati
399
450
 
400
451
  export declare function isWebhookHandlerErrorType(type: string): type is keyof typeof webhookHandlerErrorMap;
401
452
 
453
+ export declare const it: WebchatTranslations;
454
+
455
+ export declare const ja: WebchatTranslations;
456
+
457
+ export declare const ko: WebchatTranslations;
458
+
402
459
  export declare type LocationBlock = {
403
460
  type: 'location';
404
461
  latitude: number;
@@ -530,6 +587,7 @@ export declare type Props = {
530
587
  storageKey?: string;
531
588
  disableSendButton?: boolean;
532
589
  conversationId?: string;
590
+ locale?: Partial<WebchatTranslations>;
533
591
  };
534
592
 
535
593
  declare type Props_2 = {
@@ -582,10 +640,13 @@ declare type Props_6 = {
582
640
  /** @deprecated This prop is no longer used, pass the allowFileUpload via the configuration object */
583
641
  allowFileUpload?: boolean;
584
642
  renderers?: Partial<Renderers>;
643
+ locale?: Partial<WebchatTranslations>;
585
644
  } & ComponentProps_2<'div'>;
586
645
 
587
646
  declare type Props_7 = Partial<LatestWebchatTheme>;
588
647
 
648
+ export declare const pt: WebchatTranslations;
649
+
589
650
  export declare const QUOTA_EXCEEDED = "This bot has temporarily paused.\nPlease check back later.";
590
651
 
591
652
  export declare type Renderers = {
@@ -671,6 +732,8 @@ declare type ToPayloadType<T extends IntegrationMessageTypes> = {
671
732
 
672
733
  declare let _trackFn: ((event: string, properties?: Record<string, unknown>) => void) | null;
673
734
 
735
+ export declare const TranslationProvider: Provider<WebchatTranslations>;
736
+
674
737
  export declare const TypingIndicator: MemoExoticComponent<({ ...props }: ComponentProps<"div">) => JSX_2.Element>;
675
738
 
676
739
  export declare function useActiveConversation(): UseActiveConversationReturn;
@@ -735,6 +798,8 @@ export declare type UserProfile = Omit<User, 'id' | 'createdAt' | 'updatedAt'>;
735
798
 
736
799
  export declare type UserResponse = Awaited<ReturnType<Client['getUser']>>['user'];
737
800
 
801
+ export declare function useTranslations(): WebchatTranslations;
802
+
738
803
  export declare const useUser: () => UseUserReturn;
739
804
 
740
805
  declare type UseUserReturn = {
@@ -1086,6 +1151,9 @@ export declare const webchatClasses: {
1086
1151
  readonly deliveryStatus: {
1087
1152
  readonly className: "bpMessageDeliveryStatus";
1088
1153
  };
1154
+ readonly deliveryStatusLabel: {
1155
+ readonly className: "bpMessageDeliveryStatusLabel";
1156
+ };
1089
1157
  readonly blocks: {
1090
1158
  readonly text: {
1091
1159
  readonly heading1: {
@@ -1467,6 +1535,10 @@ declare type WebchatStore = {
1467
1535
  eventEmitter: EventEmitter<Events_2>;
1468
1536
  };
1469
1537
 
1538
+ export declare type WebchatTranslations = {
1539
+ [K in keyof typeof defaultTranslations]: string;
1540
+ };
1541
+
1470
1542
  export declare const webhookHandlerErrorMap: {
1471
1543
  [key in 'ResourceNotFound' | 'Forbidden']: WebchatError;
1472
1544
  };