@medipha/chat 1.0.25 → 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/editor/reset-editor-content.d.ts +6 -0
- package/dist/features/composer/reply/use-reply-target.d.ts +6 -2
- package/dist/features/forward/forward-dialog.d.ts +3 -1
- 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 +8 -4
- package/dist/features/message-list/overlays/message-detail/message-detail-dialog.d.ts +20 -0
- package/dist/features/message-list/overlays/message-details/message-details-modal.d.ts +3 -1
- package/dist/features/message-window/use-message-window.d.ts +3 -0
- package/dist/index.cjs +46 -46
- package/dist/index.js +55155 -54806
- package/dist/pages/Setting/hooks/use-conversation-settings.d.ts +0 -1
- package/dist/pages/conversation/conversation-detail/conversation-detail.d.ts +2 -2
- package/dist/pages/sidebar/hooks/use-conversations.d.ts +0 -7
- 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/components/selection-panel.d.ts +20 -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 +12 -1
- package/dist/utils/chat.d.ts +5 -2
- package/package.json +2 -2
- package/dist/features/create-conversation/tabs/selected-members-modal.d.ts +0 -12
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { ChatUser, Conversation, ConversationMember, MessageContent } from './chat';
|
|
1
|
+
import { ChatUser, Conversation, ConversationMember, MessageContent, MessageRemovalType } from './chat';
|
|
2
2
|
export declare const getMemberUser: (member: ConversationMember) => ChatUser;
|
|
3
3
|
export declare const getMemberUserId: (member: ConversationMember) => string | null;
|
|
4
4
|
export declare const getMemberRole: (member: ConversationMember | null | undefined) => string;
|
|
5
|
+
/** The person on the other side of a DIRECT conversation, or undefined for a group (and for
|
|
6
|
+
* a direct chat whose roster hasn't loaded, or the note-to-self case where the only member
|
|
7
|
+
* is the viewer). A direct row IS that one account everywhere it's listed — sidebar, forward
|
|
8
|
+
* picker, conversation header — so this is what lets those rows show and open their profile. */
|
|
9
|
+
export declare const getDirectPeerMember: (conversation: Conversation, currentUserId: string | null) => ConversationMember | undefined;
|
|
5
10
|
/** The group owner's userId, or null when the roster isn't loaded / has no OWNER row.
|
|
6
11
|
* Drives the key badge shown on their avatar in the timeline and account-info dialog. */
|
|
7
12
|
export declare const getGroupOwnerId: (members: ConversationMember[] | undefined | null) => string | null;
|
|
@@ -30,6 +35,12 @@ export interface SearchSnippetPart {
|
|
|
30
35
|
* (e.g. plain `<span>` vs. a highlighted one) — the snippet itself has no markup, just the
|
|
31
36
|
* backend's start/stop markers around each matched term. */
|
|
32
37
|
export declare const splitSearchSnippet: (snippet: string) => SearchSnippetPart[];
|
|
38
|
+
export declare const SENDER_RECALL_LABEL = "Tin nh\u1EAFn \u0111\u00E3 \u0111\u01B0\u1EE3c thu h\u1ED3i.";
|
|
39
|
+
export declare const getRemovedMessageLabel: (message: {
|
|
40
|
+
senderId?: string;
|
|
41
|
+
removedById?: string | null;
|
|
42
|
+
removalType?: MessageRemovalType | null;
|
|
43
|
+
}, currentUserId: string | null, resolveRemoverName: (userId: string) => string) => string;
|
|
33
44
|
/** Short label for the quoted message shown above a reply (bubble preview or composer banner). */
|
|
34
45
|
export declare const getReplyPreviewText: (replyTo: {
|
|
35
46
|
type: string;
|
package/dist/utils/chat.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ export type MessageType = 'TEXT' | 'IMAGE' | 'DOCUMENT' | 'SYSTEM';
|
|
|
80
80
|
* bubble can pick an icon without inspecting the message text. */
|
|
81
81
|
export type MessageSystemCategory = 'MESSAGE_PIN' | 'GROUP_INFO_UPDATE' | 'MEMBER_CHANGE';
|
|
82
82
|
export type MessageFailureStage = 'upload' | 'send';
|
|
83
|
+
export type MessageRemovalType = 'SENDER_RECALL' | 'OWNER_MODERATION';
|
|
83
84
|
export interface MentionedUser {
|
|
84
85
|
userId: string;
|
|
85
86
|
fullName?: string;
|
|
@@ -104,6 +105,7 @@ export interface MessageReplyPreview {
|
|
|
104
105
|
content: MessageContent | null;
|
|
105
106
|
attachmentName: string | null;
|
|
106
107
|
attachmentUrl?: string | null;
|
|
108
|
+
createdAt?: string | null;
|
|
107
109
|
removedAt?: string | null;
|
|
108
110
|
removedById?: string | null;
|
|
109
111
|
}
|
|
@@ -156,6 +158,7 @@ export interface ChatMessage {
|
|
|
156
158
|
pinnedByName?: string | null;
|
|
157
159
|
removedAt?: string | null;
|
|
158
160
|
removedById?: string | null;
|
|
161
|
+
removalType?: MessageRemovalType | null;
|
|
159
162
|
previewUrl?: string;
|
|
160
163
|
previewUrls?: string[];
|
|
161
164
|
failureStage?: MessageFailureStage;
|
|
@@ -247,10 +250,11 @@ export declare const getConversationMessages: (conversation: unknown) => unknown
|
|
|
247
250
|
export declare const readMessages: (response: unknown) => unknown[];
|
|
248
251
|
export declare const readMessagesWindow: (response: unknown) => MessagesWindow;
|
|
249
252
|
export declare const toMessageContent: (editorJson: unknown) => MessageContent | null;
|
|
253
|
+
export declare const stripUnavailableMentions: (content: MessageContent, allowedUserIds: ReadonlySet<string>) => MessageContent;
|
|
250
254
|
export declare const normalizeMessageContent: (content: unknown) => MessageContent | null;
|
|
251
255
|
export declare const hasMessageContent: (content: MessageContent | null | undefined) => boolean;
|
|
252
256
|
export declare const getMessageContentParts: (message: unknown) => MessageContentPart[];
|
|
253
|
-
export declare const MAX_MESSAGE_INPUT_LENGTH =
|
|
257
|
+
export declare const MAX_MESSAGE_INPUT_LENGTH = 3000;
|
|
254
258
|
export declare const getMessageContentText: (message: unknown) => string;
|
|
255
259
|
/** True for a TEXT message whose entire content is exactly one emoji (a plain "Hi" or a
|
|
256
260
|
* multi-emoji "😀😀" doesn't count) — Zalo-style, these render at a much larger size with
|
|
@@ -278,7 +282,6 @@ export declare const applyMessageTombstone: (message: ChatMessage, removal: {
|
|
|
278
282
|
removedAt?: string | null;
|
|
279
283
|
removedById?: string | null;
|
|
280
284
|
}) => ChatMessage;
|
|
281
|
-
/** Narrows the aggregate-only reaction history payload without ever retaining reaction users. */
|
|
282
285
|
export declare const normalizeReactionSummary: (value: unknown) => ReactionSummary;
|
|
283
286
|
export declare const normalizeIncomingMessage: (message: unknown, fallbackConversationId?: string) => ChatMessage;
|
|
284
287
|
/** Formats a byte count as a short human-readable size label (e.g. "2.4 MB"). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medipha/chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "Embeddable Medic-ERP chat module for React applications.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"uuid": "^11.0.5",
|
|
58
58
|
"yet-another-react-lightbox": "^3.32.2",
|
|
59
59
|
"zustand": "^5.0.8",
|
|
60
|
-
"@medipha/chat-core": "1.0.
|
|
60
|
+
"@medipha/chat-core": "1.0.12"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@eslint/js": "^10.0.1",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ChatUser } from '../../../utils/chat';
|
|
2
|
-
interface SelectedMembersModalProps {
|
|
3
|
-
users: ChatUser[];
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
onRemove: (user: ChatUser) => void;
|
|
6
|
-
onOpenProfile: (userId: string) => void;
|
|
7
|
-
}
|
|
8
|
-
/** Read-only-ish review of who's picked so far for the new group, opened from the
|
|
9
|
-
* "Đã chọn N thành viên" count — each row can also be unchecked without hunting it
|
|
10
|
-
* back down in the (possibly filtered/paginated) main list. */
|
|
11
|
-
export declare function SelectedMembersModal({ users, onClose, onRemove, onOpenProfile }: SelectedMembersModalProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|