@parallelworks/ui 0.51.0 → 0.53.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 +197 -17
- package/dist/ai/agent/toolStrings.d.ts +2 -0
- package/dist/ai/agent/toolStrings.js +20 -18
- package/dist/ai/ai.css +17 -3
- package/dist/ai/components/AllocationSelector.js +5 -1
- package/dist/ai/components/AttachmentManager.js +51 -42
- package/dist/ai/components/AttachmentUpload.d.ts +4 -2
- package/dist/ai/components/AttachmentUpload.js +9 -9
- package/dist/ai/components/BlockedGroupBanner.js +8 -14
- package/dist/ai/components/BranchNavigator.js +11 -12
- package/dist/ai/components/ChatEmptyState.js +12 -19
- package/dist/ai/components/ChatInput.d.ts +4 -3
- package/dist/ai/components/ChatInput.js +27 -13
- package/dist/ai/components/ChatMessage.js +45 -121
- package/dist/ai/components/ChatMessageList.d.ts +5 -2
- package/dist/ai/components/ChatMessageList.js +89 -51
- package/dist/ai/components/ChatSidebar.js +11 -7
- package/dist/ai/components/ChatThread.js +1 -13
- package/dist/ai/components/DragOverlay.js +3 -3
- package/dist/ai/components/MessageAttachments.d.ts +10 -0
- package/dist/ai/components/MessageAttachments.js +78 -0
- package/dist/ai/components/ModelSelector.js +3 -3
- package/dist/ai/components/PastedText.js +2 -2
- package/dist/ai/components/ProviderIssueBanner.js +19 -23
- package/dist/ai/components/ShareDialog.js +2 -2
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -2
- package/dist/ai/components/agent/ActivityLine.js +8 -51
- package/dist/ai/components/agent/AgentMessageParts.js +114 -53
- package/dist/ai/core/ChatProvider.d.ts +16 -5
- package/dist/ai/core/ChatProvider.js +41 -8
- package/dist/ai/core/config.js +4 -3
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +3 -3
- package/dist/ai/strings.d.ts +29 -3
- package/dist/ai/strings.js +80 -26
- package/dist/ai/types.d.ts +4 -0
- package/dist/ai/ui/Notice.d.ts +2 -2
- package/dist/ai/ui/Notice.js +29 -62
- package/dist/ai/ui/sidebar.d.ts +5 -3
- package/dist/ai/ui/sidebar.js +22 -10
- package/dist/components/ActionMenu.d.ts +1 -0
- package/dist/components/ActionMenu.js +6 -1
- package/dist/components/AppLink.d.ts +26 -0
- package/dist/components/AppLink.js +51 -0
- package/dist/components/Avatar.d.ts +2 -1
- package/dist/components/Avatar.js +4 -2
- package/dist/components/Button.d.ts +15 -5
- package/dist/components/Button.js +47 -40
- package/dist/components/Callout.d.ts +31 -7
- package/dist/components/Callout.js +50 -19
- package/dist/components/Card.d.ts +11 -6
- package/dist/components/Card.js +14 -8
- package/dist/components/Checkbox.js +2 -1
- package/dist/components/ColorInput.js +5 -3
- package/dist/components/Combobox.js +49 -19
- package/dist/components/ConfirmModal.d.ts +19 -8
- package/dist/components/ConfirmModal.js +31 -53
- package/dist/components/CopyButton.d.ts +38 -0
- package/dist/components/CopyButton.js +68 -0
- package/dist/components/CreateModal.js +118 -111
- package/dist/components/DatePicker.js +12 -8
- package/dist/components/DescriptionList.d.ts +25 -5
- package/dist/components/DescriptionList.js +56 -22
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/Drawer.js +10 -16
- package/dist/components/Field.d.ts +16 -5
- package/dist/components/Field.js +63 -8
- package/dist/components/IconButton.d.ts +14 -5
- package/dist/components/IconButton.js +25 -14
- package/dist/components/InfoTip.d.ts +12 -1
- package/dist/components/InfoTip.js +13 -2
- package/dist/components/Input.d.ts +14 -8
- package/dist/components/Input.js +46 -31
- package/dist/components/Loader.js +1 -1
- package/dist/components/MarkdownImpl.d.ts +1 -0
- package/dist/components/MarkdownImpl.js +1 -0
- package/dist/components/MenuEntries.d.ts +4 -0
- package/dist/components/MenuEntries.js +11 -12
- package/dist/components/Meter.js +5 -4
- package/dist/components/Modal.d.ts +28 -4
- package/dist/components/Modal.js +37 -14
- package/dist/components/Overview.d.ts +20 -12
- package/dist/components/Overview.js +14 -9
- package/dist/components/PageHeader.d.ts +47 -65
- package/dist/components/PageHeader.js +275 -153
- package/dist/components/PageHeaderAction.d.ts +67 -0
- package/dist/components/PageHeaderAction.js +107 -0
- package/dist/components/Pagination.js +6 -16
- package/dist/components/Popover.d.ts +4 -1
- package/dist/components/Popover.js +5 -3
- package/dist/components/Provider.d.ts +79 -19
- package/dist/components/Provider.js +140 -130
- package/dist/components/Radio.js +2 -1
- package/dist/components/RefreshButton.js +7 -8
- package/dist/components/RequiredMark.js +1 -1
- package/dist/components/Section.js +1 -1
- package/dist/components/Select.d.ts +4 -9
- package/dist/components/Select.js +24 -11
- package/dist/components/SettingModeOption.d.ts +1 -1
- package/dist/components/SettingModeOption.js +7 -1
- package/dist/components/SettingsCard.d.ts +5 -3
- package/dist/components/SettingsCard.js +27 -20
- package/dist/components/Slider.js +1 -1
- package/dist/components/StatusBadge.js +2 -2
- package/dist/components/Switch.js +5 -4
- package/dist/components/Table.d.ts +30 -20
- package/dist/components/Table.js +50 -73
- package/dist/components/Tabs.d.ts +3 -7
- package/dist/components/Tabs.js +6 -10
- package/dist/components/ThemeEditor.js +18 -8
- package/dist/components/Toast.d.ts +11 -3
- package/dist/components/Toast.js +45 -20
- package/dist/components/buttonClasses.js +1 -1
- package/dist/components/comboboxItems.d.ts +4 -0
- package/dist/components/comboboxItems.js +6 -1
- package/dist/components/dismiss.d.ts +12 -0
- package/dist/components/dismiss.js +19 -0
- package/dist/components/fieldBox.d.ts +4 -0
- package/dist/components/fieldBox.js +7 -3
- package/dist/components/floating.d.ts +3 -3
- package/dist/components/floating.js +1 -1
- package/dist/components/focus.d.ts +5 -0
- package/dist/components/focus.js +21 -1
- package/dist/components/markdownCodeBreaks.js +3 -4
- package/dist/components/pageHeaderStore.d.ts +41 -0
- package/dist/components/pageHeaderStore.js +67 -0
- package/dist/components/pathBreaks.d.ts +8 -0
- package/dist/components/pathBreaks.js +28 -0
- package/dist/components/segmented.js +1 -1
- package/dist/components/shortcutKey.d.ts +2 -1
- package/dist/components/shortcutKey.js +19 -2
- package/dist/components/splitter.js +1 -1
- package/dist/components/useCssIsDark.js +40 -18
- package/dist/components/useTheme.js +9 -10
- package/dist/dev.d.ts +9 -0
- package/dist/dev.js +14 -0
- package/dist/editor/Editor.d.ts +3 -2
- package/dist/editor/Editor.js +24 -5
- package/dist/editor/EditorField.d.ts +2 -1
- package/dist/editor/EditorField.js +11 -29
- package/dist/editor/FormCodePanel.d.ts +7 -3
- package/dist/editor/FormCodePanel.js +14 -7
- package/dist/editor/Monaco.d.ts +22 -6
- package/dist/editor/Monaco.js +177 -113
- package/dist/editor/editorModel.d.ts +1 -1
- package/dist/editor/editorModel.js +1 -1
- package/dist/editor/index.d.ts +6 -5
- package/dist/editor/index.js +5 -4
- package/dist/editor/languages.d.ts +24 -0
- package/dist/editor/languages.js +31 -0
- package/dist/editor/monacoFeatures.d.ts +7 -0
- package/dist/editor/monacoFeatures.js +19 -0
- package/dist/editor/themes.d.ts +8 -5
- package/dist/editor/themes.js +65 -32
- package/dist/editor/workers.d.ts +3 -3
- package/dist/editor/workers.js +8 -4
- package/dist/editor/yaml.d.ts +6 -2
- package/dist/editor/yaml.js +11 -2
- package/dist/editor/yamlLanguage.js +55 -38
- package/dist/file-explorer/FileExplorer.d.ts +18 -4
- package/dist/file-explorer/FileExplorer.js +204 -142
- package/dist/file-explorer/FileExplorerContext.js +1 -1
- package/dist/file-explorer/FilePreview/StreamedBadge.js +3 -1
- package/dist/file-explorer/FilePreview/Viewer.js +14 -10
- package/dist/file-explorer/FilePreview/index.js +4 -4
- package/dist/file-explorer/FileRow.d.ts +6 -2
- package/dist/file-explorer/FileRow.js +35 -17
- package/dist/file-explorer/FileRowsWindow.d.ts +2 -1
- package/dist/file-explorer/FileRowsWindow.js +36 -4
- package/dist/file-explorer/FileTable.d.ts +3 -1
- package/dist/file-explorer/FileTable.js +6 -3
- package/dist/file-explorer/TreeView.d.ts +5 -1
- package/dist/file-explorer/TreeView.js +86 -39
- package/dist/file-explorer/helpers.d.ts +2 -1
- package/dist/file-explorer/helpers.js +24 -23
- package/dist/file-explorer/lib/utils.d.ts +3 -0
- package/dist/file-explorer/lib/utils.js +6 -1
- package/dist/file-explorer/toasts.js +27 -19
- package/dist/file-explorer/treeRows.d.ts +6 -0
- package/dist/file-explorer/treeRows.js +19 -1
- package/dist/file-explorer/useNearEnd.js +3 -6
- package/dist/form/Fields/CheckboxGroupField.js +12 -5
- package/dist/form/Fields/DurationField.js +1 -1
- package/dist/form/Fields/LabelField.js +1 -1
- package/dist/form/Fields/ObjectField.d.ts +1 -1
- package/dist/form/Fields/ObjectField.js +3 -2
- package/dist/form/Fields/StringField.js +16 -29
- package/dist/form/Fields/TextAreaField.js +3 -4
- package/dist/form/Form.js +3 -8
- package/dist/form/Wizard/WizardNavigation.js +0 -3
- package/dist/form/Wizard/utils.js +2 -1
- package/dist/form/fieldFrame.d.ts +1 -1
- package/dist/form/fieldFrame.js +2 -2
- package/dist/form/types/fieldComponentTypes.d.ts +2 -1
- package/dist/graph/AnnotationBanner.d.ts +1 -2
- package/dist/graph/AnnotationBanner.js +30 -32
- package/dist/graph/Connectors.js +4 -1
- package/dist/graph/DependencyGraph.js +2 -2
- package/dist/graph/GraphEditor.js +11 -9
- package/dist/graph/GraphEditorDialogs.js +1 -1
- package/dist/graph/GraphNode.js +7 -4
- package/dist/graph/InputDialog.js +1 -1
- package/dist/graph/InputsEditor.js +14 -11
- package/dist/graph/MatrixGroup.js +9 -3
- package/dist/graph/Reveal.js +18 -10
- package/dist/graph/ShortcutsButton.d.ts +11 -2
- package/dist/graph/ShortcutsButton.js +14 -3
- package/dist/graph/TreeView.js +35 -18
- package/dist/graph/WorkflowSettingsDialog.js +1 -1
- package/dist/graph/editorFields.js +1 -1
- package/dist/graph/editorRows.js +16 -10
- package/dist/graph/editorStrings.d.ts +7 -0
- package/dist/graph/editorStrings.js +8 -1
- package/dist/graph/inputRefs.js +1 -1
- package/dist/graph/settingsViews.js +11 -18
- package/dist/graph/stepWith.js +1 -1
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +4 -2
- package/dist/index.d.ts +12 -12
- package/dist/index.js +16 -16
- package/dist/list/ActionToolbar.d.ts +42 -6
- package/dist/list/ActionToolbar.js +298 -101
- package/dist/list/ListPage.d.ts +15 -23
- package/dist/list/ListPage.js +42 -43
- package/dist/list/ListTable.d.ts +37 -7
- package/dist/list/ListTable.js +52 -12
- package/dist/list/ListViewControls.js +1 -1
- package/dist/list/UserHoverCard.js +7 -15
- package/dist/list/index.d.ts +2 -2
- package/dist/list/index.js +2 -2
- package/dist/list/listSearch.js +12 -10
- package/dist/list/listView.d.ts +10 -1
- package/dist/list/listView.js +15 -1
- package/dist/logviewer/LogViewer.d.ts +4 -2
- package/dist/logviewer/LogViewer.js +87 -69
- package/dist/logviewer/logviewer.css +3 -2
- package/dist/reducedMotion.d.ts +5 -0
- package/dist/reducedMotion.js +20 -0
- package/dist/safeUrl.d.ts +1 -1
- package/dist/safeUrl.js +4 -2
- package/dist/styles.css +1 -1
- package/package.json +5 -2
- package/dist/components/Breadcrumbs.d.ts +0 -37
- package/dist/components/Breadcrumbs.js +0 -90
- package/dist/components/CopyToClipboard.d.ts +0 -17
- package/dist/components/CopyToClipboard.js +0 -66
- package/dist/components/Sort.d.ts +0 -9
- package/dist/components/Sort.js +0 -42
- package/dist/file-explorer/FilePreview/CodePreviewEditor.d.ts +0 -6
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +0 -64
|
@@ -3,13 +3,13 @@ import { CustomizeIcon, DiskIcon, FileIcon, FileTextIcon, FolderIcon, ImageIcon,
|
|
|
3
3
|
import { toast } from "../components/Toast.js";
|
|
4
4
|
import { usePersistedState, useProvisionCorsRules, useSlots, useStrings } from "../components/Provider.js";
|
|
5
5
|
import { Button } from "../components/Button.js";
|
|
6
|
-
import Callout from "../components/Callout.js";
|
|
6
|
+
import { Callout } from "../components/Callout.js";
|
|
7
7
|
import { ProgressBar } from "../components/Meter.js";
|
|
8
8
|
import { Skeleton } from "../components/Skeleton.js";
|
|
9
9
|
import { formatBytes } from "../format.js";
|
|
10
10
|
import { useElapsed } from "../components/relativeTime.js";
|
|
11
11
|
import { ListSkeleton } from "../list/ListTable.js";
|
|
12
|
-
import { getFileExtension } from "./lib/utils.js";
|
|
12
|
+
import { carriesFiles, getFileExtension } from "./lib/utils.js";
|
|
13
13
|
import { CorsError } from "./lib/errors.js";
|
|
14
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { useState, useTransition } from "react";
|
|
@@ -219,20 +219,17 @@ function CorsIssuePreview({ selectedStorage, onRefresh }) {
|
|
|
219
219
|
return /* @__PURE__ */ jsxs("div", {
|
|
220
220
|
className: "flex flex-col items-center justify-center max-w-lg mx-auto",
|
|
221
221
|
children: [/* @__PURE__ */ jsxs(Callout, {
|
|
222
|
-
className: "text-left",
|
|
223
|
-
|
|
222
|
+
className: "my-4 text-left",
|
|
223
|
+
tone: "info",
|
|
224
|
+
title: t.explanation.title,
|
|
224
225
|
children: [
|
|
225
|
-
/* @__PURE__ */ jsx("h4", {
|
|
226
|
-
className: "font-semibold mb-2",
|
|
227
|
-
children: t.explanation.title
|
|
228
|
-
}),
|
|
229
226
|
/* @__PURE__ */ jsx("p", {
|
|
230
227
|
className: "mb-2",
|
|
231
228
|
children: t.explanation.description
|
|
232
229
|
}),
|
|
233
230
|
/* @__PURE__ */ jsx("p", { children: t.explanation.action }),
|
|
234
231
|
/* @__PURE__ */ jsx("p", {
|
|
235
|
-
className: "mt-2
|
|
232
|
+
className: "mt-2 italic",
|
|
236
233
|
children: t.explanation.note
|
|
237
234
|
})
|
|
238
235
|
]
|
|
@@ -264,32 +261,33 @@ function CorsPropagatingPreview() {
|
|
|
264
261
|
return /* @__PURE__ */ jsxs("div", {
|
|
265
262
|
role: "status",
|
|
266
263
|
"aria-live": "polite",
|
|
267
|
-
className: "flex flex-col items-center justify-center max-w-md mx-auto px-6 py-8 animate-[fadeInUp_400ms_ease-out]",
|
|
264
|
+
className: "flex flex-col items-center justify-center max-w-md mx-auto px-6 py-8 motion-safe:animate-[fadeInUp_400ms_ease-out]",
|
|
268
265
|
children: [
|
|
269
266
|
/* @__PURE__ */ jsxs("div", {
|
|
267
|
+
"aria-hidden": "true",
|
|
270
268
|
className: "relative w-28 h-28 mb-6 flex items-center justify-center",
|
|
271
269
|
children: [
|
|
272
270
|
/* @__PURE__ */ jsx("span", {
|
|
273
|
-
className: "absolute inline-flex h-full w-full rounded-full bg-
|
|
271
|
+
className: "absolute inline-flex h-full w-full rounded-full bg-(--theme-info)/30 motion-safe:animate-ping",
|
|
274
272
|
style: { animationDuration: "2.4s" }
|
|
275
273
|
}),
|
|
276
274
|
/* @__PURE__ */ jsx("span", {
|
|
277
|
-
className: "absolute inline-flex h-2/3 w-2/3 rounded-full bg-
|
|
275
|
+
className: "absolute inline-flex h-2/3 w-2/3 rounded-full bg-(--theme-info)/40 motion-safe:animate-ping",
|
|
278
276
|
style: {
|
|
279
277
|
animationDuration: "2.4s",
|
|
280
278
|
animationDelay: "0.6s"
|
|
281
279
|
}
|
|
282
280
|
}),
|
|
283
281
|
/* @__PURE__ */ jsx("span", {
|
|
284
|
-
className: "absolute inline-flex h-1/3 w-1/3 rounded-full bg-
|
|
282
|
+
className: "absolute inline-flex h-1/3 w-1/3 rounded-full bg-(--theme-info)/60 motion-safe:animate-ping",
|
|
285
283
|
style: {
|
|
286
284
|
animationDuration: "2.4s",
|
|
287
285
|
animationDelay: "1.2s"
|
|
288
286
|
}
|
|
289
287
|
}),
|
|
290
288
|
/* @__PURE__ */ jsx("span", {
|
|
291
|
-
className: "relative inline-flex items-center justify-center w-8 h-8 rounded-full bg-
|
|
292
|
-
children: /* @__PURE__ */ jsx("span", { className: "absolute inline-flex h-2 w-2 rounded-full bg-
|
|
289
|
+
className: "relative inline-flex items-center justify-center w-8 h-8 rounded-full bg-(--theme-info) shadow-[0_0_24px_color-mix(in_oklab,var(--theme-info)_55%,transparent)]",
|
|
290
|
+
children: /* @__PURE__ */ jsx("span", { className: "absolute inline-flex h-2 w-2 rounded-full bg-(--theme-panel-bg) motion-safe:animate-pulse" })
|
|
293
291
|
})
|
|
294
292
|
]
|
|
295
293
|
}),
|
|
@@ -349,7 +347,7 @@ function PropagationStage({ status, label }) {
|
|
|
349
347
|
return /* @__PURE__ */ jsxs("li", {
|
|
350
348
|
className: "flex flex-col items-center gap-1.5",
|
|
351
349
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
352
|
-
className: cx("relative flex items-center justify-center w-6 h-6 rounded-full border transition-colors", status === "done" && "bg-
|
|
350
|
+
className: cx("relative flex items-center justify-center w-6 h-6 rounded-full border transition-colors", status === "done" && "bg-(--theme-success-solid) border-(--theme-success-solid) text-white", status === "active" && "border-(--theme-info)", status === "pending" && "theme-border"),
|
|
353
351
|
children: [
|
|
354
352
|
status === "done" && /* @__PURE__ */ jsx("svg", {
|
|
355
353
|
viewBox: "0 0 16 16",
|
|
@@ -362,7 +360,7 @@ function PropagationStage({ status, label }) {
|
|
|
362
360
|
"aria-hidden": "true",
|
|
363
361
|
children: /* @__PURE__ */ jsx("polyline", { points: "3.5 8.5 6.5 11.5 12.5 5" })
|
|
364
362
|
}),
|
|
365
|
-
status === "active" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-
|
|
363
|
+
status === "active" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { className: "absolute inline-flex h-full w-full motion-safe:animate-ping rounded-full bg-(--theme-info)/60" }), /* @__PURE__ */ jsx("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-(--theme-info)" })] }),
|
|
366
364
|
status === "pending" && /* @__PURE__ */ jsx("span", { className: "inline-flex h-1.5 w-1.5 rounded-full theme-muted-text opacity-60" })
|
|
367
365
|
]
|
|
368
366
|
}), /* @__PURE__ */ jsx("span", {
|
|
@@ -374,7 +372,7 @@ function PropagationStage({ status, label }) {
|
|
|
374
372
|
function PropagationConnector({ active }) {
|
|
375
373
|
return /* @__PURE__ */ jsx("span", {
|
|
376
374
|
"aria-hidden": "true",
|
|
377
|
-
className: cx("h-px w-8 -mt-5 transition-colors", active ? "bg-
|
|
375
|
+
className: cx("h-px w-8 -mt-5 transition-colors", active ? "bg-(--theme-info)" : "theme-border border-t")
|
|
378
376
|
});
|
|
379
377
|
}
|
|
380
378
|
function NoDataAvailablePreview({ selectedStorage, error, onRefresh, connectionIssueMessage = null, className, canWrite = true }) {
|
|
@@ -409,8 +407,11 @@ function NoDataAvailablePreview({ selectedStorage, error, onRefresh, connectionI
|
|
|
409
407
|
className: "flex flex-col items-center justify-center max-w-md p-8",
|
|
410
408
|
children: [
|
|
411
409
|
/* @__PURE__ */ jsx("div", {
|
|
412
|
-
className: "inline-flex items-center justify-center w-14 h-14 rounded-full bg-
|
|
413
|
-
children: /* @__PURE__ */ jsx(WarningIcon, {
|
|
410
|
+
className: "inline-flex items-center justify-center w-14 h-14 rounded-full bg-(--theme-warning-muted) mb-4",
|
|
411
|
+
children: /* @__PURE__ */ jsx(WarningIcon, {
|
|
412
|
+
"aria-hidden": "true",
|
|
413
|
+
className: "h-6 w-6 text-(--theme-warning)"
|
|
414
|
+
})
|
|
414
415
|
}),
|
|
415
416
|
/* @__PURE__ */ jsx("h2", {
|
|
416
417
|
className: "text-base font-semibold mb-1",
|
|
@@ -466,13 +467,13 @@ function DragDropZone({ onDropFiles, children, className = "" }) {
|
|
|
466
467
|
className: cx("transition-[box-shadow,background-color] duration-150", className, isDragging && "ring-1 ring-(--theme-link) ring-inset bg-(--theme-link)/5"),
|
|
467
468
|
onDragOver: (e) => {
|
|
468
469
|
e.preventDefault();
|
|
469
|
-
if (onDropFiles) setIsDragging(true);
|
|
470
|
+
if (onDropFiles && carriesFiles(e.dataTransfer)) setIsDragging(true);
|
|
470
471
|
},
|
|
471
472
|
onDragLeave: () => setIsDragging(false),
|
|
472
473
|
onDrop: (e) => {
|
|
473
474
|
e.preventDefault();
|
|
474
475
|
setIsDragging(false);
|
|
475
|
-
if (!onDropFiles) return;
|
|
476
|
+
if (!onDropFiles || !carriesFiles(e.dataTransfer)) return;
|
|
476
477
|
onDropFiles(e.dataTransfer.items.length ? e.dataTransfer.items : e.dataTransfer.files);
|
|
477
478
|
},
|
|
478
479
|
children
|
|
@@ -532,4 +533,4 @@ async function addCorsRules({ provision, strings, csp, type, username, storageNa
|
|
|
532
533
|
toast.warning(strings.corsPropagating);
|
|
533
534
|
}
|
|
534
535
|
//#endregion
|
|
535
|
-
export { CorsIssuePreview, DragDropZone, NoDataAvailablePreview, NoFileSelectedPreview, NotFoundPreview, SIDEBAR_WIDTH_STORAGE_KEY, ShareFileButton, SkeletonPreview, getNodeIcon, renderUploadNodes };
|
|
536
|
+
export { CorsIssuePreview, CorsPropagatingPreview, DragDropZone, NoDataAvailablePreview, NoFileSelectedPreview, NotFoundPreview, SIDEBAR_WIDTH_STORAGE_KEY, ShareFileButton, SkeletonPreview, getNodeIcon, renderUploadNodes };
|
|
@@ -32,6 +32,9 @@ export declare function attachmentDisposition(filename: string): string;
|
|
|
32
32
|
export declare function getDirectoryPrefixFromNode(node: TreeNode): string;
|
|
33
33
|
export declare function pruneNodesInsideSelectedDirectories(nodes: TreeNode[]): TreeNode[];
|
|
34
34
|
export declare function collectObjectKeysToDelete(nodes: TreeNode[], listKeysUnderPrefix: (prefix: string) => Promise<string[]>): Promise<string[]>;
|
|
35
|
+
/** True when a drag carries files or folders, not a link or text, such as a
|
|
36
|
+
* row's own link dragged across the explorer. */
|
|
37
|
+
export declare function carriesFiles(dataTransfer: DataTransfer): boolean;
|
|
35
38
|
export declare function getUriScheme(uri: string): string;
|
|
36
39
|
export declare function removeLeadingSlash(path: string): string;
|
|
37
40
|
export declare function removeLeadingAndTrailingSlashes(path: string): string;
|
|
@@ -229,6 +229,11 @@ async function collectObjectKeysToDelete(nodes, listKeysUnderPrefix) {
|
|
|
229
229
|
}
|
|
230
230
|
return Array.from(keys);
|
|
231
231
|
}
|
|
232
|
+
/** True when a drag carries files or folders, not a link or text, such as a
|
|
233
|
+
* row's own link dragged across the explorer. */
|
|
234
|
+
function carriesFiles(dataTransfer) {
|
|
235
|
+
return Array.from(dataTransfer.types).includes("Files");
|
|
236
|
+
}
|
|
232
237
|
function getUriScheme(uri) {
|
|
233
238
|
return uri.match(/^([a-z0-9+.-]+):\/\//i)?.[1] ?? "";
|
|
234
239
|
}
|
|
@@ -290,4 +295,4 @@ function getUploadSessionETA(totalLoadedBytes, totalSizeBytes, lastProgressTime,
|
|
|
290
295
|
};
|
|
291
296
|
}
|
|
292
297
|
//#endregion
|
|
293
|
-
export { attachmentDisposition, calculateUploadNodesTotalSize, collectObjectKeysToDelete, createTreeBuilder, ensureTrailingSlash, getDirectoryNameError, getDirectoryObjectPath, getDirectoryPrefixFromNode, getFileExtension, getNodeChildren, getNodeName, getObjectKeyFromNode, getParentPath, getUploadNodesFromDataTransferItems, getUploadSessionETA, getUriScheme, isClientValid, pruneNodesInsideSelectedDirectories, removeLeadingAndTrailingSlashes, removeLeadingSlash };
|
|
298
|
+
export { attachmentDisposition, calculateUploadNodesTotalSize, carriesFiles, collectObjectKeysToDelete, createTreeBuilder, ensureTrailingSlash, getDirectoryNameError, getDirectoryObjectPath, getDirectoryPrefixFromNode, getFileExtension, getNodeChildren, getNodeName, getObjectKeyFromNode, getParentPath, getUploadNodesFromDataTransferItems, getUploadSessionETA, getUriScheme, isClientValid, pruneNodesInsideSelectedDirectories, removeLeadingAndTrailingSlashes, removeLeadingSlash };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { cx } from "../cx.js";
|
|
2
2
|
import { ChevronDownIcon, ChevronUpIcon, CloseIcon, ExpandVerticalIcon, MinimizeIcon, SuccessIcon, UploadIcon, WarningIcon } from "../icons.js";
|
|
3
|
+
import { toneIcon } from "../components/tone.js";
|
|
3
4
|
import { useStrings } from "../components/Provider.js";
|
|
4
5
|
import { Button } from "../components/Button.js";
|
|
5
6
|
import { IconButton } from "../components/IconButton.js";
|
|
7
|
+
import { Callout } from "../components/Callout.js";
|
|
6
8
|
import { ProgressBar } from "../components/Meter.js";
|
|
7
9
|
import { formatBytes, formatTimeLeft } from "../format.js";
|
|
8
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -11,28 +13,34 @@ import { useState } from "react";
|
|
|
11
13
|
function getSessionStatusInfo(session, queueLength, strings) {
|
|
12
14
|
switch (session.status) {
|
|
13
15
|
case "queued": return {
|
|
14
|
-
icon: /* @__PURE__ */ jsx(UploadIcon, { className: "w-5 h-5
|
|
16
|
+
icon: /* @__PURE__ */ jsx(UploadIcon, { className: cx("w-5 h-5", toneIcon.info) }),
|
|
15
17
|
title: strings.inQueue(session.queueIndex + 1, queueLength),
|
|
16
18
|
shortTitle: strings.queuedShort(session.queueIndex + 1, queueLength),
|
|
17
|
-
bgColor: "bg-
|
|
19
|
+
bgColor: "bg-(--theme-info-muted)"
|
|
18
20
|
};
|
|
19
21
|
case "uploading": return {
|
|
20
|
-
icon: /* @__PURE__ */ jsx(UploadIcon, { className: "w-5 h-5
|
|
22
|
+
icon: /* @__PURE__ */ jsx(UploadIcon, { className: cx("w-5 h-5", toneIcon.info) }),
|
|
21
23
|
title: strings.uploading,
|
|
22
24
|
shortTitle: strings.uploading,
|
|
23
|
-
bgColor: "bg-
|
|
25
|
+
bgColor: "bg-(--theme-info-muted)"
|
|
24
26
|
};
|
|
25
27
|
case "completed": return {
|
|
26
|
-
icon: /* @__PURE__ */ jsx(SuccessIcon, { className: "w-5 h-5
|
|
28
|
+
icon: /* @__PURE__ */ jsx(SuccessIcon, { className: cx("w-5 h-5", toneIcon.success) }),
|
|
27
29
|
title: strings.completeTitle,
|
|
28
30
|
shortTitle: strings.completed,
|
|
29
|
-
bgColor: "bg-
|
|
31
|
+
bgColor: "bg-(--theme-success-muted)"
|
|
30
32
|
};
|
|
31
33
|
case "failed": return {
|
|
32
|
-
icon: /* @__PURE__ */ jsx(WarningIcon, { className: "w-5 h-5
|
|
34
|
+
icon: /* @__PURE__ */ jsx(WarningIcon, { className: cx("w-5 h-5", toneIcon.error) }),
|
|
33
35
|
title: strings.failedTitle,
|
|
34
36
|
shortTitle: strings.failed,
|
|
35
|
-
bgColor: "bg-
|
|
37
|
+
bgColor: "bg-(--theme-error-muted)"
|
|
38
|
+
};
|
|
39
|
+
case "canceled": return {
|
|
40
|
+
icon: /* @__PURE__ */ jsx(CloseIcon, { className: "w-5 h-5 theme-muted-text" }),
|
|
41
|
+
title: strings.canceled,
|
|
42
|
+
shortTitle: strings.canceled,
|
|
43
|
+
bgColor: "bg-(--theme-muted-panel-bg)"
|
|
36
44
|
};
|
|
37
45
|
default: return {
|
|
38
46
|
icon: /* @__PURE__ */ jsx(UploadIcon, { className: "w-5 h-5 theme-muted-text" }),
|
|
@@ -178,6 +186,7 @@ function UploadSessionToast({ session, queueLength, onCancel, onCancelFile }) {
|
|
|
178
186
|
}), /* @__PURE__ */ jsx("button", {
|
|
179
187
|
type: "button",
|
|
180
188
|
"aria-label": strings.expandDetails,
|
|
189
|
+
"aria-expanded": false,
|
|
181
190
|
className: "flex items-center justify-between text-xs theme-muted-text hover:theme-text cursor-pointer",
|
|
182
191
|
onClick: handleExpandClick,
|
|
183
192
|
title: strings.expandDetails,
|
|
@@ -221,6 +230,7 @@ function UploadSessionToast({ session, queueLength, onCancel, onCancelFile }) {
|
|
|
221
230
|
}), /* @__PURE__ */ jsx("button", {
|
|
222
231
|
type: "button",
|
|
223
232
|
"aria-label": strings.minimizeDetails,
|
|
233
|
+
"aria-expanded": true,
|
|
224
234
|
className: "flex items-center justify-between text-xs theme-muted-text hover:theme-text cursor-pointer mr-2",
|
|
225
235
|
onClick: handleExpandClick,
|
|
226
236
|
title: strings.minimizeDetails,
|
|
@@ -250,15 +260,11 @@ function UploadSessionToast({ session, queueLength, onCancel, onCancelFile }) {
|
|
|
250
260
|
]
|
|
251
261
|
})
|
|
252
262
|
}),
|
|
253
|
-
isUploading && /* @__PURE__ */ jsx(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
className: "text-xs text-amber-800",
|
|
259
|
-
children: strings.keepPageOpen
|
|
260
|
-
})]
|
|
261
|
-
})
|
|
263
|
+
isUploading && /* @__PURE__ */ jsx(Callout, {
|
|
264
|
+
tone: "warning",
|
|
265
|
+
size: "sm",
|
|
266
|
+
className: "mb-4",
|
|
267
|
+
children: strings.keepPageOpen
|
|
262
268
|
}),
|
|
263
269
|
session.uploadNodes.length > 1 && isUploading && /* @__PURE__ */ jsx(ProgressBar, {
|
|
264
270
|
value: totalProgress,
|
|
@@ -271,6 +277,7 @@ function UploadSessionToast({ session, queueLength, onCancel, onCancelFile }) {
|
|
|
271
277
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
272
278
|
type: "button",
|
|
273
279
|
className: "flex items-center justify-between text-xs theme-muted-text hover:theme-text cursor-pointer",
|
|
280
|
+
"aria-expanded": isFileListExpanded,
|
|
274
281
|
onClick: () => setIsExpanded(!isFileListExpanded),
|
|
275
282
|
children: [/* @__PURE__ */ jsx("span", { children: strings.fileCount(session.uploadNodes.length) }), isFileListExpanded ? /* @__PURE__ */ jsx(ChevronUpIcon, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx(ChevronDownIcon, { className: "w-4 h-4" })]
|
|
276
283
|
}), isFileListExpanded && /* @__PURE__ */ jsx("div", {
|
|
@@ -294,10 +301,11 @@ function UploadSessionToast({ session, queueLength, onCancel, onCancelFile }) {
|
|
|
294
301
|
/* @__PURE__ */ jsxs("div", {
|
|
295
302
|
className: "flex items-center justify-end",
|
|
296
303
|
children: [shouldShowSessionCancelButton && /* @__PURE__ */ jsx(Button, {
|
|
297
|
-
variant: "
|
|
304
|
+
variant: "outline",
|
|
298
305
|
size: "xs",
|
|
306
|
+
className: "*:text-(--theme-error-text)",
|
|
299
307
|
onClick: handleCancelClick,
|
|
300
|
-
children: common.cancel
|
|
308
|
+
children: /* @__PURE__ */ jsx("span", { children: common.cancel })
|
|
301
309
|
}), showCancelConfirm && /* @__PURE__ */ jsxs("div", {
|
|
302
310
|
className: "flex items-center space-x-2",
|
|
303
311
|
children: [
|
|
@@ -32,4 +32,10 @@ export declare function nextFileLimit(current: number | undefined): number;
|
|
|
32
32
|
export declare function findRowIndex(rows: readonly TreeRow[], path: string): number;
|
|
33
33
|
/** The next selectable row in `direction`, skipping skeleton and more rows. */
|
|
34
34
|
export declare function stepRow(rows: readonly TreeRow[], from: number, direction: 1 | -1): TreeRow | undefined;
|
|
35
|
+
/** The row's parent: the nearest row above it one level up, or undefined at a root. */
|
|
36
|
+
export declare function parentRow(rows: readonly TreeRow[], index: number): TreeRow | undefined;
|
|
37
|
+
/** An open folder's first child row, or undefined when it shows none yet. */
|
|
38
|
+
export declare function firstChildRow(rows: readonly TreeRow[], index: number): TreeRow | undefined;
|
|
39
|
+
/** The first or last selectable row, for Home and End. */
|
|
40
|
+
export declare function edgeRow(rows: readonly TreeRow[], edge: 'first' | 'last'): TreeRow | undefined;
|
|
35
41
|
export {};
|
|
@@ -69,5 +69,23 @@ function stepRow(rows, from, direction) {
|
|
|
69
69
|
if (row?.kind === "node") return row;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
/** The row's parent: the nearest row above it one level up, or undefined at a root. */
|
|
73
|
+
function parentRow(rows, index) {
|
|
74
|
+
const depth = rows[index]?.depth ?? 0;
|
|
75
|
+
for (let i = index - 1; i >= 0; i--) {
|
|
76
|
+
const row = rows[i];
|
|
77
|
+
if (row?.kind === "node" && row.depth < depth) return row.depth === depth - 1 ? row : void 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** An open folder's first child row, or undefined when it shows none yet. */
|
|
81
|
+
function firstChildRow(rows, index) {
|
|
82
|
+
const depth = rows[index]?.depth ?? 0;
|
|
83
|
+
const next = rows[index + 1];
|
|
84
|
+
return next?.kind === "node" && next.depth === depth + 1 ? next : void 0;
|
|
85
|
+
}
|
|
86
|
+
/** The first or last selectable row, for Home and End. */
|
|
87
|
+
function edgeRow(rows, edge) {
|
|
88
|
+
return edge === "first" ? stepRow(rows, -1, 1) : stepRow(rows, rows.length, -1);
|
|
89
|
+
}
|
|
72
90
|
//#endregion
|
|
73
|
-
export { findRowIndex, flattenTreeRows, nextFileLimit, stepRow };
|
|
91
|
+
export { edgeRow, findRowIndex, firstChildRow, flattenTreeRows, nextFileLimit, parentRow, stepRow };
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { useEffect,
|
|
1
|
+
import { useEffect, useEffectEvent } from "react";
|
|
2
2
|
//#region src/file-explorer/useNearEnd.ts
|
|
3
3
|
/** Fires once the element comes within 100px of the bottom of `root`. */
|
|
4
4
|
function useNearEnd(ref, { active, root, onNear }) {
|
|
5
|
-
const
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
latestOnNear.current = onNear;
|
|
8
|
-
}, [onNear]);
|
|
5
|
+
const near = useEffectEvent(onNear);
|
|
9
6
|
useEffect(() => {
|
|
10
7
|
const el = ref.current;
|
|
11
8
|
if (!active || !el) return;
|
|
12
9
|
const observer = new IntersectionObserver((entries) => {
|
|
13
|
-
if (entries.some((entry) => entry.isIntersecting))
|
|
10
|
+
if (entries.some((entry) => entry.isIntersecting)) near();
|
|
14
11
|
}, {
|
|
15
12
|
root,
|
|
16
13
|
rootMargin: "100px"
|
|
@@ -5,7 +5,7 @@ import { fieldFrame } from "../fieldFrame.js";
|
|
|
5
5
|
import { useFieldValue } from "../useFieldValue.js";
|
|
6
6
|
import { fieldOption } from "./fieldOption.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { useState } from "react";
|
|
8
|
+
import { useId, useState } from "react";
|
|
9
9
|
//#region src/form/Fields/CheckboxGroupField.tsx
|
|
10
10
|
function impliedFrom(values, implies = {}) {
|
|
11
11
|
const result = /* @__PURE__ */ new Set();
|
|
@@ -19,6 +19,7 @@ function CheckboxGroupField(props) {
|
|
|
19
19
|
const { field, error, disabled, onChange } = props;
|
|
20
20
|
const [value, change] = useFieldValue(field.name ?? "");
|
|
21
21
|
const implies = field.implies;
|
|
22
|
+
const uid = useId();
|
|
22
23
|
const rawOf = new Map((field.options ?? []).map((choice) => {
|
|
23
24
|
const option = fieldOption(choice);
|
|
24
25
|
return [option.value, option.raw];
|
|
@@ -40,26 +41,32 @@ function CheckboxGroupField(props) {
|
|
|
40
41
|
return /* @__PURE__ */ jsx(Field, {
|
|
41
42
|
...fieldFrame(props, { group: true }),
|
|
42
43
|
children: /* @__PURE__ */ jsx("div", {
|
|
43
|
-
className: "flex min-w-0 max-w-lg flex-col
|
|
44
|
-
children: field.options?.map((raw) => {
|
|
44
|
+
className: "flex min-w-0 max-w-lg flex-col",
|
|
45
|
+
children: field.options?.map((raw, index) => {
|
|
45
46
|
const option = fieldOption(raw);
|
|
46
47
|
const locked = forced.has(option.value);
|
|
47
48
|
const optionDisabled = disabled || locked;
|
|
49
|
+
const labelId = `${uid}label${index}`;
|
|
50
|
+
const descriptionId = option.description && `${uid}description${index}`;
|
|
48
51
|
return /* @__PURE__ */ jsxs(FieldOption, {
|
|
49
52
|
disabled: optionDisabled,
|
|
50
|
-
className: cx("-mx-2 flex items-start gap-2.5 rounded-md px-2 py-
|
|
53
|
+
className: cx("-mx-2 flex items-start gap-2.5 rounded-md px-2 py-2 transition-colors", !optionDisabled && "hover:bg-(--theme-hover) has-[:focus-visible]:bg-(--theme-hover)"),
|
|
51
54
|
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
52
55
|
checked: manual.includes(option.value) || locked,
|
|
53
56
|
disabled: optionDisabled,
|
|
54
57
|
onCheckedChange: () => handleToggle(option.value),
|
|
55
58
|
"aria-invalid": error !== void 0 || void 0,
|
|
59
|
+
"aria-labelledby": labelId,
|
|
60
|
+
"aria-describedby": descriptionId || void 0,
|
|
56
61
|
className: "mt-0.5"
|
|
57
62
|
}), /* @__PURE__ */ jsxs("div", {
|
|
58
63
|
className: "flex min-w-0 flex-col",
|
|
59
64
|
children: [/* @__PURE__ */ jsx("span", {
|
|
60
|
-
|
|
65
|
+
id: labelId,
|
|
66
|
+
className: "font-medium leading-5 theme-text",
|
|
61
67
|
children: option.label
|
|
62
68
|
}), option.description && /* @__PURE__ */ jsx("span", {
|
|
69
|
+
id: descriptionId,
|
|
63
70
|
className: "mt-0.5 text-xs leading-snug theme-muted-text",
|
|
64
71
|
children: option.description
|
|
65
72
|
})]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useStrings } from "../../components/Provider.js";
|
|
2
|
+
import { fieldBox } from "../../components/fieldBox.js";
|
|
2
3
|
import { Checkbox } from "../../components/Checkbox.js";
|
|
3
4
|
import { Field, FieldOption } from "../../components/Field.js";
|
|
4
|
-
import { fieldBox } from "../../components/fieldBox.js";
|
|
5
5
|
import { fieldFrame } from "../fieldFrame.js";
|
|
6
6
|
import { useFieldValue } from "../useFieldValue.js";
|
|
7
7
|
import { formatDurationText, parseDurationText } from "../utils/duration.js";
|
|
@@ -10,7 +10,7 @@ function LabelField(props) {
|
|
|
10
10
|
whiteSpace: "pre-wrap",
|
|
11
11
|
...field.size ? { fontSize: `${field.size}px` } : {}
|
|
12
12
|
},
|
|
13
|
-
className: cx("
|
|
13
|
+
className: cx("text-base", field.bold !== false && "font-bold"),
|
|
14
14
|
children: field.text?.toString().replace(/(\r)/g, "").replace(/(\\n)/g, "\n") || label
|
|
15
15
|
})
|
|
16
16
|
});
|
|
@@ -4,4 +4,4 @@ export interface IObjectField extends BaseField {
|
|
|
4
4
|
type: 'object';
|
|
5
5
|
options: DynamicFormSchema;
|
|
6
6
|
}
|
|
7
|
-
export default function ObjectField({ field, label,
|
|
7
|
+
export default function ObjectField({ field, label, help, labelPosition, spaceCompact, }: FieldComponentProps<IObjectField>): import("react").JSX.Element;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { InfoTip } from "../../components/InfoTip.js";
|
|
1
2
|
import { Section } from "../../components/Section.js";
|
|
2
3
|
import { FieldsFromOptions, resolveMetaOverrides } from "../Form.js";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { useMemo } from "react";
|
|
5
6
|
//#region src/form/Fields/ObjectField.tsx
|
|
6
|
-
function ObjectField({ field, label,
|
|
7
|
+
function ObjectField({ field, label, help, labelPosition, spaceCompact }) {
|
|
7
8
|
const fieldName = field.name ?? "";
|
|
8
9
|
const meta = resolveMetaOverrides(field.options, labelPosition, spaceCompact ?? false);
|
|
9
10
|
const parentInfo = useMemo(() => ({ fieldNamePrefix: `${fieldName}.` }), [fieldName]);
|
|
10
11
|
return /* @__PURE__ */ jsx(Section, {
|
|
11
12
|
title: field.label || label,
|
|
12
|
-
beside:
|
|
13
|
+
beside: help && /* @__PURE__ */ jsx(InfoTip, { text: help }),
|
|
13
14
|
collapsible: !field.noCollapse,
|
|
14
15
|
defaultOpen: !field.collapsed,
|
|
15
16
|
children: /* @__PURE__ */ jsx(FieldsFromOptions, {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { fieldBox } from "../../components/fieldBox.js";
|
|
1
|
+
import { Field } from "../../components/Field.js";
|
|
2
|
+
import { Input } from "../../components/Input.js";
|
|
4
3
|
import { fieldFrame } from "../fieldFrame.js";
|
|
5
4
|
import { useFieldValue } from "../useFieldValue.js";
|
|
6
5
|
import { getPlaceholder } from "../utils/getPlaceholder.js";
|
|
7
|
-
import { jsx
|
|
8
|
-
import { useMemo
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { useMemo } from "react";
|
|
9
8
|
//#region src/form/Fields/StringField.tsx
|
|
10
9
|
function StringField(props) {
|
|
11
10
|
const { field, disabled, onChange } = props;
|
|
12
11
|
const [value, change] = useFieldValue(field.name ?? "");
|
|
13
|
-
const [revealed, setRevealed] = useState(false);
|
|
14
12
|
const password = field.type === "password";
|
|
15
13
|
const fallback = field.default ?? "";
|
|
16
14
|
const disallowed = useMemo(() => {
|
|
@@ -31,29 +29,18 @@ function StringField(props) {
|
|
|
31
29
|
};
|
|
32
30
|
return /* @__PURE__ */ jsx(Field, {
|
|
33
31
|
...fieldFrame(props),
|
|
34
|
-
children: (control) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
onChange: handleChange
|
|
47
|
-
});
|
|
48
|
-
return password ? /* @__PURE__ */ jsxs("div", {
|
|
49
|
-
className: "relative w-full",
|
|
50
|
-
children: [input, /* @__PURE__ */ jsx(RevealToggle, {
|
|
51
|
-
revealed,
|
|
52
|
-
onRevealedChange: setRevealed,
|
|
53
|
-
disabled
|
|
54
|
-
})]
|
|
55
|
-
}) : input;
|
|
56
|
-
}
|
|
32
|
+
children: (control) => /* @__PURE__ */ jsx(Input, {
|
|
33
|
+
...control,
|
|
34
|
+
"data-1p-ignore": true,
|
|
35
|
+
name: field.name,
|
|
36
|
+
value: password && value === fallback ? "" : value ?? "",
|
|
37
|
+
type: password ? "password" : "text",
|
|
38
|
+
disabled,
|
|
39
|
+
placeholder: password && field.placeholder === void 0 ? "•".repeat(fallback.toString().length > 0 ? 16 : 0) : getPlaceholder(field.placeholder, field.default),
|
|
40
|
+
minLength: field.minLength,
|
|
41
|
+
maxLength: field.maxLength,
|
|
42
|
+
onChange: handleChange
|
|
43
|
+
})
|
|
57
44
|
});
|
|
58
45
|
}
|
|
59
46
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { cx } from "../../cx.js";
|
|
2
1
|
import { Field } from "../../components/Field.js";
|
|
3
|
-
import {
|
|
2
|
+
import { Textarea } from "../../components/Input.js";
|
|
4
3
|
import { fieldFrame } from "../fieldFrame.js";
|
|
5
4
|
import { useFieldValue } from "../useFieldValue.js";
|
|
6
5
|
import { getPlaceholder } from "../utils/getPlaceholder.js";
|
|
@@ -11,9 +10,9 @@ function TextAreaField(props) {
|
|
|
11
10
|
const [value, change] = useFieldValue(field.name ?? "");
|
|
12
11
|
return /* @__PURE__ */ jsx(Field, {
|
|
13
12
|
...fieldFrame(props),
|
|
14
|
-
children: (control) => /* @__PURE__ */ jsx(
|
|
13
|
+
children: (control) => /* @__PURE__ */ jsx(Textarea, {
|
|
15
14
|
...control,
|
|
16
|
-
className:
|
|
15
|
+
className: "h-20 min-h-20",
|
|
17
16
|
name: field.name,
|
|
18
17
|
value: value ?? "",
|
|
19
18
|
placeholder: getPlaceholder(field.placeholder, field.default),
|
package/dist/form/Form.js
CHANGED
|
@@ -3,7 +3,6 @@ import { Loader } from "../components/Loader.js";
|
|
|
3
3
|
import { useStrings, useWorkflowEngine } from "../components/Provider.js";
|
|
4
4
|
import { Button } from "../components/Button.js";
|
|
5
5
|
import { FieldRowContext } from "../components/Field.js";
|
|
6
|
-
import { InfoTip } from "../components/InfoTip.js";
|
|
7
6
|
import { Section } from "../components/Section.js";
|
|
8
7
|
import { parseWizardConfig } from "./Wizard/utils.js";
|
|
9
8
|
import { inputWidth, resolvedFlag } from "./lib.js";
|
|
@@ -322,10 +321,7 @@ var FormField = memo(function FormField({ fieldName, optionsField, nested, field
|
|
|
322
321
|
setValue
|
|
323
322
|
]);
|
|
324
323
|
const tooltip = field?.tooltip;
|
|
325
|
-
const
|
|
326
|
-
className: "pr-2",
|
|
327
|
-
text: typeof tooltip === "string" ? tooltip.replace(/\r/g, "") : tooltip.filter(Boolean).join("\n")
|
|
328
|
-
}) : null, [tooltip]);
|
|
324
|
+
const help = (typeof tooltip === "string" ? tooltip.replace(/\r/g, "") : tooltip?.filter(Boolean).join("\n")) || void 0;
|
|
329
325
|
const path = editing ? [...editing.parent, fieldName] : null;
|
|
330
326
|
if (field === null || fieldName === "v3") return null;
|
|
331
327
|
if (reads.hidden) return editing && path && fieldName !== "$meta" ? /* @__PURE__ */ jsx(editing.Row, {
|
|
@@ -408,7 +404,7 @@ var FormField = memo(function FormField({ fieldName, optionsField, nested, field
|
|
|
408
404
|
disabled: Boolean(fieldObj.disabled),
|
|
409
405
|
computeOn: computeOn || fieldObj.computeOn,
|
|
410
406
|
spaceCompact,
|
|
411
|
-
|
|
407
|
+
help
|
|
412
408
|
})
|
|
413
409
|
})
|
|
414
410
|
});
|
|
@@ -625,8 +621,7 @@ function DynamicFormBody({ form, formJSONs: options = {}, reinitialize = false,
|
|
|
625
621
|
parsed
|
|
626
622
|
]);
|
|
627
623
|
const report = useEffectEvent((values) => {
|
|
628
|
-
|
|
629
|
-
onValuesChange?.(rest);
|
|
624
|
+
onValuesChange?.(values);
|
|
630
625
|
});
|
|
631
626
|
useEffect(() => form.subscribe({
|
|
632
627
|
formState: { values: true },
|
|
@@ -44,20 +44,17 @@ function WizardNavigation({ isLastStep, canGoBack, isCurrentStepValid, nextLabel
|
|
|
44
44
|
variant: "secondary",
|
|
45
45
|
onClick: onPrevious,
|
|
46
46
|
disabled: !canGoBack || isLoading,
|
|
47
|
-
"aria-label": t.previousStep,
|
|
48
47
|
children: prevLabel || common.previous
|
|
49
48
|
}), isLastStep && !onSubmit ? null : isLastStep ? /* @__PURE__ */ jsx(Button, {
|
|
50
49
|
variant: "primary",
|
|
51
50
|
onClick: handleSubmit,
|
|
52
51
|
disabled: !isCurrentStepValid,
|
|
53
52
|
loading: isLoading,
|
|
54
|
-
"aria-label": submitLabel,
|
|
55
53
|
children: submitLabel
|
|
56
54
|
}) : /* @__PURE__ */ jsx(Button, {
|
|
57
55
|
variant: "primary",
|
|
58
56
|
onClick: handleNext,
|
|
59
57
|
loading: isLoading,
|
|
60
|
-
"aria-label": t.nextStep,
|
|
61
58
|
children: nextLabel || common.next
|
|
62
59
|
})]
|
|
63
60
|
})] });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isDev } from "../../dev.js";
|
|
1
2
|
//#region src/form/Wizard/utils.ts
|
|
2
3
|
function isWizardMeta(value) {
|
|
3
4
|
return typeof value === "object" && value !== null && "wizard" in value;
|
|
@@ -16,7 +17,7 @@ function parseWizardConfig(options) {
|
|
|
16
17
|
stepOrder.push(key);
|
|
17
18
|
}
|
|
18
19
|
if (stepOrder.length === 0) {
|
|
19
|
-
console.warn("Wizard mode enabled but no steps found");
|
|
20
|
+
if (isDev()) console.warn("Wizard mode enabled but no steps found");
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
23
|
return {
|
|
@@ -2,6 +2,6 @@ import type { FieldProps } from '../components/Field.js';
|
|
|
2
2
|
import type { FieldComponentProps } from './types/fieldComponentTypes.js';
|
|
3
3
|
/** How a form field's props frame it: its label, help, description, required mark and error,
|
|
4
4
|
* laid out as the form lays out its fields. Spread on `Field`. */
|
|
5
|
-
export declare function fieldFrame({ field, label, labelPosition, error, disabled, spaceCompact,
|
|
5
|
+
export declare function fieldFrame({ field, label, labelPosition, error, disabled, spaceCompact, help }: FieldComponentProps, { group }?: {
|
|
6
6
|
group?: boolean;
|
|
7
7
|
}): Omit<FieldProps, 'children'>;
|
package/dist/form/fieldFrame.js
CHANGED
|
@@ -2,10 +2,10 @@ import { resolvedFlag } from "./lib.js";
|
|
|
2
2
|
//#region src/form/fieldFrame.ts
|
|
3
3
|
/** How a form field's props frame it: its label, help, description, required mark and error,
|
|
4
4
|
* laid out as the form lays out its fields. Spread on `Field`. */
|
|
5
|
-
function fieldFrame({ field, label, labelPosition, error, disabled, spaceCompact,
|
|
5
|
+
function fieldFrame({ field, label, labelPosition, error, disabled, spaceCompact, help }, { group = false } = {}) {
|
|
6
6
|
return {
|
|
7
7
|
label,
|
|
8
|
-
|
|
8
|
+
help,
|
|
9
9
|
description: field.description,
|
|
10
10
|
group,
|
|
11
11
|
required: !resolvedFlag(field.optional),
|