@medipha/chat 1.0.55 → 1.0.56
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 +3 -1
- package/dist/features/composer/pending-attachment.d.ts +3 -6
- package/dist/features/files/audio-attachment.d.ts +6 -0
- package/dist/features/files/video-attachment.d.ts +9 -0
- package/dist/features/media-preview/media-preview-modal.d.ts +4 -0
- package/dist/features/media-preview/use-image-lightbox.d.ts +3 -2
- package/dist/features/message-list/bubble/message-bubble.d.ts +2 -1
- package/dist/features/message-list/bubble/message-content-body.d.ts +2 -1
- package/dist/index.cjs +66 -66
- package/dist/index.js +12106 -11594
- package/dist/pages/conversation/conversation-detail/conversation-detail.d.ts +2 -1
- package/dist/styles.css +1 -1
- package/dist/utils/chat-display.d.ts +18 -1
- package/dist/utils/chat.d.ts +14 -0
- package/package.json +2 -2
|
@@ -3,13 +3,15 @@ export declare const BLOCKED_FILE_EXTENSIONS: Set<string>;
|
|
|
3
3
|
export declare const getFileExtension: (file: File) => string;
|
|
4
4
|
export declare const isBlockedFile: (file: File) => boolean;
|
|
5
5
|
export declare const isImageFile: (file: File) => boolean;
|
|
6
|
+
export declare const isVideoFile: (file: File) => boolean;
|
|
6
7
|
/** A clipboard image is not a file on disk, so the browser invents its name — usually the
|
|
7
8
|
* same generic "image.png" for every paste, which both the staging filter and the backend
|
|
8
9
|
* reject when it lacks a usable extension (they key off the extension, never the mimetype).
|
|
9
10
|
* Every pasted image is rebuilt under a fresh unique name so two screenshots pasted in the
|
|
10
11
|
* same batch never collide once uploaded; anything not an image is returned untouched. */
|
|
11
12
|
export declare const withImageFileExtension: (file: File) => File;
|
|
12
|
-
/** Splits staged files into same-kind runs (images
|
|
13
|
+
/** Splits staged files into same-kind runs (images, videos, documents) so each becomes one
|
|
14
|
+
* grouped message. */
|
|
13
15
|
export declare const groupAttachmentsByKind: (attachments: PendingAttachment[]) => PendingAttachment[][];
|
|
14
16
|
/** Drops executable files; `hasRejectedFiles` tells the caller
|
|
15
17
|
* whether to surface a format-not-supported error. */
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { MediaKind } from '../../utils/chat';
|
|
2
|
+
export type PendingAttachmentKind = MediaKind;
|
|
2
3
|
export interface PendingAttachment {
|
|
3
4
|
file: File;
|
|
4
5
|
previewUrl?: string;
|
|
5
|
-
|
|
6
|
-
* resolved once at staging time (see buildPendingAttachment) so every later step
|
|
7
|
-
* (grouping, the outgoing message's own `type`, the upload request) agrees on it,
|
|
8
|
-
* instead of each re-deriving it from the file's extension. */
|
|
9
|
-
isImage: boolean;
|
|
6
|
+
kind: PendingAttachmentKind;
|
|
10
7
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChatMessageAttachment } from '../../utils/chat';
|
|
2
|
+
import { MediaPreviewSource } from '../media-preview/use-image-lightbox';
|
|
3
|
+
interface VideoAttachmentProps {
|
|
4
|
+
attachment: ChatMessageAttachment;
|
|
5
|
+
onOpen: (source: MediaPreviewSource) => void;
|
|
6
|
+
onPosterSettled?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function VideoAttachment({ attachment, onOpen, onPosterSettled }: VideoAttachmentProps): import('react/jsx-runtime').JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { MediaKind } from '../../utils/chat';
|
|
1
2
|
export interface MediaPreviewItem {
|
|
2
3
|
id: string;
|
|
3
4
|
url: string;
|
|
4
5
|
createdAt: string;
|
|
5
6
|
name?: string | null;
|
|
7
|
+
kind?: MediaKind | null;
|
|
8
|
+
mimeType?: string | null;
|
|
9
|
+
thumbnailUrl?: string | null;
|
|
6
10
|
}
|
|
7
11
|
export interface MediaPreviewState {
|
|
8
12
|
items: MediaPreviewItem[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ChatMessage } from '../../utils/chat';
|
|
2
|
-
import { MediaPreviewState } from './media-preview-modal';
|
|
2
|
+
import { MediaPreviewItem, MediaPreviewState } from './media-preview-modal';
|
|
3
|
+
export type MediaPreviewSource = Omit<MediaPreviewItem, 'id' | 'createdAt'>;
|
|
3
4
|
/**
|
|
4
5
|
* Owns the fullscreen media-preview overlay. `openFromBubble` shows only the clicked
|
|
5
6
|
* message's own images — swiping across the whole conversation's media only happens from
|
|
@@ -9,7 +10,7 @@ import { MediaPreviewState } from './media-preview-modal';
|
|
|
9
10
|
export declare function useImageLightbox(): {
|
|
10
11
|
imageLightbox: MediaPreviewState | null;
|
|
11
12
|
openItems: (items: MediaPreviewState["items"], index: number) => void;
|
|
12
|
-
openFromBubble: (message: ChatMessage,
|
|
13
|
+
openFromBubble: (message: ChatMessage, sources: MediaPreviewSource[], clickedIndex: number) => void;
|
|
13
14
|
setIndex: (index: number) => void;
|
|
14
15
|
close: () => void;
|
|
15
16
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MessageMenuPosition } from '../overlays/message-menu/use-message-menu';
|
|
2
2
|
import { ChatMessage, MessageReplyPreview } from '../../../utils/chat';
|
|
3
3
|
import { ReactionType } from '@medipha/chat-core';
|
|
4
|
+
import { MediaPreviewSource } from '../../media-preview/use-image-lightbox';
|
|
4
5
|
export interface MessageBubbleProps {
|
|
5
6
|
message: ChatMessage;
|
|
6
7
|
isMine: boolean;
|
|
@@ -38,7 +39,7 @@ export interface MessageBubbleProps {
|
|
|
38
39
|
onJumpToReply: (replyMessageId: string, preview?: MessageReplyPreview) => void;
|
|
39
40
|
onOpenMentionCard: (userId: string, fallbackName?: string) => void;
|
|
40
41
|
onOpenSystemMembers: (messageId: string, totalCount: number, actionLabel: string) => void;
|
|
41
|
-
onOpenImageLightbox: (
|
|
42
|
+
onOpenImageLightbox: (sources: MediaPreviewSource[], index: number) => void;
|
|
42
43
|
onImageSettled: () => void;
|
|
43
44
|
onRetry: () => void;
|
|
44
45
|
/** Failed send never reached the server (no `id`) — this is a local-only delete, not a recall. */
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ChatMessage } from '../../../utils/chat';
|
|
2
|
+
import { MediaPreviewSource } from '../../media-preview/use-image-lightbox';
|
|
2
3
|
interface MessageContentBodyProps {
|
|
3
4
|
message: ChatMessage;
|
|
4
5
|
isLatestMessage: boolean;
|
|
5
|
-
onOpenImageLightbox: (
|
|
6
|
+
onOpenImageLightbox: (sources: MediaPreviewSource[], index: number) => void;
|
|
6
7
|
onImageSettled: () => void;
|
|
7
8
|
onOpenMentionCard: (userId: string, fallbackName?: string) => void;
|
|
8
9
|
}
|