payload 3.77.0-internal.8cf758f → 3.77.0-internal.9837b1e

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.
@@ -19,7 +19,7 @@ import { ReadonlyRequestCookies } from 'next/dist/server/web/spec-extension/adap
19
19
  import { PinoPretty } from 'pino-pretty';
20
20
  import { DatePickerProps } from 'react-datepicker';
21
21
 
22
- declare const clientTranslationKeys: ("authentication:account" | "authentication:accountOfCurrentUser" | "authentication:accountVerified" | "authentication:alreadyActivated" | "authentication:alreadyLoggedIn" | "authentication:apiKey" | "authentication:authenticated" | "authentication:backToLogin" | "authentication:beginCreateFirstUser" | "authentication:changePassword" | "authentication:checkYourEmailForPasswordReset" | "authentication:confirmGeneration" | "authentication:confirmPassword" | "authentication:createFirstUser" | "authentication:emailNotValid" | "authentication:emailOrUsername" | "authentication:emailSent" | "authentication:emailVerified" | "authentication:enableAPIKey" | "authentication:failedToUnlock" | "authentication:forceUnlock" | "authentication:forgotPassword" | "authentication:forgotPasswordEmailInstructions" | "authentication:forgotPasswordUsernameInstructions" | "authentication:usernameNotValid" | "authentication:forgotPasswordQuestion" | "authentication:generate" | "authentication:generateNewAPIKey" | "authentication:generatingNewAPIKeyWillInvalidate" | "authentication:logBackIn" | "authentication:loggedIn" | "authentication:loggedInChangePassword" | "authentication:loggedOutInactivity" | "authentication:loggedOutSuccessfully" | "authentication:loggingOut" | "authentication:login" | "authentication:logOut" | "authentication:logout" | "authentication:logoutSuccessful" | "authentication:logoutUser" | "authentication:newAPIKeyGenerated" | "authentication:newPassword" | "authentication:passed" | "authentication:passwordResetSuccessfully" | "authentication:resetPassword" | "authentication:stayLoggedIn" | "authentication:successfullyRegisteredFirstUser" | "authentication:successfullyUnlocked" | "authentication:tokenRefreshSuccessful" | "authentication:unableToVerify" | "authentication:username" | "authentication:verified" | "authentication:verifiedSuccessfully" | "authentication:verify" | "authentication:verifyUser" | "authentication:youAreInactive" | "dashboard:addWidget" | "dashboard:deleteWidget" | "dashboard:searchWidgets" | "error:autosaving" | "error:correctInvalidFields" | "error:deletingTitle" | "error:documentNotFound" | "error:emailOrPasswordIncorrect" | "error:insufficientClipboardPermissions" | "error:invalidClipboardData" | "error:invalidFileType" | "error:invalidRequestArgs" | "error:loadingDocument" | "error:logoutFailed" | "error:noMatchedField" | "error:notAllowedToAccessPage" | "error:notAllowedToPerformAction" | "error:previewing" | "error:problemUploadingFile" | "error:restoringTitle" | "error:revertingDocument" | "error:tokenNotProvided" | "error:unableToCopy" | "error:unableToDeleteCount" | "error:unableToReindexCollection" | "error:unableToUpdateCount" | "error:unauthorized" | "error:unauthorizedAdmin" | "error:unknown" | "error:unPublishingDocument" | "error:unspecific" | "error:unverifiedEmail" | "error:userEmailAlreadyRegistered" | "error:usernameAlreadyRegistered" | "error:usernameOrPasswordIncorrect" | "fields:blocks" | "fields:addLabel" | "fields:addLink" | "fields:addNew" | "fields:addNewLabel" | "fields:addRelationship" | "fields:addUpload" | "fields:block" | "fields:blockType" | "fields:chooseBetweenCustomTextOrDocument" | "fields:chooseDocumentToLink" | "fields:chooseFromExisting" | "fields:collapseAll" | "fields:customURL" | "fields:editLink" | "fields:editRelationship" | "fields:enterURL" | "fields:internalLink" | "fields:itemsAndMore" | "fields:labelRelationship" | "fields:latitude" | "fields:linkedTo" | "fields:linkType" | "fields:longitude" | "fields:openInNewTab" | "fields:passwordsDoNotMatch" | "fields:removeRelationship" | "fields:removeUpload" | "fields:saveChanges" | "fields:searchForBlock" | "fields:searchForLanguage" | "fields:selectFieldsToEdit" | "fields:showAll" | "fields:swapRelationship" | "fields:swapUpload" | "fields:textToDisplay" | "fields:toggleBlock" | "fields:uploadNewLabel" | "folder:browseByFolder" | "folder:byFolder" | "folder:deleteFolder" | "folder:folderName" | "folder:folders" | "folder:folderTypeDescription" | "folder:itemHasBeenMoved" | "folder:itemHasBeenMovedToRoot" | "folder:itemsMovedToFolder" | "folder:itemsMovedToRoot" | "folder:moveFolder" | "folder:moveItemsToFolderConfirmation" | "folder:moveItemsToRootConfirmation" | "folder:moveItemToFolderConfirmation" | "folder:moveItemToRootConfirmation" | "folder:movingFromFolder" | "folder:newFolder" | "folder:noFolder" | "folder:renameFolder" | "folder:searchByNameInFolder" | "folder:selectFolderForItem" | "general:items" | "general:of" | "general:language" | "general:dashboard" | "general:error" | "general:username" | "general:notFound" | "general:unauthorized" | "general:newLabel" | "general:name" | "general:aboutToDelete" | "general:aboutToPermanentlyDelete" | "general:aboutToPermanentlyDeleteTrash" | "general:aboutToRestore" | "general:aboutToRestoreAsDraft" | "general:aboutToRestoreAsDraftCount" | "general:aboutToRestoreCount" | "general:aboutToTrash" | "general:aboutToTrashCount" | "general:addBelow" | "general:addFilter" | "general:adminTheme" | "general:all" | "general:allCollections" | "general:allLocales" | "general:and" | "general:anotherUser" | "general:anotherUserTakenOver" | "general:applyChanges" | "general:ascending" | "general:automatic" | "general:backToDashboard" | "general:cancel" | "general:changesNotSaved" | "general:clear" | "general:clearAll" | "general:close" | "general:collapse" | "general:collections" | "general:columns" | "general:columnToSort" | "general:confirm" | "general:confirmCopy" | "general:confirmDeletion" | "general:confirmDuplication" | "general:confirmMove" | "general:confirmReindex" | "general:confirmReindexAll" | "general:confirmReindexDescription" | "general:confirmReindexDescriptionAll" | "general:confirmRestoration" | "general:copied" | "general:copy" | "general:copyField" | "general:copying" | "general:copyRow" | "general:copyWarning" | "general:create" | "general:created" | "general:createdAt" | "general:createNew" | "general:createNewLabel" | "general:creating" | "general:creatingNewLabel" | "general:currentlyEditing" | "general:custom" | "general:dark" | "general:delete" | "general:deleted" | "general:deletedAt" | "general:deletedCountSuccessfully" | "general:deletedSuccessfully" | "general:deleteLabel" | "general:deletePermanently" | "general:deleting" | "general:depth" | "general:descending" | "general:deselectAllRows" | "general:document" | "general:documentIsTrashed" | "general:documentLocked" | "general:documents" | "general:duplicate" | "general:duplicateWithoutSaving" | "general:edit" | "general:editAll" | "general:editedSince" | "general:editing" | "general:editingTakenOver" | "general:editLabel" | "general:email" | "general:emailAddress" | "general:emptyTrash" | "general:emptyTrashLabel" | "general:enterAValue" | "general:errors" | "general:exitLivePreview" | "general:export" | "general:fallbackToDefaultLocale" | "general:false" | "general:filters" | "general:filterWhere" | "general:globals" | "general:goBack" | "general:groupByLabel" | "general:import" | "general:isEditing" | "general:item" | "general:lastModified" | "general:leaveAnyway" | "general:leaveWithoutSaving" | "general:light" | "general:livePreview" | "general:loading" | "general:locale" | "general:locales" | "general:lock" | "general:menu" | "general:moreOptions" | "general:move" | "general:moveConfirm" | "general:moveCount" | "general:moveDown" | "general:moveUp" | "general:moving" | "general:movingCount" | "general:next" | "general:no" | "general:noDateSelected" | "general:noFiltersSet" | "general:noLabel" | "general:none" | "general:noOptions" | "general:noResults" | "general:nothingFound" | "general:noTrashResults" | "general:noUpcomingEventsScheduled" | "general:noValue" | "general:only" | "general:open" | "general:or" | "general:order" | "general:overwriteExistingData" | "general:pageNotFound" | "general:password" | "general:pasteField" | "general:pasteRow" | "general:payloadSettings" | "general:permanentlyDelete" | "general:permanentlyDeletedCountSuccessfully" | "general:perPage" | "general:previous" | "general:reindex" | "general:reindexingAll" | "general:remove" | "general:rename" | "general:reset" | "general:resetPreferences" | "general:resetPreferencesDescription" | "general:resettingPreferences" | "general:restore" | "general:restoreAsPublished" | "general:restoredCountSuccessfully" | "general:restoring" | "general:row" | "general:rows" | "general:save" | "general:saving" | "general:schedulePublishFor" | "general:searchBy" | "general:select" | "general:selectAll" | "general:selectAllRows" | "general:selectedCount" | "general:selectLabel" | "general:selectValue" | "general:showAllLabel" | "general:sorryNotFound" | "general:sort" | "general:sortByLabelDirection" | "general:stayOnThisPage" | "general:submissionSuccessful" | "general:submit" | "general:submitting" | "general:success" | "general:successfullyCreated" | "general:successfullyDuplicated" | "general:successfullyReindexed" | "general:takeOver" | "general:thisLanguage" | "general:time" | "general:timezone" | "general:titleDeleted" | "general:titleRestored" | "general:titleTrashed" | "general:trash" | "general:trashedCountSuccessfully" | "general:true" | "general:unlock" | "general:unsavedChanges" | "general:unsavedChangesDuplicate" | "general:untitled" | "general:upcomingEvents" | "general:updatedAt" | "general:updatedCountSuccessfully" | "general:updatedLabelSuccessfully" | "general:updatedSuccessfully" | "general:updateForEveryone" | "general:updating" | "general:uploading" | "general:uploadingBulk" | "general:user" | "general:users" | "general:value" | "general:viewing" | "general:viewReadOnly" | "general:welcome" | "general:yes" | "localization:cannotCopySameLocale" | "localization:copyFrom" | "localization:copyFromTo" | "localization:copyTo" | "localization:copyToLocale" | "localization:localeToPublish" | "localization:selectedLocales" | "localization:selectLocaleToCopy" | "localization:selectLocaleToDuplicate" | "operators:contains" | "operators:equals" | "operators:exists" | "operators:intersects" | "operators:near" | "operators:within" | "operators:isGreaterThan" | "operators:isGreaterThanOrEqualTo" | "operators:isIn" | "operators:isLessThan" | "operators:isLessThanOrEqualTo" | "operators:isLike" | "operators:isNotEqualTo" | "operators:isNotIn" | "operators:isNotLike" | "upload:addFile" | "upload:addFiles" | "upload:bulkUpload" | "upload:crop" | "upload:cropToolDescription" | "upload:download" | "upload:dragAndDrop" | "upload:editImage" | "upload:fileName" | "upload:fileSize" | "upload:filesToUpload" | "upload:fileToUpload" | "upload:focalPoint" | "upload:focalPointDescription" | "upload:height" | "upload:noFile" | "upload:pasteURL" | "upload:previewSizes" | "upload:selectCollectionToBrowse" | "upload:selectFile" | "upload:setCropArea" | "upload:setFocalPoint" | "upload:sizes" | "upload:sizesFor" | "upload:width" | "validation:username" | "validation:emailAddress" | "validation:enterNumber" | "validation:fieldHasNo" | "validation:greaterThanMax" | "validation:invalidBlock" | "validation:invalidBlocks" | "validation:invalidInput" | "validation:invalidSelection" | "validation:invalidSelections" | "validation:latitudeOutOfBounds" | "validation:lessThanMin" | "validation:limitReached" | "validation:longerThanMin" | "validation:longitudeOutOfBounds" | "validation:notValidDate" | "validation:required" | "validation:requiresAtLeast" | "validation:requiresNoMoreThan" | "validation:requiresTwoNumbers" | "validation:shorterThanMax" | "validation:timezoneRequired" | "validation:trueOrFalse" | "validation:validUploadID" | "version:version" | "version:aboutToRestore" | "version:restoring" | "version:type" | "version:aboutToPublishSelection" | "version:aboutToRestoreGlobal" | "version:aboutToRevertToPublished" | "version:aboutToUnpublish" | "version:aboutToUnpublishIn" | "version:aboutToUnpublishSelection" | "version:autosave" | "version:autosavedSuccessfully" | "version:autosavedVersion" | "version:changed" | "version:compareVersions" | "version:comparingAgainst" | "version:confirmPublish" | "version:confirmRevertToSaved" | "version:confirmUnpublish" | "version:confirmVersionRestoration" | "version:currentDraft" | "version:currentlyPublished" | "version:currentlyViewing" | "version:currentPublishedVersion" | "version:draft" | "version:draftHasPublishedVersion" | "version:draftSavedSuccessfully" | "version:lastSavedAgo" | "version:modifiedOnly" | "version:moreVersions" | "version:noFurtherVersionsFound" | "version:noLabelGroup" | "version:noRowsFound" | "version:noRowsSelected" | "version:preview" | "version:previouslyDraft" | "version:previouslyPublished" | "version:previousVersion" | "version:problemRestoringVersion" | "version:publish" | "version:publishAllLocales" | "version:publishChanges" | "version:published" | "version:publishIn" | "version:publishing" | "version:restoreAsDraft" | "version:restoredSuccessfully" | "version:restoreThisVersion" | "version:reverting" | "version:revertToPublished" | "version:revertUnsuccessful" | "version:saveDraft" | "version:scheduledSuccessfully" | "version:schedulePublish" | "version:selectLocales" | "version:selectVersionToCompare" | "version:showLocales" | "version:specificVersion" | "version:status" | "version:unpublish" | "version:unpublished" | "version:unpublishedSuccessfully" | "version:unpublishIn" | "version:unpublishing" | "version:versionAgo" | "version:versionID" | "version:versions" | "version:viewingVersion" | "version:viewingVersionGlobal" | "version:viewingVersions" | "version:viewingVersionsGlobal" | "general:aboutToDeleteCount" | "general:editingLabel" | "version:changedFieldsCount")[];
22
+ declare const clientTranslationKeys: ("authentication:account" | "authentication:accountOfCurrentUser" | "authentication:accountVerified" | "authentication:alreadyActivated" | "authentication:alreadyLoggedIn" | "authentication:apiKey" | "authentication:authenticated" | "authentication:backToLogin" | "authentication:beginCreateFirstUser" | "authentication:changePassword" | "authentication:checkYourEmailForPasswordReset" | "authentication:confirmGeneration" | "authentication:confirmPassword" | "authentication:createFirstUser" | "authentication:emailNotValid" | "authentication:emailOrUsername" | "authentication:emailSent" | "authentication:emailVerified" | "authentication:enableAPIKey" | "authentication:failedToUnlock" | "authentication:forceUnlock" | "authentication:forgotPassword" | "authentication:forgotPasswordEmailInstructions" | "authentication:forgotPasswordUsernameInstructions" | "authentication:usernameNotValid" | "authentication:forgotPasswordQuestion" | "authentication:generate" | "authentication:generateNewAPIKey" | "authentication:generatingNewAPIKeyWillInvalidate" | "authentication:logBackIn" | "authentication:loggedIn" | "authentication:loggedInChangePassword" | "authentication:loggedOutInactivity" | "authentication:loggedOutSuccessfully" | "authentication:loggingOut" | "authentication:login" | "authentication:logOut" | "authentication:logout" | "authentication:logoutSuccessful" | "authentication:logoutUser" | "authentication:newAPIKeyGenerated" | "authentication:newPassword" | "authentication:passed" | "authentication:passwordResetSuccessfully" | "authentication:resetPassword" | "authentication:stayLoggedIn" | "authentication:successfullyRegisteredFirstUser" | "authentication:successfullyUnlocked" | "authentication:tokenRefreshSuccessful" | "authentication:unableToVerify" | "authentication:username" | "authentication:verified" | "authentication:verifiedSuccessfully" | "authentication:verify" | "authentication:verifyUser" | "authentication:youAreInactive" | "dashboard:addWidget" | "dashboard:deleteWidget" | "dashboard:searchWidgets" | "error:autosaving" | "error:correctInvalidFields" | "error:deletingTitle" | "error:documentNotFound" | "error:emailOrPasswordIncorrect" | "error:insufficientClipboardPermissions" | "error:invalidClipboardData" | "error:invalidFileType" | "error:invalidRequestArgs" | "error:loadingDocument" | "error:logoutFailed" | "error:noMatchedField" | "error:notAllowedToAccessPage" | "error:notAllowedToPerformAction" | "error:previewing" | "error:problemUploadingFile" | "error:restoringTitle" | "error:revertingDocument" | "error:tokenNotProvided" | "error:unableToCopy" | "error:unableToDeleteCount" | "error:unableToReindexCollection" | "error:unableToUpdateCount" | "error:unauthorized" | "error:unauthorizedAdmin" | "error:unknown" | "error:unPublishingDocument" | "error:unspecific" | "error:unverifiedEmail" | "error:userEmailAlreadyRegistered" | "error:usernameAlreadyRegistered" | "error:usernameOrPasswordIncorrect" | "fields:blocks" | "fields:addLabel" | "fields:addLink" | "fields:addNew" | "fields:addNewLabel" | "fields:addRelationship" | "fields:addUpload" | "fields:block" | "fields:blockType" | "fields:chooseBetweenCustomTextOrDocument" | "fields:chooseDocumentToLink" | "fields:chooseFromExisting" | "fields:collapseAll" | "fields:customURL" | "fields:editLink" | "fields:editRelationship" | "fields:enterURL" | "fields:internalLink" | "fields:itemsAndMore" | "fields:labelRelationship" | "fields:latitude" | "fields:linkedTo" | "fields:linkType" | "fields:longitude" | "fields:openInNewTab" | "fields:passwordsDoNotMatch" | "fields:removeRelationship" | "fields:removeUpload" | "fields:saveChanges" | "fields:searchForBlock" | "fields:searchForLanguage" | "fields:selectFieldsToEdit" | "fields:showAll" | "fields:swapRelationship" | "fields:swapUpload" | "fields:textToDisplay" | "fields:toggleBlock" | "fields:uploadNewLabel" | "folder:browseByFolder" | "folder:byFolder" | "folder:deleteFolder" | "folder:folderName" | "folder:folders" | "folder:folderTypeDescription" | "folder:itemHasBeenMoved" | "folder:itemHasBeenMovedToRoot" | "folder:itemsMovedToFolder" | "folder:itemsMovedToRoot" | "folder:moveFolder" | "folder:moveItemsToFolderConfirmation" | "folder:moveItemsToRootConfirmation" | "folder:moveItemToFolderConfirmation" | "folder:moveItemToRootConfirmation" | "folder:movingFromFolder" | "folder:newFolder" | "folder:noFolder" | "folder:renameFolder" | "folder:searchByNameInFolder" | "folder:selectFolderForItem" | "general:items" | "general:of" | "general:language" | "general:dashboard" | "general:error" | "general:username" | "general:notFound" | "general:unauthorized" | "general:newLabel" | "general:saveChanges" | "general:name" | "general:aboutToDelete" | "general:aboutToPermanentlyDelete" | "general:aboutToPermanentlyDeleteTrash" | "general:aboutToRestore" | "general:aboutToRestoreAsDraft" | "general:aboutToRestoreAsDraftCount" | "general:aboutToRestoreCount" | "general:aboutToTrash" | "general:aboutToTrashCount" | "general:addBelow" | "general:addFilter" | "general:adminTheme" | "general:all" | "general:allCollections" | "general:allLocales" | "general:and" | "general:anotherUser" | "general:anotherUserTakenOver" | "general:applyChanges" | "general:ascending" | "general:automatic" | "general:backToDashboard" | "general:cancel" | "general:changesNotSaved" | "general:clear" | "general:clearAll" | "general:close" | "general:collapse" | "general:collections" | "general:columns" | "general:columnToSort" | "general:confirm" | "general:confirmCopy" | "general:confirmDeletion" | "general:confirmDuplication" | "general:confirmMove" | "general:confirmReindex" | "general:confirmReindexAll" | "general:confirmReindexDescription" | "general:confirmReindexDescriptionAll" | "general:confirmRestoration" | "general:copied" | "general:copy" | "general:copyField" | "general:copying" | "general:copyRow" | "general:copyWarning" | "general:create" | "general:created" | "general:createdAt" | "general:createNew" | "general:createNewLabel" | "general:creating" | "general:creatingNewLabel" | "general:currentlyEditing" | "general:custom" | "general:dark" | "general:delete" | "general:deleted" | "general:deletedAt" | "general:deletedCountSuccessfully" | "general:deletedSuccessfully" | "general:deleteLabel" | "general:deletePermanently" | "general:deleting" | "general:depth" | "general:descending" | "general:deselectAllRows" | "general:document" | "general:documentIsTrashed" | "general:documentLocked" | "general:documents" | "general:duplicate" | "general:duplicateWithoutSaving" | "general:edit" | "general:editAll" | "general:editedSince" | "general:editing" | "general:editingTakenOver" | "general:editLabel" | "general:email" | "general:emailAddress" | "general:emptyTrash" | "general:emptyTrashLabel" | "general:enterAValue" | "general:errors" | "general:exitLivePreview" | "general:export" | "general:fallbackToDefaultLocale" | "general:false" | "general:filters" | "general:filterWhere" | "general:globals" | "general:goBack" | "general:groupByLabel" | "general:import" | "general:isEditing" | "general:item" | "general:lastModified" | "general:layout" | "general:leaveAnyway" | "general:leaveWithoutSaving" | "general:light" | "general:livePreview" | "general:loading" | "general:locale" | "general:locales" | "general:lock" | "general:menu" | "general:moreOptions" | "general:move" | "general:moveConfirm" | "general:moveCount" | "general:moveDown" | "general:moveUp" | "general:moving" | "general:movingCount" | "general:next" | "general:no" | "general:noDateSelected" | "general:noFiltersSet" | "general:noLabel" | "general:none" | "general:noOptions" | "general:noResults" | "general:nothingFound" | "general:noTrashResults" | "general:noUpcomingEventsScheduled" | "general:noValue" | "general:only" | "general:open" | "general:or" | "general:order" | "general:overwriteExistingData" | "general:pageNotFound" | "general:password" | "general:pasteField" | "general:pasteRow" | "general:payloadSettings" | "general:permanentlyDelete" | "general:permanentlyDeletedCountSuccessfully" | "general:perPage" | "general:previous" | "general:reindex" | "general:reindexingAll" | "general:remove" | "general:rename" | "general:reset" | "general:resetPreferences" | "general:resetPreferencesDescription" | "general:resettingPreferences" | "general:restore" | "general:restoreAsPublished" | "general:restoredCountSuccessfully" | "general:restoring" | "general:row" | "general:rows" | "general:save" | "general:saving" | "general:schedulePublishFor" | "general:searchBy" | "general:select" | "general:selectAll" | "general:selectAllRows" | "general:selectedCount" | "general:selectLabel" | "general:selectValue" | "general:showAllLabel" | "general:sorryNotFound" | "general:sort" | "general:sortByLabelDirection" | "general:stayOnThisPage" | "general:submissionSuccessful" | "general:submit" | "general:submitting" | "general:success" | "general:successfullyCreated" | "general:successfullyDuplicated" | "general:successfullyReindexed" | "general:takeOver" | "general:thisLanguage" | "general:time" | "general:timezone" | "general:titleDeleted" | "general:titleRestored" | "general:titleTrashed" | "general:trash" | "general:trashedCountSuccessfully" | "general:true" | "general:unlock" | "general:unsavedChanges" | "general:unsavedChangesDuplicate" | "general:untitled" | "general:upcomingEvents" | "general:updatedAt" | "general:updatedCountSuccessfully" | "general:updatedLabelSuccessfully" | "general:updatedSuccessfully" | "general:updateForEveryone" | "general:updating" | "general:uploading" | "general:uploadingBulk" | "general:user" | "general:users" | "general:value" | "general:viewing" | "general:viewReadOnly" | "general:welcome" | "general:yes" | "localization:cannotCopySameLocale" | "localization:copyFrom" | "localization:copyFromTo" | "localization:copyTo" | "localization:copyToLocale" | "localization:localeToPublish" | "localization:selectedLocales" | "localization:selectLocaleToCopy" | "localization:selectLocaleToDuplicate" | "operators:contains" | "operators:equals" | "operators:exists" | "operators:intersects" | "operators:near" | "operators:within" | "operators:isGreaterThan" | "operators:isGreaterThanOrEqualTo" | "operators:isIn" | "operators:isLessThan" | "operators:isLessThanOrEqualTo" | "operators:isLike" | "operators:isNotEqualTo" | "operators:isNotIn" | "operators:isNotLike" | "upload:addFile" | "upload:addFiles" | "upload:bulkUpload" | "upload:crop" | "upload:cropToolDescription" | "upload:download" | "upload:dragAndDrop" | "upload:editImage" | "upload:fileName" | "upload:fileSize" | "upload:filesToUpload" | "upload:fileToUpload" | "upload:focalPoint" | "upload:focalPointDescription" | "upload:height" | "upload:noFile" | "upload:pasteURL" | "upload:previewSizes" | "upload:selectCollectionToBrowse" | "upload:selectFile" | "upload:setCropArea" | "upload:setFocalPoint" | "upload:sizes" | "upload:sizesFor" | "upload:width" | "validation:username" | "validation:emailAddress" | "validation:enterNumber" | "validation:fieldHasNo" | "validation:greaterThanMax" | "validation:invalidBlock" | "validation:invalidBlocks" | "validation:invalidInput" | "validation:invalidSelection" | "validation:invalidSelections" | "validation:latitudeOutOfBounds" | "validation:lessThanMin" | "validation:limitReached" | "validation:longerThanMin" | "validation:longitudeOutOfBounds" | "validation:notValidDate" | "validation:required" | "validation:requiresAtLeast" | "validation:requiresNoMoreThan" | "validation:requiresTwoNumbers" | "validation:shorterThanMax" | "validation:timezoneRequired" | "validation:trueOrFalse" | "validation:validUploadID" | "version:version" | "version:aboutToRestore" | "version:restoring" | "version:type" | "version:aboutToPublishSelection" | "version:aboutToRestoreGlobal" | "version:aboutToRevertToPublished" | "version:aboutToUnpublish" | "version:aboutToUnpublishIn" | "version:aboutToUnpublishSelection" | "version:autosave" | "version:autosavedSuccessfully" | "version:autosavedVersion" | "version:changed" | "version:compareVersions" | "version:comparingAgainst" | "version:confirmPublish" | "version:confirmRevertToSaved" | "version:confirmUnpublish" | "version:confirmVersionRestoration" | "version:currentDraft" | "version:currentlyPublished" | "version:currentlyViewing" | "version:currentPublishedVersion" | "version:draft" | "version:draftHasPublishedVersion" | "version:draftSavedSuccessfully" | "version:lastSavedAgo" | "version:modifiedOnly" | "version:moreVersions" | "version:noFurtherVersionsFound" | "version:noLabelGroup" | "version:noRowsFound" | "version:noRowsSelected" | "version:preview" | "version:previouslyDraft" | "version:previouslyPublished" | "version:previousVersion" | "version:problemRestoringVersion" | "version:publish" | "version:publishAllLocales" | "version:publishChanges" | "version:published" | "version:publishIn" | "version:publishing" | "version:restoreAsDraft" | "version:restoredSuccessfully" | "version:restoreThisVersion" | "version:reverting" | "version:revertToPublished" | "version:revertUnsuccessful" | "version:saveDraft" | "version:scheduledSuccessfully" | "version:schedulePublish" | "version:selectLocales" | "version:selectVersionToCompare" | "version:showLocales" | "version:specificVersion" | "version:status" | "version:unpublish" | "version:unpublished" | "version:unpublishedSuccessfully" | "version:unpublishIn" | "version:unpublishing" | "version:versionAgo" | "version:versionID" | "version:versions" | "version:viewingVersion" | "version:viewingVersionGlobal" | "version:viewingVersions" | "version:viewingVersionsGlobal" | "general:aboutToDeleteCount" | "general:editingLabel" | "version:changedFieldsCount")[];
23
23
 
