@aws-amplify/ui-react-storage 3.7.0 → 3.7.2
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 +1 -1
- package/dist/{createAmplifyAuthAdapter-C4RcR9wH.js → createAmplifyAuthAdapter-C0qoSzPO.js} +1188 -1186
- package/dist/esm/components/StorageBrowser/StorageBrowserDefault.mjs +16 -0
- package/dist/esm/components/StorageBrowser/actions/handlers/constants.mjs +3 -0
- package/dist/esm/components/StorageBrowser/actions/handlers/createFolder.mjs +2 -0
- package/dist/esm/components/StorageBrowser/actions/handlers/upload.mjs +2 -2
- package/dist/esm/components/StorageBrowser/createStorageBrowser.mjs +3 -3
- package/dist/esm/components/StorageBrowser/views/useView.mjs +4 -4
- package/dist/esm/version.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/types/components/StorageBrowser/actions/handlers/constants.d.ts +1 -0
- package/dist/types/components/StorageBrowser/actions/handlers/upload.d.ts +0 -1
- package/dist/types/components/StorageBrowser/index.d.ts +2 -1
- package/dist/types/components/StorageBrowser/types.d.ts +1 -2
- package/dist/types/components/StorageBrowser/views/index.d.ts +2 -0
- package/dist/types/components/StorageBrowser/views/useView.d.ts +4 -4
- package/dist/types/version.d.ts +1 -1
- package/package.json +6 -8
- package/dist/storage-browser-styles.css +0 -482
- package/dist/storage-browser-styles.js +0 -2
- package/dist/types/styles/storage-browser-styles.d.ts +0 -1
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import { useViews } from './views/context/views.mjs';
|
|
3
|
+
import './views/LocationActionView/CopyView/CopyView.mjs';
|
|
4
|
+
import '@aws-amplify/ui';
|
|
3
5
|
import './providers/store/location/context.mjs';
|
|
4
6
|
import './providers/store/files/context.mjs';
|
|
5
7
|
import './providers/store/actionType/context.mjs';
|
|
6
8
|
import './providers/store/locationItems/context.mjs';
|
|
7
9
|
import { useStore } from './providers/store/useStore.mjs';
|
|
10
|
+
import './useAction/context.mjs';
|
|
11
|
+
import './providers/configuration/context.mjs';
|
|
12
|
+
import '@aws-amplify/ui-react-core';
|
|
13
|
+
import '@aws-amplify/ui-react-core/elements';
|
|
14
|
+
import './providers/configuration/credentials/context.mjs';
|
|
15
|
+
import '@aws-amplify/storage/internals';
|
|
16
|
+
import 'aws-amplify/storage';
|
|
17
|
+
import './actions/configs/context.mjs';
|
|
18
|
+
import './views/LocationActionView/CreateFolderView/CreateFolderView.mjs';
|
|
19
|
+
import './views/LocationActionView/DeleteView/DeleteView.mjs';
|
|
20
|
+
import './views/context/actionViews.mjs';
|
|
21
|
+
import './views/LocationActionView/UploadView/UploadView.mjs';
|
|
22
|
+
import './views/LocationDetailView/LocationDetailView.mjs';
|
|
23
|
+
import './views/LocationsView/LocationsView.mjs';
|
|
8
24
|
|
|
9
25
|
/**
|
|
10
26
|
* Handles default `StorageBrowser` behavior:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isFunction } from '@aws-amplify/ui';
|
|
2
2
|
import { uploadData } from '@aws-amplify/storage/internals';
|
|
3
3
|
import { getProgress, constructBucket } from './utils.mjs';
|
|
4
|
+
import { DEFAULT_CHECKSUM_ALGORITHM } from './constants.mjs';
|
|
4
5
|
|
|
5
6
|
const createFolderHandler = (input) => {
|
|
6
7
|
const { config, data, options } = input;
|
|
@@ -21,6 +22,7 @@ const createFolderHandler = (input) => {
|
|
|
21
22
|
onProgress(data, getProgress(event));
|
|
22
23
|
},
|
|
23
24
|
preventOverwrite,
|
|
25
|
+
checksumAlgorithm: DEFAULT_CHECKSUM_ALGORITHM,
|
|
24
26
|
},
|
|
25
27
|
});
|
|
26
28
|
return {
|
|
@@ -2,11 +2,11 @@ import { isCancelError } from 'aws-amplify/storage';
|
|
|
2
2
|
import { isFunction } from '@aws-amplify/ui';
|
|
3
3
|
import { uploadData } from '@aws-amplify/storage/internals';
|
|
4
4
|
import { constructBucket, getProgress } from './utils.mjs';
|
|
5
|
+
import { DEFAULT_CHECKSUM_ALGORITHM } from './constants.mjs';
|
|
5
6
|
|
|
6
7
|
// 5MB for multipart upload
|
|
7
8
|
// https://github.com/aws-amplify/amplify-js/blob/1a5366d113c9af4ce994168653df3aadb142c581/packages/storage/src/providers/s3/utils/constants.ts#L16
|
|
8
9
|
const MULTIPART_UPLOAD_THRESHOLD_BYTES = 5 * 1024 * 1024;
|
|
9
|
-
const DEFAULT_CHECKSUM_ALGORITHM = 'crc-32';
|
|
10
10
|
const UNDEFINED_CALLBACKS = {
|
|
11
11
|
cancel: undefined,
|
|
12
12
|
pause: undefined,
|
|
@@ -55,4 +55,4 @@ const uploadHandler = ({ config, data, options }) => {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
export {
|
|
58
|
+
export { MULTIPART_UPLOAD_THRESHOLD_BYTES, UNDEFINED_CALLBACKS, uploadHandler };
|
|
@@ -14,6 +14,7 @@ import './context/elements/definitions.mjs';
|
|
|
14
14
|
import './context/elements/IconElement.mjs';
|
|
15
15
|
import { ComponentsProvider } from './ComponentsProvider.mjs';
|
|
16
16
|
import { componentsDefault } from './componentsDefault.mjs';
|
|
17
|
+
import { DisplayTextProvider } from './displayText/context.mjs';
|
|
17
18
|
import { ErrorBoundary } from './ErrorBoundary/ErrorBoundary.mjs';
|
|
18
19
|
import { createConfigurationProvider } from './providers/configuration/createConfigurationProvider.mjs';
|
|
19
20
|
import './providers/configuration/context.mjs';
|
|
@@ -23,11 +24,12 @@ import './providers/store/files/context.mjs';
|
|
|
23
24
|
import './providers/store/location/context.mjs';
|
|
24
25
|
import './providers/store/locationItems/context.mjs';
|
|
25
26
|
import { StorageBrowserDefault } from './StorageBrowserDefault.mjs';
|
|
26
|
-
import { CopyView } from './views/LocationActionView/CopyView/CopyView.mjs';
|
|
27
27
|
import { ActionHandlersProvider } from './useAction/context.mjs';
|
|
28
28
|
import { useAction } from './useAction/useAction.mjs';
|
|
29
29
|
import '@aws-amplify/ui-react-core';
|
|
30
30
|
import { getActionHandlers } from './useAction/utils.mjs';
|
|
31
|
+
import { ViewsProvider } from './views/context/views.mjs';
|
|
32
|
+
import { CopyView } from './views/LocationActionView/CopyView/CopyView.mjs';
|
|
31
33
|
import { CreateFolderView } from './views/LocationActionView/CreateFolderView/CreateFolderView.mjs';
|
|
32
34
|
import { DeleteView } from './views/LocationActionView/DeleteView/DeleteView.mjs';
|
|
33
35
|
import { LocationActionView } from './views/LocationActionView/LocationActionView.mjs';
|
|
@@ -35,8 +37,6 @@ import { UploadView } from './views/LocationActionView/UploadView/UploadView.mjs
|
|
|
35
37
|
import { LocationDetailView } from './views/LocationDetailView/LocationDetailView.mjs';
|
|
36
38
|
import { LocationsView } from './views/LocationsView/LocationsView.mjs';
|
|
37
39
|
import { useView } from './views/useView.mjs';
|
|
38
|
-
import { ViewsProvider } from './views/context/views.mjs';
|
|
39
|
-
import { DisplayTextProvider } from './displayText/context.mjs';
|
|
40
40
|
|
|
41
41
|
function createStorageBrowser(input) {
|
|
42
42
|
assertRegisterAuthListener(input.config.registerAuthListener);
|
|
@@ -18,7 +18,7 @@ import { useLocationsView } from './LocationsView/useLocationsView.mjs';
|
|
|
18
18
|
import './LocationDetailView/LocationDetailView.mjs';
|
|
19
19
|
import { useLocationDetailView } from './LocationDetailView/useLocationDetailView.mjs';
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const DEFAULT_VIEW_HOOKS = {
|
|
22
22
|
Copy: useCopyView,
|
|
23
23
|
CreateFolder: useCreateFolderView,
|
|
24
24
|
Delete: useDeleteView,
|
|
@@ -26,13 +26,13 @@ const USE_VIEW_HOOKS = {
|
|
|
26
26
|
Locations: useLocationsView,
|
|
27
27
|
Upload: useUploadView,
|
|
28
28
|
};
|
|
29
|
-
const isUseViewType = (value) => !!
|
|
29
|
+
const isUseViewType = (value) => !!DEFAULT_VIEW_HOOKS?.[value];
|
|
30
30
|
// @ts-expect-error
|
|
31
31
|
const useView = (type) => {
|
|
32
32
|
if (!isUseViewType(type)) {
|
|
33
33
|
throw new Error(`Value of \`${type}\` cannot be used to index \`useView\``);
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return DEFAULT_VIEW_HOOKS[type]();
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
export { useView };
|
|
38
|
+
export { DEFAULT_VIEW_HOOKS, useView };
|
package/dist/esm/version.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ 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 createAmplifyAuthAdapter = require('./createAmplifyAuthAdapter-
|
|
12
|
+
var createAmplifyAuthAdapter = require('./createAmplifyAuthAdapter-C0qoSzPO.js');
|
|
13
13
|
require('@aws-amplify/storage/internals');
|
|
14
14
|
require('@aws-amplify/ui-react-core/elements');
|
|
15
15
|
require('aws-amplify');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_CHECKSUM_ALGORITHM = "crc-32";
|
|
@@ -16,7 +16,6 @@ export interface UploadHandlerOutput extends TaskHandlerOutput<{
|
|
|
16
16
|
export interface UploadHandler extends TaskHandler<UploadHandlerInput, UploadHandlerOutput> {
|
|
17
17
|
}
|
|
18
18
|
export declare const MULTIPART_UPLOAD_THRESHOLD_BYTES: number;
|
|
19
|
-
export declare const DEFAULT_CHECKSUM_ALGORITHM = "crc-32";
|
|
20
19
|
export declare const UNDEFINED_CALLBACKS: {
|
|
21
20
|
cancel: undefined;
|
|
22
21
|
pause: undefined;
|
|
@@ -2,5 +2,6 @@ export { componentsDefault } from './componentsDefault';
|
|
|
2
2
|
export { createStorageBrowser } from './createStorageBrowser';
|
|
3
3
|
export { ActionViewConfig, ActionHandler, FileDataItem, ExtendedActionConfigs, } from './actions';
|
|
4
4
|
export { createAmplifyAuthAdapter, createManagedAuthAdapter, CreateManagedAuthAdapterInput, StorageBrowserAuthAdapter, } from './adapters';
|
|
5
|
-
export { CreateStorageBrowserInput, StorageBrowserType, DerivedActionViewType, DerivedActionViews, } from './types';
|
|
6
5
|
export { DefaultStorageBrowserDisplayText } from './displayText';
|
|
6
|
+
export { CreateStorageBrowserInput, StorageBrowserType, DerivedActionViewType, DerivedActionViews, } from './types';
|
|
7
|
+
export { UseView } from './views';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CustomActionConfigs, DefaultActionConfigs, ExtendedActionConfigs, ListLocations } from './actions';
|
|
3
3
|
import { GetLocationCredentials } from './credentials/types';
|
|
4
|
-
import { UseView } from './views/useView';
|
|
5
4
|
import { Components } from './ComponentsProvider';
|
|
6
5
|
import { RegisterAuthListener, StoreProviderProps } from './providers';
|
|
7
|
-
import { CopyViewType, CreateFolderViewType, DeleteViewType, UploadViewType, LocationActionViewType, LocationDetailViewType, LocationsViewType, Views } from './views';
|
|
6
|
+
import { CopyViewType, CreateFolderViewType, DeleteViewType, UploadViewType, LocationActionViewType, LocationDetailViewType, LocationsViewType, Views, UseView } from './views';
|
|
8
7
|
import { StorageBrowserDisplayText } from './displayText';
|
|
9
8
|
import { DerivedActionHandlers, UseAction } from './useAction';
|
|
10
9
|
export interface Config {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export { ViewsProvider, useViews } from './context';
|
|
1
2
|
export { CopyView, CopyViewType, CreateFolderView, CreateFolderViewType, DeleteView, DeleteViewType, LocationActionView, LocationActionViewProps, LocationActionViewType, UploadView, UploadViewType, } from './LocationActionView';
|
|
2
3
|
export { LocationDetailView, LocationDetailViewProps, LocationDetailViewType, } from './LocationDetailView';
|
|
3
4
|
export { LocationsView, LocationsViewProps, LocationsViewType, } from './LocationsView';
|
|
5
|
+
export { useView, UseView } from './useView';
|
|
4
6
|
export * from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
export declare const DEFAULT_VIEW_HOOKS: {
|
|
2
2
|
Copy: (options?: import("./LocationActionView/CopyView").UseCopyViewOptions | undefined) => import("./LocationActionView").CopyViewState;
|
|
3
3
|
CreateFolder: (options?: import("./LocationActionView/CreateFolderView").UseCreateFolderViewOptions | undefined) => import("./LocationActionView").CreateFolderViewState;
|
|
4
4
|
Delete: (options?: import("./LocationActionView/DeleteView").UseDeleteViewOptions | undefined) => import("./LocationActionView").DeleteViewState;
|
|
@@ -6,11 +6,11 @@ declare const USE_VIEW_HOOKS: {
|
|
|
6
6
|
Locations: (options?: import("./LocationsView/types").UseLocationsViewOptions | undefined) => import("./LocationsView/types").LocationsViewState;
|
|
7
7
|
Upload: (options?: import("./LocationActionView/UploadView").UseUploadViewOptions | undefined) => import("./LocationActionView").UploadViewState;
|
|
8
8
|
};
|
|
9
|
-
type
|
|
10
|
-
export type UseViewType = keyof
|
|
9
|
+
type DefaultViewHooks = typeof DEFAULT_VIEW_HOOKS;
|
|
10
|
+
export type UseViewType = keyof DefaultViewHooks;
|
|
11
11
|
export type ViewKey<T> = T extends Record<string, {
|
|
12
12
|
componentName?: `${infer U}View`;
|
|
13
13
|
}> ? U : T extends Record<infer K, any> ? K : never;
|
|
14
|
-
export type UseView = <K extends
|
|
14
|
+
export type UseView = <K extends UseViewType, S extends ReturnType<DefaultViewHooks[K]>>(type: K) => S;
|
|
15
15
|
export declare const useView: UseView;
|
|
16
16
|
export {};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.7.
|
|
1
|
+
export declare const VERSION = "3.7.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react-storage",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -14,12 +14,10 @@
|
|
|
14
14
|
"types": "./dist/types/components/StorageBrowser/index.d.ts",
|
|
15
15
|
"import": "./dist/esm/browser.mjs"
|
|
16
16
|
},
|
|
17
|
-
"./styles.css": "./dist/styles.css"
|
|
18
|
-
"./storage-browser-styles.css": "./dist/storage-browser-styles.css"
|
|
17
|
+
"./styles.css": "./dist/styles.css"
|
|
19
18
|
},
|
|
20
19
|
"browser": {
|
|
21
|
-
"./styles.css": "./dist/styles.css"
|
|
22
|
-
"./storage-browser-styles.css": "./dist/storage-browser-styles.css"
|
|
20
|
+
"./styles.css": "./dist/styles.css"
|
|
23
21
|
},
|
|
24
22
|
"types": "dist/types/index.d.ts",
|
|
25
23
|
"license": "Apache-2.0",
|
|
@@ -47,9 +45,9 @@
|
|
|
47
45
|
"typecheck": "tsc --noEmit"
|
|
48
46
|
},
|
|
49
47
|
"dependencies": {
|
|
50
|
-
"@aws-amplify/ui": "6.8.
|
|
51
|
-
"@aws-amplify/ui-react": "6.9.
|
|
52
|
-
"@aws-amplify/ui-react-core": "3.3.
|
|
48
|
+
"@aws-amplify/ui": "6.8.1",
|
|
49
|
+
"@aws-amplify/ui-react": "6.9.1",
|
|
50
|
+
"@aws-amplify/ui-react-core": "3.3.1",
|
|
53
51
|
"tslib": "^2.5.2"
|
|
54
52
|
},
|
|
55
53
|
"peerDependencies": {
|