@strapi/upload 5.55.1 → 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/useAIMetadataAvailability.js +14 -0
- package/dist/admin/hooks/useAIMetadataAvailability.js.map +1 -0
- package/dist/admin/hooks/useAIMetadataAvailability.mjs +12 -0
- package/dist/admin/hooks/useAIMetadataAvailability.mjs.map +1 -0
- package/dist/admin/hooks/useAIMetadataEnabled.js +7 -5
- package/dist/admin/hooks/useAIMetadataEnabled.js.map +1 -1
- package/dist/admin/hooks/useAIMetadataEnabled.mjs +7 -5
- package/dist/admin/hooks/useAIMetadataEnabled.mjs.map +1 -1
- package/dist/admin/hooks/useTracking.js +4 -10
- package/dist/admin/hooks/useTracking.js.map +1 -1
- package/dist/admin/hooks/useTracking.mjs +5 -10
- package/dist/admin/hooks/useTracking.mjs.map +1 -1
- package/dist/admin/legacy/hooks/useAIMetadataAvailability.js +14 -0
- package/dist/admin/legacy/hooks/useAIMetadataAvailability.js.map +1 -0
- package/dist/admin/legacy/hooks/useAIMetadataAvailability.mjs +12 -0
- package/dist/admin/legacy/hooks/useAIMetadataAvailability.mjs.map +1 -0
- package/dist/admin/legacy/hooks/useAIMetadataEnabled.js +23 -0
- package/dist/admin/legacy/hooks/useAIMetadataEnabled.js.map +1 -0
- package/dist/admin/legacy/hooks/useAIMetadataEnabled.mjs +21 -0
- package/dist/admin/legacy/hooks/useAIMetadataEnabled.mjs.map +1 -0
- package/dist/admin/legacy/hooks/useTracking.js +5 -3
- package/dist/admin/legacy/hooks/useTracking.js.map +1 -1
- package/dist/admin/legacy/hooks/useTracking.mjs +5 -3
- 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 +6 -5
- package/dist/admin/legacy/pages/App/MediaLibrary.js.map +1 -1
- package/dist/admin/legacy/pages/App/MediaLibrary.mjs +6 -5
- 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/DeleteItemsDialog.js +4 -2
- package/dist/admin/pages/Assets/components/DeleteItemsDialog.js.map +1 -1
- package/dist/admin/pages/Assets/components/DeleteItemsDialog.mjs +4 -2
- package/dist/admin/pages/Assets/components/DeleteItemsDialog.mjs.map +1 -1
- 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 +10 -3
- package/dist/admin/pages/SettingsPage/SettingsPage.js.map +1 -1
- package/dist/admin/pages/SettingsPage/SettingsPage.mjs +10 -3
- package/dist/admin/pages/SettingsPage/SettingsPage.mjs.map +1 -1
- package/dist/admin/services/api.js.map +1 -1
- package/dist/admin/services/api.mjs.map +1 -1
- package/dist/admin/src/hooks/useAIMetadataAvailability.d.ts +5 -0
- package/dist/admin/src/hooks/useAIMetadataEnabled.d.ts +5 -3
- package/dist/admin/src/hooks/useTracking.d.ts +0 -7
- package/dist/admin/src/legacy/components/EditAssetDialog/PreviewBox/PreviewComponents.d.ts +2 -2
- package/dist/admin/src/legacy/hooks/useAIMetadataAvailability.d.ts +5 -0
- package/dist/admin/src/legacy/hooks/useAIMetadataEnabled.d.ts +12 -0
- package/dist/admin/src/legacy/hooks/useSettings.d.ts +1 -0
- package/dist/admin/src/pages/Assets/components/ActionsMenuContent.d.ts +2 -2
- 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 +9 -3
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +9 -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/bootstrap.js +7 -0
- package/dist/server/bootstrap.js.map +1 -1
- package/dist/server/bootstrap.mjs +7 -0
- package/dist/server/bootstrap.mjs.map +1 -1
- 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-file.js +51 -4
- package/dist/server/controllers/admin-folder-file.js.map +1 -1
- package/dist/server/controllers/admin-folder-file.mjs +52 -5
- package/dist/server/controllers/admin-folder-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/admin-settings.js +2 -1
- package/dist/server/controllers/admin-settings.js.map +1 -1
- package/dist/server/controllers/admin-settings.mjs +2 -1
- package/dist/server/controllers/admin-settings.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/errors.js +12 -0
- package/dist/server/errors.js.map +1 -0
- package/dist/server/errors.mjs +10 -0
- package/dist/server/errors.mjs.map +1 -0
- 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/ai-metadata-provider.js +83 -0
- package/dist/server/services/ai-metadata-provider.js.map +1 -0
- package/dist/server/services/ai-metadata-provider.mjs +61 -0
- package/dist/server/services/ai-metadata-provider.mjs.map +1 -0
- package/dist/server/services/ai-metadata-strapi-managed.js +48 -0
- package/dist/server/services/ai-metadata-strapi-managed.js.map +1 -0
- package/dist/server/services/ai-metadata-strapi-managed.mjs +46 -0
- package/dist/server/services/ai-metadata-strapi-managed.mjs.map +1 -0
- package/dist/server/services/ai-metadata.js +5 -58
- package/dist/server/services/ai-metadata.js.map +1 -1
- package/dist/server/services/ai-metadata.mjs +6 -39
- package/dist/server/services/ai-metadata.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 +9 -6
- package/dist/server/services/folder.js.map +1 -1
- package/dist/server/services/folder.mjs +9 -6
- package/dist/server/services/folder.mjs.map +1 -1
- package/dist/server/services/index.js +3 -1
- package/dist/server/services/index.js.map +1 -1
- package/dist/server/services/index.mjs +3 -1
- package/dist/server/services/index.mjs.map +1 -1
- package/dist/server/services/metrics.js +1 -1
- package/dist/server/services/metrics.js.map +1 -1
- package/dist/server/services/metrics.mjs +1 -1
- package/dist/server/services/metrics.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/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/admin-folder-file.d.ts.map +1 -1
- package/dist/server/src/controllers/admin-folder.d.ts.map +1 -1
- package/dist/server/src/controllers/admin-settings.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/errors.d.ts +6 -0
- package/dist/server/src/errors.d.ts.map +1 -0
- package/dist/server/src/index.d.ts +6 -1
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/mcp/ambient-instance.d.ts +3 -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/ai-metadata-provider.d.ts +26 -0
- package/dist/server/src/services/ai-metadata-provider.d.ts.map +1 -0
- package/dist/server/src/services/ai-metadata-strapi-managed.d.ts +7 -0
- package/dist/server/src/services/ai-metadata-strapi-managed.d.ts.map +1 -0
- package/dist/server/src/services/ai-metadata.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/folder.d.ts +5 -2
- package/dist/server/src/services/folder.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +6 -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/dist/server/src/utils/images.d.ts +2 -2
- package/dist/server/src/utils/images.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/server/utils/images.js +6 -7
- package/dist/server/utils/images.js.map +1 -1
- package/dist/server/utils/images.mjs +6 -7
- package/dist/server/utils/images.mjs.map +1 -1
- package/dist/server/utils/index.js.map +1 -1
- package/dist/server/utils/index.mjs.map +1 -1
- package/dist/shared/contracts/settings.d.ts +6 -0
- package/package.json +11 -11
- package/dist/admin/legacy/hooks/useAiAvailability.js +0 -22
- package/dist/admin/legacy/hooks/useAiAvailability.js.map +0 -1
- package/dist/admin/legacy/hooks/useAiAvailability.mjs +0 -20
- package/dist/admin/legacy/hooks/useAiAvailability.mjs.map +0 -1
- package/dist/admin/src/legacy/hooks/useAiAvailability.d.ts +0 -4
|
@@ -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";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var en = {
|
|
4
4
|
"apiError.FileTooBig": "The file is too large to be uploaded. It exceeds the maximum request size allowed by the server.",
|
|
5
|
+
"apiError.FolderContainsUnauthorizedAssetsError": "The selected folders contain assets that you do not have permission to delete.",
|
|
5
6
|
"assets.uploaded": "{number, plural, one {# asset} other {# assets}} uploaded successfully",
|
|
6
7
|
"asset-details.title": "File details",
|
|
7
8
|
"asset-details.description": "Displays file information and metadata",
|
|
@@ -46,6 +47,7 @@ var en = {
|
|
|
46
47
|
"asset-details.download.error": "Failed to download the file.",
|
|
47
48
|
"asset-details.crop.trigger": "Crop",
|
|
48
49
|
"asset-details.crop.title": "Crop & Focus area",
|
|
50
|
+
"asset-details.crop.rotate-right": "Rotate 90° right",
|
|
49
51
|
"asset-details.crop.hint": "Set the crop area with the rectangle. Pin the always-visible area with the circle.",
|
|
50
52
|
"asset-details.crop.width": "Width (px)",
|
|
51
53
|
"asset-details.crop.height": "Height (px)",
|
|
@@ -63,10 +65,10 @@ var en = {
|
|
|
63
65
|
"asset-details.crop.cancel": "Cancel",
|
|
64
66
|
"asset-details.crop.save-as-copy": "Save as copy",
|
|
65
67
|
"asset-details.crop.apply": "Apply",
|
|
66
|
-
"asset-details.crop.success": "File
|
|
68
|
+
"asset-details.crop.success": "File updated",
|
|
67
69
|
"asset-details.crop.copy-success": "Copy created.",
|
|
68
|
-
"asset-details.crop.error": "Failed to
|
|
69
|
-
"asset-details.crop.loading": "Saving the
|
|
70
|
+
"asset-details.crop.error": "Failed to update the file.",
|
|
71
|
+
"asset-details.crop.loading": "Saving the copy…",
|
|
70
72
|
"asset-details.noPreview": "No preview available",
|
|
71
73
|
"upload.generic-error": "An error occurred while uploading the file.",
|
|
72
74
|
"upload.progress": "Upload progress",
|
|
@@ -232,6 +234,7 @@ var en = {
|
|
|
232
234
|
"list.assets.selected": "{numberFolders, plural, one {1 folder} other {# folders}} - {numberAssets, plural, one {1 asset} other {# assets}}",
|
|
233
235
|
"list-assets-select": "Select {name} asset",
|
|
234
236
|
"list.assets.actions.replace": "Replace media",
|
|
237
|
+
"list.assets.context-menu.label": "Asset actions",
|
|
235
238
|
"list.assets.actions.copy-link": "Copy link to media",
|
|
236
239
|
"list.assets.actions.download": "Download media",
|
|
237
240
|
"list.assets.actions.move": "Move to folder",
|
|
@@ -239,6 +242,7 @@ var en = {
|
|
|
239
242
|
"list.assets.type-not-allowed": "This type of file is not allowed.",
|
|
240
243
|
"list.assets.to-upload": "{number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload",
|
|
241
244
|
"list.folder.actions.copy-link": "Copy link to folder",
|
|
245
|
+
"list.folder.context-menu.label": "Folder actions",
|
|
242
246
|
"list.folder.actions.copy-link.success": "Folder link copied.",
|
|
243
247
|
"list.folder.actions.copy-link.error": "Failed to copy the folder link.",
|
|
244
248
|
"list.folder.actions.rename": "Rename folder",
|
|
@@ -359,6 +363,7 @@ var en = {
|
|
|
359
363
|
"list.bulk-actions.move.success-multiple-sources": "{count, plural, =1 {# element has} other {# elements have}} been moved to {destination}",
|
|
360
364
|
"list.bulk-actions.move.error": "An error occurred while moving the items.",
|
|
361
365
|
"list.bulk-actions.delete": "Delete",
|
|
366
|
+
"list.selection.context-menu.label": "Selection actions",
|
|
362
367
|
"list.bulk-actions.delete.confirm.title": "Delete {count, plural, =1 {# item} other {# items}}?",
|
|
363
368
|
"list.bulk-actions.delete.confirm.description.are-you-sure": "Are you sure you want to delete the selected items?",
|
|
364
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.",
|
|
@@ -389,6 +394,7 @@ var en = {
|
|
|
389
394
|
"sidebar.tree.expand": "Expand {name}",
|
|
390
395
|
"sidebar.tree.no-subfolders": "The folder {name} has no subfolders",
|
|
391
396
|
"sidebar.tree.collapse": "Collapse {name}",
|
|
397
|
+
"sidebar.tree.actions": "Actions for {name}",
|
|
392
398
|
"sidebar.tree.empty": "No folders yet",
|
|
393
399
|
"sidebar.tree.loading": "Loading folders...",
|
|
394
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var en = {
|
|
2
2
|
"apiError.FileTooBig": "The file is too large to be uploaded. It exceeds the maximum request size allowed by the server.",
|
|
3
|
+
"apiError.FolderContainsUnauthorizedAssetsError": "The selected folders contain assets that you do not have permission to delete.",
|
|
3
4
|
"assets.uploaded": "{number, plural, one {# asset} other {# assets}} uploaded successfully",
|
|
4
5
|
"asset-details.title": "File details",
|
|
5
6
|
"asset-details.description": "Displays file information and metadata",
|
|
@@ -44,6 +45,7 @@ var en = {
|
|
|
44
45
|
"asset-details.download.error": "Failed to download the file.",
|
|
45
46
|
"asset-details.crop.trigger": "Crop",
|
|
46
47
|
"asset-details.crop.title": "Crop & Focus area",
|
|
48
|
+
"asset-details.crop.rotate-right": "Rotate 90° right",
|
|
47
49
|
"asset-details.crop.hint": "Set the crop area with the rectangle. Pin the always-visible area with the circle.",
|
|
48
50
|
"asset-details.crop.width": "Width (px)",
|
|
49
51
|
"asset-details.crop.height": "Height (px)",
|
|
@@ -61,10 +63,10 @@ var en = {
|
|
|
61
63
|
"asset-details.crop.cancel": "Cancel",
|
|
62
64
|
"asset-details.crop.save-as-copy": "Save as copy",
|
|
63
65
|
"asset-details.crop.apply": "Apply",
|
|
64
|
-
"asset-details.crop.success": "File
|
|
66
|
+
"asset-details.crop.success": "File updated",
|
|
65
67
|
"asset-details.crop.copy-success": "Copy created.",
|
|
66
|
-
"asset-details.crop.error": "Failed to
|
|
67
|
-
"asset-details.crop.loading": "Saving the
|
|
68
|
+
"asset-details.crop.error": "Failed to update the file.",
|
|
69
|
+
"asset-details.crop.loading": "Saving the copy…",
|
|
68
70
|
"asset-details.noPreview": "No preview available",
|
|
69
71
|
"upload.generic-error": "An error occurred while uploading the file.",
|
|
70
72
|
"upload.progress": "Upload progress",
|
|
@@ -230,6 +232,7 @@ var en = {
|
|
|
230
232
|
"list.assets.selected": "{numberFolders, plural, one {1 folder} other {# folders}} - {numberAssets, plural, one {1 asset} other {# assets}}",
|
|
231
233
|
"list-assets-select": "Select {name} asset",
|
|
232
234
|
"list.assets.actions.replace": "Replace media",
|
|
235
|
+
"list.assets.context-menu.label": "Asset actions",
|
|
233
236
|
"list.assets.actions.copy-link": "Copy link to media",
|
|
234
237
|
"list.assets.actions.download": "Download media",
|
|
235
238
|
"list.assets.actions.move": "Move to folder",
|
|
@@ -237,6 +240,7 @@ var en = {
|
|
|
237
240
|
"list.assets.type-not-allowed": "This type of file is not allowed.",
|
|
238
241
|
"list.assets.to-upload": "{number, plural, =0 {No asset} one {1 asset} other {# assets}} ready to upload",
|
|
239
242
|
"list.folder.actions.copy-link": "Copy link to folder",
|
|
243
|
+
"list.folder.context-menu.label": "Folder actions",
|
|
240
244
|
"list.folder.actions.copy-link.success": "Folder link copied.",
|
|
241
245
|
"list.folder.actions.copy-link.error": "Failed to copy the folder link.",
|
|
242
246
|
"list.folder.actions.rename": "Rename folder",
|
|
@@ -357,6 +361,7 @@ var en = {
|
|
|
357
361
|
"list.bulk-actions.move.success-multiple-sources": "{count, plural, =1 {# element has} other {# elements have}} been moved to {destination}",
|
|
358
362
|
"list.bulk-actions.move.error": "An error occurred while moving the items.",
|
|
359
363
|
"list.bulk-actions.delete": "Delete",
|
|
364
|
+
"list.selection.context-menu.label": "Selection actions",
|
|
360
365
|
"list.bulk-actions.delete.confirm.title": "Delete {count, plural, =1 {# item} other {# items}}?",
|
|
361
366
|
"list.bulk-actions.delete.confirm.description.are-you-sure": "Are you sure you want to delete the selected items?",
|
|
362
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.",
|
|
@@ -387,6 +392,7 @@ var en = {
|
|
|
387
392
|
"sidebar.tree.expand": "Expand {name}",
|
|
388
393
|
"sidebar.tree.no-subfolders": "The folder {name} has no subfolders",
|
|
389
394
|
"sidebar.tree.collapse": "Collapse {name}",
|
|
395
|
+
"sidebar.tree.actions": "Actions for {name}",
|
|
390
396
|
"sidebar.tree.empty": "No folders yet",
|
|
391
397
|
"sidebar.tree.loading": "Loading folders...",
|
|
392
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;;;;"}
|
package/dist/server/bootstrap.js
CHANGED
|
@@ -47,6 +47,13 @@ async function bootstrap({ strapi: strapi1 }) {
|
|
|
47
47
|
await registerPermissionActions();
|
|
48
48
|
await registerWebhookEvents();
|
|
49
49
|
await index.getService('weeklyMetrics').registerCron();
|
|
50
|
+
// AI metadata
|
|
51
|
+
if (strapi1.ai.admin.isAvailable()) {
|
|
52
|
+
const aiMetadataProvider = index.getService('aiMetadataProvider');
|
|
53
|
+
if (!aiMetadataProvider.hasProvider() && strapi1.ai.admin.isStrapiManagedAiEnabled()) {
|
|
54
|
+
aiMetadataProvider.registerStrapiManagedProvider();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
50
57
|
index.getService('metrics').sendUploadPluginMetrics();
|
|
51
58
|
index.getService('extensions').signFileUrlsOnDocumentService();
|
|
52
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport { getService } from './utils';\nimport { ALLOWED_SORT_STRINGS, ALLOWED_WEBHOOK_EVENTS } from './constants';\nimport { notifyMediaLibraryDefault } from './media-library-default-notice';\n\nexport async function bootstrap({ strapi }: { strapi: Core.Strapi }) {\n const defaultConfig = {\n settings: {\n sizeOptimization: true,\n responsiveDimensions: true,\n autoOrientation: false,\n aiMetadata: true,\n },\n view_configuration: {\n pageSize: 10,\n sort: ALLOWED_SORT_STRINGS[0],\n },\n };\n\n // Whether this plugin has stored settings from an earlier boot, which is what separates\n // an upgrading app from a fresh install for the Media Library default notice below.\n let isExistingApp = false;\n\n for (const [key, defaultValue] of Object.entries(defaultConfig)) {\n // set plugin store\n const configurator = strapi.store!({ type: 'plugin', name: 'upload', key });\n\n const config = await configurator.get({});\n\n if (config) {\n isExistingApp = true;\n }\n if (\n config &&\n Object.keys(defaultValue).every((key) => Object.prototype.hasOwnProperty.call(config, key))\n ) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n // if the config does not exist or does not have all the required keys\n // set from the defaultValue ensuring all required settings are present\n await configurator.set({\n value: Object.assign(defaultValue, config || {}),\n });\n }\n\n await notifyMediaLibraryDefault({ strapi, isExistingApp });\n\n await registerPermissionActions();\n await registerWebhookEvents();\n\n await getService('weeklyMetrics').registerCron();\n\n getService('metrics').sendUploadPluginMetrics();\n\n getService('extensions').signFileUrlsOnDocumentService();\n}\n\nconst registerWebhookEvents = async () =>\n Object.entries(ALLOWED_WEBHOOK_EVENTS).forEach(([key, value]) => {\n strapi.get('webhookStore').addAllowedEvent(key, value);\n });\n\nconst registerPermissionActions = async () => {\n const actions = [\n {\n section: 'plugins',\n displayName: 'Access the Media Library',\n uid: 'read',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Create (upload)',\n uid: 'assets.create',\n subCategory: 'assets',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Update (crop, details, replace) + delete',\n uid: 'assets.update',\n subCategory: 'assets',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Download',\n uid: 'assets.download',\n subCategory: 'assets',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Copy link',\n uid: 'assets.copy-link',\n subCategory: 'assets',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Configure view',\n uid: 'configure-view',\n pluginName: 'upload',\n },\n {\n section: 'settings',\n displayName: 'Access the Media Library settings page',\n uid: 'settings.read',\n category: 'media library',\n pluginName: 'upload',\n },\n ];\n\n await strapi.service('admin::permission').actionProvider.registerMany(actions);\n};\n"],"names":["bootstrap","strapi","defaultConfig","settings","sizeOptimization","responsiveDimensions","autoOrientation","aiMetadata","view_configuration","pageSize","sort","ALLOWED_SORT_STRINGS","isExistingApp","key","defaultValue","Object","entries","configurator","store","type","name","config","get","keys","every","prototype","hasOwnProperty","call","set","value","assign","notifyMediaLibraryDefault","registerPermissionActions","registerWebhookEvents","getService","registerCron","sendUploadPluginMetrics","signFileUrlsOnDocumentService","ALLOWED_WEBHOOK_EVENTS","forEach","addAllowedEvent","actions","section","displayName","uid","pluginName","subCategory","category","service","actionProvider","registerMany"],"mappings":";;;;;;AAMO,eAAeA,SAAAA,CAAU,EAAEC,MAAAA,EAAAA,OAAM,EAA2B,EAAA;AACjE,IAAA,MAAMC,aAAAA,GAAgB;QACpBC,QAAAA,EAAU;YACRC,gBAAAA,EAAkB,IAAA;YAClBC,oBAAAA,EAAsB,IAAA;YACtBC,eAAAA,EAAiB,KAAA;YACjBC,UAAAA,EAAY;AACd,SAAA;QACAC,kBAAAA,EAAoB;YAClBC,QAAAA,EAAU,EAAA;YACVC,IAAAA,EAAMC,8BAAoB,CAAC,CAAA;AAC7B;AACF,KAAA;;;AAIA,IAAA,IAAIC,aAAAA,GAAgB,KAAA;IAEpB,KAAK,MAAM,CAACC,GAAAA,EAAKC,YAAAA,CAAa,IAAIC,MAAAA,CAAOC,OAAO,CAACd,aAAAA,CAAAA,CAAgB;;QAE/D,MAAMe,YAAAA,GAAehB,OAAAA,CAAOiB,KAAK,CAAE;YAAEC,IAAAA,EAAM,QAAA;YAAUC,IAAAA,EAAM,QAAA;AAAUP,YAAAA;AAAI,SAAA,CAAA;AAEzE,QAAA,MAAMQ,MAAAA,GAAS,MAAMJ,YAAAA,CAAaK,GAAG,CAAC,EAAC,CAAA;AAEvC,QAAA,IAAID,MAAAA,EAAQ;YACVT,aAAAA,GAAgB,IAAA;AAClB,QAAA;AACA,QAAA,IACES,UACAN,MAAAA,CAAOQ,IAAI,CAACT,YAAAA,CAAAA,CAAcU,KAAK,CAAC,CAACX,GAAAA,GAAQE,MAAAA,CAAOU,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,QAAQR,GAAAA,CAAAA,CAAAA,EACtF;AAEA,YAAA;AACF,QAAA;;;QAIA,MAAMI,YAAAA,CAAaW,GAAG,CAAC;AACrBC,YAAAA,KAAAA,EAAOd,MAAAA,CAAOe,MAAM,CAAChB,YAAAA,EAAcO,UAAU,EAAC;AAChD,SAAA,CAAA;AACF,IAAA;AAEA,IAAA,MAAMU,mDAAAA,CAA0B;QAAE9B,MAAAA,EAAAA,OAAAA;AAAQW,QAAAA;AAAc,KAAA,CAAA;IAExD,MAAMoB,yBAAAA,EAAAA;IACN,MAAMC,qBAAAA,EAAAA;IAEN,MAAMC,gBAAAA,CAAW,iBAAiBC,YAAY,EAAA;
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sources":["../../server/src/bootstrap.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\n\nimport { getService } from './utils';\nimport { ALLOWED_SORT_STRINGS, ALLOWED_WEBHOOK_EVENTS } from './constants';\nimport { notifyMediaLibraryDefault } from './media-library-default-notice';\n\nexport async function bootstrap({ strapi }: { strapi: Core.Strapi }) {\n const defaultConfig = {\n settings: {\n sizeOptimization: true,\n responsiveDimensions: true,\n autoOrientation: false,\n aiMetadata: true,\n },\n view_configuration: {\n pageSize: 10,\n sort: ALLOWED_SORT_STRINGS[0],\n },\n };\n\n // Whether this plugin has stored settings from an earlier boot, which is what separates\n // an upgrading app from a fresh install for the Media Library default notice below.\n let isExistingApp = false;\n\n for (const [key, defaultValue] of Object.entries(defaultConfig)) {\n // set plugin store\n const configurator = strapi.store!({ type: 'plugin', name: 'upload', key });\n\n const config = await configurator.get({});\n\n if (config) {\n isExistingApp = true;\n }\n if (\n config &&\n Object.keys(defaultValue).every((key) => Object.prototype.hasOwnProperty.call(config, key))\n ) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n // if the config does not exist or does not have all the required keys\n // set from the defaultValue ensuring all required settings are present\n await configurator.set({\n value: Object.assign(defaultValue, config || {}),\n });\n }\n\n await notifyMediaLibraryDefault({ strapi, isExistingApp });\n\n await registerPermissionActions();\n await registerWebhookEvents();\n\n await getService('weeklyMetrics').registerCron();\n\n // AI metadata\n if (strapi.ai.admin.isAvailable()) {\n const aiMetadataProvider = getService('aiMetadataProvider');\n\n if (!aiMetadataProvider.hasProvider() && strapi.ai.admin.isStrapiManagedAiEnabled()) {\n aiMetadataProvider.registerStrapiManagedProvider();\n }\n }\n\n getService('metrics').sendUploadPluginMetrics();\n\n getService('extensions').signFileUrlsOnDocumentService();\n}\n\nconst registerWebhookEvents = async () =>\n Object.entries(ALLOWED_WEBHOOK_EVENTS).forEach(([key, value]) => {\n strapi.get('webhookStore').addAllowedEvent(key, value);\n });\n\nconst registerPermissionActions = async () => {\n const actions = [\n {\n section: 'plugins',\n displayName: 'Access the Media Library',\n uid: 'read',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Create (upload)',\n uid: 'assets.create',\n subCategory: 'assets',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Update (crop, details, replace) + delete',\n uid: 'assets.update',\n subCategory: 'assets',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Download',\n uid: 'assets.download',\n subCategory: 'assets',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Copy link',\n uid: 'assets.copy-link',\n subCategory: 'assets',\n pluginName: 'upload',\n },\n {\n section: 'plugins',\n displayName: 'Configure view',\n uid: 'configure-view',\n pluginName: 'upload',\n },\n {\n section: 'settings',\n displayName: 'Access the Media Library settings page',\n uid: 'settings.read',\n category: 'media library',\n pluginName: 'upload',\n },\n ];\n\n await strapi.service('admin::permission').actionProvider.registerMany(actions);\n};\n"],"names":["bootstrap","strapi","defaultConfig","settings","sizeOptimization","responsiveDimensions","autoOrientation","aiMetadata","view_configuration","pageSize","sort","ALLOWED_SORT_STRINGS","isExistingApp","key","defaultValue","Object","entries","configurator","store","type","name","config","get","keys","every","prototype","hasOwnProperty","call","set","value","assign","notifyMediaLibraryDefault","registerPermissionActions","registerWebhookEvents","getService","registerCron","ai","admin","isAvailable","aiMetadataProvider","hasProvider","isStrapiManagedAiEnabled","registerStrapiManagedProvider","sendUploadPluginMetrics","signFileUrlsOnDocumentService","ALLOWED_WEBHOOK_EVENTS","forEach","addAllowedEvent","actions","section","displayName","uid","pluginName","subCategory","category","service","actionProvider","registerMany"],"mappings":";;;;;;AAMO,eAAeA,SAAAA,CAAU,EAAEC,MAAAA,EAAAA,OAAM,EAA2B,EAAA;AACjE,IAAA,MAAMC,aAAAA,GAAgB;QACpBC,QAAAA,EAAU;YACRC,gBAAAA,EAAkB,IAAA;YAClBC,oBAAAA,EAAsB,IAAA;YACtBC,eAAAA,EAAiB,KAAA;YACjBC,UAAAA,EAAY;AACd,SAAA;QACAC,kBAAAA,EAAoB;YAClBC,QAAAA,EAAU,EAAA;YACVC,IAAAA,EAAMC,8BAAoB,CAAC,CAAA;AAC7B;AACF,KAAA;;;AAIA,IAAA,IAAIC,aAAAA,GAAgB,KAAA;IAEpB,KAAK,MAAM,CAACC,GAAAA,EAAKC,YAAAA,CAAa,IAAIC,MAAAA,CAAOC,OAAO,CAACd,aAAAA,CAAAA,CAAgB;;QAE/D,MAAMe,YAAAA,GAAehB,OAAAA,CAAOiB,KAAK,CAAE;YAAEC,IAAAA,EAAM,QAAA;YAAUC,IAAAA,EAAM,QAAA;AAAUP,YAAAA;AAAI,SAAA,CAAA;AAEzE,QAAA,MAAMQ,MAAAA,GAAS,MAAMJ,YAAAA,CAAaK,GAAG,CAAC,EAAC,CAAA;AAEvC,QAAA,IAAID,MAAAA,EAAQ;YACVT,aAAAA,GAAgB,IAAA;AAClB,QAAA;AACA,QAAA,IACES,UACAN,MAAAA,CAAOQ,IAAI,CAACT,YAAAA,CAAAA,CAAcU,KAAK,CAAC,CAACX,GAAAA,GAAQE,MAAAA,CAAOU,SAAS,CAACC,cAAc,CAACC,IAAI,CAACN,QAAQR,GAAAA,CAAAA,CAAAA,EACtF;AAEA,YAAA;AACF,QAAA;;;QAIA,MAAMI,YAAAA,CAAaW,GAAG,CAAC;AACrBC,YAAAA,KAAAA,EAAOd,MAAAA,CAAOe,MAAM,CAAChB,YAAAA,EAAcO,UAAU,EAAC;AAChD,SAAA,CAAA;AACF,IAAA;AAEA,IAAA,MAAMU,mDAAAA,CAA0B;QAAE9B,MAAAA,EAAAA,OAAAA;AAAQW,QAAAA;AAAc,KAAA,CAAA;IAExD,MAAMoB,yBAAAA,EAAAA;IACN,MAAMC,qBAAAA,EAAAA;IAEN,MAAMC,gBAAAA,CAAW,iBAAiBC,YAAY,EAAA;;AAG9C,IAAA,IAAIlC,QAAOmC,EAAE,CAACC,KAAK,CAACC,WAAW,EAAA,EAAI;AACjC,QAAA,MAAMC,qBAAqBL,gBAAAA,CAAW,oBAAA,CAAA;QAEtC,IAAI,CAACK,kBAAAA,CAAmBC,WAAW,EAAA,IAAMvC,OAAAA,CAAOmC,EAAE,CAACC,KAAK,CAACI,wBAAwB,EAAA,EAAI;AACnFF,YAAAA,kBAAAA,CAAmBG,6BAA6B,EAAA;AAClD,QAAA;AACF,IAAA;AAEAR,IAAAA,gBAAAA,CAAW,WAAWS,uBAAuB,EAAA;AAE7CT,IAAAA,gBAAAA,CAAW,cAAcU,6BAA6B,EAAA;AACxD;AAEA,MAAMX,qBAAAA,GAAwB,UAC5BlB,MAAAA,CAAOC,OAAO,CAAC6B,gCAAAA,CAAAA,CAAwBC,OAAO,CAAC,CAAC,CAACjC,GAAAA,EAAKgB,KAAAA,CAAM,GAAA;AAC1D5B,QAAAA,MAAAA,CAAOqB,GAAG,CAAC,cAAA,CAAA,CAAgByB,eAAe,CAAClC,GAAAA,EAAKgB,KAAAA,CAAAA;AAClD,IAAA,CAAA,CAAA;AAEF,MAAMG,yBAAAA,GAA4B,UAAA;AAChC,IAAA,MAAMgB,OAAAA,GAAU;AACd,QAAA;YACEC,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,0BAAA;YACbC,GAAAA,EAAK,MAAA;YACLC,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEH,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,iBAAA;YACbC,GAAAA,EAAK,eAAA;YACLE,WAAAA,EAAa,QAAA;YACbD,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEH,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,0CAAA;YACbC,GAAAA,EAAK,eAAA;YACLE,WAAAA,EAAa,QAAA;YACbD,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEH,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,UAAA;YACbC,GAAAA,EAAK,iBAAA;YACLE,WAAAA,EAAa,QAAA;YACbD,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEH,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,WAAA;YACbC,GAAAA,EAAK,kBAAA;YACLE,WAAAA,EAAa,QAAA;YACbD,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEH,OAAAA,EAAS,SAAA;YACTC,WAAAA,EAAa,gBAAA;YACbC,GAAAA,EAAK,gBAAA;YACLC,UAAAA,EAAY;AACd,SAAA;AACA,QAAA;YACEH,OAAAA,EAAS,UAAA;YACTC,WAAAA,EAAa,wCAAA;YACbC,GAAAA,EAAK,eAAA;YACLG,QAAAA,EAAU,eAAA;YACVF,UAAAA,EAAY;AACd;AACD,KAAA;AAED,IAAA,MAAMnD,OAAOsD,OAAO,CAAC,qBAAqBC,cAAc,CAACC,YAAY,CAACT,OAAAA,CAAAA;AACxE,CAAA;;;;"}
|
|
@@ -45,6 +45,13 @@ async function bootstrap({ strapi: strapi1 }) {
|
|
|
45
45
|
await registerPermissionActions();
|
|
46
46
|
await registerWebhookEvents();
|
|
47
47
|
await getService('weeklyMetrics').registerCron();
|
|
48
|
+
// AI metadata
|
|
49
|
+
if (strapi1.ai.admin.isAvailable()) {
|
|
50
|
+
const aiMetadataProvider = getService('aiMetadataProvider');
|
|
51
|
+
if (!aiMetadataProvider.hasProvider() && strapi1.ai.admin.isStrapiManagedAiEnabled()) {
|
|
52
|
+
aiMetadataProvider.registerStrapiManagedProvider();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
48
55
|
getService('metrics').sendUploadPluginMetrics();
|
|
49
56
|
getService('extensions').signFileUrlsOnDocumentService();
|
|
50
57
|
}
|