@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.
Files changed (181) hide show
  1. package/components/CopyButton/CopyButton.js +33 -0
  2. package/components/DeploymentIcon/DeploymentIcon.js +62 -0
  3. package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -0
  4. package/components/EntityHeader/EntityHeader.js +48 -0
  5. package/components/EntityTypeLabel/EntityTypeLabel.js +10 -0
  6. package/components/FeaturedChip/FeaturedChip.js +18 -0
  7. package/components/InitialsAvatar/InitialsAvatar.js +29 -0
  8. package/components/InitialsAvatar/InitialsAvatar.module.scss.js +6 -0
  9. package/components/ItemHeader/ItemHeader.js +35 -0
  10. package/components/ItemHeader/ItemHeader.module.scss.js +6 -0
  11. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +104 -0
  12. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +10 -0
  13. package/components/MarkdownRenderer/CodeBlock/syntax-theme.js +69 -0
  14. package/components/MarkdownRenderer/MDMessageViewer.js +22 -0
  15. package/components/MarkdownRenderer/MarkdownRenderer.js +280 -0
  16. package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +11 -0
  17. package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +24 -0
  18. package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +6 -0
  19. package/components/MarkdownRenderer/Table/MarkdownTable.js +77 -0
  20. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +15 -0
  21. package/components/MarkdownRenderer/Table/TableHeader.js +30 -0
  22. package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -0
  23. package/components/MarkdownRenderer/Table/table-serialization.js +6 -0
  24. package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +66 -0
  25. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.js +12 -0
  26. package/components/MarkdownRenderer/markdown-class-names.js +23 -0
  27. package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js +18 -0
  28. package/components/PanelEmptyState/PanelEmptyState.js +17 -0
  29. package/components/PanelEmptyState/PanelEmptyState.module.scss.js +3 -0
  30. package/components/ResourceSummary/ResourceSummary.js +34 -0
  31. package/components/ResourceSummary/ResourceSummary.module.scss.js +6 -0
  32. package/constants/breakpoint.js +4 -0
  33. package/constants/dial.js +4 -0
  34. package/constants/entity-colors.js +17 -0
  35. package/constants/icon.js +13 -0
  36. package/constants/markdown-editor.js +4 -0
  37. package/constants/mime-types.js +99 -0
  38. package/constants/resizable-fields.js +4 -0
  39. package/constants/select-list.js +4 -0
  40. package/constants/tag-input.js +4 -0
  41. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +299 -0
  42. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +108 -0
  43. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +36 -0
  44. package/file-manager/UploadProgressModal/UploadProgressModal.js +56 -0
  45. package/file-manager/file-manager-variant.js +8 -0
  46. package/file-manager/path.js +7 -0
  47. package/file-manager/upload-batch.js +6 -0
  48. package/file-manager/useGridEditingScroll/useGridEditingScroll.js +45 -0
  49. package/file-manager.d.ts +491 -0
  50. package/file-manager.js +3 -0
  51. package/hooks/useAvailableHeightCap.js +36 -0
  52. package/hooks/useCodeCopy.js +20 -0
  53. package/hooks/useCollapsedText.js +38 -0
  54. package/hooks/useHorizontalOverflow.js +25 -0
  55. package/hooks/useIsMobile.js +13 -0
  56. package/hooks/useStreamedMarkdownContent.js +32 -0
  57. package/index.css +1 -1
  58. package/index.d.ts +2505 -43
  59. package/index.js +64 -49151
  60. package/markdown.d.ts +401 -0
  61. package/markdown.js +11 -0
  62. package/models/chat.js +14 -0
  63. package/models/conversation-classification.js +6 -0
  64. package/models/conversation-transfer.js +14 -0
  65. package/models/deployment-features.js +6 -0
  66. package/package.json +43 -12
  67. package/types/attachment.js +8 -0
  68. package/types/code-editor.js +6 -0
  69. package/types/entity-type.js +6 -0
  70. package/types/mime-type.js +8 -0
  71. package/utils/annotation.js +120 -0
  72. package/utils/avatar-color.js +37 -0
  73. package/utils/build-css-vars.js +8 -0
  74. package/utils/copy-to-clipboard.js +69 -0
  75. package/utils/file-download.js +79 -0
  76. package/utils/format-file-size.js +4 -0
  77. package/utils/format-last-used.js +20 -0
  78. package/utils/format-price.js +18 -0
  79. package/utils/generate-uuid.js +7 -0
  80. package/utils/initials.js +7 -0
  81. package/utils/is-audio-transcription-supported.js +5 -0
  82. package/utils/latex.js +79 -0
  83. package/utils/merge-class.js +8 -0
  84. package/utils/message-attachment-to-display.js +31 -0
  85. package/utils/message.js +5 -0
  86. package/utils/mime-type.js +73 -0
  87. package/utils/prompt-variables.js +58 -0
  88. package/utils/string-utils.js +14 -0
  89. package/components/CopyButton/CopyButton.d.ts +0 -15
  90. package/components/CopyButton/CopyButton.d.ts.map +0 -1
  91. package/components/DeploymentIcon/DeploymentIcon.d.ts +0 -36
  92. package/components/DeploymentIcon/DeploymentIcon.d.ts.map +0 -1
  93. package/components/InitialsAvatar/InitialsAvatar.d.ts +0 -13
  94. package/components/InitialsAvatar/InitialsAvatar.d.ts.map +0 -1
  95. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +0 -47
  96. package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +0 -1
  97. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts +0 -7
  98. package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +0 -1
  99. package/components/MarkdownRenderer/MDMessageViewer.d.ts +0 -31
  100. package/components/MarkdownRenderer/MDMessageViewer.d.ts.map +0 -1
  101. package/components/MarkdownRenderer/MarkdownRenderer.d.ts +0 -105
  102. package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +0 -1
  103. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +0 -31
  104. package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +0 -1
  105. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts +0 -9
  106. package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts.map +0 -1
  107. package/components/MarkdownRenderer/markdown-class-names.d.ts +0 -4
  108. package/components/MarkdownRenderer/markdown-class-names.d.ts.map +0 -1
  109. package/components/PanelEmptyState/PanelEmptyState.d.ts +0 -20
  110. package/components/PanelEmptyState/PanelEmptyState.d.ts.map +0 -1
  111. package/constants/dial.d.ts +0 -3
  112. package/constants/dial.d.ts.map +0 -1
  113. package/constants/icon.d.ts +0 -14
  114. package/constants/icon.d.ts.map +0 -1
  115. package/constants/mime-types.d.ts +0 -7
  116. package/constants/mime-types.d.ts.map +0 -1
  117. package/hooks/useCodeCopy.d.ts +0 -6
  118. package/hooks/useCodeCopy.d.ts.map +0 -1
  119. package/hooks/useCollapsedText.d.ts +0 -27
  120. package/hooks/useCollapsedText.d.ts.map +0 -1
  121. package/hooks/useIsMobile.d.ts +0 -3
  122. package/hooks/useIsMobile.d.ts.map +0 -1
  123. package/hooks/useStreamedMarkdownContent.d.ts +0 -3
  124. package/hooks/useStreamedMarkdownContent.d.ts.map +0 -1
  125. package/hooks/useTableScroll.d.ts +0 -17
  126. package/hooks/useTableScroll.d.ts.map +0 -1
  127. package/index.d.ts.map +0 -1
  128. package/models/annotation.d.ts +0 -78
  129. package/models/annotation.d.ts.map +0 -1
  130. package/models/auth.d.ts +0 -26
  131. package/models/auth.d.ts.map +0 -1
  132. package/models/chat.d.ts +0 -276
  133. package/models/chat.d.ts.map +0 -1
  134. package/models/custom-visualizer.d.ts +0 -61
  135. package/models/custom-visualizer.d.ts.map +0 -1
  136. package/models/deployment-configuration.d.ts +0 -55
  137. package/models/deployment-configuration.d.ts.map +0 -1
  138. package/models/deployment-features.d.ts +0 -17
  139. package/models/deployment-features.d.ts.map +0 -1
  140. package/models/deployment.d.ts +0 -31
  141. package/models/deployment.d.ts.map +0 -1
  142. package/models/dial-model.d.ts +0 -19
  143. package/models/dial-model.d.ts.map +0 -1
  144. package/models/import-export.d.ts +0 -23
  145. package/models/import-export.d.ts.map +0 -1
  146. package/models/theme.d.ts +0 -36
  147. package/models/theme.d.ts.map +0 -1
  148. package/models/tool-menu-item.d.ts +0 -13
  149. package/models/tool-menu-item.d.ts.map +0 -1
  150. package/types/attachment.d.ts +0 -23
  151. package/types/attachment.d.ts.map +0 -1
  152. package/types/code-editor.d.ts +0 -8
  153. package/types/code-editor.d.ts.map +0 -1
  154. package/types/mime-type.d.ts +0 -53
  155. package/types/mime-type.d.ts.map +0 -1
  156. package/utils/avatar-color.d.ts +0 -10
  157. package/utils/avatar-color.d.ts.map +0 -1
  158. package/utils/build-css-vars.d.ts +0 -4
  159. package/utils/build-css-vars.d.ts.map +0 -1
  160. package/utils/copy-to-clipboard.d.ts +0 -3
  161. package/utils/copy-to-clipboard.d.ts.map +0 -1
  162. package/utils/file-download.d.ts +0 -9
  163. package/utils/file-download.d.ts.map +0 -1
  164. package/utils/format-file-size.d.ts +0 -3
  165. package/utils/format-file-size.d.ts.map +0 -1
  166. package/utils/format-last-used.d.ts +0 -3
  167. package/utils/format-last-used.d.ts.map +0 -1
  168. package/utils/initials.d.ts +0 -3
  169. package/utils/initials.d.ts.map +0 -1
  170. package/utils/is-audio-transcription-supported.d.ts +0 -3
  171. package/utils/is-audio-transcription-supported.d.ts.map +0 -1
  172. package/utils/latex.d.ts +0 -11
  173. package/utils/latex.d.ts.map +0 -1
  174. package/utils/merge-class.d.ts +0 -4
  175. package/utils/merge-class.d.ts.map +0 -1
  176. package/utils/message-attachment-to-display.d.ts +0 -22
  177. package/utils/message-attachment-to-display.d.ts.map +0 -1
  178. package/utils/message.d.ts +0 -4
  179. package/utils/message.d.ts.map +0 -1
  180. package/utils/string-utils.d.ts +0 -5
  181. package/utils/string-utils.d.ts.map +0 -1
