@banbox/chat 1.0.8 → 1.0.10

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/index.cjs +1203 -265
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +18 -2
  4. package/dist/index.d.ts +18 -2
  5. package/dist/index.js +1127 -190
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/chat/InboxPopup.tsx +38 -35
  9. package/src/chat/SinglePopup.tsx +81 -40
  10. package/src/icons/index.tsx +55 -0
  11. package/src/index.ts +14 -12
  12. package/src/modals/ChatAddressModal.tsx +844 -0
  13. package/src/modals/{chat/ChatConfirmModal.tsx → ChatConfirmModal.tsx} +2 -2
  14. package/src/modals/ChatTranslateSettingsModal.tsx +182 -0
  15. package/src/styles/index.build.css +15 -0
  16. package/src/styles/index.css +10 -2
  17. package/src/ui/{chat/AttachmentPreviewStrip.tsx → AttachmentPreviewStrip.tsx} +2 -2
  18. package/src/ui/{chat/ChatComposerBar.tsx → ChatComposerBar.tsx} +2 -2
  19. package/src/ui/{chat/ChatFooter.tsx → ChatFooter.tsx} +102 -8
  20. package/src/ui/{chat/ChatIdentity.tsx → ChatIdentity.tsx} +2 -2
  21. package/src/ui/{chat/ChatInquiryBar.tsx → ChatInquiryBar.tsx} +1 -1
  22. package/src/ui/ChatKebabMenu.tsx +125 -0
  23. package/src/ui/{chat/ChatListHeader.tsx → ChatListHeader.tsx} +1 -1
  24. package/src/ui/{chat/ChatMessageItem.tsx → ChatMessageItem.tsx} +10 -32
  25. package/src/ui/{chat/ChatScroll.tsx → ChatScroll.tsx} +1 -1
  26. package/src/ui/{chat/ChatSpinner.tsx → ChatSpinner.tsx} +1 -1
  27. package/src/ui/{chat/ChatThreadItem.tsx → ChatThreadItem.tsx} +1 -1
  28. package/src/ui/{chat/MessageHoverActions.tsx → MessageHoverActions.tsx} +2 -2
  29. package/src/ui/{chat/ReplyCard.tsx → ReplyCard.tsx} +2 -2
  30. package/src/ui/{chat/TypingIndicator.tsx → TypingIndicator.tsx} +1 -1
  31. package/src/ui/{chat/drop-up → drop-up}/BusinessCardDropup.tsx +15 -3
  32. package/src/ui/{chat/drop-up → drop-up}/EmojiDropup.tsx +1 -1
  33. package/src/ui/{chat/message-items → message-items}/ChatAddressCard.tsx +4 -4
  34. package/src/ui/{chat/message-items → message-items}/ChatBubbleFiles.tsx +1 -1
  35. package/src/ui/{chat/message-items → message-items}/ChatBubbleImages.tsx +2 -2
  36. package/src/ui/{chat/message-items → message-items}/ChatBusinessCard.tsx +1 -1
  37. package/src/ui/{chat/scrollToMessage.ts → scrollToMessage.ts} +1 -1
  38. package/src/ui/{chat/types.ts → types.ts} +2 -2
  39. package/src/utils/theme.ts +37 -0
  40. package/src/modals/chat/ChatTranslateSettingsModal.tsx +0 -180
  41. /package/src/ui/{chat/ChatHeader.tsx → ChatHeader.tsx} +0 -0
  42. /package/src/ui/{chat/message-items → message-items}/ChatBubbleAudio.tsx +0 -0
  43. /package/src/ui/{chat/message-items → message-items}/ChatBubbleText.tsx +0 -0
