@medipha/chat 1.0.50 → 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.
Files changed (29) hide show
  1. package/dist/dashboard/dashboard.types.d.ts +11 -5
  2. package/dist/dashboard/filters/dashboard-filter-bar.d.ts +3 -1
  3. package/dist/dashboard/filters/date-range-presets.d.ts +3 -2
  4. package/dist/dashboard/sections/user-avatar-cell.d.ts +6 -0
  5. package/dist/dashboard/sections/user-detail-modal.d.ts +3 -5
  6. package/dist/dashboard/sections/user-group-breakdown-table.d.ts +2 -1
  7. package/dist/features/files/file-attachment.d.ts +4 -1
  8. package/dist/features/tags/tag-filter-dropdown.d.ts +25 -0
  9. package/dist/features/tags/tag-filter.d.ts +4 -0
  10. package/dist/features/tags/tag-form-dialog.d.ts +10 -0
  11. package/dist/features/tags/tag-manager-modal.d.ts +6 -0
  12. package/dist/features/tags/tag-quick-picker.d.ts +12 -0
  13. package/dist/index.cjs +62 -62
  14. package/dist/index.js +12932 -11848
  15. package/dist/pages/Setting/archive/archive-file-list.d.ts +2 -1
  16. package/dist/pages/Setting/archive/archive-media-grid.d.ts +2 -1
  17. package/dist/pages/Setting/archive/archive-view.d.ts +2 -1
  18. package/dist/pages/conversation/conversation-header/conversation-header.d.ts +3 -2
  19. package/dist/pages/sidebar/sidbar-conversation-list/conversation-list-row.d.ts +19 -0
  20. package/dist/pages/sidebar/sidbar-conversation-list/conversation-more-menu.d.ts +14 -0
  21. package/dist/pages/sidebar/sidbar-conversation-list/sidbar-conversation-list.d.ts +7 -2
  22. package/dist/pages/sidebar/sidebar-filter/sidebar-filter.d.ts +4 -1
  23. package/dist/shared/components/conversation-tag-label.d.ts +13 -0
  24. package/dist/shared/components/user-profile-modal.d.ts +8 -0
  25. package/dist/store/conversationsStore.d.ts +4 -1
  26. package/dist/store/tagsStore.d.ts +16 -0
  27. package/dist/styles.css +1 -1
  28. package/dist/utils/chat.d.ts +6 -0
  29. package/package.json +2 -2
@@ -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,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  interface UserProfileModalProps {
2
3
  userId: string;
3
4
  fallbackName?: string;
@@ -9,6 +10,13 @@ interface UserProfileModalProps {
9
10
  * so it can only come from the caller that knows which group we came from. */
10
11
  isGroupOwner?: boolean;
11
12
  }
13
+ interface UserProfileSummaryProps {
14
+ userId: string;
15
+ fallbackName?: string;
16
+ isGroupOwner?: boolean;
17
+ actions?: ReactNode;
18
+ }
19
+ export declare function UserProfileSummary({ userId, fallbackName, isGroupOwner, actions, }: UserProfileSummaryProps): import('react/jsx-runtime').JSX.Element;
12
20
  /** Zalo-style "Thông tin tài khoản" dialog, opened from a user avatar click: avatar on
13
21
  * top, then contact details (họ tên, ngày sinh, email, số điện thoại) and a second
14
22
  * group with the directory info (chi nhánh, phòng ban, chức vụ). Portals to body with
@@ -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 {};