@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.
@@ -1,4 +1,4 @@
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;
@@ -35,6 +35,12 @@ export interface SearchSnippetPart {
35
35
  * (e.g. plain `<span>` vs. a highlighted one) — the snippet itself has no markup, just the
36
36
  * backend's start/stop markers around each matched term. */
37
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;
38
44
  /** Short label for the quoted message shown above a reply (bubble preview or composer banner). */
39
45
  export declare const getReplyPreviewText: (replyTo: {
40
46
  type: string;
@@ -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;
@@ -157,6 +158,7 @@ export interface ChatMessage {
157
158
  pinnedByName?: string | null;
158
159
  removedAt?: string | null;
159
160
  removedById?: string | null;
161
+ removalType?: MessageRemovalType | null;
160
162
  previewUrl?: string;
161
163
  previewUrls?: string[];
162
164
  failureStage?: MessageFailureStage;
@@ -248,10 +250,11 @@ export declare const getConversationMessages: (conversation: unknown) => unknown
248
250
  export declare const readMessages: (response: unknown) => unknown[];
249
251
  export declare const readMessagesWindow: (response: unknown) => MessagesWindow;
250
252
  export declare const toMessageContent: (editorJson: unknown) => MessageContent | null;
253
+ export declare const stripUnavailableMentions: (content: MessageContent, allowedUserIds: ReadonlySet<string>) => MessageContent;
251
254
  export declare const normalizeMessageContent: (content: unknown) => MessageContent | null;
252
255
  export declare const hasMessageContent: (content: MessageContent | null | undefined) => boolean;
253
256
  export declare const getMessageContentParts: (message: unknown) => MessageContentPart[];
254
- export declare const MAX_MESSAGE_INPUT_LENGTH = 5000;
257
+ export declare const MAX_MESSAGE_INPUT_LENGTH = 3000;
255
258
  export declare const getMessageContentText: (message: unknown) => string;
256
259
  /** True for a TEXT message whose entire content is exactly one emoji (a plain "Hi" or a
257
260
  * multi-emoji "😀😀" doesn't count) — Zalo-style, these render at a much larger size with
@@ -279,7 +282,6 @@ export declare const applyMessageTombstone: (message: ChatMessage, removal: {
279
282
  removedAt?: string | null;
280
283
  removedById?: string | null;
281
284
  }) => ChatMessage;
282
- /** Narrows the aggregate-only reaction history payload without ever retaining reaction users. */
283
285
  export declare const normalizeReactionSummary: (value: unknown) => ReactionSummary;
284
286
  export declare const normalizeIncomingMessage: (message: unknown, fallbackConversationId?: string) => ChatMessage;
285
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.26",
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.11"
60
+ "@medipha/chat-core": "1.0.12"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@eslint/js": "^10.0.1",