@sendbird/ai-agent-messenger-react 1.7.0 → 1.8.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.
Files changed (43) hide show
  1. package/dist/cjs/81mv3yQ8.cjs +1 -0
  2. package/dist/cjs/B7oY12Rz.cjs +1 -0
  3. package/dist/cjs/BOQuxK8W.cjs +1 -0
  4. package/dist/cjs/Bi8XVGE0.cjs +305 -0
  5. package/dist/cjs/CZsIrgdx.cjs +1 -0
  6. package/dist/cjs/Cvx76YWg.cjs +1 -0
  7. package/dist/cjs/CxmJLyVQ.cjs +1 -0
  8. package/dist/cjs/DUZCYMwi.cjs +1 -0
  9. package/dist/cjs/GyKP4khq.cjs +1 -0
  10. package/dist/cjs/UnL5ebrx.cjs +1 -0
  11. package/dist/cjs/Vc_kaVVy.cjs +1 -0
  12. package/dist/es/BDRrsdhG.js +118 -0
  13. package/dist/es/BRbygcMm.js +5781 -0
  14. package/dist/es/{R5JH81j_.js → BoikxJUJ.js} +63 -39
  15. package/dist/es/By_mXjKX.js +118 -0
  16. package/dist/es/CjiYaXB3.js +118 -0
  17. package/dist/es/{ft1RB_3n.js → CwLgdNGh.js} +63 -39
  18. package/dist/es/{B5rkGe-T.js → D4G3q1WL.js} +64 -40
  19. package/dist/es/D9rtgPyE.js +118 -0
  20. package/dist/es/{B6_0xzKg.js → DSLWWi3o.js} +11 -17
  21. package/dist/es/{D1eX4RB5.js → DbEkY11E.js} +63 -39
  22. package/dist/es/DlPxWJIs.js +118 -0
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.d.ts +310 -184
  25. package/dist/index.js +4 -4
  26. package/package.json +5 -5
  27. package/dist/cjs/2_D7ijNY.cjs +0 -1
  28. package/dist/cjs/B-ZghjF0.cjs +0 -1
  29. package/dist/cjs/Bm1Lxho-.cjs +0 -1
  30. package/dist/cjs/Ca6B472u.cjs +0 -1
  31. package/dist/cjs/D2LBNgey.cjs +0 -1
  32. package/dist/cjs/DsV_9PUT.cjs +0 -1
  33. package/dist/cjs/DtOtVwwV.cjs +0 -305
  34. package/dist/cjs/DzUB7NMs.cjs +0 -1
  35. package/dist/cjs/Pwh9jBzw.cjs +0 -1
  36. package/dist/cjs/YSJk9LuN.cjs +0 -1
  37. package/dist/cjs/kCQFsJg4.cjs +0 -1
  38. package/dist/es/BCk4mkp9.js +0 -94
  39. package/dist/es/BPwGZpYy.js +0 -94
  40. package/dist/es/C3Xqf6Y4.js +0 -5374
  41. package/dist/es/C5ffk1-j.js +0 -94
  42. package/dist/es/CNd41zix.js +0 -94
  43. package/dist/es/DRYdWCct.js +0 -94
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Action } from '@sendbird/uikit-message-template';
1
+ import type { Action } from '@sendbird/uikit-message-template';
2
2
  import { AIAgentChannelFilter } from '@sendbird/chat/aiAgent';
3
3
  import { AIAgentModule } from '@sendbird/chat/aiAgent';
4
4
  import { BaseMessage } from '@sendbird/chat/message';
@@ -7,9 +7,7 @@ import { Context } from 'react';
7
7
  import { Conversation as Conversation_2 } from '@sendbird/chat/aiAgent';
8
8
  import { ConversationStatus } from '@sendbird/chat/aiAgent';
9
9
  import { CSSProperties } from 'react';
10
- import { DependencyList } from 'react';
11
10
  import { DeskChannelFilter } from '@sendbird/chat/aiAgent';
12
- import { Dispatch } from 'react';
13
11
  import { FC } from 'react';
14
12
  import { FileMessage } from '@sendbird/chat/message';
15
13
  import { FileMessageCreateParams } from '@sendbird/chat/message';
@@ -19,7 +17,7 @@ import { GroupChannel } from '@sendbird/chat/groupChannel';
19
17
  import { GroupChannelModule } from '@sendbird/chat/groupChannel';
20
18
  import { JSX } from 'react/jsx-runtime';
21
19
  import { LazyExoticComponent } from 'react';
22
- import { Locale } from 'date-fns';
20
+ import type { Locale } from 'date-fns';
23
21
  import { LogLevel as LogLevel_2 } from '@sendbird/chat';
24
22
  import { PropsWithChildren } from 'react';
25
23
  import { ReactNode } from 'react';
@@ -29,8 +27,8 @@ import { SendbirdChatParams } from '@sendbird/chat';
29
27
  import { SendbirdChatWith } from '@sendbird/chat';
30
28
  import { SendbirdError } from '@sendbird/chat';
