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