@epam/ai-dial-chat-hooks 1.3.0-dev.65 → 1.3.0-dev.66
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/file-manager.js +21 -21
- package/files/dial-file-manager-mapping.util.d.ts +17 -1
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -1
- package/files/dial-file-manager-mapping.util.js +77 -62
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/files/useDialFileListing/useDialFileListing.js +56 -53
- package/index.js +46 -46
- package/package.json +16 -16
package/file-manager.js
CHANGED
|
@@ -7,24 +7,24 @@ import { COLUMNS_MY_FILES as m, COLUMNS_ORGANIZATION as h, COLUMNS_SHARED as g,
|
|
|
7
7
|
import { buildSharedItemVirtualPath as C, dialCorePathToRelative as w, findDialFileByPath as T, findFolderByVirtualPath as E, formatOperationFolderName as D, getVirtualPathName as O, hasDialFileWritePermission as k, hasForbiddenNameSymbols as A, hasSamePaths as j, isCopyMoveDuplicateAllowed as M, isShareActionsAllowed as N, normalizeVirtualPath as P, parseNewFolderVirtualPath as F, resolveOwnerCoords as I, resolveSectionByPath as L, unionPathSets as R, withRoutableRootLabels as z } from "./files/dial-file-manager-path.util.js";
|
|
8
8
|
import { resolveDialFileApiPath as B, virtualPathToApiPath as V } from "./files/resolve-dial-file-api-path.js";
|
|
9
9
|
import { prepareCopyItems as H, prepareMoveRenameItems as U } from "./files/dial-file-manager-copy-move.util.js";
|
|
10
|
-
import { buildFromCache as W,
|
|
11
|
-
import { createFilesApiClient as
|
|
12
|
-
import { createUploadFileWithProgress as
|
|
13
|
-
import { openAnnotationAttachment as
|
|
14
|
-
import { getUrlFileName as
|
|
15
|
-
import { annotationToDisplayAttachment as
|
|
16
|
-
import { dialFileToAttachment as
|
|
17
|
-
import { DownloadDestinationType as
|
|
18
|
-
import { prepareDownloadDestination as
|
|
19
|
-
import { deriveActionProfile as
|
|
20
|
-
import { useDialFileListing as
|
|
21
|
-
import { useDialFileMetadata as
|
|
22
|
-
import { useDialFileMutations as
|
|
23
|
-
import { useDialFileSharing as
|
|
24
|
-
import { useDialFileUploadBatch as
|
|
25
|
-
import { useDialFileManager as
|
|
26
|
-
import { useDialFileManagerSections as
|
|
27
|
-
import { useDialFileManagerTabConfig as
|
|
28
|
-
import { useFileAttachmentPicker as
|
|
29
|
-
import { useGridEditingScroll as
|
|
30
|
-
export { m as COLUMNS_MY_FILES, h as COLUMNS_ORGANIZATION, g as COLUMNS_SHARED, _ as CORE_PERMISSION_MAP, v as DATE_OPTIONS, y as DIAL_FILE_MANAGER_SECTION_TABS, u as DialFilesApiUploadMode,
|
|
10
|
+
import { buildFromCache as W, buildSharedSearchScope as G, fetchByTab as K, fetchForSearch as q, findFirstSuccessfulCopyMoveItem as J, mapCorePermissions as Y, mapFileMetadataToDialFile as X, mapSearchItem as Z, mergeCreatedFolderIntoCache as Q, updateEntry as $ } from "./files/dial-file-manager-mapping.util.js";
|
|
11
|
+
import { createFilesApiClient as ee } from "./files/create-files-api.js";
|
|
12
|
+
import { createUploadFileWithProgress as te } from "./files/create-upload-file-with-progress.js";
|
|
13
|
+
import { openAnnotationAttachment as ne } from "./files/annotation.js";
|
|
14
|
+
import { getUrlFileName as re, isExternalSourcePreviewable as ie, resolveExternalSourceContentType as ae } from "./files/source-content.js";
|
|
15
|
+
import { annotationToDisplayAttachment as oe, attachmentDtoToDisplayAttachment as se, attachmentDtosToDisplayAttachments as ce } from "./files/attachment-dto-to-display.js";
|
|
16
|
+
import { dialFileToAttachment as le, dialFilesToAttachments as ue, dialFolderPathToAttachment as de } from "./files/dial-file-to-attachment.js";
|
|
17
|
+
import { DownloadDestinationType as fe } from "./files/download-destination.js";
|
|
18
|
+
import { prepareDownloadDestination as pe } from "./files/prepare-download-destination.js";
|
|
19
|
+
import { deriveActionProfile as me } from "./files/file-manager-variant.js";
|
|
20
|
+
import { useDialFileListing as he } from "./files/useDialFileListing/useDialFileListing.js";
|
|
21
|
+
import { useDialFileMetadata as ge } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
22
|
+
import { useDialFileMutations as _e } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
23
|
+
import { useDialFileSharing as ve } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
24
|
+
import { useDialFileUploadBatch as ye } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
25
|
+
import { useDialFileManager as be } from "./files/useDialFileManager/useDialFileManager.js";
|
|
26
|
+
import { useDialFileManagerSections as xe } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
|
|
27
|
+
import { useDialFileManagerTabConfig as Se } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
28
|
+
import { useFileAttachmentPicker as Ce } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
29
|
+
import { useGridEditingScroll as we } from "@epam/ai-dial-chat-shared";
|
|
30
|
+
export { m as COLUMNS_MY_FILES, h as COLUMNS_ORGANIZATION, g as COLUMNS_SHARED, _ as CORE_PERMISSION_MAP, v as DATE_OPTIONS, y as DIAL_FILE_MANAGER_SECTION_TABS, u as DialFilesApiUploadMode, fe as DownloadDestinationType, d as FileManagerNotificationReason, f as FileNameValidationErrorReason, p as FileOperationKind, b as PATH_SEPARATOR_REGEXP, x as RESERVED_MARKER_NAME, S as UPLOAD_CONCURRENCY, oe as annotationToDisplayAttachment, se as attachmentDtoToDisplayAttachment, ce as attachmentDtosToDisplayAttachments, W as buildFromCache, C as buildSharedItemVirtualPath, G as buildSharedSearchScope, ee as createFilesApiClient, te as createUploadFileWithProgress, me as deriveActionProfile, w as dialCorePathToRelative, le as dialFileToAttachment, ue as dialFilesToAttachments, de as dialFolderPathToAttachment, K as fetchByTab, q as fetchForSearch, T as findDialFileByPath, J as findFirstSuccessfulCopyMoveItem, E as findFolderByVirtualPath, D as formatOperationFolderName, re as getUrlFileName, O as getVirtualPathName, k as hasDialFileWritePermission, A as hasForbiddenNameSymbols, j as hasSamePaths, M as isCopyMoveDuplicateAllowed, r as isDialFileAcceptType, e as isDialFileId, ie as isExternalSourcePreviewable, N as isShareActionsAllowed, Y as mapCorePermissions, X as mapFileMetadataToDialFile, Z as mapSearchItem, Q as mergeCreatedFolderIntoCache, i as mimeTypesToAttachmentExtensionLabels, a as mimeTypesToDialFileAcceptTypes, o as mimeTypesToFileAccept, P as normalizeVirtualPath, ne as openAnnotationAttachment, F as parseNewFolderVirtualPath, H as prepareCopyItems, pe as prepareDownloadDestination, U as prepareMoveRenameItems, B as resolveDialFileApiPath, t as resolveDialFileBucketAndPath, ae as resolveExternalSourceContentType, I as resolveOwnerCoords, n as resolveRelativeDialFilePath, L as resolveSectionByPath, s as sanitizeFileName, c as splitFileNameExtension, l as trimFileNameToByteLimit, R as unionPathSets, $ as updateEntry, he as useDialFileListing, be as useDialFileManager, xe as useDialFileManagerSections, Se as useDialFileManagerTabConfig, ge as useDialFileMetadata, _e as useDialFileMutations, ve as useDialFileSharing, ye as useDialFileUploadBatch, Ce as useFileAttachmentPicker, we as useGridEditingScroll, V as virtualPathToApiPath, z as withRoutableRootLabels };
|
|
@@ -23,7 +23,23 @@ export declare const fetchByTab: (filesApi: DialFilesApi, tab: DialFileManagerTa
|
|
|
23
23
|
export declare const fetchForSearch: (filesApi: DialFilesApi, tab: DialFileManagerTabs, bucket: string, folderPath: string, sharedRootMeta: Map<string, SharedRootMeta>) => Promise<{
|
|
24
24
|
items: ListFilesItemDto[];
|
|
25
25
|
}>;
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Where search results sit in the virtual tree. Shared items are listed flat
|
|
28
|
+
* (a file nested in the owner's bucket is still a root row), so their virtual
|
|
29
|
+
* path cannot be derived from the location inside the owner's bucket.
|
|
30
|
+
*/
|
|
31
|
+
export interface SearchPathScope {
|
|
32
|
+
/** Virtual path of the folder the search runs in, e.g. `/Shared with me`. */
|
|
33
|
+
virtualRoot: string;
|
|
34
|
+
/** Bucket-relative path of that folder; omitted when results are flat children of `virtualRoot`. */
|
|
35
|
+
apiRoot?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Builds the scope for a search on the Shared tab so result rows get the same
|
|
39
|
+
* `path` as the rows `buildFromCache` produces for the same items.
|
|
40
|
+
*/
|
|
41
|
+
export declare const buildSharedSearchScope: (rootLabel: string, folderPath: string, sharedRootMeta: Map<string, SharedRootMeta>) => SearchPathScope | undefined;
|
|
42
|
+
export declare const mapSearchItem: (item: ListFilesItemDto, fallbackBucket: string, rootLabel: string, scope?: SearchPathScope) => DialFile;
|
|
27
43
|
/**
|
|
28
44
|
* Overlays a `FileMetadataResponseDto` response onto the clicked grid row so
|
|
29
45
|
* `fileMetadataPopupOptions.fileMetadata` receives a value structurally
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dial-file-manager-mapping.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-mapping.util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"dial-file-manager-mapping.util.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager-mapping.util.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,54 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { safeDecodeURI as e } from "../shared/string-utils.js";
|
|
2
|
+
import { CORE_PERMISSION_MAP as t } from "./dial-file-manager.model.js";
|
|
3
|
+
import { buildSharedItemVirtualPath as n, dialCorePathToRelative as r } from "./dial-file-manager-path.util.js";
|
|
4
|
+
import { ListFilesItemDtoNodeTypeEnum as i } from "@epam/ai-dial-chat-api-client";
|
|
5
|
+
import { DialFileManagerTabs as a, DialFileNodeType as o } from "@epam/ai-dial-react-file-manager";
|
|
5
6
|
//#region src/files/dial-file-manager-mapping.util.ts
|
|
6
|
-
var
|
|
7
|
-
if (!
|
|
8
|
-
let n =
|
|
7
|
+
var s = (e) => {
|
|
8
|
+
if (!e?.length) return;
|
|
9
|
+
let n = e.map((e) => t[e.toUpperCase()]).filter((e) => e != null);
|
|
9
10
|
return n.length > 0 ? n : void 0;
|
|
10
|
-
},
|
|
11
|
+
}, c = (e, t) => {
|
|
11
12
|
let n = t.find((e) => e.success);
|
|
12
13
|
if (n != null) return e.find(({ dto: e }) => e.sourcePath === n.sourcePath && e.destinationPath === n.destinationPath) ?? e.find(({ dto: e }) => e.destinationPath === n.destinationPath) ?? e[0];
|
|
13
|
-
},
|
|
14
|
-
let
|
|
15
|
-
if (
|
|
16
|
-
let u =
|
|
17
|
-
return
|
|
18
|
-
let d =
|
|
19
|
-
id:
|
|
14
|
+
}, l = (e, t, n, r, a) => {
|
|
15
|
+
let c = e.get(n);
|
|
16
|
+
if (c == null) return [];
|
|
17
|
+
let u = r.replace(/\/$/, "");
|
|
18
|
+
return c.map((c) => {
|
|
19
|
+
let d = c.nodeType === i.Folder, f = c.name, p = d ? `${u}/${f}/` : `${u}/${f}`, m = {
|
|
20
|
+
id: c.path,
|
|
20
21
|
name: f,
|
|
21
22
|
path: p,
|
|
22
|
-
url:
|
|
23
|
-
parentPath:
|
|
24
|
-
nodeType: d ?
|
|
25
|
-
folderId:
|
|
26
|
-
bucket:
|
|
27
|
-
author:
|
|
28
|
-
resourceType:
|
|
29
|
-
contentLength:
|
|
30
|
-
contentType:
|
|
31
|
-
updatedAt:
|
|
23
|
+
url: c.url,
|
|
24
|
+
parentPath: r,
|
|
25
|
+
nodeType: d ? o.FOLDER : o.ITEM,
|
|
26
|
+
folderId: a,
|
|
27
|
+
bucket: c.bucket,
|
|
28
|
+
author: c.author,
|
|
29
|
+
resourceType: c.resourceType,
|
|
30
|
+
contentLength: c.contentLength,
|
|
31
|
+
contentType: c.contentType,
|
|
32
|
+
updatedAt: c.updatedAt ? new Date(c.updatedAt).toISOString() : void 0
|
|
32
33
|
};
|
|
33
34
|
if (d) {
|
|
34
35
|
let r = `${n}${f}/`;
|
|
35
|
-
m.permissions =
|
|
36
|
+
m.permissions = s(c.permissions) ?? s(t.get(r)), m.items = l(e, t, r, p, c.path);
|
|
36
37
|
}
|
|
37
38
|
return m;
|
|
38
39
|
});
|
|
39
|
-
},
|
|
40
|
+
}, u = (e, t, n, r) => {
|
|
40
41
|
let a = new Map(e), o = [...a.get(t) ?? []], s = {
|
|
41
42
|
name: n.name,
|
|
42
43
|
path: n.path,
|
|
43
44
|
folderId: n.folderId,
|
|
44
|
-
nodeType:
|
|
45
|
+
nodeType: i.Folder,
|
|
45
46
|
bucket: n.bucket,
|
|
46
47
|
parentPath: n.parentPath || void 0,
|
|
47
48
|
url: n.path,
|
|
48
|
-
permissions:
|
|
49
|
+
permissions: r
|
|
49
50
|
};
|
|
50
51
|
return o.some((e) => e.name.toLowerCase() === n.name.toLowerCase()) || o.push(s), a.set(t, o), a;
|
|
51
|
-
},
|
|
52
|
+
}, d = (e, t, n) => {
|
|
52
53
|
if (!e) return e;
|
|
53
54
|
let r = typeof n == "string" ? { status: n } : n, i = e.files.map((e) => e.id === t ? {
|
|
54
55
|
...e,
|
|
@@ -58,16 +59,16 @@ var o = (t) => {
|
|
|
58
59
|
...e,
|
|
59
60
|
files: i
|
|
60
61
|
};
|
|
61
|
-
},
|
|
62
|
-
if (t ===
|
|
63
|
-
if (t ===
|
|
64
|
-
if (
|
|
65
|
-
let t =
|
|
66
|
-
if (
|
|
67
|
-
let
|
|
62
|
+
}, f = (e, t, n, i, o) => {
|
|
63
|
+
if (t === a.All) return Promise.reject(/* @__PURE__ */ Error("fetchByTab cannot list the All tab; list each section instead"));
|
|
64
|
+
if (t === a.Shared) {
|
|
65
|
+
if (i === "") return e.listSharedFiles({ path: void 0 }).then((e) => ({ items: e.items }));
|
|
66
|
+
let t = i.indexOf("/"), n = t === -1 ? i : i.slice(0, t), a = o.get(n);
|
|
67
|
+
if (a) {
|
|
68
|
+
let n = r(a.dialCorePath, a.bucket) + (t === -1 ? "" : i.slice(t + 1));
|
|
68
69
|
return e.listFiles({
|
|
69
|
-
bucket:
|
|
70
|
-
path:
|
|
70
|
+
bucket: a.bucket,
|
|
71
|
+
path: n,
|
|
71
72
|
permissions: !0
|
|
72
73
|
}).then((e) => ({
|
|
73
74
|
items: e.items,
|
|
@@ -76,66 +77,80 @@ var o = (t) => {
|
|
|
76
77
|
}
|
|
77
78
|
return Promise.resolve({ items: [] });
|
|
78
79
|
}
|
|
79
|
-
return t ===
|
|
80
|
-
bucket:
|
|
81
|
-
path:
|
|
80
|
+
return t === a.Organization ? e.listPublicFiles({ path: i || void 0 }).then((e) => ({ items: e.items })) : e.listFiles({
|
|
81
|
+
bucket: n,
|
|
82
|
+
path: i,
|
|
82
83
|
permissions: !0
|
|
83
84
|
}).then((e) => ({
|
|
84
85
|
items: e.items,
|
|
85
86
|
permissions: e.permissions
|
|
86
87
|
}));
|
|
87
|
-
},
|
|
88
|
-
if (t ===
|
|
89
|
-
let t =
|
|
90
|
-
if (!
|
|
91
|
-
let s =
|
|
92
|
-
bucket:
|
|
88
|
+
}, p = async (e, t, n, i, o) => {
|
|
89
|
+
if (t === a.Shared) {
|
|
90
|
+
let t = i.indexOf("/"), n = t === -1 ? i : i.slice(0, t), a = o.get(n);
|
|
91
|
+
if (!a) return { items: [] };
|
|
92
|
+
let s = r(a.dialCorePath, a.bucket) + (t === -1 ? "" : i.slice(t + 1)), { items: c } = await e.listFiles({
|
|
93
|
+
bucket: a.bucket,
|
|
93
94
|
path: s,
|
|
94
95
|
permissions: !0,
|
|
95
96
|
recursive: !0
|
|
96
97
|
});
|
|
97
98
|
return { items: c };
|
|
98
99
|
}
|
|
99
|
-
if (t ===
|
|
100
|
+
if (t === a.Organization) {
|
|
100
101
|
let { items: t } = await e.listPublicFiles({
|
|
101
|
-
path:
|
|
102
|
+
path: i || void 0,
|
|
102
103
|
recursive: !0
|
|
103
104
|
});
|
|
104
105
|
return { items: t };
|
|
105
106
|
}
|
|
106
107
|
let { items: s } = await e.listFiles({
|
|
107
|
-
bucket:
|
|
108
|
-
path:
|
|
108
|
+
bucket: n,
|
|
109
|
+
path: i,
|
|
109
110
|
permissions: !0,
|
|
110
111
|
recursive: !0
|
|
111
112
|
});
|
|
112
113
|
return { items: s };
|
|
113
|
-
},
|
|
114
|
-
|
|
114
|
+
}, m = (e, t, n) => {
|
|
115
|
+
if (t === "") return { virtualRoot: `/${e}` };
|
|
116
|
+
let i = t.indexOf("/"), a = i === -1 ? t : t.slice(0, i), o = n.get(a);
|
|
117
|
+
if (!o) return;
|
|
118
|
+
let s = i === -1 ? "" : t.slice(i + 1);
|
|
119
|
+
return {
|
|
120
|
+
virtualRoot: `/${e}/${t.replace(/\/$/, "")}`,
|
|
121
|
+
apiRoot: r(o.dialCorePath, o.bucket) + s
|
|
122
|
+
};
|
|
123
|
+
}, h = (t) => t.split("/").filter(Boolean).map(e), g = (e, t, a, s) => {
|
|
124
|
+
let c = e.nodeType === i.Folder, l = e.name, u = e.bucket ?? t, d = r(e.url ?? e.path ?? "", u).replace(/\/$/, ""), f = d.lastIndexOf("/"), p = f > 0 ? d.slice(0, f) : "", m;
|
|
125
|
+
if (s) {
|
|
126
|
+
let e = s.apiRoot ? h(p).slice(h(s.apiRoot).length) : [];
|
|
127
|
+
m = [s.virtualRoot, ...e].join("/");
|
|
128
|
+
} else m = n(p, a, !1);
|
|
129
|
+
let g = c ? `${m}/${l}/` : `${m}/${l}`;
|
|
115
130
|
return {
|
|
116
131
|
id: e.path,
|
|
117
|
-
name:
|
|
118
|
-
path:
|
|
132
|
+
name: l,
|
|
133
|
+
path: g,
|
|
119
134
|
url: e.url,
|
|
120
|
-
parentPath:
|
|
121
|
-
nodeType:
|
|
135
|
+
parentPath: m,
|
|
136
|
+
nodeType: c ? o.FOLDER : o.ITEM,
|
|
122
137
|
folderId: e.folderId,
|
|
123
|
-
bucket:
|
|
138
|
+
bucket: u,
|
|
124
139
|
author: e.author,
|
|
125
140
|
contentLength: e.contentLength,
|
|
126
141
|
contentType: e.contentType,
|
|
127
142
|
updatedAt: e.updatedAt ? new Date(e.updatedAt).toISOString() : void 0
|
|
128
143
|
};
|
|
129
|
-
},
|
|
144
|
+
}, _ = (e, t) => ({
|
|
130
145
|
...t,
|
|
131
146
|
bucket: e.bucket ?? t.bucket,
|
|
132
147
|
author: e.author,
|
|
133
148
|
contentLength: e.contentLength,
|
|
134
149
|
contentType: e.contentType,
|
|
135
150
|
resourceType: e.resourceType ?? t.resourceType,
|
|
136
|
-
permissions:
|
|
151
|
+
permissions: s(e.permissions) ?? t.permissions,
|
|
137
152
|
updatedAt: e.updatedAt ? new Date(e.updatedAt).toISOString() : t.updatedAt,
|
|
138
153
|
createdAt: e.createdAt ? new Date(e.createdAt).toISOString() : t.createdAt
|
|
139
154
|
});
|
|
140
155
|
//#endregion
|
|
141
|
-
export {
|
|
156
|
+
export { l as buildFromCache, m as buildSharedSearchScope, f as fetchByTab, p as fetchForSearch, c as findFirstSuccessfulCopyMoveItem, s as mapCorePermissions, _ as mapFileMetadataToDialFile, g as mapSearchItem, u as mergeCreatedFolderIntoCache, d as updateEntry };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDialFileListing.d.ts","sourceRoot":"","sources":["../../../src/files/useDialFileListing/useDialFileListing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"useDialFileListing.d.ts","sourceRoot":"","sources":["../../../src/files/useDialFileListing/useDialFileListing.ts"],"names":[],"mappings":"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"}
|
|
@@ -2,36 +2,36 @@ import { getApiErrorStatus as e } from "../../api-error/api-error.js";
|
|
|
2
2
|
import { FileManagerNotificationReason as t } from "../dial-file-manager.types.js";
|
|
3
3
|
import { buildSharedItemVirtualPath as n, dialCorePathToRelative as r, findFolderByVirtualPath as i, normalizeVirtualPath as a } from "../dial-file-manager-path.util.js";
|
|
4
4
|
import { virtualPathToApiPath as o } from "../resolve-dial-file-api-path.js";
|
|
5
|
-
import { buildFromCache as ee,
|
|
5
|
+
import { buildFromCache as ee, buildSharedSearchScope as s, fetchByTab as c, fetchForSearch as te, mapCorePermissions as ne, mapSearchItem as l, mergeCreatedFolderIntoCache as re } from "../dial-file-manager-mapping.util.js";
|
|
6
6
|
import { getParentFolderPath as ie } from "@epam/ai-dial-chat-shared";
|
|
7
|
-
import { useCallback as
|
|
8
|
-
import { ListFilesItemDtoNodeTypeEnum as
|
|
7
|
+
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
8
|
+
import { ListFilesItemDtoNodeTypeEnum as ae } from "@epam/ai-dial-chat-api-client";
|
|
9
9
|
import { NotificationVariant as h } from "@epam/ai-dial-ui-kit";
|
|
10
|
-
import { DialFileManagerTabs as g, DialFileNodeType as
|
|
10
|
+
import { DialFileManagerTabs as g, DialFileNodeType as oe } from "@epam/ai-dial-react-file-manager";
|
|
11
11
|
//#region src/files/useDialFileListing/useDialFileListing.ts
|
|
12
|
-
var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x, isActive: S = !0, sessionKey:
|
|
13
|
-
let [C, w] =
|
|
14
|
-
|
|
12
|
+
var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x, isActive: S = !0, sessionKey: se }) => {
|
|
13
|
+
let [C, w] = m(""), [T, E] = m(() => /* @__PURE__ */ new Map()), D = p(T);
|
|
14
|
+
d(() => {
|
|
15
15
|
D.current = T;
|
|
16
16
|
}, [T]);
|
|
17
|
-
let [O, k] =
|
|
18
|
-
|
|
19
|
-
let [
|
|
20
|
-
|
|
17
|
+
let [O, k] = m(() => /* @__PURE__ */ new Map()), [ce, A] = m(S), [le, ue] = m(S);
|
|
18
|
+
le !== S && (ue(S), A(S));
|
|
19
|
+
let [de, j] = m(null), [M, N] = m(0), [P, F] = m(void 0), [fe, I] = m(() => /* @__PURE__ */ new Set()), L = p(/* @__PURE__ */ new Map()), [pe, R] = m(!1), [me, z] = m(null), B = p(null), V = p(null), H = p(/* @__PURE__ */ new Set()), U = p(/* @__PURE__ */ new Set()), [W, G] = m(() => /* @__PURE__ */ new Set()), [he, K] = m(() => /* @__PURE__ */ new Set()), [q, J] = m(() => /* @__PURE__ */ new Set()), Y = `${b}|${se ?? ""}`, X = p(Y);
|
|
20
|
+
d(() => {
|
|
21
21
|
X.current !== Y && (X.current = Y, E(/* @__PURE__ */ new Map()), k(/* @__PURE__ */ new Map()), w(""), F(void 0), L.current = /* @__PURE__ */ new Map(), H.current = /* @__PURE__ */ new Set(), U.current = /* @__PURE__ */ new Set(), K(/* @__PURE__ */ new Set()), J(/* @__PURE__ */ new Set()), B.current != null && (clearTimeout(B.current), B.current = null), V.current?.(), V.current = null, z(null), R(!1), G(/* @__PURE__ */ new Set()), N((e) => e + 1));
|
|
22
|
-
}, [Y]),
|
|
22
|
+
}, [Y]), d(() => () => {
|
|
23
23
|
B.current != null && clearTimeout(B.current), V.current?.();
|
|
24
|
-
}, []),
|
|
24
|
+
}, []), d(() => {
|
|
25
25
|
if (!S) {
|
|
26
26
|
A(!1);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
let t = !1;
|
|
30
|
-
return A(!0), j(null),
|
|
30
|
+
return A(!0), j(null), c(_, b, v, C, L.current).then(({ items: e, permissions: n }) => {
|
|
31
31
|
t || (E((t) => {
|
|
32
32
|
let n = new Map(t);
|
|
33
33
|
return n.set(C, e), n;
|
|
34
|
-
}), k((e) => new Map(e).set(C, n)), b === g.Shared && C === "" && (F(e.map((e) => e.nodeType ===
|
|
34
|
+
}), k((e) => new Map(e).set(C, n)), b === g.Shared && C === "" && (F(e.map((e) => e.nodeType === ae.Folder ? `/${y}/${e.name}/` : `/${y}/${e.name}`)), L.current = new Map(e.map((e) => [e.name, {
|
|
35
35
|
bucket: e.bucket ?? "",
|
|
36
36
|
dialCorePath: e.path
|
|
37
37
|
}]))));
|
|
@@ -56,14 +56,14 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
56
56
|
S,
|
|
57
57
|
M,
|
|
58
58
|
y
|
|
59
|
-
]),
|
|
59
|
+
]), d(() => {
|
|
60
60
|
if (!S || b !== g.MyFiles) {
|
|
61
61
|
I(/* @__PURE__ */ new Set());
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
let e = !1;
|
|
65
65
|
return _.listSharedByMe(v).then((t) => {
|
|
66
|
-
e || I(new Set(t.items.map((e) => n(r(e.path, v), y, e.nodeType ===
|
|
66
|
+
e || I(new Set(t.items.map((e) => n(r(e.path, v), y, e.nodeType === ae.Folder))));
|
|
67
67
|
}).catch(() => {
|
|
68
68
|
e || I(/* @__PURE__ */ new Set());
|
|
69
69
|
}), () => {
|
|
@@ -77,12 +77,12 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
77
77
|
M,
|
|
78
78
|
y
|
|
79
79
|
]);
|
|
80
|
-
let Z =
|
|
80
|
+
let Z = f(() => [{
|
|
81
81
|
id: v,
|
|
82
82
|
name: y,
|
|
83
83
|
path: `/${y}`,
|
|
84
84
|
parentPath: "",
|
|
85
|
-
nodeType:
|
|
85
|
+
nodeType: oe.FOLDER,
|
|
86
86
|
folderId: v,
|
|
87
87
|
permissions: ne(O.get("")),
|
|
88
88
|
items: ee(T, O, "", `/${y}`, v)
|
|
@@ -91,7 +91,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
91
91
|
O,
|
|
92
92
|
y,
|
|
93
93
|
v
|
|
94
|
-
]),
|
|
94
|
+
]), ge = u((e) => {
|
|
95
95
|
if (e == null) {
|
|
96
96
|
w("");
|
|
97
97
|
return;
|
|
@@ -109,9 +109,9 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
109
109
|
r = t.startsWith(n) ? t.slice(n.length) : t;
|
|
110
110
|
}
|
|
111
111
|
w(r && !r.endsWith("/") ? `${r}/` : r);
|
|
112
|
-
}, [y]), Q =
|
|
112
|
+
}, [y]), Q = u(() => {
|
|
113
113
|
N((e) => e + 1);
|
|
114
|
-
}, []),
|
|
114
|
+
}, []), _e = Q, ve = u((e) => {
|
|
115
115
|
if (e.length === 0) return;
|
|
116
116
|
let n = new Set([...W].map((e) => o(e, y))), r = (e) => e === C || C.startsWith(e) || n.has(e), i = e.filter((e) => !r(e)), a = e.filter((e) => r(e) && e !== C);
|
|
117
117
|
i.length > 0 && (E((e) => {
|
|
@@ -123,7 +123,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
123
123
|
})), a.forEach((e) => {
|
|
124
124
|
(async () => {
|
|
125
125
|
try {
|
|
126
|
-
let { items: t, permissions: n } = await
|
|
126
|
+
let { items: t, permissions: n } = await c(_, b, v, e, L.current);
|
|
127
127
|
E((n) => new Map(n).set(e, t)), n != null && k((t) => new Map(t).set(e, n));
|
|
128
128
|
} catch {
|
|
129
129
|
x?.({
|
|
@@ -141,9 +141,9 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
141
141
|
W,
|
|
142
142
|
y,
|
|
143
143
|
x
|
|
144
|
-
]),
|
|
144
|
+
]), ye = u((e, t, n) => {
|
|
145
145
|
E((r) => re(r, e, t, n));
|
|
146
|
-
}, []),
|
|
146
|
+
}, []), be = u((e) => {
|
|
147
147
|
if (e.length === 0) return;
|
|
148
148
|
let t = new Set(e);
|
|
149
149
|
E((e) => {
|
|
@@ -152,7 +152,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
152
152
|
let r = new Map(e);
|
|
153
153
|
return r.set("", n.filter((e) => !t.has(e.name))), r;
|
|
154
154
|
}), F((t) => t?.filter((t) => !e.some((e) => t === `/${y}/${e}`)));
|
|
155
|
-
}, [y]),
|
|
155
|
+
}, [y]), xe = u((e) => {
|
|
156
156
|
if (!S) return;
|
|
157
157
|
let n = e == null ? "" : o(e, y), r = e ?? `/${y}`;
|
|
158
158
|
if (J((e) => {
|
|
@@ -172,7 +172,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
172
172
|
return t.add(r), t;
|
|
173
173
|
}), (async () => {
|
|
174
174
|
try {
|
|
175
|
-
let { items: e, permissions: t } = await
|
|
175
|
+
let { items: e, permissions: t } = await c(_, b, v, n, L.current);
|
|
176
176
|
E((t) => new Map(t).set(n, e)), t != null && k((e) => new Map(e).set(n, t)), U.current.delete(n);
|
|
177
177
|
} catch {
|
|
178
178
|
x?.({
|
|
@@ -194,7 +194,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
194
194
|
S,
|
|
195
195
|
x,
|
|
196
196
|
y
|
|
197
|
-
]),
|
|
197
|
+
]), Se = f(() => {
|
|
198
198
|
let e = /* @__PURE__ */ new Set(), t = new Set([...W, ...q]);
|
|
199
199
|
for (let n of t) {
|
|
200
200
|
let t = o(n, y);
|
|
@@ -206,7 +206,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
206
206
|
q,
|
|
207
207
|
T,
|
|
208
208
|
y
|
|
209
|
-
]),
|
|
209
|
+
]), Ce = u((e) => {
|
|
210
210
|
S && (W.forEach((t) => {
|
|
211
211
|
e.has(t) || U.current.delete(o(t, y));
|
|
212
212
|
}), G(e), [...e].filter((e) => {
|
|
@@ -216,7 +216,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
216
216
|
let n = o(e, y);
|
|
217
217
|
H.current.add(n), (async () => {
|
|
218
218
|
try {
|
|
219
|
-
let { items: e, permissions: t } = await
|
|
219
|
+
let { items: e, permissions: t } = await c(_, b, v, n, L.current);
|
|
220
220
|
E((t) => new Map(t).set(n, e)), t != null && k((e) => new Map(e).set(n, t));
|
|
221
221
|
} catch {
|
|
222
222
|
U.current.add(n), x?.({
|
|
@@ -239,9 +239,9 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
239
239
|
S,
|
|
240
240
|
x,
|
|
241
241
|
y
|
|
242
|
-
]),
|
|
242
|
+
]), we = u(() => {
|
|
243
243
|
B.current != null && (clearTimeout(B.current), B.current = null), V.current?.(), V.current = null, z(null), R(!1);
|
|
244
|
-
}, []),
|
|
244
|
+
}, []), Te = u((e, t) => {
|
|
245
245
|
if (S) {
|
|
246
246
|
if (B.current != null && (clearTimeout(B.current), B.current = null), V.current?.(), V.current = null, !t.trim()) {
|
|
247
247
|
z(null), R(!1);
|
|
@@ -249,7 +249,9 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
249
249
|
}
|
|
250
250
|
B.current = setTimeout(() => {
|
|
251
251
|
if (B.current = null, b === g.Shared && C === "") {
|
|
252
|
-
V.current?.(), V.current = null, R(!0)
|
|
252
|
+
V.current?.(), V.current = null, R(!0);
|
|
253
|
+
let e = T.get("") ?? [], t = s(y, "", /* @__PURE__ */ new Map());
|
|
254
|
+
z(e.map((e) => l(e, e.bucket ?? v, y, t))), R(!1);
|
|
253
255
|
return;
|
|
254
256
|
}
|
|
255
257
|
let e = !1;
|
|
@@ -259,7 +261,8 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
259
261
|
try {
|
|
260
262
|
let { items: t } = await te(_, b, v, C, L.current);
|
|
261
263
|
if (e) return;
|
|
262
|
-
|
|
264
|
+
let n = b === g.Shared ? s(y, C, L.current) : void 0;
|
|
265
|
+
z(t.map((e) => l(e, e.bucket ?? v, y, n)));
|
|
263
266
|
} catch {
|
|
264
267
|
e || z([]);
|
|
265
268
|
} finally {
|
|
@@ -276,7 +279,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
276
279
|
C,
|
|
277
280
|
S,
|
|
278
281
|
y
|
|
279
|
-
]), $ = C ? `/${y}/${C}` : `/${y}`,
|
|
282
|
+
]), $ = C ? `/${y}/${C}` : `/${y}`, Ee = f(() => {
|
|
280
283
|
let e = Z[0];
|
|
281
284
|
if (e) return a($) === a(`/${y}`) ? e : i(e.items ?? [], $);
|
|
282
285
|
}, [
|
|
@@ -286,32 +289,32 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
286
289
|
]);
|
|
287
290
|
return {
|
|
288
291
|
items: Z,
|
|
289
|
-
isLoading:
|
|
290
|
-
error:
|
|
292
|
+
isLoading: ce,
|
|
293
|
+
error: de,
|
|
291
294
|
path: $,
|
|
292
295
|
folderPath: C,
|
|
293
|
-
onPathChange:
|
|
296
|
+
onPathChange: ge,
|
|
294
297
|
retry: Q,
|
|
295
|
-
onSearchFiles:
|
|
296
|
-
isSearching:
|
|
297
|
-
searchResults:
|
|
298
|
-
clearSearchResults:
|
|
298
|
+
onSearchFiles: Te,
|
|
299
|
+
isSearching: pe,
|
|
300
|
+
searchResults: me,
|
|
301
|
+
clearSearchResults: we,
|
|
299
302
|
expandedPaths: W,
|
|
300
|
-
loadedPaths:
|
|
301
|
-
onExpandedPathsChange:
|
|
302
|
-
onFolderPopupPathChange:
|
|
303
|
-
folderPopupLoadingPaths:
|
|
304
|
-
sharedWithMeIds:
|
|
305
|
-
sharedByMePaths:
|
|
306
|
-
currentFolder:
|
|
303
|
+
loadedPaths: Se,
|
|
304
|
+
onExpandedPathsChange: Ce,
|
|
305
|
+
onFolderPopupPathChange: xe,
|
|
306
|
+
folderPopupLoadingPaths: he,
|
|
307
|
+
sharedWithMeIds: f(() => b === g.Shared ? P : void 0, [b, P]),
|
|
308
|
+
sharedByMePaths: fe,
|
|
309
|
+
currentFolder: Ee,
|
|
307
310
|
cache: T,
|
|
308
311
|
listingPermissionsCache: O,
|
|
309
312
|
sharedRootMetaRef: L,
|
|
310
313
|
setFolderPath: w,
|
|
311
|
-
invalidateFolders:
|
|
312
|
-
mergeCreatedFolder:
|
|
313
|
-
bumpRetry:
|
|
314
|
-
removeSharedRootItems:
|
|
314
|
+
invalidateFolders: ve,
|
|
315
|
+
mergeCreatedFolder: ye,
|
|
316
|
+
bumpRetry: _e,
|
|
317
|
+
removeSharedRootItems: be
|
|
315
318
|
};
|
|
316
319
|
};
|
|
317
320
|
//#endregion
|
package/index.js
CHANGED
|
@@ -109,49 +109,49 @@ import { COLUMNS_MY_FILES as li, COLUMNS_ORGANIZATION as ui, COLUMNS_SHARED as d
|
|
|
109
109
|
import { buildSharedItemVirtualPath as vi, dialCorePathToRelative as yi, findDialFileByPath as bi, findFolderByVirtualPath as xi, formatOperationFolderName as Si, getVirtualPathName as Ci, hasDialFileWritePermission as wi, hasForbiddenNameSymbols as Ti, hasSamePaths as Ei, isCopyMoveDuplicateAllowed as Di, isShareActionsAllowed as Oi, normalizeVirtualPath as ki, parseNewFolderVirtualPath as Ai, resolveOwnerCoords as ji, resolveSectionByPath as Mi, unionPathSets as Ni, withRoutableRootLabels as Pi } from "./files/dial-file-manager-path.util.js";
|
|
110
110
|
import { resolveDialFileApiPath as Fi, virtualPathToApiPath as Ii } from "./files/resolve-dial-file-api-path.js";
|
|
111
111
|
import { prepareCopyItems as Li, prepareMoveRenameItems as Ri } from "./files/dial-file-manager-copy-move.util.js";
|
|
112
|
-
import { buildFromCache as zi,
|
|
113
|
-
import { createFilesApiClient as
|
|
114
|
-
import { createUploadFileWithProgress as
|
|
115
|
-
import { openAnnotationAttachment as
|
|
116
|
-
import { annotationToOoxmlCanvasContent as
|
|
117
|
-
import { getUrlFileName as
|
|
118
|
-
import { annotationToDisplayAttachment as
|
|
119
|
-
import { dialFileToAttachment as
|
|
120
|
-
import { DownloadDestinationType as
|
|
121
|
-
import { prepareDownloadDestination as
|
|
122
|
-
import { deriveActionProfile as
|
|
123
|
-
import { useDialFileListing as
|
|
124
|
-
import { useDialFileMetadata as
|
|
125
|
-
import { useDialFileMutations as
|
|
126
|
-
import { useDialFileSharing as
|
|
127
|
-
import { useDialFileUploadBatch as
|
|
128
|
-
import { useDialFileManager as
|
|
129
|
-
import { useDialFileManagerSections as
|
|
130
|
-
import { useDialFileManagerTabConfig as
|
|
131
|
-
import { useFileAttachmentPicker as
|
|
132
|
-
import { getBrowserTimezone as
|
|
133
|
-
import { isValidAbsoluteUrl as
|
|
134
|
-
import { buildExternalServiceScopeId as
|
|
135
|
-
import { useChatSettingsFormConfig as
|
|
136
|
-
import { usePageFileDrag as
|
|
137
|
-
import { useViewportWidth as
|
|
138
|
-
import { usePanelMaxWidth as
|
|
139
|
-
import { useShareLink as
|
|
140
|
-
import { useToolsMenu as
|
|
141
|
-
import { USAGE_DATA_I18N_KEYS as
|
|
142
|
-
import { USAGE_MODEL_LIMITS_I18N_KEYS as
|
|
143
|
-
import { UsagePeriod as
|
|
144
|
-
import { isCappedStat as
|
|
145
|
-
import { USAGE_RESET_I18N_KEYS as
|
|
146
|
-
import { useDeploymentUsageLimits as
|
|
147
|
-
import { useRefreshUsageAfterGeneration as
|
|
148
|
-
import { resetUsageLimitBannerDismissals as
|
|
149
|
-
import { USAGE_BANNER_I18N_KEYS as
|
|
150
|
-
import { useUsageData as
|
|
151
|
-
import { McpAppResourceFetchError as
|
|
152
|
-
import { useMcpAppTools as
|
|
153
|
-
import { useMcpAppHostContext as
|
|
154
|
-
import { useMcpAppHostAdapter as
|
|
155
|
-
import { useOpenMcpAppCanvas as
|
|
156
|
-
import { useGridEditingScroll as
|
|
157
|
-
export { x as AttachmentValidationErrorReason, Fr as AudioTranscriptionError, Ir as AudioTranscriptionErrorReason, B as AuthenticationType, li as COLUMNS_MY_FILES, ui as COLUMNS_ORGANIZATION, di as COLUMNS_SHARED, fi as CORE_PERMISSION_MAP, Ct as CatalogPrimaryActionType, T as ConversationExportMode, E as ConversationTransferErrorCode, D as ConversationTransferWarningCode, pi as DATE_OPTIONS, he as DEFAULT_ENTITY_DETAILS_LABELS, tn as DEFAULT_GENERATION_CONFLICT_MESSAGE, nn as DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE, Rr as DEFAULT_MAX_ARCHIVE_BYTES, rn as DEFAULT_STREAM_IDLE_TIMEOUT_MS, mi as DIAL_FILE_MANAGER_SECTION_TABS, ai as DialFilesApiUploadMode, xa as DownloadDestinationType, k as EXPORT_APP_NAME, O as ExportFileNameKind, qt as FavoriteEntityType, oi as FileManagerNotificationReason, si as FileNameValidationErrorReason, ci as FileOperationKind, an as GenerationConflictError, on as GenerationPersistenceError, uo as McpAppResourceFetchError, ct as McpResourceKind, W as OAuthResourceKind, hi as PATH_SEPARATOR_REGEXP, In as PROMPT_CONTENT_MAX_LENGTH, Ln as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, Rn as PROMPT_DESCRIPTION_MAX_LENGTH, zn as PROMPT_NAME_MAX_LENGTH, Je as PUBLIC_SKILL_BUCKET, Bn as PromptFieldError, Ce as PromptSource, gi as RESERVED_MARKER_NAME, xr as RecipientsCountStatus, Oe as SKILL_FILE_UPLOAD_MAX_BYTES, ke as SKILL_FOLDER_MARKER, Ye as SKILL_LISTING_MAX_PAGES, Xe as SKILL_LISTING_PAGE_SIZE, Ae as SKILL_MANIFEST_FILE, Ze as SKILL_MANIFEST_MAX_BYTES, je as SKILL_TEXT_FIELD_MAX_LENGTHS, Me as SKILL_UPLOAD_MAX_FILES, Ne as SKILL_UPLOAD_MAX_TOTAL_BYTES, Jn as ScheduledTaskTriggerDescriptionKind, gr as SkillArchiveImportErrorKind, _r as SkillArchiveImportStatus, vr as SkillArchiveSelectionRejectionReason, lr as SkillEditorLoadState, pr as SkillPreviewErrorKind, Qe as SkillSource, sn as StreamInterruptedError, cn as StreamUpstreamError, G as TOOLSET_REDIRECT_STATE_KEY, K as ToolsetAuthStatus, q as ToolsetAuthTypes, J as ToolsetCredentialsLevel, Ht as ToolsetLoginOutcomeType, Y as ToolsetOAuthCallbackQuery, X as ToolsetOAuthChannelControlType, Z as ToolsetOAuthFailureReason, Q as ToolsetOAuthInitiationResultType, $ as ToolsetOAuthResultType, _i as UPLOAD_CONCURRENCY, so as USAGE_BANNER_I18N_KEYS, Ka as USAGE_DATA_I18N_KEYS, Ja as USAGE_MODEL_LIMITS_I18N_KEYS, eo as USAGE_RESET_I18N_KEYS, qn as UnsupportedTriggerReason, Za as UsagePeriod, ee as WithLogin, ha as annotationToDisplayAttachment, Zi as annotationToOoxmlCanvasContent, Qi as annotationToPdfCanvasContent, Xn as apSchedulerDayToJsDay, se as appendLocaleCode, ei as applyChunkToMessages, ga as attachmentDtoToDisplayAttachment, _a as attachmentDtosToDisplayAttachments, Br as attachmentToDto, Vr as attachmentsToDtos, ce as buildAdditionalLocaleOptions, Xt as buildAnnouncementSignature, lt as buildApplicationMcpUrl, N as buildChatCompletionsUrl, ut as buildConnectApi, P as buildDeploymentConnectApi, La as buildExternalServiceScopeId, zi as buildFromCache, Nn as buildPromptExportEnvelope, Pn as buildPromptExportFileName, Te as buildPromptOverview, Vn as buildPromptPath, V as buildResetFields, F as buildResponsesUrl, vi as buildSharedItemVirtualPath, et as buildSkillContentTree, Pe as buildSkillFilesPayload, Fe as buildSkillManifest, Ie as buildSkillManifestForSubmit, Le as buildSkillManifestFromFrontmatter, tt as buildSkillOverview, Lt as buildToolsetAuthorizeUrl, dt as buildToolsetMcpUrl, yr as classifySkillArchiveImportError, $i as clearAttachmentCache, le as composeLocalePayload, ln as createChatStreamApi, i as createCsrfMiddleware, _n as createDeploymentChangedMessage, Ji as createFilesApiClient, fo as createMcpAppsApiClient, Hr as createMessagePair, j as createPublishApiClient, rr as createScheduledTasksApiClient, a as createUnauthorizedMiddleware, Yi as createUploadFileWithProgress, I as decodeDeploymentId, te as decodeToolsetId, ue as decomposeLocalizedFields, Ca as deriveActionProfile, vt as deriveAvailableTabIds, Cr as deriveConversationRowActionState, yt as deriveFavoriteItems, Yn as describeScheduledTaskTrigger, yi as dialCorePathToRelative, va as dialFileToAttachment, ya as dialFilesToAttachments, ba as dialFolderPathToAttachment, m as downloadAttachment, Nt as emitToolsetLoginSuccess, L as encodeDeploymentId, ne as encodeToolsetId, Bi as fetchByTab, Vi as fetchForSearch, bt as filterCatalogItemsBySelector, xt as filterHiddenOwnedItems, R as findDeploymentByIdOrReference, pn as findDeploymentForConversationId, bi as findDialFileByPath, Hi as findFirstSuccessfulCopyMoveItem, xi as findFolderByVirtualPath, dn as formatAppVersion, pe as formatCalendarDate, C as formatDateYM, w as formatDateYMD, Si as formatOperationFolderName, A as formatQuotedNameList, to as formatUsageResetShort, no as formatUsageResetTime, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, Na as getBrowserTimezone, Xr as getConversationPath, Dr as getConversationSource, Ra as getExternalServiceFallbackName, vn as getFormSchemaToolSyncKey, yn as getLastDeploymentId, bn as getLastUserMessageToolConfiguration, xn as getLatestToolConfiguration, mn as getModelIdCandidatesFromConversationId, hn as getModelIdFromConversationId, pt as getPublicCatalogEntityFolderPath, Dn as getQuickAppConversationStarters, Hn as getRemainingCharacters, Tt as getRunnerSchemas, Re as getSkillFieldLengthViolations, qr as getStarterConversationText, Jr as getStarterDisplayText, An as getStarterPopulateText, Yr as getStarterSubmitText, jn as getStartersFromSchema, gn as getTimeOfDayGreeting, Sn as getToolConfigurationFromFormSchema, Ft as getToolsetOAuthChannelName, Rt as getToolsetRedirectUri, fa as getUrlFileName, Ci as getVirtualPathName, Ur as hasActiveToolConfig, Zt as hasAnnouncementContent, ea as hasAttachmentTextSource, wi as hasDialFileWritePermission, Ti as hasForbiddenNameSymbols, Ei as hasSamePaths, Qt as hasStructuredAnnouncement, o as includesIgnoreCase, zt as initiateOAuthLogin, Wr as isAnswerIncomplete, ni as isAwaitingGenerationResume, Qa as isCappedStat, r as isConversationNotFoundError, Di as isCopyMoveDuplicateAllowed, Et as isCustomAppSchema, _ as isDialFileAcceptType, d as isDialFileId, h as isDownloadableAttachment, pa as isExternalSourcePreviewable, Gr as isMessageChanged, Cn as isMessageStreaming, Dt as isMindMapSchema, Ee as isOrganisationPromptItem, mt as isPublicCatalogEntityId, re as isPublicToolsetId, Ot as isQuickAppSchema, Oi as isShareActionsAllowed, ze as isSkillFolderMarkerPath, Pa as isValidAbsoluteUrl, Fa as isValidFeaturesData, Be as isValidSkillRelativePath, Zn as jsDayToApSchedulerDay, Ui as mapCorePermissions, ge as mapDeploymentDetailsDtoToEntityDetails, U as mapDeploymentLimitsDtoToCatalogLimits, H as mapDeploymentLimitsToInput, ye as mapDeploymentToCatalogItem, be as mapDeploymentToolsetCredentials, _e as mapEntityDetailsToCatalogDetails, Wi as mapFileMetadataToDialFile, Qn as mapFormValuesToCreateBody, $n as mapFormValuesToUpdateBody, Ya as mapOverallCostLimitsToPeriodStatuses, De as mapPromptToCatalogItem, ht as mapPublishConversationResultDto, gt as mapPublishHistoryEntryDto, er as mapScheduledTaskDtoToFormValues, Gi as mapSearchItem, nt as mapSkillToCatalogItem, On as mapStages, ve as mapToolsetCredentials, xe as mapToolsetToCatalogItem, qa as mapUsageDataToDashboard, Xa as mapUserUsageToModelLimits, Ki as mergeCreatedFolderIntoCache, ar as mergeRunsById, ti as mergeStages, wn as messageHasStages, v as mimeTypesToAttachmentExtensionLabels, y as mimeTypesToDialFileAcceptTypes, b as mimeTypesToFileAccept, Ve as nameFromPath, Bt as navigateToolsetOAuthPopup, z as normalizeDeploymentId, Tn as normalizeResponseFormat, He as normalizeSkillName, ie as normalizeToolsetId, ki as normalizeVirtualPath, Xi as openAnnotationAttachment, Vt as openToolsetOAuthPopup, me as padTwoDigits, za as parseExternalServiceUrl, Ia as parseFeaturesData, Ai as parseNewFolderVirtualPath, we as parsePromptResourceUrl, Ue as parseSkillManifest, At as parseSkillManifestDocument, $e as parseSkillResourceUrl, Li as prepareCopyItems, Sa as prepareDownloadDestination, Ri as prepareMoveRenameItems, tr as prepareScheduledTaskCreateBody, nr as prepareScheduledTaskUpdateBody, rt as readSkillFileBytes, it as readSkillFilePreviewBytes, at as readSkillManifest, St as reconcileFilterTopics, ta as referenceAttachmentToPdfCanvasContent, ao as resetUsageLimitBannerDismissals, wt as resolveCatalogPrimaryAction, na as resolveCodeCanvasContent, Se as resolveDeploymentFolder, Fi as resolveDialFileApiPath, f as resolveDialFileBucketAndPath, ma as resolveExternalSourceContentType, ra as resolveGroupedVisualizerCanvasContent, ia as resolveHtmlCanvasContent, aa as resolveImageCanvasContent, oa as resolveJsonCanvasContent, de as resolveLocalizedText, sa as resolveMarkdownCanvasContent, ft as resolveMcpResourceKind, ca as resolveOoxmlCanvasContent, ji as resolveOwnerCoords, la as resolvePdfCanvasContent, p as resolveRelativeDialFilePath, Mi as resolveSectionByPath, ot as resolveSkillFileDownloadPath, st as resolveSkillManifestFileId, ua as resolveTextCanvasContent, ae as resolveToolsetCredentialsLevel, da as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, $t as sanitizeAnnouncementHtml, en as sanitizeAnnouncementMessageHtml, jr as sanitizeFileName, fn as sanitizeFooterHtml, oe as selectToolsetAuthStatus, $a as selectUsageBannerSource, Fn as serializePromptExport, Kr as shouldRerunGenerationOnEdit, un as shouldWatchForDisplayNameUpdate, We as skillFileBytesToBlob, cr as skillFileToAttachment, Ge as skillFolderMarkerParent, Mr as splitFileNameExtension, Ke as startsWithFrontmatterBlock, l as stripSurroundingSlashes, u as stripTrailingSlashes, Pt as subscribeToolsetLoginSuccess, fe as toBaseLocale, En as toOverlayMessages, _t as toPublishEntityType, M as toPublishRuleDto, kn as toStage, Nr as trimFileNameToByteLimit, Ni as unionPathSets, qe as unpackSkillArchive, qi as updateEntry, wr as useActiveConversationSync, Gt as useApplicationCredentials, Tr as useAsyncConfirmDialog, g as useAttachmentAction, Pr as useAttachmentUpload, S as useAttachmentValidation, kt as useCatalogEditNavigation, Mt as useCatalogItemDetails, Wt as useCatalogToolsetCredentials, Ba as useChatSettingsFormConfig, zr as useConversationExport, Zr as useConversationHandlers, Qr as useConversationImport, Er as useConversationLookupMaps, Or as useConversationPanelItems, $r as useConversationScroll, ii as useConversationSources, ri as useConversationStream, ro as useDeploymentUsageLimits, wa as useDialFileListing, ka as useDialFileManager, Aa as useDialFileManagerSections, ja as useDialFileManagerTabConfig, Ta as useDialFileMetadata, Ea as useDialFileMutations, Da as useDialFileSharing, Oa as useDialFileUploadBatch, Jt as useFavoriteEntitiesState, Ma as useFileAttachmentPicker, _o as useGridEditingScroll, kr as useImportFilePicker, ho as useMcpAppHostAdapter, mo as useMcpAppHostContext, po as useMcpAppTools, Ar as useMessageSelectionReply, Mn as useOAuthCallbackCompletion, go as useOpenMcpAppCanvas, Va as usePageFileDrag, Ua as usePanelMaxWidth, Kn as usePromptsState, Yt as usePublishFolders, io as useRefreshUsageAfterGeneration, or as useScheduledTaskRuns, ir as useScheduledTasks, Wa as useShareLink, Sr as useShareRecipientsCount, br as useSkillArchiveImport, Kt as useSkillDetailsPanelData, ur as useSkillEditorLoad, dr as useSkillEditorSubmit, fr as useSkillFileActions, mr as useSkillFilePreview, jt as useSkillItemDetails, hr as useSkillsState, Ga as useToolsMenu, Ut as useToolsetLogin, Lr as useTranscribeAudio, lo as useUsageData, co as useUsageLimitBanner, oo as useUsageLimitBannerDismissal, Ha as useViewportWidth, Un as validatePromptContent, Wn as validatePromptDescription, Gn as validatePromptName, sr as validateSkillFileBatch, Ii as virtualPathToApiPath, It as waitForToolsetOAuthResult, Pi as withRoutableRootLabels };
|
|
112
|
+
import { buildFromCache as zi, buildSharedSearchScope as Bi, fetchByTab as Vi, fetchForSearch as Hi, findFirstSuccessfulCopyMoveItem as Ui, mapCorePermissions as Wi, mapFileMetadataToDialFile as Gi, mapSearchItem as Ki, mergeCreatedFolderIntoCache as qi, updateEntry as Ji } from "./files/dial-file-manager-mapping.util.js";
|
|
113
|
+
import { createFilesApiClient as Yi } from "./files/create-files-api.js";
|
|
114
|
+
import { createUploadFileWithProgress as Xi } from "./files/create-upload-file-with-progress.js";
|
|
115
|
+
import { openAnnotationAttachment as Zi } from "./files/annotation.js";
|
|
116
|
+
import { annotationToOoxmlCanvasContent as Qi, annotationToPdfCanvasContent as $i, clearAttachmentCache as ea, hasAttachmentTextSource as ta, referenceAttachmentToPdfCanvasContent as na, resolveCodeCanvasContent as ra, resolveGroupedVisualizerCanvasContent as ia, resolveHtmlCanvasContent as aa, resolveImageCanvasContent as oa, resolveJsonCanvasContent as sa, resolveMarkdownCanvasContent as ca, resolveOoxmlCanvasContent as la, resolvePdfCanvasContent as ua, resolveTextCanvasContent as da, resolveVisualizerCanvasContent as fa } from "./files/attachment-canvas.js";
|
|
117
|
+
import { getUrlFileName as pa, isExternalSourcePreviewable as ma, resolveExternalSourceContentType as ha } from "./files/source-content.js";
|
|
118
|
+
import { annotationToDisplayAttachment as ga, attachmentDtoToDisplayAttachment as _a, attachmentDtosToDisplayAttachments as va } from "./files/attachment-dto-to-display.js";
|
|
119
|
+
import { dialFileToAttachment as ya, dialFilesToAttachments as ba, dialFolderPathToAttachment as xa } from "./files/dial-file-to-attachment.js";
|
|
120
|
+
import { DownloadDestinationType as Sa } from "./files/download-destination.js";
|
|
121
|
+
import { prepareDownloadDestination as Ca } from "./files/prepare-download-destination.js";
|
|
122
|
+
import { deriveActionProfile as wa } from "./files/file-manager-variant.js";
|
|
123
|
+
import { useDialFileListing as Ta } from "./files/useDialFileListing/useDialFileListing.js";
|
|
124
|
+
import { useDialFileMetadata as Ea } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
125
|
+
import { useDialFileMutations as Da } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
126
|
+
import { useDialFileSharing as Oa } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
127
|
+
import { useDialFileUploadBatch as ka } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
128
|
+
import { useDialFileManager as Aa } from "./files/useDialFileManager/useDialFileManager.js";
|
|
129
|
+
import { useDialFileManagerSections as ja } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
|
|
130
|
+
import { useDialFileManagerTabConfig as Ma } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
131
|
+
import { useFileAttachmentPicker as Na } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
132
|
+
import { getBrowserTimezone as Pa } from "./shared/browser-timezone.js";
|
|
133
|
+
import { isValidAbsoluteUrl as Fa, isValidFeaturesData as Ia, parseFeaturesData as La } from "./shared/custom-apps.js";
|
|
134
|
+
import { buildExternalServiceScopeId as Ra, getExternalServiceFallbackName as za, parseExternalServiceUrl as Ba } from "./shared/external-services.js";
|
|
135
|
+
import { useChatSettingsFormConfig as Va } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
136
|
+
import { usePageFileDrag as Ha } from "./usePageFileDrag/usePageFileDrag.js";
|
|
137
|
+
import { useViewportWidth as Ua } from "./useViewportWidth/useViewportWidth.js";
|
|
138
|
+
import { usePanelMaxWidth as Wa } from "./usePanelMaxWidth/usePanelMaxWidth.js";
|
|
139
|
+
import { useShareLink as Ga } from "./useShareLink/useShareLink.js";
|
|
140
|
+
import { useToolsMenu as Ka } from "./useToolsMenu/useToolsMenu.js";
|
|
141
|
+
import { USAGE_DATA_I18N_KEYS as qa, mapUsageDataToDashboard as Ja } from "./usage/map-usage-data-to-dashboard.js";
|
|
142
|
+
import { USAGE_MODEL_LIMITS_I18N_KEYS as Ya, mapOverallCostLimitsToPeriodStatuses as Xa, mapUserUsageToModelLimits as Za } from "./usage/map-user-usage-to-model-limits.js";
|
|
143
|
+
import { UsagePeriod as Qa } from "./usage/usage-period.js";
|
|
144
|
+
import { isCappedStat as $a, selectUsageBannerSource as eo } from "./usage/usage-banner-source.js";
|
|
145
|
+
import { USAGE_RESET_I18N_KEYS as to, formatUsageResetShort as no, formatUsageResetTime as ro } from "./usage/usage-reset-time.js";
|
|
146
|
+
import { useDeploymentUsageLimits as io } from "./usage/useDeploymentUsageLimits/useDeploymentUsageLimits.js";
|
|
147
|
+
import { useRefreshUsageAfterGeneration as ao } from "./usage/useRefreshUsageAfterGeneration/useRefreshUsageAfterGeneration.js";
|
|
148
|
+
import { resetUsageLimitBannerDismissals as oo, useUsageLimitBannerDismissal as so } from "./usage/useUsageLimitBannerDismissal/useUsageLimitBannerDismissal.js";
|
|
149
|
+
import { USAGE_BANNER_I18N_KEYS as co, useUsageLimitBanner as lo } from "./usage/useUsageLimitBanner/useUsageLimitBanner.js";
|
|
150
|
+
import { useUsageData as uo } from "./usage/useUsageData/useUsageData.js";
|
|
151
|
+
import { McpAppResourceFetchError as fo, createMcpAppsApiClient as po } from "./mcp-apps/mcp-apps-api-client.js";
|
|
152
|
+
import { useMcpAppTools as mo } from "./mcp-apps/useMcpAppTools/useMcpAppTools.js";
|
|
153
|
+
import { useMcpAppHostContext as ho } from "./mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js";
|
|
154
|
+
import { useMcpAppHostAdapter as go } from "./mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js";
|
|
155
|
+
import { useOpenMcpAppCanvas as _o } from "./mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js";
|
|
156
|
+
import { useGridEditingScroll as vo } from "@epam/ai-dial-chat-shared";
|
|
157
|
+
export { x as AttachmentValidationErrorReason, Fr as AudioTranscriptionError, Ir as AudioTranscriptionErrorReason, B as AuthenticationType, li as COLUMNS_MY_FILES, ui as COLUMNS_ORGANIZATION, di as COLUMNS_SHARED, fi as CORE_PERMISSION_MAP, Ct as CatalogPrimaryActionType, T as ConversationExportMode, E as ConversationTransferErrorCode, D as ConversationTransferWarningCode, pi as DATE_OPTIONS, he as DEFAULT_ENTITY_DETAILS_LABELS, tn as DEFAULT_GENERATION_CONFLICT_MESSAGE, nn as DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE, Rr as DEFAULT_MAX_ARCHIVE_BYTES, rn as DEFAULT_STREAM_IDLE_TIMEOUT_MS, mi as DIAL_FILE_MANAGER_SECTION_TABS, ai as DialFilesApiUploadMode, Sa as DownloadDestinationType, k as EXPORT_APP_NAME, O as ExportFileNameKind, qt as FavoriteEntityType, oi as FileManagerNotificationReason, si as FileNameValidationErrorReason, ci as FileOperationKind, an as GenerationConflictError, on as GenerationPersistenceError, fo as McpAppResourceFetchError, ct as McpResourceKind, W as OAuthResourceKind, hi as PATH_SEPARATOR_REGEXP, In as PROMPT_CONTENT_MAX_LENGTH, Ln as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, Rn as PROMPT_DESCRIPTION_MAX_LENGTH, zn as PROMPT_NAME_MAX_LENGTH, Je as PUBLIC_SKILL_BUCKET, Bn as PromptFieldError, Ce as PromptSource, gi as RESERVED_MARKER_NAME, xr as RecipientsCountStatus, Oe as SKILL_FILE_UPLOAD_MAX_BYTES, ke as SKILL_FOLDER_MARKER, Ye as SKILL_LISTING_MAX_PAGES, Xe as SKILL_LISTING_PAGE_SIZE, Ae as SKILL_MANIFEST_FILE, Ze as SKILL_MANIFEST_MAX_BYTES, je as SKILL_TEXT_FIELD_MAX_LENGTHS, Me as SKILL_UPLOAD_MAX_FILES, Ne as SKILL_UPLOAD_MAX_TOTAL_BYTES, Jn as ScheduledTaskTriggerDescriptionKind, gr as SkillArchiveImportErrorKind, _r as SkillArchiveImportStatus, vr as SkillArchiveSelectionRejectionReason, lr as SkillEditorLoadState, pr as SkillPreviewErrorKind, Qe as SkillSource, sn as StreamInterruptedError, cn as StreamUpstreamError, G as TOOLSET_REDIRECT_STATE_KEY, K as ToolsetAuthStatus, q as ToolsetAuthTypes, J as ToolsetCredentialsLevel, Ht as ToolsetLoginOutcomeType, Y as ToolsetOAuthCallbackQuery, X as ToolsetOAuthChannelControlType, Z as ToolsetOAuthFailureReason, Q as ToolsetOAuthInitiationResultType, $ as ToolsetOAuthResultType, _i as UPLOAD_CONCURRENCY, co as USAGE_BANNER_I18N_KEYS, qa as USAGE_DATA_I18N_KEYS, Ya as USAGE_MODEL_LIMITS_I18N_KEYS, to as USAGE_RESET_I18N_KEYS, qn as UnsupportedTriggerReason, Qa as UsagePeriod, ee as WithLogin, ga as annotationToDisplayAttachment, Qi as annotationToOoxmlCanvasContent, $i as annotationToPdfCanvasContent, Xn as apSchedulerDayToJsDay, se as appendLocaleCode, ei as applyChunkToMessages, _a as attachmentDtoToDisplayAttachment, va as attachmentDtosToDisplayAttachments, Br as attachmentToDto, Vr as attachmentsToDtos, ce as buildAdditionalLocaleOptions, Xt as buildAnnouncementSignature, lt as buildApplicationMcpUrl, N as buildChatCompletionsUrl, ut as buildConnectApi, P as buildDeploymentConnectApi, Ra as buildExternalServiceScopeId, zi as buildFromCache, Nn as buildPromptExportEnvelope, Pn as buildPromptExportFileName, Te as buildPromptOverview, Vn as buildPromptPath, V as buildResetFields, F as buildResponsesUrl, vi as buildSharedItemVirtualPath, Bi as buildSharedSearchScope, et as buildSkillContentTree, Pe as buildSkillFilesPayload, Fe as buildSkillManifest, Ie as buildSkillManifestForSubmit, Le as buildSkillManifestFromFrontmatter, tt as buildSkillOverview, Lt as buildToolsetAuthorizeUrl, dt as buildToolsetMcpUrl, yr as classifySkillArchiveImportError, ea as clearAttachmentCache, le as composeLocalePayload, ln as createChatStreamApi, i as createCsrfMiddleware, _n as createDeploymentChangedMessage, Yi as createFilesApiClient, po as createMcpAppsApiClient, Hr as createMessagePair, j as createPublishApiClient, rr as createScheduledTasksApiClient, a as createUnauthorizedMiddleware, Xi as createUploadFileWithProgress, I as decodeDeploymentId, te as decodeToolsetId, ue as decomposeLocalizedFields, wa as deriveActionProfile, vt as deriveAvailableTabIds, Cr as deriveConversationRowActionState, yt as deriveFavoriteItems, Yn as describeScheduledTaskTrigger, yi as dialCorePathToRelative, ya as dialFileToAttachment, ba as dialFilesToAttachments, xa as dialFolderPathToAttachment, m as downloadAttachment, Nt as emitToolsetLoginSuccess, L as encodeDeploymentId, ne as encodeToolsetId, Vi as fetchByTab, Hi as fetchForSearch, bt as filterCatalogItemsBySelector, xt as filterHiddenOwnedItems, R as findDeploymentByIdOrReference, pn as findDeploymentForConversationId, bi as findDialFileByPath, Ui as findFirstSuccessfulCopyMoveItem, xi as findFolderByVirtualPath, dn as formatAppVersion, pe as formatCalendarDate, C as formatDateYM, w as formatDateYMD, Si as formatOperationFolderName, A as formatQuotedNameList, no as formatUsageResetShort, ro as formatUsageResetTime, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, Pa as getBrowserTimezone, Xr as getConversationPath, Dr as getConversationSource, za as getExternalServiceFallbackName, vn as getFormSchemaToolSyncKey, yn as getLastDeploymentId, bn as getLastUserMessageToolConfiguration, xn as getLatestToolConfiguration, mn as getModelIdCandidatesFromConversationId, hn as getModelIdFromConversationId, pt as getPublicCatalogEntityFolderPath, Dn as getQuickAppConversationStarters, Hn as getRemainingCharacters, Tt as getRunnerSchemas, Re as getSkillFieldLengthViolations, qr as getStarterConversationText, Jr as getStarterDisplayText, An as getStarterPopulateText, Yr as getStarterSubmitText, jn as getStartersFromSchema, gn as getTimeOfDayGreeting, Sn as getToolConfigurationFromFormSchema, Ft as getToolsetOAuthChannelName, Rt as getToolsetRedirectUri, pa as getUrlFileName, Ci as getVirtualPathName, Ur as hasActiveToolConfig, Zt as hasAnnouncementContent, ta as hasAttachmentTextSource, wi as hasDialFileWritePermission, Ti as hasForbiddenNameSymbols, Ei as hasSamePaths, Qt as hasStructuredAnnouncement, o as includesIgnoreCase, zt as initiateOAuthLogin, Wr as isAnswerIncomplete, ni as isAwaitingGenerationResume, $a as isCappedStat, r as isConversationNotFoundError, Di as isCopyMoveDuplicateAllowed, Et as isCustomAppSchema, _ as isDialFileAcceptType, d as isDialFileId, h as isDownloadableAttachment, ma as isExternalSourcePreviewable, Gr as isMessageChanged, Cn as isMessageStreaming, Dt as isMindMapSchema, Ee as isOrganisationPromptItem, mt as isPublicCatalogEntityId, re as isPublicToolsetId, Ot as isQuickAppSchema, Oi as isShareActionsAllowed, ze as isSkillFolderMarkerPath, Fa as isValidAbsoluteUrl, Ia as isValidFeaturesData, Be as isValidSkillRelativePath, Zn as jsDayToApSchedulerDay, Wi as mapCorePermissions, ge as mapDeploymentDetailsDtoToEntityDetails, U as mapDeploymentLimitsDtoToCatalogLimits, H as mapDeploymentLimitsToInput, ye as mapDeploymentToCatalogItem, be as mapDeploymentToolsetCredentials, _e as mapEntityDetailsToCatalogDetails, Gi as mapFileMetadataToDialFile, Qn as mapFormValuesToCreateBody, $n as mapFormValuesToUpdateBody, Xa as mapOverallCostLimitsToPeriodStatuses, De as mapPromptToCatalogItem, ht as mapPublishConversationResultDto, gt as mapPublishHistoryEntryDto, er as mapScheduledTaskDtoToFormValues, Ki as mapSearchItem, nt as mapSkillToCatalogItem, On as mapStages, ve as mapToolsetCredentials, xe as mapToolsetToCatalogItem, Ja as mapUsageDataToDashboard, Za as mapUserUsageToModelLimits, qi as mergeCreatedFolderIntoCache, ar as mergeRunsById, ti as mergeStages, wn as messageHasStages, v as mimeTypesToAttachmentExtensionLabels, y as mimeTypesToDialFileAcceptTypes, b as mimeTypesToFileAccept, Ve as nameFromPath, Bt as navigateToolsetOAuthPopup, z as normalizeDeploymentId, Tn as normalizeResponseFormat, He as normalizeSkillName, ie as normalizeToolsetId, ki as normalizeVirtualPath, Zi as openAnnotationAttachment, Vt as openToolsetOAuthPopup, me as padTwoDigits, Ba as parseExternalServiceUrl, La as parseFeaturesData, Ai as parseNewFolderVirtualPath, we as parsePromptResourceUrl, Ue as parseSkillManifest, At as parseSkillManifestDocument, $e as parseSkillResourceUrl, Li as prepareCopyItems, Ca as prepareDownloadDestination, Ri as prepareMoveRenameItems, tr as prepareScheduledTaskCreateBody, nr as prepareScheduledTaskUpdateBody, rt as readSkillFileBytes, it as readSkillFilePreviewBytes, at as readSkillManifest, St as reconcileFilterTopics, na as referenceAttachmentToPdfCanvasContent, oo as resetUsageLimitBannerDismissals, wt as resolveCatalogPrimaryAction, ra as resolveCodeCanvasContent, Se as resolveDeploymentFolder, Fi as resolveDialFileApiPath, f as resolveDialFileBucketAndPath, ha as resolveExternalSourceContentType, ia as resolveGroupedVisualizerCanvasContent, aa as resolveHtmlCanvasContent, oa as resolveImageCanvasContent, sa as resolveJsonCanvasContent, de as resolveLocalizedText, ca as resolveMarkdownCanvasContent, ft as resolveMcpResourceKind, la as resolveOoxmlCanvasContent, ji as resolveOwnerCoords, ua as resolvePdfCanvasContent, p as resolveRelativeDialFilePath, Mi as resolveSectionByPath, ot as resolveSkillFileDownloadPath, st as resolveSkillManifestFileId, da as resolveTextCanvasContent, ae as resolveToolsetCredentialsLevel, fa as resolveVisualizerCanvasContent, s as safeDecodeURI, c as safeDecodeURIComponent, $t as sanitizeAnnouncementHtml, en as sanitizeAnnouncementMessageHtml, jr as sanitizeFileName, fn as sanitizeFooterHtml, oe as selectToolsetAuthStatus, eo as selectUsageBannerSource, Fn as serializePromptExport, Kr as shouldRerunGenerationOnEdit, un as shouldWatchForDisplayNameUpdate, We as skillFileBytesToBlob, cr as skillFileToAttachment, Ge as skillFolderMarkerParent, Mr as splitFileNameExtension, Ke as startsWithFrontmatterBlock, l as stripSurroundingSlashes, u as stripTrailingSlashes, Pt as subscribeToolsetLoginSuccess, fe as toBaseLocale, En as toOverlayMessages, _t as toPublishEntityType, M as toPublishRuleDto, kn as toStage, Nr as trimFileNameToByteLimit, Ni as unionPathSets, qe as unpackSkillArchive, Ji as updateEntry, wr as useActiveConversationSync, Gt as useApplicationCredentials, Tr as useAsyncConfirmDialog, g as useAttachmentAction, Pr as useAttachmentUpload, S as useAttachmentValidation, kt as useCatalogEditNavigation, Mt as useCatalogItemDetails, Wt as useCatalogToolsetCredentials, Va as useChatSettingsFormConfig, zr as useConversationExport, Zr as useConversationHandlers, Qr as useConversationImport, Er as useConversationLookupMaps, Or as useConversationPanelItems, $r as useConversationScroll, ii as useConversationSources, ri as useConversationStream, io as useDeploymentUsageLimits, Ta as useDialFileListing, Aa as useDialFileManager, ja as useDialFileManagerSections, Ma as useDialFileManagerTabConfig, Ea as useDialFileMetadata, Da as useDialFileMutations, Oa as useDialFileSharing, ka as useDialFileUploadBatch, Jt as useFavoriteEntitiesState, Na as useFileAttachmentPicker, vo as useGridEditingScroll, kr as useImportFilePicker, go as useMcpAppHostAdapter, ho as useMcpAppHostContext, mo as useMcpAppTools, Ar as useMessageSelectionReply, Mn as useOAuthCallbackCompletion, _o as useOpenMcpAppCanvas, Ha as usePageFileDrag, Wa as usePanelMaxWidth, Kn as usePromptsState, Yt as usePublishFolders, ao as useRefreshUsageAfterGeneration, or as useScheduledTaskRuns, ir as useScheduledTasks, Ga as useShareLink, Sr as useShareRecipientsCount, br as useSkillArchiveImport, Kt as useSkillDetailsPanelData, ur as useSkillEditorLoad, dr as useSkillEditorSubmit, fr as useSkillFileActions, mr as useSkillFilePreview, jt as useSkillItemDetails, hr as useSkillsState, Ka as useToolsMenu, Ut as useToolsetLogin, Lr as useTranscribeAudio, uo as useUsageData, lo as useUsageLimitBanner, so as useUsageLimitBannerDismissal, Ua as useViewportWidth, Un as validatePromptContent, Wn as validatePromptDescription, Gn as validatePromptName, sr as validateSkillFileBatch, Ii as virtualPathToApiPath, It as waitForToolsetOAuthResult, Pi as withRoutableRootLabels };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-hooks",
|
|
3
3
|
"description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.66",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
"dependencies": {
|
|
119
|
-
"@epam/ai-dial-chat-api-client": "1.3.0-dev.
|
|
119
|
+
"@epam/ai-dial-chat-api-client": "1.3.0-dev.66",
|
|
120
120
|
"dompurify": "3.4.16",
|
|
121
121
|
"fflate": "^0.8.3",
|
|
122
122
|
"lru-cache": "^10.4.3",
|
|
@@ -125,22 +125,22 @@
|
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
127
|
"react": "^19.2.8",
|
|
128
|
-
"@epam/ai-dial-attachment-canvas": "1.3.0-dev.
|
|
129
|
-
"@epam/ai-dial-attachment-input": "1.3.0-dev.
|
|
130
|
-
"@epam/ai-dial-catalog": "1.3.0-dev.
|
|
131
|
-
"@epam/ai-dial-chat-overlay": "1.3.0-dev.
|
|
132
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
133
|
-
"@epam/ai-dial-conversation-input": "1.3.0-dev.
|
|
134
|
-
"@epam/ai-dial-mcp-apps": "1.3.0-dev.
|
|
135
|
-
"@epam/ai-dial-publish-panel": "1.3.0-dev.
|
|
136
|
-
"@epam/ai-dial-quotations": "1.3.0-dev.
|
|
128
|
+
"@epam/ai-dial-attachment-canvas": "1.3.0-dev.66",
|
|
129
|
+
"@epam/ai-dial-attachment-input": "1.3.0-dev.66",
|
|
130
|
+
"@epam/ai-dial-catalog": "1.3.0-dev.66",
|
|
131
|
+
"@epam/ai-dial-chat-overlay": "1.3.0-dev.66",
|
|
132
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.66",
|
|
133
|
+
"@epam/ai-dial-conversation-input": "1.3.0-dev.66",
|
|
134
|
+
"@epam/ai-dial-mcp-apps": "1.3.0-dev.66",
|
|
135
|
+
"@epam/ai-dial-publish-panel": "1.3.0-dev.66",
|
|
136
|
+
"@epam/ai-dial-quotations": "1.3.0-dev.66",
|
|
137
137
|
"@epam/ai-dial-react-file-manager": "^0.3.5",
|
|
138
|
-
"@epam/ai-dial-scheduled-tasks": "1.3.0-dev.
|
|
139
|
-
"@epam/ai-dial-share": "1.3.0-dev.
|
|
140
|
-
"@epam/ai-dial-skill-editor": "1.3.0-dev.
|
|
141
|
-
"@epam/ai-dial-source-panel": "1.3.0-dev.
|
|
138
|
+
"@epam/ai-dial-scheduled-tasks": "1.3.0-dev.66",
|
|
139
|
+
"@epam/ai-dial-share": "1.3.0-dev.66",
|
|
140
|
+
"@epam/ai-dial-skill-editor": "1.3.0-dev.66",
|
|
141
|
+
"@epam/ai-dial-source-panel": "1.3.0-dev.66",
|
|
142
142
|
"@epam/ai-dial-ui-kit": "^0.15.4",
|
|
143
|
-
"@epam/ai-dial-usage-dashboard": "1.3.0-dev.
|
|
143
|
+
"@epam/ai-dial-usage-dashboard": "1.3.0-dev.66",
|
|
144
144
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
145
145
|
"@epam/pdf-highlighter-kit": "^0.0.19",
|
|
146
146
|
"@mcp-ui/client": "^7.1.1"
|