@parallelworks/ui 0.44.0 → 0.46.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/permissions.d.ts +1 -1
- package/dist/ai/agent/permissions.js +1 -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 +22 -35
- 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.d.ts +1 -1
- package/dist/ai/components/ChatStage.js +2 -2
- 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/pasteLanguage.d.ts +1 -1
- package/dist/ai/core/pasteLanguage.js +1 -1
- 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 +200 -83
- package/dist/components/Provider.js +203 -121
- 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 +5 -1
- package/dist/components/Select.js +43 -44
- 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 +5 -3
- package/dist/components/StatusBadge.js +10 -33
- 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/comboboxItems.d.ts +1 -1
- 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/editing.d.ts +1 -1
- 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 +45 -67
- 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/FilePreview/useObjectBlobUrl.js +4 -4
- package/dist/file-explorer/FilePreview/useObjectText.js +4 -4
- package/dist/file-explorer/FilePreview/usePresignedUrl.js +4 -4
- 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/types.d.ts +2 -2
- 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 +109 -190
- 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/fieldItems.d.ts +1 -1
- 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 +2 -3
- package/dist/graph/SuggestionInput.js +2 -4
- 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.d.ts +2 -2
- package/dist/graph/editorPrimitives.js +3 -3
- package/dist/graph/editorRows.js +22 -25
- package/dist/graph/editorStrings.d.ts +18 -21
- package/dist/graph/editorStrings.js +15 -27
- 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 +122 -160
- 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/logviewer/segments.d.ts +1 -1
- package/dist/logviewer/segments.js +1 -1
- 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,22 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { IoMdClose } from "../../icons/io/IoMdClose.js";
|
|
5
|
-
import { LuChevronLeft } from "../../icons/lu/LuChevronLeft.js";
|
|
6
|
-
import { LuChevronRight } from "../../icons/lu/LuChevronRight.js";
|
|
7
|
-
import { LuZoomIn } from "../../icons/lu/LuZoomIn.js";
|
|
8
|
-
import { LuZoomOut } from "../../icons/lu/LuZoomOut.js";
|
|
9
|
-
import { useStrings } from "../../components/Provider.js";
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
2
|
+
import { ChevronLeftIcon, ChevronRightIcon, CloseIcon, DownloadIcon, FileIcon, LinkIcon, ZoomInIcon, ZoomOutIcon } from "../../icons.js";
|
|
3
|
+
import { usePersistedState, useStrings } from "../../components/Provider.js";
|
|
10
4
|
import { Modal } from "../../components/Modal.js";
|
|
11
|
-
import {
|
|
5
|
+
import { IconButton } from "../../components/IconButton.js";
|
|
6
|
+
import { formatBytes } from "../../format.js";
|
|
7
|
+
import { SegmentedControl } from "../../components/SegmentedControl.js";
|
|
12
8
|
import { getPreviewKind } from "./previewType.js";
|
|
13
9
|
import { StreamedBadge } from "./StreamedBadge.js";
|
|
14
10
|
import { usePresignedUrl } from "./usePresignedUrl.js";
|
|
15
11
|
import { FilePreviewViewer } from "./Viewer.js";
|
|
16
|
-
import { clsx } from "clsx";
|
|
17
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
13
|
import { useEffect, useState } from "react";
|
|
19
|
-
import { useLocalStorage } from "usehooks-ts";
|
|
20
14
|
//#region src/file-explorer/FilePreview/index.tsx
|
|
21
15
|
/** Document views run their own chrome and text to the edge of the stage, which
|
|
22
16
|
* full-window bars would float on top of; they get the bars in flow instead. */
|
|
@@ -25,7 +19,8 @@ function isDocumentView(kind) {
|
|
|
25
19
|
}
|
|
26
20
|
function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigate, onClose, onDownload, onCopyUri }) {
|
|
27
21
|
const t = useStrings().fileExplorer;
|
|
28
|
-
const
|
|
22
|
+
const { common } = useStrings();
|
|
23
|
+
const [style, setStyle] = usePersistedState("fileExplorer.previewStyle", "quicklook");
|
|
29
24
|
const [zoom, setZoom] = useState(100);
|
|
30
25
|
const { url, loading: urlLoading, error: urlError } = usePresignedUrl(node, getPresignedUrl, {
|
|
31
26
|
enabled: open,
|
|
@@ -51,11 +46,11 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
51
46
|
const showZoom = kind === "image";
|
|
52
47
|
const floatingChrome = isOverlay && !isDocumentView(kind);
|
|
53
48
|
const topBar = /* @__PURE__ */ jsxs("div", {
|
|
54
|
-
className:
|
|
49
|
+
className: cx("flex items-center justify-between gap-3 px-4 py-3", floatingChrome ? cx("absolute inset-x-0 top-0 z-10 bg-linear-to-b from-black/80 to-transparent text-white", overImage) : "shrink-0 border-b theme-border"),
|
|
55
50
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
56
51
|
className: "flex min-w-0 items-center gap-2.5",
|
|
57
52
|
children: [
|
|
58
|
-
/* @__PURE__ */ jsx(
|
|
53
|
+
/* @__PURE__ */ jsx(FileIcon, { className: cx("h-4 w-4 shrink-0", !floatingChrome && "theme-muted-text") }),
|
|
59
54
|
/* @__PURE__ */ jsx("span", {
|
|
60
55
|
className: "truncate font-semibold",
|
|
61
56
|
children: node.name
|
|
@@ -65,88 +60,89 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
65
60
|
}), /* @__PURE__ */ jsxs("div", {
|
|
66
61
|
className: "flex shrink-0 items-center gap-1.5",
|
|
67
62
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
className:
|
|
70
|
-
children:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
63
|
+
/* @__PURE__ */ jsx("div", {
|
|
64
|
+
className: "mr-1",
|
|
65
|
+
children: /* @__PURE__ */ jsx(SegmentedControl, {
|
|
66
|
+
label: t.preview.previewLayout,
|
|
67
|
+
value: style,
|
|
68
|
+
onValueChange: setStyle,
|
|
69
|
+
options: [{
|
|
70
|
+
value: "quicklook",
|
|
71
|
+
label: t.preview.quickLook
|
|
72
|
+
}, {
|
|
73
|
+
value: "overlay",
|
|
74
|
+
label: t.preview.fullWindow
|
|
75
|
+
}]
|
|
76
|
+
})
|
|
81
77
|
}),
|
|
82
|
-
/* @__PURE__ */ jsx(
|
|
83
|
-
|
|
78
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
79
|
+
size: "md",
|
|
84
80
|
label: t.preview.copyUri,
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
icon: /* @__PURE__ */ jsx(LinkIcon, {}),
|
|
82
|
+
onClick: () => onCopyUri(node)
|
|
87
83
|
}),
|
|
88
|
-
/* @__PURE__ */ jsx(
|
|
89
|
-
|
|
90
|
-
label:
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
85
|
+
size: "md",
|
|
86
|
+
label: common.download,
|
|
87
|
+
icon: /* @__PURE__ */ jsx(DownloadIcon, {}),
|
|
88
|
+
onClick: () => onDownload(node)
|
|
93
89
|
}),
|
|
94
|
-
/* @__PURE__ */ jsx(
|
|
95
|
-
|
|
96
|
-
label:
|
|
97
|
-
|
|
98
|
-
|
|
90
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
91
|
+
size: "md",
|
|
92
|
+
label: common.close,
|
|
93
|
+
icon: /* @__PURE__ */ jsx(CloseIcon, {}),
|
|
94
|
+
onClick: onClose
|
|
99
95
|
})
|
|
100
96
|
]
|
|
101
97
|
})]
|
|
102
98
|
});
|
|
103
99
|
const footer = /* @__PURE__ */ jsxs("div", {
|
|
104
|
-
className:
|
|
100
|
+
className: cx("flex items-center justify-between gap-4 px-4 py-2.5", floatingChrome ? cx("absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/80 to-transparent text-white", overImage) : "shrink-0 border-t theme-border"),
|
|
105
101
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
106
|
-
className:
|
|
107
|
-
children: [typeof node.size === "number" &&
|
|
102
|
+
className: cx("text-xs", !floatingChrome && "theme-muted-text"),
|
|
103
|
+
children: [typeof node.size === "number" && formatBytes(node.size), node.contentType && ` · ${node.contentType}`]
|
|
108
104
|
}), /* @__PURE__ */ jsxs("div", {
|
|
109
105
|
className: "flex items-center gap-3",
|
|
110
106
|
children: [showZoom && /* @__PURE__ */ jsxs("div", {
|
|
111
|
-
className:
|
|
107
|
+
className: cx("flex items-center gap-1 rounded-lg p-0.5", floatingChrome ? "bg-white/10" : "theme-muted-panel"),
|
|
112
108
|
children: [
|
|
113
|
-
/* @__PURE__ */ jsx(
|
|
114
|
-
|
|
115
|
-
label:
|
|
109
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
110
|
+
size: "xs",
|
|
111
|
+
label: common.zoomOut,
|
|
116
112
|
onClick: () => setZoom((z) => Math.max(25, z - 25)),
|
|
117
|
-
|
|
113
|
+
icon: /* @__PURE__ */ jsx(ZoomOutIcon, {})
|
|
118
114
|
}),
|
|
119
115
|
/* @__PURE__ */ jsxs("span", {
|
|
120
116
|
className: "min-w-11 text-center text-xs tabular-nums",
|
|
121
117
|
children: [zoom, "%"]
|
|
122
118
|
}),
|
|
123
|
-
/* @__PURE__ */ jsx(
|
|
124
|
-
|
|
125
|
-
label:
|
|
119
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
120
|
+
size: "xs",
|
|
121
|
+
label: common.zoomIn,
|
|
126
122
|
onClick: () => setZoom((z) => Math.min(400, z + 25)),
|
|
127
|
-
|
|
123
|
+
icon: /* @__PURE__ */ jsx(ZoomInIcon, {})
|
|
128
124
|
})
|
|
129
125
|
]
|
|
130
126
|
}), /* @__PURE__ */ jsxs("div", {
|
|
131
127
|
className: "flex items-center gap-1",
|
|
132
128
|
children: [
|
|
133
|
-
/* @__PURE__ */ jsx(
|
|
134
|
-
|
|
129
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
130
|
+
size: "xs",
|
|
135
131
|
label: t.preview.previousFile,
|
|
136
132
|
disabled: !hasPrev,
|
|
137
133
|
onClick: goPrev,
|
|
138
|
-
|
|
134
|
+
icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
|
|
139
135
|
}),
|
|
140
136
|
/* @__PURE__ */ jsx("span", {
|
|
141
137
|
className: "min-w-14 text-center text-xs tabular-nums",
|
|
142
138
|
children: index >= 0 ? `${index + 1} / ${siblings.length}` : ""
|
|
143
139
|
}),
|
|
144
|
-
/* @__PURE__ */ jsx(
|
|
145
|
-
|
|
140
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
141
|
+
size: "xs",
|
|
146
142
|
label: t.preview.nextFile,
|
|
147
143
|
disabled: !hasNext,
|
|
148
144
|
onClick: goNext,
|
|
149
|
-
|
|
145
|
+
icon: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
150
146
|
})
|
|
151
147
|
]
|
|
152
148
|
})]
|
|
@@ -172,7 +168,7 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
172
168
|
panel: false,
|
|
173
169
|
"aria-label": node.name,
|
|
174
170
|
backdropClassName: isOverlay ? "bg-[rgba(1,4,9,.94)]" : "bg-[rgba(1,4,9,.62)] backdrop-blur-[3px]",
|
|
175
|
-
className:
|
|
171
|
+
className: cx("flex flex-col", isOverlay ? "fixed inset-0" : "relative h-[min(780px,90vh)] w-[min(1120px,94vw)] overflow-hidden rounded-2xl border theme-border shadow-2xl", floatingChrome ? "bg-transparent" : "bg-(--theme-panel-bg)"),
|
|
176
172
|
onKeyDown: (e) => {
|
|
177
173
|
if (e.key === "ArrowRight") goNext();
|
|
178
174
|
else if (e.key === "ArrowLeft") goPrev();
|
|
@@ -195,44 +191,16 @@ function FilePreview({ open, node, siblings, storage, getPresignedUrl, onNavigat
|
|
|
195
191
|
]
|
|
196
192
|
});
|
|
197
193
|
}
|
|
198
|
-
|
|
199
|
-
return /* @__PURE__ */ jsx("button", {
|
|
200
|
-
type: "button",
|
|
201
|
-
onClick,
|
|
202
|
-
className: clsx("cursor-pointer whitespace-nowrap rounded-md px-2.5 py-1 text-[11.5px] font-medium transition-colors", active ? "bg-(--theme-element) text-(--theme-element-text)" : overlayChrome ? "text-white/70 hover:text-white" : "theme-muted-text hover:theme-text"),
|
|
203
|
-
children
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
function ChromeButton({ overlay, label, onClick, children }) {
|
|
207
|
-
return /* @__PURE__ */ jsx("button", {
|
|
208
|
-
type: "button",
|
|
209
|
-
"aria-label": label,
|
|
210
|
-
title: label,
|
|
211
|
-
onClick,
|
|
212
|
-
className: clsx("flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg transition-colors", overlay ? "text-white/90 hover:bg-white/15" : "theme-muted-text hover:theme-hover hover:theme-text"),
|
|
213
|
-
children
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
function MiniButton({ overlay, label, onClick, disabled, children }) {
|
|
217
|
-
return /* @__PURE__ */ jsx("button", {
|
|
218
|
-
type: "button",
|
|
219
|
-
"aria-label": label,
|
|
220
|
-
title: label,
|
|
221
|
-
onClick,
|
|
222
|
-
disabled,
|
|
223
|
-
className: clsx("flex h-6 w-7 items-center justify-center rounded-md transition-colors", disabled ? "cursor-not-allowed opacity-40" : clsx("cursor-pointer", overlay ? "hover:bg-white/15" : "hover:theme-hover")),
|
|
224
|
-
children
|
|
225
|
-
});
|
|
226
|
-
}
|
|
194
|
+
var overImage = "[--theme-app:#fff] [--theme-muted-text-color:rgb(255_255_255/0.8)] [--theme-muted-panel-bg:rgb(255_255_255/0.15)]";
|
|
227
195
|
function EdgeButton({ side, label, disabled, onClick }) {
|
|
228
196
|
return /* @__PURE__ */ jsx("button", {
|
|
229
197
|
type: "button",
|
|
230
198
|
"aria-label": label,
|
|
231
199
|
disabled,
|
|
232
200
|
onClick,
|
|
233
|
-
className:
|
|
201
|
+
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"),
|
|
234
202
|
style: { backgroundColor: "rgba(22,27,34,.7)" },
|
|
235
|
-
children: side === "left" ? /* @__PURE__ */ jsx(
|
|
203
|
+
children: side === "left" ? /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "h-6 w-6" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-6 w-6" })
|
|
236
204
|
});
|
|
237
205
|
}
|
|
238
206
|
//#endregion
|
|
@@ -34,7 +34,7 @@ function useObjectBlobUrl(url, { maxBytes, knownSize, mimeType, cacheKey }) {
|
|
|
34
34
|
});
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
let
|
|
37
|
+
let canceled = false;
|
|
38
38
|
const record = loadPreviewContent(cacheKey, async (signal) => {
|
|
39
39
|
const response = await fetchPreviewObject(cacheKey, url, signal);
|
|
40
40
|
const { bytes, tooLarge: exceeded } = await readCappedBytes(response, maxBytes);
|
|
@@ -52,17 +52,17 @@ function useObjectBlobUrl(url, { maxBytes, knownSize, mimeType, cacheKey }) {
|
|
|
52
52
|
loading: true
|
|
53
53
|
});
|
|
54
54
|
record.promise.then((result) => {
|
|
55
|
-
if (!
|
|
55
|
+
if (!canceled) setState(toState(result));
|
|
56
56
|
}).catch((err) => {
|
|
57
57
|
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
58
|
-
if (!
|
|
58
|
+
if (!canceled) setState({
|
|
59
59
|
...IDLE,
|
|
60
60
|
error: err instanceof Error ? err.message : "Failed to load file",
|
|
61
61
|
corsError: err instanceof CorsError
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
64
|
return () => {
|
|
65
|
-
|
|
65
|
+
canceled = true;
|
|
66
66
|
};
|
|
67
67
|
}, [
|
|
68
68
|
url,
|
|
@@ -60,7 +60,7 @@ function useObjectText(url, { maxBytes, maxLines, knownSize, cacheKey, tail = fa
|
|
|
60
60
|
});
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
|
-
let
|
|
63
|
+
let canceled = false;
|
|
64
64
|
const record = loadPreviewContent(key, (signal) => readObjectText(signal, {
|
|
65
65
|
url,
|
|
66
66
|
cacheKey,
|
|
@@ -74,17 +74,17 @@ function useObjectText(url, { maxBytes, maxLines, knownSize, cacheKey, tail = fa
|
|
|
74
74
|
loading: true
|
|
75
75
|
});
|
|
76
76
|
record.promise.then((result) => {
|
|
77
|
-
if (!
|
|
77
|
+
if (!canceled) setState(toState(result));
|
|
78
78
|
}).catch((err) => {
|
|
79
79
|
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
80
|
-
if (!
|
|
80
|
+
if (!canceled) setState({
|
|
81
81
|
...IDLE,
|
|
82
82
|
error: err instanceof Error ? err.message : "Failed to load file",
|
|
83
83
|
corsError: err instanceof CorsError
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
return () => {
|
|
87
|
-
|
|
87
|
+
canceled = true;
|
|
88
88
|
};
|
|
89
89
|
}, [
|
|
90
90
|
url,
|
|
@@ -46,7 +46,7 @@ function usePresignedUrl(node, getPresignedUrl, { enabled, linkErrorMessage }) {
|
|
|
46
46
|
});
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
let
|
|
49
|
+
let canceled = false;
|
|
50
50
|
const record = loadPreviewUrl(path, () => getUrlRef.current(node));
|
|
51
51
|
setState(record.value ? toState(record.value, linkErrorRef.current) : {
|
|
52
52
|
url: null,
|
|
@@ -54,16 +54,16 @@ function usePresignedUrl(node, getPresignedUrl, { enabled, linkErrorMessage }) {
|
|
|
54
54
|
error: null
|
|
55
55
|
});
|
|
56
56
|
record.promise.then((result) => {
|
|
57
|
-
if (!
|
|
57
|
+
if (!canceled) setState(toState(result, linkErrorRef.current));
|
|
58
58
|
}).catch((err) => {
|
|
59
|
-
if (!
|
|
59
|
+
if (!canceled) setState({
|
|
60
60
|
url: null,
|
|
61
61
|
loading: false,
|
|
62
62
|
error: err instanceof Error ? err.message : linkErrorRef.current
|
|
63
63
|
});
|
|
64
64
|
});
|
|
65
65
|
return () => {
|
|
66
|
-
|
|
66
|
+
canceled = true;
|
|
67
67
|
};
|
|
68
68
|
}, [path]);
|
|
69
69
|
const cached = path ? peekPreviewUrl(path) : void 0;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { PreviewIcon } from "../icons.js";
|
|
2
3
|
import { Tooltip } from "../components/Tooltip.js";
|
|
3
4
|
import { useStrings } from "../components/Provider.js";
|
|
5
|
+
import { formatBytes } from "../format.js";
|
|
6
|
+
import { RelativeTime } from "../components/relativeTime.js";
|
|
4
7
|
import { Table } from "../components/Table.js";
|
|
5
8
|
import { RowSelectCheckbox } from "../list/ListTable.js";
|
|
6
9
|
import { MoreButton, rowContextMenuProps, useRowMenuActive } from "../list/rowMenu.js";
|
|
7
|
-
import { formatFileSize } from "./lib/utils.js";
|
|
8
|
-
import { clsx } from "clsx";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
import { DateTime } from "luxon";
|
|
11
12
|
var ROW_HEIGHT_TALL = 52.25;
|
|
@@ -27,7 +28,7 @@ function UserRow({ node, icon, storageCount, getItems, openMenu, onOpen }) {
|
|
|
27
28
|
onOpen(node);
|
|
28
29
|
};
|
|
29
30
|
return /* @__PURE__ */ jsxs("tr", {
|
|
30
|
-
className:
|
|
31
|
+
className: cx("group cursor-pointer", menuActive ? "theme-hover" : "hover:theme-hover"),
|
|
31
32
|
onClick: handleRowClick,
|
|
32
33
|
...rowContextMenuProps(openRowMenu, getItems),
|
|
33
34
|
children: [
|
|
@@ -79,7 +80,7 @@ function FileRow({ node, icon, rowId, rowIndex, active, checked, canPreview, get
|
|
|
79
80
|
id: rowId,
|
|
80
81
|
"aria-rowindex": rowIndex,
|
|
81
82
|
"aria-selected": checked,
|
|
82
|
-
className:
|
|
83
|
+
className: cx("group", checked ? "bg-blue-500/5" : menuActive ? "theme-hover" : "hover:theme-hover", active && "group-focus-visible/grid:ring-1 group-focus-visible/grid:ring-inset group-focus-visible/grid:ring-(--theme-link)", "cursor-pointer"),
|
|
83
84
|
onClick: handleRowClick,
|
|
84
85
|
style: { height: fileRowHeight(node) },
|
|
85
86
|
...rowContextMenuProps(openRowMenu, getItems),
|
|
@@ -113,7 +114,7 @@ function FileRow({ node, icon, rowId, rowIndex, active, checked, canPreview, get
|
|
|
113
114
|
}),
|
|
114
115
|
/* @__PURE__ */ jsx(Table.Item, {
|
|
115
116
|
className: "truncate py-2.5 text-sm tabular-nums text-(--theme-muted-text-color)",
|
|
116
|
-
children: typeof node.size === "number" ?
|
|
117
|
+
children: typeof node.size === "number" ? formatBytes(node.size) : "—"
|
|
117
118
|
}),
|
|
118
119
|
/* @__PURE__ */ jsx(Table.Item, {
|
|
119
120
|
className: "truncate py-2.5 text-xs uppercase tracking-wider text-(--theme-muted-text-color)",
|
|
@@ -121,13 +122,7 @@ function FileRow({ node, icon, rowId, rowIndex, active, checked, canPreview, get
|
|
|
121
122
|
}),
|
|
122
123
|
/* @__PURE__ */ jsx(Table.Item, {
|
|
123
124
|
className: "truncate py-2.5 text-sm text-(--theme-muted-text-color)",
|
|
124
|
-
children: !isDir && modifiedDt?.isValid ? /* @__PURE__ */ jsx(
|
|
125
|
-
content: modifiedDt.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS),
|
|
126
|
-
children: /* @__PURE__ */ jsx("time", {
|
|
127
|
-
dateTime: modifiedDt.toISO() ?? void 0,
|
|
128
|
-
children: modifiedDt.toRelative()
|
|
129
|
-
})
|
|
130
|
-
}) : "—"
|
|
125
|
+
children: !isDir && modifiedDt?.isValid ? /* @__PURE__ */ jsx(RelativeTime, { value: modifiedDt }) : "—"
|
|
131
126
|
}),
|
|
132
127
|
/* @__PURE__ */ jsx(Table.Item, {
|
|
133
128
|
className: "relative py-2.5",
|
|
@@ -143,8 +138,8 @@ function FileRow({ node, icon, rowId, rowIndex, active, checked, canPreview, get
|
|
|
143
138
|
e.stopPropagation();
|
|
144
139
|
onPreview(node);
|
|
145
140
|
},
|
|
146
|
-
className:
|
|
147
|
-
children: /* @__PURE__ */ jsx(
|
|
141
|
+
className: cx("rounded p-1 text-(--theme-muted-text-color) transition-colors hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app) [&>svg]:h-4 [&>svg]:w-4", menuActive ? "opacity-100" : "opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),
|
|
142
|
+
children: /* @__PURE__ */ jsx(PreviewIcon, {})
|
|
148
143
|
})
|
|
149
144
|
}), /* @__PURE__ */ jsx(MoreButton, {
|
|
150
145
|
open: menuActive,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FiFile } from "../icons/fi/FiFile.js";
|
|
3
|
-
import { useSlots, useStrings } from "../components/Provider.js";
|
|
1
|
+
import { FileIcon, FolderIcon } from "../icons.js";
|
|
4
2
|
import { canPreview } from "./FilePreview/previewType.js";
|
|
5
3
|
import { getNodeIcon } from "./helpers.js";
|
|
6
4
|
import { FileRow } from "./FileRow.js";
|
|
@@ -25,8 +23,6 @@ function spacerHeights(items, totalSize, scrollMargin) {
|
|
|
25
23
|
/** Must stay a single child of `<Table>`: Table re-keys children by traversal
|
|
26
24
|
* index, so a count that varied with scroll position would remount every row. */
|
|
27
25
|
function FileRowsWindow({ items, padTop, padBottom, nodes, checkedItems, activeIndex, rowIdPrefix, scrollEl, loadMore, getItems, openMenu, onOpen, onToggleCheck, onPreview }) {
|
|
28
|
-
const { storageIconUrl } = useSlots();
|
|
29
|
-
const storageIconAlt = useStrings().fileExplorer.chrome.storageIconAlt;
|
|
30
26
|
useNestedScrollerWarning(scrollEl, nodes.length);
|
|
31
27
|
useRowPitchAudit(scrollEl, nodes, items);
|
|
32
28
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -42,7 +38,7 @@ function FileRowsWindow({ items, padTop, padBottom, nodes, checkedItems, activeI
|
|
|
42
38
|
root: scrollEl,
|
|
43
39
|
onLoadMore: loadMore.onLoadMore
|
|
44
40
|
}, "load-more") : null;
|
|
45
|
-
const icon = getNodeIcon(node
|
|
41
|
+
const icon = getNodeIcon(node) ?? (node.type === "directory" ? /* @__PURE__ */ jsx(FolderIcon, { className: "h-4 w-4 text-sky-500/80" }) : /* @__PURE__ */ jsx(FileIcon, { className: "h-4 w-4 theme-muted-text" }));
|
|
46
42
|
return /* @__PURE__ */ jsx(FileRow, {
|
|
47
43
|
rowId: `${rowIdPrefix}-${item.index}`,
|
|
48
44
|
rowIndex: item.index + 2,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
1
2
|
import { Table } from "../components/Table.js";
|
|
2
3
|
import { listTableFixedProps } from "../list/ListTable.js";
|
|
3
4
|
import { fileRowHeight } from "./FileRow.js";
|
|
4
5
|
import { FileRowsWindow, spacerHeights } from "./FileRowsWindow.js";
|
|
5
6
|
import { FileTableHeaders } from "./FileTableHeaders.js";
|
|
6
|
-
import { clsx } from "clsx";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
@@ -133,7 +133,7 @@ function FileTable({ nodes, checkedItems, allSelected, someSelected, onSelectAll
|
|
|
133
133
|
className: "h-full overflow-auto",
|
|
134
134
|
children: /* @__PURE__ */ jsxs(Table, {
|
|
135
135
|
...listTableFixedProps,
|
|
136
|
-
className:
|
|
136
|
+
className: cx(listTableFixedProps.className, "group/grid focus:outline-none"),
|
|
137
137
|
wrapperClassName: "overflow-x-auto",
|
|
138
138
|
tableProps: {
|
|
139
139
|
role: "grid",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useStrings } from "../components/Provider.js";
|
|
2
|
+
import { Checkbox } from "../components/Checkbox.js";
|
|
2
3
|
import { Table } from "../components/Table.js";
|
|
3
4
|
import { ListActionsHeader } from "../list/ListTable.js";
|
|
4
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -14,32 +15,28 @@ function FileTableHeaders({ allSelected, someSelected, onSelectAll }) {
|
|
|
14
15
|
style: { minWidth: 200 },
|
|
15
16
|
children: /* @__PURE__ */ jsxs("div", {
|
|
16
17
|
className: "flex items-center gap-2.5",
|
|
17
|
-
children: [/* @__PURE__ */ jsx(
|
|
18
|
-
type: "checkbox",
|
|
18
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
19
19
|
"aria-label": t.chrome.selectAll,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
onChange: onSelectAll,
|
|
25
|
-
checked: allSelected
|
|
20
|
+
checked: allSelected,
|
|
21
|
+
indeterminate: someSelected && !allSelected,
|
|
22
|
+
onCheckedChange: () => onSelectAll()
|
|
26
23
|
}), /* @__PURE__ */ jsx("span", { children: t.chrome.name })]
|
|
27
24
|
})
|
|
28
25
|
}),
|
|
29
26
|
/* @__PURE__ */ jsx(Table.Header, {
|
|
30
27
|
caps: false,
|
|
31
28
|
className: "w-[14%] py-2",
|
|
32
|
-
children:
|
|
29
|
+
children: t.chrome.size
|
|
33
30
|
}),
|
|
34
31
|
/* @__PURE__ */ jsx(Table.Header, {
|
|
35
32
|
caps: false,
|
|
36
33
|
className: "w-[14%] py-2",
|
|
37
|
-
children:
|
|
34
|
+
children: t.chrome.type
|
|
38
35
|
}),
|
|
39
36
|
/* @__PURE__ */ jsx(Table.Header, {
|
|
40
37
|
caps: false,
|
|
41
38
|
className: "w-[22%] py-2",
|
|
42
|
-
children:
|
|
39
|
+
children: t.chrome.lastModified
|
|
43
40
|
}),
|
|
44
41
|
/* @__PURE__ */ jsx(ListActionsHeader, { actionCount: 1 })
|
|
45
42
|
] });
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Loader } from "../components/Loader.js";
|
|
1
2
|
import { useStrings } from "../components/Provider.js";
|
|
2
|
-
import Loader from "../components/Loader.js";
|
|
3
3
|
import { useNearEnd } from "./useNearEnd.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useRef } from "react";
|
|
6
6
|
function LoadMoreRow({ rowId, rowIndex, loading, error, auto, root, onLoadMore }) {
|
|
7
7
|
const t = useStrings().fileExplorer;
|
|
8
|
+
const { common } = useStrings();
|
|
8
9
|
const ref = useRef(null);
|
|
9
10
|
useNearEnd(ref, {
|
|
10
11
|
active: auto && !loading && !error,
|
|
@@ -25,19 +26,17 @@ function LoadMoreRow({ rowId, rowIndex, loading, error, auto, root, onLoadMore }
|
|
|
25
26
|
type: "button",
|
|
26
27
|
className: "cursor-pointer underline theme-link",
|
|
27
28
|
onClick: onLoadMore,
|
|
28
|
-
children:
|
|
29
|
+
children: common.retry
|
|
29
30
|
})]
|
|
30
|
-
}) : loading ? /* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
full: false
|
|
35
|
-
}), /* @__PURE__ */ jsx("span", { children: t.loadingMore })]
|
|
31
|
+
}) : loading ? /* @__PURE__ */ jsx(Loader, {
|
|
32
|
+
size: 16,
|
|
33
|
+
inline: true,
|
|
34
|
+
label: t.loadingMore
|
|
36
35
|
}) : /* @__PURE__ */ jsx("button", {
|
|
37
36
|
type: "button",
|
|
38
37
|
className: "cursor-pointer underline theme-link",
|
|
39
38
|
onClick: onLoadMore,
|
|
40
|
-
children:
|
|
39
|
+
children: common.loadMore
|
|
41
40
|
})
|
|
42
41
|
})
|
|
43
42
|
});
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FaRegFolderOpen } from "../icons/fa6/FaRegFolderOpen.js";
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { ChevronRightIcon, FolderIcon, FolderOpenIcon } from "../icons.js";
|
|
4
3
|
import { positionKeys } from "../components/keys.js";
|
|
5
4
|
import { useStrings } from "../components/Provider.js";
|
|
5
|
+
import { Skeleton } from "../components/Skeleton.js";
|
|
6
6
|
import { getParentPath } from "./lib/utils.js";
|
|
7
7
|
import { canPreview } from "./FilePreview/previewType.js";
|
|
8
8
|
import { getNodeIcon } from "./helpers.js";
|
|
9
9
|
import { findRowIndex, flattenTreeRows, nextFileLimit, stepRow } from "./treeRows.js";
|
|
10
|
-
import { clsx } from "clsx";
|
|
11
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
11
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
13
12
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
@@ -193,16 +192,17 @@ function RowIcons({ isDirectory, isExpanded, customIcon }) {
|
|
|
193
192
|
className: "shrink-0",
|
|
194
193
|
children: customIcon
|
|
195
194
|
});
|
|
196
|
-
const folder = isExpanded ? /* @__PURE__ */ jsx(
|
|
197
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
195
|
+
const folder = isExpanded ? /* @__PURE__ */ jsx(FolderOpenIcon, { className: "h-4 w-4 mr-1 text-sky-500" }) : /* @__PURE__ */ jsx(FolderIcon, { className: "h-4 w-4 mr-1 text-sky-500/80" });
|
|
196
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ChevronRightIcon, { className: cx("h-3.5 w-3.5 shrink-0 theme-muted-text transition-transform duration-150", isExpanded && "rotate-90") }), customIcon ?? folder] });
|
|
198
197
|
}
|
|
199
198
|
/** Click-only, unlike the table's sentinel: the tree is a navigation aid, and
|
|
200
199
|
* growing it automatically as the user scrolls is what the cap exists to prevent. */
|
|
201
200
|
function TreeMoreRow({ depth, hiddenFiles, partial, loading, failed, onReveal }) {
|
|
202
201
|
const t = useStrings().fileExplorer;
|
|
202
|
+
const { common } = useStrings();
|
|
203
203
|
const label = () => {
|
|
204
|
-
if (failed) return
|
|
205
|
-
if (hiddenFiles === 0) return
|
|
204
|
+
if (failed) return common.retry;
|
|
205
|
+
if (hiddenFiles === 0) return common.loadMore;
|
|
206
206
|
return partial ? t.treeMoreCountPartial(hiddenFiles) : t.treeMoreCount(hiddenFiles);
|
|
207
207
|
};
|
|
208
208
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -212,7 +212,7 @@ function TreeMoreRow({ depth, hiddenFiles, partial, loading, failed, onReveal })
|
|
|
212
212
|
style: { paddingLeft: depth * INDENT_PER_LEVEL + ROW_PAD_FILE },
|
|
213
213
|
children: loading ? /* @__PURE__ */ jsx("span", { children: t.loadingMore }) : /* @__PURE__ */ jsx("button", {
|
|
214
214
|
type: "button",
|
|
215
|
-
className:
|
|
215
|
+
className: cx("cursor-pointer underline", failed ? "text-red-500" : "theme-link"),
|
|
216
216
|
onClick: onReveal,
|
|
217
217
|
children: label()
|
|
218
218
|
})
|
|
@@ -227,11 +227,11 @@ function TreeSkeletonRow({ depth }) {
|
|
|
227
227
|
children: [/* @__PURE__ */ jsx(IndentGuides, { depth }), /* @__PURE__ */ jsx("div", {
|
|
228
228
|
className: "flex h-full flex-col justify-center gap-1.5 py-1 pr-2",
|
|
229
229
|
style: { paddingLeft: depth * INDENT_PER_LEVEL + ROW_PAD_FILE },
|
|
230
|
-
children:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
231
|
+
count: 3,
|
|
232
|
+
height: 12,
|
|
233
|
+
className: "shrink-0"
|
|
234
|
+
})
|
|
235
235
|
})]
|
|
236
236
|
});
|
|
237
237
|
}
|
|
@@ -334,10 +334,10 @@ var TreeRowItem = memo(function TreeRowItem({ row, isSelected, onToggleExpand, o
|
|
|
334
334
|
const customIcon = getNodeIcon(node);
|
|
335
335
|
const label = isDirectory && node.storageId && node.displayName ? node.displayName : node.name;
|
|
336
336
|
return /* @__PURE__ */ jsxs("div", {
|
|
337
|
-
className:
|
|
337
|
+
className: cx("relative h-full rounded-md transition-[box-shadow,background-color] duration-150", dragActive && "ring-1 ring-(--theme-link)/60"),
|
|
338
338
|
...dragHandlers,
|
|
339
339
|
children: [/* @__PURE__ */ jsx(IndentGuides, { depth }), /* @__PURE__ */ jsxs("div", {
|
|
340
|
-
className:
|
|
340
|
+
className: cx("group relative flex items-center gap-1.5 pr-2 py-1 rounded-md cursor-pointer", "transition-colors duration-150", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-(--theme-link)", isSelected ? "bg-(--theme-accent)/15 font-medium" : dragActive ? "theme-hover" : "hover:theme-hover"),
|
|
341
341
|
style: indentStyle(depth, isDirectory),
|
|
342
342
|
onClick: handleSelect,
|
|
343
343
|
onKeyDown: handleKeyDown,
|
|
@@ -2,10 +2,7 @@ import { type JSX } from 'react';
|
|
|
2
2
|
import type { TreeNode, TStorage, UploadNode } from './lib/types.js';
|
|
3
3
|
declare const SIDEBAR_WIDTH_STORAGE_KEY = "fileExplorerSidebarWidth";
|
|
4
4
|
declare const SIDEBAR_WIDTH_DEFAULT = 300;
|
|
5
|
-
|
|
6
|
-
type: string;
|
|
7
|
-
}) => string | undefined;
|
|
8
|
-
declare function getNodeIcon(node: TreeNode, storageIconUrl?: StorageIconUrlResolver, storageIconAlt?: string): JSX.Element | null;
|
|
5
|
+
declare function getNodeIcon(node: TreeNode): JSX.Element | null;
|
|
9
6
|
declare function renderUploadNodes(uploadNodes: UploadNode[]): JSX.Element[];
|
|
10
7
|
declare function NoFileSelectedPreview(): JSX.Element;
|
|
11
8
|
/** Shown instead of a skeleton that has nothing left to wait for. */
|