@aws-amplify/ui-react-storage 3.4.0 → 3.5.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/browser.js +35 -2
- package/dist/{createAmplifyAuthAdapter-BRctUWdR.js → createAmplifyAuthAdapter-BUDNgORg.js} +3045 -2921
- package/dist/esm/browser.mjs +2 -0
- package/dist/esm/components/FileUploader/utils/getInput.mjs +1 -1
- package/dist/esm/components/StorageBrowser/StorageBrowserAmplify.mjs +2 -7
- package/dist/esm/components/StorageBrowser/StorageBrowserDefault.mjs +3 -16
- package/dist/esm/components/StorageBrowser/actions/configs/context.mjs +4 -9
- package/dist/esm/components/StorageBrowser/actions/configs/defaults.mjs +14 -39
- package/dist/esm/components/StorageBrowser/actions/configs/utils.mjs +8 -0
- package/dist/esm/components/StorageBrowser/actions/handlers/copy.mjs +13 -13
- package/dist/esm/components/StorageBrowser/actions/handlers/createFolder.mjs +9 -6
- package/dist/esm/components/StorageBrowser/actions/handlers/delete.mjs +9 -7
- package/dist/esm/components/StorageBrowser/actions/handlers/download.mjs +7 -11
- package/dist/esm/components/StorageBrowser/actions/handlers/listLocationItems.mjs +3 -3
- package/dist/esm/components/StorageBrowser/actions/handlers/upload.mjs +11 -7
- package/dist/esm/components/StorageBrowser/actions/handlers/utils.mjs +1 -11
- package/dist/esm/components/StorageBrowser/adapters/createManagedAuthAdapter/createManagedAuthAdapter.mjs +1 -3
- package/dist/esm/components/StorageBrowser/controls/PaginationControl.mjs +3 -3
- package/dist/esm/components/StorageBrowser/controls/SearchFieldControl.mjs +12 -0
- package/dist/esm/components/StorageBrowser/controls/hooks/usePagination.mjs +9 -0
- package/dist/esm/components/StorageBrowser/controls/hooks/useSearchField.mjs +17 -0
- package/dist/esm/components/StorageBrowser/createStorageBrowser.mjs +36 -27
- package/dist/esm/components/StorageBrowser/displayText/libraries/en/locationDetailView.mjs +6 -0
- package/dist/esm/components/StorageBrowser/displayText/libraries/en/locationsView.mjs +2 -2
- package/dist/esm/components/StorageBrowser/providers/configuration/createConfigurationProvider.mjs +4 -10
- package/dist/esm/components/StorageBrowser/providers/configuration/useGetActionInputCallback.mjs +7 -7
- package/dist/esm/components/StorageBrowser/providers/store/locationItems/context.mjs +1 -1
- package/dist/esm/components/StorageBrowser/tasks/useProcessTasks.mjs +27 -6
- package/dist/esm/components/StorageBrowser/useAction/constants.mjs +4 -0
- package/dist/esm/components/StorageBrowser/useAction/context.mjs +8 -0
- package/dist/esm/components/StorageBrowser/useAction/useAction.mjs +18 -0
- package/dist/esm/components/StorageBrowser/useAction/useHandler.mjs +40 -0
- package/dist/esm/components/StorageBrowser/useAction/useList.mjs +19 -0
- package/dist/esm/components/StorageBrowser/useAction/useListFolderItems.mjs +23 -0
- package/dist/esm/components/StorageBrowser/useAction/useListLocationItems.mjs +23 -0
- package/dist/esm/components/StorageBrowser/{actions/useAction → useAction}/useListLocations.mjs +7 -6
- package/dist/esm/components/StorageBrowser/useAction/utils.mjs +26 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/CopyView.mjs +3 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/useCopyView.mjs +32 -17
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/useFolders.mjs +12 -17
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CreateFolderView/useCreateFolderView.mjs +18 -15
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DeleteView/useDeleteView.mjs +17 -12
- package/dist/esm/components/StorageBrowser/views/LocationActionView/LocationActionView.mjs +9 -16
- package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/useUploadView.mjs +44 -49
- package/dist/esm/components/StorageBrowser/views/LocationActionView/getActionViewTableData.mjs +2 -4
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/LocationDetailView.mjs +3 -3
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/LocationDetailViewProvider.mjs +12 -8
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/getLocationDetailViewTableData/getLocationDetailViewTableData.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/useLocationDetailView.mjs +50 -69
- package/dist/esm/components/StorageBrowser/views/LocationsView/LocationsView.mjs +3 -3
- package/dist/esm/components/StorageBrowser/views/LocationsView/LocationsViewProvider.mjs +2 -3
- package/dist/esm/components/StorageBrowser/views/LocationsView/useLocationsView.mjs +22 -29
- package/dist/esm/components/StorageBrowser/views/context/actionViews.mjs +33 -0
- package/dist/esm/components/StorageBrowser/views/context/getViews.mjs +32 -0
- package/dist/esm/components/StorageBrowser/views/context/primaryViews.mjs +32 -0
- package/dist/esm/components/StorageBrowser/views/context/views.mjs +19 -0
- package/dist/esm/components/StorageBrowser/views/{createUseView.mjs → useView.mjs} +19 -28
- package/dist/esm/version.mjs +1 -1
- package/dist/index.js +4 -7
- package/dist/styles.css +6 -2
- package/dist/types/components/StorageBrowser/actions/configs/context.d.ts +4 -5
- package/dist/types/components/StorageBrowser/actions/configs/defaults.d.ts +6 -7
- package/dist/types/components/StorageBrowser/actions/configs/index.d.ts +3 -2
- package/dist/types/components/StorageBrowser/actions/configs/types.d.ts +39 -69
- package/dist/types/components/StorageBrowser/actions/configs/utils.d.ts +2 -0
- package/dist/types/components/StorageBrowser/actions/handlers/copy.d.ts +12 -5
- package/dist/types/components/StorageBrowser/actions/handlers/createFolder.d.ts +7 -4
- package/dist/types/components/StorageBrowser/actions/handlers/delete.d.ts +6 -3
- package/dist/types/components/StorageBrowser/actions/handlers/download.d.ts +6 -3
- package/dist/types/components/StorageBrowser/actions/handlers/types.d.ts +11 -2
- package/dist/types/components/StorageBrowser/actions/handlers/upload.d.ts +8 -4
- package/dist/types/components/StorageBrowser/actions/handlers/utils.d.ts +0 -1
- package/dist/types/components/StorageBrowser/actions/index.d.ts +2 -4
- package/dist/types/components/StorageBrowser/adapters/permissionParsers.d.ts +1 -1
- package/dist/types/components/StorageBrowser/composables/ActionsList.d.ts +2 -2
- package/dist/types/components/StorageBrowser/controls/SearchFieldControl.d.ts +2 -0
- package/dist/types/components/StorageBrowser/controls/hooks/usePagination.d.ts +2 -0
- package/dist/types/components/StorageBrowser/controls/hooks/useSearchField.d.ts +2 -0
- package/dist/types/components/StorageBrowser/controls/types.d.ts +3 -3
- package/dist/types/components/StorageBrowser/createStorageBrowser.d.ts +3 -7
- package/dist/types/components/StorageBrowser/displayText/index.d.ts +1 -1
- package/dist/types/components/StorageBrowser/displayText/types.d.ts +1 -1
- package/dist/types/components/StorageBrowser/index.d.ts +3 -1
- package/dist/types/components/StorageBrowser/providers/configuration/index.d.ts +1 -1
- package/dist/types/components/StorageBrowser/providers/configuration/types.d.ts +2 -2
- package/dist/types/components/StorageBrowser/providers/store/files/types.d.ts +10 -1
- package/dist/types/components/StorageBrowser/providers/store/files/utils.d.ts +1 -2
- package/dist/types/components/StorageBrowser/tasks/types.d.ts +16 -13
- package/dist/types/components/StorageBrowser/tasks/useProcessTasks.d.ts +2 -3
- package/dist/types/components/StorageBrowser/types.d.ts +42 -12
- package/dist/types/components/StorageBrowser/useAction/constants.d.ts +3 -0
- package/dist/types/components/StorageBrowser/useAction/context.d.ts +5 -0
- package/dist/types/components/StorageBrowser/{actions/useAction → useAction}/createEnhancedListHandler.d.ts +3 -3
- package/dist/types/components/StorageBrowser/useAction/index.d.ts +6 -0
- package/dist/types/components/StorageBrowser/useAction/types.d.ts +76 -0
- package/dist/types/components/StorageBrowser/useAction/useAction.d.ts +3 -0
- package/dist/types/components/StorageBrowser/useAction/useHandler.d.ts +3 -0
- package/dist/types/components/StorageBrowser/useAction/useList.d.ts +9 -0
- package/dist/types/components/StorageBrowser/useAction/useListFolderItems.d.ts +13 -0
- package/dist/types/components/StorageBrowser/useAction/useListLocationItems.d.ts +10 -0
- package/dist/types/components/StorageBrowser/useAction/useListLocations.d.ts +8 -0
- package/dist/types/components/StorageBrowser/useAction/utils.d.ts +6 -0
- package/dist/types/components/StorageBrowser/views/LocationActionView/CopyView/useFolders.d.ts +1 -4
- package/dist/types/components/StorageBrowser/views/LocationActionView/CreateFolderView/types.d.ts +2 -2
- package/dist/types/components/StorageBrowser/views/LocationActionView/LocationActionView.d.ts +2 -6
- package/dist/types/components/StorageBrowser/views/LocationActionView/getActionViewTableData.d.ts +2 -4
- package/dist/types/components/StorageBrowser/views/LocationActionView/index.d.ts +6 -6
- package/dist/types/components/StorageBrowser/views/LocationActionView/types.d.ts +4 -8
- package/dist/types/components/StorageBrowser/views/LocationDetailView/getLocationDetailViewTableData/getLocationDetailViewTableData.d.ts +1 -3
- package/dist/types/components/StorageBrowser/views/LocationDetailView/types.d.ts +16 -17
- package/dist/types/components/StorageBrowser/views/LocationsView/types.d.ts +8 -12
- package/dist/types/components/StorageBrowser/views/context/actionViews.d.ts +6 -0
- package/dist/types/components/StorageBrowser/views/context/getViews.d.ts +4 -0
- package/dist/types/components/StorageBrowser/views/context/index.d.ts +1 -0
- package/dist/types/components/StorageBrowser/views/context/primaryViews.d.ts +6 -0
- package/dist/types/components/StorageBrowser/views/context/types.d.ts +9 -0
- package/dist/types/components/StorageBrowser/views/context/views.d.ts +10 -0
- package/dist/types/components/StorageBrowser/views/index.d.ts +2 -2
- package/dist/types/components/StorageBrowser/views/types.d.ts +22 -0
- package/dist/types/components/StorageBrowser/views/useView.d.ts +16 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +10 -4
- package/dist/esm/components/StorageBrowser/controls/SearchControl.mjs +0 -13
- package/dist/esm/components/StorageBrowser/views/LocationActionView/constants.mjs +0 -3
- package/dist/esm/components/StorageBrowser/views/LocationActionView/useActionView.mjs +0 -20
- package/dist/esm/components/StorageBrowser/views/context.mjs +0 -43
- package/dist/types/components/StorageBrowser/actions/createUseAction.d.ts +0 -2
- package/dist/types/components/StorageBrowser/actions/types.d.ts +0 -8
- package/dist/types/components/StorageBrowser/actions/useAction/index.d.ts +0 -1
- package/dist/types/components/StorageBrowser/actions/useAction/useListLocations.d.ts +0 -8
- package/dist/types/components/StorageBrowser/controls/SearchControl.d.ts +0 -2
- package/dist/types/components/StorageBrowser/views/LocationActionView/constants.d.ts +0 -1
- package/dist/types/components/StorageBrowser/views/context.d.ts +0 -16
- package/dist/types/components/StorageBrowser/views/createUseView.d.ts +0 -19
- /package/dist/esm/components/StorageBrowser/{actions/useAction → useAction}/createEnhancedListHandler.mjs +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface DownloadHandlerData extends
|
|
1
|
+
import { TaskData, TaskHandler, TaskHandlerInput, TaskHandlerOptions, TaskHandlerOutput } from './types';
|
|
2
|
+
export interface DownloadHandlerData extends TaskData {
|
|
3
|
+
fileKey: string;
|
|
3
4
|
}
|
|
4
5
|
export interface DownloadHandlerOptions extends TaskHandlerOptions {
|
|
5
6
|
}
|
|
6
7
|
export interface DownloadHandlerInput extends TaskHandlerInput<DownloadHandlerData, DownloadHandlerOptions> {
|
|
7
8
|
}
|
|
8
|
-
export interface DownloadHandlerOutput extends TaskHandlerOutput
|
|
9
|
+
export interface DownloadHandlerOutput extends TaskHandlerOutput<{
|
|
10
|
+
url: URL;
|
|
11
|
+
}> {
|
|
9
12
|
}
|
|
10
13
|
export interface DownloadHandler extends TaskHandler<DownloadHandlerInput, DownloadHandlerOutput> {
|
|
11
14
|
}
|
|
@@ -64,22 +64,31 @@ export interface TaskData {
|
|
|
64
64
|
key: string;
|
|
65
65
|
id: string;
|
|
66
66
|
}
|
|
67
|
-
export interface TaskHandlerOptions {
|
|
67
|
+
export interface TaskHandlerOptions<V = any> {
|
|
68
68
|
onProgress?: (data: {
|
|
69
69
|
key: string;
|
|
70
70
|
id: string;
|
|
71
71
|
}, progress: number | undefined) => void;
|
|
72
|
+
onSuccess?: (data: {
|
|
73
|
+
key: string;
|
|
74
|
+
id: string;
|
|
75
|
+
}, value: V) => void;
|
|
76
|
+
onError?: (data: {
|
|
77
|
+
key: string;
|
|
78
|
+
id: string;
|
|
79
|
+
}, message: string | undefined) => void;
|
|
72
80
|
}
|
|
73
81
|
export interface TaskHandlerInput<T extends TaskData = TaskData, K extends TaskHandlerOptions = TaskHandlerOptions> {
|
|
74
82
|
config: ActionInputConfig;
|
|
75
83
|
data: T;
|
|
76
84
|
options?: K;
|
|
77
85
|
}
|
|
78
|
-
export interface TaskHandlerOutput {
|
|
86
|
+
export interface TaskHandlerOutput<K = any> {
|
|
79
87
|
cancel?: () => void;
|
|
80
88
|
result: Promise<{
|
|
81
89
|
message?: string;
|
|
82
90
|
status: 'CANCELED' | 'COMPLETE' | 'FAILED' | 'OVERWRITE_PREVENTED';
|
|
91
|
+
value?: K;
|
|
83
92
|
}>;
|
|
84
93
|
}
|
|
85
94
|
export type TaskHandler<T = any, K = any> = (input: T) => K;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { TaskData, TaskHandler, TaskHandlerInput, TaskHandlerOutput, TaskHandlerOptions } from './types';
|
|
2
|
-
export interface UploadHandlerOptions extends TaskHandlerOptions
|
|
3
|
-
|
|
2
|
+
export interface UploadHandlerOptions extends TaskHandlerOptions<{
|
|
3
|
+
key: string;
|
|
4
|
+
}> {
|
|
4
5
|
}
|
|
5
6
|
export interface UploadHandlerData extends TaskData {
|
|
6
7
|
file: File;
|
|
8
|
+
preventOverwrite?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export interface UploadHandlerInput extends TaskHandlerInput<UploadHandlerData, UploadHandlerOptions> {
|
|
9
|
-
destinationPrefix: string;
|
|
10
11
|
}
|
|
11
|
-
export interface UploadHandlerOutput extends TaskHandlerOutput
|
|
12
|
+
export interface UploadHandlerOutput extends TaskHandlerOutput<{
|
|
13
|
+
key: string;
|
|
14
|
+
}> {
|
|
12
15
|
}
|
|
13
16
|
export interface UploadHandler extends TaskHandler<UploadHandlerInput, UploadHandlerOutput> {
|
|
14
17
|
}
|
|
15
18
|
export declare const MULTIPART_UPLOAD_THRESHOLD_BYTES: number;
|
|
19
|
+
export declare const DEFAULT_CHECKSUM_ALGORITHM = "crc-32";
|
|
16
20
|
export declare const UNDEFINED_CALLBACKS: {
|
|
17
21
|
cancel: undefined;
|
|
18
22
|
pause: undefined;
|
|
@@ -11,7 +11,6 @@ export declare const shouldExcludeLocation: ({ permissions, type }: LocationData
|
|
|
11
11
|
export declare const getFilteredLocations: (locations: AccessGrantLocation[], exclude?: ListLocationsExcludeOptions) => LocationData[];
|
|
12
12
|
export declare const getFileKey: (key: string) => string;
|
|
13
13
|
export declare const createFileDataItem: (data: FileData) => FileDataItem;
|
|
14
|
-
export declare const createFileDataItemFromLocation: (data: LocationData) => FileDataItem;
|
|
15
14
|
export declare const isFileItem: (value: unknown) => value is FileItem;
|
|
16
15
|
export declare const isFileDataItem: (item: unknown) => item is FileDataItem;
|
|
17
16
|
export declare const getProgress: ({ totalBytes, transferredBytes, }: TransferProgressEvent) => number | undefined;
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { ActionState } from './types';
|
|
4
|
-
export { useListLocations, UseListLocationsState } from './useAction';
|
|
1
|
+
export { ActionInputConfig, copyHandler, CopyHandler, CopyHandlerData, CopyHandlerInput, CopyHandlerOutput, createFileDataItem, createFolderHandler, CreateFolderHandler, CreateFolderHandlerData, CreateFolderHandlerInput, CreateFolderHandlerOptions, CreateFolderHandlerOutput, downloadHandler, DownloadHandler, DownloadHandlerData, DownloadHandlerInput, DownloadHandlerOptions, DownloadHandlerOutput, DeleteHandler, DeleteHandlerData, DeleteHandlerInput, DeleteHandlerOptions, DeleteHandlerOutput, FileData, FileDataItem, FileItem, FolderData, isFileDataItem, isFileItem, ListHandler, ListHandlerInput, ListHandlerOptions, ListHandlerOutput, listLocationItemsHandler, ListLocationItemsHandler, ListLocationItemsHandlerInput, ListLocationItemsHandlerOptions, ListLocationItemsHandlerOutput, ListLocationsExcludeOptions, ListLocations, ListLocationsInput, ListLocationsOutput, listLocationsHandler, ListLocationsHandler, ListLocationsHandlerInput, ListLocationsHandlerOptions, ListLocationsHandlerOutput, LocationData, LocationItemData, LocationItemType, LocationPermissions, LocationType, TaskData, TaskHandler, TaskHandlerInput, TaskHandlerOptions, TaskHandlerOutput, uploadHandler, UploadHandler, UploadHandlerData, UploadHandlerInput, UploadHandlerOptions, UploadHandlerOutput, } from './handlers';
|
|
2
|
+
export { ExtendedActionConfigs, ActionViewConfig, ActionViewConfigs, ActionConfigsProvider, ActionConfigsProviderProps, ActionHandler, CustomActionConfigs, defaultActionConfigs, DefaultActionConfigs, defaultActionViewConfigs, getActionConfigs, isDefaultActionViewType, useActionConfigs, } from './configs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocationPermissions } from '../actions
|
|
1
|
+
import { LocationPermissions } from '../actions';
|
|
2
2
|
import { Permission, StorageAccess } from '../storage-internal';
|
|
3
3
|
export declare const parseAccessGrantPermission: (accessGrantPermission: Permission) => LocationPermissions;
|
|
4
4
|
export declare const toAccessGrantPermission: (permission: StorageAccess[]) => Permission;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StorageBrowserIconType } from '../context/elements';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ActionListItem {
|
|
4
4
|
isDisabled?: boolean;
|
|
5
5
|
isHidden?: boolean;
|
|
6
6
|
icon?: StorageBrowserIconType;
|
|
@@ -9,7 +9,7 @@ export interface ActionsListItem {
|
|
|
9
9
|
}
|
|
10
10
|
export interface ActionsListProps {
|
|
11
11
|
isDisabled?: boolean;
|
|
12
|
-
items:
|
|
12
|
+
items: ActionListItem[];
|
|
13
13
|
onActionSelect?: (id: string) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const ActionsList: ({ isDisabled, items, onActionSelect, }: ActionsListProps) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LocationData } from '../actions';
|
|
3
|
-
import {
|
|
3
|
+
import { ActionListItem } from '../composables/ActionsList';
|
|
4
4
|
import { DataTableSortHeader, DataTableProps } from '../composables/DataTable';
|
|
5
5
|
import { MessageProps } from '../composables/Message';
|
|
6
6
|
import { Composables } from '../composables/types';
|
|
@@ -20,12 +20,11 @@ interface TableData {
|
|
|
20
20
|
interface PaginationData {
|
|
21
21
|
hasNextPage: boolean;
|
|
22
22
|
highestPageVisited: number;
|
|
23
|
-
onPaginate: (page: number) => void;
|
|
24
23
|
page: number;
|
|
25
24
|
}
|
|
26
25
|
export interface ControlsContext {
|
|
27
26
|
data: {
|
|
28
|
-
actions?:
|
|
27
|
+
actions?: ActionListItem[];
|
|
29
28
|
actionCancelLabel?: string;
|
|
30
29
|
actionDestinationLabel?: string;
|
|
31
30
|
actionExitLabel?: string;
|
|
@@ -78,6 +77,7 @@ export interface ControlsContext {
|
|
|
78
77
|
onFolderNameChange?: (value: string) => void;
|
|
79
78
|
onNavigate?: (location: LocationData, path?: string) => void;
|
|
80
79
|
onNavigateHome?: () => void;
|
|
80
|
+
onPaginate?: (page: number) => void;
|
|
81
81
|
onRefresh?: () => void;
|
|
82
82
|
onSearch?: () => void;
|
|
83
83
|
onSearchClear?: () => void;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare function createStorageBrowser(input: CreateStorageBrowserInput): {
|
|
5
|
-
StorageBrowser: StorageBrowserType<keyof Omit<typeof defaultActionConfigs, 'listLocationItems' | 'listLocations'>>;
|
|
6
|
-
useView: ReturnType<typeof createUseView<typeof defaultActionConfigs>>;
|
|
7
|
-
};
|
|
1
|
+
import { ExtendedActionConfigs } from './actions';
|
|
2
|
+
import { CreateStorageBrowserInput, CreateStorageBrowserOutput } from './types';
|
|
3
|
+
export declare function createStorageBrowser<Input extends CreateStorageBrowserInput, RInput extends Input['actions'] extends ExtendedActionConfigs ? Input['actions'] : ExtendedActionConfigs>(input: Input): CreateStorageBrowserOutput<RInput>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DisplayTextProvider, useDisplayText } from './context';
|
|
2
|
-
export { DEFAULT_STORAGE_BROWSER_DISPLAY_TEXT } from './libraries';
|
|
2
|
+
export { DEFAULT_STORAGE_BROWSER_DISPLAY_TEXT as DefaultStorageBrowserDisplayText } from './libraries';
|
|
3
3
|
export { LocationDetailViewDisplayText, LocationsViewDisplayText, CreateFolderViewDisplayText, CopyViewDisplayText, UploadViewDisplayText, DeleteViewDisplayText, StorageBrowserDisplayText, } from './types';
|
|
@@ -21,7 +21,7 @@ interface ListMessageData {
|
|
|
21
21
|
isLoading?: boolean;
|
|
22
22
|
}
|
|
23
23
|
interface ListLocationsMessageData extends ListMessageData {
|
|
24
|
-
|
|
24
|
+
items: LocationData[] | undefined;
|
|
25
25
|
}
|
|
26
26
|
export interface DefaultLocationsViewDisplayText extends DefaultListViewDisplayText {
|
|
27
27
|
getListLocationsResultMessage: (data?: ListLocationsMessageData) => {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { componentsDefault } from './componentsDefault';
|
|
2
2
|
export { createStorageBrowser } from './createStorageBrowser';
|
|
3
|
+
export { ActionViewConfig, ActionHandler, FileDataItem, ExtendedActionConfigs, } from './actions';
|
|
3
4
|
export { createAmplifyAuthAdapter, createManagedAuthAdapter, CreateManagedAuthAdapterInput, StorageBrowserAuthAdapter, } from './adapters';
|
|
4
|
-
export { CreateStorageBrowserInput, StorageBrowserType } from './types';
|
|
5
|
+
export { CreateStorageBrowserInput, StorageBrowserType, DerivedActionViewType, DerivedActionViews, } from './types';
|
|
6
|
+
export { DefaultStorageBrowserDisplayText } from './displayText';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useGetActionInput } from './context';
|
|
2
1
|
export { createConfigurationProvider } from './createConfigurationProvider';
|
|
2
|
+
export { useGetActionInput } from './context';
|
|
3
3
|
export { CredentialsProviderProps, RegisterAuthListener } from './credentials';
|
|
4
4
|
export { GetActionInput } from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ActionInputConfig,
|
|
2
|
+
import { ActionInputConfig, LocationData } from '../../actions';
|
|
3
3
|
import { CredentialsProviderProps } from './credentials';
|
|
4
4
|
export type GetActionInput = (location?: LocationData) => ActionInputConfig;
|
|
5
5
|
export interface GetActionInputProviderProps {
|
|
@@ -8,7 +8,7 @@ export interface GetActionInputProviderProps {
|
|
|
8
8
|
region: string;
|
|
9
9
|
customEndpoint?: string;
|
|
10
10
|
}
|
|
11
|
-
export interface CreateConfigurationProviderInput<T extends React.ComponentType<any>> extends
|
|
11
|
+
export interface CreateConfigurationProviderInput<T extends React.ComponentType<any>> extends GetActionInputProviderProps, CredentialsProviderProps {
|
|
12
12
|
ChildComponent?: T;
|
|
13
13
|
displayName: string;
|
|
14
14
|
region: string;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { LocationItemType, TaskData } from '../../../actions';
|
|
3
|
+
/**
|
|
4
|
+
* native OS file picker type. to restrict selectable file types, define the picker types
|
|
5
|
+
* followed by accepted file types as strings
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* type JPEGOnly = ['FOLDER', '.jpeg'];
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export type SelectionType = LocationItemType | [LocationItemType, ...string[]];
|
|
3
12
|
export type FilesActionType = {
|
|
4
13
|
type: 'ADD_FILE_ITEMS';
|
|
5
14
|
files?: File[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SelectionType } from '
|
|
3
|
-
import { FileItems, FilesActionType } from './types';
|
|
2
|
+
import { FileItems, FilesActionType, SelectionType } from './types';
|
|
4
3
|
export declare const resolveFiles: (prevItems: FileItems, files: File[] | undefined) => FileItems;
|
|
5
4
|
export declare const filesReducer: React.Reducer<FileItems, Exclude<FilesActionType, {
|
|
6
5
|
type: 'SELECT_FILES';
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { TaskHandlerInput, TaskData } from '../actions';
|
|
2
2
|
export type TaskStatus = 'CANCELED' | 'FAILED' | 'COMPLETE' | 'OVERWRITE_PREVENTED' | 'QUEUED' | 'PENDING';
|
|
3
3
|
export type StatusCounts = Record<TaskStatus | 'TOTAL', number>;
|
|
4
|
-
export interface ProcessTasksOptions<T extends TaskData = TaskData, U extends number | never = never> {
|
|
4
|
+
export interface ProcessTasksOptions<T extends TaskData = TaskData, V = any, U extends number | never = never> {
|
|
5
5
|
concurrency?: U;
|
|
6
6
|
onTaskCancel?: (data: Task<T>) => void;
|
|
7
7
|
onTaskComplete?: (data: Task<T>) => void;
|
|
8
8
|
onTaskError?: (data: Task<T>, error: Error | undefined) => void;
|
|
9
9
|
onTaskProgress?: (data: Task<T>, progress: number | undefined) => void;
|
|
10
|
-
onTaskSuccess?: (data: Task<T
|
|
10
|
+
onTaskSuccess?: (data: Task<T>, value: V | undefined) => void;
|
|
11
11
|
onTaskRemove?: (data: Task<T>) => void;
|
|
12
12
|
}
|
|
13
|
-
export interface Task<T extends TaskData = TaskData> {
|
|
13
|
+
export interface Task<T extends TaskData = TaskData, V = any> {
|
|
14
14
|
data: T;
|
|
15
15
|
message: string | undefined;
|
|
16
16
|
progress: number | undefined;
|
|
17
17
|
status: TaskStatus;
|
|
18
18
|
cancel?: () => void;
|
|
19
|
+
value?: V;
|
|
19
20
|
}
|
|
20
|
-
export type Tasks<T extends TaskData> = Task<T>[];
|
|
21
|
-
export type HandleProcessTasks<T extends TaskData,
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
export type Tasks<T extends TaskData, V = any> = Task<T, V>[];
|
|
22
|
+
export type HandleProcessTasks<T extends TaskData, U> = (input: U extends T[] ? Omit<TaskHandlerInput<T>, 'data'> : TaskHandlerInput<T>) => void;
|
|
23
|
+
export interface TasksState<T extends TaskData = TaskData> {
|
|
24
|
+
isProcessing: boolean;
|
|
25
|
+
isProcessingComplete: boolean;
|
|
26
|
+
reset: () => void;
|
|
27
|
+
statusCounts: StatusCounts;
|
|
28
|
+
tasks: Tasks<T>;
|
|
29
|
+
}
|
|
30
|
+
export type UseProcessTasksState<T extends TaskData, D> = [
|
|
31
|
+
TasksState<T>,
|
|
32
|
+
HandleProcessTasks<T, D>
|
|
30
33
|
];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActionHandler, TaskData } from '../actions';
|
|
2
2
|
import { ProcessTasksOptions, UseProcessTasksState } from './types';
|
|
3
|
-
export
|
|
4
|
-
export declare const useProcessTasks: UseProcessTasks;
|
|
3
|
+
export declare const useProcessTasks: <TData extends TaskData = TaskData, RValue = any, D extends TData[] | undefined = undefined>(handler: ActionHandler<TData, RValue>, items?: D | undefined, options?: ProcessTasksOptions<TData, RValue, D extends TData[] ? number : never> | undefined) => UseProcessTasksState<TData, D>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ListLocations } from './actions';
|
|
2
|
+
import { CustomActionConfigs, DefaultActionConfigs, ExtendedActionConfigs, ListLocations } from './actions';
|
|
3
|
+
import { GetLocationCredentials } from './credentials/types';
|
|
4
|
+
import { UseView } from './views/useView';
|
|
3
5
|
import { Components } from './ComponentsProvider';
|
|
4
6
|
import { RegisterAuthListener, StoreProviderProps } from './providers';
|
|
5
|
-
import { CopyViewType, CreateFolderViewType, DeleteViewType, UploadViewType,
|
|
6
|
-
import { GetLocationCredentials } from './credentials/types';
|
|
7
|
+
import { CopyViewType, CreateFolderViewType, DeleteViewType, UploadViewType, LocationActionViewType, LocationDetailViewType, LocationsViewType, Views } from './views';
|
|
7
8
|
import { StorageBrowserDisplayText } from './displayText';
|
|
9
|
+
import { DerivedActionHandlers, UseAction } from './useAction';
|
|
8
10
|
export interface Config {
|
|
9
11
|
accountId?: string;
|
|
10
12
|
customEndpoint?: string;
|
|
@@ -13,27 +15,55 @@ export interface Config {
|
|
|
13
15
|
registerAuthListener: RegisterAuthListener;
|
|
14
16
|
region: string;
|
|
15
17
|
}
|
|
18
|
+
export interface StorageBrowserActions {
|
|
19
|
+
default?: DefaultActionConfigs;
|
|
20
|
+
custom?: CustomActionConfigs;
|
|
21
|
+
}
|
|
16
22
|
export interface CreateStorageBrowserInput {
|
|
23
|
+
actions?: StorageBrowserActions;
|
|
17
24
|
config: Config;
|
|
18
25
|
components?: Components;
|
|
19
26
|
}
|
|
20
|
-
export interface StorageBrowserProps<
|
|
21
|
-
views?: Views<T>;
|
|
27
|
+
export interface StorageBrowserProps<K = string, V = {}> {
|
|
22
28
|
displayText?: StorageBrowserDisplayText;
|
|
29
|
+
views?: Views<K, V>;
|
|
23
30
|
}
|
|
24
|
-
export interface
|
|
25
|
-
|
|
31
|
+
export interface StorageBrowserProviderProps<V = {}> extends StoreProviderProps {
|
|
32
|
+
displayText?: StorageBrowserDisplayText;
|
|
33
|
+
views?: V;
|
|
34
|
+
}
|
|
35
|
+
export interface StorageBrowserType<K = string, V = {}> {
|
|
36
|
+
(props: StorageBrowserProps<K, V>): React.JSX.Element;
|
|
26
37
|
displayName: string;
|
|
27
|
-
Provider: (props: StorageBrowserProviderProps) => React.JSX.Element;
|
|
38
|
+
Provider: (props: StorageBrowserProviderProps<V>) => React.JSX.Element;
|
|
28
39
|
CopyView: CopyViewType;
|
|
29
40
|
CreateFolderView: CreateFolderViewType;
|
|
30
41
|
DeleteView: DeleteViewType;
|
|
31
42
|
UploadView: UploadViewType;
|
|
32
|
-
LocationActionView:
|
|
43
|
+
LocationActionView: LocationActionViewType<K>;
|
|
33
44
|
LocationDetailView: LocationDetailViewType;
|
|
34
45
|
LocationsView: LocationsViewType;
|
|
35
46
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
type DefaultActionType<T = string> = Exclude<T, keyof DefaultActionConfigs>;
|
|
48
|
+
/**
|
|
49
|
+
* @internal @unstable
|
|
50
|
+
*/
|
|
51
|
+
export type DerivedActionViews<T extends StorageBrowserActions> = {
|
|
52
|
+
[K in keyof T['custom'] as K extends DefaultActionType<K> ? T['custom'][K] extends {
|
|
53
|
+
viewName: `${string}View`;
|
|
54
|
+
} ? T['custom'][K]['viewName'] : never : never]?: () => React.JSX.Element | null;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* @internal @unstable
|
|
58
|
+
*/
|
|
59
|
+
export type DerivedActionViewType<T extends StorageBrowserActions> = keyof {
|
|
60
|
+
[K in keyof T['custom'] as K extends DefaultActionType<K> ? T['custom'][K] extends {
|
|
61
|
+
viewName: `${string}View`;
|
|
62
|
+
} ? K : never : never]?: any;
|
|
63
|
+
} | Exclude<keyof DefaultActionConfigs, 'download'>;
|
|
64
|
+
export interface CreateStorageBrowserOutput<C extends ExtendedActionConfigs = ExtendedActionConfigs> {
|
|
65
|
+
StorageBrowser: StorageBrowserType<DerivedActionViewType<C>, DerivedActionViews<C>>;
|
|
66
|
+
useAction: UseAction<DerivedActionHandlers<C>>;
|
|
67
|
+
useView: UseView;
|
|
39
68
|
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const DEFAULT_ACTION_CONCURRENCY = 4;
|
|
2
|
+
export declare const USE_ACTION_ERROR_MESSAGE = "`useAction` must be called from within `StorageBrowser.Provider`";
|
|
3
|
+
export declare const USE_LIST_ERROR_MESSAGE = "`useList` must be called from within `StorageBrowser.Provider`";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActionHandlersContext } from './types';
|
|
3
|
+
export declare const ActionHandlersProvider: import("react").ComponentType<import("react").PropsWithChildren<ActionHandlersContext>>, useActionHandlers: (params?: {
|
|
4
|
+
errorMessage?: string | undefined;
|
|
5
|
+
} | undefined) => ActionHandlersContext;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncDataAction } from '@aws-amplify/ui-react-core';
|
|
2
|
-
import { ListHandler, ListHandlerOptions, ListHandlerInput, ListHandlerOutput } from '../
|
|
2
|
+
import { ListHandler, ListHandlerOptions, ListHandlerInput, ListHandlerOutput } from '../actions';
|
|
3
3
|
type KeyWithStringValue<T> = keyof {
|
|
4
4
|
[P in keyof T as T[P] extends string ? P : never]: T[P];
|
|
5
5
|
};
|
|
@@ -27,12 +27,12 @@ export interface SearchOutput {
|
|
|
27
27
|
export interface EnhancedListHandlerOutput<T> extends ListHandlerOutput<T> {
|
|
28
28
|
search?: SearchOutput;
|
|
29
29
|
}
|
|
30
|
-
export interface EnhancedListHandlerInput<T, K> extends ListHandlerInput<EnhancedListHandlerOptions<T, K
|
|
30
|
+
export interface EnhancedListHandlerInput<T, K> extends Omit<ListHandlerInput<EnhancedListHandlerOptions<T, K>>, 'config'> {
|
|
31
31
|
}
|
|
32
32
|
export interface EnhancedListHandler<T, K> extends AsyncDataAction<EnhancedListHandlerOutput<T>, EnhancedListHandlerInput<T, K>> {
|
|
33
33
|
}
|
|
34
34
|
type ListItem<Action> = Action extends ListHandler<any, ListHandlerOutput<infer T>> ? T : never;
|
|
35
|
-
type Options<Action> = Action extends ListHandler<ListHandlerInput<ListHandlerOptions<infer E
|
|
35
|
+
type Options<Action> = Action extends ListHandler<Omit<ListHandlerInput<ListHandlerOptions<infer E>>, 'config'>> ? E : never;
|
|
36
36
|
export declare const SEARCH_LIMIT = 10000;
|
|
37
37
|
export declare const SEARCH_PAGE_SIZE = 1000;
|
|
38
38
|
interface Search<T> {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ActionHandlersProvider } from './context';
|
|
2
|
+
export { createEnhancedListHandler } from './createEnhancedListHandler';
|
|
3
|
+
export { ActionHandlersProviderProps, DefaultActionHandlers, DerivedActionHandlers, UseAction, } from './types';
|
|
4
|
+
export { useAction } from './useAction';
|
|
5
|
+
export { useList } from './useList';
|
|
6
|
+
export { getActionHandlers } from './utils';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataState } from '@aws-amplify/ui-react-core';
|
|
3
|
+
import { ActionHandler, ExtendedActionConfigs, CopyHandler, CreateFolderHandler, DeleteHandler, DownloadHandler, ListLocationItemsHandler, ListLocations, LocationData, TaskData, UploadHandler } from '../actions';
|
|
4
|
+
import { StatusCounts, Task, Tasks } from '../tasks';
|
|
5
|
+
export type ListActionState<T = any, K = any> = [
|
|
6
|
+
state: DataState<T>,
|
|
7
|
+
handleAction: (...input: K[]) => void
|
|
8
|
+
];
|
|
9
|
+
export interface DefaultActionHandlers {
|
|
10
|
+
upload: UploadHandler;
|
|
11
|
+
download: DownloadHandler;
|
|
12
|
+
copy: CopyHandler;
|
|
13
|
+
createFolder: CreateFolderHandler;
|
|
14
|
+
delete: DeleteHandler;
|
|
15
|
+
}
|
|
16
|
+
export type ActionHandlers = Record<string, ActionHandler | ListLocationItemsHandler | ListLocations>;
|
|
17
|
+
export interface ActionHandlersContext {
|
|
18
|
+
handlers: ActionHandlers;
|
|
19
|
+
}
|
|
20
|
+
export interface ActionHandlersProviderProps extends ActionHandlersContext {
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
type DerivedCustomActions<T> = T extends {
|
|
24
|
+
custom?: infer U;
|
|
25
|
+
} ? U : {};
|
|
26
|
+
export type ResolveHandlerType<T> = T extends {
|
|
27
|
+
handler: infer X;
|
|
28
|
+
} | infer X ? X : never;
|
|
29
|
+
export type DerivedActionHandlers<C extends ExtendedActionConfigs = ExtendedActionConfigs, D extends DerivedCustomActions<C> = DerivedCustomActions<C>> = DefaultActionHandlers & {
|
|
30
|
+
[K in keyof D]: ResolveHandlerType<D[K]>;
|
|
31
|
+
};
|
|
32
|
+
export interface HandleTasksOptions<U extends TaskData = TaskData> {
|
|
33
|
+
items: U[];
|
|
34
|
+
onTaskSuccess?: (task: Task<U>) => void;
|
|
35
|
+
}
|
|
36
|
+
interface HandleTasksInput {
|
|
37
|
+
location?: LocationData;
|
|
38
|
+
}
|
|
39
|
+
export interface HandleTaskInput<T, K> {
|
|
40
|
+
data: T;
|
|
41
|
+
location?: LocationData;
|
|
42
|
+
options?: {
|
|
43
|
+
onSuccess?: (data: {
|
|
44
|
+
id: string;
|
|
45
|
+
key: string;
|
|
46
|
+
}, value: K) => void;
|
|
47
|
+
onError?: (data: {
|
|
48
|
+
id: string;
|
|
49
|
+
key: string;
|
|
50
|
+
}, message: string | undefined) => void;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export type HandlerInput<T extends TaskData, K, U = undefined> = U extends undefined ? HandleTaskInput<T, K> : HandleTasksInput;
|
|
54
|
+
export interface TasksState<T extends TaskData, V = any> {
|
|
55
|
+
isProcessing: boolean;
|
|
56
|
+
isProcessingComplete: boolean;
|
|
57
|
+
reset: () => void;
|
|
58
|
+
statusCounts: StatusCounts;
|
|
59
|
+
tasks: Tasks<T, V>;
|
|
60
|
+
}
|
|
61
|
+
export type HandleTasks = (input?: HandleTasksInput) => void;
|
|
62
|
+
export type UseTasksState<T extends TaskData, V = any> = [
|
|
63
|
+
TasksState<T, V>,
|
|
64
|
+
HandleTasks
|
|
65
|
+
];
|
|
66
|
+
export type HandleTask<T, K> = (input: HandleTaskInput<T, K>) => void;
|
|
67
|
+
export type UseTaskState<T extends TaskData, R> = [
|
|
68
|
+
{
|
|
69
|
+
task: Task<T, R> | undefined;
|
|
70
|
+
isProcessing: boolean;
|
|
71
|
+
},
|
|
72
|
+
HandleTask<T, R>
|
|
73
|
+
];
|
|
74
|
+
export type UseHandlerState<T extends TaskData, R, U = undefined> = U extends undefined ? UseTaskState<T, R> : UseTasksState<T, R>;
|
|
75
|
+
export type UseAction<V extends Record<keyof V, ActionHandler>> = <K extends keyof V, TData extends V[K] extends ActionHandler<infer D> ? D & TaskData : never, TOptions extends HandleTasksOptions<TData>, U extends TOptions | undefined = undefined>(key: K, options?: U) => UseHandlerState<TData, V[K] extends ActionHandler<any, infer R> ? R : never, U>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TaskData, TaskHandler, TaskHandlerInput, TaskHandlerOutput } from '../actions';
|
|
2
|
+
import { HandleTasksOptions, UseHandlerState } from './types';
|
|
3
|
+
export declare const useHandler: <TData extends TaskData, RValue, TOptions extends HandleTasksOptions<TData>, U extends TOptions | undefined = undefined>(action: TaskHandler<TaskHandlerInput<TData, import("../actions").TaskHandlerOptions<any>>, TaskHandlerOutput<RValue>>, options?: U | undefined) => UseHandlerState<TData, RValue, U>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const LIST_ACTION_HOOKS: {
|
|
2
|
+
folderItems: () => import("./useListFolderItems").UseListFolderItemsState;
|
|
3
|
+
locationItems: () => import("./useListLocationItems").UseListLocationItemsState;
|
|
4
|
+
locations: () => import("./useListLocations").UseListLocationsState;
|
|
5
|
+
};
|
|
6
|
+
type ListActionHooks = typeof LIST_ACTION_HOOKS;
|
|
7
|
+
export type UseList = <K extends keyof ListActionHooks, S extends ListActionHooks[K]>(type: K) => ReturnType<S>;
|
|
8
|
+
export declare const useList: UseList;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LocationItemType, FolderData, ListLocationItemsHandlerInput, ListHandlerOutput } from '../actions';
|
|
2
|
+
import { EnhancedListHandlerInput, EnhancedListHandlerOutput } from './createEnhancedListHandler';
|
|
3
|
+
import { ListActionState } from './types';
|
|
4
|
+
type RemoveConfig<T> = Omit<T, 'config'>;
|
|
5
|
+
interface EnhancedInput extends RemoveConfig<EnhancedListHandlerInput<FolderData, LocationItemType>> {
|
|
6
|
+
}
|
|
7
|
+
export interface UseListLocationItemsState extends ListActionState<EnhancedListHandlerOutput<FolderData>, EnhancedInput> {
|
|
8
|
+
}
|
|
9
|
+
export type ListFolderItemsAction = (input: ListLocationItemsHandlerInput) => Promise<ListHandlerOutput<FolderData>>;
|
|
10
|
+
export interface UseListFolderItemsState extends ListActionState<EnhancedListHandlerOutput<FolderData>, EnhancedListHandlerInput<FolderData, LocationItemType>> {
|
|
11
|
+
}
|
|
12
|
+
export declare const useListFolderItems: () => UseListFolderItemsState;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LocationItemType, LocationItemData } from '../actions';
|
|
2
|
+
import { EnhancedListHandlerInput, EnhancedListHandlerOutput } from './createEnhancedListHandler';
|
|
3
|
+
import { ListActionState } from './types';
|
|
4
|
+
type RemoveConfig<T> = Omit<T, 'config'>;
|
|
5
|
+
interface EnhancedInput extends RemoveConfig<EnhancedListHandlerInput<LocationItemData, LocationItemType>> {
|
|
6
|
+
}
|
|
7
|
+
export interface UseListLocationItemsState extends ListActionState<EnhancedListHandlerOutput<LocationItemData>, EnhancedInput> {
|
|
8
|
+
}
|
|
9
|
+
export declare const useListLocationItems: () => UseListLocationItemsState;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LocationData, ListLocationsExcludeOptions } from '../actions';
|
|
2
|
+
import { EnhancedListHandlerInput, EnhancedListHandlerOutput } from './createEnhancedListHandler';
|
|
3
|
+
import { ListActionState } from './types';
|
|
4
|
+
type RemoveConfigAndPrefix<T> = Omit<T, 'prefix' | 'config'>;
|
|
5
|
+
export interface UseListLocationsState extends ListActionState<EnhancedListHandlerOutput<LocationData>, RemoveConfigAndPrefix<EnhancedListHandlerInput<LocationData, ListLocationsExcludeOptions>>> {
|
|
6
|
+
}
|
|
7
|
+
export declare const useListLocations: () => UseListLocationsState;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CustomActionConfigs, ExtendedActionConfigs } from '../actions';
|
|
2
|
+
import { ActionHandlers } from './types';
|
|
3
|
+
export declare const getActionHandlers: <T extends {
|
|
4
|
+
default: Required<ExtendedActionConfigs>['default'];
|
|
5
|
+
custom?: CustomActionConfigs | undefined;
|
|
6
|
+
}>(configs: T) => ActionHandlers;
|
package/dist/types/components/StorageBrowser/views/LocationActionView/CopyView/useFolders.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { FolderData } from '../../../actions';
|
|
2
|
-
import { ListLocationItemsHandlerInput, ListHandlerOutput } from '../../../actions';
|
|
3
|
-
import { FoldersState } from './types';
|
|
4
1
|
import { LocationState } from '../../../providers/store/location';
|
|
2
|
+
import { FoldersState } from './types';
|
|
5
3
|
export declare const DEFAULT_LIST_OPTIONS: {
|
|
6
4
|
pageSize: number;
|
|
7
5
|
delimiter: string;
|
|
8
6
|
exclude: "FILE";
|
|
9
7
|
};
|
|
10
|
-
export type ListFoldersAction = (input: ListLocationItemsHandlerInput) => Promise<ListHandlerOutput<FolderData>>;
|
|
11
8
|
interface UseFoldersInput {
|
|
12
9
|
destination: LocationState;
|
|
13
10
|
setDestination: (destination: LocationState) => void;
|
package/dist/types/components/StorageBrowser/views/LocationActionView/CreateFolderView/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { CreateFolderHandlerData, LocationData } from '../../../actions';
|
|
3
3
|
import { ActionViewType, ActionViewState, ActionViewProps } from '../types';
|
|
4
4
|
export interface CreateFolderViewState extends Omit<ActionViewState<CreateFolderHandlerData>, 'onActionCancel'> {
|
|
5
5
|
folderName: string;
|
|
@@ -11,7 +11,7 @@ export interface CreateFolderViewProps extends ActionViewProps, Partial<CreateFo
|
|
|
11
11
|
export interface CreateFolderViewProviderProps extends CreateFolderViewState {
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
}
|
|
14
|
-
export interface CreateFolderViewType extends ActionViewType<
|
|
14
|
+
export interface CreateFolderViewType extends ActionViewType<CreateFolderHandlerData, CreateFolderViewProps> {
|
|
15
15
|
Provider: (props: CreateFolderViewProviderProps) => React.JSX.Element;
|
|
16
16
|
Exit: () => React.JSX.Element | null;
|
|
17
17
|
NameField: () => React.JSX.Element | null;
|