@parallelworks/ui 0.40.1 → 0.42.0
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/README.md +25 -0
- package/dist/ai/adapter/memoryStore.js +7 -0
- package/dist/ai/adapter/mock/mockAdapter.js +52 -17
- package/dist/ai/adapter/openai/createOpenAIStream.js +1 -1
- package/dist/ai/adapter/openai/index.d.ts +1 -1
- package/dist/ai/adapter/openai/sse.d.ts +8 -2
- package/dist/ai/adapter/openai/sse.js +40 -4
- package/dist/ai/adapter/openai/wire.d.ts +6 -0
- package/dist/ai/components/AllocationSelector.d.ts +3 -4
- package/dist/ai/components/AllocationSelector.js +37 -33
- package/dist/ai/components/AttachmentManager.js +7 -7
- package/dist/ai/components/AttachmentUpload.js +5 -5
- package/dist/ai/components/BranchNavigator.js +1 -1
- package/dist/ai/components/ChatEmptyState.js +2 -2
- package/dist/ai/components/ChatInput.js +10 -8
- package/dist/ai/components/ChatLayout.js +4 -5
- package/dist/ai/components/ChatMessage.js +12 -12
- package/dist/ai/components/ChatMessageList.js +9 -9
- package/dist/ai/components/ChatSidebar.js +8 -9
- package/dist/ai/components/ChatThread.js +4 -4
- package/dist/ai/components/ComposerChrome.d.ts +2 -2
- package/dist/ai/components/ComposerChrome.js +3 -6
- package/dist/ai/components/DragOverlay.js +2 -2
- package/dist/ai/components/ModelSelector.d.ts +5 -3
- package/dist/ai/components/ModelSelector.js +102 -339
- package/dist/ai/components/PastedText.js +11 -11
- package/dist/ai/components/ProviderIssueBanner.d.ts +2 -0
- package/dist/ai/components/ProviderIssueBanner.js +34 -16
- package/dist/ai/components/Reasoning.js +4 -4
- package/dist/ai/components/ShareDialog.js +43 -35
- package/dist/ai/components/SlashMenu.d.ts +12 -2
- package/dist/ai/components/SlashMenu.js +29 -13
- package/dist/ai/components/agent/ActivityLine.js +3 -3
- package/dist/ai/components/agent/AgentMessageParts.js +20 -20
- package/dist/ai/components/agent/PermissionPicker.js +13 -11
- package/dist/ai/components/conversationActions.d.ts +4 -6
- package/dist/ai/components/conversationActions.js +9 -13
- package/dist/ai/core/ChatProvider.js +4 -4
- package/dist/ai/core/config.js +1 -1
- package/dist/ai/core/parts.d.ts +5 -0
- package/dist/ai/core/parts.js +28 -1
- package/dist/ai/core/providerIssues.d.ts +7 -0
- package/dist/ai/core/providerIssues.js +9 -1
- package/dist/ai/core/useKeyboardShortcuts.d.ts +4 -0
- package/dist/ai/core/useKeyboardShortcuts.js +8 -2
- package/dist/ai/index.d.ts +0 -1
- package/dist/ai/index.js +1 -2
- package/dist/ai/strings.d.ts +19 -0
- package/dist/ai/strings.js +18 -1
- package/dist/ai/ui/Avatar.js +5 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +0 -1
- package/dist/ai/ui/ConversationSidebar.js +6 -7
- package/dist/ai/ui/Markdown.js +3 -3
- package/dist/ai/ui/Notice.js +6 -6
- package/dist/ai/ui/chip.d.ts +4 -0
- package/dist/ai/ui/chip.js +8 -0
- package/dist/ai/ui/sidebar.d.ts +6 -5
- package/dist/ai/ui/sidebar.js +39 -43
- package/dist/components/ActionMenu.d.ts +13 -0
- package/dist/components/ActionMenu.js +30 -0
- package/dist/components/Avatar.js +6 -6
- package/dist/components/Breadcrumbs.js +1 -1
- package/dist/components/Button.js +10 -10
- package/dist/components/Callout.js +2 -2
- package/dist/components/Card.js +3 -3
- package/dist/components/Combobox.d.ts +66 -0
- package/dist/components/Combobox.js +393 -0
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +23 -0
- package/dist/components/ContextMenu.js +89 -0
- package/dist/components/CopyToClipboard.js +2 -2
- package/dist/components/CreateModal.d.ts +17 -36
- package/dist/components/CreateModal.js +97 -259
- package/dist/components/DescriptionList.js +8 -8
- package/dist/components/Filter.js +2 -2
- package/dist/components/FilterPill.js +2 -2
- package/dist/components/HoverCard.d.ts +14 -0
- package/dist/components/HoverCard.js +33 -0
- package/dist/components/IconButton.d.ts +5 -5
- package/dist/components/IconButton.js +18 -22
- package/dist/components/InfoTip.d.ts +15 -0
- package/dist/components/InfoTip.js +60 -0
- package/dist/components/Input.js +5 -5
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.js +3 -3
- package/dist/components/Markdown.js +1 -1
- package/dist/components/MarkdownImpl.js +2 -2
- package/dist/components/Menu.d.ts +33 -0
- package/dist/components/Menu.js +86 -0
- package/dist/components/MenuEntries.d.ts +56 -0
- package/dist/components/MenuEntries.js +123 -0
- package/dist/components/Modal.d.ts +29 -0
- package/dist/components/Modal.js +47 -0
- package/dist/components/Overview.js +11 -10
- package/dist/components/PageHeader.d.ts +10 -16
- package/dist/components/PageHeader.js +69 -95
- package/dist/components/Pagination.js +5 -5
- package/dist/components/Provider.d.ts +5 -11
- package/dist/components/Provider.js +11 -14
- package/dist/components/Radio.d.ts +8 -0
- package/dist/components/Radio.js +16 -0
- package/dist/components/SectionHeader.js +2 -2
- package/dist/components/SegmentedControl.d.ts +6 -5
- package/dist/components/SegmentedControl.js +34 -30
- package/dist/components/Select.d.ts +27 -0
- package/dist/components/Select.js +78 -0
- package/dist/components/SettingModeOption.d.ts +5 -8
- package/dist/components/SettingModeOption.js +10 -12
- package/dist/components/SettingRow.js +4 -4
- package/dist/components/SettingsCard.js +4 -4
- package/dist/components/SettingsGroup.js +2 -2
- package/dist/components/Sort.js +1 -1
- package/dist/components/StatusBadge.js +7 -7
- package/dist/components/StatusIcons.js +4 -4
- package/dist/components/Switch.d.ts +22 -0
- package/dist/components/Switch.js +28 -0
- package/dist/components/Table.js +11 -11
- package/dist/components/Tooltip.d.ts +24 -20
- package/dist/components/Tooltip.js +58 -76
- package/dist/components/floating.d.ts +14 -0
- package/dist/components/floating.js +21 -0
- package/dist/components/search.d.ts +2 -0
- package/dist/components/search.js +14 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/EditorField.js +16 -21
- package/dist/editor/FormCodePanel.js +19 -19
- package/dist/editor/Monaco.js +3 -3
- package/dist/file-explorer/FileExplorer.js +77 -81
- package/dist/file-explorer/FileExplorerContext.js +2 -2
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +1 -1
- package/dist/file-explorer/FilePreview/Inline.js +1 -1
- package/dist/file-explorer/FilePreview/StreamedBadge.js +5 -6
- package/dist/file-explorer/FilePreview/Viewer.js +8 -8
- package/dist/file-explorer/FilePreview/index.d.ts +1 -1
- package/dist/file-explorer/FilePreview/index.js +49 -83
- package/dist/file-explorer/FileRow.d.ts +4 -3
- package/dist/file-explorer/FileRow.js +32 -38
- package/dist/file-explorer/FileRowsWindow.d.ts +3 -2
- package/dist/file-explorer/FileRowsWindow.js +4 -4
- package/dist/file-explorer/FileTable.d.ts +3 -2
- package/dist/file-explorer/FileTable.js +3 -3
- package/dist/file-explorer/LoadMoreRow.js +1 -1
- package/dist/file-explorer/TreeView.js +11 -16
- package/dist/file-explorer/helpers.js +11 -12
- package/dist/file-explorer/toasts.js +11 -11
- package/dist/form/FieldGroup.d.ts +11 -0
- package/dist/form/FieldGroup.js +36 -0
- package/dist/form/FieldWrapper.js +4 -4
- package/dist/form/Fields/BooleanField.js +23 -33
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +9 -13
- package/dist/form/Fields/ColorField.d.ts +1 -2
- package/dist/form/Fields/ColorField.js +6 -11
- package/dist/form/Fields/DropdownField.d.ts +3 -13
- package/dist/form/Fields/DropdownField.js +40 -27
- package/dist/form/Fields/DurationField.d.ts +1 -2
- package/dist/form/Fields/DurationField.js +25 -32
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +6 -12
- package/dist/form/Fields/MultiDropdownField.js +31 -22
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +65 -35
- package/dist/form/Fields/ObjectField.d.ts +1 -1
- package/dist/form/Fields/ObjectField.js +12 -43
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +30 -41
- package/dist/form/Fields/RangeField.d.ts +1 -2
- package/dist/form/Fields/RangeField.js +23 -16
- package/dist/form/Fields/StringField.d.ts +1 -2
- package/dist/form/Fields/StringField.js +58 -26
- package/dist/form/Fields/TextAreaField.js +12 -10
- package/dist/form/Form.d.ts +30 -48
- package/dist/form/Form.js +306 -412
- package/dist/form/FormLayout.js +9 -9
- package/dist/form/Wizard/WizardContainer.d.ts +1 -4
- package/dist/form/Wizard/WizardContainer.js +40 -56
- package/dist/form/Wizard/WizardNavigation.js +1 -1
- package/dist/form/Wizard/WizardStepContent.d.ts +1 -5
- package/dist/form/Wizard/WizardStepContent.js +11 -16
- package/dist/form/Wizard/WizardStepIndicator.js +6 -6
- package/dist/form/Wizard/types.d.ts +0 -14
- package/dist/form/fieldRegistry.d.ts +1 -1
- package/dist/form/fieldRegistry.js +6 -6
- package/dist/form/formEditing.js +1 -1
- package/dist/form/index.d.ts +5 -4
- package/dist/form/index.js +6 -7
- package/dist/form/types/fieldComponentTypes.d.ts +8 -10
- package/dist/form/useChoiceField.d.ts +20 -0
- package/dist/form/useChoiceField.js +49 -0
- package/dist/form/useFieldValue.d.ts +7 -0
- package/dist/form/useFieldValue.js +20 -0
- package/dist/form/useParsedOpts.d.ts +3 -1
- package/dist/form/useParsedOpts.js +12 -17
- package/dist/form/utils/dependentOptions.d.ts +8 -4
- package/dist/form/utils/dependentOptions.js +25 -17
- package/dist/form/utils/fieldItems.d.ts +10 -0
- package/dist/form/utils/fieldItems.js +11 -0
- package/dist/form/utils/fieldPath.d.ts +10 -0
- package/dist/form/utils/fieldPath.js +20 -0
- package/dist/form/utils/shareEqual.d.ts +6 -0
- package/dist/form/utils/shareEqual.js +38 -0
- package/dist/graph/AnnotationBanner.js +8 -8
- package/dist/graph/Collapse.d.ts +1 -0
- package/dist/graph/Collapse.js +6 -27
- package/dist/graph/Connectors.js +5 -5
- package/dist/graph/DependencyGraph.js +20 -19
- package/dist/graph/GraphEditor.js +30 -41
- package/dist/graph/GraphEditorDialogs.js +17 -17
- package/dist/graph/GraphNode.js +1 -1
- package/dist/graph/InputDialog.js +19 -22
- package/dist/graph/InputsEditor.js +58 -66
- package/dist/graph/JobSummary.js +42 -39
- package/dist/graph/MatrixGroup.js +1 -1
- package/dist/graph/ProblemsButton.js +18 -19
- package/dist/graph/Reveal.js +1 -1
- package/dist/graph/ShortcutsButton.js +15 -18
- package/dist/graph/SuggestionInput.d.ts +5 -10
- package/dist/graph/SuggestionInput.js +14 -18
- package/dist/graph/ToolbarPopover.d.ts +11 -6
- package/dist/graph/ToolbarPopover.js +35 -67
- package/dist/graph/TreeView.js +24 -37
- package/dist/graph/WorkflowSettingsDialog.js +4 -4
- package/dist/graph/editorChrome.js +13 -12
- package/dist/graph/editorFields.js +29 -29
- package/dist/graph/editorPrimitives.d.ts +1 -1
- package/dist/graph/editorPrimitives.js +10 -7
- package/dist/graph/editorRows.js +103 -97
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -3
- package/dist/graph/inputRefs.js +9 -9
- package/dist/graph/settingsViews.js +6 -7
- package/dist/graph/stepWith.js +6 -6
- package/dist/index.d.ts +14 -15
- package/dist/index.js +15 -14
- package/dist/list/ActionToolbar.d.ts +6 -14
- package/dist/list/ActionToolbar.js +48 -96
- package/dist/list/ListPage.d.ts +6 -12
- package/dist/list/ListPage.js +46 -29
- package/dist/list/ListPager.js +4 -4
- package/dist/list/ListTable.js +5 -5
- package/dist/list/ListViewControls.d.ts +5 -4
- package/dist/list/ListViewControls.js +177 -267
- package/dist/list/UserHoverCard.d.ts +3 -17
- package/dist/list/UserHoverCard.js +21 -45
- package/dist/list/index.d.ts +3 -4
- package/dist/list/index.js +3 -4
- package/dist/list/listSearch.js +12 -11
- package/dist/list/rowMenu.d.ts +63 -0
- package/dist/list/rowMenu.js +134 -0
- package/dist/logviewer/LogViewer.js +26 -26
- package/dist/styles.css +1 -1
- package/package.json +7 -13
- package/dist/ai/ui/Dropdown.d.ts +0 -31
- package/dist/ai/ui/Dropdown.js +0 -110
- package/dist/components/AddMenu.d.ts +0 -18
- package/dist/components/AddMenu.js +0 -46
- package/dist/components/BareModal.d.ts +0 -17
- package/dist/components/BareModal.js +0 -77
- package/dist/components/CollapsiblePanel.d.ts +0 -27
- package/dist/components/CollapsiblePanel.js +0 -77
- package/dist/components/Dropdown.d.ts +0 -28
- package/dist/components/Dropdown.js +0 -355
- package/dist/components/Listbox.d.ts +0 -21
- package/dist/components/Listbox.js +0 -119
- package/dist/components/MultiSelect.d.ts +0 -22
- package/dist/components/MultiSelect.js +0 -168
- package/dist/components/SwitchToggle.d.ts +0 -15
- package/dist/components/SwitchToggle.js +0 -57
- package/dist/components/SwitchToggleSmall.d.ts +0 -6
- package/dist/components/SwitchToggleSmall.js +0 -14
- package/dist/components/Toggle.d.ts +0 -6
- package/dist/components/Toggle.js +0 -20
- package/dist/components/dropdownUtils.d.ts +0 -37
- package/dist/components/dropdownUtils.js +0 -99
- package/dist/form/SpecialTypes/DropdownWrapper.d.ts +0 -25
- package/dist/form/SpecialTypes/DropdownWrapper.js +0 -28
- package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +0 -51
- package/dist/form/SpecialTypes/FormikCustomDropdown.js +0 -119
- package/dist/form/SpecialTypes/FormikCustomInput.d.ts +0 -19
- package/dist/form/SpecialTypes/FormikCustomInput.js +0 -121
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.d.ts +0 -13
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.js +0 -31
- package/dist/form/SpecialTypes/FormikNumericInput.d.ts +0 -9
- package/dist/form/SpecialTypes/FormikNumericInput.js +0 -60
- package/dist/form/SpecialTypes/index.d.ts +0 -3
- package/dist/list/HoverCard.d.ts +0 -24
- package/dist/list/HoverCard.js +0 -73
- package/dist/list/RowContextMenu.d.ts +0 -127
- package/dist/list/RowContextMenu.js +0 -515
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { safeUrl } from "../safeUrl.js";
|
|
2
|
-
import { useNotify, useSlots, useStrings } from "../components/Provider.js";
|
|
3
1
|
import { BiSolidTrashAlt } from "../icons/bi/BiSolidTrashAlt.js";
|
|
4
2
|
import { BsArrowsCollapse } from "../icons/bs/BsArrowsCollapse.js";
|
|
5
3
|
import { FaAngleDown } from "../icons/fa/FaAngleDown.js";
|
|
@@ -16,16 +14,21 @@ import { LuEye } from "../icons/lu/LuEye.js";
|
|
|
16
14
|
import { MdRefresh } from "../icons/md/MdRefresh.js";
|
|
17
15
|
import { PiShareBold } from "../icons/pi/PiShareBold.js";
|
|
18
16
|
import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
|
|
17
|
+
import { MenuItem, MenuPopup, MenuSeparator } from "../components/Menu.js";
|
|
18
|
+
import { safeUrl } from "../safeUrl.js";
|
|
19
19
|
import { keyedByContent } from "../components/keys.js";
|
|
20
|
-
import {
|
|
20
|
+
import { Tooltip } from "../components/Tooltip.js";
|
|
21
|
+
import { useNotify, useSlots, useStrings } from "../components/Provider.js";
|
|
21
22
|
import { ConfirmModal } from "../components/ConfirmModal.js";
|
|
23
|
+
import { useContextMenu } from "../components/ContextMenu.js";
|
|
22
24
|
import CopyToClipboard, { CopyCodeBlock } from "../components/CopyToClipboard.js";
|
|
25
|
+
import { InfoTip } from "../components/InfoTip.js";
|
|
23
26
|
import { CreateModal } from "../components/CreateModal.js";
|
|
24
27
|
import Loader from "../components/Loader.js";
|
|
25
|
-
import { assembleRowMenu, useCopySubmenu, useRowMenu } from "../list/RowContextMenu.js";
|
|
26
28
|
import { StatusBadge } from "../components/StatusBadge.js";
|
|
27
29
|
import { Table } from "../components/Table.js";
|
|
28
30
|
import { ListActionsHeader, ListSkeleton, listTableFixedProps, listTableProps } from "../list/ListTable.js";
|
|
31
|
+
import { assembleRowMenu, useCopySubmenu } from "../list/rowMenu.js";
|
|
29
32
|
import { calculateUploadNodesTotalSize, createTreeBuilder, formatFileSize, getDirectoryNameError, getDirectoryObjectPath, getNodeChildren, getObjectKeyFromNode, getParentPath, getUploadNodesFromDataTransferItems, getUriScheme, pruneNodesInsideSelectedDirectories, removeLeadingAndTrailingSlashes } from "./lib/utils.js";
|
|
30
33
|
import { useFileExplorer } from "./FileExplorerContext.js";
|
|
31
34
|
import { PREVIEW_URL_EXPIRES_IN, canPreview } from "./FilePreview/previewType.js";
|
|
@@ -39,11 +42,11 @@ import { FileTableHeaders } from "./FileTableHeaders.js";
|
|
|
39
42
|
import { FileTable } from "./FileTable.js";
|
|
40
43
|
import { advanceListing, beginLoadingMore, canAutoLoadMore, clearListingError, clearListingsUnder, hasMore, incompletePaths, isListed, isLoadingMore, loadMoreError, nextHydrationStep, recordListingError, replaceListing } from "./lib/paging.js";
|
|
41
44
|
import { TreeView } from "./TreeView.js";
|
|
42
|
-
import { Menu
|
|
43
|
-
import
|
|
45
|
+
import { Menu } from "@base-ui/react/menu";
|
|
46
|
+
import { clsx } from "clsx";
|
|
47
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
44
48
|
import { useCallback, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
45
49
|
import { useLocalStorage } from "usehooks-ts";
|
|
46
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
47
50
|
import { DateTime } from "luxon";
|
|
48
51
|
import { Resizable } from "re-resizable";
|
|
49
52
|
//#region src/file-explorer/FileExplorer.tsx
|
|
@@ -258,7 +261,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
258
261
|
const [pendingDelete, setPendingDelete] = useState(null);
|
|
259
262
|
const [detailTab, setDetailTab] = useState("details");
|
|
260
263
|
useEffect(() => clearPreviewCache, []);
|
|
261
|
-
const { openMenu, contextMenu } =
|
|
264
|
+
const { openMenu, contextMenu } = useContextMenu();
|
|
262
265
|
const [sidebarWidth, setSidebarWidth] = useLocalStorage(SIDEBAR_WIDTH_STORAGE_KEY, 300);
|
|
263
266
|
const handleToggleExpand = useCallback((path) => {
|
|
264
267
|
setExpandedPaths((prev) => {
|
|
@@ -630,7 +633,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
630
633
|
key: "create-folder",
|
|
631
634
|
label: t.createFolder.action,
|
|
632
635
|
icon: /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
633
|
-
|
|
636
|
+
onClick: () => openCreateFolder(node)
|
|
634
637
|
}];
|
|
635
638
|
};
|
|
636
639
|
const buildRowMenu = (node) => {
|
|
@@ -644,20 +647,20 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
644
647
|
key: "preview",
|
|
645
648
|
label: t.preview.preview,
|
|
646
649
|
icon: /* @__PURE__ */ jsx(LuEye, {}),
|
|
647
|
-
|
|
650
|
+
onClick: () => openPreview(node)
|
|
648
651
|
});
|
|
649
652
|
if (isFile) {
|
|
650
653
|
actions.push({
|
|
651
654
|
key: "download",
|
|
652
655
|
label: t.preview.download,
|
|
653
656
|
icon: /* @__PURE__ */ jsx(FiDownload, {}),
|
|
654
|
-
|
|
657
|
+
onClick: () => downloadNode(node)
|
|
655
658
|
});
|
|
656
659
|
if (nodeCanShare) actions.push({
|
|
657
660
|
key: "share",
|
|
658
661
|
label: t.preview.shareFile,
|
|
659
662
|
icon: /* @__PURE__ */ jsx(PiShareBold, {}),
|
|
660
|
-
|
|
663
|
+
onClick: () => onShareFileButtonClick(node)
|
|
661
664
|
});
|
|
662
665
|
}
|
|
663
666
|
actions.push(...getCreateFolderActions(node, storage));
|
|
@@ -667,13 +670,12 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
667
670
|
label: t.preview.delete,
|
|
668
671
|
icon: /* @__PURE__ */ jsx(BiSolidTrashAlt, {}),
|
|
669
672
|
destructive: true,
|
|
670
|
-
|
|
673
|
+
onClick: () => deleteNode(node)
|
|
671
674
|
});
|
|
672
675
|
const lead = [{
|
|
673
|
-
kind: "action",
|
|
674
676
|
label: isFile ? t.preview.viewDetails : t.preview.openFolder,
|
|
675
677
|
icon: isFile ? /* @__PURE__ */ jsx(FiFileText, {}) : /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
676
|
-
|
|
678
|
+
onClick: () => handleSelectTreeItem(node.path, node)
|
|
677
679
|
}];
|
|
678
680
|
const uriExtras = uris.map((value) => ({
|
|
679
681
|
label: `${getUriScheme(value).toUpperCase()} URI`,
|
|
@@ -694,7 +696,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
694
696
|
if (items.length === 0) return;
|
|
695
697
|
e.preventDefault();
|
|
696
698
|
e.stopPropagation();
|
|
697
|
-
openMenu(e
|
|
699
|
+
openMenu(e, items);
|
|
698
700
|
};
|
|
699
701
|
const renderBreadcrumb = () => {
|
|
700
702
|
const chain = [];
|
|
@@ -951,24 +953,24 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
951
953
|
className: "flex items-center justify-end h-10 px-3 shrink-0 border-b theme-border",
|
|
952
954
|
children: /* @__PURE__ */ jsxs("div", {
|
|
953
955
|
className: "flex gap-x-0.5",
|
|
954
|
-
children: [/* @__PURE__ */ jsx(
|
|
955
|
-
|
|
956
|
-
"
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
}), /* @__PURE__ */ jsx(
|
|
964
|
-
|
|
965
|
-
"
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
956
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
957
|
+
content: t.chrome.refresh,
|
|
958
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
959
|
+
type: "button",
|
|
960
|
+
"aria-label": t.chrome.refresh,
|
|
961
|
+
className: "inline-flex items-center justify-center h-7 w-7 rounded-md cursor-pointer theme-muted-text hover:theme-text hover:theme-hover transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-(--theme-link)",
|
|
962
|
+
onClick: () => handleRefresh(),
|
|
963
|
+
children: /* @__PURE__ */ jsx(MdRefresh, { className: "h-3.5 w-3.5" })
|
|
964
|
+
})
|
|
965
|
+
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
966
|
+
content: t.chrome.collapse,
|
|
967
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
968
|
+
type: "button",
|
|
969
|
+
"aria-label": t.chrome.collapse,
|
|
970
|
+
className: "inline-flex items-center justify-center h-7 w-7 rounded-md cursor-pointer theme-muted-text hover:theme-text hover:theme-hover transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-(--theme-link)",
|
|
971
|
+
onClick: collapseAll,
|
|
972
|
+
children: /* @__PURE__ */ jsx(BsArrowsCollapse, { className: "h-3.5 w-3.5" })
|
|
973
|
+
})
|
|
972
974
|
})]
|
|
973
975
|
})
|
|
974
976
|
}), /* @__PURE__ */ jsx(TreeView, {
|
|
@@ -1028,10 +1030,9 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1028
1030
|
icon: getNodeIcon(rootNode, slots.storageIconUrl, t.chrome.storageIconAlt),
|
|
1029
1031
|
storageCount: getNodeChildren(parentToChildrenMap, rootNode.path).length,
|
|
1030
1032
|
getItems: () => [{
|
|
1031
|
-
kind: "action",
|
|
1032
1033
|
label: t.preview.open,
|
|
1033
1034
|
icon: /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
1034
|
-
|
|
1035
|
+
onClick: () => openUserNode(rootNode)
|
|
1035
1036
|
}],
|
|
1036
1037
|
openMenu,
|
|
1037
1038
|
onOpen: openUserNode
|
|
@@ -1041,7 +1042,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1041
1042
|
selectedStorage: null,
|
|
1042
1043
|
onRefresh: handleRefresh
|
|
1043
1044
|
})]
|
|
1044
|
-
}) : !selectedNode ? /* @__PURE__ */ jsx(NoFileSelectedPreview, {}) : /* @__PURE__ */ jsxs(Fragment
|
|
1045
|
+
}) : !selectedNode ? /* @__PURE__ */ jsx(NoFileSelectedPreview, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1045
1046
|
/* @__PURE__ */ jsxs("div", {
|
|
1046
1047
|
className: "flex items-center justify-between gap-3 px-4 h-12 shrink-0 border-b theme-border",
|
|
1047
1048
|
children: [renderBreadcrumb(), /* @__PURE__ */ jsxs("div", {
|
|
@@ -1093,7 +1094,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1093
1094
|
children: t.createFolder.action
|
|
1094
1095
|
})]
|
|
1095
1096
|
}),
|
|
1096
|
-
selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(
|
|
1097
|
+
selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
1097
1098
|
"aria-label": t.chrome.upload,
|
|
1098
1099
|
className: "btn btn-info cursor-pointer flex items-center justify-between pr-0.5!",
|
|
1099
1100
|
disabled: selectedNode.type === "file" || !selectedNode.storageId,
|
|
@@ -1101,23 +1102,18 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1101
1102
|
className: "hidden md:inline",
|
|
1102
1103
|
children: t.chrome.upload
|
|
1103
1104
|
})] }), /* @__PURE__ */ jsx(FaAngleDown, { className: "h-4 w-4 ml-2" })]
|
|
1104
|
-
}), /* @__PURE__ */ jsxs(
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
children: [/* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsx("button", {
|
|
1109
|
-
type: "button",
|
|
1110
|
-
className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
|
|
1105
|
+
}), /* @__PURE__ */ jsxs(MenuPopup, {
|
|
1106
|
+
align: "end",
|
|
1107
|
+
className: "w-36",
|
|
1108
|
+
children: [/* @__PURE__ */ jsx(MenuItem, {
|
|
1111
1109
|
onClick: () => fileInputRef.current?.click(),
|
|
1112
1110
|
children: "Select Files"
|
|
1113
|
-
})
|
|
1114
|
-
type: "button",
|
|
1115
|
-
className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
|
|
1111
|
+
}), /* @__PURE__ */ jsx(MenuItem, {
|
|
1116
1112
|
onClick: () => folderInputRef.current?.click(),
|
|
1117
1113
|
children: "Select Folder"
|
|
1118
|
-
})
|
|
1114
|
+
})]
|
|
1119
1115
|
})] }),
|
|
1120
|
-
/* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(
|
|
1116
|
+
/* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
1121
1117
|
"aria-label": t.chrome.download,
|
|
1122
1118
|
className: "btn btn-info cursor-pointer flex items-center justify-between pr-0.5!",
|
|
1123
1119
|
disabled: checkedItems.size === 0 && selectedNode.type !== "file" || hasFolderSelected() || !selectedNode.storageId,
|
|
@@ -1125,28 +1121,28 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1125
1121
|
className: "hidden md:inline",
|
|
1126
1122
|
children: t.chrome.download
|
|
1127
1123
|
})] }), /* @__PURE__ */ jsx(FaAngleDown, { className: "h-4 w-4 ml-2" })]
|
|
1128
|
-
}), /* @__PURE__ */ jsxs(
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
children: [/* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsx("button", {
|
|
1133
|
-
type: "button",
|
|
1134
|
-
className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
|
|
1124
|
+
}), /* @__PURE__ */ jsxs(MenuPopup, {
|
|
1125
|
+
align: "end",
|
|
1126
|
+
className: "w-72",
|
|
1127
|
+
children: [/* @__PURE__ */ jsx(MenuItem, {
|
|
1135
1128
|
onClick: handleDownload,
|
|
1136
1129
|
children: t.chrome.downloadFromBrowser
|
|
1137
|
-
})
|
|
1138
|
-
className: "
|
|
1139
|
-
children:
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
children:
|
|
1145
|
-
className: "
|
|
1146
|
-
children: line
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1130
|
+
}), downloadCommand && downloadCommandText && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), /* @__PURE__ */ jsxs("div", {
|
|
1131
|
+
className: "px-2 py-1.5",
|
|
1132
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
1133
|
+
className: "text-sm text-center pb-1.5",
|
|
1134
|
+
children: downloadCommand.label
|
|
1135
|
+
}), /* @__PURE__ */ jsx(CopyCodeBlock, {
|
|
1136
|
+
textToCopy: downloadCommandText,
|
|
1137
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1138
|
+
className: "overflow-x-auto text-xs",
|
|
1139
|
+
children: keyedByContent(downloadCommandText.split("\n"), (l) => l).map(({ key, item: line }) => /* @__PURE__ */ jsx("div", {
|
|
1140
|
+
className: "whitespace-nowrap",
|
|
1141
|
+
children: line
|
|
1142
|
+
}, key))
|
|
1143
|
+
})
|
|
1144
|
+
})]
|
|
1145
|
+
})] })]
|
|
1150
1146
|
})] }),
|
|
1151
1147
|
/* @__PURE__ */ jsxs("button", {
|
|
1152
1148
|
type: "button",
|
|
@@ -1217,7 +1213,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1217
1213
|
const createdDt = selectedNode.created ? DateTime.fromISO(selectedNode.created) : null;
|
|
1218
1214
|
const previewable = canPreview(selectedNode);
|
|
1219
1215
|
const effectiveTab = previewable ? detailTab : "details";
|
|
1220
|
-
const tabClass = (active) =>
|
|
1216
|
+
const tabClass = (active) => clsx("mx-2.5 border-b-2 px-1 py-2.5 text-[13px] font-medium cursor-pointer transition-colors", active ? "theme-text border-(--theme-element)" : "theme-muted-text border-transparent hover:theme-text");
|
|
1221
1217
|
return /* @__PURE__ */ jsxs("div", {
|
|
1222
1218
|
className: "flex h-full min-h-0 flex-col",
|
|
1223
1219
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -1267,7 +1263,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1267
1263
|
className: "tabular-nums",
|
|
1268
1264
|
children: formatFileSize(selectedNode.size)
|
|
1269
1265
|
}),
|
|
1270
|
-
modifiedDt && /* @__PURE__ */ jsxs(Fragment
|
|
1266
|
+
modifiedDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
1271
1267
|
"aria-hidden": true,
|
|
1272
1268
|
children: "·"
|
|
1273
1269
|
}), /* @__PURE__ */ jsxs("span", { children: ["Modified ", modifiedDt.toRelative()] })] })
|
|
@@ -1284,9 +1280,9 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1284
1280
|
children: [/* @__PURE__ */ jsx(ShareFileButton, {
|
|
1285
1281
|
node: selectedNode,
|
|
1286
1282
|
onShare: onShareFileButtonClick
|
|
1287
|
-
}), /* @__PURE__ */ jsx(
|
|
1283
|
+
}), /* @__PURE__ */ jsx(InfoTip, {
|
|
1288
1284
|
text: "This will generate a pre-signed URL for this file. Anyone with this link can temporarily access and download the file, even if they don't have an account. The link will automatically expire after 12 hours.",
|
|
1289
|
-
|
|
1285
|
+
side: "right"
|
|
1290
1286
|
})]
|
|
1291
1287
|
}),
|
|
1292
1288
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -1297,21 +1293,21 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1297
1293
|
}), /* @__PURE__ */ jsxs("dl", {
|
|
1298
1294
|
className: "grid grid-cols-[minmax(0,140px)_1fr] gap-x-6 gap-y-2 text-sm",
|
|
1299
1295
|
children: [
|
|
1300
|
-
typeof selectedNode.size === "number" && /* @__PURE__ */ jsxs(Fragment
|
|
1296
|
+
typeof selectedNode.size === "number" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1301
1297
|
className: "theme-muted-text",
|
|
1302
1298
|
children: t.chrome.size
|
|
1303
1299
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1304
1300
|
className: "tabular-nums",
|
|
1305
1301
|
children: formatFileSize(selectedNode.size)
|
|
1306
1302
|
})] }),
|
|
1307
|
-
selectedNode.contentType && /* @__PURE__ */ jsxs(Fragment
|
|
1303
|
+
selectedNode.contentType && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1308
1304
|
className: "theme-muted-text",
|
|
1309
1305
|
children: "Content Type"
|
|
1310
1306
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1311
1307
|
className: "font-mono text-xs",
|
|
1312
1308
|
children: selectedNode.contentType
|
|
1313
1309
|
})] }),
|
|
1314
|
-
createdDt && /* @__PURE__ */ jsxs(Fragment
|
|
1310
|
+
createdDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1315
1311
|
className: "theme-muted-text",
|
|
1316
1312
|
children: t.chrome.created
|
|
1317
1313
|
}), /* @__PURE__ */ jsxs("dd", { children: [
|
|
@@ -1322,7 +1318,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1322
1318
|
children: ["· ", createdDt.toRelative()]
|
|
1323
1319
|
})
|
|
1324
1320
|
] })] }),
|
|
1325
|
-
modifiedDt && /* @__PURE__ */ jsxs(Fragment
|
|
1321
|
+
modifiedDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1326
1322
|
className: "theme-muted-text",
|
|
1327
1323
|
children: "Last Modified"
|
|
1328
1324
|
}), /* @__PURE__ */ jsxs("dd", { children: [
|
|
@@ -1333,14 +1329,14 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1333
1329
|
children: ["· ", modifiedDt.toRelative()]
|
|
1334
1330
|
})
|
|
1335
1331
|
] })] }),
|
|
1336
|
-
selectedNode.hash && /* @__PURE__ */ jsxs(Fragment
|
|
1332
|
+
selectedNode.hash && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1337
1333
|
className: "theme-muted-text",
|
|
1338
1334
|
children: t.chrome.hash
|
|
1339
1335
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1340
1336
|
className: "font-mono text-xs break-all",
|
|
1341
1337
|
children: selectedNode.hash.replace(/^"|"$/g, "")
|
|
1342
1338
|
})] }),
|
|
1343
|
-
selectedNode.storageClass && /* @__PURE__ */ jsxs(Fragment
|
|
1339
|
+
selectedNode.storageClass && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1344
1340
|
className: "theme-muted-text",
|
|
1345
1341
|
children: "Storage Class"
|
|
1346
1342
|
}), /* @__PURE__ */ jsx("dd", {
|
|
@@ -1420,7 +1416,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1420
1416
|
}),
|
|
1421
1417
|
" ",
|
|
1422
1418
|
/* @__PURE__ */ jsx("span", {
|
|
1423
|
-
className:
|
|
1419
|
+
className: clsx(isUploadSizeExceeded(pendingUpload?.totalSize ?? 0) && "text-amber-800 font-semibold"),
|
|
1424
1420
|
children: formatFileSize(pendingUpload?.totalSize ?? 0)
|
|
1425
1421
|
})
|
|
1426
1422
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useNotify, useStrings } from "../components/Provider.js";
|
|
2
1
|
import { keyedByContent } from "../components/keys.js";
|
|
2
|
+
import { useNotify, useStrings } from "../components/Provider.js";
|
|
3
3
|
import { mapWithConcurrency } from "./lib/batch.js";
|
|
4
4
|
import { calculateUploadNodesTotalSize, getUploadSessionETA, removeLeadingSlash } from "./lib/utils.js";
|
|
5
5
|
import { UploadSessionToast } from "./toasts.js";
|
|
6
|
-
import { createContext, use, useRef } from "react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createContext, use, useRef } from "react";
|
|
8
8
|
//#region src/file-explorer/FileExplorerContext.tsx
|
|
9
9
|
var UPLOAD_CONCURRENCY = 3;
|
|
10
10
|
var FileExplorerContext = createContext(void 0);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCssIsDark } from "../../components/useCssIsDark.js";
|
|
2
2
|
import { defineEditorThemes, getThemeName } from "../../editor/themes.js";
|
|
3
3
|
import { setupMonacoWorkers } from "../../editor/workers.js";
|
|
4
|
-
import { useEffect, useRef } from "react";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useEffect, useRef } from "react";
|
|
6
6
|
import * as monaco from "monaco-editor";
|
|
7
7
|
//#region src/file-explorer/FilePreview/CodePreviewEditor.tsx
|
|
8
8
|
var OPTIONS = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useStrings } from "../../components/Provider.js";
|
|
2
1
|
import { FaExpand } from "../../icons/fa/FaExpand.js";
|
|
2
|
+
import { useStrings } from "../../components/Provider.js";
|
|
3
3
|
import { formatFileSize } from "../lib/utils.js";
|
|
4
4
|
import { getPreviewKind } from "./previewType.js";
|
|
5
5
|
import { StreamedBadge } from "./StreamedBadge.js";
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { useStrings } from "../../components/Provider.js";
|
|
2
1
|
import { FaLock } from "../../icons/fa/FaLock.js";
|
|
3
|
-
import {
|
|
2
|
+
import { useStrings } from "../../components/Provider.js";
|
|
3
|
+
import { InfoTip } from "../../components/InfoTip.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/file-explorer/FilePreview/StreamedBadge.tsx
|
|
6
6
|
function StreamedBadge() {
|
|
7
7
|
const t = useStrings().fileExplorer;
|
|
8
|
-
return /* @__PURE__ */ jsxs(
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"data-tooltip-content": t.preview.streamedTooltip,
|
|
8
|
+
return /* @__PURE__ */ jsxs(InfoTip, {
|
|
9
|
+
text: t.preview.streamedTooltip,
|
|
10
|
+
className: "shrink-0 gap-1 rounded-full border border-green-500/40 bg-green-500/15 px-2 py-0.5 text-[11px] text-green-600",
|
|
12
11
|
children: [/* @__PURE__ */ jsx(FaLock, { className: "h-2.5 w-2.5" }), t.preview.streamed]
|
|
13
12
|
});
|
|
14
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useStrings } from "../../components/Provider.js";
|
|
2
1
|
import { BsFileEarmarkZip } from "../../icons/bs/BsFileEarmarkZip.js";
|
|
3
2
|
import { BsMusicNoteBeamed } from "../../icons/bs/BsMusicNoteBeamed.js";
|
|
4
3
|
import { FaLock } from "../../icons/fa/FaLock.js";
|
|
5
4
|
import { FiDownload } from "../../icons/fi/FiDownload.js";
|
|
6
5
|
import { FiFile } from "../../icons/fi/FiFile.js";
|
|
7
6
|
import { positionKeys, withPositionKeys } from "../../components/keys.js";
|
|
7
|
+
import { useStrings } from "../../components/Provider.js";
|
|
8
8
|
import Loader from "../../components/Loader.js";
|
|
9
9
|
import Markdown from "../../components/Markdown.js";
|
|
10
10
|
import { formatFileSize, getFileExtension } from "../lib/utils.js";
|
|
@@ -14,9 +14,9 @@ import { joinSource, parseDelimited, parseNotebook, stripAnsi } from "./parse.js
|
|
|
14
14
|
import { countLines } from "./readCappedBytes.js";
|
|
15
15
|
import { useObjectBlobUrl } from "./useObjectBlobUrl.js";
|
|
16
16
|
import { useObjectText } from "./useObjectText.js";
|
|
17
|
-
import
|
|
17
|
+
import { clsx } from "clsx";
|
|
18
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
19
|
import { Suspense, lazy, useCallback, useMemo, useState } from "react";
|
|
19
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
20
20
|
//#region src/file-explorer/FilePreview/Viewer.tsx
|
|
21
21
|
var CodePreviewEditor = lazy(() => import("./CodePreviewEditor.js"));
|
|
22
22
|
var PREVIEW_MARKDOWN_CONTROLS = {
|
|
@@ -126,7 +126,7 @@ function ImageView({ node, url, zoom, onDownload, storage }) {
|
|
|
126
126
|
children: /* @__PURE__ */ jsx("img", {
|
|
127
127
|
src: url,
|
|
128
128
|
alt: node.name,
|
|
129
|
-
className:
|
|
129
|
+
className: clsx("block rounded-md shadow-lg", fit && "object-contain"),
|
|
130
130
|
style: fit ? {
|
|
131
131
|
maxWidth: "100%",
|
|
132
132
|
maxHeight: "100%"
|
|
@@ -249,12 +249,12 @@ function CodeView({ node, url, onDownload, storage, onCorsRetry }) {
|
|
|
249
249
|
className: "inline-flex shrink-0 overflow-hidden rounded-full border theme-border text-[11px]",
|
|
250
250
|
children: [/* @__PURE__ */ jsx("button", {
|
|
251
251
|
type: "button",
|
|
252
|
-
className:
|
|
252
|
+
className: clsx("cursor-pointer px-2 py-0.5", tail ? "theme-muted-text theme-hover" : "theme-element"),
|
|
253
253
|
onClick: () => setTail(false),
|
|
254
254
|
children: t.preview.head
|
|
255
255
|
}), /* @__PURE__ */ jsx("button", {
|
|
256
256
|
type: "button",
|
|
257
|
-
className:
|
|
257
|
+
className: clsx("cursor-pointer px-2 py-0.5", tail ? "theme-element" : "theme-muted-text theme-hover"),
|
|
258
258
|
onClick: () => setTail(true),
|
|
259
259
|
children: t.preview.tail
|
|
260
260
|
})]
|
|
@@ -348,7 +348,7 @@ function CsvTable({ node, text, maxRows }) {
|
|
|
348
348
|
children: header[i] ?? ""
|
|
349
349
|
}, key))]
|
|
350
350
|
}) }), /* @__PURE__ */ jsx("tbody", { children: withPositionKeys(shown, "row").map(({ key, item: row }, r) => /* @__PURE__ */ jsxs("tr", {
|
|
351
|
-
className:
|
|
351
|
+
className: clsx(r % 2 === 1 && "bg-(--theme-panel-bg)/50"),
|
|
352
352
|
children: [/* @__PURE__ */ jsx("td", {
|
|
353
353
|
className: "px-3.5 py-1.5 text-right theme-muted-text",
|
|
354
354
|
children: r + 1
|
|
@@ -471,7 +471,7 @@ function PreviewFetchState({ loading, tooLarge, size, error, corsError, storage,
|
|
|
471
471
|
onDownload
|
|
472
472
|
});
|
|
473
473
|
if (error) return /* @__PURE__ */ jsx(PreviewError, { onDownload });
|
|
474
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
474
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
475
475
|
}
|
|
476
476
|
function NotPreviewable({ icon, title, message, onDownload }) {
|
|
477
477
|
const t = useStrings().fileExplorer;
|
|
@@ -10,5 +10,5 @@ interface FilePreviewProps {
|
|
|
10
10
|
onDownload: (node: TreeNode) => void;
|
|
11
11
|
onCopyUri: (node: TreeNode) => void;
|
|
12
12
|
}
|
|
13
|
-
export declare function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigate, onClose, onDownload, onCopyUri, }: FilePreviewProps): import("react").
|
|
13
|
+
export declare function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigate, onClose, onDownload, onCopyUri, }: FilePreviewProps): import("react").JSX.Element | null;
|
|
14
14
|
export {};
|