@strapi/upload 5.56.0 → 5.57.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/hooks/useTracking.js +2 -8
- package/dist/admin/hooks/useTracking.js.map +1 -1
- package/dist/admin/hooks/useTracking.mjs +3 -8
- package/dist/admin/hooks/useTracking.mjs.map +1 -1
- package/dist/admin/legacy/hooks/useTracking.js +3 -1
- package/dist/admin/legacy/hooks/useTracking.js.map +1 -1
- package/dist/admin/legacy/hooks/useTracking.mjs +3 -1
- package/dist/admin/legacy/hooks/useTracking.mjs.map +1 -1
- package/dist/admin/legacy/pages/App/ConfigureTheView/ConfigureTheView.js +2 -1
- package/dist/admin/legacy/pages/App/ConfigureTheView/ConfigureTheView.js.map +1 -1
- package/dist/admin/legacy/pages/App/ConfigureTheView/ConfigureTheView.mjs +2 -1
- package/dist/admin/legacy/pages/App/ConfigureTheView/ConfigureTheView.mjs.map +1 -1
- package/dist/admin/legacy/pages/App/MediaLibrary.js +2 -1
- package/dist/admin/legacy/pages/App/MediaLibrary.js.map +1 -1
- package/dist/admin/legacy/pages/App/MediaLibrary.mjs +2 -1
- package/dist/admin/legacy/pages/App/MediaLibrary.mjs.map +1 -1
- package/dist/admin/pages/Assets/AssetsPage.js +24 -12
- package/dist/admin/pages/Assets/AssetsPage.js.map +1 -1
- package/dist/admin/pages/Assets/AssetsPage.mjs +25 -13
- package/dist/admin/pages/Assets/AssetsPage.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/AssetActions.js +326 -0
- package/dist/admin/pages/Assets/components/AssetActions.js.map +1 -0
- package/dist/admin/pages/Assets/components/AssetActions.mjs +324 -0
- package/dist/admin/pages/Assets/components/AssetActions.mjs.map +1 -0
- package/dist/admin/pages/Assets/components/AssetActionsMenu.js +28 -309
- package/dist/admin/pages/Assets/components/AssetActionsMenu.js.map +1 -1
- package/dist/admin/pages/Assets/components/AssetActionsMenu.mjs +31 -312
- package/dist/admin/pages/Assets/components/AssetActionsMenu.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/AssetContextMenu.js +79 -0
- package/dist/admin/pages/Assets/components/AssetContextMenu.js.map +1 -0
- package/dist/admin/pages/Assets/components/AssetContextMenu.mjs +77 -0
- package/dist/admin/pages/Assets/components/AssetContextMenu.mjs.map +1 -0
- package/dist/admin/pages/Assets/components/AssetDetails/AssetCropEditor.js +87 -5
- package/dist/admin/pages/Assets/components/AssetDetails/AssetCropEditor.js.map +1 -1
- package/dist/admin/pages/Assets/components/AssetDetails/AssetCropEditor.mjs +89 -7
- package/dist/admin/pages/Assets/components/AssetDetails/AssetCropEditor.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/AssetDetails/AssetDetailsDrawer.js +3 -3
- package/dist/admin/pages/Assets/components/AssetDetails/AssetDetailsDrawer.js.map +1 -1
- package/dist/admin/pages/Assets/components/AssetDetails/AssetDetailsDrawer.mjs +3 -3
- package/dist/admin/pages/Assets/components/AssetDetails/AssetDetailsDrawer.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/AssetDetails/useCropImg.js +62 -5
- package/dist/admin/pages/Assets/components/AssetDetails/useCropImg.js.map +1 -1
- package/dist/admin/pages/Assets/components/AssetDetails/useCropImg.mjs +60 -6
- package/dist/admin/pages/Assets/components/AssetDetails/useCropImg.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/AssetsGrid.js +27 -4
- package/dist/admin/pages/Assets/components/AssetsGrid.js.map +1 -1
- package/dist/admin/pages/Assets/components/AssetsGrid.mjs +27 -4
- package/dist/admin/pages/Assets/components/AssetsGrid.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/AssetsTable.js +27 -4
- package/dist/admin/pages/Assets/components/AssetsTable.js.map +1 -1
- package/dist/admin/pages/Assets/components/AssetsTable.mjs +27 -4
- package/dist/admin/pages/Assets/components/AssetsTable.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/CursorAnchoredMenu.js +77 -0
- package/dist/admin/pages/Assets/components/CursorAnchoredMenu.js.map +1 -0
- package/dist/admin/pages/Assets/components/CursorAnchoredMenu.mjs +75 -0
- package/dist/admin/pages/Assets/components/CursorAnchoredMenu.mjs.map +1 -0
- package/dist/admin/pages/Assets/components/FolderActions.js +139 -0
- package/dist/admin/pages/Assets/components/FolderActions.js.map +1 -0
- package/dist/admin/pages/Assets/components/FolderActions.mjs +137 -0
- package/dist/admin/pages/Assets/components/FolderActions.mjs.map +1 -0
- package/dist/admin/pages/Assets/components/FolderActionsMenu.js +25 -119
- package/dist/admin/pages/Assets/components/FolderActionsMenu.js.map +1 -1
- package/dist/admin/pages/Assets/components/FolderActionsMenu.mjs +27 -121
- package/dist/admin/pages/Assets/components/FolderActionsMenu.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/FolderContextMenu.js +67 -0
- package/dist/admin/pages/Assets/components/FolderContextMenu.js.map +1 -0
- package/dist/admin/pages/Assets/components/FolderContextMenu.mjs +65 -0
- package/dist/admin/pages/Assets/components/FolderContextMenu.mjs.map +1 -0
- package/dist/admin/pages/Assets/components/FolderTree/FolderTree.js +139 -45
- package/dist/admin/pages/Assets/components/FolderTree/FolderTree.js.map +1 -1
- package/dist/admin/pages/Assets/components/FolderTree/FolderTree.mjs +140 -47
- package/dist/admin/pages/Assets/components/FolderTree/FolderTree.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/FolderTree/FolderTreeRowMenu.js +115 -0
- package/dist/admin/pages/Assets/components/FolderTree/FolderTreeRowMenu.js.map +1 -0
- package/dist/admin/pages/Assets/components/FolderTree/FolderTreeRowMenu.mjs +113 -0
- package/dist/admin/pages/Assets/components/FolderTree/FolderTreeRowMenu.mjs.map +1 -0
- package/dist/admin/pages/Assets/components/ItemContextMenu.js +125 -0
- package/dist/admin/pages/Assets/components/ItemContextMenu.js.map +1 -0
- package/dist/admin/pages/Assets/components/ItemContextMenu.mjs +122 -0
- package/dist/admin/pages/Assets/components/ItemContextMenu.mjs.map +1 -0
- package/dist/admin/pages/Assets/components/MainAreaContextMenu.js +88 -63
- package/dist/admin/pages/Assets/components/MainAreaContextMenu.js.map +1 -1
- package/dist/admin/pages/Assets/components/MainAreaContextMenu.mjs +88 -63
- package/dist/admin/pages/Assets/components/MainAreaContextMenu.mjs.map +1 -1
- package/dist/admin/pages/Assets/components/SelectionActions.js +111 -0
- package/dist/admin/pages/Assets/components/SelectionActions.js.map +1 -0
- package/dist/admin/pages/Assets/components/SelectionActions.mjs +109 -0
- package/dist/admin/pages/Assets/components/SelectionActions.mjs.map +1 -0
- package/dist/admin/pages/Assets/components/SelectionContextMenu.js +82 -0
- package/dist/admin/pages/Assets/components/SelectionContextMenu.js.map +1 -0
- package/dist/admin/pages/Assets/components/SelectionContextMenu.mjs +80 -0
- package/dist/admin/pages/Assets/components/SelectionContextMenu.mjs.map +1 -0
- package/dist/admin/pages/Assets/hooks/useAssetSelection.js +10 -0
- package/dist/admin/pages/Assets/hooks/useAssetSelection.js.map +1 -1
- package/dist/admin/pages/Assets/hooks/useAssetSelection.mjs +10 -0
- package/dist/admin/pages/Assets/hooks/useAssetSelection.mjs.map +1 -1
- package/dist/admin/pages/SettingsPage/SettingsPage.js +8 -1
- package/dist/admin/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/dist/admin/pages/SettingsPage/SettingsPage.mjs +8 -1
- package/dist/admin/pages/SettingsPage/SettingsPage.mjs.map +1 -1
- package/dist/admin/src/hooks/useTracking.d.ts +0 -7
- package/dist/admin/src/pages/Assets/components/AssetActions.d.ts +70 -0
- package/dist/admin/src/pages/Assets/components/AssetActionsMenu.d.ts +5 -14
- package/dist/admin/src/pages/Assets/components/AssetContextMenu.d.ts +27 -0
- package/dist/admin/src/pages/Assets/components/AssetDetails/useCropImg.d.ts +16 -0
- package/dist/admin/src/pages/Assets/components/CursorAnchoredMenu.d.ts +32 -0
- package/dist/admin/src/pages/Assets/components/FolderActions.d.ts +48 -0
- package/dist/admin/src/pages/Assets/components/FolderActionsMenu.d.ts +4 -8
- package/dist/admin/src/pages/Assets/components/FolderContextMenu.d.ts +21 -0
- package/dist/admin/src/pages/Assets/components/FolderTree/FolderTree.d.ts +5 -1
- package/dist/admin/src/pages/Assets/components/FolderTree/FolderTreeRowMenu.d.ts +25 -0
- package/dist/admin/src/pages/Assets/components/ItemContextMenu.d.ts +53 -0
- package/dist/admin/src/pages/Assets/components/MainAreaContextMenu.d.ts +15 -1
- package/dist/admin/src/pages/Assets/components/SelectionActions.d.ts +40 -0
- package/dist/admin/src/pages/Assets/components/SelectionContextMenu.d.ts +25 -0
- package/dist/admin/src/pages/Assets/hooks/useAssetSelection.d.ts +5 -0
- package/dist/admin/src/utils/mediaLibraryVersion.d.ts +18 -0
- package/dist/admin/translations/en.json.js +8 -3
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +8 -3
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/admin/utils/mediaLibraryVersion.js +24 -0
- package/dist/admin/utils/mediaLibraryVersion.js.map +1 -0
- package/dist/admin/utils/mediaLibraryVersion.mjs +20 -0
- package/dist/admin/utils/mediaLibraryVersion.mjs.map +1 -0
- package/dist/server/controllers/admin-file.js +2 -2
- package/dist/server/controllers/admin-file.js.map +1 -1
- package/dist/server/controllers/admin-file.mjs +2 -2
- package/dist/server/controllers/admin-file.mjs.map +1 -1
- package/dist/server/controllers/admin-folder.js +5 -5
- package/dist/server/controllers/admin-folder.js.map +1 -1
- package/dist/server/controllers/admin-folder.mjs +5 -5
- package/dist/server/controllers/admin-folder.mjs.map +1 -1
- package/dist/server/controllers/content-api.js +30 -7
- package/dist/server/controllers/content-api.js.map +1 -1
- package/dist/server/controllers/content-api.mjs +30 -7
- package/dist/server/controllers/content-api.mjs.map +1 -1
- package/dist/server/controllers/validation/admin/folder-file.js +4 -4
- package/dist/server/controllers/validation/admin/folder-file.js.map +1 -1
- package/dist/server/controllers/validation/admin/folder-file.mjs +2 -2
- package/dist/server/controllers/validation/admin/folder-file.mjs.map +1 -1
- package/dist/server/controllers/validation/admin/folder.js +3 -4
- package/dist/server/controllers/validation/admin/folder.js.map +1 -1
- package/dist/server/controllers/validation/admin/folder.mjs +3 -4
- package/dist/server/controllers/validation/admin/folder.mjs.map +1 -1
- package/dist/server/controllers/validation/admin/upload.js +1 -2
- package/dist/server/controllers/validation/admin/upload.js.map +1 -1
- package/dist/server/controllers/validation/admin/upload.mjs +1 -2
- package/dist/server/controllers/validation/admin/upload.mjs.map +1 -1
- package/dist/server/controllers/validation/admin/utils.js +1 -2
- package/dist/server/controllers/validation/admin/utils.js.map +1 -1
- package/dist/server/controllers/validation/admin/utils.mjs +1 -2
- package/dist/server/controllers/validation/admin/utils.mjs.map +1 -1
- package/dist/server/migrations/unsign-richtext-and-blocks-urls.js +2 -2
- package/dist/server/migrations/unsign-richtext-and-blocks-urls.js.map +1 -1
- package/dist/server/migrations/unsign-richtext-and-blocks-urls.mjs +1 -1
- package/dist/server/migrations/unsign-richtext-and-blocks-urls.mjs.map +1 -1
- package/dist/server/routes/content-api.js +3 -3
- package/dist/server/routes/content-api.js.map +1 -1
- package/dist/server/routes/content-api.mjs +3 -3
- package/dist/server/routes/content-api.mjs.map +1 -1
- package/dist/server/routes/validation/upload.js +8 -0
- package/dist/server/routes/validation/upload.js.map +1 -1
- package/dist/server/routes/validation/upload.mjs +8 -0
- package/dist/server/routes/validation/upload.mjs.map +1 -1
- package/dist/server/services/api-upload-folder.js +3 -3
- package/dist/server/services/api-upload-folder.js.map +1 -1
- package/dist/server/services/api-upload-folder.mjs +3 -3
- package/dist/server/services/api-upload-folder.mjs.map +1 -1
- package/dist/server/services/extensions/utils.js +19 -15
- package/dist/server/services/extensions/utils.js.map +1 -1
- package/dist/server/services/extensions/utils.mjs +19 -15
- package/dist/server/services/extensions/utils.mjs.map +1 -1
- package/dist/server/services/file.js +2 -2
- package/dist/server/services/file.js.map +1 -1
- package/dist/server/services/file.mjs +1 -1
- package/dist/server/services/file.mjs.map +1 -1
- package/dist/server/services/folder.js +5 -5
- package/dist/server/services/folder.js.map +1 -1
- package/dist/server/services/folder.mjs +5 -5
- package/dist/server/services/folder.mjs.map +1 -1
- package/dist/server/services/provider.js +3 -4
- package/dist/server/services/provider.js.map +1 -1
- package/dist/server/services/provider.mjs +3 -4
- package/dist/server/services/provider.mjs.map +1 -1
- package/dist/server/services/upload.js +5 -6
- package/dist/server/services/upload.js.map +1 -1
- package/dist/server/services/upload.mjs +4 -5
- package/dist/server/services/upload.mjs.map +1 -1
- package/dist/server/services/weekly-metrics.js +2 -2
- package/dist/server/services/weekly-metrics.js.map +1 -1
- package/dist/server/services/weekly-metrics.mjs +2 -2
- package/dist/server/services/weekly-metrics.mjs.map +1 -1
- package/dist/server/src/controllers/admin-folder.d.ts.map +1 -1
- package/dist/server/src/controllers/content-api.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/admin/folder.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/admin/upload.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/admin/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/mcp/ambient-instance.d.ts.map +1 -1
- package/dist/server/src/routes/validation/upload.d.ts +4 -0
- package/dist/server/src/routes/validation/upload.d.ts.map +1 -1
- package/dist/server/src/services/extensions/utils.d.ts +33 -1
- package/dist/server/src/services/extensions/utils.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/provider.d.ts.map +1 -1
- package/dist/server/src/services/upload.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AssetActionPermissions } from './AssetActions';
|
|
2
|
+
import { type CursorPosition } from './CursorAnchoredMenu';
|
|
3
|
+
import type { File } from '../../../../../shared/contracts/files';
|
|
4
|
+
import type { DragFileData } from '../../../types/dnd';
|
|
5
|
+
interface AssetContextMenuProps {
|
|
6
|
+
asset: File;
|
|
7
|
+
dragData: DragFileData;
|
|
8
|
+
/** Resolved by the provider, so this menu never renders while RBAC loads. */
|
|
9
|
+
permissions: AssetActionPermissions;
|
|
10
|
+
position: CursorPosition;
|
|
11
|
+
returnFocusTo: HTMLElement | null;
|
|
12
|
+
/** Mounted only while it has something on screen, so the parent drops it on this. */
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The right-click twin of `AssetActionsMenu`: same actions, opened at the
|
|
17
|
+
* cursor instead of from the row's `•••`. Both render what `AssetActions`
|
|
18
|
+
* gives them, so the two can't offer different things.
|
|
19
|
+
*
|
|
20
|
+
* Picking "Replace", "Move" or "Delete" closes the menu and opens a dialog in
|
|
21
|
+
* the same tick, and that dialog is rendered here — so the menu being shut and
|
|
22
|
+
* this being unmounted are two different things, tracked apart. Unmounting
|
|
23
|
+
* early would take the dialog with it, and for "Replace" the hidden file input
|
|
24
|
+
* too, which is why `isBusy` also covers the native picker.
|
|
25
|
+
*/
|
|
26
|
+
export declare const AssetContextMenu: ({ asset, dragData, permissions, position, returnFocusTo, onClose, }: AssetContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -26,6 +26,20 @@ export declare const resolveCornerResize: ({ anchorX, anchorY, point, aspectRati
|
|
|
26
26
|
};
|
|
27
27
|
aspectRatio: number | null;
|
|
28
28
|
}) => CropRect;
|
|
29
|
+
export type Rotation = 0 | 90 | 180 | 270;
|
|
30
|
+
/**
|
|
31
|
+
* Remap a crop rect through a quarter-turn. `size` is the image size *before* the
|
|
32
|
+
* turn, so the returned rect is expressed against the swapped size for 90/270.
|
|
33
|
+
* Pure: the caller swaps `naturalSize` to match.
|
|
34
|
+
*/
|
|
35
|
+
export declare const rotateCropRect: (crop: CropRect, direction: "left" | "right", size: NaturalSize) => CropRect;
|
|
36
|
+
/**
|
|
37
|
+
* The crop rect expressed against the *unrotated* source, by undoing each quarter-turn
|
|
38
|
+
* already applied. `produceFile` needs it to know which source pixels to sample.
|
|
39
|
+
*/
|
|
40
|
+
export declare const sourceCropRect: (crop: CropRect, rotation: Rotation, rotatedSize: NaturalSize) => CropRect;
|
|
41
|
+
/** Advance a rotation by one quarter-turn, wrapping at 360. */
|
|
42
|
+
export declare const nextRotation: (current: Rotation, direction: "left" | "right") => Rotation;
|
|
29
43
|
/**
|
|
30
44
|
* Custom crop state + file producer. Replaces a cropperjs-based version: the
|
|
31
45
|
* crop rectangle is stored in natural-image pixels (so it stays locked across
|
|
@@ -37,6 +51,8 @@ export declare const useCropImg: () => {
|
|
|
37
51
|
init: (image: HTMLImageElement) => void;
|
|
38
52
|
crop: CropRect;
|
|
39
53
|
naturalSize: NaturalSize;
|
|
54
|
+
rotation: Rotation;
|
|
55
|
+
rotate: (direction: "left" | "right") => void;
|
|
40
56
|
aspectRatio: number | null;
|
|
41
57
|
setCropSize: (next: Partial<Pick<CropRect, "width" | "height">>) => void;
|
|
42
58
|
setCropPosition: (next: Partial<Pick<CropRect, "x" | "y">>) => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface CursorPosition {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
interface CursorAnchoredMenuProps {
|
|
7
|
+
position: CursorPosition;
|
|
8
|
+
/**
|
|
9
|
+
* Controlled, because a caller may need the menu shut while staying mounted —
|
|
10
|
+
* picking an item that opens a dialog is exactly that case.
|
|
11
|
+
*/
|
|
12
|
+
open: boolean;
|
|
13
|
+
/** Names the menu for assistive tech — Radix points `aria-labelledby` at the anchor. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Where focus goes back on close — the element that was right-clicked. */
|
|
16
|
+
returnFocusTo?: HTMLElement | null;
|
|
17
|
+
/**
|
|
18
|
+
* Asked to close. Callers that opened a dialog from an item must defer
|
|
19
|
+
* unmounting until the dialog is done, or the dialog goes with them.
|
|
20
|
+
*/
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A menu opened at the cursor by a right-click, rather than from a trigger the
|
|
26
|
+
* user can see.
|
|
27
|
+
*
|
|
28
|
+
* Extracted from `MainAreaContextMenu`, which opened the background create menu
|
|
29
|
+
* this way first; the item menus reuse it so the anchoring trick exists once.
|
|
30
|
+
*/
|
|
31
|
+
export declare const CursorAnchoredMenu: ({ position, open, label, returnFocusTo, onClose, children, }: CursorAnchoredMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { Folder } from '../../../../../shared/contracts/folders';
|
|
3
|
+
import type { DragFolderData } from '../../../types/dnd';
|
|
4
|
+
interface FolderActionsRender {
|
|
5
|
+
/** The `Menu.Item`s, for whichever trigger is rendering them. */
|
|
6
|
+
items: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* The three dialogs. Rendered outside `Menu.Root` by every caller: Radix
|
|
9
|
+
* unmounts menu content on close, and a dialog opened from a menu item has to
|
|
10
|
+
* outlive the menu that opened it.
|
|
11
|
+
*/
|
|
12
|
+
dialogs: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* True while a dialog is open. A cursor-anchored caller is mounted only as
|
|
15
|
+
* long as it has something on screen, so it needs this to know it must stay
|
|
16
|
+
* around after the menu closes.
|
|
17
|
+
*/
|
|
18
|
+
isBusy: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface FolderActionsProps {
|
|
21
|
+
/** Only the id and name are read, so a tree node satisfies this too. */
|
|
22
|
+
folder: Pick<Folder, 'id' | 'name'>;
|
|
23
|
+
/** Drag data for this folder, so the move dialog validates against its real parent. */
|
|
24
|
+
dragData: DragFolderData;
|
|
25
|
+
/**
|
|
26
|
+
* Renaming is a list affordance. The folder tree offers the same menu without
|
|
27
|
+
* it, so the two entry points there stay identical to each other.
|
|
28
|
+
*/
|
|
29
|
+
showRename?: boolean;
|
|
30
|
+
/** Receives the items and dialogs to place around whichever trigger it owns. */
|
|
31
|
+
children: (actions: FolderActionsRender) => ReactNode;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The folder actions themselves — items, dialogs and handlers — with no opinion
|
|
35
|
+
* about how the menu is opened, mirroring `AssetActions`.
|
|
36
|
+
*
|
|
37
|
+
* Both entry points (the row's `•••` trigger and the right-click menu anchored
|
|
38
|
+
* at the cursor) render what this gives them, so neither can drift from the
|
|
39
|
+
* other.
|
|
40
|
+
*
|
|
41
|
+
* A successful move or delete deselects this one folder and leaves the rest of
|
|
42
|
+
* the selection intact: they only invalidate RTK tags, so without it a
|
|
43
|
+
* `folder:<id>` key for a folder that no longer lives where the selection thinks
|
|
44
|
+
* it does would linger. A rename leaves the id valid and the folder in place, so
|
|
45
|
+
* it touches the selection not at all.
|
|
46
|
+
*/
|
|
47
|
+
export declare const FolderActions: ({ folder, dragData, showRename, children, }: FolderActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -7,15 +7,11 @@ interface FolderActionsMenuProps {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
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
|
|
11
|
-
*
|
|
12
|
-
* while open.
|
|
10
|
+
* the current multi-selection is (the bulk actions bar and the right-click menu
|
|
11
|
+
* are the selection-scoped affordances).
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `folder:<id>` key for a folder that no longer lives where the selection thinks
|
|
17
|
-
* it does would linger. A rename leaves the id valid and the folder in place, so
|
|
18
|
-
* it touches the selection not at all.
|
|
13
|
+
* The actions themselves live in `FolderActions`, shared with
|
|
14
|
+
* `FolderContextMenu`. This component is only the trigger.
|
|
19
15
|
*/
|
|
20
16
|
export declare const FolderActionsMenu: ({ folder, dragData }: FolderActionsMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
17
|
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CursorPosition } from './CursorAnchoredMenu';
|
|
2
|
+
import type { Folder } from '../../../../../shared/contracts/folders';
|
|
3
|
+
import type { DragFolderData } from '../../../types/dnd';
|
|
4
|
+
interface FolderContextMenuProps {
|
|
5
|
+
folder: Pick<Folder, 'id' | 'name'>;
|
|
6
|
+
dragData: DragFolderData;
|
|
7
|
+
/** Passed through — the folder tree offers the menu without Rename. */
|
|
8
|
+
showRename?: boolean;
|
|
9
|
+
position: CursorPosition;
|
|
10
|
+
returnFocusTo: HTMLElement | null;
|
|
11
|
+
/** Mounted only while it has something on screen, so the parent drops it on this. */
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The right-click twin of `FolderActionsMenu`: same actions, opened at the
|
|
16
|
+
* cursor. Mirrors `AssetContextMenu`, including keeping "the menu is shut" and
|
|
17
|
+
* "this is unmounted" as separate things — a dialog opened from an item is
|
|
18
|
+
* rendered here and would go with an early unmount.
|
|
19
|
+
*/
|
|
20
|
+
export declare const FolderContextMenu: ({ folder, dragData, showRename, position, returnFocusTo, onClose, }: FolderContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
interface FolderTreeProps {
|
|
2
3
|
currentFolderId: number | null;
|
|
3
4
|
/**
|
|
@@ -6,7 +7,10 @@ interface FolderTreeProps {
|
|
|
6
7
|
* */
|
|
7
8
|
showActiveFolder?: boolean;
|
|
8
9
|
onSelectFolder: (folderId: number | null) => void;
|
|
10
|
+
/** Rendered inside the sidebar, which it can listen on through `FOLDER_TREE_ROOT_SELECTOR`. */
|
|
11
|
+
backgroundContextMenu?: ReactNode;
|
|
9
12
|
}
|
|
13
|
+
export declare const FOLDER_TREE_ROOT_SELECTOR = "[data-folder-tree-root]";
|
|
10
14
|
/**
|
|
11
15
|
* Left-rail navigation for the Media Library. Fetches folder structure internally
|
|
12
16
|
* and renders:
|
|
@@ -24,5 +28,5 @@ interface FolderTreeProps {
|
|
|
24
28
|
* via `onSelectFolder` so the URL stays the single source of truth (see
|
|
25
29
|
* `useFolderNavigation`).
|
|
26
30
|
*/
|
|
27
|
-
export declare const FolderTree: ({ currentFolderId, showActiveFolder, onSelectFolder, }: FolderTreeProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const FolderTree: ({ currentFolderId, showActiveFolder, onSelectFolder, backgroundContextMenu, }: FolderTreeProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
32
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CursorPosition } from '../CursorAnchoredMenu';
|
|
2
|
+
interface FolderTreeRowMenuProps {
|
|
3
|
+
folder: {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
/** Its parent's id, so a move validates against where it actually lives. */
|
|
8
|
+
parentId: number | null;
|
|
9
|
+
/** Set by the row's right-click; null when the menu is closed. */
|
|
10
|
+
menuPosition: CursorPosition | null;
|
|
11
|
+
returnFocusTo: HTMLElement | null;
|
|
12
|
+
onCloseMenu: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Folder actions on a tree row, from either the `•••` or a right-click.
|
|
16
|
+
*
|
|
17
|
+
* Both render the same `FolderActions`, minus Rename — renaming is a list
|
|
18
|
+
* affordance and the tree does not offer it. Unlike the list, a tree row has no
|
|
19
|
+
* selection, so a right-click always means the row it landed on.
|
|
20
|
+
*
|
|
21
|
+
* One `FolderActions` serves both triggers here rather than two instances, so
|
|
22
|
+
* the dialogs it owns are not duplicated per row.
|
|
23
|
+
*/
|
|
24
|
+
export declare const FolderTreeRowMenu: ({ folder, parentId, menuPosition, returnFocusTo, onCloseMenu, }: FolderTreeRowMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { File } from '../../../../../shared/contracts/files';
|
|
3
|
+
import type { Folder } from '../../../../../shared/contracts/folders';
|
|
4
|
+
import type { DragFileData, DragFolderData } from '../../../types/dnd';
|
|
5
|
+
import type { ItemLocations } from '../../../utils/itemLocations';
|
|
6
|
+
import type { ItemKey } from '../utils/selection';
|
|
7
|
+
/**
|
|
8
|
+
* What a card or row hands over when it is right-clicked. It passes its own
|
|
9
|
+
* asset rather than a key alone, so nothing here has to resolve keys back to
|
|
10
|
+
* items — the item is already in scope where the gesture happens.
|
|
11
|
+
*/
|
|
12
|
+
export type ContextMenuPayload = {
|
|
13
|
+
kind: 'asset';
|
|
14
|
+
asset: File;
|
|
15
|
+
dragData: DragFileData;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'folder';
|
|
18
|
+
folder: Folder;
|
|
19
|
+
dragData: DragFolderData;
|
|
20
|
+
};
|
|
21
|
+
type OpenForItem = (event: React.MouseEvent, key: ItemKey, payload: ContextMenuPayload) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Called by the list items. Returns `null` outside the provider — the asset
|
|
24
|
+
* picker renders the same cards without a context menu, and a missing provider
|
|
25
|
+
* there should be a no-op rather than a crash.
|
|
26
|
+
*/
|
|
27
|
+
export declare const useItemContextMenuTrigger: () => OpenForItem | null;
|
|
28
|
+
interface ItemContextMenuProviderProps {
|
|
29
|
+
/**
|
|
30
|
+
* Real location of every loaded row, so a selection move validates each item
|
|
31
|
+
* against its own parent — same input the bulk bar takes.
|
|
32
|
+
*/
|
|
33
|
+
locations: ItemLocations;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Owns the right-click menu for the list, above both the grid and the table so
|
|
38
|
+
* one instance serves either view and the selection case has the `locations` it
|
|
39
|
+
* needs.
|
|
40
|
+
*
|
|
41
|
+
* The rule, in one place:
|
|
42
|
+
*
|
|
43
|
+
* - right-clicking an item **inside a multi-selection** opens the selection
|
|
44
|
+
* menu, acting on all of it — the file-manager behaviour, and the menu leads
|
|
45
|
+
* with the count so what it acts on is stated before the actions are
|
|
46
|
+
* - **anything else** replaces the selection with the clicked item and opens
|
|
47
|
+
* that item's own menu. That includes right-clicking an unselected item while
|
|
48
|
+
* others are selected: every file manager drops the old selection there, and
|
|
49
|
+
* the visible deselection is what stops the menu looking like it applies to
|
|
50
|
+
* items it doesn't
|
|
51
|
+
*/
|
|
52
|
+
export declare const ItemContextMenuProvider: ({ locations, children }: ItemContextMenuProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ItemLocations } from '../../../utils/itemLocations';
|
|
1
2
|
interface MainAreaContextMenuProps {
|
|
2
3
|
/** Opens the "new folder" dialog in the folder currently on screen. */
|
|
3
4
|
onCreateFolder: () => void;
|
|
@@ -11,6 +12,19 @@ interface MainAreaContextMenuProps {
|
|
|
11
12
|
* permission gate can't silently regress to permissive.
|
|
12
13
|
*/
|
|
13
14
|
disabled: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The element to listen on, found from where this renders. Defaults to the
|
|
17
|
+
* scrolling main column.
|
|
18
|
+
*/
|
|
19
|
+
containerSelector?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Real location of every loaded row. Supplying it turns on the selection
|
|
22
|
+
* section: with items selected, their bulk actions lead the menu, above the
|
|
23
|
+
* creation ones. Omitted, the menu offers creation only — which is what the
|
|
24
|
+
* folder tree wants, where the asset selection is not what you are pointing
|
|
25
|
+
* at.
|
|
26
|
+
*/
|
|
27
|
+
locations?: ItemLocations;
|
|
14
28
|
}
|
|
15
29
|
/**
|
|
16
30
|
* Drive/Dropbox-style right-click on the empty parts of the assets area: the
|
|
@@ -24,5 +38,5 @@ interface MainAreaContextMenuProps {
|
|
|
24
38
|
* row is left alone — those carry `data-native-context-menu` and keep the
|
|
25
39
|
* browser's menu (which is what you want over a thumbnail or a filename).
|
|
26
40
|
*/
|
|
27
|
-
export declare const MainAreaContextMenu: ({ onCreateFolder, onImportFiles, onImportFromUrl, disabled, }: MainAreaContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const MainAreaContextMenu: ({ onCreateFolder, onImportFiles, onImportFromUrl, disabled, containerSelector, locations, }: MainAreaContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
42
|
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ItemLocations } from '../../../utils/itemLocations';
|
|
3
|
+
interface SelectionActionsRender {
|
|
4
|
+
/** How many items the actions would act on. Zero means nothing is selected. */
|
|
5
|
+
count: number;
|
|
6
|
+
/**
|
|
7
|
+
* Whether there is anything to offer. False for a role that can read but not
|
|
8
|
+
* update; true while the RBAC check is still settling, so a menu built on it
|
|
9
|
+
* does not flash empty.
|
|
10
|
+
*/
|
|
11
|
+
hasActions: boolean;
|
|
12
|
+
/** The count label, a separator, then Move and Delete. */
|
|
13
|
+
items: ReactNode;
|
|
14
|
+
/** Rendered outside `Menu.Root` — a dialog has to outlive the menu that opened it. */
|
|
15
|
+
dialogs: ReactNode;
|
|
16
|
+
/** True while a dialog is open, for callers that unmount once nothing is on screen. */
|
|
17
|
+
isBusy: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface SelectionActionsProps {
|
|
20
|
+
/**
|
|
21
|
+
* Real location of every loaded row, so the move dialog validates each
|
|
22
|
+
* selected item against its own parent — same input the bulk bar takes.
|
|
23
|
+
*/
|
|
24
|
+
locations: ItemLocations;
|
|
25
|
+
children: (actions: SelectionActionsRender) => ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The actions that apply to the current selection — move and delete — with no
|
|
29
|
+
* opinion about which menu shows them.
|
|
30
|
+
*
|
|
31
|
+
* Two menus offer them: the one a right-click on a selected item opens, and the
|
|
32
|
+
* background menu, which prepends them to its own creation actions whenever
|
|
33
|
+
* something is selected. Sharing the items keeps the two from drifting, and
|
|
34
|
+
* keeps one copy of the dialogs they open.
|
|
35
|
+
*
|
|
36
|
+
* Only move and delete: the rest of an item's menu has no meaning for a set —
|
|
37
|
+
* there is no one link to copy and no one file to replace.
|
|
38
|
+
*/
|
|
39
|
+
export declare const SelectionActions: ({ locations, children }: SelectionActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CursorPosition } from './CursorAnchoredMenu';
|
|
2
|
+
import type { ItemLocations } from '../../../utils/itemLocations';
|
|
3
|
+
interface SelectionContextMenuProps {
|
|
4
|
+
position: CursorPosition;
|
|
5
|
+
returnFocusTo: HTMLElement | null;
|
|
6
|
+
/**
|
|
7
|
+
* Real location of every loaded row, so the move dialog validates each
|
|
8
|
+
* selected item against its own parent — same input the bulk bar takes.
|
|
9
|
+
*/
|
|
10
|
+
locations: ItemLocations;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Right-clicking one of several selected items acts on the selection, the way a
|
|
15
|
+
* file manager does.
|
|
16
|
+
*
|
|
17
|
+
* The count leads, so what the menu is about to act on is stated before the
|
|
18
|
+
* actions are. Right-clicking an item that is *not* in the selection replaces
|
|
19
|
+
* the selection with it first, and `AssetContextMenu` handles it instead.
|
|
20
|
+
*
|
|
21
|
+
* Right-clicking the background with a selection live is a different menu:
|
|
22
|
+
* `MainAreaContextMenu` shows these same actions above its creation ones.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SelectionContextMenu: ({ position, returnFocusTo, locations, onClose, }: SelectionContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -27,6 +27,11 @@ export interface AssetSelection {
|
|
|
27
27
|
selectRange: (orderedKeys: ItemKey[], targetKey: ItemKey) => void;
|
|
28
28
|
/** Header checkbox — selects every rendered item (folders and assets). */
|
|
29
29
|
selectAll: (orderedKeys: ItemKey[]) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Replaces the selection with this one key, as a right-click on an unselected
|
|
32
|
+
* item does: what the menu then acts on is what the user can see is selected.
|
|
33
|
+
*/
|
|
34
|
+
selectOnly: (key: ItemKey) => void;
|
|
30
35
|
/** Row-level "..." menu — drops one key when its item leaves the list (move, delete). */
|
|
31
36
|
deselect: (key: ItemKey) => void;
|
|
32
37
|
/** Close button / folder navigation / list-identity changes. */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which Media Library a project is configured to use, stamped on every event
|
|
3
|
+
* both trees fire. They emit the SAME event names, so without this there is no
|
|
4
|
+
* way to tell a project that kept the legacy library from one that did not.
|
|
5
|
+
*
|
|
6
|
+
* Read from the feature flag rather than from whichever tree fired the event,
|
|
7
|
+
* because the two do not line up. Several surfaces are registered outside the
|
|
8
|
+
* flag's branch in `index.ts` and so run under both settings — the Content
|
|
9
|
+
* Manager media field and picker are legacy code for everyone, and the Media
|
|
10
|
+
* Library settings page is current code for everyone. Tagging by tree would
|
|
11
|
+
* report a project running the current library as legacy the moment an editor
|
|
12
|
+
* attached an image to an entry, and vice versa.
|
|
13
|
+
*
|
|
14
|
+
* Bump these if a future revamp ever needs its own bucket.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MEDIA_LIBRARY_VERSION_CURRENT = "v2";
|
|
17
|
+
export declare const MEDIA_LIBRARY_VERSION_LEGACY = "v1";
|
|
18
|
+
export declare const getMediaLibraryVersion: () => "v2" | "v1";
|
|
@@ -47,6 +47,7 @@ var en = {
|
|
|
47
47
|
"asset-details.download.error": "Failed to download the file.",
|
|
48
48
|
"asset-details.crop.trigger": "Crop",
|
|
49
49
|
"asset-details.crop.title": "Crop & Focus area",
|
|
50
|
+
"asset-details.crop.rotate-right": "Rotate 90° right",
|
|
50
51
|
"asset-details.crop.hint": "Set the crop area with the rectangle. Pin the always-visible area with the circle.",
|
|
51
52
|
"asset-details.crop.width": "Width (px)",
|
|
52
53
|
"asset-details.crop.height": "Height (px)",
|
|
@@ -64,10 +65,10 @@ var en = {
|
|
|
64
65
|
"asset-details.crop.cancel": "Cancel",
|
|
65
66
|
"asset-details.crop.save-as-copy": "Save as copy",
|
|
66
67
|
"asset-details.crop.apply": "Apply",
|
|
67
|
-
"asset-details.crop.success": "File
|
|
68
|
+
"asset-details.crop.success": "File updated",
|
|
68
69
|
"asset-details.crop.copy-success": "Copy created.",
|
|
69
|
-
"asset-details.crop.error": "Failed to
|
|
70
|
-
"asset-details.crop.loading": "Saving the
|
|
70
|
+
"asset-details.crop.error": "Failed to update the file.",
|
|
71
|
+
"asset-details.crop.loading": "Saving the copy…",
|
|
71
72
|
"asset-details.noPreview": "No preview available",
|
|
72
73
|
"upload.generic-error": "An error occurred while uploading the file.",
|
|
73
74
|
"upload.progress": "Upload progress",
|
|
@@ -233,6 +234,7 @@ var en = {
|
|
|
233
234
|
"list.assets.selected": "{numberFolders, plural, one {1 folder} other {# folders}} - {numberAssets, plural, one {1 asset} other {# assets}}",
|
|
234
235
|
"list-assets-select": "Select {name} asset",
|
|
235
236
|
"list.assets.actions.replace": "Replace media",
|
|
237
|
+
"list.assets.context-menu.label": "Asset actions",
|
|
236
238
|
"list.assets.actions.copy-link": "Copy link to media",
|
|
237
239
|
"list.assets.actions.download": "Download media",
|
|
238
240
|
"list.assets.actions.move": "Move to folder",
|
|
@@ -240,6 +242,7 @@ var en = {
|
|
|
240
242
|
"list.assets.type-not-allowed": "This type of file is not allowed.",
|
|
241
243
|
"list.assets.to-upload": "{number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload",
|
|
242
244
|
"list.folder.actions.copy-link": "Copy link to folder",
|
|
245
|
+
"list.folder.context-menu.label": "Folder actions",
|
|
243
246
|
"list.folder.actions.copy-link.success": "Folder link copied.",
|
|
244
247
|
"list.folder.actions.copy-link.error": "Failed to copy the folder link.",
|
|
245
248
|
"list.folder.actions.rename": "Rename folder",
|
|
@@ -360,6 +363,7 @@ var en = {
|
|
|
360
363
|
"list.bulk-actions.move.success-multiple-sources": "{count, plural, =1 {# element has} other {# elements have}} been moved to {destination}",
|
|
361
364
|
"list.bulk-actions.move.error": "An error occurred while moving the items.",
|
|
362
365
|
"list.bulk-actions.delete": "Delete",
|
|
366
|
+
"list.selection.context-menu.label": "Selection actions",
|
|
363
367
|
"list.bulk-actions.delete.confirm.title": "Delete {count, plural, =1 {# item} other {# items}}?",
|
|
364
368
|
"list.bulk-actions.delete.confirm.description.are-you-sure": "Are you sure you want to delete the selected items?",
|
|
365
369
|
"list.bulk-actions.delete.confirm.description.cant-be-undone": "This action can’t be undone. Deleting a folder also removes everything inside it, and any linked content will break – media asset containers will appear empty.",
|
|
@@ -390,6 +394,7 @@ var en = {
|
|
|
390
394
|
"sidebar.tree.expand": "Expand {name}",
|
|
391
395
|
"sidebar.tree.no-subfolders": "The folder {name} has no subfolders",
|
|
392
396
|
"sidebar.tree.collapse": "Collapse {name}",
|
|
397
|
+
"sidebar.tree.actions": "Actions for {name}",
|
|
393
398
|
"sidebar.tree.empty": "No folders yet",
|
|
394
399
|
"sidebar.tree.loading": "Loading folders...",
|
|
395
400
|
"sidebar.tree.error": "Could not load folders."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -45,6 +45,7 @@ var en = {
|
|
|
45
45
|
"asset-details.download.error": "Failed to download the file.",
|
|
46
46
|
"asset-details.crop.trigger": "Crop",
|
|
47
47
|
"asset-details.crop.title": "Crop & Focus area",
|
|
48
|
+
"asset-details.crop.rotate-right": "Rotate 90° right",
|
|
48
49
|
"asset-details.crop.hint": "Set the crop area with the rectangle. Pin the always-visible area with the circle.",
|
|
49
50
|
"asset-details.crop.width": "Width (px)",
|
|
50
51
|
"asset-details.crop.height": "Height (px)",
|
|
@@ -62,10 +63,10 @@ var en = {
|
|
|
62
63
|
"asset-details.crop.cancel": "Cancel",
|
|
63
64
|
"asset-details.crop.save-as-copy": "Save as copy",
|
|
64
65
|
"asset-details.crop.apply": "Apply",
|
|
65
|
-
"asset-details.crop.success": "File
|
|
66
|
+
"asset-details.crop.success": "File updated",
|
|
66
67
|
"asset-details.crop.copy-success": "Copy created.",
|
|
67
|
-
"asset-details.crop.error": "Failed to
|
|
68
|
-
"asset-details.crop.loading": "Saving the
|
|
68
|
+
"asset-details.crop.error": "Failed to update the file.",
|
|
69
|
+
"asset-details.crop.loading": "Saving the copy…",
|
|
69
70
|
"asset-details.noPreview": "No preview available",
|
|
70
71
|
"upload.generic-error": "An error occurred while uploading the file.",
|
|
71
72
|
"upload.progress": "Upload progress",
|
|
@@ -231,6 +232,7 @@ var en = {
|
|
|
231
232
|
"list.assets.selected": "{numberFolders, plural, one {1 folder} other {# folders}} - {numberAssets, plural, one {1 asset} other {# assets}}",
|
|
232
233
|
"list-assets-select": "Select {name} asset",
|
|
233
234
|
"list.assets.actions.replace": "Replace media",
|
|
235
|
+
"list.assets.context-menu.label": "Asset actions",
|
|
234
236
|
"list.assets.actions.copy-link": "Copy link to media",
|
|
235
237
|
"list.assets.actions.download": "Download media",
|
|
236
238
|
"list.assets.actions.move": "Move to folder",
|
|
@@ -238,6 +240,7 @@ var en = {
|
|
|
238
240
|
"list.assets.type-not-allowed": "This type of file is not allowed.",
|
|
239
241
|
"list.assets.to-upload": "{number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload",
|
|
240
242
|
"list.folder.actions.copy-link": "Copy link to folder",
|
|
243
|
+
"list.folder.context-menu.label": "Folder actions",
|
|
241
244
|
"list.folder.actions.copy-link.success": "Folder link copied.",
|
|
242
245
|
"list.folder.actions.copy-link.error": "Failed to copy the folder link.",
|
|
243
246
|
"list.folder.actions.rename": "Rename folder",
|
|
@@ -358,6 +361,7 @@ var en = {
|
|
|
358
361
|
"list.bulk-actions.move.success-multiple-sources": "{count, plural, =1 {# element has} other {# elements have}} been moved to {destination}",
|
|
359
362
|
"list.bulk-actions.move.error": "An error occurred while moving the items.",
|
|
360
363
|
"list.bulk-actions.delete": "Delete",
|
|
364
|
+
"list.selection.context-menu.label": "Selection actions",
|
|
361
365
|
"list.bulk-actions.delete.confirm.title": "Delete {count, plural, =1 {# item} other {# items}}?",
|
|
362
366
|
"list.bulk-actions.delete.confirm.description.are-you-sure": "Are you sure you want to delete the selected items?",
|
|
363
367
|
"list.bulk-actions.delete.confirm.description.cant-be-undone": "This action can’t be undone. Deleting a folder also removes everything inside it, and any linked content will break – media asset containers will appear empty.",
|
|
@@ -388,6 +392,7 @@ var en = {
|
|
|
388
392
|
"sidebar.tree.expand": "Expand {name}",
|
|
389
393
|
"sidebar.tree.no-subfolders": "The folder {name} has no subfolders",
|
|
390
394
|
"sidebar.tree.collapse": "Collapse {name}",
|
|
395
|
+
"sidebar.tree.actions": "Actions for {name}",
|
|
391
396
|
"sidebar.tree.empty": "No folders yet",
|
|
392
397
|
"sidebar.tree.loading": "Loading folders...",
|
|
393
398
|
"sidebar.tree.error": "Could not load folders."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Which Media Library a project is configured to use, stamped on every event
|
|
5
|
+
* both trees fire. They emit the SAME event names, so without this there is no
|
|
6
|
+
* way to tell a project that kept the legacy library from one that did not.
|
|
7
|
+
*
|
|
8
|
+
* Read from the feature flag rather than from whichever tree fired the event,
|
|
9
|
+
* because the two do not line up. Several surfaces are registered outside the
|
|
10
|
+
* flag's branch in `index.ts` and so run under both settings — the Content
|
|
11
|
+
* Manager media field and picker are legacy code for everyone, and the Media
|
|
12
|
+
* Library settings page is current code for everyone. Tagging by tree would
|
|
13
|
+
* report a project running the current library as legacy the moment an editor
|
|
14
|
+
* attached an image to an entry, and vice versa.
|
|
15
|
+
*
|
|
16
|
+
* Bump these if a future revamp ever needs its own bucket.
|
|
17
|
+
*/ const MEDIA_LIBRARY_VERSION_CURRENT = 'v2';
|
|
18
|
+
const MEDIA_LIBRARY_VERSION_LEGACY = 'v1';
|
|
19
|
+
const getMediaLibraryVersion = ()=>window.strapi.featureFlags.isEnabled('useLegacyMediaLibrary') ? MEDIA_LIBRARY_VERSION_LEGACY : MEDIA_LIBRARY_VERSION_CURRENT;
|
|
20
|
+
|
|
21
|
+
exports.MEDIA_LIBRARY_VERSION_CURRENT = MEDIA_LIBRARY_VERSION_CURRENT;
|
|
22
|
+
exports.MEDIA_LIBRARY_VERSION_LEGACY = MEDIA_LIBRARY_VERSION_LEGACY;
|
|
23
|
+
exports.getMediaLibraryVersion = getMediaLibraryVersion;
|
|
24
|
+
//# sourceMappingURL=mediaLibraryVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaLibraryVersion.js","sources":["../../../admin/src/utils/mediaLibraryVersion.ts"],"sourcesContent":["/**\n * Which Media Library a project is configured to use, stamped on every event\n * both trees fire. They emit the SAME event names, so without this there is no\n * way to tell a project that kept the legacy library from one that did not.\n *\n * Read from the feature flag rather than from whichever tree fired the event,\n * because the two do not line up. Several surfaces are registered outside the\n * flag's branch in `index.ts` and so run under both settings — the Content\n * Manager media field and picker are legacy code for everyone, and the Media\n * Library settings page is current code for everyone. Tagging by tree would\n * report a project running the current library as legacy the moment an editor\n * attached an image to an entry, and vice versa.\n *\n * Bump these if a future revamp ever needs its own bucket.\n */\nexport const MEDIA_LIBRARY_VERSION_CURRENT = 'v2';\nexport const MEDIA_LIBRARY_VERSION_LEGACY = 'v1';\n\nexport const getMediaLibraryVersion = () =>\n window.strapi.featureFlags.isEnabled('useLegacyMediaLibrary')\n ? MEDIA_LIBRARY_VERSION_LEGACY\n : MEDIA_LIBRARY_VERSION_CURRENT;\n"],"names":["MEDIA_LIBRARY_VERSION_CURRENT","MEDIA_LIBRARY_VERSION_LEGACY","getMediaLibraryVersion","window","strapi","featureFlags","isEnabled"],"mappings":";;AAAA;;;;;;;;;;;;;;IAeO,MAAMA,6BAAAA,GAAgC;AACtC,MAAMC,+BAA+B;AAErC,MAAMC,sBAAAA,GAAyB,IACpCC,MAAAA,CAAOC,MAAM,CAACC,YAAY,CAACC,SAAS,CAAC,uBAAA,CAAA,GACjCL,4BAAAA,GACAD;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which Media Library a project is configured to use, stamped on every event
|
|
3
|
+
* both trees fire. They emit the SAME event names, so without this there is no
|
|
4
|
+
* way to tell a project that kept the legacy library from one that did not.
|
|
5
|
+
*
|
|
6
|
+
* Read from the feature flag rather than from whichever tree fired the event,
|
|
7
|
+
* because the two do not line up. Several surfaces are registered outside the
|
|
8
|
+
* flag's branch in `index.ts` and so run under both settings — the Content
|
|
9
|
+
* Manager media field and picker are legacy code for everyone, and the Media
|
|
10
|
+
* Library settings page is current code for everyone. Tagging by tree would
|
|
11
|
+
* report a project running the current library as legacy the moment an editor
|
|
12
|
+
* attached an image to an entry, and vice versa.
|
|
13
|
+
*
|
|
14
|
+
* Bump these if a future revamp ever needs its own bucket.
|
|
15
|
+
*/ const MEDIA_LIBRARY_VERSION_CURRENT = 'v2';
|
|
16
|
+
const MEDIA_LIBRARY_VERSION_LEGACY = 'v1';
|
|
17
|
+
const getMediaLibraryVersion = ()=>window.strapi.featureFlags.isEnabled('useLegacyMediaLibrary') ? MEDIA_LIBRARY_VERSION_LEGACY : MEDIA_LIBRARY_VERSION_CURRENT;
|
|
18
|
+
|
|
19
|
+
export { MEDIA_LIBRARY_VERSION_CURRENT, MEDIA_LIBRARY_VERSION_LEGACY, getMediaLibraryVersion };
|
|
20
|
+
//# sourceMappingURL=mediaLibraryVersion.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaLibraryVersion.mjs","sources":["../../../admin/src/utils/mediaLibraryVersion.ts"],"sourcesContent":["/**\n * Which Media Library a project is configured to use, stamped on every event\n * both trees fire. They emit the SAME event names, so without this there is no\n * way to tell a project that kept the legacy library from one that did not.\n *\n * Read from the feature flag rather than from whichever tree fired the event,\n * because the two do not line up. Several surfaces are registered outside the\n * flag's branch in `index.ts` and so run under both settings — the Content\n * Manager media field and picker are legacy code for everyone, and the Media\n * Library settings page is current code for everyone. Tagging by tree would\n * report a project running the current library as legacy the moment an editor\n * attached an image to an entry, and vice versa.\n *\n * Bump these if a future revamp ever needs its own bucket.\n */\nexport const MEDIA_LIBRARY_VERSION_CURRENT = 'v2';\nexport const MEDIA_LIBRARY_VERSION_LEGACY = 'v1';\n\nexport const getMediaLibraryVersion = () =>\n window.strapi.featureFlags.isEnabled('useLegacyMediaLibrary')\n ? MEDIA_LIBRARY_VERSION_LEGACY\n : MEDIA_LIBRARY_VERSION_CURRENT;\n"],"names":["MEDIA_LIBRARY_VERSION_CURRENT","MEDIA_LIBRARY_VERSION_LEGACY","getMediaLibraryVersion","window","strapi","featureFlags","isEnabled"],"mappings":"AAAA;;;;;;;;;;;;;;IAeO,MAAMA,6BAAAA,GAAgC;AACtC,MAAMC,+BAA+B;AAErC,MAAMC,sBAAAA,GAAyB,IACpCC,MAAAA,CAAOC,MAAM,CAACC,YAAY,CAACC,SAAS,CAAC,uBAAA,CAAA,GACjCL,4BAAAA,GACAD;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _ = require('lodash');
|
|
4
4
|
var utils = require('@strapi/utils');
|
|
5
5
|
var index = require('../utils/index.js');
|
|
6
6
|
var constants = require('../constants.js');
|
|
@@ -27,7 +27,7 @@ var adminFile = {
|
|
|
27
27
|
await pm.validateQuery(ctx.query);
|
|
28
28
|
const query = await utils.async.pipe(// Start by sanitizing the incoming query
|
|
29
29
|
(q)=>pm.sanitizeQuery(q), // Add the default query which should not be validated or sanitized
|
|
30
|
-
(q)=>
|
|
30
|
+
(q)=>_.merge({}, defaultQuery, q), // Add the dynamic filters based on permissions' conditions
|
|
31
31
|
(q)=>pm.addPermissionsQueryTo(q))(ctx.query);
|
|
32
32
|
const { results: files, pagination } = await index.getService('upload').findPage(query);
|
|
33
33
|
// Sign file urls for private providers
|