@medipha/chat 1.0.18 → 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.
- package/dist/assets/reactions/angry.json.d.ts +3 -0
- package/dist/assets/reactions/haha.json.d.ts +3 -0
- package/dist/assets/reactions/like.json.d.ts +3 -0
- package/dist/assets/reactions/love.json.d.ts +3 -0
- package/dist/assets/reactions/sad.json.d.ts +3 -0
- package/dist/assets/reactions/wow.json.d.ts +3 -0
- package/dist/features/media-preview/media-preview-modal.d.ts +6 -3
- package/dist/features/message-list/bubble/message-bubble.d.ts +3 -1
- package/dist/features/message-list/bubble/reaction-assets.d.ts +4 -3
- package/dist/index.cjs +46 -46
- package/dist/index.js +42442 -13398
- package/dist/shared/components/user-profile-modal.d.ts +5 -1
- package/dist/store/draftStore.d.ts +4 -18
- package/dist/store/typingStore.d.ts +2 -5
- package/dist/styles.css +1 -1
- package/dist/utils/chat-display.d.ts +3 -0
- package/package.json +2 -1
|
@@ -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 {};
|
|
@@ -2,28 +2,14 @@ import { JSONContent } from '@tiptap/core';
|
|
|
2
2
|
type DraftMap = Record<string, JSONContent>;
|
|
3
3
|
interface DraftState {
|
|
4
4
|
draftByConversation: DraftMap;
|
|
5
|
-
/** Stores (or, with `null`, discards) the unsent composer content for one conversation. */
|
|
6
5
|
setDraft: (conversationId: string, doc: JSONContent | null) => void;
|
|
7
6
|
}
|
|
8
|
-
/** Flattens a draft doc to the one-line plain text the sidebar row previews.
|
|
9
|
-
* carry their display name in attrs rather than as a text child, so they need their own
|
|
10
|
-
* branch or an "@ai đó" draft would preview as an empty string. */
|
|
7
|
+
/** Flattens a draft doc to the one-line plain text the sidebar row previews. */
|
|
11
8
|
export declare function getDraftText(doc: JSONContent | undefined): string;
|
|
12
|
-
/** Writes the pending
|
|
13
|
-
* before handing the store over to a different account. */
|
|
9
|
+
/** Writes the pending snapshot out now, skipping the debounce. */
|
|
14
10
|
export declare function flushDrafts(): void;
|
|
15
|
-
/**
|
|
16
|
-
* Points the store at one account's drafts: flushes whatever the previous account still had
|
|
17
|
-
* pending, then loads that user's own set. Called once the session's user id is known (see
|
|
18
|
-
* ChatBootstrap) — signing in as someone else on the same browser therefore swaps the whole
|
|
19
|
-
* map rather than leaking the first account's unsent text into the second's sidebar.
|
|
20
|
-
*/
|
|
11
|
+
/** Swaps the loaded draft set to another account, flushing the previous one first. */
|
|
21
12
|
export declare function setDraftUser(userId: string | null): void;
|
|
22
|
-
/**
|
|
23
|
-
* Unsent composer content, kept per conversation so switching threads (or reloading) and
|
|
24
|
-
* coming back restores what was being typed — Zalo/Messenger behaviour. Scoped to the
|
|
25
|
-
* signed-in user and mirrored to localStorage; a draft is dropped the moment its message is
|
|
26
|
-
* actually sent.
|
|
27
|
-
*/
|
|
13
|
+
/** Unsent composer content per conversation, scoped to the signed-in user. */
|
|
28
14
|
export declare const useDraftStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DraftState>>;
|
|
29
15
|
export {};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
interface TypingState {
|
|
2
2
|
/** conversationId -> display names currently typing there, most recent first. */
|
|
3
3
|
namesByConversation: Record<string, string[]>;
|
|
4
|
-
/** Replaces the typer list for one conversation; an empty list drops the key entirely. */
|
|
5
4
|
setTypingNames: (conversationId: string, names: string[]) => void;
|
|
6
5
|
clearConversation: (conversationId: string) => void;
|
|
7
6
|
}
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* typing timers) rather than by its own socket subscription — which also means it only
|
|
11
|
-
* ever covers the conversation currently open, since the socket joins that room alone. */
|
|
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. */
|
|
12
9
|
export declare const useTypingStore: import('zustand').UseBoundStore<import('zustand').StoreApi<TypingState>>;
|
|
13
10
|
export {};
|