@banbox/chat 1.0.1 → 1.0.2
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 +564 -576
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -41
- package/dist/index.d.ts +43 -41
- package/dist/index.js +486 -499
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/chat/InboxPopup.tsx +51 -46
- package/src/chat/SinglePopup.tsx +47 -58
- package/src/lottie/banbox-chat-globe.json +1 -0
- package/src/ui/chat/AttachmentPreviewStrip.tsx +63 -112
- package/src/ui/chat/ChatComposerBar.tsx +22 -38
- package/src/ui/chat/ChatFooter.tsx +1 -1
- package/src/ui/chat/ChatIdentity.tsx +148 -145
- package/src/ui/chat/ChatListHeader.tsx +60 -83
- package/src/ui/chat/ChatMessageItem.tsx +193 -214
- package/src/ui/chat/ChatThreadItem.tsx +133 -140
- package/src/ui/chat/MessageHoverActions.tsx +136 -120
- package/src/ui/chat/TypingIndicator.tsx +23 -43
- package/src/ui/chat/drop-up/BusinessCardDropup.tsx +9 -1
- package/src/ui/chat/types.ts +42 -37
package/dist/index.d.cts
CHANGED
|
@@ -334,6 +334,43 @@ type ChatUIState = {
|
|
|
334
334
|
declare const ChatUIContext: React$1.Context<ChatUIState | null>;
|
|
335
335
|
declare function useChatUI(): ChatUIState;
|
|
336
336
|
|
|
337
|
+
type MessageRef = {
|
|
338
|
+
id: string;
|
|
339
|
+
author: string | {
|
|
340
|
+
name: string;
|
|
341
|
+
};
|
|
342
|
+
time?: string;
|
|
343
|
+
text?: string;
|
|
344
|
+
images?: string[];
|
|
345
|
+
files?: MessageFile[];
|
|
346
|
+
audio?: MessageAudio;
|
|
347
|
+
};
|
|
348
|
+
type BusinessCard = {
|
|
349
|
+
avatarSrc?: string;
|
|
350
|
+
name: string;
|
|
351
|
+
country?: string;
|
|
352
|
+
flag?: string;
|
|
353
|
+
company?: string;
|
|
354
|
+
email?: string;
|
|
355
|
+
phone?: string;
|
|
356
|
+
[key: string]: string | undefined;
|
|
357
|
+
};
|
|
358
|
+
type AddressCard = {
|
|
359
|
+
name?: string;
|
|
360
|
+
label?: string;
|
|
361
|
+
businessName?: string;
|
|
362
|
+
mobileNumber?: string;
|
|
363
|
+
country?: string;
|
|
364
|
+
district?: string | null;
|
|
365
|
+
policeStation?: string | null;
|
|
366
|
+
state?: string | null;
|
|
367
|
+
city?: string | null;
|
|
368
|
+
postalCode?: string;
|
|
369
|
+
addressLine?: string;
|
|
370
|
+
landMark?: string | null;
|
|
371
|
+
[key: string]: string | null | undefined;
|
|
372
|
+
};
|
|
373
|
+
|
|
337
374
|
type FooterAction = {
|
|
338
375
|
key: "attachment" | "emoji" | "businessCard" | "addressCard" | "translate" | string;
|
|
339
376
|
title: string;
|
|
@@ -353,7 +390,7 @@ type Props$8 = {
|
|
|
353
390
|
className?: string;
|
|
354
391
|
maxRows?: number;
|
|
355
392
|
/** The message being replied to */
|
|
356
|
-
replyTo?: MessageRef
|
|
393
|
+
replyTo?: MessageRef;
|
|
357
394
|
clearReply?: () => void;
|
|
358
395
|
};
|
|
359
396
|
declare const ChatFooter: React__default.FC<Props$8>;
|
|
@@ -394,42 +431,7 @@ type LogoVariant = BaseProps & {
|
|
|
394
431
|
ringColor?: string;
|
|
395
432
|
};
|
|
396
433
|
type ChatIdentityProps = AvatarVariant | InitialVariant | LogoVariant;
|
|
397
|
-
declare const ChatIdentity:
|
|
398
|
-
|
|
399
|
-
type MessageRef = {
|
|
400
|
-
id: string;
|
|
401
|
-
author: string | {
|
|
402
|
-
name: string;
|
|
403
|
-
};
|
|
404
|
-
time?: string;
|
|
405
|
-
text?: string;
|
|
406
|
-
images?: string[];
|
|
407
|
-
files?: ChatFile[];
|
|
408
|
-
audio?: ChatAudio;
|
|
409
|
-
};
|
|
410
|
-
type BusinessCard = {
|
|
411
|
-
avatarSrc: string;
|
|
412
|
-
name: string;
|
|
413
|
-
country: string;
|
|
414
|
-
flag?: string;
|
|
415
|
-
company: string;
|
|
416
|
-
email: string;
|
|
417
|
-
phone: string;
|
|
418
|
-
};
|
|
419
|
-
type AddressCard = {
|
|
420
|
-
name: string;
|
|
421
|
-
label?: "Home" | "Office";
|
|
422
|
-
businessName?: string;
|
|
423
|
-
mobileNumber: string;
|
|
424
|
-
country: string;
|
|
425
|
-
district?: string | null;
|
|
426
|
-
policeStation?: string | null;
|
|
427
|
-
state?: string | null;
|
|
428
|
-
city?: string | null;
|
|
429
|
-
postalCode?: string;
|
|
430
|
-
addressLine: string;
|
|
431
|
-
landMark?: string | null;
|
|
432
|
-
};
|
|
434
|
+
declare const ChatIdentity: React__default.FC<ChatIdentityProps>;
|
|
433
435
|
|
|
434
436
|
type ChatAudio = {
|
|
435
437
|
src?: string;
|
|
@@ -462,7 +464,7 @@ type ChatMessageItemProps = {
|
|
|
462
464
|
onTranslate?: () => void;
|
|
463
465
|
initialSrc?: string;
|
|
464
466
|
};
|
|
465
|
-
declare const ChatMessageItem:
|
|
467
|
+
declare const ChatMessageItem: React__default.FC<ChatMessageItemProps>;
|
|
466
468
|
|
|
467
469
|
type Props$6 = {
|
|
468
470
|
top?: React__default.ReactNode;
|
|
@@ -494,19 +496,19 @@ type Props$5 = {
|
|
|
494
496
|
status: ChatThreadStatus;
|
|
495
497
|
avatarText: string;
|
|
496
498
|
avatarSrc?: string;
|
|
497
|
-
|
|
499
|
+
_size?: number;
|
|
498
500
|
avatarBg?: string;
|
|
499
501
|
className?: string;
|
|
500
502
|
onClick?: () => void;
|
|
501
503
|
};
|
|
502
|
-
declare const ChatThreadItem:
|
|
504
|
+
declare const ChatThreadItem: React__default.FC<Props$5>;
|
|
503
505
|
|
|
504
506
|
type Props$4 = {
|
|
505
507
|
className?: string;
|
|
506
508
|
onClose?: () => void;
|
|
507
509
|
onSearchChange?: (value: string) => void;
|
|
508
510
|
};
|
|
509
|
-
declare const ChatListHeader:
|
|
511
|
+
declare const ChatListHeader: React__default.FC<Props$4>;
|
|
510
512
|
|
|
511
513
|
type Props$3 = {
|
|
512
514
|
id?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -334,6 +334,43 @@ type ChatUIState = {
|
|
|
334
334
|
declare const ChatUIContext: React$1.Context<ChatUIState | null>;
|
|
335
335
|
declare function useChatUI(): ChatUIState;
|
|
336
336
|
|
|
337
|
+
type MessageRef = {
|
|
338
|
+
id: string;
|
|
339
|
+
author: string | {
|
|
340
|
+
name: string;
|
|
341
|
+
};
|
|
342
|
+
time?: string;
|
|
343
|
+
text?: string;
|
|
344
|
+
images?: string[];
|
|
345
|
+
files?: MessageFile[];
|
|
346
|
+
audio?: MessageAudio;
|
|
347
|
+
};
|
|
348
|
+
type BusinessCard = {
|
|
349
|
+
avatarSrc?: string;
|
|
350
|
+
name: string;
|
|
351
|
+
country?: string;
|
|
352
|
+
flag?: string;
|
|
353
|
+
company?: string;
|
|
354
|
+
email?: string;
|
|
355
|
+
phone?: string;
|
|
356
|
+
[key: string]: string | undefined;
|
|
357
|
+
};
|
|
358
|
+
type AddressCard = {
|
|
359
|
+
name?: string;
|
|
360
|
+
label?: string;
|
|
361
|
+
businessName?: string;
|
|
362
|
+
mobileNumber?: string;
|
|
363
|
+
country?: string;
|
|
364
|
+
district?: string | null;
|
|
365
|
+
policeStation?: string | null;
|
|
366
|
+
state?: string | null;
|
|
367
|
+
city?: string | null;
|
|
368
|
+
postalCode?: string;
|
|
369
|
+
addressLine?: string;
|
|
370
|
+
landMark?: string | null;
|
|
371
|
+
[key: string]: string | null | undefined;
|
|
372
|
+
};
|
|
373
|
+
|
|
337
374
|
type FooterAction = {
|
|
338
375
|
key: "attachment" | "emoji" | "businessCard" | "addressCard" | "translate" | string;
|
|
339
376
|
title: string;
|
|
@@ -353,7 +390,7 @@ type Props$8 = {
|
|
|
353
390
|
className?: string;
|
|
354
391
|
maxRows?: number;
|
|
355
392
|
/** The message being replied to */
|
|
356
|
-
replyTo?: MessageRef
|
|
393
|
+
replyTo?: MessageRef;
|
|
357
394
|
clearReply?: () => void;
|
|
358
395
|
};
|
|
359
396
|
declare const ChatFooter: React__default.FC<Props$8>;
|
|
@@ -394,42 +431,7 @@ type LogoVariant = BaseProps & {
|
|
|
394
431
|
ringColor?: string;
|
|
395
432
|
};
|
|
396
433
|
type ChatIdentityProps = AvatarVariant | InitialVariant | LogoVariant;
|
|
397
|
-
declare const ChatIdentity:
|
|
398
|
-
|
|
399
|
-
type MessageRef = {
|
|
400
|
-
id: string;
|
|
401
|
-
author: string | {
|
|
402
|
-
name: string;
|
|
403
|
-
};
|
|
404
|
-
time?: string;
|
|
405
|
-
text?: string;
|
|
406
|
-
images?: string[];
|
|
407
|
-
files?: ChatFile[];
|
|
408
|
-
audio?: ChatAudio;
|
|
409
|
-
};
|
|
410
|
-
type BusinessCard = {
|
|
411
|
-
avatarSrc: string;
|
|
412
|
-
name: string;
|
|
413
|
-
country: string;
|
|
414
|
-
flag?: string;
|
|
415
|
-
company: string;
|
|
416
|
-
email: string;
|
|
417
|
-
phone: string;
|
|
418
|
-
};
|
|
419
|
-
type AddressCard = {
|
|
420
|
-
name: string;
|
|
421
|
-
label?: "Home" | "Office";
|
|
422
|
-
businessName?: string;
|
|
423
|
-
mobileNumber: string;
|
|
424
|
-
country: string;
|
|
425
|
-
district?: string | null;
|
|
426
|
-
policeStation?: string | null;
|
|
427
|
-
state?: string | null;
|
|
428
|
-
city?: string | null;
|
|
429
|
-
postalCode?: string;
|
|
430
|
-
addressLine: string;
|
|
431
|
-
landMark?: string | null;
|
|
432
|
-
};
|
|
434
|
+
declare const ChatIdentity: React__default.FC<ChatIdentityProps>;
|
|
433
435
|
|
|
434
436
|
type ChatAudio = {
|
|
435
437
|
src?: string;
|
|
@@ -462,7 +464,7 @@ type ChatMessageItemProps = {
|
|
|
462
464
|
onTranslate?: () => void;
|
|
463
465
|
initialSrc?: string;
|
|
464
466
|
};
|
|
465
|
-
declare const ChatMessageItem:
|
|
467
|
+
declare const ChatMessageItem: React__default.FC<ChatMessageItemProps>;
|
|
466
468
|
|
|
467
469
|
type Props$6 = {
|
|
468
470
|
top?: React__default.ReactNode;
|
|
@@ -494,19 +496,19 @@ type Props$5 = {
|
|
|
494
496
|
status: ChatThreadStatus;
|
|
495
497
|
avatarText: string;
|
|
496
498
|
avatarSrc?: string;
|
|
497
|
-
|
|
499
|
+
_size?: number;
|
|
498
500
|
avatarBg?: string;
|
|
499
501
|
className?: string;
|
|
500
502
|
onClick?: () => void;
|
|
501
503
|
};
|
|
502
|
-
declare const ChatThreadItem:
|
|
504
|
+
declare const ChatThreadItem: React__default.FC<Props$5>;
|
|
503
505
|
|
|
504
506
|
type Props$4 = {
|
|
505
507
|
className?: string;
|
|
506
508
|
onClose?: () => void;
|
|
507
509
|
onSearchChange?: (value: string) => void;
|
|
508
510
|
};
|
|
509
|
-
declare const ChatListHeader:
|
|
511
|
+
declare const ChatListHeader: React__default.FC<Props$4>;
|
|
510
512
|
|
|
511
513
|
type Props$3 = {
|
|
512
514
|
id?: string;
|