@epam/ai-dial-chat-shared 1.3.0-dev.37 → 1.3.0-dev.372

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.
Files changed (172) hide show
  1. package/components/ActionMenu/ActionMenu.d.ts +26 -0
  2. package/components/ActionMenu/ActionMenu.d.ts.map +1 -0
  3. package/components/ActionMenu/ActionMenu.js +50 -0
  4. package/components/ConfirmationDialog/ConfirmationDialog.d.ts +6 -1
  5. package/components/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
  6. package/components/ConfirmationDialog/ConfirmationDialog.js +11 -9
  7. package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.module.scss.js +5 -4
  8. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.js +2 -2
  9. package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.module.scss.js +3 -2
  10. package/components/ConfirmationView/ConfirmationFooter.d.ts.map +1 -1
  11. package/components/ConfirmationView/ConfirmationFooter.js +25 -26
  12. package/components/ConfirmationView/ConfirmationView.d.ts +2 -0
  13. package/components/ConfirmationView/ConfirmationView.d.ts.map +1 -1
  14. package/components/ConfirmationView/ConfirmationView.js +12 -12
  15. package/components/ConfirmationView/ConfirmationView.module.scss.js +6 -5
  16. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.d.ts +31 -0
  17. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.d.ts.map +1 -0
  18. package/components/DeleteConfirmationDrawer/DeleteConfirmationDrawer.js +36 -0
  19. package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts +3 -0
  20. package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts.map +1 -1
  21. package/components/DeleteConfirmationView/DeleteConfirmationView.js +36 -27
  22. package/components/DeleteConfirmationView/DeleteConfirmationView.module.scss.js +5 -4
  23. package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -2
  24. package/components/EntityHeader/EntityHeader.js +1 -1
  25. package/components/InitialsAvatar/InitialsAvatar.d.ts +3 -0
  26. package/components/InitialsAvatar/InitialsAvatar.d.ts.map +1 -1
  27. package/components/InitialsAvatar/InitialsAvatar.js +4 -3
  28. package/components/ItemHeader/ItemHeader.d.ts +5 -1
  29. package/components/ItemHeader/ItemHeader.d.ts.map +1 -1
  30. package/components/ItemHeader/ItemHeader.js +4 -1
  31. package/components/ItemHeader/ItemHeader.module.scss.js +5 -4
  32. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +6 -2
  33. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +1 -1
  34. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +58 -58
  35. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +9 -8
  36. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +1 -1
  37. package/components/MarkdownRenderer/MDMessageViewer.d.ts +6 -2
  38. package/components/MarkdownRenderer/MDMessageViewer.d.ts.map +1 -1
  39. package/components/MarkdownRenderer/MDMessageViewer.js +14 -12
  40. package/components/MarkdownRenderer/MarkdownRenderer.d.ts +8 -0
  41. package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +1 -1
  42. package/components/MarkdownRenderer/MarkdownRenderer.js +146 -136
  43. package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +9 -8
  44. package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +1 -1
  45. package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +5 -4
  46. package/components/MarkdownRenderer/PlainTextRenderer.js +1 -1
  47. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +4 -0
  48. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +1 -1
  49. package/components/MarkdownRenderer/Table/MarkdownTable.js +68 -63
  50. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +15 -13
  51. package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -2
  52. package/components/MarkdownRenderer/markdown-whitespace.js +2 -6
  53. package/components/NewVersionAlert/NewVersionAlert.d.ts +27 -0
  54. package/components/NewVersionAlert/NewVersionAlert.d.ts.map +1 -0
  55. package/components/NewVersionAlert/NewVersionAlert.js +28 -0
  56. package/components/NewVersionAlert/NewVersionAlert.module.scss.js +4 -0
  57. package/components/NotificationStack/NotificationStack.d.ts +48 -0
  58. package/components/NotificationStack/NotificationStack.d.ts.map +1 -0
  59. package/components/NotificationStack/NotificationStack.js +111 -0
  60. package/components/PanelEmptyState/PanelEmptyState.d.ts +12 -2
  61. package/components/PanelEmptyState/PanelEmptyState.d.ts.map +1 -1
  62. package/components/PanelEmptyState/PanelEmptyState.js +19 -9
  63. package/components/PanelEmptyState/PanelEmptyState.module.scss.js +6 -2
  64. package/components/ResourceSummary/ResourceSummary.module.scss.js +5 -4
  65. package/components/TextRefinementField/TextRefinementField.d.ts +4 -2
  66. package/components/TextRefinementField/TextRefinementField.d.ts.map +1 -1
  67. package/components/TextRefinementField/TextRefinementField.js +84 -55
  68. package/components/UnsavedChangesProvider/UnsavedChangesProvider.d.ts +22 -0
  69. package/components/UnsavedChangesProvider/UnsavedChangesProvider.d.ts.map +1 -0
  70. package/components/UnsavedChangesProvider/UnsavedChangesProvider.js +57 -0
  71. package/components/UnsavedChangesProvider/unsaved-changes-context.d.ts +44 -0
  72. package/components/UnsavedChangesProvider/unsaved-changes-context.d.ts.map +1 -0
  73. package/components/UnsavedChangesProvider/unsaved-changes-context.js +13 -0
  74. package/constants/breakpoint.d.ts +6 -0
  75. package/constants/breakpoint.d.ts.map +1 -1
  76. package/constants/breakpoint.js +2 -2
  77. package/conversation-transfer/conversation-transfer-queue.d.ts +16 -0
  78. package/conversation-transfer/conversation-transfer-queue.d.ts.map +1 -0
  79. package/conversation-transfer/conversation-transfer-queue.js +24 -0
  80. package/entry-points/markdown.d.ts +1 -0
  81. package/entry-points/markdown.d.ts.map +1 -1
  82. package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts +15 -0
  83. package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts.map +1 -1
  84. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +330 -266
  85. package/file-manager/DialFileManagerShell/DialFileManagerShell.module.scss.js +8 -0
  86. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts +7 -0
  87. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts.map +1 -1
  88. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +85 -80
  89. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.module.scss.js +7 -0
  90. package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts +5 -0
  91. package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts.map +1 -1
  92. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +25 -20
  93. package/file-manager/OperationLoaderModal/OperationLoaderModal.module.scss.js +4 -0
  94. package/file-manager/file-manager-controller.d.ts +11 -3
  95. package/file-manager/file-manager-controller.d.ts.map +1 -1
  96. package/file-manager/index.d.ts +1 -0
  97. package/file-manager/index.d.ts.map +1 -1
  98. package/file-manager/labels.d.ts +23 -2
  99. package/file-manager/labels.d.ts.map +1 -1
  100. package/file-manager/shell-styles.d.ts +37 -0
  101. package/file-manager/shell-styles.d.ts.map +1 -0
  102. package/file-manager/upload-batch.d.ts +46 -0
  103. package/file-manager/upload-batch.d.ts.map +1 -1
  104. package/file-manager/upload-batch.js +6 -2
  105. package/file-manager/upload-queue.d.ts +44 -4
  106. package/file-manager/upload-queue.d.ts.map +1 -1
  107. package/file-manager/upload-queue.js +45 -13
  108. package/file-manager.js +4 -4
  109. package/hooks/useAvailableHeightCap.js +1 -1
  110. package/hooks/useControlErrorAssociation.d.ts +3 -0
  111. package/hooks/useControlErrorAssociation.d.ts.map +1 -0
  112. package/hooks/useControlErrorAssociation.js +12 -0
  113. package/hooks/useIsMobile.js +1 -1
  114. package/hooks/useIsPhone.d.ts +3 -0
  115. package/hooks/useIsPhone.d.ts.map +1 -0
  116. package/hooks/useIsPhone.js +13 -0
  117. package/hooks/useIsTablet.d.ts +3 -0
  118. package/hooks/useIsTablet.d.ts.map +1 -0
  119. package/hooks/useIsTablet.js +13 -0
  120. package/hooks/useIsTextClipped.d.ts +26 -0
  121. package/hooks/useIsTextClipped.d.ts.map +1 -0
  122. package/hooks/useIsTextClipped.js +25 -0
  123. package/hooks/useIsVerticallyClamped.d.ts +16 -0
  124. package/hooks/useIsVerticallyClamped.d.ts.map +1 -0
  125. package/hooks/useIsVerticallyClamped.js +20 -0
  126. package/hooks/useTextRefinement.d.ts +1 -1
  127. package/hooks/useTextRefinement.d.ts.map +1 -1
  128. package/hooks/useTextRefinement.js +4 -4
  129. package/hooks/useUnsavedChangesGuard.js +1 -5
  130. package/hooks/useUnsavedChangesLeaveConfirmation.d.ts +12 -0
  131. package/hooks/useUnsavedChangesLeaveConfirmation.d.ts.map +1 -0
  132. package/hooks/useUnsavedChangesLeaveConfirmation.js +22 -0
  133. package/hooks/useUnsavedChangesLeaveGuard.d.ts +24 -0
  134. package/hooks/useUnsavedChangesLeaveGuard.d.ts.map +1 -0
  135. package/hooks/useUnsavedChangesLeaveGuard.js +24 -0
  136. package/index.css +3 -2
  137. package/index.d.ts +17 -0
  138. package/index.d.ts.map +1 -1
  139. package/index.js +93 -76
  140. package/markdown.js +3 -2
  141. package/models/auth.d.ts +2 -0
  142. package/models/auth.d.ts.map +1 -1
  143. package/models/chat.d.ts +2 -0
  144. package/models/chat.d.ts.map +1 -1
  145. package/models/conversation-classification.d.ts +5 -0
  146. package/models/conversation-classification.d.ts.map +1 -1
  147. package/models/conversation-classification.js +3 -1
  148. package/models/inline-segment.d.ts +11 -0
  149. package/models/inline-segment.d.ts.map +1 -0
  150. package/models/text-refinement.d.ts +6 -2
  151. package/models/text-refinement.d.ts.map +1 -1
  152. package/package.json +10 -17
  153. package/utils/base64-json.d.ts +14 -0
  154. package/utils/base64-json.d.ts.map +1 -0
  155. package/utils/base64-json.js +4 -0
  156. package/utils/dom.d.ts +8 -0
  157. package/utils/dom.d.ts.map +1 -0
  158. package/utils/dom.js +10 -0
  159. package/utils/format-price.js +10 -10
  160. package/utils/inline-segments.d.ts +38 -0
  161. package/utils/inline-segments.d.ts.map +1 -0
  162. package/utils/inline-segments.js +53 -0
  163. package/utils/latex.d.ts +4 -3
  164. package/utils/latex.d.ts.map +1 -1
  165. package/utils/latex.js +47 -41
  166. package/utils/markdown-html.d.ts +14 -0
  167. package/utils/markdown-html.d.ts.map +1 -0
  168. package/utils/markdown-html.js +11 -0
  169. package/utils/message-attachment-to-display.js +1 -1
  170. package/utils/mime-type.js +1 -1
  171. package/utils/prompt-variables.js +5 -9
  172. package/utils/syntax-highlighting.js +8 -8
