@medipha/chat 1.0.51 → 1.0.52

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.
@@ -9,7 +9,8 @@ interface ArchiveFileListProps {
9
9
  onShare?: (message: ChatMessage) => void;
10
10
  /** Jumps back to the message this file was sent in; omitted when unavailable. */
11
11
  onJumpToMessage?: (message: ChatMessage) => void;
12
+ isGroup: boolean;
12
13
  }
13
14
  /** "Files" tab body — attachment cards grouped by day, each with preview/download/share. */
14
- export declare function ArchiveFileList({ groups, resolveSenderName, onShare, onJumpToMessage }: ArchiveFileListProps): import('react/jsx-runtime').JSX.Element;
15
+ export declare function ArchiveFileList({ groups, resolveSenderName, onShare, onJumpToMessage, isGroup, }: ArchiveFileListProps): import('react/jsx-runtime').JSX.Element;
15
16
  export {};
@@ -8,7 +8,8 @@ interface ArchiveMediaGridProps {
8
8
  onShare?: (message: ChatMessage) => void;
9
9
  /** Jumps back to the message this image was sent in; omitted when unavailable. */
10
10
  onJumpToMessage?: (message: ChatMessage) => void;
11
+ isGroup: boolean;
11
12
  }
12
13
  /** "Ảnh/Video" tab body — thumbnails grouped by day, each with preview/download/share. */
13
- export declare function ArchiveMediaGrid({ groups, resolveSenderName, onSelect, onShare, onJumpToMessage, }: ArchiveMediaGridProps): import('react/jsx-runtime').JSX.Element;
14
+ export declare function ArchiveMediaGrid({ groups, resolveSenderName, onSelect, onShare, onJumpToMessage, isGroup, }: ArchiveMediaGridProps): import('react/jsx-runtime').JSX.Element;
14
15
  export {};
