@talkjs/react-components 0.0.30 → 0.0.31
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/README.md +3 -3
- package/default.cjs +1310 -0
- package/default.css +1 -1
- package/default.d.ts +428 -62
- package/default.js +14753 -2631
- package/package.json +18 -30
- package/globalConstants.js +0 -52
- package/theming.d.ts +0 -1351
- package/theming.js +0 -1379
package/default.d.ts
CHANGED
|
@@ -2,13 +2,14 @@ import { AudioBlock } from '@talkjs/core';
|
|
|
2
2
|
import { ConversationSnapshot } from '@talkjs/core';
|
|
3
3
|
import { EditMessageParams } from '@talkjs/core';
|
|
4
4
|
import { EditTextMessageParams } from '@talkjs/core';
|
|
5
|
+
import { FileBlock } from '@talkjs/core';
|
|
5
6
|
import { FileToken } from '@talkjs/core';
|
|
6
7
|
import { GenericFileBlock } from '@talkjs/core';
|
|
7
8
|
import { ImageBlock } from '@talkjs/core';
|
|
8
9
|
import { LocationBlock } from '@talkjs/core';
|
|
9
10
|
import { MessageSnapshot } from '@talkjs/core';
|
|
10
11
|
import { ParticipantSnapshot } from '@talkjs/core';
|
|
11
|
-
import
|
|
12
|
+
import * as React from 'react';
|
|
12
13
|
import { ReferencedMessageSnapshot } from '@talkjs/core';
|
|
13
14
|
import { SendMessageParams } from '@talkjs/core';
|
|
14
15
|
import { SendTextMessageParams } from '@talkjs/core';
|
|
@@ -24,7 +25,7 @@ import { VoiceBlock } from '@talkjs/core';
|
|
|
24
25
|
*
|
|
25
26
|
* @public
|
|
26
27
|
*/
|
|
27
|
-
declare interface App {
|
|
28
|
+
export declare interface App {
|
|
28
29
|
/**
|
|
29
30
|
* Your app's unique TalkJS ID. You can find it on the Settings page of the
|
|
30
31
|
* {@link https://talkjs.com/dashboard | TalkJS dashboard.}
|
|
@@ -50,10 +51,12 @@ declare interface App {
|
|
|
50
51
|
custom: Record<string, string>;
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
export { AudioBlock }
|
|
55
|
+
|
|
53
56
|
/**
|
|
54
57
|
* @public
|
|
55
58
|
*/
|
|
56
|
-
declare interface AudioBlockProps {
|
|
59
|
+
export declare interface AudioBlockProps {
|
|
57
60
|
/**
|
|
58
61
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
59
62
|
*/
|
|
@@ -83,10 +86,46 @@ declare interface AudioBlockProps {
|
|
|
83
86
|
downloadUrl?: string;
|
|
84
87
|
}
|
|
85
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Audio player based on wavesurfer.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* Wavesurfer is designed to make SoundCloud-style sound wave players. It has no
|
|
94
|
+
* UI elements other than the actual sound waves, but it does abstract away all
|
|
95
|
+
* the audio playing browser internals very nicely.
|
|
96
|
+
*
|
|
97
|
+
* Also, it has some additional settings that let us turn the sound wave display
|
|
98
|
+
* into a series of nice rounded bars. Less signal, but also less distraction. I
|
|
99
|
+
* kinda like it!
|
|
100
|
+
*/
|
|
101
|
+
export declare function AudioPlayer({ src, onError, filename, className, }: AudioPlayerProps): JSX.Element;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export declare interface AudioPlayerProps {
|
|
107
|
+
/**
|
|
108
|
+
* Source of the audio that's being played.
|
|
109
|
+
*/
|
|
110
|
+
src: string;
|
|
111
|
+
/**
|
|
112
|
+
* Name of the audio file that's being played.
|
|
113
|
+
*/
|
|
114
|
+
filename: string;
|
|
115
|
+
/**
|
|
116
|
+
* Callback that runs when an error is encountered during playback.
|
|
117
|
+
*/
|
|
118
|
+
onError?: () => void;
|
|
119
|
+
/**
|
|
120
|
+
* @hidden
|
|
121
|
+
*/
|
|
122
|
+
className?: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
86
125
|
/**
|
|
87
126
|
* @public
|
|
88
127
|
*/
|
|
89
|
-
declare interface AvatarProps {
|
|
128
|
+
export declare interface AvatarProps {
|
|
90
129
|
/**
|
|
91
130
|
* A collection of objects which are passed to all Chatbox/ConversationList
|
|
92
131
|
* theme components.
|
|
@@ -391,10 +430,13 @@ export declare interface ChatboxProps {
|
|
|
391
430
|
* This event fires when the user clicks an action button or an action Link
|
|
392
431
|
* inside a message.
|
|
393
432
|
*
|
|
433
|
+
* @remarks
|
|
394
434
|
* The event's `action` and `params` fields specify the name of action and its
|
|
395
435
|
* parameters, if any.
|
|
396
436
|
*
|
|
397
|
-
*
|
|
437
|
+
* See
|
|
438
|
+
* {@link https://talkjs.com/docs/Guides/Web_Components/Action_Buttons_Links/ | Action Buttons and Links }
|
|
439
|
+
* for more info.
|
|
398
440
|
*/
|
|
399
441
|
onMessageAction?: (event: MessageActionEvent) => void;
|
|
400
442
|
/**
|
|
@@ -402,9 +444,9 @@ export declare interface ChatboxProps {
|
|
|
402
444
|
*
|
|
403
445
|
* @remarks
|
|
404
446
|
* Whatever data you pass here will be made available for use in theme
|
|
405
|
-
* components through {@
|
|
447
|
+
* components through {@link CommonChatboxProps.themeCustom} for Chatbox
|
|
406
448
|
* theme components and through
|
|
407
|
-
* {@
|
|
449
|
+
* {@link CommonConversationListProps.themeCustom} for ConversationList
|
|
408
450
|
* theme components.
|
|
409
451
|
*/
|
|
410
452
|
themeCustom?: any;
|
|
@@ -413,7 +455,7 @@ export declare interface ChatboxProps {
|
|
|
413
455
|
/**
|
|
414
456
|
* @public
|
|
415
457
|
*/
|
|
416
|
-
declare interface ChatHeaderProps {
|
|
458
|
+
export declare interface ChatHeaderProps {
|
|
417
459
|
/**
|
|
418
460
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
419
461
|
*/
|
|
@@ -435,7 +477,7 @@ declare interface ChatHeaderProps {
|
|
|
435
477
|
*
|
|
436
478
|
* @public
|
|
437
479
|
*/
|
|
438
|
-
declare interface CommonChatboxProps {
|
|
480
|
+
export declare interface CommonChatboxProps {
|
|
439
481
|
/**
|
|
440
482
|
* Holds information about your TalkJS app.
|
|
441
483
|
*/
|
|
@@ -493,7 +535,7 @@ declare interface CommonChatboxProps {
|
|
|
493
535
|
*
|
|
494
536
|
* @public
|
|
495
537
|
*/
|
|
496
|
-
declare interface CommonConversationListProps {
|
|
538
|
+
export declare interface CommonConversationListProps {
|
|
497
539
|
/**
|
|
498
540
|
* Holds information about your TalkJS app.
|
|
499
541
|
*/
|
|
@@ -536,7 +578,7 @@ declare interface CommonConversationListProps {
|
|
|
536
578
|
/**
|
|
537
579
|
* @public
|
|
538
580
|
*/
|
|
539
|
-
declare interface CompactMessageContentProps {
|
|
581
|
+
export declare interface CompactMessageContentProps {
|
|
540
582
|
/**
|
|
541
583
|
* A collection of objects which are passed to all Chatbox/ConversationList
|
|
542
584
|
* theme components.
|
|
@@ -555,7 +597,7 @@ declare interface CompactMessageContentProps {
|
|
|
555
597
|
/**
|
|
556
598
|
* @public
|
|
557
599
|
*/
|
|
558
|
-
declare interface ConversationImageProps {
|
|
600
|
+
export declare interface ConversationImageProps {
|
|
559
601
|
/**
|
|
560
602
|
* A collection of objects which are passed to all Chatbox/ConversationList
|
|
561
603
|
* theme components.
|
|
@@ -593,17 +635,17 @@ export declare class ConversationListController {
|
|
|
593
635
|
* programmatically from elsewhere to simulate a user click.
|
|
594
636
|
*
|
|
595
637
|
* This method will trigger the
|
|
596
|
-
* {@
|
|
638
|
+
* {@link ConversationListProps.onSelectConversation} event. In most
|
|
597
639
|
* cases, if you want to change the selected conversation programmatically
|
|
598
640
|
* from outside the conversation list, it's better to pass a different value
|
|
599
|
-
* to the {@
|
|
641
|
+
* to the {@link ConversationListProps.selectedConversationId} prop
|
|
600
642
|
* instead, as that lets you keep your local state in sync with the props
|
|
601
643
|
* passed to the conversation list.
|
|
602
644
|
*/
|
|
603
645
|
selectConversation(conversationId: string): void;
|
|
604
646
|
}
|
|
605
647
|
|
|
606
|
-
declare interface ConversationListItemProps {
|
|
648
|
+
export declare interface ConversationListItemProps {
|
|
607
649
|
/**
|
|
608
650
|
* A collection of objects which are passed to all ConversationList theme components.
|
|
609
651
|
*/
|
|
@@ -657,7 +699,7 @@ export declare interface ConversationListProps {
|
|
|
657
699
|
* update.
|
|
658
700
|
*
|
|
659
701
|
* Note that updating the selected conversation through this prop **will not**
|
|
660
|
-
* trigger the {@
|
|
702
|
+
* trigger the {@link onSelectConversation} callback.
|
|
661
703
|
*/
|
|
662
704
|
selectedConversationId?: string;
|
|
663
705
|
/**
|
|
@@ -701,7 +743,7 @@ export declare interface ConversationListProps {
|
|
|
701
743
|
*
|
|
702
744
|
* @remarks
|
|
703
745
|
* Note that updating the selected conversation through the
|
|
704
|
-
* {@
|
|
746
|
+
* {@link selectedConversationId} prop **will not** trigger this callback.
|
|
705
747
|
*
|
|
706
748
|
* Use this callback to have an adjacent chatbox show the correct
|
|
707
749
|
* conversation. See
|
|
@@ -713,18 +755,20 @@ export declare interface ConversationListProps {
|
|
|
713
755
|
*
|
|
714
756
|
* @remarks
|
|
715
757
|
* Whatever data you pass here will be made available for use in theme
|
|
716
|
-
* components through {@
|
|
758
|
+
* components through {@link CommonChatboxProps.themeCustom} for Chatbox
|
|
717
759
|
* theme components and through
|
|
718
|
-
* {@
|
|
760
|
+
* {@link CommonConversationListProps.themeCustom} for ConversationList
|
|
719
761
|
* theme components.
|
|
720
762
|
*/
|
|
721
763
|
themeCustom?: any;
|
|
722
764
|
}
|
|
723
765
|
|
|
766
|
+
export { ConversationSnapshot }
|
|
767
|
+
|
|
724
768
|
/**
|
|
725
769
|
* @public
|
|
726
770
|
*/
|
|
727
|
-
declare interface Coordinates {
|
|
771
|
+
export declare interface Coordinates {
|
|
728
772
|
latitude: number;
|
|
729
773
|
longitude: number;
|
|
730
774
|
}
|
|
@@ -761,7 +805,7 @@ export declare interface DeleteMessageEvent {
|
|
|
761
805
|
*
|
|
762
806
|
* @public
|
|
763
807
|
*/
|
|
764
|
-
declare interface DeviceFeatures {
|
|
808
|
+
export declare interface DeviceFeatures {
|
|
765
809
|
/**
|
|
766
810
|
* True if the browser supports IndexedDB, which the emoji picker depends on.
|
|
767
811
|
*/
|
|
@@ -772,10 +816,86 @@ declare interface DeviceFeatures {
|
|
|
772
816
|
isMobile: boolean;
|
|
773
817
|
}
|
|
774
818
|
|
|
819
|
+
export declare function Editor({ placeholder, disabled, className, characterLimit, spellcheck, }: EditorProps): JSX.Element;
|
|
820
|
+
|
|
821
|
+
export declare interface EditorController {
|
|
822
|
+
isTyping: boolean;
|
|
823
|
+
atTextLimit: boolean;
|
|
824
|
+
isEmpty: boolean;
|
|
825
|
+
characterCount: number;
|
|
826
|
+
showEmojiPicker: boolean;
|
|
827
|
+
send(): void;
|
|
828
|
+
shareLocation(): void;
|
|
829
|
+
attachFile(): void;
|
|
830
|
+
toggleEmojiPicker(): void;
|
|
831
|
+
}
|
|
832
|
+
|
|
775
833
|
/**
|
|
776
834
|
* @public
|
|
777
835
|
*/
|
|
778
|
-
declare interface
|
|
836
|
+
export declare interface EditorProps {
|
|
837
|
+
/**
|
|
838
|
+
* The maximum allowed character length.
|
|
839
|
+
*
|
|
840
|
+
* @remarks
|
|
841
|
+
* The default is `10000`
|
|
842
|
+
*/
|
|
843
|
+
characterLimit?: number;
|
|
844
|
+
/**
|
|
845
|
+
* Determines if the Editor can be interacted with or not.
|
|
846
|
+
*/
|
|
847
|
+
disabled?: boolean;
|
|
848
|
+
/**
|
|
849
|
+
* Placeholder text when the input is empty to encourage the user to write.
|
|
850
|
+
*
|
|
851
|
+
* @remarks
|
|
852
|
+
* The default is `"Say something..."`
|
|
853
|
+
*/
|
|
854
|
+
placeholder?: string;
|
|
855
|
+
/**
|
|
856
|
+
* If true, spell-checking is enabled.
|
|
857
|
+
*
|
|
858
|
+
* @remarks
|
|
859
|
+
* The default is `false`
|
|
860
|
+
*/
|
|
861
|
+
spellcheck?: boolean;
|
|
862
|
+
/**
|
|
863
|
+
* @hidden
|
|
864
|
+
*/
|
|
865
|
+
className?: string;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export declare function EmojiPicker(props: EmojiPickerProps): JSX.Element;
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* @public
|
|
872
|
+
*/
|
|
873
|
+
export declare interface EmojiPickerProps {
|
|
874
|
+
/**
|
|
875
|
+
* Display the emoji picker in light mode or dark mode.
|
|
876
|
+
*/
|
|
877
|
+
colorScheme: "light" | "dark";
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* Shows a bar with emoji suggestions when the user types eg `:bla`. Shown if `query` is non-empty.
|
|
882
|
+
*
|
|
883
|
+
* Uses the IndexedDB-backed emoji database from "emoji-picker-element".
|
|
884
|
+
*/
|
|
885
|
+
export declare function EmojiSuggestBar(props: EmojiSuggestBarProps): JSX.Element;
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* @public
|
|
889
|
+
*/
|
|
890
|
+
export declare interface EmojiSuggestBarProps {
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
export { FileBlock }
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* @public
|
|
897
|
+
*/
|
|
898
|
+
export declare interface FileBlockProps {
|
|
779
899
|
/**
|
|
780
900
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
781
901
|
*/
|
|
@@ -805,10 +925,54 @@ declare interface FileBlockProps {
|
|
|
805
925
|
downloadUrl?: string;
|
|
806
926
|
}
|
|
807
927
|
|
|
928
|
+
/**
|
|
929
|
+
* Displays the given number of seconds in a human-friendly MM:SS or HH:MM:SS
|
|
930
|
+
* format; whichever's shorter.
|
|
931
|
+
*
|
|
932
|
+
* @public
|
|
933
|
+
*/
|
|
934
|
+
export declare function formatDuration(seconds: number): string;
|
|
935
|
+
|
|
936
|
+
/**
|
|
937
|
+
* Returns a human-readable filesize count.
|
|
938
|
+
*
|
|
939
|
+
* @public
|
|
940
|
+
*/
|
|
941
|
+
export declare function formatFilesize(bytes: number): string;
|
|
942
|
+
|
|
943
|
+
export { GenericFileBlock }
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Given a coordinate, returns an `imageUrl` used to display a Google Maps
|
|
947
|
+
* preview image and a `linkUrl` which points to the given location on Google
|
|
948
|
+
* Maps.
|
|
949
|
+
*
|
|
950
|
+
* @public
|
|
951
|
+
*/
|
|
952
|
+
export declare function getGoogleMapsUrls({ latitude, longitude }: Coordinates): {
|
|
953
|
+
imageUrl: string;
|
|
954
|
+
linkUrl: string;
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Returns the given user's `photoUrl` if available. If not, returns a `data:`
|
|
959
|
+
* URL of a fallback SVG which shows the user's initials.
|
|
960
|
+
*
|
|
961
|
+
* @public
|
|
962
|
+
*/
|
|
963
|
+
export declare function getPhotoUrlWithFallback(user: UserSnapshot): string;
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
* Generates a random color in hex format.
|
|
967
|
+
*
|
|
968
|
+
* @public
|
|
969
|
+
*/
|
|
970
|
+
export declare function getRandomColor(id: string): string;
|
|
971
|
+
|
|
808
972
|
/**
|
|
809
973
|
* @public
|
|
810
974
|
*/
|
|
811
|
-
declare interface GroupChatImageProps {
|
|
975
|
+
export declare interface GroupChatImageProps {
|
|
812
976
|
/**
|
|
813
977
|
* A collection of objects which are passed to all Chatbox/ConversationList
|
|
814
978
|
* theme components.
|
|
@@ -825,9 +989,24 @@ declare interface GroupChatImageProps {
|
|
|
825
989
|
}
|
|
826
990
|
|
|
827
991
|
/**
|
|
992
|
+
* Parses a JSX-like React string into a React element tree.
|
|
993
|
+
*
|
|
994
|
+
* @remarks
|
|
995
|
+
* Uses the {@link https://github.com/developit/htm | `htm`} library under the
|
|
996
|
+
* hood.
|
|
997
|
+
*
|
|
828
998
|
* @public
|
|
999
|
+
*
|
|
1000
|
+
* @privateRemarks
|
|
1001
|
+
* Adapted from:
|
|
1002
|
+
* https://github.com/developit/htm/issues/175#issuecomment-773755560
|
|
829
1003
|
*/
|
|
830
|
-
declare
|
|
1004
|
+
export declare function html(strings: TemplateStringsArray, ...args: any[]): React.ReactElement;
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* @public
|
|
1008
|
+
*/
|
|
1009
|
+
export declare interface IconProps {
|
|
831
1010
|
/**
|
|
832
1011
|
* A collection of objects which are passed to all Chatbox/ConversationList
|
|
833
1012
|
* theme components.
|
|
@@ -847,22 +1026,12 @@ declare interface IconProps {
|
|
|
847
1026
|
className?: string;
|
|
848
1027
|
}
|
|
849
1028
|
|
|
850
|
-
|
|
851
|
-
isTyping: boolean;
|
|
852
|
-
atTextLimit: boolean;
|
|
853
|
-
isEmpty: boolean;
|
|
854
|
-
characterCount: number;
|
|
855
|
-
showEmojiPicker: boolean;
|
|
856
|
-
send(): void;
|
|
857
|
-
shareLocation(): void;
|
|
858
|
-
attachFile(): void;
|
|
859
|
-
toggleEmojiPicker(): void;
|
|
860
|
-
}
|
|
1029
|
+
export { ImageBlock }
|
|
861
1030
|
|
|
862
1031
|
/**
|
|
863
1032
|
* @public
|
|
864
1033
|
*/
|
|
865
|
-
declare interface ImageBlockProps {
|
|
1034
|
+
export declare interface ImageBlockProps {
|
|
866
1035
|
/**
|
|
867
1036
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
868
1037
|
*/
|
|
@@ -892,10 +1061,12 @@ declare interface ImageBlockProps {
|
|
|
892
1061
|
downloadUrl?: string;
|
|
893
1062
|
}
|
|
894
1063
|
|
|
1064
|
+
export { LocationBlock }
|
|
1065
|
+
|
|
895
1066
|
/**
|
|
896
1067
|
* @public
|
|
897
1068
|
*/
|
|
898
|
-
declare interface LocationBlockProps {
|
|
1069
|
+
export declare interface LocationBlockProps {
|
|
899
1070
|
/**
|
|
900
1071
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
901
1072
|
*/
|
|
@@ -910,6 +1081,30 @@ declare interface LocationBlockProps {
|
|
|
910
1081
|
block: LocationBlock;
|
|
911
1082
|
}
|
|
912
1083
|
|
|
1084
|
+
export declare function MentionSuggestList(props: MentionSuggestListProps): JSX.Element | null;
|
|
1085
|
+
|
|
1086
|
+
export declare interface MentionSuggestList {
|
|
1087
|
+
keydown(key: string): boolean;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* @public
|
|
1092
|
+
*/
|
|
1093
|
+
export declare interface MentionSuggestListProps {
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
export declare function MenuItem(props: MenuItemProps): JSX.Element;
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* @public
|
|
1100
|
+
*/
|
|
1101
|
+
export declare interface MenuItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1102
|
+
/**
|
|
1103
|
+
* When a callback is passed, it will be called when the menu item is selected.
|
|
1104
|
+
*/
|
|
1105
|
+
onSelect?: () => void;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
913
1108
|
/**
|
|
914
1109
|
* An event object dispatched by the {@link ChatboxProps.onMessageAction} event.
|
|
915
1110
|
*
|
|
@@ -937,7 +1132,7 @@ export declare interface MessageActionEvent {
|
|
|
937
1132
|
/**
|
|
938
1133
|
* @public
|
|
939
1134
|
*/
|
|
940
|
-
declare interface MessageActionMenuProps {
|
|
1135
|
+
export declare interface MessageActionMenuProps {
|
|
941
1136
|
/**
|
|
942
1137
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
943
1138
|
*/
|
|
@@ -952,10 +1147,34 @@ declare interface MessageActionMenuProps {
|
|
|
952
1147
|
permissions: MessagePermissions;
|
|
953
1148
|
}
|
|
954
1149
|
|
|
1150
|
+
export declare function MessageContent(props: MessageContentProps): JSX.Element;
|
|
1151
|
+
|
|
955
1152
|
/**
|
|
956
1153
|
* @public
|
|
957
1154
|
*/
|
|
958
|
-
declare interface
|
|
1155
|
+
export declare interface MessageContentProps {
|
|
1156
|
+
/**
|
|
1157
|
+
* A collection of objects which are passed to all Chatbox theme components.
|
|
1158
|
+
*/
|
|
1159
|
+
common: CommonChatboxProps;
|
|
1160
|
+
/**
|
|
1161
|
+
* The message whose contents are being displayed
|
|
1162
|
+
*/
|
|
1163
|
+
message: MessageSnapshot;
|
|
1164
|
+
/**
|
|
1165
|
+
* The current status of the given message.
|
|
1166
|
+
*/
|
|
1167
|
+
messageStatus: MessageStatus;
|
|
1168
|
+
/**
|
|
1169
|
+
* @hidden
|
|
1170
|
+
*/
|
|
1171
|
+
className?: string;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* @public
|
|
1176
|
+
*/
|
|
1177
|
+
export declare interface MessageDividerProps {
|
|
959
1178
|
/**
|
|
960
1179
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
961
1180
|
*/
|
|
@@ -978,7 +1197,7 @@ declare interface MessageDividerProps {
|
|
|
978
1197
|
/**
|
|
979
1198
|
* @public
|
|
980
1199
|
*/
|
|
981
|
-
declare interface MessageFieldProps {
|
|
1200
|
+
export declare interface MessageFieldProps {
|
|
982
1201
|
/**
|
|
983
1202
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
984
1203
|
*/
|
|
@@ -994,7 +1213,7 @@ declare interface MessageFieldProps {
|
|
|
994
1213
|
/**
|
|
995
1214
|
* An object holding the state of the message field.
|
|
996
1215
|
*/
|
|
997
|
-
editor:
|
|
1216
|
+
editor: EditorController;
|
|
998
1217
|
/**
|
|
999
1218
|
* When a message is being edited its ID will be stored here.
|
|
1000
1219
|
*/
|
|
@@ -1004,7 +1223,7 @@ declare interface MessageFieldProps {
|
|
|
1004
1223
|
/**
|
|
1005
1224
|
* @public
|
|
1006
1225
|
*/
|
|
1007
|
-
declare interface MessageListFooterProps {
|
|
1226
|
+
export declare interface MessageListFooterProps {
|
|
1008
1227
|
/**
|
|
1009
1228
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
1010
1229
|
*/
|
|
@@ -1019,7 +1238,7 @@ declare interface MessageListFooterProps {
|
|
|
1019
1238
|
*
|
|
1020
1239
|
* @public
|
|
1021
1240
|
*/
|
|
1022
|
-
declare interface MessagePermissions extends UserPermissions {
|
|
1241
|
+
export declare interface MessagePermissions extends UserPermissions {
|
|
1023
1242
|
/**
|
|
1024
1243
|
* True if the user has the ability to delete the given message.
|
|
1025
1244
|
*/
|
|
@@ -1041,7 +1260,7 @@ declare interface MessagePermissions extends UserPermissions {
|
|
|
1041
1260
|
/**
|
|
1042
1261
|
* @public
|
|
1043
1262
|
*/
|
|
1044
|
-
declare interface MessageProps {
|
|
1263
|
+
export declare interface MessageProps {
|
|
1045
1264
|
/**
|
|
1046
1265
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
1047
1266
|
*/
|
|
@@ -1060,6 +1279,8 @@ declare interface MessageProps {
|
|
|
1060
1279
|
permissions: MessagePermissions;
|
|
1061
1280
|
}
|
|
1062
1281
|
|
|
1282
|
+
export { MessageSnapshot }
|
|
1283
|
+
|
|
1063
1284
|
/**
|
|
1064
1285
|
* The current status of the message.
|
|
1065
1286
|
*
|
|
@@ -1074,7 +1295,7 @@ declare interface MessageProps {
|
|
|
1074
1295
|
*
|
|
1075
1296
|
* @public
|
|
1076
1297
|
*/
|
|
1077
|
-
declare type MessageStatus = "sending" | "sent" | "everyoneRead";
|
|
1298
|
+
export declare type MessageStatus = "sending" | "sent" | "everyoneRead";
|
|
1078
1299
|
|
|
1079
1300
|
/**
|
|
1080
1301
|
* Sent by {@link ChatboxProps.onMissingBrowserPermission} when the user
|
|
@@ -1108,10 +1329,75 @@ export declare interface MissingBrowserPermissionEvent {
|
|
|
1108
1329
|
type: BrowserPermission;
|
|
1109
1330
|
}
|
|
1110
1331
|
|
|
1332
|
+
export { ParticipantSnapshot }
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* PopoverButton component that renders a popover triggered by a button.
|
|
1336
|
+
*
|
|
1337
|
+
* Usage:
|
|
1338
|
+
* <PopoverButton
|
|
1339
|
+
* popoverComponent={YourMenuComponent}
|
|
1340
|
+
* popoverProps={{ prop1: value1, prop2: value2 }}
|
|
1341
|
+
* aria-label="..."
|
|
1342
|
+
* >
|
|
1343
|
+
* <Icon type="horizontalDots" />
|
|
1344
|
+
* </MenuButton>
|
|
1345
|
+
*
|
|
1346
|
+
* All props except for menuComponent and popoverProps are passed to the button element.
|
|
1347
|
+
*
|
|
1348
|
+
* the popoverComponent will also receive a closePopover prop. It's a function you can call to close the popover.
|
|
1349
|
+
*/
|
|
1350
|
+
export declare function PopoverButton<T extends object>(props: PopoverButtonProps<T>): JSX.Element;
|
|
1351
|
+
|
|
1111
1352
|
/**
|
|
1112
1353
|
* @public
|
|
1113
1354
|
*/
|
|
1114
|
-
declare interface
|
|
1355
|
+
export declare interface PopoverButtonProps<T extends object> extends React.HTMLAttributes<HTMLButtonElement> {
|
|
1356
|
+
/**
|
|
1357
|
+
* Whether to display a menu or a popover when the button is clicked.
|
|
1358
|
+
*
|
|
1359
|
+
* @remarks
|
|
1360
|
+
* Default value is `"popover"`.
|
|
1361
|
+
*/
|
|
1362
|
+
type?: "menu" | "popover";
|
|
1363
|
+
/**
|
|
1364
|
+
* The popover component to render in response to the button click.
|
|
1365
|
+
*/
|
|
1366
|
+
popoverComponent: React.ComponentType<T>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Props passed to the popover component.
|
|
1369
|
+
*/
|
|
1370
|
+
popoverProps: T;
|
|
1371
|
+
/**
|
|
1372
|
+
* Children nodes rendered inside the button.
|
|
1373
|
+
*/
|
|
1374
|
+
children: React.ReactNode;
|
|
1375
|
+
/**
|
|
1376
|
+
* The element to focus when the popover is opened. Can be an element or a selector. Ignored if type is "menu".
|
|
1377
|
+
*/
|
|
1378
|
+
initialFocus?: string | HTMLElement;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
export declare function ReactionPicker({ messageId, colorScheme, }: ReactionPickerProps): JSX.Element;
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* @public
|
|
1385
|
+
*/
|
|
1386
|
+
export declare interface ReactionPickerProps {
|
|
1387
|
+
/**
|
|
1388
|
+
* The ID of the message that's being reacted to.
|
|
1389
|
+
*/
|
|
1390
|
+
messageId: string;
|
|
1391
|
+
/**
|
|
1392
|
+
* Display the emoji reaction picker in light mode or dark mode.
|
|
1393
|
+
*/
|
|
1394
|
+
colorScheme: "light" | "dark";
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* @public
|
|
1399
|
+
*/
|
|
1400
|
+
export declare interface ReferencedMessageProps {
|
|
1115
1401
|
/**
|
|
1116
1402
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
1117
1403
|
*/
|
|
@@ -1122,10 +1408,12 @@ declare interface ReferencedMessageProps {
|
|
|
1122
1408
|
referencedMessage: ReferencedMessageSnapshot;
|
|
1123
1409
|
}
|
|
1124
1410
|
|
|
1411
|
+
export { ReferencedMessageSnapshot }
|
|
1412
|
+
|
|
1125
1413
|
/**
|
|
1126
1414
|
* @public
|
|
1127
1415
|
*/
|
|
1128
|
-
declare interface ReplyBarProps {
|
|
1416
|
+
export declare interface ReplyBarProps {
|
|
1129
1417
|
/**
|
|
1130
1418
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
1131
1419
|
*/
|
|
@@ -1165,10 +1453,22 @@ export declare interface SendMessageEvent {
|
|
|
1165
1453
|
conversation: ConversationSnapshot;
|
|
1166
1454
|
}
|
|
1167
1455
|
|
|
1456
|
+
export { TalkSession }
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* Displays rich text
|
|
1460
|
+
*
|
|
1461
|
+
* @public
|
|
1462
|
+
*/
|
|
1463
|
+
declare function Text_2({ block, nonInteractive, message, className, }: TextProps): React.ReactElement;
|
|
1464
|
+
export { Text_2 as Text }
|
|
1465
|
+
|
|
1466
|
+
export { TextBlock }
|
|
1467
|
+
|
|
1168
1468
|
/**
|
|
1169
1469
|
* @public
|
|
1170
1470
|
*/
|
|
1171
|
-
declare interface TextBlockProps {
|
|
1471
|
+
export declare interface TextBlockProps {
|
|
1172
1472
|
/**
|
|
1173
1473
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
1174
1474
|
*/
|
|
@@ -1183,6 +1483,31 @@ declare interface TextBlockProps {
|
|
|
1183
1483
|
block: TextBlock;
|
|
1184
1484
|
}
|
|
1185
1485
|
|
|
1486
|
+
/**
|
|
1487
|
+
* @public
|
|
1488
|
+
*/
|
|
1489
|
+
export declare interface TextProps {
|
|
1490
|
+
/**
|
|
1491
|
+
* The block of formatted text to display.
|
|
1492
|
+
*/
|
|
1493
|
+
block: TextBlock;
|
|
1494
|
+
/**
|
|
1495
|
+
* If true, links and action buttons/links won't be rendered.
|
|
1496
|
+
*
|
|
1497
|
+
* @remarks
|
|
1498
|
+
* The default is `false`
|
|
1499
|
+
*/
|
|
1500
|
+
nonInteractive?: boolean;
|
|
1501
|
+
/**
|
|
1502
|
+
* @hidden
|
|
1503
|
+
*/
|
|
1504
|
+
className?: string;
|
|
1505
|
+
/**
|
|
1506
|
+
* The message that this text block belongs to.
|
|
1507
|
+
*/
|
|
1508
|
+
message: MessageSnapshot | ReferencedMessageSnapshot;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1186
1511
|
/**
|
|
1187
1512
|
* A theme can be used to customize the appearance & behavior of your TalkJS
|
|
1188
1513
|
* Chatbox and/or ConversationList.
|
|
@@ -1218,10 +1543,31 @@ export declare interface Theme {
|
|
|
1218
1543
|
ConversationListItem: React.ComponentType<ConversationListItemProps>;
|
|
1219
1544
|
}
|
|
1220
1545
|
|
|
1546
|
+
/**
|
|
1547
|
+
* An object describing a human-readable tim
|
|
1548
|
+
*
|
|
1549
|
+
* @public
|
|
1550
|
+
*/
|
|
1551
|
+
export declare interface TimeAgo {
|
|
1552
|
+
/**
|
|
1553
|
+
* An amount of milliseconds after which the values in {@link TimeAgo.long} and {@link TimeAgo.short} _may_ have changed.
|
|
1554
|
+
* If undefined, the values will not change within any meaningful period.
|
|
1555
|
+
*/
|
|
1556
|
+
changeTimeout?: number | undefined;
|
|
1557
|
+
/**
|
|
1558
|
+
* A precise time description containing the exact date and time.
|
|
1559
|
+
*/
|
|
1560
|
+
long: string;
|
|
1561
|
+
/**
|
|
1562
|
+
* A short human-friendly time description, such as "2 minutes ago"
|
|
1563
|
+
*/
|
|
1564
|
+
short: string;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1221
1567
|
/**
|
|
1222
1568
|
* @public
|
|
1223
1569
|
*/
|
|
1224
|
-
declare interface TimeAgoProps {
|
|
1570
|
+
export declare interface TimeAgoProps {
|
|
1225
1571
|
/**
|
|
1226
1572
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
1227
1573
|
*/
|
|
@@ -1237,7 +1583,7 @@ declare interface TimeAgoProps {
|
|
|
1237
1583
|
*
|
|
1238
1584
|
* @public
|
|
1239
1585
|
*/
|
|
1240
|
-
declare interface Translation extends TranslationStrings {
|
|
1586
|
+
export declare interface Translation extends TranslationStrings {
|
|
1241
1587
|
locale: string;
|
|
1242
1588
|
}
|
|
1243
1589
|
|
|
@@ -1301,6 +1647,19 @@ declare interface TranslationStrings {
|
|
|
1301
1647
|
CONTACT_INFORMATION_HIDDEN: string;
|
|
1302
1648
|
}
|
|
1303
1649
|
|
|
1650
|
+
export { TypingSnapshot }
|
|
1651
|
+
|
|
1652
|
+
/**
|
|
1653
|
+
* Returns "Yesterday", "Last Monday", "Tuesday, March 31" or "Monday, March 31
|
|
1654
|
+
* 2014", depending on which is most appropriate.
|
|
1655
|
+
*
|
|
1656
|
+
* @param timestamp The timestamp of the event in milliseconds since Unix epoch.
|
|
1657
|
+
* @param t Relevant translation object to get localized output
|
|
1658
|
+
*
|
|
1659
|
+
* @public
|
|
1660
|
+
*/
|
|
1661
|
+
export declare function userFriendlyDate(timestamp: number, t: Translation): string;
|
|
1662
|
+
|
|
1304
1663
|
/**
|
|
1305
1664
|
* A set of permissions for the current user.
|
|
1306
1665
|
*
|
|
@@ -1309,7 +1668,7 @@ declare interface TranslationStrings {
|
|
|
1309
1668
|
*
|
|
1310
1669
|
* @public
|
|
1311
1670
|
*/
|
|
1312
|
-
declare interface UserPermissions {
|
|
1671
|
+
export declare interface UserPermissions {
|
|
1313
1672
|
/**
|
|
1314
1673
|
* True if typing indicators are enabled.
|
|
1315
1674
|
*/
|
|
@@ -1346,10 +1705,24 @@ declare interface UserPermissions {
|
|
|
1346
1705
|
canMarkConversationAsUnread: boolean;
|
|
1347
1706
|
}
|
|
1348
1707
|
|
|
1708
|
+
export { UserSnapshot }
|
|
1709
|
+
|
|
1349
1710
|
/**
|
|
1711
|
+
*
|
|
1712
|
+
* This hooks triggers only when a human-readable timestamp needs to be updated.
|
|
1713
|
+
* For example, you could use it to display that a messages was updated X
|
|
1714
|
+
* minutes or Y hours ago.
|
|
1715
|
+
*
|
|
1350
1716
|
* @public
|
|
1351
1717
|
*/
|
|
1352
|
-
declare
|
|
1718
|
+
export declare function useTimeAgo(timestamp: number, t: Translation): TimeAgo;
|
|
1719
|
+
|
|
1720
|
+
export { VideoBlock }
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* @public
|
|
1724
|
+
*/
|
|
1725
|
+
export declare interface VideoBlockProps {
|
|
1353
1726
|
/**
|
|
1354
1727
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
1355
1728
|
*/
|
|
@@ -1379,10 +1752,12 @@ declare interface VideoBlockProps {
|
|
|
1379
1752
|
downloadUrl?: string;
|
|
1380
1753
|
}
|
|
1381
1754
|
|
|
1755
|
+
export { VoiceBlock }
|
|
1756
|
+
|
|
1382
1757
|
/**
|
|
1383
1758
|
* @public
|
|
1384
1759
|
*/
|
|
1385
|
-
declare interface VoiceBlockProps {
|
|
1760
|
+
export declare interface VoiceBlockProps {
|
|
1386
1761
|
/**
|
|
1387
1762
|
* A collection of objects which are passed to all Chatbox theme components.
|
|
1388
1763
|
*/
|
|
@@ -1413,12 +1788,3 @@ declare interface VoiceBlockProps {
|
|
|
1413
1788
|
}
|
|
1414
1789
|
|
|
1415
1790
|
export { }
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
declare global {
|
|
1419
|
-
interface HTMLElementTagNameMap {
|
|
1420
|
-
"t-chatbox": ChatboxElement;
|
|
1421
|
-
"t-conversation-list": ConversationListElement;
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
|