@medipha/chat 1.0.26 → 1.0.27
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/features/composer/conversation-composer.d.ts +4 -1
- package/dist/features/composer/editor/paste-mentions.d.ts +1 -0
- package/dist/features/composer/reply/use-reply-target.d.ts +6 -2
- package/dist/features/message-list/bubble/message-actions/message-actions-menu.d.ts +2 -3
- package/dist/features/message-list/bubble/message-bubble.d.ts +3 -2
- package/dist/features/message-list/overlays/message-detail/message-detail-dialog.d.ts +4 -0
- package/dist/index.cjs +46 -46
- package/dist/index.js +54657 -54461
- package/dist/pages/Setting/hooks/use-conversation-settings.d.ts +0 -1
- package/dist/pages/Setting/members/settings-modal.d.ts +1 -4
- package/dist/shared/components/chat-dialog.d.ts +15 -0
- package/dist/shared/components/load-more-sentinel.d.ts +1 -1
- package/dist/shared/components/loading-state.d.ts +13 -0
- package/dist/shared/hooks/use-auto-focus-first-field.d.ts +11 -0
- package/dist/store/draftStore.d.ts +5 -4
- package/dist/styles.css +1 -1
- package/dist/utils/chat-display.d.ts +7 -1
- package/dist/utils/chat.d.ts +4 -2
- package/package.json +2 -2
|
@@ -10,7 +10,8 @@ interface ConversationComposerProps {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
/** Allows sending with an empty editor (attachments staged in the parent are the payload). */
|
|
12
12
|
hasPendingAttachments?: boolean;
|
|
13
|
-
|
|
13
|
+
/** Returns false to keep the draft in the box — the send was refused, not sent. */
|
|
14
|
+
onSubmit: (content: MessageContent) => boolean | void;
|
|
14
15
|
onError?: (message: string) => void;
|
|
15
16
|
onAttach?: () => void;
|
|
16
17
|
onAttachImages?: () => void;
|
|
@@ -27,6 +28,8 @@ export interface ConversationComposerHandle {
|
|
|
27
28
|
* space — used when starting a reply, so the reply reads like Zalo's own
|
|
28
29
|
* "@[tên] <đang gõ>" instead of relying on the quoted-message banner alone. */
|
|
29
30
|
insertMentionAtStart: (userId: string, fallbackName: string) => void;
|
|
31
|
+
/** Undoes the above when the reply is cancelled, leaving whatever else was typed. */
|
|
32
|
+
removeMentionAtStart: (userId: string) => void;
|
|
30
33
|
}
|
|
31
34
|
/** Rich-text composer that emits backend message content, with real @mentions. */
|
|
32
35
|
export declare const ConversationComposer: import('react').ForwardRefExoticComponent<ConversationComposerProps & import('react').RefAttributes<ConversationComposerHandle>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function flattenPastedMentions(html: string): string;
|
|
@@ -3,9 +3,13 @@ import { ChatMessage } from '../../../utils/chat';
|
|
|
3
3
|
* Tracks the message the composer is currently replying to — set from a bubble's
|
|
4
4
|
* "Reply" action, read by the composer's reply banner and included in the next send,
|
|
5
5
|
* cleared on submit or when its target message is removed/recalled.
|
|
6
|
+
*
|
|
7
|
+
* Kept per conversation, the same way drafts are: a reply belongs to the conversation it
|
|
8
|
+
* was started in, so switching away must not carry it into another one (whose messages it
|
|
9
|
+
* doesn't belong to), and coming back must restore it.
|
|
6
10
|
*/
|
|
7
|
-
export declare function useReplyTarget(): {
|
|
8
|
-
replyTarget: ChatMessage
|
|
11
|
+
export declare function useReplyTarget(conversationId: string | undefined): {
|
|
12
|
+
replyTarget: ChatMessage;
|
|
9
13
|
startReply: (message: ChatMessage) => void;
|
|
10
14
|
clearReply: () => void;
|
|
11
15
|
clearIfTarget: (messageId: string) => void;
|
|
@@ -6,10 +6,9 @@ interface MessageActionsMenuProps {
|
|
|
6
6
|
/** "Xem chi tiết" (delivery/read receipts) only means anything for a message the current
|
|
7
7
|
* user themself sent — someone else's message shows the same receipts to everyone. */
|
|
8
8
|
canViewDetails: boolean;
|
|
9
|
-
/** Whether
|
|
9
|
+
/** Whether there is something to put on the clipboard: text, or an image message's
|
|
10
|
+
* photos. False for a file-only message. */
|
|
10
11
|
canCopy: boolean;
|
|
11
|
-
/** False for a multi-image message — its reply-quote can't point at any one photo, so
|
|
12
|
-
* there's nothing specific for a reply to reference. */
|
|
13
12
|
canReply: boolean;
|
|
14
13
|
canForward: boolean;
|
|
15
14
|
isPinned: boolean;
|
|
@@ -3,7 +3,8 @@ import { ReactionType } from '@medipha/chat-core';
|
|
|
3
3
|
export interface MessageBubbleProps {
|
|
4
4
|
message: ChatMessage;
|
|
5
5
|
isMine: boolean;
|
|
6
|
-
|
|
6
|
+
currentUserId: string | null;
|
|
7
|
+
resolveUserName: (userId: string) => string;
|
|
7
8
|
isGroup: boolean;
|
|
8
9
|
isFocused: boolean;
|
|
9
10
|
isLatestMessage: boolean;
|
|
@@ -55,4 +56,4 @@ export interface MessageBubbleProps {
|
|
|
55
56
|
/** Renders one message: day divider, SYSTEM notice, reply/forward context, bubble body
|
|
56
57
|
* (delegated to MessageContentBody), reaction badge/picker (MessageReactions), action buttons
|
|
57
58
|
* and options menu (MessageActionsMenu), and the trailing timestamp/status/retry. */
|
|
58
|
-
export declare function MessageBubble({ message, isMine, isGroup, isFocused, isLatestMessage, showDayDivider, isReactionPickerOpen, myReactionType, onOpenReactionPicker, onCloseReactionPickerIfSelf, onApplyReaction, onRemoveReaction, onOpenReactionModal, canManagePins, isPinned, onTogglePin, isMenuOpen, menuPosition, onOpenMenu, onCloseMenu, onCopyMessage, onViewDetails, canRemove, removeLabel, isRemoving, onRemove, onReply, onForward, onJumpToReply, onOpenMentionCard, onOpenSystemMembers, onOpenImageLightbox, onImageSettled, onRetry, onDeleteFailed, isSenderGroupOwner, resolveUserAvatar, onOpenUserProfile, }: MessageBubbleProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare function MessageBubble({ message, isMine, currentUserId, resolveUserName, isGroup, isFocused, isLatestMessage, showDayDivider, isReactionPickerOpen, myReactionType, onOpenReactionPicker, onCloseReactionPickerIfSelf, onApplyReaction, onRemoveReaction, onOpenReactionModal, canManagePins, isPinned, onTogglePin, isMenuOpen, menuPosition, onOpenMenu, onCloseMenu, onCopyMessage, onViewDetails, canRemove, removeLabel, isRemoving, onRemove, onReply, onForward, onJumpToReply, onOpenMentionCard, onOpenSystemMembers, onOpenImageLightbox, onImageSettled, onRetry, onDeleteFailed, isSenderGroupOwner, resolveUserAvatar, onOpenUserProfile, }: MessageBubbleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { MessageContent } from '../../../../utils/chat';
|
|
1
2
|
export interface MessageDetailContent {
|
|
2
3
|
senderName?: string | null;
|
|
3
4
|
text: string;
|
|
4
5
|
createdAt?: string | null;
|
|
5
6
|
/** Absolute URL of the photo for an IMAGE message — shown as a thumbnail above the text. */
|
|
6
7
|
imageUrl?: string | null;
|
|
8
|
+
/** The message's own content. A rich document is shown (and copied) with its bold,
|
|
9
|
+
* italics, links and mentions intact; anything else falls back to `text` above. */
|
|
10
|
+
content?: MessageContent | null;
|
|
7
11
|
}
|
|
8
12
|
interface MessageDetailDialogProps {
|
|
9
13
|
detail: MessageDetailContent | null;
|