@sendbird/ai-agent-messenger-react 1.23.0 → 1.24.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.d.ts CHANGED
@@ -12,7 +12,6 @@ import { Conversation as Conversation_2 } from '@sendbird/chat/aiAgent';
12
12
  import { ConversationStatus } from '@sendbird/chat/aiAgent';
13
13
  import { CSSProperties } from 'react';
14
14
  import { DeskChannelFilter } from '@sendbird/chat/aiAgent';
15
- import { FC } from 'react';
16
15
  import { FileMessage } from '@sendbird/chat/message';
17
16
  import { FileMessageCreateParams } from '@sendbird/chat/message';
18
17
  import { format } from 'date-fns';
@@ -23,7 +22,6 @@ import { GroupChannelHandler } from '@sendbird/chat/groupChannel';
23
22
  import { GroupChannelListOrder } from '@sendbird/chat/groupChannel';
24
23
  import { GroupChannelModule } from '@sendbird/chat/groupChannel';
25
24
  import { JSX } from 'react/jsx-runtime';
26
- import { LazyExoticComponent } from 'react';
27
25
  import type { Locale } from 'date-fns';
28
26
  import { LogLevel as LogLevel_2 } from '@sendbird/chat';
29
27
  import { MultipleFilesMessage } from '@sendbird/chat/message';
@@ -36,7 +34,6 @@ import { SendbirdChatParams } from '@sendbird/chat';
36
34
  import { SendbirdChatWith } from '@sendbird/chat';
37
35
  import { SendbirdError } from '@sendbird/chat';
38
36
  import { SessionHandler } from '@sendbird/chat';
39
- import { SVGProps } from 'react';
40
37
  import { UIEvent as UIEvent_2 } from 'react';
41
38
  import { User } from '@sendbird/chat';
42
39
  import { UserMessage } from '@sendbird/chat/message';
@@ -203,6 +200,11 @@ userSessionInfo?: ManualSessionInfo | AnonymousSessionInfo | UserSessionInfo;
203
200
  stringSet?: Partial<StringSet>;
204
201
  /**
205
202
  * @public
203
+ * @description Custom icon registry for the ai agent client.
204
+ * */
205
+ icons?: IconRegistry;
206
+ /**
207
+ * @public
206
208
  * @description dir of the widget.
207
209
  * */
208
210
  dir?: "ltr" | "rtl";
@@ -288,7 +290,7 @@ __internalVariables?: InternalMessageTemplateVariables;
288
290
  children?: ReactNode | undefined;
289
291
  } & RefAttributes<MessengerSessionRef>>;
290
292
 
291
- export declare function AgentUIProviderContainer({ appearance, rootElement, logger, language, languageCode, stringSet, children, messageTemplate, theme, }: Props): JSX.Element;
293
+ export declare function AgentUIProviderContainer({ appearance, rootElement, logger, language, languageCode, stringSet, children, messageTemplate, icons, theme, }: Props): JSX.Element;
292
294
 