package/dist/index.d.cts CHANGED
@@ -395,6 +395,8 @@ type Props$8 = {
395
395
  /** Called after send completes — triggers parent re-render / scroll */
396
396
  onAfterSend?: () => void;
397
397
  actions?: FooterAction[];
398
+ /** Keys of actions to hide from the toolbar, e.g. ["businessCard", "addressCard"] */
399
+ hiddenActionKeys?: string[];
398
400
  className?: string;
399
401
  maxRows?: number;
400
402
  /** The message being replied to */
@@ -469,7 +471,13 @@ type ChatMessageItemProps = {
469
471
  status?: string;
470
472
  className?: string;
471
473
  onReply?: () => void;
472
- onTranslate?: () => void;
474
+ /**
475
+ * Optional async translator. Receives the original text and returns the
476
+ * translated string. When omitted the translate button is still shown but
477
+ * does nothing (good for demo mode).
478
+ * Example: `onTranslate={(t) => googleTranslate(t, "bn")}`
479
+ */
480
+ onTranslate?: (text: string) => string | undefined;
473
481
  initialSrc?: string;
474
482
  };
475
483
  declare const ChatMessageItem: React__default.FC<ChatMessageItemProps>;
@@ -555,6 +563,14 @@ type Props = {
555
563
  };
556
564
  declare const ChatSpinner: React__default.FC<Props>;
557
565
 
566
+ type ChatKebabMenuProps = {
567
+ pinned?: boolean;
568
+ onPinToggle?: () => void;
569
+ onDelete?: () => void;
570
+ className?: string;
571
+ };
572
+ declare const ChatKebabMenu: React__default.FC<ChatKebabMenuProps>;
573
+
558
574
  declare function cn(...inputs: ClassValue[]): string;
559
575
 
560
576
  interface PortalProps {
@@ -563,4 +579,4 @@ interface PortalProps {
563
579
  }
564
580
  declare function Portal({ children, containerId }: PortalProps): React$1.ReactPortal | null;
565
581
 
566
- export { type AddressCard$1 as AddressCard, type BusinessCard$1 as BusinessCard, type ChatAdapter, ChatFooter, ChatHeader, ChatIdentity, ChatInquiryBar, ChatListHeader, ChatMessageItem, ChatRoot, type ChatRootProps, ChatScroll, ChatSpinner, type ChatTheme, ChatThreadItem, type ChatThreadStatus, type ChatUICallbacks, ChatUIContext, ChatUIProvider, type ChatUIState, type ChatVariant, type KebabMenuOpts, type Message, type MessageAudio, type MessageFile, type MessageRef$1 as MessageRef, Portal, type Reference, ReplyCard, type SendPayload, type Thread, type ThreadStatus, type ToastOpts, TypingIndicator, cn, useChatUI };
582
+ export { type AddressCard$1 as AddressCard, type BusinessCard$1 as BusinessCard, type ChatAdapter, ChatFooter, ChatHeader, ChatIdentity, ChatInquiryBar, ChatKebabMenu, type ChatKebabMenuProps, ChatListHeader, ChatMessageItem, ChatRoot, type ChatRootProps, ChatScroll, ChatSpinner, type ChatTheme, ChatThreadItem, type ChatThreadStatus, type ChatUICallbacks, ChatUIContext, ChatUIProvider, type ChatUIState, type ChatVariant, type KebabMenuOpts, type Message, type MessageAudio, type MessageFile, type MessageRef$1 as MessageRef, Portal, type Reference, ReplyCard, type SendPayload, type Thread, type ThreadStatus, type ToastOpts, TypingIndicator, cn, useChatUI };
package/dist/index.d.ts CHANGED
@@ -395,6 +395,8 @@ type Props$8 = {
395
395
  /** Called after send completes — triggers parent re-render / scroll */
396
396
  onAfterSend?: () => void;
397
397
  actions?: FooterAction[];
398
+ /** Keys of actions to hide from the toolbar, e.g. ["businessCard", "addressCard"] */
399
+ hiddenActionKeys?: string[];
398
400
  className?: string;
399
401
  maxRows?: number;
400
402
  /** The message being replied to */
@@ -469,7 +471,13 @@ type ChatMessageItemProps = {
469
471
  status?: string;
470
472
  className?: string;
471
473
  onReply?: () => void;
472
- onTranslate?: () => void;
474
+ /**
475
+ * Optional async translator. Receives the original text and returns the
476
+ * translated string. When omitted the translate button is still shown but
477
+ * does nothing (good for demo mode).
478
+ * Example: `onTranslate={(t) => googleTranslate(t, "bn")}`
479
+ */
480
+ onTranslate?: (text: string) => string | undefined;
473
481
  initialSrc?: string;
474
482
  };
475
483
  declare const ChatMessageItem: React__default.FC<ChatMessageItemProps>;
@@ -555,6 +563,14 @@ type Props = {
555
563
  };
556
564
  declare const ChatSpinner: React__default.FC<Props>;
557
565
 
566
+ type ChatKebabMenuProps = {
567
+ pinned?: boolean;
568
+ onPinToggle?: () => void;
569
+ onDelete?: () => void;
570
+ className?: string;
571
+ };
572
+ declare const ChatKebabMenu: React__default.FC<ChatKebabMenuProps>;
573
+
558
574
  declare function cn(...inputs: ClassValue[]): string;
559
575
 
560
576
  interface PortalProps {
@@ -563,4 +579,4 @@ interface PortalProps {
563
579
  }
564
580
  declare function Portal({ children, containerId }: PortalProps): React$1.ReactPortal | null;
565
581
 
566
- export { type AddressCard$1 as AddressCard, type BusinessCard$1 as BusinessCard, type ChatAdapter, ChatFooter, ChatHeader, ChatIdentity, ChatInquiryBar, ChatListHeader, ChatMessageItem, ChatRoot, type ChatRootProps, ChatScroll, ChatSpinner, type ChatTheme, ChatThreadItem, type ChatThreadStatus, type ChatUICallbacks, ChatUIContext, ChatUIProvider, type ChatUIState, type ChatVariant, type KebabMenuOpts, type Message, type MessageAudio, type MessageFile, type MessageRef$1 as MessageRef, Portal, type Reference, ReplyCard, type SendPayload, type Thread, type ThreadStatus, type ToastOpts, TypingIndicator, cn, useChatUI };
582
+ export { type AddressCard$1 as AddressCard, type BusinessCard$1 as BusinessCard, type ChatAdapter, ChatFooter, ChatHeader, ChatIdentity, ChatInquiryBar, ChatKebabMenu, type ChatKebabMenuProps, ChatListHeader, ChatMessageItem, ChatRoot, type ChatRootProps, ChatScroll, ChatSpinner, type ChatTheme, ChatThreadItem, type ChatThreadStatus, type ChatUICallbacks, ChatUIContext, ChatUIProvider, type ChatUIState, type ChatVariant, type KebabMenuOpts, type Message, type MessageAudio, type MessageFile, type MessageRef$1 as MessageRef, Portal, type Reference, ReplyCard, type SendPayload, type Thread, type ThreadStatus, type ToastOpts, TypingIndicator, cn, useChatUI };