@banbox/chat 1.0.7 → 1.0.9
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 +1236 -235
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +1160 -160
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat/InboxPopup.tsx +105 -42
- package/src/chat/SinglePopup.tsx +59 -14
- package/src/icons/index.tsx +55 -0
- package/src/index.ts +14 -12
- package/src/modals/ChatAddressModal.tsx +844 -0
- package/src/modals/{chat/ChatConfirmModal.tsx → ChatConfirmModal.tsx} +2 -2
- package/src/modals/ChatTranslateSettingsModal.tsx +182 -0
- package/src/styles/index.build.css +15 -0
- package/src/styles/index.css +10 -2
- package/src/ui/{chat/AttachmentPreviewStrip.tsx → AttachmentPreviewStrip.tsx} +2 -2
- package/src/ui/{chat/ChatComposerBar.tsx → ChatComposerBar.tsx} +2 -2
- package/src/ui/{chat/ChatFooter.tsx → ChatFooter.tsx} +102 -8
- package/src/ui/{chat/ChatHeader.tsx → ChatHeader.tsx} +7 -4
- package/src/ui/{chat/ChatIdentity.tsx → ChatIdentity.tsx} +2 -2
- package/src/ui/{chat/ChatInquiryBar.tsx → ChatInquiryBar.tsx} +1 -1
- package/src/ui/ChatKebabMenu.tsx +125 -0
- package/src/ui/{chat/ChatListHeader.tsx → ChatListHeader.tsx} +49 -25
- package/src/ui/{chat/ChatMessageItem.tsx → ChatMessageItem.tsx} +1 -1
- package/src/ui/ChatScroll.tsx +59 -0
- package/src/ui/{chat/ChatSpinner.tsx → ChatSpinner.tsx} +1 -1
- package/src/ui/{chat/ChatThreadItem.tsx → ChatThreadItem.tsx} +9 -16
- package/src/ui/{chat/MessageHoverActions.tsx → MessageHoverActions.tsx} +2 -2
- package/src/ui/{chat/ReplyCard.tsx → ReplyCard.tsx} +2 -2
- package/src/ui/{chat/TypingIndicator.tsx → TypingIndicator.tsx} +1 -1
- package/src/ui/{chat/drop-up → drop-up}/BusinessCardDropup.tsx +15 -3
- package/src/ui/{chat/drop-up → drop-up}/EmojiDropup.tsx +1 -1
- package/src/ui/{chat/message-items → message-items}/ChatAddressCard.tsx +4 -4
- package/src/ui/{chat/message-items → message-items}/ChatBubbleFiles.tsx +1 -1
- package/src/ui/{chat/message-items → message-items}/ChatBubbleImages.tsx +2 -2
- package/src/ui/{chat/message-items → message-items}/ChatBusinessCard.tsx +1 -1
- package/src/ui/{chat/scrollToMessage.ts → scrollToMessage.ts} +1 -1
- package/src/ui/{chat/types.ts → types.ts} +2 -2
- package/src/modals/chat/ChatTranslateSettingsModal.tsx +0 -180
- package/src/ui/chat/ChatScroll.tsx +0 -52
- /package/src/ui/{chat/message-items → message-items}/ChatBubbleAudio.tsx +0 -0
- /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 */
|
|
@@ -479,10 +481,12 @@ type Props$6 = {
|
|
|
479
481
|
children: React__default.ReactNode;
|
|
480
482
|
className?: string;
|
|
481
483
|
style?: React__default.CSSProperties;
|
|
484
|
+
/** set true if you want short threads anchored at the bottom */
|
|
482
485
|
bottomAlignWhenShort?: boolean;
|
|
486
|
+
/** when this value changes, we auto-scroll to the bottom */
|
|
483
487
|
scrollKey?: string | number;
|
|
484
488
|
};
|
|
485
|
-
declare const ChatScroll: React__default.
|
|
489
|
+
declare const ChatScroll: React__default.ForwardRefExoticComponent<Props$6 & React__default.RefAttributes<HTMLDivElement>>;
|
|
486
490
|
|
|
487
491
|
type ChatThreadStatus = {
|
|
488
492
|
kind: "seen";
|
|
@@ -503,7 +507,6 @@ type Props$5 = {
|
|
|
503
507
|
status: ChatThreadStatus;
|
|
504
508
|
avatarText: string;
|
|
505
509
|
avatarSrc?: string;
|
|
506
|
-
_size?: number;
|
|
507
510
|
avatarBg?: string;
|
|
508
511
|
className?: string;
|
|
509
512
|
onClick?: () => void;
|
|
@@ -514,6 +517,7 @@ type Props$4 = {
|
|
|
514
517
|
className?: string;
|
|
515
518
|
onClose?: () => void;
|
|
516
519
|
onSearchChange?: (value: string) => void;
|
|
520
|
+
hideSearch?: boolean;
|
|
517
521
|
};
|
|
518
522
|
declare const ChatListHeader: React__default.FC<Props$4>;
|
|
519
523
|
|
|
@@ -553,6 +557,14 @@ type Props = {
|
|
|
553
557
|
};
|
|
554
558
|
declare const ChatSpinner: React__default.FC<Props>;
|
|
555
559
|
|
|
560
|
+
type ChatKebabMenuProps = {
|
|
561
|
+
pinned?: boolean;
|
|
562
|
+
onPinToggle?: () => void;
|
|
563
|
+
onDelete?: () => void;
|
|
564
|
+
className?: string;
|
|
565
|
+
};
|
|
566
|
+
declare const ChatKebabMenu: React__default.FC<ChatKebabMenuProps>;
|
|
567
|
+
|
|
556
568
|
declare function cn(...inputs: ClassValue[]): string;
|
|
557
569
|
|
|
558
570
|
interface PortalProps {
|
|
@@ -561,4 +573,4 @@ interface PortalProps {
|
|
|
561
573
|
}
|
|
562
574
|
declare function Portal({ children, containerId }: PortalProps): React$1.ReactPortal | null;
|
|
563
575
|
|
|
564
|
-
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 };
|
|
576
|
+
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 */
|
|
@@ -479,10 +481,12 @@ type Props$6 = {
|
|
|
479
481
|
children: React__default.ReactNode;
|
|
480
482
|
className?: string;
|
|
481
483
|
style?: React__default.CSSProperties;
|
|
484
|
+
/** set true if you want short threads anchored at the bottom */
|
|
482
485
|
bottomAlignWhenShort?: boolean;
|
|
486
|
+
/** when this value changes, we auto-scroll to the bottom */
|
|
483
487
|
scrollKey?: string | number;
|
|
484
488
|
};
|
|
485
|
-
declare const ChatScroll: React__default.
|
|
489
|
+
declare const ChatScroll: React__default.ForwardRefExoticComponent<Props$6 & React__default.RefAttributes<HTMLDivElement>>;
|
|
486
490
|
|
|
487
491
|
type ChatThreadStatus = {
|
|
488
492
|
kind: "seen";
|
|
@@ -503,7 +507,6 @@ type Props$5 = {
|
|
|
503
507
|
status: ChatThreadStatus;
|
|
504
508
|
avatarText: string;
|
|
505
509
|
avatarSrc?: string;
|
|
506
|
-
_size?: number;
|
|
507
510
|
avatarBg?: string;
|
|
508
511
|
className?: string;
|
|
509
512
|
onClick?: () => void;
|
|
@@ -514,6 +517,7 @@ type Props$4 = {
|
|
|
514
517
|
className?: string;
|
|
515
518
|
onClose?: () => void;
|
|
516
519
|
onSearchChange?: (value: string) => void;
|
|
520
|
+
hideSearch?: boolean;
|
|
517
521
|
};
|
|
518
522
|
declare const ChatListHeader: React__default.FC<Props$4>;
|
|
519
523
|
|
|
@@ -553,6 +557,14 @@ type Props = {
|
|
|
553
557
|
};
|
|
554
558
|
declare const ChatSpinner: React__default.FC<Props>;
|
|
555
559
|
|
|
560
|
+
type ChatKebabMenuProps = {
|
|
561
|
+
pinned?: boolean;
|
|
562
|
+
onPinToggle?: () => void;
|
|
563
|
+
onDelete?: () => void;
|
|
564
|
+
className?: string;
|
|
565
|
+
};
|
|
566
|
+
declare const ChatKebabMenu: React__default.FC<ChatKebabMenuProps>;
|
|
567
|
+
|
|
556
568
|
declare function cn(...inputs: ClassValue[]): string;
|
|
557
569
|
|
|
558
570
|
interface PortalProps {
|
|
@@ -561,4 +573,4 @@ interface PortalProps {
|
|
|
561
573
|
}
|
|
562
574
|
declare function Portal({ children, containerId }: PortalProps): React$1.ReactPortal | null;
|
|
563
575
|
|
|
564
|
-
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 };
|
|
576
|
+
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 };
|