@@ -0,0 +1,45 @@
1
+ import { useCallback as e, useEffect as t, useRef as n } from "react";
2
+ //#region src/file-manager/useGridEditingScroll/useGridEditingScroll.ts
3
+ var r = (e) => {
4
+ if (e.id) {
5
+ let t = document.querySelector(`[row-id="${e.id}"]`);
6
+ if (t) return t;
7
+ }
8
+ return e.rowIndex == null ? null : document.querySelector(`[row-index="${e.rowIndex}"]`);
9
+ }, i = (e, t) => {
10
+ requestAnimationFrame(() => {
11
+ requestAnimationFrame(() => {
12
+ !e.isDestroyed() && t.rowIndex != null && e.ensureNodeVisible(t, "middle"), r(t)?.scrollIntoView({
13
+ block: "center",
14
+ behavior: "auto"
15
+ });
16
+ });
17
+ });
18
+ }, a = (e) => e.find((e) => e.data?.isTemporary) ?? e[0] ?? null, o = ({ resolveTargetNode: r = a } = {}) => {
19
+ let o = n(/* @__PURE__ */ new Set()), s = n(!1), c = n(null), l = e(() => {
20
+ o.current = /* @__PURE__ */ new Set(), s.current = !1;
21
+ }, []), u = e((e) => {
22
+ let { api: t } = e;
23
+ !t.isDestroyed() && e.rowIndex != null && t.ensureIndexVisible(e.rowIndex);
24
+ }, []), d = e((e) => {
25
+ let { api: t } = e, n = /* @__PURE__ */ new Set(), a = [];
26
+ t.forEachNode((e) => {
27
+ let t = e.data?.id;
28
+ t && (n.add(t), s.current && !o.current.has(t) && a.push(e));
29
+ }), o.current = n, s.current = !0;
30
+ let c = r(a);
31
+ c && i(t, c);
32
+ }, [r]), f = e((e) => {
33
+ let t = c.current;
34
+ t !== e && (t != null && (t.removeEventListener("cellEditingStarted", u), t.removeEventListener("rowDataUpdated", d)), e.addEventListener("cellEditingStarted", u), e.addEventListener("rowDataUpdated", d), c.current = e);
35
+ }, [u, d]);
36
+ return t(() => () => {
37
+ let e = c.current;
38
+ e != null && !e.isDestroyed() && (e.removeEventListener("cellEditingStarted", u), e.removeEventListener("rowDataUpdated", d)), c.current = null;
39
+ }, [u, d]), {
40
+ handleGridApiChange: f,
41
+ reset: l
42
+ };
43
+ };
44
+ //#endregion
45
+ export { o as useGridEditingScroll };
@@ -0,0 +1,491 @@
1
+ import { ComponentProps } from 'react';
2
+ import { DialCopiedItem } from '@epam/ai-dial-react-file-manager';
3
+ import { DialDeletedItem } from '@epam/ai-dial-react-file-manager';
4
+ import { DialFile } from '@epam/ai-dial-react-file-manager';
5
+ import { DialFileAcceptType } from '@epam/ai-dial-react-file-manager';
6
+ import { DialFileManager } from '@epam/ai-dial-react-file-manager';
7
+ import { DialFileManagerActions } from '@epam/ai-dial-react-file-manager';
8
+ import { DialFileManagerTabs } from '@epam/ai-dial-react-file-manager';
9
+ import { DialFileNodeType } from '@epam/ai-dial-react-file-manager';
10
+ import { DialUploadFileItem } from '@epam/ai-dial-react-file-manager';
11
+ import { FC } from 'react';
12
+ import { FileManagerColumnKey } from '@epam/ai-dial-react-file-manager';
13
+ import { FileManagerGridRow } from '@epam/ai-dial-react-file-manager';
14
+ import { ReactNode } from 'react';
15
+ import { ToolbarOptions } from '@epam/ai-dial-react-file-manager';
16
+
17
+ /** Result returned by the file-manager attach modal when the user confirms a selection. */
18
+ declare interface AttachResult {
19
+ /** Selected files (individual items, not folders). */
20
+ files: DialFile[];
21
+ /** Virtual paths of selected folders. */
22
+ folderPaths: string[];
23
+ }
24
+
25
+ /** Options for the conflict-resolution popup shown during copy/move operations. */
26
+ declare type ConflictResolutionPopupOptions = NonNullable<DialFileManagerComponentProps['conflictResolutionPopupOptions']>;
27
+
28
+ /**
29
+ * Gates which actions `useDialFileManager` exposes per tab. `Attach` excludes
30
+ * Copy/Move/Duplicate (it is a file picker, not a management surface); `Browse`
31
+ * exposes the full #7503 action set. `Full` is reserved for
32
+ * `DialFileManagerVariant.FolderPicker` (#7503+).
33
+ */
34
+ declare enum DialFileManagerActionProfile {
35
+ Attach = "attach",
36
+ Browse = "browse",
37
+ Full = "full"
38
+ }
39
+
40
+ declare type DialFileManagerComponentProps = ComponentProps<typeof DialFileManager>;
41
+
42
+ /**
43
+ * Renders the DialFileManager grid/tree/toolbar and its operation overlays
44
+ * from a `FileManagerController`. Does not own popup chrome, an attach footer,
45
+ * or any attach-only selection constraints — those are host-owned.
46
+ */
47
+ export declare const DialFileManagerShell: FC<DialFileManagerShellProps>;
48
+
49
+ /**
50
+ * Pre-translated strings and resolved renderers the shell renders as-is.
51
+ * The shell never calls `useTranslation` — every host (the attach modal
52
+ * today; a future standalone page) resolves these via its own i18n.
53
+ */
54
+ declare interface DialFileManagerShellLabels {
55
+ /** Error message shown when the current folder listing fails. */
56
+ errorMessage: string;
57
+ /** Label for the retry button shown alongside the error message. */
58
+ retryLabel: string;
59
+ /** Label for the hidden-files toggle in the toolbar. */
60
+ hiddenFilesLabel: string;
61
+ /** Label shown when hidden files are currently visible. */
62
+ showHiddenFilesLabel: string;
63
+ /** Label shown when hidden files are currently hidden. */
64
+ hideHiddenFilesLabel: string;
65
+ /** Returns a bulk-selection count label (e.g. "3 selected"). */
66
+ getSelectionLabel: (count: number) => string;
67
+ /** Label for the "Upload files" action in the New menu. */
68
+ uploadFilesLabel: string;
69
+ /** Label for the "Upload archive" action in the New menu. */
70
+ uploadArchiveAction: string;
71
+ /** Label for the "New folder" action in the New menu. */
72
+ newFolderLabel: string;
73
+ /** Label for the Download action. */
74
+ downloadLabel: string;
75
+ /** Overlay label shown while a download is in progress. */
76
+ downloadingLabel: string;
77
+ /** Label for the Delete action. */
78
+ deleteLabel: string;
79
+ /** Overlay label shown while a delete operation is in progress. */
80
+ deletingLabel: string;
81
+ /** Label for the Rename action. */
82
+ renameLabel: string;
83
+ /** Overlay label shown while a rename operation is in progress. */
84
+ renamingLabel: string;
85
+ /** Label for the Copy action. */
86
+ copyLabel: string;
87
+ /** Label for the Move action. */
88
+ moveLabel: string;
89
+ /** Label for the Duplicate action. */
90
+ duplicateLabel: string;
91
+ /** Label for the "Add folder" button in the destination picker. */
92
+ addFolderLabel: string;
93
+ /** Label for the hidden-files toggle in the destination-folder picker. */
94
+ hiddenFilesSwitcherLabel: string;
95
+ /** Returns the header for the copy destination popup. */
96
+ getCopyHeader: (count: number, name?: string) => string;
97
+ /** Returns the header for the move destination popup. */
98
+ getMoveHeader: (count: number, name?: string) => string;
99
+ /** Tooltip shown on the disabled source folder in the destination picker. */
100
+ moveSourceDisabledTooltip: string;
101
+ /** Tooltip shown when a destination folder is still loading. */
102
+ folderPickerLoadingTooltip: string;
103
+ /** Empty-state title in the destination-folder picker. */
104
+ folderPickerEmptyStateTitle: string;
105
+ /** Empty-state description in the destination-folder picker. */
106
+ folderPickerEmptyStateDescription: string;
107
+ /** Overlay text shown during a copy operation. */
108
+ copyingLabel: string;
109
+ /** Overlay text shown during a move operation. */
110
+ movingLabel: string;
111
+ /** Title for the copy operation loader modal. */
112
+ operationLoaderCopyTitle: string;
113
+ /** Title for the move operation loader modal. */
114
+ operationLoaderMoveTitle: string;
115
+ /** Cancel-button label in the operation loader modal. */
116
+ operationLoaderCancelLabel: string;
117
+ /** Returns the delete confirmation dialog title for the given item names. */
118
+ deleteConfirmTitle: (names: string[]) => ReactNode;
119
+ /** Returns the delete confirmation dialog body for the given item names. */
120
+ deleteConfirmBody: (names: string[]) => ReactNode;
121
+ /** Confirm-button label in the delete confirmation dialog. */
122
+ deleteConfirmLabel: string;
123
+ /** Cancel-button label in the delete confirmation dialog. */
124
+ deleteCancelLabel: string;
125
+ /** Title for the upload progress modal. */
126
+ uploadProgressTitle: string;
127
+ /** Cancel-button label in the upload progress modal. */
128
+ cancelLabel: string;
129
+ /** Returns upload progress text (e.g. "3 of 5 uploaded"). */
130
+ getUploadProgressText: (done: number, total: number) => string;
131
+ /** Empty-state title when a search yields no results. */
132
+ searchEmptyStateTitle: string;
133
+ /** Empty-state title for an empty subfolder. */
134
+ folderEmptyStateTitle: string;
135
+ /** Tooltip explaining which symbols are forbidden in file names. */
136
+ forbiddenSymbolsTooltip: string;
137
+ /** Per-tab empty-state title and description. */
138
+ emptyStateByTab: Record<DialFileManagerTabs, EmptyStateCopy>;
139
+ /** Per-tab tree header label. */
140
+ treeHeaderByTab: Record<DialFileManagerTabs, string>;
141
+ /** Messages for inline rename validation. */
142
+ renameValidationMessages: RenameValidationMessages;
143
+ /** Options for the conflict resolution popup. */
144
+ conflictResolutionPopupOptions: ConflictResolutionPopupOptions;
145
+ /** Label for the Unshare action. */
146
+ unshareLabel: string;
147
+ /** Overlay label shown while an unshare operation is in progress. */
148
+ unsharingLabel: string;
149
+ /** Label for the Remove Access action. */
150
+ removeAccessLabel: string;
151
+ /** Overlay label shown while a remove-access operation is in progress. */
152
+ removingAccessLabel: string;
153
+ /** Label for the Info action. */
154
+ infoLabel: string;
155
+ /** Header for the metadata popup. */
156
+ metadataHeader: string;
157
+ /** Label for the file name in the metadata popup. */
158
+ metadataNameLabel: string;
159
+ /** Label for the file path in the metadata popup. */
160
+ metadataPathLabel: string;
161
+ /** Label for the modified date in the metadata popup. */
162
+ metadataModifiedDateLabel: string;
163
+ /** Label for the file size in the metadata popup. */
164
+ metadataSizeLabel: string;
165
+ /** Label for the author in the metadata popup. */
166
+ metadataAuthorLabel: string;
167
+ }
168
+
169
+ /** Props for the shared file-manager shell component. */
170
+ export declare interface DialFileManagerShellProps {
171
+ /** Structural view contract containing all controller state and callbacks. */
172
+ controller: FileManagerController;
173
+ /** Pre-translated labels the shell renders as-is. */
174
+ labels: DialFileManagerShellLabels;
175
+ /** Currently active tab. */
176
+ activeTab: DialFileManagerTabs;
177
+ /** Tab configuration for the toolbar. */
178
+ tabs: ToolbarOptions['tabs'];
179
+ /** Called when the user switches tabs. */
180
+ onTabChange: (tab: DialFileManagerTabs) => void;
181
+ /** Set of currently selected file/folder virtual paths. */
182
+ selectedPaths: Set<string>;
183
+ /** Called when the selection changes. */
184
+ onSelectedPathsChange: (paths: Set<string>) => void;
185
+ /** Host driving this shell instance — gates the upload-archive toolbar entry (standalone-only). */
186
+ variant: DialFileManagerVariant;
187
+ /** Action-set gate for the upload-archive toolbar entry (Full-only). */
188
+ actionProfile: DialFileManagerActionProfile;
189
+ /** Whether to auto-select items after upload completes. Defaults to `false`. */
190
+ autoSelectUploadedItems?: boolean;
191
+ /** MIME type filters for selectable files. */
192
+ allowedFileTypes?: DialFileAcceptType[];
193
+ /** Maximum file size in bytes for selectable files. */
194
+ maxSelectableFileSize?: number;
195
+ /** Custom row-selectability predicate, forwarded to the grid's row selection. */
196
+ isRowSelectable?: (node: {
197
+ data?: FileManagerSelectableNode | null;
198
+ }) => boolean;
199
+ /** Returns a tooltip for disabled rows, or undefined for enabled rows. */
200
+ getDisabledTooltip?: (row: FileManagerGridRow) => string | undefined;
201
+ /** Tooltip shown on files with an unsupported type. */
202
+ unsupportedFileTypeTooltip?: string;
203
+ }
204
+
205
+ /**
206
+ * Identifies which host is driving `useDialFileManager` / `DialFileManagerShell`.
207
+ * `FolderPicker` is a reserved value with no implemented UI yet (#7503+).
208
+ */
209
+ declare enum DialFileManagerVariant {
210
+ Attach = "attach",
211
+ Standalone = "standalone",
212
+ FolderPicker = "folder-picker"
213
+ }
214
+
215
+ /** Title and description pair for an empty-state display. */
216
+ declare interface EmptyStateCopy {
217
+ /** Primary empty-state heading. */
218
+ title: string;
219
+ /** Secondary empty-state description text. */
220
+ description: string;
221
+ }
222
+
223
+ /** File-manager modal with Popup chrome and an Attach footer. Selection and tab state are controlled by the host. */
224
+ export declare const FileManagerAttachModal: FC<FileManagerAttachModalProps>;
225
+
226
+ /**
227
+ * Labels for `FileManagerAttachModal`. Extends the shell labels with
228
+ * attach-specific strings.
229
+ *
230
+ * Declared here rather than beside the component so a host can type its label
231
+ * object from this package's root entry without reaching the `./file-manager`
232
+ * entry, which is the one that pulls in the grid.
233
+ */
234
+ declare interface FileManagerAttachModalLabels extends DialFileManagerShellLabels {
235
+ /** Title displayed in the Popup header. */
236
+ title: string;
237
+ /** Label for the primary Attach button. */
238
+ attachLabel: string;
239
+ /** Optional subtitle shown below the title (e.g. allowed types / size). Pass `null` to hide. */
240
+ headerDescription?: string | null;
241
+ }
242
+
243
+ /** Props accepted by `FileManagerAttachModal`. */
244
+ export declare interface FileManagerAttachModalProps {
245
+ /** Whether the modal is open. */
246
+ isOpen: boolean;
247
+ /** Called when the modal requests to be closed. */
248
+ onClose: () => void;
249
+ /** Called with the confirmed selection when the user presses Attach. */
250
+ onAttach: (result: AttachResult) => void;
251
+ /** Called when one or more selected files were filtered out due to an unsupported type. */
252
+ onSkippedUnsupportedFiles?: () => void;
253
+ /** Called when the total attachment count would exceed the limit. */
254
+ onCountLimitExceeded?: (totalCount: number, limit: number) => void;
255
+ /** Live file-manager state driving the grid. */
256
+ controller: FileManagerController;
257
+ /**
258
+ * True while any mutating operation is in progress (upload, delete, rename, etc.).
259
+ * Disables the Attach button alongside `isLoading`.
260
+ */
261
+ isAnyOperationInProgress: boolean;
262
+ /** Currently active tab. */
263
+ activeTab: DialFileManagerTabs;
264
+ /** Tab configuration for the toolbar. */
265
+ tabs: ToolbarOptions['tabs'];
266
+ /**
267
+ * Called when the user switches tabs.
268
+ * The host is responsible for resetting `selectedPaths` to an empty set.
269
+ */
270
+ onTabChange: (tab: DialFileManagerTabs) => void;
271
+ /** All user-visible strings. */
272
+ labels: FileManagerAttachModalLabels;
273
+ /** File-manager variant (controls which toolbar entries are shown). */
274
+ variant: DialFileManagerVariant;
275
+ /** Action profile controlling toolbar entry visibility. */
276
+ actionProfile: DialFileManagerActionProfile;
277
+ /**
278
+ * Current set of selected virtual paths, managed by the host.
279
+ * The host must reset this to an empty set when the active tab changes.
280
+ */
281
+ selectedPaths: Set<string>;
282
+ /** Called when the user changes the grid selection. */
283
+ onSelectedPathsChange: (paths: Set<string>) => void;
284
+ /**
285
+ * Resolves a folder `DialFile` to its DIAL Core path string for inclusion in
286
+ * `AttachResult.folderPaths`. Return `null` to skip the folder.
287
+ * Path normalization and bucket resolution are the host's responsibility.
288
+ */
289
+ resolveFolderPath: (file: DialFile) => string | null;
290
+ /**
291
+ * Returns `false` for file content-types that must be filtered out on attach.
292
+ * When absent, all content types are accepted.
293
+ */
294
+ isFileTypeAllowed?: (contentType: string) => boolean;
295
+ /** Maximum size in bytes a selectable file may have. */
296
+ maxSelectableFileSize?: number;
297
+ /** Maximum total attachments (already-attached plus newly selected). */
298
+ maximumAttachmentsAmount?: number;
299
+ /** Count of attachments already present before this modal opens. Defaults to `0`. */
300
+ existingAttachmentsAmount?: number;
301
+ /**
302
+ * Row selectability predicate forwarded to the grid and re-applied to every
303
+ * selection change, so items that were not clicked manually (e.g. the file
304
+ * manager's auto-select of newly created items) cannot enter selection
305
+ * unless manually selectable. Paths resolving to no listed node are dropped.
306
+ * When absent, selection changes are forwarded unfiltered.
307
+ */
308
+ isRowSelectable?: (node: {
309
+ data?: FileManagerSelectableNode | null;
310
+ }) => boolean;
311
+ /** Returns a tooltip for disabled rows; forwarded to the grid. */
312
+ getDisabledTooltip?: (row: FileManagerGridRow) => string | undefined;
313
+ /** Tooltip shown on files with an unsupported type; forwarded to the grid. */
314
+ unsupportedFileTypeTooltip?: string;
315
+ /** Accepted file types for the upload file input. */
316
+ allowedFileTypes?: DialFileAcceptType[];
317
+ /** Whether to auto-select items immediately after upload. Defaults to `false`. */
318
+ autoSelectUploadedItems?: boolean;
319
+ }
320
+
321
+ /**
322
+ * Structural view contract consumed by `DialFileManagerShell`. Contains exactly
323
+ * the fields of `UseDialFileManagerResult` that the shell reads, with the same
324
+ * names and types. Tabs, active tab, selection, destination-picker options, and
325
+ * host integration callbacks are explicit component props outside this contract.
326
+ *
327
+ * A `UseDialFileManagerResult` value is structurally assignable to this
328
+ * interface without a cast or adapter object.
329
+ */
330
+ declare interface FileManagerController {
331
+ /** Hierarchical items for DialFileManager's `items` prop. */
332
+ items: DialFile[];
333
+ /** True while the current folder is loading. */
334
+ isLoading: boolean;
335
+ /** Non-null when the last fetch failed. */
336
+ error: string | null;
337
+ /** Current path in DialFileManager format (e.g. `"/My files"`, `"/My files/reports/"`). */
338
+ path: string;
339
+ /** Pass directly to DialFileManager's `onPathChange`. */
340
+ onPathChange: (nextPath?: string) => void;
341
+ /** Re-runs the fetch for the current `folderPath`. */
342
+ retry: () => void;
343
+ /** Search: called by DialFileManager when the user types in the search box. */
344
+ onSearchFiles: (folder: string, query: string) => void;
345
+ /** Search: true while a search request is in flight. */
346
+ isSearching: boolean;
347
+ /** Search: flat list of matching files, or null when search is not active. */
348
+ searchResults: DialFile[] | null;
349
+ /** Search: clears results and exits search mode. */
350
+ clearSearchResults: () => void;
351
+ /** Tree: controlled set of expanded folder virtual paths. */
352
+ expandedPaths: Set<string>;
353
+ /** Tree: virtual paths whose children are already in the cache (derived). */
354
+ loadedPaths: Set<string>;
355
+ /** Tree: called by DialFileManager when a folder is expanded/collapsed. */
356
+ onExpandedPathsChange: (paths: Set<string>) => void;
357
+ /** Destination folder popup: preloads the browsed folder without changing the outer grid path. */
358
+ onFolderPopupPathChange: (nextPath?: string) => void;
359
+ /** Destination folder popup: normalized virtual paths currently being preloaded. */
360
+ folderPopupLoadingPaths: Set<string>;
361
+ /** Upload: start a new batch. */
362
+ onUploadFiles: (files: DialUploadFileItem[], destinationFolder: string) => void;
363
+ /** Upload: extracts and uploads a ZIP archive's entries to the destination folder. */
364
+ onUploadArchive: (file: File, name: string, destinationFolder: string) => void;
365
+ /** Upload: validate file names before upload (called by DialFileManager). */
366
+ onValidateUpload: (files: DialUploadFileItem[], existingFiles: DialFile[], destinationFolder: string) => Promise<FileUploadValidationResult>;
367
+ /** Upload: current batch state (null when idle). */
368
+ uploadBatchState: FileUploadBatchState | null;
369
+ /** Upload: abort all in-flight and queued uploads. */
370
+ cancelUpload: () => void;
371
+ /** Upload: dismiss the progress modal after the batch has settled. */
372
+ clearUploadBatch: () => void;
373
+ /** Folder creation: called when user confirms a new folder name. */
374
+ onCreateFolder: (file: DialUploadFileItem, folderPath: string, fileId: string) => Promise<void>;
375
+ /** Folder creation: inline synchronous validation (returns error message or null). */
376
+ onCreateFolderValidate: (name: string, parentFolder: DialFile) => string | null;
377
+ /** Download: called when user triggers download on one or more items. */
378
+ onDownloadFiles: (dialFiles: DialFile[]) => void;
379
+ /** True while a download is in progress. */
380
+ isDownloading: boolean;
381
+ /** Delete: called when user confirms deletion of one or more items. */
382
+ onDeleteFiles: (items: DialDeletedItem[], sourceFolder: string) => void;
383
+ /** True while a delete request is in flight. */
384
+ isDeleting: boolean;
385
+ /** Rename: inline validation — returns error string or null. */
386
+ onRenameValidate: (value: string, item: DialFile) => string | null;
387
+ /** Rename: called when user confirms an inline rename. Also dispatches cross-folder move (see D3). */
388
+ onMoveToFiles: (items: DialCopiedItem[], sourceFolder: string, destinationFolder: string) => void;
389
+ /** True while a rename request is in flight. */
390
+ isRenaming: boolean;
391
+ /** Copy: called when user confirms a copy-paste. */
392
+ onCopyFiles: (items: DialCopiedItem[], destinationFolder: string) => void;
393
+ /** True while a copy request is in flight. */
394
+ isCopying: boolean;
395
+ /** True while the cross-folder-move branch of onMoveToFiles is in flight. */
396
+ isMoving: boolean;
397
+ /** Aborts whichever of copy/move is currently in flight. */
398
+ cancelCopyMove: () => void;
399
+ /** True when the current folder grants WRITE (upload + new folder). */
400
+ uploadEnabled: boolean;
401
+ /** True when Upload/New must be disabled. */
402
+ isNewButtonDisabled: boolean;
403
+ /** Tooltip for disabled New/Upload when `isNewButtonDisabled` is true. */
404
+ disabledNewButtonTooltip: string;
405
+ /** Columns to show in the grid — tab-dependent. */
406
+ visibleColumns: FileManagerColumnKey[];
407
+ /** BCP-47 locale string for date formatting, sourced from i18n.language. */
408
+ dateLocale: string;
409
+ /** Fixed date format options for the UpdatedAt column. */
410
+ dateOptions: Intl.DateTimeFormatOptions;
411
+ /** Action labels for grid/tree/bulk — Delete present only on my_files tab. */
412
+ actionLabels: Partial<Record<DialFileManagerActions, string>>;
413
+ /** Root-level shared item paths, populated only on the Shared tab. */
414
+ sharedWithMeIds: string[] | undefined;
415
+ /** Share: paths the user has shared with others, populated only on my_files tab. */
416
+ sharedByMePaths: Set<string>;
417
+ /** Unshare: called when user removes a shared-with-me item (Shared tab only). */
418
+ onUnshareFiles: (files: DialFile[]) => void;
419
+ /** True while an unshare request is in flight. */
420
+ isUnsharing: boolean;
421
+ /** Remove access: called when user revokes access to an owned shared item (my_files tab only). */
422
+ onRemoveFilesAccess: (files: DialFile[]) => void;
423
+ /** True while a remove-access request is in flight. */
424
+ isRemovingAccess: boolean;
425
+ /** Metadata: populated once onGetInfo resolves; passed to fileMetadataPopupOptions.fileMetadata. */
426
+ fileMetadata: DialFile | undefined;
427
+ /** True while a metadata request is in flight. */
428
+ isFileMetadataLoading: boolean;
429
+ /** Metadata: called by DialFileManager.onGetInfo to fetch and display a file's details. */
430
+ onGetInfo: (file: DialFile) => void;
431
+ /** Metadata: resets fileMetadata/isFileMetadataLoading; passed to fileMetadataPopupOptions.clearMetadata. */
432
+ clearMetadata: () => void;
433
+ }
434
+
435
+ /**
436
+ * Minimal node shape file-manager selection predicates are evaluated against.
437
+ * Satisfied by both grid rows and `DialFile` controller items, so one
438
+ * predicate can gate manual grid clicks and programmatic selection changes.
439
+ */
440
+ declare interface FileManagerSelectableNode {
441
+ /** Virtual path of the node. */
442
+ path: string;
443
+ /** Distinguishes folders from files. */
444
+ nodeType: DialFileNodeType;
445
+ /** MIME type of a file node, when known. */
446
+ contentType?: string;
447
+ /** Size in bytes of a file node, when known. */
448
+ contentLength?: number;
449
+ }
450
+
451
+ /** State of an in-progress or just-settled upload batch, as returned by `useDialFileUploadBatch`. */
452
+ declare interface FileUploadBatchState {
453
+ /** Individual file entries in this batch. */
454
+ files: FileUploadEntry[];
455
+ /** Whether the upload progress modal should be visible. */
456
+ isOpen: boolean;
457
+ }
458
+
459
+ /** Progress state for a single file within an upload batch. */
460
+ declare interface FileUploadEntry {
461
+ /** Unique identifier of the file in the batch. */
462
+ id: string;
463
+ /** Display name of the file. */
464
+ name: string;
465
+ /** Current upload lifecycle status. */
466
+ status: FileUploadStatus;
467
+ /** 0–100 while uploading when the transport reports byte progress. */
468
+ percent?: number;
469
+ }
470
+
471
+ /** Lifecycle status of a single file within an upload batch. */
472
+ declare enum FileUploadStatus {
473
+ Queued = "queued",
474
+ Uploading = "uploading",
475
+ Completed = "completed",
476
+ Failed = "failed",
477
+ Cancelled = "cancelled"
478
+ }
479
+
480
+ /** Result of validating files before upload. */
481
+ declare interface FileUploadValidationResult {
482
+ /** Whether the files passed validation. */
483
+ valid: boolean;
484
+ /** Human-readable validation error message when `valid` is false. */
485
+ message?: string;
486
+ }
487
+
488
+ /** Validation messages shown during inline rename editing. */
489
+ declare type RenameValidationMessages = NonNullable<DialFileManagerComponentProps['renameValidationMessages']>;
490
+
491
+ export { }
@@ -0,0 +1,3 @@
1
+ import { DialFileManagerShell as e } from "./file-manager/DialFileManagerShell/DialFileManagerShell.js";
2
+ import { FileManagerAttachModal as t } from "./file-manager/FileManagerAttachModal/FileManagerAttachModal.js";
3
+ export { e as DialFileManagerShell, t as FileManagerAttachModal };
@@ -0,0 +1,36 @@
1
+ import { RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE as e } from "../constants/resizable-fields.js";
2
+ import { useCallback as t, useLayoutEffect as n, useRef as r } from "react";
3
+ //#region src/hooks/useAvailableHeightCap.ts
4
+ var i = 16, a = 200, o = new Set([
5
+ "auto",
6
+ "scroll",
7
+ "overlay"
8
+ ]), s = (e) => {
9
+ for (let t = e.parentElement; t; t = t.parentElement) {
10
+ let { overflowY: e } = getComputedStyle(t);
11
+ if (o.has(e)) return t;
12
+ }
13
+ return document.documentElement;
14
+ }, c = ({ bottomGap: o = i, minHeight: c = a, cssVariable: l = e } = {}) => {
15
+ let u = r(null), d = t(() => {
16
+ let e = u.current;
17
+ if (!e) return;
18
+ let t = s(e), n = t === document.documentElement, r = e.getBoundingClientRect().top, i = n ? r + t.scrollTop : r - t.getBoundingClientRect().top + t.scrollTop, a = t.clientHeight - i - o, d = `${Math.round(Math.max(a, c))}px`;
19
+ e.style.getPropertyValue(l) !== d && e.style.setProperty(l, d);
20
+ }, [
21
+ o,
22
+ c,
23
+ l
24
+ ]);
25
+ return n(() => {
26
+ d();
27
+ let e = u.current;
28
+ if (!e) return;
29
+ let t = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(d);
30
+ return t?.observe(s(e)), e.addEventListener("pointerdown", d, !0), window.addEventListener("resize", d), () => {
31
+ t?.disconnect(), e.removeEventListener("pointerdown", d, !0), window.removeEventListener("resize", d);
32
+ };
33
+ }, [d]), u;
34
+ };
35
+ //#endregion
36
+ export { c as useAvailableHeightCap };
@@ -0,0 +1,20 @@
1
+ import { copyToClipboard as e } from "../utils/copy-to-clipboard.js";
2
+ import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
3
+ //#region src/hooks/useCodeCopy.ts
4
+ var a = 2e3, o = (o, s = a) => {
5
+ let [c, l] = i(!1), u = r(null);
6
+ return n(() => () => {
7
+ u.current != null && clearTimeout(u.current);
8
+ }, []), {
9
+ isCopied: c,
10
+ copy: t(() => {
11
+ e(o).then((e) => {
12
+ e && (u.current != null && clearTimeout(u.current), l(!0), u.current = setTimeout(() => {
13
+ l(!1);
14
+ }, s));
15
+ });
16
+ }, [o, s])
17
+ };
18
+ };
19
+ //#endregion
20
+ export { o as useCodeCopy };
@@ -0,0 +1,38 @@
1
+ import { useCallback as e, useEffect as t, useState as n } from "react";
2
+ //#region src/hooks/useCollapsedText.ts
3
+ var r = 24, i = 1, a = ({ text: a, collapsedLineCount: o }) => {
4
+ let s = Math.max(1, o), [c, l] = n(null), [u, d] = n(!0), [f, p] = n(!1), [m, h] = n(r * s), [g, _] = n(0), v = e((e) => {
5
+ l(e);
6
+ }, []), y = e(() => {
7
+ if (!c) return;
8
+ let e = window.getComputedStyle(c), t = Number.parseFloat(e.fontSize), n = Number.isNaN(t) ? 16 : t, r = Number.parseFloat(e.lineHeight), a = n * 1.5;
9
+ e.lineHeight !== "normal" && !Number.isNaN(r) && (a = e.lineHeight.endsWith("px") ? r : r * n);
10
+ let o = a * s;
11
+ h(o), _(c.scrollHeight), p(c.scrollHeight - o > i);
12
+ }, [c, s]);
13
+ t(() => {
14
+ d(!0);
15
+ }, [s, a]), t(() => {
16
+ if (y(), !c || typeof ResizeObserver > "u") return;
17
+ let e = new ResizeObserver(y);
18
+ return e.observe(c), () => e.disconnect();
19
+ }, [
20
+ y,
21
+ c,
22
+ a
23
+ ]);
24
+ let b = e(() => {
25
+ d((e) => !e);
26
+ }, []);
27
+ return {
28
+ textRef: v,
29
+ isTextCollapsed: u && f,
30
+ isOverflowing: f,
31
+ collapsedMaxHeight: m,
32
+ expandedMaxHeight: g,
33
+ isCollapsed: u,
34
+ toggleCollapsed: b
35
+ };
36
+ };
37
+ //#endregion
38
+ export { a as useCollapsedText };
@@ -0,0 +1,25 @@
1
+ import { useCallback as e, useLayoutEffect as t, useRef as n, useState as r } from "react";
2
+ //#region src/hooks/useHorizontalOverflow.ts
3
+ var i = 1, a = () => {
4
+ let a = n(null), o = n(null), [s, c] = r(!1), [l, u] = r(!1), d = e(() => {
5
+ let e = a.current, t = o.current;
6
+ if (!e || !t) return;
7
+ let n = e.scrollWidth - e.clientWidth > i, r = e.getBoundingClientRect(), s = t.getBoundingClientRect(), l = getComputedStyle(e).direction === "rtl", d = l ? s.right > r.right + i : s.left < r.left - i, f = l ? s.left < r.left - i : s.right > r.right + i;
8
+ c(n && d), u(n && f);
9
+ }, []);
10
+ return t(() => {
11
+ d();
12
+ let e = a.current, t = o.current;
13
+ if (!e || !t || typeof ResizeObserver > "u") return;
14
+ let n = new ResizeObserver(d);
15
+ return n.observe(e), n.observe(t), () => n.disconnect();
16
+ }, [d]), {
17
+ scrollContainerRef: a,
18
+ contentRef: o,
19
+ hasContentBeyondStart: s,
20
+ hasContentBeyondEnd: l,
21
+ handleScroll: d
22
+ };
23
+ };
24
+ //#endregion
25
+ export { a as useHorizontalOverflow };