@strapi/upload 5.3.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{index-Bl2-6oC8.js → App-DeNaeOad.js} +94 -87
- package/dist/_chunks/App-DeNaeOad.js.map +1 -0
- package/dist/_chunks/{index-DCAQ4hHN.mjs → App-qgVMMoa7.mjs} +94 -87
- package/dist/_chunks/App-qgVMMoa7.mjs.map +1 -0
- package/dist/_chunks/{index-BM9Ayh_r.js → ConfigureTheView-AK7hc1C0.js} +42 -23
- package/dist/_chunks/ConfigureTheView-AK7hc1C0.js.map +1 -0
- package/dist/_chunks/{index-C_cWV2yS.mjs → ConfigureTheView-C30XDPKG.mjs} +24 -23
- package/dist/_chunks/ConfigureTheView-C30XDPKG.mjs.map +1 -0
- package/dist/_chunks/{index-C1MSWEyZ.js → SettingsPage-C60zLXmE.js} +61 -41
- package/dist/_chunks/SettingsPage-C60zLXmE.js.map +1 -0
- package/dist/_chunks/{index-BWIqjWzC.mjs → SettingsPage-DV0sB7xY.mjs} +45 -43
- package/dist/_chunks/SettingsPage-DV0sB7xY.mjs.map +1 -0
- package/dist/_chunks/{index-BwEfHu6y.mjs → index-DFekBoCC.mjs} +142 -236
- package/dist/_chunks/index-DFekBoCC.mjs.map +1 -0
- package/dist/_chunks/{index-YwynuEzj.js → index-DwVjDEMt.js} +119 -214
- package/dist/_chunks/index-DwVjDEMt.js.map +1 -0
- package/dist/admin/index.js +2 -2
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/AssetCard/AssetCardBase.d.ts +1 -1
- package/dist/admin/src/components/AssetCard/UploadingAssetCard.d.ts +1 -1
- package/dist/admin/src/components/AssetCard/VideoPreview.d.ts +1 -1
- package/dist/admin/src/components/AssetDialog/BrowseStep/{index.d.ts → BrowseStep.d.ts} +1 -1
- package/dist/admin/src/components/AssetDialog/BrowseStep/PageSize.d.ts +2 -2
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/Pagination.d.ts +4 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/PaginationFooter.d.ts +9 -0
- package/dist/admin/src/components/AssetDialog/BrowseStep/SearchAsset/{index.d.ts → SearchAsset.d.ts} +2 -2
- package/dist/admin/src/components/AssetGridList/{index.d.ts → AssetGridList.d.ts} +1 -2
- package/dist/admin/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -2
- package/dist/admin/src/components/EditFolderDialog/EditFolderDialog.d.ts +3 -1
- package/dist/admin/src/components/EditFolderDialog/RemoveFolderDialog.d.ts +1 -1
- package/dist/admin/src/components/FilterList/{index.d.ts → FilterList.d.ts} +3 -3
- package/dist/admin/src/components/FilterList/FilterTag.d.ts +3 -3
- package/dist/admin/src/components/FilterPopover/{index.d.ts → FilterPopover.d.ts} +3 -3
- package/dist/admin/src/components/FilterPopover/FilterValueInput.d.ts +2 -2
- package/dist/admin/src/components/FilterPopover/utils/getFilterList.d.ts +2 -2
- package/dist/admin/src/components/FolderGridList/FolderGridList.d.ts +1 -2
- package/dist/admin/src/components/MediaLibraryDialog/{index.d.ts → MediaLibraryDialog.d.ts} +1 -2
- package/dist/admin/src/components/MediaLibraryInput/{index.d.ts → MediaLibraryInput.d.ts} +2 -2
- package/dist/admin/src/components/SelectTree/Option.d.ts +2 -2
- package/dist/admin/src/components/SelectTree/SelectTree.d.ts +2 -3
- package/dist/admin/src/components/SelectTree/utils/flattenTree.d.ts +1 -1
- package/dist/admin/src/components/SelectTree/utils/getOpenValues.d.ts +2 -2
- package/dist/admin/src/components/SelectTree/utils/getValuesToClose.d.ts +2 -2
- package/dist/admin/src/components/SortPicker/{index.d.ts → SortPicker.d.ts} +2 -2
- package/dist/admin/src/components/UploadAssetDialog/PendingAssetStep/PendingAssetStep.d.ts +1 -1
- package/dist/admin/src/components/UploadAssetDialog/UploadAssetDialog.d.ts +1 -1
- package/dist/admin/src/{newConstants.d.ts → constants.d.ts} +1 -0
- package/dist/admin/src/hooks/useEditAsset.d.ts +4 -4
- package/dist/admin/src/hooks/useEditFolder.d.ts +4 -4
- package/dist/admin/src/hooks/useFolderStructure.d.ts +1 -1
- package/dist/admin/src/hooks/useModalQueryParams.d.ts +1 -2
- package/dist/admin/src/hooks/useSelectionState.d.ts +1 -1
- package/dist/admin/src/hooks/useUpload.d.ts +1 -1
- package/dist/admin/src/index.d.ts +3 -0
- package/dist/admin/src/pages/App/App.d.ts +1 -0
- package/dist/admin/src/pages/App/ConfigureTheView/ConfigureTheView.d.ts +6 -0
- package/dist/admin/src/pages/App/ConfigureTheView/components/Settings.d.ts +13 -0
- package/dist/admin/src/pages/App/ConfigureTheView/state/actionTypes.d.ts +2 -0
- package/dist/admin/src/pages/App/ConfigureTheView/state/actions.d.ts +12 -0
- package/dist/admin/src/pages/App/ConfigureTheView/state/init.d.ts +8 -0
- package/dist/admin/src/pages/App/ConfigureTheView/state/reducer.d.ts +15 -0
- package/dist/admin/src/pages/App/MediaLibrary/MediaLibrary.d.ts +1 -0
- package/dist/admin/src/pages/App/MediaLibrary/components/BulkActions.d.ts +15 -0
- package/dist/admin/src/pages/App/MediaLibrary/components/BulkDeleteButton.d.ts +7 -0
- package/dist/admin/src/pages/App/MediaLibrary/components/BulkMoveButton.d.ts +15 -0
- package/dist/admin/src/pages/App/MediaLibrary/components/EmptyOrNoPermissions.d.ts +7 -0
- package/dist/admin/src/pages/App/MediaLibrary/components/Filters.d.ts +1 -0
- package/dist/admin/src/pages/App/MediaLibrary/components/Header.d.ts +22 -0
- package/dist/admin/src/pages/App/components/BulkActions.d.ts +15 -0
- package/dist/admin/src/pages/App/components/BulkDeleteButton.d.ts +10 -0
- package/dist/admin/src/pages/App/components/BulkMoveButton.d.ts +15 -0
- package/dist/admin/src/pages/App/components/EmptyOrNoPermissions.d.ts +8 -0
- package/dist/admin/src/pages/App/components/Filters.d.ts +1 -0
- package/dist/admin/src/pages/App/components/Header.d.ts +13 -0
- package/dist/admin/src/pages/SettingsPage/SettingsPage.d.ts +2 -0
- package/dist/admin/src/pages/SettingsPage/init.d.ts +2 -0
- package/dist/admin/src/pages/SettingsPage/reducer.d.ts +27 -0
- package/dist/admin/src/pluginId.d.ts +0 -1
- package/dist/admin/src/utils/getBreadcrumbDataML.d.ts +1 -1
- package/dist/admin/src/utils/rawFileToAsset.d.ts +2 -2
- package/dist/admin/src/utils/toSingularTypes.d.ts +0 -1
- package/dist/admin/src/utils/typeFromMime.d.ts +1 -1
- package/dist/admin/src/utils/urlsToAssets.d.ts +2 -2
- package/dist/shared/contracts/settings.d.ts +3 -2
- package/package.json +8 -8
- package/dist/_chunks/index-BM9Ayh_r.js.map +0 -1
- package/dist/_chunks/index-BWIqjWzC.mjs.map +0 -1
- package/dist/_chunks/index-Bl2-6oC8.js.map +0 -1
- package/dist/_chunks/index-BwEfHu6y.mjs.map +0 -1
- package/dist/_chunks/index-C1MSWEyZ.js.map +0 -1
- package/dist/_chunks/index-C_cWV2yS.mjs.map +0 -1
- package/dist/_chunks/index-DCAQ4hHN.mjs.map +0 -1
- package/dist/_chunks/index-YwynuEzj.js.map +0 -1
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/PaginationContext.d.ts +0 -9
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/components.d.ts +0 -15
- package/dist/admin/src/components/AssetDialog/BrowseStep/PaginationFooter/index.d.ts +0 -9
- package/dist/admin/src/components/Breadcrumbs/index.d.ts +0 -1
- package/dist/admin/src/components/BulkMoveDialog/index.d.ts +0 -1
- package/dist/admin/src/components/ContextInfo/index.d.ts +0 -1
- package/dist/admin/src/components/EditFolderDialog/ModalHeader/index.d.ts +0 -2
- package/dist/admin/src/components/EditFolderDialog/index.d.ts +0 -1
- package/dist/admin/src/components/FolderCard/FolderCard/index.d.ts +0 -1
- package/dist/admin/src/components/FolderCard/FolderCardBody/index.d.ts +0 -1
- package/dist/admin/src/components/FolderCard/FolderCardCheckbox/index.d.ts +0 -1
- package/dist/admin/src/components/FolderCard/index.d.ts +0 -4
- package/dist/admin/src/components/FolderGridList/index.d.ts +0 -1
- package/dist/admin/src/components/SelectTree/index.d.ts +0 -2
- /package/dist/admin/src/components/AssetDialog/{index.d.ts → AssetDialog.d.ts} +0 -0
- /package/dist/admin/src/components/AssetDialog/SelectedStep/{index.d.ts → SelectedStep.d.ts} +0 -0
- /package/dist/admin/src/components/CopyLinkButton/{index.d.ts → CopyLinkButton.d.ts} +0 -0
- /package/dist/admin/src/components/EditAssetDialog/{index.d.ts → EditAssetContent.d.ts} +0 -0
- /package/dist/admin/src/components/EditAssetDialog/PreviewBox/{index.d.ts → PreviewBox.d.ts} +0 -0
- /package/dist/admin/src/components/EditAssetDialog/PreviewBox/{components.d.ts → PreviewComponents.d.ts} +0 -0
- /package/dist/admin/src/components/EmptyAssets/{index.d.ts → EmptyAssets.d.ts} +0 -0
- /package/dist/admin/src/components/FolderCard/FolderCardBodyAction/{index.d.ts → FolderCardBodyAction.d.ts} +0 -0
- /package/dist/admin/src/components/TableList/{index.d.ts → TableList.d.ts} +0 -0
- /package/dist/admin/src/components/UploadProgress/{index.d.ts → UploadProgress.d.ts} +0 -0
- /package/dist/admin/src/hooks/utils/{rename-keys.d.ts → renameKeys.d.ts} +0 -0
|
@@ -21,7 +21,6 @@ const reactDnd = require("react-dnd");
|
|
|
21
21
|
const reactRouterDom = require("react-router-dom");
|
|
22
22
|
const symbols = require("@strapi/icons/symbols");
|
|
23
23
|
const parseISO = require("date-fns/parseISO");
|
|
24
|
-
const PropTypes = require("prop-types");
|
|
25
24
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
26
25
|
function _interopNamespace(e) {
|
|
27
26
|
if (e && e.__esModule)
|
|
@@ -49,7 +48,6 @@ const ReactSelect__default = /* @__PURE__ */ _interopDefault(ReactSelect);
|
|
|
49
48
|
const Cropper__default = /* @__PURE__ */ _interopDefault(Cropper);
|
|
50
49
|
const isEmpty__default = /* @__PURE__ */ _interopDefault(isEmpty);
|
|
51
50
|
const parseISO__default = /* @__PURE__ */ _interopDefault(parseISO);
|
|
52
|
-
const PropTypes__default = /* @__PURE__ */ _interopDefault(PropTypes);
|
|
53
51
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
54
52
|
const v = glob[path];
|
|
55
53
|
if (v) {
|
|
@@ -60,7 +58,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
|
60
58
|
});
|
|
61
59
|
};
|
|
62
60
|
const name$1 = "@strapi/upload";
|
|
63
|
-
const version = "5.
|
|
61
|
+
const version = "5.4.0";
|
|
64
62
|
const description = "Makes it easy to upload images and files to your Strapi Application.";
|
|
65
63
|
const license = "SEE LICENSE IN LICENSE";
|
|
66
64
|
const author = {
|
|
@@ -78,7 +76,7 @@ const maintainers = [
|
|
|
78
76
|
const exports$1 = {
|
|
79
77
|
"./strapi-admin": {
|
|
80
78
|
types: "./dist/admin/src/index.d.ts",
|
|
81
|
-
source: "./admin/src/index.
|
|
79
|
+
source: "./admin/src/index.ts",
|
|
82
80
|
"import": "./dist/admin/index.mjs",
|
|
83
81
|
require: "./dist/admin/index.js",
|
|
84
82
|
"default": "./dist/admin/index.js"
|
|
@@ -118,8 +116,8 @@ const scripts = {
|
|
|
118
116
|
const dependencies = {
|
|
119
117
|
"@strapi/design-system": "2.0.0-rc.12",
|
|
120
118
|
"@strapi/icons": "2.0.0-rc.12",
|
|
121
|
-
"@strapi/provider-upload-local": "
|
|
122
|
-
"@strapi/utils": "
|
|
119
|
+
"@strapi/provider-upload-local": "5.4.0",
|
|
120
|
+
"@strapi/utils": "5.4.0",
|
|
123
121
|
"byte-size": "8.1.1",
|
|
124
122
|
cropperjs: "1.6.1",
|
|
125
123
|
"date-fns": "2.30.0",
|
|
@@ -141,9 +139,9 @@ const dependencies = {
|
|
|
141
139
|
yup: "0.32.9"
|
|
142
140
|
};
|
|
143
141
|
const devDependencies = {
|
|
144
|
-
"@strapi/admin": "
|
|
142
|
+
"@strapi/admin": "5.4.0",
|
|
145
143
|
"@strapi/pack-up": "5.0.0",
|
|
146
|
-
"@strapi/types": "
|
|
144
|
+
"@strapi/types": "5.4.0",
|
|
147
145
|
"@testing-library/dom": "10.1.0",
|
|
148
146
|
"@testing-library/react": "15.0.7",
|
|
149
147
|
"@testing-library/user-event": "14.5.2",
|
|
@@ -162,7 +160,7 @@ const devDependencies = {
|
|
|
162
160
|
"styled-components": "6.1.8"
|
|
163
161
|
};
|
|
164
162
|
const peerDependencies = {
|
|
165
|
-
"@strapi/admin": "^5.0.0
|
|
163
|
+
"@strapi/admin": "^5.0.0",
|
|
166
164
|
react: "^17.0.0 || ^18.0.0",
|
|
167
165
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
168
166
|
"react-router-dom": "^6.0.0",
|
|
@@ -179,6 +177,7 @@ const strapi = {
|
|
|
179
177
|
required: true,
|
|
180
178
|
kind: "plugin"
|
|
181
179
|
};
|
|
180
|
+
const gitHead = "7d785703f52464577d077c4618cbe68b44f8a9cd";
|
|
182
181
|
const pluginPkg = {
|
|
183
182
|
name: name$1,
|
|
184
183
|
version,
|
|
@@ -193,7 +192,8 @@ const pluginPkg = {
|
|
|
193
192
|
devDependencies,
|
|
194
193
|
peerDependencies,
|
|
195
194
|
engines,
|
|
196
|
-
strapi
|
|
195
|
+
strapi,
|
|
196
|
+
gitHead
|
|
197
197
|
};
|
|
198
198
|
const pluginId = pluginPkg.name.replace(/^@strapi\//i, "");
|
|
199
199
|
const useAssets = ({ skipWhen = false, query = {} } = {}) => {
|
|
@@ -508,7 +508,7 @@ function getAPIInnerErrors(error, { getTrad: getTrad2 }) {
|
|
|
508
508
|
}
|
|
509
509
|
const getTrad = (id) => `${pluginId}.${id}`;
|
|
510
510
|
const getBreadcrumbDataCM = (folder) => {
|
|
511
|
-
|
|
511
|
+
const data = [
|
|
512
512
|
{
|
|
513
513
|
id: null,
|
|
514
514
|
label: { id: getTrad("plugin.name"), defaultMessage: "Media Library" }
|
|
@@ -560,7 +560,7 @@ const getFolderParents = (folders, currentFolderId) => {
|
|
|
560
560
|
}
|
|
561
561
|
let { parent } = currentFolder;
|
|
562
562
|
while (parent !== void 0) {
|
|
563
|
-
|
|
563
|
+
const parentToStore = flatFolders.find(({ value }) => value === parent);
|
|
564
564
|
parents.push({ id: parentToStore?.value, label: parentToStore?.label });
|
|
565
565
|
parent = parentToStore?.parent;
|
|
566
566
|
}
|
|
@@ -573,9 +573,9 @@ const move = (array, oldIndex, newIndex) => {
|
|
|
573
573
|
array.splice(newIndex, 0, array.splice(oldIndex, 1)[0]);
|
|
574
574
|
return array;
|
|
575
575
|
};
|
|
576
|
-
const moveElement = (array,
|
|
577
|
-
const newIndex =
|
|
578
|
-
return move(array,
|
|
576
|
+
const moveElement = (array, index, offset) => {
|
|
577
|
+
const newIndex = index + offset;
|
|
578
|
+
return move(array, index, newIndex);
|
|
579
579
|
};
|
|
580
580
|
const prefixPluginTranslations = (trad, pluginId2) => {
|
|
581
581
|
if (!pluginId2) {
|
|
@@ -694,7 +694,7 @@ var AssetSource = /* @__PURE__ */ ((AssetSource2) => {
|
|
|
694
694
|
AssetSource2["Computer"] = "computer";
|
|
695
695
|
return AssetSource2;
|
|
696
696
|
})(AssetSource || {});
|
|
697
|
-
const PERMISSIONS
|
|
697
|
+
const PERMISSIONS = {
|
|
698
698
|
// This permission regards the main component (App) and is used to tell
|
|
699
699
|
// If the plugin link should be displayed in the menu
|
|
700
700
|
// And also if the plugin is accessible. This use case is found when a user types the url of the
|
|
@@ -789,7 +789,7 @@ const tableHeaders = [
|
|
|
789
789
|
type: "date"
|
|
790
790
|
}
|
|
791
791
|
];
|
|
792
|
-
const sortOptions
|
|
792
|
+
const sortOptions = [
|
|
793
793
|
{ key: "sort.created_at_desc", value: "createdAt:DESC" },
|
|
794
794
|
{ key: "sort.created_at_asc", value: "createdAt:ASC" },
|
|
795
795
|
{ key: "sort.name_asc", value: "name:ASC" },
|
|
@@ -797,15 +797,16 @@ const sortOptions$1 = [
|
|
|
797
797
|
{ key: "sort.updated_at_desc", value: "updatedAt:DESC" },
|
|
798
798
|
{ key: "sort.updated_at_asc", value: "updatedAt:ASC" }
|
|
799
799
|
];
|
|
800
|
-
const
|
|
800
|
+
const pageSizes = [10, 20, 50, 100];
|
|
801
|
+
const localStorageKeys = {
|
|
801
802
|
modalView: `STRAPI_UPLOAD_MODAL_VIEW`,
|
|
802
803
|
view: `STRAPI_UPLOAD_LIBRARY_VIEW`
|
|
803
804
|
};
|
|
804
|
-
const viewOptions
|
|
805
|
+
const viewOptions = {
|
|
805
806
|
GRID: 0,
|
|
806
807
|
LIST: 1
|
|
807
808
|
};
|
|
808
|
-
const { main, ...restPermissions } = PERMISSIONS
|
|
809
|
+
const { main: _main, ...restPermissions } = PERMISSIONS;
|
|
809
810
|
const useMediaLibraryPermissions = () => {
|
|
810
811
|
const { allowedActions, isLoading } = strapiAdmin.useRBAC(restPermissions);
|
|
811
812
|
return { ...allowedActions, isLoading };
|
|
@@ -940,13 +941,13 @@ const useModalQueryParams = (initialState) => {
|
|
|
940
941
|
const useSelectionState = (keys, initialValue) => {
|
|
941
942
|
const [selections, setSelections] = React__namespace.useState(initialValue);
|
|
942
943
|
const selectOne = (selection) => {
|
|
943
|
-
const
|
|
944
|
+
const index = selections.findIndex(
|
|
944
945
|
(currentSelection) => keys.every((key) => currentSelection[key] === selection[key])
|
|
945
946
|
);
|
|
946
|
-
if (
|
|
947
|
+
if (index > -1) {
|
|
947
948
|
setSelections((prevSelected) => [
|
|
948
|
-
...prevSelected.slice(0,
|
|
949
|
-
...prevSelected.slice(
|
|
949
|
+
...prevSelected.slice(0, index),
|
|
950
|
+
...prevSelected.slice(index + 1)
|
|
950
951
|
]);
|
|
951
952
|
} else {
|
|
952
953
|
setSelections((prevSelected) => [...prevSelected, selection]);
|
|
@@ -960,10 +961,10 @@ const useSelectionState = (keys, initialValue) => {
|
|
|
960
961
|
}
|
|
961
962
|
};
|
|
962
963
|
const selectOnly = (nextSelection) => {
|
|
963
|
-
const
|
|
964
|
+
const index = selections.findIndex(
|
|
964
965
|
(currentSelection) => keys.every((key) => currentSelection[key] === nextSelection[key])
|
|
965
966
|
);
|
|
966
|
-
if (
|
|
967
|
+
if (index > -1) {
|
|
967
968
|
setSelections([]);
|
|
968
969
|
} else {
|
|
969
970
|
setSelections([nextSelection]);
|
|
@@ -1144,7 +1145,7 @@ const Option = ({ children, data, selectProps, ...props }) => {
|
|
|
1144
1145
|
] }) });
|
|
1145
1146
|
};
|
|
1146
1147
|
function getOpenValues(options, defaultValue = {}) {
|
|
1147
|
-
|
|
1148
|
+
const values = [];
|
|
1148
1149
|
const { value } = defaultValue;
|
|
1149
1150
|
const option = options.find((option2) => option2.value === value);
|
|
1150
1151
|
if (!option) {
|
|
@@ -1351,6 +1352,7 @@ const getSelectStyles = (theme, error) => {
|
|
|
1351
1352
|
paddingRight: theme.spaces[1],
|
|
1352
1353
|
paddingBottom: theme.spaces[1]
|
|
1353
1354
|
}),
|
|
1355
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1354
1356
|
option(base, state) {
|
|
1355
1357
|
let backgroundColor = base?.backgroundColor;
|
|
1356
1358
|
if (state.isFocused || state.isSelected) {
|
|
@@ -1423,6 +1425,7 @@ const useCropImg = () => {
|
|
|
1423
1425
|
zoomable: false,
|
|
1424
1426
|
cropBoxResizable: true,
|
|
1425
1427
|
background: false,
|
|
1428
|
+
checkCrossOrigin: false,
|
|
1426
1429
|
crop: handleResize
|
|
1427
1430
|
});
|
|
1428
1431
|
setIsCropping(true);
|
|
@@ -1870,7 +1873,7 @@ const PreviewBox = ({
|
|
|
1870
1873
|
nextAsset.mime,
|
|
1871
1874
|
nextAsset.updatedAt
|
|
1872
1875
|
);
|
|
1873
|
-
await upload({ name: file.name, rawFile: file }, asset.folder?.id);
|
|
1876
|
+
await upload({ name: file.name, rawFile: file }, asset.folder?.id ? asset.folder.id : null);
|
|
1874
1877
|
trackUsage("didCropFile", { duplicatedFile: true, location: trackedLocation });
|
|
1875
1878
|
setHasCropIntent(false);
|
|
1876
1879
|
onCropFinish();
|
|
@@ -2004,6 +2007,7 @@ const ReplaceMediaButton = ({
|
|
|
2004
2007
|
accept: acceptedMime,
|
|
2005
2008
|
type: "file",
|
|
2006
2009
|
name: "file",
|
|
2010
|
+
"data-testid": "file-input",
|
|
2007
2011
|
tabIndex: -1,
|
|
2008
2012
|
ref: inputRef,
|
|
2009
2013
|
onChange: handleChange,
|
|
@@ -2140,7 +2144,7 @@ const EditAssetContent = ({
|
|
|
2140
2144
|
id: getTrad("modal.file-details.size"),
|
|
2141
2145
|
defaultMessage: "Size"
|
|
2142
2146
|
}),
|
|
2143
|
-
value: formatBytes(asset?.size)
|
|
2147
|
+
value: formatBytes(asset?.size ? asset.size : 0)
|
|
2144
2148
|
},
|
|
2145
2149
|
{
|
|
2146
2150
|
label: formatMessage({
|
|
@@ -2154,7 +2158,7 @@ const EditAssetContent = ({
|
|
|
2154
2158
|
id: getTrad("modal.file-details.date"),
|
|
2155
2159
|
defaultMessage: "Date"
|
|
2156
2160
|
}),
|
|
2157
|
-
value: formatDate(new Date(asset?.createdAt))
|
|
2161
|
+
value: formatDate(new Date(asset?.createdAt ? asset.createdAt : ""))
|
|
2158
2162
|
},
|
|
2159
2163
|
{
|
|
2160
2164
|
label: formatMessage({
|
|
@@ -2168,7 +2172,7 @@ const EditAssetContent = ({
|
|
|
2168
2172
|
id: getTrad("modal.file-details.id"),
|
|
2169
2173
|
defaultMessage: "Asset ID"
|
|
2170
2174
|
}),
|
|
2171
|
-
value: asset?.id
|
|
2175
|
+
value: asset?.id ? asset.id : null
|
|
2172
2176
|
}
|
|
2173
2177
|
]
|
|
2174
2178
|
}
|
|
@@ -2265,13 +2269,13 @@ const EditAssetContent = ({
|
|
|
2265
2269
|
] }) })
|
|
2266
2270
|
] }) }),
|
|
2267
2271
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
|
|
2268
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: () => handleClose(values), variant: "tertiary", children: formatMessage({ id: "global.cancel", defaultMessage: "Cancel" }) }),
|
|
2272
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: () => handleClose({ ...values }), variant: "tertiary", children: formatMessage({ id: "global.cancel", defaultMessage: "Cancel" }) }),
|
|
2269
2273
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
2270
2274
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2271
2275
|
ReplaceMediaButton,
|
|
2272
2276
|
{
|
|
2273
2277
|
onSelectMedia: setReplacementFile,
|
|
2274
|
-
acceptedMime: asset?.mime,
|
|
2278
|
+
acceptedMime: asset?.mime ?? "",
|
|
2275
2279
|
disabled: formDisabled,
|
|
2276
2280
|
trackedLocation
|
|
2277
2281
|
}
|
|
@@ -2363,9 +2367,9 @@ const useEditFolder = () => {
|
|
|
2363
2367
|
const queryClient = reactQuery.useQueryClient();
|
|
2364
2368
|
const { put, post } = strapiAdmin.useFetchClient();
|
|
2365
2369
|
const mutation = reactQuery.useMutation((...args) => editFolderRequest(put, post, ...args), {
|
|
2366
|
-
onSuccess() {
|
|
2367
|
-
queryClient.refetchQueries([pluginId, "folders"], { active: true });
|
|
2368
|
-
queryClient.refetchQueries([pluginId, "folder", "structure"], { active: true });
|
|
2370
|
+
async onSuccess() {
|
|
2371
|
+
await queryClient.refetchQueries([pluginId, "folders"], { active: true });
|
|
2372
|
+
await queryClient.refetchQueries([pluginId, "folder", "structure"], { active: true });
|
|
2369
2373
|
}
|
|
2370
2374
|
});
|
|
2371
2375
|
const editFolder = (attrs, id) => mutation.mutateAsync({ attrs, id });
|
|
@@ -2821,7 +2825,6 @@ const VideoPreview = ({
|
|
|
2821
2825
|
onLoadDuration = () => {
|
|
2822
2826
|
},
|
|
2823
2827
|
alt,
|
|
2824
|
-
size = "M",
|
|
2825
2828
|
...props
|
|
2826
2829
|
}) => {
|
|
2827
2830
|
const handleTimeUpdate = (e) => {
|
|
@@ -2925,7 +2928,7 @@ const AssetCard = ({
|
|
|
2925
2928
|
}
|
|
2926
2929
|
return /* @__PURE__ */ jsxRuntime.jsx(DocAssetCard, { ...commonAssetCardProps });
|
|
2927
2930
|
};
|
|
2928
|
-
const Draggable = ({ children, id, index
|
|
2931
|
+
const Draggable = ({ children, id, index, moveItem }) => {
|
|
2929
2932
|
const ref = React__namespace.useRef(null);
|
|
2930
2933
|
const [, drop] = reactDnd.useDrop({
|
|
2931
2934
|
accept: "draggable",
|
|
@@ -2934,15 +2937,15 @@ const Draggable = ({ children, id, index: index2, moveItem }) => {
|
|
|
2934
2937
|
return;
|
|
2935
2938
|
}
|
|
2936
2939
|
if (hoveredOverItem.id !== id) {
|
|
2937
|
-
moveItem(hoveredOverItem.index,
|
|
2938
|
-
hoveredOverItem.index =
|
|
2940
|
+
moveItem(hoveredOverItem.index, index);
|
|
2941
|
+
hoveredOverItem.index = index;
|
|
2939
2942
|
}
|
|
2940
2943
|
}
|
|
2941
2944
|
});
|
|
2942
2945
|
const [{ isDragging }, drag] = reactDnd.useDrag({
|
|
2943
2946
|
type: "draggable",
|
|
2944
2947
|
item() {
|
|
2945
|
-
return { index
|
|
2948
|
+
return { index, id };
|
|
2946
2949
|
},
|
|
2947
2950
|
collect: (monitor) => ({
|
|
2948
2951
|
isDragging: monitor.isDragging()
|
|
@@ -2964,10 +2967,10 @@ const AssetGridList = ({
|
|
|
2964
2967
|
}) => {
|
|
2965
2968
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.KeyboardNavigable, { tagName: "article", children: [
|
|
2966
2969
|
title && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "delta", fontWeight: "semiBold", children: title }) }),
|
|
2967
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: assets.map((asset,
|
|
2970
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: assets.map((asset, index) => {
|
|
2968
2971
|
const isSelected = !!selectedAssets.find((currentAsset) => currentAsset.id === asset.id);
|
|
2969
2972
|
if (onReorderAsset) {
|
|
2970
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, height: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(Draggable, { index
|
|
2973
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, height: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(Draggable, { index, moveItem: onReorderAsset, id: asset.id, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2971
2974
|
AssetCard,
|
|
2972
2975
|
{
|
|
2973
2976
|
allowedTypes,
|
|
@@ -3053,12 +3056,12 @@ const Breadcrumbs = ({
|
|
|
3053
3056
|
...props
|
|
3054
3057
|
}) => {
|
|
3055
3058
|
const { formatMessage } = reactIntl.useIntl();
|
|
3056
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Breadcrumbs, { ...props, children: breadcrumbs.map((crumb,
|
|
3059
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Breadcrumbs, { ...props, children: breadcrumbs.map((crumb, index) => {
|
|
3057
3060
|
if (Array.isArray(crumb)) {
|
|
3058
3061
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3059
3062
|
CrumbSimpleMenuAsync,
|
|
3060
3063
|
{
|
|
3061
|
-
parentsToOmit: [...breadcrumbs].splice(
|
|
3064
|
+
parentsToOmit: [...breadcrumbs].splice(index + 1, breadcrumbs.length - 1).map((parent) => parent.id),
|
|
3062
3065
|
currentFolderId,
|
|
3063
3066
|
onChangeFolder
|
|
3064
3067
|
},
|
|
@@ -3071,7 +3074,6 @@ const Breadcrumbs = ({
|
|
|
3071
3074
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3072
3075
|
designSystem.CrumbLink,
|
|
3073
3076
|
{
|
|
3074
|
-
tag: "button",
|
|
3075
3077
|
type: "button",
|
|
3076
3078
|
onClick: () => onChangeFolder(crumb.id, crumb.path),
|
|
3077
3079
|
children: typeof crumb.label !== "string" && crumb.label?.id ? formatMessage(crumb.label) : crumb.label
|
|
@@ -3082,8 +3084,8 @@ const Breadcrumbs = ({
|
|
|
3082
3084
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3083
3085
|
designSystem.CrumbLink,
|
|
3084
3086
|
{
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
+
to: crumb.href,
|
|
3088
|
+
tag: reactRouterDom.Link,
|
|
3087
3089
|
children: typeof crumb.label !== "string" && crumb.label?.id ? formatMessage(crumb.label) : crumb.label
|
|
3088
3090
|
},
|
|
3089
3091
|
`breadcrumb-${crumb?.id ?? "root"}`
|
|
@@ -3092,7 +3094,7 @@ const Breadcrumbs = ({
|
|
|
3092
3094
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3093
3095
|
designSystem.Crumb,
|
|
3094
3096
|
{
|
|
3095
|
-
isCurrent:
|
|
3097
|
+
isCurrent: index + 1 === breadcrumbs.length,
|
|
3096
3098
|
children: typeof crumb.label !== "string" && crumb.label?.id ? formatMessage(crumb.label) : crumb.label
|
|
3097
3099
|
},
|
|
3098
3100
|
`breadcrumb-${crumb?.id ?? "root"}`
|
|
@@ -3175,7 +3177,6 @@ const Card = styledComponents.styled(designSystem.Box)`
|
|
|
3175
3177
|
const FolderCard = React__namespace.forwardRef(
|
|
3176
3178
|
({
|
|
3177
3179
|
children,
|
|
3178
|
-
id,
|
|
3179
3180
|
startAction = null,
|
|
3180
3181
|
cardActions = null,
|
|
3181
3182
|
ariaLabel,
|
|
@@ -3243,6 +3244,7 @@ const FolderCardBody = (props) => {
|
|
|
3243
3244
|
{
|
|
3244
3245
|
...props,
|
|
3245
3246
|
id: `${id}-title`,
|
|
3247
|
+
"data-testid": `${id}-title`,
|
|
3246
3248
|
alignItems: "flex-start",
|
|
3247
3249
|
direction: "column",
|
|
3248
3250
|
maxWidth: "100%",
|
|
@@ -3297,7 +3299,7 @@ const SortPicker = ({ onChangeSort, value }) => {
|
|
|
3297
3299
|
id: getTrad("sort.label"),
|
|
3298
3300
|
defaultMessage: "Sort by"
|
|
3299
3301
|
}),
|
|
3300
|
-
children: sortOptions
|
|
3302
|
+
children: sortOptions.map((filter) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: filter.value, children: formatMessage({ id: getTrad(filter.key), defaultMessage: `${filter.value}` }) }, filter.key))
|
|
3301
3303
|
}
|
|
3302
3304
|
);
|
|
3303
3305
|
};
|
|
@@ -3316,6 +3318,7 @@ const VideoPreviewWrapper$1 = styledComponents.styled(designSystem.Box)`
|
|
|
3316
3318
|
}
|
|
3317
3319
|
`;
|
|
3318
3320
|
const PreviewCell = ({ type, content }) => {
|
|
3321
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
3319
3322
|
if (type === "folder") {
|
|
3320
3323
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3321
3324
|
designSystem.Flex,
|
|
@@ -3325,7 +3328,18 @@ const PreviewCell = ({ type, content }) => {
|
|
|
3325
3328
|
width: "3.2rem",
|
|
3326
3329
|
height: "3.2rem",
|
|
3327
3330
|
borderRadius: "50%",
|
|
3328
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3331
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3332
|
+
icons.Folder,
|
|
3333
|
+
{
|
|
3334
|
+
"aria-label": formatMessage({
|
|
3335
|
+
id: getTrad("header.actions.add-assets.folder"),
|
|
3336
|
+
defaultMessage: "folder"
|
|
3337
|
+
}),
|
|
3338
|
+
fill: "secondary500",
|
|
3339
|
+
width: "1.6rem",
|
|
3340
|
+
height: "1.6rem"
|
|
3341
|
+
}
|
|
3342
|
+
)
|
|
3329
3343
|
}
|
|
3330
3344
|
);
|
|
3331
3345
|
}
|
|
@@ -3722,7 +3736,9 @@ const FilterValueInput = ({
|
|
|
3722
3736
|
}
|
|
3723
3737
|
);
|
|
3724
3738
|
};
|
|
3725
|
-
const getFilterList = ({
|
|
3739
|
+
const getFilterList = ({
|
|
3740
|
+
fieldSchema: { type: fieldType, mainField }
|
|
3741
|
+
}) => {
|
|
3726
3742
|
const type = mainField?.schema.type ? mainField.schema.type : fieldType;
|
|
3727
3743
|
switch (type) {
|
|
3728
3744
|
case "enumeration": {
|
|
@@ -3817,7 +3833,12 @@ const getFilterList = ({ fieldSchema: { type: fieldType, mainField } }) => {
|
|
|
3817
3833
|
];
|
|
3818
3834
|
}
|
|
3819
3835
|
};
|
|
3820
|
-
const FilterPopover = ({
|
|
3836
|
+
const FilterPopover = ({
|
|
3837
|
+
displayedFilters: displayedFilters2,
|
|
3838
|
+
filters,
|
|
3839
|
+
onSubmit,
|
|
3840
|
+
onToggle
|
|
3841
|
+
}) => {
|
|
3821
3842
|
const { formatMessage } = reactIntl.useIntl();
|
|
3822
3843
|
const [modifiedData, setModifiedData] = React__namespace.useState({
|
|
3823
3844
|
name: "createdAt",
|
|
@@ -3919,7 +3940,7 @@ const FilterPopover = ({ displayedFilters: displayedFilters2, filters, onSubmit,
|
|
|
3919
3940
|
return filter.mime?.[oppositeFilter] === modifiedData.value;
|
|
3920
3941
|
});
|
|
3921
3942
|
const hasOppositeFilter = oppositeFilterIndex !== -1;
|
|
3922
|
-
|
|
3943
|
+
const filterToAdd = { [modifiedData.name]: { [modifiedData.filter]: modifiedData.value } };
|
|
3923
3944
|
if (!hasOppositeFilter) {
|
|
3924
3945
|
const nextFilters = [...filtersWithoutFile, filterToAdd];
|
|
3925
3946
|
onSubmit(nextFilters);
|
|
@@ -3939,7 +3960,7 @@ const FilterPopover = ({ displayedFilters: displayedFilters2, filters, onSubmit,
|
|
|
3939
3960
|
return filter[modifiedDataName] && filter[modifiedDataName]?.[modifiedDataName] === encodedValue;
|
|
3940
3961
|
}) !== void 0;
|
|
3941
3962
|
if (!hasFilter) {
|
|
3942
|
-
|
|
3963
|
+
const filterToAdd = { [modifiedData.name]: { [modifiedData.filter]: encodedValue } };
|
|
3943
3964
|
const nextFilters = [...filters, filterToAdd];
|
|
3944
3965
|
onSubmit(nextFilters);
|
|
3945
3966
|
}
|
|
@@ -4048,6 +4069,15 @@ const PageSize = ({ onChangePageSize, pageSize }) => {
|
|
|
4048
4069
|
};
|
|
4049
4070
|
const PaginationContext = React__namespace.createContext({ activePage: 1, pageCount: 1 });
|
|
4050
4071
|
const usePagination = () => React__namespace.useContext(PaginationContext);
|
|
4072
|
+
const Pagination = ({
|
|
4073
|
+
children,
|
|
4074
|
+
activePage,
|
|
4075
|
+
pageCount,
|
|
4076
|
+
label = "pagination"
|
|
4077
|
+
}) => {
|
|
4078
|
+
const paginationValue = React__namespace.useMemo(() => ({ activePage, pageCount }), [activePage, pageCount]);
|
|
4079
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PaginationContext.Provider, { value: paginationValue, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { tag: "nav", "aria-label": label, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { tag: "ul", gap: 1, children }) }) });
|
|
4080
|
+
};
|
|
4051
4081
|
const PaginationText = styledComponents.styled(designSystem.Typography)`
|
|
4052
4082
|
line-height: revert;
|
|
4053
4083
|
`;
|
|
@@ -4151,15 +4181,6 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("li", {
|
|
|
4151
4181
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children }),
|
|
4152
4182
|
/* @__PURE__ */ jsxRuntime.jsx(PaginationText, { "aria-hidden": true, small: true, children: "…" })
|
|
4153
4183
|
] }) });
|
|
4154
|
-
const Pagination = ({
|
|
4155
|
-
children,
|
|
4156
|
-
activePage,
|
|
4157
|
-
pageCount,
|
|
4158
|
-
label = "pagination"
|
|
4159
|
-
}) => {
|
|
4160
|
-
const paginationValue = React__namespace.useMemo(() => ({ activePage, pageCount }), [activePage, pageCount]);
|
|
4161
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PaginationContext.Provider, { value: paginationValue, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { tag: "nav", "aria-label": label, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { tag: "ul", gap: 1, children }) }) });
|
|
4162
|
-
};
|
|
4163
4184
|
const PaginationFooter = ({
|
|
4164
4185
|
activePage,
|
|
4165
4186
|
onChangePage,
|
|
@@ -4204,7 +4225,7 @@ const PaginationFooter = ({
|
|
|
4204
4225
|
] });
|
|
4205
4226
|
}
|
|
4206
4227
|
let firstLinksToCreate = [];
|
|
4207
|
-
|
|
4228
|
+
const lastLinks = [];
|
|
4208
4229
|
let lastLinksToCreate = [];
|
|
4209
4230
|
const middleLinks = [];
|
|
4210
4231
|
if (pageCount > 1) {
|
|
@@ -4338,6 +4359,7 @@ const SearchAsset = ({ onChangeSearch, queryValue = null }) => {
|
|
|
4338
4359
|
id: getTrad("search.clear.label"),
|
|
4339
4360
|
defaultMessage: "Clear the search"
|
|
4340
4361
|
}),
|
|
4362
|
+
"aria-label": "search",
|
|
4341
4363
|
size: "S",
|
|
4342
4364
|
value,
|
|
4343
4365
|
placeholder: formatMessage({
|
|
@@ -4389,8 +4411,8 @@ const BrowseStep = ({
|
|
|
4389
4411
|
selectedAssets
|
|
4390
4412
|
}) => {
|
|
4391
4413
|
const { formatMessage } = reactIntl.useIntl();
|
|
4392
|
-
const [view, setView] = usePersistentState(localStorageKeys
|
|
4393
|
-
const isGridView = view === viewOptions
|
|
4414
|
+
const [view, setView] = usePersistentState(localStorageKeys.modalView, viewOptions.GRID);
|
|
4415
|
+
const isGridView = view === viewOptions.GRID;
|
|
4394
4416
|
const { data: currentFolder, isLoading: isCurrentFolderLoading } = useFolder(
|
|
4395
4417
|
queryObject?.folder,
|
|
4396
4418
|
{
|
|
@@ -4412,7 +4434,7 @@ const BrowseStep = ({
|
|
|
4412
4434
|
(asset) => selectedAssets.findIndex((currAsset) => currAsset.id === asset.id) !== -1
|
|
4413
4435
|
);
|
|
4414
4436
|
const isSearching = !!queryObject?._q;
|
|
4415
|
-
const isFiltering = queryObject?.filters?.$and?.length > 0;
|
|
4437
|
+
const isFiltering = !!queryObject?.filters?.$and?.length && queryObject.filters.$and.length > 0;
|
|
4416
4438
|
const isSearchingOrFiltering = isSearching || isFiltering;
|
|
4417
4439
|
const assetCount = assets.length;
|
|
4418
4440
|
const folderCount = folders.length;
|
|
@@ -4465,18 +4487,17 @@ const BrowseStep = ({
|
|
|
4465
4487
|
id: "view-switch.grid",
|
|
4466
4488
|
defaultMessage: "Grid View"
|
|
4467
4489
|
}),
|
|
4468
|
-
onClick: () => setView(isGridView ? viewOptions
|
|
4490
|
+
onClick: () => setView(isGridView ? viewOptions.LIST : viewOptions.GRID),
|
|
4469
4491
|
children: isGridView ? /* @__PURE__ */ jsxRuntime.jsx(icons.List, {}) : /* @__PURE__ */ jsxRuntime.jsx(icons.GridFour, {})
|
|
4470
4492
|
}
|
|
4471
4493
|
) }),
|
|
4472
4494
|
/* @__PURE__ */ jsxRuntime.jsx(SearchAsset, { onChangeSearch, queryValue: queryObject._q || "" })
|
|
4473
4495
|
] })
|
|
4474
4496
|
] }) }),
|
|
4475
|
-
canRead && breadcrumbs?.length > 0 && currentFolder && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4497
|
+
canRead && breadcrumbs?.length && breadcrumbs.length > 0 && currentFolder && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4476
4498
|
Breadcrumbs,
|
|
4477
4499
|
{
|
|
4478
4500
|
onChangeFolder,
|
|
4479
|
-
tag: "nav",
|
|
4480
4501
|
label: formatMessage({
|
|
4481
4502
|
id: getTrad("header.breadcrumbs.nav.label"),
|
|
4482
4503
|
defaultMessage: "Folders navigation"
|
|
@@ -4665,7 +4686,7 @@ const SelectedStep = ({
|
|
|
4665
4686
|
}) => {
|
|
4666
4687
|
const { formatMessage } = reactIntl.useIntl();
|
|
4667
4688
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
4668
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 0, children: [
|
|
4689
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 0, direction: "column", alignItems: "start", children: [
|
|
4669
4690
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: formatMessage(
|
|
4670
4691
|
{
|
|
4671
4692
|
id: getTrad("list.assets.to-upload"),
|
|
@@ -5024,6 +5045,10 @@ const FromComputerForm = ({
|
|
|
5024
5045
|
type: "file",
|
|
5025
5046
|
multiple: true,
|
|
5026
5047
|
name: "files",
|
|
5048
|
+
"aria-label": formatMessage({
|
|
5049
|
+
id: getTrad("input.label"),
|
|
5050
|
+
defaultMessage: "Drag & Drop here or"
|
|
5051
|
+
}),
|
|
5027
5052
|
tabIndex: -1,
|
|
5028
5053
|
ref: inputRef,
|
|
5029
5054
|
zIndex: 1,
|
|
@@ -5757,7 +5782,7 @@ const CarouselAssets = React__namespace.forwardRef(
|
|
|
5757
5782
|
}
|
|
5758
5783
|
)
|
|
5759
5784
|
}
|
|
5760
|
-
) : assets.map((asset,
|
|
5785
|
+
) : assets.map((asset, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5761
5786
|
designSystem.CarouselSlide,
|
|
5762
5787
|
{
|
|
5763
5788
|
label: formatMessage(
|
|
@@ -5765,7 +5790,7 @@ const CarouselAssets = React__namespace.forwardRef(
|
|
|
5765
5790
|
id: getTrad("mediaLibraryInput.slideCount"),
|
|
5766
5791
|
defaultMessage: "{n} of {m} slides"
|
|
5767
5792
|
},
|
|
5768
|
-
{ n:
|
|
5793
|
+
{ n: index + 1, m: assets.length }
|
|
5769
5794
|
),
|
|
5770
5795
|
children: /* @__PURE__ */ jsxRuntime.jsx(CarouselAsset, { asset })
|
|
5771
5796
|
},
|
|
@@ -5978,136 +6003,8 @@ const MediaLibraryInput = React__namespace.forwardRef(
|
|
|
5978
6003
|
] });
|
|
5979
6004
|
}
|
|
5980
6005
|
);
|
|
5981
|
-
const ParentFolderShape = {
|
|
5982
|
-
id: PropTypes__default.default.number.isRequired,
|
|
5983
|
-
createdAt: PropTypes__default.default.string.isRequired,
|
|
5984
|
-
name: PropTypes__default.default.string.isRequired,
|
|
5985
|
-
updatedAt: PropTypes__default.default.string.isRequired,
|
|
5986
|
-
pathId: PropTypes__default.default.number.isRequired,
|
|
5987
|
-
path: PropTypes__default.default.string.isRequired
|
|
5988
|
-
};
|
|
5989
|
-
ParentFolderShape.parent = PropTypes__default.default.shape(ParentFolderShape);
|
|
5990
|
-
const FolderShape = {
|
|
5991
|
-
id: PropTypes__default.default.number,
|
|
5992
|
-
children: PropTypes__default.default.shape({
|
|
5993
|
-
count: PropTypes__default.default.number.isRequired
|
|
5994
|
-
}),
|
|
5995
|
-
createdAt: PropTypes__default.default.string,
|
|
5996
|
-
createdBy: PropTypes__default.default.shape(),
|
|
5997
|
-
files: PropTypes__default.default.shape({
|
|
5998
|
-
count: PropTypes__default.default.number.isRequired
|
|
5999
|
-
}),
|
|
6000
|
-
name: PropTypes__default.default.string,
|
|
6001
|
-
updatedAt: PropTypes__default.default.string,
|
|
6002
|
-
updatedBy: PropTypes__default.default.shape(),
|
|
6003
|
-
pathId: PropTypes__default.default.number,
|
|
6004
|
-
path: PropTypes__default.default.string
|
|
6005
|
-
};
|
|
6006
|
-
FolderShape.parent = PropTypes__default.default.shape(ParentFolderShape);
|
|
6007
|
-
const FolderDefinition = PropTypes__default.default.shape(FolderShape);
|
|
6008
|
-
const FolderStructure = PropTypes__default.default.shape({
|
|
6009
|
-
value: PropTypes__default.default.oneOfType([PropTypes__default.default.number, PropTypes__default.default.string]),
|
|
6010
|
-
label: PropTypes__default.default.string.isRequired,
|
|
6011
|
-
children: PropTypes__default.default.array
|
|
6012
|
-
});
|
|
6013
|
-
FolderStructure.children = PropTypes__default.default.arrayOf(PropTypes__default.default.shape(FolderStructure));
|
|
6014
|
-
FolderStructure.defaultProps = {
|
|
6015
|
-
children: void 0
|
|
6016
|
-
};
|
|
6017
|
-
PropTypes__default.default.arrayOf(FolderStructure);
|
|
6018
|
-
const AssetDefinition = PropTypes__default.default.shape({
|
|
6019
|
-
id: PropTypes__default.default.number,
|
|
6020
|
-
height: PropTypes__default.default.number,
|
|
6021
|
-
width: PropTypes__default.default.number,
|
|
6022
|
-
size: PropTypes__default.default.number,
|
|
6023
|
-
createdAt: PropTypes__default.default.string,
|
|
6024
|
-
ext: PropTypes__default.default.string,
|
|
6025
|
-
mime: PropTypes__default.default.string,
|
|
6026
|
-
name: PropTypes__default.default.string,
|
|
6027
|
-
url: PropTypes__default.default.string,
|
|
6028
|
-
updatedAt: PropTypes__default.default.string,
|
|
6029
|
-
alternativeText: PropTypes__default.default.string,
|
|
6030
|
-
caption: PropTypes__default.default.string,
|
|
6031
|
-
folder: PropTypes__default.default.shape(FolderDefinition),
|
|
6032
|
-
formats: PropTypes__default.default.shape({
|
|
6033
|
-
thumbnail: PropTypes__default.default.shape({
|
|
6034
|
-
url: PropTypes__default.default.string
|
|
6035
|
-
})
|
|
6036
|
-
})
|
|
6037
|
-
});
|
|
6038
|
-
const CrumbDefinition = PropTypes__default.default.shape({
|
|
6039
|
-
id: PropTypes__default.default.number,
|
|
6040
|
-
label: PropTypes__default.default.oneOfType([
|
|
6041
|
-
PropTypes__default.default.string,
|
|
6042
|
-
PropTypes__default.default.shape({
|
|
6043
|
-
id: PropTypes__default.default.string.isRequired,
|
|
6044
|
-
defaultMessage: PropTypes__default.default.string.isRequired
|
|
6045
|
-
})
|
|
6046
|
-
]).isRequired,
|
|
6047
|
-
href: PropTypes__default.default.string
|
|
6048
|
-
});
|
|
6049
|
-
const CrumbMenuDefinition = PropTypes__default.default.arrayOf(CrumbDefinition);
|
|
6050
|
-
const BreadcrumbsDefinition = PropTypes__default.default.arrayOf(
|
|
6051
|
-
PropTypes__default.default.oneOfType([CrumbDefinition, CrumbMenuDefinition])
|
|
6052
|
-
);
|
|
6053
|
-
const viewOptions = {
|
|
6054
|
-
GRID: 0,
|
|
6055
|
-
LIST: 1
|
|
6056
|
-
};
|
|
6057
|
-
const pageSizes = [10, 20, 50, 100];
|
|
6058
|
-
const sortOptions = [
|
|
6059
|
-
{ key: "sort.created_at_desc", value: "createdAt:DESC" },
|
|
6060
|
-
{ key: "sort.created_at_asc", value: "createdAt:ASC" },
|
|
6061
|
-
{ key: "sort.name_asc", value: "name:ASC" },
|
|
6062
|
-
{ key: "sort.name_desc", value: "name:DESC" },
|
|
6063
|
-
{ key: "sort.updated_at_desc", value: "updatedAt:DESC" },
|
|
6064
|
-
{ key: "sort.updated_at_asc", value: "updatedAt:ASC" }
|
|
6065
|
-
];
|
|
6066
|
-
const localStorageKeys = {
|
|
6067
|
-
modalView: `STRAPI_UPLOAD_MODAL_VIEW`,
|
|
6068
|
-
view: `STRAPI_UPLOAD_LIBRARY_VIEW`
|
|
6069
|
-
};
|
|
6070
|
-
const PERMISSIONS = {
|
|
6071
|
-
// This permission regards the main component (App) and is used to tell
|
|
6072
|
-
// If the plugin link should be displayed in the menu
|
|
6073
|
-
// And also if the plugin is accessible. This use case is found when a user types the url of the
|
|
6074
|
-
// plugin directly in the browser
|
|
6075
|
-
main: [
|
|
6076
|
-
{ action: "plugin::upload.read", subject: null },
|
|
6077
|
-
{
|
|
6078
|
-
action: "plugin::upload.assets.create",
|
|
6079
|
-
subject: null
|
|
6080
|
-
},
|
|
6081
|
-
{
|
|
6082
|
-
action: "plugin::upload.assets.update",
|
|
6083
|
-
subject: null
|
|
6084
|
-
}
|
|
6085
|
-
],
|
|
6086
|
-
copyLink: [
|
|
6087
|
-
{
|
|
6088
|
-
action: "plugin::upload.assets.copy-link",
|
|
6089
|
-
subject: null
|
|
6090
|
-
}
|
|
6091
|
-
],
|
|
6092
|
-
create: [
|
|
6093
|
-
{
|
|
6094
|
-
action: "plugin::upload.assets.create",
|
|
6095
|
-
subject: null
|
|
6096
|
-
}
|
|
6097
|
-
],
|
|
6098
|
-
download: [
|
|
6099
|
-
{
|
|
6100
|
-
action: "plugin::upload.assets.download",
|
|
6101
|
-
subject: null
|
|
6102
|
-
}
|
|
6103
|
-
],
|
|
6104
|
-
read: [{ action: "plugin::upload.read", subject: null }],
|
|
6105
|
-
configureView: [{ action: "plugin::upload.configure-view", subject: null }],
|
|
6106
|
-
settings: [{ action: "plugin::upload.settings.read", subject: null }],
|
|
6107
|
-
update: [{ action: "plugin::upload.assets.update", subject: null, fields: null }]
|
|
6108
|
-
};
|
|
6109
6006
|
const name = pluginPkg.strapi.name;
|
|
6110
|
-
const
|
|
6007
|
+
const admin = {
|
|
6111
6008
|
register(app) {
|
|
6112
6009
|
app.addMenuLink({
|
|
6113
6010
|
to: `plugins/${pluginId}`,
|
|
@@ -6117,21 +6014,32 @@ const index = {
|
|
|
6117
6014
|
defaultMessage: "Media Library"
|
|
6118
6015
|
},
|
|
6119
6016
|
permissions: PERMISSIONS.main,
|
|
6120
|
-
Component: () => Promise.resolve().then(() => require("./
|
|
6017
|
+
Component: () => Promise.resolve().then(() => require("./App-DeNaeOad.js")).then((mod) => ({ default: mod.Upload })),
|
|
6121
6018
|
position: 4
|
|
6122
6019
|
});
|
|
6123
6020
|
app.addSettingsLink("global", {
|
|
6124
6021
|
id: "media-library-settings",
|
|
6022
|
+
to: "media-library",
|
|
6125
6023
|
intlLabel: {
|
|
6126
6024
|
id: getTrad("plugin.name"),
|
|
6127
6025
|
defaultMessage: "Media Library"
|
|
6128
6026
|
},
|
|
6129
|
-
|
|
6130
|
-
|
|
6027
|
+
async Component() {
|
|
6028
|
+
const { ProtectedSettingsPage } = await Promise.resolve().then(() => require("./SettingsPage-C60zLXmE.js"));
|
|
6029
|
+
return { default: ProtectedSettingsPage };
|
|
6030
|
+
},
|
|
6131
6031
|
permissions: PERMISSIONS.settings
|
|
6132
6032
|
});
|
|
6133
|
-
app.addFields({
|
|
6134
|
-
|
|
6033
|
+
app.addFields({
|
|
6034
|
+
type: "media",
|
|
6035
|
+
Component: MediaLibraryInput
|
|
6036
|
+
});
|
|
6037
|
+
app.addComponents([
|
|
6038
|
+
{
|
|
6039
|
+
name: "media-library",
|
|
6040
|
+
Component: MediaLibraryDialog
|
|
6041
|
+
}
|
|
6042
|
+
]);
|
|
6135
6043
|
app.registerPlugin({
|
|
6136
6044
|
id: pluginId,
|
|
6137
6045
|
name
|
|
@@ -6156,10 +6064,8 @@ const index = {
|
|
|
6156
6064
|
return Promise.resolve(importedTrads);
|
|
6157
6065
|
}
|
|
6158
6066
|
};
|
|
6159
|
-
exports.AssetDefinition = AssetDefinition;
|
|
6160
6067
|
exports.AssetGridList = AssetGridList;
|
|
6161
6068
|
exports.Breadcrumbs = Breadcrumbs;
|
|
6162
|
-
exports.BreadcrumbsDefinition = BreadcrumbsDefinition;
|
|
6163
6069
|
exports.EditAssetDialog = EditAssetDialog;
|
|
6164
6070
|
exports.EditFolderDialog = EditFolderDialog;
|
|
6165
6071
|
exports.EmptyAssets = EmptyAssets;
|
|
@@ -6168,18 +6074,17 @@ exports.FilterPopover = FilterPopover;
|
|
|
6168
6074
|
exports.FolderCard = FolderCard;
|
|
6169
6075
|
exports.FolderCardBody = FolderCardBody;
|
|
6170
6076
|
exports.FolderCardBodyAction = FolderCardBodyAction;
|
|
6171
|
-
exports.FolderDefinition = FolderDefinition;
|
|
6172
6077
|
exports.FolderGridList = FolderGridList;
|
|
6173
6078
|
exports.PERMISSIONS = PERMISSIONS;
|
|
6174
6079
|
exports.SelectTree = SelectTree;
|
|
6175
6080
|
exports.SortPicker = SortPicker;
|
|
6176
6081
|
exports.TableList = TableList;
|
|
6177
6082
|
exports.UploadAssetDialog = UploadAssetDialog;
|
|
6083
|
+
exports.admin = admin;
|
|
6178
6084
|
exports.containsAssetFilter = containsAssetFilter;
|
|
6179
6085
|
exports.displayedFilters = displayedFilters;
|
|
6180
6086
|
exports.getFolderURL = getFolderURL;
|
|
6181
6087
|
exports.getTrad = getTrad;
|
|
6182
|
-
exports.index = index;
|
|
6183
6088
|
exports.localStorageKeys = localStorageKeys;
|
|
6184
6089
|
exports.normalizeAPIError = normalizeAPIError;
|
|
6185
6090
|
exports.pageSizes = pageSizes;
|
|
@@ -6196,4 +6101,4 @@ exports.useMediaLibraryPermissions = useMediaLibraryPermissions;
|
|
|
6196
6101
|
exports.usePersistentState = usePersistentState;
|
|
6197
6102
|
exports.useSelectionState = useSelectionState;
|
|
6198
6103
|
exports.viewOptions = viewOptions;
|
|
6199
|
-
//# sourceMappingURL=index-
|
|
6104
|
+
//# sourceMappingURL=index-DwVjDEMt.js.map
|