@red-hat-developer-hub/backstage-plugin-intelligent-assistant 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/alpha.d.ts +1 -2
- package/dist/components/Attachment.esm.js +10 -12
- package/dist/components/Attachment.esm.js.map +1 -1
- package/dist/components/CollapsedHistoryStrip.esm.js +46 -51
- package/dist/components/CollapsedHistoryStrip.esm.js.map +1 -1
- package/dist/components/FilePreview.esm.js +3 -2
- package/dist/components/FilePreview.esm.js.map +1 -1
- package/dist/components/LightSpeedChat.esm.js +580 -745
- package/dist/components/LightSpeedChat.esm.js.map +1 -1
- package/dist/components/LightspeedChatBox.esm.js +2 -3
- package/dist/components/LightspeedChatBox.esm.js.map +1 -1
- package/dist/components/LightspeedChatBoxHeader.esm.js +38 -34
- package/dist/components/LightspeedChatBoxHeader.esm.js.map +1 -1
- package/dist/components/LightspeedChatContainer.esm.js +6 -8
- package/dist/components/LightspeedChatContainer.esm.js.map +1 -1
- package/dist/components/LightspeedChatModelsState.esm.js +67 -73
- package/dist/components/LightspeedChatModelsState.esm.js.map +1 -1
- package/dist/components/LightspeedDrawerContext.esm.js.map +1 -1
- package/dist/components/LightspeedDrawerProvider.esm.js +13 -16
- package/dist/components/LightspeedDrawerProvider.esm.js.map +1 -1
- package/dist/components/LightspeedFABContent.esm.js +40 -9
- package/dist/components/LightspeedFABContent.esm.js.map +1 -1
- package/dist/components/LightspeedPage.esm.js +1 -10
- package/dist/components/LightspeedPage.esm.js.map +1 -1
- package/dist/components/McpConfigureServerModal.esm.js +79 -86
- package/dist/components/McpConfigureServerModal.esm.js.map +1 -1
- package/dist/components/McpServersSettings.esm.js +246 -212
- package/dist/components/McpServersSettings.esm.js.map +1 -1
- package/dist/components/MessageBarModelSelector.esm.js +29 -33
- package/dist/components/MessageBarModelSelector.esm.js.map +1 -1
- package/dist/components/PermissionRequiredState.esm.js +63 -63
- package/dist/components/PermissionRequiredState.esm.js.map +1 -1
- package/dist/components/RenameConversationModal.esm.js +38 -31
- package/dist/components/RenameConversationModal.esm.js.map +1 -1
- package/dist/components/Router.esm.js +4 -13
- package/dist/components/Router.esm.js.map +1 -1
- package/dist/components/ToastAlertGroup.esm.js +24 -40
- package/dist/components/ToastAlertGroup.esm.js.map +1 -1
- package/dist/components/ToolCallContent.esm.js +8 -11
- package/dist/components/ToolCallContent.esm.js.map +1 -1
- package/dist/components/notebooks/AddDocumentModal.esm.js +232 -252
- package/dist/components/notebooks/AddDocumentModal.esm.js.map +1 -1
- package/dist/components/notebooks/DeleteDocumentModal.esm.js +35 -77
- package/dist/components/notebooks/DeleteDocumentModal.esm.js.map +1 -1
- package/dist/components/notebooks/DeleteNotebookModal.esm.js +46 -81
- package/dist/components/notebooks/DeleteNotebookModal.esm.js.map +1 -1
- package/dist/components/notebooks/DocumentSidebar.esm.js +172 -196
- package/dist/components/notebooks/DocumentSidebar.esm.js.map +1 -1
- package/dist/components/notebooks/FileListItem.esm.js +69 -57
- package/dist/components/notebooks/FileListItem.esm.js.map +1 -1
- package/dist/components/notebooks/FileTypeIcon.esm.js +17 -27
- package/dist/components/notebooks/FileTypeIcon.esm.js.map +1 -1
- package/dist/components/notebooks/NotebookCard.esm.js +86 -25
- package/dist/components/notebooks/NotebookCard.esm.js.map +1 -1
- package/dist/components/notebooks/NotebookView.esm.js +367 -380
- package/dist/components/notebooks/NotebookView.esm.js.map +1 -1
- package/dist/components/notebooks/NotebooksTab.esm.js +93 -30
- package/dist/components/notebooks/NotebooksTab.esm.js.map +1 -1
- package/dist/components/notebooks/OverwriteConfirmModal.esm.js +142 -184
- package/dist/components/notebooks/OverwriteConfirmModal.esm.js.map +1 -1
- package/dist/components/notebooks/UploadResourceScreen.esm.js +58 -50
- package/dist/components/notebooks/UploadResourceScreen.esm.js.map +1 -1
- package/dist/components/notebooks/notebookDialogStyles.esm.js +33 -37
- package/dist/components/notebooks/notebookDialogStyles.esm.js.map +1 -1
- package/dist/const.esm.js +15 -2
- package/dist/const.esm.js.map +1 -1
- package/dist/hooks/useAutoScroll.esm.js +11 -11
- package/dist/hooks/useAutoScroll.esm.js.map +1 -1
- package/dist/hooks/useBufferedMessages.esm.js +5 -5
- package/dist/hooks/useBufferedMessages.esm.js.map +1 -1
- package/dist/hooks/useIsMobile.esm.js +3 -3
- package/dist/hooks/useIsMobile.esm.js.map +1 -1
- package/dist/translations/de.esm.js +1 -2
- package/dist/translations/de.esm.js.map +1 -1
- package/dist/translations/es.esm.js +1 -2
- package/dist/translations/es.esm.js.map +1 -1
- package/dist/translations/fr.esm.js +1 -2
- package/dist/translations/fr.esm.js.map +1 -1
- package/dist/translations/it.esm.js +1 -2
- package/dist/translations/it.esm.js.map +1 -1
- package/dist/translations/ja.esm.js +1 -2
- package/dist/translations/ja.esm.js.map +1 -1
- package/dist/translations/ref.esm.js +1 -2
- package/dist/translations/ref.esm.js.map +1 -1
- package/dist/types.esm.js.map +1 -1
- package/dist/utils/fab-anchor-utils.esm.js +41 -0
- package/dist/utils/fab-anchor-utils.esm.js.map +1 -0
- package/dist/utils/scoped-dialog-utils.esm.js +6 -3
- package/dist/utils/scoped-dialog-utils.esm.js.map +1 -1
- package/package.json +4 -8
- package/dist/utils/generateClassName.esm.js +0 -12
- package/dist/utils/generateClassName.esm.js.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useEffect, useContext } from 'react';
|
|
3
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
4
3
|
import CloseIcon from '@mui/icons-material/Close';
|
|
5
4
|
import Box from '@mui/material/Box';
|
|
6
5
|
import Button from '@mui/material/Button';
|
|
@@ -9,6 +8,7 @@ import DialogActions from '@mui/material/DialogActions';
|
|
|
9
8
|
import DialogContent from '@mui/material/DialogContent';
|
|
10
9
|
import DialogTitle from '@mui/material/DialogTitle';
|
|
11
10
|
import IconButton from '@mui/material/IconButton';
|
|
11
|
+
import { styled } from '@mui/material/styles';
|
|
12
12
|
import Typography from '@mui/material/Typography';
|
|
13
13
|
import { Alert, MultipleFileUpload, MultipleFileUploadMain, Tooltip, MultipleFileUploadContext } from '@patternfly/react-core';
|
|
14
14
|
import { UploadIcon } from '@patternfly/react-icons';
|
|
@@ -19,136 +19,90 @@ import { runFileUploads } from '../../utils/notebook-upload-runner.esm.js';
|
|
|
19
19
|
import { getNotebookAcceptedFileTypes, validateFiles } from '../../utils/notebook-upload-utils.esm.js';
|
|
20
20
|
import { getScopedDialogProps } from '../../utils/scoped-dialog-utils.esm.js';
|
|
21
21
|
import { FileListItem } from './FileListItem.esm.js';
|
|
22
|
-
import {
|
|
22
|
+
import { notebookDialogTitleTextSx, notebookDialogCloseButtonSx, notebookDialogTitleSx, notebookDialogContentSx, notebookDialogActionsSx, notebookDialogPaperSx, optionalStyle } from './notebookDialogStyles.esm.js';
|
|
23
23
|
|
|
24
24
|
const UNIQUE_FILE_TYPE_LABELS = [
|
|
25
25
|
...new Set(Object.values(NOTEBOOK_EXTENSION_TO_FILE_TYPE))
|
|
26
26
|
].map((t) => t.toUpperCase());
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
const ErrorAlert = styled(Alert)(({ theme }) => ({
|
|
28
|
+
marginBottom: theme.spacing(2),
|
|
29
|
+
"--pf-v6-c-alert--PaddingBlockEnd": "0",
|
|
30
|
+
"& .pf-v6-c-alert__title": {
|
|
31
|
+
marginBlockStart: 0
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
const Dropzone = styled("div", {
|
|
35
|
+
shouldForwardProp: (prop) => prop !== "isDropzoneDisabled"
|
|
36
|
+
})(({ theme, isDropzoneDisabled }) => ({
|
|
37
|
+
borderColor: "var(--pf-t--global--border--color--brand--default)",
|
|
38
|
+
borderWidth: 2,
|
|
39
|
+
borderStyle: "dashed",
|
|
40
|
+
borderRadius: theme.spacing(1),
|
|
41
|
+
transition: "background-color 0.2s ease",
|
|
42
|
+
cursor: isDropzoneDisabled ? "default" : "pointer",
|
|
43
|
+
...isDropzoneDisabled ? {
|
|
44
|
+
opacity: 0.5,
|
|
45
|
+
pointerEvents: "none",
|
|
46
|
+
"&:hover": {
|
|
47
|
+
backgroundColor: "transparent"
|
|
40
48
|
}
|
|
41
|
-
}
|
|
42
|
-
dropzone: {
|
|
43
|
-
borderColor: "var(--pf-t--global--border--color--brand--default)",
|
|
44
|
-
borderWidth: 2,
|
|
45
|
-
borderStyle: "dashed",
|
|
46
|
-
borderRadius: theme.spacing(1),
|
|
47
|
-
padding: theme.spacing(2),
|
|
48
|
-
transition: "background-color 0.2s ease",
|
|
49
|
-
cursor: "pointer",
|
|
49
|
+
} : {
|
|
50
50
|
"&:hover": {
|
|
51
51
|
backgroundColor: "color-mix(in srgb, var(--pf-t--global--color--brand--default) 10%, transparent)"
|
|
52
|
-
},
|
|
53
|
-
"& .pf-v6-c-multiple-file-upload__main": {
|
|
54
|
-
border: "none",
|
|
55
|
-
paddingBottom: 0
|
|
56
|
-
},
|
|
57
|
-
"& .pf-v6-c-multiple-file-upload__title-icon": {
|
|
58
|
-
fontSize: "2rem"
|
|
59
52
|
}
|
|
60
53
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
overflowY: "auto"
|
|
65
|
-
},
|
|
66
|
-
fileListHeader: {
|
|
67
|
-
display: "flex",
|
|
68
|
-
alignItems: "center",
|
|
69
|
-
justifyContent: "space-between",
|
|
70
|
-
marginBottom: theme.spacing(1)
|
|
71
|
-
},
|
|
72
|
-
fileCount: {
|
|
73
|
-
fontSize: "0.875rem",
|
|
74
|
-
color: theme.palette.text.secondary
|
|
75
|
-
},
|
|
76
|
-
dialogActions: {
|
|
77
|
-
padding: "16px 24px",
|
|
78
|
-
justifyContent: "flex-start",
|
|
79
|
-
gap: theme.spacing(1)
|
|
80
|
-
},
|
|
81
|
-
dialogActionsCompact: {
|
|
82
|
-
padding: "12px 16px !important",
|
|
83
|
-
justifyContent: "flex-start",
|
|
84
|
-
gap: theme.spacing(1)
|
|
85
|
-
},
|
|
86
|
-
addButton: {
|
|
87
|
-
textTransform: "none"
|
|
88
|
-
},
|
|
89
|
-
cancelButton: {
|
|
90
|
-
textTransform: "none"
|
|
91
|
-
},
|
|
92
|
-
uploadIcon: {
|
|
93
|
-
color: "var(--pf-t--global--icon--color--brand--default)"
|
|
54
|
+
"& .pf-v6-c-multiple-file-upload__main": {
|
|
55
|
+
border: "none",
|
|
56
|
+
paddingBottom: 0
|
|
94
57
|
},
|
|
95
|
-
|
|
96
|
-
fontSize: "
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
justifyContent: "center",
|
|
106
|
-
marginTop: theme.spacing(0.5)
|
|
107
|
-
},
|
|
108
|
-
fileTypeChip: {
|
|
109
|
-
display: "inline-block",
|
|
110
|
-
padding: "2px 10px",
|
|
111
|
-
borderRadius: 12,
|
|
112
|
-
fontSize: "0.75rem",
|
|
113
|
-
fontWeight: 500,
|
|
114
|
-
backgroundColor: theme.palette.type === "dark" ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.08)",
|
|
115
|
-
color: theme.palette.text.secondary
|
|
116
|
-
},
|
|
117
|
-
maxFileSizeText: {
|
|
118
|
-
fontSize: "0.875rem",
|
|
119
|
-
color: theme.palette.text.secondary,
|
|
120
|
-
textAlign: "center",
|
|
121
|
-
marginTop: theme.spacing(1)
|
|
122
|
-
},
|
|
123
|
-
dropzoneDisabled: {
|
|
124
|
-
opacity: 0.5,
|
|
125
|
-
pointerEvents: "none",
|
|
126
|
-
cursor: "default",
|
|
127
|
-
"&:hover": {
|
|
128
|
-
backgroundColor: "transparent"
|
|
129
|
-
}
|
|
58
|
+
"& .pf-v6-c-multiple-file-upload__title-icon": {
|
|
59
|
+
fontSize: "2rem"
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
62
|
+
const DropzoneClickAreaRoot = styled("div")(({ theme }) => ({
|
|
63
|
+
display: "block",
|
|
64
|
+
padding: theme.spacing(2),
|
|
65
|
+
cursor: "pointer",
|
|
66
|
+
'&[aria-disabled="true"]': {
|
|
67
|
+
cursor: "default"
|
|
130
68
|
}
|
|
131
69
|
}));
|
|
70
|
+
const StyledUploadIcon = styled(UploadIcon)({
|
|
71
|
+
color: "var(--pf-t--global--icon--color--brand--default)"
|
|
72
|
+
});
|
|
73
|
+
const FileTypeChip = styled("span")(({ theme }) => ({
|
|
74
|
+
display: "inline-block",
|
|
75
|
+
padding: "2px 10px",
|
|
76
|
+
borderRadius: 12,
|
|
77
|
+
fontSize: "0.75rem",
|
|
78
|
+
fontWeight: 500,
|
|
79
|
+
backgroundColor: theme.palette.mode === "dark" ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.08)",
|
|
80
|
+
color: theme.palette.text.secondary
|
|
81
|
+
}));
|
|
132
82
|
const DropzoneClickArea = ({
|
|
133
83
|
children,
|
|
134
84
|
isDisabled,
|
|
135
85
|
ariaLabel
|
|
136
86
|
}) => {
|
|
137
87
|
const { open } = useContext(MultipleFileUploadContext);
|
|
88
|
+
const openFilePicker = (event) => {
|
|
89
|
+
event.stopPropagation();
|
|
90
|
+
open();
|
|
91
|
+
};
|
|
138
92
|
return /* @__PURE__ */ jsx(
|
|
139
|
-
|
|
93
|
+
DropzoneClickAreaRoot,
|
|
140
94
|
{
|
|
141
95
|
role: "button",
|
|
142
96
|
"aria-label": ariaLabel,
|
|
97
|
+
"aria-disabled": isDisabled,
|
|
143
98
|
tabIndex: isDisabled ? -1 : 0,
|
|
144
|
-
onClick: isDisabled ? void 0 :
|
|
99
|
+
onClick: isDisabled ? void 0 : openFilePicker,
|
|
145
100
|
onKeyDown: isDisabled ? void 0 : (e) => {
|
|
146
101
|
if (e.key === "Enter" || e.key === " ") {
|
|
147
102
|
e.preventDefault();
|
|
148
|
-
|
|
103
|
+
openFilePicker(e);
|
|
149
104
|
}
|
|
150
105
|
},
|
|
151
|
-
style: { cursor: isDisabled ? "default" : "pointer" },
|
|
152
106
|
children
|
|
153
107
|
}
|
|
154
108
|
);
|
|
@@ -167,7 +121,6 @@ const AddDocumentModal = ({
|
|
|
167
121
|
onFilesAdded,
|
|
168
122
|
isCompact = false
|
|
169
123
|
}) => {
|
|
170
|
-
const classes = useStyles();
|
|
171
124
|
const { t } = useTranslation();
|
|
172
125
|
const uploadMutation = useUploadDocument();
|
|
173
126
|
const [validationErrors, setValidationErrors] = useState([]);
|
|
@@ -243,161 +196,188 @@ const AddDocumentModal = ({
|
|
|
243
196
|
"aria-labelledby": "add-document-modal-title",
|
|
244
197
|
...scopedProps,
|
|
245
198
|
PaperProps: {
|
|
246
|
-
|
|
247
|
-
|
|
199
|
+
...scopedProps.PaperProps,
|
|
200
|
+
sx: [
|
|
201
|
+
notebookDialogPaperSx(isCompact),
|
|
202
|
+
optionalStyle(scopedProps.PaperProps?.sx)
|
|
203
|
+
]
|
|
248
204
|
},
|
|
249
205
|
children: [
|
|
250
|
-
/* @__PURE__ */ jsxs(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
)
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
isInline: true,
|
|
301
|
-
className: classes.errorAlert,
|
|
302
|
-
title: t("notebook.view.documents.uploadsInProgress")
|
|
303
|
-
}
|
|
304
|
-
),
|
|
305
|
-
(() => {
|
|
306
|
-
const isDropzoneDisabled = remainingSlots <= 0;
|
|
307
|
-
const dropzoneContent = /* @__PURE__ */ jsx(
|
|
308
|
-
MultipleFileUpload,
|
|
206
|
+
/* @__PURE__ */ jsxs(DialogTitle, { sx: notebookDialogTitleSx(isCompact), children: [
|
|
207
|
+
/* @__PURE__ */ jsxs(Typography, { component: "h2", sx: notebookDialogTitleTextSx(isCompact), children: [
|
|
208
|
+
t("notebook.upload.modal.title"),
|
|
209
|
+
selectedFiles.length > 0 && ` (${selectedFiles.length}/${NOTEBOOK_MAX_FILES - existingDocumentNames.length})`
|
|
210
|
+
] }),
|
|
211
|
+
/* @__PURE__ */ jsx(
|
|
212
|
+
IconButton,
|
|
213
|
+
{
|
|
214
|
+
"aria-label": t("common.close"),
|
|
215
|
+
onClick: handleClose,
|
|
216
|
+
sx: notebookDialogCloseButtonSx,
|
|
217
|
+
size: "small",
|
|
218
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
] }),
|
|
222
|
+
/* @__PURE__ */ jsxs(DialogContent, { sx: notebookDialogContentSx(isCompact), children: [
|
|
223
|
+
validationErrors.length > 0 && /* @__PURE__ */ jsx(
|
|
224
|
+
ErrorAlert,
|
|
225
|
+
{
|
|
226
|
+
variant: "danger",
|
|
227
|
+
isInline: true,
|
|
228
|
+
title: validationErrors.map((errorKey) => {
|
|
229
|
+
const message = t(errorKey);
|
|
230
|
+
return errorKey === "notebook.upload.error.tooManyFiles" ? message.replace("{{max}}", String(NOTEBOOK_MAX_FILES)) : message;
|
|
231
|
+
}).join("\n")
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
hasUploadsInProgress && /* @__PURE__ */ jsx(
|
|
235
|
+
ErrorAlert,
|
|
236
|
+
{
|
|
237
|
+
variant: "info",
|
|
238
|
+
isInline: true,
|
|
239
|
+
title: t("notebook.view.documents.uploadsInProgress")
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
(() => {
|
|
243
|
+
const isDropzoneDisabled = remainingSlots <= 0;
|
|
244
|
+
const dropzoneContent = /* @__PURE__ */ jsx(Dropzone, { isDropzoneDisabled, children: /* @__PURE__ */ jsx(
|
|
245
|
+
MultipleFileUpload,
|
|
246
|
+
{
|
|
247
|
+
dropzoneProps: {
|
|
248
|
+
accept: getNotebookAcceptedFileTypes(),
|
|
249
|
+
onDropRejected: handleDropRejected,
|
|
250
|
+
disabled: isDropzoneDisabled,
|
|
251
|
+
noClick: true
|
|
252
|
+
},
|
|
253
|
+
onFileDrop: handleFileDrop,
|
|
254
|
+
children: /* @__PURE__ */ jsxs(
|
|
255
|
+
DropzoneClickArea,
|
|
309
256
|
{
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
)
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
257
|
+
isDisabled: isDropzoneDisabled,
|
|
258
|
+
ariaLabel: t("notebook.upload.modal.dragDropTitle"),
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ jsx(
|
|
261
|
+
MultipleFileUploadMain,
|
|
262
|
+
{
|
|
263
|
+
titleIcon: /* @__PURE__ */ jsx(StyledUploadIcon, {}),
|
|
264
|
+
titleText: t("notebook.upload.modal.dragDropTitle"),
|
|
265
|
+
isUploadButtonHidden: true
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
/* @__PURE__ */ jsx(
|
|
269
|
+
Typography,
|
|
270
|
+
{
|
|
271
|
+
sx: {
|
|
272
|
+
fontSize: "0.875rem",
|
|
273
|
+
color: "text.secondary",
|
|
274
|
+
textAlign: "center",
|
|
275
|
+
mt: 1
|
|
276
|
+
},
|
|
277
|
+
children: t("notebook.upload.modal.supportedFormats")
|
|
278
|
+
}
|
|
279
|
+
),
|
|
280
|
+
/* @__PURE__ */ jsx(
|
|
281
|
+
Box,
|
|
282
|
+
{
|
|
283
|
+
sx: {
|
|
284
|
+
display: "flex",
|
|
285
|
+
flexWrap: "wrap",
|
|
286
|
+
gap: 0.75,
|
|
287
|
+
justifyContent: "center",
|
|
288
|
+
mt: 0.5
|
|
289
|
+
},
|
|
290
|
+
children: UNIQUE_FILE_TYPE_LABELS.map((label) => /* @__PURE__ */ jsx(FileTypeChip, { children: label }, label))
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
/* @__PURE__ */ jsx(
|
|
294
|
+
Typography,
|
|
295
|
+
{
|
|
296
|
+
sx: {
|
|
297
|
+
fontSize: "0.875rem",
|
|
298
|
+
color: "text.secondary",
|
|
299
|
+
textAlign: "center",
|
|
300
|
+
mt: 1
|
|
301
|
+
},
|
|
302
|
+
children: t("notebook.upload.modal.maxFileSize")
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
]
|
|
337
306
|
}
|
|
338
|
-
)
|
|
339
|
-
|
|
340
|
-
|
|
307
|
+
)
|
|
308
|
+
}
|
|
309
|
+
) });
|
|
310
|
+
return isDropzoneDisabled ? /* @__PURE__ */ jsx(
|
|
311
|
+
Tooltip,
|
|
312
|
+
{
|
|
313
|
+
content: t("notebook.view.documents.maxReached"),
|
|
314
|
+
position: "top",
|
|
315
|
+
children: /* @__PURE__ */ jsx("div", { children: dropzoneContent })
|
|
316
|
+
}
|
|
317
|
+
) : dropzoneContent;
|
|
318
|
+
})(),
|
|
319
|
+
selectedFiles.length > 0 && /* @__PURE__ */ jsxs(Box, { sx: { mt: 2, maxHeight: 200, overflowY: "auto" }, children: [
|
|
320
|
+
/* @__PURE__ */ jsx(
|
|
321
|
+
Box,
|
|
322
|
+
{
|
|
323
|
+
sx: {
|
|
324
|
+
display: "flex",
|
|
325
|
+
alignItems: "center",
|
|
326
|
+
justifyContent: "space-between",
|
|
327
|
+
mb: 1
|
|
328
|
+
},
|
|
329
|
+
children: /* @__PURE__ */ jsx(
|
|
330
|
+
Typography,
|
|
341
331
|
{
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
332
|
+
sx: { fontSize: "0.875rem", color: "text.secondary" },
|
|
333
|
+
children: t("notebook.upload.modal.selectedFiles", {
|
|
334
|
+
count: selectedFiles.length,
|
|
335
|
+
max: NOTEBOOK_MAX_FILES - existingDocumentNames.length
|
|
336
|
+
})
|
|
345
337
|
}
|
|
346
|
-
)
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
338
|
+
)
|
|
339
|
+
}
|
|
340
|
+
),
|
|
341
|
+
selectedFiles.map((file, index) => /* @__PURE__ */ jsx(
|
|
342
|
+
FileListItem,
|
|
343
|
+
{
|
|
344
|
+
file,
|
|
345
|
+
onRemove: () => handleRemoveFile(index),
|
|
346
|
+
removeAriaLabel: t(
|
|
347
|
+
"notebook.upload.modal.removeFile",
|
|
355
348
|
{
|
|
356
|
-
file
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
),
|
|
389
|
-
/* @__PURE__ */ jsx(
|
|
390
|
-
Button,
|
|
391
|
-
{
|
|
392
|
-
onClick: handleClose,
|
|
393
|
-
className: classes.cancelButton,
|
|
394
|
-
color: "inherit",
|
|
395
|
-
children: t("common.cancel")
|
|
396
|
-
}
|
|
397
|
-
)
|
|
398
|
-
]
|
|
399
|
-
}
|
|
400
|
-
)
|
|
349
|
+
fileName: file.name
|
|
350
|
+
}
|
|
351
|
+
)
|
|
352
|
+
},
|
|
353
|
+
`${file.name}-${index}`
|
|
354
|
+
))
|
|
355
|
+
] })
|
|
356
|
+
] }),
|
|
357
|
+
/* @__PURE__ */ jsxs(DialogActions, { sx: notebookDialogActionsSx(isCompact), children: [
|
|
358
|
+
/* @__PURE__ */ jsx(
|
|
359
|
+
Button,
|
|
360
|
+
{
|
|
361
|
+
onClick: handleAddFiles,
|
|
362
|
+
sx: { textTransform: "none" },
|
|
363
|
+
variant: "contained",
|
|
364
|
+
color: "primary",
|
|
365
|
+
disabled: selectedFiles.length === 0 || hasUploadsInProgress,
|
|
366
|
+
children: selectedFiles.length > 0 ? t("notebook.upload.modal.addButton", {
|
|
367
|
+
count: selectedFiles.length
|
|
368
|
+
}) : t("notebook.upload.modal.addButtonEmpty")
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
/* @__PURE__ */ jsx(
|
|
372
|
+
Button,
|
|
373
|
+
{
|
|
374
|
+
onClick: handleClose,
|
|
375
|
+
sx: { textTransform: "none" },
|
|
376
|
+
color: "inherit",
|
|
377
|
+
children: t("common.cancel")
|
|
378
|
+
}
|
|
379
|
+
)
|
|
380
|
+
] })
|
|
401
381
|
]
|
|
402
382
|
}
|
|
403
383
|
);
|