293
295
  declare abstract class AIAgentBaseStats {
294
296
  protected timers: Map<string, TimerData> = new Map();
@@ -383,6 +385,36 @@ declare interface AIAgentCache {
383
385
  messenger: MessengerSessionCache;
384
386
  }
385
387
 
388
+ declare type AIAgentCommonIconName =
389
+ | 'close'
390
+ | 'send'
391
+ | 'menu'
392
+ | 'spinner'
393
+ | 'chat'
394
+ | 'message'
395
+ | 'error'
396
+ | 'refresh'
397
+ | 'chevron-down'
398
+ | 'done'
399
+ | 'done-circle'
400
+ | 'stop'
401
+ | 'stop-circle'
402
+ | 'user'
403
+ | 'file-document'
404
+ | 'agent'
405
+ | 'radio-on'
406
+ | 'radio-off'
407
+ | 'source'
408
+ | 'copy'
409
+ | 'good'
410
+ | 'bad'
411
+ | 'good-filled'
412
+ | 'bad-filled'
413
+ | 'delight'
414
+ | 'photo'
415
+ | 'add'
416
+ | 'document';
417
+
386
418
  export declare interface AIAgentConfig {
387
419
  conversation?: {
388
420
  /**
@@ -557,6 +589,22 @@ declare interface AIAgentGroupChannelFilter {
557
589
  copilotSupportChannelUrl?: string;
558
590
  }
559
591
 
592
+ declare type AIAgentIconComponent = ComponentType<AIAgentIconComponentProps>;
593
+
594
+ declare type AIAgentIconComponentProps = {
595
+ size?: number | string;
596
+ color?: string;
597
+ /**
598
+ * Metadata flag. When true, this icon is a direction-sensitive glyph and should be
599
+ * horizontally flipped by the implementation when rendered in an RTL layout.
600
+ * The value does not reflect the current layout direction — it only marks the icon
601
+ * as eligible for flipping.
602
+ */
603
+ flipInRtl?: boolean;
604
+ };
605
+
606
+ declare type AIAgentIconRegistry<T extends string = AIAgentCommonIconName> = Partial<Record<T, AIAgentIconComponent>>;
607
+
560
608
  declare interface AIAgentInfo {
561
609
  userId: string;
562
610
  nickname: string;
@@ -775,6 +823,11 @@ export declare type AIAgentProps = PropsWithChildren<{
775
823
  * @description Localization string set for the ai agent client.
776
824
  * */
777
825
  stringSet?: Partial<StringSet>;
826
+ /**
827
+ * @public
828
+ * @description Custom icon registry for the ai agent client.
829
+ * */
830
+ icons?: IconRegistry;
778
831
  /**
779
832
  * @public
780
833
  * @description dir of the widget.
@@ -2409,64 +2462,13 @@ export declare interface GroundednessInfo {
2409
2462
  */
2410
2463
  declare type HexColor = `#${string}`;
2411
2464
 
2412
- /**
2413
- * frequently used icons are imported statically, and others are imported dynamically.
2414
- * */
2415
- declare const icons: {
2416
- readonly close: FC<SVGProps<SVGElement>>;
2417
- readonly send: FC<SVGProps<SVGElement>>;
2418
- readonly menu: FC<SVGProps<SVGElement>>;
2419
- readonly expand: FC<SVGProps<SVGElement>>;
2420
- readonly collapse: FC<SVGProps<SVGElement>>;
2421
- readonly spinner: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2422
- readonly chat: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2423
- readonly message: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2424
- readonly error: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2425
- readonly info: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2426
- readonly refresh: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2427
- readonly 'chevron-down': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2428
- readonly 'chevron-right': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2429
- readonly done: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2430
- readonly 'done-circle': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2431
- readonly stop: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2432
- readonly 'stop-circle': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2433
- readonly user: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2434
- readonly 'file-document': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2435
- readonly download: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2436
- readonly attach: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2437
- readonly delete: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2438
- readonly 'close-filled': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2439
- readonly agent: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2440
- readonly question: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2441
- readonly actionbook: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2442
- readonly function: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2443
- readonly 'radio-on': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2444
- readonly 'radio-off': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2445
- readonly confluence: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2446
- readonly zendesk: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2447
- readonly salesforce: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2448
- readonly sprinklr: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2449
- readonly website: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2450
- readonly snippet: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2451
- readonly template: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2452
- readonly source: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2453
- readonly bot: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2454
- readonly 'bot-filled': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2455
- readonly copy: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2456
- readonly show: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2457
- readonly mute: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2458
- readonly good: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2459
- readonly bad: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2460
- readonly 'good-filled': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2461
- readonly 'bad-filled': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2462
- readonly delight: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2463
- readonly photo: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2464
- readonly 'arrow-left': LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2465
- readonly add: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2466
- readonly document: LazyExoticComponent<FC<SVGProps<SVGElement>>>;
2467
- };
2465
+ export declare type IconComponent = AIAgentIconComponent;
2466
+
2467
+ export declare type IconComponentProps = AIAgentIconComponentProps;
2468
2468
 
2469
- declare type IconType = keyof typeof icons;
2469
+ export declare type IconRegistry = AIAgentIconRegistry<IconType>;
2470
+
2471
+ export declare type IconType = AIAgentCommonIconName | ReactOnlyIconName;
2470
2472
 
2471
2473
  declare type IncomingBaseMessageProps<T> = T &
2472
2474
  BaseMessageProps<{
@@ -4193,6 +4195,7 @@ declare type Props = {
4193
4195
  language?: string;
4194
4196
  /** @internal DO NOT USE THIS **/
4195
4197
  languageCode?: string;
4198
+ icons?: IconRegistry;
4196
4199
  theme?: {
4197
4200
  palette?: Partial<PaletteShape>;
4198
4201
  typography?: Partial<{
@@ -4252,6 +4255,8 @@ declare type Props_4 = PropsWithChildren<{
4252
4255
  style?: CSSProperties;
4253
4256
  }>;
4254
4257
 
4258
+ declare type ReactOnlyIconName = 'expand' | 'collapse' | 'chevron-right' | 'download' | 'attach' | 'close-filled' | 'actionbook' | 'function' | 'confluence' | 'zendesk' | 'salesforce' | 'sprinklr' | 'website' | 'snippet' | 'template' | 'show' | 'mute';
4259
+
4255
4260
  declare type SBUFoundationProps<T = NonNullable<unknown>> = T & {
4256
4261
  className?: string;
4257
4262
  children?: ReactNode;