@epam/ai-dial-chat-hooks 1.2.0-dev.3 → 1.2.0-dev.303
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/api-error/api-error.js +7 -4
- package/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
- package/attachments.d.ts +10 -4
- package/catalog/catalog-derivations.js +1 -1
- package/catalog/deployment-id.js +8 -2
- package/catalog/map-deployment-limits-to-catalog.js +16 -24
- package/catalog/map-deployment-limits-to-input.js +81 -9
- package/catalog/map-deployment-to-catalog-item.js +34 -34
- package/catalog/map-entity-details-to-catalog.js +7 -0
- package/catalog/map-skill-to-catalog-item.js +55 -48
- package/catalog/publish.js +6 -5
- package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +122 -101
- package/catalog/usePublishFolders/usePublishFolders.js +1 -1
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
- package/catalog/useSkillItemDetails.js +19 -17
- package/catalog.d.ts +159 -35
- package/catalog.js +23 -22
- package/conversation/announcement-message.js +16 -5
- package/conversation/conversation-transfer/export-conversation.js +24 -16
- package/conversation/conversation-transfer/import-conversation.js +80 -31
- package/conversation/conversation-transfer/queue.js +8 -5
- package/conversation/create-chat-stream-api.js +85 -49
- package/conversation/message-utils.js +44 -2
- package/conversation/stage.js +27 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.js +7 -8
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +12 -5
- package/conversation/useConversationExport/useConversationExport.js +9 -9
- package/conversation/useConversationHandlers/message-utils.js +8 -5
- package/conversation/useConversationHandlers/useConversationHandlers.js +187 -177
- package/conversation/useConversationImport/useConversationImport.js +123 -121
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +50 -32
- package/conversation/useConversationScroll/useConversationScroll.js +68 -64
- package/conversation/useConversationStream/apply-chunk.js +1 -1
- package/conversation/useConversationStream/frame-scheduler.js +39 -0
- package/conversation/useConversationStream/generation-resume.js +122 -64
- package/conversation/useConversationStream/useConversationStream.js +279 -116
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
- package/conversation/useTranscribeAudio/transcription-retry.js +5 -4
- package/conversation-overlay.d.ts +7 -0
- package/conversation-overlay.js +2 -0
- package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
- package/conversation-sources.d.ts +1 -1
- package/conversation-transfer.d.ts +2 -1
- package/conversation.d.ts +328 -25
- package/conversation.js +32 -30
- package/file-manager-canvas.d.ts +418 -0
- package/file-manager-canvas.js +2 -0
- package/file-manager.d.ts +155 -359
- package/file-manager.js +25 -24
- package/files/attachment-canvas.js +116 -55
- package/files/attachment-types.js +14 -13
- package/files/dial-file-manager-copy-move.util.js +9 -8
- package/files/dial-file-manager-mapping.util.js +2 -1
- package/files/dial-file-manager-path.util.js +24 -2
- package/files/dial-file-manager.model.js +23 -19
- package/files/dial-file-manager.types.js +3 -3
- package/files/file-manager-variant.js +1 -1
- package/files/resolve-dial-file-api-path.js +11 -12
- package/files/useDialFileListing/useDialFileListing.js +140 -127
- package/files/useDialFileManager/useDialFileManager.js +139 -135
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -19
- package/files/useDialFileMutations/useDialFileMutations.js +65 -60
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +48 -0
- package/index.d.ts +1281 -136
- package/index.js +136 -122
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
- package/mcp-apps.d.ts +8 -6
- package/oauth/toolset-id.js +5 -3
- package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
- package/oauth.d.ts +32 -0
- package/oauth.js +9 -9
- package/package.json +38 -23
- package/scheduled-task/scheduled-task-description.js +81 -0
- package/scheduled-task/scheduled-task-preparation.js +24 -0
- package/scheduled-task/scheduled-task-trigger.js +74 -71
- package/scheduled-task/scheduled-tasks-api-client.js +19 -0
- package/scheduled-task/use-scheduled-task-runs.js +194 -0
- package/scheduled-task/use-scheduled-tasks.js +93 -0
- package/scheduled-tasks.d.ts +197 -3
- package/scheduled-tasks.js +7 -2
- package/shared/application-schema.js +5 -2
- package/shared/cron-day-of-month.js +13 -0
- package/skill/skill-archive.js +19 -0
- package/skill/skill-types.js +8 -7
- package/skill/skill.js +53 -27
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +79 -0
- package/skill/useSkillEditorLoad.js +65 -59
- package/skill/useSkillEditorSubmit.js +108 -84
- package/skill/useSkillFileActions.js +70 -58
- package/skill-editor.d.ts +160 -8
- package/skill-editor.js +9 -8
- package/usage/map-usage-data-to-dashboard.js +66 -0
- package/usage/map-user-usage-to-model-limits.js +202 -0
- package/usage.d.ts +125 -0
- package/usage.js +3 -0
- package/usePageFileDrag/usePageFileDrag.js +3 -3
- package/utils.d.ts +26 -6
- package/utils.js +10 -10
package/file-manager.js
CHANGED
|
@@ -3,27 +3,28 @@ import { isDialFileAcceptType as r, mimeTypesToAttachmentExtensionLabels as i, m
|
|
|
3
3
|
import { sanitizeFileName as s, splitFileNameExtension as c, trimFileNameToByteLimit as l } from "./files/file-name.js";
|
|
4
4
|
import { DialFilesApiUploadMode as u } from "./files/dial-files-api.js";
|
|
5
5
|
import { FileManagerNotificationReason as d, FileNameValidationErrorReason as f, FileOperationKind as p } from "./files/dial-file-manager.types.js";
|
|
6
|
-
import { COLUMNS_WITHOUT_AUTHOR as m, COLUMNS_WITH_AUTHOR as h, CORE_PERMISSION_MAP as g, DATE_OPTIONS as _,
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { useDialFileManagerTabConfig as
|
|
28
|
-
import {
|
|
29
|
-
|
|
6
|
+
import { COLUMNS_WITHOUT_AUTHOR as m, COLUMNS_WITH_AUTHOR as h, CORE_PERMISSION_MAP as g, DATE_OPTIONS as _, DIAL_FILE_MANAGER_SECTION_TABS as v, PATH_SEPARATOR_REGEXP as y, RESERVED_MARKER_NAME as b, UPLOAD_CONCURRENCY as x } from "./files/dial-file-manager.model.js";
|
|
7
|
+
import { buildSharedItemVirtualPath as S, dialCorePathToRelative as C, findDialFileByPath as w, findFolderByVirtualPath as T, formatOperationFolderName as E, getVirtualPathName as D, hasDialFileWritePermission as O, hasForbiddenNameSymbols as k, hasSamePaths as A, isCopyMoveDuplicateAllowed as j, isShareActionsAllowed as M, normalizeVirtualPath as N, parseNewFolderVirtualPath as P, resolveOwnerCoords as F, resolveSectionByPath as I, unionPathSets as L, withRoutableRootLabels as R } from "./files/dial-file-manager-path.util.js";
|
|
8
|
+
import { resolveDialFileApiPath as z, virtualPathToApiPath as B } from "./files/resolve-dial-file-api-path.js";
|
|
9
|
+
import { prepareCopyItems as V, prepareMoveRenameItems as H } from "./files/dial-file-manager-copy-move.util.js";
|
|
10
|
+
import { buildFromCache as U, fetchByTab as W, fetchForSearch as G, findFirstSuccessfulCopyMoveItem as K, mapCorePermissions as q, mapFileMetadataToDialFile as J, mapSearchItem as Y, mergeCreatedFolderIntoCache as X, updateEntry as Z } from "./files/dial-file-manager-mapping.util.js";
|
|
11
|
+
import { createFilesApiClient as Q } from "./files/create-files-api.js";
|
|
12
|
+
import { createUploadFileWithProgress as $ } from "./files/create-upload-file-with-progress.js";
|
|
13
|
+
import { openAnnotationAttachment as ee } from "./files/annotation.js";
|
|
14
|
+
import { getUrlFileName as te, isExternalSourcePreviewable as ne, resolveExternalSourceContentType as re } from "./files/source-content.js";
|
|
15
|
+
import { annotationToDisplayAttachment as ie, attachmentDtoToDisplayAttachment as ae, attachmentDtosToDisplayAttachments as oe } from "./files/attachment-dto-to-display.js";
|
|
16
|
+
import { dialFileToAttachment as se, dialFilesToAttachments as ce, dialFolderPathToAttachment as le } from "./files/dial-file-to-attachment.js";
|
|
17
|
+
import { DownloadDestinationType as ue } from "./files/download-destination.js";
|
|
18
|
+
import { prepareDownloadDestination as de } from "./files/prepare-download-destination.js";
|
|
19
|
+
import { deriveActionProfile as fe } from "./files/file-manager-variant.js";
|
|
20
|
+
import { useDialFileListing as pe } from "./files/useDialFileListing/useDialFileListing.js";
|
|
21
|
+
import { useDialFileMetadata as me } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
22
|
+
import { useDialFileMutations as he } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
23
|
+
import { useDialFileSharing as ge } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
24
|
+
import { useDialFileUploadBatch as _e } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
25
|
+
import { useDialFileManager as ve } from "./files/useDialFileManager/useDialFileManager.js";
|
|
26
|
+
import { useDialFileManagerSections as ye } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
|
|
27
|
+
import { useDialFileManagerTabConfig as be } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
28
|
+
import { useFileAttachmentPicker as xe } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
29
|
+
import { useGridEditingScroll as Se } from "@epam/ai-dial-chat-shared";
|
|
30
|
+
export { m as COLUMNS_WITHOUT_AUTHOR, h as COLUMNS_WITH_AUTHOR, g as CORE_PERMISSION_MAP, _ as DATE_OPTIONS, v as DIAL_FILE_MANAGER_SECTION_TABS, u as DialFilesApiUploadMode, ue as DownloadDestinationType, d as FileManagerNotificationReason, f as FileNameValidationErrorReason, p as FileOperationKind, y as PATH_SEPARATOR_REGEXP, b as RESERVED_MARKER_NAME, x as UPLOAD_CONCURRENCY, ie as annotationToDisplayAttachment, ae as attachmentDtoToDisplayAttachment, oe as attachmentDtosToDisplayAttachments, U as buildFromCache, S as buildSharedItemVirtualPath, Q as createFilesApiClient, $ as createUploadFileWithProgress, fe as deriveActionProfile, C as dialCorePathToRelative, se as dialFileToAttachment, ce as dialFilesToAttachments, le as dialFolderPathToAttachment, W as fetchByTab, G as fetchForSearch, w as findDialFileByPath, K as findFirstSuccessfulCopyMoveItem, T as findFolderByVirtualPath, E as formatOperationFolderName, te as getUrlFileName, D as getVirtualPathName, O as hasDialFileWritePermission, k as hasForbiddenNameSymbols, A as hasSamePaths, j as isCopyMoveDuplicateAllowed, r as isDialFileAcceptType, e as isDialFileId, ne as isExternalSourcePreviewable, M as isShareActionsAllowed, q as mapCorePermissions, J as mapFileMetadataToDialFile, Y as mapSearchItem, X as mergeCreatedFolderIntoCache, i as mimeTypesToAttachmentExtensionLabels, a as mimeTypesToDialFileAcceptTypes, o as mimeTypesToFileAccept, N as normalizeVirtualPath, ee as openAnnotationAttachment, P as parseNewFolderVirtualPath, V as prepareCopyItems, de as prepareDownloadDestination, H as prepareMoveRenameItems, z as resolveDialFileApiPath, t as resolveDialFileBucketAndPath, re as resolveExternalSourceContentType, F as resolveOwnerCoords, n as resolveRelativeDialFilePath, I as resolveSectionByPath, s as sanitizeFileName, c as splitFileNameExtension, l as trimFileNameToByteLimit, L as unionPathSets, Z as updateEntry, pe as useDialFileListing, ve as useDialFileManager, ye as useDialFileManagerSections, be as useDialFileManagerTabConfig, me as useDialFileMetadata, he as useDialFileMutations, ge as useDialFileSharing, _e as useDialFileUploadBatch, xe as useFileAttachmentPicker, Se as useGridEditingScroll, B as virtualPathToApiPath, R as withRoutableRootLabels };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isDialFileId as e } from "./dial-file.js";
|
|
2
2
|
import { AttachmentContentType as t, AttachmentErrorType as n, OoxmlFileType as r, OoxmlHighlightKind as i, getOoxmlFileType as a } from "@epam/ai-dial-attachment-canvas";
|
|
3
3
|
import { MIMEType as o, base64ToBlob as s, tryBase64ToBytes as c } from "@epam/ai-dial-chat-shared";
|
|
4
|
-
import {
|
|
4
|
+
import { annotationHighlightIds as l, annotationToOfficeHighlightLocations as u, annotationsToPdfHighlights as d, gatherSameSourceAnnotations as f, getAnnotationPdfPage as p, parsePdfPageReference as m } from "@epam/ai-dial-quotations";
|
|
5
5
|
import { LRUCache as h } from "lru-cache";
|
|
6
6
|
//#region src/files/attachment-canvas.ts
|
|
7
7
|
var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
@@ -69,14 +69,14 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
69
69
|
if (t.url != null && e(t.url)) return E(t.url);
|
|
70
70
|
if (t.referenceUrl != null && e(t.referenceUrl)) return E(t.referenceUrl);
|
|
71
71
|
}, O = async (e, t) => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (
|
|
75
|
-
let
|
|
76
|
-
return URL.createObjectURL(
|
|
72
|
+
let n = "file" in e ? e.file : void 0, r = n != null && n.size === 0, i = n != null && !r ? void 0 : t.resolveDialUrl(e);
|
|
73
|
+
if (n != null && i == null) return URL.createObjectURL(n);
|
|
74
|
+
if (i != null) try {
|
|
75
|
+
let n = await w(i, D(e) ?? "", t);
|
|
76
|
+
return URL.createObjectURL(n);
|
|
77
77
|
} catch (e) {
|
|
78
78
|
let t = e.status;
|
|
79
|
-
return t == null ? y(
|
|
79
|
+
return t == null ? y(i) : v(t, i);
|
|
80
80
|
}
|
|
81
81
|
if (e.previewUrl != null) return e.previewUrl;
|
|
82
82
|
if (e.data != null) return g(e.data, e.contentType);
|
|
@@ -91,12 +91,11 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
91
91
|
}
|
|
92
92
|
if ("file" in e) return e.file.text();
|
|
93
93
|
}, A = (e, t) => e.data != null || t.resolveDialUrl(e) != null || "file" in e, j = (e, n) => {
|
|
94
|
-
|
|
94
|
+
let r = "file" in e ? e.file : void 0, i = r != null && r.size === 0, a = r != null && !i ? void 0 : n.resolveDialUrl(e);
|
|
95
|
+
return r != null && a == null ? {
|
|
95
96
|
type: t.Image,
|
|
96
|
-
url: URL.createObjectURL(
|
|
97
|
-
}
|
|
98
|
-
let r = n.resolveDialUrl(e);
|
|
99
|
-
return r == null ? e.previewUrl == null ? e.data == null ? null : {
|
|
97
|
+
url: URL.createObjectURL(r)
|
|
98
|
+
} : a == null ? e.previewUrl == null ? e.data == null ? null : {
|
|
100
99
|
type: t.Image,
|
|
101
100
|
url: g(e.data, e.contentType)
|
|
102
101
|
} : {
|
|
@@ -104,7 +103,7 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
104
103
|
url: e.previewUrl
|
|
105
104
|
} : {
|
|
106
105
|
type: t.Image,
|
|
107
|
-
url:
|
|
106
|
+
url: a
|
|
108
107
|
};
|
|
109
108
|
}, M = async (e, n) => {
|
|
110
109
|
let r = await k(e, n);
|
|
@@ -125,32 +124,79 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
125
124
|
text: i,
|
|
126
125
|
language: r
|
|
127
126
|
} : i;
|
|
128
|
-
}, I =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
}, I = (e) => {
|
|
128
|
+
try {
|
|
129
|
+
return new URL(e, window.location.href).origin;
|
|
130
|
+
} catch {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
}, L = async (e, n) => {
|
|
134
|
+
let r = n.resolveDialUrl(e) ?? void 0;
|
|
135
|
+
if (r != null) return {
|
|
135
136
|
type: t.Html,
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
url: r,
|
|
138
|
+
isSameOriginUrl: I(r) === I(window.location.href),
|
|
139
|
+
resolveSourceText: async () => {
|
|
140
|
+
let t = await k(e, n);
|
|
141
|
+
if (t == null || typeof t != "string") throw Error("Failed to resolve HTML source text");
|
|
142
|
+
return t;
|
|
143
|
+
}
|
|
138
144
|
};
|
|
139
|
-
|
|
145
|
+
let i = await k(e, n);
|
|
146
|
+
return i == null ? null : typeof i == "string" ? i.length > P ? null : {
|
|
147
|
+
type: t.Html,
|
|
148
|
+
srcdoc: i,
|
|
149
|
+
srcdocHostUrl: n.htmlSrcdocHostUrl
|
|
150
|
+
} : i;
|
|
151
|
+
}, R = (e, t) => ({
|
|
152
|
+
id: e,
|
|
153
|
+
bboxes: [{
|
|
154
|
+
page: t,
|
|
155
|
+
x1: 0,
|
|
156
|
+
y1: 0,
|
|
157
|
+
x2: 0,
|
|
158
|
+
y2: 0
|
|
159
|
+
}],
|
|
160
|
+
style: {
|
|
161
|
+
backgroundColor: "transparent",
|
|
162
|
+
opacity: 0
|
|
163
|
+
}
|
|
164
|
+
}), z = (n, r, i) => {
|
|
140
165
|
let a = n.body?.source?.attachment;
|
|
141
166
|
if (a?.type !== o.PDF) return null;
|
|
142
167
|
let s = e(a.url) ? i.resolveDialFileDownloadUrl(a.url) : a.url;
|
|
143
168
|
if (s == null) return null;
|
|
144
|
-
let c = (r.find((e) => e.annotations.includes(n))?.annotations ?? [n]).filter((e) => e.body?.source?.attachment?.url === a.url), u = c.indexOf(n), f = d(c), m = l(n,
|
|
169
|
+
let c = (r.find((e) => e.annotations.includes(n))?.annotations ?? [n]).filter((e) => e.body?.source?.attachment?.url === a.url), u = c.indexOf(n), f = d(c), m = l(c)[u], h = p(n), g = f.some((e) => e.id === m);
|
|
170
|
+
if (!g && h != null) {
|
|
171
|
+
let e = `page-anchor-${m}`;
|
|
172
|
+
return {
|
|
173
|
+
type: t.Pdf,
|
|
174
|
+
url: s,
|
|
175
|
+
highlights: [...f, R(e, h)],
|
|
176
|
+
selectedHighlightId: e,
|
|
177
|
+
page: h
|
|
178
|
+
};
|
|
179
|
+
}
|
|
145
180
|
return {
|
|
146
181
|
type: t.Pdf,
|
|
147
182
|
url: s,
|
|
148
183
|
highlights: f,
|
|
149
|
-
selectedHighlightId:
|
|
150
|
-
page:
|
|
184
|
+
selectedHighlightId: g ? m : void 0,
|
|
185
|
+
page: h
|
|
151
186
|
};
|
|
152
|
-
},
|
|
187
|
+
}, B = (e) => {
|
|
153
188
|
switch (e.type) {
|
|
189
|
+
case "docx_text_anchor": return {
|
|
190
|
+
kind: i.DocxTableRow,
|
|
191
|
+
cells: e.cells,
|
|
192
|
+
occurrence: e.occurrence
|
|
193
|
+
};
|
|
194
|
+
case "pptx_text_anchor": return {
|
|
195
|
+
kind: i.PptxTableRow,
|
|
196
|
+
cells: e.cells,
|
|
197
|
+
occurrence: e.occurrence,
|
|
198
|
+
slide: e.slide
|
|
199
|
+
};
|
|
154
200
|
case "docx_text_range": return {
|
|
155
201
|
kind: i.DocxTextRange,
|
|
156
202
|
story: e.story,
|
|
@@ -174,22 +220,22 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
174
220
|
end: e.end
|
|
175
221
|
};
|
|
176
222
|
}
|
|
177
|
-
},
|
|
223
|
+
}, V = (n, i, o) => {
|
|
178
224
|
let s = n.body?.source?.attachment;
|
|
179
225
|
if (s?.url == null) return null;
|
|
180
226
|
let c = a(s.title ?? s.url, s.type);
|
|
181
227
|
if (c !== r.Docx && c !== r.Xlsx && c !== r.Pptx) return null;
|
|
182
228
|
let d = e(s.url) ? o.resolveDialFileDownloadUrl(s.url) : s.url;
|
|
183
229
|
if (d == null) return null;
|
|
184
|
-
let p = f(n, i), m = [], h;
|
|
230
|
+
let p = f(n, i), m = [], h, g = l(p);
|
|
185
231
|
return p.forEach((e, t) => {
|
|
186
232
|
let r = u(e);
|
|
187
233
|
if (r.length === 0) return;
|
|
188
|
-
let i =
|
|
234
|
+
let i = g[t];
|
|
189
235
|
m.push({
|
|
190
236
|
id: i,
|
|
191
|
-
locations: r.map(
|
|
192
|
-
}), e === n && (h = i);
|
|
237
|
+
locations: r.map(B)
|
|
238
|
+
}), e === n && h == null && (h = i);
|
|
193
239
|
}), {
|
|
194
240
|
type: t.Ooxml,
|
|
195
241
|
url: d,
|
|
@@ -199,7 +245,7 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
199
245
|
selectedHighlightId: h
|
|
200
246
|
} : {}
|
|
201
247
|
};
|
|
202
|
-
},
|
|
248
|
+
}, H = (n, r) => {
|
|
203
249
|
let i = m(n.url);
|
|
204
250
|
if (i == null) return null;
|
|
205
251
|
let a = e(i.baseUrl) ? r.resolveDialFileDownloadUrl(i.baseUrl) : i.baseUrl;
|
|
@@ -212,55 +258,42 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
212
258
|
return {
|
|
213
259
|
type: t.Pdf,
|
|
214
260
|
url: a,
|
|
215
|
-
highlights: [
|
|
216
|
-
id: o,
|
|
217
|
-
bboxes: [{
|
|
218
|
-
page: i.page,
|
|
219
|
-
x1: 0,
|
|
220
|
-
y1: 0,
|
|
221
|
-
x2: 0,
|
|
222
|
-
y2: 0
|
|
223
|
-
}],
|
|
224
|
-
style: {
|
|
225
|
-
backgroundColor: "transparent",
|
|
226
|
-
opacity: 0
|
|
227
|
-
}
|
|
228
|
-
}],
|
|
261
|
+
highlights: [R(o, i.page)],
|
|
229
262
|
selectedHighlightId: o,
|
|
230
263
|
page: i.page
|
|
231
264
|
};
|
|
232
|
-
},
|
|
265
|
+
}, U = (e) => {
|
|
233
266
|
try {
|
|
234
267
|
let t = new URL(e).protocol;
|
|
235
268
|
return t === "http:" || t === "https:" || t === "blob:";
|
|
236
269
|
} catch {
|
|
237
270
|
return !1;
|
|
238
271
|
}
|
|
239
|
-
},
|
|
272
|
+
}, W = (t) => t.url != null && !e(t.url) && U(t.url) ? t.url : void 0, G = async (e, n) => {
|
|
240
273
|
let r = await O(e, n);
|
|
241
274
|
if (r != null) return typeof r == "string" ? {
|
|
242
275
|
type: t.Pdf,
|
|
243
276
|
url: r
|
|
244
277
|
} : r;
|
|
245
|
-
let i =
|
|
278
|
+
let i = W(e);
|
|
246
279
|
return i == null ? null : {
|
|
247
280
|
type: t.Pdf,
|
|
248
281
|
url: i
|
|
249
282
|
};
|
|
250
|
-
},
|
|
283
|
+
}, K = async (e, n, r) => {
|
|
251
284
|
let i = await O(e, n);
|
|
252
285
|
if (i != null) return typeof i == "string" ? {
|
|
253
286
|
type: t.Ooxml,
|
|
254
287
|
url: i,
|
|
255
288
|
format: r
|
|
256
289
|
} : i;
|
|
257
|
-
let a =
|
|
290
|
+
let a = W(e);
|
|
258
291
|
return a == null ? null : {
|
|
259
292
|
type: t.Ooxml,
|
|
260
293
|
url: a,
|
|
261
294
|
format: r
|
|
262
295
|
};
|
|
263
|
-
},
|
|
296
|
+
}, q = async (e, n) => {
|
|
264
297
|
let r = await k(e, n);
|
|
265
298
|
if (r == null) return null;
|
|
266
299
|
if (typeof r != "string") return r;
|
|
@@ -276,7 +309,7 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
276
309
|
text: r
|
|
277
310
|
};
|
|
278
311
|
}
|
|
279
|
-
},
|
|
312
|
+
}, J = async (e, n, r, i) => {
|
|
280
313
|
let a = await k(e, n);
|
|
281
314
|
if (a == null || typeof a != "string") return null;
|
|
282
315
|
let o = {};
|
|
@@ -298,6 +331,34 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
298
331
|
visualizerName: r.title,
|
|
299
332
|
requestTimeout: r.requestTimeout
|
|
300
333
|
};
|
|
334
|
+
}, Y = (e, n, r, i) => {
|
|
335
|
+
let a = {
|
|
336
|
+
width: r.width,
|
|
337
|
+
height: r.height,
|
|
338
|
+
mobileHeight: r.mobileHeight,
|
|
339
|
+
themeId: i
|
|
340
|
+
}, o = [], s = [];
|
|
341
|
+
return e.forEach((e) => {
|
|
342
|
+
let t = n(e);
|
|
343
|
+
t != null && (s.push(e), o.push({
|
|
344
|
+
url: t,
|
|
345
|
+
mimeType: e.contentType,
|
|
346
|
+
visualizerData: { layout: a }
|
|
347
|
+
}));
|
|
348
|
+
}), o.length === 0 ? {
|
|
349
|
+
content: null,
|
|
350
|
+
resolved: []
|
|
351
|
+
} : {
|
|
352
|
+
content: {
|
|
353
|
+
type: t.GroupedVisualizer,
|
|
354
|
+
url: r.url,
|
|
355
|
+
attachments: o,
|
|
356
|
+
layout: a,
|
|
357
|
+
visualizerName: r.title,
|
|
358
|
+
requestTimeout: r.requestTimeout
|
|
359
|
+
},
|
|
360
|
+
resolved: s
|
|
361
|
+
};
|
|
301
362
|
};
|
|
302
363
|
//#endregion
|
|
303
|
-
export {
|
|
364
|
+
export { V as annotationToOoxmlCanvasContent, z as annotationToPdfCanvasContent, S as clearAttachmentCache, A as hasAttachmentTextSource, H as referenceAttachmentToPdfCanvasContent, F as resolveCodeCanvasContent, Y as resolveGroupedVisualizerCanvasContent, L as resolveHtmlCanvasContent, j as resolveImageCanvasContent, q as resolveJsonCanvasContent, N as resolveMarkdownCanvasContent, K as resolveOoxmlCanvasContent, G as resolvePdfCanvasContent, M as resolveTextCanvasContent, J as resolveVisualizerCanvasContent };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { normalizeMimeType as e } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { extension as t } from "mime-types";
|
|
2
3
|
//#region src/files/attachment-types.ts
|
|
3
|
-
var
|
|
4
|
-
if (
|
|
5
|
-
},
|
|
6
|
-
let
|
|
7
|
-
if (!(
|
|
8
|
-
},
|
|
9
|
-
if (
|
|
10
|
-
let
|
|
11
|
-
if (
|
|
12
|
-
let
|
|
13
|
-
return
|
|
4
|
+
var n = "*/*", r = (e) => e.startsWith(".") || e.includes("/"), i = (t) => {
|
|
5
|
+
if (t != null) return t.map((t) => t === "*" ? n : t.startsWith(".") ? t : e(t)).filter(r);
|
|
6
|
+
}, a = (e) => {
|
|
7
|
+
let t = i(e);
|
|
8
|
+
if (!(t == null || t.length === 0) && !t.some((e) => e === n)) return t.join(",");
|
|
9
|
+
}, o = (n) => n.map((n) => {
|
|
10
|
+
if (n.endsWith("/*")) return n;
|
|
11
|
+
let r = e(n), i = t(r);
|
|
12
|
+
if (i !== !1) return `.${i}`;
|
|
13
|
+
let a = r.split("/")[1];
|
|
14
|
+
return a == null ? n : `.${a.toLowerCase()}`;
|
|
14
15
|
}).join(", ");
|
|
15
16
|
//#endregion
|
|
16
|
-
export {
|
|
17
|
+
export { r as isDialFileAcceptType, o as mimeTypesToAttachmentExtensionLabels, i as mimeTypesToDialFileAcceptTypes, a as mimeTypesToFileAccept };
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { getVirtualPathName as e } from "./dial-file-manager-path.util.js";
|
|
2
|
-
import {
|
|
2
|
+
import { virtualPathToApiPath as t } from "./resolve-dial-file-api-path.js";
|
|
3
|
+
import { getParentFolderPath as n } from "@epam/ai-dial-chat-shared";
|
|
3
4
|
import { CopyItemDtoNodeTypeEnum as r, MoveItemDtoNodeTypeEnum as i, RenameItemDtoNodeTypeEnum as a } from "@epam/ai-dial-chat-api-client";
|
|
4
5
|
import { DialFileNodeType as o } from "@epam/ai-dial-react-file-manager";
|
|
5
6
|
//#region src/files/dial-file-manager-copy-move.util.ts
|
|
6
|
-
var s = (
|
|
7
|
-
let s =
|
|
7
|
+
var s = (n, i, a) => n.map((n) => {
|
|
8
|
+
let s = n.nodeType === o.FOLDER, c = t(n.sourceUrl, a), l = t(n.destinationUrl, a), u = e(n.sourceUrl, c);
|
|
8
9
|
return {
|
|
9
|
-
destinationName: e(
|
|
10
|
+
destinationName: e(n.destinationUrl, l),
|
|
10
11
|
dto: {
|
|
11
12
|
bucket: i,
|
|
12
13
|
sourcePath: s ? c.endsWith("/") ? c : `${c}/` : c.replace(/\/$/, ""),
|
|
13
14
|
destinationPath: s ? l.endsWith("/") ? l : `${l}/` : l.replace(/\/$/, ""),
|
|
14
|
-
overwrite:
|
|
15
|
+
overwrite: n.overwrite === !0,
|
|
15
16
|
nodeType: s ? r.Folder : r.Item,
|
|
16
17
|
name: u
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
}), c = (r, s, c) => {
|
|
20
21
|
let l = r.map((r) => {
|
|
21
|
-
let i = r.nodeType === o.FOLDER, a =
|
|
22
|
+
let i = r.nodeType === o.FOLDER, a = t(r.sourceUrl, c), s = t(r.destinationUrl, c), l = e(r.sourceUrl, a), u = e(r.destinationUrl, s), d = i ? a.endsWith("/") ? a : `${a}/` : a.replace(/\/$/, ""), f = i ? s.endsWith("/") ? s : `${s}/` : s.replace(/\/$/, "");
|
|
22
23
|
return {
|
|
23
24
|
isFolder: i,
|
|
24
25
|
name: l,
|
|
@@ -26,8 +27,8 @@ var s = (t, i, a) => t.map((t) => {
|
|
|
26
27
|
overwrite: r.overwrite === !0,
|
|
27
28
|
sourcePath: d,
|
|
28
29
|
destinationPath: f,
|
|
29
|
-
sourceParent:
|
|
30
|
-
destinationParent:
|
|
30
|
+
sourceParent: n(d),
|
|
31
|
+
destinationParent: n(f)
|
|
31
32
|
};
|
|
32
33
|
});
|
|
33
34
|
return {
|
|
@@ -50,7 +50,7 @@ var o = (t) => {
|
|
|
50
50
|
return o.some((e) => e.name.toLowerCase() === n.name.toLowerCase()) || o.push(s), a.set(t, o), a;
|
|
51
51
|
}, u = (e, t, n) => {
|
|
52
52
|
if (!e) return e;
|
|
53
|
-
let r = typeof n == "string" ? { status: n } : n, i = e.files.map((e
|
|
53
|
+
let r = typeof n == "string" ? { status: n } : n, i = e.files.map((e) => e.id === t ? {
|
|
54
54
|
...e,
|
|
55
55
|
...r
|
|
56
56
|
} : e);
|
|
@@ -59,6 +59,7 @@ var o = (t) => {
|
|
|
59
59
|
files: i
|
|
60
60
|
};
|
|
61
61
|
}, d = (e, t, r, a, o) => {
|
|
62
|
+
if (t === i.All) return Promise.reject(/* @__PURE__ */ Error("fetchByTab cannot list the All tab; list each section instead"));
|
|
62
63
|
if (t === i.Shared) {
|
|
63
64
|
if (a === "") return e.listSharedFiles({ path: void 0 }).then((e) => ({ items: e.items }));
|
|
64
65
|
let t = a.indexOf("/"), r = t === -1 ? a : a.slice(0, t), i = o.get(r);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { safeDecodeURI as e, stripTrailingSlashes as t } from "../shared/string-utils.js";
|
|
2
2
|
import { PATH_SEPARATOR_REGEXP as n } from "./dial-file-manager.model.js";
|
|
3
|
-
import { DialFileManagerActionProfile as r } from "
|
|
3
|
+
import { DialFileManagerActionProfile as r } from "@epam/ai-dial-chat-shared";
|
|
4
4
|
import { DialFileNodeType as i, DialFilePermission as a } from "@epam/ai-dial-react-file-manager";
|
|
5
5
|
//#region src/files/dial-file-manager-path.util.ts
|
|
6
6
|
var o = (e, t) => {
|
|
@@ -67,6 +67,28 @@ var o = (e, t) => {
|
|
|
67
67
|
bucket: a.bucket,
|
|
68
68
|
path: o + s
|
|
69
69
|
};
|
|
70
|
+
}, y = (e, t) => {
|
|
71
|
+
let n = e.startsWith("/") ? e : `/${e}`;
|
|
72
|
+
return t.find((e) => {
|
|
73
|
+
let t = `/${e.rootLabel}`;
|
|
74
|
+
return n === t || n.startsWith(`${t}/`);
|
|
75
|
+
});
|
|
76
|
+
}, b = (e) => {
|
|
77
|
+
let t = /* @__PURE__ */ new Set();
|
|
78
|
+
return e.forEach((e) => e.forEach((e) => t.add(e))), t;
|
|
79
|
+
}, x = (e, t) => {
|
|
80
|
+
if (e.size !== t.size) return !1;
|
|
81
|
+
for (let n of e) if (!t.has(n)) return !1;
|
|
82
|
+
return !0;
|
|
83
|
+
}, S = (e) => {
|
|
84
|
+
let t = /* @__PURE__ */ new Set();
|
|
85
|
+
return e.map((e) => {
|
|
86
|
+
let n = e.rootLabel.trim(), r = n !== "" && !n.includes("/") && !t.has(n) ? n : e.tab;
|
|
87
|
+
return t.add(r), r === e.rootLabel ? e : {
|
|
88
|
+
...e,
|
|
89
|
+
rootLabel: r
|
|
90
|
+
};
|
|
91
|
+
});
|
|
70
92
|
};
|
|
71
93
|
//#endregion
|
|
72
|
-
export { _ as buildSharedItemVirtualPath, g as dialCorePathToRelative, f as findDialFileByPath, u as findFolderByVirtualPath, l as formatOperationFolderName, c as getVirtualPathName, d as hasDialFileWritePermission, o as hasForbiddenNameSymbols, p as isCopyMoveDuplicateAllowed, m as isShareActionsAllowed, s as normalizeVirtualPath, h as parseNewFolderVirtualPath, v as resolveOwnerCoords };
|
|
94
|
+
export { _ as buildSharedItemVirtualPath, g as dialCorePathToRelative, f as findDialFileByPath, u as findFolderByVirtualPath, l as formatOperationFolderName, c as getVirtualPathName, d as hasDialFileWritePermission, o as hasForbiddenNameSymbols, x as hasSamePaths, p as isCopyMoveDuplicateAllowed, m as isShareActionsAllowed, s as normalizeVirtualPath, h as parseNewFolderVirtualPath, v as resolveOwnerCoords, y as resolveSectionByPath, b as unionPathSets, S as withRoutableRootLabels };
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import { HIDDEN_FILE as e } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import {
|
|
2
|
+
import { DialFileManagerTabs as t, DialFilePermission as n, FileManagerColumnKey as r } from "@epam/ai-dial-react-file-manager";
|
|
3
3
|
//#region src/files/dial-file-manager.model.ts
|
|
4
|
-
var
|
|
4
|
+
var i = 3, a = e, o = /[/\\]/, s = {
|
|
5
5
|
year: "numeric",
|
|
6
6
|
month: "short",
|
|
7
7
|
day: "2-digit",
|
|
8
8
|
hour: "2-digit",
|
|
9
9
|
minute: "2-digit",
|
|
10
10
|
hour12: !1
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
],
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
],
|
|
23
|
-
READ:
|
|
24
|
-
WRITE:
|
|
25
|
-
SHARE:
|
|
26
|
-
}
|
|
11
|
+
}, c = [
|
|
12
|
+
r.Name,
|
|
13
|
+
r.UpdatedAt,
|
|
14
|
+
r.Size,
|
|
15
|
+
r.Actions
|
|
16
|
+
], l = [
|
|
17
|
+
r.Name,
|
|
18
|
+
r.UpdatedAt,
|
|
19
|
+
r.Size,
|
|
20
|
+
r.Author,
|
|
21
|
+
r.Actions
|
|
22
|
+
], u = {
|
|
23
|
+
READ: n.READ,
|
|
24
|
+
WRITE: n.WRITE,
|
|
25
|
+
SHARE: n.SHARE
|
|
26
|
+
}, d = [
|
|
27
|
+
t.MyFiles,
|
|
28
|
+
t.Shared,
|
|
29
|
+
t.Organization
|
|
30
|
+
];
|
|
27
31
|
//#endregion
|
|
28
|
-
export {
|
|
32
|
+
export { c as COLUMNS_WITHOUT_AUTHOR, l as COLUMNS_WITH_AUTHOR, u as CORE_PERMISSION_MAP, s as DATE_OPTIONS, d as DIAL_FILE_MANAGER_SECTION_TABS, o as PATH_SEPARATOR_REGEXP, a as RESERVED_MARKER_NAME, i as UPLOAD_CONCURRENCY };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region src/files/dial-file-manager.types.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
|
-
return e.FolderLoadFailed = "folderLoadFailed", e.MetadataLoadFailed = "metadataLoadFailed", e.FolderCreateFailed = "folderCreateFailed", e.DownloadFileFailed = "downloadFileFailed", e.DownloadFilesFailed = "downloadFilesFailed", e.FilesDeleted = "filesDeleted", e.FilesDeletePartiallyFailed = "filesDeletePartiallyFailed", e.DeleteFailed = "deleteFailed", e.RenameFailed = "renameFailed", e.RenamePartiallyFailed = "renamePartiallyFailed", e.MoveFailed = "moveFailed", e.MovePartiallyFailed = "movePartiallyFailed", e.CopyFailed = "copyFailed", e.CopyPartiallyFailed = "copyPartiallyFailed", e.UnshareFailed = "unshareFailed", e.RemoveAccessFailed = "removeAccessFailed", e.UploadFailed = "uploadFailed", e.UploadCompleted = "uploadCompleted", e.UploadArchiveFailed = "uploadArchiveFailed", e.UploadArchivePartiallyFailed = "uploadArchivePartiallyFailed", e.UploadArchiveRequestFailed = "uploadArchiveRequestFailed", e;
|
|
3
|
+
return e.FolderLoadFailed = "folderLoadFailed", e.MetadataLoadFailed = "metadataLoadFailed", e.FolderCreateFailed = "folderCreateFailed", e.DownloadFileFailed = "downloadFileFailed", e.DownloadFilesFailed = "downloadFilesFailed", e.FilesDeleted = "filesDeleted", e.FilesDeletePartiallyFailed = "filesDeletePartiallyFailed", e.DeleteFailed = "deleteFailed", e.RenameFailed = "renameFailed", e.RenamePartiallyFailed = "renamePartiallyFailed", e.MoveFailed = "moveFailed", e.MovePartiallyFailed = "movePartiallyFailed", e.CopyFailed = "copyFailed", e.CopyPartiallyFailed = "copyPartiallyFailed", e.UnshareFailed = "unshareFailed", e.RemoveAccessFailed = "removeAccessFailed", e.UploadFailed = "uploadFailed", e.UploadCompleted = "uploadCompleted", e.UploadArchiveFailed = "uploadArchiveFailed", e.UploadArchivePartiallyFailed = "uploadArchivePartiallyFailed", e.UploadArchiveRequestFailed = "uploadArchiveRequestFailed", e.CrossSectionTransferUnsupported = "crossSectionTransferUnsupported", e;
|
|
4
4
|
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
|
-
return e.Empty = "empty", e.ForbiddenSymbols = "forbiddenSymbols", e.ReservedName = "reservedName", e.TooLong = "tooLong", e.DuplicateName = "duplicateName", e
|
|
5
|
+
return e.Empty = "empty", e.ForbiddenSymbols = "forbiddenSymbols", e.ReservedName = "reservedName", e.TooLong = "tooLong", e.DuplicateName = "duplicateName", e;
|
|
6
6
|
}({}), n = /* @__PURE__ */ function(e) {
|
|
7
|
-
return e.FolderCreated = "folderCreated", e.FileRenamed = "fileRenamed", e.FileDownloaded = "fileDownloaded", e.FilesDownloaded = "filesDownloaded", e.FileCopied = "fileCopied", e.FilesCopied = "filesCopied", e.FileMoved = "fileMoved", e.FilesMoved = "filesMoved", e;
|
|
7
|
+
return e.FolderCreated = "folderCreated", e.FileRenamed = "fileRenamed", e.FileDownloaded = "fileDownloaded", e.FilesDownloaded = "filesDownloaded", e.FileCopied = "fileCopied", e.FilesCopied = "filesCopied", e.FileMoved = "fileMoved", e.FilesMoved = "filesMoved", e.FileDuplicated = "fileDuplicated", e.FilesDuplicated = "filesDuplicated", e;
|
|
8
8
|
}({});
|
|
9
9
|
//#endregion
|
|
10
10
|
export { e as FileManagerNotificationReason, t as FileNameValidationErrorReason, n as FileOperationKind };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { safeDecodeURI as e } from "../shared/string-utils.js";
|
|
2
|
-
import {
|
|
3
|
-
import { DialFileNodeType as n } from "@epam/ai-dial-react-file-manager";
|
|
2
|
+
import { DialFileNodeType as t } from "@epam/ai-dial-react-file-manager";
|
|
4
3
|
//#region src/files/resolve-dial-file-api-path.ts
|
|
5
|
-
var
|
|
6
|
-
let i = `files/${
|
|
4
|
+
var n = (e) => e.startsWith("files/"), r = (t, r) => {
|
|
5
|
+
let i = `files/${r}/`;
|
|
7
6
|
if (t.startsWith(i)) return e(t.slice(i.length));
|
|
8
|
-
if (
|
|
9
|
-
let
|
|
7
|
+
if (n(t)) {
|
|
8
|
+
let n = t.slice(6), i = n.indexOf("/");
|
|
10
9
|
if (i >= 0) {
|
|
11
|
-
let t =
|
|
12
|
-
if (t ===
|
|
10
|
+
let t = n.slice(0, i), a = n.slice(i + 1);
|
|
11
|
+
if (t === r) return e(a);
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
14
|
return t;
|
|
16
|
-
},
|
|
15
|
+
}, i = (e, t) => {
|
|
17
16
|
let n = `/${t}`, r = `/${t}/`, i = `${t}/`;
|
|
18
17
|
if (e === n || e === `${t}` || e === r || e === i) return "";
|
|
19
18
|
let a;
|
|
@@ -25,9 +24,9 @@ var r = (e) => e.startsWith("files/"), i = (t, n) => {
|
|
|
25
24
|
}
|
|
26
25
|
let o = a.replace(/\/{2,}/g, "/");
|
|
27
26
|
return o && !o.endsWith("/") ? `${o}/` : o;
|
|
28
|
-
},
|
|
29
|
-
let s = e.nodeType ===
|
|
27
|
+
}, a = (e, t) => e.startsWith("/") || e === t || e.startsWith(`${t}/`), o = (e, n, o) => {
|
|
28
|
+
let s = e.nodeType === t.FOLDER, c = e.id ? r(e.id, n) : null, l = c != null && !a(c, o) ? c : i(e.path, o);
|
|
30
29
|
return s ? l.endsWith("/") ? l : `${l}/` : l.replace(/\/$/, "");
|
|
31
30
|
};
|
|
32
31
|
//#endregion
|
|
33
|
-
export {
|
|
32
|
+
export { o as resolveDialFileApiPath, i as virtualPathToApiPath };
|