@strapi/upload 5.4.1 → 5.5.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/{App-qgVMMoa7.mjs → App-CnKRJSFI.mjs} +3 -3
- package/dist/_chunks/{App-qgVMMoa7.mjs.map → App-CnKRJSFI.mjs.map} +1 -1
- package/dist/_chunks/{App-DeNaeOad.js → App-DvNA8DcO.js} +4 -5
- package/dist/_chunks/{App-DeNaeOad.js.map → App-DvNA8DcO.js.map} +1 -1
- package/dist/_chunks/{ConfigureTheView-C30XDPKG.mjs → ConfigureTheView-BiYrBNO5.mjs} +2 -2
- package/dist/_chunks/{ConfigureTheView-C30XDPKG.mjs.map → ConfigureTheView-BiYrBNO5.mjs.map} +1 -1
- package/dist/_chunks/{ConfigureTheView-AK7hc1C0.js → ConfigureTheView-CgkgNQgk.js} +3 -4
- package/dist/_chunks/{ConfigureTheView-AK7hc1C0.js.map → ConfigureTheView-CgkgNQgk.js.map} +1 -1
- package/dist/_chunks/{SettingsPage-DV0sB7xY.mjs → SettingsPage-B0kz2mu3.mjs} +2 -2
- package/dist/_chunks/{SettingsPage-DV0sB7xY.mjs.map → SettingsPage-B0kz2mu3.mjs.map} +1 -1
- package/dist/_chunks/{SettingsPage-C60zLXmE.js → SettingsPage-BBl5rnJi.js} +3 -4
- package/dist/_chunks/{SettingsPage-C60zLXmE.js.map → SettingsPage-BBl5rnJi.js.map} +1 -1
- package/dist/_chunks/{graphql-68BJxih-.mjs → graphql-DMPTPlvx.mjs} +2 -2
- package/dist/_chunks/{graphql-68BJxih-.mjs.map → graphql-DMPTPlvx.mjs.map} +1 -1
- package/dist/_chunks/{graphql-DkkRswQX.js → graphql-QF5Y36Qj.js} +2 -2
- package/dist/_chunks/{graphql-DkkRswQX.js.map → graphql-QF5Y36Qj.js.map} +1 -1
- package/dist/_chunks/{index-DFekBoCC.mjs → index-B2N2JGA2.mjs} +68 -49
- package/dist/_chunks/index-B2N2JGA2.mjs.map +1 -0
- package/dist/_chunks/{index-BDq2waDf.js → index-D57iKFts.js} +9 -16
- package/dist/_chunks/{index-BDq2waDf.js.map → index-D57iKFts.js.map} +1 -1
- package/dist/_chunks/{index-DwVjDEMt.js → index-jOutXPCm.js} +60 -41
- package/dist/_chunks/index-jOutXPCm.js.map +1 -0
- package/dist/_chunks/{index-BGwOh3pn.mjs → index-sOlgMDiZ.mjs} +9 -16
- package/dist/_chunks/{index-BGwOh3pn.mjs.map → index-sOlgMDiZ.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/MediaLibraryInput/MediaLibraryInput.d.ts +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.mjs +1 -1
- package/package.json +10 -9
- package/dist/_chunks/index-DFekBoCC.mjs.map +0 -1
- package/dist/_chunks/index-DwVjDEMt.js.map +0 -1
|
@@ -327,7 +327,7 @@ async function register({ strapi: strapi2 }) {
|
|
|
327
327
|
strapi2.plugin("upload").provider = createProvider(strapi2.config.get("plugin::upload"));
|
|
328
328
|
await registerUploadMiddleware({ strapi: strapi2 });
|
|
329
329
|
if (strapi2.plugin("graphql")) {
|
|
330
|
-
const { installGraphqlExtension } = await Promise.resolve().then(() => require("./graphql-
|
|
330
|
+
const { installGraphqlExtension } = await Promise.resolve().then(() => require("./graphql-QF5Y36Qj.js"));
|
|
331
331
|
installGraphqlExtension({ strapi: strapi2 });
|
|
332
332
|
}
|
|
333
333
|
if (strapi2.plugin("documentation")) {
|
|
@@ -917,8 +917,7 @@ const upload = ({ strapi: strapi2 }) => {
|
|
|
917
917
|
const formats = await generateResponsiveFormats2(fileData);
|
|
918
918
|
if (Array.isArray(formats) && formats.length > 0) {
|
|
919
919
|
for (const format of formats) {
|
|
920
|
-
if (!format)
|
|
921
|
-
continue;
|
|
920
|
+
if (!format) continue;
|
|
922
921
|
uploadPromises.push(uploadResponsiveFormat(format));
|
|
923
922
|
}
|
|
924
923
|
}
|
|
@@ -1220,8 +1219,7 @@ const DEFAULT_BREAKPOINTS = {
|
|
|
1220
1219
|
const getBreakpoints = () => strapi.config.get("plugin::upload.breakpoints", DEFAULT_BREAKPOINTS);
|
|
1221
1220
|
const generateResponsiveFormats = async (file2) => {
|
|
1222
1221
|
const { responsiveDimensions = false } = await getService("upload").getSettings() ?? {};
|
|
1223
|
-
if (!responsiveDimensions)
|
|
1224
|
-
return [];
|
|
1222
|
+
if (!responsiveDimensions) return [];
|
|
1225
1223
|
const originalDimensions = await getDimensions(file2);
|
|
1226
1224
|
const breakpoints = getBreakpoints();
|
|
1227
1225
|
return Promise.all(
|
|
@@ -1471,8 +1469,7 @@ const folder = {
|
|
|
1471
1469
|
getStructure
|
|
1472
1470
|
};
|
|
1473
1471
|
const getFolderPath = async (folderId) => {
|
|
1474
|
-
if (!folderId)
|
|
1475
|
-
return "/";
|
|
1472
|
+
if (!folderId) return "/";
|
|
1476
1473
|
const parentFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({ where: { id: folderId } });
|
|
1477
1474
|
return parentFolder.path;
|
|
1478
1475
|
};
|
|
@@ -2084,8 +2081,7 @@ const validateUpdateFolderSchema = (id) => utils.yup.object().shape({
|
|
|
2084
2081
|
"dont-move-inside-self",
|
|
2085
2082
|
"folder cannot be moved inside itself",
|
|
2086
2083
|
async function test(parent) {
|
|
2087
|
-
if (fp.isNil(parent))
|
|
2088
|
-
return true;
|
|
2084
|
+
if (fp.isNil(parent)) return true;
|
|
2089
2085
|
const destinationFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({
|
|
2090
2086
|
select: ["path"],
|
|
2091
2087
|
where: { id: parent }
|
|
@@ -2094,8 +2090,7 @@ const validateUpdateFolderSchema = (id) => utils.yup.object().shape({
|
|
|
2094
2090
|
select: ["path"],
|
|
2095
2091
|
where: { id }
|
|
2096
2092
|
});
|
|
2097
|
-
if (!destinationFolder || !currentFolder)
|
|
2098
|
-
return true;
|
|
2093
|
+
if (!destinationFolder || !currentFolder) return true;
|
|
2099
2094
|
return !isFolderOrChild(destinationFolder, currentFolder);
|
|
2100
2095
|
}
|
|
2101
2096
|
)
|
|
@@ -2217,8 +2212,7 @@ const validateStructureMoveManyFoldersFilesSchema = utils.yup.object().shape({
|
|
|
2217
2212
|
}).noUnknown().required();
|
|
2218
2213
|
const validateDuplicatesMoveManyFoldersFilesSchema = utils.yup.object().test("are-folders-unique", "some folders already exist", async function areFoldersUnique(value) {
|
|
2219
2214
|
const { folderIds, destinationFolderId } = value;
|
|
2220
|
-
if (fp.isEmpty(folderIds))
|
|
2221
|
-
return true;
|
|
2215
|
+
if (fp.isEmpty(folderIds)) return true;
|
|
2222
2216
|
const folders = await strapi.db.query(FOLDER_MODEL_UID).findMany({
|
|
2223
2217
|
select: ["name"],
|
|
2224
2218
|
where: { id: { $in: folderIds } }
|
|
@@ -2240,8 +2234,7 @@ const validateMoveFoldersNotInsideThemselvesSchema = utils.yup.object().test(
|
|
|
2240
2234
|
"folders cannot be moved inside themselves or one of its children",
|
|
2241
2235
|
async function validateMoveFoldersNotInsideThemselves(value) {
|
|
2242
2236
|
const { folderIds, destinationFolderId } = value;
|
|
2243
|
-
if (destinationFolderId === null || fp.isEmpty(folderIds))
|
|
2244
|
-
return true;
|
|
2237
|
+
if (destinationFolderId === null || fp.isEmpty(folderIds)) return true;
|
|
2245
2238
|
const destinationFolder = await strapi.db.query(FOLDER_MODEL_UID).findOne({
|
|
2246
2239
|
select: ["path"],
|
|
2247
2240
|
where: { id: destinationFolderId }
|
|
@@ -2725,4 +2718,4 @@ const index = () => ({
|
|
|
2725
2718
|
});
|
|
2726
2719
|
exports.FILE_MODEL_UID = FILE_MODEL_UID;
|
|
2727
2720
|
exports.index = index;
|
|
2728
|
-
//# sourceMappingURL=index-
|
|
2721
|
+
//# sourceMappingURL=index-D57iKFts.js.map
|