@parallelworks/ui 0.43.0 → 0.45.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 +348 -25
- package/dist/ai/agent/diff.d.ts +2 -1
- package/dist/ai/agent/diff.js +4 -12
- package/dist/ai/agent/diffHighlight.d.ts +1 -1
- package/dist/ai/agent/diffHighlight.js +4 -3
- package/dist/ai/agent/index.d.ts +2 -1
- package/dist/ai/agent/toolStrings.d.ts +37 -0
- package/dist/ai/agent/toolStrings.js +35 -0
- package/dist/ai/agent/toolfmt.d.ts +8 -3
- package/dist/ai/agent/toolfmt.js +50 -65
- package/dist/ai/ai.css +18 -31
- package/dist/ai/components/AllocationSelector.js +2 -2
- package/dist/ai/components/AttachmentManager.js +28 -29
- package/dist/ai/components/AttachmentUpload.js +25 -30
- package/dist/ai/components/BlockedGroupBanner.js +2 -2
- package/dist/ai/components/BranchNavigator.js +3 -4
- package/dist/ai/components/ChatEmptyState.js +8 -7
- package/dist/ai/components/ChatInput.js +10 -12
- package/dist/ai/components/ChatLayout.js +3 -3
- package/dist/ai/components/ChatMessage.js +49 -61
- package/dist/ai/components/ChatMessageList.js +46 -42
- package/dist/ai/components/ChatSidebar.js +26 -34
- package/dist/ai/components/ChatStage.js +1 -1
- package/dist/ai/components/ComposerChrome.js +3 -4
- package/dist/ai/components/DragOverlay.js +6 -4
- package/dist/ai/components/ModelSelector.js +14 -15
- package/dist/ai/components/PastedText.js +18 -14
- package/dist/ai/components/ProviderIssueBanner.js +3 -4
- package/dist/ai/components/Reasoning.d.ts +12 -6
- package/dist/ai/components/Reasoning.js +31 -18
- package/dist/ai/components/ShareDialog.js +25 -28
- package/dist/ai/components/SlashMenu.js +3 -3
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -5
- package/dist/ai/components/agent/ActivityLine.js +17 -54
- package/dist/ai/components/agent/AgentMessageParts.js +139 -149
- package/dist/ai/components/conversationActions.js +16 -16
- package/dist/ai/core/ChatProvider.d.ts +2 -4
- package/dist/ai/core/ChatProvider.js +25 -38
- package/dist/ai/core/exportConversation.js +4 -4
- package/dist/ai/core/sidebarState.d.ts +8 -6
- package/dist/ai/core/sidebarState.js +21 -28
- package/dist/ai/core/useKeyboardShortcuts.js +14 -5
- package/dist/ai/index.d.ts +4 -5
- package/dist/ai/index.js +7 -7
- package/dist/ai/strings.d.ts +14 -31
- package/dist/ai/strings.js +19 -39
- package/dist/ai/types.d.ts +0 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +12 -9
- package/dist/ai/ui/ConversationSidebar.js +43 -87
- package/dist/ai/ui/Markdown.d.ts +3 -6
- package/dist/ai/ui/Markdown.js +6 -73
- package/dist/ai/ui/Notice.js +10 -12
- package/dist/ai/ui/chip.d.ts +2 -2
- package/dist/ai/ui/chip.js +1 -1
- package/dist/ai/ui/sidebar.d.ts +4 -20
- package/dist/ai/ui/sidebar.js +30 -67
- package/dist/ai/utils.d.ts +0 -1
- package/dist/ai/utils.js +1 -14
- package/dist/brandIcons.d.ts +51 -0
- package/dist/brandIcons.js +75 -0
- package/dist/components/Avatar.d.ts +3 -1
- package/dist/components/Avatar.js +34 -28
- package/dist/components/Button.d.ts +12 -7
- package/dist/components/Button.js +39 -44
- package/dist/components/Callout.js +18 -12
- package/dist/components/Card.d.ts +18 -8
- package/dist/components/Card.js +17 -6
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox.js +30 -0
- package/dist/components/Combobox.d.ts +9 -1
- package/dist/components/Combobox.js +71 -44
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +2 -8
- package/dist/components/ContextMenu.js +2 -29
- package/dist/components/CopyToClipboard.js +17 -36
- package/dist/components/CreateModal.d.ts +3 -24
- package/dist/components/CreateModal.js +46 -113
- package/dist/components/DatePicker.d.ts +31 -0
- package/dist/components/DatePicker.js +191 -0
- package/dist/components/DescriptionList.js +4 -4
- package/dist/components/Disclosure.d.ts +34 -0
- package/dist/components/Disclosure.js +46 -0
- package/dist/components/Drawer.d.ts +47 -0
- package/dist/components/Drawer.js +120 -0
- package/dist/components/EmptyState.d.ts +15 -10
- package/dist/components/EmptyState.js +13 -8
- package/dist/components/ExternalLink.d.ts +8 -0
- package/dist/components/ExternalLink.js +29 -0
- package/dist/components/Field.d.ts +70 -0
- package/dist/components/Field.js +159 -0
- package/dist/components/HoverCard.js +11 -14
- package/dist/components/IconButton.d.ts +16 -13
- package/dist/components/IconButton.js +27 -18
- package/dist/components/InfoTip.js +16 -23
- package/dist/components/Input.d.ts +10 -9
- package/dist/components/Input.js +54 -96
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.d.ts +15 -8
- package/dist/components/Loader.js +29 -19
- package/dist/components/Markdown.d.ts +7 -1
- package/dist/components/Markdown.js +2 -0
- package/dist/components/MarkdownImpl.d.ts +1 -1
- package/dist/components/MarkdownImpl.js +55 -14
- package/dist/components/Menu.js +13 -15
- package/dist/components/MenuEntries.js +11 -16
- package/dist/components/Meter.d.ts +48 -0
- package/dist/components/Meter.js +94 -0
- package/dist/components/Modal.js +11 -14
- package/dist/components/NumberInput.d.ts +25 -0
- package/dist/components/NumberInput.js +55 -0
- package/dist/components/Overview.js +12 -10
- package/dist/components/PageHeader.d.ts +2 -3
- package/dist/components/PageHeader.js +30 -21
- package/dist/components/Pagination.d.ts +27 -14
- package/dist/components/Pagination.js +86 -25
- package/dist/components/Popover.d.ts +47 -0
- package/dist/components/Popover.js +63 -0
- package/dist/components/Provider.d.ts +197 -80
- package/dist/components/Provider.js +200 -118
- package/dist/components/Radio.d.ts +1 -1
- package/dist/components/Radio.js +4 -4
- package/dist/components/RefreshButton.d.ts +15 -0
- package/dist/components/RefreshButton.js +53 -0
- package/dist/components/RunStatusIcon.d.ts +12 -0
- package/dist/components/RunStatusIcon.js +84 -0
- package/dist/components/SearchInput.d.ts +16 -0
- package/dist/components/SearchInput.js +52 -0
- package/dist/components/Section.d.ts +28 -0
- package/dist/components/Section.js +76 -0
- package/dist/components/SegmentedControl.d.ts +7 -11
- package/dist/components/SegmentedControl.js +25 -56
- package/dist/components/Select.d.ts +8 -1
- package/dist/components/Select.js +47 -43
- package/dist/components/SettingModeOption.d.ts +3 -5
- package/dist/components/SettingModeOption.js +5 -6
- package/dist/components/SettingsCard.d.ts +32 -19
- package/dist/components/SettingsCard.js +40 -13
- package/dist/components/Skeleton.d.ts +22 -0
- package/dist/components/Skeleton.js +34 -0
- package/dist/components/Slider.d.ts +16 -0
- package/dist/components/Slider.js +30 -0
- package/dist/components/Sort.js +4 -6
- package/dist/components/StatusBadge.d.ts +3 -1
- package/dist/components/StatusBadge.js +9 -32
- package/dist/components/StatusIcons.d.ts +0 -4
- package/dist/components/StatusIcons.js +5 -13
- package/dist/components/Switch.d.ts +5 -1
- package/dist/components/Switch.js +23 -6
- package/dist/components/Table.js +13 -20
- package/dist/components/Tabs.d.ts +52 -0
- package/dist/components/Tabs.js +75 -0
- package/dist/components/ThemeEditor.d.ts +29 -0
- package/dist/components/ThemeEditor.js +397 -0
- package/dist/components/Toast.d.ts +57 -0
- package/dist/components/Toast.js +203 -0
- package/dist/components/Tooltip.js +12 -15
- package/dist/components/buttonClasses.d.ts +18 -0
- package/dist/components/buttonClasses.js +31 -0
- package/dist/components/codeTheme.d.ts +5 -0
- package/dist/components/codeTheme.js +93 -0
- package/dist/components/fieldBox.d.ts +14 -0
- package/dist/components/fieldBox.js +29 -0
- package/dist/components/floating.d.ts +26 -5
- package/dist/components/floating.js +31 -9
- package/dist/{ai/ui/codeBreaks.js → components/markdownCodeBreaks.js} +1 -1
- package/dist/components/persistedState.d.ts +2 -0
- package/dist/components/persistedState.js +63 -0
- package/dist/components/relativeTime.d.ts +36 -8
- package/dist/components/relativeTime.js +106 -23
- package/dist/components/segmented.d.ts +17 -0
- package/dist/components/segmented.js +27 -0
- package/dist/components/shortcutKey.d.ts +4 -0
- package/dist/components/shortcutKey.js +27 -0
- package/dist/components/splitter.d.ts +26 -0
- package/dist/components/splitter.js +69 -0
- package/dist/components/tone.d.ts +9 -0
- package/dist/components/tone.js +30 -0
- package/dist/components/useCopy.d.ts +14 -0
- package/dist/components/useCopy.js +31 -0
- package/dist/components/useCssIsDark.d.ts +2 -0
- package/dist/components/useCssIsDark.js +2 -1
- package/dist/components/useTheme.d.ts +10 -0
- package/dist/components/useTheme.js +40 -0
- package/dist/cx.d.ts +5 -0
- package/dist/cx.js +11 -0
- package/dist/editor/Editor.js +2 -2
- package/dist/editor/EditorField.js +7 -10
- package/dist/editor/FormCodePanel.js +10 -23
- package/dist/editor/Monaco.js +7 -4
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +2 -2
- package/dist/editor/themes.d.ts +4 -0
- package/dist/editor/themes.js +75 -76
- package/dist/file-explorer/FileExplorer.js +180 -187
- package/dist/file-explorer/FileExplorerContext.js +36 -58
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +2 -1
- package/dist/file-explorer/FilePreview/Inline.js +9 -7
- package/dist/file-explorer/FilePreview/StreamedBadge.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +32 -34
- package/dist/file-explorer/FilePreview/index.js +60 -92
- package/dist/file-explorer/FileRow.js +10 -15
- package/dist/file-explorer/FileRowsWindow.js +2 -6
- package/dist/file-explorer/FileTable.js +2 -2
- package/dist/file-explorer/FileTableHeaders.js +8 -11
- package/dist/file-explorer/LoadMoreRow.js +8 -9
- package/dist/file-explorer/TreeView.js +16 -16
- package/dist/file-explorer/helpers.d.ts +1 -4
- package/dist/file-explorer/helpers.js +101 -114
- package/dist/file-explorer/lib/utils.d.ts +0 -2
- package/dist/file-explorer/lib/utils.js +1 -25
- package/dist/file-explorer/toasts.js +104 -185
- package/dist/form/Fields/BooleanField.js +12 -14
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +16 -18
- package/dist/form/Fields/ColorField.js +11 -11
- package/dist/form/Fields/DropdownField.d.ts +1 -1
- package/dist/form/Fields/DropdownField.js +20 -36
- package/dist/form/Fields/DurationField.d.ts +1 -1
- package/dist/form/Fields/DurationField.js +36 -50
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +1 -1
- package/dist/form/Fields/MultiDropdownField.js +9 -14
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +13 -48
- package/dist/form/Fields/ObjectField.js +3 -3
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +15 -18
- package/dist/form/Fields/RangeField.js +34 -35
- package/dist/form/Fields/StringField.d.ts +1 -1
- package/dist/form/Fields/StringField.js +15 -25
- package/dist/form/Fields/TextAreaField.js +10 -15
- package/dist/form/Form.d.ts +7 -2
- package/dist/form/Form.js +144 -49
- package/dist/form/FormLayout.js +18 -12
- package/dist/form/Wizard/WizardContainer.js +44 -18
- package/dist/form/Wizard/WizardNavigation.d.ts +1 -1
- package/dist/form/Wizard/WizardNavigation.js +31 -56
- package/dist/form/Wizard/WizardStepIndicator.d.ts +3 -0
- package/dist/form/Wizard/WizardStepIndicator.js +98 -114
- package/dist/form/Wizard/types.d.ts +2 -2
- package/dist/form/fieldFrame.d.ts +7 -0
- package/dist/form/fieldFrame.js +19 -0
- package/dist/form/index.d.ts +5 -5
- package/dist/form/index.js +4 -6
- package/dist/form/layoutCSS.js +5 -4
- package/dist/form/types/fieldComponentTypes.d.ts +5 -3
- package/dist/form/useChoiceField.js +2 -3
- package/dist/form/useFieldValue.d.ts +3 -0
- package/dist/form/useFieldValue.js +24 -7
- package/dist/form/utils/duration.d.ts +2 -2
- package/dist/form/utils/duration.js +3 -3
- package/dist/form/utils/fieldPath.d.ts +5 -3
- package/dist/form/utils/fieldPath.js +18 -3
- package/dist/form/utils/secondaryField.d.ts +0 -7
- package/dist/form/utils/secondaryField.js +1 -12
- package/dist/form/validation.d.ts +29 -0
- package/dist/form/validation.js +14 -0
- package/dist/format.d.ts +28 -0
- package/dist/format.js +64 -0
- package/dist/graph/AnnotationBanner.js +20 -31
- package/dist/graph/Connectors.js +1 -1
- package/dist/graph/DependencyGraph.js +51 -65
- package/dist/graph/GraphEditor.js +24 -28
- package/dist/graph/GraphEditorDialogs.js +239 -245
- package/dist/graph/InputDialog.js +93 -112
- package/dist/graph/InputsEditor.js +83 -84
- package/dist/graph/JobSummary.js +10 -11
- package/dist/graph/MatrixGroup.js +3 -3
- package/dist/graph/ProblemsButton.js +9 -10
- package/dist/graph/ShortcutsButton.js +12 -17
- package/dist/graph/SuggestionInput.d.ts +1 -2
- package/dist/graph/SuggestionInput.js +1 -3
- package/dist/graph/TreeView.js +47 -45
- package/dist/graph/WorkflowSettingsDialog.js +97 -102
- package/dist/graph/editorChrome.js +10 -12
- package/dist/graph/editorFields.d.ts +19 -16
- package/dist/graph/editorFields.js +97 -135
- package/dist/graph/editorPrimitives.js +2 -2
- package/dist/graph/editorRows.js +22 -25
- package/dist/graph/editorStrings.d.ts +16 -19
- package/dist/graph/editorStrings.js +11 -23
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -4
- package/dist/graph/inputRefs.d.ts +0 -13
- package/dist/graph/inputRefs.js +121 -159
- package/dist/graph/settingsViews.js +5 -3
- package/dist/graph/stepWith.js +100 -100
- package/dist/graph/toolbarPanel.d.ts +8 -0
- package/dist/graph/toolbarPanel.js +11 -0
- package/dist/icons.d.ts +234 -23
- package/dist/icons.js +249 -264
- package/dist/index.d.ts +38 -21
- package/dist/index.js +42 -21
- package/dist/list/ActionToolbar.d.ts +1 -5
- package/dist/list/ActionToolbar.js +21 -20
- package/dist/list/ListPage.js +7 -7
- package/dist/list/ListTable.d.ts +3 -2
- package/dist/list/ListTable.js +33 -29
- package/dist/list/ListViewControls.d.ts +0 -17
- package/dist/list/ListViewControls.js +50 -118
- package/dist/list/UserHoverCard.js +24 -32
- package/dist/list/index.d.ts +2 -4
- package/dist/list/index.js +3 -5
- package/dist/list/listSearch.d.ts +1 -1
- package/dist/list/listSearch.js +19 -14
- package/dist/list/rowMenu.js +20 -26
- package/dist/logviewer/LogViewer.js +268 -382
- package/dist/logviewer/logviewer.css +53 -41
- package/dist/styles/base.css +16 -40
- package/dist/styles/theme.css +75 -106
- package/dist/styles.css +1 -1
- package/dist/theme/color.d.ts +40 -0
- package/dist/theme/color.js +228 -0
- package/dist/theme/contrast.d.ts +42 -0
- package/dist/theme/contrast.js +145 -0
- package/dist/theme/derive.d.ts +25 -0
- package/dist/theme/derive.js +475 -0
- package/dist/theme/fit.d.ts +35 -0
- package/dist/theme/fit.js +185 -0
- package/dist/theme/index.d.ts +14 -29
- package/dist/theme/index.js +20 -279
- package/dist/theme/model.d.ts +64 -0
- package/dist/theme/model.js +219 -0
- package/package.json +9 -5
- package/dist/ai/ui/Avatar.d.ts +0 -7
- package/dist/ai/ui/Avatar.js +0 -24
- package/dist/components/Filter.d.ts +0 -15
- package/dist/components/Filter.js +0 -32
- package/dist/components/FilterPill.d.ts +0 -7
- package/dist/components/FilterPill.js +0 -14
- package/dist/components/Indicator.d.ts +0 -4
- package/dist/components/Indicator.js +0 -44
- package/dist/components/SectionHeader.d.ts +0 -8
- package/dist/components/SectionHeader.js +0 -11
- package/dist/components/SettingRow.d.ts +0 -18
- package/dist/components/SettingRow.js +0 -35
- package/dist/components/SettingsGroup.d.ts +0 -8
- package/dist/components/SettingsGroup.js +0 -17
- package/dist/components/ghostButton.d.ts +0 -4
- package/dist/components/ghostButton.js +0 -7
- package/dist/components/inputClasses.d.ts +0 -1
- package/dist/components/inputClasses.js +0 -4
- package/dist/duration.d.ts +0 -3
- package/dist/duration.js +0 -17
- package/dist/form/FieldGroup.d.ts +0 -11
- package/dist/form/FieldGroup.js +0 -36
- package/dist/form/FieldWrapper.d.ts +0 -16
- package/dist/form/FieldWrapper.js +0 -55
- package/dist/form/fieldContext.d.ts +0 -19
- package/dist/form/fieldContext.js +0 -26
- package/dist/graph/Collapse.d.ts +0 -7
- package/dist/graph/Collapse.js +0 -15
- package/dist/graph/ToolbarPopover.d.ts +0 -13
- package/dist/graph/ToolbarPopover.js +0 -39
- package/dist/icons/ai/AiOutlineRollback.js +0 -16
- package/dist/icons/bi/BiBell.js +0 -16
- package/dist/icons/bi/BiBellOff.js +0 -16
- package/dist/icons/bi/BiBuildings.js +0 -20
- package/dist/icons/bi/BiError.js +0 -20
- package/dist/icons/bi/BiExpandVertical.js +0 -16
- package/dist/icons/bi/BiPause.js +0 -16
- package/dist/icons/bi/BiPlay.js +0 -16
- package/dist/icons/bi/BiRedo.js +0 -16
- package/dist/icons/bi/BiSolidCheckShield.js +0 -16
- package/dist/icons/bi/BiSolidTrashAlt.js +0 -16
- package/dist/icons/bi/BiStop.js +0 -16
- package/dist/icons/bi/BiUndo.js +0 -16
- package/dist/icons/bs/BsArrowsCollapse.js +0 -22
- package/dist/icons/bs/BsBank2.js +0 -19
- package/dist/icons/bs/BsBriefcase.js +0 -19
- package/dist/icons/bs/BsBucket.js +0 -19
- package/dist/icons/bs/BsCalendarX.js +0 -23
- package/dist/icons/bs/BsChatLeft.js +0 -19
- package/dist/icons/bs/BsChevronDoubleDown.js +0 -29
- package/dist/icons/bs/BsChevronDoubleUp.js +0 -29
- package/dist/icons/bs/BsClipboardCheck.js +0 -34
- package/dist/icons/bs/BsCurrencyDollar.js +0 -19
- package/dist/icons/bs/BsDash.js +0 -19
- package/dist/icons/bs/BsFileEarmarkZip.js +0 -23
- package/dist/icons/bs/BsFiles.js +0 -19
- package/dist/icons/bs/BsGeoAlt.js +0 -23
- package/dist/icons/bs/BsGrid.js +0 -19
- package/dist/icons/bs/BsLayers.js +0 -19
- package/dist/icons/bs/BsLayoutThreeColumns.js +0 -19
- package/dist/icons/bs/BsListUl.js +0 -22
- package/dist/icons/bs/BsMortarboard.js +0 -23
- package/dist/icons/bs/BsMusicNoteBeamed.js +0 -34
- package/dist/icons/bs/BsOpenai.js +0 -19
- package/dist/icons/bs/BsPersonPlus.js +0 -26
- package/dist/icons/bs/BsSearch.js +0 -19
- package/dist/icons/bs/BsSend.js +0 -19
- package/dist/icons/bs/BsShieldSlash.js +0 -22
- package/dist/icons/bs/BsStar.js +0 -19
- package/dist/icons/bs/BsStarFill.js +0 -19
- package/dist/icons/bs/BsStopCircle.js +0 -23
- package/dist/icons/bs/BsTag.js +0 -23
- package/dist/icons/bs/BsTelephone.js +0 -19
- package/dist/icons/bs/BsTerminal.js +0 -23
- package/dist/icons/bs/BsTerminalFill.js +0 -19
- package/dist/icons/bs/BsThreeDots.js +0 -19
- package/dist/icons/bs/BsThreeDotsVertical.js +0 -19
- package/dist/icons/bs/BsZoomIn.js +0 -37
- package/dist/icons/fa/FaAmazon.js +0 -16
- package/dist/icons/fa/FaAngleDown.js +0 -16
- package/dist/icons/fa/FaAngleLeft.js +0 -16
- package/dist/icons/fa/FaAngleRight.js +0 -16
- package/dist/icons/fa/FaAngleUp.js +0 -16
- package/dist/icons/fa/FaArrowDown.js +0 -16
- package/dist/icons/fa/FaArrowLeft.js +0 -16
- package/dist/icons/fa/FaArrowRight.js +0 -16
- package/dist/icons/fa/FaArrowUp.js +0 -16
- package/dist/icons/fa/FaBalanceScale.js +0 -16
- package/dist/icons/fa/FaCaretDown.js +0 -16
- package/dist/icons/fa/FaCentos.js +0 -16
- package/dist/icons/fa/FaChartLine.js +0 -16
- package/dist/icons/fa/FaChartPie.js +0 -16
- package/dist/icons/fa/FaCheck.js +0 -16
- package/dist/icons/fa/FaChevronDown.js +0 -16
- package/dist/icons/fa/FaChevronUp.js +0 -16
- package/dist/icons/fa/FaChrome.js +0 -16
- package/dist/icons/fa/FaCircleNotch.js +0 -16
- package/dist/icons/fa/FaCloud.js +0 -16
- package/dist/icons/fa/FaCloudDownloadAlt.js +0 -16
- package/dist/icons/fa/FaCog.js +0 -16
- package/dist/icons/fa/FaCogs.js +0 -16
- package/dist/icons/fa/FaComments.js +0 -16
- package/dist/icons/fa/FaCompress.js +0 -16
- package/dist/icons/fa/FaDesktop.js +0 -16
- package/dist/icons/fa/FaDocker.js +0 -16
- package/dist/icons/fa/FaDollarSign.js +0 -16
- package/dist/icons/fa/FaEdge.js +0 -16
- package/dist/icons/fa/FaEdit.js +0 -16
- package/dist/icons/fa/FaExclamationTriangle.js +0 -16
- package/dist/icons/fa/FaExpand.js +0 -16
- package/dist/icons/fa/FaEye.js +0 -16
- package/dist/icons/fa/FaEyeSlash.js +0 -16
- package/dist/icons/fa/FaFile.js +0 -16
- package/dist/icons/fa/FaFilePdf.js +0 -16
- package/dist/icons/fa/FaFilter.js +0 -16
- package/dist/icons/fa/FaFirefoxBrowser.js +0 -16
- package/dist/icons/fa/FaFlask.js +0 -16
- package/dist/icons/fa/FaFolder.js +0 -16
- package/dist/icons/fa/FaGithub.js +0 -16
- package/dist/icons/fa/FaGitlab.js +0 -16
- package/dist/icons/fa/FaGlobe.js +0 -16
- package/dist/icons/fa/FaGlobeAmericas.js +0 -16
- package/dist/icons/fa/FaImage.js +0 -16
- package/dist/icons/fa/FaInfoCircle.js +0 -16
- package/dist/icons/fa/FaKey.js +0 -16
- package/dist/icons/fa/FaLayerGroup.js +0 -16
- package/dist/icons/fa/FaLink.js +0 -16
- package/dist/icons/fa/FaLinkedin.js +0 -16
- package/dist/icons/fa/FaLinux.js +0 -16
- package/dist/icons/fa/FaList.js +0 -16
- package/dist/icons/fa/FaLock.js +0 -16
- package/dist/icons/fa/FaOpenid.js +0 -16
- package/dist/icons/fa/FaOpera.js +0 -16
- package/dist/icons/fa/FaPaperclip.js +0 -16
- package/dist/icons/fa/FaPlus.js +0 -16
- package/dist/icons/fa/FaPowerOff.js +0 -16
- package/dist/icons/fa/FaPrint.js +0 -16
- package/dist/icons/fa/FaQrcode.js +0 -16
- package/dist/icons/fa/FaQuestionCircle.js +0 -16
- package/dist/icons/fa/FaRedhat.js +0 -16
- package/dist/icons/fa/FaRegCircle.js +0 -16
- package/dist/icons/fa/FaRegFileImage.js +0 -16
- package/dist/icons/fa/FaRegFolder.js +0 -16
- package/dist/icons/fa/FaRobot.js +0 -16
- package/dist/icons/fa/FaRocket.js +0 -16
- package/dist/icons/fa/FaRunning.js +0 -16
- package/dist/icons/fa/FaSafari.js +0 -16
- package/dist/icons/fa/FaSave.js +0 -16
- package/dist/icons/fa/FaSearch.js +0 -16
- package/dist/icons/fa/FaShieldAlt.js +0 -16
- package/dist/icons/fa/FaSlack.js +0 -16
- package/dist/icons/fa/FaStar.js +0 -16
- package/dist/icons/fa/FaStop.js +0 -16
- package/dist/icons/fa/FaSuse.js +0 -16
- package/dist/icons/fa/FaTerminal.js +0 -16
- package/dist/icons/fa/FaTimes.js +0 -16
- package/dist/icons/fa/FaUbuntu.js +0 -16
- package/dist/icons/fa/FaUndoAlt.js +0 -16
- package/dist/icons/fa/FaUnlink.js +0 -16
- package/dist/icons/fa/FaUser.js +0 -16
- package/dist/icons/fa/FaUsers.js +0 -16
- package/dist/icons/fa/FaWindows.js +0 -16
- package/dist/icons/fa6/FaApple.js +0 -16
- package/dist/icons/fa6/FaArrowsRotate.js +0 -16
- package/dist/icons/fa6/FaDebian.js +0 -16
- package/dist/icons/fa6/FaFilterCircleXmark.js +0 -16
- package/dist/icons/fa6/FaInbox.js +0 -16
- package/dist/icons/fa6/FaLocationDot.js +0 -16
- package/dist/icons/fa6/FaRegFilePdf.js +0 -16
- package/dist/icons/fa6/FaRegFolderOpen.js +0 -16
- package/dist/icons/fa6/FaUpRightFromSquare.js +0 -16
- package/dist/icons/fa6/FaWandMagicSparkles.js +0 -16
- package/dist/icons/fa6/FaXTwitter.js +0 -16
- package/dist/icons/fi/FiActivity.js +0 -23
- package/dist/icons/fi/FiAlertCircle.js +0 -49
- package/dist/icons/fi/FiChevronDown.js +0 -23
- package/dist/icons/fi/FiClock.js +0 -31
- package/dist/icons/fi/FiCopy.js +0 -34
- package/dist/icons/fi/FiDownload.js +0 -40
- package/dist/icons/fi/FiFile.js +0 -27
- package/dist/icons/fi/FiFileText.js +0 -55
- package/dist/icons/fi/FiHardDrive.js +0 -55
- package/dist/icons/fi/FiRotateCcw.js +0 -27
- package/dist/icons/fi/FiUpload.js +0 -40
- package/dist/icons/fi/FiX.js +0 -37
- package/dist/icons/fi/FiZap.js +0 -23
- package/dist/icons/gi/GiSpy.js +0 -16
- package/dist/icons/go/GoGitCommit.js +0 -16
- package/dist/icons/go/GoGitPullRequest.js +0 -20
- package/dist/icons/go/GoIssueOpened.js +0 -16
- package/dist/icons/go/GoPlus.js +0 -16
- package/dist/icons/go/GoRepoForked.js +0 -28
- package/dist/icons/go/GoSignOut.js +0 -16
- package/dist/icons/go/GoSkip.js +0 -20
- package/dist/icons/go/GoVideo.js +0 -20
- package/dist/icons/gr/GrCloudComputer.js +0 -20
- package/dist/icons/gr/GrInbox.js +0 -20
- package/dist/icons/gr/GrServerCluster.js +0 -20
- package/dist/icons/gr/GrStorage.js +0 -20
- package/dist/icons/gr/GrTasks.js +0 -20
- package/dist/icons/hi/HiCog.js +0 -24
- package/dist/icons/hi/HiDuplicate.js +0 -24
- package/dist/icons/hi/HiOutlineArchive.js +0 -26
- package/dist/icons/hi/HiOutlineClipboardCopy.js +0 -26
- package/dist/icons/hi/HiOutlineHome.js +0 -26
- package/dist/icons/hi/HiQuestionMarkCircle.js +0 -24
- package/dist/icons/hi/HiServer.js +0 -24
- package/dist/icons/hi2/HiMiniCheckCircle.js +0 -24
- package/dist/icons/hi2/HiMiniLanguage.js +0 -28
- package/dist/icons/hi2/HiMiniMinusCircle.js +0 -24
- package/dist/icons/hi2/HiMiniXCircle.js +0 -24
- package/dist/icons/hi2/HiSparkles.js +0 -24
- package/dist/icons/im/ImSpinner5.js +0 -19
- package/dist/icons/io/IoIosNotifications.js +0 -16
- package/dist/icons/io/IoMdBuild.js +0 -16
- package/dist/icons/io/IoMdClose.js +0 -16
- package/dist/icons/io5/IoCloudUploadOutline.js +0 -32
- package/dist/icons/io5/IoDocumentTextOutline.js +0 -31
- package/dist/icons/io5/IoFileTrayFullOutline.js +0 -31
- package/dist/icons/io5/IoHeart.js +0 -16
- package/dist/icons/io5/IoHeartDislike.js +0 -16
- package/dist/icons/io5/IoHeartOutline.js +0 -22
- package/dist/icons/io5/IoInformationCircleOutline.js +0 -50
- package/dist/icons/io5/IoSettingsOutline.js +0 -22
- package/dist/icons/io5/IoWarningOutline.js +0 -40
- package/dist/icons/lu/LuArrowRight.js +0 -27
- package/dist/icons/lu/LuBadgeCheck.js +0 -27
- package/dist/icons/lu/LuBraces.js +0 -27
- package/dist/icons/lu/LuBrainCircuit.js +0 -101
- package/dist/icons/lu/LuCalendar.js +0 -46
- package/dist/icons/lu/LuCheck.js +0 -23
- package/dist/icons/lu/LuChevronLeft.js +0 -23
- package/dist/icons/lu/LuChevronRight.js +0 -23
- package/dist/icons/lu/LuCode.js +0 -27
- package/dist/icons/lu/LuExternalLink.js +0 -35
- package/dist/icons/lu/LuEye.js +0 -31
- package/dist/icons/lu/LuEyeOff.js +0 -40
- package/dist/icons/lu/LuFolderTree.js +0 -40
- package/dist/icons/lu/LuIdCard.js +0 -55
- package/dist/icons/lu/LuKeyboard.js +0 -71
- package/dist/icons/lu/LuLogs.js +0 -65
- package/dist/icons/lu/LuMail.js +0 -33
- package/dist/icons/lu/LuMegaphone.js +0 -27
- package/dist/icons/lu/LuMoon.js +0 -23
- package/dist/icons/lu/LuNetwork.js +0 -63
- package/dist/icons/lu/LuPartyPopper.js +0 -65
- package/dist/icons/lu/LuSettings2.js +0 -48
- package/dist/icons/lu/LuSheet.js +0 -72
- package/dist/icons/lu/LuShield.js +0 -23
- package/dist/icons/lu/LuSun.js +0 -69
- package/dist/icons/lu/LuTextCursorInput.js +0 -45
- package/dist/icons/lu/LuX.js +0 -27
- package/dist/icons/lu/LuZoomIn.js +0 -59
- package/dist/icons/lu/LuZoomOut.js +0 -49
- package/dist/icons/md/MdClear.js +0 -23
- package/dist/icons/md/MdDragHandle.js +0 -23
- package/dist/icons/md/MdInstallDesktop.js +0 -31
- package/dist/icons/md/MdOutlineAttachMoney.js +0 -23
- package/dist/icons/md/MdOutlineMoneyOff.js +0 -23
- package/dist/icons/md/MdPieChart.js +0 -23
- package/dist/icons/md/MdRefresh.js +0 -23
- package/dist/icons/md/MdReplay.js +0 -23
- package/dist/icons/md/MdSmartphone.js +0 -23
- package/dist/icons/pi/PiArrowBendUpRightBold.js +0 -19
- package/dist/icons/pi/PiPlugsConnectedFill.js +0 -19
- package/dist/icons/pi/PiRectangleDashed.js +0 -19
- package/dist/icons/pi/PiShareBold.js +0 -19
- package/dist/icons/si/SiAnthropic.js +0 -19
- package/dist/icons/si/SiHelm.js +0 -19
- package/dist/icons/si/SiKubernetes.js +0 -19
- package/dist/icons/tb/TbAlertTriangle.js +0 -35
- package/dist/icons/tb/TbAlertTriangleFilled.js +0 -19
- package/dist/icons/tb/TbApi.js +0 -40
- package/dist/icons/tb/TbBrain.js +0 -50
- package/dist/icons/tb/TbBuildingTunnel.js +0 -65
- package/dist/icons/tb/TbEdit.js +0 -35
- package/dist/icons/tb/TbLayoutSidebar.js +0 -27
- package/dist/icons/tb/TbLayoutSidebarLeftCollapse.js +0 -35
- package/dist/icons/tb/TbLayoutSidebarRightCollapse.js +0 -35
- package/dist/icons/tb/TbUser.js +0 -27
- package/dist/icons/tb/TbUserOff.js +0 -35
- package/dist/icons/tb/TbWorldShare.js +0 -55
- package/dist/icons/tb/TbWorldWww.js +0 -65
- package/dist/icons/ti/TiArrowSortedDown.js +0 -20
- package/dist/icons/ti/TiArrowSortedUp.js +0 -20
- package/dist/icons/ti/TiArrowUnsorted.js +0 -20
- package/dist/icons/ti/TiCancel.js +0 -20
- package/dist/icons/vsc/VscChromeMinimize.js +0 -19
- package/dist/icons/vsc/VscJson.js +0 -19
- package/dist/icons/vsc/VscLayoutSidebarLeft.js +0 -19
- package/dist/icons/vsc/VscPass.js +0 -27
- package/dist/icons/vsc/VscSplitHorizontal.js +0 -19
- package/dist/icons/vsc/VscTerminalPowershell.js +0 -19
- package/dist/list/ListPager.d.ts +0 -14
- package/dist/list/ListPager.js +0 -62
- package/dist/list/textEntry.d.ts +0 -2
- package/dist/list/textEntry.js +0 -10
- /package/dist/{ai/ui/codeBreaks.d.ts → components/markdownCodeBreaks.d.ts} +0 -0
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FaAngleDown } from "../icons/fa/FaAngleDown.js";
|
|
4
|
-
import { FaLink } from "../icons/fa/FaLink.js";
|
|
5
|
-
import { FaRegFolder } from "../icons/fa/FaRegFolder.js";
|
|
6
|
-
import { FaUsers } from "../icons/fa/FaUsers.js";
|
|
7
|
-
import { FiDownload } from "../icons/fi/FiDownload.js";
|
|
8
|
-
import { FiFile } from "../icons/fi/FiFile.js";
|
|
9
|
-
import { FiFileText } from "../icons/fi/FiFileText.js";
|
|
10
|
-
import { FiUpload } from "../icons/fi/FiUpload.js";
|
|
11
|
-
import { HiOutlineClipboardCopy } from "../icons/hi/HiOutlineClipboardCopy.js";
|
|
12
|
-
import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
|
|
13
|
-
import { LuEye } from "../icons/lu/LuEye.js";
|
|
14
|
-
import { MdRefresh } from "../icons/md/MdRefresh.js";
|
|
15
|
-
import { PiShareBold } from "../icons/pi/PiShareBold.js";
|
|
16
|
-
import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { AccessIcon, ChevronDownIcon, ChevronRightIcon, CollapseIcon, CopyIcon, DownloadIcon, FileIcon, FileTextIcon, FolderIcon, LinkIcon, PreviewIcon, ShareIcon, TrashIcon, UploadIcon, WarningIcon } from "../icons.js";
|
|
17
3
|
import { MenuItem, MenuPopup, MenuSeparator } from "../components/Menu.js";
|
|
18
4
|
import { safeUrl } from "../safeUrl.js";
|
|
19
5
|
import { keyedByContent } from "../components/keys.js";
|
|
6
|
+
import { buttonClasses } from "../components/buttonClasses.js";
|
|
7
|
+
import { Loader } from "../components/Loader.js";
|
|
8
|
+
import { toast } from "../components/Toast.js";
|
|
20
9
|
import { Tooltip } from "../components/Tooltip.js";
|
|
21
|
-
import {
|
|
10
|
+
import { usePersistedState, useSlots, useStrings } from "../components/Provider.js";
|
|
11
|
+
import { useCopy } from "../components/useCopy.js";
|
|
12
|
+
import { Button } from "../components/Button.js";
|
|
22
13
|
import { ConfirmModal } from "../components/ConfirmModal.js";
|
|
23
14
|
import { useContextMenu } from "../components/ContextMenu.js";
|
|
24
15
|
import CopyToClipboard, { CopyCodeBlock } from "../components/CopyToClipboard.js";
|
|
25
|
-
import { InfoTip } from "../components/InfoTip.js";
|
|
26
16
|
import { CreateModal } from "../components/CreateModal.js";
|
|
27
|
-
import
|
|
17
|
+
import { InfoTip } from "../components/InfoTip.js";
|
|
18
|
+
import { useSplitter } from "../components/splitter.js";
|
|
19
|
+
import { formatBytes, formatDateTime } from "../format.js";
|
|
20
|
+
import { RelativeTime } from "../components/relativeTime.js";
|
|
21
|
+
import { RefreshButton } from "../components/RefreshButton.js";
|
|
28
22
|
import { StatusBadge } from "../components/StatusBadge.js";
|
|
29
23
|
import { Table } from "../components/Table.js";
|
|
30
24
|
import { ListActionsHeader, ListSkeleton, listTableFixedProps, listTableProps } from "../list/ListTable.js";
|
|
31
25
|
import { assembleRowMenu, useCopySubmenu } from "../list/rowMenu.js";
|
|
32
|
-
import { calculateUploadNodesTotalSize, createTreeBuilder,
|
|
26
|
+
import { calculateUploadNodesTotalSize, createTreeBuilder, getDirectoryNameError, getDirectoryObjectPath, getNodeChildren, getObjectKeyFromNode, getParentPath, getUploadNodesFromDataTransferItems, getUriScheme, pruneNodesInsideSelectedDirectories, removeLeadingAndTrailingSlashes } from "./lib/utils.js";
|
|
33
27
|
import { useFileExplorer } from "./FileExplorerContext.js";
|
|
34
28
|
import { PREVIEW_URL_EXPIRES_IN, canPreview } from "./FilePreview/previewType.js";
|
|
35
29
|
import { CorsError } from "./lib/errors.js";
|
|
@@ -43,15 +37,12 @@ import { FileTable } from "./FileTable.js";
|
|
|
43
37
|
import { advanceListing, beginLoadingMore, canAutoLoadMore, clearListingError, clearListingsUnder, hasMore, incompletePaths, isListed, isLoadingMore, loadMoreError, nextHydrationStep, recordListingError, replaceListing } from "./lib/paging.js";
|
|
44
38
|
import { TreeView } from "./TreeView.js";
|
|
45
39
|
import { Menu } from "@base-ui/react/menu";
|
|
46
|
-
import { clsx } from "clsx";
|
|
47
40
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
48
41
|
import { useCallback, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
49
|
-
import { useLocalStorage } from "usehooks-ts";
|
|
50
42
|
import { DateTime } from "luxon";
|
|
51
|
-
import { Resizable } from "re-resizable";
|
|
52
43
|
//#region src/file-explorer/FileExplorer.tsx
|
|
53
44
|
function UriCard({ value }) {
|
|
54
|
-
const
|
|
45
|
+
const { common } = useStrings();
|
|
55
46
|
const scheme = getUriScheme(value);
|
|
56
47
|
return /* @__PURE__ */ jsxs(CopyToClipboard, {
|
|
57
48
|
text: value,
|
|
@@ -63,13 +54,13 @@ function UriCard({ value }) {
|
|
|
63
54
|
children: scheme
|
|
64
55
|
}),
|
|
65
56
|
/* @__PURE__ */ jsx("span", {
|
|
66
|
-
className: "flex-1 min-w-0 inline-flex items-center px-3 py-2 font-mono text-[12.5px] leading-snug break-all text-(--theme-
|
|
57
|
+
className: "flex-1 min-w-0 inline-flex items-center px-3 py-2 font-mono text-[12.5px] leading-snug break-all text-(--theme-focus)",
|
|
67
58
|
children: value
|
|
68
59
|
}),
|
|
69
60
|
/* @__PURE__ */ jsx("span", {
|
|
70
61
|
className: "shrink-0 inline-flex items-center justify-center px-3 border-l theme-border theme-muted-text group-hover:text-(--theme-link) group-hover:bg-(--theme-link)/5 transition-colors duration-150",
|
|
71
|
-
title:
|
|
72
|
-
children: /* @__PURE__ */ jsx(
|
|
62
|
+
title: common.copyToClipboard,
|
|
63
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { className: "h-3.5 w-3.5" })
|
|
73
64
|
})
|
|
74
65
|
]
|
|
75
66
|
});
|
|
@@ -99,37 +90,29 @@ function getAncestorDirPaths(path) {
|
|
|
99
90
|
/** The tree's width is the host's when the tree is embedded on its own, and this
|
|
100
91
|
* component's when it is showing the details pane beside it. */
|
|
101
92
|
function TreeFrame({ treeOnly, sidebarWidth, onWidthChange, children }) {
|
|
93
|
+
const splitter = useSplitter({
|
|
94
|
+
width: sidebarWidth,
|
|
95
|
+
onWidthChange,
|
|
96
|
+
min: 200,
|
|
97
|
+
max: 800,
|
|
98
|
+
side: "right",
|
|
99
|
+
defaultWidth: 300
|
|
100
|
+
});
|
|
102
101
|
if (treeOnly) return /* @__PURE__ */ jsx("div", {
|
|
103
102
|
className: "h-full w-full min-w-0",
|
|
104
103
|
children
|
|
105
104
|
});
|
|
106
|
-
return /* @__PURE__ */
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
minWidth: 200,
|
|
112
|
-
maxWidth: 800,
|
|
113
|
-
enable: {
|
|
114
|
-
top: false,
|
|
115
|
-
right: true,
|
|
116
|
-
bottom: false,
|
|
117
|
-
left: false,
|
|
118
|
-
topRight: false,
|
|
119
|
-
bottomRight: false,
|
|
120
|
-
bottomLeft: false,
|
|
121
|
-
topLeft: false
|
|
122
|
-
},
|
|
123
|
-
onResizeStop: (_e, _direction, _ref, d) => {
|
|
124
|
-
onWidthChange((prev) => prev + d.width);
|
|
125
|
-
},
|
|
126
|
-
children
|
|
105
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
106
|
+
className: "relative h-full shrink-0",
|
|
107
|
+
style: { width: splitter.width },
|
|
108
|
+
children: [children, /* @__PURE__ */ jsx("div", { ...splitter.separatorProps })]
|
|
127
109
|
});
|
|
128
110
|
}
|
|
129
111
|
function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHierarchy = false, groups = [], groupsLoading = false, selectedPath, onPathChange, getProviderAndClient, treeOnly = false, initialExpandedPaths, onExpandedPathsChange, objectUris, downloadCommand, extraRowActions, headerAccessory }) {
|
|
130
112
|
const copySubmenu = useCopySubmenu();
|
|
131
113
|
const t = useStrings().fileExplorer;
|
|
132
|
-
const
|
|
114
|
+
const { common } = useStrings();
|
|
115
|
+
const { copy } = useCopy();
|
|
133
116
|
const slots = useSlots();
|
|
134
117
|
const fileExplorerContext = useFileExplorer();
|
|
135
118
|
const [listings, setListings] = useState(() => /* @__PURE__ */ new Map());
|
|
@@ -262,7 +245,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
262
245
|
const [detailTab, setDetailTab] = useState("details");
|
|
263
246
|
useEffect(() => clearPreviewCache, []);
|
|
264
247
|
const { openMenu, contextMenu } = useContextMenu();
|
|
265
|
-
const [sidebarWidth, setSidebarWidth] =
|
|
248
|
+
const [sidebarWidth, setSidebarWidth] = usePersistedState(SIDEBAR_WIDTH_STORAGE_KEY, 300);
|
|
266
249
|
const handleToggleExpand = useCallback((path) => {
|
|
267
250
|
setExpandedPaths((prev) => {
|
|
268
251
|
const next = new Set(prev);
|
|
@@ -276,7 +259,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
276
259
|
const getStorageProviderAndClient = async (storageId) => {
|
|
277
260
|
const storage = findStorage(storageId);
|
|
278
261
|
if (!storage) {
|
|
279
|
-
|
|
262
|
+
toast.error(t.messages.storageUnavailable);
|
|
280
263
|
return null;
|
|
281
264
|
}
|
|
282
265
|
const { provider, client } = await getProviderAndClient(storage).catch(() => ({
|
|
@@ -312,7 +295,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
312
295
|
const cursor = more ? listings.get(node.path)?.cursor : void 0;
|
|
313
296
|
try {
|
|
314
297
|
const factory = await getStorageProviderAndClient(node.storageId);
|
|
315
|
-
if (!factory) throw new Error(
|
|
298
|
+
if (!factory) throw new Error(t.messages.connectFailed);
|
|
316
299
|
const { storage, provider, client } = factory;
|
|
317
300
|
if (provider.listDirectoryInput && provider.convertDataToStorageObjects) {
|
|
318
301
|
const dir_path = node.root ? "" : node.relativePath ?? "";
|
|
@@ -469,17 +452,17 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
469
452
|
const onDropFiles = async (targetPath, files) => {
|
|
470
453
|
const targetStorageId = treeMap[targetPath]?.storageId;
|
|
471
454
|
if (!storageCanWrite(targetStorageId)) {
|
|
472
|
-
|
|
455
|
+
toast.error(t.messages.noWriteAccess);
|
|
473
456
|
return;
|
|
474
457
|
}
|
|
475
458
|
if (!storageCanUpload(targetStorageId)) {
|
|
476
|
-
|
|
459
|
+
toast.error(t.messages.uploadsUnsupported);
|
|
477
460
|
return;
|
|
478
461
|
}
|
|
479
462
|
let uploadNodes = [];
|
|
480
463
|
let totalSize = 0;
|
|
481
464
|
if (waitForUpload) {
|
|
482
|
-
|
|
465
|
+
toast.warning(t.messages.waitForCurrentUpload);
|
|
483
466
|
return;
|
|
484
467
|
}
|
|
485
468
|
setWaitForUpload(true);
|
|
@@ -516,21 +499,21 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
516
499
|
const filesToDownload = getFilesToDownload();
|
|
517
500
|
const firstFile = filesToDownload[0];
|
|
518
501
|
if (!firstFile) {
|
|
519
|
-
|
|
502
|
+
toast.error(t.messages.noFilesForDownload);
|
|
520
503
|
return;
|
|
521
504
|
}
|
|
522
505
|
const factory = await getStorageProviderAndClient(firstFile.storageId);
|
|
523
506
|
if (!factory) return;
|
|
524
507
|
const { provider, client } = factory;
|
|
525
508
|
if (!provider.getFileInput) {
|
|
526
|
-
|
|
509
|
+
toast.error(t.messages.downloadUnsupported);
|
|
527
510
|
return;
|
|
528
511
|
}
|
|
529
512
|
for (const [index, node] of filesToDownload.entries()) {
|
|
530
513
|
const input = provider.getFileInput(node.storageName ?? "", node, void 0, node.name);
|
|
531
514
|
const [presignedUrl, error] = await client.getFile(input);
|
|
532
515
|
if (error || !presignedUrl) {
|
|
533
|
-
|
|
516
|
+
toast.error(error?.message ?? t.messages.downloadLinkFailed);
|
|
534
517
|
continue;
|
|
535
518
|
}
|
|
536
519
|
triggerBrowserDownload(presignedUrl, node.name);
|
|
@@ -542,17 +525,16 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
542
525
|
if (!factory) return;
|
|
543
526
|
const { provider, client } = factory;
|
|
544
527
|
if (!provider.getFileInput) {
|
|
545
|
-
|
|
528
|
+
toast.error(t.messages.sharingUnsupported);
|
|
546
529
|
return;
|
|
547
530
|
}
|
|
548
531
|
const input = provider.getFileInput(node.storageName ?? "", node);
|
|
549
532
|
const [presignedUrl, error] = await client.getFile(input);
|
|
550
533
|
if (error || !presignedUrl) {
|
|
551
|
-
|
|
534
|
+
toast.error(error?.message ?? t.messages.fileLinkFailed);
|
|
552
535
|
return;
|
|
553
536
|
}
|
|
554
|
-
await
|
|
555
|
-
notify.info(t.messages.fileLinkCopied);
|
|
537
|
+
await copy(presignedUrl, { label: t.fileLink });
|
|
556
538
|
};
|
|
557
539
|
const triggerBrowserDownload = (url, filename) => {
|
|
558
540
|
const href = safeUrl(url);
|
|
@@ -568,9 +550,9 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
568
550
|
};
|
|
569
551
|
const getPresignedUrl = async (node, downloadFilename) => {
|
|
570
552
|
const factory = await getStorageProviderAndClient(node.storageId);
|
|
571
|
-
if (!factory) return [null,
|
|
553
|
+
if (!factory) return [null, new Error(t.messages.connectFailed)];
|
|
572
554
|
const { provider, client } = factory;
|
|
573
|
-
if (!provider.getFileInput) return [null,
|
|
555
|
+
if (!provider.getFileInput) return [null, new Error(t.messages.previewUnsupported)];
|
|
574
556
|
const input = provider.getFileInput(node.storageName ?? "", node, PREVIEW_URL_EXPIRES_IN, downloadFilename);
|
|
575
557
|
return client.getFile(input);
|
|
576
558
|
};
|
|
@@ -596,27 +578,22 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
596
578
|
const copyNodeUri = async (node) => {
|
|
597
579
|
const uri = getNodeUris(node)[0];
|
|
598
580
|
if (!uri) {
|
|
599
|
-
|
|
581
|
+
toast.error(t.messages.noUri);
|
|
600
582
|
return;
|
|
601
583
|
}
|
|
602
|
-
|
|
603
|
-
await navigator.clipboard.writeText(uri);
|
|
604
|
-
notify.info(t.messages.uriCopied);
|
|
605
|
-
} catch {
|
|
606
|
-
notify.error(t.messages.uriCopyFailed);
|
|
607
|
-
}
|
|
584
|
+
await copy(uri, { label: t.uri });
|
|
608
585
|
};
|
|
609
586
|
const downloadNode = async (node) => {
|
|
610
587
|
const [presignedUrl, error] = await getPresignedUrl(node, node.name);
|
|
611
588
|
if (error || !presignedUrl) {
|
|
612
|
-
|
|
589
|
+
toast.error(error?.message ?? t.messages.downloadLinkFailed);
|
|
613
590
|
return;
|
|
614
591
|
}
|
|
615
592
|
triggerBrowserDownload(presignedUrl, node.name);
|
|
616
593
|
};
|
|
617
594
|
const deleteNode = (node) => {
|
|
618
595
|
if (!storageCanDelete(findStorage(node.storageId))) {
|
|
619
|
-
|
|
596
|
+
toast.error(t.messages.noWriteAccess);
|
|
620
597
|
return;
|
|
621
598
|
}
|
|
622
599
|
setPendingDelete([node]);
|
|
@@ -632,7 +609,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
632
609
|
return [{
|
|
633
610
|
key: "create-folder",
|
|
634
611
|
label: t.createFolder.action,
|
|
635
|
-
icon: /* @__PURE__ */ jsx(
|
|
612
|
+
icon: /* @__PURE__ */ jsx(FolderIcon, {}),
|
|
636
613
|
onClick: () => openCreateFolder(node)
|
|
637
614
|
}];
|
|
638
615
|
};
|
|
@@ -646,20 +623,20 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
646
623
|
if (isFile && canPreview(node)) actions.push({
|
|
647
624
|
key: "preview",
|
|
648
625
|
label: t.preview.preview,
|
|
649
|
-
icon: /* @__PURE__ */ jsx(
|
|
626
|
+
icon: /* @__PURE__ */ jsx(PreviewIcon, {}),
|
|
650
627
|
onClick: () => openPreview(node)
|
|
651
628
|
});
|
|
652
629
|
if (isFile) {
|
|
653
630
|
actions.push({
|
|
654
631
|
key: "download",
|
|
655
|
-
label:
|
|
656
|
-
icon: /* @__PURE__ */ jsx(
|
|
632
|
+
label: common.download,
|
|
633
|
+
icon: /* @__PURE__ */ jsx(DownloadIcon, {}),
|
|
657
634
|
onClick: () => downloadNode(node)
|
|
658
635
|
});
|
|
659
636
|
if (nodeCanShare) actions.push({
|
|
660
637
|
key: "share",
|
|
661
638
|
label: t.preview.shareFile,
|
|
662
|
-
icon: /* @__PURE__ */ jsx(
|
|
639
|
+
icon: /* @__PURE__ */ jsx(ShareIcon, {}),
|
|
663
640
|
onClick: () => onShareFileButtonClick(node)
|
|
664
641
|
});
|
|
665
642
|
}
|
|
@@ -667,20 +644,20 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
667
644
|
actions.push(...extraRowActions?.(node, storage) ?? []);
|
|
668
645
|
if (nodeCanDelete && !node.root) actions.push({
|
|
669
646
|
key: "delete",
|
|
670
|
-
label:
|
|
671
|
-
icon: /* @__PURE__ */ jsx(
|
|
647
|
+
label: common.delete,
|
|
648
|
+
icon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
672
649
|
destructive: true,
|
|
673
650
|
onClick: () => deleteNode(node)
|
|
674
651
|
});
|
|
675
652
|
const lead = [{
|
|
676
653
|
label: isFile ? t.preview.viewDetails : t.preview.openFolder,
|
|
677
|
-
icon: isFile ? /* @__PURE__ */ jsx(
|
|
654
|
+
icon: isFile ? /* @__PURE__ */ jsx(FileTextIcon, {}) : /* @__PURE__ */ jsx(FolderIcon, {}),
|
|
678
655
|
onClick: () => handleSelectTreeItem(node.path, node)
|
|
679
656
|
}];
|
|
680
657
|
const uriExtras = uris.map((value) => ({
|
|
681
658
|
label: `${getUriScheme(value).toUpperCase()} URI`,
|
|
682
659
|
value,
|
|
683
|
-
icon: /* @__PURE__ */ jsx(
|
|
660
|
+
icon: /* @__PURE__ */ jsx(LinkIcon, {})
|
|
684
661
|
}));
|
|
685
662
|
return assembleRowMenu({
|
|
686
663
|
lead,
|
|
@@ -716,7 +693,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
716
693
|
const label = node.displayName || node.name;
|
|
717
694
|
return /* @__PURE__ */ jsxs("span", {
|
|
718
695
|
className: "flex min-w-0 items-center gap-1",
|
|
719
|
-
children: [i > 0 && /* @__PURE__ */ jsx(
|
|
696
|
+
children: [i > 0 && /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3 shrink-0 text-(--theme-muted-text-color)" }), isLast ? /* @__PURE__ */ jsx("span", {
|
|
720
697
|
className: "truncate font-semibold text-(--theme-app)",
|
|
721
698
|
children: label
|
|
722
699
|
}) : /* @__PURE__ */ jsx("button", {
|
|
@@ -744,7 +721,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
744
721
|
};
|
|
745
722
|
const onDeleteClick = () => {
|
|
746
723
|
if (!selectedNodeCanDelete) {
|
|
747
|
-
|
|
724
|
+
toast.error(t.messages.noWriteAccess);
|
|
748
725
|
return;
|
|
749
726
|
}
|
|
750
727
|
let nodesToDelete = [];
|
|
@@ -777,7 +754,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
777
754
|
const handleDelete = async () => {
|
|
778
755
|
const firstPending = pendingDelete?.[0];
|
|
779
756
|
if (!pendingDelete || !firstPending) {
|
|
780
|
-
|
|
757
|
+
toast.error(t.messages.noItemsForDeletion);
|
|
781
758
|
return;
|
|
782
759
|
}
|
|
783
760
|
const parentPath = getParentPath(firstPending.path);
|
|
@@ -786,44 +763,51 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
786
763
|
if (!factory) return;
|
|
787
764
|
const { storage, provider, client } = factory;
|
|
788
765
|
if (!provider.deleteFilesInput) {
|
|
789
|
-
|
|
766
|
+
toast.error(t.messages.deleteUnsupported);
|
|
790
767
|
return;
|
|
791
768
|
}
|
|
769
|
+
const deleting = toast.loading(t.messages.deleting);
|
|
792
770
|
try {
|
|
793
|
-
notify.loading(t.messages.deleting);
|
|
794
771
|
const input = provider.deleteFilesInput(storage.bucketName || storage.name, pendingDelete);
|
|
795
772
|
const response = await client.deleteFiles(input);
|
|
796
|
-
notify.dismiss();
|
|
797
773
|
if (parentNode) await fetchNodeChildren(parentNode, { replace: true });
|
|
798
774
|
setPendingDelete(null);
|
|
799
775
|
setCheckedItems(/* @__PURE__ */ new Set());
|
|
800
776
|
setDeleteModalOpen(false);
|
|
801
777
|
if (response?.Errors?.length) {
|
|
802
|
-
|
|
778
|
+
toast.update(deleting, {
|
|
779
|
+
tone: "error",
|
|
780
|
+
message: t.messages.deleteSomeFailed
|
|
781
|
+
});
|
|
803
782
|
return;
|
|
804
783
|
}
|
|
805
784
|
const deletedPaths = new Set(pendingDelete.map((n) => n.path));
|
|
806
785
|
const deletedDirPrefixes = pendingDelete.filter((n) => n.type === "directory").map((n) => n.path.endsWith("/") ? n.path : `${n.path}/`);
|
|
807
786
|
const selectedRemoved = !!selectedNode && (deletedPaths.has(selectedNode.path) || deletedDirPrefixes.some((p) => selectedNode.path.startsWith(p)));
|
|
808
787
|
if (selectedNode && (selectedNode.type === "directory" || selectedRemoved)) handlePostDelete(selectedNode);
|
|
809
|
-
|
|
788
|
+
toast.update(deleting, {
|
|
789
|
+
tone: "success",
|
|
790
|
+
message: t.messages.deleteSuccess
|
|
791
|
+
});
|
|
810
792
|
} catch (err) {
|
|
811
|
-
|
|
812
|
-
|
|
793
|
+
toast.update(deleting, {
|
|
794
|
+
tone: "error",
|
|
795
|
+
message: t.messages.deleteFailed(err instanceof Error ? err.message : String(err))
|
|
796
|
+
});
|
|
813
797
|
}
|
|
814
798
|
};
|
|
815
799
|
const handleUploadInputChange = (files, selectedNode) => {
|
|
816
800
|
if (!files || !selectedNode || selectedNode.type === "file") return;
|
|
817
801
|
if (!storageCanWrite(selectedNode.storageId)) {
|
|
818
|
-
|
|
802
|
+
toast.error(t.messages.noWriteAccess);
|
|
819
803
|
return;
|
|
820
804
|
}
|
|
821
805
|
if (!storageCanUpload(selectedNode.storageId)) {
|
|
822
|
-
|
|
806
|
+
toast.error(t.messages.uploadsUnsupported);
|
|
823
807
|
return;
|
|
824
808
|
}
|
|
825
809
|
if (waitForUpload) {
|
|
826
|
-
|
|
810
|
+
toast.warning(t.messages.waitForCurrentUpload);
|
|
827
811
|
return;
|
|
828
812
|
}
|
|
829
813
|
const uploadNodes = Array.from(files).map((file) => ({
|
|
@@ -843,48 +827,43 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
843
827
|
};
|
|
844
828
|
const handleUpload = async () => {
|
|
845
829
|
if (!pendingUpload) {
|
|
846
|
-
|
|
830
|
+
toast.error(t.messages.noFilesToUpload);
|
|
847
831
|
return;
|
|
848
832
|
}
|
|
849
833
|
if (waitForUpload) {
|
|
850
|
-
|
|
834
|
+
toast.info(t.messages.waitForUpload);
|
|
851
835
|
return;
|
|
852
836
|
}
|
|
853
837
|
const targetNode = treeMap[pendingUpload.targetPath];
|
|
854
838
|
if (!targetNode?.storageId) {
|
|
855
|
-
|
|
839
|
+
toast.error(t.messages.invalidUploadTarget);
|
|
856
840
|
return;
|
|
857
841
|
}
|
|
858
842
|
const factory = await getStorageProviderAndClient(targetNode.storageId);
|
|
859
843
|
if (!factory) {
|
|
860
|
-
|
|
844
|
+
toast.error(t.messages.connectFailed);
|
|
861
845
|
return;
|
|
862
846
|
}
|
|
863
847
|
const { storage, provider, client } = factory;
|
|
864
848
|
const storageName = storage.bucketName || storage.name;
|
|
865
849
|
const cleanTargetPath = targetNode.root ? "" : removeLeadingAndTrailingSlashes(targetNode.relativePath || "");
|
|
866
850
|
if (!provider.uploadFileInput) {
|
|
867
|
-
|
|
851
|
+
toast.error(t.messages.uploadUnsupported);
|
|
868
852
|
return;
|
|
869
853
|
}
|
|
870
854
|
const sessionId = fileExplorerContext.addUploadSession(storageName, cleanTargetPath, pendingUpload.uploadNodes, client, provider, targetNode, (node) => fetchNodeChildren(node, { replace: true }));
|
|
871
855
|
const sessionQueueIndex = fileExplorerContext.getUploadQueueIndex(sessionId);
|
|
872
856
|
if (sessionQueueIndex === -1) {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
icon: null,
|
|
877
|
-
isLoading: false,
|
|
878
|
-
closeButton: null
|
|
857
|
+
toast.update(sessionId, {
|
|
858
|
+
message: t.messages.uploadInitFailed,
|
|
859
|
+
tone: "error"
|
|
879
860
|
});
|
|
880
861
|
return;
|
|
881
862
|
} else if (sessionQueueIndex > 0 && fileExplorerContext.uploadQueue[sessionQueueIndex - 1] !== sessionId) {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
isLoading: false,
|
|
887
|
-
autoClose: false
|
|
863
|
+
toast.update(sessionId, {
|
|
864
|
+
message: t.messages.uploadQueuedInfo,
|
|
865
|
+
tone: "info",
|
|
866
|
+
timeout: false
|
|
888
867
|
});
|
|
889
868
|
return;
|
|
890
869
|
}
|
|
@@ -898,15 +877,15 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
898
877
|
};
|
|
899
878
|
const handleCreateFolder = async (name) => {
|
|
900
879
|
if (!isStorageDirectory(createFolderTarget)) {
|
|
901
|
-
|
|
880
|
+
toast.error(t.createFolder.invalidTarget);
|
|
902
881
|
return false;
|
|
903
882
|
}
|
|
904
883
|
if (!storageCanWrite(createFolderTarget.storageId)) {
|
|
905
|
-
|
|
884
|
+
toast.error(t.messages.noWriteAccess);
|
|
906
885
|
return false;
|
|
907
886
|
}
|
|
908
887
|
if (!storageCanUpload(createFolderTarget.storageId)) {
|
|
909
|
-
|
|
888
|
+
toast.error(t.createFolder.unsupported);
|
|
910
889
|
return false;
|
|
911
890
|
}
|
|
912
891
|
try {
|
|
@@ -914,16 +893,16 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
914
893
|
if (!factory) return false;
|
|
915
894
|
const { storage, provider, client } = factory;
|
|
916
895
|
if (!provider.uploadFileInput) {
|
|
917
|
-
|
|
896
|
+
toast.error(t.createFolder.unsupported);
|
|
918
897
|
return false;
|
|
919
898
|
}
|
|
920
899
|
const input = provider.uploadFileInput(storage.bucketName || storage.name, getDirectoryObjectPath(createFolderTarget, name), new Blob());
|
|
921
900
|
await client.uploadFile(input);
|
|
922
901
|
await fetchNodeChildren(createFolderTarget, { replace: true });
|
|
923
|
-
|
|
902
|
+
toast.success(t.createFolder.success(name));
|
|
924
903
|
return true;
|
|
925
904
|
} catch (error) {
|
|
926
|
-
|
|
905
|
+
toast.error(t.createFolder.error(getErrorMessage(error)));
|
|
927
906
|
return false;
|
|
928
907
|
}
|
|
929
908
|
};
|
|
@@ -953,23 +932,17 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
953
932
|
className: "flex items-center justify-end h-10 px-3 shrink-0 border-b theme-border",
|
|
954
933
|
children: /* @__PURE__ */ jsxs("div", {
|
|
955
934
|
className: "flex gap-x-0.5",
|
|
956
|
-
children: [/* @__PURE__ */ jsx(
|
|
957
|
-
|
|
958
|
-
|
|
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
|
-
})
|
|
935
|
+
children: [/* @__PURE__ */ jsx(RefreshButton, {
|
|
936
|
+
iconOnly: true,
|
|
937
|
+
onRefresh: () => handleRefresh()
|
|
965
938
|
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
966
|
-
content:
|
|
939
|
+
content: common.collapse,
|
|
967
940
|
children: /* @__PURE__ */ jsx("button", {
|
|
968
941
|
type: "button",
|
|
969
|
-
"aria-label":
|
|
942
|
+
"aria-label": common.collapse,
|
|
970
943
|
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
944
|
onClick: collapseAll,
|
|
972
|
-
children: /* @__PURE__ */ jsx(
|
|
945
|
+
children: /* @__PURE__ */ jsx(CollapseIcon, { className: "h-3.5 w-3.5" })
|
|
973
946
|
})
|
|
974
947
|
})]
|
|
975
948
|
})
|
|
@@ -1012,26 +985,26 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1012
985
|
caps: false,
|
|
1013
986
|
className: "py-2",
|
|
1014
987
|
style: { minWidth: 200 },
|
|
1015
|
-
children:
|
|
988
|
+
children: t.chrome.name
|
|
1016
989
|
}),
|
|
1017
990
|
/* @__PURE__ */ jsx(Table.Header, {
|
|
1018
991
|
caps: false,
|
|
1019
992
|
className: "w-[22%] py-2",
|
|
1020
|
-
children:
|
|
993
|
+
children: t.chrome.type
|
|
1021
994
|
}),
|
|
1022
995
|
/* @__PURE__ */ jsx(Table.Header, {
|
|
1023
996
|
caps: false,
|
|
1024
997
|
className: "w-[22%] py-2",
|
|
1025
|
-
children:
|
|
998
|
+
children: t.chrome.storages
|
|
1026
999
|
}),
|
|
1027
1000
|
/* @__PURE__ */ jsx(ListActionsHeader, { actionCount: 1 }),
|
|
1028
1001
|
rootNodes.map((rootNode) => /* @__PURE__ */ jsx(UserRow, {
|
|
1029
1002
|
node: rootNode,
|
|
1030
|
-
icon: getNodeIcon(rootNode
|
|
1003
|
+
icon: getNodeIcon(rootNode),
|
|
1031
1004
|
storageCount: getNodeChildren(parentToChildrenMap, rootNode.path).length,
|
|
1032
1005
|
getItems: () => [{
|
|
1033
1006
|
label: t.preview.open,
|
|
1034
|
-
icon: /* @__PURE__ */ jsx(
|
|
1007
|
+
icon: /* @__PURE__ */ jsx(FolderIcon, {}),
|
|
1035
1008
|
onClick: () => openUserNode(rootNode)
|
|
1036
1009
|
}],
|
|
1037
1010
|
openMenu,
|
|
@@ -1083,44 +1056,59 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1083
1056
|
handleUploadInputChange(e.target.files, selectedNode);
|
|
1084
1057
|
}
|
|
1085
1058
|
}),
|
|
1086
|
-
selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */
|
|
1087
|
-
|
|
1059
|
+
selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */ jsx(Button, {
|
|
1060
|
+
variant: "primary",
|
|
1061
|
+
size: "sm",
|
|
1088
1062
|
"aria-label": t.createFolder.action,
|
|
1089
|
-
|
|
1063
|
+
icon: /* @__PURE__ */ jsx(FolderIcon, {}),
|
|
1090
1064
|
disabled: selectedNode.type === "file" || !selectedNode.storageId,
|
|
1091
1065
|
onClick: () => setCreateFolderTarget(selectedNode),
|
|
1092
|
-
children:
|
|
1066
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1093
1067
|
className: "hidden md:inline",
|
|
1094
1068
|
children: t.createFolder.action
|
|
1095
|
-
})
|
|
1069
|
+
})
|
|
1096
1070
|
}),
|
|
1097
1071
|
selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
1098
1072
|
"aria-label": t.chrome.upload,
|
|
1099
|
-
className:
|
|
1073
|
+
className: buttonClasses({
|
|
1074
|
+
variant: "primary",
|
|
1075
|
+
size: "sm"
|
|
1076
|
+
}),
|
|
1100
1077
|
disabled: selectedNode.type === "file" || !selectedNode.storageId,
|
|
1101
|
-
children: [
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1078
|
+
children: [
|
|
1079
|
+
/* @__PURE__ */ jsx(UploadIcon, {}),
|
|
1080
|
+
/* @__PURE__ */ jsx("span", {
|
|
1081
|
+
className: "hidden md:inline",
|
|
1082
|
+
children: t.chrome.upload
|
|
1083
|
+
}),
|
|
1084
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
1085
|
+
]
|
|
1105
1086
|
}), /* @__PURE__ */ jsxs(MenuPopup, {
|
|
1106
1087
|
align: "end",
|
|
1107
1088
|
className: "w-36",
|
|
1108
1089
|
children: [/* @__PURE__ */ jsx(MenuItem, {
|
|
1109
1090
|
onClick: () => fileInputRef.current?.click(),
|
|
1110
|
-
children:
|
|
1091
|
+
children: t.chrome.selectFiles
|
|
1111
1092
|
}), /* @__PURE__ */ jsx(MenuItem, {
|
|
1112
1093
|
onClick: () => folderInputRef.current?.click(),
|
|
1113
|
-
children:
|
|
1094
|
+
children: t.chrome.selectFolder
|
|
1114
1095
|
})]
|
|
1115
1096
|
})] }),
|
|
1116
1097
|
/* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
1117
|
-
"aria-label":
|
|
1118
|
-
className:
|
|
1098
|
+
"aria-label": common.download,
|
|
1099
|
+
className: buttonClasses({
|
|
1100
|
+
variant: "primary",
|
|
1101
|
+
size: "sm"
|
|
1102
|
+
}),
|
|
1119
1103
|
disabled: checkedItems.size === 0 && selectedNode.type !== "file" || hasFolderSelected() || !selectedNode.storageId,
|
|
1120
|
-
children: [
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1104
|
+
children: [
|
|
1105
|
+
/* @__PURE__ */ jsx(DownloadIcon, {}),
|
|
1106
|
+
/* @__PURE__ */ jsx("span", {
|
|
1107
|
+
className: "hidden md:inline",
|
|
1108
|
+
children: common.download
|
|
1109
|
+
}),
|
|
1110
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
1111
|
+
]
|
|
1124
1112
|
}), /* @__PURE__ */ jsxs(MenuPopup, {
|
|
1125
1113
|
align: "end",
|
|
1126
1114
|
className: "w-72",
|
|
@@ -1144,28 +1132,29 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1144
1132
|
})]
|
|
1145
1133
|
})] })]
|
|
1146
1134
|
})] }),
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
|
|
1135
|
+
groups.length > 0 && selectedNodeCanManageAccess && /* @__PURE__ */ jsx(Button, {
|
|
1136
|
+
variant: "primary",
|
|
1137
|
+
size: "sm",
|
|
1149
1138
|
"aria-label": t.chrome.access,
|
|
1150
|
-
|
|
1139
|
+
icon: /* @__PURE__ */ jsx(AccessIcon, {}),
|
|
1151
1140
|
disabled: !selectedNode.storageId,
|
|
1152
1141
|
onClick: () => setAccessDrawerOpen(true),
|
|
1153
|
-
|
|
1154
|
-
children: [/* @__PURE__ */ jsx(FaUsers, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ jsx("span", {
|
|
1142
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1155
1143
|
className: "hidden md:inline",
|
|
1156
1144
|
children: t.chrome.manageAccess
|
|
1157
|
-
})
|
|
1145
|
+
})
|
|
1158
1146
|
}),
|
|
1159
|
-
selectedNodeCanDelete && /* @__PURE__ */
|
|
1160
|
-
|
|
1161
|
-
"
|
|
1162
|
-
|
|
1147
|
+
selectedNodeCanDelete && /* @__PURE__ */ jsx(Button, {
|
|
1148
|
+
variant: "danger",
|
|
1149
|
+
size: "sm",
|
|
1150
|
+
"aria-label": common.delete,
|
|
1151
|
+
icon: /* @__PURE__ */ jsx(TrashIcon, {}),
|
|
1163
1152
|
disabled: checkedItems.size === 0 && selectedNode.type !== "file" || !selectedNode.storageId,
|
|
1164
1153
|
onClick: onDeleteClick,
|
|
1165
|
-
children:
|
|
1154
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1166
1155
|
className: "hidden md:inline",
|
|
1167
|
-
children:
|
|
1168
|
-
})
|
|
1156
|
+
children: common.delete
|
|
1157
|
+
})
|
|
1169
1158
|
})
|
|
1170
1159
|
]
|
|
1171
1160
|
})]
|
|
@@ -1208,12 +1197,12 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1208
1197
|
}),
|
|
1209
1198
|
selectedNode.type === "file" && (() => {
|
|
1210
1199
|
const uris = getNodeUris(selectedNode);
|
|
1211
|
-
const fileIcon = getNodeIcon(selectedNode
|
|
1200
|
+
const fileIcon = getNodeIcon(selectedNode) ?? /* @__PURE__ */ jsx(FileIcon, { className: "h-5 w-5 theme-muted-text" });
|
|
1212
1201
|
const modifiedDt = selectedNode.modified ? DateTime.fromISO(selectedNode.modified) : null;
|
|
1213
1202
|
const createdDt = selectedNode.created ? DateTime.fromISO(selectedNode.created) : null;
|
|
1214
1203
|
const previewable = canPreview(selectedNode);
|
|
1215
1204
|
const effectiveTab = previewable ? detailTab : "details";
|
|
1216
|
-
const tabClass = (active) =>
|
|
1205
|
+
const tabClass = (active) => cx("mx-2.5 border-b-2 px-1 py-2.5 text-[13px] font-medium cursor-pointer transition-colors", active ? "theme-text border-(--theme-accent)" : "theme-muted-text border-transparent hover:theme-text");
|
|
1217
1206
|
return /* @__PURE__ */ jsxs("div", {
|
|
1218
1207
|
className: "flex h-full min-h-0 flex-col",
|
|
1219
1208
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -1261,12 +1250,16 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1261
1250
|
}),
|
|
1262
1251
|
typeof selectedNode.size === "number" && /* @__PURE__ */ jsx("span", {
|
|
1263
1252
|
className: "tabular-nums",
|
|
1264
|
-
children:
|
|
1253
|
+
children: formatBytes(selectedNode.size)
|
|
1265
1254
|
}),
|
|
1266
1255
|
modifiedDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
1267
1256
|
"aria-hidden": true,
|
|
1268
1257
|
children: "·"
|
|
1269
|
-
}), /* @__PURE__ */ jsxs("span", { children: [
|
|
1258
|
+
}), /* @__PURE__ */ jsxs("span", { children: [
|
|
1259
|
+
t.chrome.modified,
|
|
1260
|
+
" ",
|
|
1261
|
+
/* @__PURE__ */ jsx(RelativeTime, { value: modifiedDt })
|
|
1262
|
+
] })] })
|
|
1270
1263
|
]
|
|
1271
1264
|
})]
|
|
1272
1265
|
})]
|
|
@@ -1289,7 +1282,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1289
1282
|
className: "px-6 py-5 mt-5 border-t theme-border",
|
|
1290
1283
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
1291
1284
|
className: "text-[11px] font-semibold uppercase tracking-widest theme-muted-text mb-3",
|
|
1292
|
-
children:
|
|
1285
|
+
children: t.chrome.details
|
|
1293
1286
|
}), /* @__PURE__ */ jsxs("dl", {
|
|
1294
1287
|
className: "grid grid-cols-[minmax(0,140px)_1fr] gap-x-6 gap-y-2 text-sm",
|
|
1295
1288
|
children: [
|
|
@@ -1298,11 +1291,11 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1298
1291
|
children: t.chrome.size
|
|
1299
1292
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1300
1293
|
className: "tabular-nums",
|
|
1301
|
-
children:
|
|
1294
|
+
children: formatBytes(selectedNode.size)
|
|
1302
1295
|
})] }),
|
|
1303
1296
|
selectedNode.contentType && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1304
1297
|
className: "theme-muted-text",
|
|
1305
|
-
children:
|
|
1298
|
+
children: t.chrome.contentType
|
|
1306
1299
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1307
1300
|
className: "font-mono text-xs",
|
|
1308
1301
|
children: selectedNode.contentType
|
|
@@ -1311,22 +1304,22 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1311
1304
|
className: "theme-muted-text",
|
|
1312
1305
|
children: t.chrome.created
|
|
1313
1306
|
}), /* @__PURE__ */ jsxs("dd", { children: [
|
|
1314
|
-
createdDt
|
|
1307
|
+
formatDateTime(createdDt),
|
|
1315
1308
|
" ",
|
|
1316
1309
|
/* @__PURE__ */ jsxs("span", {
|
|
1317
1310
|
className: "theme-muted-text",
|
|
1318
|
-
children: ["· ", createdDt
|
|
1311
|
+
children: ["· ", /* @__PURE__ */ jsx(RelativeTime, { value: createdDt })]
|
|
1319
1312
|
})
|
|
1320
1313
|
] })] }),
|
|
1321
1314
|
modifiedDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1322
1315
|
className: "theme-muted-text",
|
|
1323
|
-
children:
|
|
1316
|
+
children: t.chrome.lastModified
|
|
1324
1317
|
}), /* @__PURE__ */ jsxs("dd", { children: [
|
|
1325
|
-
modifiedDt
|
|
1318
|
+
formatDateTime(modifiedDt),
|
|
1326
1319
|
" ",
|
|
1327
1320
|
/* @__PURE__ */ jsxs("span", {
|
|
1328
1321
|
className: "theme-muted-text",
|
|
1329
|
-
children: ["· ", modifiedDt
|
|
1322
|
+
children: ["· ", /* @__PURE__ */ jsx(RelativeTime, { value: modifiedDt })]
|
|
1330
1323
|
})
|
|
1331
1324
|
] })] }),
|
|
1332
1325
|
selectedNode.hash && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
@@ -1338,7 +1331,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1338
1331
|
})] }),
|
|
1339
1332
|
selectedNode.storageClass && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1340
1333
|
className: "theme-muted-text",
|
|
1341
|
-
children:
|
|
1334
|
+
children: t.chrome.storageClass
|
|
1342
1335
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1343
1336
|
className: "font-mono text-xs uppercase tracking-wider",
|
|
1344
1337
|
children: selectedNode.storageClass
|
|
@@ -1368,7 +1361,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1368
1361
|
/* @__PURE__ */ jsx(CreateModal, {
|
|
1369
1362
|
open: !!createFolderTarget,
|
|
1370
1363
|
onClose: () => setCreateFolderTarget(null),
|
|
1371
|
-
typeIcon: /* @__PURE__ */ jsx(
|
|
1364
|
+
typeIcon: /* @__PURE__ */ jsx(FolderIcon, { className: "w-3 h-3" }),
|
|
1372
1365
|
typeLabel: t.createFolder.folder,
|
|
1373
1366
|
namePlaceholder: t.createFolder.namePlaceholder,
|
|
1374
1367
|
submitLabel: t.createFolder.submit,
|
|
@@ -1378,7 +1371,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1378
1371
|
}),
|
|
1379
1372
|
waitForUpload && /* @__PURE__ */ jsx("div", {
|
|
1380
1373
|
className: "absolute inset-0 bg-(--theme-app-bg)/75 backdrop-blur-[2px] transition-opacity flex items-center justify-center z-50",
|
|
1381
|
-
children: /* @__PURE__ */ jsx(Loader, {
|
|
1374
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
1382
1375
|
}),
|
|
1383
1376
|
/* @__PURE__ */ jsx(ConfirmModal, {
|
|
1384
1377
|
open: uploadModalOpen && !!pendingUpload,
|
|
@@ -1412,12 +1405,12 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1412
1405
|
children: [
|
|
1413
1406
|
/* @__PURE__ */ jsx("span", {
|
|
1414
1407
|
className: "font-semibold",
|
|
1415
|
-
children: t.
|
|
1408
|
+
children: t.upload.totalSize
|
|
1416
1409
|
}),
|
|
1417
1410
|
" ",
|
|
1418
1411
|
/* @__PURE__ */ jsx("span", {
|
|
1419
|
-
className:
|
|
1420
|
-
children:
|
|
1412
|
+
className: cx(isUploadSizeExceeded(pendingUpload?.totalSize ?? 0) && "text-amber-800 font-semibold"),
|
|
1413
|
+
children: formatBytes(pendingUpload?.totalSize ?? 0)
|
|
1421
1414
|
})
|
|
1422
1415
|
]
|
|
1423
1416
|
}),
|
|
@@ -1425,14 +1418,14 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1425
1418
|
className: "mt-3 p-3 bg-amber-50 border border-amber-200 rounded-lg",
|
|
1426
1419
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1427
1420
|
className: "flex items-start gap-2",
|
|
1428
|
-
children: [/* @__PURE__ */ jsx(
|
|
1421
|
+
children: [/* @__PURE__ */ jsx(WarningIcon, { className: "w-4 h-4 text-amber-600 shrink-0 mt-0.5" }), /* @__PURE__ */ jsxs("div", {
|
|
1429
1422
|
className: "text-amber-800",
|
|
1430
1423
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1431
1424
|
className: "font-semibold mb-1",
|
|
1432
1425
|
children: t.confirmUpload.sizeLimitTitle
|
|
1433
1426
|
}), /* @__PURE__ */ jsxs("div", {
|
|
1434
1427
|
className: "text-sm",
|
|
1435
|
-
children: [/* @__PURE__ */ jsx("p", { children: t.confirmUpload.sizeLimitBody(
|
|
1428
|
+
children: [/* @__PURE__ */ jsx("p", { children: t.confirmUpload.sizeLimitBody(formatBytes(pendingUpload?.totalSize ?? 0), formatBytes(MAX_UPLOAD_SIZE)) }), /* @__PURE__ */ jsx("p", { children: t.confirmUpload.sizeLimitHint })]
|
|
1436
1429
|
})]
|
|
1437
1430
|
})]
|
|
1438
1431
|
})
|
|
@@ -1451,7 +1444,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1451
1444
|
destructive: true,
|
|
1452
1445
|
title: t.confirmDelete.title,
|
|
1453
1446
|
description: t.confirmDelete.text,
|
|
1454
|
-
confirmLabel:
|
|
1447
|
+
confirmLabel: common.delete,
|
|
1455
1448
|
onConfirm: handleDelete,
|
|
1456
1449
|
children: /* @__PURE__ */ jsx("div", {
|
|
1457
1450
|
className: "text-sm flex flex-col gap-2 mt-2 text-left",
|