31
29
  import { SessionHandler } from '@sendbird/chat';
32
- import { SetStateAction } from 'react';
33
30
  import { SVGProps } from 'react';
31
+ import { User } from '@sendbird/chat';
34
32
  import { UserMessage } from '@sendbird/chat/message';
35
33
  import { UserMessageCreateParams } from '@sendbird/chat/message';
36
34
 
@@ -253,6 +251,25 @@ declare interface AIAgentCache {
253
251
  declare interface AIAgentConfig {
254
252
  conversation?: {
255
253
  isTalkToAgentViewEnabled?: boolean;
254
+ scrollMode?: ConversationScrollMode;
255
+ input?: {
256
+ /**
257
+ * (Mobile only) Whether to enable the camera option in the attachment menu.
258
+ * */
259
+ camera?: {
260
+ photoEnabled?: boolean;
261
+ };
262
+ /**
263
+ * (Mobile only) Whether to enable the gallery option in the attachment menu.
264
+ * */
265
+ gallery?: {
266
+ photoEnabled?: boolean;
267
+ };
268
+ /**
269
+ * (Mobile only) Whether to enable the file option in the attachment menu.
270
+ * */
271
+ fileEnabled?: boolean;
272
+ };
256
273
  };
257
274
  }
258
275
 
@@ -292,6 +309,7 @@ declare interface AIAgentConversationContextValue {
292
309
  sendUserMessage: (params: UserMessageCreateParams) => Promise<UserMessage>;
293
310
  sendFileMessage: (params: FileMessageCreateParams) => Promise<FileMessage>;
294
311
  deleteMessage: (message: UserMessage | FileMessage) => Promise<void>;
312
+ resendMessage: (message: UserMessage | FileMessage) => Promise<UserMessage | FileMessage>;
295
313
  };
296
314
 
297
315
  state: {
@@ -359,13 +377,23 @@ declare interface AIAgentInfo {
359
377
  isUserFeedbackCommentOptionEnabled: boolean;
360
378
  }
361
379
 
380
+ /**
381
+ * Language set interface that includes strings and locale
382
+ * T can be any shape - doesn't have to extend AIAgentCommonStrings
383
+ */
384
+ declare interface AIAgentLanguageSet {
385
+ language: string;
386
+ strings: AIAgentStringSet;
387
+ dateLocale: Locale;
388
+ }
389
+
362
390
  declare interface AIAgentMessengerSessionContextValue {
363
391
  userSessionInfo?: UserSessionInfo | ManualSessionInfo | AnonymousSessionInfo;
364
392
 
393
+ sdkUser: null | User;
365
394
  userSession: null | UserSession;
366
395
  aiAgentInfo: null | AIAgentInfo;
367
396
  launcherInfo: null | LauncherInfo;
368
- attachmentMode: AttachmentMode;
369
397
 
370
398
  connectionError?: Error;
371
399
 
@@ -377,6 +405,8 @@ declare interface AIAgentMessengerSessionContextValue {
377
405
 
378
406
  authenticate: () => Promise<MessengerSettingsResponse>;
379
407
  deauthenticate: () => Promise<void>;
408
+
409
+ createAttachmentRules: (params: { channel?: GroupChannel; uploadSizeLimit?: number }) => AttachmentRules;
380
410
  }
381
411
 
382
412
  declare interface AIAgentMessengerSessionRef {
@@ -539,6 +569,68 @@ declare interface AIAgentQueryParams {
539
569
  conversationListParams?: ConversationListCollectionParams;
540
570
  }
541
571
 
572
+ /**
573
+ * Common string set interface shared between react and react-native packages
574
+ * These are the base strings that both packages use
575
+ * Structure follows the react-native nested format
576
+ */
577
+ declare interface AIAgentStringSet {
578
+ conversation: {
579
+ input_placeholder: string;
580
+ input_placeholder_disabled: string;
581
+ input_placeholder_wait_ai_agent_response: string;
582
+ input_placeholder_active_form: string;
583
+
584
+ unknown_message_type: string;
585
+ powered_by: string;
586
+ citation_title: string;
587
+ start_new_conversation_label: string;
588
+
589
+ failed_message_resend: string;
590
+ failed_message_remove: string;
591
+
592
+ file_upload_no_supported_files: string;
593
+ };
594
+
595
+ conversation_list: {
596
+ header_title: string;
597
+ ended: string;
598
+ };
599
+
600
+ date_format: {
601
+ just_now: string;
602
+ minutes_ago: (minutes: number) => string;
603
+ hours_ago: (hours: number) => string;
604
+ date_short: string;
605
+ date_separator: string;
606
+ message_timestamp: string;
607
+ };
608
+
609
+ csat: {
610
+ title: string;
611
+ submitted_label: string;
612
+ cre_question: string;
613
+ cre_positive_label: string;
614
+ cre_negative_label: string;
615
+ reason_placeholder: string;
616
+ question: string;
617
+ submit_label: string;
618
+ submission_expired: string;
619
+ };
620
+
621
+ form: {
622
+ optional_label: string;
623
+ validation_required: string;
624
+ };
625
+
626
+ common: {
627
+ placeholder_something_went_wrong: string;
628
+ placeholder_no_messages: string;
629
+ placeholder_no_conversations: string;
630
+ placeholder_something_went_wrong_retry_label: string;
631
+ };
632
+ }
633
+
542
634
  declare type AnonUserSessionData = { userId: string; authToken: string; expireAt: number };
543
635
 
544
636
  export declare class AnonymousSessionInfo {
@@ -547,10 +639,18 @@ export declare class AnonymousSessionInfo {
547
639
  sessionHandler?: never;
548
640
  }
549
641
 
550
- declare enum AttachmentMode {
551
- OFF = 'off',
552
- ALWAYS = 'always',
553
- HANDED_OFF_ONLY = 'handed_off_only',
642
+ declare interface AttachmentRules {
643
+ maxAttachmentCount: number;
644
+
645
+ // Attachment button visibility flag
646
+ isEnabled: () => boolean;
647
+
648
+ // Supported mime types
649
+ supportedMimeTypes: string[];
650
+
651
+ isSupportedMimeType: (mimeType: string) => boolean;
652
+ getUploadSizeLimit: (mimeType: string) => number;
653
+ getUploadSizeLimitInMB: (mimeType: string) => number;
554
654
  }
555
655
 
556
656
  declare abstract class BaseCommand {
@@ -569,16 +669,15 @@ declare abstract class BaseCommand {
569
669
  declare type BaseMessageProps<T> = T & {
570
670
  createdAt?: number;
571
671
  extendedMessagePayload?: Partial<ExtendedMessagePayload>;
672
+
673
+ // flags
572
674
  groupType?: MessageGroupType;
573
675
  maxBodyWidth?: number;
574
- onClickMedia?: (params: {
575
- url: string;
576
- type: string;
577
- }) => void;
578
- onClickFile?: (params: {
579
- url: string;
580
- type: string;
581
- }) => void;
676
+
677
+ // handlers
678
+ onClickMedia?: (params: { url: string; type: string }) => void;
679
+ onClickFile?: (params: { url: string; type: string }) => void;
680
+
582
681
  children?: ReactNode;
583
682
  };
584
683
 
@@ -626,7 +725,7 @@ declare interface ConversationContextProps {
626
725
  export declare const ConversationContextProvider: ({ channelUrl, onClearChannelUrl, onNavigateToConversationList, shouldMarkAsRead, children, }: PropsWithChildren<ConversationContextProps>) => JSX.Element;
627
726
 
628
727
  declare interface ConversationContextValue extends AIAgentConversationContextValue {
629
- scrollSource: ReturnType<typeof useMessageListScroll>;
728
+ scrollSource: ConversationScrollContextValue;
630
729
  goToActiveConversation: () => Promise<void>;
631
730
  onNavigateToConversationList?: () => void;
632
731
  }
@@ -760,6 +859,56 @@ export declare const ConversationListLayout: {
760
859
  }) => null;
761
860
  };
762
861
 
862
+ declare interface ConversationScrollContextValue {
863
+ ref: RefObject<HTMLDivElement | null> | ((element: HTMLDivElement | null) => void);
864
+ state: {
865
+ bottomSpace?: number;
866
+ shouldShowScrollButton: boolean;
867
+ };
868
+ props: {
869
+ onScroll?: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void;
870
+ };
871
+ actions: {
872
+ /**
873
+ * Scrolls to the bottom of the list (latest messages)
874
+ * @param animated - Whether to animate the scroll. Defaults to true
875
+ */
876
+ scrollToBottom: (animated?: boolean) => void;
877
+ /**
878
+ * Call before sending a message
879
+ * - Fixed mode: Captures current content height as baseline for padding calculation
880
+ * - Auto mode: No operation
881
+ */
882
+ onBeforeMessageSend: () => void;
883
+ /**
884
+ * Call after a message is sent and rendered
885
+ * - Fixed mode: Scrolls to the last user message
886
+ * - Auto mode: Scrolls to bottom to show the latest message
887
+ */
888
+ onAfterMessageSend: () => void;
889
+ /**
890
+ * Call when receiving streaming message updates
891
+ * - Fixed mode: Maintains scroll position while content grows
892
+ * - Auto mode: No operation (scrolling is handled by shouldScrollToBottom check)
893
+ */
894
+ onStreamingUpdate: (isStreaming: boolean) => void;
895
+ /**
896
+ * Notify when conversation closed state changes
897
+ * - When closed and in fixed mode: Switches to auto mode internally
898
+ * - When reopened or in auto mode: No change
899
+ */
900
+ onConversationClosed: (isClosed: boolean) => void;
901
+ /**
902
+ * Notify when typing indicator state changes
903
+ * - When typing starts: Keep scroll button hidden
904
+ * - When typing stops: Show button again after a delay
905
+ */
906
+ onTypingIndicatorUpdate: (isTyping: boolean) => void;
907
+ };
908
+ }
909
+
910
+ declare type ConversationScrollMode = 'auto' | 'fixed';
911
+
763
912
  declare type CSATSubmitParams = {
764
913
  csatType: string;
765
914
  csat?: number;
@@ -770,9 +919,9 @@ declare type CSATSubmitParams = {
770
919
  };
771
920
 
772
921
  export declare enum CSATType {
773
- AI_AGENT_CSAT_5 = "AI_AGENT_CSAT_5",
774
- AI_AGENT_CSAT_5_WITH_CRE = "AI_AGENT_CSAT_5_WITH_CRE",
775
- HELPDESK_CSAT_5 = "HELPDESK_CSAT_5"
922
+ AI_AGENT_CSAT_5 = 'AI_AGENT_CSAT_5',
923
+ AI_AGENT_CSAT_5_WITH_CRE = 'AI_AGENT_CSAT_5_WITH_CRE',
924
+ HELPDESK_CSAT_5 = 'HELPDESK_CSAT_5',
776
925
  }
777
926
 
778
927
  declare type CustomEvent_2 = {
@@ -791,89 +940,6 @@ declare type CustomEvent_2 = {
791
940
  };
792
941
  export { CustomEvent_2 as CustomEvent }
793
942
 
794
- declare const _default: {
795
- language: string;
796
- dateLocale: Locale;
797
- stringSet: {
798
- CHANNEL_FROZEN: string;
799
- PLACE_HOLDER__WRONG: string;
800
- PLACE_HOLDER__NO_MESSAGES: string;
801
- UNKNOWN__UNKNOWN_MESSAGE_TYPE: string;
802
- HEADER_BUTTON__AGENT_HANDOFF: string;
803
- MESSAGE_INPUT__PLACE_HOLDER: string;
804
- MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE: string;
805
- MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES: string;
806
- MESSAGE_INPUT__PLACE_HOLDER__DISABLED: string;
807
- BUTTON__CANCEL: string;
808
- BUTTON__SAVE: string;
809
- BUTTON__OK: string;
810
- BUTTON__SUBMIT: string;
811
- NO_NAME: string;
812
- RETRY: string;
813
- POWERED_BY: string;
814
- OPTIONAL: string;
815
- SUBMITTED: string;
816
- TRY_AGAIN: string;
817
- DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR: string;
818
- DATE_FORMAT__MESSAGE_TIMESTAMP: string;
819
- DATE_FORMAT__JUST_NOW: string;
820
- DATE_FORMAT__MINUTES_AGO: (minutes: number) => string;
821
- DATE_FORMAT__HOURS_AGO: (hours: number) => string;
822
- DATE_FORMAT__DATE_SHORT: string;
823
- FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT: string;
824
- FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT: string;
825
- FILE_VIEWER__UNSUPPORT: string;
826
- CSAT_TITLE_UNSUBMITTED: string;
827
- CSAT_TITLE_SUBMITTED: string;
828
- CSAT_CRE_TITLE: string;
829
- CSAT_CRE_SOLVED: string;
830
- CSAT_CRE_NOT_SOLVED: string;
831
- CSAT_REASON_PLACEHOLDER: string;
832
- CSAT_RATING_TITLE: string;
833
- CSAT5_RATING_SCORE_1: string;
834
- CSAT5_RATING_SCORE_2: string;
835
- CSAT5_RATING_SCORE_3: string;
836
- CSAT5_RATING_SCORE_4: string;
837
- CSAT5_RATING_SCORE_5: string;
838
- CSAT_SUBMIT_LABEL: string;
839
- CSAT_SUBMISSION_EXPIRED: string;
840
- CONVERSATION_CLOSED_FOOTER_LABEL: string;
841
- START_NEW_CONVERSATION: string;
842
- RETURN_TO_CONVERSATION: string;
843
- TALK_TO_AGENT: string;
844
- CONVERSATION_LIST__HEADER_TITLE: string;
845
- CONVERSATION_LIST__TOPICS_FALLBACK: string;
846
- CONVERSATION_LIST__NO_CONVERSATIONS: string;
847
- CONVERSATION_LIST__ENDED: string;
848
- CITATION_SOURCE_TITLE: string;
849
- FORM_PLACEHOLDER: string;
850
- FORM_UNAVAILABLE: string;
851
- FORM_NOT_SUPPORTED: string;
852
- FORM_VALIDATION_REQUIRED: string;
853
- FORM_VALIDATION_MIN_LENGTH: (minLength: number) => string;
854
- FORM_VALIDATION_MAX_LENGTH: (maxLength: number) => string;
855
- FORM_VALIDATION_MIN: (minValue: number) => string;
856
- FORM_VALIDATION_MAX: (maxValue: number) => string;
857
- FORM_VALIDATION_MIN_SELECT: (minSelect: number) => string;
858
- FORM_VALIDATION_MAX_SELECT: (maxSelect: number) => string;
859
- FORM_VALIDATION_REGEX_FAILED: string;
860
- FEEDBACK_TITLE: string;
861
- FEEDBACK_GOOD: string;
862
- FEEDBACK_BAD: string;
863
- FEEDBACK_COMMENT_LABEL: string;
864
- FEEDBACK_COMMENT_PLACEHOLDER: string;
865
- FEEDBACK_CANCEL: string;
866
- FEEDBACK_SUBMIT: string;
867
- FEEDBACK_SAVE: string;
868
- FEEDBACK_EDIT: string;
869
- FEEDBACK_REMOVE: string;
870
- /** @deprecated Please use DATE_FORMAT__DATE_SHORT instead. **/
871
- DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: string;
872
- /** @deprecated Unused string **/
873
- DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: string;
874
- };
875
- };
876
-
877
943
  export declare const DefaultMessenger: ForwardRefExoticComponent<MessengerProps & RefAttributes<MessengerSessionRef>>;
878
944
 
879
945
  declare interface Dispatcher {
@@ -926,6 +992,7 @@ export declare interface ExtendedMessagePayload {
926
992
  csat_submitted_label: string;
927
993
 
928
994
  cre?: {
995
+ required: boolean; // default: true
929
996
  question: string;
930
997
  positive_label: string;
931
998
  negative_label: string;
@@ -1104,11 +1171,14 @@ declare const icons: {
1104
1171
 
1105
1172
  declare type IconType = keyof typeof icons;
1106
1173
 
1107
- declare type IncomingBaseMessageProps<T> = T & BaseMessageProps<{
1174
+ declare type IncomingBaseMessageProps<T> = T &
1175
+ BaseMessageProps<{
1108
1176
  sender: {
1109
1177
  nickname: string;
1110
1178
  profileUrl?: string;
1111
1179
  };
1180
+
1181
+ // flags
1112
1182
  suggestedRepliesVisible?: boolean;
1113
1183
  suggestedRepliesDirection?: 'vertical' | 'horizontal';
1114
1184
  isBotMessage?: boolean;
@@ -1118,27 +1188,19 @@ declare type IncomingBaseMessageProps<T> = T & BaseMessageProps<{
1118
1188
  isConversationClosed?: boolean;
1119
1189
  isFeedbackEnabled?: boolean;
1120
1190
  isFeedbackCommentEnabled?: boolean;
1191
+
1192
+ // handlers
1121
1193
  onGetCachedMessageTemplate?: (templateKey: string) => string | null;
1122
1194
  onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
1123
1195
  onHandleTemplateInternalAction?: (action: Action) => void;
1124
- onClickSuggestedReply?: (params: {
1125
- reply: string;
1126
- }) => void;
1127
- onClickCTA?: (params: {
1128
- url: string;
1129
- }) => void;
1196
+ onClickSuggestedReply?: (params: { reply: string }) => void;
1197
+ onClickCTA?: (params: { url: string }) => void;
1130
1198
  onClickCitation?: (citation: CitationInfo) => void;
1131
- onFeedbackUpdate?: (params: {
1132
- rating: 'good' | 'bad';
1133
- comment?: string;
1134
- } | null) => void;
1135
- onSubmitForm?: (params: {
1136
- key: string;
1137
- data: Record<string, FormFieldValue>;
1138
- }) => Promise<void>;
1139
- onCancelForm?: (params: {
1140
- key: string;
1141
- }) => Promise<void>;
1199
+ onFeedbackUpdate?: (params: { rating: 'good' | 'bad'; comment?: string } | null) => void;
1200
+ onSubmitForm?: (params: { key: string; data: Record<string, FormFieldValue> }) => Promise<void>;
1201
+ onCancelForm?: (params: { key: string }) => Promise<void>;
1202
+
1203
+ // fallbacks
1142
1204
  messageTemplateErrorFallback?: ReactNode;
1143
1205
  messageTemplateLoadingFallback?: ReactNode;
1144
1206
  }>;
@@ -1242,12 +1304,15 @@ export declare const IncomingMessageLayout: {
1242
1304
  }) => null;
1243
1305
  };
1244
1306
 
1245
- export declare type IncomingMessageProps<T extends IncomingMessageUnion['messageType'] = IncomingMessageUnion['messageType']> = PickMessageProps<IncomingMessageUnion, T>;
1307
+ export declare type IncomingMessageProps<T extends IncomingMessageUnion['messageType'] = IncomingMessageUnion['messageType']> =
1308
+ PickMessageProps<IncomingMessageUnion, T>;
1246
1309
 
1247
- declare type IncomingMessageUnion = IncomingBaseMessageProps<{
1310
+ declare type IncomingMessageUnion =
1311
+ | IncomingBaseMessageProps<{
1248
1312
  messageType: 'user';
1249
1313
  message: string;
1250
- }> | IncomingBaseMessageProps<{
1314
+ }>
1315
+ | IncomingBaseMessageProps<{
1251
1316
  messageType: 'file';
1252
1317
  message: string;
1253
1318
  file: {
@@ -1283,10 +1348,11 @@ declare interface InternalMessageTemplateVariables {
1283
1348
  cascade_padding_right?: number;
1284
1349
  }
1285
1350
 
1286
- declare interface LanguageSet {
1287
- language: string;
1351
+ /**
1352
+ * Language set interface for React
1353
+ */
1354
+ declare interface LanguageSet extends Omit<AIAgentLanguageSet, 'strings'> {
1288
1355
  stringSet: StringSet;
1289
- dateLocale: Locale;
1290
1356
  }
1291
1357
 
1292
1358
  export declare function LauncherBase({ className, isOpened, onClick, type, imageUrl, dir, animated, backgroundColor, size, }: LauncherProps): JSX.Element;
@@ -1460,11 +1526,11 @@ declare interface MessengerProps extends AIAgentProps {
1460
1526
  }
1461
1527
 
1462
1528
  declare interface MessengerSessionCache {
1463
- getSettings(userId: string): MessengerSettingsData | null;
1464
- setSettings(userId: string, value: MessengerSettingsData): void;
1529
+ getSettings(userId: string): MessengerSettingsResponse | null;
1530
+ setSettings(userId: string, value: MessengerSettingsResponse): void;
1465
1531
  getAnonUser(): AnonUserSessionData | null;
1466
1532
  setAnonUser(value: AnonUserSessionData): void;
1467
- clear(userId: string): void;
1533
+ clear(userId: string | undefined): void;
1468
1534
  }
1469
1535
 
1470
1536
  declare interface MessengerSessionContextValue extends AIAgentMessengerSessionContextValue {
@@ -1480,8 +1546,6 @@ declare interface MessengerSessionContextValue extends AIAgentMessengerSessionCo
1480
1546
  export declare interface MessengerSessionRef extends AIAgentMessengerSessionRef {
1481
1547
  }
1482
1548
 
1483
- declare type MessengerSettingsData = { knownActiveChannelUrl: string };
1484
-
1485
1549
  declare interface MessengerSettingsResponse {
1486
1550
  active_channel: {
1487
1551
  channel_url: string;
@@ -1526,6 +1590,12 @@ declare interface MessengerSettingsResponse {
1526
1590
  session_token: string;
1527
1591
  expire_at: number;
1528
1592
  };
1593
+ upload_restriction?: {
1594
+ default_upload_size_limit: number;
1595
+ upload_size_limit_per_type: Record<string, number>;
1596
+ supported_image_mime_types: string[];
1597
+ supported_file_mime_types: string[];
1598
+ };
1529
1599
  }
1530
1600
 
1531
1601
  declare type MultiSelectField = {
@@ -1562,15 +1632,18 @@ declare type OnJoinedProactiveConversation = (params: {
1562
1632
  channel: GroupChannel;
1563
1633
  }) => void;
1564
1634
 
1565
- declare type OutgoingBaseMessageProps<T> = T & BaseMessageProps<{
1635
+ declare type OutgoingBaseMessageProps<T> = T &
1636
+ BaseMessageProps<{
1566
1637
  sender: {
1567
1638
  nickname: string;
1568
1639
  profileUrl?: string;
1569
1640
  };
1641
+
1570
1642
  sendingStatus: 'pending' | 'failed' | 'succeeded' | 'canceled' | 'scheduled';
1643
+ onClickFailedMessage?: () => void;
1571
1644
  }>;
1572
1645
 
1573
- declare function OutgoingMessageBody(props: OutgoingMessageBodyProps): JSX.Element | null;
1646
+ declare function OutgoingMessageBody(props: OutgoingMessageBodyProps): JSX.Element;
1574
1647
 
1575
1648
  declare type OutgoingMessageBodyProps<T extends MessageType_2 = MessageType_2> = OutgoingMessageProps<T> & {
1576
1649
  customStyle?: {
@@ -1615,12 +1688,15 @@ export declare const OutgoingMessageLayout: {
1615
1688
  }) => null;
1616
1689
  };
1617
1690
 
1618
- export declare type OutgoingMessageProps<T extends OutgoingMessageUnion['messageType'] = OutgoingMessageUnion['messageType']> = PickMessageProps<OutgoingMessageUnion, T>;
1691
+ export declare type OutgoingMessageProps<T extends OutgoingMessageUnion['messageType'] = OutgoingMessageUnion['messageType']> =
1692
+ PickMessageProps<OutgoingMessageUnion, T>;
1619
1693
 
1620
- declare type OutgoingMessageUnion = OutgoingBaseMessageProps<{
1694
+ declare type OutgoingMessageUnion =
1695
+ | OutgoingBaseMessageProps<{
1621
1696
  messageType: 'user';
1622
1697
  message: string;
1623
- }> | OutgoingBaseMessageProps<{
1698
+ }>
1699
+ | OutgoingBaseMessageProps<{
1624
1700
  messageType: 'file';
1625
1701
  message: string;
1626
1702
  file: {
@@ -1674,13 +1750,10 @@ declare interface PaletteTextEmphasis {
1674
1750
  textDisabled: string;
1675
1751
  }
1676
1752
 
1677
- declare type PickMessageProps<Union, T extends Union extends {
1678
- messageType: infer MT;
1679
- } ? MT : never = Union extends {
1680
- messageType: infer MT;
1681
- } ? MT : never> = Union extends {
1682
- messageType: T;
1683
- } ? Union : never;
1753
+ declare type PickMessageProps<
1754
+ Union,
1755
+ T extends Union extends { messageType: infer MT } ? MT : never = Union extends { messageType: infer MT } ? MT : never,
1756
+ > = Union extends { messageType: T } ? Union : never;
1684
1757
 
1685
1758
  export declare interface PlaceholderBaseProps extends PlaceholderCommonProps {
1686
1759
  icon?: IconType;
@@ -1757,11 +1830,6 @@ export declare type PositionHorizontal = 'start' | 'end';
1757
1830
 
1758
1831
  export declare type PositionVertical = 'top' | 'bottom';
1759
1832
 
1760
- /**
1761
- * You can pass the resolve function to scrollPubSub, if you want to catch when the scroll is finished.
1762
- * */
1763
- declare type PromiseResolver = () => void;
1764
-
1765
1833
  declare type Props = {
1766
1834
  children: ReactNode;
1767
1835
  rootElement?: HTMLElement;
@@ -1824,26 +1892,6 @@ declare type Props_5 = PropsWithChildren<{
1824
1892
  onOpenConversationView?: (channelUrl: string, status: 'open' | 'closed') => void;
1825
1893
  }>;
1826
1894
 
1827
- declare type PubSub<T> = {
1828
- publish: (data: T) => void;
1829
- subscribe: (subscriber: (data: T) => void) => () => void;
1830
- };
1831
-
1832
- declare type ScrollTopicUnion = {
1833
- type: 'scrollToBottom';
1834
- data?: {
1835
- animated?: boolean;
1836
- resolve?: PromiseResolver;
1837
- };
1838
- } | {
1839
- type: 'scroll';
1840
- data?: {
1841
- top?: number;
1842
- animated?: boolean;
1843
- resolve?: PromiseResolver;
1844
- };
1845
- };
1846
-
1847
1895
  declare type SingleSelectField = {
1848
1896
  key: string;
1849
1897
  type: 'single-select';
@@ -1855,7 +1903,91 @@ declare type SingleSelectField = {
1855
1903
  layout: 'default';
1856
1904
  };
1857
1905
 
1858
- declare type StringSet = typeof _default.stringSet;
1906
+ /**
1907
+ * StringSet type for React components
1908
+ * Uses SNAKE_CASE keys for backward compatibility
1909
+ */
1910
+ declare type StringSet = {
1911
+ CHANNEL_FROZEN: string;
1912
+ PLACE_HOLDER__WRONG: string;
1913
+ PLACE_HOLDER__NO_MESSAGES: string;
1914
+ UNKNOWN__UNKNOWN_MESSAGE_TYPE: string;
1915
+ HEADER_BUTTON__AGENT_HANDOFF: string;
1916
+ MESSAGE_INPUT__PLACE_HOLDER: string;
1917
+ MESSAGE_INPUT__PLACE_HOLDER__WAIT_AI_AGENT_RESPONSE: string;
1918
+ MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES: string;
1919
+ MESSAGE_INPUT__PLACE_HOLDER__DISABLED: string;
1920
+ BUTTON__CANCEL: string;
1921
+ BUTTON__SAVE: string;
1922
+ BUTTON__OK: string;
1923
+ BUTTON__SUBMIT: string;
1924
+ NO_NAME: string;
1925
+ RETRY: string;
1926
+ POWERED_BY: string;
1927
+ OPTIONAL: string;
1928
+ SUBMITTED: string;
1929
+ TRY_AGAIN: string;
1930
+ DATE_FORMAT__MESSAGE_LIST__DATE_SEPARATOR: string;
1931
+ DATE_FORMAT__MESSAGE_TIMESTAMP: string;
1932
+ DATE_FORMAT__JUST_NOW: string;
1933
+ DATE_FORMAT__MINUTES_AGO: (minutes: number) => string;
1934
+ DATE_FORMAT__HOURS_AGO: (hours: number) => string;
1935
+ DATE_FORMAT__DATE_SHORT: string;
1936
+ FILE_UPLOAD_NOTIFICATION__COUNT_LIMIT: string;
1937
+ FILE_UPLOAD_NOTIFICATION__SIZE_LIMIT: string;
1938
+ FILE_UPLOAD_NO_SUPPORTED_FILES: string;
1939
+ FILE_VIEWER__UNSUPPORT: string;
1940
+ CSAT_TITLE_UNSUBMITTED: string;
1941
+ CSAT_TITLE_SUBMITTED: string;
1942
+ CSAT_CRE_TITLE: string;
1943
+ CSAT_CRE_SOLVED: string;
1944
+ CSAT_CRE_NOT_SOLVED: string;
1945
+ CSAT_REASON_PLACEHOLDER: string;
1946
+ CSAT_RATING_TITLE: string;
1947
+ CSAT5_RATING_SCORE_1: string;
1948
+ CSAT5_RATING_SCORE_2: string;
1949
+ CSAT5_RATING_SCORE_3: string;
1950
+ CSAT5_RATING_SCORE_4: string;
1951
+ CSAT5_RATING_SCORE_5: string;
1952
+ CSAT_SUBMIT_LABEL: string;
1953
+ CSAT_SUBMISSION_EXPIRED: string;
1954
+ CONVERSATION_CLOSED_FOOTER_LABEL: string;
1955
+ START_NEW_CONVERSATION: string;
1956
+ RETURN_TO_CONVERSATION: string;
1957
+ TALK_TO_AGENT: string;
1958
+ CONVERSATION_LIST__HEADER_TITLE: string;
1959
+ CONVERSATION_LIST__TOPICS_FALLBACK: string;
1960
+ CONVERSATION_LIST__NO_CONVERSATIONS: string;
1961
+ CONVERSATION_LIST__ENDED: string;
1962
+ CITATION_SOURCE_TITLE: string;
1963
+ FORM_PLACEHOLDER: string;
1964
+ FORM_UNAVAILABLE: string;
1965
+ FORM_NOT_SUPPORTED: string;
1966
+ FORM_VALIDATION_REQUIRED: string;
1967
+ FORM_VALIDATION_MIN_LENGTH: (minLength: number) => string;
1968
+ FORM_VALIDATION_MAX_LENGTH: (maxLength: number) => string;
1969
+ FORM_VALIDATION_MIN: (minValue: number) => string;
1970
+ FORM_VALIDATION_MAX: (maxValue: number) => string;
1971
+ FORM_VALIDATION_MIN_SELECT: (minSelect: number) => string;
1972
+ FORM_VALIDATION_MAX_SELECT: (maxSelect: number) => string;
1973
+ FORM_VALIDATION_REGEX_FAILED: string;
1974
+ FEEDBACK_TITLE: string;
1975
+ FEEDBACK_GOOD: string;
1976
+ FEEDBACK_BAD: string;
1977
+ FEEDBACK_COMMENT_LABEL: string;
1978
+ FEEDBACK_COMMENT_PLACEHOLDER: string;
1979
+ FEEDBACK_CANCEL: string;
1980
+ FEEDBACK_SUBMIT: string;
1981
+ FEEDBACK_SAVE: string;
1982
+ FEEDBACK_EDIT: string;
1983
+ FEEDBACK_REMOVE: string;
1984
+ FAILED_MESSAGE_RESEND: string;
1985
+ FAILED_MESSAGE_REMOVE: string;
1986
+ /** @deprecated Please use DATE_FORMAT__DATE_SHORT instead. **/
1987
+ DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: string;
1988
+ /** @deprecated Unused string **/
1989
+ DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: string;
1990
+ };
1859
1991
 
1860
1992
  declare function SystemAdminMessage(props: SystemMessageProps): JSX.Element | null;
1861
1993
 
@@ -1891,12 +2023,15 @@ export declare const SystemMessageLayout: {
1891
2023
  }) => null;
1892
2024
  };
1893
2025
 
1894
- export declare type SystemMessageProps<T extends SystemMessageUnion['messageType'] = SystemMessageUnion['messageType']> = PickMessageProps<SystemMessageUnion, T>;
2026
+ export declare type SystemMessageProps<T extends SystemMessageUnion['messageType'] = SystemMessageUnion['messageType']> =
2027
+ PickMessageProps<SystemMessageUnion, T>;
1895
2028
 
1896
- declare type SystemMessageUnion = SystemBaseMessageProps<{
2029
+ declare type SystemMessageUnion =
2030
+ | SystemBaseMessageProps<{
1897
2031
  messageType: 'admin';
1898
2032
  message: string;
1899
- }> | SystemBaseMessageProps<{
2033
+ }>
2034
+ | SystemBaseMessageProps<{
1900
2035
  messageType: 'admin.csat';
1901
2036
  csat?: number;
1902
2037
  csatReason?: string;
@@ -1965,15 +2100,6 @@ export declare const useLocalizationContext: {
1965
2100
  displayName: string;
1966
2101
  };
1967
2102
 
1968
- declare function useMessageListScroll(behavior: 'smooth' | 'auto', deps?: DependencyList): {
1969
- scrollRef: RefObject<HTMLDivElement | null>;
1970
- scrollPubSub: PubSub<ScrollTopicUnion>;
1971
- isScrollBottomReached: boolean;
1972
- setIsScrollBottomReached: Dispatch<SetStateAction<boolean>>;
1973
- scrollDistanceFromBottomRef: RefObject<number>;
1974
- scrollPositionRef: RefObject<number>;
1975
- };
1976
-
1977
2103
  export declare const useMessengerContext: {
1978
2104
  (): MessengerContextValue;
1979
2105
  displayName: string;