@medipha/chat 1.0.39 → 1.0.41

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.
@@ -1,5 +1,6 @@
1
- import { Conversation, ConversationMember } from '../../../utils/chat';
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
- nextCursor: string | null;
35
- otherMembers: ConversationMember[];
31
+ otherMembers: import('../../../utils/chat').ConversationMember[];
36
32
  renameConversation: (title: string) => Promise<boolean>;
37
- searchMembers: (search: string) => Promise<void>;
33
+ searchMembers: (search: string) => void;
38
34
  updateGroupAvatarFile: (file: File) => Promise<boolean>;
39
35
  };
40
36
  export {};
@@ -1,4 +1,9 @@
1
- export declare function usePendingJoinRequests(conversationId: string | undefined, enabled: boolean): {
2
- requests: import('../../../utils/chat').PendingMember[];
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
  };
@@ -3,6 +3,8 @@ interface GroupMembersModalProps {
3
3
  members: ConversationMember[] | undefined;
4
4
  memberCount: number;
5
5
  onClose: () => void;
6
+ /** Shown only where adding is offered (the Setting panel); the header list omits it. */
7
+ onOpenAddModal?: () => void;
6
8
  /** Opens the account-info modal for a member. */
7
9
  onOpenProfile?: (userId: string) => void;
8
10
  /** Who is looking — they never get a tick next to their own row. */
@@ -17,5 +19,5 @@ interface GroupMembersModalProps {
17
19
  /** Read-only member list opened from the group header's member count. Reads straight from
18
20
  * the conversation's own `members` (kept live in the shared conversationsStore) instead of
19
21
  * its own fetch — no separate loading state, and no staleness while it's open. */
20
- export declare function GroupMembersModal({ members, memberCount, onClose, onOpenProfile, currentUserId, canRemove, isRemoving, onDeleteMembers, }: GroupMembersModalProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function GroupMembersModal({ members, memberCount, onClose, onOpenAddModal, onOpenProfile, currentUserId, canRemove, isRemoving, onDeleteMembers, }: GroupMembersModalProps): import("react/jsx-runtime").JSX.Element;
21
23
  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
- reload: () => Promise<void>;
13
- reset: () => void;
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(activeConversationId?: string): UseConversationsResult;
10
+ export declare function useConversations(): UseConversationsResult;
11
11
  export {};
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ interface ConfirmDialogProps {
3
+ title: string;
4
+ /** Body copy — plain text, or richer markup when the action needs a preview. */
5
+ children: ReactNode;
6
+ confirmLabel: string;
7
+ busyLabel?: string;
8
+ isBusy?: boolean;
9
+ onCancel: () => void;
10
+ onConfirm: () => void;
11
+ }
12
+ /** The one destructive-confirm shape the whole app uses: deleting a conversation, unpinning,
13
+ * recalling a message. Built on SettingsModal so backdrop/Esc behave like every other modal. */
14
+ export declare function ConfirmDialog({ title, children, confirmLabel, busyLabel, isBusy, onCancel, onConfirm, }: ConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,6 @@
1
+ interface LottieAnimationProps {
2
+ src: string;
3
+ className?: string;
4
+ }
5
+ export declare function LottieAnimation({ src, className }: LottieAnimationProps): import("react/jsx-runtime").JSX.Element | null;
6
+ 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'];