@sendbird/ai-agent-messenger-react-native 1.7.0 → 1.8.0
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/dist/index.cjs +1 -1
- package/dist/index.d.ts +411 -26
- package/dist/index.js +2535 -2441
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ import { JSX } from 'react/jsx-runtime';
|
|
|
22
22
|
import { LayoutChangeEvent } from 'react-native';
|
|
23
23
|
import { LogLevel } from '@sendbird/chat';
|
|
24
24
|
import { MMKV } from 'react-native-mmkv';
|
|
25
|
+
import { MultipleFilesMessage } from '@sendbird/chat/message';
|
|
26
|
+
import { MultipleFilesMessageCreateParams } from '@sendbird/chat/message';
|
|
25
27
|
import { NativeScrollEvent } from 'react-native';
|
|
26
28
|
import { NativeSyntheticEvent } from 'react-native';
|
|
27
29
|
import { PropsWithChildren } from 'react';
|
|
@@ -229,13 +231,13 @@ declare interface AIAgentConfig {
|
|
|
229
231
|
photoEnabled?: boolean;
|
|
230
232
|
};
|
|
231
233
|
/**
|
|
232
|
-
*
|
|
234
|
+
* Whether to enable the gallery/photo option in the attachment menu.
|
|
233
235
|
* */
|
|
234
236
|
gallery?: {
|
|
235
237
|
photoEnabled?: boolean;
|
|
236
238
|
};
|
|
237
239
|
/**
|
|
238
|
-
*
|
|
240
|
+
* Whether to enable the file option in the attachment menu.
|
|
239
241
|
* */
|
|
240
242
|
fileEnabled?: boolean;
|
|
241
243
|
};
|
|
@@ -294,8 +296,11 @@ declare interface AIAgentConversationContextValue {
|
|
|
294
296
|
loadNext: () => Promise<void>;
|
|
295
297
|
sendUserMessage: (params: UserMessageCreateParams) => Promise<UserMessage>;
|
|
296
298
|
sendFileMessage: (params: FileMessageCreateParams) => Promise<FileMessage>;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
+
sendMultipleFilesMessage: (params: MultipleFilesMessageCreateParams) => Promise<MultipleFilesMessage>;
|
|
300
|
+
deleteMessage: (message: UserMessage | FileMessage | MultipleFilesMessage) => Promise<void>;
|
|
301
|
+
resendMessage: (
|
|
302
|
+
message: UserMessage | FileMessage | MultipleFilesMessage,
|
|
303
|
+
) => Promise<UserMessage | FileMessage | MultipleFilesMessage>;
|
|
299
304
|
resetNewMessages: () => void;
|
|
300
305
|
};
|
|
301
306
|
|
|
@@ -376,7 +381,6 @@ declare interface AIAgentMessengerSessionContextValue {
|
|
|
376
381
|
userSession: null | UserSession;
|
|
377
382
|
aiAgentInfo: null | AIAgentInfo;
|
|
378
383
|
launcherInfo: null | LauncherInfo;
|
|
379
|
-
presentMethod: PresentMethod;
|
|
380
384
|
|
|
381
385
|
connectionError?: Error;
|
|
382
386
|
|
|
@@ -488,10 +492,6 @@ queryParams?: AIAgentQueryParams;
|
|
|
488
492
|
* @description AIAgent global default config.
|
|
489
493
|
* */
|
|
490
494
|
config?: AIAgentConfig;
|
|
491
|
-
/**
|
|
492
|
-
* @internal Used for conversation initial render stat tracking.
|
|
493
|
-
*/
|
|
494
|
-
presentMethod?: PresentMethod;
|
|
495
495
|
} & {
|
|
496
496
|
children?: ReactNode | undefined;
|
|
497
497
|
} & RefAttributes<AIAgentMessengerSessionRef>>;
|
|
@@ -551,6 +551,7 @@ declare interface AIAgentStringSet {
|
|
|
551
551
|
header_title: string;
|
|
552
552
|
ended: string;
|
|
553
553
|
footer_title: string;
|
|
554
|
+
multiple_files_count: (count: number) => string;
|
|
554
555
|
};
|
|
555
556
|
|
|
556
557
|
date_format: {
|
|
@@ -645,7 +646,9 @@ declare type BaseMessageProps<T> = T & {
|
|
|
645
646
|
maxBodyWidth?: number;
|
|
646
647
|
|
|
647
648
|
// handlers
|
|
649
|
+
/** @deprecated Use onClickMediaFiles instead */
|
|
648
650
|
onClickMedia?: (params: { url: string; type: string }) => void;
|
|
651
|
+
onClickMediaFiles?: (params: { files: Array<{ url: string; type: string; name?: string }>; index: number }) => void;
|
|
649
652
|
onClickFile?: (params: { url: string; type: string }) => void;
|
|
650
653
|
|
|
651
654
|
children?: ReactNode;
|
|
@@ -712,12 +715,14 @@ declare interface CommandPayloads {
|
|
|
712
715
|
[CommandType.ConversationClose]: undefined | CloseConversationCommandParams;
|
|
713
716
|
[CommandType.MessengerSettingsUpdated]: MessengerSettingsUpdatedParams;
|
|
714
717
|
[CommandType.ActiveChannelUpdated]: ActiveChannelUpdatedParams;
|
|
718
|
+
[CommandType.AnonymousSessionTokenExpired]: undefined;
|
|
715
719
|
}
|
|
716
720
|
|
|
717
721
|
declare enum CommandType {
|
|
718
722
|
ConversationClose = 'conv.close',
|
|
719
723
|
MessengerSettingsUpdated = 'messenger.settings.updated',
|
|
720
724
|
ActiveChannelUpdated = 'active.channel.updated',
|
|
725
|
+
AnonymousSessionTokenExpired = 'anon.token.expired',
|
|
721
726
|
}
|
|
722
727
|
|
|
723
728
|
declare type CommunityDocumentPickerModule = typeof CommunityDocumentPicker;
|
|
@@ -823,11 +828,11 @@ declare interface ConversationHeaderTemplateProps {
|
|
|
823
828
|
}
|
|
824
829
|
|
|
825
830
|
declare class ConversationInitialRenderStats extends AIAgentBaseStats {
|
|
826
|
-
private presentMethod: PresentMethod;
|
|
831
|
+
private presentMethod: PresentMethod = 'direct_present';
|
|
827
832
|
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
this
|
|
833
|
+
setPresentMethod(method: PresentMethod): this {
|
|
834
|
+
this.presentMethod = method;
|
|
835
|
+
return this;
|
|
831
836
|
}
|
|
832
837
|
|
|
833
838
|
protected getMetricKey(): string {
|
|
@@ -870,18 +875,18 @@ declare class ConversationInitialRenderStats extends AIAgentBaseStats {
|
|
|
870
875
|
*/
|
|
871
876
|
declare class ConversationInitialRenderStatsTracker {
|
|
872
877
|
private readonly commitCallback: StatsAppendCallback;
|
|
873
|
-
private
|
|
878
|
+
private presentMethod: PresentMethod = 'direct_present';
|
|
874
879
|
private stats: ConversationInitialRenderStats | null = null;
|
|
875
880
|
|
|
876
|
-
constructor(commitCallback: StatsAppendCallback
|
|
881
|
+
constructor(commitCallback: StatsAppendCallback) {
|
|
877
882
|
this.commitCallback = commitCallback;
|
|
878
|
-
this.presentMethod = presentMethod;
|
|
879
883
|
}
|
|
880
884
|
|
|
881
885
|
private getOrCreateStats(): ConversationInitialRenderStats {
|
|
882
886
|
if (!this.stats || this.stats.isCommitted()) {
|
|
883
|
-
this.stats = new ConversationInitialRenderStats(
|
|
884
|
-
|
|
887
|
+
this.stats = new ConversationInitialRenderStats()
|
|
888
|
+
.setCommitCallback(this.commitCallback)
|
|
889
|
+
.setPresentMethod(this.presentMethod);
|
|
885
890
|
}
|
|
886
891
|
return this.stats;
|
|
887
892
|
}
|
|
@@ -957,6 +962,11 @@ declare class ConversationInitialRenderStatsTracker {
|
|
|
957
962
|
this.stats?.commit();
|
|
958
963
|
}
|
|
959
964
|
|
|
965
|
+
setPresentMethod(method: PresentMethod): void {
|
|
966
|
+
this.presentMethod = method;
|
|
967
|
+
this.stats?.setPresentMethod(method);
|
|
968
|
+
}
|
|
969
|
+
|
|
960
970
|
clear(): void {
|
|
961
971
|
this.stats = null;
|
|
962
972
|
}
|
|
@@ -1602,6 +1612,14 @@ export declare const IncomingMessageLayout: {
|
|
|
1602
1612
|
url: string;
|
|
1603
1613
|
type: string;
|
|
1604
1614
|
}) => void;
|
|
1615
|
+
onClickMediaFiles?: (params: {
|
|
1616
|
+
files: Array<{
|
|
1617
|
+
url: string;
|
|
1618
|
+
type: string;
|
|
1619
|
+
name?: string;
|
|
1620
|
+
}>;
|
|
1621
|
+
index: number;
|
|
1622
|
+
}) => void;
|
|
1605
1623
|
onClickFile?: (params: {
|
|
1606
1624
|
url: string;
|
|
1607
1625
|
type: string;
|
|
@@ -1666,6 +1684,86 @@ export declare const IncomingMessageLayout: {
|
|
|
1666
1684
|
url: string;
|
|
1667
1685
|
type: string;
|
|
1668
1686
|
}) => void;
|
|
1687
|
+
onClickMediaFiles?: (params: {
|
|
1688
|
+
files: Array<{
|
|
1689
|
+
url: string;
|
|
1690
|
+
type: string;
|
|
1691
|
+
name?: string;
|
|
1692
|
+
}>;
|
|
1693
|
+
index: number;
|
|
1694
|
+
}) => void;
|
|
1695
|
+
onClickFile?: (params: {
|
|
1696
|
+
url: string;
|
|
1697
|
+
type: string;
|
|
1698
|
+
}) => void;
|
|
1699
|
+
children?: ReactNode;
|
|
1700
|
+
}) | ({
|
|
1701
|
+
messageType: "multipleFiles";
|
|
1702
|
+
message: string;
|
|
1703
|
+
files: {
|
|
1704
|
+
type: string;
|
|
1705
|
+
url: string;
|
|
1706
|
+
name: string;
|
|
1707
|
+
}[];
|
|
1708
|
+
} & {
|
|
1709
|
+
sender: {
|
|
1710
|
+
nickname: string;
|
|
1711
|
+
profileUrl?: string;
|
|
1712
|
+
};
|
|
1713
|
+
suggestedRepliesVisible?: boolean;
|
|
1714
|
+
suggestedRepliesDirection?: "vertical" | "horizontal";
|
|
1715
|
+
isBotMessage?: boolean;
|
|
1716
|
+
isTyping?: boolean;
|
|
1717
|
+
isStreaming?: boolean;
|
|
1718
|
+
isHandedOff?: boolean;
|
|
1719
|
+
isConversationClosed?: boolean;
|
|
1720
|
+
isFeedbackEnabled?: boolean;
|
|
1721
|
+
isFeedbackCommentEnabled?: boolean;
|
|
1722
|
+
isSenderAvatarVisible?: boolean;
|
|
1723
|
+
onGetCachedMessageTemplate?: (templateKey: string) => string | null;
|
|
1724
|
+
onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
|
|
1725
|
+
onHandleTemplateInternalAction?: (action: Action) => void;
|
|
1726
|
+
onClickSuggestedReply?: (params: {
|
|
1727
|
+
reply: string;
|
|
1728
|
+
}) => void;
|
|
1729
|
+
onClickCTA?: (params: {
|
|
1730
|
+
url: string;
|
|
1731
|
+
}) => void;
|
|
1732
|
+
onClickCitation?: (citation: CitationInfo) => void;
|
|
1733
|
+
onFeedbackUpdate?: (params: {
|
|
1734
|
+
rating: "good" | "bad";
|
|
1735
|
+
comment?: string;
|
|
1736
|
+
} | null) => void;
|
|
1737
|
+
onSubmitForm?: (params: {
|
|
1738
|
+
key: string;
|
|
1739
|
+
data: Record<string, FormFieldValue>;
|
|
1740
|
+
}) => Promise<void>;
|
|
1741
|
+
onCancelForm?: (params: {
|
|
1742
|
+
key: string;
|
|
1743
|
+
}) => Promise<void>;
|
|
1744
|
+
onStreamAnimationStart?: () => void;
|
|
1745
|
+
onStreamAnimationProgress?: () => void;
|
|
1746
|
+
onStreamAnimationComplete?: () => void;
|
|
1747
|
+
messageTemplateErrorFallback?: ReactNode;
|
|
1748
|
+
messageTemplateLoadingFallback?: ReactNode;
|
|
1749
|
+
} & {
|
|
1750
|
+
data?: string;
|
|
1751
|
+
createdAt?: number;
|
|
1752
|
+
extendedMessagePayload?: Partial<ExtendedMessagePayload>;
|
|
1753
|
+
groupType?: MessageGroupType;
|
|
1754
|
+
maxBodyWidth?: number;
|
|
1755
|
+
onClickMedia?: (params: {
|
|
1756
|
+
url: string;
|
|
1757
|
+
type: string;
|
|
1758
|
+
}) => void;
|
|
1759
|
+
onClickMediaFiles?: (params: {
|
|
1760
|
+
files: Array<{
|
|
1761
|
+
url: string;
|
|
1762
|
+
type: string;
|
|
1763
|
+
name?: string;
|
|
1764
|
+
}>;
|
|
1765
|
+
index: number;
|
|
1766
|
+
}) => void;
|
|
1669
1767
|
onClickFile?: (params: {
|
|
1670
1768
|
url: string;
|
|
1671
1769
|
type: string;
|
|
@@ -1763,6 +1861,14 @@ export declare const IncomingMessageLayout: {
|
|
|
1763
1861
|
url: string;
|
|
1764
1862
|
type: string;
|
|
1765
1863
|
}) => void;
|
|
1864
|
+
onClickMediaFiles?: (params: {
|
|
1865
|
+
files: Array<{
|
|
1866
|
+
url: string;
|
|
1867
|
+
type: string;
|
|
1868
|
+
name?: string;
|
|
1869
|
+
}>;
|
|
1870
|
+
index: number;
|
|
1871
|
+
}) => void;
|
|
1766
1872
|
onClickFile?: (params: {
|
|
1767
1873
|
url: string;
|
|
1768
1874
|
type: string;
|
|
@@ -1827,6 +1933,86 @@ export declare const IncomingMessageLayout: {
|
|
|
1827
1933
|
url: string;
|
|
1828
1934
|
type: string;
|
|
1829
1935
|
}) => void;
|
|
1936
|
+
onClickMediaFiles?: (params: {
|
|
1937
|
+
files: Array<{
|
|
1938
|
+
url: string;
|
|
1939
|
+
type: string;
|
|
1940
|
+
name?: string;
|
|
1941
|
+
}>;
|
|
1942
|
+
index: number;
|
|
1943
|
+
}) => void;
|
|
1944
|
+
onClickFile?: (params: {
|
|
1945
|
+
url: string;
|
|
1946
|
+
type: string;
|
|
1947
|
+
}) => void;
|
|
1948
|
+
children?: ReactNode;
|
|
1949
|
+
}) | ({
|
|
1950
|
+
messageType: "multipleFiles";
|
|
1951
|
+
message: string;
|
|
1952
|
+
files: {
|
|
1953
|
+
type: string;
|
|
1954
|
+
url: string;
|
|
1955
|
+
name: string;
|
|
1956
|
+
}[];
|
|
1957
|
+
} & {
|
|
1958
|
+
sender: {
|
|
1959
|
+
nickname: string;
|
|
1960
|
+
profileUrl?: string;
|
|
1961
|
+
};
|
|
1962
|
+
suggestedRepliesVisible?: boolean;
|
|
1963
|
+
suggestedRepliesDirection?: "vertical" | "horizontal";
|
|
1964
|
+
isBotMessage?: boolean;
|
|
1965
|
+
isTyping?: boolean;
|
|
1966
|
+
isStreaming?: boolean;
|
|
1967
|
+
isHandedOff?: boolean;
|
|
1968
|
+
isConversationClosed?: boolean;
|
|
1969
|
+
isFeedbackEnabled?: boolean;
|
|
1970
|
+
isFeedbackCommentEnabled?: boolean;
|
|
1971
|
+
isSenderAvatarVisible?: boolean;
|
|
1972
|
+
onGetCachedMessageTemplate?: (templateKey: string) => string | null;
|
|
1973
|
+
onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
|
|
1974
|
+
onHandleTemplateInternalAction?: (action: Action) => void;
|
|
1975
|
+
onClickSuggestedReply?: (params: {
|
|
1976
|
+
reply: string;
|
|
1977
|
+
}) => void;
|
|
1978
|
+
onClickCTA?: (params: {
|
|
1979
|
+
url: string;
|
|
1980
|
+
}) => void;
|
|
1981
|
+
onClickCitation?: (citation: CitationInfo) => void;
|
|
1982
|
+
onFeedbackUpdate?: (params: {
|
|
1983
|
+
rating: "good" | "bad";
|
|
1984
|
+
comment?: string;
|
|
1985
|
+
} | null) => void;
|
|
1986
|
+
onSubmitForm?: (params: {
|
|
1987
|
+
key: string;
|
|
1988
|
+
data: Record<string, FormFieldValue>;
|
|
1989
|
+
}) => Promise<void>;
|
|
1990
|
+
onCancelForm?: (params: {
|
|
1991
|
+
key: string;
|
|
1992
|
+
}) => Promise<void>;
|
|
1993
|
+
onStreamAnimationStart?: () => void;
|
|
1994
|
+
onStreamAnimationProgress?: () => void;
|
|
1995
|
+
onStreamAnimationComplete?: () => void;
|
|
1996
|
+
messageTemplateErrorFallback?: ReactNode;
|
|
1997
|
+
messageTemplateLoadingFallback?: ReactNode;
|
|
1998
|
+
} & {
|
|
1999
|
+
data?: string;
|
|
2000
|
+
createdAt?: number;
|
|
2001
|
+
extendedMessagePayload?: Partial<ExtendedMessagePayload>;
|
|
2002
|
+
groupType?: MessageGroupType;
|
|
2003
|
+
maxBodyWidth?: number;
|
|
2004
|
+
onClickMedia?: (params: {
|
|
2005
|
+
url: string;
|
|
2006
|
+
type: string;
|
|
2007
|
+
}) => void;
|
|
2008
|
+
onClickMediaFiles?: (params: {
|
|
2009
|
+
files: Array<{
|
|
2010
|
+
url: string;
|
|
2011
|
+
type: string;
|
|
2012
|
+
name?: string;
|
|
2013
|
+
}>;
|
|
2014
|
+
index: number;
|
|
2015
|
+
}) => void;
|
|
1830
2016
|
onClickFile?: (params: {
|
|
1831
2017
|
url: string;
|
|
1832
2018
|
type: string;
|
|
@@ -1919,6 +2105,14 @@ export declare const IncomingMessageLayout: {
|
|
|
1919
2105
|
url: string;
|
|
1920
2106
|
type: string;
|
|
1921
2107
|
}) => void;
|
|
2108
|
+
onClickMediaFiles?: (params: {
|
|
2109
|
+
files: Array<{
|
|
2110
|
+
url: string;
|
|
2111
|
+
type: string;
|
|
2112
|
+
name?: string;
|
|
2113
|
+
}>;
|
|
2114
|
+
index: number;
|
|
2115
|
+
}) => void;
|
|
1922
2116
|
onClickFile?: (params: {
|
|
1923
2117
|
url: string;
|
|
1924
2118
|
type: string;
|
|
@@ -1983,6 +2177,86 @@ export declare const IncomingMessageLayout: {
|
|
|
1983
2177
|
url: string;
|
|
1984
2178
|
type: string;
|
|
1985
2179
|
}) => void;
|
|
2180
|
+
onClickMediaFiles?: (params: {
|
|
2181
|
+
files: Array<{
|
|
2182
|
+
url: string;
|
|
2183
|
+
type: string;
|
|
2184
|
+
name?: string;
|
|
2185
|
+
}>;
|
|
2186
|
+
index: number;
|
|
2187
|
+
}) => void;
|
|
2188
|
+
onClickFile?: (params: {
|
|
2189
|
+
url: string;
|
|
2190
|
+
type: string;
|
|
2191
|
+
}) => void;
|
|
2192
|
+
children?: ReactNode;
|
|
2193
|
+
}) | ({
|
|
2194
|
+
messageType: "multipleFiles";
|
|
2195
|
+
message: string;
|
|
2196
|
+
files: {
|
|
2197
|
+
type: string;
|
|
2198
|
+
url: string;
|
|
2199
|
+
name: string;
|
|
2200
|
+
}[];
|
|
2201
|
+
} & {
|
|
2202
|
+
sender: {
|
|
2203
|
+
nickname: string;
|
|
2204
|
+
profileUrl?: string;
|
|
2205
|
+
};
|
|
2206
|
+
suggestedRepliesVisible?: boolean;
|
|
2207
|
+
suggestedRepliesDirection?: "vertical" | "horizontal";
|
|
2208
|
+
isBotMessage?: boolean;
|
|
2209
|
+
isTyping?: boolean;
|
|
2210
|
+
isStreaming?: boolean;
|
|
2211
|
+
isHandedOff?: boolean;
|
|
2212
|
+
isConversationClosed?: boolean;
|
|
2213
|
+
isFeedbackEnabled?: boolean;
|
|
2214
|
+
isFeedbackCommentEnabled?: boolean;
|
|
2215
|
+
isSenderAvatarVisible?: boolean;
|
|
2216
|
+
onGetCachedMessageTemplate?: (templateKey: string) => string | null;
|
|
2217
|
+
onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
|
|
2218
|
+
onHandleTemplateInternalAction?: (action: Action) => void;
|
|
2219
|
+
onClickSuggestedReply?: (params: {
|
|
2220
|
+
reply: string;
|
|
2221
|
+
}) => void;
|
|
2222
|
+
onClickCTA?: (params: {
|
|
2223
|
+
url: string;
|
|
2224
|
+
}) => void;
|
|
2225
|
+
onClickCitation?: (citation: CitationInfo) => void;
|
|
2226
|
+
onFeedbackUpdate?: (params: {
|
|
2227
|
+
rating: "good" | "bad";
|
|
2228
|
+
comment?: string;
|
|
2229
|
+
} | null) => void;
|
|
2230
|
+
onSubmitForm?: (params: {
|
|
2231
|
+
key: string;
|
|
2232
|
+
data: Record<string, FormFieldValue>;
|
|
2233
|
+
}) => Promise<void>;
|
|
2234
|
+
onCancelForm?: (params: {
|
|
2235
|
+
key: string;
|
|
2236
|
+
}) => Promise<void>;
|
|
2237
|
+
onStreamAnimationStart?: () => void;
|
|
2238
|
+
onStreamAnimationProgress?: () => void;
|
|
2239
|
+
onStreamAnimationComplete?: () => void;
|
|
2240
|
+
messageTemplateErrorFallback?: ReactNode;
|
|
2241
|
+
messageTemplateLoadingFallback?: ReactNode;
|
|
2242
|
+
} & {
|
|
2243
|
+
data?: string;
|
|
2244
|
+
createdAt?: number;
|
|
2245
|
+
extendedMessagePayload?: Partial<ExtendedMessagePayload>;
|
|
2246
|
+
groupType?: MessageGroupType;
|
|
2247
|
+
maxBodyWidth?: number;
|
|
2248
|
+
onClickMedia?: (params: {
|
|
2249
|
+
url: string;
|
|
2250
|
+
type: string;
|
|
2251
|
+
}) => void;
|
|
2252
|
+
onClickMediaFiles?: (params: {
|
|
2253
|
+
files: Array<{
|
|
2254
|
+
url: string;
|
|
2255
|
+
type: string;
|
|
2256
|
+
name?: string;
|
|
2257
|
+
}>;
|
|
2258
|
+
index: number;
|
|
2259
|
+
}) => void;
|
|
1986
2260
|
onClickFile?: (params: {
|
|
1987
2261
|
url: string;
|
|
1988
2262
|
type: string;
|
|
@@ -2090,6 +2364,14 @@ export declare const IncomingMessageLayout: {
|
|
|
2090
2364
|
url: string;
|
|
2091
2365
|
type: string;
|
|
2092
2366
|
}) => void;
|
|
2367
|
+
onClickMediaFiles?: (params: {
|
|
2368
|
+
files: Array<{
|
|
2369
|
+
url: string;
|
|
2370
|
+
type: string;
|
|
2371
|
+
name?: string;
|
|
2372
|
+
}>;
|
|
2373
|
+
index: number;
|
|
2374
|
+
}) => void;
|
|
2093
2375
|
onClickFile?: (params: {
|
|
2094
2376
|
url: string;
|
|
2095
2377
|
type: string;
|
|
@@ -2154,6 +2436,86 @@ export declare const IncomingMessageLayout: {
|
|
|
2154
2436
|
url: string;
|
|
2155
2437
|
type: string;
|
|
2156
2438
|
}) => void;
|
|
2439
|
+
onClickMediaFiles?: (params: {
|
|
2440
|
+
files: Array<{
|
|
2441
|
+
url: string;
|
|
2442
|
+
type: string;
|
|
2443
|
+
name?: string;
|
|
2444
|
+
}>;
|
|
2445
|
+
index: number;
|
|
2446
|
+
}) => void;
|
|
2447
|
+
onClickFile?: (params: {
|
|
2448
|
+
url: string;
|
|
2449
|
+
type: string;
|
|
2450
|
+
}) => void;
|
|
2451
|
+
children?: ReactNode;
|
|
2452
|
+
}) | ({
|
|
2453
|
+
messageType: "multipleFiles";
|
|
2454
|
+
message: string;
|
|
2455
|
+
files: {
|
|
2456
|
+
type: string;
|
|
2457
|
+
url: string;
|
|
2458
|
+
name: string;
|
|
2459
|
+
}[];
|
|
2460
|
+
} & {
|
|
2461
|
+
sender: {
|
|
2462
|
+
nickname: string;
|
|
2463
|
+
profileUrl?: string;
|
|
2464
|
+
};
|
|
2465
|
+
suggestedRepliesVisible?: boolean;
|
|
2466
|
+
suggestedRepliesDirection?: "vertical" | "horizontal";
|
|
2467
|
+
isBotMessage?: boolean;
|
|
2468
|
+
isTyping?: boolean;
|
|
2469
|
+
isStreaming?: boolean;
|
|
2470
|
+
isHandedOff?: boolean;
|
|
2471
|
+
isConversationClosed?: boolean;
|
|
2472
|
+
isFeedbackEnabled?: boolean;
|
|
2473
|
+
isFeedbackCommentEnabled?: boolean;
|
|
2474
|
+
isSenderAvatarVisible?: boolean;
|
|
2475
|
+
onGetCachedMessageTemplate?: (templateKey: string) => string | null;
|
|
2476
|
+
onRequestMessageTemplate?: (templateKey: string) => Promise<string>;
|
|
2477
|
+
onHandleTemplateInternalAction?: (action: Action) => void;
|
|
2478
|
+
onClickSuggestedReply?: (params: {
|
|
2479
|
+
reply: string;
|
|
2480
|
+
}) => void;
|
|
2481
|
+
onClickCTA?: (params: {
|
|
2482
|
+
url: string;
|
|
2483
|
+
}) => void;
|
|
2484
|
+
onClickCitation?: (citation: CitationInfo) => void;
|
|
2485
|
+
onFeedbackUpdate?: (params: {
|
|
2486
|
+
rating: "good" | "bad";
|
|
2487
|
+
comment?: string;
|
|
2488
|
+
} | null) => void;
|
|
2489
|
+
onSubmitForm?: (params: {
|
|
2490
|
+
key: string;
|
|
2491
|
+
data: Record<string, FormFieldValue>;
|
|
2492
|
+
}) => Promise<void>;
|
|
2493
|
+
onCancelForm?: (params: {
|
|
2494
|
+
key: string;
|
|
2495
|
+
}) => Promise<void>;
|
|
2496
|
+
onStreamAnimationStart?: () => void;
|
|
2497
|
+
onStreamAnimationProgress?: () => void;
|
|
2498
|
+
onStreamAnimationComplete?: () => void;
|
|
2499
|
+
messageTemplateErrorFallback?: ReactNode;
|
|
2500
|
+
messageTemplateLoadingFallback?: ReactNode;
|
|
2501
|
+
} & {
|
|
2502
|
+
data?: string;
|
|
2503
|
+
createdAt?: number;
|
|
2504
|
+
extendedMessagePayload?: Partial<ExtendedMessagePayload>;
|
|
2505
|
+
groupType?: MessageGroupType;
|
|
2506
|
+
maxBodyWidth?: number;
|
|
2507
|
+
onClickMedia?: (params: {
|
|
2508
|
+
url: string;
|
|
2509
|
+
type: string;
|
|
2510
|
+
}) => void;
|
|
2511
|
+
onClickMediaFiles?: (params: {
|
|
2512
|
+
files: Array<{
|
|
2513
|
+
url: string;
|
|
2514
|
+
type: string;
|
|
2515
|
+
name?: string;
|
|
2516
|
+
}>;
|
|
2517
|
+
index: number;
|
|
2518
|
+
}) => void;
|
|
2157
2519
|
onClickFile?: (params: {
|
|
2158
2520
|
url: string;
|
|
2159
2521
|
type: string;
|
|
@@ -2195,6 +2557,15 @@ declare type IncomingMessageUnion =
|
|
|
2195
2557
|
url: string;
|
|
2196
2558
|
name: string;
|
|
2197
2559
|
};
|
|
2560
|
+
}>
|
|
2561
|
+
| IncomingBaseMessageProps<{
|
|
2562
|
+
messageType: 'multipleFiles';
|
|
2563
|
+
message: string;
|
|
2564
|
+
files: {
|
|
2565
|
+
type: string;
|
|
2566
|
+
url: string;
|
|
2567
|
+
name: string;
|
|
2568
|
+
}[];
|
|
2198
2569
|
}>;
|
|
2199
2570
|
|
|
2200
2571
|
declare type InputState = {
|
|
@@ -2394,6 +2765,7 @@ declare interface MessengerSettingsResponse {
|
|
|
2394
2765
|
upload_size_limit_per_type: Record<string, number>;
|
|
2395
2766
|
supported_image_mime_types: string[];
|
|
2396
2767
|
supported_file_mime_types: string[];
|
|
2768
|
+
max_attachment_count?: number;
|
|
2397
2769
|
};
|
|
2398
2770
|
}
|
|
2399
2771
|
|
|
@@ -2523,10 +2895,10 @@ export declare const OutgoingMessageLayout: {
|
|
|
2523
2895
|
defaults: {
|
|
2524
2896
|
template: ComponentType<OutgoingMessageProps>;
|
|
2525
2897
|
components: {
|
|
2526
|
-
SendingStatus: ({ sendingStatus, containerStyle }: OutgoingMessageProps<"file" | "user"> & {
|
|
2898
|
+
SendingStatus: ({ sendingStatus, containerStyle }: OutgoingMessageProps<"file" | "user" | "multipleFiles"> & {
|
|
2527
2899
|
containerStyle?: ViewStyle;
|
|
2528
2900
|
}) => ReactNode;
|
|
2529
|
-
SentTime: ({ createdAt, containerStyle }: OutgoingMessageProps<"file" | "user"> & {
|
|
2901
|
+
SentTime: ({ createdAt, containerStyle }: OutgoingMessageProps<"file" | "user" | "multipleFiles"> & {
|
|
2530
2902
|
containerStyle?: ViewStyle;
|
|
2531
2903
|
}) => ReactNode;
|
|
2532
2904
|
MessageBody: (props: OutgoingMessageBodyProps) => ReactNode;
|
|
@@ -2537,26 +2909,26 @@ export declare const OutgoingMessageLayout: {
|
|
|
2537
2909
|
children?: ReactNode;
|
|
2538
2910
|
}) => JSX.Element;
|
|
2539
2911
|
Context: Context<LayoutContextValue<OutgoingMessageProps, {
|
|
2540
|
-
SendingStatus: ({ sendingStatus, containerStyle }: OutgoingMessageProps<"file" | "user"> & {
|
|
2912
|
+
SendingStatus: ({ sendingStatus, containerStyle }: OutgoingMessageProps<"file" | "user" | "multipleFiles"> & {
|
|
2541
2913
|
containerStyle?: ViewStyle;
|
|
2542
2914
|
}) => ReactNode;
|
|
2543
|
-
SentTime: ({ createdAt, containerStyle }: OutgoingMessageProps<"file" | "user"> & {
|
|
2915
|
+
SentTime: ({ createdAt, containerStyle }: OutgoingMessageProps<"file" | "user" | "multipleFiles"> & {
|
|
2544
2916
|
containerStyle?: ViewStyle;
|
|
2545
2917
|
}) => ReactNode;
|
|
2546
2918
|
MessageBody: (props: OutgoingMessageBodyProps) => ReactNode;
|
|
2547
2919
|
}>>;
|
|
2548
2920
|
useContext: () => LayoutContextValue<OutgoingMessageProps, {
|
|
2549
|
-
SendingStatus: ({ sendingStatus, containerStyle }: OutgoingMessageProps<"file" | "user"> & {
|
|
2921
|
+
SendingStatus: ({ sendingStatus, containerStyle }: OutgoingMessageProps<"file" | "user" | "multipleFiles"> & {
|
|
2550
2922
|
containerStyle?: ViewStyle;
|
|
2551
2923
|
}) => ReactNode;
|
|
2552
|
-
SentTime: ({ createdAt, containerStyle }: OutgoingMessageProps<"file" | "user"> & {
|
|
2924
|
+
SentTime: ({ createdAt, containerStyle }: OutgoingMessageProps<"file" | "user" | "multipleFiles"> & {
|
|
2553
2925
|
containerStyle?: ViewStyle;
|
|
2554
2926
|
}) => ReactNode;
|
|
2555
2927
|
MessageBody: (props: OutgoingMessageBodyProps) => ReactNode;
|
|
2556
2928
|
}>;
|
|
2557
2929
|
} & {
|
|
2558
2930
|
SentTime: (props: {
|
|
2559
|
-
component: ({ createdAt, containerStyle }: OutgoingMessageProps<"file" | "user"> & {
|
|
2931
|
+
component: ({ createdAt, containerStyle }: OutgoingMessageProps<"file" | "user" | "multipleFiles"> & {
|
|
2560
2932
|
containerStyle?: ViewStyle;
|
|
2561
2933
|
}) => ReactNode;
|
|
2562
2934
|
}) => null;
|
|
@@ -2564,7 +2936,7 @@ export declare const OutgoingMessageLayout: {
|
|
|
2564
2936
|
component: (props: OutgoingMessageBodyProps) => ReactNode;
|
|
2565
2937
|
}) => null;
|
|
2566
2938
|
SendingStatus: (props: {
|
|
2567
|
-
component: ({ sendingStatus, containerStyle }: OutgoingMessageProps<"file" | "user"> & {
|
|
2939
|
+
component: ({ sendingStatus, containerStyle }: OutgoingMessageProps<"file" | "user" | "multipleFiles"> & {
|
|
2568
2940
|
containerStyle?: ViewStyle;
|
|
2569
2941
|
}) => ReactNode;
|
|
2570
2942
|
}) => null;
|
|
@@ -2590,6 +2962,18 @@ declare type OutgoingMessageUnion =
|
|
|
2590
2962
|
aspectRatio: string;
|
|
2591
2963
|
localFile?: unknown;
|
|
2592
2964
|
};
|
|
2965
|
+
}>
|
|
2966
|
+
| OutgoingBaseMessageProps<{
|
|
2967
|
+
messageType: 'multipleFiles';
|
|
2968
|
+
message: string;
|
|
2969
|
+
files: {
|
|
2970
|
+
type: string;
|
|
2971
|
+
url: string;
|
|
2972
|
+
name: string;
|
|
2973
|
+
}[];
|
|
2974
|
+
metadata: {
|
|
2975
|
+
localFiles?: unknown[];
|
|
2976
|
+
};
|
|
2593
2977
|
}>;
|
|
2594
2978
|
|
|
2595
2979
|
declare interface PaletteColor {
|
|
@@ -2813,6 +3197,7 @@ declare type SystemMessageUnion =
|
|
|
2813
3197
|
csatExpireAt?: number;
|
|
2814
3198
|
isResolvedWhenDeterminedByUser?: boolean;
|
|
2815
3199
|
onSubmitCSAT: (params: CSATSubmitParams) => Promise<void>;
|
|
3200
|
+
onScrollToBottom?: () => void;
|
|
2816
3201
|
}>;
|
|
2817
3202
|
|
|
2818
3203
|
declare type TextField = {
|