@strapi/upload 5.51.2 → 5.52.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/admin/future/App.js +3 -3
- package/dist/admin/future/App.js.map +1 -1
- package/dist/admin/future/App.mjs +4 -4
- package/dist/admin/future/App.mjs.map +1 -1
- package/dist/admin/future/components/BetaNotice.js +72 -0
- package/dist/admin/future/components/BetaNotice.js.map +1 -0
- package/dist/admin/future/components/BetaNotice.mjs +70 -0
- package/dist/admin/future/components/BetaNotice.mjs.map +1 -0
- package/dist/admin/future/components/Drawer.js +16 -3
- package/dist/admin/future/components/Drawer.js.map +1 -1
- package/dist/admin/future/components/Drawer.mjs +16 -3
- package/dist/admin/future/components/Drawer.mjs.map +1 -1
- package/dist/admin/future/hooks/useAIMetadataEnabled.js +39 -0
- package/dist/admin/future/hooks/useAIMetadataEnabled.js.map +1 -0
- package/dist/admin/future/hooks/useAIMetadataEnabled.mjs +37 -0
- package/dist/admin/future/hooks/useAIMetadataEnabled.mjs.map +1 -0
- package/dist/admin/future/pages/Assets/AssetsPage.js +297 -139
- package/dist/admin/future/pages/Assets/AssetsPage.js.map +1 -1
- package/dist/admin/future/pages/Assets/AssetsPage.mjs +301 -143
- package/dist/admin/future/pages/Assets/AssetsPage.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/ActionsMenuContent.js +46 -0
- package/dist/admin/future/pages/Assets/components/ActionsMenuContent.js.map +1 -0
- package/dist/admin/future/pages/Assets/components/ActionsMenuContent.mjs +44 -0
- package/dist/admin/future/pages/Assets/components/ActionsMenuContent.mjs.map +1 -0
- package/dist/admin/future/pages/Assets/components/AssetActionsMenu.js +325 -0
- package/dist/admin/future/pages/Assets/components/AssetActionsMenu.js.map +1 -0
- package/dist/admin/future/pages/Assets/components/AssetActionsMenu.mjs +323 -0
- package/dist/admin/future/pages/Assets/components/AssetActionsMenu.mjs.map +1 -0
- package/dist/admin/future/pages/Assets/components/AssetDetails/AssetCropEditor.js +35 -14
- package/dist/admin/future/pages/Assets/components/AssetDetails/AssetCropEditor.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetDetails/AssetCropEditor.mjs +35 -14
- package/dist/admin/future/pages/Assets/components/AssetDetails/AssetCropEditor.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.js +54 -53
- package/dist/admin/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.mjs +54 -54
- package/dist/admin/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetsGrid.js +89 -24
- package/dist/admin/future/pages/Assets/components/AssetsGrid.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetsGrid.mjs +91 -26
- package/dist/admin/future/pages/Assets/components/AssetsGrid.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetsSearchInput.js +15 -3
- package/dist/admin/future/pages/Assets/components/AssetsSearchInput.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetsSearchInput.mjs +16 -4
- package/dist/admin/future/pages/Assets/components/AssetsSearchInput.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetsTable.js +168 -58
- package/dist/admin/future/pages/Assets/components/AssetsTable.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/AssetsTable.mjs +171 -61
- package/dist/admin/future/pages/Assets/components/AssetsTable.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/BulkActionsBar.js +64 -132
- package/dist/admin/future/pages/Assets/components/BulkActionsBar.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/BulkActionsBar.mjs +64 -132
- package/dist/admin/future/pages/Assets/components/BulkActionsBar.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/BulkMoveDialog.js +123 -76
- package/dist/admin/future/pages/Assets/components/BulkMoveDialog.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/BulkMoveDialog.mjs +126 -79
- package/dist/admin/future/pages/Assets/components/BulkMoveDialog.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/BusyOverlay.js +36 -0
- package/dist/admin/future/pages/Assets/components/BusyOverlay.js.map +1 -0
- package/dist/admin/future/pages/Assets/components/BusyOverlay.mjs +34 -0
- package/dist/admin/future/pages/Assets/components/BusyOverlay.mjs.map +1 -0
- package/dist/admin/future/pages/Assets/components/DeleteItemsDialog.js +131 -0
- package/dist/admin/future/pages/Assets/components/DeleteItemsDialog.js.map +1 -0
- package/dist/admin/future/pages/Assets/components/DeleteItemsDialog.mjs +129 -0
- package/dist/admin/future/pages/Assets/components/DeleteItemsDialog.mjs.map +1 -0
- package/dist/admin/future/pages/Assets/components/Dnd/AssetsDndProvider.js +27 -17
- package/dist/admin/future/pages/Assets/components/Dnd/AssetsDndProvider.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/Dnd/AssetsDndProvider.mjs +28 -18
- package/dist/admin/future/pages/Assets/components/Dnd/AssetsDndProvider.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/Dnd/buildDragSet.js +28 -31
- package/dist/admin/future/pages/Assets/components/Dnd/buildDragSet.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/Dnd/buildDragSet.mjs +28 -31
- package/dist/admin/future/pages/Assets/components/Dnd/buildDragSet.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/Dnd/useAssetDnd.js +10 -15
- package/dist/admin/future/pages/Assets/components/Dnd/useAssetDnd.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/Dnd/useAssetDnd.mjs +10 -15
- package/dist/admin/future/pages/Assets/components/Dnd/useAssetDnd.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/FilterBadges.js +13 -4
- package/dist/admin/future/pages/Assets/components/FilterBadges.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/FilterBadges.mjs +13 -4
- package/dist/admin/future/pages/Assets/components/FilterBadges.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/FilterMenu.js +241 -61
- package/dist/admin/future/pages/Assets/components/FilterMenu.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/FilterMenu.mjs +244 -64
- package/dist/admin/future/pages/Assets/components/FilterMenu.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/components/FolderActionsMenu.js +144 -0
- package/dist/admin/future/pages/Assets/components/FolderActionsMenu.js.map +1 -0
- package/dist/admin/future/pages/Assets/components/FolderActionsMenu.mjs +142 -0
- package/dist/admin/future/pages/Assets/components/FolderActionsMenu.mjs.map +1 -0
- package/dist/admin/future/pages/Assets/components/{CreateFolderDialog.js → FolderFormDialog.js} +50 -16
- package/dist/admin/future/pages/Assets/components/FolderFormDialog.js.map +1 -0
- package/dist/admin/future/pages/Assets/components/{CreateFolderDialog.mjs → FolderFormDialog.mjs} +52 -18
- package/dist/admin/future/pages/Assets/components/FolderFormDialog.mjs.map +1 -0
- package/dist/admin/future/pages/Assets/components/FolderTree/FolderTree.js +111 -191
- package/dist/admin/future/pages/Assets/components/FolderTree/FolderTree.js.map +1 -1
- package/dist/admin/future/pages/Assets/components/FolderTree/FolderTree.mjs +114 -194
- package/dist/admin/future/pages/Assets/components/FolderTree/FolderTree.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/hooks/useBusyAssets.js +47 -0
- package/dist/admin/future/pages/Assets/hooks/useBusyAssets.js.map +1 -0
- package/dist/admin/future/pages/Assets/hooks/useBusyAssets.mjs +44 -0
- package/dist/admin/future/pages/Assets/hooks/useBusyAssets.mjs.map +1 -0
- package/dist/admin/future/pages/Assets/hooks/useInfiniteAssets.js +203 -62
- package/dist/admin/future/pages/Assets/hooks/useInfiniteAssets.js.map +1 -1
- package/dist/admin/future/pages/Assets/hooks/useInfiniteAssets.mjs +204 -63
- package/dist/admin/future/pages/Assets/hooks/useInfiniteAssets.mjs.map +1 -1
- package/dist/admin/future/pages/Assets/hooks/useInfiniteScrollSentinel.js +75 -0
- package/dist/admin/future/pages/Assets/hooks/useInfiniteScrollSentinel.js.map +1 -0
- package/dist/admin/future/pages/Assets/hooks/useInfiniteScrollSentinel.mjs +73 -0
- package/dist/admin/future/pages/Assets/hooks/useInfiniteScrollSentinel.mjs.map +1 -0
- package/dist/admin/future/services/api.js +24 -0
- package/dist/admin/future/services/api.js.map +1 -1
- package/dist/admin/future/services/api.mjs +24 -0
- package/dist/admin/future/services/api.mjs.map +1 -1
- package/dist/admin/future/services/assets.js +11 -0
- package/dist/admin/future/services/assets.js.map +1 -1
- package/dist/admin/future/services/assets.mjs +11 -0
- package/dist/admin/future/services/assets.mjs.map +1 -1
- package/dist/admin/future/services/folders.js +37 -2
- package/dist/admin/future/services/folders.js.map +1 -1
- package/dist/admin/future/services/folders.mjs +37 -3
- package/dist/admin/future/services/folders.mjs.map +1 -1
- package/dist/admin/future/utils/buildDragSetFromSelection.js +7 -5
- package/dist/admin/future/utils/buildDragSetFromSelection.js.map +1 -1
- package/dist/admin/future/utils/buildDragSetFromSelection.mjs +7 -5
- package/dist/admin/future/utils/buildDragSetFromSelection.mjs.map +1 -1
- package/dist/admin/future/utils/formatMoveSuccessMessage.js +12 -1
- package/dist/admin/future/utils/formatMoveSuccessMessage.js.map +1 -1
- package/dist/admin/future/utils/formatMoveSuccessMessage.mjs +12 -1
- package/dist/admin/future/utils/formatMoveSuccessMessage.mjs.map +1 -1
- package/dist/admin/future/utils/getRelationId.js +24 -0
- package/dist/admin/future/utils/getRelationId.js.map +1 -0
- package/dist/admin/future/utils/getRelationId.mjs +22 -0
- package/dist/admin/future/utils/getRelationId.mjs.map +1 -0
- package/dist/admin/future/utils/isEventFromWithin.js +14 -0
- package/dist/admin/future/utils/isEventFromWithin.js.map +1 -0
- package/dist/admin/future/utils/isEventFromWithin.mjs +12 -0
- package/dist/admin/future/utils/isEventFromWithin.mjs.map +1 -0
- package/dist/admin/future/utils/itemLocations.js +40 -0
- package/dist/admin/future/utils/itemLocations.js.map +1 -0
- package/dist/admin/future/utils/itemLocations.mjs +36 -0
- package/dist/admin/future/utils/itemLocations.mjs.map +1 -0
- package/dist/admin/future/utils/itemSource.js +36 -0
- package/dist/admin/future/utils/itemSource.js.map +1 -0
- package/dist/admin/future/utils/itemSource.mjs +32 -0
- package/dist/admin/future/utils/itemSource.mjs.map +1 -0
- package/dist/admin/index.js +11 -17
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +12 -18
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/src/future/App.d.ts +1 -1
- package/dist/admin/src/future/components/BetaNotice.d.ts +11 -0
- package/dist/admin/src/future/components/Drawer.d.ts +5 -1
- package/dist/admin/src/future/hooks/useAIMetadataEnabled.d.ts +26 -0
- package/dist/admin/src/future/pages/Assets/components/ActionsMenuContent.d.ts +33 -0
- package/dist/admin/src/future/pages/Assets/components/AssetActionsMenu.d.ts +24 -0
- package/dist/admin/src/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.d.ts +16 -0
- package/dist/admin/src/future/pages/Assets/components/BulkActionsBar.d.ts +8 -1
- package/dist/admin/src/future/pages/Assets/components/BulkMoveDialog.d.ts +17 -6
- package/dist/admin/src/future/pages/Assets/components/BusyOverlay.d.ts +9 -0
- package/dist/admin/src/future/pages/Assets/components/DeleteItemsDialog.d.ts +27 -0
- package/dist/admin/src/future/pages/Assets/components/Dnd/AssetsDndProvider.d.ts +8 -1
- package/dist/admin/src/future/pages/Assets/components/Dnd/buildDragSet.d.ts +18 -3
- package/dist/admin/src/future/pages/Assets/components/Dnd/useAssetDnd.d.ts +2 -1
- package/dist/admin/src/future/pages/Assets/components/FilterBadges.d.ts +3 -1
- package/dist/admin/src/future/pages/Assets/components/FilterMenu.d.ts +4 -0
- package/dist/admin/src/future/pages/Assets/components/FolderActionsMenu.d.ts +20 -0
- package/dist/admin/src/future/pages/Assets/components/FolderFormDialog.d.ts +16 -0
- package/dist/admin/src/future/pages/Assets/hooks/useBusyAssets.d.ts +38 -0
- package/dist/admin/src/future/pages/Assets/hooks/useInfiniteAssets.d.ts +20 -6
- package/dist/admin/src/future/pages/Assets/hooks/useInfiniteScrollSentinel.d.ts +41 -0
- package/dist/admin/src/future/services/folders.d.ts +6 -1
- package/dist/admin/src/future/utils/buildDragSetFromSelection.d.ts +4 -3
- package/dist/admin/src/future/utils/formatMoveSuccessMessage.d.ts +7 -1
- package/dist/admin/src/future/utils/getRelationId.d.ts +11 -0
- package/dist/admin/src/future/utils/isEventFromWithin.d.ts +11 -0
- package/dist/admin/src/future/utils/itemLocations.d.ts +31 -0
- package/dist/admin/src/future/utils/itemSource.d.ts +22 -0
- package/dist/admin/translations/en.json.js +25 -4
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +25 -4
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/server/services/image-manipulation.js.map +1 -1
- package/dist/server/services/image-manipulation.mjs.map +1 -1
- package/dist/server/src/services/image-manipulation.d.ts +0 -5
- package/dist/server/src/services/image-manipulation.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/admin/future/pages/Assets/components/CreateFolderDialog.js.map +0 -1
- package/dist/admin/future/pages/Assets/components/CreateFolderDialog.mjs.map +0 -1
- package/dist/admin/future/pages/Assets/components/FolderTree/filterFolderTree.js +0 -33
- package/dist/admin/future/pages/Assets/components/FolderTree/filterFolderTree.js.map +0 -1
- package/dist/admin/future/pages/Assets/components/FolderTree/filterFolderTree.mjs +0 -31
- package/dist/admin/future/pages/Assets/components/FolderTree/filterFolderTree.mjs.map +0 -1
- package/dist/admin/src/future/pages/Assets/components/CreateFolderDialog.d.ts +0 -8
- package/dist/admin/src/future/pages/Assets/components/FolderTree/filterFolderTree.d.ts +0 -16
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ItemLocations } from '../../../utils/itemLocations';
|
|
1
2
|
import type { File } from '../../../../../../shared/contracts/files';
|
|
2
3
|
interface BulkActionsBarProps {
|
|
3
4
|
/**
|
|
@@ -9,6 +10,12 @@ interface BulkActionsBarProps {
|
|
|
9
10
|
* every selected asset id is guaranteed to appear here.
|
|
10
11
|
*/
|
|
11
12
|
assets?: File[];
|
|
13
|
+
/**
|
|
14
|
+
* Real location of every loaded row, so the move dialog validates each
|
|
15
|
+
* selected item against its own parent. Defaults to a lookup that misses
|
|
16
|
+
* everything, which falls back to the folder currently open.
|
|
17
|
+
*/
|
|
18
|
+
locations?: ItemLocations;
|
|
12
19
|
}
|
|
13
|
-
export declare const BulkActionsBar: ({ assets }: BulkActionsBarProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
20
|
+
export declare const BulkActionsBar: ({ assets, locations, }: BulkActionsBarProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
21
|
export {};
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import type { DragItemData } from '../../../types/dnd';
|
|
1
2
|
interface BulkMoveDialogProps {
|
|
2
3
|
open: boolean;
|
|
3
4
|
onClose: () => void;
|
|
5
|
+
/**
|
|
6
|
+
* Items to move, as drag data so destination validation sees each item's real
|
|
7
|
+
* parent — the current folder is not a reliable stand-in once results come
|
|
8
|
+
* from a global search.
|
|
9
|
+
*/
|
|
10
|
+
items: DragItemData[];
|
|
11
|
+
onSuccess?: () => void;
|
|
4
12
|
}
|
|
5
13
|
/**
|
|
6
|
-
* "Move elements to" modal
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* folder
|
|
10
|
-
*
|
|
14
|
+
* "Move elements to" modal. Moves the given items (assets and/or folders) into
|
|
15
|
+
* the picked destination folder via `POST /upload/actions/bulk-move`. The
|
|
16
|
+
* mutation invalidates the asset list, folder list and the sidebar
|
|
17
|
+
* folder-structure, so both panes refresh on success. On failure the modal stays
|
|
18
|
+
* open so the user can retry or cancel.
|
|
19
|
+
*
|
|
20
|
+
* Used both by the bulk actions bar (the whole selection) and by a folder's
|
|
21
|
+
* actions menu (that one folder).
|
|
11
22
|
*/
|
|
12
|
-
export declare const BulkMoveDialog: ({ open, onClose }: BulkMoveDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const BulkMoveDialog: ({ open, onClose, items, onSuccess }: BulkMoveDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
24
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface BusyOverlayProps {
|
|
2
|
+
/** Shown next to the spinner, and read out as the loader's accessible label. */
|
|
3
|
+
children: string;
|
|
4
|
+
zIndex?: number;
|
|
5
|
+
/** Hides the label, leaving the spinner — for containers too small to fit text. */
|
|
6
|
+
hideLabel?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const BusyOverlay: ({ children, zIndex, hideLabel }: BusyOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface DeleteItemsDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
/** Explicit delete target — assets and/or folders, by id. */
|
|
5
|
+
target: {
|
|
6
|
+
fileIds: number[];
|
|
7
|
+
folderIds: number[];
|
|
8
|
+
};
|
|
9
|
+
/** Called after a successful delete, before the toast. */
|
|
10
|
+
onSuccess?: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Mirrors the in-flight state out to the caller, so a host that has its own
|
|
13
|
+
* controls (the bulk actions bar) can disable them for the duration.
|
|
14
|
+
*/
|
|
15
|
+
onPendingChange?: (pending: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Confirm dialog for `POST /upload/actions/bulk-delete`. Fully controlled: the
|
|
19
|
+
* caller owns `open` and renders its own trigger. Shared by the bulk actions bar
|
|
20
|
+
* (selection-scoped) and the per-folder actions menu (item-scoped), so the
|
|
21
|
+
* target is always passed in explicitly rather than read from the selection.
|
|
22
|
+
*
|
|
23
|
+
* Deleting a folder cascades server-side, which is why the copy warns about
|
|
24
|
+
* folder contents even for a single item.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DeleteItemsDialog: ({ open, onClose, target, onSuccess, onPendingChange, }: DeleteItemsDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ItemLocations } from '../../../../utils/itemLocations';
|
|
2
3
|
interface AssetsDndContextValue {
|
|
3
4
|
isInternalDragActive: boolean;
|
|
4
5
|
isMovePending: boolean;
|
|
@@ -9,6 +10,12 @@ export declare const useAssetsDnd: () => AssetsDndContextValue;
|
|
|
9
10
|
export declare const useAssetsDndOptional: () => AssetsDndContextValue | null;
|
|
10
11
|
interface AssetsDndProviderProps {
|
|
11
12
|
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Real location of every loaded row, so a multi-item drag validates against
|
|
15
|
+
* each item's own parent. Defaults to a lookup that misses everything, which
|
|
16
|
+
* falls back to the folder currently open.
|
|
17
|
+
*/
|
|
18
|
+
locations?: ItemLocations;
|
|
12
19
|
}
|
|
13
|
-
export declare const AssetsDndProvider: ({ children }: AssetsDndProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const AssetsDndProvider: ({ children, locations, }: AssetsDndProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
21
|
export {};
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
import { type ItemLocations } from '../../../../utils/itemLocations';
|
|
1
2
|
import { type ItemKey } from '../../utils/selection';
|
|
2
3
|
import type { DragItemData } from '../../../../types/dnd';
|
|
3
4
|
export interface DragSet {
|
|
4
5
|
items: DragItemData[];
|
|
5
6
|
/** True when the active item was already selected — membership is the full selection. */
|
|
6
7
|
fromSelection: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Location of the row the user actually grabbed — the only item in the set
|
|
10
|
+
* whose origin the user can point at. Names the source in the success toast.
|
|
11
|
+
*/
|
|
12
|
+
activeSourceFolderId: number | null;
|
|
13
|
+
/**
|
|
14
|
+
* True when the set spans more than one source folder, which a global search
|
|
15
|
+
* selection can. There is then no single source to name, so the toast has to
|
|
16
|
+
* drop it rather than pick one item's folder and imply the others came from
|
|
17
|
+
* there too.
|
|
18
|
+
*/
|
|
19
|
+
spansMultipleSources: boolean;
|
|
7
20
|
}
|
|
8
21
|
/**
|
|
9
22
|
* Derive the drag payload once at drag start.
|
|
@@ -11,7 +24,9 @@ export interface DragSet {
|
|
|
11
24
|
* - Dragging a selected item moves the complete current selection.
|
|
12
25
|
* - Dragging an unselected item moves only that item.
|
|
13
26
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
27
|
+
* The active item carries its own location on `dragData` (the row it was
|
|
28
|
+
* grabbed from); the rest of the selection is resolved through `locations`.
|
|
29
|
+
* Neither is derived from the folder currently open, because search results are
|
|
30
|
+
* global — see `utils/itemLocations.ts`.
|
|
16
31
|
*/
|
|
17
|
-
export declare const buildDragSet: (activeData: DragItemData, selectedKeys: Set<ItemKey> | undefined,
|
|
32
|
+
export declare const buildDragSet: (activeData: DragItemData, selectedKeys: Set<ItemKey> | undefined, locations: ItemLocations, fallbackFolderId: number | null) => DragSet;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DragFolderData } from '../../../../types/dnd';
|
|
1
|
+
import type { DragFileData, DragFolderData } from '../../../../types/dnd';
|
|
2
2
|
export declare const useFileDraggable: (asset: {
|
|
3
3
|
id: number;
|
|
4
4
|
name: string;
|
|
@@ -6,6 +6,7 @@ export declare const useFileDraggable: (asset: {
|
|
|
6
6
|
id?: number;
|
|
7
7
|
} | null;
|
|
8
8
|
}) => {
|
|
9
|
+
dragData: DragFileData;
|
|
9
10
|
active: import("@dnd-kit/core").Active | null;
|
|
10
11
|
activatorEvent: Event | null;
|
|
11
12
|
activeNodeRect: import("@dnd-kit/core").ClientRect | null;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type ListFilters } from '../hooks/useListFilters';
|
|
2
2
|
interface FilterBadgesProps {
|
|
3
3
|
listFilters: ListFilters;
|
|
4
|
+
/** Sticky header is scrolled/compact — reduce the space above the badges. */
|
|
5
|
+
compact?: boolean;
|
|
4
6
|
}
|
|
5
|
-
export declare const FilterBadges: ({ listFilters }: FilterBadgesProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare const FilterBadges: ({ listFilters, compact }: FilterBadgesProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
6
8
|
export {};
|
|
@@ -17,6 +17,10 @@ interface FilterMenuProps {
|
|
|
17
17
|
* - Creation date / Last modified → preset list (single pick, `within the
|
|
18
18
|
* last` by default) + "Select date range" (creation date only) opening the
|
|
19
19
|
* range calendar; a completed range adds an `is` range badge.
|
|
20
|
+
*
|
|
21
|
+
* Closing behaviour follows how many values a field can hold: a date is one
|
|
22
|
+
* value, so picking a preset (or committing a range) closes the menu; Type is a
|
|
23
|
+
* set, so it stays open until dismissed.
|
|
20
24
|
*/
|
|
21
25
|
export declare const FilterMenu: ({ listFilters }: FilterMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
26
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Folder } from '../../../../../../shared/contracts/folders';
|
|
2
|
+
import type { DragFolderData } from '../../../types/dnd';
|
|
3
|
+
interface FolderActionsMenuProps {
|
|
4
|
+
folder: Folder;
|
|
5
|
+
/** Drag data for this folder, so the move dialog validates against its real parent. */
|
|
6
|
+
dragData: DragFolderData;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The "..." menu on a folder row/card. Always acts on that one folder, whatever
|
|
10
|
+
* the current multi-selection is (the bulk actions bar is the selection-scoped
|
|
11
|
+
* affordance). It reuses the shared move and delete dialogs, which mount only
|
|
12
|
+
* while open.
|
|
13
|
+
*
|
|
14
|
+
* A successful move or delete clears the whole selection: they only invalidate
|
|
15
|
+
* RTK tags, so without it a `folder:<id>` key for a folder that no longer lives
|
|
16
|
+
* where the selection thinks it does would linger. A rename leaves the id
|
|
17
|
+
* valid, so it deliberately keeps the selection.
|
|
18
|
+
*/
|
|
19
|
+
export declare const FolderActionsMenu: ({ folder, dragData }: FolderActionsMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface FolderFormDialogBaseProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
/** Sent as `parent`. Create: the folder being created in. Rename: the folder's existing parent. */
|
|
5
|
+
parentFolderId: number | null;
|
|
6
|
+
}
|
|
7
|
+
type FolderFormDialogProps = FolderFormDialogBaseProps & ({
|
|
8
|
+
mode: 'create';
|
|
9
|
+
parentFolderName: string;
|
|
10
|
+
} | {
|
|
11
|
+
mode: 'rename';
|
|
12
|
+
folderId: number;
|
|
13
|
+
initialName: string;
|
|
14
|
+
});
|
|
15
|
+
export declare const FolderFormDialog: (props: FolderFormDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Which assets have a long-running mutation in flight, so the list can show it
|
|
4
|
+
* on the item itself.
|
|
5
|
+
*
|
|
6
|
+
* The mutation stays where it is triggered — the row's "..." menu — but the
|
|
7
|
+
* feedback has to render on the row or card, which is an ancestor of it. The
|
|
8
|
+
* menu sits in a leaf `<td>` (table) / footer `Flex` (grid), so an overlay
|
|
9
|
+
* mounted there would cover the button and nothing else. Rather than hoist the
|
|
10
|
+
* mutation up into both `AssetRow` and `AssetCard` (duplicating it, and moving
|
|
11
|
+
* it away from the control that owns it), the busy flag travels up through
|
|
12
|
+
* context and the ancestor renders the overlay.
|
|
13
|
+
*
|
|
14
|
+
* Scoped per asset id rather than a single boolean: a replace on one row must
|
|
15
|
+
* not blank out every other row. Modelled on `isMovePending` in
|
|
16
|
+
* `AssetsDndProvider`, which does the same thing for drag-moves — that one is
|
|
17
|
+
* list-wide because a move genuinely blocks the whole list.
|
|
18
|
+
*/
|
|
19
|
+
export interface BusyAssets {
|
|
20
|
+
/** Whether this asset has a mutation in flight. */
|
|
21
|
+
isBusy: (id: number) => boolean;
|
|
22
|
+
/** The message to show while it is, or `null`. */
|
|
23
|
+
getBusyMessage: (id: number) => string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Marks the asset busy and returns the release function. Pair it with
|
|
26
|
+
* `try`/`finally` so the flag clears on failure too.
|
|
27
|
+
*/
|
|
28
|
+
markBusy: (id: number, message: string) => () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare const BusyAssetsProvider: ({ children }: {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}) => import("react").FunctionComponentElement<import("react").ProviderProps<BusyAssets | null>>;
|
|
33
|
+
/**
|
|
34
|
+
* Optional by design: `AssetActionsMenu`, `AssetRow` and `AssetCard` are also
|
|
35
|
+
* rendered in tests and in the asset picker, outside this provider. Without it
|
|
36
|
+
* the mutation still runs, it just shows no row-level feedback.
|
|
37
|
+
*/
|
|
38
|
+
export declare const useBusyAssetsOptional: () => BusyAssets | null;
|
|
@@ -6,16 +6,30 @@ interface UseInfiniteAssetsOptions {
|
|
|
6
6
|
search?: string;
|
|
7
7
|
/** Extra `filters[$and]` entries for the files query. */
|
|
8
8
|
filters?: Record<string, unknown>[];
|
|
9
|
-
/**
|
|
10
|
-
* Stable fingerprint of `filters` — a change resets the accumulated pages
|
|
11
|
-
* (the array identity itself changes every render).
|
|
12
|
-
*/
|
|
13
|
-
filtersKey?: string;
|
|
14
9
|
/** Structural switch: an `is [folder]`-only type badge means no file can match. */
|
|
15
10
|
enabled?: boolean;
|
|
16
11
|
}
|
|
17
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Infinite scroll over `/upload/files`, keeping one accumulated slot per page.
|
|
14
|
+
*
|
|
15
|
+
* The caller MUST render the returned `subscribers` node — that is what keeps
|
|
16
|
+
* every loaded page subscribed, so `{Asset, LIST}` invalidations keep the whole
|
|
17
|
+
* list consistent rather than only the current page.
|
|
18
|
+
*/
|
|
19
|
+
declare const useInfiniteAssets: ({ folder, sort, search, filters, enabled, }?: UseInfiniteAssetsOptions) => {
|
|
18
20
|
assets: File[];
|
|
21
|
+
subscribers: null;
|
|
22
|
+
pagination: undefined;
|
|
23
|
+
isLoading: boolean;
|
|
24
|
+
isFetchingMore: boolean;
|
|
25
|
+
hasNextPage: boolean;
|
|
26
|
+
fetchNextPage: () => void;
|
|
27
|
+
error: undefined;
|
|
28
|
+
} | {
|
|
29
|
+
assets: File[];
|
|
30
|
+
subscribers: import("react").FunctionComponentElement<{
|
|
31
|
+
children?: import("react").ReactNode | undefined;
|
|
32
|
+
}>;
|
|
19
33
|
pagination: Pagination | undefined;
|
|
20
34
|
isLoading: boolean;
|
|
21
35
|
isFetchingMore: boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
interface UseInfiniteScrollSentinelArgs {
|
|
2
|
+
/** Whether there is a further page to request. */
|
|
3
|
+
hasNextPage: boolean;
|
|
4
|
+
/** Whether a subsequent page is already in flight. */
|
|
5
|
+
isFetchingMore: boolean;
|
|
6
|
+
/** Called to request the next page. Held in a ref, so it need not be stable. */
|
|
7
|
+
onLoadMore: () => void;
|
|
8
|
+
/**
|
|
9
|
+
* Passed to the `IntersectionObserver`. Read once, when the sentinel node
|
|
10
|
+
* attaches — changing it afterwards does NOT rebuild the observer, so a
|
|
11
|
+
* later `threshold`/`rootMargin` is silently ignored. Pass a stable, ideally
|
|
12
|
+
* module-level, object.
|
|
13
|
+
*/
|
|
14
|
+
options?: IntersectionObserverInit;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Infinite-scroll trigger for the media library list.
|
|
18
|
+
*
|
|
19
|
+
* Returns a callback ref to place on a sentinel element rendered after the last
|
|
20
|
+
* row. Three deliberate choices:
|
|
21
|
+
*
|
|
22
|
+
* 1. **Loading is driven only by fresh observer readings.** A fetch fires from
|
|
23
|
+
* the `IntersectionObserver` callback — never from a state/prop change — so
|
|
24
|
+
* it can't react to a stale `isIntersecting` from before newly loaded rows
|
|
25
|
+
* rendered (which fetched an extra page on every trigger).
|
|
26
|
+
*
|
|
27
|
+
* 2. **Each settled page re-observes the sentinel.** An `IntersectionObserver`
|
|
28
|
+
* only fires on a *transition*. When the sentinel stays on screen (a page
|
|
29
|
+
* that doesn't fill the viewport — tall viewport, short page, grid fitting
|
|
30
|
+
* the whole page) it would never fire again and loading would stall. So when
|
|
31
|
+
* `isFetchingMore` settles back to false we re-observe, forcing a fresh
|
|
32
|
+
* reading against the new layout: still on screen → load the next page;
|
|
33
|
+
* viewport now filled → stop.
|
|
34
|
+
*
|
|
35
|
+
* 3. **A callback ref, not a stable object ref.** The sentinel only mounts once
|
|
36
|
+
* the first page has rendered (the list shows a loader before that). A
|
|
37
|
+
* callback ref (re)binds the observer exactly when the node mounts/unmounts,
|
|
38
|
+
* so the observer can't miss a sentinel that appears after the hook first ran.
|
|
39
|
+
*/
|
|
40
|
+
export declare const useInfiniteScrollSentinel: ({ hasNextPage, isFetchingMore, onLoadMore, options, }: UseInfiniteScrollSentinelArgs) => (node: HTMLElement | null) => void;
|
|
41
|
+
export {};
|
|
@@ -21,7 +21,12 @@ interface BulkMoveParams {
|
|
|
21
21
|
/** `null` moves the items to the root of the Media Library. */
|
|
22
22
|
destinationFolderId: number | null;
|
|
23
23
|
}
|
|
24
|
-
export declare const useCreateFolderMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<Pick<Folder, "name" | "parent">, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "Asset" | "Folder", Folder, "adminApi">>,
|
|
24
|
+
export declare const useCreateFolderMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<Pick<Folder, "name" | "parent">, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "Asset" | "Folder", Folder, "adminApi">>, useUpdateFolderMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<{
|
|
25
|
+
id: number;
|
|
26
|
+
} & {
|
|
27
|
+
name: string;
|
|
28
|
+
parent: number | null;
|
|
29
|
+
}, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "Asset" | "Folder", Folder, "adminApi">>, useGetFoldersQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void | GetFoldersParams, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "Asset" | "Folder", Folder[], "adminApi">>, useGetFolderQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<{
|
|
25
30
|
id: number;
|
|
26
31
|
}, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "Asset" | "Folder", FolderWithCounts, "adminApi">>, useGetAllFoldersQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "Asset" | "Folder", Folder[], "adminApi">>, useGetFolderStructureQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<void, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "Asset" | "Folder", FolderNode[], "adminApi">>, useBulkMoveMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query").MutationDefinition<BulkMoveParams, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError | import("@reduxjs/toolkit").SerializedError, {}, {}>, "GuidedTourMeta" | "HomepageKeyStatistics" | "AiUsage" | "AiFeatureConfig" | "Asset" | "Folder", {
|
|
27
32
|
data: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { type ItemLocations } from './itemLocations';
|
|
1
2
|
import type { DragItemData } from '../types/dnd';
|
|
2
3
|
/**
|
|
3
4
|
* Reconstruct the drag set from a bulk-actions selection so the dialog can feed
|
|
4
5
|
* the exact same `DragItemData[]` into `computeValidDropTargets` / the canonical
|
|
5
6
|
* `canDropItemOnFolder` predicate that pointer drag uses.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* Each item's location comes from the loaded row, not from the folder currently
|
|
9
|
+
* open: search results are global, so a selected item can live anywhere.
|
|
9
10
|
* Names are irrelevant to drop validation, so they are left empty.
|
|
10
11
|
*/
|
|
11
|
-
export declare const buildDragSetFromSelection: (selectedIds: ReadonlySet<number>, selectedFolderIds: ReadonlySet<number>,
|
|
12
|
+
export declare const buildDragSetFromSelection: (selectedIds: ReadonlySet<number>, selectedFolderIds: ReadonlySet<number>, locations: ItemLocations, fallbackFolderId: number | null) => DragItemData[];
|
|
@@ -2,7 +2,13 @@ import type { IntlShape } from 'react-intl';
|
|
|
2
2
|
interface FormatMoveSuccessArgs {
|
|
3
3
|
formatMessage: IntlShape['formatMessage'];
|
|
4
4
|
count: number;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Leaf name of the folder the items came from, or `null` when the move spans
|
|
7
|
+
* several source folders and no single one can be named — a global-search
|
|
8
|
+
* selection can hold items from anywhere. The wording then omits the source
|
|
9
|
+
* rather than naming one folder and implying the rest came from it too.
|
|
10
|
+
*/
|
|
11
|
+
source: string | null;
|
|
6
12
|
destination: string;
|
|
7
13
|
}
|
|
8
14
|
/**
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalise a to-one relation down to its id.
|
|
3
|
+
*
|
|
4
|
+
* The contracts type `File['folder']` and `Folder['parent']` as ids, but the
|
|
5
|
+
* admin populates both (`populate: { folder: true }` on `/upload/files`,
|
|
6
|
+
* `populate: { parent: true }` on `/upload/folders`), so the wire value is an
|
|
7
|
+
* object. Only the id is ever read — move validation compares locations by id.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getRelationId: (relation: number | string | {
|
|
10
|
+
id?: number;
|
|
11
|
+
} | null | undefined) => number | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SyntheticEvent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* True when the event really originated inside `currentTarget`'s DOM subtree.
|
|
4
|
+
*
|
|
5
|
+
* Portaled content (Radix menus, modals, select popovers) bubbles through the
|
|
6
|
+
* React tree, so a row's handlers see events coming from dialogs rendered by
|
|
7
|
+
* its own children. Guarding on DOM containment keeps those out — without
|
|
8
|
+
* calling `stopPropagation`, which would also kill the native event before it
|
|
9
|
+
* reaches `document`, where Radix listens in order to dismiss its layers.
|
|
10
|
+
*/
|
|
11
|
+
export declare const isEventFromWithin: (event: SyntheticEvent) => boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { File } from '../../../../shared/contracts/files';
|
|
2
|
+
import type { Folder } from '../../../../shared/contracts/folders';
|
|
3
|
+
/**
|
|
4
|
+
* Where each loaded item actually lives, keyed by id.
|
|
5
|
+
*
|
|
6
|
+
* Search results are global, so the folder currently open (`?folder=`) says
|
|
7
|
+
* nothing about a selected item's location. The loaded lists do: the server
|
|
8
|
+
* populates `folder` on `/upload/files` and `parent` on `/upload/folders`.
|
|
9
|
+
*
|
|
10
|
+
* `undefined` means "not in the loaded list" and is distinct from `null`
|
|
11
|
+
* ("lives at the root") — the two lead to different move validation.
|
|
12
|
+
*/
|
|
13
|
+
export interface ItemLocations {
|
|
14
|
+
fileFolderId: (id: number) => number | null | undefined;
|
|
15
|
+
folderParentId: (id: number) => number | null | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** Every id misses — used where no list is loaded (e.g. an isolated provider). */
|
|
18
|
+
export declare const emptyItemLocations: ItemLocations;
|
|
19
|
+
/**
|
|
20
|
+
* Build the lookup once per list. Callers memoize on the rows so the identity
|
|
21
|
+
* stays stable: `BulkMoveDialog` memoizes its destination walk on the items
|
|
22
|
+
* derived from it.
|
|
23
|
+
*/
|
|
24
|
+
export declare const buildItemLocations: (assets: File[], folders: Folder[]) => ItemLocations;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve an item's location, falling back to the folder currently open when it
|
|
27
|
+
* is not in the loaded list. The fallback is unreachable in practice — selection
|
|
28
|
+
* clears whenever the list identity changes and infinite scroll only appends —
|
|
29
|
+
* but a stale parent beats silently dropping the item from the move.
|
|
30
|
+
*/
|
|
31
|
+
export declare const locateItem: (locations: ItemLocations, kind: "file" | "folder", id: number, fallbackFolderId: number | null) => number | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DragItemData } from '../types/dnd';
|
|
2
|
+
/**
|
|
3
|
+
* Where an item currently lives, regardless of its kind — folders carry their
|
|
4
|
+
* location on `parentId`, files on `folderId`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const sourceFolderIdOf: (item: DragItemData) => number | null;
|
|
7
|
+
/**
|
|
8
|
+
* The one folder every item in a move came from, or `null` when there isn't one.
|
|
9
|
+
*
|
|
10
|
+
* A selection made under a global search can hold items from anywhere, so a move
|
|
11
|
+
* has a nameable source only when the whole set agrees on it. `null` also covers
|
|
12
|
+
* the empty set. Callers pass the result straight to `formatMoveSuccessMessage`,
|
|
13
|
+
* which drops the source from the wording rather than crediting one item's
|
|
14
|
+
* folder to all of them.
|
|
15
|
+
*
|
|
16
|
+
* Note `null` is overloaded on purpose at the *label* level: an item at the
|
|
17
|
+
* Media Library root also has a `null` location, and both cases end up reading
|
|
18
|
+
* as "no folder to name". Use `hasUniformSource` when the difference matters.
|
|
19
|
+
*/
|
|
20
|
+
export declare const uniformSourceFolderId: (items: DragItemData[]) => number | null;
|
|
21
|
+
/** Whether every item in the set came from the same folder. False for an empty set. */
|
|
22
|
+
export declare const hasUniformSource: (items: DragItemData[]) => boolean;
|
|
@@ -100,6 +100,9 @@ var en = {
|
|
|
100
100
|
"upload.progress.maximize": "Maximize",
|
|
101
101
|
"upload.progress.minimize": "Minimize",
|
|
102
102
|
"upload.progress.close": "Close",
|
|
103
|
+
"beta.badge": "Beta",
|
|
104
|
+
"beta.notice.close": "Close",
|
|
105
|
+
"beta.notice.content": "This is a beta version of the Media Library. Some features are still in progress — please report any issue you run into.",
|
|
103
106
|
"bulk.select.label": "Select all assets",
|
|
104
107
|
"button.next": "Next",
|
|
105
108
|
"new": "New",
|
|
@@ -116,6 +119,7 @@ var en = {
|
|
|
116
119
|
"control-card.save-focal-point": "Save focal point",
|
|
117
120
|
"control-card.download": "Download",
|
|
118
121
|
"control-card.edit": "Edit",
|
|
122
|
+
"control-card.more-actions": "More actions",
|
|
119
123
|
"control-card.remove-selection": "Remove from selection",
|
|
120
124
|
"control-card.replace-media": "Replace Media",
|
|
121
125
|
"control-card.save": "Save",
|
|
@@ -133,11 +137,16 @@ var en = {
|
|
|
133
137
|
"header.actions.add-assets": "Add new assets",
|
|
134
138
|
"header.actions.add-folder": "Add new folder",
|
|
135
139
|
"folder.create.title": "New folder",
|
|
140
|
+
"folder.create.title-in": "New folder in {folderName}",
|
|
136
141
|
"folder.form.name.label": "Folder name",
|
|
137
142
|
"folder.create.submit": "Create folder",
|
|
138
143
|
"folder.create.form.error.name-required": "Name is required",
|
|
139
144
|
"folder.create.form.error.unknown": "An error occurred while creating the folder",
|
|
140
145
|
"folder.create.success": "Folder has been created",
|
|
146
|
+
"folder.rename.title": "Rename folder",
|
|
147
|
+
"folder.rename.submit": "Save",
|
|
148
|
+
"folder.rename.form.error.unknown": "An error occurred while renaming the folder",
|
|
149
|
+
"folder.rename.success": "Folder has been renamed",
|
|
141
150
|
"header.actions.add-assets.folder": "folder",
|
|
142
151
|
"header.actions.upload-assets": "Upload assets",
|
|
143
152
|
"header.actions.upload-new-asset": "Upload new asset",
|
|
@@ -223,8 +232,19 @@ var en = {
|
|
|
223
232
|
"list.assets.preview-asset": "Preview for the video at path {path}",
|
|
224
233
|
"list.assets.selected": "{numberFolders, plural, one {1 folder} other {# folders}} - {numberAssets, plural, one {1 asset} other {# assets}}",
|
|
225
234
|
"list-assets-select": "Select {name} asset",
|
|
235
|
+
"list.assets.actions.replace": "Replace media",
|
|
236
|
+
"list.assets.actions.copy-link": "Copy link to media",
|
|
237
|
+
"list.assets.actions.download": "Download media",
|
|
238
|
+
"list.assets.actions.move": "Move to folder",
|
|
239
|
+
"list.assets.actions.delete": "Delete",
|
|
226
240
|
"list.assets.type-not-allowed": "This type of file is not allowed.",
|
|
227
241
|
"list.assets.to-upload": "{number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload",
|
|
242
|
+
"list.folder.actions.copy-link": "Copy link to folder",
|
|
243
|
+
"list.folder.actions.copy-link.success": "Folder link copied.",
|
|
244
|
+
"list.folder.actions.copy-link.error": "Failed to copy the folder link.",
|
|
245
|
+
"list.folder.actions.rename": "Rename folder",
|
|
246
|
+
"list.folder.actions.move": "Move to folder",
|
|
247
|
+
"list.folder.actions.delete": "Delete folder",
|
|
228
248
|
"list.folder.edit": "Edit folder",
|
|
229
249
|
"list.folder.select": "Select {name} folder",
|
|
230
250
|
"list.folder.subtitle": "{folderCount, plural, one {# folder} other {# folders}}, {filesCount, plural, one {# asset} other {# assets}}",
|
|
@@ -317,6 +337,7 @@ var en = {
|
|
|
317
337
|
"list.table.header.sort": "Sort on {label}",
|
|
318
338
|
"list.table.header.select-all": "Select all",
|
|
319
339
|
"list.table.row.select": "Select {name}",
|
|
340
|
+
"list.table.row.metadata-missing": "This asset is missing metadata (caption or alternative text).",
|
|
320
341
|
"list.table.content.empty-label": "This field is empty",
|
|
321
342
|
"list.bulk-actions.label": "Bulk actions",
|
|
322
343
|
"list.bulk-actions.selected-count": "{count, plural, =1 {# item selected} other {# items selected}}",
|
|
@@ -330,8 +351,11 @@ var en = {
|
|
|
330
351
|
"list.bulk-actions.move": "Move",
|
|
331
352
|
"list.bulk-actions.move.title": "Move elements to",
|
|
332
353
|
"list.bulk-actions.move.location": "Location",
|
|
354
|
+
"list.bulk-actions.move.no-destination": "There is no other folder to move this to.",
|
|
355
|
+
"list.bulk-actions.move.load-error": "Couldn't load the folder list. Please try again.",
|
|
333
356
|
"list.bulk-actions.move.submit": "Move",
|
|
334
357
|
"list.bulk-actions.move.success": "{count, plural, =1 {# element has} other {# elements have}} been moved from {source} to {destination}",
|
|
358
|
+
"list.bulk-actions.move.success-multiple-sources": "{count, plural, =1 {# element has} other {# elements have}} been moved to {destination}",
|
|
335
359
|
"list.bulk-actions.move.error": "An error occurred while moving the items.",
|
|
336
360
|
"list.bulk-actions.delete": "Delete",
|
|
337
361
|
"list.bulk-actions.delete.confirm.title": "Delete {count, plural, =1 {# item} other {# items}}?",
|
|
@@ -364,11 +388,8 @@ var en = {
|
|
|
364
388
|
"sidebar.tree.expand": "Expand {name}",
|
|
365
389
|
"sidebar.tree.collapse": "Collapse {name}",
|
|
366
390
|
"sidebar.tree.empty": "No folders yet",
|
|
367
|
-
"sidebar.tree.no-results": "No folders match \"{query}\"",
|
|
368
391
|
"sidebar.tree.loading": "Loading folders...",
|
|
369
|
-
"sidebar.tree.error": "Could not load folders."
|
|
370
|
-
"sidebar.search.label": "Search folders",
|
|
371
|
-
"sidebar.search.placeholder": "Search folders"
|
|
392
|
+
"sidebar.tree.error": "Could not load folders."
|
|
372
393
|
};
|
|
373
394
|
|
|
374
395
|
module.exports = en;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|