@parallelworks/ui 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/ai/adapter/openai/createOpenAIStream.js +3 -2
- package/dist/ai/agent/diff.d.ts +0 -1
- package/dist/ai/agent/diff.js +3 -2
- package/dist/ai/agent/toolfmt.js +2 -3
- package/dist/ai/ai.css +5 -0
- package/dist/ai/components/AllocationSelector.js +3 -2
- package/dist/ai/components/AttachmentManager.js +7 -5
- package/dist/ai/components/AttachmentUpload.js +11 -7
- package/dist/ai/components/BlockedGroupBanner.js +2 -2
- package/dist/ai/components/BranchNavigator.js +8 -5
- package/dist/ai/components/ChatEmptyState.js +8 -5
- package/dist/ai/components/ChatInput.d.ts +2 -5
- package/dist/ai/components/ChatInput.js +16 -11
- package/dist/ai/components/ChatMessage.js +25 -17
- package/dist/ai/components/ChatMessageList.js +4 -3
- package/dist/ai/components/ChatSidebar.d.ts +0 -1
- package/dist/ai/components/ChatSidebar.js +22 -16
- package/dist/ai/components/ChatThread.js +9 -11
- package/dist/ai/components/ComposerChrome.js +2 -2
- package/dist/ai/components/ModelSelector.js +20 -14
- package/dist/ai/components/ShareDialog.js +10 -6
- package/dist/ai/components/SlashMenu.d.ts +0 -1
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -1
- package/dist/ai/components/agent/ActivityLine.js +5 -4
- package/dist/ai/components/agent/AgentMessageParts.d.ts +1 -26
- package/dist/ai/components/agent/AgentMessageParts.js +13 -12
- package/dist/ai/core/ChatProvider.d.ts +2 -6
- package/dist/ai/core/ChatProvider.js +42 -67
- package/dist/ai/core/KeyboardShortcutsProvider.js +1 -1
- package/dist/ai/core/chatReducer.d.ts +0 -6
- package/dist/ai/core/chatReducer.js +1 -15
- package/dist/ai/core/useKeyboardShortcuts.d.ts +3 -1
- package/dist/ai/core/useKeyboardShortcuts.js +9 -11
- package/dist/ai/core/useSSEStream.d.ts +0 -1
- package/dist/ai/core/useSSEStream.js +5 -17
- package/dist/ai/strings.d.ts +0 -1
- package/dist/ai/strings.js +0 -1
- package/dist/ai/types.d.ts +1 -1
- package/dist/ai/ui/Avatar.d.ts +1 -2
- package/dist/ai/ui/Avatar.js +7 -18
- package/dist/ai/ui/Dropdown.js +2 -2
- package/dist/ai/ui/Markdown.d.ts +1 -3
- package/dist/ai/ui/Markdown.js +1 -2
- package/dist/ai/ui/Notice.js +5 -3
- package/dist/ai/ui/sidebar.d.ts +0 -1
- package/dist/ai/ui/sidebar.js +5 -3
- package/dist/ai/utils.js +1 -1
- package/dist/components/Avatar.js +4 -2
- package/dist/components/BareModal.js +1 -5
- package/dist/components/Breadcrumbs.js +21 -14
- package/dist/components/Button.js +3 -2
- package/dist/components/Callout.js +4 -3
- package/dist/components/CollapsiblePanel.d.ts +1 -3
- package/dist/components/CollapsiblePanel.js +7 -7
- package/dist/components/CopyToClipboard.js +8 -4
- package/dist/components/CreateModal.js +11 -7
- package/dist/components/Dropdown.d.ts +0 -4
- package/dist/components/Dropdown.js +7 -8
- package/dist/components/Filter.js +2 -2
- package/dist/components/Indicator.js +14 -9
- package/dist/components/Input.js +6 -4
- package/dist/components/Listbox.js +16 -20
- package/dist/components/Loader.js +1 -1
- package/dist/components/MultiSelect.js +5 -8
- package/dist/components/PageHeader.js +10 -7
- package/dist/components/Pagination.js +1 -1
- package/dist/components/Provider.d.ts +0 -8
- package/dist/components/Sort.js +6 -4
- package/dist/components/StatusIcons.d.ts +11 -0
- package/dist/components/StatusIcons.js +20 -0
- package/dist/components/SwitchToggle.js +3 -5
- package/dist/components/Table.d.ts +1 -3
- package/dist/components/Tooltip.js +3 -3
- package/dist/components/dropdownUtils.js +7 -8
- package/dist/components/relativeTime.d.ts +0 -7
- package/dist/components/relativeTime.js +1 -1
- package/dist/duration.js +1 -1
- package/dist/editor/Editor.d.ts +1 -1
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/EditorField.d.ts +0 -1
- package/dist/editor/EditorField.js +8 -8
- package/dist/editor/FormCodePanel.js +20 -23
- package/dist/editor/yamlLanguage.js +2 -2
- package/dist/file-explorer/FileExplorer.js +94 -82
- package/dist/file-explorer/FileExplorerContext.d.ts +1 -2
- package/dist/file-explorer/FileExplorerContext.js +92 -125
- package/dist/file-explorer/FilePreview/Inline.d.ts +1 -2
- package/dist/file-explorer/FilePreview/Inline.js +4 -4
- package/dist/file-explorer/FilePreview/StreamedBadge.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +14 -14
- package/dist/file-explorer/FilePreview/index.d.ts +1 -2
- package/dist/file-explorer/FilePreview/index.js +20 -13
- package/dist/file-explorer/FilePreview/parse.d.ts +2 -1
- package/dist/file-explorer/FilePreview/useObjectBlobUrl.d.ts +5 -4
- package/dist/file-explorer/FilePreview/useObjectBlobUrl.js +23 -36
- package/dist/file-explorer/FilePreview/useObjectText.d.ts +1 -2
- package/dist/file-explorer/FilePreview/useObjectText.js +5 -7
- package/dist/file-explorer/FileRow.js +3 -3
- package/dist/file-explorer/FileRowsWindow.d.ts +5 -12
- package/dist/file-explorer/FileRowsWindow.js +3 -2
- package/dist/file-explorer/FileTable.d.ts +2 -6
- package/dist/file-explorer/LoadMoreRow.d.ts +8 -0
- package/dist/file-explorer/TreeView.d.ts +0 -1
- package/dist/file-explorer/TreeView.js +11 -9
- package/dist/file-explorer/helpers.js +45 -33
- package/dist/file-explorer/lib/fileExplorer.d.ts +0 -2
- package/dist/file-explorer/lib/types.d.ts +0 -1
- package/dist/file-explorer/lib/utils.js +15 -20
- package/dist/file-explorer/toasts.js +54 -45
- package/dist/form/Fields/BooleanField.js +5 -4
- package/dist/form/Fields/CheckboxGroupField.js +5 -4
- package/dist/form/Fields/ColorField.js +5 -4
- package/dist/form/Fields/DropdownField.d.ts +0 -1
- package/dist/form/Fields/DropdownField.js +10 -13
- package/dist/form/Fields/DurationField.js +2 -2
- package/dist/form/Fields/LabelField.js +5 -5
- package/dist/form/Fields/MultiDropdownField.d.ts +1 -1
- package/dist/form/Fields/MultiDropdownField.js +8 -11
- package/dist/form/Fields/NumberField.js +6 -5
- package/dist/form/Fields/ObjectField.d.ts +1 -2
- package/dist/form/Fields/ObjectField.js +22 -21
- package/dist/form/Fields/RadioField.js +4 -3
- package/dist/form/Fields/RangeField.js +7 -6
- package/dist/form/Fields/StringField.js +2 -1
- package/dist/form/Fields/TextAreaField.js +2 -1
- package/dist/form/Form.d.ts +7 -8
- package/dist/form/Form.js +56 -81
- package/dist/form/SpecialTypes/DropdownWrapper.d.ts +0 -2
- package/dist/form/SpecialTypes/DropdownWrapper.js +1 -3
- package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +1 -3
- package/dist/form/SpecialTypes/FormikCustomDropdown.js +4 -7
- package/dist/form/SpecialTypes/FormikCustomInput.js +16 -13
- package/dist/form/Wizard/WizardContainer.js +8 -25
- package/dist/form/Wizard/WizardNavigation.d.ts +1 -1
- package/dist/form/Wizard/WizardNavigation.js +5 -6
- package/dist/form/Wizard/WizardStepContent.d.ts +1 -1
- package/dist/form/Wizard/WizardStepContent.js +2 -2
- package/dist/form/Wizard/WizardStepIndicator.js +7 -17
- package/dist/form/Wizard/types.d.ts +4 -46
- package/dist/form/Wizard/useWizardState.d.ts +2 -10
- package/dist/form/Wizard/useWizardState.js +42 -92
- package/dist/form/Wizard/utils.js +6 -11
- package/dist/form/lib.js +28 -54
- package/dist/form/types/fieldTypes.d.ts +4 -5
- package/dist/form/utils/dependentOptions.d.ts +6 -0
- package/dist/form/utils/dependentOptions.js +21 -0
- package/dist/form/utils/getParentValue.d.ts +2 -1
- package/dist/form/utils/getParentValue.js +10 -15
- package/dist/form/utils/getValueUsingPath.js +1 -1
- package/dist/graph/AnnotationBanner.d.ts +1 -1
- package/dist/graph/AnnotationBanner.js +10 -6
- package/dist/graph/Collapse.d.ts +3 -3
- package/dist/graph/Collapse.js +3 -8
- package/dist/graph/DependencyGraph.d.ts +5 -4
- package/dist/graph/DependencyGraph.js +178 -226
- package/dist/graph/JobSummary.d.ts +10 -8
- package/dist/graph/JobSummary.js +17 -16
- package/dist/graph/MatrixGroup.d.ts +5 -17
- package/dist/graph/MatrixGroup.js +11 -22
- package/dist/graph/TreeView.d.ts +1 -3
- package/dist/graph/TreeView.js +106 -492
- package/dist/graph/types.d.ts +3 -2
- package/dist/graph/util.d.ts +5 -0
- package/dist/graph/util.js +18 -0
- package/dist/icons/ai/AiOutlineRollback.js +16 -0
- package/dist/icons/bi/BiBell.js +16 -0
- package/dist/icons/bi/BiBellOff.js +16 -0
- package/dist/icons/bi/BiBuildings.js +20 -0
- package/dist/icons/bi/BiError.js +20 -0
- package/dist/icons/bi/BiExpandVertical.js +16 -0
- package/dist/icons/bi/BiPause.js +16 -0
- package/dist/icons/bi/BiPlay.js +16 -0
- package/dist/icons/bi/BiSolidCheckShield.js +16 -0
- package/dist/icons/bi/BiSolidTrashAlt.js +16 -0
- package/dist/icons/bi/BiStop.js +16 -0
- package/dist/icons/bs/BsArrowsCollapse.js +22 -0
- package/dist/icons/bs/BsBank2.js +19 -0
- package/dist/icons/bs/BsBriefcase.js +19 -0
- package/dist/icons/bs/BsBucket.js +19 -0
- package/dist/icons/bs/BsCalendarX.js +23 -0
- package/dist/icons/bs/BsChatLeft.js +19 -0
- package/dist/icons/bs/BsChevronDoubleDown.js +29 -0
- package/dist/icons/bs/BsChevronDoubleUp.js +29 -0
- package/dist/icons/bs/BsClipboardCheck.js +34 -0
- package/dist/icons/bs/BsCurrencyDollar.js +19 -0
- package/dist/icons/bs/BsDash.js +19 -0
- package/dist/icons/bs/BsFileEarmarkZip.js +23 -0
- package/dist/icons/bs/BsFiles.js +19 -0
- package/dist/icons/bs/BsGeoAlt.js +23 -0
- package/dist/icons/bs/BsGrid.js +19 -0
- package/dist/icons/bs/BsLayers.js +19 -0
- package/dist/icons/bs/BsLayoutThreeColumns.js +19 -0
- package/dist/icons/bs/BsListUl.js +22 -0
- package/dist/icons/bs/BsMortarboard.js +23 -0
- package/dist/icons/bs/BsMusicNoteBeamed.js +34 -0
- package/dist/icons/bs/BsOpenai.js +19 -0
- package/dist/icons/bs/BsPersonPlus.js +26 -0
- package/dist/icons/bs/BsSearch.js +19 -0
- package/dist/icons/bs/BsSend.js +19 -0
- package/dist/icons/bs/BsShieldSlash.js +22 -0
- package/dist/icons/bs/BsStar.js +19 -0
- package/dist/icons/bs/BsStarFill.js +19 -0
- package/dist/icons/bs/BsStopCircle.js +23 -0
- package/dist/icons/bs/BsTag.js +23 -0
- package/dist/icons/bs/BsTelephone.js +19 -0
- package/dist/icons/bs/BsTerminal.js +23 -0
- package/dist/icons/bs/BsTerminalFill.js +19 -0
- package/dist/icons/bs/BsThreeDots.js +19 -0
- package/dist/icons/bs/BsThreeDotsVertical.js +19 -0
- package/dist/icons/bs/BsZoomIn.js +37 -0
- package/dist/icons/fa/FaAmazon.js +16 -0
- package/dist/icons/fa/FaAngleDown.js +16 -0
- package/dist/icons/fa/FaAngleLeft.js +16 -0
- package/dist/icons/fa/FaAngleRight.js +16 -0
- package/dist/icons/fa/FaAngleUp.js +16 -0
- package/dist/icons/fa/FaArrowDown.js +16 -0
- package/dist/icons/fa/FaArrowLeft.js +16 -0
- package/dist/icons/fa/FaArrowRight.js +16 -0
- package/dist/icons/fa/FaArrowUp.js +16 -0
- package/dist/icons/fa/FaBalanceScale.js +16 -0
- package/dist/icons/fa/FaCaretDown.js +16 -0
- package/dist/icons/fa/FaCentos.js +16 -0
- package/dist/icons/fa/FaChartLine.js +16 -0
- package/dist/icons/fa/FaChartPie.js +16 -0
- package/dist/icons/fa/FaCheck.js +16 -0
- package/dist/icons/fa/FaChevronDown.js +16 -0
- package/dist/icons/fa/FaChevronUp.js +16 -0
- package/dist/icons/fa/FaChrome.js +16 -0
- package/dist/icons/fa/FaCircleNotch.js +16 -0
- package/dist/icons/fa/FaCloud.js +16 -0
- package/dist/icons/fa/FaCloudDownloadAlt.js +16 -0
- package/dist/icons/fa/FaCog.js +16 -0
- package/dist/icons/fa/FaCogs.js +16 -0
- package/dist/icons/fa/FaComments.js +16 -0
- package/dist/icons/fa/FaCompress.js +16 -0
- package/dist/icons/fa/FaDesktop.js +16 -0
- package/dist/icons/fa/FaDocker.js +16 -0
- package/dist/icons/fa/FaDollarSign.js +16 -0
- package/dist/icons/fa/FaEdge.js +16 -0
- package/dist/icons/fa/FaEdit.js +16 -0
- package/dist/icons/fa/FaExclamationTriangle.js +16 -0
- package/dist/icons/fa/FaExpand.js +16 -0
- package/dist/icons/fa/FaEye.js +16 -0
- package/dist/icons/fa/FaEyeSlash.js +16 -0
- package/dist/icons/fa/FaFile.js +16 -0
- package/dist/icons/fa/FaFilePdf.js +16 -0
- package/dist/icons/fa/FaFilter.js +16 -0
- package/dist/icons/fa/FaFirefoxBrowser.js +16 -0
- package/dist/icons/fa/FaFlask.js +16 -0
- package/dist/icons/fa/FaFolder.js +16 -0
- package/dist/icons/fa/FaGithub.js +16 -0
- package/dist/icons/fa/FaGitlab.js +16 -0
- package/dist/icons/fa/FaGlobe.js +16 -0
- package/dist/icons/fa/FaGlobeAmericas.js +16 -0
- package/dist/icons/fa/FaImage.js +16 -0
- package/dist/icons/fa/FaInfoCircle.js +16 -0
- package/dist/icons/fa/FaKey.js +16 -0
- package/dist/icons/fa/FaLayerGroup.js +16 -0
- package/dist/icons/fa/FaLink.js +16 -0
- package/dist/icons/fa/FaLinkedin.js +16 -0
- package/dist/icons/fa/FaLinux.js +16 -0
- package/dist/icons/fa/FaList.js +16 -0
- package/dist/icons/fa/FaLock.js +16 -0
- package/dist/icons/fa/FaOpenid.js +16 -0
- package/dist/icons/fa/FaOpera.js +16 -0
- package/dist/icons/fa/FaPaperclip.js +16 -0
- package/dist/icons/fa/FaPlus.js +16 -0
- package/dist/icons/fa/FaPowerOff.js +16 -0
- package/dist/icons/fa/FaPrint.js +16 -0
- package/dist/icons/fa/FaQrcode.js +16 -0
- package/dist/icons/fa/FaQuestionCircle.js +16 -0
- package/dist/icons/fa/FaRedhat.js +16 -0
- package/dist/icons/fa/FaRegCircle.js +16 -0
- package/dist/icons/fa/FaRegFileImage.js +16 -0
- package/dist/icons/fa/FaRegFolder.js +16 -0
- package/dist/icons/fa/FaRobot.js +16 -0
- package/dist/icons/fa/FaRocket.js +16 -0
- package/dist/icons/fa/FaRunning.js +16 -0
- package/dist/icons/fa/FaSafari.js +16 -0
- package/dist/icons/fa/FaSave.js +16 -0
- package/dist/icons/fa/FaSearch.js +16 -0
- package/dist/icons/fa/FaShieldAlt.js +16 -0
- package/dist/icons/fa/FaSlack.js +16 -0
- package/dist/icons/fa/FaStar.js +16 -0
- package/dist/icons/fa/FaStop.js +16 -0
- package/dist/icons/fa/FaSuse.js +16 -0
- package/dist/icons/fa/FaTerminal.js +16 -0
- package/dist/icons/fa/FaTimes.js +16 -0
- package/dist/icons/fa/FaUbuntu.js +16 -0
- package/dist/icons/fa/FaUndoAlt.js +16 -0
- package/dist/icons/fa/FaUnlink.js +16 -0
- package/dist/icons/fa/FaUser.js +16 -0
- package/dist/icons/fa/FaUsers.js +16 -0
- package/dist/icons/fa/FaWindows.js +16 -0
- package/dist/icons/fa6/FaApple.js +16 -0
- package/dist/icons/fa6/FaArrowsRotate.js +16 -0
- package/dist/icons/fa6/FaDebian.js +16 -0
- package/dist/icons/fa6/FaFilterCircleXmark.js +16 -0
- package/dist/icons/fa6/FaInbox.js +16 -0
- package/dist/icons/fa6/FaLocationDot.js +16 -0
- package/dist/icons/fa6/FaRegFilePdf.js +16 -0
- package/dist/icons/fa6/FaRegFolderOpen.js +16 -0
- package/dist/icons/fa6/FaUpRightFromSquare.js +16 -0
- package/dist/icons/fa6/FaWandMagicSparkles.js +16 -0
- package/dist/icons/fa6/FaXTwitter.js +16 -0
- package/dist/icons/fi/FiActivity.js +23 -0
- package/dist/icons/fi/FiAlertCircle.js +49 -0
- package/dist/icons/fi/FiChevronDown.js +23 -0
- package/dist/icons/fi/FiClock.js +31 -0
- package/dist/icons/fi/FiCopy.js +34 -0
- package/dist/icons/fi/FiDownload.js +40 -0
- package/dist/icons/fi/FiFile.js +27 -0
- package/dist/icons/fi/FiFileText.js +55 -0
- package/dist/icons/fi/FiHardDrive.js +55 -0
- package/dist/icons/fi/FiRotateCcw.js +27 -0
- package/dist/icons/fi/FiUpload.js +40 -0
- package/dist/icons/fi/FiX.js +37 -0
- package/dist/icons/fi/FiZap.js +23 -0
- package/dist/icons/gi/GiSpy.js +16 -0
- package/dist/icons/go/GoGitCommit.js +16 -0
- package/dist/icons/go/GoGitPullRequest.js +20 -0
- package/dist/icons/go/GoIssueOpened.js +16 -0
- package/dist/icons/go/GoPlus.js +16 -0
- package/dist/icons/go/GoRepoForked.js +28 -0
- package/dist/icons/go/GoSignOut.js +16 -0
- package/dist/icons/go/GoSkip.js +20 -0
- package/dist/icons/go/GoVideo.js +20 -0
- package/dist/icons/gr/GrCloudComputer.js +20 -0
- package/dist/icons/gr/GrInbox.js +20 -0
- package/dist/icons/gr/GrServerCluster.js +20 -0
- package/dist/icons/gr/GrStorage.js +20 -0
- package/dist/icons/gr/GrTasks.js +20 -0
- package/dist/icons/hi/HiCog.js +24 -0
- package/dist/icons/hi/HiDuplicate.js +24 -0
- package/dist/icons/hi/HiOutlineArchive.js +26 -0
- package/dist/icons/hi/HiOutlineClipboardCopy.js +26 -0
- package/dist/icons/hi/HiOutlineHome.js +26 -0
- package/dist/icons/hi/HiQuestionMarkCircle.js +24 -0
- package/dist/icons/hi/HiServer.js +24 -0
- package/dist/icons/hi2/HiMiniCheckCircle.js +24 -0
- package/dist/icons/hi2/HiMiniLanguage.js +28 -0
- package/dist/icons/hi2/HiMiniMinusCircle.js +24 -0
- package/dist/icons/hi2/HiMiniXCircle.js +24 -0
- package/dist/icons/hi2/HiSparkles.js +24 -0
- package/dist/icons/im/ImSpinner5.js +19 -0
- package/dist/icons/io/IoIosNotifications.js +16 -0
- package/dist/icons/io/IoMdBuild.js +16 -0
- package/dist/icons/io/IoMdClose.js +16 -0
- package/dist/icons/io5/IoCloudUploadOutline.js +32 -0
- package/dist/icons/io5/IoDocumentTextOutline.js +31 -0
- package/dist/icons/io5/IoFileTrayFullOutline.js +31 -0
- package/dist/icons/io5/IoHeart.js +16 -0
- package/dist/icons/io5/IoHeartDislike.js +16 -0
- package/dist/icons/io5/IoHeartOutline.js +22 -0
- package/dist/icons/io5/IoInformationCircleOutline.js +50 -0
- package/dist/icons/io5/IoSettingsOutline.js +22 -0
- package/dist/icons/io5/IoWarningOutline.js +40 -0
- package/dist/icons/lu/LuArrowRight.js +27 -0
- package/dist/icons/lu/LuBadgeCheck.js +27 -0
- package/dist/icons/lu/LuBrainCircuit.js +101 -0
- package/dist/icons/lu/LuCalendar.js +46 -0
- package/dist/icons/lu/LuCheck.js +23 -0
- package/dist/icons/lu/LuChevronLeft.js +23 -0
- package/dist/icons/lu/LuChevronRight.js +23 -0
- package/dist/icons/lu/LuExternalLink.js +35 -0
- package/dist/icons/lu/LuEye.js +31 -0
- package/dist/icons/lu/LuEyeOff.js +40 -0
- package/dist/icons/lu/LuFolderTree.js +40 -0
- package/dist/icons/lu/LuIdCard.js +55 -0
- package/dist/icons/lu/LuLogs.js +65 -0
- package/dist/icons/lu/LuMail.js +33 -0
- package/dist/icons/lu/LuMegaphone.js +27 -0
- package/dist/icons/lu/LuMoon.js +23 -0
- package/dist/icons/lu/LuPartyPopper.js +65 -0
- package/dist/icons/lu/LuSettings2.js +48 -0
- package/dist/icons/lu/LuSheet.js +72 -0
- package/dist/icons/lu/LuShield.js +23 -0
- package/dist/icons/lu/LuSun.js +69 -0
- package/dist/icons/lu/LuX.js +27 -0
- package/dist/icons/lu/LuZoomIn.js +59 -0
- package/dist/icons/lu/LuZoomOut.js +49 -0
- package/dist/icons/md/MdClear.js +23 -0
- package/dist/icons/md/MdDragHandle.js +23 -0
- package/dist/icons/md/MdInstallDesktop.js +31 -0
- package/dist/icons/md/MdOutlineAttachMoney.js +23 -0
- package/dist/icons/md/MdOutlineMoneyOff.js +23 -0
- package/dist/icons/md/MdPieChart.js +23 -0
- package/dist/icons/md/MdRefresh.js +23 -0
- package/dist/icons/md/MdReplay.js +23 -0
- package/dist/icons/md/MdSmartphone.js +23 -0
- package/dist/icons/pi/PiArrowBendUpRightBold.js +19 -0
- package/dist/icons/pi/PiPlugsConnectedFill.js +19 -0
- package/dist/icons/pi/PiRectangleDashed.js +19 -0
- package/dist/icons/pi/PiShareBold.js +19 -0
- package/dist/icons/si/SiAnthropic.js +19 -0
- package/dist/icons/si/SiHelm.js +19 -0
- package/dist/icons/si/SiKubernetes.js +19 -0
- package/dist/icons/tb/TbAlertTriangle.js +35 -0
- package/dist/icons/tb/TbAlertTriangleFilled.js +19 -0
- package/dist/icons/tb/TbApi.js +40 -0
- package/dist/icons/tb/TbBrain.js +50 -0
- package/dist/icons/tb/TbBuildingTunnel.js +65 -0
- package/dist/icons/tb/TbEdit.js +35 -0
- package/dist/icons/tb/TbLayoutSidebar.js +27 -0
- package/dist/icons/tb/TbLayoutSidebarLeftCollapse.js +35 -0
- package/dist/icons/tb/TbLayoutSidebarRightCollapse.js +35 -0
- package/dist/icons/tb/TbUser.js +27 -0
- package/dist/icons/tb/TbUserOff.js +35 -0
- package/dist/icons/tb/TbWorldShare.js +55 -0
- package/dist/icons/tb/TbWorldWww.js +65 -0
- package/dist/icons/ti/TiArrowSortedDown.js +20 -0
- package/dist/icons/ti/TiArrowSortedUp.js +20 -0
- package/dist/icons/ti/TiArrowUnsorted.js +20 -0
- package/dist/icons/ti/TiCancel.js +20 -0
- package/dist/icons/vsc/VscChromeMinimize.js +19 -0
- package/dist/icons/vsc/VscJson.js +19 -0
- package/dist/icons/vsc/VscLayoutSidebarLeft.js +19 -0
- package/dist/icons/vsc/VscPass.js +27 -0
- package/dist/icons/vsc/VscSplitHorizontal.js +19 -0
- package/dist/icons/vsc/VscTerminalPowershell.js +19 -0
- package/dist/icons.d.ts +7 -22
- package/dist/icons.js +257 -38
- package/dist/index.d.ts +1 -1
- package/dist/list/ActionToolbar.js +2 -2
- package/dist/list/ListPager.js +4 -3
- package/dist/list/ListTable.js +2 -2
- package/dist/list/ListViewControls.js +29 -42
- package/dist/list/RowContextMenu.js +28 -19
- package/dist/list/listSearch.js +6 -5
- package/dist/logviewer/LogViewer.js +28 -20
- package/dist/logviewer/segments.js +2 -2
- package/dist/styles/theme.css +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/index.js +5 -5
- package/package.json +28 -30
- package/dist/ai/ui/buttons.d.ts +0 -1
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { safeUrl } from "../safeUrl.js";
|
|
2
2
|
import { useNotify, useSlots, useStrings } from "../components/Provider.js";
|
|
3
|
-
import {
|
|
3
|
+
import { BiSolidTrashAlt } from "../icons/bi/BiSolidTrashAlt.js";
|
|
4
|
+
import { BsArrowsCollapse } from "../icons/bs/BsArrowsCollapse.js";
|
|
5
|
+
import { FaAngleDown } from "../icons/fa/FaAngleDown.js";
|
|
6
|
+
import { FaLink } from "../icons/fa/FaLink.js";
|
|
7
|
+
import { FaRegFolder } from "../icons/fa/FaRegFolder.js";
|
|
8
|
+
import { FaUsers } from "../icons/fa/FaUsers.js";
|
|
9
|
+
import { FiDownload } from "../icons/fi/FiDownload.js";
|
|
10
|
+
import { FiFile } from "../icons/fi/FiFile.js";
|
|
11
|
+
import { FiFileText } from "../icons/fi/FiFileText.js";
|
|
12
|
+
import { FiUpload } from "../icons/fi/FiUpload.js";
|
|
13
|
+
import { HiOutlineClipboardCopy } from "../icons/hi/HiOutlineClipboardCopy.js";
|
|
14
|
+
import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
|
|
15
|
+
import { LuEye } from "../icons/lu/LuEye.js";
|
|
16
|
+
import { MdRefresh } from "../icons/md/MdRefresh.js";
|
|
17
|
+
import { PiShareBold } from "../icons/pi/PiShareBold.js";
|
|
18
|
+
import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
|
|
4
19
|
import { keyedByContent } from "../components/keys.js";
|
|
5
20
|
import { TOOLTIP_ID, TooltipInfo } from "../components/Tooltip.js";
|
|
6
21
|
import { ConfirmModal } from "../components/ConfirmModal.js";
|
|
@@ -51,11 +66,15 @@ function UriCard({ value }) {
|
|
|
51
66
|
/* @__PURE__ */ jsx("span", {
|
|
52
67
|
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",
|
|
53
68
|
title: t.chrome.copyToClipboard,
|
|
54
|
-
children: /* @__PURE__ */ jsx(
|
|
69
|
+
children: /* @__PURE__ */ jsx(HiOutlineClipboardCopy, { className: "h-3.5 w-3.5" })
|
|
55
70
|
})
|
|
56
71
|
]
|
|
57
72
|
});
|
|
58
73
|
}
|
|
74
|
+
var MAX_UPLOAD_SIZE = 85899345920;
|
|
75
|
+
function isUploadSizeExceeded(size) {
|
|
76
|
+
return size > MAX_UPLOAD_SIZE;
|
|
77
|
+
}
|
|
59
78
|
function isStorageDirectory(node) {
|
|
60
79
|
return node?.type === "directory" && !!node.storageId;
|
|
61
80
|
}
|
|
@@ -68,7 +87,7 @@ function getAncestorDirPaths(path) {
|
|
|
68
87
|
const segments = (isDir ? path.slice(0, -1) : path).split("/").filter(Boolean);
|
|
69
88
|
const dirSegmentCount = isDir ? segments.length : segments.length - 1;
|
|
70
89
|
const ancestors = [];
|
|
71
|
-
for (let i = 1; i <= dirSegmentCount; i++) ancestors.push(segments.slice(0, i).join("/")
|
|
90
|
+
for (let i = 1; i <= dirSegmentCount; i++) ancestors.push(`${segments.slice(0, i).join("/")}/`);
|
|
72
91
|
return ancestors;
|
|
73
92
|
}
|
|
74
93
|
/** The tree's width is the host's when the tree is embedded on its own, and this
|
|
@@ -157,9 +176,10 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
157
176
|
setCheckedItems(/* @__PURE__ */ new Set());
|
|
158
177
|
}
|
|
159
178
|
const selectedNodeChildren = useMemo(() => selectedNode ? getNodeChildren(parentToChildrenMap, selectedNode.path) : [], [parentToChildrenMap, selectedNode]);
|
|
160
|
-
const
|
|
161
|
-
const
|
|
162
|
-
const
|
|
179
|
+
const findStorage = (storageId) => storages.find((s) => s.id === storageId);
|
|
180
|
+
const storageCanWrite = (storageId) => findStorage(storageId)?.canWrite === true;
|
|
181
|
+
const storageCanUpload = (storageId) => findStorage(storageId)?.canUpload !== false;
|
|
182
|
+
const selectedStorage = findStorage(selectedNode?.storageId);
|
|
163
183
|
const selectedNodeCanWrite = selectedStorage?.canWrite === true;
|
|
164
184
|
const selectedNodeCanUpload = selectedStorage?.canUpload !== false;
|
|
165
185
|
const selectedNodeCanShare = selectedStorage?.canShare !== false;
|
|
@@ -181,10 +201,6 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
181
201
|
useEffect(() => clearPreviewCache, []);
|
|
182
202
|
const { openMenu, contextMenu } = useRowMenu();
|
|
183
203
|
const [sidebarWidth, setSidebarWidth] = useLocalStorage(SIDEBAR_WIDTH_STORAGE_KEY, 300);
|
|
184
|
-
const MAX_UPLOAD_SIZE = 85899345920;
|
|
185
|
-
const isUploadSizeExceeded = (size) => {
|
|
186
|
-
return size > MAX_UPLOAD_SIZE;
|
|
187
|
-
};
|
|
188
204
|
const handleToggleExpand = useCallback((path) => {
|
|
189
205
|
setExpandedPaths((prev) => {
|
|
190
206
|
const next = new Set(prev);
|
|
@@ -196,10 +212,10 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
196
212
|
setExpandedPaths(/* @__PURE__ */ new Set([""]));
|
|
197
213
|
}, []);
|
|
198
214
|
const getStorageProviderAndClient = async (storageId) => {
|
|
199
|
-
const storage =
|
|
215
|
+
const storage = findStorage(storageId);
|
|
200
216
|
if (!storage) {
|
|
201
217
|
notify.error(t.messages.storageUnavailable);
|
|
202
|
-
return;
|
|
218
|
+
return null;
|
|
203
219
|
}
|
|
204
220
|
const { provider, client } = await getProviderAndClient(storage).catch(() => ({
|
|
205
221
|
provider: null,
|
|
@@ -236,7 +252,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
236
252
|
const factory = await getStorageProviderAndClient(node.storageId);
|
|
237
253
|
if (!factory) throw new Error("Failed to connect to storage provider.");
|
|
238
254
|
const { storage, provider, client } = factory;
|
|
239
|
-
if (provider
|
|
255
|
+
if (provider.listDirectoryInput && provider.convertDataToStorageObjects) {
|
|
240
256
|
const dir_path = node.root ? "" : node.relativePath ?? "";
|
|
241
257
|
const input = provider.listDirectoryInput(storage, dir_path, cursor ? { cursor } : {});
|
|
242
258
|
const objects = await client.listDirectory(input);
|
|
@@ -262,7 +278,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
262
278
|
const errorMessage = isCorsError ? error.message || "CORS error" : error instanceof Error ? error.message : "Unknown error";
|
|
263
279
|
if (owns()) {
|
|
264
280
|
setListings((prev) => recordListingError(options?.replace ? clearListingsUnder(prev, node.path) : prev, node.path, errorMessage));
|
|
265
|
-
updateConnectionIssuesMessage((prev) => new Map(prev).set(nodeStorageId, `Failed to load contents for ${node
|
|
281
|
+
updateConnectionIssuesMessage((prev) => new Map(prev).set(nodeStorageId, `Failed to load contents for ${node.displayName || node.name}: ${errorMessage}`));
|
|
266
282
|
if (isCorsError) setHasCorsIssue((prev) => new Map(prev).set(nodeStorageId, true));
|
|
267
283
|
}
|
|
268
284
|
return { corsError: isCorsError };
|
|
@@ -283,7 +299,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
283
299
|
setDetailTab("details");
|
|
284
300
|
}
|
|
285
301
|
setSelectedPath(path);
|
|
286
|
-
if (node.type === "directory" && node
|
|
302
|
+
if (node.type === "directory" && node.storageId && !isListed(listings, path)) await fetchNodeChildren(node);
|
|
287
303
|
};
|
|
288
304
|
useEffect(() => {
|
|
289
305
|
if (!normalizedSelectedPath) return;
|
|
@@ -430,18 +446,21 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
430
446
|
if (selectedNode && selectedNode.type === "directory") return true;
|
|
431
447
|
return false;
|
|
432
448
|
};
|
|
449
|
+
const getFilesToDownload = () => {
|
|
450
|
+
if (checkedItems.size > 0) return Array.from(checkedItems).map((path) => treeMap[path]).filter((node) => node?.type === "file");
|
|
451
|
+
return selectedNode?.type === "file" ? [selectedNode] : [];
|
|
452
|
+
};
|
|
433
453
|
const handleDownload = async () => {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
if (filesToDownload.length === 0) {
|
|
454
|
+
const filesToDownload = getFilesToDownload();
|
|
455
|
+
const firstFile = filesToDownload[0];
|
|
456
|
+
if (!firstFile) {
|
|
438
457
|
notify.error(t.messages.noFilesForDownload);
|
|
439
458
|
return;
|
|
440
459
|
}
|
|
441
|
-
const factory = await getStorageProviderAndClient(
|
|
460
|
+
const factory = await getStorageProviderAndClient(firstFile.storageId);
|
|
442
461
|
if (!factory) return;
|
|
443
462
|
const { provider, client } = factory;
|
|
444
|
-
if (!provider
|
|
463
|
+
if (!provider.getFileInput) {
|
|
445
464
|
notify.error(t.messages.downloadUnsupported);
|
|
446
465
|
return;
|
|
447
466
|
}
|
|
@@ -460,7 +479,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
460
479
|
const factory = await getStorageProviderAndClient(node.storageId);
|
|
461
480
|
if (!factory) return;
|
|
462
481
|
const { provider, client } = factory;
|
|
463
|
-
if (!provider
|
|
482
|
+
if (!provider.getFileInput) {
|
|
464
483
|
notify.error(t.messages.sharingUnsupported);
|
|
465
484
|
return;
|
|
466
485
|
}
|
|
@@ -489,14 +508,14 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
489
508
|
const factory = await getStorageProviderAndClient(node.storageId);
|
|
490
509
|
if (!factory) return [null, /* @__PURE__ */ new Error("Failed to connect to storage provider.")];
|
|
491
510
|
const { provider, client } = factory;
|
|
492
|
-
if (!provider
|
|
511
|
+
if (!provider.getFileInput) return [null, /* @__PURE__ */ new Error("Preview is not supported for this storage.")];
|
|
493
512
|
const input = provider.getFileInput(node.storageName ?? "", node, PREVIEW_URL_EXPIRES_IN, downloadFilename);
|
|
494
513
|
return client.getFile(input);
|
|
495
514
|
};
|
|
496
515
|
const previewSiblings = useMemo(() => previewNode ? getNodeChildren(parentToChildrenMap, getParentPath(previewNode.path)).filter((n) => n.type === "file") : [], [previewNode, parentToChildrenMap]);
|
|
497
516
|
const openPreview = (node) => {
|
|
498
517
|
if (node.type !== "file") return;
|
|
499
|
-
if (onOpenFile?.(node,
|
|
518
|
+
if (onOpenFile?.(node, findStorage(node.storageId))) return;
|
|
500
519
|
setPreviewNode(node);
|
|
501
520
|
setPreviewOpen(true);
|
|
502
521
|
};
|
|
@@ -508,7 +527,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
508
527
|
if (!expandedPaths.has(node.path)) handleToggleExpand(node.path);
|
|
509
528
|
};
|
|
510
529
|
const getNodeUris = (node) => {
|
|
511
|
-
const storage =
|
|
530
|
+
const storage = findStorage(node.storageId);
|
|
512
531
|
if (!storage || !objectUris) return [];
|
|
513
532
|
return objectUris(storage, getObjectKeyFromNode(node));
|
|
514
533
|
};
|
|
@@ -534,7 +553,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
534
553
|
triggerBrowserDownload(presignedUrl, node.name);
|
|
535
554
|
};
|
|
536
555
|
const deleteNode = (node) => {
|
|
537
|
-
if (
|
|
556
|
+
if (findStorage(node.storageId)?.canWrite !== true) {
|
|
538
557
|
notify.error(t.messages.noWriteAccess);
|
|
539
558
|
return;
|
|
540
559
|
}
|
|
@@ -551,12 +570,12 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
551
570
|
return [{
|
|
552
571
|
key: "create-folder",
|
|
553
572
|
label: t.createFolder.action,
|
|
554
|
-
icon: /* @__PURE__ */ jsx(
|
|
573
|
+
icon: /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
555
574
|
onSelect: () => openCreateFolder(node)
|
|
556
575
|
}];
|
|
557
576
|
};
|
|
558
577
|
const buildRowMenu = (node) => {
|
|
559
|
-
const storage =
|
|
578
|
+
const storage = findStorage(node.storageId);
|
|
560
579
|
const nodeCanWrite = storage?.canWrite === true;
|
|
561
580
|
const nodeCanShare = storage?.canShare !== false;
|
|
562
581
|
const isFile = node.type === "file";
|
|
@@ -565,20 +584,20 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
565
584
|
if (isFile && canPreview(node)) actions.push({
|
|
566
585
|
key: "preview",
|
|
567
586
|
label: t.preview.preview,
|
|
568
|
-
icon: /* @__PURE__ */ jsx(
|
|
587
|
+
icon: /* @__PURE__ */ jsx(LuEye, {}),
|
|
569
588
|
onSelect: () => openPreview(node)
|
|
570
589
|
});
|
|
571
590
|
if (isFile) {
|
|
572
591
|
actions.push({
|
|
573
592
|
key: "download",
|
|
574
593
|
label: t.preview.download,
|
|
575
|
-
icon: /* @__PURE__ */ jsx(
|
|
594
|
+
icon: /* @__PURE__ */ jsx(FiDownload, {}),
|
|
576
595
|
onSelect: () => downloadNode(node)
|
|
577
596
|
});
|
|
578
597
|
if (nodeCanShare) actions.push({
|
|
579
598
|
key: "share",
|
|
580
599
|
label: t.preview.shareFile,
|
|
581
|
-
icon: /* @__PURE__ */ jsx(
|
|
600
|
+
icon: /* @__PURE__ */ jsx(PiShareBold, {}),
|
|
582
601
|
onSelect: () => onShareFileButtonClick(node)
|
|
583
602
|
});
|
|
584
603
|
}
|
|
@@ -586,20 +605,20 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
586
605
|
if (nodeCanWrite && !node.root) actions.push({
|
|
587
606
|
key: "delete",
|
|
588
607
|
label: t.preview.delete,
|
|
589
|
-
icon: /* @__PURE__ */ jsx(
|
|
608
|
+
icon: /* @__PURE__ */ jsx(BiSolidTrashAlt, {}),
|
|
590
609
|
destructive: true,
|
|
591
610
|
onSelect: () => deleteNode(node)
|
|
592
611
|
});
|
|
593
612
|
const lead = [{
|
|
594
613
|
kind: "action",
|
|
595
614
|
label: isFile ? t.preview.viewDetails : t.preview.openFolder,
|
|
596
|
-
icon: isFile ? /* @__PURE__ */ jsx(
|
|
615
|
+
icon: isFile ? /* @__PURE__ */ jsx(FiFileText, {}) : /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
597
616
|
onSelect: () => handleSelectTreeItem(node.path, node)
|
|
598
617
|
}];
|
|
599
618
|
const uriExtras = uris.map((value) => ({
|
|
600
619
|
label: `${getUriScheme(value).toUpperCase()} URI`,
|
|
601
620
|
value,
|
|
602
|
-
icon: /* @__PURE__ */ jsx(
|
|
621
|
+
icon: /* @__PURE__ */ jsx(FaLink, {})
|
|
603
622
|
}));
|
|
604
623
|
return assembleRowMenu({
|
|
605
624
|
lead,
|
|
@@ -635,7 +654,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
635
654
|
const label = node.displayName || node.name;
|
|
636
655
|
return /* @__PURE__ */ jsxs("span", {
|
|
637
656
|
className: "flex min-w-0 items-center gap-1",
|
|
638
|
-
children: [i > 0 && /* @__PURE__ */ jsx(
|
|
657
|
+
children: [i > 0 && /* @__PURE__ */ jsx(LuChevronRight, { className: "h-3 w-3 shrink-0 text-(--theme-muted-text-color)" }), isLast ? /* @__PURE__ */ jsx("span", {
|
|
639
658
|
className: "truncate font-semibold text-(--theme-app)",
|
|
640
659
|
children: label
|
|
641
660
|
}) : /* @__PURE__ */ jsx("button", {
|
|
@@ -649,13 +668,10 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
649
668
|
});
|
|
650
669
|
};
|
|
651
670
|
const generateDownloadCommand = () => {
|
|
652
|
-
|
|
653
|
-
if (
|
|
654
|
-
else if (selectedNode && selectedNode.type === "file") filesToDownload = [selectedNode];
|
|
655
|
-
if (filesToDownload.length === 0) return "";
|
|
656
|
-
if (!downloadCommand) return "";
|
|
671
|
+
const filesToDownload = getFilesToDownload();
|
|
672
|
+
if (!downloadCommand || filesToDownload.length === 0) return "";
|
|
657
673
|
const objects = filesToDownload.flatMap((node) => {
|
|
658
|
-
const storage =
|
|
674
|
+
const storage = findStorage(node.storageId);
|
|
659
675
|
return storage ? [{
|
|
660
676
|
storage,
|
|
661
677
|
key: getObjectKeyFromNode(node),
|
|
@@ -697,16 +713,17 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
697
713
|
}
|
|
698
714
|
};
|
|
699
715
|
const handleDelete = async () => {
|
|
700
|
-
|
|
716
|
+
const firstPending = pendingDelete?.[0];
|
|
717
|
+
if (!pendingDelete || !firstPending) {
|
|
701
718
|
notify.error(t.messages.noItemsForDeletion);
|
|
702
719
|
return;
|
|
703
720
|
}
|
|
704
|
-
const parentPath = getParentPath(
|
|
721
|
+
const parentPath = getParentPath(firstPending.path);
|
|
705
722
|
const parentNode = treeMap[parentPath];
|
|
706
|
-
const factory = await getStorageProviderAndClient(
|
|
723
|
+
const factory = await getStorageProviderAndClient(firstPending.storageId);
|
|
707
724
|
if (!factory) return;
|
|
708
725
|
const { storage, provider, client } = factory;
|
|
709
|
-
if (!provider
|
|
726
|
+
if (!provider.deleteFilesInput) {
|
|
710
727
|
notify.error(t.messages.deleteUnsupported);
|
|
711
728
|
return;
|
|
712
729
|
}
|
|
@@ -747,7 +764,6 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
747
764
|
notify.warning(t.messages.waitForCurrentUpload);
|
|
748
765
|
return;
|
|
749
766
|
}
|
|
750
|
-
setWaitForUpload(true);
|
|
751
767
|
const uploadNodes = Array.from(files).map((file) => ({
|
|
752
768
|
name: file.name,
|
|
753
769
|
file,
|
|
@@ -760,7 +776,6 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
760
776
|
totalSize
|
|
761
777
|
});
|
|
762
778
|
setUploadModalOpen(true);
|
|
763
|
-
setWaitForUpload(false);
|
|
764
779
|
if (fileInputRef.current) fileInputRef.current.value = "";
|
|
765
780
|
if (folderInputRef.current) folderInputRef.current.value = "";
|
|
766
781
|
};
|
|
@@ -774,7 +789,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
774
789
|
return;
|
|
775
790
|
}
|
|
776
791
|
const targetNode = treeMap[pendingUpload.targetPath];
|
|
777
|
-
if (!targetNode
|
|
792
|
+
if (!targetNode?.storageId) {
|
|
778
793
|
notify.error(t.messages.invalidUploadTarget);
|
|
779
794
|
return;
|
|
780
795
|
}
|
|
@@ -786,7 +801,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
786
801
|
const { storage, provider, client } = factory;
|
|
787
802
|
const storageName = storage.bucketName || storage.name;
|
|
788
803
|
const cleanTargetPath = targetNode.root ? "" : removeLeadingAndTrailingSlashes(targetNode.relativePath || "");
|
|
789
|
-
if (!provider
|
|
804
|
+
if (!provider.uploadFileInput) {
|
|
790
805
|
notify.error(t.messages.uploadUnsupported);
|
|
791
806
|
return;
|
|
792
807
|
}
|
|
@@ -813,7 +828,6 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
813
828
|
}
|
|
814
829
|
setUploadModalOpen(false);
|
|
815
830
|
setPendingUpload(null);
|
|
816
|
-
setWaitForUpload(false);
|
|
817
831
|
};
|
|
818
832
|
const validateFolderName = (name) => {
|
|
819
833
|
if (createFolderTarget?.type !== "directory") return null;
|
|
@@ -861,6 +875,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
861
875
|
if (onRefresh) onRefresh();
|
|
862
876
|
return { corsError: false };
|
|
863
877
|
};
|
|
878
|
+
const downloadCommandText = generateDownloadCommand();
|
|
864
879
|
return /* @__PURE__ */ jsxs("div", {
|
|
865
880
|
className: "w-full h-full flex relative",
|
|
866
881
|
children: [
|
|
@@ -884,7 +899,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
884
899
|
"data-tooltip-class-name": "z-50",
|
|
885
900
|
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)",
|
|
886
901
|
onClick: () => handleRefresh(),
|
|
887
|
-
children: /* @__PURE__ */ jsx(
|
|
902
|
+
children: /* @__PURE__ */ jsx(MdRefresh, { className: "h-3.5 w-3.5" })
|
|
888
903
|
}), /* @__PURE__ */ jsx("button", {
|
|
889
904
|
type: "button",
|
|
890
905
|
"aria-label": t.chrome.collapse,
|
|
@@ -893,7 +908,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
893
908
|
"data-tooltip-class-name": "z-50",
|
|
894
909
|
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)",
|
|
895
910
|
onClick: collapseAll,
|
|
896
|
-
children: /* @__PURE__ */ jsx(
|
|
911
|
+
children: /* @__PURE__ */ jsx(BsArrowsCollapse, { className: "h-3.5 w-3.5" })
|
|
897
912
|
})]
|
|
898
913
|
})
|
|
899
914
|
}), /* @__PURE__ */ jsx(TreeView, {
|
|
@@ -955,7 +970,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
955
970
|
getItems: () => [{
|
|
956
971
|
kind: "action",
|
|
957
972
|
label: t.preview.open,
|
|
958
|
-
icon: /* @__PURE__ */ jsx(
|
|
973
|
+
icon: /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
959
974
|
onSelect: () => openUserNode(rootNode)
|
|
960
975
|
}],
|
|
961
976
|
openMenu,
|
|
@@ -1012,7 +1027,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1012
1027
|
className: "btn btn-info cursor-pointer flex items-center justify-center",
|
|
1013
1028
|
disabled: selectedNode.type === "file" || !selectedNode.storageId,
|
|
1014
1029
|
onClick: () => setCreateFolderTarget(selectedNode),
|
|
1015
|
-
children: [/* @__PURE__ */ jsx(
|
|
1030
|
+
children: [/* @__PURE__ */ jsx(FaRegFolder, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ jsx("span", {
|
|
1016
1031
|
className: "hidden md:inline",
|
|
1017
1032
|
children: t.createFolder.action
|
|
1018
1033
|
})]
|
|
@@ -1021,10 +1036,10 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1021
1036
|
"aria-label": t.chrome.upload,
|
|
1022
1037
|
className: "btn btn-info cursor-pointer flex items-center justify-between pr-0.5!",
|
|
1023
1038
|
disabled: selectedNode.type === "file" || !selectedNode.storageId,
|
|
1024
|
-
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(
|
|
1039
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(FiUpload, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ jsx("span", {
|
|
1025
1040
|
className: "hidden md:inline",
|
|
1026
1041
|
children: t.chrome.upload
|
|
1027
|
-
})] }), /* @__PURE__ */ jsx(
|
|
1042
|
+
})] }), /* @__PURE__ */ jsx(FaAngleDown, { className: "h-4 w-4 ml-2" })]
|
|
1028
1043
|
}), /* @__PURE__ */ jsxs(MenuItems, {
|
|
1029
1044
|
transition: true,
|
|
1030
1045
|
anchor: "bottom end",
|
|
@@ -1045,10 +1060,10 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1045
1060
|
"aria-label": t.chrome.download,
|
|
1046
1061
|
className: "btn btn-info cursor-pointer flex items-center justify-between pr-0.5!",
|
|
1047
1062
|
disabled: checkedItems.size === 0 && selectedNode.type !== "file" || hasFolderSelected() || !selectedNode.storageId,
|
|
1048
|
-
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(
|
|
1063
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(FiDownload, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ jsx("span", {
|
|
1049
1064
|
className: "hidden md:inline",
|
|
1050
1065
|
children: t.chrome.download
|
|
1051
|
-
})] }), /* @__PURE__ */ jsx(
|
|
1066
|
+
})] }), /* @__PURE__ */ jsx(FaAngleDown, { className: "h-4 w-4 ml-2" })]
|
|
1052
1067
|
}), /* @__PURE__ */ jsxs(MenuItems, {
|
|
1053
1068
|
transition: true,
|
|
1054
1069
|
anchor: "bottom end",
|
|
@@ -1058,22 +1073,19 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1058
1073
|
className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
|
|
1059
1074
|
onClick: handleDownload,
|
|
1060
1075
|
children: t.chrome.downloadFromBrowser
|
|
1061
|
-
}) }), downloadCommand &&
|
|
1076
|
+
}) }), downloadCommand && downloadCommandText && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MenuSeparator, { className: "my-0.5 h-px theme-border" }), /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
1062
1077
|
className: "text-sm w-full text-center pointer-events-none px-2 py-1.5",
|
|
1063
1078
|
children: downloadCommand.label
|
|
1064
|
-
}), (
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
1069
|
-
className: "
|
|
1070
|
-
children:
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
})
|
|
1075
|
-
});
|
|
1076
|
-
})()] }) })] })]
|
|
1079
|
+
}), /* @__PURE__ */ jsx(CopyCodeBlock, {
|
|
1080
|
+
textToCopy: downloadCommandText,
|
|
1081
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1082
|
+
className: "overflow-x-auto text-xs",
|
|
1083
|
+
children: keyedByContent(downloadCommandText.split("\n"), (l) => l).map(({ key, item: line }) => /* @__PURE__ */ jsx("div", {
|
|
1084
|
+
className: "whitespace-nowrap",
|
|
1085
|
+
children: line
|
|
1086
|
+
}, key))
|
|
1087
|
+
})
|
|
1088
|
+
})] }) })] })]
|
|
1077
1089
|
})] }),
|
|
1078
1090
|
/* @__PURE__ */ jsxs("button", {
|
|
1079
1091
|
type: "button",
|
|
@@ -1081,8 +1093,8 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1081
1093
|
className: "btn btn-info cursor-pointer flex items-center justify-center",
|
|
1082
1094
|
disabled: !selectedNode.storageId,
|
|
1083
1095
|
onClick: () => setAccessDrawerOpen(true),
|
|
1084
|
-
hidden:
|
|
1085
|
-
children: [/* @__PURE__ */ jsx(
|
|
1096
|
+
hidden: groups.length === 0 || !selectedNodeCanManageAccess,
|
|
1097
|
+
children: [/* @__PURE__ */ jsx(FaUsers, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ jsx("span", {
|
|
1086
1098
|
className: "hidden md:inline",
|
|
1087
1099
|
children: t.chrome.manageAccess
|
|
1088
1100
|
})]
|
|
@@ -1093,7 +1105,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1093
1105
|
className: "btn btn-destructive cursor-pointer flex items-center justify-center",
|
|
1094
1106
|
disabled: checkedItems.size === 0 && selectedNode.type !== "file" || !selectedNode.storageId,
|
|
1095
1107
|
onClick: onDeleteClick,
|
|
1096
|
-
children: [/* @__PURE__ */ jsx(
|
|
1108
|
+
children: [/* @__PURE__ */ jsx(BiSolidTrashAlt, { className: "h-4 w-4 mr-2" }), /* @__PURE__ */ jsx("span", {
|
|
1097
1109
|
className: "hidden md:inline",
|
|
1098
1110
|
children: t.chrome.delete
|
|
1099
1111
|
})]
|
|
@@ -1129,7 +1141,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1129
1141
|
onSelectAll: handleBatchCheckbox
|
|
1130
1142
|
})
|
|
1131
1143
|
}), /* @__PURE__ */ jsx(NoDataAvailablePreview, {
|
|
1132
|
-
selectedStorage:
|
|
1144
|
+
selectedStorage: selectedStorage ?? null,
|
|
1133
1145
|
canWrite: selectedNodeCanWrite,
|
|
1134
1146
|
onRefresh: handleRefresh,
|
|
1135
1147
|
error: hasCorsIssue.get(selectedNode.storageId ?? "") ? new CorsError(connectionIssuesMessage.get(selectedNode.storageId ?? "") || "") : null,
|
|
@@ -1139,7 +1151,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1139
1151
|
}),
|
|
1140
1152
|
selectedNode.type === "file" && (() => {
|
|
1141
1153
|
const uris = getNodeUris(selectedNode);
|
|
1142
|
-
const fileIcon = getNodeIcon(selectedNode, slots.storageIconUrl, t.chrome.storageIconAlt) ?? /* @__PURE__ */ jsx(
|
|
1154
|
+
const fileIcon = getNodeIcon(selectedNode, slots.storageIconUrl, t.chrome.storageIconAlt) ?? /* @__PURE__ */ jsx(FiFile, { className: "h-5 w-5 theme-muted-text" });
|
|
1143
1155
|
const modifiedDt = selectedNode.modified ? DateTime.fromISO(selectedNode.modified) : null;
|
|
1144
1156
|
const createdDt = selectedNode.created ? DateTime.fromISO(selectedNode.created) : null;
|
|
1145
1157
|
const previewable = canPreview(selectedNode);
|
|
@@ -1162,7 +1174,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1162
1174
|
})]
|
|
1163
1175
|
}), effectiveTab === "preview" && previewable ? /* @__PURE__ */ jsx(FilePreviewInline, {
|
|
1164
1176
|
node: selectedNode,
|
|
1165
|
-
storage:
|
|
1177
|
+
storage: selectedStorage ?? null,
|
|
1166
1178
|
getPresignedUrl,
|
|
1167
1179
|
onOpenFull: openPreview,
|
|
1168
1180
|
onDownload: downloadNode,
|
|
@@ -1289,7 +1301,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1289
1301
|
open: previewOpen,
|
|
1290
1302
|
node: previewNode,
|
|
1291
1303
|
siblings: previewSiblings,
|
|
1292
|
-
storage:
|
|
1304
|
+
storage: findStorage(previewNode?.storageId) ?? null,
|
|
1293
1305
|
getPresignedUrl,
|
|
1294
1306
|
onNavigate: setPreviewNode,
|
|
1295
1307
|
onClose: closePreview,
|
|
@@ -1299,7 +1311,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1299
1311
|
/* @__PURE__ */ jsx(CreateModal, {
|
|
1300
1312
|
open: !!createFolderTarget,
|
|
1301
1313
|
onClose: () => setCreateFolderTarget(null),
|
|
1302
|
-
typeIcon: /* @__PURE__ */ jsx(
|
|
1314
|
+
typeIcon: /* @__PURE__ */ jsx(FaRegFolder, { className: "w-3 h-3" }),
|
|
1303
1315
|
typeLabel: t.createFolder.folder,
|
|
1304
1316
|
namePlaceholder: t.createFolder.namePlaceholder,
|
|
1305
1317
|
submitLabel: t.createFolder.submit,
|
|
@@ -1356,7 +1368,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1356
1368
|
className: "mt-3 p-3 bg-amber-50 border border-amber-200 rounded-lg",
|
|
1357
1369
|
children: /* @__PURE__ */ jsxs("div", {
|
|
1358
1370
|
className: "flex items-start gap-2",
|
|
1359
|
-
children: [/* @__PURE__ */ jsx(
|
|
1371
|
+
children: [/* @__PURE__ */ jsx(TbAlertTriangle, { className: "w-4 h-4 text-amber-600 shrink-0 mt-0.5" }), /* @__PURE__ */ jsxs("div", {
|
|
1360
1372
|
className: "text-amber-800",
|
|
1361
1373
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1362
1374
|
className: "font-semibold mb-1",
|
|
@@ -1396,7 +1408,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1396
1408
|
open: accessDrawerOpen,
|
|
1397
1409
|
setOpen: setAccessDrawerOpen,
|
|
1398
1410
|
groups,
|
|
1399
|
-
storage:
|
|
1411
|
+
storage: selectedStorage
|
|
1400
1412
|
})
|
|
1401
1413
|
]
|
|
1402
1414
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IFileExplorerClient, IFileExplorerProvider } from './lib/fileExplorer.js';
|
|
2
|
-
import type { TreeNode,
|
|
2
|
+
import type { TreeNode, UploadNode, UploadSession } from './lib/types.js';
|
|
3
3
|
interface IFileExplorerContextValue {
|
|
4
4
|
uploadSessionMap: Map<string, UploadSession>;
|
|
5
5
|
uploadQueue: string[];
|
|
@@ -7,7 +7,6 @@ interface IFileExplorerContextValue {
|
|
|
7
7
|
getUploadSessionById: (sessionId: string) => UploadSession | undefined;
|
|
8
8
|
getUploadQueueIndex: (sessionId: string) => number;
|
|
9
9
|
startUploadSession: (sessionId: string) => Promise<void>;
|
|
10
|
-
updateFileUploadProgress?: (sessionId: string, fileKey: string, progress: UploadFileProgress) => void;
|
|
11
10
|
}
|
|
12
11
|
interface IFileExplorerProviderProps {
|
|
13
12
|
children: React.ReactNode;
|