@epam/ai-dial-chat-shared 1.1.0-dev.99 → 1.2.0-dev.1
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/components/CopyButton/CopyButton.js +33 -0
- package/components/DeploymentIcon/DeploymentIcon.js +62 -0
- package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -0
- package/components/EntityHeader/EntityHeader.js +48 -0
- package/components/EntityTypeLabel/EntityTypeLabel.js +10 -0
- package/components/FeaturedChip/FeaturedChip.js +18 -0
- package/components/InitialsAvatar/InitialsAvatar.js +29 -0
- package/components/InitialsAvatar/InitialsAvatar.module.scss.js +6 -0
- package/components/ItemHeader/ItemHeader.js +35 -0
- package/components/ItemHeader/ItemHeader.module.scss.js +6 -0
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +104 -0
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +10 -0
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.js +69 -0
- package/components/MarkdownRenderer/MDMessageViewer.js +22 -0
- package/components/MarkdownRenderer/MarkdownRenderer.js +280 -0
- package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +11 -0
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +24 -0
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +6 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.js +77 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +15 -0
- package/components/MarkdownRenderer/Table/TableHeader.js +30 -0
- package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -0
- package/components/MarkdownRenderer/Table/table-serialization.js +6 -0
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +66 -0
- package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.js +12 -0
- package/components/MarkdownRenderer/markdown-class-names.js +23 -0
- package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js +18 -0
- package/components/PanelEmptyState/PanelEmptyState.js +17 -0
- package/components/PanelEmptyState/PanelEmptyState.module.scss.js +3 -0
- package/components/ResourceSummary/ResourceSummary.js +34 -0
- package/components/ResourceSummary/ResourceSummary.module.scss.js +6 -0
- package/constants/breakpoint.js +4 -0
- package/constants/dial.js +4 -0
- package/constants/entity-colors.js +17 -0
- package/constants/icon.js +13 -0
- package/constants/markdown-editor.js +4 -0
- package/constants/mime-types.js +99 -0
- package/constants/resizable-fields.js +4 -0
- package/constants/select-list.js +4 -0
- package/constants/tag-input.js +4 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +299 -0
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +108 -0
- package/file-manager/OperationLoaderModal/OperationLoaderModal.js +36 -0
- package/file-manager/UploadProgressModal/UploadProgressModal.js +56 -0
- package/file-manager/file-manager-variant.js +8 -0
- package/file-manager/path.js +7 -0
- package/file-manager/upload-batch.js +6 -0
- package/file-manager/useGridEditingScroll/useGridEditingScroll.js +45 -0
- package/file-manager.d.ts +491 -0
- package/file-manager.js +3 -0
- package/hooks/useAvailableHeightCap.js +36 -0
- package/hooks/useCodeCopy.js +20 -0
- package/hooks/useCollapsedText.js +38 -0
- package/hooks/useHorizontalOverflow.js +25 -0
- package/hooks/useIsMobile.js +13 -0
- package/hooks/useStreamedMarkdownContent.js +32 -0
- package/index.css +1 -1
- package/index.d.ts +2505 -43
- package/index.js +64 -49151
- package/markdown.d.ts +401 -0
- package/markdown.js +11 -0
- package/models/chat.js +14 -0
- package/models/conversation-classification.js +6 -0
- package/models/conversation-transfer.js +14 -0
- package/models/deployment-features.js +6 -0
- package/package.json +43 -12
- package/types/attachment.js +8 -0
- package/types/code-editor.js +6 -0
- package/types/entity-type.js +6 -0
- package/types/mime-type.js +8 -0
- package/utils/annotation.js +120 -0
- package/utils/avatar-color.js +37 -0
- package/utils/build-css-vars.js +8 -0
- package/utils/copy-to-clipboard.js +69 -0
- package/utils/file-download.js +79 -0
- package/utils/format-file-size.js +4 -0
- package/utils/format-last-used.js +20 -0
- package/utils/format-price.js +18 -0
- package/utils/generate-uuid.js +7 -0
- package/utils/initials.js +7 -0
- package/utils/is-audio-transcription-supported.js +5 -0
- package/utils/latex.js +79 -0
- package/utils/merge-class.js +8 -0
- package/utils/message-attachment-to-display.js +31 -0
- package/utils/message.js +5 -0
- package/utils/mime-type.js +73 -0
- package/utils/prompt-variables.js +58 -0
- package/utils/string-utils.js +14 -0
- package/components/CopyButton/CopyButton.d.ts +0 -15
- package/components/CopyButton/CopyButton.d.ts.map +0 -1
- package/components/DeploymentIcon/DeploymentIcon.d.ts +0 -36
- package/components/DeploymentIcon/DeploymentIcon.d.ts.map +0 -1
- package/components/InitialsAvatar/InitialsAvatar.d.ts +0 -13
- package/components/InitialsAvatar/InitialsAvatar.d.ts.map +0 -1
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +0 -47
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +0 -1
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts +0 -7
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +0 -1
- package/components/MarkdownRenderer/MDMessageViewer.d.ts +0 -31
- package/components/MarkdownRenderer/MDMessageViewer.d.ts.map +0 -1
- package/components/MarkdownRenderer/MarkdownRenderer.d.ts +0 -105
- package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +0 -1
- package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +0 -31
- package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +0 -1
- package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts +0 -9
- package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts.map +0 -1
- package/components/MarkdownRenderer/markdown-class-names.d.ts +0 -4
- package/components/MarkdownRenderer/markdown-class-names.d.ts.map +0 -1
- package/components/PanelEmptyState/PanelEmptyState.d.ts +0 -20
- package/components/PanelEmptyState/PanelEmptyState.d.ts.map +0 -1
- package/constants/dial.d.ts +0 -3
- package/constants/dial.d.ts.map +0 -1
- package/constants/icon.d.ts +0 -14
- package/constants/icon.d.ts.map +0 -1
- package/constants/mime-types.d.ts +0 -7
- package/constants/mime-types.d.ts.map +0 -1
- package/hooks/useCodeCopy.d.ts +0 -6
- package/hooks/useCodeCopy.d.ts.map +0 -1
- package/hooks/useCollapsedText.d.ts +0 -27
- package/hooks/useCollapsedText.d.ts.map +0 -1
- package/hooks/useIsMobile.d.ts +0 -3
- package/hooks/useIsMobile.d.ts.map +0 -1
- package/hooks/useStreamedMarkdownContent.d.ts +0 -3
- package/hooks/useStreamedMarkdownContent.d.ts.map +0 -1
- package/hooks/useTableScroll.d.ts +0 -17
- package/hooks/useTableScroll.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/models/annotation.d.ts +0 -78
- package/models/annotation.d.ts.map +0 -1
- package/models/auth.d.ts +0 -26
- package/models/auth.d.ts.map +0 -1
- package/models/chat.d.ts +0 -276
- package/models/chat.d.ts.map +0 -1
- package/models/custom-visualizer.d.ts +0 -61
- package/models/custom-visualizer.d.ts.map +0 -1
- package/models/deployment-configuration.d.ts +0 -55
- package/models/deployment-configuration.d.ts.map +0 -1
- package/models/deployment-features.d.ts +0 -17
- package/models/deployment-features.d.ts.map +0 -1
- package/models/deployment.d.ts +0 -31
- package/models/deployment.d.ts.map +0 -1
- package/models/dial-model.d.ts +0 -19
- package/models/dial-model.d.ts.map +0 -1
- package/models/import-export.d.ts +0 -23
- package/models/import-export.d.ts.map +0 -1
- package/models/theme.d.ts +0 -36
- package/models/theme.d.ts.map +0 -1
- package/models/tool-menu-item.d.ts +0 -13
- package/models/tool-menu-item.d.ts.map +0 -1
- package/types/attachment.d.ts +0 -23
- package/types/attachment.d.ts.map +0 -1
- package/types/code-editor.d.ts +0 -8
- package/types/code-editor.d.ts.map +0 -1
- package/types/mime-type.d.ts +0 -53
- package/types/mime-type.d.ts.map +0 -1
- package/utils/avatar-color.d.ts +0 -10
- package/utils/avatar-color.d.ts.map +0 -1
- package/utils/build-css-vars.d.ts +0 -4
- package/utils/build-css-vars.d.ts.map +0 -1
- package/utils/copy-to-clipboard.d.ts +0 -3
- package/utils/copy-to-clipboard.d.ts.map +0 -1
- package/utils/file-download.d.ts +0 -9
- package/utils/file-download.d.ts.map +0 -1
- package/utils/format-file-size.d.ts +0 -3
- package/utils/format-file-size.d.ts.map +0 -1
- package/utils/format-last-used.d.ts +0 -3
- package/utils/format-last-used.d.ts.map +0 -1
- package/utils/initials.d.ts +0 -3
- package/utils/initials.d.ts.map +0 -1
- package/utils/is-audio-transcription-supported.d.ts +0 -3
- package/utils/is-audio-transcription-supported.d.ts.map +0 -1
- package/utils/latex.d.ts +0 -11
- package/utils/latex.d.ts.map +0 -1
- package/utils/merge-class.d.ts +0 -4
- package/utils/merge-class.d.ts.map +0 -1
- package/utils/message-attachment-to-display.d.ts +0 -22
- package/utils/message-attachment-to-display.d.ts.map +0 -1
- package/utils/message.d.ts +0 -4
- package/utils/message.d.ts.map +0 -1
- package/utils/string-utils.d.ts +0 -5
- package/utils/string-utils.d.ts.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CatalogEntityType as e } from "../types/entity-type.js";
|
|
2
|
+
//#region src/constants/entity-colors.ts
|
|
3
|
+
var t = {
|
|
4
|
+
[e.Model]: "var(--text-visual-blue, #1189C8)",
|
|
5
|
+
[e.Agent]: "var(--text-visual-green-1, #059669)",
|
|
6
|
+
[e.Skill]: "var(--text-visual-violet-1, #7C3AED)",
|
|
7
|
+
[e.Toolset]: "var(--text-visual-brown-2, #B45309)",
|
|
8
|
+
[e.Prompt]: "var(--text-visual-violet-2, #3730B7)"
|
|
9
|
+
}, n = {
|
|
10
|
+
[e.Model]: "var(--bg-visual-blue, #D6EDF9)",
|
|
11
|
+
[e.Agent]: "var(--bg-visual-green-2, #D1F0DC)",
|
|
12
|
+
[e.Skill]: "var(--bg-visual-violet-2, #F1E9FF)",
|
|
13
|
+
[e.Toolset]: "var(--bg-visual-brown, #FDE8D8)",
|
|
14
|
+
[e.Prompt]: "var(--bg-visual-violet-1, #DDE3F9)"
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as ENTITY_TYPE_BG_COLOR, t as ENTITY_TYPE_COLOR };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DIAL_ICON_SIZE as e, DIAL_KIT_ICON_STROKE as t } from "@epam/ai-dial-ui-kit";
|
|
2
|
+
//#region src/constants/icon.ts
|
|
3
|
+
var n = {
|
|
4
|
+
size: e.MD,
|
|
5
|
+
stroke: t,
|
|
6
|
+
"aria-hidden": !0
|
|
7
|
+
}, r = {
|
|
8
|
+
size: e.LG,
|
|
9
|
+
stroke: t,
|
|
10
|
+
"aria-hidden": !0
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as BASE_LG_ICON_PROPS, n as BASE_MD_ICON_PROPS };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/constants/markdown-editor.ts
|
|
2
|
+
var e = "[&_.wmde-markdown>ol]:list-decimal [&_.wmde-markdown_ul]:list-disc [&_.wmde-markdown_ul_ul]:list-[circle] [&_.wmde-markdown_ul_ul_ul]:list-[square]";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
//#region src/constants/mime-types.ts
|
|
2
|
+
var e = {
|
|
3
|
+
"text/calendar": "ics",
|
|
4
|
+
"text/css": "css",
|
|
5
|
+
"text/csv": "csv",
|
|
6
|
+
"text/html": "html",
|
|
7
|
+
"text/javascript": "js",
|
|
8
|
+
"text/jsx": "jsx",
|
|
9
|
+
"text/markdown": "md",
|
|
10
|
+
"text/plain": "txt",
|
|
11
|
+
"text/tsx": "tsx",
|
|
12
|
+
"text/typescript": "ts",
|
|
13
|
+
"text/xml": "xml",
|
|
14
|
+
"text/x-php": "php",
|
|
15
|
+
"text/x-rustsrc": "rs",
|
|
16
|
+
"text/x-sql": "sql",
|
|
17
|
+
"text/x-vue": "vue",
|
|
18
|
+
"application/epub+zip": "epub",
|
|
19
|
+
"application/gzip": "gz",
|
|
20
|
+
"application/java-archive": "jar",
|
|
21
|
+
"application/javascript": "js",
|
|
22
|
+
"application/json": "json",
|
|
23
|
+
"application/ld+json": "jsonld",
|
|
24
|
+
"application/manifest+json": "webmanifest",
|
|
25
|
+
"application/msword": "doc",
|
|
26
|
+
"application/octet-stream": "bin",
|
|
27
|
+
"application/ogg": "ogx",
|
|
28
|
+
"application/pdf": "pdf",
|
|
29
|
+
"application/rtf": "rtf",
|
|
30
|
+
"application/sql": "sql",
|
|
31
|
+
"application/typescript": "ts",
|
|
32
|
+
"application/xhtml+xml": "xhtml",
|
|
33
|
+
"application/xml": "xml",
|
|
34
|
+
"application/vnd.amazon.ebook": "azw",
|
|
35
|
+
"application/vnd.apple.installer+xml": "mpkg",
|
|
36
|
+
"application/vnd.ms-excel": "xls",
|
|
37
|
+
"application/vnd.ms-fontobject": "eot",
|
|
38
|
+
"application/vnd.ms-powerpoint": "ppt",
|
|
39
|
+
"application/vnd.ms-word": "doc",
|
|
40
|
+
"application/vnd.mozilla.xul+xml": "xul",
|
|
41
|
+
"application/vnd.oasis.opendocument.presentation": "odp",
|
|
42
|
+
"application/vnd.oasis.opendocument.spreadsheet": "ods",
|
|
43
|
+
"application/vnd.oasis.opendocument.text": "odt",
|
|
44
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx",
|
|
45
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
|
|
46
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
|
|
47
|
+
"application/vnd.rar": "rar",
|
|
48
|
+
"application/vnd.visio": "vsd",
|
|
49
|
+
"application/x-7z-compressed": "7z",
|
|
50
|
+
"application/x-abiword": "abw",
|
|
51
|
+
"application/x-bzip": "bz",
|
|
52
|
+
"application/x-bzip2": "bz2",
|
|
53
|
+
"application/x-cdf": "cda",
|
|
54
|
+
"application/x-csh": "csh",
|
|
55
|
+
"application/x-freearc": "arc",
|
|
56
|
+
"application/x-gzip": "gz",
|
|
57
|
+
"application/x-httpd-php": "php",
|
|
58
|
+
"application/x-php": "php",
|
|
59
|
+
"application/x-rar-compressed": "rar",
|
|
60
|
+
"application/x-rust": "rs",
|
|
61
|
+
"application/x-sh": "sh",
|
|
62
|
+
"application/x-tar": "tar",
|
|
63
|
+
"application/x-zip-compressed": "zip",
|
|
64
|
+
"application/zip": "zip",
|
|
65
|
+
"audio/3gpp": "3gp",
|
|
66
|
+
"audio/3gpp2": "3g2",
|
|
67
|
+
"audio/aac": "aac",
|
|
68
|
+
"audio/midi": "midi",
|
|
69
|
+
"audio/mp4": "m4a",
|
|
70
|
+
"audio/mpeg": "mp3",
|
|
71
|
+
"audio/ogg": "oga",
|
|
72
|
+
"audio/wav": "wav",
|
|
73
|
+
"audio/webm": "weba",
|
|
74
|
+
"audio/x-midi": "midi",
|
|
75
|
+
"font/otf": "otf",
|
|
76
|
+
"font/ttf": "ttf",
|
|
77
|
+
"font/woff": "woff",
|
|
78
|
+
"font/woff2": "woff2",
|
|
79
|
+
"image/apng": "apng",
|
|
80
|
+
"image/avif": "avif",
|
|
81
|
+
"image/bmp": "bmp",
|
|
82
|
+
"image/gif": "gif",
|
|
83
|
+
"image/jpeg": "jpg",
|
|
84
|
+
"image/png": "png",
|
|
85
|
+
"image/svg+xml": "svg",
|
|
86
|
+
"image/tiff": "tiff",
|
|
87
|
+
"image/vnd.microsoft.icon": "ico",
|
|
88
|
+
"image/webp": "webp",
|
|
89
|
+
"video/3gpp": "3gp",
|
|
90
|
+
"video/3gpp2": "3g2",
|
|
91
|
+
"video/mp2t": "ts",
|
|
92
|
+
"video/mp4": "mp4",
|
|
93
|
+
"video/mpeg": "mpeg",
|
|
94
|
+
"video/ogg": "ogv",
|
|
95
|
+
"video/webm": "webm",
|
|
96
|
+
"video/x-msvideo": "avi"
|
|
97
|
+
}, t = "*/*", n = "audio/";
|
|
98
|
+
//#endregion
|
|
99
|
+
export { n as MIME_TYPE_AUDIO_PREFIX, e as MIME_TYPE_EXT_MAP, t as MIME_TYPE_WILDCARD };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/constants/resizable-fields.ts
|
|
2
|
+
var e = "max-h-[50vh]", t = "--resizable-field-max-height", n = "[&_.w-md-editor]:max-h-[var(--resizable-field-max-height,70vh)]";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { n as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, t as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, e as RESIZABLE_TEXTAREA_CLASS_NAME };
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { DialFileManagerActionProfile as e, DialFileManagerVariant as t } from "../file-manager-variant.js";
|
|
2
|
+
import { getParentFolderPath as ee } from "../path.js";
|
|
3
|
+
import { FileUploadStatus as n } from "../upload-batch.js";
|
|
4
|
+
import { useGridEditingScroll as te } from "../useGridEditingScroll/useGridEditingScroll.js";
|
|
5
|
+
import { OperationLoaderModal as ne } from "../OperationLoaderModal/OperationLoaderModal.js";
|
|
6
|
+
import { UploadProgressModal as re } from "../UploadProgressModal/UploadProgressModal.js";
|
|
7
|
+
import { NOT_ALLOWED_SYMBOLS_REGEXP as r, PrimaryButton as ie, Spinner as ae } from "@epam/ai-dial-ui-kit";
|
|
8
|
+
import { memo as i, useEffect as oe, useMemo as a, useState as se } from "react";
|
|
9
|
+
import { Fragment as ce, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
10
|
+
import { DialFileManager as le, DialFileManagerActions as c, DialFileManagerTabs as l, GridSelectionMode as u } from "@epam/ai-dial-react-file-manager";
|
|
11
|
+
//#region src/file-manager/DialFileManagerShell/DialFileManagerShell.tsx
|
|
12
|
+
var d = (e, t) => {
|
|
13
|
+
if (e.isDownloading) return t.downloadingLabel;
|
|
14
|
+
if (e.isDeleting) return t.deletingLabel;
|
|
15
|
+
if (e.isRenaming && !e.isMoving) return t.renamingLabel;
|
|
16
|
+
if (e.isUnsharing) return t.unsharingLabel;
|
|
17
|
+
if (e.isRemovingAccess) return t.removingAccessLabel;
|
|
18
|
+
}, f = ({ controller: i, labels: f, activeTab: p, tabs: m, onTabChange: h, selectedPaths: g, onSelectedPathsChange: ue, variant: de, actionProfile: fe, autoSelectUploadedItems: pe = !1, allowedFileTypes: me, maxSelectableFileSize: he, isRowSelectable: _, getDisabledTooltip: ge, unsupportedFileTypeTooltip: _e }) => {
|
|
19
|
+
let { items: ve, isLoading: ye, error: be, path: v, onPathChange: xe, retry: Se, onSearchFiles: Ce, isSearching: y, searchResults: b, clearSearchResults: we, expandedPaths: x, loadedPaths: S, onExpandedPathsChange: C, onFolderPopupPathChange: w, folderPopupLoadingPaths: T, onUploadFiles: E, onUploadArchive: D, onValidateUpload: O, uploadBatchState: k, cancelUpload: Te, clearUploadBatch: A, onCreateFolder: Ee, onCreateFolderValidate: De, onDownloadFiles: Oe, isDownloading: ke, onDeleteFiles: Ae, isDeleting: je, onMoveToFiles: Me, onRenameValidate: Ne, isRenaming: Pe, onCopyFiles: Fe, isCopying: Ie, isMoving: j, cancelCopyMove: Le, uploadEnabled: M, isNewButtonDisabled: N, disabledNewButtonTooltip: P, visibleColumns: F, dateLocale: I, dateOptions: L, actionLabels: R, sharedWithMeIds: Re, sharedByMePaths: z, onUnshareFiles: ze, isUnsharing: Be, onRemoveFilesAccess: Ve, isRemovingAccess: He, fileMetadata: B, isFileMetadataLoading: V, onGetInfo: Ue, clearMetadata: H } = i, [U, We] = se(void 0), { handleGridApiChange: Ge, reset: W } = te();
|
|
20
|
+
oe(() => {
|
|
21
|
+
W();
|
|
22
|
+
}, [p, W]);
|
|
23
|
+
let G = a(() => {
|
|
24
|
+
let e = {};
|
|
25
|
+
return c.Download in R && (e[c.Download] = f.downloadLabel), c.Delete in R && (e[c.Delete] = f.deleteLabel), c.Rename in R && (e[c.Rename] = f.renameLabel), c.Copy in R && (e[c.Copy] = f.copyLabel), c.Move in R && (e[c.Move] = f.moveLabel), c.Duplicate in R && (e[c.Duplicate] = f.duplicateLabel), c.Unshare in R && (e[c.Unshare] = f.unshareLabel), c.RemoveAccess in R && (e[c.RemoveAccess] = f.removeAccessLabel), e;
|
|
26
|
+
}, [
|
|
27
|
+
R,
|
|
28
|
+
f.downloadLabel,
|
|
29
|
+
f.deleteLabel,
|
|
30
|
+
f.renameLabel,
|
|
31
|
+
f.copyLabel,
|
|
32
|
+
f.moveLabel,
|
|
33
|
+
f.duplicateLabel,
|
|
34
|
+
f.unshareLabel,
|
|
35
|
+
f.removeAccessLabel
|
|
36
|
+
]), K = a(() => c.Info in R ? {
|
|
37
|
+
...G,
|
|
38
|
+
[c.Info]: f.infoLabel
|
|
39
|
+
} : G, [
|
|
40
|
+
G,
|
|
41
|
+
R,
|
|
42
|
+
f.infoLabel
|
|
43
|
+
]), q = a(() => {
|
|
44
|
+
if (g.size === 0) return !1;
|
|
45
|
+
for (let e of g) if (!z.has(e)) return !1;
|
|
46
|
+
return !0;
|
|
47
|
+
}, [g, z]), J = a(() => {
|
|
48
|
+
if (q) return G;
|
|
49
|
+
let { [c.RemoveAccess]: e, ...t } = G;
|
|
50
|
+
return t;
|
|
51
|
+
}, [G, q]), Ke = a(() => ({
|
|
52
|
+
selectionMode: u.MULTIPLE,
|
|
53
|
+
visibleColumns: F,
|
|
54
|
+
dateLocale: I,
|
|
55
|
+
dateOptions: L,
|
|
56
|
+
additionalGridOptions: {
|
|
57
|
+
domLayout: "normal",
|
|
58
|
+
rowSelection: {
|
|
59
|
+
mode: "multiRow",
|
|
60
|
+
isRowSelectable: _ ?? (() => !0)
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
actionLabels: K
|
|
64
|
+
}), [
|
|
65
|
+
F,
|
|
66
|
+
I,
|
|
67
|
+
L,
|
|
68
|
+
K,
|
|
69
|
+
_
|
|
70
|
+
]), qe = a(() => ({
|
|
71
|
+
header: f.treeHeaderByTab[p],
|
|
72
|
+
expandedPaths: x,
|
|
73
|
+
loadedPaths: S,
|
|
74
|
+
loadingPaths: T,
|
|
75
|
+
onExpandedPathsChange: C,
|
|
76
|
+
actionLabels: G
|
|
77
|
+
}), [
|
|
78
|
+
f.treeHeaderByTab,
|
|
79
|
+
p,
|
|
80
|
+
x,
|
|
81
|
+
S,
|
|
82
|
+
T,
|
|
83
|
+
C,
|
|
84
|
+
G
|
|
85
|
+
]), Y = de === t.Standalone && fe === e.Full && p === l.MyFiles && M, Je = a(() => ({
|
|
86
|
+
tabs: m,
|
|
87
|
+
activeTab: p,
|
|
88
|
+
onTabChange: h,
|
|
89
|
+
showHiddenFilesToggle: !0,
|
|
90
|
+
hiddenFilesSwitcherLabel: f.hiddenFilesLabel,
|
|
91
|
+
showHiddenFilesLabel: f.showHiddenFilesLabel,
|
|
92
|
+
hideHiddenFilesLabel: f.hideHiddenFilesLabel,
|
|
93
|
+
isNewButtonDisabled: N,
|
|
94
|
+
disabledNewButtonTooltip: P,
|
|
95
|
+
newActions: {
|
|
96
|
+
uploadFiles: { label: f.uploadFilesLabel },
|
|
97
|
+
newFolder: { label: f.newFolderLabel },
|
|
98
|
+
...Y ? { uploadArchive: { label: f.uploadArchiveAction } } : {}
|
|
99
|
+
}
|
|
100
|
+
}), [
|
|
101
|
+
m,
|
|
102
|
+
p,
|
|
103
|
+
h,
|
|
104
|
+
f.hiddenFilesLabel,
|
|
105
|
+
f.showHiddenFilesLabel,
|
|
106
|
+
f.hideHiddenFilesLabel,
|
|
107
|
+
N,
|
|
108
|
+
P,
|
|
109
|
+
f.uploadFilesLabel,
|
|
110
|
+
f.newFolderLabel,
|
|
111
|
+
Y,
|
|
112
|
+
f.uploadArchiveAction
|
|
113
|
+
]), Ye = a(() => ({
|
|
114
|
+
getSelectionLabel: f.getSelectionLabel,
|
|
115
|
+
actionLabels: J
|
|
116
|
+
}), [f.getSelectionLabel, J]), Xe = a(() => ({
|
|
117
|
+
cancelLabel: f.deleteCancelLabel,
|
|
118
|
+
confirmLabel: f.deleteConfirmLabel,
|
|
119
|
+
titleRenderer: f.deleteConfirmTitle,
|
|
120
|
+
contentRenderer: f.deleteConfirmBody
|
|
121
|
+
}), [
|
|
122
|
+
f.deleteCancelLabel,
|
|
123
|
+
f.deleteConfirmLabel,
|
|
124
|
+
f.deleteConfirmTitle,
|
|
125
|
+
f.deleteConfirmBody
|
|
126
|
+
]), Ze = a(() => {
|
|
127
|
+
let e;
|
|
128
|
+
for (let t of g) {
|
|
129
|
+
let n = ee(t);
|
|
130
|
+
if (e === void 0) e = n;
|
|
131
|
+
else if (e !== n) return;
|
|
132
|
+
}
|
|
133
|
+
return e;
|
|
134
|
+
}, [g]), X = U != null && T.has(U), Z = X ? U : Ze, Qe = a(() => ({
|
|
135
|
+
copyLabel: f.copyLabel,
|
|
136
|
+
moveLabel: f.moveLabel,
|
|
137
|
+
addFolderLabel: f.addFolderLabel,
|
|
138
|
+
hiddenFilesSwitcherLabel: f.hiddenFilesSwitcherLabel,
|
|
139
|
+
getCopyHeader: f.getCopyHeader,
|
|
140
|
+
getMoveHeader: f.getMoveHeader,
|
|
141
|
+
disabledPathTooltip: X ? f.folderPickerLoadingTooltip : f.moveSourceDisabledTooltip,
|
|
142
|
+
emptyStateTitle: f.folderPickerEmptyStateTitle,
|
|
143
|
+
emptyStateDescription: f.folderPickerEmptyStateDescription,
|
|
144
|
+
sourceFolder: Z,
|
|
145
|
+
destinationFolderPath: U,
|
|
146
|
+
setDestinationFolderPath: We,
|
|
147
|
+
filesLoading: X
|
|
148
|
+
}), [
|
|
149
|
+
f.copyLabel,
|
|
150
|
+
f.moveLabel,
|
|
151
|
+
f.addFolderLabel,
|
|
152
|
+
f.hiddenFilesSwitcherLabel,
|
|
153
|
+
f.getCopyHeader,
|
|
154
|
+
f.getMoveHeader,
|
|
155
|
+
f.folderPickerLoadingTooltip,
|
|
156
|
+
f.moveSourceDisabledTooltip,
|
|
157
|
+
f.folderPickerEmptyStateTitle,
|
|
158
|
+
f.folderPickerEmptyStateDescription,
|
|
159
|
+
X,
|
|
160
|
+
Z,
|
|
161
|
+
U
|
|
162
|
+
]), $e = () => {
|
|
163
|
+
Te(), A();
|
|
164
|
+
}, et = a(() => ({
|
|
165
|
+
fileMetadata: B,
|
|
166
|
+
loading: V,
|
|
167
|
+
clearMetadata: H,
|
|
168
|
+
header: f.metadataHeader,
|
|
169
|
+
nameLabel: f.metadataNameLabel,
|
|
170
|
+
pathLabel: f.metadataPathLabel,
|
|
171
|
+
modifiedDateLabel: f.metadataModifiedDateLabel,
|
|
172
|
+
sizeLabel: f.metadataSizeLabel,
|
|
173
|
+
authorLabel: f.metadataAuthorLabel
|
|
174
|
+
}), [
|
|
175
|
+
B,
|
|
176
|
+
V,
|
|
177
|
+
H,
|
|
178
|
+
f.metadataHeader,
|
|
179
|
+
f.metadataNameLabel,
|
|
180
|
+
f.metadataPathLabel,
|
|
181
|
+
f.metadataModifiedDateLabel,
|
|
182
|
+
f.metadataSizeLabel,
|
|
183
|
+
f.metadataAuthorLabel
|
|
184
|
+
]), Q = d({
|
|
185
|
+
isDownloading: ke,
|
|
186
|
+
isDeleting: je,
|
|
187
|
+
isRenaming: Pe,
|
|
188
|
+
isMoving: j,
|
|
189
|
+
isUnsharing: Be,
|
|
190
|
+
isRemovingAccess: He
|
|
191
|
+
}, f), tt = a(() => {
|
|
192
|
+
if (k == null) return "";
|
|
193
|
+
let e = k.files.filter((e) => e.status !== n.Uploading).length;
|
|
194
|
+
return f.getUploadProgressText(e, k.files.length);
|
|
195
|
+
}, [k, f]), $ = a(() => b != null && !y ? {
|
|
196
|
+
title: f.searchEmptyStateTitle,
|
|
197
|
+
description: ""
|
|
198
|
+
} : v.split("/").filter(Boolean).length > 1 ? {
|
|
199
|
+
title: f.folderEmptyStateTitle,
|
|
200
|
+
description: ""
|
|
201
|
+
} : f.emptyStateByTab[p], [
|
|
202
|
+
b,
|
|
203
|
+
y,
|
|
204
|
+
v,
|
|
205
|
+
f.searchEmptyStateTitle,
|
|
206
|
+
f.folderEmptyStateTitle,
|
|
207
|
+
f.emptyStateByTab,
|
|
208
|
+
p
|
|
209
|
+
]);
|
|
210
|
+
return /* @__PURE__ */ s(ce, { children: [
|
|
211
|
+
be == null ? /* @__PURE__ */ s("div", {
|
|
212
|
+
className: "relative flex min-h-0 w-full grow overflow-auto bg-layer-sunken",
|
|
213
|
+
children: [/* @__PURE__ */ o(le, {
|
|
214
|
+
className: "min-h-0 w-full grow bg-layer-sunken",
|
|
215
|
+
gridClassName: "size-full",
|
|
216
|
+
items: ve,
|
|
217
|
+
path: v,
|
|
218
|
+
onPathChange: xe,
|
|
219
|
+
onGridApiChange: Ge,
|
|
220
|
+
filesLoading: ye,
|
|
221
|
+
allowedFileTypes: me,
|
|
222
|
+
maxSelectableFileSize: he,
|
|
223
|
+
selectedPaths: g,
|
|
224
|
+
onSelectedPathsChange: ue,
|
|
225
|
+
navigationPanelOptions: { searchable: !0 },
|
|
226
|
+
hideSearchPathItemName: !0,
|
|
227
|
+
onSearchFiles: Ce,
|
|
228
|
+
searchInProgress: y,
|
|
229
|
+
searchResults: b ?? [],
|
|
230
|
+
clearSearchResults: we,
|
|
231
|
+
gridOptions: Ke,
|
|
232
|
+
treeOptions: qe,
|
|
233
|
+
onFolderPopupPathChange: w,
|
|
234
|
+
toolbarOptions: Je,
|
|
235
|
+
bulkActionsToolbarOptions: Ye,
|
|
236
|
+
autoSelectUploadedItems: pe,
|
|
237
|
+
emptyStateTitle: $.title,
|
|
238
|
+
emptyStateDescription: $.description,
|
|
239
|
+
uploadEnabled: M,
|
|
240
|
+
sharedWithMeIds: Re,
|
|
241
|
+
sharedByMePaths: z,
|
|
242
|
+
onUnshareFiles: ze,
|
|
243
|
+
onRemoveFilesAccess: Ve,
|
|
244
|
+
fileMetadataPopupOptions: et,
|
|
245
|
+
onGetInfo: Ue,
|
|
246
|
+
onUploadFiles: E,
|
|
247
|
+
onUploadArchive: D,
|
|
248
|
+
onValidateUpload: O,
|
|
249
|
+
onCreateFolder: Ee,
|
|
250
|
+
onCreateFolderValidate: De,
|
|
251
|
+
onDownloadFiles: Oe,
|
|
252
|
+
onDeleteFiles: Ae,
|
|
253
|
+
onMoveToFiles: Me,
|
|
254
|
+
onCopyFiles: Fe,
|
|
255
|
+
onRenameValidate: Ne,
|
|
256
|
+
renameValidationMessages: f.renameValidationMessages,
|
|
257
|
+
isRenameFileAvailable: M,
|
|
258
|
+
deleteConfirmationOptions: Xe,
|
|
259
|
+
conflictResolutionPopupOptions: f.conflictResolutionPopupOptions,
|
|
260
|
+
destinationFolderPopupOptions: Qe,
|
|
261
|
+
forbiddenSymbolsRegExp: r,
|
|
262
|
+
forbiddenSymbolsTooltip: f.forbiddenSymbolsTooltip,
|
|
263
|
+
getDisabledTooltip: ge,
|
|
264
|
+
unsupportedFileTypeTooltip: _e
|
|
265
|
+
}), Q != null && /* @__PURE__ */ o("div", {
|
|
266
|
+
"aria-live": "polite",
|
|
267
|
+
className: "absolute inset-0 z-[52] flex items-center justify-center bg-backdrop desktop:p-4",
|
|
268
|
+
children: /* @__PURE__ */ o(ae, {
|
|
269
|
+
size: 32,
|
|
270
|
+
fullWidth: !1,
|
|
271
|
+
ariaLabel: Q
|
|
272
|
+
})
|
|
273
|
+
})]
|
|
274
|
+
}) : /* @__PURE__ */ s("div", {
|
|
275
|
+
role: "alert",
|
|
276
|
+
className: "flex flex-col items-center gap-4 p-6",
|
|
277
|
+
children: [/* @__PURE__ */ o("p", { children: f.errorMessage }), /* @__PURE__ */ o(ie, {
|
|
278
|
+
label: f.retryLabel,
|
|
279
|
+
onClick: Se
|
|
280
|
+
})]
|
|
281
|
+
}),
|
|
282
|
+
k != null && /* @__PURE__ */ o(re, {
|
|
283
|
+
batchState: k,
|
|
284
|
+
uploadProgressTitle: f.uploadProgressTitle,
|
|
285
|
+
uploadProgressText: tt,
|
|
286
|
+
cancelLabel: f.cancelLabel,
|
|
287
|
+
onCancel: $e
|
|
288
|
+
}),
|
|
289
|
+
(Ie || j) && /* @__PURE__ */ o(ne, {
|
|
290
|
+
title: j ? f.operationLoaderMoveTitle : f.operationLoaderCopyTitle,
|
|
291
|
+
text: j ? f.movingLabel : f.copyingLabel,
|
|
292
|
+
cancelLabel: f.operationLoaderCancelLabel,
|
|
293
|
+
onCancel: Le
|
|
294
|
+
})
|
|
295
|
+
] });
|
|
296
|
+
};
|
|
297
|
+
i(f);
|
|
298
|
+
//#endregion
|
|
299
|
+
export { f as DialFileManagerShell };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { isHiddenPath as e } from "../path.js";
|
|
2
|
+
import { DialFileManagerShell as t } from "../DialFileManagerShell/DialFileManagerShell.js";
|
|
3
|
+
import { Popup as n, PopupSize as r, PrimaryButton as i } from "@epam/ai-dial-ui-kit";
|
|
4
|
+
import { memo as a, useCallback as o, useMemo as s } from "react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
import { DialFileNodeType as u } from "@epam/ai-dial-react-file-manager";
|
|
7
|
+
//#region src/file-manager/FileManagerAttachModal/FileManagerAttachModal.tsx
|
|
8
|
+
var d = a(({ isOpen: a, onClose: d, onAttach: f, onSkippedUnsupportedFiles: p, onCountLimitExceeded: m, controller: h, isAnyOperationInProgress: g, activeTab: _, tabs: v, onTabChange: y, labels: b, variant: x, actionProfile: S, selectedPaths: C, onSelectedPathsChange: w, resolveFolderPath: T, isFileTypeAllowed: E, maxSelectableFileSize: D, maximumAttachmentsAmount: O, existingAttachmentsAmount: k = 0, isRowSelectable: A, getDisabledTooltip: j, unsupportedFileTypeTooltip: M, allowedFileTypes: N, autoSelectUploadedItems: P = !1 }) => {
|
|
9
|
+
let { items: F, isLoading: I, searchResults: L } = h, R = s(() => {
|
|
10
|
+
let e = /* @__PURE__ */ new Map(), t = (n) => {
|
|
11
|
+
n.forEach((n) => {
|
|
12
|
+
(n.nodeType === u.ITEM || n.nodeType === u.FOLDER) && (e.set(n.path, n), n.id && e.set(n.id, n)), n.items && t(n.items);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
return t(F), L?.forEach((t) => {
|
|
16
|
+
e.set(t.path, t), t.id && e.set(t.id, t);
|
|
17
|
+
}), e;
|
|
18
|
+
}, [F, L]), z = s(() => Array.from(C).map((e) => R.get(e)).filter((e) => e != null), [R, C]), B = o((e) => {
|
|
19
|
+
if (A == null) {
|
|
20
|
+
w(new Set(e));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let t = /* @__PURE__ */ new Set();
|
|
24
|
+
for (let n of e) {
|
|
25
|
+
let e = R.get(n);
|
|
26
|
+
e != null && A({ data: e }) && t.add(n);
|
|
27
|
+
}
|
|
28
|
+
w(t);
|
|
29
|
+
}, [
|
|
30
|
+
R,
|
|
31
|
+
A,
|
|
32
|
+
w
|
|
33
|
+
]), V = o(() => {
|
|
34
|
+
let t = [], n = [];
|
|
35
|
+
for (let r of z) e(r.path) || (r.nodeType === u.FOLDER ? t.push(r.path) : n.push(r));
|
|
36
|
+
let r = t.filter((e) => !t.some((t) => t !== e && e.startsWith(`${t}/`))), i = n.filter((t) => !(e(t.path) || E != null && t.contentType != null && !E(t.contentType))), a = i.filter((e) => !r.some((t) => e.path.startsWith(`${t}/`)));
|
|
37
|
+
n.length - i.length > 0 && p?.();
|
|
38
|
+
let o = r.flatMap((e) => {
|
|
39
|
+
let t = R.get(e);
|
|
40
|
+
if (t == null) return [];
|
|
41
|
+
let n = T(t);
|
|
42
|
+
return n == null ? [] : [n];
|
|
43
|
+
}), s = k + a.length + o.length;
|
|
44
|
+
if (O != null && O > 0 && s > O) {
|
|
45
|
+
m?.(s, O);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
f({
|
|
49
|
+
files: a,
|
|
50
|
+
folderPaths: o
|
|
51
|
+
});
|
|
52
|
+
}, [
|
|
53
|
+
f,
|
|
54
|
+
p,
|
|
55
|
+
m,
|
|
56
|
+
z,
|
|
57
|
+
E,
|
|
58
|
+
O,
|
|
59
|
+
k,
|
|
60
|
+
R,
|
|
61
|
+
T
|
|
62
|
+
]), { title: H, attachLabel: U, headerDescription: W, ...G } = b;
|
|
63
|
+
return /* @__PURE__ */ c(n, {
|
|
64
|
+
open: a,
|
|
65
|
+
header: /* @__PURE__ */ l("div", {
|
|
66
|
+
className: "flex flex-col gap-1",
|
|
67
|
+
children: [/* @__PURE__ */ c("span", { children: H }), W != null && /* @__PURE__ */ c("p", {
|
|
68
|
+
className: "dial-small-text text-start",
|
|
69
|
+
children: W
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
ariaLabel: H,
|
|
73
|
+
size: r.Lg,
|
|
74
|
+
className: "flex !h-[min(800px,100dvh)] w-full flex-col !bg-layer-sunken",
|
|
75
|
+
onClose: d,
|
|
76
|
+
footer: /* @__PURE__ */ c("div", {
|
|
77
|
+
className: "flex justify-end px-6 py-4",
|
|
78
|
+
children: /* @__PURE__ */ c(i, {
|
|
79
|
+
label: U,
|
|
80
|
+
disabled: z.length === 0 || I || g,
|
|
81
|
+
onClick: V
|
|
82
|
+
})
|
|
83
|
+
}),
|
|
84
|
+
children: /* @__PURE__ */ c("div", {
|
|
85
|
+
className: "flex min-h-0 flex-col",
|
|
86
|
+
children: /* @__PURE__ */ c(t, {
|
|
87
|
+
controller: h,
|
|
88
|
+
labels: G,
|
|
89
|
+
activeTab: _,
|
|
90
|
+
tabs: v,
|
|
91
|
+
onTabChange: y,
|
|
92
|
+
selectedPaths: C,
|
|
93
|
+
onSelectedPathsChange: B,
|
|
94
|
+
variant: x,
|
|
95
|
+
actionProfile: S,
|
|
96
|
+
autoSelectUploadedItems: P,
|
|
97
|
+
allowedFileTypes: N,
|
|
98
|
+
maxSelectableFileSize: D,
|
|
99
|
+
isRowSelectable: A,
|
|
100
|
+
getDisabledTooltip: j,
|
|
101
|
+
unsupportedFileTypeTooltip: M
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
d.displayName = "FileManagerAttachModal";
|
|
107
|
+
//#endregion
|
|
108
|
+
export { d as FileManagerAttachModal };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { NeutralButton as e, Popup as t, Spinner as n } from "@epam/ai-dial-ui-kit";
|
|
2
|
+
import { memo as r } from "react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/file-manager/OperationLoaderModal/OperationLoaderModal.tsx
|
|
5
|
+
var o = ({ title: r, text: o, cancelLabel: s, onCancel: c }) => /* @__PURE__ */ i(t, {
|
|
6
|
+
className: "!h-fit !max-h-full !w-[400px]",
|
|
7
|
+
open: !0,
|
|
8
|
+
closeOnOutsideClick: !1,
|
|
9
|
+
hideClose: !0,
|
|
10
|
+
onClose: c,
|
|
11
|
+
footer: /* @__PURE__ */ i("div", {
|
|
12
|
+
className: "flex justify-end gap-2 px-6 py-4",
|
|
13
|
+
children: /* @__PURE__ */ i(e, {
|
|
14
|
+
label: s,
|
|
15
|
+
onClick: c
|
|
16
|
+
})
|
|
17
|
+
}),
|
|
18
|
+
children: /* @__PURE__ */ a("div", {
|
|
19
|
+
"aria-live": "polite",
|
|
20
|
+
className: "flex flex-col items-center gap-4 px-6 py-4 text-center",
|
|
21
|
+
children: [/* @__PURE__ */ i(n, {
|
|
22
|
+
size: 32,
|
|
23
|
+
fullWidth: !1,
|
|
24
|
+
ariaLabel: r
|
|
25
|
+
}), /* @__PURE__ */ a("div", {
|
|
26
|
+
className: "flex flex-col gap-1",
|
|
27
|
+
children: [/* @__PURE__ */ i("div", { children: r }), /* @__PURE__ */ i("div", {
|
|
28
|
+
className: "dial-small-text text-secondary",
|
|
29
|
+
children: o
|
|
30
|
+
})]
|
|
31
|
+
})]
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
r(o);
|
|
35
|
+
//#endregion
|
|
36
|
+
export { o as OperationLoaderModal };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DialFileName as e, NeutralButton as t, Popup as n } from "@epam/ai-dial-ui-kit";
|
|
2
|
+
import { memo as r, useCallback as i } from "react";
|
|
3
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
//#region src/file-manager/UploadProgressModal/UploadProgressModal.tsx
|
|
5
|
+
var s = ({ batchState: r, uploadProgressTitle: s, uploadProgressText: c, cancelLabel: l, onCancel: u }) => {
|
|
6
|
+
let { files: d } = r, f = i((e) => e === void 0 ? null : /* @__PURE__ */ a("div", {
|
|
7
|
+
className: "h-1 w-full overflow-hidden rounded-full bg-control-disable-primary",
|
|
8
|
+
"data-qa": "uploading-indicator",
|
|
9
|
+
role: "progressbar",
|
|
10
|
+
"aria-valuemin": 0,
|
|
11
|
+
"aria-valuemax": 100,
|
|
12
|
+
"aria-valuenow": e,
|
|
13
|
+
children: /* @__PURE__ */ a("div", {
|
|
14
|
+
className: "h-full rounded-full bg-control-accent transition-all duration-300",
|
|
15
|
+
style: { width: `${e}%` }
|
|
16
|
+
})
|
|
17
|
+
}), []);
|
|
18
|
+
return /* @__PURE__ */ a(n, {
|
|
19
|
+
className: "!h-fit !max-h-full !w-[400px] mobile:!w-full desktop:!max-h-[693px]",
|
|
20
|
+
open: r.isOpen,
|
|
21
|
+
closeOnOutsideClick: !1,
|
|
22
|
+
hideClose: !0,
|
|
23
|
+
onClose: u,
|
|
24
|
+
footer: /* @__PURE__ */ a("div", {
|
|
25
|
+
className: "flex justify-end gap-2 px-6 py-4",
|
|
26
|
+
children: /* @__PURE__ */ a(t, {
|
|
27
|
+
label: l,
|
|
28
|
+
onClick: u
|
|
29
|
+
})
|
|
30
|
+
}),
|
|
31
|
+
header: /* @__PURE__ */ o("div", {
|
|
32
|
+
className: "flex flex-col gap-2",
|
|
33
|
+
children: [/* @__PURE__ */ a("div", { children: s }), /* @__PURE__ */ a("div", {
|
|
34
|
+
className: "dial-small-text text-secondary",
|
|
35
|
+
"data-qa": "uploading-items-count",
|
|
36
|
+
children: c
|
|
37
|
+
})]
|
|
38
|
+
}),
|
|
39
|
+
children: /* @__PURE__ */ a("div", {
|
|
40
|
+
className: "flex h-full max-h-full flex-col gap-4 px-6",
|
|
41
|
+
children: /* @__PURE__ */ a("div", {
|
|
42
|
+
className: "flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto",
|
|
43
|
+
children: d.map((t) => /* @__PURE__ */ a("div", {
|
|
44
|
+
className: "rounded bg-layer-sunken px-3 py-2",
|
|
45
|
+
children: /* @__PURE__ */ a(e, {
|
|
46
|
+
name: t.name,
|
|
47
|
+
details: f(t.percent)
|
|
48
|
+
})
|
|
49
|
+
}, t.id))
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
r(s);
|
|
55
|
+
//#endregion
|
|
56
|
+
export { s as UploadProgressModal };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/file-manager/file-manager-variant.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.Attach = "attach", e.Standalone = "standalone", e.FolderPicker = "folder-picker", e;
|
|
4
|
+
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e.Attach = "attach", e.Browse = "browse", e.Full = "full", e;
|
|
6
|
+
}({});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as DialFileManagerActionProfile, e as DialFileManagerVariant };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/file-manager/path.ts
|
|
2
|
+
var e = (e) => e.split("/").some((e) => e.startsWith(".")), t = (e) => {
|
|
3
|
+
let t = e.replace(/\/$/, ""), n = t.lastIndexOf("/");
|
|
4
|
+
return n > 0 ? t.slice(0, n + 1) : "";
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { t as getParentFolderPath, e as isHiddenPath };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/file-manager/upload-batch.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.Queued = "queued", e.Uploading = "uploading", e.Completed = "completed", e.Failed = "failed", e.Cancelled = "cancelled", e;
|
|
4
|
+
}({});
|
|
5
|
+
//#endregion
|
|
6
|
+
export { e as FileUploadStatus };
|