@strapi/upload 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{index-DCAQ4hHN.mjs → App-D1ayH-QS.mjs} +94 -87
- package/dist/_chunks/App-D1ayH-QS.mjs.map +1 -0
- package/dist/_chunks/{index-Bl2-6oC8.js → App-Dqqn78jO.js} +94 -87
- package/dist/_chunks/App-Dqqn78jO.js.map +1 -0
- package/dist/_chunks/{index-C_cWV2yS.mjs → ConfigureTheView-B2Syy3q5.mjs} +24 -23
- package/dist/_chunks/ConfigureTheView-B2Syy3q5.mjs.map +1 -0
- package/dist/_chunks/{index-BM9Ayh_r.js → ConfigureTheView-fwDgErsi.js} +42 -23
- package/dist/_chunks/ConfigureTheView-fwDgErsi.js.map +1 -0
- package/dist/_chunks/{index-BWIqjWzC.mjs → SettingsPage-BYC3ism8.mjs} +45 -43
- package/dist/_chunks/SettingsPage-BYC3ism8.mjs.map +1 -0
- package/dist/_chunks/{index-C1MSWEyZ.js → SettingsPage-oDEVs3XV.js} +61 -41
- package/dist/_chunks/SettingsPage-oDEVs3XV.js.map +1 -0
- package/dist/_chunks/{index-YwynuEzj.js → index-B7NW5XiM.js} +115 -211
- package/dist/_chunks/index-B7NW5XiM.js.map +1 -0
- package/dist/_chunks/{index-BwEfHu6y.mjs → index-Clesg6BA.mjs} +138 -233
- package/dist/_chunks/index-Clesg6BA.mjs.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) {
|
|
@@ -1870,7 +1872,7 @@ const PreviewBox = ({
|
|
|
1870
1872
|
nextAsset.mime,
|
|
1871
1873
|
nextAsset.updatedAt
|
|
1872
1874
|
);
|
|
1873
|
-
await upload({ name: file.name, rawFile: file }, asset.folder?.id);
|
|
1875
|
+
await upload({ name: file.name, rawFile: file }, asset.folder?.id ? asset.folder.id : null);
|
|
1874
1876
|
trackUsage("didCropFile", { duplicatedFile: true, location: trackedLocation });
|
|
1875
1877
|
setHasCropIntent(false);
|
|
1876
1878
|
onCropFinish();
|
|
@@ -2004,6 +2006,7 @@ const ReplaceMediaButton = ({
|
|
|
2004
2006
|
accept: acceptedMime,
|
|
2005
2007
|
type: "file",
|
|
2006
2008
|
name: "file",
|
|
2009
|
+
"data-testid": "file-input",
|
|
2007
2010
|
tabIndex: -1,
|
|
2008
2011
|
ref: inputRef,
|
|
2009
2012
|
onChange: handleChange,
|
|
@@ -2140,7 +2143,7 @@ const EditAssetContent = ({
|
|
|
2140
2143
|
id: getTrad("modal.file-details.size"),
|
|
2141
2144
|
defaultMessage: "Size"
|
|
2142
2145
|
}),
|
|
2143
|
-
value: formatBytes(asset?.size)
|
|
2146
|
+
value: formatBytes(asset?.size ? asset.size : 0)
|
|
2144
2147
|
},
|
|
2145
2148
|
{
|
|
2146
2149
|
label: formatMessage({
|
|
@@ -2154,7 +2157,7 @@ const EditAssetContent = ({
|
|
|
2154
2157
|
id: getTrad("modal.file-details.date"),
|
|
2155
2158
|
defaultMessage: "Date"
|
|
2156
2159
|
}),
|
|
2157
|
-
value: formatDate(new Date(asset?.createdAt))
|
|
2160
|
+
value: formatDate(new Date(asset?.createdAt ? asset.createdAt : ""))
|
|
2158
2161
|
},
|
|
2159
2162
|
{
|
|
2160
2163
|
label: formatMessage({
|
|
@@ -2168,7 +2171,7 @@ const EditAssetContent = ({
|
|
|
2168
2171
|
id: getTrad("modal.file-details.id"),
|
|
2169
2172
|
defaultMessage: "Asset ID"
|
|
2170
2173
|
}),
|
|
2171
|
-
value: asset?.id
|
|
2174
|
+
value: asset?.id ? asset.id : null
|
|
2172
2175
|
}
|
|
2173
2176
|
]
|
|
2174
2177
|
}
|
|
@@ -2265,13 +2268,13 @@ const EditAssetContent = ({
|
|
|
2265
2268
|
] }) })
|
|
2266
2269
|
] }) }),
|
|
2267
2270
|
/* @__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" }) }),
|
|
2271
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: () => handleClose({ ...values }), variant: "tertiary", children: formatMessage({ id: "global.cancel", defaultMessage: "Cancel" }) }),
|
|
2269
2272
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
2270
2273
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2271
2274
|
ReplaceMediaButton,
|
|
2272
2275
|
{
|
|
2273
2276
|
onSelectMedia: setReplacementFile,
|
|
2274
|
-
acceptedMime: asset?.mime,
|
|
2277
|
+
acceptedMime: asset?.mime ?? "",
|
|
2275
2278
|
disabled: formDisabled,
|
|
2276
2279
|
trackedLocation
|
|
2277
2280
|
}
|
|
@@ -2821,7 +2824,6 @@ const VideoPreview = ({
|
|
|
2821
2824
|
onLoadDuration = () => {
|
|
2822
2825
|
},
|
|
2823
2826
|
alt,
|
|
2824
|
-
size = "M",
|
|
2825
2827
|
...props
|
|
2826
2828
|
}) => {
|
|
2827
2829
|
const handleTimeUpdate = (e) => {
|
|
@@ -2925,7 +2927,7 @@ const AssetCard = ({
|
|
|
2925
2927
|
}
|
|
2926
2928
|
return /* @__PURE__ */ jsxRuntime.jsx(DocAssetCard, { ...commonAssetCardProps });
|
|
2927
2929
|
};
|
|
2928
|
-
const Draggable = ({ children, id, index
|
|
2930
|
+
const Draggable = ({ children, id, index, moveItem }) => {
|
|
2929
2931
|
const ref = React__namespace.useRef(null);
|
|
2930
2932
|
const [, drop] = reactDnd.useDrop({
|
|
2931
2933
|
accept: "draggable",
|
|
@@ -2934,15 +2936,15 @@ const Draggable = ({ children, id, index: index2, moveItem }) => {
|
|
|
2934
2936
|
return;
|
|
2935
2937
|
}
|
|
2936
2938
|
if (hoveredOverItem.id !== id) {
|
|
2937
|
-
moveItem(hoveredOverItem.index,
|
|
2938
|
-
hoveredOverItem.index =
|
|
2939
|
+
moveItem(hoveredOverItem.index, index);
|
|
2940
|
+
hoveredOverItem.index = index;
|
|
2939
2941
|
}
|
|
2940
2942
|
}
|
|
2941
2943
|
});
|
|
2942
2944
|
const [{ isDragging }, drag] = reactDnd.useDrag({
|
|
2943
2945
|
type: "draggable",
|
|
2944
2946
|
item() {
|
|
2945
|
-
return { index
|
|
2947
|
+
return { index, id };
|
|
2946
2948
|
},
|
|
2947
2949
|
collect: (monitor) => ({
|
|
2948
2950
|
isDragging: monitor.isDragging()
|
|
@@ -2964,10 +2966,10 @@ const AssetGridList = ({
|
|
|
2964
2966
|
}) => {
|
|
2965
2967
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.KeyboardNavigable, { tagName: "article", children: [
|
|
2966
2968
|
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,
|
|
2969
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: assets.map((asset, index) => {
|
|
2968
2970
|
const isSelected = !!selectedAssets.find((currentAsset) => currentAsset.id === asset.id);
|
|
2969
2971
|
if (onReorderAsset) {
|
|
2970
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, height: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(Draggable, { index
|
|
2972
|
+
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
2973
|
AssetCard,
|
|
2972
2974
|
{
|
|
2973
2975
|
allowedTypes,
|
|
@@ -3053,12 +3055,12 @@ const Breadcrumbs = ({
|
|
|
3053
3055
|
...props
|
|
3054
3056
|
}) => {
|
|
3055
3057
|
const { formatMessage } = reactIntl.useIntl();
|
|
3056
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Breadcrumbs, { ...props, children: breadcrumbs.map((crumb,
|
|
3058
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Breadcrumbs, { ...props, children: breadcrumbs.map((crumb, index) => {
|
|
3057
3059
|
if (Array.isArray(crumb)) {
|
|
3058
3060
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3059
3061
|
CrumbSimpleMenuAsync,
|
|
3060
3062
|
{
|
|
3061
|
-
parentsToOmit: [...breadcrumbs].splice(
|
|
3063
|
+
parentsToOmit: [...breadcrumbs].splice(index + 1, breadcrumbs.length - 1).map((parent) => parent.id),
|
|
3062
3064
|
currentFolderId,
|
|
3063
3065
|
onChangeFolder
|
|
3064
3066
|
},
|
|
@@ -3071,7 +3073,6 @@ const Breadcrumbs = ({
|
|
|
3071
3073
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3072
3074
|
designSystem.CrumbLink,
|
|
3073
3075
|
{
|
|
3074
|
-
tag: "button",
|
|
3075
3076
|
type: "button",
|
|
3076
3077
|
onClick: () => onChangeFolder(crumb.id, crumb.path),
|
|
3077
3078
|
children: typeof crumb.label !== "string" && crumb.label?.id ? formatMessage(crumb.label) : crumb.label
|
|
@@ -3082,8 +3083,8 @@ const Breadcrumbs = ({
|
|
|
3082
3083
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3083
3084
|
designSystem.CrumbLink,
|
|
3084
3085
|
{
|
|
3085
|
-
|
|
3086
|
-
|
|
3086
|
+
to: crumb.href,
|
|
3087
|
+
tag: reactRouterDom.Link,
|
|
3087
3088
|
children: typeof crumb.label !== "string" && crumb.label?.id ? formatMessage(crumb.label) : crumb.label
|
|
3088
3089
|
},
|
|
3089
3090
|
`breadcrumb-${crumb?.id ?? "root"}`
|
|
@@ -3092,7 +3093,7 @@ const Breadcrumbs = ({
|
|
|
3092
3093
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3093
3094
|
designSystem.Crumb,
|
|
3094
3095
|
{
|
|
3095
|
-
isCurrent:
|
|
3096
|
+
isCurrent: index + 1 === breadcrumbs.length,
|
|
3096
3097
|
children: typeof crumb.label !== "string" && crumb.label?.id ? formatMessage(crumb.label) : crumb.label
|
|
3097
3098
|
},
|
|
3098
3099
|
`breadcrumb-${crumb?.id ?? "root"}`
|
|
@@ -3175,7 +3176,6 @@ const Card = styledComponents.styled(designSystem.Box)`
|
|
|
3175
3176
|
const FolderCard = React__namespace.forwardRef(
|
|
3176
3177
|
({
|
|
3177
3178
|
children,
|
|
3178
|
-
id,
|
|
3179
3179
|
startAction = null,
|
|
3180
3180
|
cardActions = null,
|
|
3181
3181
|
ariaLabel,
|
|
@@ -3243,6 +3243,7 @@ const FolderCardBody = (props) => {
|
|
|
3243
3243
|
{
|
|
3244
3244
|
...props,
|
|
3245
3245
|
id: `${id}-title`,
|
|
3246
|
+
"data-testid": `${id}-title`,
|
|
3246
3247
|
alignItems: "flex-start",
|
|
3247
3248
|
direction: "column",
|
|
3248
3249
|
maxWidth: "100%",
|
|
@@ -3297,7 +3298,7 @@ const SortPicker = ({ onChangeSort, value }) => {
|
|
|
3297
3298
|
id: getTrad("sort.label"),
|
|
3298
3299
|
defaultMessage: "Sort by"
|
|
3299
3300
|
}),
|
|
3300
|
-
children: sortOptions
|
|
3301
|
+
children: sortOptions.map((filter) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: filter.value, children: formatMessage({ id: getTrad(filter.key), defaultMessage: `${filter.value}` }) }, filter.key))
|
|
3301
3302
|
}
|
|
3302
3303
|
);
|
|
3303
3304
|
};
|
|
@@ -3316,6 +3317,7 @@ const VideoPreviewWrapper$1 = styledComponents.styled(designSystem.Box)`
|
|
|
3316
3317
|
}
|
|
3317
3318
|
`;
|
|
3318
3319
|
const PreviewCell = ({ type, content }) => {
|
|
3320
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
3319
3321
|
if (type === "folder") {
|
|
3320
3322
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3321
3323
|
designSystem.Flex,
|
|
@@ -3325,7 +3327,18 @@ const PreviewCell = ({ type, content }) => {
|
|
|
3325
3327
|
width: "3.2rem",
|
|
3326
3328
|
height: "3.2rem",
|
|
3327
3329
|
borderRadius: "50%",
|
|
3328
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3330
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3331
|
+
icons.Folder,
|
|
3332
|
+
{
|
|
3333
|
+
"aria-label": formatMessage({
|
|
3334
|
+
id: getTrad("header.actions.add-assets.folder"),
|
|
3335
|
+
defaultMessage: "folder"
|
|
3336
|
+
}),
|
|
3337
|
+
fill: "secondary500",
|
|
3338
|
+
width: "1.6rem",
|
|
3339
|
+
height: "1.6rem"
|
|
3340
|
+
}
|
|
3341
|
+
)
|
|
3329
3342
|
}
|
|
3330
3343
|
);
|
|
3331
3344
|
}
|
|
@@ -3722,7 +3735,9 @@ const FilterValueInput = ({
|
|
|
3722
3735
|
}
|
|
3723
3736
|
);
|
|
3724
3737
|
};
|
|
3725
|
-
const getFilterList = ({
|
|
3738
|
+
const getFilterList = ({
|
|
3739
|
+
fieldSchema: { type: fieldType, mainField }
|
|
3740
|
+
}) => {
|
|
3726
3741
|
const type = mainField?.schema.type ? mainField.schema.type : fieldType;
|
|
3727
3742
|
switch (type) {
|
|
3728
3743
|
case "enumeration": {
|
|
@@ -3817,7 +3832,12 @@ const getFilterList = ({ fieldSchema: { type: fieldType, mainField } }) => {
|
|
|
3817
3832
|
];
|
|
3818
3833
|
}
|
|
3819
3834
|
};
|
|
3820
|
-
const FilterPopover = ({
|
|
3835
|
+
const FilterPopover = ({
|
|
3836
|
+
displayedFilters: displayedFilters2,
|
|
3837
|
+
filters,
|
|
3838
|
+
onSubmit,
|
|
3839
|
+
onToggle
|
|
3840
|
+
}) => {
|
|
3821
3841
|
const { formatMessage } = reactIntl.useIntl();
|
|
3822
3842
|
const [modifiedData, setModifiedData] = React__namespace.useState({
|
|
3823
3843
|
name: "createdAt",
|
|
@@ -3919,7 +3939,7 @@ const FilterPopover = ({ displayedFilters: displayedFilters2, filters, onSubmit,
|
|
|
3919
3939
|
return filter.mime?.[oppositeFilter] === modifiedData.value;
|
|
3920
3940
|
});
|
|
3921
3941
|
const hasOppositeFilter = oppositeFilterIndex !== -1;
|
|
3922
|
-
|
|
3942
|
+
const filterToAdd = { [modifiedData.name]: { [modifiedData.filter]: modifiedData.value } };
|
|
3923
3943
|
if (!hasOppositeFilter) {
|
|
3924
3944
|
const nextFilters = [...filtersWithoutFile, filterToAdd];
|
|
3925
3945
|
onSubmit(nextFilters);
|
|
@@ -3939,7 +3959,7 @@ const FilterPopover = ({ displayedFilters: displayedFilters2, filters, onSubmit,
|
|
|
3939
3959
|
return filter[modifiedDataName] && filter[modifiedDataName]?.[modifiedDataName] === encodedValue;
|
|
3940
3960
|
}) !== void 0;
|
|
3941
3961
|
if (!hasFilter) {
|
|
3942
|
-
|
|
3962
|
+
const filterToAdd = { [modifiedData.name]: { [modifiedData.filter]: encodedValue } };
|
|
3943
3963
|
const nextFilters = [...filters, filterToAdd];
|
|
3944
3964
|
onSubmit(nextFilters);
|
|
3945
3965
|
}
|
|
@@ -4048,6 +4068,15 @@ const PageSize = ({ onChangePageSize, pageSize }) => {
|
|
|
4048
4068
|
};
|
|
4049
4069
|
const PaginationContext = React__namespace.createContext({ activePage: 1, pageCount: 1 });
|
|
4050
4070
|
const usePagination = () => React__namespace.useContext(PaginationContext);
|
|
4071
|
+
const Pagination = ({
|
|
4072
|
+
children,
|
|
4073
|
+
activePage,
|
|
4074
|
+
pageCount,
|
|
4075
|
+
label = "pagination"
|
|
4076
|
+
}) => {
|
|
4077
|
+
const paginationValue = React__namespace.useMemo(() => ({ activePage, pageCount }), [activePage, pageCount]);
|
|
4078
|
+
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 }) }) });
|
|
4079
|
+
};
|
|
4051
4080
|
const PaginationText = styledComponents.styled(designSystem.Typography)`
|
|
4052
4081
|
line-height: revert;
|
|
4053
4082
|
`;
|
|
@@ -4151,15 +4180,6 @@ const Dots = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("li", {
|
|
|
4151
4180
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children }),
|
|
4152
4181
|
/* @__PURE__ */ jsxRuntime.jsx(PaginationText, { "aria-hidden": true, small: true, children: "…" })
|
|
4153
4182
|
] }) });
|
|
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
4183
|
const PaginationFooter = ({
|
|
4164
4184
|
activePage,
|
|
4165
4185
|
onChangePage,
|
|
@@ -4204,7 +4224,7 @@ const PaginationFooter = ({
|
|
|
4204
4224
|
] });
|
|
4205
4225
|
}
|
|
4206
4226
|
let firstLinksToCreate = [];
|
|
4207
|
-
|
|
4227
|
+
const lastLinks = [];
|
|
4208
4228
|
let lastLinksToCreate = [];
|
|
4209
4229
|
const middleLinks = [];
|
|
4210
4230
|
if (pageCount > 1) {
|
|
@@ -4338,6 +4358,7 @@ const SearchAsset = ({ onChangeSearch, queryValue = null }) => {
|
|
|
4338
4358
|
id: getTrad("search.clear.label"),
|
|
4339
4359
|
defaultMessage: "Clear the search"
|
|
4340
4360
|
}),
|
|
4361
|
+
"aria-label": "search",
|
|
4341
4362
|
size: "S",
|
|
4342
4363
|
value,
|
|
4343
4364
|
placeholder: formatMessage({
|
|
@@ -4389,8 +4410,8 @@ const BrowseStep = ({
|
|
|
4389
4410
|
selectedAssets
|
|
4390
4411
|
}) => {
|
|
4391
4412
|
const { formatMessage } = reactIntl.useIntl();
|
|
4392
|
-
const [view, setView] = usePersistentState(localStorageKeys
|
|
4393
|
-
const isGridView = view === viewOptions
|
|
4413
|
+
const [view, setView] = usePersistentState(localStorageKeys.modalView, viewOptions.GRID);
|
|
4414
|
+
const isGridView = view === viewOptions.GRID;
|
|
4394
4415
|
const { data: currentFolder, isLoading: isCurrentFolderLoading } = useFolder(
|
|
4395
4416
|
queryObject?.folder,
|
|
4396
4417
|
{
|
|
@@ -4412,7 +4433,7 @@ const BrowseStep = ({
|
|
|
4412
4433
|
(asset) => selectedAssets.findIndex((currAsset) => currAsset.id === asset.id) !== -1
|
|
4413
4434
|
);
|
|
4414
4435
|
const isSearching = !!queryObject?._q;
|
|
4415
|
-
const isFiltering = queryObject?.filters?.$and?.length > 0;
|
|
4436
|
+
const isFiltering = !!queryObject?.filters?.$and?.length && queryObject.filters.$and.length > 0;
|
|
4416
4437
|
const isSearchingOrFiltering = isSearching || isFiltering;
|
|
4417
4438
|
const assetCount = assets.length;
|
|
4418
4439
|
const folderCount = folders.length;
|
|
@@ -4465,18 +4486,17 @@ const BrowseStep = ({
|
|
|
4465
4486
|
id: "view-switch.grid",
|
|
4466
4487
|
defaultMessage: "Grid View"
|
|
4467
4488
|
}),
|
|
4468
|
-
onClick: () => setView(isGridView ? viewOptions
|
|
4489
|
+
onClick: () => setView(isGridView ? viewOptions.LIST : viewOptions.GRID),
|
|
4469
4490
|
children: isGridView ? /* @__PURE__ */ jsxRuntime.jsx(icons.List, {}) : /* @__PURE__ */ jsxRuntime.jsx(icons.GridFour, {})
|
|
4470
4491
|
}
|
|
4471
4492
|
) }),
|
|
4472
4493
|
/* @__PURE__ */ jsxRuntime.jsx(SearchAsset, { onChangeSearch, queryValue: queryObject._q || "" })
|
|
4473
4494
|
] })
|
|
4474
4495
|
] }) }),
|
|
4475
|
-
canRead && breadcrumbs?.length > 0 && currentFolder && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4496
|
+
canRead && breadcrumbs?.length && breadcrumbs.length > 0 && currentFolder && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4476
4497
|
Breadcrumbs,
|
|
4477
4498
|
{
|
|
4478
4499
|
onChangeFolder,
|
|
4479
|
-
tag: "nav",
|
|
4480
4500
|
label: formatMessage({
|
|
4481
4501
|
id: getTrad("header.breadcrumbs.nav.label"),
|
|
4482
4502
|
defaultMessage: "Folders navigation"
|
|
@@ -4665,7 +4685,7 @@ const SelectedStep = ({
|
|
|
4665
4685
|
}) => {
|
|
4666
4686
|
const { formatMessage } = reactIntl.useIntl();
|
|
4667
4687
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 4, children: [
|
|
4668
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 0, children: [
|
|
4688
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 0, direction: "column", alignItems: "start", children: [
|
|
4669
4689
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", children: formatMessage(
|
|
4670
4690
|
{
|
|
4671
4691
|
id: getTrad("list.assets.to-upload"),
|
|
@@ -5024,6 +5044,10 @@ const FromComputerForm = ({
|
|
|
5024
5044
|
type: "file",
|
|
5025
5045
|
multiple: true,
|
|
5026
5046
|
name: "files",
|
|
5047
|
+
"aria-label": formatMessage({
|
|
5048
|
+
id: getTrad("input.label"),
|
|
5049
|
+
defaultMessage: "Drag & Drop here or"
|
|
5050
|
+
}),
|
|
5027
5051
|
tabIndex: -1,
|
|
5028
5052
|
ref: inputRef,
|
|
5029
5053
|
zIndex: 1,
|
|
@@ -5757,7 +5781,7 @@ const CarouselAssets = React__namespace.forwardRef(
|
|
|
5757
5781
|
}
|
|
5758
5782
|
)
|
|
5759
5783
|
}
|
|
5760
|
-
) : assets.map((asset,
|
|
5784
|
+
) : assets.map((asset, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5761
5785
|
designSystem.CarouselSlide,
|
|
5762
5786
|
{
|
|
5763
5787
|
label: formatMessage(
|
|
@@ -5765,7 +5789,7 @@ const CarouselAssets = React__namespace.forwardRef(
|
|
|
5765
5789
|
id: getTrad("mediaLibraryInput.slideCount"),
|
|
5766
5790
|
defaultMessage: "{n} of {m} slides"
|
|
5767
5791
|
},
|
|
5768
|
-
{ n:
|
|
5792
|
+
{ n: index + 1, m: assets.length }
|
|
5769
5793
|
),
|
|
5770
5794
|
children: /* @__PURE__ */ jsxRuntime.jsx(CarouselAsset, { asset })
|
|
5771
5795
|
},
|
|
@@ -5978,136 +6002,8 @@ const MediaLibraryInput = React__namespace.forwardRef(
|
|
|
5978
6002
|
] });
|
|
5979
6003
|
}
|
|
5980
6004
|
);
|
|
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
6005
|
const name = pluginPkg.strapi.name;
|
|
6110
|
-
const
|
|
6006
|
+
const admin = {
|
|
6111
6007
|
register(app) {
|
|
6112
6008
|
app.addMenuLink({
|
|
6113
6009
|
to: `plugins/${pluginId}`,
|
|
@@ -6117,21 +6013,32 @@ const index = {
|
|
|
6117
6013
|
defaultMessage: "Media Library"
|
|
6118
6014
|
},
|
|
6119
6015
|
permissions: PERMISSIONS.main,
|
|
6120
|
-
Component: () => Promise.resolve().then(() => require("./
|
|
6016
|
+
Component: () => Promise.resolve().then(() => require("./App-Dqqn78jO.js")).then((mod) => ({ default: mod.Upload })),
|
|
6121
6017
|
position: 4
|
|
6122
6018
|
});
|
|
6123
6019
|
app.addSettingsLink("global", {
|
|
6124
6020
|
id: "media-library-settings",
|
|
6021
|
+
to: "media-library",
|
|
6125
6022
|
intlLabel: {
|
|
6126
6023
|
id: getTrad("plugin.name"),
|
|
6127
6024
|
defaultMessage: "Media Library"
|
|
6128
6025
|
},
|
|
6129
|
-
|
|
6130
|
-
|
|
6026
|
+
async Component() {
|
|
6027
|
+
const { ProtectedSettingsPage } = await Promise.resolve().then(() => require("./SettingsPage-oDEVs3XV.js"));
|
|
6028
|
+
return { default: ProtectedSettingsPage };
|
|
6029
|
+
},
|
|
6131
6030
|
permissions: PERMISSIONS.settings
|
|
6132
6031
|
});
|
|
6133
|
-
app.addFields({
|
|
6134
|
-
|
|
6032
|
+
app.addFields({
|
|
6033
|
+
type: "media",
|
|
6034
|
+
Component: MediaLibraryInput
|
|
6035
|
+
});
|
|
6036
|
+
app.addComponents([
|
|
6037
|
+
{
|
|
6038
|
+
name: "media-library",
|
|
6039
|
+
Component: MediaLibraryDialog
|
|
6040
|
+
}
|
|
6041
|
+
]);
|
|
6135
6042
|
app.registerPlugin({
|
|
6136
6043
|
id: pluginId,
|
|
6137
6044
|
name
|
|
@@ -6156,10 +6063,8 @@ const index = {
|
|
|
6156
6063
|
return Promise.resolve(importedTrads);
|
|
6157
6064
|
}
|
|
6158
6065
|
};
|
|
6159
|
-
exports.AssetDefinition = AssetDefinition;
|
|
6160
6066
|
exports.AssetGridList = AssetGridList;
|
|
6161
6067
|
exports.Breadcrumbs = Breadcrumbs;
|
|
6162
|
-
exports.BreadcrumbsDefinition = BreadcrumbsDefinition;
|
|
6163
6068
|
exports.EditAssetDialog = EditAssetDialog;
|
|
6164
6069
|
exports.EditFolderDialog = EditFolderDialog;
|
|
6165
6070
|
exports.EmptyAssets = EmptyAssets;
|
|
@@ -6168,18 +6073,17 @@ exports.FilterPopover = FilterPopover;
|
|
|
6168
6073
|
exports.FolderCard = FolderCard;
|
|
6169
6074
|
exports.FolderCardBody = FolderCardBody;
|
|
6170
6075
|
exports.FolderCardBodyAction = FolderCardBodyAction;
|
|
6171
|
-
exports.FolderDefinition = FolderDefinition;
|
|
6172
6076
|
exports.FolderGridList = FolderGridList;
|
|
6173
6077
|
exports.PERMISSIONS = PERMISSIONS;
|
|
6174
6078
|
exports.SelectTree = SelectTree;
|
|
6175
6079
|
exports.SortPicker = SortPicker;
|
|
6176
6080
|
exports.TableList = TableList;
|
|
6177
6081
|
exports.UploadAssetDialog = UploadAssetDialog;
|
|
6082
|
+
exports.admin = admin;
|
|
6178
6083
|
exports.containsAssetFilter = containsAssetFilter;
|
|
6179
6084
|
exports.displayedFilters = displayedFilters;
|
|
6180
6085
|
exports.getFolderURL = getFolderURL;
|
|
6181
6086
|
exports.getTrad = getTrad;
|
|
6182
|
-
exports.index = index;
|
|
6183
6087
|
exports.localStorageKeys = localStorageKeys;
|
|
6184
6088
|
exports.normalizeAPIError = normalizeAPIError;
|
|
6185
6089
|
exports.pageSizes = pageSizes;
|
|
@@ -6196,4 +6100,4 @@ exports.useMediaLibraryPermissions = useMediaLibraryPermissions;
|
|
|
6196
6100
|
exports.usePersistentState = usePersistentState;
|
|
6197
6101
|
exports.useSelectionState = useSelectionState;
|
|
6198
6102
|
exports.viewOptions = viewOptions;
|
|
6199
|
-
//# sourceMappingURL=index-
|
|
6103
|
+
//# sourceMappingURL=index-B7NW5XiM.js.map
|