@medipha/chat 1.0.17 → 1.0.19

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.
@@ -4,10 +4,14 @@ interface UserProfileModalProps {
4
4
  onClose: () => void;
5
5
  /** Opens (or reuses) a direct conversation with this user. */
6
6
  onStartChat?: (userId: string) => void;
7
+ /** Badges the avatar with the owner key — set when this dialog was opened from a group
8
+ * whose owner this user is. It's a per-conversation role, not a property of the account,
9
+ * so it can only come from the caller that knows which group we came from. */
10
+ isGroupOwner?: boolean;
7
11
  }
8
12
  /** Zalo-style "Thông tin tài khoản" dialog, opened from a user avatar click: avatar on
9
13
  * top, then contact details (họ tên, ngày sinh, email, số điện thoại) and a second
10
14
  * group with the directory info (chi nhánh, phòng ban, chức vụ). Portals to body with
11
15
  * the layered mask so it stacks above the member-list modal it may be opened from. */
12
- export declare function UserProfileModal({ userId, fallbackName, onClose, onStartChat }: UserProfileModalProps): import('react').ReactPortal;
16
+ export declare function UserProfileModal({ userId, fallbackName, onClose, onStartChat, isGroupOwner, }: UserProfileModalProps): import('react').ReactPortal;
13
17
  export {};
@@ -0,0 +1,15 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+ type DraftMap = Record<string, JSONContent>;
3
+ interface DraftState {
4
+ draftByConversation: DraftMap;
5
+ setDraft: (conversationId: string, doc: JSONContent | null) => void;
6
+ }
7
+ /** Flattens a draft doc to the one-line plain text the sidebar row previews. */
8
+ export declare function getDraftText(doc: JSONContent | undefined): string;
9
+ /** Writes the pending snapshot out now, skipping the debounce. */
10
+ export declare function flushDrafts(): void;
11
+ /** Swaps the loaded draft set to another account, flushing the previous one first. */
12
+ export declare function setDraftUser(userId: string | null): void;
13
+ /** Unsent composer content per conversation, scoped to the signed-in user. */
14
+ export declare const useDraftStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DraftState>>;
15
+ export {};
@@ -0,0 +1,10 @@
1
+ interface TypingState {
2
+ /** conversationId -> display names currently typing there, most recent first. */
3
+ namesByConversation: Record<string, string[]>;
4
+ setTypingNames: (conversationId: string, names: string[]) => void;
5
+ clearConversation: (conversationId: string) => void;
6
+ }
7
+ /** Typing state of the open conversation, mirrored here so its sidebar row can show it.
8
+ * Fed by useTypingIndicator (which owns the typing timers), not its own subscription. */
9
+ export declare const useTypingStore: import('zustand').UseBoundStore<import('zustand').StoreApi<TypingState>>;
10
+ export {};