@ermis-network/ermis-chat-react 1.0.0 → 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/README.md +9 -0
- package/dist/index.cjs +752 -333
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +382 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +88 -1
- package/dist/index.d.ts +88 -1
- package/dist/index.mjs +691 -274
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelInfo/AddMemberModal.tsx +48 -174
- package/src/components/ChannelList.tsx +5 -0
- package/src/components/CreateChannelModal.tsx +274 -0
- package/src/components/UserPicker.tsx +377 -0
- package/src/index.ts +11 -0
- package/src/styles/_create-channel-modal.css +183 -0
- package/src/styles/_user-picker.css +268 -0
- package/src/styles/index.css +3 -0
- package/src/types.ts +100 -0
package/dist/index.d.mts
CHANGED
|
@@ -800,6 +800,89 @@ type ChannelInfoProps = {
|
|
|
800
800
|
actionsBlockLabel?: string;
|
|
801
801
|
actionsUnblockLabel?: string;
|
|
802
802
|
};
|
|
803
|
+
/** Individual user item in UserPicker */
|
|
804
|
+
type UserPickerUser = {
|
|
805
|
+
id: string;
|
|
806
|
+
name?: string;
|
|
807
|
+
email?: string;
|
|
808
|
+
phone?: string;
|
|
809
|
+
avatar?: string;
|
|
810
|
+
[key: string]: any;
|
|
811
|
+
};
|
|
812
|
+
/** Props for each user row in UserPicker */
|
|
813
|
+
type UserPickerItemProps = {
|
|
814
|
+
user: UserPickerUser;
|
|
815
|
+
selected: boolean;
|
|
816
|
+
disabled: boolean;
|
|
817
|
+
mode: 'radio' | 'checkbox';
|
|
818
|
+
onToggle: (user: UserPickerUser) => void;
|
|
819
|
+
AvatarComponent: React.ComponentType<AvatarProps>;
|
|
820
|
+
};
|
|
821
|
+
/** Props for the selected users chip box */
|
|
822
|
+
type UserPickerSelectedBoxProps = {
|
|
823
|
+
users: UserPickerUser[];
|
|
824
|
+
onRemove: (userId: string) => void;
|
|
825
|
+
AvatarComponent: React.ComponentType<AvatarProps>;
|
|
826
|
+
/** Label when no users selected */
|
|
827
|
+
emptyLabel?: string;
|
|
828
|
+
};
|
|
829
|
+
/** Main UserPicker props */
|
|
830
|
+
type UserPickerProps = {
|
|
831
|
+
/** Selection mode: 'radio' for single, 'checkbox' for multi */
|
|
832
|
+
mode: 'radio' | 'checkbox';
|
|
833
|
+
/** Called whenever selection changes */
|
|
834
|
+
onSelectionChange?: (users: UserPickerUser[]) => void;
|
|
835
|
+
/** User IDs to exclude from the list (e.g. existing members) */
|
|
836
|
+
excludeUserIds?: string[];
|
|
837
|
+
/** Users that are pre-selected on mount */
|
|
838
|
+
initialSelectedUsers?: UserPickerUser[];
|
|
839
|
+
/** Page size for queryUsers (default: 30) */
|
|
840
|
+
pageSize?: number;
|
|
841
|
+
/** Custom avatar component */
|
|
842
|
+
AvatarComponent?: React.ComponentType<AvatarProps>;
|
|
843
|
+
/** Custom user item component (replaces the default row) */
|
|
844
|
+
UserItemComponent?: React.ComponentType<UserPickerItemProps>;
|
|
845
|
+
/** Custom selected box component (checkbox mode only) */
|
|
846
|
+
SelectedBoxComponent?: React.ComponentType<UserPickerSelectedBoxProps>;
|
|
847
|
+
/** Custom search input component */
|
|
848
|
+
SearchInputComponent?: React.ComponentType<{
|
|
849
|
+
value: string;
|
|
850
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
851
|
+
placeholder: string;
|
|
852
|
+
}>;
|
|
853
|
+
/** I18n labels */
|
|
854
|
+
searchPlaceholder?: string;
|
|
855
|
+
loadingText?: string;
|
|
856
|
+
emptyText?: string;
|
|
857
|
+
loadingMoreText?: string;
|
|
858
|
+
selectedEmptyLabel?: string;
|
|
859
|
+
};
|
|
860
|
+
type CreateChannelModalProps = {
|
|
861
|
+
isOpen: boolean;
|
|
862
|
+
onClose: () => void;
|
|
863
|
+
onSuccess?: (channel: any) => void;
|
|
864
|
+
/** Override visual components */
|
|
865
|
+
AvatarComponent?: React.ComponentType<AvatarProps>;
|
|
866
|
+
UserItemComponent?: React.ComponentType<UserPickerItemProps>;
|
|
867
|
+
/** i18n labels */
|
|
868
|
+
title?: string;
|
|
869
|
+
directTabLabel?: string;
|
|
870
|
+
groupTabLabel?: string;
|
|
871
|
+
groupNameLabel?: string;
|
|
872
|
+
groupNamePlaceholder?: string;
|
|
873
|
+
groupDescriptionLabel?: string;
|
|
874
|
+
groupDescriptionPlaceholder?: string;
|
|
875
|
+
groupPublicLabel?: string;
|
|
876
|
+
groupAvatarLabel?: string;
|
|
877
|
+
userSearchPlaceholder?: string;
|
|
878
|
+
cancelButtonLabel?: string;
|
|
879
|
+
createButtonLabel?: string;
|
|
880
|
+
creatingButtonLabel?: string;
|
|
881
|
+
/** File upload configuration for group channel images */
|
|
882
|
+
imageAccept?: string;
|
|
883
|
+
maxImageSize?: number;
|
|
884
|
+
maxImageSizeError?: string;
|
|
885
|
+
};
|
|
803
886
|
|
|
804
887
|
declare const ChatProvider: React$1.FC<ChatProviderProps>;
|
|
805
888
|
|
|
@@ -1135,4 +1218,8 @@ type PanelProps = {
|
|
|
1135
1218
|
*/
|
|
1136
1219
|
declare const Panel: React$1.FC<PanelProps>;
|
|
1137
1220
|
|
|
1138
|
-
|
|
1221
|
+
declare const UserPicker: React$1.FC<UserPickerProps>;
|
|
1222
|
+
|
|
1223
|
+
declare const CreateChannelModal: React$1.FC<CreateChannelModalProps>;
|
|
1224
|
+
|
|
1225
|
+
export { type AddMemberButtonProps, type AddMemberModalProps, type AddMemberUserItemProps, type AttachButtonProps, type AttachmentItem, AttachmentList, type AttachmentProps, Avatar, type AvatarProps, Channel, ChannelHeader, type ChannelHeaderData, type ChannelHeaderProps, ChannelInfo, type ChannelInfoActionsProps, type ChannelInfoCoverProps, type ChannelInfoEmptyStateProps, type ChannelInfoFileItemProps, type ChannelInfoHeaderProps, type ChannelInfoLinkItemProps, type ChannelInfoMediaItemProps, type ChannelInfoMemberItemProps, type ChannelInfoProps, type ChannelInfoTabsProps, ChannelItem, type ChannelItemProps, ChannelList, type ChannelListProps, type ChannelProps, type ChatContextValue, ChatProvider, type ChatProviderProps, CreateChannelModal, type CreateChannelModalProps, type DateSeparatorProps, DefaultChannelInfoActions, DefaultChannelInfoCover, DefaultChannelInfoHeader, DefaultChannelInfoTabs, Dropdown, type DropdownProps, type EmojiButtonProps, type EmojiPickerProps, ErrorMessage, type FilePreviewItem, FilesPreview, type FilesPreviewProps, type ForwardChannelItemProps, ForwardMessageModal, type ForwardMessageModalProps, type JumpToLatestProps, type LatestReaction, type MediaTab, type MentionMember, type MentionPayload, MentionSuggestions, type MentionSuggestionsProps, MessageActionsBox, type MessageActionsBoxProps, MessageAttachment, type MessageBubbleProps, MessageInput, type MessageInputProps, MessageItem, type MessageItemProps, type MessageListProps, MessageQuickReactions, MessageReactions, type MessageReactionsProps, type MessageRendererProps, Modal, type ModalProps, Panel, type PinnedMessageItemProps, PinnedMessages, type PinnedMessagesProps, PollMessage, QuotedMessagePreview, type QuotedMessagePreviewProps, type ReactionUser, RegularMessage, ReplyPreview, type ReplyPreviewProps, type SendButtonProps, SignalMessage, StickerMessage, SystemMessage, SystemMessageItem, type SystemMessageItemProps, type Theme, TypingIndicator, type TypingIndicatorProps, type TypingUser, type UseChannelMessagesOptions, type UseChannelReturn, type UseLoadMessagesOptions, type UseLoadMessagesReturn, type UseMentionsOptions, type UseMentionsReturn, type UseScrollToMessageOptions, type UseScrollToMessageReturn, UserPicker, type UserPickerItemProps, type UserPickerProps, type UserPickerSelectedBoxProps, type UserPickerUser, VirtualMessageList, closeAllDropdowns, dedupMessages, defaultMessageRenderers, formatDateLabel, formatTime, getDateKey, getMessageUserId, replaceMentionsForPreview, useBannedState, useBlockedState, useChannel, useChannelListUpdates, useChannelMessages, useChannelRowUpdates, useChatClient, useLoadMessages, useMentions, useMessageActions, usePendingState, useScrollToMessage, useTypingIndicator };
|
package/dist/index.d.ts
CHANGED
|
@@ -800,6 +800,89 @@ type ChannelInfoProps = {
|
|
|
800
800
|
actionsBlockLabel?: string;
|
|
801
801
|
actionsUnblockLabel?: string;
|
|
802
802
|
};
|
|
803
|
+
/** Individual user item in UserPicker */
|
|
804
|
+
type UserPickerUser = {
|
|
805
|
+
id: string;
|
|
806
|
+
name?: string;
|
|
807
|
+
email?: string;
|
|
808
|
+
phone?: string;
|
|
809
|
+
avatar?: string;
|
|
810
|
+
[key: string]: any;
|
|
811
|
+
};
|
|
812
|
+
/** Props for each user row in UserPicker */
|
|
813
|
+
type UserPickerItemProps = {
|
|
814
|
+
user: UserPickerUser;
|
|
815
|
+
selected: boolean;
|
|
816
|
+
disabled: boolean;
|
|
817
|
+
mode: 'radio' | 'checkbox';
|
|
818
|
+
onToggle: (user: UserPickerUser) => void;
|
|
819
|
+
AvatarComponent: React.ComponentType<AvatarProps>;
|
|
820
|
+
};
|
|
821
|
+
/** Props for the selected users chip box */
|
|
822
|
+
type UserPickerSelectedBoxProps = {
|
|
823
|
+
users: UserPickerUser[];
|
|
824
|
+
onRemove: (userId: string) => void;
|
|
825
|
+
AvatarComponent: React.ComponentType<AvatarProps>;
|
|
826
|
+
/** Label when no users selected */
|
|
827
|
+
emptyLabel?: string;
|
|
828
|
+
};
|
|
829
|
+
/** Main UserPicker props */
|
|
830
|
+
type UserPickerProps = {
|
|
831
|
+
/** Selection mode: 'radio' for single, 'checkbox' for multi */
|
|
832
|
+
mode: 'radio' | 'checkbox';
|
|
833
|
+
/** Called whenever selection changes */
|
|
834
|
+
onSelectionChange?: (users: UserPickerUser[]) => void;
|
|
835
|
+
/** User IDs to exclude from the list (e.g. existing members) */
|
|
836
|
+
excludeUserIds?: string[];
|
|
837
|
+
/** Users that are pre-selected on mount */
|
|
838
|
+
initialSelectedUsers?: UserPickerUser[];
|
|
839
|
+
/** Page size for queryUsers (default: 30) */
|
|
840
|
+
pageSize?: number;
|
|
841
|
+
/** Custom avatar component */
|
|
842
|
+
AvatarComponent?: React.ComponentType<AvatarProps>;
|
|
843
|
+
/** Custom user item component (replaces the default row) */
|
|
844
|
+
UserItemComponent?: React.ComponentType<UserPickerItemProps>;
|
|
845
|
+
/** Custom selected box component (checkbox mode only) */
|
|
846
|
+
SelectedBoxComponent?: React.ComponentType<UserPickerSelectedBoxProps>;
|
|
847
|
+
/** Custom search input component */
|
|
848
|
+
SearchInputComponent?: React.ComponentType<{
|
|
849
|
+
value: string;
|
|
850
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
851
|
+
placeholder: string;
|
|
852
|
+
}>;
|
|
853
|
+
/** I18n labels */
|
|
854
|
+
searchPlaceholder?: string;
|
|
855
|
+
loadingText?: string;
|
|
856
|
+
emptyText?: string;
|
|
857
|
+
loadingMoreText?: string;
|
|
858
|
+
selectedEmptyLabel?: string;
|
|
859
|
+
};
|
|
860
|
+
type CreateChannelModalProps = {
|
|
861
|
+
isOpen: boolean;
|
|
862
|
+
onClose: () => void;
|
|
863
|
+
onSuccess?: (channel: any) => void;
|
|
864
|
+
/** Override visual components */
|
|
865
|
+
AvatarComponent?: React.ComponentType<AvatarProps>;
|
|
866
|
+
UserItemComponent?: React.ComponentType<UserPickerItemProps>;
|
|
867
|
+
/** i18n labels */
|
|
868
|
+
title?: string;
|
|
869
|
+
directTabLabel?: string;
|
|
870
|
+
groupTabLabel?: string;
|
|
871
|
+
groupNameLabel?: string;
|
|
872
|
+
groupNamePlaceholder?: string;
|
|
873
|
+
groupDescriptionLabel?: string;
|
|
874
|
+
groupDescriptionPlaceholder?: string;
|
|
875
|
+
groupPublicLabel?: string;
|
|
876
|
+
groupAvatarLabel?: string;
|
|
877
|
+
userSearchPlaceholder?: string;
|
|
878
|
+
cancelButtonLabel?: string;
|
|
879
|
+
createButtonLabel?: string;
|
|
880
|
+
creatingButtonLabel?: string;
|
|
881
|
+
/** File upload configuration for group channel images */
|
|
882
|
+
imageAccept?: string;
|
|
883
|
+
maxImageSize?: number;
|
|
884
|
+
maxImageSizeError?: string;
|
|
885
|
+
};
|
|
803
886
|
|
|
804
887
|
declare const ChatProvider: React$1.FC<ChatProviderProps>;
|
|
805
888
|
|
|
@@ -1135,4 +1218,8 @@ type PanelProps = {
|
|
|
1135
1218
|
*/
|
|
1136
1219
|
declare const Panel: React$1.FC<PanelProps>;
|
|
1137
1220
|
|
|
1138
|
-
|
|
1221
|
+
declare const UserPicker: React$1.FC<UserPickerProps>;
|
|
1222
|
+
|
|
1223
|
+
declare const CreateChannelModal: React$1.FC<CreateChannelModalProps>;
|
|
1224
|
+
|
|
1225
|
+
export { type AddMemberButtonProps, type AddMemberModalProps, type AddMemberUserItemProps, type AttachButtonProps, type AttachmentItem, AttachmentList, type AttachmentProps, Avatar, type AvatarProps, Channel, ChannelHeader, type ChannelHeaderData, type ChannelHeaderProps, ChannelInfo, type ChannelInfoActionsProps, type ChannelInfoCoverProps, type ChannelInfoEmptyStateProps, type ChannelInfoFileItemProps, type ChannelInfoHeaderProps, type ChannelInfoLinkItemProps, type ChannelInfoMediaItemProps, type ChannelInfoMemberItemProps, type ChannelInfoProps, type ChannelInfoTabsProps, ChannelItem, type ChannelItemProps, ChannelList, type ChannelListProps, type ChannelProps, type ChatContextValue, ChatProvider, type ChatProviderProps, CreateChannelModal, type CreateChannelModalProps, type DateSeparatorProps, DefaultChannelInfoActions, DefaultChannelInfoCover, DefaultChannelInfoHeader, DefaultChannelInfoTabs, Dropdown, type DropdownProps, type EmojiButtonProps, type EmojiPickerProps, ErrorMessage, type FilePreviewItem, FilesPreview, type FilesPreviewProps, type ForwardChannelItemProps, ForwardMessageModal, type ForwardMessageModalProps, type JumpToLatestProps, type LatestReaction, type MediaTab, type MentionMember, type MentionPayload, MentionSuggestions, type MentionSuggestionsProps, MessageActionsBox, type MessageActionsBoxProps, MessageAttachment, type MessageBubbleProps, MessageInput, type MessageInputProps, MessageItem, type MessageItemProps, type MessageListProps, MessageQuickReactions, MessageReactions, type MessageReactionsProps, type MessageRendererProps, Modal, type ModalProps, Panel, type PinnedMessageItemProps, PinnedMessages, type PinnedMessagesProps, PollMessage, QuotedMessagePreview, type QuotedMessagePreviewProps, type ReactionUser, RegularMessage, ReplyPreview, type ReplyPreviewProps, type SendButtonProps, SignalMessage, StickerMessage, SystemMessage, SystemMessageItem, type SystemMessageItemProps, type Theme, TypingIndicator, type TypingIndicatorProps, type TypingUser, type UseChannelMessagesOptions, type UseChannelReturn, type UseLoadMessagesOptions, type UseLoadMessagesReturn, type UseMentionsOptions, type UseMentionsReturn, type UseScrollToMessageOptions, type UseScrollToMessageReturn, UserPicker, type UserPickerItemProps, type UserPickerProps, type UserPickerSelectedBoxProps, type UserPickerUser, VirtualMessageList, closeAllDropdowns, dedupMessages, defaultMessageRenderers, formatDateLabel, formatTime, getDateKey, getMessageUserId, replaceMentionsForPreview, useBannedState, useBlockedState, useChannel, useChannelListUpdates, useChannelMessages, useChannelRowUpdates, useChatClient, useLoadMessages, useMentions, useMessageActions, usePendingState, useScrollToMessage, useTypingIndicator };
|