@medipha/chat 1.0.52 → 1.0.54
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/dashboard/dashboard.types.d.ts +1 -0
- package/dist/features/composer/attachment-file-helpers.d.ts +3 -3
- package/dist/index.cjs +67 -67
- package/dist/index.js +10772 -10442
- package/dist/pages/Setting/archive/archive-file-list.d.ts +3 -1
- package/dist/pages/Setting/archive/archive-load-more.d.ts +6 -0
- package/dist/pages/Setting/archive/archive-media-grid.d.ts +3 -1
- package/dist/pages/Setting/archive/archive-view.d.ts +3 -2
- package/dist/pages/Setting/archive/hooks/use-conversation-archive.d.ts +14 -1
- package/dist/pages/conversation/conversation-footer/conversation-footer.d.ts +0 -1
- package/dist/shared/hooks/use-department-codes.d.ts +1 -0
- package/dist/store/departmentCodesStore.d.ts +10 -0
- package/dist/styles.css +1 -1
- package/dist/utils/chat.d.ts +3 -0
- package/package.json +2 -2
|
@@ -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 {};
|
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDepartmentCodes(): Record<string, string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface DepartmentCodesState {
|
|
2
|
+
codeById: Record<string, string>;
|
|
3
|
+
hasLoaded: boolean;
|
|
4
|
+
load: () => Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
/** Branch id -> ERP branch code, loaded once per session from the branch option list the
|
|
7
|
+
* directory filters already use. Departments below a branch carry no code of their own,
|
|
8
|
+
* so only branches are mapped here. */
|
|
9
|
+
export declare const useDepartmentCodesStore: import('zustand').UseBoundStore<import('zustand').StoreApi<DepartmentCodesState>>;
|
|
10
|
+
export {};
|