@medipha/chat 1.0.53 → 1.0.55

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,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { ChatMessage, ChatMessageAttachment } from '../../../utils/chat';
2
3
  import { ArchiveDayGroup, FileEntry } from './archive-helpers';
3
4
  interface ArchiveFileListProps {
@@ -10,7 +11,8 @@ interface ArchiveFileListProps {
10
11
  /** Jumps back to the message this file was sent in; omitted when unavailable. */
11
12
  onJumpToMessage?: (message: ChatMessage) => void;
12
13
  isGroup: boolean;
14
+ footer?: ReactNode;
13
15
  }
14
16
  /** "Files" tab body — attachment cards grouped by day, each with preview/download/share. */
15
- export declare function ArchiveFileList({ groups, resolveSenderName, onShare, onJumpToMessage, isGroup, }: ArchiveFileListProps): import('react/jsx-runtime').JSX.Element;
17
+ export declare function ArchiveFileList({ groups, resolveSenderName, onShare, onJumpToMessage, isGroup, footer, }: ArchiveFileListProps): import('react/jsx-runtime').JSX.Element;
16
18
  export {};
@@ -0,0 +1,6 @@
1
+ interface ArchiveLoadMoreProps {
2
+ isLoading: boolean;
3
+ onLoadMore: () => void;
4
+ }
5
+ export declare function ArchiveLoadMore({ isLoading, onLoadMore }: ArchiveLoadMoreProps): import('react/jsx-runtime').JSX.Element;
6
+ export {};
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { ChatMessage, ChatMessageAttachment } from '../../../utils/chat';
2
3
  import { ArchiveDayGroup } from './archive-helpers';
3
4
  interface ArchiveMediaGridProps {
@@ -9,7 +10,8 @@ interface ArchiveMediaGridProps {
9
10
  /** Jumps back to the message this image was sent in; omitted when unavailable. */
10
11
  onJumpToMessage?: (message: ChatMessage) => void;
11
12
  isGroup: boolean;
13
+ footer?: ReactNode;
12
14
  }
13
15
  /** "Ảnh/Video" tab body — thumbnails grouped by day, each with preview/download/share. */
14
- export declare function ArchiveMediaGrid({ groups, resolveSenderName, onSelect, onShare, onJumpToMessage, isGroup, }: ArchiveMediaGridProps): import('react/jsx-runtime').JSX.Element;
16
+ export declare function ArchiveMediaGrid({ groups, resolveSenderName, onSelect, onShare, onJumpToMessage, isGroup, footer, }: ArchiveMediaGridProps): import('react/jsx-runtime').JSX.Element;
15
17
  export {};
@@ -1,8 +1,9 @@
1
1
  import { ChatMessage, ConversationMember } from '../../../utils/chat';
2
- import { ArchiveTab } from './hooks/use-conversation-archive';
2
+ import { ArchiveInitialPages, ArchiveTab } from './hooks/use-conversation-archive';
3
3
  interface ArchiveViewProps {
4
4
  conversationId: string | undefined;
5
5
  initialTab: ArchiveTab;
6
+ initialPages?: ArchiveInitialPages;
6
7
  members: ConversationMember[];
7
8
  isGroup: boolean;
8
9
  onBack: () => void;
@@ -16,5 +17,5 @@ interface ArchiveViewProps {
16
17
  * default), filterable by day/sender/type. Renders inline in place of the settings panel
17
18
  * body (not an overlay modal).
18
19
  */
19
- export declare function ArchiveView({ conversationId, initialTab, members, isGroup, onBack, onForwardMessage, onJumpToMessage, }: ArchiveViewProps): import('react/jsx-runtime').JSX.Element;
20
+ export declare function ArchiveView({ conversationId, initialTab, initialPages, members, isGroup, onBack, onForwardMessage, onJumpToMessage, }: ArchiveViewProps): import('react/jsx-runtime').JSX.Element;
20
21
  export {};
@@ -1,15 +1,27 @@
1
+ import { ArchivePageInfo } from '../../../../api/client';
1
2
  import { ChatMessage } from '../../../../utils/chat';
2
3
  export type ArchiveTab = 'media' | 'file';
4
+ export interface ArchiveMessagePage {
5
+ items: ChatMessage[];
6
+ pageState: ArchivePageInfo;
7
+ }
8
+ export type ArchiveInitialPages = Partial<Record<ArchiveTab, ArchiveMessagePage>>;
3
9
  export interface ArchiveDateRange {
4
10
  from?: string | null;
5
11
  to?: string | null;
6
12
  }
7
13
  /** Loads media/file/link archive data for a conversation (entire history by default),
8
14
  * filterable by sender and an explicit sent-date range. */
9
- export declare function useConversationArchive(conversationId: string | undefined): {
15
+ export declare function useConversationArchive(conversationId: string | undefined, initialPages?: ArchiveInitialPages): {
10
16
  error: string;
11
17
  fileItems: ChatMessage[];
18
+ hasMoreByTab: {
19
+ media: boolean;
20
+ file: boolean;
21
+ };
12
22
  load: (tab: ArchiveTab, dateRange?: ArchiveDateRange) => Promise<void>;
23
+ loadMore: (tab: ArchiveTab) => Promise<void>;
24
+ loadingMoreTab: ArchiveTab | null;
13
25
  loadingTab: ArchiveTab | null;
14
26
  mediaItems: ChatMessage[];
15
27
  senderId: string | null;
@@ -18,5 +30,6 @@ export declare function useConversationArchive(conversationId: string | undefine
18
30
  /** Fetches a small preview (default 5-day window) of media and file items for the settings panel. */
19
31
  export declare function useConversationArchivePreview(conversationId: string | undefined): {
20
32
  filePreview: ChatMessage[];
33
+ initialPages: Partial<Record<ArchiveTab, ArchiveMessagePage>>;
21
34
  mediaPreview: ChatMessage[];
22
35
  };
@@ -40,7 +40,6 @@ interface ConversationFooterProps {
40
40
  onTypingStop: () => void;
41
41
  uploadInputRef: RefObject<HTMLInputElement>;
42
42
  imageUploadInputRef: RefObject<HTMLInputElement>;
43
- acceptAttribute: string;
44
43
  }
45
44
  export interface ConversationFooterHandle {
46
45
  focusComposer: () => void;