@epam/ai-dial-chat-hooks 1.2.0-dev.28 → 1.2.0-dev.282
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 +17 -13
- package/catalog.d.ts +139 -34
- package/catalog.js +23 -22
- 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/useConversationExport/useConversationExport.js +9 -9
- package/conversation/useConversationHandlers/useConversationHandlers.js +73 -57
- 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 +265 -116
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -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 +295 -17
- package/conversation.js +32 -29
- package/file-manager-canvas.d.ts +53 -5
- package/file-manager.d.ts +156 -26
- package/file-manager.js +25 -23
- package/files/attachment-canvas.js +74 -40
- package/files/attachment-types.js +14 -13
- package/files/dial-file-manager-mapping.util.js +2 -1
- package/files/dial-file-manager-path.util.js +23 -1
- package/files/dial-file-manager.model.js +23 -19
- package/files/dial-file-manager.types.js +3 -3
- package/files/useDialFileListing/useDialFileListing.js +139 -127
- package/files/useDialFileManager/useDialFileManager.js +132 -128
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -19
- package/files/useDialFileMutations/useDialFileMutations.js +33 -32
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +49 -0
- package/index.d.ts +1178 -112
- 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 +26 -21
- 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/conversation.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { buildAnnouncementSignature as e, hasAnnouncementContent as t, hasStructuredAnnouncement as n, sanitizeAnnouncementHtml as r, sanitizeAnnouncementMessageHtml as i } from "./conversation/announcement-message.js";
|
|
2
|
-
import { DEFAULT_GENERATION_CONFLICT_MESSAGE as a,
|
|
3
|
-
import { shouldWatchForDisplayNameUpdate as
|
|
4
|
-
import { formatAppVersion as
|
|
5
|
-
import { getModelIdFromConversationId as
|
|
6
|
-
import { getTimeOfDayGreeting as
|
|
7
|
-
import { createDeploymentChangedMessage as
|
|
8
|
-
import { getLastDeploymentId as
|
|
9
|
-
import { getQuickAppConversationStarters as
|
|
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 {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
|
|
2
|
+
import { DEFAULT_GENERATION_CONFLICT_MESSAGE as a, DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE as o, DEFAULT_STREAM_IDLE_TIMEOUT_MS as s, GenerationConflictError as c, GenerationPersistenceError as l, StreamInterruptedError as u, StreamUpstreamError as d, createChatStreamApi as f } from "./conversation/create-chat-stream-api.js";
|
|
3
|
+
import { shouldWatchForDisplayNameUpdate as p } from "./conversation/display-name-watch.js";
|
|
4
|
+
import { formatAppVersion as m, sanitizeFooterHtml as h } from "./conversation/footer-message.js";
|
|
5
|
+
import { getModelIdFromConversationId as g } from "./conversation/get-model-id-from-conversation-id.js";
|
|
6
|
+
import { getTimeOfDayGreeting as _ } from "./conversation/greeting.js";
|
|
7
|
+
import { createDeploymentChangedMessage as v } from "./conversation/message-factory.js";
|
|
8
|
+
import { getFormSchemaToolSyncKey as y, getLastDeploymentId as b, getLastUserMessageToolConfiguration as x, getLatestToolConfiguration as S, getToolConfigurationFromFormSchema as C, isMessageStreaming as w, messageHasStages as T, normalizeResponseFormat as E } from "./conversation/message-utils.js";
|
|
9
|
+
import { getQuickAppConversationStarters as D } from "./conversation/quick-app-conversation-starters.js";
|
|
10
|
+
import { mapStages as O, toStage as k } from "./conversation/stage.js";
|
|
11
|
+
import { getStarterPopulateText as A, getStartersFromSchema as j } from "./conversation/starter-option.js";
|
|
12
|
+
import { deriveConversationRowActionState as M } from "./conversation/deriveConversationRowActionState/deriveConversationRowActionState.js";
|
|
13
|
+
import { useActiveConversationSync as N } from "./conversation/useActiveConversationSync/useActiveConversationSync.js";
|
|
14
|
+
import { useAsyncConfirmDialog as P } from "./conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js";
|
|
15
|
+
import { useConversationLookupMaps as F } from "./conversation/useConversationLookupMaps/useConversationLookupMaps.js";
|
|
16
|
+
import { getConversationSource as I, useConversationPanelItems as L } from "./conversation/useConversationPanelItems/useConversationPanelItems.js";
|
|
17
|
+
import { useImportFilePicker as R } from "./conversation/useImportFilePicker/useImportFilePicker.js";
|
|
18
|
+
import { useMessageSelectionReply as z } from "./conversation/useMessageSelectionReply/useMessageSelectionReply.js";
|
|
19
|
+
import { useAttachmentUpload as B } from "./conversation/useAttachmentUpload/useAttachmentUpload.js";
|
|
20
|
+
import { AudioTranscriptionError as V, AudioTranscriptionErrorReason as H } from "./conversation/useTranscribeAudio/audio-transcription-error.js";
|
|
21
|
+
import { useTranscribeAudio as U } from "./conversation/useTranscribeAudio/useTranscribeAudio.js";
|
|
22
|
+
import { attachmentToDto as W, attachmentsToDtos as G } from "./conversation/useConversationHandlers/attachment-to-dto.js";
|
|
23
|
+
import { createMessagePair as K } from "./conversation/useConversationHandlers/message-factory.js";
|
|
24
|
+
import { hasActiveToolConfig as q, isAnswerIncomplete as J, isMessageChanged as Y, shouldRerunGenerationOnEdit as X } from "./conversation/useConversationHandlers/message-utils.js";
|
|
25
|
+
import { getStarterConversationText as Z, getStarterDisplayText as Q, getStarterSubmitText as $ } from "./conversation/useConversationHandlers/starter-option.js";
|
|
26
|
+
import { getConversationPath as ee } from "./conversation/useConversationStream/conversation-path.js";
|
|
27
|
+
import { useConversationHandlers as te } from "./conversation/useConversationHandlers/useConversationHandlers.js";
|
|
28
|
+
import { applyChunkToMessages as ne, mergeStages as re } from "./conversation/useConversationStream/apply-chunk.js";
|
|
29
|
+
import { isAwaitingGenerationResume as ie } from "./conversation/useConversationStream/generation-resume.js";
|
|
30
|
+
import { useConversationStream as ae } from "./conversation/useConversationStream/useConversationStream.js";
|
|
31
|
+
import { useChatSettingsFormConfig as oe } from "./useChatSettingsFormConfig/useChatSettingsFormConfig.js";
|
|
32
|
+
import { useToolsMenu as se } from "./useToolsMenu/useToolsMenu.js";
|
|
33
|
+
export { V as AudioTranscriptionError, H as AudioTranscriptionErrorReason, a as DEFAULT_GENERATION_CONFLICT_MESSAGE, o as DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE, s as DEFAULT_STREAM_IDLE_TIMEOUT_MS, c as GenerationConflictError, l as GenerationPersistenceError, u as StreamInterruptedError, d as StreamUpstreamError, ne as applyChunkToMessages, W as attachmentToDto, G as attachmentsToDtos, e as buildAnnouncementSignature, f as createChatStreamApi, v as createDeploymentChangedMessage, K as createMessagePair, M as deriveConversationRowActionState, m as formatAppVersion, ee as getConversationPath, I as getConversationSource, y as getFormSchemaToolSyncKey, b as getLastDeploymentId, x as getLastUserMessageToolConfiguration, S as getLatestToolConfiguration, g as getModelIdFromConversationId, D as getQuickAppConversationStarters, Z as getStarterConversationText, Q as getStarterDisplayText, A as getStarterPopulateText, $ as getStarterSubmitText, j as getStartersFromSchema, _ as getTimeOfDayGreeting, C as getToolConfigurationFromFormSchema, q as hasActiveToolConfig, t as hasAnnouncementContent, n as hasStructuredAnnouncement, J as isAnswerIncomplete, ie as isAwaitingGenerationResume, Y as isMessageChanged, w as isMessageStreaming, O as mapStages, re as mergeStages, T as messageHasStages, E as normalizeResponseFormat, r as sanitizeAnnouncementHtml, i as sanitizeAnnouncementMessageHtml, h as sanitizeFooterHtml, X as shouldRerunGenerationOnEdit, p as shouldWatchForDisplayNameUpdate, k as toStage, N as useActiveConversationSync, P as useAsyncConfirmDialog, B as useAttachmentUpload, oe as useChatSettingsFormConfig, te as useConversationHandlers, F as useConversationLookupMaps, L as useConversationPanelItems, ae as useConversationStream, R as useImportFilePicker, z as useMessageSelectionReply, se as useToolsMenu, U as useTranscribeAudio };
|
package/file-manager-canvas.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ export declare const annotationToOoxmlCanvasContent: (annotation: Annotation, an
|
|
|
21
21
|
/**
|
|
22
22
|
* Builds a `PdfCanvasContent` for a PDF citation annotation, including highlights
|
|
23
23
|
* for the clicked annotation's document within its citation group.
|
|
24
|
+
* When the clicked annotation has a page but no selector with valid geometry,
|
|
25
|
+
* an invisible page-anchor highlight is added and selected so the viewer
|
|
26
|
+
* still opens that page.
|
|
24
27
|
* Returns `null` if the annotation has no PDF source attachment.
|
|
25
28
|
*/
|
|
26
29
|
export declare const annotationToPdfCanvasContent: (annotation: Annotation, groups: AnnotationGroup[], resolvers: AttachmentCanvasUrlResolvers) => PdfCanvasContent | null;
|
|
@@ -37,6 +40,8 @@ export declare interface AttachmentCanvasUrlResolvers {
|
|
|
37
40
|
resolveDialUrl: (attachment: DisplayAttachment) => string | undefined;
|
|
38
41
|
/** Resolves a DIAL Core file id to a fetchable metadata URL (used for cache-freshness validation). */
|
|
39
42
|
resolveDialFileMetadataUrl: (fileId: string) => string | undefined;
|
|
43
|
+
/** URL of a host-served bootstrap document that renders HTML with no download URL (inline `data`) under its own response CSP instead of the embedding page's — forwarded as `HtmlCanvasContent.srcdocHostUrl`. When omitted, that HTML renders via plain `srcdoc`. */
|
|
44
|
+
htmlSrcdocHostUrl?: string;
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
/** The type of content the canvas can display. */
|
|
@@ -127,10 +132,16 @@ export declare const hasAttachmentTextSource: (attachment: DisplayAttachment, re
|
|
|
127
132
|
declare interface HtmlCanvasContent {
|
|
128
133
|
/** Discriminates the content type to select the correct renderer. */
|
|
129
134
|
type: AttachmentContentType.Html;
|
|
130
|
-
/** Full HTML text rendered via `srcdoc` in a sandboxed iframe.
|
|
135
|
+
/** Full HTML text rendered via `srcdoc` in a sandboxed iframe. Populated only when no `url` is available (local, non-downloadable file attachments); when `url` is set, "View source" instead calls `resolveSourceText`. */
|
|
131
136
|
srcdoc?: string;
|
|
132
|
-
/**
|
|
137
|
+
/** URL rendered via `src` in a sandboxed iframe when `srcdoc` is absent, or in preference to `srcdoc` when `isSameOriginUrl` is set. Also used as the download-button/"Open in new tab" target. */
|
|
133
138
|
url?: string;
|
|
139
|
+
/** True when `url`'s origin matches the embedding document's own origin. Forces the iframe sandbox to omit `allow-same-origin` — granting it would let a same-origin framed document reach this page's own cookies/storage — and makes `src` take precedence over `srcdoc`; also skips the `contentDocument` block-detection check, since the iframe is intentionally opaque-origin either way. */
|
|
140
|
+
isSameOriginUrl?: boolean;
|
|
141
|
+
/** Lazily fetches the full HTML source text for the "View source" toggle. Used instead of an eagerly-populated `srcdoc` when `url` is set; absent when `srcdoc` is already populated. */
|
|
142
|
+
resolveSourceText?: () => Promise<string>;
|
|
143
|
+
/** Host-served bootstrap document used to render `srcdoc` without inheriting the embedding page's CSP. When set alongside `srcdoc`, the iframe loads this URL via `src` (still `sandbox="allow-scripts"`) and posts `{ type: HTML_PREVIEW_FRAME_RENDER_MESSAGE, html: srcdoc }` to it once loaded, so the HTML renders under that response's own policy. Ignored when `srcdoc` is absent or `isSameOriginUrl` selects `url`. */
|
|
144
|
+
srcdocHostUrl?: string;
|
|
134
145
|
}
|
|
135
146
|
|
|
136
147
|
/** Content payload for image attachments. */
|
|
@@ -195,6 +206,16 @@ declare interface OoxmlDocxHighlightLocation {
|
|
|
195
206
|
text: string;
|
|
196
207
|
}
|
|
197
208
|
|
|
209
|
+
/** A complete table row in the DOCX body, matched by cell text. */
|
|
210
|
+
declare interface OoxmlDocxTableRowLocation {
|
|
211
|
+
/** Location kind. */
|
|
212
|
+
kind: OoxmlHighlightKind.DocxTableRow;
|
|
213
|
+
/** Plain text of each cell, in column order. */
|
|
214
|
+
cells: string[];
|
|
215
|
+
/** 1-based matching row in document order. */
|
|
216
|
+
occurrence: number;
|
|
217
|
+
}
|
|
218
|
+
|
|
198
219
|
/** Supported document formats rendered by the installed `@silurus/ooxml` runtime. */
|
|
199
220
|
declare enum OoxmlFileType {
|
|
200
221
|
Docx = 'docx',
|
|
@@ -217,6 +238,10 @@ declare enum OoxmlHighlightKind {
|
|
|
217
238
|
DocxTextRange = 'docxTextRange',
|
|
218
239
|
/** A character range inside a single PPTX shape on one slide. */
|
|
219
240
|
PptxTextRange = 'pptxTextRange',
|
|
241
|
+
/** A complete DOCX table row identified by its cell text. */
|
|
242
|
+
DocxTableRow = 'docxTableRow',
|
|
243
|
+
/** A complete PPTX table row identified by its cell text on one slide. */
|
|
244
|
+
PptxTableRow = 'pptxTableRow',
|
|
220
245
|
/** One cell, or a contiguous same-row cell range, on a named XLSX sheet. */
|
|
221
246
|
XlsxCellRange = 'xlsxCellRange',
|
|
222
247
|
}
|
|
@@ -225,6 +250,8 @@ declare enum OoxmlHighlightKind {
|
|
|
225
250
|
declare type OoxmlHighlightLocation =
|
|
226
251
|
| OoxmlDocxHighlightLocation
|
|
227
252
|
| OoxmlPptxHighlightLocation
|
|
253
|
+
| OoxmlDocxTableRowLocation
|
|
254
|
+
| OoxmlPptxTableRowLocation
|
|
228
255
|
| OoxmlXlsxHighlightLocation;
|
|
229
256
|
|
|
230
257
|
/** A cited character range inside a single shape on one PPTX slide. */
|
|
@@ -243,6 +270,18 @@ declare interface OoxmlPptxHighlightLocation {
|
|
|
243
270
|
text: string;
|
|
244
271
|
}
|
|
245
272
|
|
|
273
|
+
/** A complete table row on one PPTX slide, matched by cell text. */
|
|
274
|
+
declare interface OoxmlPptxTableRowLocation {
|
|
275
|
+
/** Location kind. */
|
|
276
|
+
kind: OoxmlHighlightKind.PptxTableRow;
|
|
277
|
+
/** Plain text of each cell, in column order. */
|
|
278
|
+
cells: string[];
|
|
279
|
+
/** 1-based matching row on the specified slide. */
|
|
280
|
+
occurrence: number;
|
|
281
|
+
/** 1-based slide number. */
|
|
282
|
+
slide: number;
|
|
283
|
+
}
|
|
284
|
+
|
|
246
285
|
/** A cited cell, or contiguous same-row cell range, on a named XLSX sheet. */
|
|
247
286
|
declare interface OoxmlXlsxHighlightLocation {
|
|
248
287
|
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
@@ -302,9 +341,18 @@ export declare const resolveGroupedVisualizerCanvasContent: (attachments: Displa
|
|
|
302
341
|
|
|
303
342
|
/**
|
|
304
343
|
* Resolves an HTML canvas content payload from a DisplayAttachment.
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
344
|
+
* When the attachment has a download URL, that URL is the primary render
|
|
345
|
+
* target so the preview loads via `src` and gets its own response-level CSP
|
|
346
|
+
* instead of inheriting the host document's — no HTML text is fetched up
|
|
347
|
+
* front; `resolveSourceText` fetches it lazily, only when the "View source"
|
|
348
|
+
* toggle is used, and rejects if that fetch fails. `isSameOriginUrl` reflects
|
|
349
|
+
* a real comparison against the embedding document's own origin.
|
|
350
|
+
* With no download URL (local file or inline data), falls back to `srcdoc`,
|
|
351
|
+
* rejecting payloads larger than 1 MiB to prevent browser truncation, and
|
|
352
|
+
* forwards `resolvers.htmlSrcdocHostUrl` so that HTML can still render under
|
|
353
|
+
* its own response-level CSP.
|
|
354
|
+
* Returns `null` if no source is available, or an `ErrorCanvasContent` when
|
|
355
|
+
* that fallback fetch fails.
|
|
308
356
|
*/
|
|
309
357
|
export declare const resolveHtmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<HtmlCanvasContent | ErrorCanvasContent | null>;
|
|
310
358
|
|
package/file-manager.d.ts
CHANGED
|
@@ -24,13 +24,16 @@ import { DiscardSharedItemDto } from '@epam/ai-dial-chat-api-client';
|
|
|
24
24
|
import { DiscardSharedResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
25
25
|
import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
|
|
26
26
|
import { FileManagerColumnKey } from '@epam/ai-dial-react-file-manager';
|
|
27
|
+
import { FileManagerSelectableNode } from '@epam/ai-dial-chat-shared';
|
|
27
28
|
import { FileMetadataResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
28
29
|
import { FilesApi } from '@epam/ai-dial-chat-api-client';
|
|
30
|
+
import { FileTreeOptions } from '@epam/ai-dial-react-file-manager';
|
|
29
31
|
import { FileUploadBatchState } from '@epam/ai-dial-chat-shared';
|
|
30
32
|
import { FileUploadEntry } from '@epam/ai-dial-chat-shared';
|
|
31
33
|
import { FileUploadResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
32
34
|
import { FileUploadStatus } from '@epam/ai-dial-chat-shared';
|
|
33
35
|
import { FileUploadValidationResult } from '@epam/ai-dial-chat-shared';
|
|
36
|
+
import { FilterChipItem } from '@epam/ai-dial-ui-kit';
|
|
34
37
|
import { getParentFolderPath } from '@epam/ai-dial-chat-shared';
|
|
35
38
|
import { ListFilesItemDto } from '@epam/ai-dial-chat-api-client';
|
|
36
39
|
import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
@@ -44,8 +47,6 @@ import { RenameFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
|
44
47
|
import { RenameItemDto } from '@epam/ai-dial-chat-api-client';
|
|
45
48
|
import { RevokeAccessItemDto } from '@epam/ai-dial-chat-api-client';
|
|
46
49
|
import { RevokeAccessResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
47
|
-
import { TabModel } from '@epam/ai-dial-ui-kit';
|
|
48
|
-
import { ToolbarOptions } from '@epam/ai-dial-react-file-manager';
|
|
49
50
|
import { UploadArchiveResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
50
51
|
import { useGridEditingScroll } from '@epam/ai-dial-chat-shared';
|
|
51
52
|
import { UseGridEditingScrollOptions } from '@epam/ai-dial-chat-shared';
|
|
@@ -122,11 +123,22 @@ export declare const DATE_OPTIONS: Intl.DateTimeFormatOptions;
|
|
|
122
123
|
|
|
123
124
|
export declare const deriveActionProfile: (variant: DialFileManagerVariant) => DialFileManagerActionProfile;
|
|
124
125
|
|
|
126
|
+
/** Source tabs `useDialFileManagerSections` can merge into the All tab, in display order. */
|
|
127
|
+
export declare const DIAL_FILE_MANAGER_SECTION_TABS: readonly DialFileManagerTabs[];
|
|
128
|
+
|
|
125
129
|
/** Strip the "files/{bucket}/" prefix from a DIAL Core URL to get the path within the bucket. */
|
|
126
130
|
export declare const dialCorePathToRelative: (dialCorePath: string, bucket: string) => string;
|
|
127
131
|
|
|
128
132
|
export { DialFileManagerActionProfile }
|
|
129
133
|
|
|
134
|
+
/** One source tab rendered as a top-level folder of the All view. */
|
|
135
|
+
export declare interface DialFileManagerSection {
|
|
136
|
+
/** Source tab backing this section — `MyFiles`, `Shared` or `Organization`. */
|
|
137
|
+
tab: DialFileManagerTabs;
|
|
138
|
+
/** Display name of the section's top-level folder; also the first segment of its virtual paths. An empty, slash-containing or repeated label is replaced by the tab id. */
|
|
139
|
+
rootLabel: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
130
142
|
export { DialFileManagerVariant }
|
|
131
143
|
|
|
132
144
|
/**
|
|
@@ -343,7 +355,9 @@ export declare enum FileManagerNotificationReason {
|
|
|
343
355
|
/** `onUploadArchive` extracted some entries successfully and some failed; `count`/`names`/`restCount` describe the failures. */
|
|
344
356
|
UploadArchivePartiallyFailed = "uploadArchivePartiallyFailed",
|
|
345
357
|
/** `onUploadArchive`'s `uploadArchive` request itself rejected. */
|
|
346
|
-
UploadArchiveRequestFailed = "uploadArchiveRequestFailed"
|
|
358
|
+
UploadArchiveRequestFailed = "uploadArchiveRequestFailed",
|
|
359
|
+
/** A copy/move targeted a destination in a different All-view section from its source items; no request was made. */
|
|
360
|
+
CrossSectionTransferUnsupported = "crossSectionTransferUnsupported"
|
|
347
361
|
}
|
|
348
362
|
|
|
349
363
|
/**
|
|
@@ -364,8 +378,6 @@ export declare type FileNameValidationError = {
|
|
|
364
378
|
} | {
|
|
365
379
|
reason: FileNameValidationErrorReason.DuplicateName;
|
|
366
380
|
existingName: string;
|
|
367
|
-
} | {
|
|
368
|
-
reason: FileNameValidationErrorReason.LeadingDot;
|
|
369
381
|
};
|
|
370
382
|
|
|
371
383
|
/**
|
|
@@ -378,8 +390,7 @@ export declare enum FileNameValidationErrorReason {
|
|
|
378
390
|
ForbiddenSymbols = "forbiddenSymbols",
|
|
379
391
|
ReservedName = "reservedName",
|
|
380
392
|
TooLong = "tooLong",
|
|
381
|
-
DuplicateName = "duplicateName"
|
|
382
|
-
LeadingDot = "leadingDot"
|
|
393
|
+
DuplicateName = "duplicateName"
|
|
383
394
|
}
|
|
384
395
|
|
|
385
396
|
/**
|
|
@@ -396,7 +407,10 @@ export declare enum FileOperationKind {
|
|
|
396
407
|
FileCopied = "fileCopied",
|
|
397
408
|
FilesCopied = "filesCopied",
|
|
398
409
|
FileMoved = "fileMoved",
|
|
399
|
-
FilesMoved = "filesMoved"
|
|
410
|
+
FilesMoved = "filesMoved",
|
|
411
|
+
/** A copy whose every item landed in its own source folder (Duplicate). */
|
|
412
|
+
FileDuplicated = "fileDuplicated",
|
|
413
|
+
FilesDuplicated = "filesDuplicated"
|
|
400
414
|
}
|
|
401
415
|
|
|
402
416
|
/**
|
|
@@ -411,13 +425,15 @@ export declare interface FileOperationSuccessEvent {
|
|
|
411
425
|
name?: string;
|
|
412
426
|
/** Number of items the operation covered, when applicable. */
|
|
413
427
|
count?: number;
|
|
414
|
-
/**
|
|
428
|
+
/**
|
|
429
|
+
* Destination folder as a slash-joined virtual path starting at the root
|
|
430
|
+
* label (e.g. `My files/reports`), for copy/move/duplicate operations.
|
|
431
|
+
*/
|
|
415
432
|
destinationFolderName?: string;
|
|
416
433
|
/**
|
|
417
|
-
* Whether the affected item is a folder rather than a file.
|
|
418
|
-
*
|
|
419
|
-
*
|
|
420
|
-
* "File renamed").
|
|
434
|
+
* Whether the affected item is a folder rather than a file. Set for rename,
|
|
435
|
+
* copy, move, and duplicate events; on a multi-item event it describes the
|
|
436
|
+
* first successfully affected item (the one `name` refers to).
|
|
421
437
|
*/
|
|
422
438
|
isFolder?: boolean;
|
|
423
439
|
}
|
|
@@ -488,6 +504,9 @@ export declare const hasDialFileWritePermission: (folder?: DialFile) => boolean;
|
|
|
488
504
|
|
|
489
505
|
export declare const hasForbiddenNameSymbols: (name: string, forbiddenSymbolsRegExp?: RegExp) => boolean;
|
|
490
506
|
|
|
507
|
+
/** Returns `true` when both sets contain exactly the same paths. */
|
|
508
|
+
export declare const hasSamePaths: (a: ReadonlySet<string>, b: ReadonlySet<string>) => boolean;
|
|
509
|
+
|
|
491
510
|
/** Copy/Move/Duplicate are Browse/Full-only — the attach picker excludes them. */
|
|
492
511
|
export declare const isCopyMoveDuplicateAllowed: (actionProfile: DialFileManagerActionProfile) => boolean;
|
|
493
512
|
|
|
@@ -521,7 +540,14 @@ export declare const mergeCreatedFolderIntoCache: (cache: Map<string, ListFilesI
|
|
|
521
540
|
/** Formats MIME types as a human-readable, comma-separated list of dotted extensions (or the MIME type itself for wildcards). */
|
|
522
541
|
export declare const mimeTypesToAttachmentExtensionLabels: (types: string[]) => string;
|
|
523
542
|
|
|
524
|
-
/**
|
|
543
|
+
/**
|
|
544
|
+
* Normalizes `*` to the all-files wildcard, canonicalizes MIME aliases, and drops
|
|
545
|
+
* any value that is not a valid `DialFileAcceptType`.
|
|
546
|
+
*
|
|
547
|
+
* Aliases are resolved because a file picker matches an `accept` entry against its
|
|
548
|
+
* own MIME table: a declared `text/json` offers no `.json` file, while the
|
|
549
|
+
* `application/json` it denotes does.
|
|
550
|
+
*/
|
|
525
551
|
export declare const mimeTypesToDialFileAcceptTypes: (types?: string[]) => DialFileAcceptType[] | undefined;
|
|
526
552
|
|
|
527
553
|
/**
|
|
@@ -626,6 +652,9 @@ export declare const resolveOwnerCoords: (apiPath: string, sharedRootMeta: Map<s
|
|
|
626
652
|
*/
|
|
627
653
|
export declare const resolveRelativeDialFilePath: (pathOrFileId: string, bucket: string) => string;
|
|
628
654
|
|
|
655
|
+
/** Returns the section whose root label is the first segment of `virtualPath`, or `undefined` when none matches. */
|
|
656
|
+
export declare const resolveSectionByPath: <TSection extends DialFileManagerSection>(virtualPath: string, sections: readonly TSection[]) => TSection | undefined;
|
|
657
|
+
|
|
629
658
|
/**
|
|
630
659
|
* Sanitizes a filename for upload by replacing forbidden characters with `_`,
|
|
631
660
|
* trimming trailing dots/whitespace from the base name, and capping the result
|
|
@@ -654,7 +683,10 @@ export declare const splitFileNameExtension: (fileName: string) => {
|
|
|
654
683
|
|
|
655
684
|
export declare const trimFileNameToByteLimit: (name: string, limit?: number) => string;
|
|
656
685
|
|
|
657
|
-
|
|
686
|
+
/** Returns a new set containing every path from each of `pathSets`. */
|
|
687
|
+
export declare const unionPathSets: (pathSets: readonly ReadonlySet<string>[]) => Set<string>;
|
|
688
|
+
|
|
689
|
+
export declare const updateEntry: (prev: FileUploadBatchState | null, id: string, patch: FileUploadStatus | Partial<Pick<FileUploadEntry, "status" | "percent">>) => FileUploadBatchState | null;
|
|
658
690
|
|
|
659
691
|
/** Max number of files uploaded concurrently within a single upload batch. */
|
|
660
692
|
export declare const UPLOAD_CONCURRENCY = 3;
|
|
@@ -690,7 +722,7 @@ export declare type UploadMode = 'overwrite' | 'create-only';
|
|
|
690
722
|
* - shared: files shared with the user via `DialFilesApi.listSharedFiles`
|
|
691
723
|
* - organization: public bucket via `DialFilesApi.listPublicFiles`
|
|
692
724
|
*/
|
|
693
|
-
export declare const useDialFileListing: ({ filesApi, bucket, rootLabel, activeTab, onNotification, }: UseDialFileListingOptions) => UseDialFileListingResult;
|
|
725
|
+
export declare const useDialFileListing: ({ filesApi, bucket, rootLabel, activeTab, onNotification, isActive, sessionKey, }: UseDialFileListingOptions) => UseDialFileListingResult;
|
|
694
726
|
|
|
695
727
|
/** Options accepted by `useDialFileListing`. */
|
|
696
728
|
export declare interface UseDialFileListingOptions {
|
|
@@ -704,6 +736,10 @@ export declare interface UseDialFileListingOptions {
|
|
|
704
736
|
activeTab: DialFileManagerTabs;
|
|
705
737
|
/** Called with a structured event when a folder-load operation fails. */
|
|
706
738
|
onNotification?: (notification: FileManagerNotification) => void;
|
|
739
|
+
/** When false, the hook issues no `DialFilesApi` call and reports `isLoading: false`. Defaults to `true`. */
|
|
740
|
+
isActive?: boolean;
|
|
741
|
+
/** Changing this value resets cache and navigation exactly like an `activeTab` change. Defaults to `undefined`. */
|
|
742
|
+
sessionKey?: string;
|
|
707
743
|
}
|
|
708
744
|
|
|
709
745
|
/** Values returned by `useDialFileListing`. */
|
|
@@ -760,7 +796,7 @@ export declare interface UseDialFileListingResult {
|
|
|
760
796
|
* every translated string reaches it through `labels`,
|
|
761
797
|
* `disabledNewButtonTooltip`, and `buildValidationErrorMessage`.
|
|
762
798
|
*/
|
|
763
|
-
export declare const useDialFileManager: ({ filesApi, bucket, rootLabel, activeTab, onNotification, onOperationSuccess, forbiddenSymbolsRegExp, variant, actionProfile, labels, locale, disabledNewButtonTooltip, downloadDestination, buildValidationErrorMessage, }: UseDialFileManagerOptions) => UseDialFileManagerResult;
|
|
799
|
+
export declare const useDialFileManager: ({ filesApi, bucket, rootLabel, activeTab, isActive, sessionKey, onNotification, onOperationSuccess, forbiddenSymbolsRegExp, variant, actionProfile, labels, locale, disabledNewButtonTooltip, downloadDestination, buildValidationErrorMessage, }: UseDialFileManagerOptions) => UseDialFileManagerResult;
|
|
764
800
|
|
|
765
801
|
export declare interface UseDialFileManagerOptions {
|
|
766
802
|
/** Injected operation port used for every file-manager network call. */
|
|
@@ -771,6 +807,10 @@ export declare interface UseDialFileManagerOptions {
|
|
|
771
807
|
rootLabel?: string;
|
|
772
808
|
/** Active tab — drives listing source and per-tab options. Defaults to MyFiles. */
|
|
773
809
|
activeTab?: DialFileManagerTabs;
|
|
810
|
+
/** When false, the listing issues no `DialFilesApi` call and reports `isLoading: false`. Defaults to `true`. */
|
|
811
|
+
isActive?: boolean;
|
|
812
|
+
/** Changing this value resets cache and navigation exactly like an `activeTab` change. Defaults to `undefined`. */
|
|
813
|
+
sessionKey?: string;
|
|
774
814
|
/** Called when a file-manager action should surface a toast notification. */
|
|
775
815
|
onNotification?: (notification: FileManagerNotification) => void;
|
|
776
816
|
/** Called when a mutation succeeds, instead of invoking an application notification service directly. */
|
|
@@ -825,7 +865,7 @@ export declare interface UseDialFileManagerResult {
|
|
|
825
865
|
onSearchFiles: (folder: string, query: string) => void;
|
|
826
866
|
/** Search: true while a search request is in flight. */
|
|
827
867
|
isSearching: boolean;
|
|
828
|
-
/** Search: flat
|
|
868
|
+
/** Search: flat, unfiltered recursive listing of the current folder, or null when search is not active. */
|
|
829
869
|
searchResults: DialFile[] | null;
|
|
830
870
|
/** Search: clears results and exits search mode. */
|
|
831
871
|
clearSearchResults: () => void;
|
|
@@ -849,7 +889,9 @@ export declare interface UseDialFileManagerResult {
|
|
|
849
889
|
uploadBatchState: FileUploadBatchState | null;
|
|
850
890
|
/** Upload: abort all in-flight and queued uploads. */
|
|
851
891
|
cancelUpload: () => void;
|
|
852
|
-
/** Upload:
|
|
892
|
+
/** Upload: abort one queued or in-flight upload by its entry id. */
|
|
893
|
+
cancelUploadFile: (id: string) => void;
|
|
894
|
+
/** Upload: empty the upload queue. */
|
|
853
895
|
clearUploadBatch: () => void;
|
|
854
896
|
/** Folder creation: called when user confirms a new folder name. */
|
|
855
897
|
onCreateFolder: (file: DialUploadFileItem, folderPath: string, fileId: string) => Promise<void>;
|
|
@@ -916,7 +958,7 @@ export declare interface UseDialFileManagerResult {
|
|
|
916
958
|
/**
|
|
917
959
|
* True while any mutating file-manager operation is in flight: the OR of
|
|
918
960
|
* `isCreatingFolder`, `isDownloading`, `isDeleting`, `isRenaming`, `isCopying`,
|
|
919
|
-
* `isMoving`, `isUnsharing`, `isRemovingAccess`, and
|
|
961
|
+
* `isMoving`, `isUnsharing`, `isRemovingAccess`, and any upload still queued or running.
|
|
920
962
|
*
|
|
921
963
|
* Deliberately excludes three flags, each already fully contained by its own
|
|
922
964
|
* scoped loading UI:
|
|
@@ -927,17 +969,42 @@ export declare interface UseDialFileManagerResult {
|
|
|
927
969
|
isAnyOperationInProgress: boolean;
|
|
928
970
|
}
|
|
929
971
|
|
|
972
|
+
/**
|
|
973
|
+
* Composes one `useDialFileManager` per source tab (My files, Shared,
|
|
974
|
+
* Organization) so the File storage page can offer an All tab without a
|
|
975
|
+
* second copy of the per-tab rules. On a single tab it returns that section's
|
|
976
|
+
* result; on All it merges the section roots into one tree and routes every
|
|
977
|
+
* callback to the section owning the path. Section availability and names
|
|
978
|
+
* arrive through `sections` — the hook reads no config, i18n, or context.
|
|
979
|
+
*/
|
|
980
|
+
export declare const useDialFileManagerSections: ({ activeTab, sections, ...managerOptions }: UseDialFileManagerSectionsOptions) => UseDialFileManagerSectionsResult;
|
|
981
|
+
|
|
982
|
+
/** Options accepted by `useDialFileManagerSections`. */
|
|
983
|
+
export declare interface UseDialFileManagerSectionsOptions extends Omit<UseDialFileManagerOptions, 'activeTab' | 'rootLabel' | 'isActive' | 'sessionKey'> {
|
|
984
|
+
/** Active tab, including `DialFileManagerTabs.All`. */
|
|
985
|
+
activeTab: DialFileManagerTabs;
|
|
986
|
+
/** Enabled source tabs in display order, each with its translated top-level folder name. */
|
|
987
|
+
sections: DialFileManagerSection[];
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
/** Values returned by `useDialFileManagerSections`. */
|
|
991
|
+
export declare interface UseDialFileManagerSectionsResult extends UseDialFileManagerResult {
|
|
992
|
+
/** Source tab of the browsed folder; never `DialFileManagerTabs.All`. */
|
|
993
|
+
sectionTab: DialFileManagerTabs;
|
|
994
|
+
}
|
|
995
|
+
|
|
930
996
|
/**
|
|
931
997
|
* Filters the file-manager's tab list down to the host's configured set and
|
|
932
998
|
* resets `activeTab` to the highest-priority still-enabled tab when the
|
|
933
999
|
* current one becomes excluded. A `fileManagerTabs` of `undefined` means no
|
|
934
1000
|
* restriction — every tab in `allTabs` stays enabled and no reset ever fires.
|
|
1001
|
+
* The All tab is kept only while at least two source tabs are enabled.
|
|
935
1002
|
*/
|
|
936
|
-
export declare const useDialFileManagerTabConfig: (activeTab: DialFileManagerTabs, onTabChange: (tab: DialFileManagerTabs) => void, allTabs:
|
|
1003
|
+
export declare const useDialFileManagerTabConfig: (activeTab: DialFileManagerTabs, onTabChange: (tab: DialFileManagerTabs) => void, allTabs: FilterChipItem<DialFileManagerTabs>[] | undefined, fileManagerTabs: string[] | undefined) => UseDialFileManagerTabConfigResult;
|
|
937
1004
|
|
|
938
1005
|
/** Values returned by `useDialFileManagerTabConfig`. */
|
|
939
1006
|
export declare interface UseDialFileManagerTabConfigResult {
|
|
940
|
-
tabs:
|
|
1007
|
+
tabs: FileTreeOptions['tabs'];
|
|
941
1008
|
}
|
|
942
1009
|
|
|
943
1010
|
/**
|
|
@@ -1062,10 +1129,11 @@ export declare interface UseDialFileSharingResult {
|
|
|
1062
1129
|
|
|
1063
1130
|
/**
|
|
1064
1131
|
* Manages upload batches (single-file and ZIP-archive extraction), including
|
|
1065
|
-
* concurrency-limited progress tracking and abort.
|
|
1066
|
-
*
|
|
1067
|
-
* `
|
|
1068
|
-
* cache
|
|
1132
|
+
* concurrency-limited progress tracking and per-file abort. A batch started
|
|
1133
|
+
* while another is on screen is appended to it, and settled entries stay in
|
|
1134
|
+
* `uploadBatchState` until `clearUploadBatch`. Invalidates the shared listing
|
|
1135
|
+
* cache for the destination folder through `invalidateFolders`/`bumpRetry`
|
|
1136
|
+
* after a batch settles — it never holds its own copy of the cache.
|
|
1069
1137
|
*/
|
|
1070
1138
|
export declare const useDialFileUploadBatch: ({ filesApi, bucket, rootLabel, activeTab, cache, sharedRootMetaRef, invalidateFolders, bumpRetry, onNotification, }: UseDialFileUploadBatchOptions) => UseDialFileUploadBatchResult;
|
|
1071
1139
|
|
|
@@ -1098,9 +1166,68 @@ export declare interface UseDialFileUploadBatchResult {
|
|
|
1098
1166
|
onValidateUpload: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => Promise<FileUploadValidationResult>;
|
|
1099
1167
|
uploadBatchState: FileUploadBatchState | null;
|
|
1100
1168
|
cancelUpload: () => void;
|
|
1169
|
+
cancelUploadFile: (id: string) => void;
|
|
1101
1170
|
clearUploadBatch: () => void;
|
|
1102
1171
|
}
|
|
1103
1172
|
|
|
1173
|
+
/**
|
|
1174
|
+
* Composes the file-manager tab/listing hooks into the stateful part of an attachment picker:
|
|
1175
|
+
* active tab, selected paths, and hidden-path/MIME/size/folder row eligibility. Returns the
|
|
1176
|
+
* existing `useDialFileManager` controller unchanged and the selection/tab/eligibility fields
|
|
1177
|
+
* `FileManagerAttachModal` already consumes — it composes that modal, it does not replace it.
|
|
1178
|
+
* Final attachment filtering, deduplication, and count enforcement stay owned by the modal.
|
|
1179
|
+
*/
|
|
1180
|
+
export declare const useFileAttachmentPicker: ({ fileManagerOptions, bucket, forbiddenSymbolsRegExp, tabLabels, allowedTabs, initialTab, allowedTypes, maxSelectableFileSize, canAttachFolders, }: UseFileAttachmentPickerOptions) => UseFileAttachmentPickerResult;
|
|
1181
|
+
|
|
1182
|
+
/** Options accepted by {@link useFileAttachmentPicker}. */
|
|
1183
|
+
export declare interface UseFileAttachmentPickerOptions {
|
|
1184
|
+
/**
|
|
1185
|
+
* Configured `useDialFileManager` options besides the values this hook derives:
|
|
1186
|
+
* `bucket`, `activeTab`, `rootLabel`, `variant`, and `forbiddenSymbolsRegExp`.
|
|
1187
|
+
*/
|
|
1188
|
+
fileManagerOptions: Omit<UseDialFileManagerOptions, 'bucket' | 'activeTab' | 'rootLabel' | 'variant' | 'forbiddenSymbolsRegExp'>;
|
|
1189
|
+
/** DIAL Core bucket to browse. */
|
|
1190
|
+
bucket: string;
|
|
1191
|
+
/** Regexp of characters forbidden in file/folder names, forwarded to `useDialFileManager`. */
|
|
1192
|
+
forbiddenSymbolsRegExp?: RegExp;
|
|
1193
|
+
/** Host-translated label per tab; also supplies the active tab's root-folder label. */
|
|
1194
|
+
tabLabels: Record<DialFileManagerTabs, string>;
|
|
1195
|
+
/** Tab ids the host's configuration allows. `undefined` allows every tab. */
|
|
1196
|
+
allowedTabs?: string[];
|
|
1197
|
+
/** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`. */
|
|
1198
|
+
initialTab?: DialFileManagerTabs;
|
|
1199
|
+
/** MIME types eligible for selection/upload. Empty or absent allows every type. */
|
|
1200
|
+
allowedTypes?: string[];
|
|
1201
|
+
/** Files at or below this size (bytes) remain eligible; absent allows any size. */
|
|
1202
|
+
maxSelectableFileSize?: number;
|
|
1203
|
+
/** Whether folder rows are eligible for selection. Defaults to `false`. */
|
|
1204
|
+
canAttachFolders?: boolean;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
/** Result returned by {@link useFileAttachmentPicker}. */
|
|
1208
|
+
export declare interface UseFileAttachmentPickerResult {
|
|
1209
|
+
/** The composed file-manager controller; forward to `FileManagerAttachModal`'s `controller` prop. */
|
|
1210
|
+
controller: UseDialFileManagerResult;
|
|
1211
|
+
/** Active tab. */
|
|
1212
|
+
activeTab: DialFileManagerTabs;
|
|
1213
|
+
/** Tab list filtered to `allowedTabs`; forward to `FileManagerAttachModal`'s `tabs` prop. */
|
|
1214
|
+
tabs: FileTreeOptions['tabs'];
|
|
1215
|
+
/** Switches the active tab and clears the current selection. */
|
|
1216
|
+
onTabChange: (tab: DialFileManagerTabs) => void;
|
|
1217
|
+
/** Currently selected paths. */
|
|
1218
|
+
selectedPaths: Set<string>;
|
|
1219
|
+
/** Replaces the selection with a defensive copy of the given set. */
|
|
1220
|
+
onSelectedPathsChange: (paths: Set<string>) => void;
|
|
1221
|
+
/** Row eligibility predicate; forward to `FileManagerAttachModal`'s `isRowSelectable` prop. */
|
|
1222
|
+
isRowSelectable: (node: {
|
|
1223
|
+
data?: FileManagerSelectableNode | null;
|
|
1224
|
+
}) => boolean;
|
|
1225
|
+
/** MIME eligibility predicate; forward to `FileManagerAttachModal`'s `isFileTypeAllowed` prop. */
|
|
1226
|
+
isFileTypeAllowed: (contentType: string) => boolean;
|
|
1227
|
+
/** Accepted upload MIME types; forward to `FileManagerAttachModal`'s `allowedFileTypes` prop. */
|
|
1228
|
+
allowedFileTypes: DialFileAcceptType[] | undefined;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1104
1231
|
export { useGridEditingScroll }
|
|
1105
1232
|
|
|
1106
1233
|
export { UseGridEditingScrollOptions }
|
|
@@ -1113,4 +1240,7 @@ export { UseGridEditingScrollResult }
|
|
|
1113
1240
|
*/
|
|
1114
1241
|
export declare const virtualPathToApiPath: (virtualPath: string, rootLabel: string) => string;
|
|
1115
1242
|
|
|
1243
|
+
/** Returns `sections` with every root label usable as a unique first path segment, falling back to the tab id. */
|
|
1244
|
+
export declare const withRoutableRootLabels: <TSection extends DialFileManagerSection>(sections: readonly TSection[]) => TSection[];
|
|
1245
|
+
|
|
1116
1246
|
export { }
|
package/file-manager.js
CHANGED
|
@@ -3,26 +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 { DialFileManagerActionProfile as
|
|
8
|
-
import { buildSharedItemVirtualPath as
|
|
9
|
-
import { getParentFolderPath as
|
|
10
|
-
import { prepareCopyItems as
|
|
11
|
-
import { buildFromCache as
|
|
12
|
-
import { createFilesApiClient as
|
|
13
|
-
import { createUploadFileWithProgress as
|
|
14
|
-
import { openAnnotationAttachment as
|
|
15
|
-
import { getUrlFileName as
|
|
16
|
-
import { annotationToDisplayAttachment as
|
|
17
|
-
import { dialFileToAttachment as
|
|
18
|
-
import { DownloadDestinationType as
|
|
19
|
-
import { prepareDownloadDestination 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 {
|
|
27
|
-
import {
|
|
28
|
-
|
|
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 { DialFileManagerActionProfile as S, DialFileManagerVariant as C, deriveActionProfile as w } from "./files/file-manager-variant.js";
|
|
8
|
+
import { buildSharedItemVirtualPath as T, dialCorePathToRelative as E, findDialFileByPath as D, findFolderByVirtualPath as O, formatOperationFolderName as k, getVirtualPathName as A, hasDialFileWritePermission as j, hasForbiddenNameSymbols as M, hasSamePaths as N, isCopyMoveDuplicateAllowed as P, isShareActionsAllowed as F, normalizeVirtualPath as I, parseNewFolderVirtualPath as L, resolveOwnerCoords as R, resolveSectionByPath as z, unionPathSets as B, withRoutableRootLabels as V } from "./files/dial-file-manager-path.util.js";
|
|
9
|
+
import { getParentFolderPath as H, resolveDialFileApiPath as U, virtualPathToApiPath as W } from "./files/resolve-dial-file-api-path.js";
|
|
10
|
+
import { prepareCopyItems as G, prepareMoveRenameItems as K } from "./files/dial-file-manager-copy-move.util.js";
|
|
11
|
+
import { buildFromCache as q, fetchByTab as J, fetchForSearch as Y, findFirstSuccessfulCopyMoveItem as X, mapCorePermissions as Z, mapFileMetadataToDialFile as Q, mapSearchItem as $, mergeCreatedFolderIntoCache as ee, updateEntry as te } from "./files/dial-file-manager-mapping.util.js";
|
|
12
|
+
import { createFilesApiClient as ne } from "./files/create-files-api.js";
|
|
13
|
+
import { createUploadFileWithProgress as re } from "./files/create-upload-file-with-progress.js";
|
|
14
|
+
import { openAnnotationAttachment as ie } from "./files/annotation.js";
|
|
15
|
+
import { getUrlFileName as ae, isExternalSourcePreviewable as oe, resolveExternalSourceContentType as se } from "./files/source-content.js";
|
|
16
|
+
import { annotationToDisplayAttachment as ce, attachmentDtoToDisplayAttachment as le, attachmentDtosToDisplayAttachments as ue } from "./files/attachment-dto-to-display.js";
|
|
17
|
+
import { dialFileToAttachment as de, dialFilesToAttachments as fe, dialFolderPathToAttachment as pe } from "./files/dial-file-to-attachment.js";
|
|
18
|
+
import { DownloadDestinationType as me } from "./files/download-destination.js";
|
|
19
|
+
import { prepareDownloadDestination as he } from "./files/prepare-download-destination.js";
|
|
20
|
+
import { useDialFileListing as ge } from "./files/useDialFileListing/useDialFileListing.js";
|
|
21
|
+
import { useDialFileMetadata as _e } from "./files/useDialFileMetadata/useDialFileMetadata.js";
|
|
22
|
+
import { useDialFileMutations as ve } from "./files/useDialFileMutations/useDialFileMutations.js";
|
|
23
|
+
import { useDialFileSharing as ye } from "./files/useDialFileSharing/useDialFileSharing.js";
|
|
24
|
+
import { useDialFileUploadBatch as be } from "./files/useDialFileUploadBatch/useDialFileUploadBatch.js";
|
|
25
|
+
import { useDialFileManager as xe } from "./files/useDialFileManager/useDialFileManager.js";
|
|
26
|
+
import { useDialFileManagerSections as Se } from "./files/useDialFileManagerSections/useDialFileManagerSections.js";
|
|
27
|
+
import { useDialFileManagerTabConfig as Ce } from "./files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
28
|
+
import { useFileAttachmentPicker as we } from "./files/useFileAttachmentPicker/useFileAttachmentPicker.js";
|
|
29
|
+
import { useGridEditingScroll as Te } 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, S as DialFileManagerActionProfile, C as DialFileManagerVariant, u as DialFilesApiUploadMode, me 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, ce as annotationToDisplayAttachment, le as attachmentDtoToDisplayAttachment, ue as attachmentDtosToDisplayAttachments, q as buildFromCache, T as buildSharedItemVirtualPath, ne as createFilesApiClient, re as createUploadFileWithProgress, w as deriveActionProfile, E as dialCorePathToRelative, de as dialFileToAttachment, fe as dialFilesToAttachments, pe as dialFolderPathToAttachment, J as fetchByTab, Y as fetchForSearch, D as findDialFileByPath, X as findFirstSuccessfulCopyMoveItem, O as findFolderByVirtualPath, k as formatOperationFolderName, H as getParentFolderPath, ae as getUrlFileName, A as getVirtualPathName, j as hasDialFileWritePermission, M as hasForbiddenNameSymbols, N as hasSamePaths, P as isCopyMoveDuplicateAllowed, r as isDialFileAcceptType, e as isDialFileId, oe as isExternalSourcePreviewable, F as isShareActionsAllowed, Z as mapCorePermissions, Q as mapFileMetadataToDialFile, $ as mapSearchItem, ee as mergeCreatedFolderIntoCache, i as mimeTypesToAttachmentExtensionLabels, a as mimeTypesToDialFileAcceptTypes, o as mimeTypesToFileAccept, I as normalizeVirtualPath, ie as openAnnotationAttachment, L as parseNewFolderVirtualPath, G as prepareCopyItems, he as prepareDownloadDestination, K as prepareMoveRenameItems, U as resolveDialFileApiPath, t as resolveDialFileBucketAndPath, se as resolveExternalSourceContentType, R as resolveOwnerCoords, n as resolveRelativeDialFilePath, z as resolveSectionByPath, s as sanitizeFileName, c as splitFileNameExtension, l as trimFileNameToByteLimit, B as unionPathSets, te as updateEntry, ge as useDialFileListing, xe as useDialFileManager, Se as useDialFileManagerSections, Ce as useDialFileManagerTabConfig, _e as useDialFileMetadata, ve as useDialFileMutations, ye as useDialFileSharing, be as useDialFileUploadBatch, we as useFileAttachmentPicker, Te as useGridEditingScroll, W as virtualPathToApiPath, V as withRoutableRootLabels };
|