@medipha/chat 1.0.27 → 1.0.28
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/attachment-file-helpers.d.ts +6 -0
- package/dist/features/composer/conversation-composer.d.ts +0 -10
- package/dist/features/composer/editor/mention-suggestion-list.d.ts +2 -1
- package/dist/index.cjs +44 -44
- package/dist/index.js +7682 -7662
- package/dist/shared/components/work-status-badge.d.ts +9 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -3,6 +3,12 @@ export declare const ACCEPT_ATTRIBUTE = ".jpg,.jpeg,.png,.webp,.gif,.pdf,.doc,.d
|
|
|
3
3
|
export declare const ACCEPTED_FILE_EXTENSIONS: Set<string>;
|
|
4
4
|
export declare const getFileExtension: (file: File) => string;
|
|
5
5
|
export declare const isImageFile: (file: File) => boolean;
|
|
6
|
+
/** A clipboard image is not a file on disk, so the browser invents its name — usually
|
|
7
|
+
* "image.png", but it can arrive without a usable extension, which both the staging
|
|
8
|
+
* filter and the backend reject (they key off the extension, never the mimetype). Rebuild
|
|
9
|
+
* those under a real extension derived from the mimetype; anything already named like an
|
|
10
|
+
* image, and anything not an image at all, is returned untouched. */
|
|
11
|
+
export declare const withImageFileExtension: (file: File) => File;
|
|
6
12
|
/** Splits staged files into same-kind runs (images vs. documents) so each becomes one grouped message. */
|
|
7
13
|
export declare const groupAttachmentsByKind: (attachments: PendingAttachment[]) => PendingAttachment[][];
|
|
8
14
|
/** Keeps only files with a supported extension; `hasRejectedFiles` tells the caller
|
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
import { ChatUser, MessageContent } from '../../utils/chat';
|
|
2
2
|
interface ConversationComposerProps {
|
|
3
|
-
/** Keys the saved draft. Omit (or pass undefined) to disable draft persistence. */
|
|
4
3
|
draftKey?: string;
|
|
5
4
|
conversationName: string;
|
|
6
5
|
members: ChatUser[];
|
|
7
6
|
canMentionAll: boolean;
|
|
8
|
-
/** Enables @mentions; turned off for 1-1 chats where there's nobody to tag. */
|
|
9
7
|
enableMentions?: boolean;
|
|
10
8
|
disabled?: boolean;
|
|
11
|
-
/** Allows sending with an empty editor (attachments staged in the parent are the payload). */
|
|
12
9
|
hasPendingAttachments?: boolean;
|
|
13
|
-
/** Returns false to keep the draft in the box — the send was refused, not sent. */
|
|
14
10
|
onSubmit: (content: MessageContent) => boolean | void;
|
|
15
11
|
onError?: (message: string) => void;
|
|
16
12
|
onAttach?: () => void;
|
|
17
13
|
onAttachImages?: () => void;
|
|
18
|
-
/** Stages pasted image file(s) exactly like the attach-image button/drop would. */
|
|
19
14
|
onPasteFiles?: (files: File[]) => void;
|
|
20
15
|
onTypingStart?: () => void;
|
|
21
16
|
onTypingStop?: () => void;
|
|
22
17
|
}
|
|
23
18
|
export interface ConversationComposerHandle {
|
|
24
|
-
/** Returns the caret to the editor — used after staging an attachment, where focus
|
|
25
|
-
* otherwise stays on the attach button (or the file dialog that just closed). */
|
|
26
19
|
focus: () => void;
|
|
27
|
-
/** Inserts an @mention of this user at the very start of the draft, then a trailing
|
|
28
|
-
* space — used when starting a reply, so the reply reads like Zalo's own
|
|
29
|
-
* "@[tên] <đang gõ>" instead of relying on the quoted-message banner alone. */
|
|
30
20
|
insertMentionAtStart: (userId: string, fallbackName: string) => void;
|
|
31
21
|
/** Undoes the above when the reply is cancelled, leaving whatever else was typed. */
|
|
32
22
|
removeMentionAtStart: (userId: string) => void;
|
|
@@ -9,7 +9,8 @@ interface MentionSuggestionListProps {
|
|
|
9
9
|
items: MentionItem[];
|
|
10
10
|
selectedIndex: number;
|
|
11
11
|
onSelect: (index: number) => void;
|
|
12
|
+
onHighlight: (index: number) => void;
|
|
12
13
|
}
|
|
13
14
|
/** Zalo-style @mention dropdown: hint row, an "@All" option, then members with avatars. */
|
|
14
|
-
export declare function MentionSuggestionList({ items, selectedIndex, onSelect }: MentionSuggestionListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
export declare function MentionSuggestionList({ items, selectedIndex, onSelect, onHighlight, }: MentionSuggestionListProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
16
|
export {};
|