@strapi/upload 5.2.0 → 5.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/_chunks/{index-l4hbqJYu.js → index-BM9Ayh_r.js} +2 -2
- package/dist/_chunks/{index-l4hbqJYu.js.map → index-BM9Ayh_r.js.map} +1 -1
- package/dist/_chunks/{index-GpFGwMho.mjs → index-BWIqjWzC.mjs} +2 -2
- package/dist/_chunks/{index-GpFGwMho.mjs.map → index-BWIqjWzC.mjs.map} +1 -1
- package/dist/_chunks/{index-DlRn6eNH.js → index-Bl2-6oC8.js} +21 -22
- package/dist/_chunks/index-Bl2-6oC8.js.map +1 -0
- package/dist/_chunks/{index-BjvAmZvH.mjs → index-BwEfHu6y.mjs} +1079 -1595
- package/dist/_chunks/index-BwEfHu6y.mjs.map +1 -0
- package/dist/_chunks/{index-D7YMYvKK.js → index-C1MSWEyZ.js} +2 -2
- package/dist/_chunks/{index-D7YMYvKK.js.map → index-C1MSWEyZ.js.map} +1 -1
- package/dist/_chunks/{index-KSVkjErL.mjs → index-C_cWV2yS.mjs} +2 -2
- package/dist/_chunks/{index-KSVkjErL.mjs.map → index-C_cWV2yS.mjs.map} +1 -1
- package/dist/_chunks/{index-Bi33Km2i.mjs → index-DCAQ4hHN.mjs} +21 -22
- package/dist/_chunks/index-DCAQ4hHN.mjs.map +1 -0
- package/dist/_chunks/{index-BHcSb0I3.js → index-YwynuEzj.js} +1077 -1593
- package/dist/_chunks/index-YwynuEzj.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/AssetCard/AssetCard.d.ts +18 -0
- package/dist/admin/src/components/AssetCard/AssetCardBase.d.ts +14 -0
- package/dist/admin/src/components/AssetCard/AudioAssetCard.d.ts +7 -0
- package/dist/admin/src/components/AssetCard/AudioPreview.d.ts +6 -0
- package/dist/admin/src/components/AssetCard/DocAssetCard.d.ts +7 -0
- package/dist/admin/src/components/AssetCard/ImageAssetCard.d.ts +12 -0
- package/dist/admin/src/components/AssetCard/UploadingAssetCard.d.ts +17 -0
- package/dist/admin/src/components/AssetCard/VideoAssetCard.d.ts +8 -0
- package/dist/admin/src/components/AssetCard/VideoPreview.d.ts +9 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/Filters.d.ts +23 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/PageSize.d.ts +6 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/Pagination.d.ts +9 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/PaginationContext.d.ts +9 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/components.d.ts +15 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/index.d.ts +9 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/SearchAsset/index.d.ts +7 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/index.d.ts +63 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/utils/isSelectable.d.ts +1 -0
- package/dist/admin/src/components/AssetDialog/DialogFooter.d.ts +6 -0
- package/dist/admin/src/components/AssetDialog/SelectedStep/index.d.ts +8 -0
- package/dist/admin/src/components/AssetDialog/index.d.ts +39 -0
- package/dist/admin/src/components/AssetGridList/Draggable.d.ts +9 -0
- package/dist/admin/src/components/AssetGridList/index.d.ts +14 -0
- package/dist/admin/src/components/Breadcrumbs/Breadcrumbs.d.ts +15 -0
- package/dist/admin/src/components/Breadcrumbs/CrumbSimpleMenuAsync.d.ts +7 -0
- package/dist/admin/src/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/admin/src/components/BulkMoveDialog/BulkMoveDialog.d.ts +15 -0
- package/dist/admin/src/components/BulkMoveDialog/index.d.ts +1 -0
- package/dist/admin/src/components/ContextInfo/ContextInfo.d.ts +8 -0
- package/dist/admin/src/components/ContextInfo/index.d.ts +1 -0
- package/dist/admin/src/components/CopyLinkButton/index.d.ts +3 -0
- package/dist/admin/src/components/EditAssetDialog/DialogHeader.d.ts +1 -0
- package/dist/admin/src/components/EditAssetDialog/PreviewBox/AssetPreview.d.ts +9 -0
- package/dist/admin/src/components/EditAssetDialog/PreviewBox/CroppingActions.d.ts +7 -0
- package/dist/admin/src/components/EditAssetDialog/PreviewBox/components.d.ts +17 -0
- package/dist/admin/src/components/EditAssetDialog/PreviewBox/index.d.ts +23 -0
- package/dist/admin/src/components/EditAssetDialog/RemoveAssetDialog.d.ts +8 -0
- package/dist/admin/src/components/EditAssetDialog/ReplaceMediaButton.d.ts +8 -0
- package/dist/admin/src/components/EditAssetDialog/index.d.ts +28 -0
- package/dist/admin/src/components/EditFolderDialog/EditFolderDialog.d.ts +10 -0
- package/dist/admin/src/components/EditFolderDialog/ModalHeader/ModalHeader.d.ts +5 -0
- package/dist/admin/src/components/EditFolderDialog/ModalHeader/index.d.ts +2 -0
- package/dist/admin/src/components/EditFolderDialog/RemoveFolderDialog.d.ts +7 -0
- package/dist/admin/src/components/EditFolderDialog/index.d.ts +1 -0
- package/dist/admin/src/components/EmptyAssets/EmptyAssetGrid.d.ts +6 -0
- package/dist/admin/src/components/EmptyAssets/index.d.ts +10 -0
- package/dist/admin/src/components/FilterList/FilterTag.d.ts +23 -0
- package/dist/admin/src/components/FilterList/index.d.ts +33 -0
- package/dist/admin/src/components/FilterPopover/FilterValueInput.d.ts +12 -0
- package/dist/admin/src/components/FilterPopover/index.d.ts +31 -0
- package/dist/admin/src/components/FilterPopover/utils/getFilterList.d.ts +21 -0
- package/dist/admin/src/components/FolderCard/FolderCard/FolderCard.d.ts +13 -0
- package/dist/admin/src/components/FolderCard/FolderCard/index.d.ts +1 -0
- package/dist/admin/src/components/FolderCard/FolderCardBody/FolderCardBody.d.ts +2 -0
- package/dist/admin/src/components/FolderCard/FolderCardBody/index.d.ts +1 -0
- package/dist/admin/src/components/FolderCard/FolderCardBodyAction/index.d.ts +7 -0
- package/dist/admin/src/components/FolderCard/FolderCardCheckbox/FolderCardCheckbox.d.ts +2 -0
- package/dist/admin/src/components/FolderCard/FolderCardCheckbox/index.d.ts +1 -0
- package/dist/admin/src/components/FolderCard/contexts/FolderCard.d.ts +7 -0
- package/dist/admin/src/components/FolderCard/index.d.ts +4 -0
- package/dist/admin/src/components/FolderGridList/FolderGridList.d.ts +7 -0
- package/dist/admin/src/components/FolderGridList/index.d.ts +1 -0
- package/dist/admin/src/components/MediaLibraryDialog/index.d.ts +9 -0
- package/dist/admin/src/components/MediaLibraryInput/Carousel/CarouselAsset.d.ts +4 -0
- package/dist/admin/src/components/MediaLibraryInput/Carousel/CarouselAssetActions.d.ts +9 -0
- package/dist/admin/src/components/MediaLibraryInput/Carousel/CarouselAssets.d.ts +22 -0
- package/dist/admin/src/components/MediaLibraryInput/Carousel/EmptyStateAsset.d.ts +10 -0
- package/dist/admin/src/components/MediaLibraryInput/index.d.ts +17 -0
- package/dist/admin/src/components/SelectTree/Option.d.ts +16 -0
- package/dist/admin/src/components/SelectTree/SelectTree.d.ts +23 -0
- package/dist/admin/src/components/SelectTree/index.d.ts +2 -0
- package/dist/admin/src/components/SelectTree/utils/getOpenValues.d.ts +9 -0
- package/dist/admin/src/components/SelectTree/utils/getValuesToClose.d.ts +6 -0
- package/dist/admin/src/components/SortPicker/index.d.ts +7 -0
- package/dist/admin/src/components/TableList/CellContent.d.ts +8 -0
- package/dist/admin/src/components/TableList/PreviewCell.d.ts +7 -0
- package/dist/admin/src/components/TableList/TableRows.d.ts +22 -0
- package/dist/admin/src/components/TableList/index.d.ts +31 -0
- package/dist/admin/src/components/UploadAssetDialog/AddAssetStep/AddAssetStep.d.ts +13 -0
- package/dist/admin/src/components/UploadAssetDialog/AddAssetStep/FromComputerForm.d.ts +8 -0
- package/dist/admin/src/components/UploadAssetDialog/AddAssetStep/FromUrlForm.d.ts +8 -0
- package/dist/admin/src/components/UploadAssetDialog/PendingAssetStep/PendingAssetStep.d.ts +22 -0
- package/dist/admin/src/components/UploadAssetDialog/UploadAssetDialog.d.ts +21 -0
- package/dist/admin/src/components/UploadProgress/index.d.ts +7 -0
- package/dist/admin/src/hooks/useBulkMove.d.ts +5 -5
- package/dist/admin/src/hooks/useBulkRemove.d.ts +17 -20
- package/dist/admin/src/hooks/useEditAsset.d.ts +4 -4
- package/dist/admin/src/hooks/useEditFolder.d.ts +4 -4
- package/dist/admin/src/hooks/useFolder.d.ts +1 -1
- package/dist/admin/src/hooks/useFolderStructure.d.ts +7 -1
- package/dist/admin/src/hooks/useMediaLibraryPermissions.d.ts +5 -1
- package/dist/admin/src/hooks/useModalQueryParams.d.ts +1 -1
- package/dist/admin/src/hooks/useUpload.d.ts +7 -4
- package/dist/admin/src/newConstants.d.ts +24 -0
- package/dist/admin/src/utils/findRecursiveFolderByValue.d.ts +3 -2
- package/dist/admin/src/utils/getAllowedFiles.d.ts +1 -2
- package/dist/admin/src/utils/getBreadcrumbDataCM.d.ts +1 -1
- package/dist/admin/src/utils/getFolderParents.d.ts +4 -3
- package/dist/admin/src/utils/moveElement.d.ts +1 -1
- package/dist/admin/src/utils/urlsToAssets.d.ts +1 -1
- package/dist/shared/contracts/files.d.ts +10 -6
- package/dist/shared/contracts/folders.d.ts +23 -2
- package/package.json +8 -8
- package/dist/_chunks/index-BHcSb0I3.js.map +0 -1
- package/dist/_chunks/index-Bi33Km2i.mjs.map +0 -1
- package/dist/_chunks/index-BjvAmZvH.mjs.map +0 -1
- package/dist/_chunks/index-DlRn6eNH.js.map +0 -1
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { BulkDeleteFiles, File } from '../../../shared/contracts/files';
|
|
2
|
-
import type { BulkDeleteFolders,
|
|
2
|
+
import type { BulkDeleteFolders, FolderDefinition } from '../../../shared/contracts/folders';
|
|
3
3
|
export interface FileWithType extends File {
|
|
4
4
|
type: string;
|
|
5
5
|
}
|
|
6
|
-
export interface FolderWithType extends Folder {
|
|
7
|
-
type: string;
|
|
8
|
-
}
|
|
9
6
|
export declare const useBulkRemove: () => {
|
|
10
|
-
remove: (variables: (
|
|
7
|
+
remove: (variables: (FolderDefinition | FileWithType)[], options?: import("react-query").MutateOptions<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown> | undefined) => Promise<BulkDeleteFiles.Response | BulkDeleteFolders.Response>;
|
|
11
8
|
data: undefined;
|
|
12
9
|
error: null;
|
|
13
10
|
isError: false;
|
|
@@ -15,15 +12,15 @@ export declare const useBulkRemove: () => {
|
|
|
15
12
|
isLoading: false;
|
|
16
13
|
isSuccess: false;
|
|
17
14
|
status: "idle";
|
|
18
|
-
mutate: import("react-query").UseMutateFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (
|
|
15
|
+
mutate: import("react-query").UseMutateFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown>;
|
|
19
16
|
reset: () => void;
|
|
20
17
|
context: unknown;
|
|
21
18
|
failureCount: number;
|
|
22
19
|
isPaused: boolean;
|
|
23
|
-
variables: (
|
|
24
|
-
mutateAsync: import("react-query").UseMutateAsyncFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (
|
|
20
|
+
variables: (FolderDefinition | FileWithType)[] | undefined;
|
|
21
|
+
mutateAsync: import("react-query").UseMutateAsyncFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown>;
|
|
25
22
|
} | {
|
|
26
|
-
remove: (variables: (
|
|
23
|
+
remove: (variables: (FolderDefinition | FileWithType)[], options?: import("react-query").MutateOptions<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown> | undefined) => Promise<BulkDeleteFiles.Response | BulkDeleteFolders.Response>;
|
|
27
24
|
data: undefined;
|
|
28
25
|
error: null;
|
|
29
26
|
isError: false;
|
|
@@ -31,15 +28,15 @@ export declare const useBulkRemove: () => {
|
|
|
31
28
|
isLoading: true;
|
|
32
29
|
isSuccess: false;
|
|
33
30
|
status: "loading";
|
|
34
|
-
mutate: import("react-query").UseMutateFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (
|
|
31
|
+
mutate: import("react-query").UseMutateFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown>;
|
|
35
32
|
reset: () => void;
|
|
36
33
|
context: unknown;
|
|
37
34
|
failureCount: number;
|
|
38
35
|
isPaused: boolean;
|
|
39
|
-
variables: (
|
|
40
|
-
mutateAsync: import("react-query").UseMutateAsyncFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (
|
|
36
|
+
variables: (FolderDefinition | FileWithType)[] | undefined;
|
|
37
|
+
mutateAsync: import("react-query").UseMutateAsyncFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown>;
|
|
41
38
|
} | {
|
|
42
|
-
remove: (variables: (
|
|
39
|
+
remove: (variables: (FolderDefinition | FileWithType)[], options?: import("react-query").MutateOptions<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown> | undefined) => Promise<BulkDeleteFiles.Response | BulkDeleteFolders.Response>;
|
|
43
40
|
data: undefined;
|
|
44
41
|
error: import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined;
|
|
45
42
|
isError: true;
|
|
@@ -47,15 +44,15 @@ export declare const useBulkRemove: () => {
|
|
|
47
44
|
isLoading: false;
|
|
48
45
|
isSuccess: false;
|
|
49
46
|
status: "error";
|
|
50
|
-
mutate: import("react-query").UseMutateFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (
|
|
47
|
+
mutate: import("react-query").UseMutateFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown>;
|
|
51
48
|
reset: () => void;
|
|
52
49
|
context: unknown;
|
|
53
50
|
failureCount: number;
|
|
54
51
|
isPaused: boolean;
|
|
55
|
-
variables: (
|
|
56
|
-
mutateAsync: import("react-query").UseMutateAsyncFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (
|
|
52
|
+
variables: (FolderDefinition | FileWithType)[] | undefined;
|
|
53
|
+
mutateAsync: import("react-query").UseMutateAsyncFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown>;
|
|
57
54
|
} | {
|
|
58
|
-
remove: (variables: (
|
|
55
|
+
remove: (variables: (FolderDefinition | FileWithType)[], options?: import("react-query").MutateOptions<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown> | undefined) => Promise<BulkDeleteFiles.Response | BulkDeleteFolders.Response>;
|
|
59
56
|
data: BulkDeleteFiles.Response | BulkDeleteFolders.Response;
|
|
60
57
|
error: null;
|
|
61
58
|
isError: false;
|
|
@@ -63,11 +60,11 @@ export declare const useBulkRemove: () => {
|
|
|
63
60
|
isLoading: false;
|
|
64
61
|
isSuccess: true;
|
|
65
62
|
status: "success";
|
|
66
|
-
mutate: import("react-query").UseMutateFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (
|
|
63
|
+
mutate: import("react-query").UseMutateFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown>;
|
|
67
64
|
reset: () => void;
|
|
68
65
|
context: unknown;
|
|
69
66
|
failureCount: number;
|
|
70
67
|
isPaused: boolean;
|
|
71
|
-
variables: (
|
|
72
|
-
mutateAsync: import("react-query").UseMutateAsyncFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (
|
|
68
|
+
variables: (FolderDefinition | FileWithType)[] | undefined;
|
|
69
|
+
mutateAsync: import("react-query").UseMutateAsyncFunction<BulkDeleteFiles.Response | BulkDeleteFolders.Response, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, (FolderDefinition | FileWithType)[], unknown>;
|
|
73
70
|
};
|
|
@@ -12,7 +12,7 @@ export declare const useEditAsset: () => {
|
|
|
12
12
|
cancel: () => void;
|
|
13
13
|
editAsset: (asset: FileAsset, file: File) => Promise<FileAsset>;
|
|
14
14
|
progress: number;
|
|
15
|
-
status: "
|
|
15
|
+
status: "loading" | "success" | "error" | "idle";
|
|
16
16
|
data: undefined;
|
|
17
17
|
error: null;
|
|
18
18
|
isError: false;
|
|
@@ -39,7 +39,7 @@ export declare const useEditAsset: () => {
|
|
|
39
39
|
cancel: () => void;
|
|
40
40
|
editAsset: (asset: FileAsset, file: File) => Promise<FileAsset>;
|
|
41
41
|
progress: number;
|
|
42
|
-
status: "
|
|
42
|
+
status: "loading" | "success" | "error" | "idle";
|
|
43
43
|
data: undefined;
|
|
44
44
|
error: null;
|
|
45
45
|
isError: false;
|
|
@@ -66,7 +66,7 @@ export declare const useEditAsset: () => {
|
|
|
66
66
|
cancel: () => void;
|
|
67
67
|
editAsset: (asset: FileAsset, file: File) => Promise<FileAsset>;
|
|
68
68
|
progress: number;
|
|
69
|
-
status: "
|
|
69
|
+
status: "loading" | "success" | "error" | "idle";
|
|
70
70
|
data: undefined;
|
|
71
71
|
error: ErrorMutation;
|
|
72
72
|
isError: true;
|
|
@@ -93,7 +93,7 @@ export declare const useEditAsset: () => {
|
|
|
93
93
|
cancel: () => void;
|
|
94
94
|
editAsset: (asset: FileAsset, file: File) => Promise<FileAsset>;
|
|
95
95
|
progress: number;
|
|
96
|
-
status: "
|
|
96
|
+
status: "loading" | "success" | "error" | "idle";
|
|
97
97
|
data: FileAsset;
|
|
98
98
|
error: null;
|
|
99
99
|
isError: false;
|
|
@@ -5,7 +5,7 @@ interface EditFolderRequestParams {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const useEditFolder: () => {
|
|
7
7
|
editFolder: (attrs: EditFolderRequestParams['attrs'], id?: EditFolderRequestParams['id']) => Promise<import("../../../shared/contracts/folders").Folder>;
|
|
8
|
-
status: "
|
|
8
|
+
status: "loading" | "success" | "error" | "idle";
|
|
9
9
|
data: undefined;
|
|
10
10
|
error: null;
|
|
11
11
|
isError: false;
|
|
@@ -21,7 +21,7 @@ export declare const useEditFolder: () => {
|
|
|
21
21
|
mutateAsync: import("react-query").UseMutateAsyncFunction<import("../../../shared/contracts/folders").Folder, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").NotFoundError<string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, EditFolderRequestParams, unknown>;
|
|
22
22
|
} | {
|
|
23
23
|
editFolder: (attrs: EditFolderRequestParams['attrs'], id?: EditFolderRequestParams['id']) => Promise<import("../../../shared/contracts/folders").Folder>;
|
|
24
|
-
status: "
|
|
24
|
+
status: "loading" | "success" | "error" | "idle";
|
|
25
25
|
data: undefined;
|
|
26
26
|
error: null;
|
|
27
27
|
isError: false;
|
|
@@ -37,7 +37,7 @@ export declare const useEditFolder: () => {
|
|
|
37
37
|
mutateAsync: import("react-query").UseMutateAsyncFunction<import("../../../shared/contracts/folders").Folder, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").NotFoundError<string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, EditFolderRequestParams, unknown>;
|
|
38
38
|
} | {
|
|
39
39
|
editFolder: (attrs: EditFolderRequestParams['attrs'], id?: EditFolderRequestParams['id']) => Promise<import("../../../shared/contracts/folders").Folder>;
|
|
40
|
-
status: "
|
|
40
|
+
status: "loading" | "success" | "error" | "idle";
|
|
41
41
|
data: undefined;
|
|
42
42
|
error: import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").NotFoundError<string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined;
|
|
43
43
|
isError: true;
|
|
@@ -53,7 +53,7 @@ export declare const useEditFolder: () => {
|
|
|
53
53
|
mutateAsync: import("react-query").UseMutateAsyncFunction<import("../../../shared/contracts/folders").Folder, import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").NotFoundError<string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | undefined, EditFolderRequestParams, unknown>;
|
|
54
54
|
} | {
|
|
55
55
|
editFolder: (attrs: EditFolderRequestParams['attrs'], id?: EditFolderRequestParams['id']) => Promise<import("../../../shared/contracts/folders").Folder>;
|
|
56
|
-
status: "
|
|
56
|
+
status: "loading" | "success" | "error" | "idle";
|
|
57
57
|
data: import("../../../shared/contracts/folders").Folder;
|
|
58
58
|
error: null;
|
|
59
59
|
isError: false;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { FolderNode } from '../../../shared/contracts/folders';
|
|
2
|
+
interface FolderNodeWithChildren extends Omit<FolderNode, 'children'> {
|
|
3
|
+
children: FolderNodeWithChildren[];
|
|
4
|
+
label?: string;
|
|
5
|
+
value: string | number | null;
|
|
6
|
+
}
|
|
2
7
|
export declare const useFolderStructure: ({ enabled }?: {
|
|
3
8
|
enabled?: boolean | undefined;
|
|
4
9
|
}) => {
|
|
5
10
|
data: {
|
|
6
11
|
value: null;
|
|
7
12
|
label: string;
|
|
8
|
-
children: import("./utils/rename-keys").DeepRecord<
|
|
13
|
+
children: import("./utils/rename-keys").DeepRecord<FolderNodeWithChildren>[];
|
|
9
14
|
}[] | undefined;
|
|
10
15
|
error: unknown;
|
|
11
16
|
isLoading: boolean;
|
|
12
17
|
};
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { useRBAC } from '@strapi/admin/strapi-admin';
|
|
2
|
+
type UseRBACReturnType = ReturnType<typeof useRBAC>;
|
|
3
|
+
type AllowedActionsType = UseRBACReturnType['allowedActions'];
|
|
4
|
+
export declare const useMediaLibraryPermissions: () => AllowedActionsType & {
|
|
2
5
|
isLoading: boolean;
|
|
3
6
|
};
|
|
7
|
+
export {};
|
|
@@ -14,7 +14,7 @@ declare const useModalQueryParams: (initialState?: Partial<Query>) => ({
|
|
|
14
14
|
onChangePage: (page: Query['page']) => void;
|
|
15
15
|
onChangePageSize: (pageSize: Query['pageSize']) => void;
|
|
16
16
|
onChangeSort: (sort: Query['sort']) => void;
|
|
17
|
-
onChangeSearch: (_q: Query['_q']) => void;
|
|
17
|
+
onChangeSearch: (_q: Query['_q'] | null) => void;
|
|
18
18
|
queryObject?: undefined;
|
|
19
19
|
rawQuery?: undefined;
|
|
20
20
|
})[];
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { File, RawFile } from '../../../shared/contracts/files';
|
|
2
|
-
interface Asset extends File {
|
|
3
|
-
rawFile
|
|
2
|
+
interface Asset extends Omit<File, 'id' | 'hash'> {
|
|
3
|
+
rawFile?: RawFile;
|
|
4
|
+
id?: File['id'];
|
|
5
|
+
hash?: File['hash'];
|
|
4
6
|
}
|
|
5
7
|
export declare const useUpload: () => {
|
|
6
|
-
upload: (asset: Asset, folderId: number) => Promise<File[]>;
|
|
8
|
+
upload: (asset: Asset, folderId: number | null) => Promise<File[]>;
|
|
9
|
+
isLoading: boolean;
|
|
7
10
|
cancel: () => void;
|
|
8
11
|
error: import("@strapi/utils/dist/errors").ApplicationError<"ApplicationError", string, unknown> | import("@strapi/utils/dist/errors").ValidationError<string, unknown> | null | undefined;
|
|
9
12
|
progress: number;
|
|
10
|
-
status: "
|
|
13
|
+
status: "loading" | "success" | "error" | "idle";
|
|
11
14
|
};
|
|
12
15
|
export {};
|
|
@@ -43,3 +43,27 @@ export declare const PERMISSIONS: {
|
|
|
43
43
|
fields: null;
|
|
44
44
|
}[];
|
|
45
45
|
};
|
|
46
|
+
export declare const tableHeaders: {
|
|
47
|
+
name: string;
|
|
48
|
+
key: string;
|
|
49
|
+
metadatas: {
|
|
50
|
+
label: {
|
|
51
|
+
id: string;
|
|
52
|
+
defaultMessage: string;
|
|
53
|
+
};
|
|
54
|
+
isSortable: boolean;
|
|
55
|
+
};
|
|
56
|
+
type: string;
|
|
57
|
+
}[];
|
|
58
|
+
export declare const sortOptions: {
|
|
59
|
+
key: string;
|
|
60
|
+
value: string;
|
|
61
|
+
}[];
|
|
62
|
+
export declare const localStorageKeys: {
|
|
63
|
+
modalView: string;
|
|
64
|
+
view: string;
|
|
65
|
+
};
|
|
66
|
+
export declare const viewOptions: {
|
|
67
|
+
GRID: number;
|
|
68
|
+
LIST: number;
|
|
69
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { FolderNode } from '../../../shared/contracts/folders';
|
|
2
2
|
interface FolderStructureValue extends Omit<FolderNode, 'children'> {
|
|
3
|
-
value
|
|
3
|
+
value?: string | number | null;
|
|
4
4
|
children?: FolderStructureValue[];
|
|
5
|
+
label?: string;
|
|
5
6
|
}
|
|
6
7
|
type Value = number | null | {
|
|
7
8
|
value: number | null;
|
|
8
9
|
};
|
|
9
|
-
export declare function findRecursiveFolderByValue(data: FolderStructureValue[], value: Value): undefined;
|
|
10
|
+
export declare function findRecursiveFolderByValue(data: FolderStructureValue[], value: Value): FolderStructureValue | undefined;
|
|
10
11
|
export {};
|
|
@@ -5,11 +5,10 @@ import type { File } from '../../../shared/contracts/files';
|
|
|
5
5
|
* @param {Object[]} files Array of files
|
|
6
6
|
* @returns Object[]
|
|
7
7
|
*/
|
|
8
|
-
interface AllowedFiles extends File {
|
|
8
|
+
export interface AllowedFiles extends File {
|
|
9
9
|
documentId: string;
|
|
10
10
|
isSelectable: boolean;
|
|
11
11
|
locale: string | null;
|
|
12
12
|
type: string;
|
|
13
13
|
}
|
|
14
14
|
export declare const getAllowedFiles: (pluralTypes: string[], files: AllowedFiles[]) => AllowedFiles[];
|
|
15
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Folder } from '../../../shared/contracts/folders';
|
|
2
2
|
import type { MessageDescriptor } from 'react-intl';
|
|
3
|
-
interface BreadcrumbDataFolder extends Omit<Folder, 'children' | 'files' | 'parent'> {
|
|
3
|
+
export interface BreadcrumbDataFolder extends Omit<Folder, 'children' | 'files' | 'parent'> {
|
|
4
4
|
parent?: BreadcrumbDataFolder;
|
|
5
5
|
children?: {
|
|
6
6
|
count: number;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { FolderNode } from '../../../shared/contracts/folders';
|
|
2
2
|
interface FolderStructureValue extends Omit<FolderNode, 'children'> {
|
|
3
|
-
value: number | null;
|
|
3
|
+
value: string | number | null;
|
|
4
4
|
children?: FolderStructureValue[];
|
|
5
5
|
}
|
|
6
6
|
export declare const getFolderParents: (folders: FolderStructureValue[], currentFolderId: number) => {
|
|
7
|
-
id
|
|
8
|
-
label
|
|
7
|
+
id?: string | number | null | undefined;
|
|
8
|
+
label?: string | undefined;
|
|
9
|
+
path?: string | undefined;
|
|
9
10
|
}[];
|
|
10
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const moveElement: (array:
|
|
1
|
+
export declare const moveElement: <T = number>(array: T[], index: number, offset: number) => T[];
|
|
@@ -44,21 +44,25 @@ export interface File {
|
|
|
44
44
|
name: string;
|
|
45
45
|
alternativeText?: string | null;
|
|
46
46
|
caption?: string | null;
|
|
47
|
-
width?: number;
|
|
48
|
-
height?: number;
|
|
49
|
-
formats?: Record<string, FileFormat
|
|
47
|
+
width?: number | null;
|
|
48
|
+
height?: number | null;
|
|
49
|
+
formats?: Record<string, FileFormat> | {
|
|
50
|
+
thumbnail: {
|
|
51
|
+
url: string;
|
|
52
|
+
};
|
|
53
|
+
} | null;
|
|
50
54
|
hash: string;
|
|
51
55
|
ext?: string;
|
|
52
56
|
mime?: string;
|
|
53
57
|
size?: number;
|
|
54
58
|
sizeInBytes?: number;
|
|
55
59
|
url?: string;
|
|
56
|
-
previewUrl?: string;
|
|
60
|
+
previewUrl?: string | null;
|
|
57
61
|
path?: string | null;
|
|
58
62
|
provider?: string;
|
|
59
|
-
provider_metadata?: Record<string, unknown
|
|
63
|
+
provider_metadata?: Record<string, unknown> | null;
|
|
60
64
|
isUrlSigned?: boolean;
|
|
61
|
-
folder?: number | null;
|
|
65
|
+
folder?: number | string | null;
|
|
62
66
|
folderPath?: string;
|
|
63
67
|
related?: {
|
|
64
68
|
id: string | number;
|
|
@@ -2,6 +2,22 @@ import { errors } from '@strapi/utils';
|
|
|
2
2
|
export type SortOrder = 'ASC' | 'DESC';
|
|
3
3
|
export type SortKey = 'createdAt' | 'name' | 'updatedAt';
|
|
4
4
|
import type { File } from './files';
|
|
5
|
+
export interface FolderDefinition extends Omit<Folder, 'children' | 'files' | 'parent'> {
|
|
6
|
+
children?: {
|
|
7
|
+
count: number;
|
|
8
|
+
};
|
|
9
|
+
createdAt?: string;
|
|
10
|
+
documentId?: string;
|
|
11
|
+
files?: {
|
|
12
|
+
count: number;
|
|
13
|
+
};
|
|
14
|
+
folderUrl?: string;
|
|
15
|
+
isSelectable?: boolean;
|
|
16
|
+
locale?: string | null;
|
|
17
|
+
publishedAt?: string;
|
|
18
|
+
type: string;
|
|
19
|
+
updatedAt?: string;
|
|
20
|
+
}
|
|
5
21
|
export interface Folder {
|
|
6
22
|
id: number;
|
|
7
23
|
name: string;
|
|
@@ -20,6 +36,10 @@ export interface Folder {
|
|
|
20
36
|
export type FolderNode = Partial<Omit<Folder, 'children'>> & {
|
|
21
37
|
children: FolderNode[];
|
|
22
38
|
};
|
|
39
|
+
type FolderNodeWithValue = Omit<FolderNode, 'children'> & {
|
|
40
|
+
value: string | number | null;
|
|
41
|
+
children: FolderNodeWithValue[];
|
|
42
|
+
};
|
|
23
43
|
/**
|
|
24
44
|
* GET /upload/folders/:id - Get specific folder
|
|
25
45
|
*/
|
|
@@ -94,7 +114,7 @@ export declare namespace GetFolderStructure {
|
|
|
94
114
|
}
|
|
95
115
|
interface Response {
|
|
96
116
|
data: {
|
|
97
|
-
data: number[] &
|
|
117
|
+
data: number[] & FolderNodeWithValue[];
|
|
98
118
|
};
|
|
99
119
|
error?: errors.ApplicationError | errors.NotFoundError;
|
|
100
120
|
}
|
|
@@ -112,7 +132,7 @@ export declare namespace BulkDeleteFolders {
|
|
|
112
132
|
data: {
|
|
113
133
|
data: {
|
|
114
134
|
files: [];
|
|
115
|
-
folders:
|
|
135
|
+
folders: FolderDefinition[];
|
|
116
136
|
};
|
|
117
137
|
};
|
|
118
138
|
error?: errors.ApplicationError | errors.ValidationError;
|
|
@@ -138,3 +158,4 @@ export declare namespace BulkMoveFolders {
|
|
|
138
158
|
error?: errors.ApplicationError | errors.ValidationError;
|
|
139
159
|
}
|
|
140
160
|
}
|
|
161
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/upload",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Makes it easy to upload images and files to your Strapi Application.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"watch": "pack-up watch"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@strapi/design-system": "2.0.0-rc.
|
|
60
|
-
"@strapi/icons": "2.0.0-rc.
|
|
61
|
-
"@strapi/provider-upload-local": "5.
|
|
62
|
-
"@strapi/utils": "5.
|
|
59
|
+
"@strapi/design-system": "2.0.0-rc.12",
|
|
60
|
+
"@strapi/icons": "2.0.0-rc.12",
|
|
61
|
+
"@strapi/provider-upload-local": "5.3.0",
|
|
62
|
+
"@strapi/utils": "5.3.0",
|
|
63
63
|
"byte-size": "8.1.1",
|
|
64
64
|
"cropperjs": "1.6.1",
|
|
65
65
|
"date-fns": "2.30.0",
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
"yup": "0.32.9"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@strapi/admin": "5.
|
|
84
|
+
"@strapi/admin": "5.3.0",
|
|
85
85
|
"@strapi/pack-up": "5.0.0",
|
|
86
|
-
"@strapi/types": "5.
|
|
86
|
+
"@strapi/types": "5.3.0",
|
|
87
87
|
"@testing-library/dom": "10.1.0",
|
|
88
88
|
"@testing-library/react": "15.0.7",
|
|
89
89
|
"@testing-library/user-event": "14.5.2",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"required": true,
|
|
120
120
|
"kind": "plugin"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "a83471de7de7757b0e50c1b4cbb84b01028ba5d1"
|
|
123
123
|
}
|