@@ -4,6 +4,7 @@ interface ArchiveViewProps {
4
4
  conversationId: string | undefined;
5
5
  initialTab: ArchiveTab;
6
6
  members: ConversationMember[];
7
+ isGroup: boolean;
7
8
  onBack: () => void;
8
9
  /** Forwards a file's message to another conversation (opens the forward picker). */
9
10
  onForwardMessage?: (message: ChatMessage) => void;
@@ -15,5 +16,5 @@ interface ArchiveViewProps {
15
16
  * default), filterable by day/sender/type. Renders inline in place of the settings panel
16
17
  * body (not an overlay modal).
17
18
  */
18
- export declare function ArchiveView({ conversationId, initialTab, members, onBack, onForwardMessage, onJumpToMessage, }: ArchiveViewProps): import('react/jsx-runtime').JSX.Element;
19
+ export declare function ArchiveView({ conversationId, initialTab, members, isGroup, onBack, onForwardMessage, onJumpToMessage, }: ArchiveViewProps): import('react/jsx-runtime').JSX.Element;
19
20
  export {};
@@ -1,9 +1,10 @@
1
- import { ConversationMember } from '../../../utils/chat';
1
+ import { ConversationMember, ConversationTag } from '../../../utils/chat';
2
2
  interface ConversationHeaderProps {
3
3
  title: string;
4
4
  avatarUrl?: string | null;
5
5
  isGroup: boolean;
6
6
  isVerified?: boolean;
7
+ tag?: ConversationTag | null;
7
8
  groupMemberCount: number;
8
9
  members?: ConversationMember[];
9
10
  currentUserId?: string | null;
@@ -31,5 +32,5 @@ interface ConversationHeaderProps {
31
32
  onCopyInviteLink?: () => void;
32
33
  }
33
34
  /** Conversation title/status row plus the collapsible in-header search and toggle buttons. */
34
- export declare function ConversationHeader({ title, avatarUrl, isGroup, isVerified, groupMemberCount, members, currentUserId, isOtherMemberOnline, onOpenSearch, onOpenMessageList, isSettingsOpen, onToggleSettings, onOpenMembers, canEditTitle, onEditTitle, onOpenAvatarProfile, onOpenFullPage, onCloseConversation, pendingApprovalCount, onOpenPendingApprovals, onCopyInviteLink, }: ConversationHeaderProps): import('react/jsx-runtime').JSX.Element;
35
+ export declare function ConversationHeader({ title, avatarUrl, isGroup, isVerified, tag, groupMemberCount, members, currentUserId, isOtherMemberOnline, onOpenSearch, onOpenMessageList, isSettingsOpen, onToggleSettings, onOpenMembers, canEditTitle, onEditTitle, onOpenAvatarProfile, onOpenFullPage, onCloseConversation, pendingApprovalCount, onOpenPendingApprovals, onCopyInviteLink, }: ConversationHeaderProps): import('react/jsx-runtime').JSX.Element;
35
36
  export {};
@@ -0,0 +1,19 @@
1
+ import { RefObject } from 'react';
2
+ import { Conversation } from '../../../utils/chat';
3
+ export interface ConversationListRowProps {
4
+ conversation: Conversation;
5
+ currentUserId: string | null;
6
+ isCompact: boolean;
7
+ isOnScreen: boolean;
8
+ isActiveConversation: boolean;
9
+ isNotificationPending: boolean;
10
+ isMenuOpen: boolean;
11
+ menuTriggerRef?: RefObject<HTMLButtonElement>;
12
+ buildConversationPath?: (targetId: string) => string;
13
+ onSelectConversation: (conversation: Conversation) => void;
14
+ onToggleErpNotification: (conversationId: string, enabled: boolean) => void;
15
+ onToggleMenu: (conversationId: string) => void;
16
+ }
17
+ declare function ConversationListRowImpl({ conversation, currentUserId, isCompact, isOnScreen, isActiveConversation, isNotificationPending, isMenuOpen, menuTriggerRef, buildConversationPath, onSelectConversation, onToggleErpNotification, onToggleMenu, }: ConversationListRowProps): import('react/jsx-runtime').JSX.Element;
18
+ export declare const ConversationListRow: import('react').MemoExoticComponent<typeof ConversationListRowImpl>;
19
+ export {};
@@ -0,0 +1,14 @@
1
+ import { RefObject } from 'react';
2
+ import { Conversation } from '../../../utils/chat';
3
+ interface ConversationMoreMenuProps {
4
+ conversation: Conversation;
5
+ triggerRef: RefObject<HTMLButtonElement | null>;
6
+ conversationKindLabel: string;
7
+ isPinned: boolean;
8
+ onClose: () => void;
9
+ onManageTags: () => void;
10
+ onTogglePin: () => void;
11
+ onDelete: () => void;
12
+ }
13
+ export declare function ConversationMoreMenu({ conversation, triggerRef, conversationKindLabel, isPinned, onClose, onManageTags, onTogglePin, onDelete, }: ConversationMoreMenuProps): import('react').ReactPortal | null;
14
+ export {};
@@ -13,7 +13,12 @@ interface SidbarConversationListProps {
13
13
  onClearConversation: (conversationId: string) => Promise<boolean>;
14
14
  pendingNotificationIds: ReadonlySet<string>;
15
15
  onToggleErpNotification: (conversationId: string, enabled: boolean) => void;
16
+ onOpenTagManager: (conversation: Conversation) => void;
16
17
  }
17
- /** The scrollable list of conversation rows — already-filtered input in, Link rows out. */
18
- export declare function SidbarConversationList({ conversations, isLoading, error, currentUserId, activeConversationId, openConversationIds, isCompact, buildConversationPath, onSelectConversation, onTogglePin, onClearConversation, pendingNotificationIds, onToggleErpNotification, }: SidbarConversationListProps): import('react/jsx-runtime').JSX.Element;
18
+ /** The scrollable list of conversation rows — already-filtered input in, Link rows out. Each
19
+ * row is its own memoized component (conversation-list-row.tsx) so a change to one
20
+ * conversation (a tag, a pin, an unread count) only re-renders that row, not the whole
21
+ * list — the "..." menu and its selection state live here instead, since only one can be
22
+ * open across the whole list. */
23
+ export declare function SidbarConversationList({ conversations, isLoading, error, currentUserId, activeConversationId, openConversationIds, isCompact, buildConversationPath, onSelectConversation, onTogglePin, onClearConversation, pendingNotificationIds, onToggleErpNotification, onOpenTagManager, }: SidbarConversationListProps): import('react/jsx-runtime').JSX.Element;
19
24
  export {};
@@ -5,7 +5,10 @@ interface SidebarFilterProps {
5
5
  activeFilter: SidebarConversationFilter;
6
6
  onActiveFilterChange: (filter: SidebarConversationFilter) => void;
7
7
  onOpenCreate: () => void;
8
+ onOpenTags: () => void;
9
+ tagFilters: string[];
10
+ onTagFiltersChange: (tagFilters: string[]) => void;
8
11
  disableTooltip?: boolean;
9
12
  }
10
- export declare function SidebarFilter({ searchTerm, onSearchTermChange, activeFilter, onActiveFilterChange, onOpenCreate, disableTooltip, }: SidebarFilterProps): import('react/jsx-runtime').JSX.Element;
13
+ export declare function SidebarFilter({ searchTerm, onSearchTermChange, activeFilter, onActiveFilterChange, onOpenCreate, onOpenTags, tagFilters, onTagFiltersChange, disableTooltip, }: SidebarFilterProps): import('react/jsx-runtime').JSX.Element;
11
14
  export {};
@@ -0,0 +1,13 @@
1
+ import { ConversationTag } from '../../utils/chat';
2
+ interface TagShapeIconProps {
3
+ variant?: 'filled' | 'outlined';
4
+ className?: string;
5
+ }
6
+ export declare function TagShapeIcon({ variant, className }: TagShapeIconProps): import('react/jsx-runtime').JSX.Element;
7
+ interface ConversationTagLabelProps {
8
+ tag: ConversationTag;
9
+ showName?: boolean;
10
+ className?: string;
11
+ }
12
+ export declare function ConversationTagLabel({ tag, showName, className }: ConversationTagLabelProps): import('react/jsx-runtime').JSX.Element;
13
+ export {};
@@ -1,4 +1,4 @@
1
- import { Conversation, ConversationMember } from '../utils/chat';
1
+ import { Conversation, ConversationMember, ConversationTag } from '../utils/chat';
2
2
  interface ConversationsState {
3
3
  conversations: Conversation[];
4
4
  isLoading: boolean;
@@ -34,6 +34,9 @@ interface ConversationsState {
34
34
  applyPinnedAt: (conversationId: string, userId: string, pinnedAt: string | null) => void;
35
35
  applyConversationPinned: (payload: unknown) => void;
36
36
  patchConversationMember: (conversationId: string, userId: string, update: Partial<ConversationMember>) => void;
37
+ replaceConversationTag: (tagId: string, nextTag: ConversationTag | null) => void;
38
+ applyTagConversations: (tag: ConversationTag, conversationIds: string[]) => void;
39
+ applyConversationTag: (conversationId: string, tag: ConversationTag | null) => void;
37
40
  }
38
41
  /**
39
42
  * Shared conversation-summary list — the single source sidebar rows AND the page-level
@@ -0,0 +1,16 @@
1
+ import { TagPayload } from '@medipha/chat-core';
2
+ import { ConversationTag } from '../utils/chat';
3
+ interface TagsState {
4
+ tags: ConversationTag[];
5
+ isLoading: boolean;
6
+ hasLoaded: boolean;
7
+ error: string;
8
+ loadTags: () => Promise<void>;
9
+ addTag: (payload: TagPayload) => Promise<ConversationTag>;
10
+ editTag: (tagId: string, payload: Partial<TagPayload>) => Promise<ConversationTag>;
11
+ removeTag: (tagId: string) => Promise<void>;
12
+ saveTagConversations: (tag: ConversationTag, conversationIds: string[]) => Promise<void>;
13
+ assignConversationTag: (conversationId: string, tag: ConversationTag | null) => Promise<void>;
14
+ }
15
+ export declare const useTagsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<TagsState>>;
16
+ export {};