@@ -1,320 +1,384 @@
1
1
  import { mergeClasses as e } from "../../utils/merge-class.js";
2
- import { DialFileManagerActionProfile as t, DialFileManagerVariant as n } from "../file-manager-variant.js";
2
+ import { buildCssVars as t } from "../../utils/build-css-vars.js";
3
+ import { DialFileManagerActionProfile as n, DialFileManagerVariant as r } from "../file-manager-variant.js";
3
4
  import { getParentFolderPath as ee } from "../path.js";
4
5
  import { useGridEditingScroll as te } from "../useGridEditingScroll/useGridEditingScroll.js";
5
6
  import { OperationLoaderModal as ne } from "../OperationLoaderModal/OperationLoaderModal.js";
6
- import { toUploadQueueItems as re } from "../upload-queue.js";
7
- import { ButtonVariant as r, NOT_ALLOWED_SYMBOLS_REGEXP as ie, PrimaryButton as ae, Spinner as oe, TransferQueue as se } from "@epam/ai-dial-ui-kit";
8
- import { memo as i, useCallback as ce, useEffect as le, useMemo as a, useState as ue } from "react";
9
- import { Fragment as de, jsx as o, jsxs as s } from "react/jsx-runtime";
10
- import { DialFileManager as fe, DialFileManagerActions as c, DialFileManagerTabs as pe, GridSelectionMode as me } from "@epam/ai-dial-react-file-manager";
7
+ import { TransferQueueRowKind as re, buildTransferQueueLabels as ie, parseTransferQueueRowId as ae, toTransferQueueItems as oe } from "../upload-queue.js";
8
+ import i from "./DialFileManagerShell.module.scss.js";
9
+ import { Button as se, ButtonAppearance as ce, ButtonVariant as a, ElementSize as le, ErrorMessageNotification as ue, LiveRegion as de, LiveRegionElement as fe, NOT_ALLOWED_SYMBOLS_REGEXP as pe, Spinner as me, TransferQueue as he } from "@epam/ai-dial-ui-kit";
10
+ import { memo as o, useCallback as ge, useEffect as _e, useMemo as s, useState as ve } from "react";
11
+ import { Fragment as ye, jsx as c, jsxs as l } from "react/jsx-runtime";
12
+ import { DialFileManager as be, DialFileManagerActions as u, DialFileManagerTabs as xe, GridSelectionMode as Se } from "@epam/ai-dial-react-file-manager";
11
13
  //#region src/file-manager/DialFileManagerShell/DialFileManagerShell.tsx
