@parallelworks/ui 0.1.0 → 0.3.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/dist/assets/editor.worker-CuBRIwi-.js +14776 -0
- package/dist/assets/json.worker-8ytS02vz.js +22161 -0
- package/dist/assets/yaml.worker-DJC-VUcv.js +48367 -0
- package/dist/chunks/CodePreviewEditor-CSPRILMp.js +61 -0
- package/dist/chunks/Indicator-hBSIxOPK.js +39 -0
- package/dist/chunks/Loader-DQiZ75fa.js +25 -0
- package/dist/chunks/Markdown-C5Re2ezs.js +101 -0
- package/dist/chunks/MarkdownImpl-Bq4QhrtA.js +33 -0
- package/dist/chunks/Modal-sOUEwebV.js +121 -0
- package/dist/chunks/Monaco-CC4ak1JG.js +717 -0
- package/dist/chunks/Provider-DvVvScTQ.js +391 -0
- package/dist/chunks/StatusBadge-DXp4zkSd.js +46 -0
- package/dist/chunks/SwitchToggle-2uRw8ZeJ.js +725 -0
- package/dist/chunks/SwitchToggleSmall-FcsaYSTs.js +14 -0
- package/dist/chunks/Table-C5z6qWjM.js +91 -0
- package/dist/chunks/Tooltip-WgbiC_nd.js +71 -0
- package/dist/chunks/editor-D55tumuZ.js +372 -0
- package/dist/chunks/lib-DTgL8klR.js +191 -0
- package/dist/chunks/list-7PyDF1tz.js +465 -0
- package/dist/components/CollapsiblePanel.d.ts +27 -0
- package/dist/components/CopyToClipboard.d.ts +17 -0
- package/dist/components/Dropdown.d.ts +24 -0
- package/dist/components/Indicator.d.ts +4 -0
- package/dist/components/Listbox.d.ts +18 -0
- package/dist/components/Markdown.d.ts +7 -0
- package/dist/components/MarkdownImpl.d.ts +2 -0
- package/dist/components/MultiSelect.d.ts +19 -0
- package/dist/components/Overview.d.ts +12 -0
- package/dist/components/Provider.d.ts +438 -0
- package/dist/components/SectionHeader.d.ts +6 -0
- package/dist/components/SwitchToggle.d.ts +12 -0
- package/dist/components/SwitchToggleSmall.d.ts +6 -0
- package/dist/components/dropdownUtils.d.ts +18 -0
- package/dist/editor/Editor.d.ts +2 -0
- package/dist/editor/EditorField.d.ts +11 -0
- package/dist/editor/FormCodePanel.d.ts +8 -0
- package/dist/editor/Monaco.d.ts +31 -0
- package/dist/editor/index.d.ts +7 -0
- package/dist/editor/index.js +2 -0
- package/dist/editor/themes.d.ts +4 -0
- package/dist/editor/useCssIsDark.d.ts +6 -0
- package/dist/editor/workers.d.ts +6 -0
- package/dist/file-explorer/FileExplorer.d.ts +23 -0
- package/dist/file-explorer/FileExplorerContext.d.ts +17 -0
- package/dist/file-explorer/FilePreview/CodePreviewEditor.d.ts +6 -0
- package/dist/file-explorer/FilePreview/Inline.d.ts +13 -0
- package/dist/file-explorer/FilePreview/StreamedBadge.d.ts +1 -0
- package/dist/file-explorer/FilePreview/Viewer.d.ts +15 -0
- package/dist/file-explorer/FilePreview/index.d.ts +15 -0
- package/dist/file-explorer/FilePreview/parse.d.ts +24 -0
- package/dist/file-explorer/FilePreview/previewCache.d.ts +26 -0
- package/dist/file-explorer/FilePreview/previewType.d.ts +21 -0
- package/dist/file-explorer/FilePreview/readCappedBytes.d.ts +37 -0
- package/dist/file-explorer/FilePreview/useObjectBlobUrl.d.ts +16 -0
- package/dist/file-explorer/FilePreview/useObjectText.d.ts +23 -0
- package/dist/file-explorer/FilePreview/usePresignedUrl.d.ts +12 -0
- package/dist/file-explorer/FileRow.d.ts +35 -0
- package/dist/file-explorer/FileRowsWindow.d.ts +43 -0
- package/dist/file-explorer/FileTable.d.ts +26 -0
- package/dist/file-explorer/FileTableHeaders.d.ts +13 -0
- package/dist/file-explorer/LoadMoreRow.d.ts +15 -0
- package/dist/file-explorer/TreeView.d.ts +28 -0
- package/dist/file-explorer/helpers.d.ts +47 -0
- package/dist/file-explorer/index.d.ts +10 -0
- package/dist/file-explorer/index.js +5646 -0
- package/dist/file-explorer/lib/batch.d.ts +3 -0
- package/dist/file-explorer/lib/errors.d.ts +3 -0
- package/dist/file-explorer/lib/fileExplorer.d.ts +32 -0
- package/dist/file-explorer/lib/paging.d.ts +93 -0
- package/dist/file-explorer/lib/types.d.ts +92 -0
- package/dist/file-explorer/lib/utils.d.ts +37 -0
- package/dist/file-explorer/toasts.d.ts +9 -0
- package/dist/file-explorer/treeRows.d.ts +35 -0
- package/dist/file-explorer/useNearEnd.d.ts +7 -0
- package/dist/form/FieldWrapper.d.ts +10 -0
- package/dist/form/Fields/BooleanField.d.ts +12 -0
- package/dist/form/Fields/BucketReadOnlyField.d.ts +7 -0
- package/dist/form/Fields/CheckboxGroupField.d.ts +18 -0
- package/dist/form/Fields/ColorField.d.ts +8 -0
- package/dist/form/Fields/DropdownField.d.ts +24 -0
- package/dist/form/Fields/DurationField.d.ts +13 -0
- package/dist/form/Fields/LabelField.d.ts +9 -0
- package/dist/form/Fields/MultiDropdownField.d.ts +18 -0
- package/dist/form/Fields/NumberField.d.ts +13 -0
- package/dist/form/Fields/ObjectField.d.ts +8 -0
- package/dist/form/Fields/RadioField.d.ts +9 -0
- package/dist/form/Fields/RangeField.d.ts +11 -0
- package/dist/form/Fields/ResourceOptionIcon.d.ts +11 -0
- package/dist/form/Fields/StepField.d.ts +3 -0
- package/dist/form/Fields/StringField.d.ts +17 -0
- package/dist/form/Fields/TextAreaField.d.ts +8 -0
- package/dist/form/Fields/durationValidity.d.ts +2 -0
- package/dist/form/Form.d.ts +105 -0
- package/dist/form/SpecialTypes/DropdownWrapper.d.ts +14 -0
- package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +53 -0
- package/dist/form/SpecialTypes/FormikCustomInput.d.ts +17 -0
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.d.ts +13 -0
- package/dist/form/SpecialTypes/FormikNumericInput.d.ts +9 -0
- package/dist/form/SpecialTypes/index.d.ts +3 -0
- package/dist/form/Wizard/WizardContainer.d.ts +5 -0
- package/dist/form/Wizard/WizardNavigation.d.ts +2 -0
- package/dist/form/Wizard/WizardStepContent.d.ts +8 -0
- package/dist/form/Wizard/WizardStepIndicator.d.ts +2 -0
- package/dist/form/Wizard/types.d.ts +171 -0
- package/dist/form/Wizard/useWizardState.d.ts +28 -0
- package/dist/form/Wizard/utils.d.ts +2 -0
- package/dist/form/fieldRegistry.d.ts +7 -0
- package/dist/form/index.d.ts +16 -0
- package/dist/form/index.js +2319 -0
- package/dist/form/lib.d.ts +15 -0
- package/dist/form/types/fieldComponentTypes.d.ts +32 -0
- package/dist/form/types/fieldTypes.d.ts +80 -0
- package/dist/form/types/workflow-schema.d.ts +1107 -0
- package/dist/form/useParsedOpts.d.ts +5 -0
- package/dist/form/usePrevious.d.ts +1 -0
- package/dist/form/utils/checkShowIfObject.d.ts +1 -0
- package/dist/form/utils/getParentValue.d.ts +1 -0
- package/dist/form/utils/getPlaceholder.d.ts +2 -0
- package/dist/form/utils/getValueUsingPath.d.ts +1 -0
- package/dist/form/utils/pwResolver.d.ts +18 -0
- package/dist/form/utils/secondaryField.d.ts +8 -0
- package/dist/form/utils/slurmDuration.d.ts +15 -0
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +2 -2
- package/dist/index.d.ts +17 -0
- package/dist/index.js +42 -350
- package/dist/list/ListTable.d.ts +63 -0
- package/dist/list/RowContextMenu.d.ts +113 -0
- package/dist/list/index.d.ts +2 -0
- package/dist/list/index.js +2 -0
- package/dist/logviewer/LogViewer.d.ts +18 -0
- package/dist/logviewer/index.d.ts +1 -0
- package/dist/logviewer/index.js +534 -0
- package/dist/logviewer/logviewer.css +70 -0
- package/dist/styles/theme.css +30 -0
- package/dist/styles.css +1 -1
- package/dist/workflow/AnnotationBanner.d.ts +5 -0
- package/dist/workflow/Collapse.d.ts +6 -0
- package/dist/workflow/DependencyGraph.d.ts +15 -0
- package/dist/workflow/JobSummary.d.ts +38 -0
- package/dist/workflow/MatrixGroup.d.ts +41 -0
- package/dist/workflow/Reveal.d.ts +7 -0
- package/dist/workflow/TreeView.d.ts +42 -0
- package/dist/workflow/index.d.ts +1 -0
- package/dist/workflow/index.js +2331 -0
- package/package.json +71 -6
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function paginate<TPage>(fetchPage: (cursor?: string) => Promise<TPage>, nextCursor: (page: TPage) => string | undefined): AsyncGenerator<TPage>;
|
|
2
|
+
export declare function chunk<T>(items: readonly T[], size: number): T[][];
|
|
3
|
+
export declare function mapWithConcurrency<T, R>(items: readonly T[], limit: number, worker: (item: T) => Promise<R>): Promise<PromiseSettledResult<R>[]>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TListPageRequest } from './paging.js';
|
|
2
|
+
import type { TreeNode, TStorage, TStorageObject } from './types.js';
|
|
3
|
+
/** Every provider resolves get-file as a [url, error] tuple. */
|
|
4
|
+
export type FileExplorerGetFileResult = [string | null, Error | null];
|
|
5
|
+
/** The UI only checks Errors?.length; each provider's richer error entries
|
|
6
|
+
* satisfy this structurally. */
|
|
7
|
+
export interface FileExplorerDeleteFilesResult {
|
|
8
|
+
Errors?: unknown[];
|
|
9
|
+
}
|
|
10
|
+
export interface IFileExplorerClient {
|
|
11
|
+
getStorageName(): string;
|
|
12
|
+
getExpiresAt(): Date;
|
|
13
|
+
getFile(input: unknown): Promise<FileExplorerGetFileResult>;
|
|
14
|
+
listDirectory(input: unknown): Promise<unknown>;
|
|
15
|
+
deleteFiles(input: unknown): Promise<FileExplorerDeleteFilesResult>;
|
|
16
|
+
uploadFile(input: unknown, onProgress?: (progress: {
|
|
17
|
+
loadedBytes: number;
|
|
18
|
+
totalBytes: number;
|
|
19
|
+
percentage: number;
|
|
20
|
+
}) => void, abortController?: AbortController): Promise<unknown>;
|
|
21
|
+
}
|
|
22
|
+
export interface IFileExplorerProvider {
|
|
23
|
+
createClient: ((organization: string, username: string, name: string) => Promise<IFileExplorerClient | null>) | null;
|
|
24
|
+
convertDataToStorageObjects?(data: unknown): TStorageObject[];
|
|
25
|
+
/** Absent ⇒ the explorer treats one page as the whole directory. Method syntax for
|
|
26
|
+
* the same bivariance reason as the two above. */
|
|
27
|
+
nextPageCursor?(data: unknown): string | undefined;
|
|
28
|
+
listDirectoryInput?: ((storage: TStorage, dir_path?: string, page?: TListPageRequest) => unknown) | null;
|
|
29
|
+
getFileInput?: ((storageName: string, node: TreeNode, presignedUrlExpiresIn?: number) => unknown) | null;
|
|
30
|
+
deleteFilesInput?: ((storageName: string, nodes: TreeNode[]) => unknown) | null;
|
|
31
|
+
uploadFileInput?: ((storageName: string, objectPath: string, file: File | Blob) => unknown) | null;
|
|
32
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { TStorageObject } from './types.js';
|
|
2
|
+
/** Both providers already cap an unqualified list at 1,000, so stating it leaves
|
|
3
|
+
* single-page directories byte-identical. */
|
|
4
|
+
export declare const LIST_PAGE_SIZE = 1000;
|
|
5
|
+
export type TListPageRequest = {
|
|
6
|
+
cursor?: string;
|
|
7
|
+
/** Overridable so a test can page without seeding 2,000 objects. */
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
};
|
|
10
|
+
/** Keyed by tree path. A storage's flat `objects` bag cannot say whether a directory
|
|
11
|
+
* was listed at all, only whether anything landed under it. */
|
|
12
|
+
export type TDirectoryListing = {
|
|
13
|
+
/** Present ⇒ more entries exist and the provider can resume from here. */
|
|
14
|
+
cursor?: string;
|
|
15
|
+
/** 0 ⇒ never listed, which is what tells "empty" apart from "not asked yet". */
|
|
16
|
+
pagesLoaded: number;
|
|
17
|
+
/** Not `loadingPaths`, which swaps the whole table for a skeleton and would blank
|
|
18
|
+
* the rows being read. */
|
|
19
|
+
loadingMore: boolean;
|
|
20
|
+
/** The storage-level error surfaces only on an empty folder, so without this a
|
|
21
|
+
* failure mid-folder is invisible. */
|
|
22
|
+
error?: string;
|
|
23
|
+
};
|
|
24
|
+
/** Uncapped, opening a 200k-object folder and scrolling would walk all of it. */
|
|
25
|
+
export declare const MAX_AUTO_PAGES = 5;
|
|
26
|
+
export type TListings = ReadonlyMap<string, TDirectoryListing>;
|
|
27
|
+
export declare function isListed(listings: TListings, path: string): boolean;
|
|
28
|
+
/** True even while a request is in flight, so the sentinel stays put. */
|
|
29
|
+
export declare function hasMore(listings: TListings, path: string): boolean;
|
|
30
|
+
/** Auto-load stops at the cap; past it the user asks for each page. */
|
|
31
|
+
export declare function canAutoLoadMore(listings: TListings, path: string): boolean;
|
|
32
|
+
export declare function isLoadingMore(listings: TListings, path: string): boolean;
|
|
33
|
+
export declare function loadMoreError(listings: TListings, path: string): string | undefined;
|
|
34
|
+
export declare function beginLoadingMore(listings: TListings, path: string): TListings;
|
|
35
|
+
/** `expectedPagesLoaded` is captured before the request: a mismatch means a refresh
|
|
36
|
+
* reset this directory while the page was in flight. */
|
|
37
|
+
export declare function advanceListing(listings: TListings, path: string, page: {
|
|
38
|
+
cursor?: string;
|
|
39
|
+
}, expectedPagesLoaded: number): TListings;
|
|
40
|
+
/** Always a new map, since the hydration walk only re-runs on a `listings` change.
|
|
41
|
+
* `pagesLoaded` stays put, so a failed first page still reads as unlisted. */
|
|
42
|
+
export declare function recordListingError(listings: TListings, path: string, error: string): TListings;
|
|
43
|
+
/** Slash-terminates the prefix: without it, clearing `logs` would also clear
|
|
44
|
+
* `logs-archive/`. */
|
|
45
|
+
export declare function clearListingsUnder(listings: TListings, path: string): TListings;
|
|
46
|
+
/** The same prefix rule for the attempt sets that shadow `listings`. They gate
|
|
47
|
+
* re-listing, so a path left behind here reads as tried-and-empty forever. */
|
|
48
|
+
export declare function forgetPathsUnder(paths: Set<string>, path: string): void;
|
|
49
|
+
/** Tree paths whose children should keep arrival order, since sorting them would
|
|
50
|
+
* reshuffle rows under the user mid-scroll. */
|
|
51
|
+
export declare function incompletePaths(listings: TListings): Set<string>;
|
|
52
|
+
/** Reached only when the target is deep inside a directory of well over 20,000
|
|
53
|
+
* entries, where the alternative is draining it all. */
|
|
54
|
+
export declare const MAX_HYDRATION_PAGES = 20;
|
|
55
|
+
type THydrationStep =
|
|
56
|
+
/** List this directory's first page. */
|
|
57
|
+
{
|
|
58
|
+
kind: 'fetch';
|
|
59
|
+
path: string;
|
|
60
|
+
}
|
|
61
|
+
/** Pull another page; the target is not in what we have. */
|
|
62
|
+
| {
|
|
63
|
+
kind: 'more';
|
|
64
|
+
path: string;
|
|
65
|
+
} | {
|
|
66
|
+
kind: 'stuck';
|
|
67
|
+
}
|
|
68
|
+
/** Either resolved, or a request is already in flight. */
|
|
69
|
+
| {
|
|
70
|
+
kind: 'done';
|
|
71
|
+
};
|
|
72
|
+
/** What a deep link needs next. Pure so the walk is table-testable. */
|
|
73
|
+
export declare function nextHydrationStep({ targetResolved, ancestors, isListableDir, listings, inFlight, attempted, pagesPulled, }: {
|
|
74
|
+
targetResolved: boolean;
|
|
75
|
+
/** Directory paths from the storage root down to the target. */
|
|
76
|
+
ancestors: readonly string[];
|
|
77
|
+
/** False above the storage root, and false for a directory a page has not
|
|
78
|
+
* introduced yet. */
|
|
79
|
+
isListableDir: (path: string) => boolean;
|
|
80
|
+
listings: TListings;
|
|
81
|
+
/** Must not be a state value: `attempted` is a ref, so a state-backed signal would
|
|
82
|
+
* lag it by a render and make an in-flight ancestor read as stuck. */
|
|
83
|
+
inFlight: ReadonlySet<string>;
|
|
84
|
+
attempted: ReadonlySet<string>;
|
|
85
|
+
pagesPulled: number;
|
|
86
|
+
}): THydrationStep;
|
|
87
|
+
/** `replace` drops the directory's previous contents first, which is how a refresh
|
|
88
|
+
* sheds deleted objects rather than re-adding them. */
|
|
89
|
+
export declare function nextObjects(previous: TStorageObject[], page: TStorageObject[], options: {
|
|
90
|
+
replace?: boolean;
|
|
91
|
+
dirPath: string;
|
|
92
|
+
}): TStorageObject[];
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { IFileExplorerClient, IFileExplorerProvider } from './fileExplorer.js';
|
|
2
|
+
export type TStorage = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
bucketName?: string;
|
|
6
|
+
user: string;
|
|
7
|
+
displayName?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
created?: string;
|
|
10
|
+
modified?: string;
|
|
11
|
+
region?: string;
|
|
12
|
+
csp?: string;
|
|
13
|
+
imageUrl?: string;
|
|
14
|
+
canWrite?: boolean | undefined;
|
|
15
|
+
canUpload?: boolean | undefined;
|
|
16
|
+
canShare?: boolean | undefined;
|
|
17
|
+
canManageAccess?: boolean | undefined;
|
|
18
|
+
supportsPwUri?: boolean | undefined;
|
|
19
|
+
objects?: TStorageObject[];
|
|
20
|
+
};
|
|
21
|
+
export type TStorageObject = {
|
|
22
|
+
path: string;
|
|
23
|
+
type: 'file' | 'directory';
|
|
24
|
+
key?: string;
|
|
25
|
+
size?: number;
|
|
26
|
+
created?: string;
|
|
27
|
+
modified?: string;
|
|
28
|
+
contentType?: string;
|
|
29
|
+
hash?: string;
|
|
30
|
+
storageClass?: string;
|
|
31
|
+
};
|
|
32
|
+
export type TreeNode = {
|
|
33
|
+
name: string;
|
|
34
|
+
displayName?: string;
|
|
35
|
+
path: string;
|
|
36
|
+
relativePath?: string;
|
|
37
|
+
type: 'file' | 'directory';
|
|
38
|
+
size?: number;
|
|
39
|
+
created?: string;
|
|
40
|
+
modified?: string;
|
|
41
|
+
contentType?: string;
|
|
42
|
+
hash?: string;
|
|
43
|
+
storageClass?: string;
|
|
44
|
+
storageId?: string;
|
|
45
|
+
storageName?: string;
|
|
46
|
+
storageNodeIcon?: string;
|
|
47
|
+
storageImageUrl?: string;
|
|
48
|
+
storageType?: string;
|
|
49
|
+
root?: boolean;
|
|
50
|
+
};
|
|
51
|
+
export type TreeMap = {
|
|
52
|
+
[path: string]: TreeNode;
|
|
53
|
+
};
|
|
54
|
+
export type UploadNode = {
|
|
55
|
+
name: string;
|
|
56
|
+
file: File | Blob;
|
|
57
|
+
relativePath: string;
|
|
58
|
+
};
|
|
59
|
+
export interface UploadFileProgress {
|
|
60
|
+
fileKey: string;
|
|
61
|
+
fileSizeBytes: number;
|
|
62
|
+
loadedBytes?: number;
|
|
63
|
+
totalBytes?: number;
|
|
64
|
+
percentage?: number;
|
|
65
|
+
abortController?: AbortController;
|
|
66
|
+
status?: 'pending' | 'uploading' | 'completed' | 'failed' | 'cancelled';
|
|
67
|
+
}
|
|
68
|
+
export interface UploadSession {
|
|
69
|
+
id: string;
|
|
70
|
+
storageName: string;
|
|
71
|
+
targetPath: string;
|
|
72
|
+
uploadNodes: UploadNode[];
|
|
73
|
+
status: 'queued' | 'uploading' | 'completed' | 'failed' | 'cancelled';
|
|
74
|
+
queueIndex: number;
|
|
75
|
+
client: IFileExplorerClient;
|
|
76
|
+
provider: IFileExplorerProvider;
|
|
77
|
+
progress?: {
|
|
78
|
+
completedFiles: number;
|
|
79
|
+
totalFiles: number;
|
|
80
|
+
totalSizeBytes: number;
|
|
81
|
+
allFiles?: Map<string, UploadFileProgress>;
|
|
82
|
+
overallProgress?: number;
|
|
83
|
+
totalLoadedBytes?: number;
|
|
84
|
+
lastProgressTime?: number;
|
|
85
|
+
lastProgressBytes?: number;
|
|
86
|
+
estimatedSecondsLeft?: number;
|
|
87
|
+
};
|
|
88
|
+
toastId: string;
|
|
89
|
+
abortController?: AbortController;
|
|
90
|
+
targetNode: TreeNode;
|
|
91
|
+
refreshTargetNode: (targetNode: TreeNode) => Promise<unknown>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IFileExplorerClient } from './fileExplorer.js';
|
|
2
|
+
import type { TStorage, TreeMap, TreeNode, UploadNode } from './types.js';
|
|
3
|
+
export declare function formatFileSize(bytes: number): string;
|
|
4
|
+
export declare function getFileExtension(filename: string): string | null;
|
|
5
|
+
export declare function buildTreeFromUserStorages(storages: TStorage[], options?: {
|
|
6
|
+
forceUserHierarchy?: boolean;
|
|
7
|
+
unsortedParents?: ReadonlySet<string>;
|
|
8
|
+
}): {
|
|
9
|
+
treeMap: TreeMap;
|
|
10
|
+
parentToChildrenMap: Record<string, TreeNode[]>;
|
|
11
|
+
};
|
|
12
|
+
export declare function getNodeChildren(parentToChildrenMap: Record<string, TreeNode[]>, parentPath: string): TreeNode[];
|
|
13
|
+
export declare function getParentPath(currentPath: string): string;
|
|
14
|
+
export type DirectoryNameError = 'reserved' | 'separator' | 'exists';
|
|
15
|
+
export declare function getDirectoryNameError(name: string, siblings: TreeNode[]): DirectoryNameError | null;
|
|
16
|
+
export declare function getDirectoryObjectPath(parentNode: TreeNode, directoryName: string): string;
|
|
17
|
+
export declare function getUploadNodesFromDataTransferItems(items: DataTransferItemList): Promise<{
|
|
18
|
+
uploadNodes: UploadNode[];
|
|
19
|
+
totalSize: number;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function calculateUploadNodesTotalSize(uploadNodes: UploadNode[]): number;
|
|
22
|
+
export declare function getObjectKeyFromNode(node: TreeNode): string;
|
|
23
|
+
export declare function getDirectoryPrefixFromNode(node: TreeNode): string;
|
|
24
|
+
export declare function pruneNodesInsideSelectedDirectories(nodes: TreeNode[]): TreeNode[];
|
|
25
|
+
export declare function collectObjectKeysToDelete(nodes: TreeNode[], listKeysUnderPrefix: (prefix: string) => Promise<string[]>): Promise<string[]>;
|
|
26
|
+
export declare function getPwUri(username: string, pwName: string, key: string): string;
|
|
27
|
+
export declare function getCspUri(csp: string, cspBucketName: string, key: string): string | null;
|
|
28
|
+
export declare function removeLeadingSlash(path: string): string;
|
|
29
|
+
export declare function removeLeadingAndTrailingSlashes(path: string): string;
|
|
30
|
+
export declare function isClientValid(client: IFileExplorerClient): boolean;
|
|
31
|
+
export declare function getUploadSessionETA(totalLoadedBytes: number, totalSizeBytes: number, lastProgressTime?: number, lastProgressBytes?: number): {
|
|
32
|
+
estimatedSecondsLeft?: number;
|
|
33
|
+
lastProgressTime: number;
|
|
34
|
+
lastProgressBytes: number;
|
|
35
|
+
shouldUpdateETA: boolean;
|
|
36
|
+
};
|
|
37
|
+
export declare function formatETA(seconds: number): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UploadSession } from './lib/types.js';
|
|
2
|
+
interface UploadSessionToastProps {
|
|
3
|
+
session: UploadSession;
|
|
4
|
+
queueLength: number;
|
|
5
|
+
onCancel?: () => void;
|
|
6
|
+
onCancelFile?: (relativePath: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function UploadSessionToast({ session, queueLength, onCancel, onCancelFile, }: UploadSessionToastProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { TreeNode } from './lib/types.js';
|
|
2
|
+
/** 10,000 file rows render cheaply but stand 300,000px tall, burying the folder's
|
|
3
|
+
* next sibling. Directories are never held back. */
|
|
4
|
+
export declare const TREE_FILE_CAP = 50;
|
|
5
|
+
/** One visible line in the sidebar tree. */
|
|
6
|
+
export interface TreeRow {
|
|
7
|
+
kind: 'node' | 'skeleton' | 'more';
|
|
8
|
+
/** Non-node rows suffix the parent path after a NUL, which object keys effectively
|
|
9
|
+
* never contain; nothing is derived from the key, so a collision only warns. */
|
|
10
|
+
key: string;
|
|
11
|
+
node: TreeNode;
|
|
12
|
+
/** Roots are 0. Drives indent and aria-level (which is 1-based). */
|
|
13
|
+
depth: number;
|
|
14
|
+
posInSet: number;
|
|
15
|
+
/** The true sibling count, which aria-setsize wants even when the cap shows fewer. */
|
|
16
|
+
setSize: number;
|
|
17
|
+
isExpanded: boolean;
|
|
18
|
+
/** `more` rows only: files held back by the cap, 0 when only pages remain. */
|
|
19
|
+
hiddenFiles?: number;
|
|
20
|
+
}
|
|
21
|
+
interface FlattenTreeOptions {
|
|
22
|
+
loadingPaths?: ReadonlySet<string>;
|
|
23
|
+
incompletePaths?: ReadonlySet<string>;
|
|
24
|
+
/** Absent means `TREE_FILE_CAP`. */
|
|
25
|
+
fileLimits?: ReadonlyMap<string, number>;
|
|
26
|
+
}
|
|
27
|
+
/** Flattens the tree to exactly the rows that should be on screen, so the sidebar
|
|
28
|
+
* can be windowed and keyboard navigation can move by index instead of by DOM. */
|
|
29
|
+
export declare function flattenTreeRows(roots: TreeNode[], parentToChildrenMap: Record<string, TreeNode[]>, expandedPaths: ReadonlySet<string>, options?: FlattenTreeOptions): TreeRow[];
|
|
30
|
+
export declare function nextFileLimit(current: number | undefined): number;
|
|
31
|
+
/** Index of `path` among the visible rows, or -1. */
|
|
32
|
+
export declare function findRowIndex(rows: readonly TreeRow[], path: string): number;
|
|
33
|
+
/** The next selectable row in `direction`, skipping skeleton and more rows. */
|
|
34
|
+
export declare function stepRow(rows: readonly TreeRow[], from: number, direction: 1 | -1): TreeRow | undefined;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/** Fires once the element comes within 100px of the bottom of `root`. */
|
|
3
|
+
export declare function useNearEnd(ref: RefObject<Element | null>, { active, root, onNear, }: {
|
|
4
|
+
active: boolean;
|
|
5
|
+
root: HTMLElement | null;
|
|
6
|
+
onNear: () => void;
|
|
7
|
+
}): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare function FieldWrapper({ label, tooltipComponent, description, labelPosition, spaceCompact, optional, children, }: {
|
|
3
|
+
label: string;
|
|
4
|
+
tooltipComponent?: React.ReactNode;
|
|
5
|
+
description?: string | undefined;
|
|
6
|
+
labelPosition?: 'left' | 'top' | undefined;
|
|
7
|
+
spaceCompact?: boolean | undefined;
|
|
8
|
+
optional?: boolean | undefined;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface IBooleanField extends BaseField {
|
|
4
|
+
type: 'boolean';
|
|
5
|
+
default?: boolean;
|
|
6
|
+
options?: {
|
|
7
|
+
onOption?: boolean | string;
|
|
8
|
+
offOption?: boolean | string;
|
|
9
|
+
};
|
|
10
|
+
disabled_message?: string;
|
|
11
|
+
}
|
|
12
|
+
export default function BooleanField(props: FieldComponentProps<IBooleanField>): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
interface BucketReadOnlyField extends BaseField {
|
|
4
|
+
type: 'bucket-read-only';
|
|
5
|
+
}
|
|
6
|
+
export default function BucketReadOnlyField({ field, disabled, missing, labelPosition, setFormDirty, }: FieldComponentProps<BucketReadOnlyField>): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface ICheckboxGroupField extends BaseField {
|
|
4
|
+
type: 'checkbox-group';
|
|
5
|
+
options?: Array<{
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Maps a value to the values it forces on. While the key is selected, each
|
|
12
|
+
* listed value is checked and locked (disabled) to show the implication.
|
|
13
|
+
* Deselecting the key clears the implied values unless the user had also
|
|
14
|
+
* selected them independently.
|
|
15
|
+
*/
|
|
16
|
+
implies?: Record<string, string[]>;
|
|
17
|
+
}
|
|
18
|
+
export default function CheckboxGroupField({ field, label, labelPosition, missing, disabled, onChange, tooltipComponent, spaceCompact, setFormDirty, }: FieldComponentProps<ICheckboxGroupField>): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
3
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
4
|
+
export interface IColorField extends BaseField {
|
|
5
|
+
type: 'color';
|
|
6
|
+
default?: string;
|
|
7
|
+
}
|
|
8
|
+
export default function ColorField(props: FieldComponentProps<IColorField>): React.JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface IDropdownField extends BaseField {
|
|
4
|
+
type: 'dropdown';
|
|
5
|
+
dropdownType?: string;
|
|
6
|
+
options: Array<{
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
secondaryLabel?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}> | Record<string, Array<{
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
secondaryLabel?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}>>;
|
|
17
|
+
parentValue?: string;
|
|
18
|
+
resetOnChange?: boolean;
|
|
19
|
+
autoselect?: boolean;
|
|
20
|
+
allowCustomValue?: boolean;
|
|
21
|
+
customValueLabel?: string;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
}
|
|
24
|
+
export default function DropdownField(props: FieldComponentProps<IDropdownField, string>): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface IDurationField extends BaseField {
|
|
4
|
+
type: 'duration';
|
|
5
|
+
default?: number;
|
|
6
|
+
min?: number | string;
|
|
7
|
+
max?: number | string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disableValue?: number;
|
|
10
|
+
disableLabel?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import("react").MemoExoticComponent<({ field, label, labelPosition, missing, disabled, onChange, tooltipComponent, spaceCompact, setFormDirty, currentValue, setFieldValue, setFieldTouched, }: FieldComponentProps<IDurationField, number | string | undefined>) => import("react").JSX.Element>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface ILabelField extends BaseField {
|
|
4
|
+
type: 'label';
|
|
5
|
+
text?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
bold?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default function LabelField(props: FieldComponentProps<ILabelField>): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface IMultiDropdownField extends BaseField {
|
|
4
|
+
type: 'multi-dropdown';
|
|
5
|
+
options: Array<string | {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string | boolean | number;
|
|
8
|
+
secondaryLabel?: string;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
}> | Record<string, Array<string | {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string | boolean | number;
|
|
13
|
+
secondaryLabel?: string;
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
}>>;
|
|
16
|
+
parentValue?: string | boolean | number;
|
|
17
|
+
}
|
|
18
|
+
export default function MultiDropdownField({ field, label, tooltipComponent, labelPosition, spaceCompact, disabled, missing, setFormDirty, onChange, }: FieldComponentProps<IMultiDropdownField>): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface INumberField extends BaseField {
|
|
4
|
+
type: 'number';
|
|
5
|
+
default?: number;
|
|
6
|
+
prefillDefault?: boolean;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
thousandsSeparator?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export default function NumberField(props: FieldComponentProps<INumberField>): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
3
|
+
import type { BaseField, DynamicFormSchema } from '../types/fieldTypes.js';
|
|
4
|
+
export interface IObjectField extends BaseField {
|
|
5
|
+
type: 'object';
|
|
6
|
+
options: DynamicFormSchema;
|
|
7
|
+
}
|
|
8
|
+
export default function ObjectField({ field, label, tooltipComponent, missingFields, setFormDirty, workflowForm, labelPosition, spaceCompact, }: FieldComponentProps<IObjectField>): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
3
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
4
|
+
export interface IRadioField extends BaseField {
|
|
5
|
+
type: 'radio';
|
|
6
|
+
options?: string[];
|
|
7
|
+
optionLabelPosition?: 'left' | 'top';
|
|
8
|
+
}
|
|
9
|
+
export default function RadioField(props: FieldComponentProps<IRadioField>): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
3
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
4
|
+
export interface IRangeField extends BaseField {
|
|
5
|
+
type: 'range';
|
|
6
|
+
default?: number;
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
}
|
|
11
|
+
export default function RangeField(props: FieldComponentProps<IRangeField>): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StatusDot } from '../../components/StatusBadge.js';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
interface ResourceOptionIconProps {
|
|
4
|
+
imageUrl?: string;
|
|
5
|
+
fallbackIcon: string;
|
|
6
|
+
alt: string;
|
|
7
|
+
variant?: ComponentProps<typeof StatusDot>['variant'];
|
|
8
|
+
dotSize?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function ResourceOptionIcon({ imageUrl, fallbackIcon, alt, variant, dotSize, }: ResourceOptionIconProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface IStringField extends BaseField {
|
|
4
|
+
type: 'string' | 'password';
|
|
5
|
+
default?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
lowercase?: boolean;
|
|
8
|
+
minLength?: number;
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
step?: number;
|
|
13
|
+
sanitize?: string;
|
|
14
|
+
prefillDefault?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import("react").MemoExoticComponent<(props: FieldComponentProps<IStringField, string>) => import("react").JSX.Element>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FieldComponentProps } from '../types/fieldComponentTypes.js';
|
|
2
|
+
import type { BaseField } from '../types/fieldTypes.js';
|
|
3
|
+
export interface ITextAreaField extends BaseField {
|
|
4
|
+
type: 'textarea';
|
|
5
|
+
default?: string;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
export default function TextAreaField(props: FieldComponentProps<ITextAreaField>): import("react").JSX.Element;
|