@epam/statgpt-conversation-list 0.1.0-rc.0
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/LICENSE +21 -0
- package/README.md +77 -0
- package/index.css +1 -0
- package/index.d.ts +4 -0
- package/index.js +12 -0
- package/index.mjs +4392 -0
- package/models/conversation-list.d.ts +20 -0
- package/models/titles.d.ts +18 -0
- package/package.json +27 -0
- package/types/action-menu-item.d.ts +5 -0
- package/types/conversation-groups.d.ts +7 -0
- package/utils/compress-zip.d.ts +23 -0
- package/utils/conversations-grouping.d.ts +6 -0
- package/utils/download.d.ts +1 -0
- package/utils/shared-conversations.d.ts +4 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ConversationInfo, Conversation } from '@epam/ai-dial-shared';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { ActionMenuItem } from '../types/action-menu-item';
|
|
4
|
+
import { ConversationListTitles } from './titles';
|
|
5
|
+
import { SharedConversationsRequest, SharedConversations } from '../../../dial-toolkit/src/models/conversation';
|
|
6
|
+
export interface ConversationListActions {
|
|
7
|
+
deleteConversation: (conversation: ConversationInfo) => Promise<void>;
|
|
8
|
+
getConversation: (conversationId: string) => Promise<Conversation>;
|
|
9
|
+
getFileBlob: (path: string) => Promise<Blob>;
|
|
10
|
+
getConversations: (locale: string) => Promise<ConversationInfo[]>;
|
|
11
|
+
getSharedConversations: (requestData?: SharedConversationsRequest) => Promise<SharedConversations>;
|
|
12
|
+
}
|
|
13
|
+
export type GroupedConversations = Record<string, ConversationInfo[]>;
|
|
14
|
+
export interface ConversationStyles {
|
|
15
|
+
conversationItemIcon?: ReactNode;
|
|
16
|
+
disableModalDividers?: boolean;
|
|
17
|
+
isSmallModalButton?: boolean;
|
|
18
|
+
actionsIcons?: Record<ActionMenuItem, ReactNode>;
|
|
19
|
+
titles: ConversationListTitles;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ConversationListTitles {
|
|
2
|
+
noConversation?: string;
|
|
3
|
+
clickNewChat?: string;
|
|
4
|
+
allChats?: string;
|
|
5
|
+
share?: string;
|
|
6
|
+
export?: string;
|
|
7
|
+
delete?: string;
|
|
8
|
+
close?: string;
|
|
9
|
+
deleteTitle?: string;
|
|
10
|
+
deleteMessage?: string;
|
|
11
|
+
cancel?: string;
|
|
12
|
+
searchPlaceholder?: string;
|
|
13
|
+
shared?: string;
|
|
14
|
+
today?: string;
|
|
15
|
+
lastWeek?: string;
|
|
16
|
+
earlier?: string;
|
|
17
|
+
yesterday?: string;
|
|
18
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@epam/statgpt-conversation-list",
|
|
3
|
+
"version": "0.1.0-rc.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@tabler/icons-react": "^3.34.1",
|
|
7
|
+
"react": "19.1.0",
|
|
8
|
+
"@epam/ai-dial-shared": "^0.34.0",
|
|
9
|
+
"@epam/statgpt-ui-components": "0.1.0-rc.0",
|
|
10
|
+
"classnames": "^2.5.1",
|
|
11
|
+
"@epam/statgpt-shared-toolkit": "0.1.0-rc.0",
|
|
12
|
+
"@epam/statgpt-dial-toolkit": "0.1.0-rc.0",
|
|
13
|
+
"jszip": "3.10.1",
|
|
14
|
+
"lodash": "^4.17.21"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./index.mjs",
|
|
19
|
+
"require": "./index.js",
|
|
20
|
+
"types": "./index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"main": "index",
|
|
24
|
+
"browser": "index.js",
|
|
25
|
+
"module": "index.mjs",
|
|
26
|
+
"types": "index.d.ts"
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Attachment, Conversation } from '@epam/ai-dial-shared';
|
|
2
|
+
interface DialFile {
|
|
3
|
+
folderId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
relativePath?: string;
|
|
6
|
+
contentType: string;
|
|
7
|
+
absolutePath: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getAttachments: (conversation: Conversation) => {
|
|
10
|
+
relativePath: string;
|
|
11
|
+
contentLength: number;
|
|
12
|
+
folderId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
contentType: string;
|
|
15
|
+
absolutePath: string;
|
|
16
|
+
}[];
|
|
17
|
+
export declare const isFolderId: (id: string) => boolean;
|
|
18
|
+
export declare const isAbsoluteUrl: (url: string) => boolean;
|
|
19
|
+
export declare const getDialFilesFromAttachments: (attachments?: Attachment[]) => DialFile[];
|
|
20
|
+
export declare function getZippedFile(conversation: Conversation, getFileBlob: (filePath: string) => Promise<Blob>): Promise<string>;
|
|
21
|
+
export declare const splitFolderId: (folderId: string) => string | undefined;
|
|
22
|
+
export declare const constructPath: (...values: (string | undefined | null)[]) => string;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConversationInfo } from '@epam/ai-dial-shared';
|
|
2
|
+
import { GroupedConversations } from '../models/conversation-list';
|
|
3
|
+
import { ConversationListTitles } from '../models/titles';
|
|
4
|
+
export declare const getConversationsGroupedByDate: (conversations: ConversationInfo[]) => GroupedConversations;
|
|
5
|
+
export declare const sortConversationsByUpdatedAt: (groupedConversations: ConversationInfo[]) => ConversationInfo[];
|
|
6
|
+
export declare const getLabelByGroup: (groupLabel: string, translations?: ConversationListTitles) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function triggerDownload(url: string, name: string): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SharedConversations } from '../../../dial-toolkit/src/models/conversation';
|
|
2
|
+
import { ConversationInfo } from '@epam/ai-dial-shared';
|
|
3
|
+
export declare const transformSharedConversations: (sharedConversationsData: SharedConversations, locale: string) => ConversationInfo[];
|
|
4
|
+
export declare const getSharedConversationsGroup: (sharedConversations: ConversationInfo[]) => Record<string, ConversationInfo[]>;
|