@aws-amplify/ui-react-storage 3.14.0 → 3.15.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 +8 -2
- package/dist/{createStorageBrowser-CotOvK0A.js → createStorageBrowser-CG-6mXiT.js} +392 -148
- package/dist/esm/browser.mjs +1 -0
- package/dist/esm/components/StorageBrowser/ErrorBoundary/ErrorBoundary.mjs +1 -0
- package/dist/esm/components/StorageBrowser/StorageBrowserAmplify.mjs +1 -0
- package/dist/esm/components/StorageBrowser/actions/configs/defaults.mjs +1 -0
- package/dist/esm/components/StorageBrowser/actions/handlers/defaults.mjs +1 -1
- package/dist/esm/components/StorageBrowser/actions/handlers/listLocations.mjs +7 -2
- package/dist/esm/components/StorageBrowser/actions/handlers/utils.mjs +65 -1
- package/dist/esm/components/StorageBrowser/actions/handlers/zipdownload.mjs +195 -0
- package/dist/esm/components/StorageBrowser/adapters/createAmplifyAuthAdapter/createAmplifyListLocationsHandler.mjs +3 -1
- package/dist/esm/components/StorageBrowser/adapters/createManagedAuthAdapter/createManagedAuthAdapter.mjs +1 -0
- package/dist/esm/components/StorageBrowser/components/ComponentsProvider.mjs +1 -0
- package/dist/esm/components/StorageBrowser/components/base/preview/DownloadButton.mjs +1 -0
- package/dist/esm/components/StorageBrowser/controls/DataTableControl.mjs +1 -0
- package/dist/esm/components/StorageBrowser/createStorageBrowser/StorageBrowserDefault.mjs +1 -0
- package/dist/esm/components/StorageBrowser/createStorageBrowser/createProvider.mjs +1 -0
- package/dist/esm/components/StorageBrowser/createStorageBrowser/createStorageBrowser.mjs +1 -0
- package/dist/esm/components/StorageBrowser/displayText/libraries/en/downloadView.mjs +2 -0
- package/dist/esm/components/StorageBrowser/displayText/libraries/en/shared.mjs +2 -0
- package/dist/esm/components/StorageBrowser/locationItems/context.mjs +1 -0
- package/dist/esm/components/StorageBrowser/tasks/constants.mjs +2 -0
- package/dist/esm/components/StorageBrowser/tasks/useProcessTasks.mjs +10 -4
- package/dist/esm/components/StorageBrowser/tasks/utils.mjs +4 -1
- package/dist/esm/components/StorageBrowser/useAction/useHandler.mjs +1 -1
- package/dist/esm/components/StorageBrowser/useAction/utils.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/CopyView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/CopyViewProvider.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/FoldersMessageControl.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/useCopyView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CopyView/useFolders.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CreateFolderView/CreateFolderView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/CreateFolderView/useCreateFolderView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DeleteView/DeleteView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DeleteView/useDeleteView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DownloadView/DownloadView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/DownloadView/useDownloadView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/UploadView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/UploadViewProvider.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/useUploadView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/LocationDetailView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/getLocationDetailViewTableData/getLocationDetailViewTableData.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationDetailView/useLocationDetailView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationsView/LocationsView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationsView/LocationsViewProvider.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/LocationsView/useLocationsView.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/context/actionViews.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/context/primaryViews.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/hooks/useFilePreview/useFilePreview.mjs +1 -0
- package/dist/esm/components/StorageBrowser/views/utils/tableResolvers/constants.mjs +4 -0
- package/dist/esm/components/StorageBrowser/views/utils/tableResolvers/utils.mjs +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/index.js +2 -1
- package/dist/styles.css +17 -0
- package/dist/types/components/StorageBrowser/actions/handlers/index.d.ts +1 -0
- package/dist/types/components/StorageBrowser/actions/handlers/types.d.ts +4 -2
- package/dist/types/components/StorageBrowser/actions/handlers/utils.d.ts +11 -0
- package/dist/types/components/StorageBrowser/actions/handlers/zipdownload.d.ts +3 -0
- package/dist/types/components/StorageBrowser/displayText/types.d.ts +2 -0
- package/dist/types/components/StorageBrowser/tasks/types.d.ts +3 -3
- package/dist/types/components/StorageBrowser/tasks/useProcessTasks.d.ts +1 -1
- package/dist/types/components/StorageBrowser/useAction/useHandler.d.ts +1 -1
- package/dist/types/components/StorageBrowser/views/utils/tableResolvers/constants.d.ts +4 -0
- package/dist/types/version.d.ts +1 -1
- package/package.json +11 -8
- package/dist/esm/components/StorageBrowser/actions/handlers/download.mjs +0 -38
|
@@ -2,6 +2,7 @@ import React__default from 'react';
|
|
|
2
2
|
import '@aws-amplify/storage/internals';
|
|
3
3
|
import { isMultipartUpload } from '../../../actions/handlers/utils.mjs';
|
|
4
4
|
import '@aws-amplify/ui';
|
|
5
|
+
import 'jszip';
|
|
5
6
|
import 'aws-amplify/storage';
|
|
6
7
|
import '../../../actions/configs/context.mjs';
|
|
7
8
|
import '../../../actions/configs/defaults.mjs';
|
package/dist/esm/components/StorageBrowser/views/LocationActionView/UploadView/useUploadView.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import '../../../credentials/context.mjs';
|
|
|
10
10
|
import '@aws-amplify/storage/internals';
|
|
11
11
|
import '../../../configuration/context.mjs';
|
|
12
12
|
import 'aws-amplify';
|
|
13
|
+
import 'jszip';
|
|
13
14
|
import 'aws-amplify/storage';
|
|
14
15
|
import '../../../actions/configs/context.mjs';
|
|
15
16
|
import '../../../actions/configs/defaults.mjs';
|
|
@@ -12,6 +12,7 @@ import '../../credentials/context.mjs';
|
|
|
12
12
|
import '@aws-amplify/storage/internals';
|
|
13
13
|
import '../../configuration/context.mjs';
|
|
14
14
|
import 'aws-amplify';
|
|
15
|
+
import 'jszip';
|
|
15
16
|
import 'aws-amplify/storage';
|
|
16
17
|
import '../../actions/configs/context.mjs';
|
|
17
18
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '@aws-amplify/storage/internals';
|
|
2
2
|
import { createFileDataItem } from '../../../actions/handlers/utils.mjs';
|
|
3
3
|
import '@aws-amplify/ui';
|
|
4
|
+
import 'jszip';
|
|
4
5
|
import 'aws-amplify/storage';
|
|
5
6
|
import '../../../actions/configs/context.mjs';
|
|
6
7
|
import '../../../actions/configs/defaults.mjs';
|
package/dist/esm/components/StorageBrowser/views/LocationDetailView/useLocationDetailView.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { isUndefined, isFunction } from '@aws-amplify/ui';
|
|
|
3
3
|
import { usePaginate } from '../hooks/usePaginate.mjs';
|
|
4
4
|
import '@aws-amplify/storage/internals';
|
|
5
5
|
import 'aws-amplify';
|
|
6
|
+
import 'jszip';
|
|
6
7
|
import 'aws-amplify/storage';
|
|
7
8
|
import { useActionConfigs } from '../../actions/configs/context.mjs';
|
|
8
9
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -12,6 +12,7 @@ import '../../credentials/context.mjs';
|
|
|
12
12
|
import '@aws-amplify/storage/internals';
|
|
13
13
|
import '../../configuration/context.mjs';
|
|
14
14
|
import 'aws-amplify';
|
|
15
|
+
import 'jszip';
|
|
15
16
|
import 'aws-amplify/storage';
|
|
16
17
|
import '../../actions/configs/context.mjs';
|
|
17
18
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -12,6 +12,7 @@ import '../../credentials/context.mjs';
|
|
|
12
12
|
import '@aws-amplify/storage/internals';
|
|
13
13
|
import '../../configuration/context.mjs';
|
|
14
14
|
import 'aws-amplify';
|
|
15
|
+
import 'jszip';
|
|
15
16
|
import 'aws-amplify/storage';
|
|
16
17
|
import '../../actions/configs/context.mjs';
|
|
17
18
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -2,6 +2,7 @@ import React__default from 'react';
|
|
|
2
2
|
import '@aws-amplify/storage/internals';
|
|
3
3
|
import { getFileKey } from '../../actions/handlers/utils.mjs';
|
|
4
4
|
import '@aws-amplify/ui';
|
|
5
|
+
import 'jszip';
|
|
5
6
|
import 'aws-amplify/storage';
|
|
6
7
|
import '../../actions/configs/context.mjs';
|
|
7
8
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -10,6 +10,7 @@ import '@aws-amplify/storage/internals';
|
|
|
10
10
|
import '../../configuration/context.mjs';
|
|
11
11
|
import '@aws-amplify/ui-react-core';
|
|
12
12
|
import 'aws-amplify';
|
|
13
|
+
import 'jszip';
|
|
13
14
|
import 'aws-amplify/storage';
|
|
14
15
|
import '../../actions/configs/context.mjs';
|
|
15
16
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -10,6 +10,7 @@ import '@aws-amplify/storage/internals';
|
|
|
10
10
|
import '../../configuration/context.mjs';
|
|
11
11
|
import '@aws-amplify/ui-react-core';
|
|
12
12
|
import 'aws-amplify';
|
|
13
|
+
import 'jszip';
|
|
13
14
|
import 'aws-amplify/storage';
|
|
14
15
|
import '../../actions/configs/context.mjs';
|
|
15
16
|
import '../../actions/configs/defaults.mjs';
|
|
@@ -8,6 +8,7 @@ import { safeGetProperties } from '../../utils/files/safeGetProperties.mjs';
|
|
|
8
8
|
import { getUrl } from '@aws-amplify/storage/internals';
|
|
9
9
|
import { constructBucket } from '../../../actions/handlers/utils.mjs';
|
|
10
10
|
import '@aws-amplify/ui';
|
|
11
|
+
import 'jszip';
|
|
11
12
|
import 'aws-amplify/storage';
|
|
12
13
|
import { useStore } from '../../../store/context.mjs';
|
|
13
14
|
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
const STATUS_LABELS = {
|
|
2
2
|
PENDING: 'statusDisplayInProgressLabel',
|
|
3
|
+
FINISHING: 'statusDisplayFinishingLabel',
|
|
3
4
|
CANCELED: 'statusDisplayCanceledLabel',
|
|
4
5
|
COMPLETE: 'statusDisplayCompletedLabel',
|
|
6
|
+
LOADED: 'statusDisplayLoadedLabel',
|
|
5
7
|
FAILED: 'statusDisplayFailedLabel',
|
|
6
8
|
QUEUED: 'statusDisplayQueuedLabel',
|
|
7
9
|
OVERWRITE_PREVENTED: 'statusDisplayOverwritePreventedLabel',
|
|
8
10
|
};
|
|
9
11
|
const STATUS_ICONS = {
|
|
10
12
|
PENDING: 'action-progress',
|
|
13
|
+
FINISHING: 'action-progress',
|
|
11
14
|
COMPLETE: 'action-success',
|
|
15
|
+
LOADED: 'action-success',
|
|
12
16
|
FAILED: 'action-error',
|
|
13
17
|
OVERWRITE_PREVENTED: 'action-info',
|
|
14
18
|
CANCELED: 'action-canceled',
|
|
@@ -27,7 +27,7 @@ const getUploadCellProgress = ({ progress, status, }) => {
|
|
|
27
27
|
};
|
|
28
28
|
const getDownloadCellProgress = ({ progress, status, }) => {
|
|
29
29
|
// prefer `progress` if available, 1 if status is complete, default 0
|
|
30
|
-
const value = progress ?? (status === 'COMPLETE' ? 1 : 0);
|
|
30
|
+
const value = progress ?? (status === 'LOADED' || status === 'COMPLETE' ? 1 : 0);
|
|
31
31
|
const displayValue = `${Math.round(value * 100)}%`;
|
|
32
32
|
return { displayValue, value };
|
|
33
33
|
};
|
package/dist/esm/version.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -9,9 +9,10 @@ var uiReactCore = require('@aws-amplify/ui-react-core');
|
|
|
9
9
|
var auth = require('aws-amplify/auth');
|
|
10
10
|
var storage = require('aws-amplify/storage');
|
|
11
11
|
var internal = require('@aws-amplify/ui-react/internal');
|
|
12
|
-
var createStorageBrowser = require('./createStorageBrowser-
|
|
12
|
+
var createStorageBrowser = require('./createStorageBrowser-CG-6mXiT.js');
|
|
13
13
|
require('@aws-amplify/storage/internals');
|
|
14
14
|
require('aws-amplify');
|
|
15
|
+
require('jszip');
|
|
15
16
|
require('aws-amplify/utils');
|
|
16
17
|
require('@aws-amplify/ui-react-core/elements');
|
|
17
18
|
|
package/dist/styles.css
CHANGED
|
@@ -3565,6 +3565,23 @@ strong.amplify-text {
|
|
|
3565
3565
|
gap: var(--amplify-space-medium);
|
|
3566
3566
|
}
|
|
3567
3567
|
|
|
3568
|
+
[data-amplify-authenticator-passkeyprompt] .amplify-authenticator__passkey-success-icon {
|
|
3569
|
+
font-size: var(--amplify-font-sizes-xxxl);
|
|
3570
|
+
color: var(--amplify-colors-green-60, #34a853);
|
|
3571
|
+
}
|
|
3572
|
+
[data-amplify-authenticator-passkeyprompt] .amplify-authenticator__passkey-credential-item {
|
|
3573
|
+
padding: var(--amplify-space-medium);
|
|
3574
|
+
background-color: var(--amplify-colors-background-secondary);
|
|
3575
|
+
border-radius: var(--amplify-radii-small);
|
|
3576
|
+
}
|
|
3577
|
+
[data-amplify-authenticator-passkeyprompt] .amplify-authenticator__passkey-error {
|
|
3578
|
+
color: var(--amplify-colors-font-error);
|
|
3579
|
+
margin-top: var(--amplify-space-small);
|
|
3580
|
+
}
|
|
3581
|
+
[data-amplify-authenticator-passkeyprompt] .amplify-authenticator__passkey-icon {
|
|
3582
|
+
font-size: var(--amplify-components-authenticator-passkey-icon-size, 12rem);
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3568
3585
|
.amplify-avatar {
|
|
3569
3586
|
--avatar-color: var(--amplify-components-avatar-color);
|
|
3570
3587
|
--avatar-background-color: var(--amplify-components-avatar-background-color);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AllFileTypes } from '../../createStorageBrowser/types';
|
|
2
2
|
import type { LocationCredentialsProvider } from '../../storage-internal';
|
|
3
|
+
import type { TaskStatus } from '../../tasks';
|
|
3
4
|
/**
|
|
4
5
|
* `location` grant scope
|
|
5
6
|
*/
|
|
@@ -78,14 +79,15 @@ export interface TaskHandlerOptions {
|
|
|
78
79
|
onProgress?: (data: {
|
|
79
80
|
key: string;
|
|
80
81
|
id: string;
|
|
81
|
-
}, progress: number | undefined) => void;
|
|
82
|
+
}, progress: number | undefined, state?: TaskStatus) => void;
|
|
82
83
|
}
|
|
83
84
|
export interface TaskHandlerInput<TData extends TaskData = TaskData, TOptions extends TaskHandlerOptions = TaskHandlerOptions> {
|
|
84
85
|
config: ActionInputConfig;
|
|
85
86
|
data: TData;
|
|
87
|
+
all: TData[];
|
|
86
88
|
options?: TOptions;
|
|
87
89
|
}
|
|
88
|
-
export type TaskResultStatus = 'CANCELED' | 'COMPLETE' | 'FAILED' | 'OVERWRITE_PREVENTED';
|
|
90
|
+
export type TaskResultStatus = 'CANCELED' | 'COMPLETE' | 'FAILED' | 'LOADED' | 'OVERWRITE_PREVENTED';
|
|
89
91
|
export interface TaskResult<TStatus, TValue> {
|
|
90
92
|
/**
|
|
91
93
|
* result error (if any)
|
|
@@ -8,6 +8,17 @@ export declare const constructBucket: ({ bucket: bucketName, region: globalRegio
|
|
|
8
8
|
};
|
|
9
9
|
export declare const parseAccessGrantLocation: (location: AccessGrantLocation) => LocationData;
|
|
10
10
|
export declare const shouldExcludeLocation: ({ permissions, type }: LocationData, exclude?: ListLocationsExcludeOptions) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Deduplicates locations with the same bucket and prefix.
|
|
13
|
+
* Only deduplicates when one location's permissions are a superset of another's.
|
|
14
|
+
* This prevents deduplication of incompatible grants like READ + WRITE.
|
|
15
|
+
*
|
|
16
|
+
* Examples:
|
|
17
|
+
* - READ + READWRITE → Keep READWRITE (superset)
|
|
18
|
+
* - READ + READ → Keep first (identical)
|
|
19
|
+
* - READ + WRITE → Keep both (not superset, need separate locations)
|
|
20
|
+
*/
|
|
21
|
+
export declare const deduplicateLocations: (locations: LocationData[]) => LocationData[];
|
|
11
22
|
export declare const getFilteredLocations: (locations: AccessGrantLocation[], exclude?: ListLocationsExcludeOptions) => LocationData[];
|
|
12
23
|
export declare const getFileKey: (key: string) => string;
|
|
13
24
|
export declare const createFileDataItem: (data: FileData) => FileDataItem;
|
|
@@ -102,8 +102,10 @@ export interface DefaultActionViewDisplayText<T extends TaskData = TaskData> {
|
|
|
102
102
|
} | undefined;
|
|
103
103
|
statusDisplayCanceledLabel: string;
|
|
104
104
|
statusDisplayCompletedLabel: string;
|
|
105
|
+
statusDisplayLoadedLabel: string;
|
|
105
106
|
statusDisplayFailedLabel: string;
|
|
106
107
|
statusDisplayInProgressLabel: string;
|
|
108
|
+
statusDisplayFinishingLabel: string;
|
|
107
109
|
statusDisplayQueuedLabel: string;
|
|
108
110
|
statusDisplayTotalLabel: string;
|
|
109
111
|
title: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { TaskHandlerInput,
|
|
1
|
+
import type { TaskData, TaskHandlerInput, TaskHandlerOptions, TaskResult, TaskResultStatus } from '../actions';
|
|
2
2
|
/**
|
|
3
3
|
* extends {@link TaskResultStatus} to include `QUEUED` and `PENDING` statuses
|
|
4
4
|
* used in task processing
|
|
5
5
|
*/
|
|
6
|
-
export type TaskStatus = TaskResultStatus | 'QUEUED' | 'PENDING';
|
|
6
|
+
export type TaskStatus = TaskResultStatus | 'QUEUED' | 'PENDING' | 'FINISHING';
|
|
7
7
|
/**
|
|
8
8
|
* aggregate task status counts
|
|
9
9
|
*/
|
|
@@ -50,7 +50,7 @@ export type UseProcessTasksState<TTask, TInput> = [
|
|
|
50
50
|
interface HandleTasksOptions extends TaskHandlerOptions {
|
|
51
51
|
concurrency?: number;
|
|
52
52
|
}
|
|
53
|
-
export interface HandleBatchTasksInput<TData extends TaskData> extends Omit<TaskHandlerInput<TData, HandleTasksOptions>, 'data'> {
|
|
53
|
+
export interface HandleBatchTasksInput<TData extends TaskData> extends Omit<TaskHandlerInput<TData, HandleTasksOptions>, 'data' | 'all'> {
|
|
54
54
|
}
|
|
55
55
|
export interface HandleSingleTaskInput<TData extends TaskData> extends TaskHandlerInput<TData> {
|
|
56
56
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ActionHandler } from '../actions';
|
|
2
|
-
import type { InferHandleTasksInput,
|
|
2
|
+
import type { InferHandleTasksInput, ProcessTasksOptions, Task, UseProcessTasksState } from './types';
|
|
3
3
|
export declare function useProcessTasks<TData, TValue, TTask extends Task<TData, TValue>, TInput extends InferHandleTasksInput<TItems, TTask['data']>, TItems extends TTask['data'][] | undefined = undefined>(handler: ActionHandler<TData, TValue>, options?: ProcessTasksOptions<TTask, TItems>): UseProcessTasksState<TTask, TInput>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ActionHandler } from '../actions';
|
|
2
|
-
import type {
|
|
2
|
+
import type { HandleTasksState, HandleTaskState, InferTask, UseHandlerOptions, UseHandlerOptionsWithItems } from './types';
|
|
3
3
|
export declare function useHandler<THandler extends ActionHandler, TTask extends InferTask<THandler>>(handler: THandler, options: UseHandlerOptionsWithItems<TTask>): HandleTasksState<TTask>;
|
|
4
4
|
export declare function useHandler<THandler extends ActionHandler, TTask extends InferTask<THandler>>(handler: THandler, options?: UseHandlerOptions<TTask>): HandleTaskState<TTask>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
export declare const STATUS_LABELS: {
|
|
2
2
|
readonly PENDING: "statusDisplayInProgressLabel";
|
|
3
|
+
readonly FINISHING: "statusDisplayFinishingLabel";
|
|
3
4
|
readonly CANCELED: "statusDisplayCanceledLabel";
|
|
4
5
|
readonly COMPLETE: "statusDisplayCompletedLabel";
|
|
6
|
+
readonly LOADED: "statusDisplayLoadedLabel";
|
|
5
7
|
readonly FAILED: "statusDisplayFailedLabel";
|
|
6
8
|
readonly QUEUED: "statusDisplayQueuedLabel";
|
|
7
9
|
readonly OVERWRITE_PREVENTED: "statusDisplayOverwritePreventedLabel";
|
|
8
10
|
};
|
|
9
11
|
export declare const STATUS_ICONS: {
|
|
10
12
|
readonly PENDING: "action-progress";
|
|
13
|
+
readonly FINISHING: "action-progress";
|
|
11
14
|
readonly COMPLETE: "action-success";
|
|
15
|
+
readonly LOADED: "action-success";
|
|
12
16
|
readonly FAILED: "action-error";
|
|
13
17
|
readonly OVERWRITE_PREVENTED: "action-info";
|
|
14
18
|
readonly CANCELED: "action-canceled";
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.
|
|
1
|
+
export declare const VERSION = "3.15.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react-storage",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "yarn build:rollup",
|
|
36
36
|
"build:rollup": "rollup --config",
|
|
37
|
+
"build:watch": "rollup -c -w",
|
|
37
38
|
"check:esm": "node --input-type=module --eval 'import \"@aws-amplify/ui-react-storage\"'",
|
|
38
39
|
"clean": "rimraf dist node_modules",
|
|
39
40
|
"dev": "yarn build:rollup --watch",
|
|
@@ -45,10 +46,11 @@
|
|
|
45
46
|
"typecheck": "tsc --noEmit"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@aws-amplify/ui": "6.
|
|
49
|
-
"@aws-amplify/ui-react": "6.
|
|
50
|
-
"@aws-amplify/ui-react-core": "3.
|
|
51
|
-
"tslib": "^2.5.2"
|
|
49
|
+
"@aws-amplify/ui": "6.14.0",
|
|
50
|
+
"@aws-amplify/ui-react": "6.14.0",
|
|
51
|
+
"@aws-amplify/ui-react-core": "3.5.0",
|
|
52
|
+
"tslib": "^2.5.2",
|
|
53
|
+
"jszip": "^3.10.1"
|
|
52
54
|
},
|
|
53
55
|
"peerDependencies": {
|
|
54
56
|
"aws-amplify": "^6.14.3",
|
|
@@ -56,7 +58,8 @@
|
|
|
56
58
|
"react-dom": "^16.14 || ^17 || ^18 || ^19"
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|
|
59
|
-
"@types/node": "^18.19.50"
|
|
61
|
+
"@types/node": "^18.19.50",
|
|
62
|
+
"node-fetch": "~3.3.2"
|
|
60
63
|
},
|
|
61
64
|
"sideEffects": [
|
|
62
65
|
"dist/**/*.css"
|
|
@@ -66,7 +69,7 @@
|
|
|
66
69
|
"name": "createStorageBrowser",
|
|
67
70
|
"path": "dist/esm/browser.mjs",
|
|
68
71
|
"import": "{ createStorageBrowser }",
|
|
69
|
-
"limit": "
|
|
72
|
+
"limit": "94.1 kB",
|
|
70
73
|
"ignore": [
|
|
71
74
|
"@aws-amplify/storage"
|
|
72
75
|
]
|
|
@@ -75,7 +78,7 @@
|
|
|
75
78
|
"name": "StorageBrowser",
|
|
76
79
|
"path": "dist/esm/index.mjs",
|
|
77
80
|
"import": "{ StorageBrowser }",
|
|
78
|
-
"limit": "
|
|
81
|
+
"limit": "118.6 kB"
|
|
79
82
|
},
|
|
80
83
|
{
|
|
81
84
|
"name": "FileUploader",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { getUrl } from '@aws-amplify/storage/internals';
|
|
2
|
-
import { constructBucket } from './utils.mjs';
|
|
3
|
-
|
|
4
|
-
function downloadFromUrl(fileName, url) {
|
|
5
|
-
const a = document.createElement('a');
|
|
6
|
-
a.href = url;
|
|
7
|
-
a.download = fileName;
|
|
8
|
-
a.target = '_blank';
|
|
9
|
-
document.body.appendChild(a);
|
|
10
|
-
a.click();
|
|
11
|
-
document.body.removeChild(a);
|
|
12
|
-
}
|
|
13
|
-
const downloadHandler = ({ config, data }) => {
|
|
14
|
-
const { accountId, credentials, customEndpoint } = config;
|
|
15
|
-
const { key } = data;
|
|
16
|
-
const result = getUrl({
|
|
17
|
-
path: key,
|
|
18
|
-
options: {
|
|
19
|
-
bucket: constructBucket(config),
|
|
20
|
-
customEndpoint,
|
|
21
|
-
locationCredentialsProvider: credentials,
|
|
22
|
-
validateObjectExistence: true,
|
|
23
|
-
contentDisposition: 'attachment',
|
|
24
|
-
expectedBucketOwner: accountId,
|
|
25
|
-
},
|
|
26
|
-
})
|
|
27
|
-
.then(({ url }) => {
|
|
28
|
-
downloadFromUrl(key, url.toString());
|
|
29
|
-
return { status: 'COMPLETE', value: { url } };
|
|
30
|
-
})
|
|
31
|
-
.catch((error) => {
|
|
32
|
-
const { message } = error;
|
|
33
|
-
return { error, message, status: 'FAILED' };
|
|
34
|
-
});
|
|
35
|
-
return { result };
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { downloadHandler };
|