@epam/ai-dial-chat-hooks 1.1.16 → 1.1.17
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 +3 -4
- package/api-transport/create-csrf-middleware.js +1 -2
- package/api-transport/create-unauthorized-middleware.js +5 -3
- package/attachment/useAttachmentAction/useAttachmentAction.js +6 -10
- package/attachment/useAttachmentValidation/useAttachmentValidation.js +1 -2
- package/catalog/catalog-derivations.js +1 -2
- package/catalog/catalog-primary-action.js +1 -2
- package/catalog/create-publish-api.js +1 -2
- package/catalog/deployment-endpoint-url.js +1 -2
- package/catalog/deployment-id.js +1 -2
- package/catalog/entity-details.js +1 -2
- package/catalog/map-deployment-limits-to-catalog.js +1 -2
- package/catalog/map-deployment-limits-to-input.js +1 -2
- package/catalog/map-deployment-to-catalog-item.js +1 -2
- package/catalog/map-entity-details-to-catalog.js +2 -3
- package/catalog/map-prompt-to-catalog-item.js +1 -2
- package/catalog/map-skill-to-catalog-item.js +1 -2
- package/catalog/mcp-endpoint-url.js +1 -2
- package/catalog/publish.js +1 -2
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +2 -7
- package/catalog/useCatalogItemDetails.js +1 -2
- package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js +1 -2
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js +2 -3
- package/catalog/usePublishFolders/usePublishFolders.js +2 -3
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +1 -2
- package/catalog/useSkillItemDetails.js +4 -5
- package/conversation/announcement-message.js +1 -2
- package/conversation/conversation-transfer/async.js +1 -2
- package/conversation/conversation-transfer/attachment-refs.js +1 -2
- package/conversation/conversation-transfer/build-upload-path.js +1 -2
- package/conversation/conversation-transfer/date.js +1 -2
- package/conversation/conversation-transfer/dial-file-resolve.js +1 -2
- package/conversation/conversation-transfer/export-conversation.js +1 -2
- package/conversation/conversation-transfer/import-conversation.js +7 -9
- package/conversation/conversation-transfer/progress.js +2 -3
- package/conversation/conversation-transfer/queue.js +1 -2
- package/conversation/conversation-transfer/types.js +1 -2
- package/conversation/conversation-transfer/zip-export.js +2 -9
- package/conversation/conversation-transfer/zip-import.js +2 -3
- package/conversation/create-chat-stream-api.js +2 -7
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.js +1 -2
- package/conversation/display-name-watch.js +1 -2
- package/conversation/footer-message.js +1 -2
- package/conversation/get-model-id-from-conversation-id.js +12 -13
- package/conversation/greeting.js +1 -2
- package/conversation/message-factory.js +1 -2
- package/conversation/message-utils.js +1 -2
- package/conversation/overlay-messages.js +1 -2
- package/conversation/quick-app-conversation-starters.js +1 -2
- package/conversation/starter-option.js +1 -2
- package/conversation/useActiveConversationSync/useActiveConversationSync.js +1 -2
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js +1 -2
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +5 -3
- package/conversation/useConversationExport/useConversationExport.js +12 -14
- package/conversation/useConversationHandlers/attachment-to-dto.js +1 -2
- package/conversation/useConversationHandlers/message-factory.js +1 -2
- package/conversation/useConversationHandlers/message-utils.js +3 -4
- package/conversation/useConversationHandlers/starter-option.js +1 -2
- package/conversation/useConversationHandlers/useConversationHandlers.js +3 -4
- package/conversation/useConversationImport/useConversationImport.js +29 -30
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.js +1 -2
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +1 -2
- package/conversation/useConversationScroll/useConversationScroll.js +3 -8
- package/conversation/useConversationStream/apply-chunk.js +1 -2
- package/conversation/useConversationStream/buffered-generation.js +1 -2
- package/conversation/useConversationStream/conversation-path.js +3 -4
- package/conversation/useConversationStream/generation-resume.js +13 -17
- package/conversation/useConversationStream/useConversationStream.js +10 -22
- package/conversation/useImportFilePicker/useImportFilePicker.js +1 -2
- package/conversation/useTranscribeAudio/audio-transcription-error.js +1 -2
- package/conversation/useTranscribeAudio/transcription-retry.js +1 -2
- package/conversation/useTranscribeAudio/useTranscribeAudio.js +1 -2
- package/conversation-overlay.js +1 -2
- package/conversation-sources/useConversationSources/useConversationSources.js +1 -2
- package/conversation-sources.js +1 -2
- package/file-manager-canvas.js +1 -2
- package/files/annotation.js +1 -2
- package/files/attachment-canvas.js +1 -2
- package/files/attachment-dto-to-display.js +1 -2
- package/files/attachment-types.js +2 -3
- package/files/create-files-api.js +1 -2
- package/files/create-upload-file-with-progress.js +6 -14
- package/files/dial-file-manager-copy-move.util.js +1 -2
- package/files/dial-file-manager-mapping.util.js +4 -5
- package/files/dial-file-manager-path.util.js +1 -2
- package/files/dial-file-manager.model.js +1 -2
- package/files/dial-file-manager.types.js +1 -2
- package/files/dial-file-to-attachment.js +4 -5
- package/files/dial-file.js +1 -2
- package/files/dial-files-api.js +1 -2
- package/files/download-destination.js +1 -2
- package/files/file-manager-variant.js +1 -2
- package/files/file-name.js +1 -2
- package/files/prepare-download-destination.js +1 -2
- package/files/resolve-dial-file-api-path.js +1 -2
- package/files/source-content.js +2 -3
- package/files/useDialFileListing/useDialFileListing.js +38 -46
- package/files/useDialFileManager/useDialFileManager.js +1 -2
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -2
- package/files/useDialFileMetadata/useDialFileMetadata.js +4 -5
- package/files/useDialFileMutations/useDialFileMutations.js +1 -2
- package/files/useDialFileSharing/useDialFileSharing.js +1 -2
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +17 -16
- package/mcp-apps/mcp-apps-api-client.js +1 -2
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +1 -2
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -2
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +4 -8
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +1 -2
- package/oauth/authorize-url.js +2 -3
- package/oauth/handshake.js +4 -12
- package/oauth/popup.js +1 -2
- package/oauth/toolset-id.js +4 -5
- package/oauth/types.js +1 -2
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +3 -7
- package/oauth/useToolsetLogin/useToolsetLogin.js +1 -2
- package/package.json +17 -17
- package/prompt/export-prompt.js +1 -2
- package/prompt/prompt-resource.js +1 -2
- package/prompt/prompt.js +1 -2
- package/prompt/usePromptsState/usePromptsState.js +1 -2
- package/scheduled-task/scheduled-task-mapping.js +1 -2
- package/scheduled-task/scheduled-task-trigger.js +2 -3
- package/scroll-anchoring.js +1 -2
- package/shared/application-schema.js +3 -4
- package/shared/browser-timezone.js +1 -2
- package/shared/cron-weekday.js +1 -2
- package/shared/custom-apps.js +1 -2
- package/shared/external-services.js +1 -2
- package/shared/formatting.js +1 -2
- package/shared/locale.js +3 -4
- package/shared/string-utils.js +1 -2
- package/shared/toolset-login-events.js +1 -2
- package/skill/skill-file-batch-validation.js +19 -19
- package/skill/skill-file-preview.js +1 -2
- package/skill/skill-manifest.js +1 -2
- package/skill/skill-types.js +2 -3
- package/skill/skill.js +11 -9
- package/skill/useSkillEditorLoad.js +1 -2
- package/skill/useSkillEditorSubmit.js +2 -7
- package/skill/useSkillFileActions.js +1 -2
- package/skill/useSkillFilePreview.js +1 -2
- package/skill/useSkillsState/useSkillsState.js +1 -2
- package/skills-state.js +1 -2
- package/source-content.js +1 -2
- package/usage/map-usage-data-to-dashboard.js +1 -2
- package/usage/map-user-usage-to-model-limits.js +1 -2
- package/usage/useUsageData/useUsageData.js +1 -2
- package/useChatSettingsFormConfig/useChatSettingsFormConfig.js +1 -2
- package/usePageFileDrag/usePageFileDrag.js +4 -5
- package/usePanelMaxWidth/usePanelMaxWidth.js +1 -2
- package/useShareLink/useShareLink.js +1 -2
- package/useShareRecipientsCount/useShareRecipientsCount.js +1 -2
- package/useToolsMenu/useToolsMenu.js +1 -2
- package/useViewportWidth/useViewportWidth.js +1 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { safeDecodeURI as e } from "../../shared/string-utils.js";
|
|
2
|
-
|
|
2
|
+
// src/conversation/useConversationStream/conversation-path.ts
|
|
3
3
|
var t = (t) => {
|
|
4
|
-
let n = t.indexOf("/");
|
|
5
|
-
return e(
|
|
4
|
+
let n = t.indexOf("/"), r = n === -1 ? t : t.substring(n + 1);
|
|
5
|
+
return e(r);
|
|
6
6
|
};
|
|
7
|
-
//#endregion
|
|
8
7
|
export { t as getConversationPath };
|
|
@@ -4,14 +4,14 @@ import { getConversationPath as r } from "./conversation-path.js";
|
|
|
4
4
|
import { applyChunkToMessages as i } from "./apply-chunk.js";
|
|
5
5
|
import { restoreBufferedMessage as a } from "./buffered-generation.js";
|
|
6
6
|
import { MessageRole as o } from "@epam/ai-dial-chat-shared";
|
|
7
|
-
|
|
7
|
+
// src/conversation/useConversationStream/generation-resume.ts
|
|
8
8
|
var s = (e) => {
|
|
9
9
|
let t = e.custom_content;
|
|
10
10
|
return !!e.content || e.responseId != null || !!t?.attachments?.length || !!t?.stages?.length || !!t?.annotations?.length || !!t?.form_schema || t?.state != null;
|
|
11
11
|
}, c = (e) => {
|
|
12
12
|
let t = e.messages[e.messages.length - 1];
|
|
13
13
|
return !!t && t.role === o.Assistant && !s(t) && t.streamErrorMessage == null && !t.wasStoppedByUser;
|
|
14
|
-
}, l =
|
|
14
|
+
}, l = 3e5, u = "awaiting-resume", d = [
|
|
15
15
|
1e3,
|
|
16
16
|
2e3,
|
|
17
17
|
4e3,
|
|
@@ -80,21 +80,18 @@ var s = (e) => {
|
|
|
80
80
|
if (!T()) return;
|
|
81
81
|
p.current.delete(S), _(S);
|
|
82
82
|
let n = e && e.messages.length - 1 === C && c(e) && s(w.message);
|
|
83
|
-
|
|
84
|
-
w.message
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
});
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
h.current.delete(S), e && v(S) && (d(e), f.current = e);
|
|
83
|
+
t || n ? (w.message = {
|
|
84
|
+
...w.message,
|
|
85
|
+
streamErrorMessage: y
|
|
86
|
+
}, v(S) && d((e) => {
|
|
87
|
+
if (!e || !T() || !v(S)) return e;
|
|
88
|
+
let t = a(e, w);
|
|
89
|
+
return f.current = t, t;
|
|
90
|
+
})) : (h.current.delete(S), e && v(S) && (d(e), f.current = e));
|
|
95
91
|
}, D = async () => {
|
|
96
92
|
try {
|
|
97
|
-
|
|
93
|
+
let n = await o.getConversation(e(t));
|
|
94
|
+
E(n);
|
|
98
95
|
} catch {
|
|
99
96
|
E(void 0, s(w.message));
|
|
100
97
|
}
|
|
@@ -163,5 +160,4 @@ var s = (e) => {
|
|
|
163
160
|
}
|
|
164
161
|
})();
|
|
165
162
|
};
|
|
166
|
-
|
|
167
|
-
export { h as createResumeIfAwaitingGeneration, p as fetchConversationForRecovery, s as hasGeneratedPayload, c as isAwaitingGenerationResume };
|
|
163
|
+
export { d as RECOVERY_REFETCH_DELAYS_MS, h as createResumeIfAwaitingGeneration, p as fetchConversationForRecovery, s as hasGeneratedPayload, c as isAwaitingGenerationResume };
|
|
@@ -7,7 +7,7 @@ import { createResumeIfAwaitingGeneration as u, fetchConversationForRecovery as
|
|
|
7
7
|
import { MessageRole as m, generateUUID as h } from "@epam/ai-dial-chat-shared";
|
|
8
8
|
import { useCallback as g, useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
9
9
|
import { SendCompletionDtoModeEnum as x } from "@epam/ai-dial-chat-api-client";
|
|
10
|
-
|
|
10
|
+
// src/conversation/useConversationStream/useConversationStream.ts
|
|
11
11
|
var S = 2e4, ee = (e, t, n) => e instanceof i ? n : e instanceof r ? t : e instanceof o ? e.message : "", C = ({ conversationId: r, state: { setConversation: o, conversationRef: C }, transport: w, generation: { startGeneration: T, completeGeneration: E }, channel: D, overlay: O, onStopError: k, generationConflictMessage: A = t, generationPersistenceErrorMessage: j = n, onStreamError: M }) => {
|
|
12
12
|
let N = y(M);
|
|
13
13
|
_(() => {
|
|
@@ -61,7 +61,7 @@ var S = 2e4, ee = (e, t, n) => e instanceof i ? n : e instanceof r ? t : e insta
|
|
|
61
61
|
}, W = () => {
|
|
62
62
|
if (M()) return;
|
|
63
63
|
let e = V.current.get(b);
|
|
64
|
-
|
|
64
|
+
e && e.generationId === y && (e.message = {
|
|
65
65
|
...e.message,
|
|
66
66
|
streamErrorMessage: j
|
|
67
67
|
}, N.current?.(new i()), G(b) && o((t) => {
|
|
@@ -96,11 +96,8 @@ var S = 2e4, ee = (e, t, n) => e instanceof i ? n : e instanceof r ? t : e insta
|
|
|
96
96
|
onComplete: async () => {
|
|
97
97
|
let n = V.current.get(b), r = n?.generationId === y ? n : void 0;
|
|
98
98
|
if (I(), H.current.has(y) ? H.current.delete(y) : M() || O?.notifyGenerationEnd?.(), !M()) {
|
|
99
|
-
if (!G(b))
|
|
100
|
-
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
try {
|
|
99
|
+
if (!G(b)) r && V.current.delete(b);
|
|
100
|
+
else try {
|
|
104
101
|
let n = await w.getConversation(e(t));
|
|
105
102
|
if (M()) return;
|
|
106
103
|
if (!G(b)) {
|
|
@@ -118,11 +115,7 @@ var S = 2e4, ee = (e, t, n) => e instanceof i ? n : e instanceof r ? t : e insta
|
|
|
118
115
|
}
|
|
119
116
|
},
|
|
120
117
|
onError: (e) => {
|
|
121
|
-
|
|
122
|
-
Q(e);
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
X(e);
|
|
118
|
+
N.current?.(e), e instanceof a && !M() ? Q(e) : X(e);
|
|
126
119
|
}
|
|
127
120
|
}, X = (e) => {
|
|
128
121
|
let t = V.current.get(b), n = t?.generationId === y ? t : void 0;
|
|
@@ -157,15 +150,11 @@ var S = 2e4, ee = (e, t, n) => e instanceof i ? n : e instanceof r ? t : e insta
|
|
|
157
150
|
return;
|
|
158
151
|
}
|
|
159
152
|
let c = V.current.get(b), l = c?.generationId === y ? c : void 0;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
});
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
B.current.delete(b), l && V.current.delete(b), G(b) && (o(i), C.current = i), Z();
|
|
153
|
+
p(i) ? J(t, i, {
|
|
154
|
+
seedMessage: l?.message,
|
|
155
|
+
skipDedupe: !0,
|
|
156
|
+
onSettled: Z
|
|
157
|
+
}) : (B.current.delete(b), l && V.current.delete(b), G(b) && (o(i), C.current = i), Z());
|
|
169
158
|
};
|
|
170
159
|
(async () => {
|
|
171
160
|
try {
|
|
@@ -223,5 +212,4 @@ var S = 2e4, ee = (e, t, n) => e instanceof i ? n : e instanceof r ? t : e insta
|
|
|
223
212
|
canStopStreaming: $ != null && I === $
|
|
224
213
|
};
|
|
225
214
|
};
|
|
226
|
-
//#endregion
|
|
227
215
|
export { C as useConversationStream };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as e, useLayoutEffect as t, useRef as n } from "react";
|
|
2
|
-
|
|
2
|
+
// src/conversation/useImportFilePicker/useImportFilePicker.ts
|
|
3
3
|
var r = ({ accept: r, onFileSelected: i }) => {
|
|
4
4
|
let a = n(null);
|
|
5
5
|
return t(() => {
|
|
@@ -16,5 +16,4 @@ var r = ({ accept: r, onFileSelected: i }) => {
|
|
|
16
16
|
}, [i])
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
//#endregion
|
|
20
19
|
export { r as useImportFilePicker };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/conversation/useTranscribeAudio/audio-transcription-error.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
3
|
return e.Unavailable = "unavailable", e.TooLarge = "tooLarge", e.Busy = "busy", e.Failed = "failed", e;
|
|
4
4
|
}({}), t = class extends Error {
|
|
@@ -8,5 +8,4 @@ var e = /* @__PURE__ */ function(e) {
|
|
|
8
8
|
super(e), this.name = "AudioTranscriptionError", this.reason = e, this.limitBytes = t;
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
//#endregion
|
|
12
11
|
export { t as AudioTranscriptionError, e as AudioTranscriptionErrorReason };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AudioTranscriptionError as e, AudioTranscriptionErrorReason as t } from "./audio-transcription-error.js";
|
|
2
|
-
|
|
2
|
+
// src/conversation/useTranscribeAudio/transcription-retry.ts
|
|
3
3
|
var n = 2, r = 6e3, i = (e, t) => (t.throwIfAborted(), new Promise((n, r) => {
|
|
4
4
|
let i = () => {
|
|
5
5
|
clearTimeout(a), r(t.reason);
|
|
@@ -35,5 +35,4 @@ var n = 2, r = 6e3, i = (e, t) => (t.throwIfAborted(), new Promise((n, r) => {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
export { o as withTranscriptionRetry };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AudioTranscriptionError as e, AudioTranscriptionErrorReason as t } from "./audio-transcription-error.js";
|
|
2
2
|
import { withTranscriptionRetry as n } from "./transcription-retry.js";
|
|
3
3
|
import { useCallback as r } from "react";
|
|
4
|
-
|
|
4
|
+
// src/conversation/useTranscribeAudio/useTranscribeAudio.ts
|
|
5
5
|
var i = ({ transcriptionApi: i, filesApi: a, transcribeWithDeployment: o, bucket: s, asrModelId: c, selectedDeploymentId: l, maxSizeBytes: u }) => ({ transcribeAudio: r(async (r, d) => {
|
|
6
6
|
if (d.throwIfAborted(), !s || !c && !l) throw new e(t.Unavailable);
|
|
7
7
|
if (r.size > u) throw new e(t.TooLarge, u);
|
|
@@ -37,5 +37,4 @@ var i = ({ transcriptionApi: i, filesApi: a, transcribeWithDeployment: o, bucket
|
|
|
37
37
|
i,
|
|
38
38
|
o
|
|
39
39
|
]) });
|
|
40
|
-
//#endregion
|
|
41
40
|
export { i as useTranscribeAudio };
|
package/conversation-overlay.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as toOverlayMessages };
|
|
1
|
+
export { toOverlayMessages } from "./conversation/overlay-messages.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MessageRole as e, messageAttachmentToDisplayAttachment as t } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { getAnnotationPdfPage as n, isReferenceOnlyAttachment as r, parsePdfPageReference as i, resolveMessageAnnotations as a } from "@epam/ai-dial-quotations";
|
|
3
3
|
import { useMemo as o } from "react";
|
|
4
|
-
|
|
4
|
+
// src/conversation-sources/useConversationSources/useConversationSources.ts
|
|
5
5
|
var s = {}, c = (e, t) => {
|
|
6
6
|
let r = n(e);
|
|
7
7
|
if (r == null) return t;
|
|
@@ -50,5 +50,4 @@ var s = {}, c = (e, t) => {
|
|
|
50
50
|
sources: l
|
|
51
51
|
};
|
|
52
52
|
}, [n, i]);
|
|
53
|
-
//#endregion
|
|
54
53
|
export { l as useConversationSources };
|
package/conversation-sources.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as useConversationSources };
|
|
1
|
+
export { useConversationSources } from "./conversation-sources/useConversationSources/useConversationSources.js";
|
package/file-manager-canvas.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as annotationToOoxmlCanvasContent, t as annotationToPdfCanvasContent, n as clearAttachmentCache, r as hasAttachmentTextSource, i as referenceAttachmentToPdfCanvasContent, a as resolveCodeCanvasContent, o as resolveGroupedVisualizerCanvasContent, s as resolveHtmlCanvasContent, c as resolveImageCanvasContent, l as resolveJsonCanvasContent, u as resolveMarkdownCanvasContent, d as resolveOoxmlCanvasContent, f as resolvePdfCanvasContent, p as resolveTextCanvasContent, m as resolveVisualizerCanvasContent };
|
|
1
|
+
export { annotationToOoxmlCanvasContent, annotationToPdfCanvasContent, clearAttachmentCache, hasAttachmentTextSource, referenceAttachmentToPdfCanvasContent, resolveCodeCanvasContent, resolveGroupedVisualizerCanvasContent, resolveHtmlCanvasContent, resolveImageCanvasContent, resolveJsonCanvasContent, resolveMarkdownCanvasContent, resolveOoxmlCanvasContent, resolvePdfCanvasContent, resolveTextCanvasContent, resolveVisualizerCanvasContent } from "./files/attachment-canvas.js";
|
package/files/annotation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isDialFileId as e } from "./dial-file.js";
|
|
2
2
|
import { triggerAnchorDownload as t } from "@epam/ai-dial-chat-shared";
|
|
3
|
-
|
|
3
|
+
// src/files/annotation.ts
|
|
4
4
|
var n = (n, r) => {
|
|
5
5
|
let { url: i } = n;
|
|
6
6
|
if (i == null) return;
|
|
@@ -11,5 +11,4 @@ var n = (n, r) => {
|
|
|
11
11
|
t(e, n.title ?? a.split("/").pop() ?? "");
|
|
12
12
|
} else window.open(i, "_blank", "noopener,noreferrer");
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { n as openAnnotationAttachment };
|
|
@@ -3,7 +3,7 @@ import { AttachmentContentType as t, AttachmentErrorType as n, OoxmlFileType as
|
|
|
3
3
|
import { MIMEType as o, base64ToBlob as s, tryBase64ToBytes as c } from "@epam/ai-dial-chat-shared";
|
|
4
4
|
import { annotationHighlightId 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
|
+
// src/files/attachment-canvas.ts
|
|
7
7
|
var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
8
8
|
let t = c(e);
|
|
9
9
|
return t == null ? e : new TextDecoder().decode(t);
|
|
@@ -337,5 +337,4 @@ var g = (e, t) => URL.createObjectURL(s(e, t)), _ = (e) => {
|
|
|
337
337
|
resolved: s
|
|
338
338
|
};
|
|
339
339
|
};
|
|
340
|
-
//#endregion
|
|
341
340
|
export { z as annotationToOoxmlCanvasContent, L as annotationToPdfCanvasContent, S as clearAttachmentCache, A as hasAttachmentTextSource, B as referenceAttachmentToPdfCanvasContent, F as resolveCodeCanvasContent, q as resolveGroupedVisualizerCanvasContent, I as resolveHtmlCanvasContent, j as resolveImageCanvasContent, G as resolveJsonCanvasContent, N as resolveMarkdownCanvasContent, W as resolveOoxmlCanvasContent, U as resolvePdfCanvasContent, M as resolveTextCanvasContent, K as resolveVisualizerCanvasContent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AttachmentType as e, RequestStatus as t, messageAttachmentToDisplayAttachment as n } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
|
|
2
|
+
// src/files/attachment-dto-to-display.ts
|
|
3
3
|
var r = (e, t) => n(e, t), i = (n) => {
|
|
4
4
|
let r = n.body?.source?.attachment;
|
|
5
5
|
return r == null ? null : {
|
|
@@ -11,5 +11,4 @@ var r = (e, t) => n(e, t), i = (n) => {
|
|
|
11
11
|
url: r.url
|
|
12
12
|
};
|
|
13
13
|
}, a = (e, t) => e?.map((e) => r(e, t)) ?? [];
|
|
14
|
-
//#endregion
|
|
15
14
|
export { i as annotationToDisplayAttachment, r as attachmentDtoToDisplayAttachment, a as attachmentDtosToDisplayAttachments };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { extension as e } from "mime-types";
|
|
2
|
-
|
|
2
|
+
// src/files/attachment-types.ts
|
|
3
3
|
var t = "*/*", n = (e) => e.startsWith(".") || e.includes("/"), r = (e) => {
|
|
4
4
|
if (e != null) return e.map((e) => e === "*" ? t : e).filter(n);
|
|
5
5
|
}, i = (e) => {
|
|
6
6
|
let n = r(e);
|
|
7
|
-
if (
|
|
7
|
+
if (n != null && n.length !== 0 && !n.some((e) => e === t)) return n.join(",");
|
|
8
8
|
}, a = (t) => t.map((t) => {
|
|
9
9
|
if (t.endsWith("/*")) return t;
|
|
10
10
|
let n = e(t);
|
|
@@ -12,5 +12,4 @@ var t = "*/*", n = (e) => e.startsWith(".") || e.includes("/"), r = (e) => {
|
|
|
12
12
|
let r = t.split("/")[1];
|
|
13
13
|
return r == null ? t : `.${r.toLowerCase()}`;
|
|
14
14
|
}).join(", ");
|
|
15
|
-
//#endregion
|
|
16
15
|
export { n as isDialFileAcceptType, a as mimeTypesToAttachmentExtensionLabels, r as mimeTypesToDialFileAcceptTypes, i as mimeTypesToFileAccept };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/files/create-files-api.ts
|
|
2
2
|
var e = (e) => e instanceof AbortSignal ? { signal: e } : e ?? {}, t = (t, n) => ({
|
|
3
3
|
listPublicFiles: (e) => t.listPublicFiles(e),
|
|
4
4
|
listSharedFiles: (e) => t.listSharedFiles(e),
|
|
@@ -36,5 +36,4 @@ var e = (e) => e instanceof AbortSignal ? { signal: e } : e ?? {}, t = (t, n) =>
|
|
|
36
36
|
discardShared: (e) => t.discardShared({ discardSharedDto: { items: e } }),
|
|
37
37
|
listSharedByMe: (e) => t.listSharedByMe({ bucket: e })
|
|
38
38
|
});
|
|
39
|
-
//#endregion
|
|
40
39
|
export { t as createFilesApiClient };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/files/create-upload-file-with-progress.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
let { uploadUrl: t, xhrFactory: n = () => new XMLHttpRequest() } = e;
|
|
4
4
|
return (r, i, a, { signal: o, onProgress: s, uploadMode: c } = {}) => new Promise((l, u) => {
|
|
@@ -11,19 +11,12 @@ var e = (e) => {
|
|
|
11
11
|
!s || !e.lengthComputable || e.total <= 0 || s(Math.min(100, Math.round(e.loaded / e.total * 100)));
|
|
12
12
|
}), d.addEventListener("load", () => {
|
|
13
13
|
let n = d.getResponseHeader("x-csrf-token");
|
|
14
|
-
if (n && e.setCsrfToken(n), d.status >= 200 && d.status < 300) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
u(/* @__PURE__ */ Error("Upload response was not valid JSON"));
|
|
19
|
-
}
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (d.status === 401) {
|
|
23
|
-
e.notifyUnauthorized(t), u(e.createUnauthorizedError(t));
|
|
24
|
-
return;
|
|
14
|
+
if (n && e.setCsrfToken(n), d.status >= 200 && d.status < 300) try {
|
|
15
|
+
l(JSON.parse(d.responseText));
|
|
16
|
+
} catch {
|
|
17
|
+
u(/* @__PURE__ */ Error("Upload response was not valid JSON"));
|
|
25
18
|
}
|
|
26
|
-
u(/* @__PURE__ */ Error(`Upload failed with status ${d.status}`));
|
|
19
|
+
else d.status === 401 ? (e.notifyUnauthorized(t), u(e.createUnauthorizedError(t))) : u(/* @__PURE__ */ Error(`Upload failed with status ${d.status}`));
|
|
27
20
|
}), d.addEventListener("error", () => {
|
|
28
21
|
u(/* @__PURE__ */ Error("Upload failed"));
|
|
29
22
|
}), d.addEventListener("abort", () => {
|
|
@@ -38,5 +31,4 @@ var e = (e) => {
|
|
|
38
31
|
d.send(p);
|
|
39
32
|
});
|
|
40
33
|
};
|
|
41
|
-
//#endregion
|
|
42
34
|
export { e as createUploadFileWithProgress };
|
|
@@ -2,7 +2,7 @@ import { getVirtualPathName as e } from "./dial-file-manager-path.util.js";
|
|
|
2
2
|
import { getParentFolderPath as t, virtualPathToApiPath as n } from "./resolve-dial-file-api-path.js";
|
|
3
3
|
import { CopyItemDtoNodeTypeEnum as r, MoveItemDtoNodeTypeEnum as i, RenameItemDtoNodeTypeEnum as a } from "@epam/ai-dial-chat-api-client";
|
|
4
4
|
import { DialFileNodeType as o } from "@epam/ai-dial-react-file-manager";
|
|
5
|
-
|
|
5
|
+
// src/files/dial-file-manager-copy-move.util.ts
|
|
6
6
|
var s = (t, i, a) => t.map((t) => {
|
|
7
7
|
let s = t.nodeType === o.FOLDER, c = n(t.sourceUrl, a), l = n(t.destinationUrl, a), u = e(t.sourceUrl, c);
|
|
8
8
|
return {
|
|
@@ -51,5 +51,4 @@ var s = (t, i, a) => t.map((t) => {
|
|
|
51
51
|
}))
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
//#endregion
|
|
55
54
|
export { s as prepareCopyItems, c as prepareMoveRenameItems };
|
|
@@ -2,7 +2,7 @@ import { CORE_PERMISSION_MAP as e } from "./dial-file-manager.model.js";
|
|
|
2
2
|
import { buildSharedItemVirtualPath as t, dialCorePathToRelative as n } from "./dial-file-manager-path.util.js";
|
|
3
3
|
import { ListFilesItemDtoNodeTypeEnum as r } from "@epam/ai-dial-chat-api-client";
|
|
4
4
|
import { DialFileManagerTabs as i, DialFileNodeType as a } from "@epam/ai-dial-react-file-manager";
|
|
5
|
-
|
|
5
|
+
// src/files/dial-file-manager-mapping.util.ts
|
|
6
6
|
var o = (t) => {
|
|
7
7
|
if (!t?.length) return;
|
|
8
8
|
let n = t.map((t) => e[t.toUpperCase()]).filter((e) => e != null);
|
|
@@ -110,13 +110,13 @@ var o = (t) => {
|
|
|
110
110
|
});
|
|
111
111
|
return { items: s };
|
|
112
112
|
}, p = (e, i, o) => {
|
|
113
|
-
let s = e.nodeType === r.Folder, c = e.name, l = e.bucket ?? i, u =
|
|
113
|
+
let s = e.nodeType === r.Folder, c = e.name, l = e.bucket ?? i, u = e.url ?? e.path ?? "", d = n(u, l).replace(/\/$/, ""), f = d.lastIndexOf("/"), p = f > 0 ? d.slice(0, f) : "", m = t(p, o, !1), h = s ? `${m}/${c}/` : `${m}/${c}`;
|
|
114
114
|
return {
|
|
115
115
|
id: e.path,
|
|
116
116
|
name: c,
|
|
117
|
-
path:
|
|
117
|
+
path: h,
|
|
118
118
|
url: e.url,
|
|
119
|
-
parentPath:
|
|
119
|
+
parentPath: m,
|
|
120
120
|
nodeType: s ? a.FOLDER : a.ITEM,
|
|
121
121
|
folderId: e.folderId,
|
|
122
122
|
bucket: l,
|
|
@@ -136,5 +136,4 @@ var o = (t) => {
|
|
|
136
136
|
updatedAt: e.updatedAt ? new Date(e.updatedAt).toISOString() : t.updatedAt,
|
|
137
137
|
createdAt: e.createdAt ? new Date(e.createdAt).toISOString() : t.createdAt
|
|
138
138
|
});
|
|
139
|
-
//#endregion
|
|
140
139
|
export { c as buildFromCache, d as fetchByTab, f as fetchForSearch, s as findFirstSuccessfulCopyMoveItem, o as mapCorePermissions, m as mapFileMetadataToDialFile, p as mapSearchItem, l as mergeCreatedFolderIntoCache, u as updateEntry };
|
|
@@ -2,7 +2,7 @@ import { safeDecodeURI as e, stripTrailingSlashes as t } from "../shared/string-
|
|
|
2
2
|
import { PATH_SEPARATOR_REGEXP as n } from "./dial-file-manager.model.js";
|
|
3
3
|
import { DialFileManagerActionProfile as r } from "./file-manager-variant.js";
|
|
4
4
|
import { DialFileNodeType as i, DialFilePermission as a } from "@epam/ai-dial-react-file-manager";
|
|
5
|
-
|
|
5
|
+
// src/files/dial-file-manager-path.util.ts
|
|
6
6
|
var o = (e, t) => {
|
|
7
7
|
if (n.test(e)) return !0;
|
|
8
8
|
if (t == null) return !1;
|
|
@@ -68,5 +68,4 @@ var o = (e, t) => {
|
|
|
68
68
|
path: o + s
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
//#endregion
|
|
72
71
|
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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HIDDEN_FILE as e } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { DialFilePermission as t, FileManagerColumnKey as n } from "@epam/ai-dial-react-file-manager";
|
|
3
|
-
|
|
3
|
+
// src/files/dial-file-manager.model.ts
|
|
4
4
|
var r = 3, i = e, a = /[/\\]/, o = {
|
|
5
5
|
year: "numeric",
|
|
6
6
|
month: "short",
|
|
@@ -24,5 +24,4 @@ var r = 3, i = e, a = /[/\\]/, o = {
|
|
|
24
24
|
WRITE: t.WRITE,
|
|
25
25
|
SHARE: t.SHARE
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
export { s as COLUMNS_WITHOUT_AUTHOR, c as COLUMNS_WITH_AUTHOR, l as CORE_PERMISSION_MAP, o as DATE_OPTIONS, a as PATH_SEPARATOR_REGEXP, i as RESERVED_MARKER_NAME, r as UPLOAD_CONCURRENCY };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/files/dial-file-manager.types.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
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;
|
|
4
4
|
}({}), t = /* @__PURE__ */ function(e) {
|
|
@@ -6,5 +6,4 @@ var e = /* @__PURE__ */ function(e) {
|
|
|
6
6
|
}({}), n = /* @__PURE__ */ function(e) {
|
|
7
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;
|
|
8
8
|
}({});
|
|
9
|
-
//#endregion
|
|
10
9
|
export { e as FileManagerNotificationReason, t as FileNameValidationErrorReason, n as FileOperationKind };
|
|
@@ -2,7 +2,7 @@ import { safeDecodeURI as e } from "../shared/string-utils.js";
|
|
|
2
2
|
import { isDialFileId as t } from "./dial-file.js";
|
|
3
3
|
import { AttachmentType as n, RequestStatus as r } from "@epam/ai-dial-chat-shared";
|
|
4
4
|
import { DialFileNodeType as i } from "@epam/ai-dial-ui-kit";
|
|
5
|
-
|
|
5
|
+
// src/files/dial-file-to-attachment.ts
|
|
6
6
|
var a = (e, n) => {
|
|
7
7
|
let r = e.url ?? e.id;
|
|
8
8
|
if (r) return t(r) || r.startsWith("http://") || r.startsWith("https://") ? r : `files/${n}/${r.replace(/^\/+/, "")}`;
|
|
@@ -22,16 +22,15 @@ var a = (e, n) => {
|
|
|
22
22
|
...u == null ? {} : { previewUrl: u }
|
|
23
23
|
};
|
|
24
24
|
}, s = (e, t, n) => e.map((e) => o(e, t, n)).filter((e) => e != null), c = (t) => {
|
|
25
|
-
let i =
|
|
25
|
+
let i = t.replace(/\/$/, "").split("/").filter(Boolean).pop() ?? "", a = e(i);
|
|
26
26
|
return {
|
|
27
27
|
id: t,
|
|
28
|
-
name:
|
|
28
|
+
name: a,
|
|
29
29
|
contentType: "application/octet-stream",
|
|
30
30
|
type: n.File,
|
|
31
31
|
status: r.Idle,
|
|
32
32
|
url: t,
|
|
33
|
-
file: new File([],
|
|
33
|
+
file: new File([], a)
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { o as dialFileToAttachment, s as dialFilesToAttachments, c as dialFolderPathToAttachment };
|
package/files/dial-file.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { safeDecodeURI as e } from "../shared/string-utils.js";
|
|
2
|
-
|
|
2
|
+
// src/files/dial-file.ts
|
|
3
3
|
var t = (e) => e.startsWith("files/"), n = (n, r) => {
|
|
4
4
|
let i = `files/${r}/`;
|
|
5
5
|
if (n.startsWith(i)) return e(n.slice(i.length));
|
|
@@ -26,5 +26,4 @@ var t = (e) => e.startsWith("files/"), n = (n, r) => {
|
|
|
26
26
|
path: o
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
|
-
//#endregion
|
|
30
29
|
export { t as isDialFileId, r as resolveDialFileBucketAndPath, n as resolveRelativeDialFilePath };
|
package/files/dial-files-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DialFileManagerActionProfile as e, DialFileManagerVariant as t } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
|
|
2
|
+
// src/files/file-manager-variant.ts
|
|
3
3
|
var n = (n) => {
|
|
4
4
|
switch (n) {
|
|
5
5
|
case t.Attach: return e.Attach;
|
|
@@ -7,5 +7,4 @@ var n = (n) => {
|
|
|
7
7
|
case t.FolderPicker: return e.Full;
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
//#endregion
|
|
11
10
|
export { e as DialFileManagerActionProfile, t as DialFileManagerVariant, n as deriveActionProfile };
|
package/files/file-name.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getUtf8ByteLength as e, truncateToUtf8Bytes as t } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { NOT_ALLOWED_SYMBOLS_REGEXP as n } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
|
|
3
|
+
// src/files/file-name.ts
|
|
4
4
|
var r = (e) => {
|
|
5
5
|
let t = e.lastIndexOf("."), n = t > 0;
|
|
6
6
|
return {
|
|
@@ -19,5 +19,4 @@ var r = (e) => {
|
|
|
19
19
|
let { base: t, extension: a } = r(e), s = o(t.replace(new RegExp(n.source, "g"), "_"));
|
|
20
20
|
return s === "" ? e : i(`${s}${a}`);
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { s as sanitizeFileName, r as splitFileNameExtension, i as trimFileNameToByteLimit };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DownloadDestinationType as e } from "./download-destination.js";
|
|
2
|
-
|
|
2
|
+
// src/files/prepare-download-destination.ts
|
|
3
3
|
var t = async (t, n = "application/octet-stream") => {
|
|
4
4
|
let r = window.showSaveFilePicker;
|
|
5
5
|
if (r == null) return { type: e.Blob };
|
|
@@ -20,5 +20,4 @@ var t = async (t, n = "application/octet-stream") => {
|
|
|
20
20
|
throw t;
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
export { t as prepareDownloadDestination };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { safeDecodeURI as e } from "../shared/string-utils.js";
|
|
2
2
|
import { getParentFolderPath as t } from "@epam/ai-dial-chat-shared";
|
|
3
3
|
import { DialFileNodeType as n } from "@epam/ai-dial-react-file-manager";
|
|
4
|
-
|
|
4
|
+
// src/files/resolve-dial-file-api-path.ts
|
|
5
5
|
var r = (e) => e.startsWith("files/"), i = (t, n) => {
|
|
6
6
|
let i = `files/${n}/`;
|
|
7
7
|
if (t.startsWith(i)) return e(t.slice(i.length));
|
|
@@ -29,5 +29,4 @@ var r = (e) => e.startsWith("files/"), i = (t, n) => {
|
|
|
29
29
|
let s = e.nodeType === n.FOLDER, c = e.id ? i(e.id, t) : null, l = c != null && !o(c, r) ? c : a(e.path, r);
|
|
30
30
|
return s ? l.endsWith("/") ? l : `${l}/` : l.replace(/\/$/, "");
|
|
31
31
|
};
|
|
32
|
-
//#endregion
|
|
33
32
|
export { t as getParentFolderPath, s as resolveDialFileApiPath, a as virtualPathToApiPath };
|
package/files/source-content.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// src/files/source-content.ts
|
|
2
2
|
var e = {
|
|
3
3
|
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
4
4
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
5
5
|
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
6
6
|
csv: "text/csv"
|
|
7
|
-
}, t = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), n = new Set(["html", "htm"]), r = "pdf", i = "application/pdf", a = (e) => e.split(/[?#]/)[0], o = (e) => {
|
|
7
|
+
}, t = /* @__PURE__ */ new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), n = /* @__PURE__ */ new Set(["html", "htm"]), r = "pdf", i = "application/pdf", a = (e) => e.split(/[?#]/)[0], o = (e) => {
|
|
8
8
|
let t = e.lastIndexOf(".");
|
|
9
9
|
return t === -1 ? "" : e.slice(t + 1).toLowerCase();
|
|
10
10
|
}, s = (e) => {
|
|
@@ -33,5 +33,4 @@ var e = {
|
|
|
33
33
|
let i = o(s(r));
|
|
34
34
|
return t.has(i) || n.has(i);
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { s as getUrlFileName, u as isExternalSourcePreviewable, l as resolveExternalSourceContentType };
|