@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.
- package/dist/dashboard/dashboard.types.d.ts +11 -5
- package/dist/dashboard/filters/dashboard-filter-bar.d.ts +3 -1
- package/dist/dashboard/filters/date-range-presets.d.ts +3 -2
- package/dist/dashboard/sections/user-avatar-cell.d.ts +6 -0
- package/dist/dashboard/sections/user-detail-modal.d.ts +3 -5
- package/dist/dashboard/sections/user-group-breakdown-table.d.ts +2 -1
- package/dist/features/files/file-attachment.d.ts +4 -1
- package/dist/features/tags/tag-filter-dropdown.d.ts +25 -0
- package/dist/features/tags/tag-filter.d.ts +4 -0
- package/dist/features/tags/tag-form-dialog.d.ts +10 -0
- package/dist/features/tags/tag-manager-modal.d.ts +6 -0
- package/dist/features/tags/tag-quick-picker.d.ts +12 -0
- package/dist/index.cjs +62 -62
- package/dist/index.js +12932 -11848
- package/dist/pages/Setting/archive/archive-file-list.d.ts +2 -1
- package/dist/pages/Setting/archive/archive-media-grid.d.ts +2 -1
- package/dist/pages/Setting/archive/archive-view.d.ts +2 -1
- package/dist/pages/conversation/conversation-header/conversation-header.d.ts +3 -2
- package/dist/pages/sidebar/sidbar-conversation-list/conversation-list-row.d.ts +19 -0
- package/dist/pages/sidebar/sidbar-conversation-list/conversation-more-menu.d.ts +14 -0
- package/dist/pages/sidebar/sidbar-conversation-list/sidbar-conversation-list.d.ts +7 -2
- package/dist/pages/sidebar/sidebar-filter/sidebar-filter.d.ts +4 -1
- package/dist/shared/components/conversation-tag-label.d.ts +13 -0
- package/dist/shared/components/user-profile-modal.d.ts +8 -0
- package/dist/store/conversationsStore.d.ts +4 -1
- package/dist/store/tagsStore.d.ts +16 -0
- package/dist/styles.css +1 -1
- package/dist/utils/chat.d.ts +6 -0
- package/package.json +2 -2
|
@@ -3,17 +3,18 @@ export type ConversationKind = 'GROUP' | 'DIRECT';
|
|
|
3
3
|
export type ConversationKindFilter = 'all' | 'verified' | 'group' | 'direct';
|
|
4
4
|
export interface DashboardFilters {
|
|
5
5
|
preset: DashboardRangePreset;
|
|
6
|
-
from: string;
|
|
7
|
-
to: string;
|
|
6
|
+
from: string | null;
|
|
7
|
+
to: string | null;
|
|
8
8
|
userId: string | null;
|
|
9
9
|
kind: ConversationKindFilter;
|
|
10
10
|
search: string;
|
|
11
|
+
branchId: string | null;
|
|
12
|
+
departmentId: string | null;
|
|
11
13
|
}
|
|
12
14
|
export interface ConversationOverviewStats {
|
|
13
15
|
groupConversations: number;
|
|
14
16
|
verifiedGroups: number;
|
|
15
17
|
totalMessages: number;
|
|
16
|
-
sentByUserMessages: number | null;
|
|
17
18
|
}
|
|
18
19
|
export type TrendGranularity = 'hour' | 'day' | 'week' | 'month';
|
|
19
20
|
export interface ConversationCreationPoint {
|
|
@@ -51,7 +52,6 @@ export interface ConversationListRow {
|
|
|
51
52
|
createdByAvatarUrl: string | null;
|
|
52
53
|
memberCount: number;
|
|
53
54
|
totalMessageCount: number;
|
|
54
|
-
pinnedMessageCount: number;
|
|
55
55
|
messageCount: number;
|
|
56
56
|
createdAt: string;
|
|
57
57
|
}
|
|
@@ -59,6 +59,7 @@ export interface TopUserRow {
|
|
|
59
59
|
userId: string;
|
|
60
60
|
fullName: string;
|
|
61
61
|
avatarUrl: string | null;
|
|
62
|
+
branchName: string | null;
|
|
62
63
|
departmentName: string | null;
|
|
63
64
|
jobTitleName: string | null;
|
|
64
65
|
messageCount: number;
|
|
@@ -94,6 +95,11 @@ export interface DashboardPageQuery extends DashboardFilters {
|
|
|
94
95
|
page: number;
|
|
95
96
|
pageSize: number;
|
|
96
97
|
}
|
|
98
|
+
export interface UserGroupBreakdownQuery {
|
|
99
|
+
userId: string;
|
|
100
|
+
page: number;
|
|
101
|
+
pageSize: number;
|
|
102
|
+
}
|
|
97
103
|
export interface DashboardDataSource {
|
|
98
104
|
fetchConversationOverview(filters: DashboardFilters, signal: AbortSignal): Promise<ConversationOverviewStats>;
|
|
99
105
|
fetchConversationCreationTrend(filters: DashboardFilters, signal: AbortSignal): Promise<ConversationCreationTrend>;
|
|
@@ -105,5 +111,5 @@ export interface DashboardDataSource {
|
|
|
105
111
|
pageSize: number;
|
|
106
112
|
}, signal: AbortSignal): Promise<DashboardPage<ConversationMemberRow>>;
|
|
107
113
|
fetchTopUsers(query: DashboardPageQuery, signal: AbortSignal): Promise<DashboardPage<TopUserRow>>;
|
|
108
|
-
fetchUserGroupBreakdown(query:
|
|
114
|
+
fetchUserGroupBreakdown(query: UserGroupBreakdownQuery, signal: AbortSignal): Promise<DashboardPage<UserGroupBreakdownRow>>;
|
|
109
115
|
}
|
|
@@ -2,13 +2,15 @@ import { DashboardFilters } from '../dashboard.types';
|
|
|
2
2
|
interface DashboardFilterBarProps {
|
|
3
3
|
filters: DashboardFilters;
|
|
4
4
|
onChange: (filters: DashboardFilters) => void;
|
|
5
|
+
showDateFilter?: boolean;
|
|
5
6
|
showKindFilter?: boolean;
|
|
6
7
|
showUserFilter?: boolean;
|
|
8
|
+
showDirectoryFilter?: boolean;
|
|
7
9
|
/** What the user filter means here — the roster filters by who created the group, the
|
|
8
10
|
* other reports by who took part. */
|
|
9
11
|
userPlaceholder?: string;
|
|
10
12
|
searchPlaceholder?: string;
|
|
11
13
|
groupsOnly?: boolean;
|
|
12
14
|
}
|
|
13
|
-
export declare function DashboardFilterBar({ filters, onChange, showKindFilter, showUserFilter, userPlaceholder, searchPlaceholder, groupsOnly, }: DashboardFilterBarProps): import('react/jsx-runtime').JSX.Element;
|
|
15
|
+
export declare function DashboardFilterBar({ filters, onChange, showDateFilter, showKindFilter, showUserFilter, showDirectoryFilter, userPlaceholder, searchPlaceholder, groupsOnly, }: DashboardFilterBarProps): import('react/jsx-runtime').JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -6,9 +6,10 @@ export interface DashboardRangePresetOption {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const DASHBOARD_RANGE_PRESETS: DashboardRangePresetOption[];
|
|
8
8
|
export interface DashboardDateRange {
|
|
9
|
-
from: string;
|
|
10
|
-
to: string;
|
|
9
|
+
from: string | null;
|
|
10
|
+
to: string | null;
|
|
11
11
|
}
|
|
12
|
+
export declare const ALL_TIME_RANGE: DashboardDateRange;
|
|
12
13
|
export declare function resolvePresetRange(preset: Exclude<DashboardRangePreset, 'custom'>, now?: Dayjs): DashboardDateRange;
|
|
13
14
|
export declare function toRange(from: Dayjs, to: Dayjs): DashboardDateRange;
|
|
14
15
|
export declare const DEFAULT_PRESET: DashboardRangePresetOption['key'];
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { DashboardDataSource
|
|
1
|
+
import { DashboardDataSource } from '../dashboard.types';
|
|
2
2
|
interface UserDetailModalProps {
|
|
3
3
|
dataSource: DashboardDataSource;
|
|
4
|
-
filters: DashboardFilters;
|
|
5
4
|
userId: string;
|
|
6
5
|
userName: string;
|
|
7
6
|
onClose: () => void;
|
|
7
|
+
onOpenUser?: (userId: string) => void;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
* filter, so the detail always answers for the same period the table was showing. */
|
|
11
|
-
export declare function UserDetailModal({ dataSource, filters, userId, userName, onClose, }: UserDetailModalProps): import('react/jsx-runtime').JSX.Element;
|
|
9
|
+
export declare function UserDetailModal({ dataSource, userId, userName, onClose, onOpenUser, }: UserDetailModalProps): import('react/jsx-runtime').JSX.Element;
|
|
12
10
|
export {};
|
|
@@ -6,6 +6,7 @@ interface UserGroupBreakdownTableProps {
|
|
|
6
6
|
currentPage: number;
|
|
7
7
|
pageSize: number;
|
|
8
8
|
onPageChange: (page: number, pageSize: number) => void;
|
|
9
|
+
onOpenMembers?: (conversationId: string, memberCount: number) => void;
|
|
9
10
|
}
|
|
10
|
-
export declare function UserGroupBreakdownTable({ page, isLoading, isExpanded, currentPage, pageSize, onPageChange, }: UserGroupBreakdownTableProps): import('react/jsx-runtime').JSX.Element;
|
|
11
|
+
export declare function UserGroupBreakdownTable({ page, isLoading, isExpanded, currentPage, pageSize, onPageChange, onOpenMembers, }: UserGroupBreakdownTableProps): import('react/jsx-runtime').JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -7,6 +7,9 @@ interface FileAttachmentProps {
|
|
|
7
7
|
onShare?: () => void;
|
|
8
8
|
/** When provided, a 4th action jumps back to the message this attachment was sent in. */
|
|
9
9
|
onJumpToMessage?: () => void;
|
|
10
|
+
/** Whether the conversation this attachment belongs to is a group — only meaningful
|
|
11
|
+
* alongside `onJumpToMessage`, to word that action's tooltip. */
|
|
12
|
+
isGroup?: boolean;
|
|
10
13
|
/**
|
|
11
14
|
* Settings/archive layout: the whole card is clickable to preview and gets a subtle hover
|
|
12
15
|
* zoom. Chat bubbles leave this off. The action row is always on the same line as the
|
|
@@ -20,5 +23,5 @@ interface FileAttachmentProps {
|
|
|
20
23
|
* new tab) and Download actions, plus optional Share. Used in chat bubbles, the settings
|
|
21
24
|
* document list, and the archive.
|
|
22
25
|
*/
|
|
23
|
-
export declare function FileAttachment({ attachment, meta, onShare, onJumpToMessage, inline }: FileAttachmentProps): import('react/jsx-runtime').JSX.Element;
|
|
26
|
+
export declare function FileAttachment({ attachment, meta, onShare, onJumpToMessage, isGroup, inline, }: FileAttachmentProps): import('react/jsx-runtime').JSX.Element;
|
|
24
27
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface MenuPosition {
|
|
2
|
+
top?: number;
|
|
3
|
+
bottom?: number;
|
|
4
|
+
left: number;
|
|
5
|
+
maxHeight: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function computeMenuPosition(trigger: HTMLElement, { menuWidth, align }?: {
|
|
8
|
+
menuWidth?: number;
|
|
9
|
+
align?: 'left' | 'right';
|
|
10
|
+
}): MenuPosition;
|
|
11
|
+
export interface TagFilterOptionRowProps {
|
|
12
|
+
label: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
isChecked: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
onToggle: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function TagFilterOptionRow({ label, color, isChecked, disabled, onToggle, }: TagFilterOptionRowProps): import('react/jsx-runtime').JSX.Element;
|
|
19
|
+
interface TagFilterDropdownProps {
|
|
20
|
+
selectedFilters: string[];
|
|
21
|
+
onChange: (selectedFilters: string[]) => void;
|
|
22
|
+
onManageTags?: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function TagFilterDropdown({ selectedFilters, onChange, onManageTags }: TagFilterDropdownProps): import('react/jsx-runtime').JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Conversation, ConversationTag } from '../../utils/chat';
|
|
2
|
+
export declare const TAG_FILTER_UNTAGGED = "untagged";
|
|
3
|
+
export declare function resolveTagFilter(selectedFilters: string[], tags: ConversationTag[]): string[];
|
|
4
|
+
export declare function matchesTagFilter(conversation: Conversation, selectedFilters: string[]): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TagPayload } from '@medipha/chat-core';
|
|
2
|
+
import { ConversationTag } from '../../utils/chat';
|
|
3
|
+
interface TagFormDialogProps {
|
|
4
|
+
editingTag?: ConversationTag;
|
|
5
|
+
existingTags: ConversationTag[];
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onSubmit: (payload: TagPayload) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function TagFormDialog({ editingTag, existingTags, onClose, onSubmit }: TagFormDialogProps): import('react/jsx-runtime').JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { Conversation } from '../../utils/chat';
|
|
3
|
+
interface TagQuickPickerProps {
|
|
4
|
+
conversation: Conversation;
|
|
5
|
+
triggerRef: RefObject<HTMLButtonElement | null>;
|
|
6
|
+
onManageTags: () => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
variant?: 'standalone' | 'submenu';
|
|
9
|
+
submenuAlign?: 'left' | 'right';
|
|
10
|
+
}
|
|
11
|
+
export declare function TagQuickPicker({ conversation, triggerRef, onManageTags, onClose, variant, submenuAlign, }: TagQuickPickerProps): import('react/jsx-runtime').JSX.Element | null;
|
|
12
|
+
export {};
|