@medipha/chat 1.0.24 → 1.0.26

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.
@@ -6,5 +6,11 @@ import { Editor } from '@tiptap/core';
6
6
  * bullet/numbered list — you end up with an empty list item still showing its marker next
7
7
  * to the placeholder. `clearNodes()` over the whole selection lifts those wrappers away
8
8
  * first, so what's left to clear is plain paragraphs.
9
+ *
10
+ * The trailing `setTextSelection(0)` collapses the caret back to the start of the emptied
11
+ * paragraph. Without it the `AllSelection` opened by `selectAll()` survives the whole
12
+ * chain — `clearContent()` replaces the document range but never re-anchors the selection,
13
+ * and `AllSelection` re-maps onto the new empty document — so the composer came back with
14
+ * its blank line still selected, drawn by the browser as a dark block at the caret.
9
15
  */
10
16
  export declare function resetEditorContent(editor: Editor | null | undefined): void;
@@ -3,9 +3,11 @@ interface ForwardDialogProps {
3
3
  source: ChatMessage;
4
4
  onClose: () => void;
5
5
  onForward: (targetConversationIds: string[], note: string) => void;
6
+ /** Opens the account-info modal for the person behind a "Cá nhân" row. */
7
+ onOpenProfile?: (userId: string) => void;
6
8
  }
7
9
  /** Zalo-style forward picker: choose one or more conversations to forward a message into.
8
10
  * Built on the shared settings-modal shell/list/checkbox components (same ones the
9
11
  * add-member and create-group pickers use) instead of one-off markup. */
10
- export declare function ForwardDialog({ source, onClose, onForward }: ForwardDialogProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function ForwardDialog({ source, onClose, onForward, onOpenProfile }: ForwardDialogProps): import("react/jsx-runtime").JSX.Element;
11
13
  export {};
@@ -1,4 +1,4 @@
1
- import { ChatMessage } from '../../../utils/chat';
1
+ import { ChatMessage, MessageReplyPreview } from '../../../utils/chat';
2
2
  import { ReactionType } from '@medipha/chat-core';
3
3
  export interface MessageBubbleProps {
4
4
  message: ChatMessage;
@@ -34,7 +34,10 @@ export interface MessageBubbleProps {
34
34
  onRemove: () => void;
35
35
  onReply: () => void;
36
36
  onForward: () => void;
37
- onJumpToReply: (replyMessageId: string) => void;
37
+ /** `preview` is passed only from a reply quote — it lets the caller show the quoted
38
+ * message's own content when the jump lands on something no longer in this reader's
39
+ * history. The pin notice's "Xem" has no preview, so it gets a plain notice instead. */
40
+ onJumpToReply: (replyMessageId: string, preview?: MessageReplyPreview) => void;
38
41
  onOpenMentionCard: (userId: string, fallbackName?: string) => void;
39
42
  onOpenSystemMembers: (messageId: string, totalCount: number, actionLabel: string) => void;
40
43
  onOpenImageLightbox: (urls: string[], index: number) => void;
@@ -0,0 +1,16 @@
1
+ export interface MessageDetailContent {
2
+ senderName?: string | null;
3
+ text: string;
4
+ createdAt?: string | null;
5
+ /** Absolute URL of the photo for an IMAGE message — shown as a thumbnail above the text. */
6
+ imageUrl?: string | null;
7
+ }
8
+ interface MessageDetailDialogProps {
9
+ detail: MessageDetailContent | null;
10
+ onClose: () => void;
11
+ /** Renders inside the caller's own box instead of the page — for a dialog opened from a
12
+ * panel that already sits above the conversation. */
13
+ inline?: boolean;
14
+ }
15
+ export declare function MessageDetailDialog({ detail, onClose, inline }: MessageDetailDialogProps): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -10,7 +10,9 @@ interface MessageDetailsModalProps {
10
10
  * is over MAX_DETAILED_SEEN_MEMBERS and details aren't computed at all. */
11
11
  seenBy: ConversationMember[] | null;
12
12
  onClose: () => void;
13
+ /** Opens the account-info modal for a member of the seen-by list. */
14
+ onOpenProfile?: (userId: string) => void;
13
15
  }
14
16
  /** "Thông tin tin nhắn" dialog — sender/content/time preview plus a seen-by list. */
15
- export declare function MessageDetailsModal({ message, isGroup, members, otherMember, currentUserId, authUser, seenBy, onClose, }: MessageDetailsModalProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function MessageDetailsModal({ message, isGroup, members, otherMember, currentUserId, authUser, seenBy, onClose, onOpenProfile, }: MessageDetailsModalProps): import("react/jsx-runtime").JSX.Element;
16
18
  export {};
@@ -30,6 +30,9 @@ export declare function useMessageWindow(conversationId: string | undefined): {
30
30
  isLoadingNewer: boolean;
31
31
  isLoadingOlder: boolean;
32
32
  loadAround: (messageId: string) => Promise<boolean>;
33
+ /** Whether the last `loadAround` failed because the message is gone for this reader.
34
+ * Read it right after awaiting the call. */
35
+ wasLastAroundNotFound: () => boolean;
33
36
  loadLatest: () => Promise<boolean>;
34
37
  loadNewer: () => Promise<boolean>;
35
38
  loadOlder: () => Promise<boolean>;