@medipha/chat 1.0.39 → 1.0.40
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 +47 -47
- package/dist/index.js +8754 -8747
- package/dist/pages/Setting/hooks/use-conversation-settings.d.ts +7 -11
- package/dist/pages/Setting/hooks/use-pending-join-requests.d.ts +7 -2
- package/dist/pages/Setting/members/members-list-modal.d.ts +2 -7
- package/dist/pages/conversation/conversation-detail/conversation-detail.d.ts +1 -0
- package/dist/pages/conversation/conversation-footer/conversation-footer.d.ts +1 -0
- package/dist/pages/conversation/hooks/use-current-membership.d.ts +19 -10
- package/dist/pages/sidebar/hooks/use-conversations.d.ts +1 -1
- package/dist/store/pendingJoinRequestsStore.d.ts +4 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Conversation
|
|
1
|
+
import { Conversation } from '../../../utils/chat';
|
|
2
2
|
interface UseConversationSettingsParams {
|
|
3
|
+
conversation: Conversation | null;
|
|
3
4
|
conversationId: string | undefined;
|
|
4
5
|
currentUserId: string | null;
|
|
5
6
|
onConversationUpdated?: (conversation: Conversation) => void;
|
|
@@ -8,33 +9,28 @@ interface UseConversationSettingsParams {
|
|
|
8
9
|
onMembersChanged?: () => void;
|
|
9
10
|
}
|
|
10
11
|
/** Coordinates member management, rename, delete, and leave actions for a conversation. */
|
|
11
|
-
export declare function useConversationSettings({ conversationId, currentUserId, onConversationUpdated, onDeleteSuccess, onLeaveSuccess, onMembersChanged, }: UseConversationSettingsParams): {
|
|
12
|
+
export declare function useConversationSettings({ conversation, conversationId, currentUserId, onConversationUpdated, onDeleteSuccess, onLeaveSuccess, onMembersChanged, }: UseConversationSettingsParams): {
|
|
12
13
|
addingUserId: string | null;
|
|
13
14
|
addMember: (userId: string) => Promise<boolean>;
|
|
14
15
|
addMembers: (userIds: string[]) => Promise<boolean>;
|
|
15
|
-
currentMember: ConversationMember | null;
|
|
16
|
+
currentMember: import('../../../utils/chat').ConversationMember | null;
|
|
16
17
|
deletingUserId: string | null;
|
|
17
18
|
deleteGroup: () => Promise<boolean>;
|
|
18
19
|
deleteMember: (userId: string) => Promise<boolean>;
|
|
19
20
|
removeMembers: (userIds: string[]) => Promise<boolean>;
|
|
20
21
|
isDeletingGroup: boolean;
|
|
21
22
|
isLeaving: boolean;
|
|
22
|
-
isLoadingMembers: boolean;
|
|
23
|
-
isLoadingMoreMembers: boolean;
|
|
24
23
|
isRenaming: boolean;
|
|
25
24
|
isUpdatingAvatar: boolean;
|
|
26
25
|
isOwner: boolean;
|
|
27
26
|
leave: (nextOwnerId?: string | null) => Promise<boolean>;
|
|
28
|
-
loadMoreMembers: () => Promise<void>;
|
|
29
27
|
memberCountLabel: string;
|
|
30
28
|
memberUserIds: Set<string>;
|
|
31
|
-
members: ConversationMember[];
|
|
32
|
-
membersError: string;
|
|
29
|
+
members: import('../../../utils/chat').ConversationMember[];
|
|
33
30
|
membersSearch: string;
|
|
34
|
-
|
|
35
|
-
otherMembers: ConversationMember[];
|
|
31
|
+
otherMembers: import('../../../utils/chat').ConversationMember[];
|
|
36
32
|
renameConversation: (title: string) => Promise<boolean>;
|
|
37
|
-
searchMembers: (search: string) =>
|
|
33
|
+
searchMembers: (search: string) => void;
|
|
38
34
|
updateGroupAvatarFile: (file: File) => Promise<boolean>;
|
|
39
35
|
};
|
|
40
36
|
export {};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { PendingMember } from '../../../utils/chat';
|
|
2
|
+
export declare function usePendingJoinRequests(conversationId: string | undefined, enabled: boolean, { autoLoad }?: {
|
|
3
|
+
autoLoad?: boolean;
|
|
4
|
+
}): {
|
|
5
|
+
requests: PendingMember[];
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
error: string;
|
|
3
8
|
reload: () => void;
|
|
4
9
|
};
|
|
@@ -4,19 +4,14 @@ interface MembersListModalProps {
|
|
|
4
4
|
memberCountLabel: string;
|
|
5
5
|
currentUserId: string | null;
|
|
6
6
|
isOwner: boolean;
|
|
7
|
-
isLoadingMembers: boolean;
|
|
8
|
-
membersError: string;
|
|
9
7
|
deletingUserId: string | null;
|
|
10
|
-
nextCursor: string | null;
|
|
11
|
-
isLoadingMoreMembers: boolean;
|
|
12
8
|
onClose: () => void;
|
|
13
9
|
onOpenAddModal: () => void;
|
|
14
|
-
onSearch: (search: string) =>
|
|
10
|
+
onSearch: (search: string) => void;
|
|
15
11
|
onDeleteMember: (userId: string) => void;
|
|
16
12
|
/** Removes the whole tick-selection in one request, so the group gets one "đã xóa" notice
|
|
17
13
|
* instead of one per person. */
|
|
18
14
|
onDeleteMembers: (userIds: string[]) => Promise<boolean> | void;
|
|
19
|
-
onLoadMore: () => void;
|
|
20
15
|
/** Opens the account-info modal for a member. */
|
|
21
16
|
onOpenProfile: (userId: string) => void;
|
|
22
17
|
/** True when this is a verified group and the caller lacks hasUpdateGroupVerified —
|
|
@@ -25,5 +20,5 @@ interface MembersListModalProps {
|
|
|
25
20
|
updateLocked?: boolean;
|
|
26
21
|
}
|
|
27
22
|
/** "Thành viên" — quick-add row, member list with role subtitle + remove, load-more. */
|
|
28
|
-
export declare function MembersListModal({ members, memberCountLabel, currentUserId, isOwner,
|
|
23
|
+
export declare function MembersListModal({ members, memberCountLabel, currentUserId, isOwner, deletingUserId, onClose, onOpenAddModal, onSearch, onDeleteMember, onDeleteMembers, onOpenProfile, updateLocked, }: MembersListModalProps): import("react/jsx-runtime").JSX.Element;
|
|
29
24
|
export {};
|
|
@@ -59,6 +59,7 @@ interface ConversationDetailProps {
|
|
|
59
59
|
onRemovePendingAttachment: (index: number) => void;
|
|
60
60
|
canModerateMessages: boolean;
|
|
61
61
|
canManagePins: boolean;
|
|
62
|
+
onDropFiles?: (files: File[]) => void;
|
|
62
63
|
dayDividerKeys: Set<string>;
|
|
63
64
|
replyTargetState: ReplyTargetForDetail;
|
|
64
65
|
onForward: (message: ChatMessage) => void;
|
|
@@ -44,6 +44,7 @@ interface ConversationFooterProps {
|
|
|
44
44
|
}
|
|
45
45
|
export interface ConversationFooterHandle {
|
|
46
46
|
focusComposer: () => void;
|
|
47
|
+
sendFiles: (files: File[]) => void;
|
|
47
48
|
}
|
|
48
49
|
/** The message composer itself — toolbar + input — plus its two hidden file inputs. Owns
|
|
49
50
|
* turning a submitted draft (text and/or staged attachments) into outgoing messages,
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { ChatUser } from '../../../utils/chat';
|
|
2
|
-
|
|
3
|
-
* Owns the current user's membership info for a GROUP conversation — the active member
|
|
4
|
-
* list used for @mention autocomplete, and the current user's own role/status, used
|
|
5
|
-
* across permission checks (pin management, moderation, title editing). A no-op for
|
|
6
|
-
* DIRECT conversations, which have no membership roles to resolve.
|
|
7
|
-
*/
|
|
8
|
-
export declare function useCurrentMembership(conversationId: string | undefined, conversationType: string, currentUserId: string | null): {
|
|
1
|
+
import { ChatUser, Conversation } from '../../../utils/chat';
|
|
2
|
+
export declare function useCurrentMembership(conversation: Conversation | null | undefined, conversationType: string, currentUserId: string | null): {
|
|
9
3
|
mentionMembers: ChatUser[];
|
|
10
4
|
currentMemberRole: string;
|
|
11
5
|
currentMemberStatus: string;
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
} | {
|
|
7
|
+
mentionMembers: {
|
|
8
|
+
id: string | undefined;
|
|
9
|
+
userId?: string;
|
|
10
|
+
fullName?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
account?: string;
|
|
14
|
+
email?: string;
|
|
15
|
+
avatarUrl?: string;
|
|
16
|
+
avatar?: string;
|
|
17
|
+
code?: string;
|
|
18
|
+
jobTitleName?: string;
|
|
19
|
+
workStatusName?: string | null;
|
|
20
|
+
}[];
|
|
21
|
+
currentMemberRole: string;
|
|
22
|
+
currentMemberStatus: string;
|
|
14
23
|
};
|
|
@@ -7,5 +7,5 @@ interface UseConversationsResult {
|
|
|
7
7
|
clearConversationForUser: (conversationId: string) => Promise<boolean>;
|
|
8
8
|
reload: () => Promise<void>;
|
|
9
9
|
}
|
|
10
|
-
export declare function useConversations(
|
|
10
|
+
export declare function useConversations(): UseConversationsResult;
|
|
11
11
|
export {};
|
|
@@ -2,11 +2,15 @@ import { PendingMember } from '../utils/chat';
|
|
|
2
2
|
export declare function readPendingMembers(response: unknown): PendingMember[];
|
|
3
3
|
interface PendingJoinRequestsState {
|
|
4
4
|
conversationId: string | null;
|
|
5
|
+
loadedConversationId: string | null;
|
|
5
6
|
requests: PendingMember[];
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
error: string;
|
|
6
9
|
load: (conversationId: string) => Promise<void>;
|
|
7
10
|
clear: () => void;
|
|
8
11
|
}
|
|
9
12
|
export declare const usePendingJoinRequestsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<PendingJoinRequestsState>>;
|
|
13
|
+
export declare function watchPendingJoinRequests(): () => void;
|
|
10
14
|
export interface PendingJoinRequestGroup {
|
|
11
15
|
key: string;
|
|
12
16
|
status: PendingMember['status'];
|