@parallelworks/ui 0.41.0 → 0.42.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 +25 -0
- package/dist/ai/components/AllocationSelector.d.ts +3 -4
- package/dist/ai/components/AllocationSelector.js +37 -33
- package/dist/ai/components/AttachmentManager.js +7 -7
- package/dist/ai/components/AttachmentUpload.js +5 -5
- package/dist/ai/components/BranchNavigator.js +1 -1
- package/dist/ai/components/ChatEmptyState.js +2 -2
- package/dist/ai/components/ChatInput.js +10 -8
- package/dist/ai/components/ChatLayout.js +4 -5
- package/dist/ai/components/ChatMessage.js +12 -12
- package/dist/ai/components/ChatMessageList.js +9 -9
- package/dist/ai/components/ChatSidebar.js +8 -9
- package/dist/ai/components/ChatThread.js +4 -4
- package/dist/ai/components/ComposerChrome.d.ts +2 -2
- package/dist/ai/components/ComposerChrome.js +3 -6
- package/dist/ai/components/DragOverlay.js +2 -2
- package/dist/ai/components/ModelSelector.d.ts +5 -3
- package/dist/ai/components/ModelSelector.js +102 -339
- package/dist/ai/components/PastedText.js +11 -11
- package/dist/ai/components/ProviderIssueBanner.d.ts +2 -0
- package/dist/ai/components/ProviderIssueBanner.js +34 -16
- package/dist/ai/components/Reasoning.js +4 -4
- package/dist/ai/components/ShareDialog.js +43 -35
- package/dist/ai/components/SlashMenu.d.ts +12 -2
- package/dist/ai/components/SlashMenu.js +29 -13
- package/dist/ai/components/agent/ActivityLine.js +3 -3
- package/dist/ai/components/agent/AgentMessageParts.js +20 -20
- package/dist/ai/components/agent/PermissionPicker.js +13 -11
- package/dist/ai/components/conversationActions.d.ts +4 -6
- package/dist/ai/components/conversationActions.js +9 -13
- package/dist/ai/core/ChatProvider.js +1 -1
- package/dist/ai/core/config.js +1 -1
- package/dist/ai/core/providerIssues.d.ts +7 -0
- package/dist/ai/core/providerIssues.js +9 -1
- package/dist/ai/core/useKeyboardShortcuts.d.ts +4 -0
- package/dist/ai/core/useKeyboardShortcuts.js +8 -2
- package/dist/ai/index.d.ts +0 -1
- package/dist/ai/index.js +1 -2
- package/dist/ai/strings.d.ts +19 -0
- package/dist/ai/strings.js +18 -1
- package/dist/ai/ui/Avatar.js +5 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +0 -1
- package/dist/ai/ui/ConversationSidebar.js +6 -7
- package/dist/ai/ui/Markdown.js +3 -3
- package/dist/ai/ui/Notice.js +6 -6
- package/dist/ai/ui/chip.d.ts +4 -0
- package/dist/ai/ui/chip.js +8 -0
- package/dist/ai/ui/sidebar.d.ts +6 -5
- package/dist/ai/ui/sidebar.js +39 -43
- package/dist/components/ActionMenu.d.ts +13 -0
- package/dist/components/ActionMenu.js +30 -0
- package/dist/components/Avatar.js +6 -6
- package/dist/components/Breadcrumbs.js +1 -1
- package/dist/components/Button.js +10 -10
- package/dist/components/Callout.js +2 -2
- package/dist/components/Card.js +3 -3
- package/dist/components/Combobox.d.ts +66 -0
- package/dist/components/Combobox.js +393 -0
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +23 -0
- package/dist/components/ContextMenu.js +89 -0
- package/dist/components/CopyToClipboard.js +2 -2
- package/dist/components/CreateModal.d.ts +17 -36
- package/dist/components/CreateModal.js +97 -259
- package/dist/components/DescriptionList.js +8 -8
- package/dist/components/Filter.js +2 -2
- package/dist/components/FilterPill.js +2 -2
- package/dist/components/HoverCard.d.ts +14 -0
- package/dist/components/HoverCard.js +33 -0
- package/dist/components/IconButton.d.ts +5 -5
- package/dist/components/IconButton.js +18 -22
- package/dist/components/InfoTip.d.ts +15 -0
- package/dist/components/InfoTip.js +60 -0
- package/dist/components/Input.js +5 -5
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.js +3 -3
- package/dist/components/Markdown.js +1 -1
- package/dist/components/MarkdownImpl.js +2 -2
- package/dist/components/Menu.d.ts +33 -0
- package/dist/components/Menu.js +86 -0
- package/dist/components/MenuEntries.d.ts +56 -0
- package/dist/components/MenuEntries.js +123 -0
- package/dist/components/Modal.d.ts +29 -0
- package/dist/components/Modal.js +47 -0
- package/dist/components/Overview.js +11 -10
- package/dist/components/PageHeader.d.ts +10 -16
- package/dist/components/PageHeader.js +69 -95
- package/dist/components/Pagination.js +5 -5
- package/dist/components/Provider.d.ts +5 -11
- package/dist/components/Provider.js +11 -14
- package/dist/components/Radio.d.ts +8 -0
- package/dist/components/Radio.js +16 -0
- package/dist/components/SectionHeader.js +2 -2
- package/dist/components/SegmentedControl.d.ts +6 -5
- package/dist/components/SegmentedControl.js +34 -30
- package/dist/components/Select.d.ts +27 -0
- package/dist/components/Select.js +78 -0
- package/dist/components/SettingModeOption.d.ts +5 -8
- package/dist/components/SettingModeOption.js +10 -12
- package/dist/components/SettingRow.js +4 -4
- package/dist/components/SettingsCard.js +4 -4
- package/dist/components/SettingsGroup.js +2 -2
- package/dist/components/Sort.js +1 -1
- package/dist/components/StatusBadge.js +7 -7
- package/dist/components/StatusIcons.js +4 -4
- package/dist/components/Switch.d.ts +22 -0
- package/dist/components/Switch.js +28 -0
- package/dist/components/Table.js +11 -11
- package/dist/components/Tooltip.d.ts +24 -20
- package/dist/components/Tooltip.js +58 -76
- package/dist/components/floating.d.ts +14 -0
- package/dist/components/floating.js +21 -0
- package/dist/components/search.d.ts +2 -0
- package/dist/components/search.js +14 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/EditorField.js +16 -21
- package/dist/editor/FormCodePanel.js +19 -19
- package/dist/editor/Monaco.js +3 -3
- package/dist/file-explorer/FileExplorer.js +77 -81
- package/dist/file-explorer/FileExplorerContext.js +2 -2
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +1 -1
- package/dist/file-explorer/FilePreview/Inline.js +1 -1
- package/dist/file-explorer/FilePreview/StreamedBadge.js +5 -6
- package/dist/file-explorer/FilePreview/Viewer.js +8 -8
- package/dist/file-explorer/FilePreview/index.d.ts +1 -1
- package/dist/file-explorer/FilePreview/index.js +49 -83
- package/dist/file-explorer/FileRow.d.ts +4 -3
- package/dist/file-explorer/FileRow.js +32 -38
- package/dist/file-explorer/FileRowsWindow.d.ts +3 -2
- package/dist/file-explorer/FileRowsWindow.js +4 -4
- package/dist/file-explorer/FileTable.d.ts +3 -2
- package/dist/file-explorer/FileTable.js +3 -3
- package/dist/file-explorer/LoadMoreRow.js +1 -1
- package/dist/file-explorer/TreeView.js +11 -16
- package/dist/file-explorer/helpers.js +11 -12
- package/dist/file-explorer/toasts.js +11 -11
- package/dist/form/FieldGroup.d.ts +11 -0
- package/dist/form/FieldGroup.js +36 -0
- package/dist/form/FieldWrapper.js +4 -4
- package/dist/form/Fields/BooleanField.js +23 -33
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +9 -13
- package/dist/form/Fields/ColorField.d.ts +1 -2
- package/dist/form/Fields/ColorField.js +6 -11
- package/dist/form/Fields/DropdownField.d.ts +3 -13
- package/dist/form/Fields/DropdownField.js +40 -27
- package/dist/form/Fields/DurationField.d.ts +1 -2
- package/dist/form/Fields/DurationField.js +25 -32
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +6 -12
- package/dist/form/Fields/MultiDropdownField.js +31 -22
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +65 -35
- package/dist/form/Fields/ObjectField.d.ts +1 -1
- package/dist/form/Fields/ObjectField.js +12 -43
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +30 -41
- package/dist/form/Fields/RangeField.d.ts +1 -2
- package/dist/form/Fields/RangeField.js +23 -16
- package/dist/form/Fields/StringField.d.ts +1 -2
- package/dist/form/Fields/StringField.js +58 -26
- package/dist/form/Fields/TextAreaField.js +12 -10
- package/dist/form/Form.d.ts +30 -48
- package/dist/form/Form.js +306 -412
- package/dist/form/FormLayout.js +9 -9
- package/dist/form/Wizard/WizardContainer.d.ts +1 -4
- package/dist/form/Wizard/WizardContainer.js +40 -56
- package/dist/form/Wizard/WizardNavigation.js +1 -1
- package/dist/form/Wizard/WizardStepContent.d.ts +1 -5
- package/dist/form/Wizard/WizardStepContent.js +11 -16
- package/dist/form/Wizard/WizardStepIndicator.js +6 -6
- package/dist/form/Wizard/types.d.ts +0 -14
- package/dist/form/fieldRegistry.d.ts +1 -1
- package/dist/form/fieldRegistry.js +6 -6
- package/dist/form/formEditing.js +1 -1
- package/dist/form/index.d.ts +5 -4
- package/dist/form/index.js +6 -7
- package/dist/form/types/fieldComponentTypes.d.ts +8 -10
- package/dist/form/useChoiceField.d.ts +20 -0
- package/dist/form/useChoiceField.js +49 -0
- package/dist/form/useFieldValue.d.ts +7 -0
- package/dist/form/useFieldValue.js +20 -0
- package/dist/form/useParsedOpts.d.ts +3 -1
- package/dist/form/useParsedOpts.js +12 -17
- package/dist/form/utils/dependentOptions.d.ts +8 -4
- package/dist/form/utils/dependentOptions.js +25 -17
- package/dist/form/utils/fieldItems.d.ts +10 -0
- package/dist/form/utils/fieldItems.js +11 -0
- package/dist/form/utils/fieldPath.d.ts +10 -0
- package/dist/form/utils/fieldPath.js +20 -0
- package/dist/form/utils/shareEqual.d.ts +6 -0
- package/dist/form/utils/shareEqual.js +38 -0
- package/dist/graph/AnnotationBanner.js +8 -8
- package/dist/graph/Collapse.d.ts +1 -0
- package/dist/graph/Collapse.js +6 -27
- package/dist/graph/Connectors.js +5 -5
- package/dist/graph/DependencyGraph.js +20 -19
- package/dist/graph/GraphEditor.js +30 -41
- package/dist/graph/GraphEditorDialogs.js +17 -17
- package/dist/graph/GraphNode.js +1 -1
- package/dist/graph/InputDialog.js +19 -22
- package/dist/graph/InputsEditor.js +58 -66
- package/dist/graph/JobSummary.js +42 -39
- package/dist/graph/MatrixGroup.js +1 -1
- package/dist/graph/ProblemsButton.js +18 -19
- package/dist/graph/Reveal.js +1 -1
- package/dist/graph/ShortcutsButton.js +15 -18
- package/dist/graph/SuggestionInput.d.ts +5 -10
- package/dist/graph/SuggestionInput.js +14 -18
- package/dist/graph/ToolbarPopover.d.ts +11 -6
- package/dist/graph/ToolbarPopover.js +35 -67
- package/dist/graph/TreeView.js +24 -37
- package/dist/graph/WorkflowSettingsDialog.js +4 -4
- package/dist/graph/editorChrome.js +13 -12
- package/dist/graph/editorFields.js +29 -29
- package/dist/graph/editorPrimitives.d.ts +1 -1
- package/dist/graph/editorPrimitives.js +10 -7
- package/dist/graph/editorRows.js +103 -97
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -3
- package/dist/graph/inputRefs.js +9 -9
- package/dist/graph/settingsViews.js +6 -7
- package/dist/graph/stepWith.js +6 -6
- package/dist/index.d.ts +14 -15
- package/dist/index.js +15 -14
- package/dist/list/ActionToolbar.d.ts +6 -14
- package/dist/list/ActionToolbar.js +48 -96
- package/dist/list/ListPage.d.ts +6 -12
- package/dist/list/ListPage.js +46 -29
- package/dist/list/ListPager.js +4 -4
- package/dist/list/ListTable.js +5 -5
- package/dist/list/ListViewControls.d.ts +5 -4
- package/dist/list/ListViewControls.js +177 -267
- package/dist/list/UserHoverCard.d.ts +3 -17
- package/dist/list/UserHoverCard.js +21 -45
- package/dist/list/index.d.ts +3 -4
- package/dist/list/index.js +3 -4
- package/dist/list/listSearch.js +12 -11
- package/dist/list/rowMenu.d.ts +63 -0
- package/dist/list/rowMenu.js +134 -0
- package/dist/logviewer/LogViewer.js +26 -26
- package/dist/styles.css +1 -1
- package/package.json +7 -13
- package/dist/ai/ui/Dropdown.d.ts +0 -31
- package/dist/ai/ui/Dropdown.js +0 -110
- package/dist/components/AddMenu.d.ts +0 -18
- package/dist/components/AddMenu.js +0 -46
- package/dist/components/BareModal.d.ts +0 -17
- package/dist/components/BareModal.js +0 -77
- package/dist/components/CollapsiblePanel.d.ts +0 -27
- package/dist/components/CollapsiblePanel.js +0 -77
- package/dist/components/Dropdown.d.ts +0 -28
- package/dist/components/Dropdown.js +0 -355
- package/dist/components/Listbox.d.ts +0 -21
- package/dist/components/Listbox.js +0 -119
- package/dist/components/MultiSelect.d.ts +0 -22
- package/dist/components/MultiSelect.js +0 -168
- package/dist/components/SwitchToggle.d.ts +0 -15
- package/dist/components/SwitchToggle.js +0 -57
- package/dist/components/SwitchToggleSmall.d.ts +0 -6
- package/dist/components/SwitchToggleSmall.js +0 -14
- package/dist/components/Toggle.d.ts +0 -6
- package/dist/components/Toggle.js +0 -20
- package/dist/components/dropdownUtils.d.ts +0 -37
- package/dist/components/dropdownUtils.js +0 -99
- package/dist/form/SpecialTypes/DropdownWrapper.d.ts +0 -25
- package/dist/form/SpecialTypes/DropdownWrapper.js +0 -28
- package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +0 -51
- package/dist/form/SpecialTypes/FormikCustomDropdown.js +0 -119
- package/dist/form/SpecialTypes/FormikCustomInput.d.ts +0 -19
- package/dist/form/SpecialTypes/FormikCustomInput.js +0 -121
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.d.ts +0 -13
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.js +0 -31
- package/dist/form/SpecialTypes/FormikNumericInput.d.ts +0 -9
- package/dist/form/SpecialTypes/FormikNumericInput.js +0 -60
- package/dist/form/SpecialTypes/index.d.ts +0 -3
- package/dist/list/HoverCard.d.ts +0 -24
- package/dist/list/HoverCard.js +0 -73
- package/dist/list/RowContextMenu.d.ts +0 -127
- package/dist/list/RowContextMenu.js +0 -515
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/components/floating.ts
|
|
2
|
+
/** Popups portal into the host's .ds-root when it has one, so they inherit the
|
|
3
|
+
* design system's CSS variables; undefined lets the portal use document.body. */
|
|
4
|
+
function portalContainer() {
|
|
5
|
+
if (typeof document === "undefined") return;
|
|
6
|
+
return document.querySelector(".ds-root") ?? void 0;
|
|
7
|
+
}
|
|
8
|
+
/** Above dialogs and sticky chrome; hidden while its anchor is scrolled out of view. */
|
|
9
|
+
var positionerClassName = "z-[10000] outline-none data-anchor-hidden:invisible";
|
|
10
|
+
var enterExit = "origin-(--transform-origin) transition-[transform,opacity] duration-100 data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0";
|
|
11
|
+
/** A panel of choices: a menu, a select's list, a combobox's list. */
|
|
12
|
+
var panelClassName = `rounded-lg border border-(--theme-border) bg-(--theme-app-bg) text-sm text-(--theme-app) shadow-(--theme-shadow-lg) outline-none ${enterExit}`;
|
|
13
|
+
/** A row in a panel. */
|
|
14
|
+
var panelItemClassName = "flex w-full cursor-pointer select-none items-center gap-2 px-3 py-1.5 text-left outline-none data-highlighted:bg-(--theme-hover) data-highlighted:text-(--theme-hover-text) data-disabled:cursor-not-allowed data-disabled:opacity-50";
|
|
15
|
+
/** A tooltip's or infotip's small inverted surface. */
|
|
16
|
+
var tipClassName = `rounded-md bg-(--theme-app) px-2 py-1 text-xs text-(--theme-app-bg) shadow-(--theme-shadow) whitespace-pre-line break-words data-instant:transition-none ${enterExit}`;
|
|
17
|
+
var tipArrowClassName = "size-2 rotate-45 bg-(--theme-app) data-[side=top]:-bottom-1 data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1";
|
|
18
|
+
/** A hover card's surface; the card sets its own width and padding. */
|
|
19
|
+
var cardClassName = `overflow-hidden rounded-xl border border-(--theme-border) bg-(--theme-panel-bg) text-(--theme-app) shadow-(--theme-shadow-lg) outline-none ${enterExit}`;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { cardClassName, panelClassName, panelItemClassName, portalContainer, positionerClassName, tipArrowClassName, tipClassName };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { Combobox } from "@base-ui/react/combobox";
|
|
3
|
+
//#region src/components/search.ts
|
|
4
|
+
var fold = (text) => text.replaceAll("-", "");
|
|
5
|
+
/** Whether a query matches any of the texts, the way every picker in the package searches. */
|
|
6
|
+
function useQueryMatch() {
|
|
7
|
+
const { contains } = Combobox.useFilter();
|
|
8
|
+
return useCallback((query, ...texts) => {
|
|
9
|
+
const q = fold(query);
|
|
10
|
+
return texts.some((text) => text !== void 0 && contains(fold(text), q));
|
|
11
|
+
}, [contains]);
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { useQueryMatch };
|
package/dist/editor/Editor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Loader from "../components/Loader.js";
|
|
2
|
-
import { Suspense, lazy } from "react";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Suspense, lazy } from "react";
|
|
4
4
|
//#region src/editor/Editor.tsx
|
|
5
5
|
var MonacoEditor = lazy(() => import("./Monaco.js"));
|
|
6
6
|
function Editor(props) {
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
import { FieldWrapper } from "../form/FieldWrapper.js";
|
|
2
|
+
import { useFieldValue } from "../form/useFieldValue.js";
|
|
2
3
|
import Editor from "./Editor.js";
|
|
3
|
-
import
|
|
4
|
-
import { useMemo, useRef } from "react";
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { useMemo, useRef } from "react";
|
|
7
|
+
import { useFormContext, useWatch } from "react-hook-form";
|
|
7
8
|
//#region src/editor/EditorField.tsx
|
|
8
|
-
function hasResetKeys(obj) {
|
|
9
|
-
return typeof obj === "object" && obj !== null && "editorKeyPostfix" in obj && typeof obj.editorKeyPostfix === "string";
|
|
10
|
-
}
|
|
11
9
|
function EditorField(props) {
|
|
12
|
-
const { field, label, labelPosition, disabled, onChange, tooltipComponent, spaceCompact
|
|
10
|
+
const { field, label, labelPosition, disabled, onChange, tooltipComponent, spaceCompact } = props;
|
|
13
11
|
const fieldName = field.name ?? "";
|
|
14
|
-
const [
|
|
15
|
-
const { setFieldValue, setFieldTouched, values } = useFormikContext();
|
|
16
|
-
const debounceRef = useRef(null);
|
|
12
|
+
const [value, change] = useFieldValue(fieldName);
|
|
17
13
|
const touchedRef = useRef(false);
|
|
18
14
|
const handleChange = (val) => {
|
|
19
15
|
touchedRef.current = true;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
onChange?.(val);
|
|
23
|
-
setFieldTouched(fieldName, true);
|
|
24
|
-
setFieldValue(fieldName, val);
|
|
25
|
-
setFormDirty(true);
|
|
26
|
-
}, 500);
|
|
16
|
+
onChange?.(val);
|
|
17
|
+
change(val);
|
|
27
18
|
};
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
const { control } = useFormContext();
|
|
20
|
+
const resetKey = useWatch({
|
|
21
|
+
control,
|
|
22
|
+
name: "editorKeyPostfix"
|
|
23
|
+
});
|
|
24
|
+
const editorKeyPostfix = typeof resetKey === "string" ? resetKey : "";
|
|
30
25
|
const postfixKey = useMemo(() => {
|
|
31
26
|
const randomKey = Math.random().toString(36).substring(7);
|
|
32
27
|
return editorKeyPostfix || randomKey;
|
|
@@ -41,8 +36,8 @@ function EditorField(props) {
|
|
|
41
36
|
ariaLabel: label,
|
|
42
37
|
height: "200px",
|
|
43
38
|
path: fieldName,
|
|
44
|
-
...touchedRef.current ? {} : { value
|
|
45
|
-
className:
|
|
39
|
+
...touchedRef.current || value === void 0 ? {} : { value },
|
|
40
|
+
className: clsx("bg-(--theme-input-bg) w-11 border focus:border rounded text-[10px] leading-4 pl-[6px]", disabled && "opacity-75"),
|
|
46
41
|
readOnly: disabled,
|
|
47
42
|
onChange: handleChange,
|
|
48
43
|
language: field.options?.language || "shell"
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useNotify, useStrings, useWorkflowEngine } from "../components/Provider.js";
|
|
2
1
|
import { FaCheck } from "../icons/fa/FaCheck.js";
|
|
3
2
|
import { FiCopy } from "../icons/fi/FiCopy.js";
|
|
4
3
|
import { LuEye } from "../icons/lu/LuEye.js";
|
|
5
4
|
import { LuEyeOff } from "../icons/lu/LuEyeOff.js";
|
|
6
|
-
import
|
|
5
|
+
import { Tooltip } from "../components/Tooltip.js";
|
|
6
|
+
import { useNotify, useStrings, useWorkflowEngine } from "../components/Provider.js";
|
|
7
|
+
import { Switch } from "../components/Switch.js";
|
|
7
8
|
import { flattenGroups, impureSetValueFromPath } from "../form/lib.js";
|
|
8
9
|
import Editor from "./Editor.js";
|
|
9
|
-
import
|
|
10
|
-
import { useId, useRef, useState } from "react";
|
|
10
|
+
import { clsx } from "clsx";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { useRef, useState } from "react";
|
|
12
13
|
//#region src/editor/FormCodePanel.tsx
|
|
13
14
|
var isObject = (value) => typeof value === "object" && value !== null;
|
|
14
15
|
var shouldIgnoreField = (engine, fieldSchema, inputs, arrayIndex) => {
|
|
@@ -73,7 +74,6 @@ function FormCodePanel({ formJSON, data, mutate, height = "600px", disabled = fa
|
|
|
73
74
|
const engine = useWorkflowEngine();
|
|
74
75
|
const notify = useNotify();
|
|
75
76
|
const { common: t } = useStrings();
|
|
76
|
-
const uid = useId();
|
|
77
77
|
const [jsonHasErrors, setJsonHasErrors] = useState(false);
|
|
78
78
|
const [showHidden, setShowHidden] = useState(false);
|
|
79
79
|
const [copied, setCopied] = useState(false);
|
|
@@ -103,22 +103,22 @@ function FormCodePanel({ formJSON, data, mutate, height = "600px", disabled = fa
|
|
|
103
103
|
style: { height },
|
|
104
104
|
className: "flex w-full flex-col gap-2",
|
|
105
105
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
106
|
-
className:
|
|
106
|
+
className: clsx("flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border", jsonHasErrors ? "border-red-500" : "border-(--theme-border)"),
|
|
107
107
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
108
108
|
className: "bg-(--theme-muted-panel-bg) text-(--theme-muted-panel-color) flex shrink-0 items-center gap-3 border-b border-(--theme-border) px-3 py-2",
|
|
109
|
-
children: [hasHiddenFields && /* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
})
|
|
109
|
+
children: [hasHiddenFields && /* @__PURE__ */ jsx(Tooltip, {
|
|
110
|
+
content: t.showHiddenFieldsHint,
|
|
111
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
112
|
+
className: "flex cursor-pointer select-none items-center gap-2 text-sm text-(--theme-app)",
|
|
113
|
+
children: [/* @__PURE__ */ jsx(Switch, {
|
|
114
|
+
size: "sm",
|
|
115
|
+
checked: showHidden,
|
|
116
|
+
onCheckedChange: setShowHidden
|
|
117
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
118
|
+
className: "flex items-center gap-1.5",
|
|
119
|
+
children: [showHidden ? /* @__PURE__ */ jsx(LuEye, {}) : /* @__PURE__ */ jsx(LuEyeOff, {}), t.showHiddenFields]
|
|
120
|
+
})]
|
|
121
|
+
})
|
|
122
122
|
}), /* @__PURE__ */ jsxs("button", {
|
|
123
123
|
type: "button",
|
|
124
124
|
onClick: handleCopy,
|
package/dist/editor/Monaco.js
CHANGED
|
@@ -7,9 +7,9 @@ import { defineEditorThemes, getThemeName } from "./themes.js";
|
|
|
7
7
|
import { setupMonacoWorkers } from "./workers.js";
|
|
8
8
|
import { holdListeners, modelFor } from "./editorModel.js";
|
|
9
9
|
import { ensureYamlLanguage } from "./yamlLanguage.js";
|
|
10
|
-
import
|
|
11
|
-
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
10
|
+
import { clsx } from "clsx";
|
|
12
11
|
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
13
13
|
import * as monaco from "monaco-editor";
|
|
14
14
|
//#region src/editor/Monaco.tsx
|
|
15
15
|
setupMonacoWorkers();
|
|
@@ -116,7 +116,7 @@ function MonacoEditor({ className, disabled, onChange = noop, onValidate = noop,
|
|
|
116
116
|
width,
|
|
117
117
|
height
|
|
118
118
|
},
|
|
119
|
-
className:
|
|
119
|
+
className: clsx("relative border rounded", className),
|
|
120
120
|
ref: (ref) => {
|
|
121
121
|
if (ref && !monacoRef.current) {
|
|
122
122
|
defineEditorThemes(monaco.editor);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { safeUrl } from "../safeUrl.js";
|
|
2
|
-
import { useNotify, useSlots, useStrings } from "../components/Provider.js";
|
|
3
1
|
import { BiSolidTrashAlt } from "../icons/bi/BiSolidTrashAlt.js";
|
|
4
2
|
import { BsArrowsCollapse } from "../icons/bs/BsArrowsCollapse.js";
|
|
5
3
|
import { FaAngleDown } from "../icons/fa/FaAngleDown.js";
|
|
@@ -16,16 +14,21 @@ import { LuEye } from "../icons/lu/LuEye.js";
|
|
|
16
14
|
import { MdRefresh } from "../icons/md/MdRefresh.js";
|
|
17
15
|
import { PiShareBold } from "../icons/pi/PiShareBold.js";
|
|
18
16
|
import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
|
|
17
|
+
import { MenuItem, MenuPopup, MenuSeparator } from "../components/Menu.js";
|
|
18
|
+
import { safeUrl } from "../safeUrl.js";
|
|
19
19
|
import { keyedByContent } from "../components/keys.js";
|
|
20
|
-
import {
|
|
20
|
+
import { Tooltip } from "../components/Tooltip.js";
|
|
21
|
+
import { useNotify, useSlots, useStrings } from "../components/Provider.js";
|
|
21
22
|
import { ConfirmModal } from "../components/ConfirmModal.js";
|
|
23
|
+
import { useContextMenu } from "../components/ContextMenu.js";
|
|
22
24
|
import CopyToClipboard, { CopyCodeBlock } from "../components/CopyToClipboard.js";
|
|
25
|
+
import { InfoTip } from "../components/InfoTip.js";
|
|
23
26
|
import { CreateModal } from "../components/CreateModal.js";
|
|
24
27
|
import Loader from "../components/Loader.js";
|
|
25
|
-
import { assembleRowMenu, useCopySubmenu, useRowMenu } from "../list/RowContextMenu.js";
|
|
26
28
|
import { StatusBadge } from "../components/StatusBadge.js";
|
|
27
29
|
import { Table } from "../components/Table.js";
|
|
28
30
|
import { ListActionsHeader, ListSkeleton, listTableFixedProps, listTableProps } from "../list/ListTable.js";
|
|
31
|
+
import { assembleRowMenu, useCopySubmenu } from "../list/rowMenu.js";
|
|
29
32
|
import { calculateUploadNodesTotalSize, createTreeBuilder, formatFileSize, getDirectoryNameError, getDirectoryObjectPath, getNodeChildren, getObjectKeyFromNode, getParentPath, getUploadNodesFromDataTransferItems, getUriScheme, pruneNodesInsideSelectedDirectories, removeLeadingAndTrailingSlashes } from "./lib/utils.js";
|
|
30
33
|
import { useFileExplorer } from "./FileExplorerContext.js";
|
|
31
34
|
import { PREVIEW_URL_EXPIRES_IN, canPreview } from "./FilePreview/previewType.js";
|
|
@@ -39,11 +42,11 @@ import { FileTableHeaders } from "./FileTableHeaders.js";
|
|
|
39
42
|
import { FileTable } from "./FileTable.js";
|
|
40
43
|
import { advanceListing, beginLoadingMore, canAutoLoadMore, clearListingError, clearListingsUnder, hasMore, incompletePaths, isListed, isLoadingMore, loadMoreError, nextHydrationStep, recordListingError, replaceListing } from "./lib/paging.js";
|
|
41
44
|
import { TreeView } from "./TreeView.js";
|
|
42
|
-
import { Menu
|
|
43
|
-
import
|
|
45
|
+
import { Menu } from "@base-ui/react/menu";
|
|
46
|
+
import { clsx } from "clsx";
|
|
47
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
44
48
|
import { useCallback, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
45
49
|
import { useLocalStorage } from "usehooks-ts";
|
|
46
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
47
50
|
import { DateTime } from "luxon";
|
|
48
51
|
import { Resizable } from "re-resizable";
|
|
49
52
|
//#region src/file-explorer/FileExplorer.tsx
|
|
@@ -258,7 +261,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
258
261
|
const [pendingDelete, setPendingDelete] = useState(null);
|
|
259
262
|
const [detailTab, setDetailTab] = useState("details");
|
|
260
263
|
useEffect(() => clearPreviewCache, []);
|
|
261
|
-
const { openMenu, contextMenu } =
|
|
264
|
+
const { openMenu, contextMenu } = useContextMenu();
|
|
262
265
|
const [sidebarWidth, setSidebarWidth] = useLocalStorage(SIDEBAR_WIDTH_STORAGE_KEY, 300);
|
|
263
266
|
const handleToggleExpand = useCallback((path) => {
|
|
264
267
|
setExpandedPaths((prev) => {
|
|
@@ -630,7 +633,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
630
633
|
key: "create-folder",
|
|
631
634
|
label: t.createFolder.action,
|
|
632
635
|
icon: /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
633
|
-
|
|
636
|
+
onClick: () => openCreateFolder(node)
|
|
634
637
|
}];
|
|
635
638
|
};
|
|
636
639
|
const buildRowMenu = (node) => {
|
|
@@ -644,20 +647,20 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
644
647
|
key: "preview",
|
|
645
648
|
label: t.preview.preview,
|
|
646
649
|
icon: /* @__PURE__ */ jsx(LuEye, {}),
|
|
647
|
-
|
|
650
|
+
onClick: () => openPreview(node)
|
|
648
651
|
});
|
|
649
652
|
if (isFile) {
|
|
650
653
|
actions.push({
|
|
651
654
|
key: "download",
|
|
652
655
|
label: t.preview.download,
|
|
653
656
|
icon: /* @__PURE__ */ jsx(FiDownload, {}),
|
|
654
|
-
|
|
657
|
+
onClick: () => downloadNode(node)
|
|
655
658
|
});
|
|
656
659
|
if (nodeCanShare) actions.push({
|
|
657
660
|
key: "share",
|
|
658
661
|
label: t.preview.shareFile,
|
|
659
662
|
icon: /* @__PURE__ */ jsx(PiShareBold, {}),
|
|
660
|
-
|
|
663
|
+
onClick: () => onShareFileButtonClick(node)
|
|
661
664
|
});
|
|
662
665
|
}
|
|
663
666
|
actions.push(...getCreateFolderActions(node, storage));
|
|
@@ -667,13 +670,12 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
667
670
|
label: t.preview.delete,
|
|
668
671
|
icon: /* @__PURE__ */ jsx(BiSolidTrashAlt, {}),
|
|
669
672
|
destructive: true,
|
|
670
|
-
|
|
673
|
+
onClick: () => deleteNode(node)
|
|
671
674
|
});
|
|
672
675
|
const lead = [{
|
|
673
|
-
kind: "action",
|
|
674
676
|
label: isFile ? t.preview.viewDetails : t.preview.openFolder,
|
|
675
677
|
icon: isFile ? /* @__PURE__ */ jsx(FiFileText, {}) : /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
676
|
-
|
|
678
|
+
onClick: () => handleSelectTreeItem(node.path, node)
|
|
677
679
|
}];
|
|
678
680
|
const uriExtras = uris.map((value) => ({
|
|
679
681
|
label: `${getUriScheme(value).toUpperCase()} URI`,
|
|
@@ -694,7 +696,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
694
696
|
if (items.length === 0) return;
|
|
695
697
|
e.preventDefault();
|
|
696
698
|
e.stopPropagation();
|
|
697
|
-
openMenu(e
|
|
699
|
+
openMenu(e, items);
|
|
698
700
|
};
|
|
699
701
|
const renderBreadcrumb = () => {
|
|
700
702
|
const chain = [];
|
|
@@ -951,24 +953,24 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
951
953
|
className: "flex items-center justify-end h-10 px-3 shrink-0 border-b theme-border",
|
|
952
954
|
children: /* @__PURE__ */ jsxs("div", {
|
|
953
955
|
className: "flex gap-x-0.5",
|
|
954
|
-
children: [/* @__PURE__ */ jsx(
|
|
955
|
-
|
|
956
|
-
"
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
}), /* @__PURE__ */ jsx(
|
|
964
|
-
|
|
965
|
-
"
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
956
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
957
|
+
content: t.chrome.refresh,
|
|
958
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
959
|
+
type: "button",
|
|
960
|
+
"aria-label": t.chrome.refresh,
|
|
961
|
+
className: "inline-flex items-center justify-center h-7 w-7 rounded-md cursor-pointer theme-muted-text hover:theme-text hover:theme-hover transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-(--theme-link)",
|
|
962
|
+
onClick: () => handleRefresh(),
|
|
963
|
+
children: /* @__PURE__ */ jsx(MdRefresh, { className: "h-3.5 w-3.5" })
|
|
964
|
+
})
|
|
965
|
+
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
966
|
+
content: t.chrome.collapse,
|
|
967
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
968
|
+
type: "button",
|
|
969
|
+
"aria-label": t.chrome.collapse,
|
|
970
|
+
className: "inline-flex items-center justify-center h-7 w-7 rounded-md cursor-pointer theme-muted-text hover:theme-text hover:theme-hover transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-(--theme-link)",
|
|
971
|
+
onClick: collapseAll,
|
|
972
|
+
children: /* @__PURE__ */ jsx(BsArrowsCollapse, { className: "h-3.5 w-3.5" })
|
|
973
|
+
})
|
|
972
974
|
})]
|
|
973
975
|
})
|
|
974
976
|
}), /* @__PURE__ */ jsx(TreeView, {
|
|
@@ -1028,10 +1030,9 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1028
1030
|
icon: getNodeIcon(rootNode, slots.storageIconUrl, t.chrome.storageIconAlt),
|
|
1029
1031
|
storageCount: getNodeChildren(parentToChildrenMap, rootNode.path).length,
|
|
1030
1032
|
getItems: () => [{
|
|
1031
|
-
kind: "action",
|
|
1032
1033
|
label: t.preview.open,
|
|
1033
1034
|
icon: /* @__PURE__ */ jsx(FaRegFolder, {}),
|
|
1034
|
-
|
|
1035
|
+
onClick: () => openUserNode(rootNode)
|
|
1035
1036
|
}],
|
|
1036
1037
|
openMenu,
|
|
1037
1038
|
onOpen: openUserNode
|
|
@@ -1041,7 +1042,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1041
1042
|
selectedStorage: null,
|
|
1042
1043
|
onRefresh: handleRefresh
|
|
1043
1044
|
})]
|
|
1044
|
-
}) : !selectedNode ? /* @__PURE__ */ jsx(NoFileSelectedPreview, {}) : /* @__PURE__ */ jsxs(Fragment
|
|
1045
|
+
}) : !selectedNode ? /* @__PURE__ */ jsx(NoFileSelectedPreview, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1045
1046
|
/* @__PURE__ */ jsxs("div", {
|
|
1046
1047
|
className: "flex items-center justify-between gap-3 px-4 h-12 shrink-0 border-b theme-border",
|
|
1047
1048
|
children: [renderBreadcrumb(), /* @__PURE__ */ jsxs("div", {
|
|
@@ -1093,7 +1094,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1093
1094
|
children: t.createFolder.action
|
|
1094
1095
|
})]
|
|
1095
1096
|
}),
|
|
1096
|
-
selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(
|
|
1097
|
+
selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
1097
1098
|
"aria-label": t.chrome.upload,
|
|
1098
1099
|
className: "btn btn-info cursor-pointer flex items-center justify-between pr-0.5!",
|
|
1099
1100
|
disabled: selectedNode.type === "file" || !selectedNode.storageId,
|
|
@@ -1101,23 +1102,18 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1101
1102
|
className: "hidden md:inline",
|
|
1102
1103
|
children: t.chrome.upload
|
|
1103
1104
|
})] }), /* @__PURE__ */ jsx(FaAngleDown, { className: "h-4 w-4 ml-2" })]
|
|
1104
|
-
}), /* @__PURE__ */ jsxs(
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
children: [/* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsx("button", {
|
|
1109
|
-
type: "button",
|
|
1110
|
-
className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
|
|
1105
|
+
}), /* @__PURE__ */ jsxs(MenuPopup, {
|
|
1106
|
+
align: "end",
|
|
1107
|
+
className: "w-36",
|
|
1108
|
+
children: [/* @__PURE__ */ jsx(MenuItem, {
|
|
1111
1109
|
onClick: () => fileInputRef.current?.click(),
|
|
1112
1110
|
children: "Select Files"
|
|
1113
|
-
})
|
|
1114
|
-
type: "button",
|
|
1115
|
-
className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
|
|
1111
|
+
}), /* @__PURE__ */ jsx(MenuItem, {
|
|
1116
1112
|
onClick: () => folderInputRef.current?.click(),
|
|
1117
1113
|
children: "Select Folder"
|
|
1118
|
-
})
|
|
1114
|
+
})]
|
|
1119
1115
|
})] }),
|
|
1120
|
-
/* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(
|
|
1116
|
+
/* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
1121
1117
|
"aria-label": t.chrome.download,
|
|
1122
1118
|
className: "btn btn-info cursor-pointer flex items-center justify-between pr-0.5!",
|
|
1123
1119
|
disabled: checkedItems.size === 0 && selectedNode.type !== "file" || hasFolderSelected() || !selectedNode.storageId,
|
|
@@ -1125,28 +1121,28 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1125
1121
|
className: "hidden md:inline",
|
|
1126
1122
|
children: t.chrome.download
|
|
1127
1123
|
})] }), /* @__PURE__ */ jsx(FaAngleDown, { className: "h-4 w-4 ml-2" })]
|
|
1128
|
-
}), /* @__PURE__ */ jsxs(
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
children: [/* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsx("button", {
|
|
1133
|
-
type: "button",
|
|
1134
|
-
className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
|
|
1124
|
+
}), /* @__PURE__ */ jsxs(MenuPopup, {
|
|
1125
|
+
align: "end",
|
|
1126
|
+
className: "w-72",
|
|
1127
|
+
children: [/* @__PURE__ */ jsx(MenuItem, {
|
|
1135
1128
|
onClick: handleDownload,
|
|
1136
1129
|
children: t.chrome.downloadFromBrowser
|
|
1137
|
-
})
|
|
1138
|
-
className: "
|
|
1139
|
-
children:
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
children:
|
|
1145
|
-
className: "
|
|
1146
|
-
children: line
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1130
|
+
}), downloadCommand && downloadCommandText && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), /* @__PURE__ */ jsxs("div", {
|
|
1131
|
+
className: "px-2 py-1.5",
|
|
1132
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
1133
|
+
className: "text-sm text-center pb-1.5",
|
|
1134
|
+
children: downloadCommand.label
|
|
1135
|
+
}), /* @__PURE__ */ jsx(CopyCodeBlock, {
|
|
1136
|
+
textToCopy: downloadCommandText,
|
|
1137
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1138
|
+
className: "overflow-x-auto text-xs",
|
|
1139
|
+
children: keyedByContent(downloadCommandText.split("\n"), (l) => l).map(({ key, item: line }) => /* @__PURE__ */ jsx("div", {
|
|
1140
|
+
className: "whitespace-nowrap",
|
|
1141
|
+
children: line
|
|
1142
|
+
}, key))
|
|
1143
|
+
})
|
|
1144
|
+
})]
|
|
1145
|
+
})] })]
|
|
1150
1146
|
})] }),
|
|
1151
1147
|
/* @__PURE__ */ jsxs("button", {
|
|
1152
1148
|
type: "button",
|
|
@@ -1217,7 +1213,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1217
1213
|
const createdDt = selectedNode.created ? DateTime.fromISO(selectedNode.created) : null;
|
|
1218
1214
|
const previewable = canPreview(selectedNode);
|
|
1219
1215
|
const effectiveTab = previewable ? detailTab : "details";
|
|
1220
|
-
const tabClass = (active) =>
|
|
1216
|
+
const tabClass = (active) => clsx("mx-2.5 border-b-2 px-1 py-2.5 text-[13px] font-medium cursor-pointer transition-colors", active ? "theme-text border-(--theme-element)" : "theme-muted-text border-transparent hover:theme-text");
|
|
1221
1217
|
return /* @__PURE__ */ jsxs("div", {
|
|
1222
1218
|
className: "flex h-full min-h-0 flex-col",
|
|
1223
1219
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -1267,7 +1263,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1267
1263
|
className: "tabular-nums",
|
|
1268
1264
|
children: formatFileSize(selectedNode.size)
|
|
1269
1265
|
}),
|
|
1270
|
-
modifiedDt && /* @__PURE__ */ jsxs(Fragment
|
|
1266
|
+
modifiedDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
1271
1267
|
"aria-hidden": true,
|
|
1272
1268
|
children: "·"
|
|
1273
1269
|
}), /* @__PURE__ */ jsxs("span", { children: ["Modified ", modifiedDt.toRelative()] })] })
|
|
@@ -1284,9 +1280,9 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1284
1280
|
children: [/* @__PURE__ */ jsx(ShareFileButton, {
|
|
1285
1281
|
node: selectedNode,
|
|
1286
1282
|
onShare: onShareFileButtonClick
|
|
1287
|
-
}), /* @__PURE__ */ jsx(
|
|
1283
|
+
}), /* @__PURE__ */ jsx(InfoTip, {
|
|
1288
1284
|
text: "This will generate a pre-signed URL for this file. Anyone with this link can temporarily access and download the file, even if they don't have an account. The link will automatically expire after 12 hours.",
|
|
1289
|
-
|
|
1285
|
+
side: "right"
|
|
1290
1286
|
})]
|
|
1291
1287
|
}),
|
|
1292
1288
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -1297,21 +1293,21 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1297
1293
|
}), /* @__PURE__ */ jsxs("dl", {
|
|
1298
1294
|
className: "grid grid-cols-[minmax(0,140px)_1fr] gap-x-6 gap-y-2 text-sm",
|
|
1299
1295
|
children: [
|
|
1300
|
-
typeof selectedNode.size === "number" && /* @__PURE__ */ jsxs(Fragment
|
|
1296
|
+
typeof selectedNode.size === "number" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1301
1297
|
className: "theme-muted-text",
|
|
1302
1298
|
children: t.chrome.size
|
|
1303
1299
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1304
1300
|
className: "tabular-nums",
|
|
1305
1301
|
children: formatFileSize(selectedNode.size)
|
|
1306
1302
|
})] }),
|
|
1307
|
-
selectedNode.contentType && /* @__PURE__ */ jsxs(Fragment
|
|
1303
|
+
selectedNode.contentType && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1308
1304
|
className: "theme-muted-text",
|
|
1309
1305
|
children: "Content Type"
|
|
1310
1306
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1311
1307
|
className: "font-mono text-xs",
|
|
1312
1308
|
children: selectedNode.contentType
|
|
1313
1309
|
})] }),
|
|
1314
|
-
createdDt && /* @__PURE__ */ jsxs(Fragment
|
|
1310
|
+
createdDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1315
1311
|
className: "theme-muted-text",
|
|
1316
1312
|
children: t.chrome.created
|
|
1317
1313
|
}), /* @__PURE__ */ jsxs("dd", { children: [
|
|
@@ -1322,7 +1318,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1322
1318
|
children: ["· ", createdDt.toRelative()]
|
|
1323
1319
|
})
|
|
1324
1320
|
] })] }),
|
|
1325
|
-
modifiedDt && /* @__PURE__ */ jsxs(Fragment
|
|
1321
|
+
modifiedDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1326
1322
|
className: "theme-muted-text",
|
|
1327
1323
|
children: "Last Modified"
|
|
1328
1324
|
}), /* @__PURE__ */ jsxs("dd", { children: [
|
|
@@ -1333,14 +1329,14 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1333
1329
|
children: ["· ", modifiedDt.toRelative()]
|
|
1334
1330
|
})
|
|
1335
1331
|
] })] }),
|
|
1336
|
-
selectedNode.hash && /* @__PURE__ */ jsxs(Fragment
|
|
1332
|
+
selectedNode.hash && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1337
1333
|
className: "theme-muted-text",
|
|
1338
1334
|
children: t.chrome.hash
|
|
1339
1335
|
}), /* @__PURE__ */ jsx("dd", {
|
|
1340
1336
|
className: "font-mono text-xs break-all",
|
|
1341
1337
|
children: selectedNode.hash.replace(/^"|"$/g, "")
|
|
1342
1338
|
})] }),
|
|
1343
|
-
selectedNode.storageClass && /* @__PURE__ */ jsxs(Fragment
|
|
1339
|
+
selectedNode.storageClass && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
1344
1340
|
className: "theme-muted-text",
|
|
1345
1341
|
children: "Storage Class"
|
|
1346
1342
|
}), /* @__PURE__ */ jsx("dd", {
|
|
@@ -1420,7 +1416,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
|
|
|
1420
1416
|
}),
|
|
1421
1417
|
" ",
|
|
1422
1418
|
/* @__PURE__ */ jsx("span", {
|
|
1423
|
-
className:
|
|
1419
|
+
className: clsx(isUploadSizeExceeded(pendingUpload?.totalSize ?? 0) && "text-amber-800 font-semibold"),
|
|
1424
1420
|
children: formatFileSize(pendingUpload?.totalSize ?? 0)
|
|
1425
1421
|
})
|
|
1426
1422
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useNotify, useStrings } from "../components/Provider.js";
|
|
2
1
|
import { keyedByContent } from "../components/keys.js";
|
|
2
|
+
import { useNotify, useStrings } from "../components/Provider.js";
|
|
3
3
|
import { mapWithConcurrency } from "./lib/batch.js";
|
|
4
4
|
import { calculateUploadNodesTotalSize, getUploadSessionETA, removeLeadingSlash } from "./lib/utils.js";
|
|
5
5
|
import { UploadSessionToast } from "./toasts.js";
|
|
6
|
-
import { createContext, use, useRef } from "react";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { createContext, use, useRef } from "react";
|
|
8
8
|
//#region src/file-explorer/FileExplorerContext.tsx
|
|
9
9
|
var UPLOAD_CONCURRENCY = 3;
|
|
10
10
|
var FileExplorerContext = createContext(void 0);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCssIsDark } from "../../components/useCssIsDark.js";
|
|
2
2
|
import { defineEditorThemes, getThemeName } from "../../editor/themes.js";
|
|
3
3
|
import { setupMonacoWorkers } from "../../editor/workers.js";
|
|
4
|
-
import { useEffect, useRef } from "react";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useEffect, useRef } from "react";
|
|
6
6
|
import * as monaco from "monaco-editor";
|
|
7
7
|
//#region src/file-explorer/FilePreview/CodePreviewEditor.tsx
|
|
8
8
|
var OPTIONS = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useStrings } from "../../components/Provider.js";
|
|
2
1
|
import { FaExpand } from "../../icons/fa/FaExpand.js";
|
|
2
|
+
import { useStrings } from "../../components/Provider.js";
|
|
3
3
|
import { formatFileSize } from "../lib/utils.js";
|
|
4
4
|
import { getPreviewKind } from "./previewType.js";
|
|
5
5
|
import { StreamedBadge } from "./StreamedBadge.js";
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { useStrings } from "../../components/Provider.js";
|
|
2
1
|
import { FaLock } from "../../icons/fa/FaLock.js";
|
|
3
|
-
import {
|
|
2
|
+
import { useStrings } from "../../components/Provider.js";
|
|
3
|
+
import { InfoTip } from "../../components/InfoTip.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/file-explorer/FilePreview/StreamedBadge.tsx
|
|
6
6
|
function StreamedBadge() {
|
|
7
7
|
const t = useStrings().fileExplorer;
|
|
8
|
-
return /* @__PURE__ */ jsxs(
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"data-tooltip-content": t.preview.streamedTooltip,
|
|
8
|
+
return /* @__PURE__ */ jsxs(InfoTip, {
|
|
9
|
+
text: t.preview.streamedTooltip,
|
|
10
|
+
className: "shrink-0 gap-1 rounded-full border border-green-500/40 bg-green-500/15 px-2 py-0.5 text-[11px] text-green-600",
|
|
12
11
|
children: [/* @__PURE__ */ jsx(FaLock, { className: "h-2.5 w-2.5" }), t.preview.streamed]
|
|
13
12
|
});
|
|
14
13
|
}
|