@sendbird/ai-agent-messenger-react 1.41.0 → 1.42.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 +154 -154
- package/dist/index.d.ts +62 -7
- package/dist/index.js +4060 -4022
- package/package.json +5 -9
package/dist/index.d.ts
CHANGED
|
@@ -65,8 +65,11 @@ declare interface ActiveChannelUpdatedParams {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export declare interface AgentClientHandlers extends AIAgentClientHandlers {
|
|
68
|
+
/** @internal */
|
|
68
69
|
onMessageSend?: (message: string) => void;
|
|
70
|
+
/** @internal */
|
|
69
71
|
onFunctionCallDetailClick?: (func: FunctionCallsInfo) => void;
|
|
72
|
+
/** @internal */
|
|
70
73
|
onInitializeFailed?: (error: Error) => void;
|
|
71
74
|
}
|
|
72
75
|
|
|
@@ -251,8 +254,7 @@ customApiHost?: string;
|
|
|
251
254
|
* */
|
|
252
255
|
agentPreviewConfigs?: AgentPreviewConfigs;
|
|
253
256
|
/**
|
|
254
|
-
* @
|
|
255
|
-
* @description Event handlers for the ai agent client.
|
|
257
|
+
* @public
|
|
256
258
|
*/
|
|
257
259
|
handlers?: AgentClientHandlers;
|
|
258
260
|
/**
|
|
@@ -267,7 +269,8 @@ enableCloseConversationButton?: boolean;
|
|
|
267
269
|
enableExpandButton?: boolean;
|
|
268
270
|
/**
|
|
269
271
|
* @internal
|
|
270
|
-
* @description Whether to automatically disconnect the WebSocket
|
|
272
|
+
* @description Whether to automatically disconnect the WebSocket after the messenger stays closed for 60 seconds.
|
|
273
|
+
* The legacy name is kept for compatibility; this applies regardless of launcher rendering or customization.
|
|
271
274
|
* Set to false to keep the connection alive even during inactivity. (default: true)
|
|
272
275
|
*/
|
|
273
276
|
enableAutoDisconnectInLauncher?: boolean;
|
|
@@ -439,6 +442,10 @@ declare interface AIAgentClientHandlers {
|
|
|
439
442
|
* should be efficient and non-blocking, as this may be called frequently.
|
|
440
443
|
*/
|
|
441
444
|
onLiveMetric?: (metric: LiveMetric) => void;
|
|
445
|
+
/**
|
|
446
|
+
* Called when a displayable nudge message is received after `requestNudgeMessage`.
|
|
447
|
+
*/
|
|
448
|
+
onNudgeMessageReceived?: (response: NudgeMessageResponse) => void;
|
|
442
449
|
}
|
|
443
450
|
|
|
444
451
|
declare type AIAgentCommonIconName =
|
|
@@ -1016,8 +1023,7 @@ export declare type AIAgentProps = PropsWithChildren<{
|
|
|
1016
1023
|
* */
|
|
1017
1024
|
agentPreviewConfigs?: AgentPreviewConfigs;
|
|
1018
1025
|
/**
|
|
1019
|
-
* @
|
|
1020
|
-
* @description Event handlers for the ai agent client.
|
|
1026
|
+
* @public
|
|
1021
1027
|
*/
|
|
1022
1028
|
handlers?: AgentClientHandlers;
|
|
1023
1029
|
/**
|
|
@@ -1032,7 +1038,8 @@ export declare type AIAgentProps = PropsWithChildren<{
|
|
|
1032
1038
|
enableExpandButton?: boolean;
|
|
1033
1039
|
/**
|
|
1034
1040
|
* @internal
|
|
1035
|
-
* @description Whether to automatically disconnect the WebSocket
|
|
1041
|
+
* @description Whether to automatically disconnect the WebSocket after the messenger stays closed for 60 seconds.
|
|
1042
|
+
* The legacy name is kept for compatibility; this applies regardless of launcher rendering or customization.
|
|
1036
1043
|
* Set to false to keep the connection alive even during inactivity. (default: true)
|
|
1037
1044
|
*/
|
|
1038
1045
|
enableAutoDisconnectInLauncher?: boolean;
|
|
@@ -3192,8 +3199,17 @@ export declare interface FeedbackInfo {
|
|
|
3192
3199
|
comment?: string;
|
|
3193
3200
|
}
|
|
3194
3201
|
|
|
3202
|
+
export declare interface FixedLauncherProps extends Pick<LauncherProps, 'opened' | 'setOpened' | 'entryPoint' | 'activeRoute'> {
|
|
3203
|
+
/** Configured launcher size, available for sizing or positioning your custom UI. */
|
|
3204
|
+
size?: number;
|
|
3205
|
+
/** Placement styles for the custom launcher. Apply them or use your own positioning. */
|
|
3206
|
+
style?: CSSProperties;
|
|
3207
|
+
}
|
|
3208
|
+
|
|
3195
3209
|
export declare const FixedMessenger: ForwardRefExoticComponent<MessengerProps & RefAttributes<MessengerSessionRef>> & {
|
|
3196
3210
|
Style: (props: FixedMessengerStyleProps) => null;
|
|
3211
|
+
Launcher: ({ component }: FixedMessengerLauncherProps) => null;
|
|
3212
|
+
NudgeMessage: ({ component }: FixedMessengerNudgeMessageProps) => null;
|
|
3197
3213
|
Conversation: ({ component }: FixedMessengerConversationProps) => null;
|
|
3198
3214
|
ConversationChildren: ({ children }: PropsWithChildren) => null;
|
|
3199
3215
|
ConversationList: ({ component }: FixedMessengerConversationListProps) => null;
|
|
@@ -3208,6 +3224,10 @@ declare interface FixedMessengerConversationProps {
|
|
|
3208
3224
|
component: ComponentType<ConversationProps>;
|
|
3209
3225
|
}
|
|
3210
3226
|
|
|
3227
|
+
declare interface FixedMessengerLauncherProps {
|
|
3228
|
+
component: ComponentType<FixedLauncherProps>;
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3211
3231
|
export declare type FixedMessengerMargin = {
|
|
3212
3232
|
top: number;
|
|
3213
3233
|
bottom: number;
|
|
@@ -3215,6 +3235,10 @@ export declare type FixedMessengerMargin = {
|
|
|
3215
3235
|
end: number;
|
|
3216
3236
|
};
|
|
3217
3237
|
|
|
3238
|
+
declare interface FixedMessengerNudgeMessageProps {
|
|
3239
|
+
component: ComponentType<FixedNudgeMessageProps>;
|
|
3240
|
+
}
|
|
3241
|
+
|
|
3218
3242
|
export declare type FixedMessengerPosition = `${PositionHorizontal}-${PositionVertical}`;
|
|
3219
3243
|
|
|
3220
3244
|
declare interface FixedMessengerStyleProps {
|
|
@@ -3237,6 +3261,11 @@ declare interface FixedMessengerStyleProps {
|
|
|
3237
3261
|
launcherSize?: number;
|
|
3238
3262
|
}
|
|
3239
3263
|
|
|
3264
|
+
export declare interface FixedNudgeMessageProps extends Omit<NudgeMessageViewProps, 'nudgeMessageKey'> {
|
|
3265
|
+
/** Placement styles for the custom nudge message. Apply them or use your own positioning. */
|
|
3266
|
+
style?: CSSProperties;
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3240
3269
|
declare type ForegroundTaskScheduler = (start: () => void) => void | (() => void);
|
|
3241
3270
|
|
|
3242
3271
|
declare interface Form {
|
|
@@ -5624,7 +5653,7 @@ declare interface LanguageSet extends Omit<AIAgentLanguageSet, 'strings'> {
|
|
|
5624
5653
|
stringSet: StringSet;
|
|
5625
5654
|
}
|
|
5626
5655
|
|
|
5627
|
-
export declare function LauncherBase({ className, children, isOpened, onClick, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, type, imageUrl, dir, animated, backgroundColor, size, hasUnread, }:
|
|
5656
|
+
export declare function LauncherBase({ className, children, isOpened, onClick, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, type, imageUrl, dir, animated, backgroundColor, size, hasUnread, }: LauncherProps_2): JSX.Element;
|
|
5628
5657
|
|
|
5629
5658
|
declare type LauncherImageType = 'default_icon' | 'custom_image';
|
|
5630
5659
|
|
|
@@ -5634,6 +5663,15 @@ declare interface LauncherInfo {
|
|
|
5634
5663
|
}
|
|
5635
5664
|
|
|
5636
5665
|
declare type LauncherProps = {
|
|
5666
|
+
opened: boolean;
|
|
5667
|
+
setOpened: (opened: boolean) => void;
|
|
5668
|
+
size?: number;
|
|
5669
|
+
className?: string;
|
|
5670
|
+
entryPoint?: LauncherRoute;
|
|
5671
|
+
activeRoute?: LauncherRoute;
|
|
5672
|
+
};
|
|
5673
|
+
|
|
5674
|
+
declare type LauncherProps_2 = {
|
|
5637
5675
|
className?: string;
|
|
5638
5676
|
children?: ReactNode;
|
|
5639
5677
|
isOpened: boolean;
|
|
@@ -5649,6 +5687,8 @@ declare type LauncherProps = {
|
|
|
5649
5687
|
hasUnread?: boolean;
|
|
5650
5688
|
};
|
|
5651
5689
|
|
|
5690
|
+
export declare type LauncherRoute = 'Conversation' | 'ConversationList';
|
|
5691
|
+
|
|
5652
5692
|
declare interface LayoutContextValue<Props, Components extends Record<string, ComponentType<any>>> {
|
|
5653
5693
|
Template: ComponentType<Props>;
|
|
5654
5694
|
updateTemplate: (template: ComponentType<Props>) => void;
|
|
@@ -6704,6 +6744,21 @@ export declare interface NudgeMessageResponse {
|
|
|
6704
6744
|
callbackUserMessage?: string;
|
|
6705
6745
|
}
|
|
6706
6746
|
|
|
6747
|
+
declare interface NudgeMessageState {
|
|
6748
|
+
/** The nudge to display; null while the messenger is opened or no nudge is active. */
|
|
6749
|
+
nudgeMessage: NudgeMessageResponse | null;
|
|
6750
|
+
/**
|
|
6751
|
+
* Counts nudges received and never falls back when one is cleared; each platform's renderer keys
|
|
6752
|
+
* the bubble on it to replay the entrance animation.
|
|
6753
|
+
*/
|
|
6754
|
+
nudgeMessageKey: number;
|
|
6755
|
+
dismissNudgeMessage: () => void;
|
|
6756
|
+
/** Starts a new conversation from the nudge: creates a channel, opens the messenger, and sends the callback user message. */
|
|
6757
|
+
startNudgeConversation: () => Promise<void>;
|
|
6758
|
+
}
|
|
6759
|
+
|
|
6760
|
+
declare type NudgeMessageViewProps = NudgeMessageState;
|
|
6761
|
+
|
|
6707
6762
|
declare type NumberField = {
|
|
6708
6763
|
key: string;
|
|
6709
6764
|
type: 'number';
|