24
24
  declare const enTranslations: {
25
25
  authentication: {
@@ -330,6 +330,7 @@ declare const enTranslations: {
330
330
  items: string;
331
331
  language: string;
332
332
  lastModified: string;
333
+ layout: string;
333
334
  leaveAnyway: string;
334
335
  leaveWithoutSaving: string;
335
336
  light: string;
@@ -392,6 +393,7 @@ declare const enTranslations: {
392
393
  row: string;
393
394
  rows: string;
394
395
  save: string;
396
+ saveChanges: string;
395
397
  saving: string;
396
398
  schedulePublishFor: string;
397
399
  searchBy: string;
@@ -30,10 +30,10 @@ export const getBaseUploadFields = ({ collection, config })=>{
30
30
  return generateFilePathOrURL({
31
31
  collectionSlug: collection.slug,
32
32
  config,
33
- filename: typeof adminThumbnail === 'string' ? originalDoc.sizes?.[adminThumbnail].filename : undefined,
33
+ filename: typeof adminThumbnail === 'string' ? originalDoc.sizes?.[adminThumbnail]?.filename : undefined,
34
34
  relative: false,
35
35
  serverURL: req.payload.config.serverURL,
36
- urlOrPath: typeof adminThumbnail === 'string' ? originalDoc.sizes?.[adminThumbnail].url : undefined
36
+ urlOrPath: typeof adminThumbnail === 'string' ? originalDoc.sizes?.[adminThumbnail]?.url : undefined
37
37
  });
38
38
  }
39
39
  ]
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/uploads/getBaseFields.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\nimport type { Config } from '../config/types.js'\nimport type { Field } from '../fields/config/types.js'\nimport type { UploadConfig } from './types.js'\n\nimport { generateFilePathOrURL } from './generateFilePathOrURL.js'\nimport { mimeTypeValidator } from './mimeTypeValidator.js'\n\ntype Options = {\n collection: CollectionConfig\n config: Config\n}\n\nexport const getBaseUploadFields = ({ collection, config }: Options): Field[] => {\n const uploadOptions: UploadConfig = typeof collection.upload === 'object' ? collection.upload : {}\n\n const mimeType: Field = {\n name: 'mimeType',\n type: 'text',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: 'MIME Type',\n }\n\n const thumbnailURL: Field = {\n name: 'thumbnailURL',\n type: 'text',\n admin: {\n hidden: true,\n readOnly: true,\n },\n hooks: {\n afterRead: [\n ({ originalDoc, req }) => {\n const adminThumbnail =\n typeof collection.upload !== 'boolean' ? collection.upload?.adminThumbnail : undefined\n\n if (typeof adminThumbnail === 'function') {\n return adminThumbnail({ doc: originalDoc })\n }\n\n return generateFilePathOrURL({\n collectionSlug: collection.slug,\n config,\n filename:\n typeof adminThumbnail === 'string'\n ? (originalDoc.sizes?.[adminThumbnail].filename as string)\n : undefined,\n relative: false,\n serverURL: req.payload.config.serverURL,\n urlOrPath:\n typeof adminThumbnail === 'string'\n ? (originalDoc.sizes?.[adminThumbnail].url as string)\n : undefined,\n })\n },\n ],\n },\n label: 'Thumbnail URL',\n }\n\n const width: Field = {\n name: 'width',\n type: 'number',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: ({ t }) => t('upload:width'),\n }\n\n const height: Field = {\n name: 'height',\n type: 'number',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: ({ t }) => t('upload:height'),\n }\n\n const filesize: Field = {\n name: 'filesize',\n type: 'number',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: ({ t }) => t('upload:fileSize'),\n }\n\n const filename: Field = {\n name: 'filename',\n type: 'text',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n readOnly: true,\n },\n index: true,\n label: ({ t }) => t('upload:fileName'),\n }\n\n // Only set unique: true if the collection does not have a compound index\n if (\n collection.upload === true ||\n (typeof collection.upload === 'object' && !collection.upload.filenameCompoundIndex)\n ) {\n filename.unique = true\n }\n\n const url: Field = {\n name: 'url',\n type: 'text',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: 'URL',\n }\n\n let uploadFields: Field[] = [\n {\n ...url,\n hooks: {\n afterRead: [\n ({ data, originalDoc, req, value }) =>\n generateFilePathOrURL({\n collectionSlug: collection.slug,\n config,\n filename: data?.filename || originalDoc?.filename,\n relative: false,\n serverURL: req.payload.config.serverURL,\n urlOrPath: value,\n }),\n ],\n beforeChange: [\n ({ collection, data, originalDoc, req, value }) =>\n generateFilePathOrURL({\n collectionSlug: collection?.slug as string,\n config,\n filename: data?.filename || originalDoc?.filename,\n relative: true,\n serverURL: req.payload.config.serverURL,\n urlOrPath: value,\n }),\n ],\n },\n },\n thumbnailURL,\n filename,\n mimeType,\n filesize,\n width,\n height,\n ]\n\n // Add focal point fields if not disabled\n if (\n uploadOptions.focalPoint !== false ||\n uploadOptions.imageSizes ||\n uploadOptions.resizeOptions\n ) {\n uploadFields = uploadFields.concat(\n ['focalX', 'focalY'].map((name) => {\n return {\n name,\n type: 'number',\n admin: {\n disableGroupBy: true,\n disableListColumn: true,\n disableListFilter: true,\n hidden: true,\n },\n }\n }),\n )\n }\n\n if (uploadOptions.mimeTypes) {\n mimeType.validate = mimeTypeValidator(uploadOptions.mimeTypes)\n }\n\n // In Payload v4, image size subfields (`url`, `width`, `height`, etc.) should\n // default to `disableGroupBy: true`, `disableListColumn: true` and `disableListFilter: true`\n // to avoid cluttering the collection list view and filters by default.\n if (uploadOptions.imageSizes) {\n uploadFields = uploadFields.concat([\n {\n name: 'sizes',\n type: 'group',\n admin: {\n hidden: true,\n },\n fields: uploadOptions.imageSizes.map((size) => ({\n name: size.name,\n type: 'group',\n admin: {\n hidden: true,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n fields: [\n {\n ...url,\n admin: {\n ...url.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n hooks: {\n afterRead: [\n ({ collection, data, originalDoc, req, value }) =>\n generateFilePathOrURL({\n collectionSlug: collection?.slug as string,\n config,\n filename:\n data?.sizes?.[size.name]?.filename ||\n originalDoc?.sizes?.[size.name]?.filename,\n relative: false,\n serverURL: req.payload.config.serverURL,\n urlOrPath: value,\n }),\n ],\n beforeChange: [\n ({ collection, data, originalDoc, req, value }) =>\n generateFilePathOrURL({\n collectionSlug: collection?.slug as string,\n config,\n filename:\n data?.sizes?.[size.name]?.filename ||\n originalDoc?.sizes?.[size.name]?.filename,\n relative: true,\n serverURL: req.payload.config.serverURL,\n urlOrPath: value,\n }),\n ],\n },\n },\n {\n ...width,\n admin: {\n ...width.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n },\n {\n ...height,\n admin: {\n ...height.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n },\n {\n ...mimeType,\n admin: {\n ...mimeType.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n },\n {\n ...filesize,\n admin: {\n ...filesize.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n },\n {\n ...filename,\n admin: {\n ...filename.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n unique: false,\n },\n ],\n label: size.name,\n })),\n label: ({ t }) => t('upload:sizes'),\n },\n ])\n }\n return uploadFields\n}\n"],"names":["generateFilePathOrURL","mimeTypeValidator","getBaseUploadFields","collection","config","uploadOptions","upload","mimeType","name","type","admin","hidden","readOnly","label","thumbnailURL","hooks","afterRead","originalDoc","req","adminThumbnail","undefined","doc","collectionSlug","slug","filename","sizes","relative","serverURL","payload","urlOrPath","url","width","t","height","filesize","disableBulkEdit","index","filenameCompoundIndex","unique","uploadFields","data","value","beforeChange","focalPoint","imageSizes","resizeOptions","concat","map","disableGroupBy","disableListColumn","disableListFilter","mimeTypes","validate","fields","size"],"mappings":"AAKA,SAASA,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,iBAAiB,QAAQ,yBAAwB;AAO1D,OAAO,MAAMC,sBAAsB,CAAC,EAAEC,UAAU,EAAEC,MAAM,EAAW;IACjE,MAAMC,gBAA8B,OAAOF,WAAWG,MAAM,KAAK,WAAWH,WAAWG,MAAM,GAAG,CAAC;IAEjG,MAAMC,WAAkB;QACtBC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,QAAQ;YACRC,UAAU;QACZ;QACAC,OAAO;IACT;IAEA,MAAMC,eAAsB;QAC1BN,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,QAAQ;YACRC,UAAU;QACZ;QACAG,OAAO;YACLC,WAAW;gBACT,CAAC,EAAEC,WAAW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EsC,kBAAkB;wCAAEA,gBAAgB;oCAAK,CAAC;oCAC1D,GAAIM,KAAK5C,KAAK,EAAEuC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;oCAChE,GAAIK,KAAK5C,KAAK,EAAEwC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;gCAClE;4BACF;4BACA;gCACE,GAAGhB,QAAQ;gCACXxB,OAAO;oCACL,GAAGwB,SAASxB,KAAK;oCACjB,GAAI4C,KAAK5C,KAAK,EAAEsC,kBAAkB;wCAAEA,gBAAgB;oCAAK,CAAC;oCAC1D,GAAIM,KAAK5C,KAAK,EAAEuC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;oCAChE,GAAIK,KAAK5C,KAAK,EAAEwC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;gCAClE;4BACF;4BACA;gCACE,GAAG1B,QAAQ;gCACXd,OAAO;oCACL,GAAGc,SAASd,KAAK;oCACjB,GAAI4C,KAAK5C,KAAK,EAAEsC,kBAAkB;wCAAEA,gBAAgB;oCAAK,CAAC;oCAC1D,GAAIM,KAAK5C,KAAK,EAAEuC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;oCAChE,GAAIK,KAAK5C,KAAK,EAAEwC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;gCAClE;gCACAZ,QAAQ;4BACV;yBACD;wBACDzB,OAAOyC,KAAK9C,IAAI;oBAClB,CAAA;gBACAK,OAAO,CAAC,EAAEmB,CAAC,EAAE,GAAKA,EAAE;YACtB;SACD;IACH;IACA,OAAOO;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/uploads/getBaseFields.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\nimport type { Config } from '../config/types.js'\nimport type { Field } from '../fields/config/types.js'\nimport type { UploadConfig } from './types.js'\n\nimport { generateFilePathOrURL } from './generateFilePathOrURL.js'\nimport { mimeTypeValidator } from './mimeTypeValidator.js'\n\ntype Options = {\n collection: CollectionConfig\n config: Config\n}\n\nexport const getBaseUploadFields = ({ collection, config }: Options): Field[] => {\n const uploadOptions: UploadConfig = typeof collection.upload === 'object' ? collection.upload : {}\n\n const mimeType: Field = {\n name: 'mimeType',\n type: 'text',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: 'MIME Type',\n }\n\n const thumbnailURL: Field = {\n name: 'thumbnailURL',\n type: 'text',\n admin: {\n hidden: true,\n readOnly: true,\n },\n hooks: {\n afterRead: [\n ({ originalDoc, req }) => {\n const adminThumbnail =\n typeof collection.upload !== 'boolean' ? collection.upload?.adminThumbnail : undefined\n\n if (typeof adminThumbnail === 'function') {\n return adminThumbnail({ doc: originalDoc })\n }\n\n return generateFilePathOrURL({\n collectionSlug: collection.slug,\n config,\n filename:\n typeof adminThumbnail === 'string'\n ? (originalDoc.sizes?.[adminThumbnail]?.filename as string)\n : undefined,\n relative: false,\n serverURL: req.payload.config.serverURL,\n urlOrPath:\n typeof adminThumbnail === 'string'\n ? (originalDoc.sizes?.[adminThumbnail]?.url as string)\n : undefined,\n })\n },\n ],\n },\n label: 'Thumbnail URL',\n }\n\n const width: Field = {\n name: 'width',\n type: 'number',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: ({ t }) => t('upload:width'),\n }\n\n const height: Field = {\n name: 'height',\n type: 'number',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: ({ t }) => t('upload:height'),\n }\n\n const filesize: Field = {\n name: 'filesize',\n type: 'number',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: ({ t }) => t('upload:fileSize'),\n }\n\n const filename: Field = {\n name: 'filename',\n type: 'text',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n readOnly: true,\n },\n index: true,\n label: ({ t }) => t('upload:fileName'),\n }\n\n // Only set unique: true if the collection does not have a compound index\n if (\n collection.upload === true ||\n (typeof collection.upload === 'object' && !collection.upload.filenameCompoundIndex)\n ) {\n filename.unique = true\n }\n\n const url: Field = {\n name: 'url',\n type: 'text',\n admin: {\n hidden: true,\n readOnly: true,\n },\n label: 'URL',\n }\n\n let uploadFields: Field[] = [\n {\n ...url,\n hooks: {\n afterRead: [\n ({ data, originalDoc, req, value }) =>\n generateFilePathOrURL({\n collectionSlug: collection.slug,\n config,\n filename: data?.filename || originalDoc?.filename,\n relative: false,\n serverURL: req.payload.config.serverURL,\n urlOrPath: value,\n }),\n ],\n beforeChange: [\n ({ collection, data, originalDoc, req, value }) =>\n generateFilePathOrURL({\n collectionSlug: collection?.slug as string,\n config,\n filename: data?.filename || originalDoc?.filename,\n relative: true,\n serverURL: req.payload.config.serverURL,\n urlOrPath: value,\n }),\n ],\n },\n },\n thumbnailURL,\n filename,\n mimeType,\n filesize,\n width,\n height,\n ]\n\n // Add focal point fields if not disabled\n if (\n uploadOptions.focalPoint !== false ||\n uploadOptions.imageSizes ||\n uploadOptions.resizeOptions\n ) {\n uploadFields = uploadFields.concat(\n ['focalX', 'focalY'].map((name) => {\n return {\n name,\n type: 'number',\n admin: {\n disableGroupBy: true,\n disableListColumn: true,\n disableListFilter: true,\n hidden: true,\n },\n }\n }),\n )\n }\n\n if (uploadOptions.mimeTypes) {\n mimeType.validate = mimeTypeValidator(uploadOptions.mimeTypes)\n }\n\n // In Payload v4, image size subfields (`url`, `width`, `height`, etc.) should\n // default to `disableGroupBy: true`, `disableListColumn: true` and `disableListFilter: true`\n // to avoid cluttering the collection list view and filters by default.\n if (uploadOptions.imageSizes) {\n uploadFields = uploadFields.concat([\n {\n name: 'sizes',\n type: 'group',\n admin: {\n hidden: true,\n },\n fields: uploadOptions.imageSizes.map((size) => ({\n name: size.name,\n type: 'group',\n admin: {\n hidden: true,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n fields: [\n {\n ...url,\n admin: {\n ...url.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n hooks: {\n afterRead: [\n ({ collection, data, originalDoc, req, value }) =>\n generateFilePathOrURL({\n collectionSlug: collection?.slug as string,\n config,\n filename:\n data?.sizes?.[size.name]?.filename ||\n originalDoc?.sizes?.[size.name]?.filename,\n relative: false,\n serverURL: req.payload.config.serverURL,\n urlOrPath: value,\n }),\n ],\n beforeChange: [\n ({ collection, data, originalDoc, req, value }) =>\n generateFilePathOrURL({\n collectionSlug: collection?.slug as string,\n config,\n filename:\n data?.sizes?.[size.name]?.filename ||\n originalDoc?.sizes?.[size.name]?.filename,\n relative: true,\n serverURL: req.payload.config.serverURL,\n urlOrPath: value,\n }),\n ],\n },\n },\n {\n ...width,\n admin: {\n ...width.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n },\n {\n ...height,\n admin: {\n ...height.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n },\n {\n ...mimeType,\n admin: {\n ...mimeType.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n },\n {\n ...filesize,\n admin: {\n ...filesize.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n },\n {\n ...filename,\n admin: {\n ...filename.admin,\n ...(size.admin?.disableGroupBy && { disableGroupBy: true }),\n ...(size.admin?.disableListColumn && { disableListColumn: true }),\n ...(size.admin?.disableListFilter && { disableListFilter: true }),\n },\n unique: false,\n },\n ],\n label: size.name,\n })),\n label: ({ t }) => t('upload:sizes'),\n },\n ])\n }\n return uploadFields\n}\n"],"names":["generateFilePathOrURL","mimeTypeValidator","getBaseUploadFields","collection","config","uploadOptions","upload","mimeType","name","type","admin","hidden","readOnly","label","thumbnailURL","hooks","afterRead","originalDoc","req","adminThumbnail","undefined","doc","collectionSlug","slug","filename","sizes","relative","serverURL","payload","urlOrPath","url","width","t","height","filesize","disableBulkEdit","index","filenameCompoundIndex","unique","uploadFields","data","value","beforeChange","focalPoint","imageSizes","resizeOptions","concat","map","disableGroupBy","disableListColumn","disableListFilter","mimeTypes","validate","fields","size"],"mappings":"AAKA,SAASA,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,iBAAiB,QAAQ,yBAAwB;AAO1D,OAAO,MAAMC,sBAAsB,CAAC,EAAEC,UAAU,EAAEC,MAAM,EAAW;IACjE,MAAMC,gBAA8B,OAAOF,WAAWG,MAAM,KAAK,WAAWH,WAAWG,MAAM,GAAG,CAAC;IAEjG,MAAMC,WAAkB;QACtBC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,QAAQ;YACRC,UAAU;QACZ;QACAC,OAAO;IACT;IAEA,MAAMC,eAAsB;QAC1BN,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,QAAQ;YACRC,UAAU;QACZ;QACAG,OAAO;YACLC,WAAW;gBACT,CAAC,EAAEC,WAAW,EAAEC,GAAG,EAAE;oBACnB,MAAMC,iBACJ,OAAOhB,WAAWG,MAAM,KAAK,YAAYH,WAAWG,MAAM,EAAEa,iBAAiBC;oBAE/E,IAAI,OAAOD,mBAAmB,YAAY;wBACxC,OAAOA,eAAe;4BAAEE,KAAKJ;wBAAY;oBAC3C;oBAEA,OAAOjB,sBAAsB;wBAC3BsB,gBAAgBnB,WAAWoB,IAAI;wBAC/BnB;wBACAoB,UACE,OAAOL,mBAAmB,WACrBF,YAAYQ,KAAK,EAAE,CAACN,eAAe,EAAEK,WACtCJ;wBACNM,UAAU;wBACVC,WAAWT,IAAIU,OAAO,CAACxB,MAAM,CAACuB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A,mBAAmB;oCAAK,CAAC;oCAChE,GAAIK,KAAK5C,KAAK,EAAEwC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;gCAClE;4BACF;4BACA;gCACE,GAAG1B,QAAQ;gCACXd,OAAO;oCACL,GAAGc,SAASd,KAAK;oCACjB,GAAI4C,KAAK5C,KAAK,EAAEsC,kBAAkB;wCAAEA,gBAAgB;oCAAK,CAAC;oCAC1D,GAAIM,KAAK5C,KAAK,EAAEuC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;oCAChE,GAAIK,KAAK5C,KAAK,EAAEwC,qBAAqB;wCAAEA,mBAAmB;oCAAK,CAAC;gCAClE;gCACAZ,QAAQ;4BACV;yBACD;wBACDzB,OAAOyC,KAAK9C,IAAI;oBAClB,CAAA;gBACAK,OAAO,CAAC,EAAEmB,CAAC,EAAE,GAAKA,EAAE;YACtB;SACD;IACH;IACA,OAAOO;AACT,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "3.77.0-internal.8cf758f",
3
+ "version": "3.77.0-internal.9837b1e",
4
4
  "description": "Node, React, Headless CMS and Application Framework built on Next.js",
5
5
  "keywords": [
6
6
  "admin panel",
@@ -115,7 +115,7 @@
115
115
  "undici": "7.18.2",
116
116
  "uuid": "10.0.0",
117
117
  "ws": "^8.16.0",
118
- "@payloadcms/translations": "3.77.0-internal.8cf758f"
118
+ "@payloadcms/translations": "3.77.0-internal.9837b1e"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@hyrious/esbuild-plugin-commonjs": "0.2.6",