12
- var he = (e, t) => {
13
- if (e.isDownloading) return t.downloadingLabel;
14
+ var Ce = (e, t) => {
14
15
  if (e.isDeleting) return t.deletingLabel;
15
16
  if (e.isRenaming && !e.isMoving) return t.renamingLabel;
16
17
  if (e.isUnsharing) return t.unsharingLabel;
17
18
  if (e.isRemovingAccess) return t.removingAccessLabel;
18
- }, l = ({ controller: i, labels: l, activeTab: u, tabs: d, onTabChange: f, selectedPaths: p, onSelectedPathsChange: ge, variant: m, actionProfile: _e, autoSelectUploadedItems: ve = !1, allowedFileTypes: ye, maxSelectableFileSize: h, oversizedUploadMessage: g, isRowSelectable: _, getDisabledTooltip: be, unsupportedFileTypeTooltip: xe }) => {
19
- let { items: Se, isLoading: Ce, error: we, path: v, onPathChange: Te, retry: Ee, onSearchFiles: De, isSearching: Oe, searchResults: ke, clearSearchResults: Ae, expandedPaths: y, loadedPaths: b, onExpandedPathsChange: x, onFolderPopupPathChange: je, folderPopupLoadingPaths: S, onUploadFiles: Me, onUploadArchive: Ne, onValidateUpload: Pe, uploadBatchState: C, cancelUpload: w, cancelUploadFile: T, clearUploadBatch: E, onCreateFolder: Fe, onCreateFolderValidate: Ie, onDownloadFiles: Le, isDownloading: Re, onDeleteFiles: ze, isDeleting: Be, onMoveToFiles: Ve, onRenameValidate: He, isRenaming: Ue, onCopyFiles: We, isCopying: Ge, isMoving: D, cancelCopyMove: Ke, uploadEnabled: O, isNewButtonDisabled: k, disabledNewButtonTooltip: A, visibleColumns: j, dateLocale: M, dateOptions: N, actionLabels: P, sharedWithMeIds: qe, sharedByMePaths: F, onUnshareFiles: Je, isUnsharing: Ye, onRemoveFilesAccess: Xe, isRemovingAccess: Ze, fileMetadata: I, isFileMetadataLoading: L, onGetInfo: Qe, clearMetadata: R, sectionTab: $e } = i, z = $e ?? u, [B, et] = ue(void 0), { handleGridApiChange: tt, reset: V } = te();
20
- le(() => {
21
- V();
22
- }, [z, V]);
23
- let H = a(() => {
19
+ }, d = ({ controller: o, labels: d, activeTab: f, tabs: p, onTabChange: m, selectedPaths: h, onSelectedPathsChange: we, variant: g, actionProfile: Te, autoSelectUploadedItems: Ee = !1, allowedFileTypes: De, maxSelectableFileSize: _, oversizedUploadMessage: Oe, isRowSelectable: v, getDisabledTooltip: ke, unsupportedFileTypeTooltip: Ae, treeContainerClassName: y, onPreview: je, onTableFileClick: Me, previewExtensions: Ne, styles: b }) => {
20
+ let { items: Pe, isLoading: Fe, error: Ie, path: x, onPathChange: Le, retry: Re, onSearchFiles: ze, isSearching: Be, searchResults: Ve, clearSearchResults: He, expandedPaths: Ue, loadedPaths: S, onExpandedPathsChange: We, onFolderPopupPathChange: Ge, folderPopupLoadingPaths: C, onUploadFiles: Ke, onUploadArchive: qe, onValidateUpload: Je, uploadBatchState: w, cancelUpload: T, cancelUploadFile: E, clearUploadBatch: D, downloadBatchState: O, cancelDownloadFile: k, cancelAllDownloads: A, clearDownloadBatch: j, onCreateFolder: Ye, onCreateFolderValidate: Xe, onDownloadFiles: Ze, onDeleteFiles: Qe, isDeleting: $e, onMoveToFiles: et, onRenameValidate: tt, isRenaming: nt, onCopyFiles: rt, isCopying: it, isMoving: M, cancelCopyMove: at, uploadEnabled: N, isNewButtonDisabled: P, disabledNewButtonTooltip: F, visibleColumns: I, dateLocale: L, dateOptions: R, actionLabels: z, sharedWithMeIds: ot, sharedByMePaths: B, onUnshareFiles: st, isUnsharing: ct, onRemoveFilesAccess: lt, isRemovingAccess: ut, fileMetadata: V, isFileMetadataLoading: H, onGetInfo: dt, clearMetadata: U, sectionTab: ft } = o, W = ft ?? f, [G, pt] = ve(void 0), { handleGridApiChange: mt, reset: K } = te();
21
+ _e(() => {
22
+ K();
23
+ }, [W, K]);
24
+ let q = s(() => {
24
25
  let e = {};
25
- return c.Download in P && (e[c.Download] = l.downloadLabel), c.Delete in P && (e[c.Delete] = l.deleteLabel), c.Rename in P && (e[c.Rename] = l.renameLabel), c.Copy in P && (e[c.Copy] = l.copyLabel), c.Move in P && (e[c.Move] = l.moveLabel), c.Duplicate in P && (e[c.Duplicate] = l.duplicateLabel), c.Unshare in P && (e[c.Unshare] = l.unshareLabel), c.RemoveAccess in P && (e[c.RemoveAccess] = l.removeAccessLabel), e;
26
+ return u.Download in z && (e[u.Download] = d.downloadLabel), u.Delete in z && (e[u.Delete] = d.deleteLabel), u.Rename in z && (e[u.Rename] = d.renameLabel), u.Copy in z && (e[u.Copy] = d.copyLabel), u.Move in z && (e[u.Move] = d.moveLabel), u.Duplicate in z && (e[u.Duplicate] = d.duplicateLabel), u.Unshare in z && (e[u.Unshare] = d.unshareLabel), u.RemoveAccess in z && (e[u.RemoveAccess] = d.removeAccessLabel), e;
26
27
  }, [
27
- P,
28
- l.downloadLabel,
29
- l.deleteLabel,
30
- l.renameLabel,
31
- l.copyLabel,
32
- l.moveLabel,
33
- l.duplicateLabel,
34
- l.unshareLabel,
35
- l.removeAccessLabel
36
- ]), U = a(() => c.Info in P ? {
37
- ...H,
38
- [c.Info]: l.infoLabel
39
- } : H, [
40
- H,
41
- P,
42
- l.infoLabel
43
- ]), W = a(() => {
44
- if (p.size === 0) return !1;
45
- for (let e of p) if (!F.has(e)) return !1;
28
+ z,
29
+ d.downloadLabel,
30
+ d.deleteLabel,
31
+ d.renameLabel,
32
+ d.copyLabel,
33
+ d.moveLabel,
34
+ d.duplicateLabel,
35
+ d.unshareLabel,
36
+ d.removeAccessLabel
37
+ ]), J = s(() => {
38
+ let e = d.previewLabel == null ? q : {
39
+ ...q,
40
+ [u.Preview]: d.previewLabel
41
+ };
42
+ return u.Info in z ? {
43
+ ...e,
44
+ [u.Info]: d.infoLabel
45
+ } : e;
46
+ }, [
47
+ q,
48
+ z,
49
+ d.infoLabel,
50
+ d.previewLabel
51
+ ]), Y = s(() => {
52
+ if (h.size === 0) return !1;
53
+ for (let e of h) if (!B.has(e)) return !1;
46
54
  return !0;
47
- }, [p, F]), G = a(() => {
48
- if (W) return H;
49
- let { [c.RemoveAccess]: e, ...t } = H;
55
+ }, [h, B]), X = s(() => {
56
+ if (Y) return q;
57
+ let { [u.RemoveAccess]: e, ...t } = q;
50
58
  return t;
51
- }, [H, W]), K = m === n.Attach, nt = a(() => ({
52
- selectionMode: me.MULTIPLE,
53
- ...K ? { filterable: !1 } : {},
54
- visibleColumns: j,
55
- dateLocale: M,
56
- dateOptions: N,
59
+ }, [q, Y]), Z = g === r.Attach, ht = s(() => ({
60
+ selectionMode: Se.MULTIPLE,
61
+ filterable: !1,
62
+ withoutHeaderBorders: !0,
63
+ containerClassName: Z ? void 0 : "rounded-none shadow-none",
64
+ visibleColumns: I,
65
+ dateLocale: L,
66
+ dateOptions: R,
57
67
  additionalGridOptions: {
58
68
  domLayout: "normal",
59
69
  rowSelection: {
60
70
  mode: "multiRow",
61
- isRowSelectable: _ ?? (() => !0)
71
+ isRowSelectable: v ?? (() => !0)
62
72
  }
63
73
  },
64
- actionLabels: U
74
+ actionLabels: J
65
75
  }), [
66
- K,
67
- j,
68
- M,
69
- N,
70
- U,
71
- _
72
- ]), rt = a(() => ({
73
- header: m === n.Attach ? null : l.treeHeaderByTab[u],
74
- containerClassName: m === n.Attach ? "min-h-0 h-full w-[360px] shrink-0 rounded-xl bg-layer-raised shadow-sm" : void 0,
75
- tabsAriaLabel: l.treeHeaderByTab[u],
76
- tabs: d,
77
- activeTab: u,
78
- onTabChange: f,
79
- expandedPaths: y,
80
- loadedPaths: b,
81
- loadingPaths: S,
82
- onExpandedPathsChange: x,
83
- actionLabels: H
76
+ I,
77
+ L,
78
+ R,
79
+ J,
80
+ v,
81
+ Z
82
+ ]), gt = s(() => ({
83
+ header: d.treeHeader ?? null,
84
+ containerClassName: y ?? (g === r.Attach ? e("relative z-1 min-h-0 h-full w-[360px] shrink-0 border-e", i.tree) : void 0),
85
+ tabsAriaLabel: d.treeHeaderByTab[f],
86
+ tabs: p,
87
+ activeTab: f,
88
+ onTabChange: m,
89
+ expandedPaths: Ue,
90
+ loadedPaths: S,
91
+ loadingPaths: C,
92
+ onExpandedPathsChange: We,
93
+ actionLabels: q
84
94
  }), [
85
- l.treeHeaderByTab,
86
- m,
87
- d,
88
- u,
89
- f,
95
+ d.treeHeader,
96
+ d.treeHeaderByTab,
90
97
  y,
91
- b,
98
+ g,
99
+ p,
100
+ f,
101
+ m,
102
+ Ue,
92
103
  S,
93
- x,
94
- H
95
- ]), q = m === n.Standalone && _e === t.Full && z === pe.MyFiles && O, it = a(() => ({
104
+ C,
105
+ We,
106
+ q
107
+ ]), _t = g === r.Standalone && Te === n.Full && W === xe.MyFiles && N, vt = s(() => ({
96
108
  showHiddenFilesToggle: !0,
97
- ...K ? { newButtonVariant: r.Neutral } : {},
98
- hiddenFilesSwitcherLabel: l.hiddenFilesLabel,
99
- showHiddenFilesLabel: l.showHiddenFilesLabel,
100
- hideHiddenFilesLabel: l.hideHiddenFilesLabel,
101
- isNewButtonDisabled: k,
102
- disabledNewButtonTooltip: A,
109
+ ...Z ? { newButtonVariant: a.Neutral } : {},
110
+ hiddenFilesSwitcherLabel: d.hiddenFilesLabel,
111
+ showHiddenFilesLabel: d.showHiddenFilesLabel,
112
+ hideHiddenFilesLabel: d.hideHiddenFilesLabel,
113
+ isNewButtonDisabled: P,
114
+ disabledNewButtonTooltip: F,
103
115
  newActions: {
104
116
  uploadFiles: {
105
- label: l.uploadFilesLabel,
117
+ label: d.uploadFilesLabel,
106
118
  icon: null
107
119
  },
108
120
  newFolder: {
109
- label: l.newFolderLabel,
121
+ label: d.newFolderLabel,
110
122
  icon: null
111
123
  },
112
- ...q ? { uploadArchive: {
113
- label: l.uploadArchiveAction,
124
+ ..._t ? { uploadArchive: {
125
+ label: d.uploadArchiveAction,
114
126
  icon: null
115
127
  } } : {}
116
128
  }
117
129
  }), [
118
- K,
119
- l.hiddenFilesLabel,
120
- l.showHiddenFilesLabel,
121
- l.hideHiddenFilesLabel,
122
- k,
123
- A,
124
- l.uploadFilesLabel,
125
- l.newFolderLabel,
126
- q,
127
- l.uploadArchiveAction
128
- ]), at = a(() => K ? void 0 : {
129
- getSelectionLabel: l.getSelectionLabel,
130
- actionLabels: G
130
+ Z,
131
+ d.hiddenFilesLabel,
132
+ d.showHiddenFilesLabel,
133
+ d.hideHiddenFilesLabel,
134
+ P,
135
+ F,
136
+ d.uploadFilesLabel,
137
+ d.newFolderLabel,
138
+ _t,
139
+ d.uploadArchiveAction
140
+ ]), yt = s(() => Z ? void 0 : {
141
+ getSelectionLabel: d.getSelectionLabel,
142
+ actionLabels: X
131
143
  }, [
132
- K,
133
- l.getSelectionLabel,
134
- G
135
- ]), ot = a(() => ({
136
- cancelLabel: l.deleteCancelLabel,
137
- confirmLabel: l.deleteConfirmLabel,
138
- closeLabel: l.deleteCloseLabel,
139
- titleRenderer: l.deleteConfirmTitle,
140
- contentRenderer: l.deleteConfirmBody
144
+ Z,
145
+ d.getSelectionLabel,
146
+ X
147
+ ]), bt = s(() => ({
148
+ cancelLabel: d.deleteCancelLabel,
149
+ confirmLabel: d.deleteConfirmLabel,
150
+ closeLabel: d.deleteCloseLabel,
151
+ titleRenderer: d.deleteConfirmTitle,
152
+ contentRenderer: d.deleteConfirmBody
141
153
  }), [
142
- l.deleteCancelLabel,
143
- l.deleteConfirmLabel,
144
- l.deleteCloseLabel,
145
- l.deleteConfirmTitle,
146
- l.deleteConfirmBody
147
- ]), st = a(() => {
154
+ d.deleteCancelLabel,
155
+ d.deleteConfirmLabel,
156
+ d.deleteCloseLabel,
157
+ d.deleteConfirmTitle,
158
+ d.deleteConfirmBody
159
+ ]), xt = s(() => {
148
160
  let e;
149
- for (let t of p) {
161
+ for (let t of h) {
150
162
  let n = ee(t);
151
163
  if (e === void 0) e = n;
152
164
  else if (e !== n) return;
153
165
  }
154
166
  return e;
155
- }, [p]), J = B != null && S.has(B), Y = J ? B : st, ct = a(() => ({
156
- copyLabel: l.copyLabel,
157
- moveLabel: l.moveLabel,
158
- addFolderLabel: l.addFolderLabel,
159
- hiddenFilesSwitcherLabel: l.hiddenFilesSwitcherLabel,
160
- getCopyHeader: l.getCopyHeader,
161
- getMoveHeader: l.getMoveHeader,
162
- disabledPathTooltip: J ? l.folderPickerLoadingTooltip : l.moveSourceDisabledTooltip,
163
- emptyStateTitle: l.folderPickerEmptyStateTitle,
164
- emptyStateDescription: l.folderPickerEmptyStateDescription,
165
- sourceFolder: Y,
166
- destinationFolderPath: B,
167
- setDestinationFolderPath: et,
168
- filesLoading: J
167
+ }, [h]), Q = G != null && C.has(G), St = Q ? G : xt, Ct = s(() => ({
168
+ copyLabel: d.copyLabel,
169
+ moveLabel: d.moveLabel,
170
+ addFolderLabel: d.addFolderLabel,
171
+ hiddenFilesSwitcherLabel: d.hiddenFilesSwitcherLabel,
172
+ getCopyHeader: d.getCopyHeader,
173
+ getMoveHeader: d.getMoveHeader,
174
+ disabledPathTooltip: Q ? d.folderPickerLoadingTooltip : d.moveSourceDisabledTooltip,
175
+ movedIntoItselfTooltip: d.movedIntoItselfTooltip,
176
+ emptyStateTitle: d.folderPickerEmptyStateTitle,
177
+ emptyStateDescription: d.folderPickerEmptyStateDescription,
178
+ sourceFolder: St,
179
+ destinationFolderPath: G,
180
+ setDestinationFolderPath: pt,
181
+ filesLoading: Q
169
182
  }), [
170
- l.copyLabel,
171
- l.moveLabel,
172
- l.addFolderLabel,
173
- l.hiddenFilesSwitcherLabel,
174
- l.getCopyHeader,
175
- l.getMoveHeader,
176
- l.folderPickerLoadingTooltip,
177
- l.moveSourceDisabledTooltip,
178
- l.folderPickerEmptyStateTitle,
179
- l.folderPickerEmptyStateDescription,
180
- J,
181
- Y,
182
- B
183
- ]), lt = ce(() => {
184
- w(), E();
185
- }, [w, E]), X = a(() => re(C?.files ?? []), [C]), ut = a(() => ({
186
- fileMetadata: I,
187
- loading: L,
188
- clearMetadata: R,
189
- header: l.metadataHeader,
190
- nameLabel: l.metadataNameLabel,
191
- pathLabel: l.metadataPathLabel,
192
- modifiedDateLabel: l.metadataModifiedDateLabel,
193
- sizeLabel: l.metadataSizeLabel,
194
- authorLabel: l.metadataAuthorLabel
183
+ d.copyLabel,
184
+ d.moveLabel,
185
+ d.addFolderLabel,
186
+ d.hiddenFilesSwitcherLabel,
187
+ d.getCopyHeader,
188
+ d.getMoveHeader,
189
+ d.folderPickerLoadingTooltip,
190
+ d.moveSourceDisabledTooltip,
191
+ d.movedIntoItselfTooltip,
192
+ d.folderPickerEmptyStateTitle,
193
+ d.folderPickerEmptyStateDescription,
194
+ Q,
195
+ St,
196
+ G
197
+ ]), wt = ge(() => {
198
+ T(), A(), D(), j();
199
+ }, [
200
+ T,
201
+ A,
202
+ D,
203
+ j
204
+ ]), Tt = ge((e) => {
205
+ let t = ae(e);
206
+ t?.kind === re.Upload ? E(t.entryId) : t?.kind === re.Download && k(t.entryId);
207
+ }, [E, k]), Et = s(() => oe(w, O, d.uploadFailureMessages), [
208
+ w,
209
+ O,
210
+ d.uploadFailureMessages
211
+ ]), Dt = w?.files.length ?? 0, Ot = O?.files.length ?? 0, kt = d.getTransferQueueTitle?.({
212
+ uploads: Dt,
213
+ downloads: Ot
214
+ }) ?? d.getUploadQueueTitle(Dt + Ot), At = s(() => ie({
215
+ uploadLabels: d.uploadQueueLabels,
216
+ downloadLabels: d.downloadQueueLabels,
217
+ mixedProgressLabel: d.transferQueueProgressAriaLabel,
218
+ uploadNames: new Set(w?.files.map((e) => e.name)),
219
+ downloadNames: new Set(O?.files.map((e) => e.name))
195
220
  }), [
196
- I,
197
- L,
198
- R,
199
- l.metadataHeader,
200
- l.metadataNameLabel,
201
- l.metadataPathLabel,
202
- l.metadataModifiedDateLabel,
203
- l.metadataSizeLabel,
204
- l.metadataAuthorLabel
205
- ]), Z = he({
206
- isDownloading: Re,
207
- isDeleting: Be,
208
- isRenaming: Ue,
209
- isMoving: D,
210
- isUnsharing: Ye,
211
- isRemovingAccess: Ze
212
- }, l), Q = "bg-layer-base", $ = a(() => v.split("/").filter(Boolean).length > 1 ? {
213
- title: l.folderEmptyStateTitle,
221
+ d.uploadQueueLabels,
222
+ d.downloadQueueLabels,
223
+ d.transferQueueProgressAriaLabel,
224
+ w,
225
+ O
226
+ ]), jt = s(() => ({
227
+ fileMetadata: V,
228
+ loading: H,
229
+ clearMetadata: U,
230
+ header: d.metadataHeader,
231
+ nameLabel: d.metadataNameLabel,
232
+ pathLabel: d.metadataPathLabel,
233
+ modifiedDateLabel: d.metadataModifiedDateLabel,
234
+ sizeLabel: d.metadataSizeLabel,
235
+ authorLabel: d.metadataAuthorLabel
236
+ }), [
237
+ V,
238
+ H,
239
+ U,
240
+ d.metadataHeader,
241
+ d.metadataNameLabel,
242
+ d.metadataPathLabel,
243
+ d.metadataModifiedDateLabel,
244
+ d.metadataSizeLabel,
245
+ d.metadataAuthorLabel
246
+ ]), $ = Ce({
247
+ isDeleting: $e,
248
+ isRenaming: nt,
249
+ isMoving: M,
250
+ isUnsharing: ct,
251
+ isRemovingAccess: ut
252
+ }, d), Mt = s(() => x.split("/").filter(Boolean).length > 1 ? {
253
+ title: d.folderEmptyStateTitle,
214
254
  description: ""
215
- } : l.emptyStateByTab[z], [
216
- v,
217
- l.folderEmptyStateTitle,
218
- l.emptyStateByTab,
219
- z
220
- ]);
221
- return /* @__PURE__ */ s(de, { children: [
222
- we == null ? /* @__PURE__ */ s("div", {
223
- className: e("relative flex min-h-0 w-full grow overflow-auto", Q),
224
- children: [/* @__PURE__ */ o(fe, {
225
- className: e("min-h-0 w-full grow", Q, K && "p-0"),
226
- contentClassName: m === n.Attach ? "px-0 pb-0" : void 0,
227
- gridClassName: m === n.Attach ? "size-full gap-6 px-6 py-4" : "size-full",
228
- items: Se,
229
- path: v,
230
- onPathChange: Te,
231
- onGridApiChange: tt,
232
- filesLoading: Ce,
233
- allowedFileTypes: ye,
234
- maxSelectableFileSize: h,
235
- maxFileSize: h,
236
- uploadValidationMessages: g == null ? void 0 : { oversizedFiles: g },
237
- selectedPaths: p,
238
- onSelectedPathsChange: ge,
239
- navigationPanelOptions: {
240
- searchable: !0,
241
- placeholder: l.searchPlaceholderByTab?.[z]
242
- },
243
- hideSearchPathItemName: !0,
244
- onSearchFiles: De,
245
- searchInProgress: Oe,
246
- searchResults: ke ?? [],
247
- clearSearchResults: Ae,
248
- gridOptions: nt,
249
- treeOptions: rt,
250
- onFolderPopupPathChange: je,
251
- toolbarOptions: it,
252
- bulkActionsToolbarOptions: at,
253
- autoSelectUploadedItems: ve,
254
- emptyStateTitle: $.title,
255
- emptyStateDescription: $.description,
256
- searchEmptyStateTitle: l.searchEmptyStateTitle,
257
- uploadEnabled: O,
258
- sharedWithMeIds: qe,
259
- sharedByMePaths: F,
260
- onUnshareFiles: Je,
261
- onRemoveFilesAccess: Xe,
262
- fileMetadataPopupOptions: ut,
263
- onGetInfo: Qe,
264
- onUploadFiles: Me,
265
- onUploadArchive: Ne,
266
- onValidateUpload: Pe,
267
- onCreateFolder: Fe,
268
- onCreateFolderValidate: Ie,
269
- onDownloadFiles: Le,
270
- onDeleteFiles: ze,
271
- onMoveToFiles: Ve,
272
- onCopyFiles: We,
273
- onRenameValidate: He,
274
- renameValidationMessages: l.renameValidationMessages,
275
- isRenameFileAvailable: O,
276
- deleteConfirmationOptions: ot,
277
- conflictResolutionPopupOptions: l.conflictResolutionPopupOptions,
278
- destinationFolderPopupOptions: ct,
279
- forbiddenSymbolsRegExp: ie,
280
- forbiddenSymbolsTooltip: l.forbiddenSymbolsTooltip,
281
- getDisabledTooltip: be,
282
- unsupportedFileTypeTooltip: xe
283
- }), Z != null && /* @__PURE__ */ o("div", {
284
- "aria-live": "polite",
285
- className: "absolute inset-0 z-[52] flex items-center justify-center bg-backdrop desktop:p-4",
286
- children: /* @__PURE__ */ o(oe, {
287
- size: 32,
288
- fullWidth: !1,
289
- ariaLabel: Z
255
+ } : d.emptyStateByTab[W], [
256
+ x,
257
+ d.folderEmptyStateTitle,
258
+ d.emptyStateByTab,
259
+ W
260
+ ]), Nt = t({
261
+ "--dfms-surface": b?.colors?.surface,
262
+ "--dfms-tree-bg": b?.colors?.treeBackground,
263
+ "--dfms-tree-border": b?.colors?.treeBorder,
264
+ "--dfms-tree-shadow": b?.colors?.treeShadow,
265
+ "--dfms-overlay-backdrop": b?.colors?.overlayBackdrop
266
+ });
267
+ return /* @__PURE__ */ l(ye, { children: [
268
+ Ie == null ? /* @__PURE__ */ l("div", {
269
+ style: Nt,
270
+ className: e("relative flex min-h-0 w-full grow overflow-auto", i.surface),
271
+ children: [
272
+ /* @__PURE__ */ c(be, {
273
+ className: e("min-h-0 w-full grow", i.surface, Z && "p-0"),
274
+ contentClassName: Z ? "px-0 pb-0" : void 0,
275
+ gridClassName: g === r.Attach ? "size-full gap-6 px-6 py-4" : "size-full",
276
+ items: Pe,
277
+ path: x,
278
+ onPathChange: Le,
279
+ onGridApiChange: mt,
280
+ filesLoading: Fe,
281
+ allowedFileTypes: De,
282
+ maxSelectableFileSize: _,
283
+ maxFileSize: _,
284
+ uploadValidationMessages: Oe == null ? void 0 : { oversizedFiles: Oe },
285
+ selectedPaths: h,
286
+ onSelectedPathsChange: we,
287
+ navigationPanelOptions: {
288
+ searchable: !0,
289
+ placeholder: d.searchPlaceholderByTab?.[W]
290
+ },
291
+ hideSearchPathItemName: !0,
292
+ onSearchFiles: ze,
293
+ searchInProgress: Be,
294
+ searchResults: Ve ?? [],
295
+ clearSearchResults: He,
296
+ gridOptions: ht,
297
+ treeOptions: gt,
298
+ onFolderPopupPathChange: Ge,
299
+ toolbarOptions: vt,
300
+ bulkActionsToolbarOptions: yt,
301
+ autoSelectUploadedItems: Ee,
302
+ emptyStateTitle: Mt.title,
303
+ emptyStateDescription: Mt.description,
304
+ searchEmptyStateTitle: d.searchEmptyStateTitle,
305
+ uploadEnabled: N,
306
+ sharedWithMeIds: ot,
307
+ sharedByMePaths: B,
308
+ onUnshareFiles: st,
309
+ onRemoveFilesAccess: lt,
310
+ fileMetadataPopupOptions: jt,
311
+ onGetInfo: dt,
312
+ onPreview: je,
313
+ onTableFileClick: Me,
314
+ previewExtensions: Ne,
315
+ onUploadFiles: Ke,
316
+ onUploadArchive: qe,
317
+ onValidateUpload: Je,
318
+ onCreateFolder: Ye,
319
+ onCreateFolderValidate: Xe,
320
+ onDownloadFiles: Ze,
321
+ onDeleteFiles: Qe,
322
+ onMoveToFiles: et,
323
+ onCopyFiles: rt,
324
+ onRenameValidate: tt,
325
+ renameValidationMessages: d.renameValidationMessages,
326
+ isRenameFileAvailable: N,
327
+ deleteConfirmationOptions: bt,
328
+ conflictResolutionPopupOptions: d.conflictResolutionPopupOptions,
329
+ destinationFolderPopupOptions: Ct,
330
+ forbiddenSymbolsRegExp: pe,
331
+ forbiddenSymbolsTooltip: d.forbiddenSymbolsTooltip,
332
+ getDisabledTooltip: ke,
333
+ unsupportedFileTypeTooltip: Ae
334
+ }),
335
+ /* @__PURE__ */ c(de, {
336
+ visuallyHidden: !0,
337
+ as: fe.Span,
338
+ children: $ ?? ""
339
+ }),
340
+ $ != null && /* @__PURE__ */ c("div", {
341
+ className: e("absolute inset-0 z-52 flex items-center justify-center desktop:p-4", i.overlay),
342
+ children: /* @__PURE__ */ c(me, {
343
+ size: 32,
344
+ fullWidth: !1,
345
+ ariaLabel: $
346
+ })
290
347
  })
291
- })]
292
- }) : /* @__PURE__ */ s("div", {
293
- role: "alert",
294
- className: "flex flex-col items-center gap-4 p-6",
295
- children: [/* @__PURE__ */ o("p", { children: l.errorMessage }), /* @__PURE__ */ o(ae, {
296
- label: l.retryLabel,
297
- onClick: Ee
298
- })]
348
+ ]
349
+ }) : /* @__PURE__ */ c("div", {
350
+ className: "p-6",
351
+ children: /* @__PURE__ */ c(ue, {
352
+ message: d.errorMessage,
353
+ action: /* @__PURE__ */ c(se, {
354
+ variant: a.Neutral,
355
+ appearance: ce.Outlined,
356
+ size: le.Small,
357
+ label: d.retryLabel,
358
+ onClick: Re
359
+ })
360
+ })
299
361
  }),
300
- /* @__PURE__ */ o("div", {
301
- className: "fixed bottom-4 end-4 z-[70]",
302
- children: /* @__PURE__ */ o(se, {
303
- title: l.getUploadQueueTitle(X.length),
304
- items: X,
305
- onClose: lt,
306
- onCancelItem: T,
307
- labels: l.uploadQueueLabels
362
+ /* @__PURE__ */ c("div", {
363
+ className: "fixed inset-e-4 bottom-4 z-51",
364
+ children: /* @__PURE__ */ c(he, {
365
+ title: kt,
366
+ items: Et,
367
+ onClose: wt,
368
+ onCancelItem: Tt,
369
+ labels: At
308
370
  })
309
371
  }),
310
- (Ge || D) && /* @__PURE__ */ o(ne, {
311
- title: D ? l.operationLoaderMoveTitle : l.operationLoaderCopyTitle,
312
- text: D ? l.movingLabel : l.copyingLabel,
313
- cancelLabel: l.operationLoaderCancelLabel,
314
- onCancel: Ke
372
+ (it || M) && /* @__PURE__ */ c(ne, {
373
+ title: M ? d.operationLoaderMoveTitle : d.operationLoaderCopyTitle,
374
+ text: M ? d.movingLabel : d.copyingLabel,
375
+ cancelLabel: d.operationLoaderCancelLabel,
376
+ onCancel: at,
377
+ colors: b?.operationLoader,
378
+ textClassName: b?.operationLoaderTextClassName
315
379
  })
316
380
  ] });
317
381
  };
318
- i(l);
382
+ o(d);
319
383
  //#endregion
320
- export { l as DialFileManagerShell };
384
+ export { d as DialFileManagerShell };