@epam/ai-dial-chat-hooks 1.2.0-rc.0 → 1.3.0-dev.10
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/conversation/create-chat-stream-api.js +14 -10
- package/conversation/useConversationStream/useConversationStream.js +98 -77
- package/conversation.d.ts +14 -1
- package/file-manager.d.ts +4 -2
- package/file-manager.js +25 -25
- package/files/dial-file-manager.model.js +7 -3
- package/files/useDialFileListing/useDialFileListing.js +2 -2
- package/files/useDialFileManager/useDialFileManager.js +146 -140
- package/files/useDialFileMutations/useDialFileMutations.js +206 -204
- package/index.d.ts +18 -3
- package/index.js +43 -43
- package/package.json +15 -15
|
@@ -1,150 +1,156 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { hasDialFileWritePermission as
|
|
3
|
-
import { deriveActionProfile as
|
|
4
|
-
import { useDialFileListing as
|
|
5
|
-
import { useDialFileMetadata as
|
|
6
|
-
import { useDialFileMutations as
|
|
7
|
-
import { useDialFileSharing as
|
|
8
|
-
import { useDialFileUploadBatch as
|
|
9
|
-
import { DialFileManagerActionProfile as
|
|
10
|
-
import { useCallback as
|
|
11
|
-
import { DialFileManagerActions as
|
|
1
|
+
import { COLUMNS_MY_FILES as e, COLUMNS_ORGANIZATION as t, COLUMNS_SHARED as n, DATE_OPTIONS as r } from "../dial-file-manager.model.js";
|
|
2
|
+
import { hasDialFileWritePermission as i, isCopyMoveDuplicateAllowed as a, isShareActionsAllowed as o } from "../dial-file-manager-path.util.js";
|
|
3
|
+
import { deriveActionProfile as s } from "../file-manager-variant.js";
|
|
4
|
+
import { useDialFileListing as c } from "../useDialFileListing/useDialFileListing.js";
|
|
5
|
+
import { useDialFileMetadata as l } from "../useDialFileMetadata/useDialFileMetadata.js";
|
|
6
|
+
import { useDialFileMutations as u } from "../useDialFileMutations/useDialFileMutations.js";
|
|
7
|
+
import { useDialFileSharing as d } from "../useDialFileSharing/useDialFileSharing.js";
|
|
8
|
+
import { useDialFileUploadBatch as f } from "../useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
9
|
+
import { DialFileManagerActionProfile as p, DialFileManagerVariant as m, isUploadInProgress as h } from "@epam/ai-dial-chat-shared";
|
|
10
|
+
import { useCallback as g, useMemo as _ } from "react";
|
|
11
|
+
import { DialFileManagerActions as v, DialFileManagerTabs as y } from "@epam/ai-dial-react-file-manager";
|
|
12
12
|
//#region src/files/useDialFileManager/useDialFileManager.ts
|
|
13
|
-
var
|
|
14
|
-
let
|
|
15
|
-
filesApi:
|
|
16
|
-
bucket:
|
|
17
|
-
rootLabel:
|
|
18
|
-
activeTab:
|
|
19
|
-
onNotification:
|
|
20
|
-
isActive:
|
|
21
|
-
sessionKey:
|
|
22
|
-
}),
|
|
23
|
-
filesApi:
|
|
24
|
-
bucket:
|
|
25
|
-
rootLabel:
|
|
26
|
-
activeTab:
|
|
27
|
-
cache:
|
|
28
|
-
sharedRootMetaRef:
|
|
29
|
-
invalidateFolders:
|
|
30
|
-
bumpRetry:
|
|
31
|
-
onNotification:
|
|
32
|
-
}), R = l({
|
|
33
|
-
filesApi: y,
|
|
34
|
-
bucket: b,
|
|
35
|
-
rootLabel: x,
|
|
36
|
-
activeTab: S,
|
|
37
|
-
folderPath: I.folderPath,
|
|
38
|
-
currentFolder: I.currentFolder,
|
|
39
|
-
sharedRootMetaRef: I.sharedRootMetaRef,
|
|
40
|
-
listingPermissionsCache: I.listingPermissionsCache,
|
|
41
|
-
invalidateFolders: I.invalidateFolders,
|
|
42
|
-
bumpRetry: I.bumpRetry,
|
|
43
|
-
mergeCreatedFolder: I.mergeCreatedFolder,
|
|
44
|
-
setFolderPath: I.setFolderPath,
|
|
45
|
-
onNotification: T,
|
|
46
|
-
onOperationSuccess: E,
|
|
47
|
-
downloadDestination: N,
|
|
48
|
-
forbiddenSymbolsRegExp: D
|
|
13
|
+
var b = ({ filesApi: b, bucket: x, rootLabel: S = "My files", activeTab: C = y.MyFiles, isActive: w, sessionKey: T, onNotification: E, onOperationSuccess: D, forbiddenSymbolsRegExp: O, variant: k = m.Attach, actionProfile: A, labels: j, locale: M, disabledNewButtonTooltip: N, downloadDestination: P, buildValidationErrorMessage: F }) => {
|
|
14
|
+
let I = A ?? s(k), L = c({
|
|
15
|
+
filesApi: b,
|
|
16
|
+
bucket: x,
|
|
17
|
+
rootLabel: S,
|
|
18
|
+
activeTab: C,
|
|
19
|
+
onNotification: E,
|
|
20
|
+
isActive: w,
|
|
21
|
+
sessionKey: T
|
|
22
|
+
}), R = f({
|
|
23
|
+
filesApi: b,
|
|
24
|
+
bucket: x,
|
|
25
|
+
rootLabel: S,
|
|
26
|
+
activeTab: C,
|
|
27
|
+
cache: L.cache,
|
|
28
|
+
sharedRootMetaRef: L.sharedRootMetaRef,
|
|
29
|
+
invalidateFolders: L.invalidateFolders,
|
|
30
|
+
bumpRetry: L.bumpRetry,
|
|
31
|
+
onNotification: E
|
|
49
32
|
}), z = u({
|
|
50
|
-
filesApi:
|
|
51
|
-
bucket:
|
|
52
|
-
rootLabel:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
33
|
+
filesApi: b,
|
|
34
|
+
bucket: x,
|
|
35
|
+
rootLabel: S,
|
|
36
|
+
activeTab: C,
|
|
37
|
+
folderPath: L.folderPath,
|
|
38
|
+
currentFolder: L.currentFolder,
|
|
39
|
+
sharedRootMetaRef: L.sharedRootMetaRef,
|
|
40
|
+
listingPermissionsCache: L.listingPermissionsCache,
|
|
41
|
+
invalidateFolders: L.invalidateFolders,
|
|
42
|
+
bumpRetry: L.bumpRetry,
|
|
43
|
+
mergeCreatedFolder: L.mergeCreatedFolder,
|
|
44
|
+
setFolderPath: L.setFolderPath,
|
|
45
|
+
onNotification: E,
|
|
46
|
+
onOperationSuccess: D,
|
|
47
|
+
downloadDestination: P,
|
|
48
|
+
forbiddenSymbolsRegExp: O
|
|
49
|
+
}), B = d({
|
|
50
|
+
filesApi: b,
|
|
51
|
+
bucket: x,
|
|
52
|
+
rootLabel: S,
|
|
53
|
+
bumpRetry: L.bumpRetry,
|
|
54
|
+
onNotification: E
|
|
55
|
+
}), V = l({
|
|
56
|
+
filesApi: b,
|
|
57
|
+
bucket: x,
|
|
58
|
+
rootLabel: S,
|
|
59
|
+
onNotification: E
|
|
60
|
+
}), H = i(L.currentFolder), U = _(() => C === y.Organization || C === y.Shared && L.folderPath === "" ? !1 : H, [
|
|
61
|
+
C,
|
|
62
|
+
L.folderPath,
|
|
63
|
+
H
|
|
64
|
+
]), W = _(() => {
|
|
65
|
+
switch (C) {
|
|
66
|
+
case y.Shared: return n;
|
|
67
|
+
case y.Organization: return t;
|
|
68
|
+
default: return e;
|
|
69
|
+
}
|
|
70
|
+
}, [C]), G = _(() => {
|
|
65
71
|
let e = {}, t = (t) => {
|
|
66
|
-
let n =
|
|
72
|
+
let n = j[t];
|
|
67
73
|
n != null && (e[t] = n);
|
|
68
74
|
};
|
|
69
|
-
return t(
|
|
75
|
+
return t(v.Download), C === y.MyFiles ? (t(v.Delete), U && (t(v.Rename), a(I) && (t(v.Copy), t(v.Move), t(v.Duplicate))), o(I) && t(v.RemoveAccess)) : C === y.Shared && o(I) && t(v.Unshare), I === p.Full && t(v.Info), e;
|
|
70
76
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
]),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
]),
|
|
86
|
-
let n =
|
|
87
|
-
return n ?
|
|
88
|
-
}, [
|
|
89
|
-
let n =
|
|
90
|
-
return n ?
|
|
91
|
-
}, [
|
|
77
|
+
C,
|
|
78
|
+
U,
|
|
79
|
+
I,
|
|
80
|
+
j
|
|
81
|
+
]), K = _(() => z.isCreatingFolder || z.isDownloading || z.isDeleting || z.isRenaming || z.isCopying || z.isMoving || B.isUnsharing || B.isRemovingAccess || h(R.uploadBatchState), [
|
|
82
|
+
z.isCreatingFolder,
|
|
83
|
+
z.isDownloading,
|
|
84
|
+
z.isDeleting,
|
|
85
|
+
z.isRenaming,
|
|
86
|
+
z.isCopying,
|
|
87
|
+
z.isMoving,
|
|
88
|
+
B.isUnsharing,
|
|
89
|
+
B.isRemovingAccess,
|
|
90
|
+
R.uploadBatchState
|
|
91
|
+
]), q = g((e, t) => {
|
|
92
|
+
let n = z.onCreateFolderValidate(e, t);
|
|
93
|
+
return n ? F(n) : null;
|
|
94
|
+
}, [z, F]), J = g((e, t) => {
|
|
95
|
+
let n = z.onRenameValidate(e, t);
|
|
96
|
+
return n ? F(n, t) : null;
|
|
97
|
+
}, [z, F]);
|
|
92
98
|
return {
|
|
93
|
-
items:
|
|
94
|
-
isLoading:
|
|
95
|
-
error:
|
|
96
|
-
path:
|
|
97
|
-
onPathChange:
|
|
98
|
-
retry:
|
|
99
|
-
onSearchFiles:
|
|
100
|
-
isSearching:
|
|
101
|
-
searchResults:
|
|
102
|
-
clearSearchResults:
|
|
103
|
-
expandedPaths:
|
|
104
|
-
loadedPaths:
|
|
105
|
-
onExpandedPathsChange:
|
|
106
|
-
onFolderPopupPathChange:
|
|
107
|
-
folderPopupLoadingPaths:
|
|
108
|
-
onUploadFiles:
|
|
109
|
-
onUploadArchive:
|
|
110
|
-
onValidateUpload:
|
|
111
|
-
uploadBatchState:
|
|
112
|
-
cancelUpload:
|
|
113
|
-
cancelUploadFile:
|
|
114
|
-
clearUploadBatch:
|
|
115
|
-
onCreateFolder:
|
|
116
|
-
onCreateFolderValidate:
|
|
117
|
-
isCreatingFolder:
|
|
118
|
-
onDownloadFiles:
|
|
119
|
-
isDownloading:
|
|
120
|
-
onDeleteFiles:
|
|
121
|
-
isDeleting:
|
|
122
|
-
onRenameValidate:
|
|
123
|
-
onMoveToFiles:
|
|
124
|
-
isRenaming:
|
|
125
|
-
onCopyFiles:
|
|
126
|
-
isCopying:
|
|
127
|
-
isMoving:
|
|
128
|
-
cancelCopyMove:
|
|
129
|
-
uploadEnabled:
|
|
130
|
-
isNewButtonDisabled: !
|
|
131
|
-
disabledNewButtonTooltip:
|
|
132
|
-
visibleColumns:
|
|
133
|
-
dateLocale:
|
|
134
|
-
dateOptions:
|
|
135
|
-
actionLabels:
|
|
136
|
-
sharedWithMeIds:
|
|
137
|
-
sharedByMePaths:
|
|
138
|
-
onUnshareFiles:
|
|
139
|
-
isUnsharing:
|
|
140
|
-
onRemoveFilesAccess:
|
|
141
|
-
isRemovingAccess:
|
|
142
|
-
fileMetadata:
|
|
143
|
-
isFileMetadataLoading:
|
|
144
|
-
onGetInfo:
|
|
145
|
-
clearMetadata:
|
|
146
|
-
isAnyOperationInProgress:
|
|
99
|
+
items: L.items,
|
|
100
|
+
isLoading: L.isLoading,
|
|
101
|
+
error: L.error,
|
|
102
|
+
path: L.path,
|
|
103
|
+
onPathChange: L.onPathChange,
|
|
104
|
+
retry: L.retry,
|
|
105
|
+
onSearchFiles: L.onSearchFiles,
|
|
106
|
+
isSearching: L.isSearching,
|
|
107
|
+
searchResults: L.searchResults,
|
|
108
|
+
clearSearchResults: L.clearSearchResults,
|
|
109
|
+
expandedPaths: L.expandedPaths,
|
|
110
|
+
loadedPaths: L.loadedPaths,
|
|
111
|
+
onExpandedPathsChange: L.onExpandedPathsChange,
|
|
112
|
+
onFolderPopupPathChange: L.onFolderPopupPathChange,
|
|
113
|
+
folderPopupLoadingPaths: L.folderPopupLoadingPaths,
|
|
114
|
+
onUploadFiles: R.onUploadFiles,
|
|
115
|
+
onUploadArchive: R.onUploadArchive,
|
|
116
|
+
onValidateUpload: R.onValidateUpload,
|
|
117
|
+
uploadBatchState: R.uploadBatchState,
|
|
118
|
+
cancelUpload: R.cancelUpload,
|
|
119
|
+
cancelUploadFile: R.cancelUploadFile,
|
|
120
|
+
clearUploadBatch: R.clearUploadBatch,
|
|
121
|
+
onCreateFolder: z.onCreateFolder,
|
|
122
|
+
onCreateFolderValidate: q,
|
|
123
|
+
isCreatingFolder: z.isCreatingFolder,
|
|
124
|
+
onDownloadFiles: z.onDownloadFiles,
|
|
125
|
+
isDownloading: z.isDownloading,
|
|
126
|
+
onDeleteFiles: z.onDeleteFiles,
|
|
127
|
+
isDeleting: z.isDeleting,
|
|
128
|
+
onRenameValidate: J,
|
|
129
|
+
onMoveToFiles: z.onMoveToFiles,
|
|
130
|
+
isRenaming: z.isRenaming,
|
|
131
|
+
onCopyFiles: z.onCopyFiles,
|
|
132
|
+
isCopying: z.isCopying,
|
|
133
|
+
isMoving: z.isMoving,
|
|
134
|
+
cancelCopyMove: z.cancelCopyMove,
|
|
135
|
+
uploadEnabled: U,
|
|
136
|
+
isNewButtonDisabled: !U,
|
|
137
|
+
disabledNewButtonTooltip: N,
|
|
138
|
+
visibleColumns: W,
|
|
139
|
+
dateLocale: M,
|
|
140
|
+
dateOptions: r,
|
|
141
|
+
actionLabels: G,
|
|
142
|
+
sharedWithMeIds: L.sharedWithMeIds,
|
|
143
|
+
sharedByMePaths: L.sharedByMePaths,
|
|
144
|
+
onUnshareFiles: B.onUnshareFiles,
|
|
145
|
+
isUnsharing: B.isUnsharing,
|
|
146
|
+
onRemoveFilesAccess: B.onRemoveFilesAccess,
|
|
147
|
+
isRemovingAccess: B.isRemovingAccess,
|
|
148
|
+
fileMetadata: V.fileMetadata,
|
|
149
|
+
isFileMetadataLoading: V.isFileMetadataLoading,
|
|
150
|
+
onGetInfo: V.onGetInfo,
|
|
151
|
+
clearMetadata: V.clearMetadata,
|
|
152
|
+
isAnyOperationInProgress: K
|
|
147
153
|
};
|
|
148
154
|
};
|
|
149
155
|
//#endregion
|
|
150
|
-
export {
|
|
156
|
+
export { b as useDialFileManager };
|