@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,6 @@
|
|
|
1
1
|
import { useNotify, useStrings } from "../components/Provider.js";
|
|
2
2
|
import { keyedByContent } from "../components/keys.js";
|
|
3
|
-
import { getUploadSessionETA, removeLeadingSlash } from "./lib/utils.js";
|
|
3
|
+
import { calculateUploadNodesTotalSize, getUploadSessionETA, removeLeadingSlash } from "./lib/utils.js";
|
|
4
4
|
import { UploadSessionToast } from "./toasts.js";
|
|
5
5
|
import { createContext, use, useRef } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -21,37 +21,26 @@ function FileExplorerProvider({ children }) {
|
|
|
21
21
|
const uploadQueueRef = useRef([]);
|
|
22
22
|
const isProcessingRef = useRef(false);
|
|
23
23
|
const uploadSessionIdCounter = useRef(0);
|
|
24
|
-
const uploadSessionIdPrefix = "upload-session";
|
|
25
24
|
const generateUploadSessionId = () => {
|
|
26
|
-
return
|
|
25
|
+
return `upload-session-${Date.now()}-${uploadSessionIdCounter.current++}`;
|
|
27
26
|
};
|
|
28
27
|
const calculateWeightedProgress = (session) => {
|
|
29
28
|
if (!session.progress?.allFiles || session.progress.allFiles.size === 0) return 0;
|
|
30
29
|
let totalWeightedProgress = 0;
|
|
31
30
|
let totalWeight = 0;
|
|
32
31
|
session.progress.allFiles.forEach((fileProgress) => {
|
|
33
|
-
const fileSize = fileProgress.fileSizeBytes
|
|
34
|
-
|
|
35
|
-
totalWeightedProgress += filePercentage / 100 * fileSize;
|
|
32
|
+
const fileSize = fileProgress.fileSizeBytes;
|
|
33
|
+
totalWeightedProgress += (fileProgress.percentage ?? 0) / 100 * fileSize;
|
|
36
34
|
totalWeight += fileSize;
|
|
37
35
|
});
|
|
38
36
|
return totalWeight > 0 ? totalWeightedProgress / totalWeight * 100 : 0;
|
|
39
37
|
};
|
|
40
|
-
const
|
|
41
|
-
if (!session.progress?.allFiles) return {
|
|
42
|
-
loaded: 0,
|
|
43
|
-
total: session.progress?.totalSizeBytes || 0
|
|
44
|
-
};
|
|
38
|
+
const sumLoadedBytes = (session) => {
|
|
45
39
|
let totalLoaded = 0;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
totalLoaded += fileProgress.loadedBytes || 0;
|
|
49
|
-
totalSize += fileProgress.fileSizeBytes || 0;
|
|
40
|
+
session.progress?.allFiles?.forEach((fileProgress) => {
|
|
41
|
+
totalLoaded += fileProgress.loadedBytes ?? 0;
|
|
50
42
|
});
|
|
51
|
-
return
|
|
52
|
-
loaded: totalLoaded,
|
|
53
|
-
total: totalSize
|
|
54
|
-
};
|
|
43
|
+
return totalLoaded;
|
|
55
44
|
};
|
|
56
45
|
const updateFileProgressInUploadSession = (session, relativePath, updates) => {
|
|
57
46
|
if (!session.progress?.allFiles) return;
|
|
@@ -77,10 +66,10 @@ function FileExplorerProvider({ children }) {
|
|
|
77
66
|
progress: {
|
|
78
67
|
completedFiles: 0,
|
|
79
68
|
totalFiles: uploadNodes.length,
|
|
80
|
-
totalSizeBytes: uploadNodes
|
|
69
|
+
totalSizeBytes: calculateUploadNodesTotalSize(uploadNodes),
|
|
81
70
|
allFiles: new Map(uploadNodes.map((file) => [file.relativePath, {
|
|
82
71
|
fileKey: file.relativePath,
|
|
83
|
-
fileSizeBytes: file.file
|
|
72
|
+
fileSizeBytes: file.file.size,
|
|
84
73
|
abortController: new AbortController(),
|
|
85
74
|
status: "pending",
|
|
86
75
|
percentage: 0
|
|
@@ -154,109 +143,90 @@ function FileExplorerProvider({ children }) {
|
|
|
154
143
|
}
|
|
155
144
|
session.status = "uploading";
|
|
156
145
|
isProcessingRef.current = true;
|
|
146
|
+
const progressToast = (shown = session) => /* @__PURE__ */ jsx(UploadSessionToast, {
|
|
147
|
+
session: shown,
|
|
148
|
+
queueLength: uploadQueueRef.current.length,
|
|
149
|
+
onCancel: () => handleSessionCancel(session),
|
|
150
|
+
onCancelFile: (path) => cancelFileInSession(sessionId, path)
|
|
151
|
+
});
|
|
157
152
|
try {
|
|
158
153
|
notify.update(sessionId, {
|
|
159
|
-
render:
|
|
160
|
-
session,
|
|
161
|
-
queueLength: uploadQueueRef.current.length,
|
|
162
|
-
onCancel: () => handleSessionCancel(session),
|
|
163
|
-
onCancelFile: (path) => cancelFileInSession(sessionId, path)
|
|
164
|
-
}),
|
|
154
|
+
render: progressToast(),
|
|
165
155
|
icon: false,
|
|
166
156
|
isLoading: false,
|
|
167
157
|
closeButton: false,
|
|
168
158
|
autoClose: false
|
|
169
159
|
});
|
|
170
160
|
const results = await Promise.allSettled(session.uploadNodes.map(async (node) => {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
161
|
+
const fileProgress = session.progress?.allFiles?.get(node.relativePath);
|
|
162
|
+
if (!fileProgress) return;
|
|
163
|
+
if (fileProgress.status === "cancelled") throw new Error("Upload cancelled by user");
|
|
164
|
+
updateFileProgressInUploadSession(session, node.relativePath, {
|
|
165
|
+
status: "uploading",
|
|
166
|
+
loadedBytes: 0,
|
|
167
|
+
totalBytes: node.file.size,
|
|
168
|
+
percentage: 0
|
|
169
|
+
});
|
|
170
|
+
const objectPath = session.targetPath ? `${session.targetPath}/${removeLeadingSlash(node.relativePath)}` : removeLeadingSlash(node.relativePath);
|
|
171
|
+
const uploadFileInput = session.provider.uploadFileInput;
|
|
172
|
+
if (!uploadFileInput) {
|
|
173
|
+
updateFileProgressInUploadSession(session, node.relativePath, { status: "failed" });
|
|
174
|
+
throw new Error("Upload is not supported for this storage provider");
|
|
175
|
+
}
|
|
176
|
+
const input = uploadFileInput(session.storageName, objectPath, node.file);
|
|
177
|
+
const onProgress = (progress) => {
|
|
178
|
+
if (session.status === "cancelled" || !session.progress?.allFiles) return;
|
|
179
|
+
const currentFileProgress = session.progress.allFiles.get(node.relativePath);
|
|
180
|
+
if (!currentFileProgress || [
|
|
181
|
+
"failed",
|
|
182
|
+
"cancelled",
|
|
183
|
+
"completed"
|
|
184
|
+
].includes(currentFileProgress.status ?? "")) return;
|
|
178
185
|
updateFileProgressInUploadSession(session, node.relativePath, {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
percentage:
|
|
186
|
+
loadedBytes: progress.loadedBytes,
|
|
187
|
+
totalBytes: progress.totalBytes,
|
|
188
|
+
percentage: progress.percentage,
|
|
189
|
+
status: progress.percentage === 100 ? "completed" : "uploading"
|
|
190
|
+
});
|
|
191
|
+
if (progress.percentage === 100) session.progress.completedFiles += 1;
|
|
192
|
+
const totalLoadedBytes = sumLoadedBytes(session);
|
|
193
|
+
session.progress.overallProgress = calculateWeightedProgress(session);
|
|
194
|
+
session.progress.totalLoadedBytes = totalLoadedBytes;
|
|
195
|
+
const { estimatedSecondsLeft, lastProgressTime, lastProgressBytes, shouldUpdateETA } = getUploadSessionETA(totalLoadedBytes, session.progress.totalSizeBytes, session.progress.lastProgressTime, session.progress.lastProgressBytes);
|
|
196
|
+
session.progress.lastProgressTime = lastProgressTime;
|
|
197
|
+
session.progress.lastProgressBytes = lastProgressBytes;
|
|
198
|
+
if (shouldUpdateETA) session.progress.estimatedSecondsLeft = estimatedSecondsLeft;
|
|
199
|
+
notify.update(sessionId, {
|
|
200
|
+
render: progressToast(),
|
|
201
|
+
icon: false,
|
|
202
|
+
isLoading: false,
|
|
203
|
+
closeButton: false,
|
|
204
|
+
autoClose: false
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
try {
|
|
208
|
+
await session.client.uploadFile(input, onProgress, fileProgress.abortController);
|
|
209
|
+
updateFileProgressInUploadSession(session, node.relativePath, { status: "completed" });
|
|
210
|
+
} catch (error) {
|
|
211
|
+
const errorMessage = error instanceof Error ? error.message : String(error ?? "");
|
|
212
|
+
const isCancelled = errorMessage.toLowerCase().includes("abort") || errorMessage.toLowerCase().includes("cancel");
|
|
213
|
+
updateFileProgressInUploadSession(session, node.relativePath, { status: isCancelled ? "cancelled" : "failed" });
|
|
214
|
+
notify.update(sessionId, {
|
|
215
|
+
render: progressToast({
|
|
216
|
+
...session,
|
|
217
|
+
progress: {
|
|
218
|
+
completedFiles: 0,
|
|
219
|
+
totalFiles: 0,
|
|
220
|
+
totalSizeBytes: 0,
|
|
221
|
+
...session.progress
|
|
222
|
+
}
|
|
223
|
+
}),
|
|
224
|
+
icon: false,
|
|
225
|
+
isLoading: false,
|
|
226
|
+
closeButton: session.status === "failed" || session.status === "cancelled",
|
|
227
|
+
autoClose: false
|
|
183
228
|
});
|
|
184
|
-
|
|
185
|
-
const uploadFileInput = session.provider.uploadFileInput;
|
|
186
|
-
if (!uploadFileInput) return {
|
|
187
|
-
reason: "Upload is not supported for this storage provider",
|
|
188
|
-
status: "rejected"
|
|
189
|
-
};
|
|
190
|
-
const input = uploadFileInput(session.storageName, objectPath, node.file);
|
|
191
|
-
const onProgress = (progress) => {
|
|
192
|
-
if (session.status === "cancelled") return;
|
|
193
|
-
if (session.progress?.allFiles) {
|
|
194
|
-
const currentFileProgress = session.progress.allFiles.get(node.relativePath);
|
|
195
|
-
if (!currentFileProgress) return;
|
|
196
|
-
if ([
|
|
197
|
-
"failed",
|
|
198
|
-
"cancelled",
|
|
199
|
-
"complete"
|
|
200
|
-
].includes(currentFileProgress.status ?? "")) return;
|
|
201
|
-
const wasCompleted = currentFileProgress.percentage === 100;
|
|
202
|
-
updateFileProgressInUploadSession(session, node.relativePath, {
|
|
203
|
-
loadedBytes: progress.loadedBytes,
|
|
204
|
-
totalBytes: progress.totalBytes,
|
|
205
|
-
percentage: progress.percentage,
|
|
206
|
-
status: progress.percentage === 100 ? "completed" : "uploading"
|
|
207
|
-
});
|
|
208
|
-
if (progress.percentage === 100 && !wasCompleted) session.progress.completedFiles += 1;
|
|
209
|
-
const overallProgress = calculateWeightedProgress(session);
|
|
210
|
-
const { loaded: totalLoadedBytes } = calculateOverallLoadedBytes(session);
|
|
211
|
-
session.progress.overallProgress = overallProgress;
|
|
212
|
-
session.progress.totalLoadedBytes = totalLoadedBytes;
|
|
213
|
-
const { estimatedSecondsLeft, lastProgressTime, lastProgressBytes, shouldUpdateETA } = getUploadSessionETA(totalLoadedBytes, session.progress.totalSizeBytes, session.progress.lastProgressTime, session.progress.lastProgressBytes);
|
|
214
|
-
session.progress.lastProgressTime = lastProgressTime;
|
|
215
|
-
session.progress.lastProgressBytes = lastProgressBytes;
|
|
216
|
-
if (shouldUpdateETA) session.progress.estimatedSecondsLeft = estimatedSecondsLeft;
|
|
217
|
-
notify.update(sessionId, {
|
|
218
|
-
render: /* @__PURE__ */ jsx(UploadSessionToast, {
|
|
219
|
-
session,
|
|
220
|
-
queueLength: uploadQueueRef.current.length,
|
|
221
|
-
onCancel: () => handleSessionCancel(session),
|
|
222
|
-
onCancelFile: (path) => cancelFileInSession(sessionId, path)
|
|
223
|
-
}),
|
|
224
|
-
icon: false,
|
|
225
|
-
isLoading: false,
|
|
226
|
-
closeButton: false,
|
|
227
|
-
autoClose: false
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
try {
|
|
232
|
-
await session.client.uploadFile(input, onProgress, fileProgress.abortController);
|
|
233
|
-
updateFileProgressInUploadSession(session, node.relativePath, { status: "completed" });
|
|
234
|
-
} catch (error) {
|
|
235
|
-
const errorMessage = error instanceof Error ? error.message : String(error ?? "");
|
|
236
|
-
const isCancelled = errorMessage.toLowerCase().includes("abort") || errorMessage.toLowerCase().includes("cancel");
|
|
237
|
-
updateFileProgressInUploadSession(session, node.relativePath, { status: isCancelled ? "cancelled" : "failed" });
|
|
238
|
-
notify.update(sessionId, {
|
|
239
|
-
render: /* @__PURE__ */ jsx(UploadSessionToast, {
|
|
240
|
-
session: {
|
|
241
|
-
...session,
|
|
242
|
-
progress: {
|
|
243
|
-
completedFiles: 0,
|
|
244
|
-
totalFiles: 0,
|
|
245
|
-
totalSizeBytes: 0,
|
|
246
|
-
...session.progress
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
queueLength: uploadQueueRef.current.length,
|
|
250
|
-
onCancel: () => handleSessionCancel(session),
|
|
251
|
-
onCancelFile: (path) => cancelFileInSession(sessionId, path)
|
|
252
|
-
}),
|
|
253
|
-
icon: false,
|
|
254
|
-
isLoading: false,
|
|
255
|
-
closeButton: session.status === "failed" || session.status === "cancelled",
|
|
256
|
-
autoClose: false
|
|
257
|
-
});
|
|
258
|
-
throw error;
|
|
259
|
-
}
|
|
229
|
+
throw error;
|
|
260
230
|
}
|
|
261
231
|
}));
|
|
262
232
|
try {
|
|
@@ -266,19 +236,16 @@ function FileExplorerProvider({ children }) {
|
|
|
266
236
|
}
|
|
267
237
|
const failedResults = results.filter((r) => r.status === "rejected");
|
|
268
238
|
const actualFailedResults = failedResults.filter((result) => {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
return !reason.toLowerCase().includes("abort") && !reason.toLowerCase().includes("cancel");
|
|
272
|
-
}
|
|
273
|
-
return false;
|
|
239
|
+
const reason = result.reason?.message || result.reason?.toString() || "";
|
|
240
|
+
return !reason.toLowerCase().includes("abort") && !reason.toLowerCase().includes("cancel");
|
|
274
241
|
});
|
|
275
|
-
const abortedCount = failedResults
|
|
242
|
+
const abortedCount = failedResults.length - actualFailedResults.length;
|
|
276
243
|
const failedFileNames = actualFailedResults.map((result) => {
|
|
277
|
-
const originalIndex = results.
|
|
244
|
+
const originalIndex = results.indexOf(result);
|
|
278
245
|
return session.uploadNodes[originalIndex]?.name || `File #${originalIndex + 1}`;
|
|
279
|
-
})
|
|
280
|
-
const successfulCount = results
|
|
281
|
-
if (actualFailedResults
|
|
246
|
+
});
|
|
247
|
+
const successfulCount = results.length - failedResults.length;
|
|
248
|
+
if (actualFailedResults.length > 0) notify.update(sessionId, {
|
|
282
249
|
render: /* @__PURE__ */ jsxs("div", {
|
|
283
250
|
className: "text-md",
|
|
284
251
|
children: [
|
|
@@ -344,8 +311,8 @@ function FileExplorerProvider({ children }) {
|
|
|
344
311
|
}
|
|
345
312
|
};
|
|
346
313
|
const processNextUploadSessionInQueue = async () => {
|
|
347
|
-
if (isProcessingRef.current || uploadQueueRef.current.length === 0) return;
|
|
348
314
|
const nextSessionId = uploadQueueRef.current[0];
|
|
315
|
+
if (isProcessingRef.current || nextSessionId === void 0) return;
|
|
349
316
|
await startUploadSession(nextSessionId);
|
|
350
317
|
};
|
|
351
318
|
const contextValue = {
|
|
@@ -7,7 +7,6 @@ interface FilePreviewInlineProps {
|
|
|
7
7
|
onDownload: (node: TreeNode) => void;
|
|
8
8
|
/** When false, skip fetching and release any held preview blob. */
|
|
9
9
|
active?: boolean;
|
|
10
|
-
showSecurityIndicator?: boolean;
|
|
11
10
|
}
|
|
12
|
-
export declare function FilePreviewInline({ node, storage, getPresignedUrl, onOpenFull, onDownload, active,
|
|
11
|
+
export declare function FilePreviewInline({ node, storage, getPresignedUrl, onOpenFull, onDownload, active, }: FilePreviewInlineProps): import("react").JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useStrings } from "../../components/Provider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { FaExpand } from "../../icons/fa/FaExpand.js";
|
|
3
3
|
import { formatFileSize } from "../lib/utils.js";
|
|
4
4
|
import { getPreviewKind } from "./previewType.js";
|
|
5
5
|
import { StreamedBadge } from "./StreamedBadge.js";
|
|
@@ -7,7 +7,7 @@ import { usePresignedUrl } from "./usePresignedUrl.js";
|
|
|
7
7
|
import { FilePreviewViewer } from "./Viewer.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/file-explorer/FilePreview/Inline.tsx
|
|
10
|
-
function FilePreviewInline({ node, storage, getPresignedUrl, onOpenFull, onDownload, active = true
|
|
10
|
+
function FilePreviewInline({ node, storage, getPresignedUrl, onOpenFull, onDownload, active = true }) {
|
|
11
11
|
const t = useStrings().fileExplorer;
|
|
12
12
|
const { url, loading, error } = usePresignedUrl(node, getPresignedUrl, {
|
|
13
13
|
enabled: active,
|
|
@@ -31,12 +31,12 @@ function FilePreviewInline({ node, storage, getPresignedUrl, onOpenFull, onDownl
|
|
|
31
31
|
className: "flex shrink-0 items-center justify-between gap-3 border-t theme-border px-4 py-2.5",
|
|
32
32
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
33
33
|
className: "flex items-center gap-2 text-xs theme-muted-text",
|
|
34
|
-
children: [/* @__PURE__ */ jsxs("span", { children: [typeof node.size === "number" && formatFileSize(node.size), node.contentType && ` · ${node.contentType}`] }),
|
|
34
|
+
children: [/* @__PURE__ */ jsxs("span", { children: [typeof node.size === "number" && formatFileSize(node.size), node.contentType && ` · ${node.contentType}`] }), url && /* @__PURE__ */ jsx(StreamedBadge, {})]
|
|
35
35
|
}), /* @__PURE__ */ jsxs("button", {
|
|
36
36
|
type: "button",
|
|
37
37
|
className: "btn btn-neutral cursor-pointer",
|
|
38
38
|
onClick: () => onOpenFull(node),
|
|
39
|
-
children: [/* @__PURE__ */ jsx(
|
|
39
|
+
children: [/* @__PURE__ */ jsx(FaExpand, { className: "mr-2 h-4 w-4" }), t.preview.openFullPreview]
|
|
40
40
|
})]
|
|
41
41
|
})]
|
|
42
42
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useStrings } from "../../components/Provider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { FaLock } from "../../icons/fa/FaLock.js";
|
|
3
3
|
import { TOOLTIP_ID } from "../../components/Tooltip.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/file-explorer/FilePreview/StreamedBadge.tsx
|
|
@@ -9,7 +9,7 @@ function StreamedBadge() {
|
|
|
9
9
|
className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-green-500/40 bg-green-500/15 px-2 py-0.5 text-[11px] text-green-600",
|
|
10
10
|
"data-tooltip-id": TOOLTIP_ID,
|
|
11
11
|
"data-tooltip-content": t.preview.streamedTooltip,
|
|
12
|
-
children: [/* @__PURE__ */ jsx(
|
|
12
|
+
children: [/* @__PURE__ */ jsx(FaLock, { className: "h-2.5 w-2.5" }), t.preview.streamed]
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { useStrings } from "../../components/Provider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { BsFileEarmarkZip } from "../../icons/bs/BsFileEarmarkZip.js";
|
|
3
|
+
import { BsMusicNoteBeamed } from "../../icons/bs/BsMusicNoteBeamed.js";
|
|
4
|
+
import { FaLock } from "../../icons/fa/FaLock.js";
|
|
5
|
+
import { FiDownload } from "../../icons/fi/FiDownload.js";
|
|
6
|
+
import { FiFile } from "../../icons/fi/FiFile.js";
|
|
3
7
|
import { positionKeys, withPositionKeys } from "../../components/keys.js";
|
|
4
8
|
import Loader from "../../components/Loader.js";
|
|
5
9
|
import Markdown from "../../components/Markdown.js";
|
|
@@ -36,19 +40,19 @@ function FilePreviewViewer({ node, kind, url, urlLoading, urlError, zoom = 100,
|
|
|
36
40
|
return { corsError: false };
|
|
37
41
|
}, [url]);
|
|
38
42
|
if (urlError) return /* @__PURE__ */ jsx(NotPreviewable, {
|
|
39
|
-
icon: /* @__PURE__ */ jsx(
|
|
43
|
+
icon: /* @__PURE__ */ jsx(FiFile, { className: "h-9 w-9 theme-muted-text" }),
|
|
40
44
|
title: t.preview.errorTitle,
|
|
41
45
|
message: urlError,
|
|
42
46
|
onDownload
|
|
43
47
|
});
|
|
44
48
|
if (kind === "archive") return /* @__PURE__ */ jsx(NotPreviewable, {
|
|
45
|
-
icon: /* @__PURE__ */ jsx(
|
|
49
|
+
icon: /* @__PURE__ */ jsx(BsFileEarmarkZip, { className: "h-9 w-9 text-(--theme-link)" }),
|
|
46
50
|
title: t.preview.archiveTitle,
|
|
47
51
|
message: t.preview.archiveMessage,
|
|
48
52
|
onDownload
|
|
49
53
|
});
|
|
50
54
|
if (kind === "unsupported") return /* @__PURE__ */ jsx(NotPreviewable, {
|
|
51
|
-
icon: /* @__PURE__ */ jsx(
|
|
55
|
+
icon: /* @__PURE__ */ jsx(FiFile, { className: "h-9 w-9 theme-muted-text" }),
|
|
52
56
|
title: t.preview.unsupportedTitle,
|
|
53
57
|
message: t.preview.unsupportedMessage,
|
|
54
58
|
onDownload
|
|
@@ -153,7 +157,7 @@ function AudioView({ node, url, onDownload }) {
|
|
|
153
157
|
children: [
|
|
154
158
|
/* @__PURE__ */ jsx("div", {
|
|
155
159
|
className: "flex h-28 w-28 items-center justify-center rounded-2xl bg-linear-to-br from-(--theme-element) to-(--theme-link) shadow-lg",
|
|
156
|
-
children: /* @__PURE__ */ jsx(
|
|
160
|
+
children: /* @__PURE__ */ jsx(BsMusicNoteBeamed, { className: "h-12 w-12 text-white" })
|
|
157
161
|
}),
|
|
158
162
|
/* @__PURE__ */ jsxs("div", {
|
|
159
163
|
className: "text-center",
|
|
@@ -179,7 +183,7 @@ function AudioView({ node, url, onDownload }) {
|
|
|
179
183
|
function PreviewError({ onDownload }) {
|
|
180
184
|
const t = useStrings().fileExplorer;
|
|
181
185
|
return /* @__PURE__ */ jsx(NotPreviewable, {
|
|
182
|
-
icon: /* @__PURE__ */ jsx(
|
|
186
|
+
icon: /* @__PURE__ */ jsx(FiFile, { className: "h-9 w-9 theme-muted-text" }),
|
|
183
187
|
title: t.preview.errorTitle,
|
|
184
188
|
message: t.preview.previewError,
|
|
185
189
|
onDownload
|
|
@@ -187,7 +191,6 @@ function PreviewError({ onDownload }) {
|
|
|
187
191
|
}
|
|
188
192
|
function PdfView({ node, url, onDownload, storage, onCorsRetry }) {
|
|
189
193
|
const { blobUrl, loading, error, tooLarge, corsError } = useObjectBlobUrl(url, {
|
|
190
|
-
enabled: true,
|
|
191
194
|
maxBytes: PDF_PREVIEW_MAX_BYTES,
|
|
192
195
|
knownSize: node.size,
|
|
193
196
|
mimeType: "application/pdf",
|
|
@@ -213,7 +216,6 @@ function CodeView({ node, url, onDownload, storage, onCorsRetry }) {
|
|
|
213
216
|
const language = getMonacoLanguage(node);
|
|
214
217
|
const [tail, setTail] = useState(false);
|
|
215
218
|
const { text, loading, error, tooLarge, truncated, corsError } = useObjectText(url, {
|
|
216
|
-
enabled: true,
|
|
217
219
|
maxBytes: CODE_PREVIEW_MAX_BYTES,
|
|
218
220
|
maxLines: CODE_PREVIEW_MAX_LINES,
|
|
219
221
|
knownSize: node.size,
|
|
@@ -252,7 +254,7 @@ function CodeView({ node, url, onDownload, storage, onCorsRetry }) {
|
|
|
252
254
|
}),
|
|
253
255
|
/* @__PURE__ */ jsxs("span", {
|
|
254
256
|
className: "inline-flex shrink-0 items-center gap-1 rounded-full border theme-border px-2 py-0.5 text-[11px] theme-muted-text",
|
|
255
|
-
children: [/* @__PURE__ */ jsx(
|
|
257
|
+
children: [/* @__PURE__ */ jsx(FaLock, { className: "h-2.5 w-2.5" }), t.readOnly]
|
|
256
258
|
})
|
|
257
259
|
]
|
|
258
260
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -291,7 +293,6 @@ function toFencedCode(text, language) {
|
|
|
291
293
|
}
|
|
292
294
|
function CsvView({ node, url, onDownload, storage, onCorsRetry }) {
|
|
293
295
|
const { text, loading, error, tooLarge, corsError } = useObjectText(url, {
|
|
294
|
-
enabled: true,
|
|
295
296
|
maxBytes: TABULAR_PREVIEW_MAX_BYTES,
|
|
296
297
|
maxLines: 502,
|
|
297
298
|
knownSize: node.size,
|
|
@@ -354,7 +355,6 @@ function CsvTable({ node, text }) {
|
|
|
354
355
|
}
|
|
355
356
|
function NotebookView({ node, url, onDownload, storage, onCorsRetry }) {
|
|
356
357
|
const { text, loading, error, tooLarge, corsError } = useObjectText(url, {
|
|
357
|
-
enabled: true,
|
|
358
358
|
maxBytes: TABULAR_PREVIEW_MAX_BYTES,
|
|
359
359
|
knownSize: node.size,
|
|
360
360
|
cacheKey: node.path
|
|
@@ -480,7 +480,7 @@ function NotPreviewable({ icon, title, message, onDownload }) {
|
|
|
480
480
|
type: "button",
|
|
481
481
|
className: "btn btn-info cursor-pointer",
|
|
482
482
|
onClick: onDownload,
|
|
483
|
-
children: [/* @__PURE__ */ jsx(
|
|
483
|
+
children: [/* @__PURE__ */ jsx(FiDownload, { className: "mr-2 h-4 w-4" }), t.preview.downloadInstead]
|
|
484
484
|
})
|
|
485
485
|
]
|
|
486
486
|
})
|
|
@@ -499,7 +499,7 @@ function TooLargeInline({ onDownload }) {
|
|
|
499
499
|
type: "button",
|
|
500
500
|
className: "btn btn-info cursor-pointer",
|
|
501
501
|
onClick: onDownload,
|
|
502
|
-
children: [/* @__PURE__ */ jsx(
|
|
502
|
+
children: [/* @__PURE__ */ jsx(FiDownload, { className: "mr-2 h-4 w-4" }), t.preview.downloadInstead]
|
|
503
503
|
})]
|
|
504
504
|
})
|
|
505
505
|
});
|
|
@@ -517,7 +517,7 @@ function InlineError({ message, onDownload }) {
|
|
|
517
517
|
type: "button",
|
|
518
518
|
className: "btn btn-neutral cursor-pointer",
|
|
519
519
|
onClick: onDownload,
|
|
520
|
-
children: [/* @__PURE__ */ jsx(
|
|
520
|
+
children: [/* @__PURE__ */ jsx(FiDownload, { className: "mr-2 h-4 w-4" }), t.preview.downloadInstead]
|
|
521
521
|
})]
|
|
522
522
|
})
|
|
523
523
|
});
|
|
@@ -9,7 +9,6 @@ interface FilePreviewProps {
|
|
|
9
9
|
onClose: () => void;
|
|
10
10
|
onDownload: (node: TreeNode) => void;
|
|
11
11
|
onCopyUri: (node: TreeNode) => void;
|
|
12
|
-
showSecurityIndicator?: boolean;
|
|
13
12
|
}
|
|
14
|
-
export declare function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigate, onClose, onDownload, onCopyUri,
|
|
13
|
+
export declare function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigate, onClose, onDownload, onCopyUri, }: FilePreviewProps): import("react").ReactPortal | null;
|
|
15
14
|
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { useStrings } from "../../components/Provider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { FaLink } from "../../icons/fa/FaLink.js";
|
|
3
|
+
import { FiDownload } from "../../icons/fi/FiDownload.js";
|
|
4
|
+
import { FiFile } from "../../icons/fi/FiFile.js";
|
|
5
|
+
import { IoMdClose } from "../../icons/io/IoMdClose.js";
|
|
6
|
+
import { LuChevronLeft } from "../../icons/lu/LuChevronLeft.js";
|
|
7
|
+
import { LuChevronRight } from "../../icons/lu/LuChevronRight.js";
|
|
8
|
+
import { LuZoomIn } from "../../icons/lu/LuZoomIn.js";
|
|
9
|
+
import { LuZoomOut } from "../../icons/lu/LuZoomOut.js";
|
|
3
10
|
import { formatFileSize } from "../lib/utils.js";
|
|
4
11
|
import { getPreviewKind } from "./previewType.js";
|
|
5
12
|
import { StreamedBadge } from "./StreamedBadge.js";
|
|
@@ -16,11 +23,11 @@ import { createPortal } from "react-dom";
|
|
|
16
23
|
function isDocumentView(kind) {
|
|
17
24
|
return kind === "code" || kind === "csv" || kind === "notebook";
|
|
18
25
|
}
|
|
19
|
-
function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigate, onClose, onDownload, onCopyUri
|
|
26
|
+
function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigate, onClose, onDownload, onCopyUri }) {
|
|
20
27
|
const t = useStrings().fileExplorer;
|
|
21
28
|
const [style, setStyle] = useLocalStorage("fileExplorer.previewStyle", "quicklook");
|
|
22
29
|
const [zoom, setZoom] = useState(100);
|
|
23
|
-
const { url, loading: urlLoading, error: urlError } = usePresignedUrl(
|
|
30
|
+
const { url, loading: urlLoading, error: urlError } = usePresignedUrl(node, getPresignedUrl, {
|
|
24
31
|
enabled: open,
|
|
25
32
|
linkErrorMessage: t.preview.linkError
|
|
26
33
|
});
|
|
@@ -71,12 +78,12 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
71
78
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
72
79
|
className: "flex min-w-0 items-center gap-2.5",
|
|
73
80
|
children: [
|
|
74
|
-
/* @__PURE__ */ jsx(
|
|
81
|
+
/* @__PURE__ */ jsx(FiFile, { className: cx("h-4 w-4 shrink-0", !floatingChrome && "theme-muted-text") }),
|
|
75
82
|
/* @__PURE__ */ jsx("span", {
|
|
76
83
|
className: "truncate font-semibold",
|
|
77
84
|
children: node.name
|
|
78
85
|
}),
|
|
79
|
-
|
|
86
|
+
url && /* @__PURE__ */ jsx(StreamedBadge, {})
|
|
80
87
|
]
|
|
81
88
|
}), /* @__PURE__ */ jsxs("div", {
|
|
82
89
|
className: "flex shrink-0 items-center gap-1.5",
|
|
@@ -99,19 +106,19 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
99
106
|
overlay: floatingChrome,
|
|
100
107
|
label: t.preview.copyUri,
|
|
101
108
|
onClick: () => onCopyUri(node),
|
|
102
|
-
children: /* @__PURE__ */ jsx(
|
|
109
|
+
children: /* @__PURE__ */ jsx(FaLink, { className: "h-4 w-4" })
|
|
103
110
|
}),
|
|
104
111
|
/* @__PURE__ */ jsx(ChromeButton, {
|
|
105
112
|
overlay: floatingChrome,
|
|
106
113
|
label: t.preview.download,
|
|
107
114
|
onClick: () => onDownload(node),
|
|
108
|
-
children: /* @__PURE__ */ jsx(
|
|
115
|
+
children: /* @__PURE__ */ jsx(FiDownload, { className: "h-4 w-4" })
|
|
109
116
|
}),
|
|
110
117
|
/* @__PURE__ */ jsx(ChromeButton, {
|
|
111
118
|
overlay: floatingChrome,
|
|
112
119
|
label: t.preview.close,
|
|
113
120
|
onClick: onClose,
|
|
114
|
-
children: /* @__PURE__ */ jsx(
|
|
121
|
+
children: /* @__PURE__ */ jsx(IoMdClose, { className: "h-4 w-4" })
|
|
115
122
|
})
|
|
116
123
|
]
|
|
117
124
|
})]
|
|
@@ -130,7 +137,7 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
130
137
|
overlay: floatingChrome,
|
|
131
138
|
label: t.preview.zoomOut,
|
|
132
139
|
onClick: () => setZoom((z) => Math.max(25, z - 25)),
|
|
133
|
-
children: /* @__PURE__ */ jsx(
|
|
140
|
+
children: /* @__PURE__ */ jsx(LuZoomOut, { className: "h-3.5 w-3.5" })
|
|
134
141
|
}),
|
|
135
142
|
/* @__PURE__ */ jsxs("span", {
|
|
136
143
|
className: "min-w-11 text-center text-xs tabular-nums",
|
|
@@ -140,7 +147,7 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
140
147
|
overlay: floatingChrome,
|
|
141
148
|
label: t.preview.zoomIn,
|
|
142
149
|
onClick: () => setZoom((z) => Math.min(400, z + 25)),
|
|
143
|
-
children: /* @__PURE__ */ jsx(
|
|
150
|
+
children: /* @__PURE__ */ jsx(LuZoomIn, { className: "h-3.5 w-3.5" })
|
|
144
151
|
})
|
|
145
152
|
]
|
|
146
153
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -151,7 +158,7 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
151
158
|
label: t.preview.previousFile,
|
|
152
159
|
disabled: !hasPrev,
|
|
153
160
|
onClick: goPrev,
|
|
154
|
-
children: /* @__PURE__ */ jsx(
|
|
161
|
+
children: /* @__PURE__ */ jsx(LuChevronLeft, { className: "h-4 w-4" })
|
|
155
162
|
}),
|
|
156
163
|
/* @__PURE__ */ jsx("span", {
|
|
157
164
|
className: "min-w-14 text-center text-xs tabular-nums",
|
|
@@ -162,7 +169,7 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
162
169
|
label: t.preview.nextFile,
|
|
163
170
|
disabled: !hasNext,
|
|
164
171
|
onClick: goNext,
|
|
165
|
-
children: /* @__PURE__ */ jsx(
|
|
172
|
+
children: /* @__PURE__ */ jsx(LuChevronRight, { className: "h-4 w-4" })
|
|
166
173
|
})
|
|
167
174
|
]
|
|
168
175
|
})]
|
|
@@ -259,7 +266,7 @@ function EdgeButton({ side, label, disabled, onClick }) {
|
|
|
259
266
|
},
|
|
260
267
|
className: cx("absolute top-1/2 z-20 flex h-13 w-13 -translate-y-1/2 items-center justify-center rounded-full text-white backdrop-blur", side === "left" ? "left-5" : "right-5", disabled ? "cursor-not-allowed opacity-30" : "cursor-pointer hover:bg-white/20"),
|
|
261
268
|
style: { backgroundColor: "rgba(22,27,34,.7)" },
|
|
262
|
-
children: side === "left" ? /* @__PURE__ */ jsx(
|
|
269
|
+
children: side === "left" ? /* @__PURE__ */ jsx(LuChevronLeft, { className: "h-6 w-6" }) : /* @__PURE__ */ jsx(LuChevronRight, { className: "h-6 w-6" })
|
|
263
270
|
});
|
|
264
271
|
}
|
|
265
272
|
//#endregion
|
|
@@ -9,7 +9,7 @@ export interface NotebookOutput {
|
|
|
9
9
|
evalue?: string;
|
|
10
10
|
traceback?: string[];
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface NotebookCell {
|
|
13
13
|
cell_type: string;
|
|
14
14
|
source: string | string[];
|
|
15
15
|
outputs?: NotebookOutput[];
|
|
@@ -22,3 +22,4 @@ export declare function parseNotebook(text: string): ParsedNotebook | null;
|
|
|
22
22
|
/** nbformat `source`/`text` is a string or an array of lines; normalize to one string. */
|
|
23
23
|
export declare function joinSource(source: unknown): string;
|
|
24
24
|
export declare function stripAnsi(text: string): string;
|
|
25
|
+
export {};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface BlobResult {
|
|
2
2
|
blobUrl: string | null;
|
|
3
|
+
tooLarge: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface ObjectBlobState extends BlobResult {
|
|
3
6
|
loading: boolean;
|
|
4
7
|
error: string | null;
|
|
5
|
-
tooLarge: boolean;
|
|
6
8
|
corsError: boolean;
|
|
7
9
|
}
|
|
8
10
|
/** Fetch an object into a blob URL with a forced MIME type so e.g. PDFs render inline even when served as octet-stream; cached per `cacheKey` so repeated mounts share one download and one blob URL, revoked when the cache drops it. */
|
|
9
|
-
export declare function useObjectBlobUrl(url: string
|
|
10
|
-
enabled: boolean;
|
|
11
|
+
export declare function useObjectBlobUrl(url: string, { maxBytes, knownSize, mimeType, cacheKey, }: {
|
|
11
12
|
maxBytes: number;
|
|
12
13
|
knownSize?: number | undefined;
|
|
13
14
|
mimeType: string;
|