@parallelworks/ui 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +348 -25
- package/dist/ai/agent/diff.d.ts +2 -1
- package/dist/ai/agent/diff.js +4 -12
- package/dist/ai/agent/diffHighlight.d.ts +1 -1
- package/dist/ai/agent/diffHighlight.js +4 -3
- package/dist/ai/agent/index.d.ts +2 -1
- package/dist/ai/agent/toolStrings.d.ts +37 -0
- package/dist/ai/agent/toolStrings.js +35 -0
- package/dist/ai/agent/toolfmt.d.ts +8 -3
- package/dist/ai/agent/toolfmt.js +50 -65
- package/dist/ai/ai.css +18 -31
- package/dist/ai/components/AllocationSelector.js +2 -2
- package/dist/ai/components/AttachmentManager.js +28 -29
- package/dist/ai/components/AttachmentUpload.js +25 -30
- package/dist/ai/components/BlockedGroupBanner.js +2 -2
- package/dist/ai/components/BranchNavigator.js +3 -4
- package/dist/ai/components/ChatEmptyState.js +8 -7
- package/dist/ai/components/ChatInput.js +10 -12
- package/dist/ai/components/ChatLayout.js +3 -3
- package/dist/ai/components/ChatMessage.js +49 -61
- package/dist/ai/components/ChatMessageList.js +46 -42
- package/dist/ai/components/ChatSidebar.js +26 -34
- package/dist/ai/components/ChatStage.js +1 -1
- package/dist/ai/components/ComposerChrome.js +3 -4
- package/dist/ai/components/DragOverlay.js +6 -4
- package/dist/ai/components/ModelSelector.js +14 -15
- package/dist/ai/components/PastedText.js +18 -14
- package/dist/ai/components/ProviderIssueBanner.js +3 -4
- package/dist/ai/components/Reasoning.d.ts +12 -6
- package/dist/ai/components/Reasoning.js +31 -18
- package/dist/ai/components/ShareDialog.js +25 -28
- package/dist/ai/components/SlashMenu.js +3 -3
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -5
- package/dist/ai/components/agent/ActivityLine.js +17 -54
- package/dist/ai/components/agent/AgentMessageParts.js +139 -149
- package/dist/ai/components/conversationActions.js +16 -16
- package/dist/ai/core/ChatProvider.d.ts +2 -4
- package/dist/ai/core/ChatProvider.js +25 -38
- package/dist/ai/core/exportConversation.js +4 -4
- package/dist/ai/core/sidebarState.d.ts +8 -6
- package/dist/ai/core/sidebarState.js +21 -28
- package/dist/ai/core/useKeyboardShortcuts.js +14 -5
- package/dist/ai/index.d.ts +4 -5
- package/dist/ai/index.js +7 -7
- package/dist/ai/strings.d.ts +14 -31
- package/dist/ai/strings.js +19 -39
- package/dist/ai/types.d.ts +0 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +12 -9
- package/dist/ai/ui/ConversationSidebar.js +43 -87
- package/dist/ai/ui/Markdown.d.ts +3 -6
- package/dist/ai/ui/Markdown.js +6 -73
- package/dist/ai/ui/Notice.js +10 -12
- package/dist/ai/ui/chip.d.ts +2 -2
- package/dist/ai/ui/chip.js +1 -1
- package/dist/ai/ui/sidebar.d.ts +4 -20
- package/dist/ai/ui/sidebar.js +30 -67
- package/dist/ai/utils.d.ts +0 -1
- package/dist/ai/utils.js +1 -14
- package/dist/brandIcons.d.ts +51 -0
- package/dist/brandIcons.js +75 -0
- package/dist/components/Avatar.d.ts +3 -1
- package/dist/components/Avatar.js +34 -28
- package/dist/components/Button.d.ts +12 -7
- package/dist/components/Button.js +39 -44
- package/dist/components/Callout.js +18 -12
- package/dist/components/Card.d.ts +18 -8
- package/dist/components/Card.js +17 -6
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox.js +30 -0
- package/dist/components/Combobox.d.ts +9 -1
- package/dist/components/Combobox.js +71 -44
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +2 -8
- package/dist/components/ContextMenu.js +2 -29
- package/dist/components/CopyToClipboard.js +17 -36
- package/dist/components/CreateModal.d.ts +3 -24
- package/dist/components/CreateModal.js +46 -113
- package/dist/components/DatePicker.d.ts +31 -0
- package/dist/components/DatePicker.js +191 -0
- package/dist/components/DescriptionList.js +4 -4
- package/dist/components/Disclosure.d.ts +34 -0
- package/dist/components/Disclosure.js +46 -0
- package/dist/components/Drawer.d.ts +47 -0
- package/dist/components/Drawer.js +120 -0
- package/dist/components/EmptyState.d.ts +15 -10
- package/dist/components/EmptyState.js +13 -8
- package/dist/components/ExternalLink.d.ts +8 -0
- package/dist/components/ExternalLink.js +29 -0
- package/dist/components/Field.d.ts +70 -0
- package/dist/components/Field.js +159 -0
- package/dist/components/HoverCard.js +11 -14
- package/dist/components/IconButton.d.ts +16 -13
- package/dist/components/IconButton.js +27 -18
- package/dist/components/InfoTip.js +16 -23
- package/dist/components/Input.d.ts +10 -9
- package/dist/components/Input.js +54 -96
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.d.ts +15 -8
- package/dist/components/Loader.js +29 -19
- package/dist/components/Markdown.d.ts +7 -1
- package/dist/components/Markdown.js +2 -0
- package/dist/components/MarkdownImpl.d.ts +1 -1
- package/dist/components/MarkdownImpl.js +55 -14
- package/dist/components/Menu.js +13 -15
- package/dist/components/MenuEntries.js +11 -16
- package/dist/components/Meter.d.ts +48 -0
- package/dist/components/Meter.js +94 -0
- package/dist/components/Modal.js +11 -14
- package/dist/components/NumberInput.d.ts +25 -0
- package/dist/components/NumberInput.js +55 -0
- package/dist/components/Overview.js +12 -10
- package/dist/components/PageHeader.d.ts +2 -3
- package/dist/components/PageHeader.js +30 -21
- package/dist/components/Pagination.d.ts +27 -14
- package/dist/components/Pagination.js +86 -25
- package/dist/components/Popover.d.ts +47 -0
- package/dist/components/Popover.js +63 -0
- package/dist/components/Provider.d.ts +197 -80
- package/dist/components/Provider.js +200 -118
- package/dist/components/Radio.d.ts +1 -1
- package/dist/components/Radio.js +4 -4
- package/dist/components/RefreshButton.d.ts +15 -0
- package/dist/components/RefreshButton.js +53 -0
- package/dist/components/RunStatusIcon.d.ts +12 -0
- package/dist/components/RunStatusIcon.js +84 -0
- package/dist/components/SearchInput.d.ts +16 -0
- package/dist/components/SearchInput.js +52 -0
- package/dist/components/Section.d.ts +28 -0
- package/dist/components/Section.js +76 -0
- package/dist/components/SegmentedControl.d.ts +7 -11
- package/dist/components/SegmentedControl.js +25 -56
- package/dist/components/Select.d.ts +8 -1
- package/dist/components/Select.js +47 -43
- package/dist/components/SettingModeOption.d.ts +3 -5
- package/dist/components/SettingModeOption.js +5 -6
- package/dist/components/SettingsCard.d.ts +32 -19
- package/dist/components/SettingsCard.js +40 -13
- package/dist/components/Skeleton.d.ts +22 -0
- package/dist/components/Skeleton.js +34 -0
- package/dist/components/Slider.d.ts +16 -0
- package/dist/components/Slider.js +30 -0
- package/dist/components/Sort.js +4 -6
- package/dist/components/StatusBadge.d.ts +3 -1
- package/dist/components/StatusBadge.js +9 -32
- package/dist/components/StatusIcons.d.ts +0 -4
- package/dist/components/StatusIcons.js +5 -13
- package/dist/components/Switch.d.ts +5 -1
- package/dist/components/Switch.js +23 -6
- package/dist/components/Table.js +13 -20
- package/dist/components/Tabs.d.ts +52 -0
- package/dist/components/Tabs.js +75 -0
- package/dist/components/ThemeEditor.d.ts +29 -0
- package/dist/components/ThemeEditor.js +397 -0
- package/dist/components/Toast.d.ts +57 -0
- package/dist/components/Toast.js +203 -0
- package/dist/components/Tooltip.js +12 -15
- package/dist/components/buttonClasses.d.ts +18 -0
- package/dist/components/buttonClasses.js +31 -0
- package/dist/components/codeTheme.d.ts +5 -0
- package/dist/components/codeTheme.js +93 -0
- package/dist/components/fieldBox.d.ts +14 -0
- package/dist/components/fieldBox.js +29 -0
- package/dist/components/floating.d.ts +26 -5
- package/dist/components/floating.js +31 -9
- package/dist/{ai/ui/codeBreaks.js → components/markdownCodeBreaks.js} +1 -1
- package/dist/components/persistedState.d.ts +2 -0
- package/dist/components/persistedState.js +63 -0
- package/dist/components/relativeTime.d.ts +36 -8
- package/dist/components/relativeTime.js +106 -23
- package/dist/components/segmented.d.ts +17 -0
- package/dist/components/segmented.js +27 -0
- package/dist/components/shortcutKey.d.ts +4 -0
- package/dist/components/shortcutKey.js +27 -0
- package/dist/components/splitter.d.ts +26 -0
- package/dist/components/splitter.js +69 -0
- package/dist/components/tone.d.ts +9 -0
- package/dist/components/tone.js +30 -0
- package/dist/components/useCopy.d.ts +14 -0
- package/dist/components/useCopy.js +31 -0
- package/dist/components/useCssIsDark.d.ts +2 -0
- package/dist/components/useCssIsDark.js +2 -1
- package/dist/components/useTheme.d.ts +10 -0
- package/dist/components/useTheme.js +40 -0
- package/dist/cx.d.ts +5 -0
- package/dist/cx.js +11 -0
- package/dist/editor/Editor.js +2 -2
- package/dist/editor/EditorField.js +7 -10
- package/dist/editor/FormCodePanel.js +10 -23
- package/dist/editor/Monaco.js +7 -4
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +2 -2
- package/dist/editor/themes.d.ts +4 -0
- package/dist/editor/themes.js +75 -76
- package/dist/file-explorer/FileExplorer.js +180 -187
- package/dist/file-explorer/FileExplorerContext.js +36 -58
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +2 -1
- package/dist/file-explorer/FilePreview/Inline.js +9 -7
- package/dist/file-explorer/FilePreview/StreamedBadge.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +32 -34
- package/dist/file-explorer/FilePreview/index.js +60 -92
- package/dist/file-explorer/FileRow.js +10 -15
- package/dist/file-explorer/FileRowsWindow.js +2 -6
- package/dist/file-explorer/FileTable.js +2 -2
- package/dist/file-explorer/FileTableHeaders.js +8 -11
- package/dist/file-explorer/LoadMoreRow.js +8 -9
- package/dist/file-explorer/TreeView.js +16 -16
- package/dist/file-explorer/helpers.d.ts +1 -4
- package/dist/file-explorer/helpers.js +101 -114
- package/dist/file-explorer/lib/utils.d.ts +0 -2
- package/dist/file-explorer/lib/utils.js +1 -25
- package/dist/file-explorer/toasts.js +104 -185
- package/dist/form/Fields/BooleanField.js +12 -14
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +16 -18
- package/dist/form/Fields/ColorField.js +11 -11
- package/dist/form/Fields/DropdownField.d.ts +1 -1
- package/dist/form/Fields/DropdownField.js +20 -36
- package/dist/form/Fields/DurationField.d.ts +1 -1
- package/dist/form/Fields/DurationField.js +36 -50
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +1 -1
- package/dist/form/Fields/MultiDropdownField.js +9 -14
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +13 -48
- package/dist/form/Fields/ObjectField.js +3 -3
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +15 -18
- package/dist/form/Fields/RangeField.js +34 -35
- package/dist/form/Fields/StringField.d.ts +1 -1
- package/dist/form/Fields/StringField.js +15 -25
- package/dist/form/Fields/TextAreaField.js +10 -15
- package/dist/form/Form.d.ts +7 -2
- package/dist/form/Form.js +144 -49
- package/dist/form/FormLayout.js +18 -12
- package/dist/form/Wizard/WizardContainer.js +44 -18
- package/dist/form/Wizard/WizardNavigation.d.ts +1 -1
- package/dist/form/Wizard/WizardNavigation.js +31 -56
- package/dist/form/Wizard/WizardStepIndicator.d.ts +3 -0
- package/dist/form/Wizard/WizardStepIndicator.js +98 -114
- package/dist/form/Wizard/types.d.ts +2 -2
- package/dist/form/fieldFrame.d.ts +7 -0
- package/dist/form/fieldFrame.js +19 -0
- package/dist/form/index.d.ts +5 -5
- package/dist/form/index.js +4 -6
- package/dist/form/layoutCSS.js +5 -4
- package/dist/form/types/fieldComponentTypes.d.ts +5 -3
- package/dist/form/useChoiceField.js +2 -3
- package/dist/form/useFieldValue.d.ts +3 -0
- package/dist/form/useFieldValue.js +24 -7
- package/dist/form/utils/duration.d.ts +2 -2
- package/dist/form/utils/duration.js +3 -3
- package/dist/form/utils/fieldPath.d.ts +5 -3
- package/dist/form/utils/fieldPath.js +18 -3
- package/dist/form/utils/secondaryField.d.ts +0 -7
- package/dist/form/utils/secondaryField.js +1 -12
- package/dist/form/validation.d.ts +29 -0
- package/dist/form/validation.js +14 -0
- package/dist/format.d.ts +28 -0
- package/dist/format.js +64 -0
- package/dist/graph/AnnotationBanner.js +20 -31
- package/dist/graph/Connectors.js +1 -1
- package/dist/graph/DependencyGraph.js +51 -65
- package/dist/graph/GraphEditor.js +24 -28
- package/dist/graph/GraphEditorDialogs.js +239 -245
- package/dist/graph/InputDialog.js +93 -112
- package/dist/graph/InputsEditor.js +83 -84
- package/dist/graph/JobSummary.js +10 -11
- package/dist/graph/MatrixGroup.js +3 -3
- package/dist/graph/ProblemsButton.js +9 -10
- package/dist/graph/ShortcutsButton.js +12 -17
- package/dist/graph/SuggestionInput.d.ts +1 -2
- package/dist/graph/SuggestionInput.js +1 -3
- package/dist/graph/TreeView.js +47 -45
- package/dist/graph/WorkflowSettingsDialog.js +97 -102
- package/dist/graph/editorChrome.js +10 -12
- package/dist/graph/editorFields.d.ts +19 -16
- package/dist/graph/editorFields.js +97 -135
- package/dist/graph/editorPrimitives.js +2 -2
- package/dist/graph/editorRows.js +22 -25
- package/dist/graph/editorStrings.d.ts +16 -19
- package/dist/graph/editorStrings.js +11 -23
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -4
- package/dist/graph/inputRefs.d.ts +0 -13
- package/dist/graph/inputRefs.js +121 -159
- package/dist/graph/settingsViews.js +5 -3
- package/dist/graph/stepWith.js +100 -100
- package/dist/graph/toolbarPanel.d.ts +8 -0
- package/dist/graph/toolbarPanel.js +11 -0
- package/dist/icons.d.ts +234 -23
- package/dist/icons.js +249 -264
- package/dist/index.d.ts +38 -21
- package/dist/index.js +42 -21
- package/dist/list/ActionToolbar.d.ts +1 -5
- package/dist/list/ActionToolbar.js +21 -20
- package/dist/list/ListPage.js +7 -7
- package/dist/list/ListTable.d.ts +3 -2
- package/dist/list/ListTable.js +33 -29
- package/dist/list/ListViewControls.d.ts +0 -17
- package/dist/list/ListViewControls.js +50 -118
- package/dist/list/UserHoverCard.js +24 -32
- package/dist/list/index.d.ts +2 -4
- package/dist/list/index.js +3 -5
- package/dist/list/listSearch.d.ts +1 -1
- package/dist/list/listSearch.js +19 -14
- package/dist/list/rowMenu.js +20 -26
- package/dist/logviewer/LogViewer.js +268 -382
- package/dist/logviewer/logviewer.css +53 -41
- package/dist/styles/base.css +16 -40
- package/dist/styles/theme.css +75 -106
- package/dist/styles.css +1 -1
- package/dist/theme/color.d.ts +40 -0
- package/dist/theme/color.js +228 -0
- package/dist/theme/contrast.d.ts +42 -0
- package/dist/theme/contrast.js +145 -0
- package/dist/theme/derive.d.ts +25 -0
- package/dist/theme/derive.js +475 -0
- package/dist/theme/fit.d.ts +35 -0
- package/dist/theme/fit.js +185 -0
- package/dist/theme/index.d.ts +14 -29
- package/dist/theme/index.js +20 -279
- package/dist/theme/model.d.ts +64 -0
- package/dist/theme/model.js +219 -0
- package/package.json +9 -5
- package/dist/ai/ui/Avatar.d.ts +0 -7
- package/dist/ai/ui/Avatar.js +0 -24
- package/dist/components/Filter.d.ts +0 -15
- package/dist/components/Filter.js +0 -32
- package/dist/components/FilterPill.d.ts +0 -7
- package/dist/components/FilterPill.js +0 -14
- package/dist/components/Indicator.d.ts +0 -4
- package/dist/components/Indicator.js +0 -44
- package/dist/components/SectionHeader.d.ts +0 -8
- package/dist/components/SectionHeader.js +0 -11
- package/dist/components/SettingRow.d.ts +0 -18
- package/dist/components/SettingRow.js +0 -35
- package/dist/components/SettingsGroup.d.ts +0 -8
- package/dist/components/SettingsGroup.js +0 -17
- package/dist/components/ghostButton.d.ts +0 -4
- package/dist/components/ghostButton.js +0 -7
- package/dist/components/inputClasses.d.ts +0 -1
- package/dist/components/inputClasses.js +0 -4
- package/dist/duration.d.ts +0 -3
- package/dist/duration.js +0 -17
- package/dist/form/FieldGroup.d.ts +0 -11
- package/dist/form/FieldGroup.js +0 -36
- package/dist/form/FieldWrapper.d.ts +0 -16
- package/dist/form/FieldWrapper.js +0 -55
- package/dist/form/fieldContext.d.ts +0 -19
- package/dist/form/fieldContext.js +0 -26
- package/dist/graph/Collapse.d.ts +0 -7
- package/dist/graph/Collapse.js +0 -15
- package/dist/graph/ToolbarPopover.d.ts +0 -13
- package/dist/graph/ToolbarPopover.js +0 -39
- package/dist/icons/ai/AiOutlineRollback.js +0 -16
- package/dist/icons/bi/BiBell.js +0 -16
- package/dist/icons/bi/BiBellOff.js +0 -16
- package/dist/icons/bi/BiBuildings.js +0 -20
- package/dist/icons/bi/BiError.js +0 -20
- package/dist/icons/bi/BiExpandVertical.js +0 -16
- package/dist/icons/bi/BiPause.js +0 -16
- package/dist/icons/bi/BiPlay.js +0 -16
- package/dist/icons/bi/BiRedo.js +0 -16
- package/dist/icons/bi/BiSolidCheckShield.js +0 -16
- package/dist/icons/bi/BiSolidTrashAlt.js +0 -16
- package/dist/icons/bi/BiStop.js +0 -16
- package/dist/icons/bi/BiUndo.js +0 -16
- package/dist/icons/bs/BsArrowsCollapse.js +0 -22
- package/dist/icons/bs/BsBank2.js +0 -19
- package/dist/icons/bs/BsBriefcase.js +0 -19
- package/dist/icons/bs/BsBucket.js +0 -19
- package/dist/icons/bs/BsCalendarX.js +0 -23
- package/dist/icons/bs/BsChatLeft.js +0 -19
- package/dist/icons/bs/BsChevronDoubleDown.js +0 -29
- package/dist/icons/bs/BsChevronDoubleUp.js +0 -29
- package/dist/icons/bs/BsClipboardCheck.js +0 -34
- package/dist/icons/bs/BsCurrencyDollar.js +0 -19
- package/dist/icons/bs/BsDash.js +0 -19
- package/dist/icons/bs/BsFileEarmarkZip.js +0 -23
- package/dist/icons/bs/BsFiles.js +0 -19
- package/dist/icons/bs/BsGeoAlt.js +0 -23
- package/dist/icons/bs/BsGrid.js +0 -19
- package/dist/icons/bs/BsLayers.js +0 -19
- package/dist/icons/bs/BsLayoutThreeColumns.js +0 -19
- package/dist/icons/bs/BsListUl.js +0 -22
- package/dist/icons/bs/BsMortarboard.js +0 -23
- package/dist/icons/bs/BsMusicNoteBeamed.js +0 -34
- package/dist/icons/bs/BsOpenai.js +0 -19
- package/dist/icons/bs/BsPersonPlus.js +0 -26
- package/dist/icons/bs/BsSearch.js +0 -19
- package/dist/icons/bs/BsSend.js +0 -19
- package/dist/icons/bs/BsShieldSlash.js +0 -22
- package/dist/icons/bs/BsStar.js +0 -19
- package/dist/icons/bs/BsStarFill.js +0 -19
- package/dist/icons/bs/BsStopCircle.js +0 -23
- package/dist/icons/bs/BsTag.js +0 -23
- package/dist/icons/bs/BsTelephone.js +0 -19
- package/dist/icons/bs/BsTerminal.js +0 -23
- package/dist/icons/bs/BsTerminalFill.js +0 -19
- package/dist/icons/bs/BsThreeDots.js +0 -19
- package/dist/icons/bs/BsThreeDotsVertical.js +0 -19
- package/dist/icons/bs/BsZoomIn.js +0 -37
- package/dist/icons/fa/FaAmazon.js +0 -16
- package/dist/icons/fa/FaAngleDown.js +0 -16
- package/dist/icons/fa/FaAngleLeft.js +0 -16
- package/dist/icons/fa/FaAngleRight.js +0 -16
- package/dist/icons/fa/FaAngleUp.js +0 -16
- package/dist/icons/fa/FaArrowDown.js +0 -16
- package/dist/icons/fa/FaArrowLeft.js +0 -16
- package/dist/icons/fa/FaArrowRight.js +0 -16
- package/dist/icons/fa/FaArrowUp.js +0 -16
- package/dist/icons/fa/FaBalanceScale.js +0 -16
- package/dist/icons/fa/FaCaretDown.js +0 -16
- package/dist/icons/fa/FaCentos.js +0 -16
- package/dist/icons/fa/FaChartLine.js +0 -16
- package/dist/icons/fa/FaChartPie.js +0 -16
- package/dist/icons/fa/FaCheck.js +0 -16
- package/dist/icons/fa/FaChevronDown.js +0 -16
- package/dist/icons/fa/FaChevronUp.js +0 -16
- package/dist/icons/fa/FaChrome.js +0 -16
- package/dist/icons/fa/FaCircleNotch.js +0 -16
- package/dist/icons/fa/FaCloud.js +0 -16
- package/dist/icons/fa/FaCloudDownloadAlt.js +0 -16
- package/dist/icons/fa/FaCog.js +0 -16
- package/dist/icons/fa/FaCogs.js +0 -16
- package/dist/icons/fa/FaComments.js +0 -16
- package/dist/icons/fa/FaCompress.js +0 -16
- package/dist/icons/fa/FaDesktop.js +0 -16
- package/dist/icons/fa/FaDocker.js +0 -16
- package/dist/icons/fa/FaDollarSign.js +0 -16
- package/dist/icons/fa/FaEdge.js +0 -16
- package/dist/icons/fa/FaEdit.js +0 -16
- package/dist/icons/fa/FaExclamationTriangle.js +0 -16
- package/dist/icons/fa/FaExpand.js +0 -16
- package/dist/icons/fa/FaEye.js +0 -16
- package/dist/icons/fa/FaEyeSlash.js +0 -16
- package/dist/icons/fa/FaFile.js +0 -16
- package/dist/icons/fa/FaFilePdf.js +0 -16
- package/dist/icons/fa/FaFilter.js +0 -16
- package/dist/icons/fa/FaFirefoxBrowser.js +0 -16
- package/dist/icons/fa/FaFlask.js +0 -16
- package/dist/icons/fa/FaFolder.js +0 -16
- package/dist/icons/fa/FaGithub.js +0 -16
- package/dist/icons/fa/FaGitlab.js +0 -16
- package/dist/icons/fa/FaGlobe.js +0 -16
- package/dist/icons/fa/FaGlobeAmericas.js +0 -16
- package/dist/icons/fa/FaImage.js +0 -16
- package/dist/icons/fa/FaInfoCircle.js +0 -16
- package/dist/icons/fa/FaKey.js +0 -16
- package/dist/icons/fa/FaLayerGroup.js +0 -16
- package/dist/icons/fa/FaLink.js +0 -16
- package/dist/icons/fa/FaLinkedin.js +0 -16
- package/dist/icons/fa/FaLinux.js +0 -16
- package/dist/icons/fa/FaList.js +0 -16
- package/dist/icons/fa/FaLock.js +0 -16
- package/dist/icons/fa/FaOpenid.js +0 -16
- package/dist/icons/fa/FaOpera.js +0 -16
- package/dist/icons/fa/FaPaperclip.js +0 -16
- package/dist/icons/fa/FaPlus.js +0 -16
- package/dist/icons/fa/FaPowerOff.js +0 -16
- package/dist/icons/fa/FaPrint.js +0 -16
- package/dist/icons/fa/FaQrcode.js +0 -16
- package/dist/icons/fa/FaQuestionCircle.js +0 -16
- package/dist/icons/fa/FaRedhat.js +0 -16
- package/dist/icons/fa/FaRegCircle.js +0 -16
- package/dist/icons/fa/FaRegFileImage.js +0 -16
- package/dist/icons/fa/FaRegFolder.js +0 -16
- package/dist/icons/fa/FaRobot.js +0 -16
- package/dist/icons/fa/FaRocket.js +0 -16
- package/dist/icons/fa/FaRunning.js +0 -16
- package/dist/icons/fa/FaSafari.js +0 -16
- package/dist/icons/fa/FaSave.js +0 -16
- package/dist/icons/fa/FaSearch.js +0 -16
- package/dist/icons/fa/FaShieldAlt.js +0 -16
- package/dist/icons/fa/FaSlack.js +0 -16
- package/dist/icons/fa/FaStar.js +0 -16
- package/dist/icons/fa/FaStop.js +0 -16
- package/dist/icons/fa/FaSuse.js +0 -16
- package/dist/icons/fa/FaTerminal.js +0 -16
- package/dist/icons/fa/FaTimes.js +0 -16
- package/dist/icons/fa/FaUbuntu.js +0 -16
- package/dist/icons/fa/FaUndoAlt.js +0 -16
- package/dist/icons/fa/FaUnlink.js +0 -16
- package/dist/icons/fa/FaUser.js +0 -16
- package/dist/icons/fa/FaUsers.js +0 -16
- package/dist/icons/fa/FaWindows.js +0 -16
- package/dist/icons/fa6/FaApple.js +0 -16
- package/dist/icons/fa6/FaArrowsRotate.js +0 -16
- package/dist/icons/fa6/FaDebian.js +0 -16
- package/dist/icons/fa6/FaFilterCircleXmark.js +0 -16
- package/dist/icons/fa6/FaInbox.js +0 -16
- package/dist/icons/fa6/FaLocationDot.js +0 -16
- package/dist/icons/fa6/FaRegFilePdf.js +0 -16
- package/dist/icons/fa6/FaRegFolderOpen.js +0 -16
- package/dist/icons/fa6/FaUpRightFromSquare.js +0 -16
- package/dist/icons/fa6/FaWandMagicSparkles.js +0 -16
- package/dist/icons/fa6/FaXTwitter.js +0 -16
- package/dist/icons/fi/FiActivity.js +0 -23
- package/dist/icons/fi/FiAlertCircle.js +0 -49
- package/dist/icons/fi/FiChevronDown.js +0 -23
- package/dist/icons/fi/FiClock.js +0 -31
- package/dist/icons/fi/FiCopy.js +0 -34
- package/dist/icons/fi/FiDownload.js +0 -40
- package/dist/icons/fi/FiFile.js +0 -27
- package/dist/icons/fi/FiFileText.js +0 -55
- package/dist/icons/fi/FiHardDrive.js +0 -55
- package/dist/icons/fi/FiRotateCcw.js +0 -27
- package/dist/icons/fi/FiUpload.js +0 -40
- package/dist/icons/fi/FiX.js +0 -37
- package/dist/icons/fi/FiZap.js +0 -23
- package/dist/icons/gi/GiSpy.js +0 -16
- package/dist/icons/go/GoGitCommit.js +0 -16
- package/dist/icons/go/GoGitPullRequest.js +0 -20
- package/dist/icons/go/GoIssueOpened.js +0 -16
- package/dist/icons/go/GoPlus.js +0 -16
- package/dist/icons/go/GoRepoForked.js +0 -28
- package/dist/icons/go/GoSignOut.js +0 -16
- package/dist/icons/go/GoSkip.js +0 -20
- package/dist/icons/go/GoVideo.js +0 -20
- package/dist/icons/gr/GrCloudComputer.js +0 -20
- package/dist/icons/gr/GrInbox.js +0 -20
- package/dist/icons/gr/GrServerCluster.js +0 -20
- package/dist/icons/gr/GrStorage.js +0 -20
- package/dist/icons/gr/GrTasks.js +0 -20
- package/dist/icons/hi/HiCog.js +0 -24
- package/dist/icons/hi/HiDuplicate.js +0 -24
- package/dist/icons/hi/HiOutlineArchive.js +0 -26
- package/dist/icons/hi/HiOutlineClipboardCopy.js +0 -26
- package/dist/icons/hi/HiOutlineHome.js +0 -26
- package/dist/icons/hi/HiQuestionMarkCircle.js +0 -24
- package/dist/icons/hi/HiServer.js +0 -24
- package/dist/icons/hi2/HiMiniCheckCircle.js +0 -24
- package/dist/icons/hi2/HiMiniLanguage.js +0 -28
- package/dist/icons/hi2/HiMiniMinusCircle.js +0 -24
- package/dist/icons/hi2/HiMiniXCircle.js +0 -24
- package/dist/icons/hi2/HiSparkles.js +0 -24
- package/dist/icons/im/ImSpinner5.js +0 -19
- package/dist/icons/io/IoIosNotifications.js +0 -16
- package/dist/icons/io/IoMdBuild.js +0 -16
- package/dist/icons/io/IoMdClose.js +0 -16
- package/dist/icons/io5/IoCloudUploadOutline.js +0 -32
- package/dist/icons/io5/IoDocumentTextOutline.js +0 -31
- package/dist/icons/io5/IoFileTrayFullOutline.js +0 -31
- package/dist/icons/io5/IoHeart.js +0 -16
- package/dist/icons/io5/IoHeartDislike.js +0 -16
- package/dist/icons/io5/IoHeartOutline.js +0 -22
- package/dist/icons/io5/IoInformationCircleOutline.js +0 -50
- package/dist/icons/io5/IoSettingsOutline.js +0 -22
- package/dist/icons/io5/IoWarningOutline.js +0 -40
- package/dist/icons/lu/LuArrowRight.js +0 -27
- package/dist/icons/lu/LuBadgeCheck.js +0 -27
- package/dist/icons/lu/LuBraces.js +0 -27
- package/dist/icons/lu/LuBrainCircuit.js +0 -101
- package/dist/icons/lu/LuCalendar.js +0 -46
- package/dist/icons/lu/LuCheck.js +0 -23
- package/dist/icons/lu/LuChevronLeft.js +0 -23
- package/dist/icons/lu/LuChevronRight.js +0 -23
- package/dist/icons/lu/LuCode.js +0 -27
- package/dist/icons/lu/LuExternalLink.js +0 -35
- package/dist/icons/lu/LuEye.js +0 -31
- package/dist/icons/lu/LuEyeOff.js +0 -40
- package/dist/icons/lu/LuFolderTree.js +0 -40
- package/dist/icons/lu/LuIdCard.js +0 -55
- package/dist/icons/lu/LuKeyboard.js +0 -71
- package/dist/icons/lu/LuLogs.js +0 -65
- package/dist/icons/lu/LuMail.js +0 -33
- package/dist/icons/lu/LuMegaphone.js +0 -27
- package/dist/icons/lu/LuMoon.js +0 -23
- package/dist/icons/lu/LuNetwork.js +0 -63
- package/dist/icons/lu/LuPartyPopper.js +0 -65
- package/dist/icons/lu/LuSettings2.js +0 -48
- package/dist/icons/lu/LuSheet.js +0 -72
- package/dist/icons/lu/LuShield.js +0 -23
- package/dist/icons/lu/LuSun.js +0 -69
- package/dist/icons/lu/LuTextCursorInput.js +0 -45
- package/dist/icons/lu/LuX.js +0 -27
- package/dist/icons/lu/LuZoomIn.js +0 -59
- package/dist/icons/lu/LuZoomOut.js +0 -49
- package/dist/icons/md/MdClear.js +0 -23
- package/dist/icons/md/MdDragHandle.js +0 -23
- package/dist/icons/md/MdInstallDesktop.js +0 -31
- package/dist/icons/md/MdOutlineAttachMoney.js +0 -23
- package/dist/icons/md/MdOutlineMoneyOff.js +0 -23
- package/dist/icons/md/MdPieChart.js +0 -23
- package/dist/icons/md/MdRefresh.js +0 -23
- package/dist/icons/md/MdReplay.js +0 -23
- package/dist/icons/md/MdSmartphone.js +0 -23
- package/dist/icons/pi/PiArrowBendUpRightBold.js +0 -19
- package/dist/icons/pi/PiPlugsConnectedFill.js +0 -19
- package/dist/icons/pi/PiRectangleDashed.js +0 -19
- package/dist/icons/pi/PiShareBold.js +0 -19
- package/dist/icons/si/SiAnthropic.js +0 -19
- package/dist/icons/si/SiHelm.js +0 -19
- package/dist/icons/si/SiKubernetes.js +0 -19
- package/dist/icons/tb/TbAlertTriangle.js +0 -35
- package/dist/icons/tb/TbAlertTriangleFilled.js +0 -19
- package/dist/icons/tb/TbApi.js +0 -40
- package/dist/icons/tb/TbBrain.js +0 -50
- package/dist/icons/tb/TbBuildingTunnel.js +0 -65
- package/dist/icons/tb/TbEdit.js +0 -35
- package/dist/icons/tb/TbLayoutSidebar.js +0 -27
- package/dist/icons/tb/TbLayoutSidebarLeftCollapse.js +0 -35
- package/dist/icons/tb/TbLayoutSidebarRightCollapse.js +0 -35
- package/dist/icons/tb/TbUser.js +0 -27
- package/dist/icons/tb/TbUserOff.js +0 -35
- package/dist/icons/tb/TbWorldShare.js +0 -55
- package/dist/icons/tb/TbWorldWww.js +0 -65
- package/dist/icons/ti/TiArrowSortedDown.js +0 -20
- package/dist/icons/ti/TiArrowSortedUp.js +0 -20
- package/dist/icons/ti/TiArrowUnsorted.js +0 -20
- package/dist/icons/ti/TiCancel.js +0 -20
- package/dist/icons/vsc/VscChromeMinimize.js +0 -19
- package/dist/icons/vsc/VscJson.js +0 -19
- package/dist/icons/vsc/VscLayoutSidebarLeft.js +0 -19
- package/dist/icons/vsc/VscPass.js +0 -27
- package/dist/icons/vsc/VscSplitHorizontal.js +0 -19
- package/dist/icons/vsc/VscTerminalPowershell.js +0 -19
- package/dist/list/ListPager.d.ts +0 -14
- package/dist/list/ListPager.js +0 -62
- package/dist/list/textEntry.d.ts +0 -2
- package/dist/list/textEntry.js +0 -10
- /package/dist/{ai/ui/codeBreaks.d.ts → components/markdownCodeBreaks.d.ts} +0 -0
|
@@ -1,109 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { FaWandMagicSparkles } from "../icons/fa6/FaWandMagicSparkles.js";
|
|
7
|
-
import { FiFile } from "../icons/fi/FiFile.js";
|
|
8
|
-
import { FiFileText } from "../icons/fi/FiFileText.js";
|
|
9
|
-
import { FiHardDrive } from "../icons/fi/FiHardDrive.js";
|
|
10
|
-
import { GoVideo } from "../icons/go/GoVideo.js";
|
|
11
|
-
import { IoDocumentTextOutline } from "../icons/io5/IoDocumentTextOutline.js";
|
|
12
|
-
import { LuSheet } from "../icons/lu/LuSheet.js";
|
|
13
|
-
import { MdRefresh } from "../icons/md/MdRefresh.js";
|
|
14
|
-
import { PiShareBold } from "../icons/pi/PiShareBold.js";
|
|
15
|
-
import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
|
|
16
|
-
import { positionKeys } from "../components/keys.js";
|
|
17
|
-
import { useNotify, useProvisionCorsRules, useStrings } from "../components/Provider.js";
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { CustomizeIcon, DiskIcon, FileIcon, FileTextIcon, FolderIcon, ImageIcon, PdfIcon, RefreshIcon, RetryIcon, ShareIcon, SpreadsheetIcon, UserIcon, VideoIcon, WarningIcon, ZipIcon } from "../icons.js";
|
|
3
|
+
import { toast } from "../components/Toast.js";
|
|
4
|
+
import { usePersistedState, useProvisionCorsRules, useSlots, useStrings } from "../components/Provider.js";
|
|
5
|
+
import { Button } from "../components/Button.js";
|
|
18
6
|
import Callout from "../components/Callout.js";
|
|
7
|
+
import { ProgressBar } from "../components/Meter.js";
|
|
8
|
+
import { Skeleton } from "../components/Skeleton.js";
|
|
9
|
+
import { formatBytes } from "../format.js";
|
|
10
|
+
import { useElapsed } from "../components/relativeTime.js";
|
|
19
11
|
import { ListSkeleton } from "../list/ListTable.js";
|
|
20
|
-
import {
|
|
12
|
+
import { getFileExtension } from "./lib/utils.js";
|
|
21
13
|
import { CorsError } from "./lib/errors.js";
|
|
22
|
-
import { clsx } from "clsx";
|
|
23
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
24
|
-
import {
|
|
25
|
-
import { useLocalStorage } from "usehooks-ts";
|
|
15
|
+
import { useState, useTransition } from "react";
|
|
26
16
|
//#region src/file-explorer/helpers.tsx
|
|
27
17
|
var SIDEBAR_WIDTH_STORAGE_KEY = "fileExplorerSidebarWidth";
|
|
28
18
|
var contentTypeIconMap = [
|
|
29
19
|
{
|
|
30
20
|
pattern: /^image\//,
|
|
31
|
-
icon: /* @__PURE__ */ jsx(
|
|
21
|
+
icon: /* @__PURE__ */ jsx(ImageIcon, { className: "h-4 w-4 text-blue-500" })
|
|
32
22
|
},
|
|
33
23
|
{
|
|
34
24
|
pattern: /^video\//,
|
|
35
|
-
icon: /* @__PURE__ */ jsx(
|
|
25
|
+
icon: /* @__PURE__ */ jsx(VideoIcon, { className: "h-4 w-4 text-purple-500" })
|
|
36
26
|
},
|
|
37
27
|
{
|
|
38
28
|
pattern: /^application\/pdf$/,
|
|
39
|
-
icon: /* @__PURE__ */ jsx(
|
|
29
|
+
icon: /* @__PURE__ */ jsx(PdfIcon, { className: "h-4 w-4 text-red-500" })
|
|
40
30
|
},
|
|
41
31
|
{
|
|
42
32
|
pattern: /(spreadsheet|csv|excel)/,
|
|
43
|
-
icon: /* @__PURE__ */ jsx(
|
|
33
|
+
icon: /* @__PURE__ */ jsx(SpreadsheetIcon, { className: "h-4 w-4 text-green-500" })
|
|
44
34
|
},
|
|
45
35
|
{
|
|
46
36
|
pattern: /(document|word)/,
|
|
47
|
-
icon: /* @__PURE__ */ jsx(
|
|
37
|
+
icon: /* @__PURE__ */ jsx(FileTextIcon, { className: "h-4 w-4 text-blue-400" })
|
|
48
38
|
},
|
|
49
39
|
{
|
|
50
40
|
pattern: /(javascript|json|css|html)/,
|
|
51
|
-
icon: /* @__PURE__ */ jsx(
|
|
41
|
+
icon: /* @__PURE__ */ jsx(FileTextIcon, { className: "h-4 w-4 text-yellow-500" })
|
|
52
42
|
},
|
|
53
43
|
{
|
|
54
44
|
pattern: /(zip|gzip|tar)/,
|
|
55
|
-
icon: /* @__PURE__ */ jsx(
|
|
45
|
+
icon: /* @__PURE__ */ jsx(ZipIcon, { className: "h-4 w-4 text-purple-600" })
|
|
56
46
|
}
|
|
57
47
|
];
|
|
58
48
|
var extensionIconMap = [
|
|
59
49
|
{
|
|
60
50
|
pattern: /^(jpe?g|png|gif|svg|webp)$/i,
|
|
61
|
-
icon: /* @__PURE__ */ jsx(
|
|
51
|
+
icon: /* @__PURE__ */ jsx(ImageIcon, { className: "h-4 w-4 text-blue-500" })
|
|
62
52
|
},
|
|
63
53
|
{
|
|
64
54
|
pattern: /^(mp4|mov|avi|mkv)$/i,
|
|
65
|
-
icon: /* @__PURE__ */ jsx(
|
|
55
|
+
icon: /* @__PURE__ */ jsx(VideoIcon, { className: "h-4 w-4 text-purple-500" })
|
|
66
56
|
},
|
|
67
57
|
{
|
|
68
58
|
pattern: /^pdf$/i,
|
|
69
|
-
icon: /* @__PURE__ */ jsx(
|
|
59
|
+
icon: /* @__PURE__ */ jsx(PdfIcon, { className: "h-4 w-4 text-red-500" })
|
|
70
60
|
},
|
|
71
61
|
{
|
|
72
62
|
pattern: /^(xlsx?|csv|ods)$/i,
|
|
73
|
-
icon: /* @__PURE__ */ jsx(
|
|
63
|
+
icon: /* @__PURE__ */ jsx(SpreadsheetIcon, { className: "h-4 w-4 text-green-500" })
|
|
74
64
|
},
|
|
75
65
|
{
|
|
76
66
|
pattern: /^(docx?|odt)$/i,
|
|
77
|
-
icon: /* @__PURE__ */ jsx(
|
|
67
|
+
icon: /* @__PURE__ */ jsx(FileTextIcon, { className: "h-4 w-4 text-blue-400" })
|
|
78
68
|
},
|
|
79
69
|
{
|
|
80
70
|
pattern: /^(js|ts|json|css|html|md|txt)$/i,
|
|
81
|
-
icon: /* @__PURE__ */ jsx(
|
|
71
|
+
icon: /* @__PURE__ */ jsx(FileTextIcon, { className: "h-4 w-4 text-yellow-500" })
|
|
82
72
|
},
|
|
83
73
|
{
|
|
84
74
|
pattern: /^(zip|gz|gzip|tar|rar)$/i,
|
|
85
|
-
icon: /* @__PURE__ */ jsx(
|
|
75
|
+
icon: /* @__PURE__ */ jsx(ZipIcon, { className: "h-4 w-4 text-purple-600" })
|
|
86
76
|
}
|
|
87
77
|
];
|
|
88
|
-
function
|
|
78
|
+
function StorageImage({ node }) {
|
|
79
|
+
const { storageIconUrl } = useSlots();
|
|
80
|
+
const alt = useStrings().fileExplorer.chrome.storageIconAlt;
|
|
81
|
+
const fallbackSrc = node.storageNodeIcon ? storageIconUrl?.({ type: node.storageNodeIcon }) : void 0;
|
|
82
|
+
const src = node.storageImageUrl || fallbackSrc;
|
|
83
|
+
if (!src) return /* @__PURE__ */ jsx(DiskIcon, { className: "h-4 w-4 mr-2" });
|
|
84
|
+
return /* @__PURE__ */ jsx("img", {
|
|
85
|
+
className: "h-4 w-4 mr-2",
|
|
86
|
+
src,
|
|
87
|
+
alt,
|
|
88
|
+
onError: (e) => {
|
|
89
|
+
if (fallbackSrc) e.currentTarget.src = fallbackSrc;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function getNodeIcon(node) {
|
|
89
94
|
const isUserNode = !node.storageId;
|
|
90
95
|
const isStorageNode = node.root;
|
|
91
|
-
if (isUserNode) return /* @__PURE__ */ jsx(
|
|
92
|
-
if (isStorageNode && node.storageType === "workspace") return /* @__PURE__ */ jsx(
|
|
93
|
-
if (isStorageNode && node.storageNodeIcon) {
|
|
94
|
-
const storageNodeIcon = node.storageNodeIcon;
|
|
95
|
-
const fallbackSrc = storageIconUrl?.({ type: storageNodeIcon });
|
|
96
|
-
const iconSrc = node.storageImageUrl || fallbackSrc;
|
|
97
|
-
if (!iconSrc) return /* @__PURE__ */ jsx(FiHardDrive, { className: "h-4 w-4 mr-2" });
|
|
98
|
-
return /* @__PURE__ */ jsx("img", {
|
|
99
|
-
className: "h-4 w-4 mr-2",
|
|
100
|
-
src: iconSrc,
|
|
101
|
-
alt: storageIconAlt,
|
|
102
|
-
onError: (e) => {
|
|
103
|
-
if (fallbackSrc) e.currentTarget.src = fallbackSrc;
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
96
|
+
if (isUserNode) return /* @__PURE__ */ jsx(UserIcon, { className: "h-3 w-3 mr-2" });
|
|
97
|
+
if (isStorageNode && node.storageType === "workspace") return /* @__PURE__ */ jsx(DiskIcon, { className: "h-4 w-4 mr-2" });
|
|
98
|
+
if (isStorageNode && node.storageNodeIcon) return /* @__PURE__ */ jsx(StorageImage, { node });
|
|
107
99
|
if (!isStorageNode && node.type === "directory") return null;
|
|
108
100
|
if (node.contentType) {
|
|
109
101
|
for (const { pattern, icon } of contentTypeIconMap) if (pattern.test(node.contentType)) return icon;
|
|
@@ -112,7 +104,7 @@ function getNodeIcon(node, storageIconUrl, storageIconAlt = "Storage icon") {
|
|
|
112
104
|
if (ext) {
|
|
113
105
|
for (const { pattern, icon } of extensionIconMap) if (pattern.test(ext)) return icon;
|
|
114
106
|
}
|
|
115
|
-
return /* @__PURE__ */ jsx(
|
|
107
|
+
return /* @__PURE__ */ jsx(FileIcon, { className: "h-4 w-4 theme-muted-text" });
|
|
116
108
|
}
|
|
117
109
|
function renderUploadNodes(uploadNodes) {
|
|
118
110
|
const sorted = [...uploadNodes].sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
@@ -125,7 +117,7 @@ function renderUploadNodes(uploadNodes) {
|
|
|
125
117
|
while (common < folders.length && common < lastFolders.length && folders[common] === lastFolders[common]) common++;
|
|
126
118
|
const folderElements = folders.slice(common).map((folder, i) => /* @__PURE__ */ jsxs("div", {
|
|
127
119
|
style: { marginLeft: (common + i) * 16 },
|
|
128
|
-
children: [/* @__PURE__ */ jsx(
|
|
120
|
+
children: [/* @__PURE__ */ jsx(FolderIcon, { className: "inline h-3 w-3 mr-1" }), /* @__PURE__ */ jsxs("span", {
|
|
129
121
|
className: "font-semibold",
|
|
130
122
|
children: [folder, "/"]
|
|
131
123
|
})]
|
|
@@ -140,7 +132,7 @@ function renderUploadNodes(uploadNodes) {
|
|
|
140
132
|
className: "ml-2 text-xs theme-muted-text",
|
|
141
133
|
children: [
|
|
142
134
|
"(",
|
|
143
|
-
|
|
135
|
+
formatBytes(node.file.size),
|
|
144
136
|
")"
|
|
145
137
|
]
|
|
146
138
|
})
|
|
@@ -157,7 +149,7 @@ function NoFileSelectedPreview() {
|
|
|
157
149
|
children: [
|
|
158
150
|
/* @__PURE__ */ jsx("div", {
|
|
159
151
|
className: "inline-flex items-center justify-center w-14 h-14 rounded-full theme-muted-panel mb-4",
|
|
160
|
-
children: /* @__PURE__ */ jsx(
|
|
152
|
+
children: /* @__PURE__ */ jsx(DiskIcon, { className: "h-6 w-6 theme-muted-text" })
|
|
161
153
|
}),
|
|
162
154
|
/* @__PURE__ */ jsx("h2", {
|
|
163
155
|
className: "text-base font-semibold mb-1",
|
|
@@ -174,6 +166,7 @@ function NoFileSelectedPreview() {
|
|
|
174
166
|
/** Shown instead of a skeleton that has nothing left to wait for. */
|
|
175
167
|
function NotFoundPreview({ path, onRetry }) {
|
|
176
168
|
const t = useStrings().fileExplorer.notFound;
|
|
169
|
+
const { common } = useStrings();
|
|
177
170
|
const name = path.replace(/\/$/, "").split("/").pop() || path;
|
|
178
171
|
return /* @__PURE__ */ jsx("div", {
|
|
179
172
|
className: "flex-1 flex items-center justify-center p-8",
|
|
@@ -182,7 +175,7 @@ function NotFoundPreview({ path, onRetry }) {
|
|
|
182
175
|
children: [
|
|
183
176
|
/* @__PURE__ */ jsx("div", {
|
|
184
177
|
className: "inline-flex items-center justify-center w-14 h-14 rounded-full theme-muted-panel mb-4",
|
|
185
|
-
children: /* @__PURE__ */ jsx(
|
|
178
|
+
children: /* @__PURE__ */ jsx(DiskIcon, { className: "h-6 w-6 theme-muted-text" })
|
|
186
179
|
}),
|
|
187
180
|
/* @__PURE__ */ jsx("h2", {
|
|
188
181
|
className: "text-base font-semibold mb-1",
|
|
@@ -192,11 +185,11 @@ function NotFoundPreview({ path, onRetry }) {
|
|
|
192
185
|
className: "text-sm theme-muted-text mb-4",
|
|
193
186
|
children: t.description
|
|
194
187
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
|
|
197
|
-
|
|
188
|
+
/* @__PURE__ */ jsx(Button, {
|
|
189
|
+
variant: "primary",
|
|
190
|
+
icon: /* @__PURE__ */ jsx(RetryIcon, {}),
|
|
198
191
|
onClick: onRetry,
|
|
199
|
-
children:
|
|
192
|
+
children: common.retry
|
|
200
193
|
})
|
|
201
194
|
]
|
|
202
195
|
})
|
|
@@ -205,7 +198,7 @@ function NotFoundPreview({ path, onRetry }) {
|
|
|
205
198
|
function CorsIssuePreview({ selectedStorage, onRefresh }) {
|
|
206
199
|
const t = useStrings().fileExplorer.cors;
|
|
207
200
|
const messages = useStrings().fileExplorer.messages;
|
|
208
|
-
const
|
|
201
|
+
const { common } = useStrings();
|
|
209
202
|
const provisionCorsRules = useProvisionCorsRules();
|
|
210
203
|
const [isPending, startTransition] = useTransition();
|
|
211
204
|
const handleAddCorsRules = () => {
|
|
@@ -213,7 +206,6 @@ function CorsIssuePreview({ selectedStorage, onRefresh }) {
|
|
|
213
206
|
startTransition(async () => {
|
|
214
207
|
await addCorsRules({
|
|
215
208
|
provision: provisionCorsRules,
|
|
216
|
-
notify,
|
|
217
209
|
strings: messages,
|
|
218
210
|
csp: selectedStorage?.csp,
|
|
219
211
|
type: selectedStorage?.type,
|
|
@@ -246,16 +238,16 @@ function CorsIssuePreview({ selectedStorage, onRefresh }) {
|
|
|
246
238
|
]
|
|
247
239
|
}), /* @__PURE__ */ jsxs("div", {
|
|
248
240
|
className: "flex gap-3 justify-center",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
250
|
-
|
|
251
|
-
|
|
241
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
242
|
+
variant: "primary",
|
|
243
|
+
icon: /* @__PURE__ */ jsx(RefreshIcon, {}),
|
|
252
244
|
onClick: onRefresh ? () => onRefresh() : void 0,
|
|
253
|
-
children:
|
|
254
|
-
}), provisionCorsRules && /* @__PURE__ */
|
|
255
|
-
|
|
256
|
-
|
|
245
|
+
children: common.retry
|
|
246
|
+
}), provisionCorsRules && /* @__PURE__ */ jsx(Button, {
|
|
247
|
+
variant: "primary",
|
|
248
|
+
icon: /* @__PURE__ */ jsx(CustomizeIcon, {}),
|
|
257
249
|
onClick: handleAddCorsRules,
|
|
258
|
-
children:
|
|
250
|
+
children: t.actions.addRules
|
|
259
251
|
})]
|
|
260
252
|
})]
|
|
261
253
|
});
|
|
@@ -263,14 +255,8 @@ function CorsIssuePreview({ selectedStorage, onRefresh }) {
|
|
|
263
255
|
var CORS_PROPAGATION_BUDGET_MS = 6e4;
|
|
264
256
|
function CorsPropagatingPreview() {
|
|
265
257
|
const t = useStrings().fileExplorer.cors.propagating;
|
|
266
|
-
const [
|
|
267
|
-
|
|
268
|
-
const start = Date.now();
|
|
269
|
-
const id = setInterval(() => {
|
|
270
|
-
setElapsedMs(Date.now() - start);
|
|
271
|
-
}, 500);
|
|
272
|
-
return () => clearInterval(id);
|
|
273
|
-
}, []);
|
|
258
|
+
const [start] = useState(Date.now);
|
|
259
|
+
const elapsedMs = useElapsed(start) ?? 0;
|
|
274
260
|
const totalSeconds = Math.floor(elapsedMs / 1e3);
|
|
275
261
|
const mm = String(Math.floor(totalSeconds / 60)).padStart(2, "0");
|
|
276
262
|
const ss = String(totalSeconds % 60).padStart(2, "0");
|
|
@@ -334,15 +320,11 @@ function CorsPropagatingPreview() {
|
|
|
334
320
|
})
|
|
335
321
|
]
|
|
336
322
|
}),
|
|
337
|
-
/* @__PURE__ */ jsx(
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
className: "h-full bg-blue-500 transition-[width] duration-500 ease-linear",
|
|
343
|
-
style: { width: `${progressPct}%` }
|
|
344
|
-
})
|
|
345
|
-
})
|
|
323
|
+
/* @__PURE__ */ jsx(ProgressBar, {
|
|
324
|
+
value: progressPct,
|
|
325
|
+
size: "sm",
|
|
326
|
+
"aria-label": t.stages.propagating,
|
|
327
|
+
className: "w-full max-w-xs mb-3"
|
|
346
328
|
}),
|
|
347
329
|
/* @__PURE__ */ jsxs("div", {
|
|
348
330
|
className: "flex items-center gap-2 theme-muted-text text-xs font-mono tabular-nums",
|
|
@@ -367,7 +349,7 @@ function PropagationStage({ status, label }) {
|
|
|
367
349
|
return /* @__PURE__ */ jsxs("li", {
|
|
368
350
|
className: "flex flex-col items-center gap-1.5",
|
|
369
351
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
370
|
-
className:
|
|
352
|
+
className: cx("relative flex items-center justify-center w-6 h-6 rounded-full border transition-colors", status === "done" && "bg-green-500 border-green-500 text-white", status === "active" && "border-blue-500", status === "pending" && "theme-border"),
|
|
371
353
|
children: [
|
|
372
354
|
status === "done" && /* @__PURE__ */ jsx("svg", {
|
|
373
355
|
viewBox: "0 0 16 16",
|
|
@@ -384,7 +366,7 @@ function PropagationStage({ status, label }) {
|
|
|
384
366
|
status === "pending" && /* @__PURE__ */ jsx("span", { className: "inline-flex h-1.5 w-1.5 rounded-full theme-muted-text opacity-60" })
|
|
385
367
|
]
|
|
386
368
|
}), /* @__PURE__ */ jsx("span", {
|
|
387
|
-
className:
|
|
369
|
+
className: cx("text-[11px] uppercase tracking-wider", status === "pending" ? "theme-muted-text opacity-60" : "theme-text"),
|
|
388
370
|
children: label
|
|
389
371
|
})]
|
|
390
372
|
});
|
|
@@ -392,26 +374,27 @@ function PropagationStage({ status, label }) {
|
|
|
392
374
|
function PropagationConnector({ active }) {
|
|
393
375
|
return /* @__PURE__ */ jsx("span", {
|
|
394
376
|
"aria-hidden": "true",
|
|
395
|
-
className:
|
|
377
|
+
className: cx("h-px w-8 -mt-5 transition-colors", active ? "bg-blue-500" : "theme-border border-t")
|
|
396
378
|
});
|
|
397
379
|
}
|
|
398
380
|
function NoDataAvailablePreview({ selectedStorage, error, onRefresh, connectionIssueMessage = null, className, canWrite = true }) {
|
|
399
381
|
const t = useStrings().fileExplorer;
|
|
382
|
+
const { common } = useStrings();
|
|
400
383
|
if (error instanceof CorsError) return /* @__PURE__ */ jsx("div", {
|
|
401
|
-
className:
|
|
384
|
+
className: cx("flex-1 flex items-center justify-center w-full text-center", className),
|
|
402
385
|
children: /* @__PURE__ */ jsx(CorsIssuePreview, {
|
|
403
386
|
selectedStorage,
|
|
404
387
|
onRefresh
|
|
405
388
|
})
|
|
406
389
|
});
|
|
407
390
|
return /* @__PURE__ */ jsx("div", {
|
|
408
|
-
className:
|
|
391
|
+
className: cx("flex-1 flex items-center justify-center w-full text-center", className),
|
|
409
392
|
children: !connectionIssueMessage ? /* @__PURE__ */ jsxs("div", {
|
|
410
393
|
className: "flex flex-col items-center justify-center max-w-sm p-8",
|
|
411
394
|
children: [
|
|
412
395
|
/* @__PURE__ */ jsx("div", {
|
|
413
396
|
className: "inline-flex items-center justify-center w-14 h-14 rounded-full theme-muted-panel mb-4",
|
|
414
|
-
children: /* @__PURE__ */ jsx(
|
|
397
|
+
children: /* @__PURE__ */ jsx(FileIcon, { className: "h-6 w-6 theme-muted-text" })
|
|
415
398
|
}),
|
|
416
399
|
/* @__PURE__ */ jsx("h2", {
|
|
417
400
|
className: "text-base font-semibold mb-1",
|
|
@@ -427,7 +410,7 @@ function NoDataAvailablePreview({ selectedStorage, error, onRefresh, connectionI
|
|
|
427
410
|
children: [
|
|
428
411
|
/* @__PURE__ */ jsx("div", {
|
|
429
412
|
className: "inline-flex items-center justify-center w-14 h-14 rounded-full bg-amber-500/10 mb-4",
|
|
430
|
-
children: /* @__PURE__ */ jsx(
|
|
413
|
+
children: /* @__PURE__ */ jsx(WarningIcon, { className: "h-6 w-6 text-amber-500" })
|
|
431
414
|
}),
|
|
432
415
|
/* @__PURE__ */ jsx("h2", {
|
|
433
416
|
className: "text-base font-semibold mb-1",
|
|
@@ -437,18 +420,18 @@ function NoDataAvailablePreview({ selectedStorage, error, onRefresh, connectionI
|
|
|
437
420
|
className: "text-sm theme-muted-text mb-4",
|
|
438
421
|
children: connectionIssueMessage
|
|
439
422
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
|
|
442
|
-
|
|
423
|
+
/* @__PURE__ */ jsx(Button, {
|
|
424
|
+
variant: "primary",
|
|
425
|
+
icon: /* @__PURE__ */ jsx(RefreshIcon, {}),
|
|
443
426
|
onClick: onRefresh ? () => onRefresh() : void 0,
|
|
444
|
-
children:
|
|
427
|
+
children: common.retry
|
|
445
428
|
})
|
|
446
429
|
]
|
|
447
430
|
})
|
|
448
431
|
});
|
|
449
432
|
}
|
|
450
433
|
function SkeletonPreview() {
|
|
451
|
-
const [sidebarWidth] =
|
|
434
|
+
const [sidebarWidth] = usePersistedState(SIDEBAR_WIDTH_STORAGE_KEY, 300);
|
|
452
435
|
return /* @__PURE__ */ jsxs("div", {
|
|
453
436
|
className: "w-full h-full flex",
|
|
454
437
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -464,7 +447,10 @@ function SkeletonPreview() {
|
|
|
464
447
|
})
|
|
465
448
|
}), /* @__PURE__ */ jsx("div", {
|
|
466
449
|
className: "overflow-auto flex-1 px-2 py-2 space-y-1.5",
|
|
467
|
-
children:
|
|
450
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
451
|
+
count: 6,
|
|
452
|
+
height: 14
|
|
453
|
+
})
|
|
468
454
|
})]
|
|
469
455
|
})
|
|
470
456
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -477,7 +463,7 @@ function DragDropZone({ onDropFiles, children, className = "" }) {
|
|
|
477
463
|
const [isDragging, setIsDragging] = useState(false);
|
|
478
464
|
return /* @__PURE__ */ jsx("div", {
|
|
479
465
|
role: "none",
|
|
480
|
-
className:
|
|
466
|
+
className: cx("transition-[box-shadow,background-color] duration-150", className, isDragging && "ring-1 ring-(--theme-link) ring-inset bg-(--theme-link)/5"),
|
|
481
467
|
onDragOver: (e) => {
|
|
482
468
|
e.preventDefault();
|
|
483
469
|
if (onDropFiles) setIsDragging(true);
|
|
@@ -495,25 +481,26 @@ function DragDropZone({ onDropFiles, children, className = "" }) {
|
|
|
495
481
|
function ShareFileButton({ node, onShare }) {
|
|
496
482
|
const t = useStrings().fileExplorer;
|
|
497
483
|
const [isPending, startTransition] = useTransition();
|
|
498
|
-
return /* @__PURE__ */
|
|
499
|
-
|
|
484
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
485
|
+
variant: "primary",
|
|
486
|
+
size: "sm",
|
|
500
487
|
"aria-label": t.preview.shareFile,
|
|
501
|
-
|
|
488
|
+
icon: /* @__PURE__ */ jsx(ShareIcon, {}),
|
|
502
489
|
onClick: () => {
|
|
503
490
|
startTransition(async () => {
|
|
504
491
|
await onShare(node);
|
|
505
492
|
});
|
|
506
493
|
},
|
|
507
|
-
|
|
508
|
-
children:
|
|
494
|
+
loading: isPending,
|
|
495
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
509
496
|
className: "hidden md:inline",
|
|
510
497
|
children: t.empty.shareThisFile
|
|
511
|
-
})
|
|
498
|
+
})
|
|
512
499
|
});
|
|
513
500
|
}
|
|
514
|
-
async function addCorsRules({ provision,
|
|
501
|
+
async function addCorsRules({ provision, strings, csp, type, username, storageName, onRefresh }) {
|
|
515
502
|
if (!storageName || !username || !csp) {
|
|
516
|
-
|
|
503
|
+
toast.error(strings.corsNoStorage);
|
|
517
504
|
return;
|
|
518
505
|
}
|
|
519
506
|
const res = await provision({
|
|
@@ -523,11 +510,11 @@ async function addCorsRules({ provision, notify, strings, csp, type, username, s
|
|
|
523
510
|
storageName
|
|
524
511
|
});
|
|
525
512
|
if (res.error) {
|
|
526
|
-
|
|
513
|
+
toast.error(res.error);
|
|
527
514
|
return;
|
|
528
515
|
}
|
|
529
516
|
if (!onRefresh) {
|
|
530
|
-
|
|
517
|
+
toast.success(strings.corsAdded);
|
|
531
518
|
return;
|
|
532
519
|
}
|
|
533
520
|
const pollBudgetMs = 9e4;
|
|
@@ -537,12 +524,12 @@ async function addCorsRules({ provision, notify, strings, csp, type, username, s
|
|
|
537
524
|
while (Date.now() < deadline) {
|
|
538
525
|
if (!(await onRefresh({ silent: true }))?.corsError) {
|
|
539
526
|
await onRefresh();
|
|
540
|
-
|
|
527
|
+
toast.success(strings.corsAdded);
|
|
541
528
|
return;
|
|
542
529
|
}
|
|
543
530
|
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
544
531
|
}
|
|
545
|
-
|
|
532
|
+
toast.warning(strings.corsPropagating);
|
|
546
533
|
}
|
|
547
534
|
//#endregion
|
|
548
535
|
export { CorsIssuePreview, DragDropZone, NoDataAvailablePreview, NoFileSelectedPreview, NotFoundPreview, SIDEBAR_WIDTH_STORAGE_KEY, ShareFileButton, SkeletonPreview, getNodeIcon, renderUploadNodes };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IFileExplorerClient } from './fileExplorer.js';
|
|
2
2
|
import type { TreeMap, TreeNode, TStorage, TStorageObject, UploadNode } from './types.js';
|
|
3
|
-
export declare function formatFileSize(bytes: number): string;
|
|
4
3
|
export declare function getFileExtension(filename: string): string | null;
|
|
5
4
|
export declare function getNodeName(node: TStorageObject): string;
|
|
6
5
|
export type TTree = {
|
|
@@ -44,4 +43,3 @@ export declare function getUploadSessionETA(totalLoadedBytes: number, totalSizeB
|
|
|
44
43
|
lastProgressBytes: number;
|
|
45
44
|
shouldUpdateETA: boolean;
|
|
46
45
|
};
|
|
47
|
-
export declare function formatETA(seconds: number): string;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
//#region src/file-explorer/lib/utils.ts
|
|
2
|
-
function formatFileSize(bytes) {
|
|
3
|
-
if (bytes === 0) return "0 B";
|
|
4
|
-
const k = 1024;
|
|
5
|
-
const sizes = [
|
|
6
|
-
"B",
|
|
7
|
-
"KB",
|
|
8
|
-
"MB",
|
|
9
|
-
"GB",
|
|
10
|
-
"TB"
|
|
11
|
-
];
|
|
12
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
13
|
-
return `${Number.parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`;
|
|
14
|
-
}
|
|
15
2
|
function getFileExtension(filename) {
|
|
16
3
|
return filename.match(/\.([a-zA-Z0-9]+)$/)?.[1]?.toLowerCase() ?? null;
|
|
17
4
|
}
|
|
@@ -302,16 +289,5 @@ function getUploadSessionETA(totalLoadedBytes, totalSizeBytes, lastProgressTime,
|
|
|
302
289
|
shouldUpdateETA: false
|
|
303
290
|
};
|
|
304
291
|
}
|
|
305
|
-
function formatETA(seconds) {
|
|
306
|
-
if (seconds <= 0) return "Almost done";
|
|
307
|
-
if (seconds < 5) return "Few seconds";
|
|
308
|
-
if (seconds < 60) return `~ ${seconds}s`;
|
|
309
|
-
if (seconds < 3600) {
|
|
310
|
-
const mins = Math.floor(seconds / 60);
|
|
311
|
-
const secs = seconds % 60;
|
|
312
|
-
return secs > 0 ? `~ ${mins}m ${secs}s` : `~ ${mins}m`;
|
|
313
|
-
}
|
|
314
|
-
return `~ ${Math.floor(seconds / 3600)}h ${Math.ceil(seconds % 3600 / 60)}m`;
|
|
315
|
-
}
|
|
316
292
|
//#endregion
|
|
317
|
-
export { attachmentDisposition, calculateUploadNodesTotalSize, collectObjectKeysToDelete, createTreeBuilder, ensureTrailingSlash,
|
|
293
|
+
export { attachmentDisposition, calculateUploadNodesTotalSize, collectObjectKeysToDelete, createTreeBuilder, ensureTrailingSlash, getDirectoryNameError, getDirectoryObjectPath, getDirectoryPrefixFromNode, getFileExtension, getNodeChildren, getNodeName, getObjectKeyFromNode, getParentPath, getUploadNodesFromDataTransferItems, getUploadSessionETA, getUriScheme, isClientValid, pruneNodesInsideSelectedDirectories, removeLeadingAndTrailingSlashes, removeLeadingSlash };
|