hash
stringlengths
40
40
date
stringdate
2020-04-17 22:01:00
2025-03-21 18:34:11
author
stringclasses
90 values
commit_message
stringlengths
9
197
is_merge
bool
1 class
masked_commit_message
stringlengths
4
170
type
stringclasses
8 values
git_diff
stringlengths
160
5.96M
36fda30c61bc2fc9f1154c62bf7cd7c2df887811
2024-05-21 01:27:52
Elliot DeNolf
feat: store focal point on uploads (#6436)
false
store focal point on uploads (#6436)
feat
diff --git a/packages/next/src/fetchAPI-multipart/index.ts b/packages/next/src/fetchAPI-multipart/index.ts index a9d1cc276e9..bea99f65c42 100644 --- a/packages/next/src/fetchAPI-multipart/index.ts +++ b/packages/next/src/fetchAPI-multipart/index.ts @@ -152,7 +152,7 @@ type FetchAPIFileUpload = (args: { request: Request }) => Promise<FetchAPIFileUploadResponse> export const fetchAPIFileUpload: FetchAPIFileUpload = async ({ options, request }) => { - const uploadOptions = { ...DEFAULT_OPTIONS, ...options } + const uploadOptions: FetchAPIFileUploadOptions = { ...DEFAULT_OPTIONS, ...options } if (!isEligibleRequest(request)) { debugLog(uploadOptions, 'Request is not eligible for file upload!') return { diff --git a/packages/payload/src/collections/operations/create.ts b/packages/payload/src/collections/operations/create.ts index beedd144bb1..a0c3dbe9d75 100644 --- a/packages/payload/src/collections/operations/create.ts +++ b/packages/payload/src/collections/operations/create.ts @@ -121,6 +121,7 @@ export const createOperation = async <TSlug extends keyof GeneratedTypes['collec collection, config, data, + operation: 'create', overwriteExistingFiles, req, throwOnMissingFile: diff --git a/packages/payload/src/collections/operations/update.ts b/packages/payload/src/collections/operations/update.ts index 94361f242b2..7051726bae9 100644 --- a/packages/payload/src/collections/operations/update.ts +++ b/packages/payload/src/collections/operations/update.ts @@ -156,6 +156,7 @@ export const updateOperation = async <TSlug extends keyof GeneratedTypes['collec collection, config, data: bulkUpdateData, + operation: 'update', overwriteExistingFiles, req, throwOnMissingFile: false, diff --git a/packages/payload/src/collections/operations/updateByID.ts b/packages/payload/src/collections/operations/updateByID.ts index c593488776d..de3f13b77ed 100644 --- a/packages/payload/src/collections/operations/updateByID.ts +++ b/packages/payload/src/collections/operations/updateByID.ts @@ -147,6 +147,7 @@ export const updateByIDOperation = async <TSlug extends keyof GeneratedTypes['co collection, config, data, + operation: 'update', overwriteExistingFiles, req, throwOnMissingFile: false, diff --git a/packages/payload/src/exports/utilities.ts b/packages/payload/src/exports/utilities.ts index aa5955ec2e9..4528d6ae715 100644 --- a/packages/payload/src/exports/utilities.ts +++ b/packages/payload/src/exports/utilities.ts @@ -12,7 +12,7 @@ export { traverseFields as beforeValidateTraverseFields } from '../fields/hooks/ export { formatFilesize } from '../uploads/formatFilesize.js' -export { default as isImage } from '../uploads/isImage.js' +export { isImage } from '../uploads/isImage.js' export { combineMerge } from '../utilities/combineMerge.js' export { diff --git a/packages/payload/src/types/index.ts b/packages/payload/src/types/index.ts index cb7bdc4c736..0c83eea90f8 100644 --- a/packages/payload/src/types/index.ts +++ b/packages/payload/src/types/index.ts @@ -7,19 +7,6 @@ import type { GeneratedTypes } from '../index.js' import type { validOperators } from './constants.js' export type { Payload as Payload } from '../index.js' -export type UploadEdits = { - crop?: { - height?: number - width?: number - x?: number - y?: number - } - focalPoint?: { - x?: number - y?: number - } -} - export type CustomPayloadRequestProperties = { context: RequestContext /** The locale that should be used for a field when it is not translated to the requested locale */ diff --git a/packages/payload/src/uploads/canResizeImage.ts b/packages/payload/src/uploads/canResizeImage.ts index cb3815c9dfe..15f4c63b1f1 100644 --- a/packages/payload/src/uploads/canResizeImage.ts +++ b/packages/payload/src/uploads/canResizeImage.ts @@ -1,3 +1,3 @@ -export default function canResizeImage(mimeType: string): boolean { +export function canResizeImage(mimeType: string): boolean { return ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/tiff'].indexOf(mimeType) > -1 } diff --git a/packages/payload/src/uploads/cropImage.ts b/packages/payload/src/uploads/cropImage.ts index 3f08a58f689..1167983f404 100644 --- a/packages/payload/src/uploads/cropImage.ts +++ b/packages/payload/src/uploads/cropImage.ts @@ -2,7 +2,7 @@ export const percentToPixel = (value, dimension) => { return Math.floor((parseFloat(value) / 100) * dimension) } -export default async function cropImage({ cropData, dimensions, file, sharp }) { +export async function cropImage({ cropData, dimensions, file, sharp }) { try { const { height, width, x, y } = cropData diff --git a/packages/payload/src/uploads/generateFileData.ts b/packages/payload/src/uploads/generateFileData.ts index b9b4aed8aaa..56098a4d93a 100644 --- a/packages/payload/src/uploads/generateFileData.ts +++ b/packages/payload/src/uploads/generateFileData.ts @@ -9,22 +9,24 @@ import sanitize from 'sanitize-filename' import type { Collection } from '../collections/config/types.js' import type { SanitizedConfig } from '../config/types.js' import type { PayloadRequestWithData } from '../types/index.js' -import type { FileData, FileToSave, ProbedImageSize } from './types.js' +import type { FileData, FileToSave, ProbedImageSize, UploadEdits } from './types.js' import { FileRetrievalError, FileUploadError, MissingFile } from '../errors/index.js' -import canResizeImage from './canResizeImage.js' -import cropImage from './cropImage.js' +import { canResizeImage } from './canResizeImage.js' +import { cropImage } from './cropImage.js' import { getExternalFile } from './getExternalFile.js' import { getFileByPath } from './getFileByPath.js' import { getImageSize } from './getImageSize.js' -import getSafeFileName from './getSafeFilename.js' -import resizeAndTransformImageSizes from './imageResizer.js' -import isImage from './isImage.js' +import { getSafeFileName } from './getSafeFilename.js' +import { resizeAndTransformImageSizes } from './imageResizer.js' +import { isImage } from './isImage.js' type Args<T> = { collection: Collection config: SanitizedConfig data: T + operation: 'create' | 'update' + originalDoc?: T overwriteExistingFiles?: boolean req: PayloadRequestWithData throwOnMissingFile?: boolean @@ -38,6 +40,8 @@ type Result<T> = Promise<{ export const generateFileData = async <T>({ collection: { config: collectionConfig }, data, + operation, + originalDoc, overwriteExistingFiles, req, throwOnMissingFile, @@ -53,10 +57,22 @@ export const generateFileData = async <T>({ let file = req.file - const uploadEdits = req.query['uploadEdits'] || {} - - const { disableLocalStorage, formatOptions, imageSizes, resizeOptions, staticDir, trimOptions } = - collectionConfig.upload + const uploadEdits = parseUploadEditsFromReqOrIncomingData({ + data, + operation, + originalDoc, + req, + }) + + const { + disableLocalStorage, + focalPoint: focalPointEnabled = true, + formatOptions, + imageSizes, + resizeOptions, + staticDir, + trimOptions, + } = collectionConfig.upload const staticPath = staticDir @@ -228,9 +244,9 @@ export const generateFileData = async <T>({ } } - if (Array.isArray(imageSizes) && fileSupportsResize && sharp) { + if (fileSupportsResize && (Array.isArray(imageSizes) || focalPointEnabled !== false)) { req.payloadUploadSizes = {} - const { sizeData, sizesToSave } = await resizeAndTransformImageSizes({ + const { focalPoint, sizeData, sizesToSave } = await resizeAndTransformImageSizes({ config: collectionConfig, dimensions: !cropData ? dimensions @@ -245,13 +261,16 @@ export const generateFileData = async <T>({ savedFilename: fsSafeName || file.name, sharp, staticPath, + uploadEdits, }) fileData.sizes = sizeData + fileData.focalX = focalPoint?.x + fileData.focalY = focalPoint?.y filesToSave.push(...sizesToSave) } } catch (err) { - console.error(err) + req.payload.logger.error(err) throw new FileUploadError(req.t) } @@ -265,3 +284,50 @@ export const generateFileData = async <T>({ files: filesToSave, } } + +/** + * Parse upload edits from req or incoming data + */ +function parseUploadEditsFromReqOrIncomingData(args: { + data: unknown + operation: 'create' | 'update' + originalDoc: unknown + req: PayloadRequestWithData +}): UploadEdits { + const { data, operation, originalDoc, req } = args + + // Get intended focal point change from query string or incoming data + const { + uploadEdits = {}, + }: { + uploadEdits?: UploadEdits + } = req.query || {} + + if (uploadEdits.focalPoint) return uploadEdits + + const incomingData = data as FileData + const origDoc = originalDoc as FileData + + // If no change in focal point, return undefined. + // This prevents a refocal operation triggered from admin, because it always sends the focal point. + if (origDoc && incomingData.focalX === origDoc.focalX && incomingData.focalY === origDoc.focalY) { + return undefined + } + + if (incomingData?.focalX && incomingData?.focalY) { + uploadEdits.focalPoint = { + x: incomingData.focalX, + y: incomingData.focalY, + } + return uploadEdits + } + + // If no focal point is set, default to center + if (operation === 'create') { + uploadEdits.focalPoint = { + x: 50, + y: 50, + } + } + return uploadEdits +} diff --git a/packages/payload/src/uploads/getBaseFields.ts b/packages/payload/src/uploads/getBaseFields.ts index 7396fae44a6..66204c24f3e 100644 --- a/packages/payload/src/uploads/getBaseFields.ts +++ b/packages/payload/src/uploads/getBaseFields.ts @@ -149,6 +149,25 @@ export const getBaseUploadFields = ({ collection, config }: Options): Field[] => height, ] + // Add focal point fields if not disabled + if ( + uploadOptions.focalPoint !== false || + uploadOptions.imageSizes || + uploadOptions.resizeOptions + ) { + uploadFields = uploadFields.concat( + ['focalX', 'focalY'].map((name) => { + return { + name, + type: 'number', + admin: { + hidden: true, + }, + } + }), + ) + } + if (uploadOptions.mimeTypes) { mimeType.validate = mimeTypeValidator(uploadOptions.mimeTypes) } diff --git a/packages/payload/src/uploads/getSafeFilename.ts b/packages/payload/src/uploads/getSafeFilename.ts index 720c23abe83..79fddae80b5 100644 --- a/packages/payload/src/uploads/getSafeFilename.ts +++ b/packages/payload/src/uploads/getSafeFilename.ts @@ -29,7 +29,7 @@ type Args = { staticPath: string } -async function getSafeFileName({ +export async function getSafeFileName({ collectionSlug, desiredFilename, req, @@ -51,5 +51,3 @@ async function getSafeFileName({ } return modifiedFilename } - -export default getSafeFileName diff --git a/packages/payload/src/uploads/imageResizer.ts b/packages/payload/src/uploads/imageResizer.ts index a057bd7bacb..3bc49d85b90 100644 --- a/packages/payload/src/uploads/imageResizer.ts +++ b/packages/payload/src/uploads/imageResizer.ts @@ -8,8 +8,15 @@ import sanitize from 'sanitize-filename' import type { SanitizedCollectionConfig } from '../collections/config/types.js' import type { SharpDependency } from '../config/types.js' -import type { PayloadRequestWithData, UploadEdits } from '../types/index.js' -import type { FileSize, FileSizes, FileToSave, ImageSize, ProbedImageSize } from './types.js' +import type { PayloadRequestWithData } from '../types/index.js' +import type { + FileSize, + FileSizes, + FileToSave, + ImageSize, + ProbedImageSize, + UploadEdits, +} from './types.js' import { isNumber } from '../utilities/isNumber.js' import fileExists from './fileExists.js' @@ -19,18 +26,16 @@ type ResizeArgs = { dimensions: ProbedImageSize file: PayloadRequestWithData['file'] mimeType: string - req: PayloadRequestWithData & { - query?: { - uploadEdits?: UploadEdits - } - } + req: PayloadRequestWithData savedFilename: string - sharp: SharpDependency + sharp?: SharpDependency staticPath: string + uploadEdits?: UploadEdits } /** Result from resizing and transforming the requested image sizes */ type ImageSizesResult = { + focalPoint?: UploadEdits['focalPoint'] sizeData: FileSizes sizesToSave: FileToSave[] } @@ -71,6 +76,16 @@ const createImageName = ( extension: string, ) => `${outputImageName}-${width}x${height}.${extension}` +type CreateResultArgs = { + filename?: FileSize['filename'] + filesize?: FileSize['filesize'] + height?: FileSize['height'] + mimeType?: FileSize['mimeType'] + name: string + sizesToSave?: FileToSave[] + width?: FileSize['width'] +} + /** * Create the result object for the image resize operation based on the * provided parameters. If the name is not provided, an empty result object @@ -85,26 +100,28 @@ const createImageName = ( * @param sizesToSave - the sizes to save * @returns the result object */ -const createResult = ( - name: string, - filename: FileSize['filename'] = null, - width: FileSize['width'] = null, - height: FileSize['height'] = null, - filesize: FileSize['filesize'] = null, - mimeType: FileSize['mimeType'] = null, - sizesToSave: FileToSave[] = [], -): ImageSizesResult => ({ - sizeData: { - [name]: { - filename, - filesize, - height, - mimeType, - width, +const createResult = ({ + name, + filename = null, + filesize = null, + height = null, + mimeType = null, + sizesToSave = [], + width = null, +}: CreateResultArgs): ImageSizesResult => { + return { + sizeData: { + [name]: { + filename, + filesize, + height, + mimeType, + width, + }, }, - }, - sizesToSave, -}) + sizesToSave, + } +} /** * Check if the image needs to be resized according to the requested dimensions @@ -208,7 +225,7 @@ const sanitizeResizeConfig = (resizeConfig: ImageSize): ImageSize => { * @param resizeConfig - the resize config * @returns the result of the resize operation(s) */ -export default async function resizeAndTransformImageSizes({ +export async function resizeAndTransformImageSizes({ config, dimensions, file, @@ -217,10 +234,27 @@ export default async function resizeAndTransformImageSizes({ savedFilename, sharp, staticPath, + uploadEdits, }: ResizeArgs): Promise<ImageSizesResult> { - const { imageSizes } = config.upload - // Noting to resize here so return as early as possible - if (!imageSizes) return { sizeData: {}, sizesToSave: [] } + const { focalPoint: focalPointEnabled = true, imageSizes } = config.upload + + // Focal point adjustments + const incomingFocalPoint = uploadEdits.focalPoint + ? { + x: isNumber(uploadEdits.focalPoint.x) ? Math.round(uploadEdits.focalPoint.x) : 50, + y: isNumber(uploadEdits.focalPoint.y) ? Math.round(uploadEdits.focalPoint.y) : 50, + } + : undefined + + const defaultResult: ImageSizesResult = { + ...(focalPointEnabled && incomingFocalPoint && { focalPoint: incomingFocalPoint }), + sizeData: {}, + sizesToSave: [], + } + + if (!imageSizes || !sharp) { + return defaultResult + } const sharpBase = sharp(file.tempFilePath || file.data).rotate() // pass rotate() to auto-rotate based on EXIF data. https://github.com/payloadcms/payload/pull/3081 @@ -232,16 +266,13 @@ export default async function resizeAndTransformImageSizes({ // skipped COMPLETELY and thus will not be included in the resulting images. // All further format/trim options will thus be skipped as well. if (preventResize(imageResizeConfig, dimensions)) { - return createResult(imageResizeConfig.name) + return createResult({ name: imageResizeConfig.name }) } const imageToResize = sharpBase.clone() let resized = imageToResize - if ( - req.query?.uploadEdits?.focalPoint && - applyPayloadAdjustments(imageResizeConfig, dimensions) - ) { + if (incomingFocalPoint && applyPayloadAdjustments(imageResizeConfig, dimensions)) { const { height: resizeHeight, width: resizeWidth } = imageResizeConfig const resizeAspectRatio = resizeWidth / resizeHeight const originalAspectRatio = dimensions.width / dimensions.height @@ -254,27 +285,17 @@ export default async function resizeAndTransformImageSizes({ }) const { info: scaledImageInfo } = await scaledImage.toBuffer({ resolveWithObject: true }) - // Focal point adjustments - const focalPoint = { - x: isNumber(req.query.uploadEdits.focalPoint?.x) - ? req.query.uploadEdits.focalPoint.x - : 50, - y: isNumber(req.query.uploadEdits.focalPoint?.y) - ? req.query.uploadEdits.focalPoint.y - : 50, - } - const safeResizeWidth = resizeWidth ?? scaledImageInfo.width const maxOffsetX = scaledImageInfo.width - safeResizeWidth const leftFocalEdge = Math.round( - scaledImageInfo.width * (focalPoint.x / 100) - safeResizeWidth / 2, + scaledImageInfo.width * (incomingFocalPoint.x / 100) - safeResizeWidth / 2, ) const safeOffsetX = Math.min(Math.max(0, leftFocalEdge), maxOffsetX) const safeResizeHeight = resizeHeight ?? scaledImageInfo.height const maxOffsetY = scaledImageInfo.height - safeResizeHeight const topFocalEdge = Math.round( - scaledImageInfo.height * (focalPoint.y / 100) - safeResizeHeight / 2, + scaledImageInfo.height * (incomingFocalPoint.y / 100) - safeResizeHeight / 2, ) const safeOffsetY = Math.min(Math.max(0, topFocalEdge), maxOffsetY) @@ -306,7 +327,9 @@ export default async function resizeAndTransformImageSizes({ const sanitizedImage = getSanitizedImageData(savedFilename) - req.payloadUploadSizes[imageResizeConfig.name] = bufferData + if (req.payloadUploadSizes) { + req.payloadUploadSizes[imageResizeConfig.name] = bufferData + } const mimeInfo = await fromBuffer(bufferData) @@ -327,15 +350,15 @@ export default async function resizeAndTransformImageSizes({ } const { height, size, width } = bufferInfo - return createResult( - imageResizeConfig.name, - imageNameWithDimensions, - width, + return createResult({ + name: imageResizeConfig.name, + filename: imageNameWithDimensions, + filesize: size, height, - size, - mimeInfo?.mime || mimeType, - [{ buffer: bufferData, path: imagePath }], - ) + mimeType: mimeInfo?.mime || mimeType, + sizesToSave: [{ buffer: bufferData, path: imagePath }], + width, + }) }), ) @@ -345,6 +368,6 @@ export default async function resizeAndTransformImageSizes({ acc.sizesToSave.push(...result.sizesToSave) return acc }, - { sizeData: {}, sizesToSave: [] }, + { ...defaultResult }, ) } diff --git a/packages/payload/src/uploads/isImage.ts b/packages/payload/src/uploads/isImage.ts index 01873bb94d7..62e6e05863c 100644 --- a/packages/payload/src/uploads/isImage.ts +++ b/packages/payload/src/uploads/isImage.ts @@ -1,4 +1,4 @@ -export default function isImage(mimeType: string): boolean { +export function isImage(mimeType: string): boolean { return ( ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'image/webp', 'image/avif'].indexOf( mimeType, diff --git a/packages/payload/src/uploads/types.ts b/packages/payload/src/uploads/types.ts index ec44b7129ee..a5801668077 100644 --- a/packages/payload/src/uploads/types.ts +++ b/packages/payload/src/uploads/types.ts @@ -18,6 +18,8 @@ export type FileSizes = { export type FileData = { filename: string filesize: number + focalX?: number + focalY?: number height: number mimeType: string sizes: FileSizes @@ -117,3 +119,16 @@ export type FileToSave = { buffer: Buffer path: string } + +export type UploadEdits = { + crop?: { + height?: number + width?: number + x?: number + y?: number + } + focalPoint?: { + x?: number + y?: number + } +} diff --git a/packages/ui/src/elements/EditUpload/index.tsx b/packages/ui/src/elements/EditUpload/index.tsx index fcef403a3c9..7c1e4a880e1 100644 --- a/packages/ui/src/elements/EditUpload/index.tsx +++ b/packages/ui/src/elements/EditUpload/index.tsx @@ -32,13 +32,12 @@ type FocalPosition = { } export type EditUploadProps = { - doc?: Data fileName: string fileSrc: string imageCacheTag?: string initialCrop?: CropType initialFocalPoint?: FocalPosition - onSave?: ({ crop, pointPosition }: { crop: CropType; pointPosition: FocalPosition }) => void + onSave?: ({ crop, focalPosition }: { crop: CropType; focalPosition: FocalPosition }) => void showCrop?: boolean showFocalPoint?: boolean } @@ -51,11 +50,6 @@ const defaultCrop: CropType = { y: 0, } -const defaultPointPosition: FocalPosition = { - x: 50, - y: 50, -} - export const EditUpload: React.FC<EditUploadProps> = ({ fileName, fileSrc, @@ -76,8 +70,15 @@ export const EditUpload: React.FC<EditUploadProps> = ({ ...initialCrop, })) - const [pointPosition, setPointPosition] = useState<FocalPosition>(() => ({ - ...defaultPointPosition, + const defaultFocalPosition: FocalPosition = { + x: 50, + y: 50, + } + + console.log({ initialFocalPoint }) + + const [focalPosition, setFocalPosition] = useState<FocalPosition>(() => ({ + ...defaultFocalPosition, ...initialFocalPoint, })) const [checkBounds, setCheckBounds] = useState<boolean>(false) @@ -103,10 +104,16 @@ export const EditUpload: React.FC<EditUploadProps> = ({ }) } - const fineTuneFocalPoint = ({ coordinate, value }: { coordinate: 'x' | 'y'; value: string }) => { + const fineTuneFocalPosition = ({ + coordinate, + value, + }: { + coordinate: 'x' | 'y' + value: string + }) => { const intValue = parseInt(value) if (intValue >= 0 && intValue <= 100) { - setPointPosition((prevPosition) => ({ ...prevPosition, [coordinate]: intValue })) + setFocalPosition((prevPosition) => ({ ...prevPosition, [coordinate]: intValue })) } } @@ -114,13 +121,13 @@ export const EditUpload: React.FC<EditUploadProps> = ({ if (typeof onSave === 'function') onSave({ crop, - pointPosition, + focalPosition, }) closeModal(editDrawerSlug) } const onDragEnd = React.useCallback(({ x, y }) => { - setPointPosition({ x, y }) + setFocalPosition({ x, y }) setCheckBounds(false) }, []) @@ -133,7 +140,7 @@ export const EditUpload: React.FC<EditUploadProps> = ({ ((boundsRect.left - containerRect.left + boundsRect.width / 2) / containerRect.width) * 100 const yCenter = ((boundsRect.top - containerRect.top + boundsRect.height / 2) / containerRect.height) * 100 - setPointPosition({ x: xCenter, y: yCenter }) + setFocalPosition({ x: xCenter, y: yCenter }) } const fileSrcToUse = imageCacheTag ? `${fileSrc}?${imageCacheTag}` : fileSrc @@ -209,7 +216,7 @@ export const EditUpload: React.FC<EditUploadProps> = ({ checkBounds={showCrop ? checkBounds : false} className={`${baseClass}__focalPoint`} containerRef={focalWrapRef} - initialPosition={pointPosition} + initialPosition={focalPosition} onDragEnd={onDragEnd} setCheckBounds={showCrop ? setCheckBounds : false} > @@ -280,13 +287,13 @@ export const EditUpload: React.FC<EditUploadProps> = ({ <div className={`${baseClass}__inputsWrap`}> <Input name="X %" - onChange={(value) => fineTuneFocalPoint({ coordinate: 'x', value })} - value={pointPosition.x.toFixed(0)} + onChange={(value) => fineTuneFocalPosition({ coordinate: 'x', value })} + value={focalPosition.x.toFixed(0)} /> <Input name="Y %" - onChange={(value) => fineTuneFocalPoint({ coordinate: 'y', value })} - value={pointPosition.y.toFixed(0)} + onChange={(value) => fineTuneFocalPosition({ coordinate: 'y', value })} + value={focalPosition.y.toFixed(0)} /> </div> </div> diff --git a/packages/ui/src/elements/Upload/index.tsx b/packages/ui/src/elements/Upload/index.tsx index d3b78e9b6f7..f0255e558f5 100644 --- a/packages/ui/src/elements/Upload/index.tsx +++ b/packages/ui/src/elements/Upload/index.tsx @@ -101,7 +101,7 @@ export const Upload: React.FC<UploadProps> = (props) => { }, [setValue]) const onEditsSave = React.useCallback( - ({ crop, pointPosition }) => { + ({ crop, focalPosition }) => { setCrop({ x: crop.x || 0, y: crop.y || 0, @@ -122,10 +122,10 @@ export const Upload: React.FC<UploadProps> = (props) => { type: 'SET', params: { uploadEdits: - crop || pointPosition + crop || focalPosition ? { crop: crop || null, - focalPoint: pointPosition ? pointPosition : null, + focalPoint: focalPosition ? focalPosition : null, } : null, }, @@ -164,10 +164,12 @@ export const Upload: React.FC<UploadProps> = (props) => { const hasImageSizes = uploadConfig?.imageSizes?.length > 0 const hasResizeOptions = Boolean(uploadConfig?.resizeOptions) + // Explicity check if set to true, default is undefined + const focalPointEnabled = uploadConfig?.focalPoint === true const { crop: showCrop = true, focalPoint = true } = uploadConfig - const showFocalPoint = focalPoint && (hasImageSizes || hasResizeOptions) + const showFocalPoint = focalPoint && (hasImageSizes || hasResizeOptions || focalPointEnabled) const lastSubmittedTime = submitted ? new Date().toISOString() : null @@ -234,14 +236,13 @@ export const Upload: React.FC<UploadProps> = (props) => { {(value || doc.filename) && ( <Drawer Header={null} slug={editDrawerSlug}> <EditUpload - doc={doc || undefined} fileName={value?.name || doc?.filename} fileSrc={fileSrc || doc?.url} imageCacheTag={lastSubmittedTime} initialCrop={formQueryParams?.uploadEdits?.crop ?? {}} initialFocalPoint={{ - x: formQueryParams?.uploadEdits?.focalPoint.x || 0, - y: formQueryParams?.uploadEdits?.focalPoint.y || 0, + x: formQueryParams?.uploadEdits?.focalPoint.x || doc.focalX || 50, + y: formQueryParams?.uploadEdits?.focalPoint.y || doc.focalY || 50, }} onSave={onEditsSave} showCrop={showCrop} diff --git a/test/uploads/config.ts b/test/uploads/config.ts index 17e2aeb5780..18af7d05eba 100644 --- a/test/uploads/config.ts +++ b/test/uploads/config.ts @@ -12,6 +12,7 @@ import { Uploads2 } from './collections/Upload2/index.js' import { audioSlug, enlargeSlug, + focalNoSizesSlug, mediaSlug, reduceSlug, relationSlug, @@ -183,6 +184,16 @@ export default buildConfigWithDefaults({ ], }, }, + { + slug: focalNoSizesSlug, + fields: [], + upload: { + crop: false, + focalPoint: true, + mimeTypes: ['image/png', 'image/jpg', 'image/jpeg'], + staticDir: './focal-no-sizes', + }, + }, { slug: mediaSlug, fields: [], diff --git a/test/uploads/int.spec.ts b/test/uploads/int.spec.ts index 189de748b33..b200c003065 100644 --- a/test/uploads/int.spec.ts +++ b/test/uploads/int.spec.ts @@ -14,6 +14,8 @@ import configPromise from './config.js' import { createStreamableFile } from './createStreamableFile.js' import { enlargeSlug, + focalNoSizesSlug, + focalOnlySlug, mediaSlug, reduceSlug, relationSlug, @@ -73,6 +75,8 @@ describe('Collections - Uploads', () => { // Check api response expect(doc.mimeType).toEqual('image/png') + expect(doc.focalX).toEqual(50) + expect(doc.focalY).toEqual(50) expect(sizes.maintainedAspectRatio.url).toContain('/api/media/file/image') expect(sizes.maintainedAspectRatio.url).toContain('.png') expect(sizes.maintainedAspectRatio.width).toEqual(1024) @@ -286,7 +290,6 @@ describe('Collections - Uploads', () => { expect(await fileExists(path.join(expectedPath, mediaDoc.sizes.icon.filename))).toBe(false) }) }) - describe('delete', () => { it('should remove related files when deleting by ID', async () => { const formData = new FormData() @@ -527,6 +530,88 @@ describe('Collections - Uploads', () => { }) }) + describe('focal point', () => { + let file + + beforeAll(async () => { + // Create image + const filePath = path.resolve(dirname, './image.png') + file = await getFileByPath(filePath) + file.name = 'focal.png' + }) + + it('should be able to set focal point through local API', async () => { + const doc = await payload.create({ + collection: focalOnlySlug, + data: { + focalX: 5, + focalY: 5, + }, + file, + }) + + expect(doc.focalX).toEqual(5) + expect(doc.focalY).toEqual(5) + + const updatedFocal = await payload.update({ + collection: focalOnlySlug, + id: doc.id, + data: { + focalX: 10, + focalY: 10, + }, + }) + + expect(updatedFocal.focalX).toEqual(10) + expect(updatedFocal.focalY).toEqual(10) + + const updateWithoutFocal = await payload.update({ + collection: focalOnlySlug, + id: doc.id, + data: {}, + }) + + // Expect focal point to be the same + expect(updateWithoutFocal.focalX).toEqual(10) + expect(updateWithoutFocal.focalY).toEqual(10) + }) + + it('should default focal point to 50, 50', async () => { + const doc = await payload.create({ + collection: focalOnlySlug, + data: { + // No focal point + }, + file, + }) + + expect(doc.focalX).toEqual(50) + expect(doc.focalY).toEqual(50) + + const updateWithoutFocal = await payload.update({ + collection: focalOnlySlug, + id: doc.id, + data: {}, + }) + + expect(updateWithoutFocal.focalX).toEqual(50) + expect(updateWithoutFocal.focalY).toEqual(50) + }) + + it('should set focal point even if no sizes defined', async () => { + const doc = await payload.create({ + collection: focalNoSizesSlug, // config without sizes + data: { + // No focal point + }, + file, + }) + + expect(doc.focalX).toEqual(50) + expect(doc.focalY).toEqual(50) + }) + }) + describe('Image Manipulation', () => { it('should enlarge images if resize options `withoutEnlargement` is set to false', async () => { const small = await getFileByPath(path.resolve(dirname, './small.png')) diff --git a/test/uploads/payload-types.ts b/test/uploads/payload-types.ts index ac68fdf43fa..ac96f94b06e 100644 --- a/test/uploads/payload-types.ts +++ b/test/uploads/payload-types.ts @@ -15,6 +15,7 @@ export interface Config { 'object-fit': ObjectFit; 'crop-only': CropOnly; 'focal-only': FocalOnly; + 'focal-no-sizes': FocalNoSize; media: Media; enlarge: Enlarge; reduce: Reduce; @@ -64,6 +65,8 @@ export interface Media { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { maintainedAspectRatio?: { url?: string | null; @@ -204,6 +207,8 @@ export interface Version { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -230,6 +235,8 @@ export interface GifResize { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { small?: { url?: string | null; @@ -264,6 +271,8 @@ export interface NoImageSize { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -280,6 +289,8 @@ export interface ObjectFit { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { fitContain?: { url?: string | null; @@ -330,6 +341,8 @@ export interface CropOnly { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { focalTest?: { url?: string | null; @@ -372,6 +385,8 @@ export interface FocalOnly { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { focalTest?: { url?: string | null; @@ -399,6 +414,24 @@ export interface FocalOnly { }; }; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "focal-no-sizes". + */ +export interface FocalNoSize { + id: string; + updatedAt: string; + createdAt: string; + url?: string | null; + thumbnailURL?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; + focalX?: number | null; + focalY?: number | null; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "enlarge". @@ -414,6 +447,8 @@ export interface Enlarge { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { accidentalSameSize?: { url?: string | null; @@ -472,6 +507,8 @@ export interface Reduce { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { accidentalSameSize?: { url?: string | null; @@ -522,6 +559,8 @@ export interface MediaTrim { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { trimNumber?: { url?: string | null; @@ -564,6 +603,8 @@ export interface UnstoredMedia { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -580,6 +621,8 @@ export interface ExternallyServedMedia { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -612,6 +655,8 @@ export interface Uploads1 { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -629,6 +674,8 @@ export interface Uploads2 { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -645,6 +692,8 @@ export interface AdminThumbnailFunction { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -661,6 +710,8 @@ export interface AdminThumbnailSize { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; sizes?: { small?: { url?: string | null; @@ -695,6 +746,8 @@ export interface OptionalFile { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -711,6 +764,8 @@ export interface RequiredFile { filesize?: number | null; width?: number | null; height?: number | null; + focalX?: number | null; + focalY?: number | null; } /** * This interface was referenced by `Config`'s JSON-Schema diff --git a/test/uploads/shared.ts b/test/uploads/shared.ts index 301f4bb75b1..890422aed51 100644 --- a/test/uploads/shared.ts +++ b/test/uploads/shared.ts @@ -1,19 +1,12 @@ export const usersSlug = 'users' - export const mediaSlug = 'media' - export const relationSlug = 'relation' - export const audioSlug = 'audio' - export const enlargeSlug = 'enlarge' - +export const focalNoSizesSlug = 'focal-no-sizes' +export const focalOnlySlug = 'focal-only' export const reduceSlug = 'reduce' - export const adminThumbnailFunctionSlug = 'admin-thumbnail-function' - export const adminThumbnailSizeSlug = 'admin-thumbnail-size' - export const unstoredMediaSlug = 'unstored-media' - export const versionSlug = 'versions'
950f8ce80a9b23f533951ffd0d8186e57f4580a3
2025-01-01 01:36:56
Boyan Bratvanov
docs: add missing vertical line to Collection Upload options table (#10282)
false
add missing vertical line to Collection Upload options table (#10282)
docs
diff --git a/docs/upload/overview.mdx b/docs/upload/overview.mdx index 56c9564f389..cd1e3cc519a 100644 --- a/docs/upload/overview.mdx +++ b/docs/upload/overview.mdx @@ -97,7 +97,7 @@ _An asterisk denotes that an option is required._ | **`displayPreview`** | Enable displaying preview of the uploaded file in Upload fields related to this Collection. Can be locally overridden by `displayPreview` option in Upload field. [More](/docs/fields/upload#config-options). | | **`externalFileHeaderFilter`** | Accepts existing headers and returns the headers after filtering or modifying. | | **`filesRequiredOnCreate`** | Mandate file data on creation, default is true. | -| **`filenameCompoundIndex`** | Field slugs to use for a compound index instead of the default filename index. +| **`filenameCompoundIndex`** | Field slugs to use for a compound index instead of the default filename index. | | **`focalPoint`** | Set to `false` to disable the focal point selection tool in the [Admin Panel](../admin/overview). The focal point selector is only available when `imageSizes` or `resizeOptions` are defined. [More](#crop-and-focal-point-selector) | | **`formatOptions`** | An object with `format` and `options` that are used with the Sharp image library to format the upload file. [More](https://sharp.pixelplumbing.com/api-output#toformat) | | **`handlers`** | Array of Request handlers to execute when fetching a file, if a handler returns a Response it will be sent to the client. Otherwise Payload will retrieve and send back the file. |
825f9521bbfb63078677e2c78f38cd18aa1349d5
2023-10-04 21:06:44
Dan Ribbens
chore: fix relationship preferences unique constraint prompt on pushSchema
false
fix relationship preferences unique constraint prompt on pushSchema
chore
diff --git a/packages/db-postgres/src/schema/build.ts b/packages/db-postgres/src/schema/build.ts index 333a7fb77a2..2c22e43a5f7 100644 --- a/packages/db-postgres/src/schema/build.ts +++ b/packages/db-postgres/src/schema/build.ts @@ -157,7 +157,7 @@ export const buildTable = ({ return acc }, { - _localeParent: unique().on(cols._locale, cols._parentID), + _localeParent: unique('locale_parent_id_unique').on(cols._locale, cols._parentID), }, ) }) @@ -254,14 +254,18 @@ export const buildTable = ({ if (hasLocalizedRelationshipField) { result.localeIdx = index('locale_idx').on(cols.locale) - result.parentPathOrderLocale = unique().on( + result.parentPathOrderLocale = unique('parent_id_path_order_locale_unique').on( cols.parent, cols.path, cols.order, cols.locale, ) } else { - result.parentPathOrder = unique().on(cols.parent, cols.path, cols.order) + result.parentPathOrder = unique('parent_id_path_order_unique').on( + cols.parent, + cols.path, + cols.order, + ) } return result
9e9dfbcb1034a1bf03d05b25fe80248136193127
2023-01-10 05:36:02
James
chore: cleanup mergeDrafts
false
cleanup mergeDrafts
chore
diff --git a/src/versions/drafts/mergeDrafts.ts b/src/versions/drafts/mergeDrafts.ts index 5e555f0ef7e..d606f27b718 100644 --- a/src/versions/drafts/mergeDrafts.ts +++ b/src/versions/drafts/mergeDrafts.ts @@ -42,18 +42,14 @@ export const mergeDrafts = async <T extends TypeWithID>({ query, where: incomingWhere, }: Args): Promise<PaginatedDocs<T>> => { - console.log('---------STARTING---------'); // Query the main collection, non-paginated, for any IDs that match the query - const mainCollectionFind = await collection.Model.find(query, { updatedAt: 1 }, { limit: paginationOptions.limit }).lean(); - // Create object "map" for performant lookup - const mainCollectionMatchMap = mainCollectionFind.reduce((map, { _id, updatedAt }) => { - const newMap = map; - newMap[_id] = updatedAt; - return newMap; - }, {}); - - console.log({ mainCollectionMatchMap }); + const mainCollectionMatchMap = await collection.Model.find(query, { updatedAt: 1 }, { limit: paginationOptions.limit }) + .lean().then((res) => res.reduce((map, { _id, updatedAt }) => { + const newMap = map; + newMap[_id] = updatedAt; + return newMap; + }, {})); // Query the versions collection with a version-specific query const VersionModel = payload.versions[collection.config.slug] as CollectionModel; @@ -80,8 +76,13 @@ export const mergeDrafts = async <T extends TypeWithID>({ } const versionQuery = await VersionModel.buildQuery(versionQueryToBuild, locale); + const includedParentIDs: (string | number)[] = []; - const versionCollectionQuery = await VersionModel.aggregate<AggregateVersion<T>>([ + // Create version "map" for performant lookup + // and in the same loop, check if there are matched versions without a matched parent + // This means that the newer version's parent should appear in the main query. + // To do so, add the version's parent ID into an explicit `includedIDs` array + const versionCollectionMatchMap = await VersionModel.aggregate<AggregateVersion<T>>([ { $sort: { updatedAt: -1 } }, { $group: { @@ -94,63 +95,44 @@ export const mergeDrafts = async <T extends TypeWithID>({ }, { $match: versionQuery }, { $limit: paginationOptions.limit }, - ]); - - const includedParentIDs: (string | number)[] = []; - - // Create object "map" for performant lookup - // and in the same loop, check if there are matched versions without a matched parent - // This means that the newer version's parent should appear in the main query. - // To do so, add the version's parent ID into an explicit `includedIDs` array - - const versionCollectionMatchMap = versionCollectionQuery.reduce<VersionCollectionMatchMap<T>>((map, { _id, updatedAt, createdAt, version }) => { + ]).then((res) => res.reduce<VersionCollectionMatchMap<T>>((map, { _id, updatedAt, createdAt, version }) => { const newMap = map; newMap[_id] = { version, updatedAt, createdAt }; const matchedParent = mainCollectionMatchMap[_id]; if (!matchedParent) includedParentIDs.push(_id); return newMap; - }, {}); - - console.log({ versionCollectionMatchMap }); - console.log({ includedParentIDs }); + }, {})); // Now we need to explicitly exclude any parent matches that have newer versions // which did NOT appear in the versions query - - const parentsWithoutNewerVersions = await Promise.all(Object.entries(mainCollectionMatchMap).map(async ([parentDocID, parentDocUpdatedAt]) => { + const excludedParentIDs = await Promise.all(Object.entries(mainCollectionMatchMap).map(async ([parentDocID, parentDocUpdatedAt]) => { // If there is a matched version, and it's newer, this parent should remain if (versionCollectionMatchMap[parentDocID] && versionCollectionMatchMap[parentDocID].updatedAt > parentDocUpdatedAt) { return null; } // Otherwise, we need to check if there are newer versions present - // that did not get returned from the versions query. If there are, - // this says that the newest version does not match the incoming query, - // and the parent ID should be excluded + // that did not get returned from the versions query const versionsQuery = await VersionModel.find({ updatedAt: { $gt: parentDocUpdatedAt, }, }, {}, { limit: 1 }).lean(); + // If there are, + // this says that the newest version does not match the incoming query, + // and the parent ID should be excluded if (versionsQuery.length > 0) { return parentDocID; } return null; - })); - - console.log({ parentsWithoutNewerVersions }); - - const excludedParentIDs = parentsWithoutNewerVersions.filter((result) => Boolean(result)); - - console.log({ excludedParentIDs }); + })).then((res) => res.filter((result) => Boolean(result))); // Run a final query against the main collection, - // passing in the ids to exclude and include - // so that they appear correctly - // in paginated results, properly paginated + // passing in any ids to exclude and include + // so that they appear properly paginated const finalQueryToBuild: { where: Where } = { where: { and: [], @@ -183,8 +165,6 @@ export const mergeDrafts = async <T extends TypeWithID>({ }); } - console.log({ finalPayloadQuery: JSON.stringify(finalQueryToBuild, null, 2) }); - const finalQuery = await collection.Model.buildQuery(finalQueryToBuild, locale); let result = await collection.Model.paginate(finalQuery, paginationOptions);
95b96e3e9e0074d4f66ba374e89b4593a7758642
2024-04-23 19:20:41
Jarrod Flesch
chore: adjust headersWithCors for req without payload (#5963)
false
adjust headersWithCors for req without payload (#5963)
chore
diff --git a/packages/next/src/routes/rest/index.ts b/packages/next/src/routes/rest/index.ts index 7525d86f017..9e9dc8fac97 100644 --- a/packages/next/src/routes/rest/index.ts +++ b/packages/next/src/routes/rest/index.ts @@ -187,7 +187,7 @@ export const OPTIONS = return routeError({ config, err: error, - req, + req: req || request, }) } } @@ -347,7 +347,7 @@ export const GET = collection, config, err: error, - req, + req: req || request, }) } } @@ -493,7 +493,7 @@ export const POST = collection, config, err: error, - req, + req: req || request, }) } } @@ -566,7 +566,7 @@ export const DELETE = collection, config, err: error, - req, + req: req || request, }) } } @@ -639,7 +639,7 @@ export const PATCH = collection, config, err: error, - req, + req: req || request, }) } } diff --git a/packages/next/src/routes/rest/routeError.ts b/packages/next/src/routes/rest/routeError.ts index 99e10cd4880..2a8e2d4ce00 100644 --- a/packages/next/src/routes/rest/routeError.ts +++ b/packages/next/src/routes/rest/routeError.ts @@ -78,15 +78,10 @@ export const routeError = async ({ collection?: Collection config: Promise<SanitizedConfig> | SanitizedConfig err: APIError - req: PayloadRequest + req: Partial<PayloadRequest> }) => { let payload = req?.payload - const headers = headersWithCors({ - headers: new Headers(), - req, - }) - if (!payload) { try { payload = await getPayloadHMR({ config: configArg }) @@ -95,11 +90,17 @@ export const routeError = async ({ { message: 'There was an error initializing Payload', }, - { headers, status: httpStatus.INTERNAL_SERVER_ERROR }, + { status: httpStatus.INTERNAL_SERVER_ERROR }, ) } } + req.payload = payload + const headers = headersWithCors({ + headers: new Headers(), + req, + }) + const { config, logger } = payload let response = formatErrors(err) @@ -122,7 +123,7 @@ export const routeError = async ({ ;({ response, status } = collection.config.hooks.afterError( err, response, - req.context, + req?.context, collection.config, ) || { response, status }) } @@ -131,7 +132,7 @@ export const routeError = async ({ ;({ response, status } = config.hooks.afterError( err, response, - req.context, + req?.context, collection?.config, ) || { response, diff --git a/packages/next/src/utilities/headersWithCors.ts b/packages/next/src/utilities/headersWithCors.ts index 0d6f9984474..f8f39b00143 100644 --- a/packages/next/src/utilities/headersWithCors.ts +++ b/packages/next/src/utilities/headersWithCors.ts @@ -2,11 +2,11 @@ import type { PayloadRequest } from 'payload/types' type CorsArgs = { headers: Headers - req: PayloadRequest + req: Partial<PayloadRequest> } export const headersWithCors = ({ headers, req }: CorsArgs): Headers => { - const cors = req.payload.config.cors - const requestOrigin = req.headers.get('Origin') + const cors = req?.payload.config.cors + const requestOrigin = req?.headers.get('Origin') if (cors) { headers.set('Access-Control-Allow-Methods', 'PUT, PATCH, POST, GET, DELETE, OPTIONS') diff --git a/test/fields-relationship/e2e.spec.ts b/test/fields-relationship/e2e.spec.ts index 922a64ba047..6260c934f5d 100644 --- a/test/fields-relationship/e2e.spec.ts +++ b/test/fields-relationship/e2e.spec.ts @@ -253,6 +253,7 @@ describe('fields - relationship', () => { }) async function runFilterOptionsTest(fieldName: string) { + await page.reload() await page.goto(url.edit(docWithExistingRelations.id)) // fill the first relation field diff --git a/tsconfig.json b/tsconfig.json index d55001935b9..aa3dc7b1aee 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -37,7 +37,7 @@ ], "paths": { "@payload-config": [ - "./test/_community/config.ts" + "./test/fields-relationship/config.ts" ], "@payloadcms/live-preview": [ "./packages/live-preview/src" @@ -161,4 +161,4 @@ ".next/types/**/*.ts", "scripts/**/*.ts" ] -} +} \ No newline at end of file
62744e79ac8f3e67b6e3989da3423400799b65f7
2024-08-06 21:58:06
Patrik
fix(next, payload): enable relationship & upload version tracking when localization enabled (#7508)
false
enable relationship & upload version tracking when localization enabled (#7508)
fix
diff --git a/.vscode/launch.json b/.vscode/launch.json index af980747028..6a907551958 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -56,6 +56,13 @@ "request": "launch", "type": "node-terminal" }, + { + "command": "node --no-deprecation test/dev.js fields-relationship", + "cwd": "${workspaceFolder}", + "name": "Run Dev Fields-Relationship", + "request": "launch", + "type": "node-terminal" + }, { "command": "node --no-deprecation test/dev.js login-with-username", "cwd": "${workspaceFolder}", diff --git a/packages/next/src/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx b/packages/next/src/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx index 4dbc06da685..bfcfef34b57 100644 --- a/packages/next/src/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx +++ b/packages/next/src/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx @@ -26,7 +26,13 @@ const generateLabelFromValue = ( locale: string, value: { relationTo: string; value: RelationshipValue } | RelationshipValue, ): string => { - let relation: string + if (Array.isArray(value)) { + return value + .map((v) => generateLabelFromValue(collections, field, locale, v)) + .filter(Boolean) // Filters out any undefined or empty values + .join(', ') + } + let relatedDoc: RelationshipValue let valueToReturn = '' as any @@ -37,17 +43,20 @@ const generateLabelFromValue = ( return String(value) } - if (Array.isArray(relationTo)) { - if (typeof value === 'object') { - relation = value.relationTo - relatedDoc = value.value - } + if (typeof value === 'object' && 'relationTo' in value) { + relatedDoc = value.value } else { - relation = relationTo + // Non-polymorphic relationship relatedDoc = value } - const relatedCollection = collections.find((c) => c.slug === relation) + const relatedCollection = relationTo + ? collections.find( + (c) => + c.slug === + (typeof value === 'object' && 'relationTo' in value ? value.relationTo : relationTo), + ) + : null if (relatedCollection) { const useAsTitle = relatedCollection?.admin?.useAsTitle @@ -56,45 +65,65 @@ const generateLabelFromValue = ( ) let titleFieldIsLocalized = false - if (useAsTitleField && fieldAffectsData(useAsTitleField)) + if (useAsTitleField && fieldAffectsData(useAsTitleField)) { titleFieldIsLocalized = useAsTitleField.localized + } if (typeof relatedDoc?.[useAsTitle] !== 'undefined') { valueToReturn = relatedDoc[useAsTitle] } else if (typeof relatedDoc?.id !== 'undefined') { valueToReturn = relatedDoc.id + } else { + valueToReturn = relatedDoc } if (typeof valueToReturn === 'object' && titleFieldIsLocalized) { valueToReturn = valueToReturn[locale] } + } else if (relatedDoc) { + // Handle non-polymorphic `hasMany` relationships or fallback + if (typeof relatedDoc.id !== 'undefined') { + valueToReturn = relatedDoc.id + } else { + valueToReturn = relatedDoc + } + } + + if (typeof valueToReturn === 'object' && valueToReturn !== null) { + valueToReturn = JSON.stringify(valueToReturn) } return valueToReturn } const Relationship: React.FC<Props> = ({ comparison, field, i18n, locale, version }) => { - let placeholder = '' + const placeholder = `[${i18n.t('general:noValue')}]` const { collections } = useConfig() - if (version === comparison) placeholder = `[${i18n.t('general:noValue')}]` + let versionToRender: string | undefined = placeholder + let comparisonToRender: string | undefined = placeholder - let versionToRender = version - let comparisonToRender = comparison + if (version) { + if ('hasMany' in field && field.hasMany && Array.isArray(version)) { + versionToRender = + version.map((val) => generateLabelFromValue(collections, field, locale, val)).join(', ') || + placeholder + } else { + versionToRender = generateLabelFromValue(collections, field, locale, version) || placeholder + } + } - if ('hasMany' in field && field.hasMany) { - if (Array.isArray(version)) - versionToRender = version - .map((val) => generateLabelFromValue(collections, field, locale, val)) - .join(', ') - if (Array.isArray(comparison)) - comparisonToRender = comparison - .map((val) => generateLabelFromValue(collections, field, locale, val)) - .join(', ') - } else { - versionToRender = generateLabelFromValue(collections, field, locale, version) - comparisonToRender = generateLabelFromValue(collections, field, locale, comparison) + if (comparison) { + if ('hasMany' in field && field.hasMany && Array.isArray(comparison)) { + comparisonToRender = + comparison + .map((val) => generateLabelFromValue(collections, field, locale, val)) + .join(', ') || placeholder + } else { + comparisonToRender = + generateLabelFromValue(collections, field, locale, comparison) || placeholder + } } const label = @@ -112,10 +141,8 @@ const Relationship: React.FC<Props> = ({ comparison, field, i18n, locale, versio </Label> <ReactDiffViewer hideLineNumbers - newValue={typeof versionToRender !== 'undefined' ? String(versionToRender) : placeholder} - oldValue={ - typeof comparisonToRender !== 'undefined' ? String(comparisonToRender) : placeholder - } + newValue={versionToRender} + oldValue={comparisonToRender} showDiffOnly={false} splitView styles={diffStyles} diff --git a/packages/next/src/views/Version/RenderFieldsToDiff/fields/index.tsx b/packages/next/src/views/Version/RenderFieldsToDiff/fields/index.tsx index 4f23b60d8fd..98247b07ba9 100644 --- a/packages/next/src/views/Version/RenderFieldsToDiff/fields/index.tsx +++ b/packages/next/src/views/Version/RenderFieldsToDiff/fields/index.tsx @@ -18,12 +18,12 @@ export default { number: Text, point: Text, radio: Select, - relationship: null, + relationship: Relationship, richText: Text, row: Nested, select: Select, tabs: Tabs, text: Text, textarea: Text, - upload: null, + upload: Relationship, } diff --git a/packages/payload/src/fields/hooks/afterRead/relationshipPopulationPromise.ts b/packages/payload/src/fields/hooks/afterRead/relationshipPopulationPromise.ts index 41b2c39e473..386c4cf132f 100644 --- a/packages/payload/src/fields/hooks/afterRead/relationshipPopulationPromise.ts +++ b/packages/payload/src/fields/hooks/afterRead/relationshipPopulationPromise.ts @@ -126,24 +126,25 @@ export const relationshipPopulationPromise = async ({ if (fieldSupportsMany(field) && field.hasMany) { if ( + field.localized && locale === 'all' && typeof siblingDoc[field.name] === 'object' && siblingDoc[field.name] !== null ) { - Object.keys(siblingDoc[field.name]).forEach((key) => { - if (Array.isArray(siblingDoc[field.name][key])) { - siblingDoc[field.name][key].forEach((relatedDoc, index) => { + Object.keys(siblingDoc[field.name]).forEach((localeKey) => { + if (Array.isArray(siblingDoc[field.name][localeKey])) { + siblingDoc[field.name][localeKey].forEach((relatedDoc, index) => { const rowPromise = async () => { await populate({ currentDepth, - data: siblingDoc[field.name][key][index], + data: siblingDoc[field.name][localeKey][index], dataReference: resultingDoc, depth: populateDepth, draft, fallbackLocale, field, index, - key, + key: localeKey, locale, overrideAccess, req, @@ -179,21 +180,22 @@ export const relationshipPopulationPromise = async ({ }) } } else if ( + field.localized && + locale === 'all' && typeof siblingDoc[field.name] === 'object' && - siblingDoc[field.name] !== null && - locale === 'all' + siblingDoc[field.name] !== null ) { - Object.keys(siblingDoc[field.name]).forEach((key) => { + Object.keys(siblingDoc[field.name]).forEach((localeKey) => { const rowPromise = async () => { await populate({ currentDepth, - data: siblingDoc[field.name][key], + data: siblingDoc[field.name][localeKey], dataReference: resultingDoc, depth: populateDepth, draft, fallbackLocale, field, - key, + key: localeKey, locale, overrideAccess, req, diff --git a/test/fields-relationship/collectionSlugs.ts b/test/fields-relationship/collectionSlugs.ts index 3ecb0cea92f..a1b637ff5cc 100644 --- a/test/fields-relationship/collectionSlugs.ts +++ b/test/fields-relationship/collectionSlugs.ts @@ -12,3 +12,4 @@ export const collection2Slug = 'collection-2' export const videoCollectionSlug = 'videos' export const podcastCollectionSlug = 'podcasts' export const mixedMediaCollectionSlug = 'mixed-media' +export const versionedRelationshipFieldSlug = 'versioned-relationship-field' diff --git a/test/fields-relationship/collections/VersionedRelationshipField/index.ts b/test/fields-relationship/collections/VersionedRelationshipField/index.ts new file mode 100644 index 00000000000..50b3889bbcb --- /dev/null +++ b/test/fields-relationship/collections/VersionedRelationshipField/index.ts @@ -0,0 +1,21 @@ +import type { CollectionConfig } from 'payload' + +import { collection1Slug, versionedRelationshipFieldSlug } from '../../collectionSlugs.js' + +export const VersionedRelationshipFieldCollection: CollectionConfig = { + slug: versionedRelationshipFieldSlug, + fields: [ + { + name: 'title', + type: 'text', + required: true, + }, + { + name: 'relationshipField', + type: 'relationship', + relationTo: [collection1Slug], + hasMany: true, + }, + ], + versions: true, +} diff --git a/test/fields-relationship/config.ts b/test/fields-relationship/config.ts index 16993c7c92d..55d439fb525 100644 --- a/test/fields-relationship/config.ts +++ b/test/fields-relationship/config.ts @@ -24,6 +24,7 @@ import { slug, videoCollectionSlug, } from './collectionSlugs.js' +import { VersionedRelationshipFieldCollection } from './collections/VersionedRelationshipField/index.js' export interface FieldsRelationship { createdAt: Date @@ -321,6 +322,9 @@ export default buildConfigWithDefaults({ }, ], slug: collection1Slug, + admin: { + useAsTitle: 'name', + }, }, { fields: [ @@ -376,7 +380,13 @@ export default buildConfigWithDefaults({ }, ], }, + VersionedRelationshipFieldCollection, ], + localization: { + locales: ['en'], + defaultLocale: 'en', + fallback: true, + }, onInit: async (payload) => { await payload.create({ collection: 'users', diff --git a/test/fields-relationship/int.spec.ts b/test/fields-relationship/int.spec.ts new file mode 100644 index 00000000000..525e8f66463 --- /dev/null +++ b/test/fields-relationship/int.spec.ts @@ -0,0 +1,101 @@ +import type { Payload } from 'payload' + +import type { NextRESTClient } from '../helpers/NextRESTClient.js' +import type { Collection1 } from './payload-types.js' + +import { devUser } from '../credentials.js' +import { initPayloadInt } from '../helpers/initPayloadInt.js' +import { collection1Slug, versionedRelationshipFieldSlug } from './collectionSlugs.js' +import configPromise from './config.js' + +let payload: Payload +let restClient: NextRESTClient + +const { email, password } = devUser + +describe('Relationship Fields', () => { + beforeAll(async () => { + const initialized = await initPayloadInt(configPromise) + ;({ payload, restClient } = initialized) + + await restClient.login({ + slug: 'users', + credentials: { + email, + password, + }, + }) + }) + + afterAll(async () => { + if (typeof payload.db.destroy === 'function') { + await payload.db.destroy() + } + }) + + describe('Versioned Relationship Field', () => { + let version2ID: string + const relatedDocName = 'Related Doc' + beforeAll(async () => { + const relatedDoc = await payload.create({ + collection: collection1Slug, + data: { + name: relatedDocName, + }, + }) + + const version1 = await payload.create({ + collection: versionedRelationshipFieldSlug, + data: { + title: 'Version 1 Title', + relationshipField: { + value: relatedDoc.id, + relationTo: collection1Slug, + }, + }, + }) + + const version2 = await payload.update({ + collection: versionedRelationshipFieldSlug, + id: version1.id, + data: { + title: 'Version 2 Title', + }, + }) + + const versions = await payload.findVersions({ + collection: versionedRelationshipFieldSlug, + where: { + parent: { + equals: version2.id, + }, + }, + sort: '-updatedAt', + limit: 1, + }) + + version2ID = versions.docs[0].id + }) + it('should return the correct versioned relationship field via REST', async () => { + const version2Data = await restClient + .GET(`/${versionedRelationshipFieldSlug}/versions/${version2ID}?locale=all`) + .then((res) => res.json()) + + expect(version2Data.version.title).toEqual('Version 2 Title') + expect(version2Data.version.relationshipField[0].value.name).toEqual(relatedDocName) + }) + + it('should return the correct versioned relationship field via LocalAPI', async () => { + const version2Data = await payload.findVersionByID({ + collection: versionedRelationshipFieldSlug, + id: version2ID, + locale: 'all', + }) + + expect(version2Data.version.title).toEqual('Version 2 Title') + expect((version2Data.version.relationshipField[0].value as Collection1).name).toEqual( + relatedDocName, + ) + }) + }) +}) diff --git a/test/fields-relationship/payload-types.ts b/test/fields-relationship/payload-types.ts index 36f974b2346..9d8a0fdfaaf 100644 --- a/test/fields-relationship/payload-types.ts +++ b/test/fields-relationship/payload-types.ts @@ -24,12 +24,16 @@ export interface Config { videos: Video; podcasts: Podcast; 'mixed-media': MixedMedia; + 'versioned-relationship-field': VersionedRelationshipField; users: User; 'payload-preferences': PayloadPreference; 'payload-migrations': PayloadMigration; }; + db: { + defaultIDType: string; + }; globals: {}; - locale: null; + locale: 'en'; user: User & { collection: 'users'; }; @@ -37,15 +41,20 @@ export interface Config { export interface UserAuthOperations { forgotPassword: { email: string; + password: string; }; login: { - password: string; email: string; + password: string; }; registerFirstUser: { email: string; password: string; }; + unlock: { + email: string; + password: string; + }; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -252,6 +261,22 @@ export interface MixedMedia { updatedAt: string; createdAt: string; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "versioned-relationship-field". + */ +export interface VersionedRelationshipField { + id: string; + title: string; + relationshipField?: + | { + relationTo: 'collection-1'; + value: string | Collection1; + }[] + | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "users".
32f0f340acd85ca72dc27510a37f968b947aa7bc
2024-12-04 08:27:49
Paul
fix(templates): vercel migrations (#9730)
false
vercel migrations (#9730)
fix
diff --git a/templates/with-vercel-website/src/migrations/20241203_192242_initial.json b/templates/with-vercel-website/src/migrations/20241204_024245_initial.json similarity index 99% rename from templates/with-vercel-website/src/migrations/20241203_192242_initial.json rename to templates/with-vercel-website/src/migrations/20241204_024245_initial.json index 72d01bc9943..a925e0d8826 100644 --- a/templates/with-vercel-website/src/migrations/20241203_192242_initial.json +++ b/templates/with-vercel-website/src/migrations/20241204_024245_initial.json @@ -1,5 +1,5 @@ { - "id": "4cf463a4-5305-48e4-9938-2b1ffea91fda", + "id": "cd3bdd6a-6b91-41eb-86ea-c2542d3d852d", "prevId": "00000000-0000-0000-0000-000000000000", "version": "7", "dialect": "postgresql", @@ -4139,6 +4139,42 @@ "type": "varchar", "primaryKey": false, "notNull": false + }, + "sizes_og_url": { + "name": "sizes_og_url", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sizes_og_width": { + "name": "sizes_og_width", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "sizes_og_height": { + "name": "sizes_og_height", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "sizes_og_mime_type": { + "name": "sizes_og_mime_type", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, + "sizes_og_filesize": { + "name": "sizes_og_filesize", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "sizes_og_filename": { + "name": "sizes_og_filename", + "type": "varchar", + "primaryKey": false, + "notNull": false } }, "indexes": { @@ -4276,6 +4312,21 @@ "concurrently": false, "method": "btree", "with": {} + }, + "media_sizes_og_sizes_og_filename_idx": { + "name": "media_sizes_og_sizes_og_filename_idx", + "columns": [ + { + "expression": "sizes_og_filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} } }, "foreignKeys": {}, diff --git a/templates/with-vercel-website/src/migrations/20241203_192242_initial.ts b/templates/with-vercel-website/src/migrations/20241204_024245_initial.ts similarity index 99% rename from templates/with-vercel-website/src/migrations/20241203_192242_initial.ts rename to templates/with-vercel-website/src/migrations/20241204_024245_initial.ts index bb66beb2813..c7f7dcb8649 100644 --- a/templates/with-vercel-website/src/migrations/20241203_192242_initial.ts +++ b/templates/with-vercel-website/src/migrations/20241204_024245_initial.ts @@ -387,7 +387,13 @@ export async function up({ payload, req }: MigrateUpArgs): Promise<void> { "sizes_xlarge_height" numeric, "sizes_xlarge_mime_type" varchar, "sizes_xlarge_filesize" numeric, - "sizes_xlarge_filename" varchar + "sizes_xlarge_filename" varchar, + "sizes_og_url" varchar, + "sizes_og_width" numeric, + "sizes_og_height" numeric, + "sizes_og_mime_type" varchar, + "sizes_og_filesize" numeric, + "sizes_og_filename" varchar ); CREATE TABLE IF NOT EXISTS "categories_breadcrumbs" ( @@ -1356,6 +1362,7 @@ export async function up({ payload, req }: MigrateUpArgs): Promise<void> { CREATE INDEX IF NOT EXISTS "media_sizes_medium_sizes_medium_filename_idx" ON "media" USING btree ("sizes_medium_filename"); CREATE INDEX IF NOT EXISTS "media_sizes_large_sizes_large_filename_idx" ON "media" USING btree ("sizes_large_filename"); CREATE INDEX IF NOT EXISTS "media_sizes_xlarge_sizes_xlarge_filename_idx" ON "media" USING btree ("sizes_xlarge_filename"); + CREATE INDEX IF NOT EXISTS "media_sizes_og_sizes_og_filename_idx" ON "media" USING btree ("sizes_og_filename"); CREATE INDEX IF NOT EXISTS "categories_breadcrumbs_order_idx" ON "categories_breadcrumbs" USING btree ("_order"); CREATE INDEX IF NOT EXISTS "categories_breadcrumbs_parent_id_idx" ON "categories_breadcrumbs" USING btree ("_parent_id"); CREATE INDEX IF NOT EXISTS "categories_breadcrumbs_doc_idx" ON "categories_breadcrumbs" USING btree ("doc_id"); diff --git a/templates/with-vercel-website/src/migrations/index.ts b/templates/with-vercel-website/src/migrations/index.ts index fc0a33340e6..4bc81e28a52 100644 --- a/templates/with-vercel-website/src/migrations/index.ts +++ b/templates/with-vercel-website/src/migrations/index.ts @@ -1,9 +1,9 @@ -import * as migration_20241203_192242_initial from './20241203_192242_initial' +import * as migration_20241204_024245_initial from './20241204_024245_initial' export const migrations = [ { - up: migration_20241203_192242_initial.up, - down: migration_20241203_192242_initial.down, - name: '20241203_192242_initial', + up: migration_20241204_024245_initial.up, + down: migration_20241204_024245_initial.down, + name: '20241204_024245_initial', }, ]
c2509b462c3e949f1d39d7af0e086d1f5ccd1ecc
2024-03-05 22:12:20
Jacob Fletcher
chore(next): wires create first user
false
wires create first user
chore
diff --git a/packages/next/src/views/CreateFirstUser/index.client.tsx b/packages/next/src/views/CreateFirstUser/index.client.tsx index 41fd4ce9b66..e7d149062a3 100644 --- a/packages/next/src/views/CreateFirstUser/index.client.tsx +++ b/packages/next/src/views/CreateFirstUser/index.client.tsx @@ -1,13 +1,14 @@ 'use client' -import { RenderFields, useComponentMap } from '@payloadcms/ui' +import { FieldMap, RenderFields, useComponentMap } from '@payloadcms/ui' import React from 'react' export const CreateFirstUserFields: React.FC<{ userSlug: string -}> = ({ userSlug }) => { + createFirstUserFieldMap: FieldMap +}> = ({ userSlug, createFirstUserFieldMap }) => { const { getFieldMap } = useComponentMap() const fieldMap = getFieldMap({ collectionSlug: userSlug }) - return <RenderFields fieldMap={fieldMap} /> + return <RenderFields fieldMap={[...(fieldMap || []), ...(createFirstUserFieldMap || [])]} /> } diff --git a/packages/next/src/views/CreateFirstUser/index.tsx b/packages/next/src/views/CreateFirstUser/index.tsx index 24b4acfdb47..364305d23d6 100644 --- a/packages/next/src/views/CreateFirstUser/index.tsx +++ b/packages/next/src/views/CreateFirstUser/index.tsx @@ -1,7 +1,6 @@ import type { Field } from 'payload/types' -import { Form, FormSubmit, buildStateFromSchema } from '@payloadcms/ui' -import { redirect } from 'next/navigation' +import { Form, FormSubmit, buildStateFromSchema, mapFields } from '@payloadcms/ui' import React from 'react' import type { AdminViewProps } from '../Root' @@ -16,6 +15,7 @@ export const CreateFirstUser: React.FC<AdminViewProps> = async ({ initPageResult req, req: { payload: { + config, config: { admin: { user: userSlug }, routes: { admin: adminRoute, api: apiRoute }, @@ -25,21 +25,7 @@ export const CreateFirstUser: React.FC<AdminViewProps> = async ({ initPageResult }, } = initPageResult - if (req.user) { - redirect(adminRoute) - } - - const { docs } = await req.payload.find({ - collection: userSlug, - depth: 0, - limit: 1, - }) - - if (docs.length > 0) { - redirect(adminRoute) - } - - const fields = [ + const fields: Field[] = [ { name: 'email', type: 'email', @@ -48,17 +34,25 @@ export const CreateFirstUser: React.FC<AdminViewProps> = async ({ initPageResult }, { name: 'password', - type: 'password', + type: 'text', label: req.t('general:password'), required: true, }, { name: 'confirm-password', - type: 'confirmPassword', + type: 'text', label: req.t('authentication:confirmPassword'), required: true, }, - ] as Field[] + ] + + const createFirstUserFieldMap = mapFields({ + fieldSchema: fields, + operation: 'create', + config, + parentPath: userSlug, + permissions: {}, + }) const formState = await buildStateFromSchema({ fieldSchema: fields, @@ -78,7 +72,10 @@ export const CreateFirstUser: React.FC<AdminViewProps> = async ({ initPageResult redirect={adminRoute} validationOperation="create" > - <CreateFirstUserFields userSlug={userSlug} /> + <CreateFirstUserFields + userSlug={userSlug} + createFirstUserFieldMap={createFirstUserFieldMap} + /> <FormSubmit>{req.t('general:create')}</FormSubmit> </Form> </React.Fragment> diff --git a/packages/next/src/views/Root/index.tsx b/packages/next/src/views/Root/index.tsx index 87c4a1055f8..93473f621f7 100644 --- a/packages/next/src/views/Root/index.tsx +++ b/packages/next/src/views/Root/index.tsx @@ -17,6 +17,7 @@ import { Unauthorized } from '../Unauthorized' import { Verify, verifyBaseClass } from '../Verify' import { Metadata } from 'next' import { I18n } from '@payloadcms/translations' +import { redirect } from 'next/navigation' export { generatePageMetadata } from './meta' @@ -60,12 +61,18 @@ const oneSegmentViews = { export const RootPage = async ({ config: configPromise, params, searchParams }: Args) => { const config = await configPromise + + const { + routes: { admin: adminRoute }, + admin: { user: userSlug }, + } = config + let ViewToRender: React.FC<AdminViewProps> let templateClassName let initPageResult: InitPageResult let templateType: 'default' | 'minimal' = 'default' - let route = config.routes.admin + let route = adminRoute if (Array.isArray(params.segments)) { route = route + '/' + params.segments.join('/') @@ -194,6 +201,23 @@ export const RootPage = async ({ config: configPromise, params, searchParams }: break } + const dbHasUser = await initPageResult.req.payload.db + .findOne({ + collection: userSlug, + req: initPageResult.req, + }) + ?.then((doc) => !!doc) + + const createFirstUserRoute = `${adminRoute}/create-first-user` + + if (!dbHasUser && route !== createFirstUserRoute) { + redirect(createFirstUserRoute) + } + + if (dbHasUser && route === createFirstUserRoute) { + redirect(adminRoute) + } + if (initPageResult) { if (templateType === 'minimal') { return ( diff --git a/packages/ui/src/utilities/buildComponentMap/mapFields.tsx b/packages/ui/src/utilities/buildComponentMap/mapFields.tsx index a7204321265..58e7ac150ae 100644 --- a/packages/ui/src/utilities/buildComponentMap/mapFields.tsx +++ b/packages/ui/src/utilities/buildComponentMap/mapFields.tsx @@ -167,17 +167,19 @@ export const mapFields = (args: { // i.e. not all fields have `maxRows` or `min` or `max` // but this is labor intensive and requires consuming components to be updated const fieldComponentProps: FormFieldBase = { - AfterInput: 'components' in field.admin && + AfterInput: 'admin' in field && + 'components' in field.admin && 'afterInput' in field.admin.components && - Array.isArray(field.admin.components.afterInput) && ( + Array.isArray(field.admin?.components?.afterInput) && ( <Fragment> {field.admin.components.afterInput.map((Component, i) => ( <Component key={i} /> ))} </Fragment> ), - BeforeInput: field.admin?.components && - 'beforeInput' in field.admin?.components && + BeforeInput: 'admin' in field && + field.admin?.components && + 'beforeInput' in field.admin.components && Array.isArray(field.admin.components.beforeInput) && ( <Fragment> {field.admin.components.beforeInput.map((Component, i) => ( @@ -201,8 +203,9 @@ export const mapFields = (args: { Error: ( <RenderCustomComponent CustomComponent={ - field.admin?.components && - 'Error' in field.admin?.components && + 'admin' in field && + field.admin.components && + 'Error' in field.admin.components && field.admin?.components?.Error } DefaultComponent={DefaultError} @@ -212,18 +215,20 @@ export const mapFields = (args: { Label: ( <RenderCustomComponent CustomComponent={ + 'admin' in field && field.admin?.components && - 'Label' in field.admin?.components && + 'Label' in field.admin.components && field.admin?.components?.Label } DefaultComponent={DefaultLabel} componentProps={labelProps} /> ), - className: 'className' in field.admin ? field?.admin?.className : undefined, + className: + 'admin' in field && 'className' in field.admin ? field?.admin?.className : undefined, fieldMap: nestedFieldMap, - style: 'style' in field.admin ? field?.admin?.style : undefined, - width: 'width' in field.admin ? field?.admin?.width : undefined, + style: 'admin' in field && 'style' in field.admin ? field?.admin?.style : undefined, + width: 'admin' in field && 'width' in field.admin ? field?.admin?.width : undefined, // TODO: fix types // label: 'label' in field ? field.label : undefined, blocks, @@ -234,7 +239,7 @@ export const mapFields = (args: { options: 'options' in field ? field.options : undefined, relationTo: 'relationTo' in field ? field.relationTo : undefined, richTextComponentMap: undefined, - step: 'step' in field.admin ? field.admin.step : undefined, + step: 'admin' in field && 'step' in field.admin ? field.admin.step : undefined, tabs, } @@ -248,7 +253,8 @@ export const mapFields = (args: { slug: b.slug, labels: b.labels, })), - dateDisplayFormat: 'date' in field.admin ? field.admin.date.displayFormat : undefined, + dateDisplayFormat: + 'admin' in field && 'date' in field.admin ? field.admin.date.displayFormat : undefined, fieldType: field.type, isFieldAffectingData, label: @@ -342,7 +348,7 @@ export const mapFields = (args: { fieldPermissions, hasMany: 'hasMany' in field ? field.hasMany : undefined, isFieldAffectingData, - isSidebar: field.admin?.position === 'sidebar', + isSidebar: 'admin' in field && field.admin?.position === 'sidebar', label: 'label' in field && typeof field.label !== 'function' ? field.label : undefined, labels: 'labels' in field ? field.labels : undefined, localized: 'localized' in field ? field.localized : false,
cb831362c7f692331646792bbb57294610ddbac5
2024-09-20 21:40:06
Alessio Gravili
chore: add re-usable run against prod command (#8333)
false
add re-usable run against prod command (#8333)
chore
diff --git a/package.json b/package.json index 9b734ef5054..15793514563 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,8 @@ "lint:fix": "turbo run lint:fix --concurrency 1 --continue", "obliterate-playwright-cache-macos": "rm -rf ~/Library/Caches/ms-playwright && find /System/Volumes/Data/private/var/folders -type d -name 'playwright*' -exec rm -rf {} +", "prepare": "husky", + "prepare-run-test-against-prod": "pnpm bf && rm -rf test/packed && rm -rf test/node_modules && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd ..", + "prepare-run-test-against-prod:ci": "rm -rf test/node_modules && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd ..", "reinstall": "pnpm clean:all && pnpm install", "release:alpha": "pnpm runts ./scripts/release.ts --bump prerelease --tag alpha", "release:beta": "pnpm runts ./scripts/release.ts --bump prerelease --tag beta", @@ -82,8 +84,8 @@ "test:e2e": "pnpm runts ./test/runE2E.ts", "test:e2e:debug": "cross-env NODE_OPTIONS=--no-deprecation NODE_NO_WARNINGS=1 PWDEBUG=1 DISABLE_LOGGING=true playwright test", "test:e2e:headed": "cross-env NODE_OPTIONS=--no-deprecation NODE_NO_WARNINGS=1 DISABLE_LOGGING=true playwright test --headed", - "test:e2e:prod": "pnpm bf && rm -rf test/packed && rm -rf test/node_modules && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd .. && pnpm runts ./test/runE2E.ts --prod", - "test:e2e:prod:ci": "rm -rf test/node_modules && rm -f test/pnpm-lock.yaml && pnpm run script:pack --all --no-build --dest test/packed && pnpm runts test/setupProd.ts && cd test && pnpm i --ignore-workspace && cd .. && pnpm runts ./test/runE2E.ts --prod", + "test:e2e:prod": "pnpm prepare-run-test-against-prod && pnpm runts ./test/runE2E.ts --prod", + "test:e2e:prod:ci": "pnpm prepare-run-test-against-prod:ci && pnpm runts ./test/runE2E.ts --prod", "test:int": "cross-env NODE_OPTIONS=\"--no-deprecation\" NODE_NO_WARNINGS=1 DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand", "test:int:postgres": "cross-env NODE_OPTIONS=\"--no-deprecation\" NODE_NO_WARNINGS=1 PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand", "test:int:sqlite": "cross-env NODE_OPTIONS=\"--no-deprecation\" NODE_NO_WARNINGS=1 PAYLOAD_DATABASE=sqlite DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
8b8ceabbdd6354761e7d744cacb1192cac3a2427
2023-10-17 21:37:37
PatrikKozak
fix(templates): user access control (#3712)
false
user access control (#3712)
fix
diff --git a/templates/ecommerce/src/payload/collections/Users/access/adminsAndUser.ts b/templates/ecommerce/src/payload/collections/Users/access/adminsAndUser.ts index 797b06f1d9f..17630ce192a 100644 --- a/templates/ecommerce/src/payload/collections/Users/access/adminsAndUser.ts +++ b/templates/ecommerce/src/payload/collections/Users/access/adminsAndUser.ts @@ -9,7 +9,9 @@ const adminsAndUser: Access = ({ req: { user } }) => { } return { - id: user.id, + id: { + equals: user.id, + }, } } diff --git a/templates/website/src/payload/collections/Users/access/adminsAndUser.ts b/templates/website/src/payload/collections/Users/access/adminsAndUser.ts index 797b06f1d9f..17630ce192a 100644 --- a/templates/website/src/payload/collections/Users/access/adminsAndUser.ts +++ b/templates/website/src/payload/collections/Users/access/adminsAndUser.ts @@ -9,7 +9,9 @@ const adminsAndUser: Access = ({ req: { user } }) => { } return { - id: user.id, + id: { + equals: user.id, + }, } }
ce2cb35d711925a9c500c43a7c0d5ab6bdc3f905
2024-08-27 04:10:38
Paul
fix(plugin-seo): remove dependency on import from payload/next package (#7879)
false
remove dependency on import from payload/next package (#7879)
fix
diff --git a/packages/plugin-seo/src/index.tsx b/packages/plugin-seo/src/index.tsx index a957c9af610..ffafe29acf1 100644 --- a/packages/plugin-seo/src/index.tsx +++ b/packages/plugin-seo/src/index.tsx @@ -1,6 +1,5 @@ import type { Config, GroupField, TabsField, TextField } from 'payload' -import { addDataAndFileToRequest } from '@payloadcms/next/utilities' import { deepMergeSimple } from 'payload/shared' import type { @@ -133,7 +132,11 @@ export const seoPlugin = ...(config.endpoints ?? []), { handler: async (req) => { - await addDataAndFileToRequest(req) + const data = await req.json() + + if (data) { + req.data = data + } const result = pluginConfig.generateTitle ? await pluginConfig.generateTitle({ @@ -148,7 +151,11 @@ export const seoPlugin = }, { handler: async (req) => { - await addDataAndFileToRequest(req) + const data = await req.json() + + if (data) { + req.data = data + } const result = pluginConfig.generateDescription ? await pluginConfig.generateDescription({ @@ -163,7 +170,11 @@ export const seoPlugin = }, { handler: async (req) => { - await addDataAndFileToRequest(req) + const data = await req.json() + + if (data) { + req.data = data + } const result = pluginConfig.generateURL ? await pluginConfig.generateURL({ @@ -178,7 +189,11 @@ export const seoPlugin = }, { handler: async (req) => { - await addDataAndFileToRequest(req) + const data = await req.json() + + if (data) { + req.data = data + } const result = pluginConfig.generateImage ? await pluginConfig.generateImage({
73e0e25e14516c100e275537e28d8e9bb02b1777
2024-12-02 10:05:03
Alessio Gravili
fix(ui): upgrade react-select, fixes type issues with select input (#9653)
false
upgrade react-select, fixes type issues with select input (#9653)
fix
diff --git a/examples/form-builder/next-app/package.json b/examples/form-builder/next-app/package.json index a95ede35c6f..09b83e10a9e 100644 --- a/examples/form-builder/next-app/package.json +++ b/examples/form-builder/next-app/package.json @@ -20,7 +20,7 @@ "react": "18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.41.0", - "react-select": "^5.7.0", + "react-select": "5.8.3", "sass": "^1.55.0", "slate": "^0.84.0" }, diff --git a/examples/form-builder/next-pages/package.json b/examples/form-builder/next-pages/package.json index a95ede35c6f..09b83e10a9e 100644 --- a/examples/form-builder/next-pages/package.json +++ b/examples/form-builder/next-pages/package.json @@ -20,7 +20,7 @@ "react": "18.2.0", "react-dom": "^18.2.0", "react-hook-form": "^7.41.0", - "react-select": "^5.7.0", + "react-select": "5.8.3", "sass": "^1.55.0", "slate": "^0.84.0" }, diff --git a/packages/ui/package.json b/packages/ui/package.json index c6c0137bcb3..deffb85a708 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -117,7 +117,7 @@ "qs-esm": "7.0.2", "react-datepicker": "6.9.0", "react-image-crop": "10.1.8", - "react-select": "5.8.0", + "react-select": "5.8.3", "scheduler": "0.0.0-experimental-3edc000d-20240926", "sonner": "^1.5.0", "ts-essentials": "10.0.3", diff --git a/packages/ui/src/elements/ReactSelect/Input/index.tsx b/packages/ui/src/elements/ReactSelect/Input/index.tsx index c6c64c4c672..7e77dea843b 100644 --- a/packages/ui/src/elements/ReactSelect/Input/index.tsx +++ b/packages/ui/src/elements/ReactSelect/Input/index.tsx @@ -1,15 +1,14 @@ 'use client' -import type { ControlProps } from 'react-select' +import type { InputProps } from 'react-select' import React from 'react' import { components as SelectComponents } from 'react-select' import type { Option } from '../types.js' -export const Input: React.FC<ControlProps<Option, any>> = (props) => { +export const Input: React.FC<InputProps<Option, any>> = (props) => { return ( <React.Fragment> - {/* @ts-expect-error // TODO Fix this - Broke with React 19 types */} <SelectComponents.Input {...props} /** diff --git a/packages/ui/src/elements/ReactSelect/index.tsx b/packages/ui/src/elements/ReactSelect/index.tsx index 7c006a2e371..8319e771460 100644 --- a/packages/ui/src/elements/ReactSelect/index.tsx +++ b/packages/ui/src/elements/ReactSelect/index.tsx @@ -1,10 +1,10 @@ 'use client' -import type { CSSProperties, KeyboardEventHandler } from 'react' +import type { KeyboardEventHandler } from 'react' import { arrayMove } from '@dnd-kit/sortable' import { getTranslation } from '@payloadcms/translations' import React, { useEffect, useId } from 'react' -import Select from 'react-select' +import Select, { type StylesConfig } from 'react-select' import CreatableSelect from 'react-select/creatable' import type { Option, ReactSelectAdapterProps } from './types.js' @@ -67,11 +67,11 @@ const SelectAdapter: React.FC<ReactSelectAdapterProps> = (props) => { .filter(Boolean) .join(' ') - const styles = { + const styles: StylesConfig<Option> = { // Remove the default react-select z-index from the menu so that our custom // z-index in the "payload-default" css layer can take effect, in such a way // that end users can easily override it as with other styles. - menu: (rsStyles: CSSProperties): CSSProperties => ({ ...rsStyles, zIndex: undefined }), + menu: (rsStyles) => ({ ...rsStyles, zIndex: undefined }), } if (!hasMounted) { diff --git a/packages/ui/src/fields/Relationship/index.tsx b/packages/ui/src/fields/Relationship/index.tsx index bd4eeb504c5..7c346dc5a26 100644 --- a/packages/ui/src/fields/Relationship/index.tsx +++ b/packages/ui/src/fields/Relationship/index.tsx @@ -625,7 +625,7 @@ const RelationshipFieldComponent: RelationshipFieldClientComponent = (props) => } return hasMany && Array.isArray(relationTo) ? `${option.relationTo}_${option.value}` - : option.value + : (option.value as string) }} isLoading={isLoading} isMulti={hasMany} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b16ac454929..a2fcfc9e515 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1537,8 +1537,8 @@ importers: specifier: 10.1.8 version: 10.1.8([email protected]) react-select: - specifier: 5.8.0 - version: 5.8.0([email protected]([email protected]))([email protected])([email protected]) + specifier: 5.8.3 + version: 5.8.3([email protected]([email protected]))([email protected])([email protected]) scheduler: specifier: 0.0.0-experimental-3edc000d-20240926 version: 0.0.0-experimental-3edc000d-20240926 @@ -8645,8 +8645,8 @@ packages: react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020 - [email protected]: - resolution: {integrity: sha512-TfjLDo58XrhP6VG5M/Mi56Us0Yt8X7xD6cDybC7yoRMUNm7BGO7qk8J0TLQOua/prb8vUOtsfnXZwfm30HGsAA==} + [email protected]: + resolution: {integrity: sha512-lVswnIq8/iTj1db7XCG74M/3fbGB6ZaluCzvwPGT5ZOjCdL/k0CLWhEK0vCBLuU5bHTEf6Gj8jtSvi+3v+tO1w==} peerDependencies: react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020 @@ -18691,7 +18691,7 @@ snapshots: react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020([email protected]) - [email protected]([email protected]([email protected]))([email protected])([email protected]): + [email protected]([email protected]([email protected]))([email protected])([email protected]): dependencies: '@babel/runtime': 7.26.0 '@emotion/cache': 11.13.1
8a054d8cc9a9158a2c8b29071698cc7a3c7407e6
2024-03-20 00:13:46
James
chore: moves fields, preps for individual export
false
moves fields, preps for individual export
chore
diff --git a/packages/next/src/views/API/RenderJSON/index.tsx b/packages/next/src/views/API/RenderJSON/index.tsx index c004c93e45a..aa0540b41ac 100644 --- a/packages/next/src/views/API/RenderJSON/index.tsx +++ b/packages/next/src/views/API/RenderJSON/index.tsx @@ -1,5 +1,5 @@ 'use client' -import { Chevron } from '@payloadcms/ui' +import { Chevron } from '@payloadcms/ui/icons/Chevron' import * as React from 'react' import './index.scss' diff --git a/packages/next/src/views/API/index.client.tsx b/packages/next/src/views/API/index.client.tsx index 5ae500bfb6e..c8a02618505 100644 --- a/packages/next/src/views/API/index.client.tsx +++ b/packages/next/src/views/API/index.client.tsx @@ -2,7 +2,7 @@ import { CopyToClipboard, Gutter, SetViewActions } from '@payloadcms/ui/elements' import { Checkbox, Form, Number as NumberInput, Select } from '@payloadcms/ui/forms' -import { MinimizeMaximize } from '@payloadcms/ui/icons' +import { MinimizeMaximize } from '@payloadcms/ui/icons/MinimizeMaximize' import { useComponentMap, useConfig, diff --git a/packages/next/src/views/CreateFirstUser/index.client.tsx b/packages/next/src/views/CreateFirstUser/index.client.tsx index 556dc6a9885..df22909c883 100644 --- a/packages/next/src/views/CreateFirstUser/index.client.tsx +++ b/packages/next/src/views/CreateFirstUser/index.client.tsx @@ -1,7 +1,8 @@ 'use client' -import type { FieldMap } from '@payloadcms/ui' +import type { FieldMap } from '@payloadcms/ui/utilities' -import { RenderFields, useComponentMap } from '@payloadcms/ui' +import { RenderFields } from '@payloadcms/ui/forms' +import { useComponentMap } from '@payloadcms/ui/providers' import React from 'react' export const CreateFirstUserFields: React.FC<{ diff --git a/packages/next/tsconfig.json b/packages/next/tsconfig.json index d5d6abee45e..ba111bfa14f 100644 --- a/packages/next/tsconfig.json +++ b/packages/next/tsconfig.json @@ -6,13 +6,7 @@ "emitDeclarationOnly": true, "outDir": "./dist" /* Specify an output folder for all emitted files. */, "rootDir": "./src" /* Specify the root folder within your source files. */, - "sourceMap": true, - "paths": { - "@payloadcms/ui": ["../ui/src/exports/index.ts"], - "@payloadcms/ui/*": ["../ui/src/exports/*"], - "@payloadcms/ui/scss": ["../ui/src/scss/styles.scss"], - "@payloadcms/ui/scss/app.scss": ["../ui/src/scss/app.scss"] - } + "sourceMap": true }, "exclude": [ "src/**/*.spec.js", diff --git a/packages/ui/package.json b/packages/ui/package.json index 540d9f52256..fa3976e13b2 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,8 +1,6 @@ { "name": "@payloadcms/ui", "version": "3.0.0-alpha.48", - "main": "./src/index.ts", - "types": "./dist/index.d.ts", "type": "module", "scripts": { "build": "pnpm copyfiles && pnpm build:swc && pnpm build:types && pnpm build:webpack && rm dist/prod/index.js", @@ -16,11 +14,59 @@ "prepublishOnly": "pnpm clean && pnpm turbo build" }, "exports": { - ".": "./src/exports/index.ts", - "./*": { - "import": "./src/exports/*.ts", - "require": "./src/exports/*.ts", - "types": "./src/exports/*.dts" + "./assets": { + "import": "./src/assets/index.tsx", + "require": "./src/assets/index.tsx", + "default": "./src/assets/index.tsx", + "types": "./src/assets/index.tsx" + }, + "./elements/*": { + "import": "./src/elements/*/index.tsx", + "require": "./src/elements/*/index.tsx", + "default": "./src/elements/*/index.tsx", + "types": "./src/elements/*/index.tsx" + }, + "./forms/*": { + "import": "./src/forms/*/index.tsx", + "require": "./src/forms/*/index.tsx", + "default": "./src/forms/*/index.tsx", + "types": "./src/forms/*/index.tsx" + }, + "./graphics/*": { + "import": "./src/graphics/*/index.tsx", + "require": "./src/graphics/*/index.tsx", + "default": "./src/graphics/*/index.tsx", + "types": "./src/graphics/*/index.tsx" + }, + "./hooks/*": { + "import": "./src/hooks/*.ts", + "require": "./src/hooks/*.ts", + "default": "./src/hooks/*.ts", + "types": "./src/hooks/*.ts" + }, + "./icons/*": { + "import": "./src/icons/*/index.tsx", + "require": "./src/icons/*/index.tsx", + "default": "./src/icons/*/index.tsx", + "types": "./src/icons/*/index.tsx" + }, + "./providers/*": { + "import": "./src/providers/*/index.tsx", + "require": "./src/providers/*/index.tsx", + "default": "./src/providers/*/index.tsx", + "types": "./src/providers/*/index.tsx" + }, + "./templates/*": { + "import": "./src/templates/*/index.tsx", + "require": "./src/templates/*/index.tsx", + "default": "./src/templates/*/index.tsx", + "types": "./src/templates/*/index.tsx" + }, + "./utilities/*": { + "import": "./src/utilities/*/index.tsx", + "require": "./src/utilities/*/index.tsx", + "default": "./src/utilities/*/index.tsx", + "types": "./src/utilities/*/index.tsx" }, "./scss": { "import": "./src/scss.scss", diff --git a/packages/ui/src/exports/assets.ts b/packages/ui/src/assets/index.ts similarity index 100% rename from packages/ui/src/exports/assets.ts rename to packages/ui/src/assets/index.ts diff --git a/packages/ui/src/config.ts b/packages/ui/src/config.ts deleted file mode 100644 index e27fdc96946..00000000000 --- a/packages/ui/src/config.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SanitizedConfig } from 'payload/config' - -export default {} as Promise<SanitizedConfig> diff --git a/packages/ui/src/elements/ArrayAction/index.tsx b/packages/ui/src/elements/ArrayAction/index.tsx index fc660ca5dda..039c128a231 100644 --- a/packages/ui/src/elements/ArrayAction/index.tsx +++ b/packages/ui/src/elements/ArrayAction/index.tsx @@ -1,7 +1,5 @@ import React from 'react' -import type { Props } from './types.js' - import { Chevron } from '../../icons/Chevron/index.js' import { Copy } from '../../icons/Copy/index.js' import { MoreIcon } from '../../icons/More/index.js' @@ -14,6 +12,16 @@ import './index.scss' const baseClass = 'array-actions' +export type Props = { + addRow: (current: number, blockType?: string) => void + duplicateRow: (current: number) => void + hasMaxRows: boolean + index: number + moveRow: (from: number, to: number) => void + removeRow: (index: number) => void + rowCount: number +} + export const ArrayAction: React.FC<Props> = ({ addRow, duplicateRow, diff --git a/packages/ui/src/elements/ArrayAction/types.ts b/packages/ui/src/elements/ArrayAction/types.ts deleted file mode 100644 index 5e2addaca3a..00000000000 --- a/packages/ui/src/elements/ArrayAction/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type Props = { - addRow: (current: number, blockType?: string) => void - duplicateRow: (current: number) => void - hasMaxRows: boolean - index: number - moveRow: (from: number, to: number) => void - removeRow: (index: number) => void - rowCount: number -} diff --git a/packages/ui/src/elements/Button/types.ts b/packages/ui/src/elements/Button/types.ts index 88cf1df0e84..56a1dc38f60 100644 --- a/packages/ui/src/elements/Button/types.ts +++ b/packages/ui/src/elements/Button/types.ts @@ -1,7 +1,7 @@ import type { ElementType, MouseEvent } from 'react' import type React from 'react' -import type { LinkType } from '../../exports/types.js' +import type { LinkType } from '../../exports-old/types.js' export type Props = { Link?: LinkType diff --git a/packages/ui/src/elements/ListDrawer/DrawerContent.tsx b/packages/ui/src/elements/ListDrawer/DrawerContent.tsx index 3cd4d267887..5e88db1a21c 100644 --- a/packages/ui/src/elements/ListDrawer/DrawerContent.tsx +++ b/packages/ui/src/elements/ListDrawer/DrawerContent.tsx @@ -11,7 +11,7 @@ import type { ListDrawerProps } from './types.js' import Label from '../../forms/Label/index.js' import usePayloadAPI from '../../hooks/usePayloadAPI.js' -import { useUseTitleField } from '../../hooks/useUseAsTitle.js' +import { useUseTitleField } from '../../hooks/useUseAsTitle.sx' import { X } from '../../icons/X/index.js' import { useAuth } from '../../providers/Auth/index.js' import { useComponentMap } from '../../providers/ComponentMapProvider/index.js' diff --git a/packages/ui/src/elements/Upload/index.tsx b/packages/ui/src/elements/Upload/index.tsx index 3f2a06db3b2..724d15673fe 100644 --- a/packages/ui/src/elements/Upload/index.tsx +++ b/packages/ui/src/elements/Upload/index.tsx @@ -4,10 +4,10 @@ import React, { useCallback, useEffect, useState } from 'react' import type { Props } from './types.js' -import Error from '../../forms/Error/index.js' +import { fieldBaseClass } from '../../fields/shared.js' +import { Error } from '../../forms/Error/index.js' import { useFormSubmitted } from '../../forms/Form/context.js' import reduceFieldsToValues from '../../forms/Form/reduceFieldsToValues.js' -import { fieldBaseClass } from '../../forms/fields/shared.js' import { useField } from '../../forms/useField/index.js' import { useDocumentInfo } from '../../providers/DocumentInfo/index.js' import { useTranslation } from '../../providers/Translation/index.js' diff --git a/packages/ui/src/exports-old/assets.ts b/packages/ui/src/exports-old/assets.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/ui/src/exports/elements.ts b/packages/ui/src/exports-old/elements.ts similarity index 54% rename from packages/ui/src/exports/elements.ts rename to packages/ui/src/exports-old/elements.ts index d3f3c6b0dbc..37e7ccf2575 100644 --- a/packages/ui/src/exports/elements.ts +++ b/packages/ui/src/exports-old/elements.ts @@ -1,52 +1,52 @@ -export { Button } from '../elements/Button/index.js' -export { Card } from '../elements/Card/index.js' -export { Collapsible } from '../elements/Collapsible/index.js' -export { default as CopyToClipboard } from '../elements/CopyToClipboard/index.js' -export { DeleteMany } from '../elements/DeleteMany/index.js' -export { DocumentControls } from '../elements/DocumentControls/index.js' -export { useDocumentDrawer } from '../elements/DocumentDrawer/index.js' -export { DocumentFields } from '../elements/DocumentFields/index.js' -export { DocumentHeader } from '../elements/DocumentHeader/index.js' -export { Drawer, DrawerToggler, formatDrawerSlug } from '../elements/Drawer/index.js' -export { useDrawerSlug } from '../elements/Drawer/useDrawerSlug.js' -export { EditMany } from '../elements/EditMany/index.js' -export { ErrorPill } from '../elements/ErrorPill/index.js' -export { default as GenerateConfirmation } from '../elements/GenerateConfirmation/index.js' -export { Gutter } from '../elements/Gutter/index.js' -export { HydrateClientUser } from '../elements/HydrateClientUser/index.js' -export { ListControls } from '../elements/ListControls/index.js' -export { useListDrawer } from '../elements/ListDrawer/index.js' -export { ListSelection } from '../elements/ListSelection/index.js' -export { LoadingOverlayToggle } from '../elements/Loading/index.js' -export { FormLoadingOverlayToggle } from '../elements/Loading/index.js' -export { LoadingOverlay } from '../elements/Loading/index.js' -export { Pagination } from '../elements/Pagination/index.js' -export { PerPage } from '../elements/PerPage/index.js' -export { Pill } from '../elements/Pill/index.js' -export * as PopupList from '../elements/Popup/PopupButtonList/index.js' -export { default as Popup } from '../elements/Popup/index.js' -export { PublishMany } from '../elements/PublishMany/index.js' -export { default as ReactSelect } from '../elements/ReactSelect/index.js' +export { Button } from '../elements/Button/index.jsx' +export { Card } from '../elements/Card/index.jsx' +export { Collapsible } from '../elements/Collapsible/index.jsx' +export { default as CopyToClipboard } from '../elements/CopyToClipboard/index.jsx' +export { DeleteMany } from '../elements/DeleteMany/index.jsx' +export { DocumentControls } from '../elements/DocumentControls/index.jsx' +export { useDocumentDrawer } from '../elements/DocumentDrawer/index.jsx' +export { DocumentFields } from '../elements/DocumentFields/index.jsx' +export { DocumentHeader } from '../elements/DocumentHeader/index.jsx' +export { Drawer, DrawerToggler, formatDrawerSlug } from '../elements/Drawer/index.jsx' +export { useDrawerSlug } from '../elements/Drawer/useDrawerSlug.jsx' +export { EditMany } from '../elements/EditMany/index.jsx' +export { ErrorPill } from '../elements/ErrorPill/index.jsx' +export { default as GenerateConfirmation } from '../elements/GenerateConfirmation/index.jsx' +export { Gutter } from '../elements/Gutter/index.jsx' +export { HydrateClientUser } from '../elements/HydrateClientUser/index.jsx' +export { ListControls } from '../elements/ListControls/index.jsx' +export { useListDrawer } from '../elements/ListDrawer/index.jsx' +export { ListSelection } from '../elements/ListSelection/index.jsx' +export { LoadingOverlayToggle } from '../elements/Loading/index.jsx' +export { FormLoadingOverlayToggle } from '../elements/Loading/index.jsx' +export { LoadingOverlay } from '../elements/Loading/index.jsx' +export { Pagination } from '../elements/Pagination/index.jsx' +export { PerPage } from '../elements/PerPage/index.jsx' +export { Pill } from '../elements/Pill/index.jsx' +export * as PopupList from '../elements/Popup/PopupButtonList/index.jsx' +export { default as Popup } from '../elements/Popup/index.jsx' +export { PublishMany } from '../elements/PublishMany/index.jsx' +export { default as ReactSelect } from '../elements/ReactSelect/index.jsx' export type { Option } from '../elements/ReactSelect/types.js' -export { RenderCustomComponent } from '../elements/RenderCustomComponent/index.js' -export { ShimmerEffect } from '../elements/ShimmerEffect/index.js' -export { StaggeredShimmers } from '../elements/ShimmerEffect/index.js' -export { SortColumn } from '../elements/SortColumn/index.js' -export { SetStepNav } from '../elements/StepNav/SetStepNav.js' -export { useStepNav } from '../elements/StepNav/index.js' +export { RenderCustomComponent } from '../elements/RenderCustomComponent/index.jsx' +export { ShimmerEffect } from '../elements/ShimmerEffect/index.jsx' +export { StaggeredShimmers } from '../elements/ShimmerEffect/index.jsx' +export { SortColumn } from '../elements/SortColumn/index.jsx' +export { SetStepNav } from '../elements/StepNav/SetStepNav.jsx' +export { useStepNav } from '../elements/StepNav/index.jsx' export type { StepNavItem } from '../elements/StepNav/types.js' -export { TableCellProvider, useTableCell } from '../elements/Table/TableCellProvider/index.js' -export { Table } from '../elements/Table/index.js' +export { TableCellProvider, useTableCell } from '../elements/Table/TableCellProvider/index.jsx' +export { Table } from '../elements/Table/index.jsx' export type { Column } from '../elements/Table/types.js' -export { TableColumnsProvider } from '../elements/TableColumns/index.js' -export { default as Thumbnail } from '../elements/Thumbnail/index.js' -export { Tooltip } from '../elements/Tooltip/index.js' +export { TableColumnsProvider } from '../elements/TableColumns/index.jsx' +export { default as Thumbnail } from '../elements/Thumbnail/index.jsx' +export { Tooltip } from '../elements/Tooltip/index.jsx' // export { useThumbnail } from '../elements/Upload/index.js' -export { Translation } from '../elements/Translation/index.js' -export { UnpublishMany } from '../elements/UnpublishMany/index.js' -export { Upload } from '../elements/Upload/index.js' +export { Translation } from '../elements/Translation/index.jsx' +export { UnpublishMany } from '../elements/UnpublishMany/index.jsx' +export { Upload } from '../elements/Upload/index.jsx' export { BlocksDrawer } from '../forms/fields/Blocks/BlocksDrawer/index.js' -export { SetViewActions } from '../providers/ActionsProvider/SetViewActions/index.js' +export { SetViewActions } from '../providers/ActionsProvider/SetViewActions/index.jsx' import * as facelessUIImport from '@faceless-ui/modal' const { Modal } = facelessUIImport && 'Modal' in facelessUIImport ? facelessUIImport : { Modal: undefined } diff --git a/packages/ui/src/exports/form-utilities.ts b/packages/ui/src/exports-old/form-utilities.ts similarity index 100% rename from packages/ui/src/exports/form-utilities.ts rename to packages/ui/src/exports-old/form-utilities.ts diff --git a/packages/ui/src/exports/graphics.ts b/packages/ui/src/exports-old/graphics.ts similarity index 54% rename from packages/ui/src/exports/graphics.ts rename to packages/ui/src/exports-old/graphics.ts index 61fce41c9ec..5b2bf33411c 100644 --- a/packages/ui/src/exports/graphics.ts +++ b/packages/ui/src/exports-old/graphics.ts @@ -1,2 +1,2 @@ -export { default as FileGraphic } from '../graphics/File/index.js' -export { Logo } from '../graphics/Logo/index.js' +export { default as FileGraphic } from '../graphics/File/index.jsx' +export { Logo } from '../graphics/Logo/index.jsx' diff --git a/packages/ui/src/exports/hooks.ts b/packages/ui/src/exports-old/hooks.ts similarity index 85% rename from packages/ui/src/exports/hooks.ts rename to packages/ui/src/exports-old/hooks.ts index 28d7d549a57..a80486faff3 100644 --- a/packages/ui/src/exports/hooks.ts +++ b/packages/ui/src/exports-old/hooks.ts @@ -1,8 +1,8 @@ export { useAdminThumbnail } from '../hooks/useAdminThumbnail.js' export { default as useDebounce } from '../hooks/useDebounce.js' -export { default as useHotkey } from '../hooks/useHotkey.js' -export { useIntersect } from '../hooks/useIntersect.js' -export { default as usePayloadAPI } from '../hooks/usePayloadAPI.js' +export { default as useHotkey } from '../hooks/useHotkey.jsx' +export { useIntersect } from '../hooks/useIntersect.jsx' +export { default as usePayloadAPI } from '../hooks/usePayloadAPI.jsx' export { useResize } from '../hooks/useResize.js' export { default as useThumbnail } from '../hooks/useThumbnail.js' diff --git a/packages/ui/src/exports/providers.ts b/packages/ui/src/exports-old/providers.ts similarity index 63% rename from packages/ui/src/exports/providers.ts rename to packages/ui/src/exports-old/providers.ts index e35dbc887a3..7475dbae7e2 100644 --- a/packages/ui/src/exports/providers.ts +++ b/packages/ui/src/exports-old/providers.ts @@ -1,35 +1,35 @@ -export { useActions } from '../providers/ActionsProvider/index.js' -export { useAuth } from '../providers/Auth/index.js' -export { ClientFunctionProvider, useAddClientFunction } from '../providers/ClientFunction/index.js' -export { useClientFunctions } from '../providers/ClientFunction/index.js' -export { useComponentMap } from '../providers/ComponentMapProvider/index.js' -export type { IComponentMapContext } from '../providers/ComponentMapProvider/index.js' -export { ConfigProvider, useConfig } from '../providers/Config/index.js' -export { useDocumentEvents } from '../providers/DocumentEvents/index.js' -export { useDocumentInfo } from '../providers/DocumentInfo/index.js' +export { useActions } from '../providers/ActionsProvider/index.jsx' +export { useAuth } from '../providers/Auth/index.jsx' +export { ClientFunctionProvider, useAddClientFunction } from '../providers/ClientFunction/index.jsx' +export { useClientFunctions } from '../providers/ClientFunction/index.jsx' +export { useComponentMap } from '../providers/ComponentMapProvider/index.jsx' +export type { IComponentMapContext } from '../providers/ComponentMapProvider/index.jsx' +export { ConfigProvider, useConfig } from '../providers/Config/index.jsx' +export { useDocumentEvents } from '../providers/DocumentEvents/index.jsx' +export { useDocumentInfo } from '../providers/DocumentInfo/index.jsx' export { type DocumentInfo, type DocumentInfoContext, type DocumentInfoProps, DocumentInfoProvider, -} from '../providers/DocumentInfo/index.js' -export { EditDepthContext, EditDepthProvider } from '../providers/EditDepth/index.js' -export { useEditDepth } from '../providers/EditDepth/index.js' -export { FormQueryParams, FormQueryParamsProvider } from '../providers/FormQueryParams/index.js' -export type { QueryParamTypes } from '../providers/FormQueryParams/index.js' -export { useFormQueryParams } from '../providers/FormQueryParams/index.js' -export { useListInfo } from '../providers/ListInfo/index.js' -export { ListInfoProvider } from '../providers/ListInfo/index.js' +} from '../providers/DocumentInfo/index.jsx' +export { EditDepthContext, EditDepthProvider } from '../providers/EditDepth/index.jsx' +export { useEditDepth } from '../providers/EditDepth/index.jsx' +export { FormQueryParams, FormQueryParamsProvider } from '../providers/FormQueryParams/index.jsx' +export type { QueryParamTypes } from '../providers/FormQueryParams/index.jsx' +export { useFormQueryParams } from '../providers/FormQueryParams/index.jsx' +export { useListInfo } from '../providers/ListInfo/index.jsx' +export { ListInfoProvider } from '../providers/ListInfo/index.jsx' export type { ColumnPreferences } from '../providers/ListInfo/types.js' -export { useLocale } from '../providers/Locale/index.js' -export { OperationProvider } from '../providers/OperationProvider/index.js' -export { RootProvider } from '../providers/Root/index.js' -export { useRouteCache } from '../providers/RouteCache/index.js' +export { useLocale } from '../providers/Locale/index.jsx' +export { OperationProvider } from '../providers/OperationProvider/index.jsx' +export { RootProvider } from '../providers/Root/index.jsx' +export { useRouteCache } from '../providers/RouteCache/index.jsx' export { SelectAllStatus, SelectionProvider, useSelection, -} from '../providers/SelectionProvider/index.js' -export { useTheme } from '../providers/Theme/index.js' +} from '../providers/SelectionProvider/index.jsx' +export { useTheme } from '../providers/Theme/index.jsx' export type { Theme } from '../providers/Theme/types.js' -export { useTranslation } from '../providers/Translation/index.js' +export { useTranslation } from '../providers/Translation/index.jsx' diff --git a/packages/ui/src/exports/scss.scss b/packages/ui/src/exports-old/scss.scss similarity index 100% rename from packages/ui/src/exports/scss.scss rename to packages/ui/src/exports-old/scss.scss diff --git a/packages/ui/src/exports-old/templates.ts b/packages/ui/src/exports-old/templates.ts new file mode 100644 index 00000000000..b3c160204c4 --- /dev/null +++ b/packages/ui/src/exports-old/templates.ts @@ -0,0 +1,2 @@ +export { DefaultTemplate } from '../templates/Default/index.jsx' +export { MinimalTemplate } from '../templates/Minimal/index.jsx' diff --git a/packages/ui/src/exports/types.ts b/packages/ui/src/exports-old/types.ts similarity index 100% rename from packages/ui/src/exports/types.ts rename to packages/ui/src/exports-old/types.ts diff --git a/packages/ui/src/exports/utilities.ts b/packages/ui/src/exports-old/utilities.ts similarity index 91% rename from packages/ui/src/exports/utilities.ts rename to packages/ui/src/exports-old/utilities.ts index a3aaadff680..5df515e924f 100644 --- a/packages/ui/src/exports/utilities.ts +++ b/packages/ui/src/exports-old/utilities.ts @@ -1,5 +1,5 @@ -export { buildComponentMap } from '../utilities/buildComponentMap/index.js' -export { mapFields } from '../utilities/buildComponentMap/mapFields.js' +export { buildComponentMap } from '../utilities/buildComponentMap/index.jsx' +export { mapFields } from '../utilities/buildComponentMap/mapFields.jsx' export type { FieldMap, MappedField } from '../utilities/buildComponentMap/types.js' export type { ReducedBlock } from '../utilities/buildComponentMap/types.js' export { buildFieldSchemaMap } from '../utilities/buildFieldSchemaMap/index.js' @@ -8,8 +8,8 @@ export { default as canUseDOM } from '../utilities/canUseDOM.js' export { findLocaleFromCode } from '../utilities/findLocaleFromCode.js' export { formatDate } from '../utilities/formatDate/index.js' export { formatDocTitle } from '../utilities/formatDocTitle.js' -export { formatFields } from '../utilities/formatFields.js' +export { formatFields } from '../utilities/formatFields.jsx' export { getFormState } from '../utilities/getFormState.js' export type { EntityToGroup, Group } from '../utilities/groupNavItems.js' export { EntityType, groupNavItems } from '../utilities/groupNavItems.js' -export { withMergedProps } from '../utilities/withMergedProps/index.js' +export { withMergedProps } from '../utilities/withMergedProps/index.jsx' diff --git a/packages/ui/src/exports/forms.ts b/packages/ui/src/exports/forms.ts deleted file mode 100644 index a27f94b894f..00000000000 --- a/packages/ui/src/exports/forms.ts +++ /dev/null @@ -1,60 +0,0 @@ -export { default as Error } from '../forms/Error/index.js' -export { default as FieldDescription } from '../forms/FieldDescription/index.js' -export { - FieldPropsProvider as FieldPathProvider, - useFieldProps as useFieldPath, -} from '../forms/FieldPropsProvider/index.js' -export { - useAllFormFields, - useForm, - useFormFields, - useFormSubmitted, - useWatchForm, -} from '../forms/Form/context.js' -export { useFormModified } from '../forms/Form/context.js' -export { createNestedFieldPath } from '../forms/Form/createNestedFieldPath.js' -export { default as Form } from '../forms/Form/index.js' -export type { Props as FormProps } from '../forms/Form/types.js' -export { default as Label } from '../forms/Label/index.js' -export { RenderFields } from '../forms/RenderFields/index.js' -export { useRowLabel } from '../forms/RowLabel/Context/index.js' -export { default as FormSubmit } from '../forms/Submit/index.js' -export { default as Submit } from '../forms/Submit/index.js' - -export type { ArrayFieldProps } from '../forms/fields/Array/types.js' -export { default as SectionTitle } from '../forms/fields/Blocks/SectionTitle/index.js' -export type { BlocksFieldProps } from '../forms/fields/Blocks/types.js' -export { CheckboxInput } from '../forms/fields/Checkbox/Input.js' -export { default as Checkbox } from '../forms/fields/Checkbox/index.js' -export type { CheckboxFieldProps } from '../forms/fields/Checkbox/types.js' -export type { CodeFieldProps } from '../forms/fields/Code/types.js' -export { default as ConfirmPassword } from '../forms/fields/ConfirmPassword/index.js' -export type { DateFieldProps } from '../forms/fields/DateTime/types.js' -export { default as Email } from '../forms/fields/Email/index.js' -export type { EmailFieldProps } from '../forms/fields/Email/types.js' -export type { GroupFieldProps } from '../forms/fields/Group/types.js' -export { default as HiddenInput } from '../forms/fields/HiddenInput/index.js' -export type { HiddenInputFieldProps } from '../forms/fields/HiddenInput/types.js' -export type { JSONFieldProps } from '../forms/fields/JSON/types.js' -export { default as Number } from '../forms/fields/Number/index.js' - -export type { NumberFieldProps } from '../forms/fields/Number/types.js' - -export { default as Password } from '../forms/fields/Password/index.js' -export { default as RadioGroupInput } from '../forms/fields/RadioGroup/index.js' -export type { OnChange } from '../forms/fields/RadioGroup/types.js' -export { default as Select } from '../forms/fields/Select/index.js' -export { default as SelectInput } from '../forms/fields/Select/index.js' - -export { TextInput, type TextInputProps } from '../forms/fields/Text/Input.js' - -export { default as Text } from '../forms/fields/Text/index.js' -export { type TextAreaInputProps, TextareaInput } from '../forms/fields/Textarea/Input.js' -export { default as Textarea } from '../forms/fields/Textarea/index.js' -export { UploadInput, type UploadInputProps } from '../forms/fields/Upload/Input.js' -export { default as UploadField } from '../forms/fields/Upload/index.js' -export { fieldComponents } from '../forms/fields/index.js' -export { fieldBaseClass } from '../forms/fields/shared.js' -export { useField } from '../forms/useField/index.js' -export type { FieldType, Options } from '../forms/useField/types.js' -export { withCondition } from '../forms/withCondition/index.js' diff --git a/packages/ui/src/exports/icons.ts b/packages/ui/src/exports/icons.ts deleted file mode 100644 index a79e6982c49..00000000000 --- a/packages/ui/src/exports/icons.ts +++ /dev/null @@ -1,17 +0,0 @@ -export { Calendar } from '../icons/Calendar/index.js' -export { Check } from '../icons/Check/index.js' -export { Chevron } from '../icons/Chevron/index.js' -export { CodeBlockIcon } from '../icons/CodeBlock/index.js' -export { Copy } from '../icons/Copy/index.js' -export { DragHandle } from '../icons/DragHandle/index.js' -export { Edit } from '../icons/Edit/index.js' -export { Line } from '../icons/Line/index.js' -export { LinkIcon } from '../icons/Link/index.js' -export { LogOut } from '../icons/LogOut/index.js' -export { Menu } from '../icons/Menu/index.js' -export { MinimizeMaximize } from '../icons/MinimizeMaximize/index.js' -export { MoreIcon } from '../icons/More/index.js' -export { Plus } from '../icons/Plus/index.js' -export { Search } from '../icons/Search/index.js' -export { Swap } from '../icons/Swap/index.js' -export { X } from '../icons/X/index.js' diff --git a/packages/ui/src/exports/templates.ts b/packages/ui/src/exports/templates.ts deleted file mode 100644 index 2a204fc352b..00000000000 --- a/packages/ui/src/exports/templates.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { DefaultTemplate } from '../templates/Default/index.js' -export { MinimalTemplate } from '../templates/Minimal/index.js' diff --git a/packages/ui/src/forms/fields/Array/ArrayRow.tsx b/packages/ui/src/fields/Array/ArrayRow.tsx similarity index 81% rename from packages/ui/src/forms/fields/Array/ArrayRow.tsx rename to packages/ui/src/fields/Array/ArrayRow.tsx index afc19d2be14..09381bc524c 100644 --- a/packages/ui/src/forms/fields/Array/ArrayRow.tsx +++ b/packages/ui/src/fields/Array/ArrayRow.tsx @@ -1,20 +1,20 @@ import type { FieldPermissions } from 'payload/auth' -import type { ArrayField, Row, RowLabel as RowLabelType } from 'payload/types' +import type { ArrayField, Row } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React from 'react' -import type { UseDraggableSortableReturn } from '../../../elements/DraggableSortable/useDraggableSortable/types.js' -import type { FieldMap } from '../../../utilities/buildComponentMap/types.js' +import type { UseDraggableSortableReturn } from '../../elements/DraggableSortable/useDraggableSortable/types.js' +import type { FieldMap } from '../../utilities/buildComponentMap/types.js' -import { ArrayAction } from '../../../elements/ArrayAction/index.js' -import { Collapsible } from '../../../elements/Collapsible/index.js' -import { ErrorPill } from '../../../elements/ErrorPill/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import { useFormSubmitted } from '../../Form/context.js' -import { RenderFields } from '../../RenderFields/index.js' -import { RowLabel } from '../../RowLabel/index.js' -import HiddenInput from '../HiddenInput/index.js' +import { ArrayAction } from '../../elements/ArrayAction/index.js' +import { Collapsible } from '../../elements/Collapsible/index.js' +import { ErrorPill } from '../../elements/ErrorPill/index.js' +import { useFormSubmitted } from '../../forms/Form/context.js' +import { RenderFields } from '../../forms/RenderFields/index.js' +import { RowLabel } from '../../forms/RowLabel/index.js' +import { useTranslation } from '../../providers/Translation/index.js' +import { HiddenInput } from '../HiddenInput/index.js' import './index.scss' const baseClass = 'array-field' diff --git a/packages/ui/src/forms/fields/Array/index.scss b/packages/ui/src/fields/Array/index.scss similarity index 97% rename from packages/ui/src/forms/fields/Array/index.scss rename to packages/ui/src/fields/Array/index.scss index 636c04e8b1b..ef7ea93e543 100644 --- a/packages/ui/src/forms/fields/Array/index.scss +++ b/packages/ui/src/fields/Array/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .array-field { display: flex; diff --git a/packages/ui/src/forms/fields/Array/index.tsx b/packages/ui/src/fields/Array/index.tsx similarity index 83% rename from packages/ui/src/forms/fields/Array/index.tsx rename to packages/ui/src/fields/Array/index.tsx index be7a2120a8d..b2edefe4f23 100644 --- a/packages/ui/src/forms/fields/Array/index.tsx +++ b/packages/ui/src/fields/Array/index.tsx @@ -1,30 +1,49 @@ 'use client' +import type { FieldPermissions } from 'payload/auth' +import type { FieldBase } from 'payload/types' +import type { ArrayField as ArrayFieldType } from 'payload/types' + import { getTranslation } from '@payloadcms/translations' import React, { useCallback } from 'react' -import type { ArrayFieldProps } from './types.js' +import type { FieldMap } from '../../utilities/buildComponentMap/types.js' +import type { FormFieldBase } from '../shared.js' -import Banner from '../../../elements/Banner/index.js' -import { Button } from '../../../elements/Button/index.js' -import DraggableSortableItem from '../../../elements/DraggableSortable/DraggableSortableItem/index.js' -import DraggableSortable from '../../../elements/DraggableSortable/index.js' -import { ErrorPill } from '../../../elements/ErrorPill/index.js' -import { useConfig } from '../../../providers/Config/index.js' -import { useDocumentInfo } from '../../../providers/DocumentInfo/index.js' -import { useLocale } from '../../../providers/Locale/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import { scrollToID } from '../../../utilities/scrollToID.js' -import { useForm, useFormSubmitted } from '../../Form/context.js' -import LabelComp from '../../Label/index.js' -import { NullifyLocaleField } from '../../NullifyField/index.js' -import { useField } from '../../useField/index.js' +import Banner from '../../elements/Banner/index.js' +import { Button } from '../../elements/Button/index.js' +import DraggableSortableItem from '../../elements/DraggableSortable/DraggableSortableItem/index.js' +import DraggableSortable from '../../elements/DraggableSortable/index.js' +import { ErrorPill } from '../../elements/ErrorPill/index.js' +import { useForm, useFormSubmitted } from '../../forms/Form/context.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { NullifyLocaleField } from '../../forms/NullifyField/index.js' +import { useField } from '../../forms/useField/index.js' +import { useConfig } from '../../providers/Config/index.js' +import { useDocumentInfo } from '../../providers/DocumentInfo/index.js' +import { useLocale } from '../../providers/Locale/index.js' +import { useTranslation } from '../../providers/Translation/index.js' +import { scrollToID } from '../../utilities/scrollToID.js' import { fieldBaseClass } from '../shared.js' import { ArrayRow } from './ArrayRow.js' import './index.scss' const baseClass = 'array-field' -const ArrayFieldType: React.FC<ArrayFieldProps> = (props) => { +export type ArrayFieldProps = FormFieldBase & { + RowLabel?: React.ReactNode + fieldMap: FieldMap + forceRender?: boolean + indexPath: string + label?: FieldBase['label'] + labels?: ArrayFieldType['labels'] + maxRows?: ArrayFieldType['maxRows'] + minRows?: ArrayFieldType['minRows'] + name?: string + permissions: FieldPermissions + width?: string +} + +export const ArrayField: React.FC<ArrayFieldProps> = (props) => { const { name, Description, @@ -278,5 +297,3 @@ const ArrayFieldType: React.FC<ArrayFieldProps> = (props) => { </div> ) } - -export default ArrayFieldType diff --git a/packages/ui/src/forms/fields/Blocks/BlockRow.tsx b/packages/ui/src/fields/Blocks/BlockRow.tsx similarity index 83% rename from packages/ui/src/forms/fields/Blocks/BlockRow.tsx rename to packages/ui/src/fields/Blocks/BlockRow.tsx index 50cdbd32378..86321857dac 100644 --- a/packages/ui/src/forms/fields/Blocks/BlockRow.tsx +++ b/packages/ui/src/fields/Blocks/BlockRow.tsx @@ -5,19 +5,18 @@ import type { Labels, Row } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React from 'react' -import type { UseDraggableSortableReturn } from '../../../elements/DraggableSortable/useDraggableSortable/types.js' -import type { ReducedBlock } from '../../../utilities/buildComponentMap/types.js' +import type { UseDraggableSortableReturn } from '../../elements/DraggableSortable/useDraggableSortable/types.js' +import type { ReducedBlock } from '../../utilities/buildComponentMap/types.js' -import { Collapsible } from '../../../elements/Collapsible/index.js' -import { ErrorPill } from '../../../elements/ErrorPill/index.js' -import Pill from '../../../elements/Pill/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import { FieldPropsProvider } from '../../FieldPropsProvider/index.js' -import { useFormSubmitted } from '../../Form/context.js' -import { RenderFields } from '../../RenderFields/index.js' -import HiddenInput from '../HiddenInput/index.js' +import { Collapsible } from '../../elements/Collapsible/index.js' +import { ErrorPill } from '../../elements/ErrorPill/index.js' +import Pill from '../../elements/Pill/index.js' +import { useFormSubmitted } from '../../forms/Form/context.js' +import { RenderFields } from '../../forms/RenderFields/index.js' +import { useTranslation } from '../../providers/Translation/index.js' +import { HiddenInput } from '../HiddenInput/index.js' import { RowActions } from './RowActions.js' -import SectionTitle from './SectionTitle/index.js' +import { SectionTitle } from './SectionTitle/index.js' const baseClass = 'blocks-field' diff --git a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/BlockSearch/index.scss b/packages/ui/src/fields/Blocks/BlocksDrawer/BlockSearch/index.scss similarity index 93% rename from packages/ui/src/forms/fields/Blocks/BlocksDrawer/BlockSearch/index.scss rename to packages/ui/src/fields/Blocks/BlocksDrawer/BlockSearch/index.scss index 57677e09218..a84b72395e5 100644 --- a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/BlockSearch/index.scss +++ b/packages/ui/src/fields/Blocks/BlocksDrawer/BlockSearch/index.scss @@ -1,4 +1,4 @@ -@import '../../../../../scss/styles.scss'; +@import '../../../../scss/styles.scss'; $icon-width: base(1); $icon-margin: base(0.25); diff --git a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/BlockSearch/index.tsx b/packages/ui/src/fields/Blocks/BlocksDrawer/BlockSearch/index.tsx similarity index 63% rename from packages/ui/src/forms/fields/Blocks/BlocksDrawer/BlockSearch/index.tsx rename to packages/ui/src/fields/Blocks/BlocksDrawer/BlockSearch/index.tsx index 9a9e365a8a8..4a5c75df578 100644 --- a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/BlockSearch/index.tsx +++ b/packages/ui/src/fields/Blocks/BlocksDrawer/BlockSearch/index.tsx @@ -1,12 +1,12 @@ import React from 'react' -import SearchIcon from '../../../../../graphics/Search/index.js' -import { useTranslation } from '../../../../../providers/Translation/index.js' +import SearchIcon from '../../../../graphics/Search/index.js' +import { useTranslation } from '../../../../providers/Translation/index.js' import './index.scss' const baseClass = 'block-search' -const BlockSearch: React.FC<{ setSearchTerm: (term: string) => void }> = (props) => { +export const BlockSearch: React.FC<{ setSearchTerm: (term: string) => void }> = (props) => { const { setSearchTerm } = props const { t } = useTranslation() @@ -25,5 +25,3 @@ const BlockSearch: React.FC<{ setSearchTerm: (term: string) => void }> = (props) </div> ) } - -export default BlockSearch diff --git a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/index.scss b/packages/ui/src/fields/Blocks/BlocksDrawer/index.scss similarity index 95% rename from packages/ui/src/forms/fields/Blocks/BlocksDrawer/index.scss rename to packages/ui/src/fields/Blocks/BlocksDrawer/index.scss index 9ad0d305854..a07728e8ed5 100644 --- a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/index.scss +++ b/packages/ui/src/fields/Blocks/BlocksDrawer/index.scss @@ -1,4 +1,4 @@ -@import '../../../../scss/styles.scss'; +@import '../../../scss/styles.scss'; .blocks-drawer { &__blocks-wrapper { diff --git a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/index.tsx b/packages/ui/src/fields/Blocks/BlocksDrawer/index.tsx similarity index 81% rename from packages/ui/src/forms/fields/Blocks/BlocksDrawer/index.tsx rename to packages/ui/src/fields/Blocks/BlocksDrawer/index.tsx index 4165061cd6a..6597665a82a 100644 --- a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/index.tsx +++ b/packages/ui/src/fields/Blocks/BlocksDrawer/index.tsx @@ -1,20 +1,28 @@ 'use client' import type { I18n } from '@payloadcms/translations' +import type { Labels } from 'payload/types' import * as facelessUIImport from '@faceless-ui/modal' import { getTranslation } from '@payloadcms/translations' import React, { useEffect, useState } from 'react' -import type { ReducedBlock } from '../../../../utilities/buildComponentMap/types.js' -import type { Props } from './types.js' +import type { ReducedBlock } from '../../../utilities/buildComponentMap/types.js' -import { Drawer } from '../../../../elements/Drawer/index.js' -import { ThumbnailCard } from '../../../../elements/ThumbnailCard/index.js' -import DefaultBlockImage from '../../../../graphics/DefaultBlockImage/index.js' -import { useTranslation } from '../../../../providers/Translation/index.js' -import BlockSearch from './BlockSearch/index.js' +import { Drawer } from '../../../elements/Drawer/index.js' +import { ThumbnailCard } from '../../../elements/ThumbnailCard/index.js' +import DefaultBlockImage from '../../../graphics/DefaultBlockImage/index.js' +import { useTranslation } from '../../../providers/Translation/index.js' +import { BlockSearch } from './BlockSearch/index.js' import './index.scss' +export type Props = { + addRow: (index: number, blockType?: string) => void + addRowIndex: number + blocks: ReducedBlock[] + drawerSlug: string + labels: Labels +} + const baseClass = 'blocks-drawer' const getBlockLabel = (block: ReducedBlock, i18n: I18n) => { diff --git a/packages/ui/src/forms/fields/Blocks/RowActions.tsx b/packages/ui/src/fields/Blocks/RowActions.tsx similarity index 87% rename from packages/ui/src/forms/fields/Blocks/RowActions.tsx rename to packages/ui/src/fields/Blocks/RowActions.tsx index 9b1516b5e40..6f703e7f0fd 100644 --- a/packages/ui/src/forms/fields/Blocks/RowActions.tsx +++ b/packages/ui/src/fields/Blocks/RowActions.tsx @@ -4,10 +4,10 @@ import type { Labels } from 'payload/types' import * as facelessUIImport from '@faceless-ui/modal' import React from 'react' -import type { FieldMap, ReducedBlock } from '../../../utilities/buildComponentMap/types.js' +import type { FieldMap, ReducedBlock } from '../../utilities/buildComponentMap/types.js' -import { ArrayAction } from '../../../elements/ArrayAction/index.js' -import { useDrawerSlug } from '../../../elements/Drawer/useDrawerSlug.js' +import { ArrayAction } from '../../elements/ArrayAction/index.js' +import { useDrawerSlug } from '../../elements/Drawer/useDrawerSlug.js' import { BlocksDrawer } from './BlocksDrawer/index.js' export const RowActions: React.FC<{ diff --git a/packages/ui/src/forms/fields/Blocks/SectionTitle/index.scss b/packages/ui/src/fields/Blocks/SectionTitle/index.scss similarity index 95% rename from packages/ui/src/forms/fields/Blocks/SectionTitle/index.scss rename to packages/ui/src/fields/Blocks/SectionTitle/index.scss index fc6d50aa94e..d9b87e4243b 100644 --- a/packages/ui/src/forms/fields/Blocks/SectionTitle/index.scss +++ b/packages/ui/src/fields/Blocks/SectionTitle/index.scss @@ -1,4 +1,4 @@ -@import '../../../../scss/styles.scss'; +@import '../../../scss/styles.scss'; .section-title { position: relative; diff --git a/packages/ui/src/forms/fields/Blocks/SectionTitle/index.tsx b/packages/ui/src/fields/Blocks/SectionTitle/index.tsx similarity index 74% rename from packages/ui/src/forms/fields/Blocks/SectionTitle/index.tsx rename to packages/ui/src/fields/Blocks/SectionTitle/index.tsx index 9b1ba85ce4b..423b0483375 100644 --- a/packages/ui/src/forms/fields/Blocks/SectionTitle/index.tsx +++ b/packages/ui/src/fields/Blocks/SectionTitle/index.tsx @@ -1,18 +1,23 @@ import React from 'react' -import type { Props } from './types.js' - -import { useTranslation } from '../../../../providers/Translation/index.js' -import { useField } from '../../../useField/index.js' +import { useField } from '../../../forms/useField/index.js' +import { useTranslation } from '../../../providers/Translation/index.js' import './index.scss' const baseClass = 'section-title' +export type Props = { + customOnChange?: (e: React.ChangeEvent<HTMLInputElement>) => void + customValue?: string + path: string + readOnly: boolean +} + /** * An input field representing the block's `blockName` property - responsible for reading and saving the `blockName` * property from/into the provided path. */ -const SectionTitle: React.FC<Props> = (props) => { +export const SectionTitle: React.FC<Props> = (props) => { const { customOnChange, customValue, path, readOnly } = props const { setValue, value } = useField({ path }) @@ -43,5 +48,3 @@ const SectionTitle: React.FC<Props> = (props) => { </div> ) } - -export default SectionTitle diff --git a/packages/ui/src/forms/fields/Blocks/index.scss b/packages/ui/src/fields/Blocks/index.scss similarity index 98% rename from packages/ui/src/forms/fields/Blocks/index.scss rename to packages/ui/src/fields/Blocks/index.scss index a09be9224d6..df0b1895beb 100644 --- a/packages/ui/src/forms/fields/Blocks/index.scss +++ b/packages/ui/src/fields/Blocks/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .blocks-field { display: flex; diff --git a/packages/ui/src/forms/fields/Blocks/index.tsx b/packages/ui/src/fields/Blocks/index.tsx similarity index 83% rename from packages/ui/src/forms/fields/Blocks/index.tsx rename to packages/ui/src/fields/Blocks/index.tsx index 6df4d04a4a4..2277bc10e38 100644 --- a/packages/ui/src/forms/fields/Blocks/index.tsx +++ b/packages/ui/src/fields/Blocks/index.tsx @@ -2,24 +2,22 @@ import { getTranslation } from '@payloadcms/translations' import React, { Fragment, useCallback } from 'react' -import type { BlocksFieldProps } from './types.js' - -import Banner from '../../../elements/Banner/index.js' -import { Button } from '../../../elements/Button/index.js' -import DraggableSortableItem from '../../../elements/DraggableSortable/DraggableSortableItem/index.js' -import DraggableSortable from '../../../elements/DraggableSortable/index.js' -import { DrawerToggler } from '../../../elements/Drawer/index.js' -import { useDrawerSlug } from '../../../elements/Drawer/useDrawerSlug.js' -import { ErrorPill } from '../../../elements/ErrorPill/index.js' -import { useConfig } from '../../../providers/Config/index.js' -import { useDocumentInfo } from '../../../providers/DocumentInfo/index.js' -import { useLocale } from '../../../providers/Locale/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import { scrollToID } from '../../../utilities/scrollToID.js' -import { useForm, useFormSubmitted } from '../../Form/context.js' -import LabelComp from '../../Label/index.js' -import { NullifyLocaleField } from '../../NullifyField/index.js' -import { useField } from '../../useField/index.js' +import Banner from '../../elements/Banner/index.js' +import { Button } from '../../elements/Button/index.js' +import DraggableSortableItem from '../../elements/DraggableSortable/DraggableSortableItem/index.js' +import DraggableSortable from '../../elements/DraggableSortable/index.js' +import { DrawerToggler } from '../../elements/Drawer/index.js' +import { useDrawerSlug } from '../../elements/Drawer/useDrawerSlug.js' +import { ErrorPill } from '../../elements/ErrorPill/index.js' +import { useForm, useFormSubmitted } from '../../forms/Form/context.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { NullifyLocaleField } from '../../forms/NullifyField/index.js' +import { useField } from '../../forms/useField/index.js' +import { useConfig } from '../../providers/Config/index.js' +import { useDocumentInfo } from '../../providers/DocumentInfo/index.js' +import { useLocale } from '../../providers/Locale/index.js' +import { useTranslation } from '../../providers/Translation/index.js' +import { scrollToID } from '../../utilities/scrollToID.js' import { fieldBaseClass } from '../shared.js' import { BlockRow } from './BlockRow.js' import { BlocksDrawer } from './BlocksDrawer/index.js' @@ -27,7 +25,28 @@ import './index.scss' const baseClass = 'blocks-field' -const BlocksField: React.FC<BlocksFieldProps> = (props) => { +import type { FieldPermissions } from 'payload/auth' +import type { BlockField, FieldBase } from 'payload/types' + +import type { FieldMap, ReducedBlock } from '../../utilities/buildComponentMap/types.js' +import type { FormFieldBase } from '../shared.js' + +export type BlocksFieldProps = FormFieldBase & { + blocks?: ReducedBlock[] + fieldMap: FieldMap + forceRender?: boolean + indexPath: string + label?: FieldBase['label'] + labels?: BlockField['labels'] + maxRows?: number + minRows?: number + name?: string + permissions: FieldPermissions + slug?: string + width?: string +} + +export const BlocksField: React.FC<BlocksFieldProps> = (props) => { const { i18n, t } = useTranslation() const { @@ -311,5 +330,3 @@ const BlocksField: React.FC<BlocksFieldProps> = (props) => { </div> ) } - -export default BlocksField diff --git a/packages/ui/src/forms/fields/Checkbox/Input.tsx b/packages/ui/src/fields/Checkbox/Input.tsx similarity index 93% rename from packages/ui/src/forms/fields/Checkbox/Input.tsx rename to packages/ui/src/fields/Checkbox/Input.tsx index 143cfcdc40f..ed79fb4b71f 100644 --- a/packages/ui/src/forms/fields/Checkbox/Input.tsx +++ b/packages/ui/src/fields/Checkbox/Input.tsx @@ -1,8 +1,8 @@ 'use client' import React from 'react' -import { Check } from '../../../icons/Check/index.js' -import { Line } from '../../../icons/Line/index.js' +import { Check } from '../../icons/Check/index.js' +import { Line } from '../../icons/Line/index.js' type Props = { AfterInput?: React.ReactNode diff --git a/packages/ui/src/forms/fields/Checkbox/index.scss b/packages/ui/src/fields/Checkbox/index.scss similarity index 98% rename from packages/ui/src/forms/fields/Checkbox/index.scss rename to packages/ui/src/fields/Checkbox/index.scss index 783b83a9391..253a001b9c2 100644 --- a/packages/ui/src/forms/fields/Checkbox/index.scss +++ b/packages/ui/src/fields/Checkbox/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .checkbox { position: relative; diff --git a/packages/ui/src/forms/fields/Checkbox/index.tsx b/packages/ui/src/fields/Checkbox/index.tsx similarity index 82% rename from packages/ui/src/forms/fields/Checkbox/index.tsx rename to packages/ui/src/fields/Checkbox/index.tsx index 5f998604bf6..f0afb1e5974 100644 --- a/packages/ui/src/forms/fields/Checkbox/index.tsx +++ b/packages/ui/src/fields/Checkbox/index.tsx @@ -5,18 +5,20 @@ import React, { useCallback } from 'react' import type { CheckboxFieldProps } from './types.js' -import { generateFieldID } from '../../../utilities/generateFieldID.js' -import { useForm } from '../../Form/context.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { useForm } from '../../forms/Form/context.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { generateFieldID } from '../../utilities/generateFieldID.js' import { fieldBaseClass } from '../shared.js' import { CheckboxInput } from './Input.js' import './index.scss' const baseClass = 'checkbox' -const Checkbox: React.FC<CheckboxFieldProps> = (props) => { +export { CheckboxFieldProps, CheckboxInput } + +const CheckboxField: React.FC<CheckboxFieldProps> = (props) => { const { id, name, @@ -105,4 +107,4 @@ const Checkbox: React.FC<CheckboxFieldProps> = (props) => { ) } -export default withCondition(Checkbox) +export const Checkbox = withCondition(CheckboxField) diff --git a/packages/ui/src/forms/fields/Checkbox/types.ts b/packages/ui/src/fields/Checkbox/types.ts similarity index 100% rename from packages/ui/src/forms/fields/Checkbox/types.ts rename to packages/ui/src/fields/Checkbox/types.ts diff --git a/packages/ui/src/forms/fields/Code/index.scss b/packages/ui/src/fields/Code/index.scss similarity index 93% rename from packages/ui/src/forms/fields/Code/index.scss rename to packages/ui/src/fields/Code/index.scss index a6f4abcb205..853a6c8f19d 100644 --- a/packages/ui/src/forms/fields/Code/index.scss +++ b/packages/ui/src/fields/Code/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .code-field { position: relative; diff --git a/packages/ui/src/forms/fields/Code/index.tsx b/packages/ui/src/fields/Code/index.tsx similarity index 68% rename from packages/ui/src/forms/fields/Code/index.tsx rename to packages/ui/src/fields/Code/index.tsx index 1d47341c22a..11543441a6f 100644 --- a/packages/ui/src/forms/fields/Code/index.tsx +++ b/packages/ui/src/fields/Code/index.tsx @@ -1,16 +1,27 @@ /* eslint-disable react/destructuring-assignment */ 'use client' +import type { CodeField as CodeFieldType, FieldBase } from 'payload/types' + import React, { useCallback } from 'react' -import type { CodeFieldProps } from './types.js' +import type { FormFieldBase } from '../shared.js' -import { CodeEditor } from '../../../elements/CodeEditor/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { CodeEditor } from '../../elements/CodeEditor/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' +export type CodeFieldProps = FormFieldBase & { + editorOptions?: CodeFieldType['admin']['editorOptions'] + label?: FieldBase['label'] + language?: CodeFieldType['admin']['language'] + name?: string + path?: string + width: string +} + const prismToMonacoLanguageMap = { js: 'javascript', ts: 'typescript', @@ -18,7 +29,7 @@ const prismToMonacoLanguageMap = { const baseClass = 'code-field' -const Code: React.FC<CodeFieldProps> = (props) => { +const CodeField: React.FC<CodeFieldProps> = (props) => { const { name, AfterInput, @@ -49,7 +60,7 @@ const Code: React.FC<CodeFieldProps> = (props) => { [validate, required], ) - const { path, setValue, showError, value } = useField({ + const { setValue, showError, value } = useField({ path: pathFromProps || name, validate: memoizedValidate, }) @@ -88,4 +99,4 @@ const Code: React.FC<CodeFieldProps> = (props) => { ) } -export default withCondition(Code) +export const Code = withCondition(CodeField) diff --git a/packages/ui/src/forms/fields/Collapsible/index.scss b/packages/ui/src/fields/Collapsible/index.scss similarity index 84% rename from packages/ui/src/forms/fields/Collapsible/index.scss rename to packages/ui/src/fields/Collapsible/index.scss index 49882b69c3f..3bfa1068018 100644 --- a/packages/ui/src/forms/fields/Collapsible/index.scss +++ b/packages/ui/src/fields/Collapsible/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .collapsible-field { &__row-label-wrap { diff --git a/packages/ui/src/forms/fields/Collapsible/index.tsx b/packages/ui/src/fields/Collapsible/index.tsx similarity index 76% rename from packages/ui/src/forms/fields/Collapsible/index.tsx rename to packages/ui/src/fields/Collapsible/index.tsx index 8a354092768..5f66e31fbe9 100644 --- a/packages/ui/src/forms/fields/Collapsible/index.tsx +++ b/packages/ui/src/fields/Collapsible/index.tsx @@ -4,23 +4,36 @@ import type { DocumentPreferences } from 'payload/types' import React, { Fragment, useCallback, useEffect, useState } from 'react' -import type { CollapsibleFieldProps } from './types.js' - -import { Collapsible } from '../../../elements/Collapsible/index.js' -import { ErrorPill } from '../../../elements/ErrorPill/index.js' -import { useDocumentInfo } from '../../../providers/DocumentInfo/index.js' -import { usePreferences } from '../../../providers/Preferences/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import { useFieldProps } from '../../FieldPropsProvider/index.js' -import LabelComp from '../../Label/index.js' -import { RenderFields } from '../../RenderFields/index.js' -import { WatchChildErrors } from '../../WatchChildErrors/index.js' -import { withCondition } from '../../withCondition/index.js' +import { Collapsible as CollapsibleElement } from '../../elements/Collapsible/index.js' +import { ErrorPill } from '../../elements/ErrorPill/index.js' +import { useFieldProps } from '../../forms/FieldPropsProvider/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { RenderFields } from '../../forms/RenderFields/index.js' +import { WatchChildErrors } from '../../forms/WatchChildErrors/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useDocumentInfo } from '../../providers/DocumentInfo/index.js' +import { usePreferences } from '../../providers/Preferences/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' const baseClass = 'collapsible-field' +import type { FieldPermissions } from 'payload/auth' +import type { FieldBase } from 'payload/types' + +import type { FieldMap } from '../../utilities/buildComponentMap/types.js' +import type { FormFieldBase } from '../shared.js' + +export type CollapsibleFieldProps = FormFieldBase & { + fieldMap: FieldMap + indexPath: string + initCollapsed?: boolean + label?: FieldBase['label'] + permissions: FieldPermissions + width?: string +} + const CollapsibleField: React.FC<CollapsibleFieldProps> = (props) => { const { Description, @@ -108,7 +121,7 @@ const CollapsibleField: React.FC<CollapsibleFieldProps> = (props) => { .join(' ')} id={`field-${fieldPreferencesKey}${path ? `-${path.replace(/\./g, '__')}` : ''}`} > - <Collapsible + <CollapsibleElement className={`${baseClass}__collapsible`} collapsibleStyle={fieldHasErrors ? 'error' : 'default'} header={ @@ -129,11 +142,11 @@ const CollapsibleField: React.FC<CollapsibleFieldProps> = (props) => { readOnly={readOnly} schemaPath={schemaPath} /> - </Collapsible> + </CollapsibleElement> {Description} </div> </Fragment> ) } -export default withCondition(CollapsibleField) +export const Collapsible = withCondition(CollapsibleField) diff --git a/packages/ui/src/forms/fields/ConfirmPassword/index.scss b/packages/ui/src/fields/ConfirmPassword/index.scss similarity index 91% rename from packages/ui/src/forms/fields/ConfirmPassword/index.scss rename to packages/ui/src/fields/ConfirmPassword/index.scss index 12eb4481d04..2db4d78a664 100644 --- a/packages/ui/src/forms/fields/ConfirmPassword/index.scss +++ b/packages/ui/src/fields/ConfirmPassword/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.confirm-password { position: relative; diff --git a/packages/ui/src/forms/fields/ConfirmPassword/index.tsx b/packages/ui/src/fields/ConfirmPassword/index.tsx similarity index 69% rename from packages/ui/src/forms/fields/ConfirmPassword/index.tsx rename to packages/ui/src/fields/ConfirmPassword/index.tsx index 60b42a99953..750c59abf0d 100644 --- a/packages/ui/src/forms/fields/ConfirmPassword/index.tsx +++ b/packages/ui/src/fields/ConfirmPassword/index.tsx @@ -3,21 +3,23 @@ import type { FormField } from 'payload/types' import React, { useCallback } from 'react' -import type { ConfirmPasswordFieldProps } from './types.js' - -import { useTranslation } from '../../../providers/Translation/index.js' -import Error from '../../Error/index.js' -import { useFormFields } from '../../Form/context.js' -import Label from '../../Label/index.js' -import { useField } from '../../useField/index.js' +import { Error } from '../../forms/Error/index.js' +import { useFormFields } from '../../forms/Form/context.js' +import { Label } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' -const ConfirmPassword: React.FC<ConfirmPasswordFieldProps> = (props) => { +export type ConfirmPasswordFieldProps = { + disabled?: boolean +} + +export const ConfirmPassword: React.FC<ConfirmPasswordFieldProps> = (props) => { const { disabled } = props const password = useFormFields<FormField>(([fields]) => fields.password) - const { i18n, t } = useTranslation() + const { t } = useTranslation() const validate = useCallback( (value: string) => { @@ -36,7 +38,7 @@ const ConfirmPassword: React.FC<ConfirmPasswordFieldProps> = (props) => { const path = 'confirm-password' - const { errorMessage, setValue, showError, value } = useField({ + const { setValue, showError, value } = useField({ disableFormData: true, path, validate, @@ -66,5 +68,3 @@ const ConfirmPassword: React.FC<ConfirmPasswordFieldProps> = (props) => { </div> ) } - -export default ConfirmPassword diff --git a/packages/ui/src/forms/fields/DateTime/index.scss b/packages/ui/src/fields/DateTime/index.scss similarity index 100% rename from packages/ui/src/forms/fields/DateTime/index.scss rename to packages/ui/src/fields/DateTime/index.scss diff --git a/packages/ui/src/forms/fields/DateTime/index.tsx b/packages/ui/src/fields/DateTime/index.tsx similarity index 71% rename from packages/ui/src/forms/fields/DateTime/index.tsx rename to packages/ui/src/fields/DateTime/index.tsx index cb96ca352dd..8fb27c5ebad 100644 --- a/packages/ui/src/forms/fields/DateTime/index.tsx +++ b/packages/ui/src/fields/DateTime/index.tsx @@ -5,18 +5,31 @@ import type { ClientValidate } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React, { useCallback } from 'react' -import type { DateFieldProps } from './types.js' - -import { DatePickerField } from '../../../elements/DatePicker/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' +import { DatePickerField } from '../../elements/DatePicker/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' const baseClass = 'date-time-field' -const DateTime: React.FC<DateFieldProps> = (props) => { +import type { DateField, FieldBase } from 'payload/types' + +import type { FormFieldBase } from '../shared.js' + +import { withCondition } from '../../forms/withCondition/index.js' + +export type DateFieldProps = FormFieldBase & { + date?: DateField['admin']['date'] + label?: FieldBase['label'] + name?: string + path?: string + placeholder?: DateField['admin']['placeholder'] | string + width?: string +} + +const DateTimeField: React.FC<DateFieldProps> = (props) => { const { name, AfterInput, @@ -90,4 +103,4 @@ const DateTime: React.FC<DateFieldProps> = (props) => { ) } -export default DateTime +export const DateTime = withCondition(DateTimeField) diff --git a/packages/ui/src/forms/fields/Email/index.scss b/packages/ui/src/fields/Email/index.scss similarity index 92% rename from packages/ui/src/forms/fields/Email/index.scss rename to packages/ui/src/fields/Email/index.scss index b776059bf8e..a44a200240d 100644 --- a/packages/ui/src/forms/fields/Email/index.scss +++ b/packages/ui/src/fields/Email/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.email { position: relative; diff --git a/packages/ui/src/forms/fields/Email/index.tsx b/packages/ui/src/fields/Email/index.tsx similarity index 70% rename from packages/ui/src/forms/fields/Email/index.tsx rename to packages/ui/src/fields/Email/index.tsx index 573f3c39cca..af26f74d841 100644 --- a/packages/ui/src/forms/fields/Email/index.tsx +++ b/packages/ui/src/fields/Email/index.tsx @@ -1,19 +1,29 @@ 'use client' import type { ClientValidate } from 'payload/types' +import type { EmailField as EmailFieldType, FieldBase } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React, { useCallback } from 'react' -import type { EmailFieldProps } from './types.js' +import type { FormFieldBase } from '../shared.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' -export const Email: React.FC<EmailFieldProps> = (props) => { +export type EmailFieldProps = FormFieldBase & { + autoComplete?: string + label?: FieldBase['label'] + name?: string + path?: string + placeholder?: EmailFieldType['admin']['placeholder'] + width?: string +} + +const EmailField: React.FC<EmailFieldProps> = (props) => { const { name, AfterInput, @@ -82,4 +92,4 @@ export const Email: React.FC<EmailFieldProps> = (props) => { ) } -export default withCondition(Email) +export const Email = withCondition(EmailField) diff --git a/packages/ui/src/forms/fields/Group/index.scss b/packages/ui/src/fields/Group/index.scss similarity index 98% rename from packages/ui/src/forms/fields/Group/index.scss rename to packages/ui/src/fields/Group/index.scss index 155ed8cb6ba..635c505f974 100644 --- a/packages/ui/src/forms/fields/Group/index.scss +++ b/packages/ui/src/fields/Group/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .group-field { margin-left: calc(var(--gutter-h) * -1); diff --git a/packages/ui/src/forms/fields/Group/index.tsx b/packages/ui/src/fields/Group/index.tsx similarity index 68% rename from packages/ui/src/forms/fields/Group/index.tsx rename to packages/ui/src/fields/Group/index.tsx index f843fd03de4..dcf81d3f509 100644 --- a/packages/ui/src/forms/fields/Group/index.tsx +++ b/packages/ui/src/fields/Group/index.tsx @@ -1,16 +1,20 @@ 'use client' +import type { FieldPermissions } from 'payload/auth' +import type { FieldBase } from 'payload/types' + import React, { Fragment } from 'react' -import type { GroupFieldProps } from './types.js' +import type { FieldMap } from '../../utilities/buildComponentMap/types.js' +import type { FormFieldBase } from '../shared.js' -import { useCollapsible } from '../../../elements/Collapsible/provider.js' -import { ErrorPill } from '../../../elements/ErrorPill/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import { useFieldProps } from '../../FieldPropsProvider/index.js' -import LabelComp from '../../Label/index.js' -import { RenderFields } from '../../RenderFields/index.js' -import { WatchChildErrors } from '../../WatchChildErrors/index.js' -import { withCondition } from '../../withCondition/index.js' +import { useCollapsible } from '../../elements/Collapsible/provider.js' +import { ErrorPill } from '../../elements/ErrorPill/index.js' +import { useFieldProps } from '../../forms/FieldPropsProvider/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { RenderFields } from '../../forms/RenderFields/index.js' +import { WatchChildErrors } from '../../forms/WatchChildErrors/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { useRow } from '../Row/provider.js' import { useTabs } from '../Tabs/provider.js' import { fieldBaseClass } from '../shared.js' @@ -19,7 +23,18 @@ import { GroupProvider, useGroup } from './provider.js' const baseClass = 'group-field' -const Group: React.FC<GroupFieldProps> = (props) => { +export type GroupFieldProps = FormFieldBase & { + fieldMap: FieldMap + forceRender?: boolean + hideGutter?: boolean + indexPath: string + label?: FieldBase['label'] + name?: string + permissions: FieldPermissions + width?: string +} + +const GroupField: React.FC<GroupFieldProps> = (props) => { const { Description, Label: LabelFromProps, @@ -94,4 +109,6 @@ const Group: React.FC<GroupFieldProps> = (props) => { ) } -export default withCondition(Group) +export { GroupProvider, useGroup } + +export const Group = withCondition(GroupField) diff --git a/packages/ui/src/forms/fields/Group/provider.tsx b/packages/ui/src/fields/Group/provider.tsx similarity index 51% rename from packages/ui/src/forms/fields/Group/provider.tsx rename to packages/ui/src/fields/Group/provider.tsx index cf51812d7dc..fa13d20387a 100644 --- a/packages/ui/src/forms/fields/Group/provider.tsx +++ b/packages/ui/src/fields/Group/provider.tsx @@ -1,15 +1,13 @@ 'use client' import React, { createContext, useContext } from 'react' -const Context = createContext(false) +export const GroupContext = createContext(false) export const GroupProvider: React.FC<{ children?: React.ReactNode; withinGroup?: boolean }> = ({ children, withinGroup = true, }) => { - return <Context.Provider value={withinGroup}>{children}</Context.Provider> + return <GroupContext.Provider value={withinGroup}>{children}</GroupContext.Provider> } -export const useGroup = (): boolean => useContext(Context) - -export default Context +export const useGroup = (): boolean => useContext(GroupContext) diff --git a/packages/ui/src/forms/fields/HiddenInput/index.tsx b/packages/ui/src/fields/HiddenInput/index.tsx similarity index 67% rename from packages/ui/src/forms/fields/HiddenInput/index.tsx rename to packages/ui/src/fields/HiddenInput/index.tsx index b76a4b49a89..d8632d3b5fb 100644 --- a/packages/ui/src/forms/fields/HiddenInput/index.tsx +++ b/packages/ui/src/fields/HiddenInput/index.tsx @@ -1,16 +1,21 @@ 'use client' import React, { useEffect } from 'react' -import type { HiddenInputFieldProps } from './types.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +export type HiddenInputFieldProps = { + disableModifyingForm?: false + name: string + path?: string + value?: unknown +} /** * This is mainly used to save a value on the form that is not visible to the user. * For example, this sets the `ìd` property of a block in the Blocks field. */ -const HiddenInput: React.FC<HiddenInputFieldProps> = (props) => { +const HiddenInputField: React.FC<HiddenInputFieldProps> = (props) => { const { name, disableModifyingForm = true, path: pathFromProps, value: valueFromProps } = props const { path, setValue, value } = useField({ @@ -34,4 +39,4 @@ const HiddenInput: React.FC<HiddenInputFieldProps> = (props) => { ) } -export default withCondition(HiddenInput) +export const HiddenInput = withCondition(HiddenInputField) diff --git a/packages/ui/src/forms/fields/JSON/index.scss b/packages/ui/src/fields/JSON/index.scss similarity index 93% rename from packages/ui/src/forms/fields/JSON/index.scss rename to packages/ui/src/fields/JSON/index.scss index 41420aad4b4..849c92d3f50 100644 --- a/packages/ui/src/forms/fields/JSON/index.scss +++ b/packages/ui/src/fields/JSON/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .json-field { position: relative; diff --git a/packages/ui/src/forms/fields/JSON/index.tsx b/packages/ui/src/fields/JSON/index.tsx similarity index 77% rename from packages/ui/src/forms/fields/JSON/index.tsx rename to packages/ui/src/fields/JSON/index.tsx index 8765e293661..6a486def609 100644 --- a/packages/ui/src/forms/fields/JSON/index.tsx +++ b/packages/ui/src/fields/JSON/index.tsx @@ -3,18 +3,28 @@ import type { ClientValidate } from 'payload/types' import React, { useCallback, useEffect, useState } from 'react' -import type { JSONFieldProps } from './types.js' - -import { CodeEditor } from '../../../elements/CodeEditor/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { CodeEditor } from '../../elements/CodeEditor/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' const baseClass = 'json-field' -const JSONField: React.FC<JSONFieldProps> = (props) => { +import type { FieldBase, JSONField as JSONFieldType } from 'payload/types' + +import type { FormFieldBase } from '../shared.js' + +export type JSONFieldProps = FormFieldBase & { + editorOptions?: JSONFieldType['admin']['editorOptions'] + label?: FieldBase['label'] + name?: string + path?: string + width?: string +} + +const JSONFieldComponent: React.FC<JSONFieldProps> = (props) => { const { name, AfterInput, @@ -116,4 +126,4 @@ const JSONField: React.FC<JSONFieldProps> = (props) => { ) } -export default withCondition(JSONField) +export const JSONField = withCondition(JSONFieldComponent) diff --git a/packages/ui/src/forms/fields/Number/index.scss b/packages/ui/src/fields/Number/index.scss similarity index 91% rename from packages/ui/src/forms/fields/Number/index.scss rename to packages/ui/src/fields/Number/index.scss index 7d100732343..ab294a5a1da 100644 --- a/packages/ui/src/forms/fields/Number/index.scss +++ b/packages/ui/src/fields/Number/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.number { position: relative; diff --git a/packages/ui/src/forms/fields/Number/index.tsx b/packages/ui/src/fields/Number/index.tsx similarity index 81% rename from packages/ui/src/forms/fields/Number/index.tsx rename to packages/ui/src/fields/Number/index.tsx index fa6ad3cbace..5f6cec18f91 100644 --- a/packages/ui/src/forms/fields/Number/index.tsx +++ b/packages/ui/src/fields/Number/index.tsx @@ -1,21 +1,37 @@ /* eslint-disable react/destructuring-assignment */ 'use client' +import type { FieldBase, NumberField as NumberFieldType } from 'payload/types' + import { getTranslation } from '@payloadcms/translations' import { isNumber } from 'payload/utilities' import React, { useCallback, useEffect, useState } from 'react' -import type { Option } from '../../../elements/ReactSelect/types.js' -import type { NumberFieldProps } from './types.js' +import type { Option } from '../../elements/ReactSelect/types.js' +import type { FormFieldBase } from '../shared.js' -import ReactSelect from '../../../elements/ReactSelect/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import ReactSelect from '../../elements/ReactSelect/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' -const NumberField: React.FC<NumberFieldProps> = (props) => { +export type NumberFieldProps = FormFieldBase & { + hasMany?: boolean + label?: FieldBase['label'] + max?: number + maxRows?: number + min?: number + name?: string + onChange?: (e: number) => void + path?: string + placeholder?: NumberFieldType['admin']['placeholder'] + step?: number + width?: string +} + +const NumberFieldComponent: React.FC<NumberFieldProps> = (props) => { const { name, AfterInput, @@ -108,7 +124,7 @@ const NumberField: React.FC<NumberFieldProps> = (props) => { label: `${val}`, value: { toString: () => `${val}${index}`, - value: (val as any)?.value || val, + value: (val as unknown as Record<string, number>)?.value || val, }, // You're probably wondering, why the hell is this done that way? Well, React-select automatically uses "label-value" as a key, so we will get that react duplicate key warning if we just pass in the value as multiple values can be the same. So we need to append the index to the toString() of the value to avoid that warning, as it uses that as the key. } }), @@ -139,7 +155,7 @@ const NumberField: React.FC<NumberFieldProps> = (props) => { <ReactSelect className={`field-${path.replace(/\./g, '__')}`} disabled={readOnly} - filterOption={(option, rawInput) => { + filterOption={(_, rawInput) => { // eslint-disable-next-line no-restricted-globals const isOverHasMany = Array.isArray(value) && value.length >= maxRows return isNumber(rawInput) && !isOverHasMany @@ -148,7 +164,7 @@ const NumberField: React.FC<NumberFieldProps> = (props) => { isCreatable isMulti isSortable - noOptionsMessage={({ inputValue }) => { + noOptionsMessage={() => { const isOverHasMany = Array.isArray(value) && value.length >= maxRows if (isOverHasMany) { return t('validation:limitReached', { max: maxRows, value: value.length + 1 }) @@ -190,4 +206,4 @@ const NumberField: React.FC<NumberFieldProps> = (props) => { ) } -export default withCondition(NumberField) +export const NumberField = withCondition(NumberFieldComponent) diff --git a/packages/ui/src/forms/fields/Password/index.scss b/packages/ui/src/fields/Password/index.scss similarity index 90% rename from packages/ui/src/forms/fields/Password/index.scss rename to packages/ui/src/fields/Password/index.scss index 37ecf30e04f..31f091b40aa 100644 --- a/packages/ui/src/forms/fields/Password/index.scss +++ b/packages/ui/src/fields/Password/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.password { position: relative; diff --git a/packages/ui/src/forms/fields/Password/index.tsx b/packages/ui/src/fields/Password/index.tsx similarity index 64% rename from packages/ui/src/forms/fields/Password/index.tsx rename to packages/ui/src/fields/Password/index.tsx index a1326005b8f..1fcb04b8bd2 100644 --- a/packages/ui/src/forms/fields/Password/index.tsx +++ b/packages/ui/src/fields/Password/index.tsx @@ -1,17 +1,31 @@ 'use client' -import type { ClientValidate } from 'payload/types' +import type { ClientValidate, Description, Validate } from 'payload/types' import React, { useCallback } from 'react' -import type { PasswordFieldProps } from './types.js' +import type { FormFieldBase } from '../shared.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' -export const Password: React.FC<PasswordFieldProps> = (props) => { +export type PasswordFieldProps = FormFieldBase & { + autoComplete?: string + className?: string + description?: Description + disabled?: boolean + label?: string + name: string + path?: string + required?: boolean + style?: React.CSSProperties + validate?: Validate + width?: string +} + +export const PasswordField: React.FC<PasswordFieldProps> = (props) => { const { name, Error, @@ -68,4 +82,4 @@ export const Password: React.FC<PasswordFieldProps> = (props) => { ) } -export default withCondition(Password) +export const Password = withCondition(PasswordField) diff --git a/packages/ui/src/forms/fields/Point/index.scss b/packages/ui/src/fields/Point/index.scss similarity index 93% rename from packages/ui/src/forms/fields/Point/index.scss rename to packages/ui/src/fields/Point/index.scss index ef11e624c0e..525db4630a9 100644 --- a/packages/ui/src/forms/fields/Point/index.scss +++ b/packages/ui/src/fields/Point/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .point { position: relative; diff --git a/packages/ui/src/forms/fields/Point/index.tsx b/packages/ui/src/fields/Point/index.tsx similarity index 83% rename from packages/ui/src/forms/fields/Point/index.tsx rename to packages/ui/src/fields/Point/index.tsx index d70d4ba8789..20ddf40f0be 100644 --- a/packages/ui/src/forms/fields/Point/index.tsx +++ b/packages/ui/src/fields/Point/index.tsx @@ -1,21 +1,30 @@ /* eslint-disable react/destructuring-assignment */ 'use client' -import type { ClientValidate } from 'payload/types' +import type { ClientValidate, FieldBase } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React, { useCallback } from 'react' -import type { PointFieldProps } from './types.js' - -import { useTranslation } from '../../../providers/Translation/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' const baseClass = 'point' +import type { FormFieldBase } from '../shared.js' + +export type PointFieldProps = FormFieldBase & { + label?: FieldBase['label'] + name?: string + path?: string + placeholder?: string + step?: number + width?: string +} + const PointField: React.FC<PointFieldProps> = (props) => { const { name, @@ -130,4 +139,4 @@ const PointField: React.FC<PointFieldProps> = (props) => { ) } -export default withCondition(PointField) +export const Point = withCondition(PointField) diff --git a/packages/ui/src/forms/fields/RadioGroup/Radio/index.scss b/packages/ui/src/fields/RadioGroup/Radio/index.scss similarity index 97% rename from packages/ui/src/forms/fields/RadioGroup/Radio/index.scss rename to packages/ui/src/fields/RadioGroup/Radio/index.scss index 0dc543372d7..c43f3ba6fbf 100644 --- a/packages/ui/src/forms/fields/RadioGroup/Radio/index.scss +++ b/packages/ui/src/fields/RadioGroup/Radio/index.scss @@ -1,4 +1,4 @@ -@import '../../../../scss/styles'; +@import '../../../scss/styles.scss'; .radio-input { display: flex; diff --git a/packages/ui/src/forms/fields/RadioGroup/Radio/index.tsx b/packages/ui/src/fields/RadioGroup/Radio/index.tsx similarity index 89% rename from packages/ui/src/forms/fields/RadioGroup/Radio/index.tsx rename to packages/ui/src/fields/RadioGroup/Radio/index.tsx index 353f3108c41..f3c2e806e26 100644 --- a/packages/ui/src/forms/fields/RadioGroup/Radio/index.tsx +++ b/packages/ui/src/fields/RadioGroup/Radio/index.tsx @@ -4,9 +4,9 @@ import type { OptionObject } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React from 'react' -import type { OnChange } from '../types.js' +import type { OnChange } from '../index.js' -import { useTranslation } from '../../../../providers/Translation/index.js' +import { useTranslation } from '../../../providers/Translation/index.js' import './index.scss' const baseClass = 'radio-input' diff --git a/packages/ui/src/forms/fields/RadioGroup/index.scss b/packages/ui/src/fields/RadioGroup/index.scss similarity index 94% rename from packages/ui/src/forms/fields/RadioGroup/index.scss rename to packages/ui/src/fields/RadioGroup/index.scss index 2ad8b6bfd55..dd16ae96860 100644 --- a/packages/ui/src/forms/fields/RadioGroup/index.scss +++ b/packages/ui/src/fields/RadioGroup/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .radio-group { &__error-wrap { diff --git a/packages/ui/src/forms/fields/RadioGroup/index.tsx b/packages/ui/src/fields/RadioGroup/index.tsx similarity index 78% rename from packages/ui/src/forms/fields/RadioGroup/index.tsx rename to packages/ui/src/fields/RadioGroup/index.tsx index a296461c014..f2d85645dd1 100644 --- a/packages/ui/src/forms/fields/RadioGroup/index.tsx +++ b/packages/ui/src/fields/RadioGroup/index.tsx @@ -1,22 +1,37 @@ /* eslint-disable react/destructuring-assignment */ /* eslint-disable react-hooks/exhaustive-deps */ 'use client' +import type { FieldBase, Option } from 'payload/types' + import { optionIsObject } from 'payload/types' import React, { useCallback } from 'react' -import type { RadioFieldProps } from './types.js' - -import { useForm } from '../../Form/context.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { useForm } from '../../forms/Form/context.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' import { fieldBaseClass } from '../shared.js' import { Radio } from './Radio/index.js' import './index.scss' const baseClass = 'radio-group' -const RadioGroup: React.FC<RadioFieldProps> = (props) => { +import type { FormFieldBase } from '../shared.js' + +export type RadioFieldProps = FormFieldBase & { + label?: FieldBase['label'] + layout?: 'horizontal' | 'vertical' + name?: string + onChange?: OnChange + options?: Option[] + path?: string + value?: string + width?: string +} + +export type OnChange<T = string> = (value: T) => void + +const RadioGroupField: React.FC<RadioFieldProps> = (props) => { const { name, Description, @@ -82,14 +97,11 @@ const RadioGroup: React.FC<RadioFieldProps> = (props) => { <ul className={`${baseClass}--group`} id={`field-${path.replace(/\./g, '__')}`}> {options.map((option) => { let optionValue = '' - let optionLabel: Record<string, string> | string = '' if (optionIsObject(option)) { optionValue = option.value - optionLabel = option.label } else { optionValue = option - optionLabel = option } const isSelected = String(optionValue) === String(value) @@ -123,4 +135,4 @@ const RadioGroup: React.FC<RadioFieldProps> = (props) => { ) } -export default withCondition(RadioGroup) +export const RadioGroup = withCondition(RadioGroupField) diff --git a/packages/ui/src/forms/fields/Relationship/AddNew/index.scss b/packages/ui/src/fields/Relationship/AddNew/index.scss similarity index 91% rename from packages/ui/src/forms/fields/Relationship/AddNew/index.scss rename to packages/ui/src/fields/Relationship/AddNew/index.scss index 3e122b00f2f..b95a53210a0 100644 --- a/packages/ui/src/forms/fields/Relationship/AddNew/index.scss +++ b/packages/ui/src/fields/Relationship/AddNew/index.scss @@ -1,4 +1,4 @@ -@import '../../../../scss/styles.scss'; +@import '../../../scss/styles.scss'; .relationship-add-new { display: flex; diff --git a/packages/ui/src/forms/fields/Relationship/AddNew/index.tsx b/packages/ui/src/fields/Relationship/AddNew/index.tsx similarity index 90% rename from packages/ui/src/forms/fields/Relationship/AddNew/index.tsx rename to packages/ui/src/fields/Relationship/AddNew/index.tsx index d10d49aa677..019972f2e01 100644 --- a/packages/ui/src/forms/fields/Relationship/AddNew/index.tsx +++ b/packages/ui/src/fields/Relationship/AddNew/index.tsx @@ -4,18 +4,18 @@ import type { SanitizedCollectionConfig } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React, { Fragment, useCallback, useEffect, useState } from 'react' -import type { DocumentInfoContext } from '../../../../providers/DocumentInfo/types.js' +import type { DocumentInfoContext } from '../../../providers/DocumentInfo/types.js' import type { Value } from '../types.js' import type { Props } from './types.js' -import { Button } from '../../../../elements/Button/index.js' -import { useDocumentDrawer } from '../../../../elements/DocumentDrawer/index.js' -import * as PopupList from '../../../../elements/Popup/PopupButtonList/index.js' -import Popup from '../../../../elements/Popup/index.js' -import { Tooltip } from '../../../../elements/Tooltip/index.js' -import { Plus } from '../../../../icons/Plus/index.js' -import { useAuth } from '../../../../providers/Auth/index.js' -import { useTranslation } from '../../../../providers/Translation/index.js' +import { Button } from '../../../elements/Button/index.js' +import { useDocumentDrawer } from '../../../elements/DocumentDrawer/index.js' +import * as PopupList from '../../../elements/Popup/PopupButtonList/index.js' +import Popup from '../../../elements/Popup/index.js' +import { Tooltip } from '../../../elements/Tooltip/index.js' +import { Plus } from '../../../icons/Plus/index.js' +import { useAuth } from '../../../providers/Auth/index.js' +import { useTranslation } from '../../../providers/Translation/index.js' import './index.scss' import { useRelatedCollections } from './useRelatedCollections.js' diff --git a/packages/ui/src/forms/fields/Relationship/AddNew/types.ts b/packages/ui/src/fields/Relationship/AddNew/types.ts similarity index 100% rename from packages/ui/src/forms/fields/Relationship/AddNew/types.ts rename to packages/ui/src/fields/Relationship/AddNew/types.ts diff --git a/packages/ui/src/forms/fields/Relationship/AddNew/useRelatedCollections.ts b/packages/ui/src/fields/Relationship/AddNew/useRelatedCollections.ts similarity index 78% rename from packages/ui/src/forms/fields/Relationship/AddNew/useRelatedCollections.ts rename to packages/ui/src/fields/Relationship/AddNew/useRelatedCollections.ts index aa88a2e2ea9..7479d819361 100644 --- a/packages/ui/src/forms/fields/Relationship/AddNew/useRelatedCollections.ts +++ b/packages/ui/src/fields/Relationship/AddNew/useRelatedCollections.ts @@ -1,8 +1,8 @@ -import type { ClientConfig, SanitizedCollectionConfig } from 'payload/types' +import type { ClientConfig } from 'payload/types' import { useState } from 'react' -import { useConfig } from '../../../../providers/Config/index.js' +import { useConfig } from '../../../providers/Config/index.js' export const useRelatedCollections = ( relationTo: string | string[], diff --git a/packages/ui/src/forms/fields/Relationship/createRelationMap.ts b/packages/ui/src/fields/Relationship/createRelationMap.ts similarity index 100% rename from packages/ui/src/forms/fields/Relationship/createRelationMap.ts rename to packages/ui/src/fields/Relationship/createRelationMap.ts diff --git a/packages/ui/src/forms/fields/Relationship/findOptionsByValue.ts b/packages/ui/src/fields/Relationship/findOptionsByValue.ts similarity index 94% rename from packages/ui/src/forms/fields/Relationship/findOptionsByValue.ts rename to packages/ui/src/fields/Relationship/findOptionsByValue.ts index aea9150cbe1..0e89628e7a9 100644 --- a/packages/ui/src/forms/fields/Relationship/findOptionsByValue.ts +++ b/packages/ui/src/fields/Relationship/findOptionsByValue.ts @@ -1,4 +1,4 @@ -import type { Option } from '../../../elements/ReactSelect/types.js' +import type { Option } from '../../elements/ReactSelect/types.js' import type { OptionGroup, Value } from './types.js' type Args = { diff --git a/packages/ui/src/forms/fields/Relationship/index.scss b/packages/ui/src/fields/Relationship/index.scss similarity index 95% rename from packages/ui/src/forms/fields/Relationship/index.scss rename to packages/ui/src/fields/Relationship/index.scss index 4118a9112f4..6ea0f375e07 100644 --- a/packages/ui/src/forms/fields/Relationship/index.scss +++ b/packages/ui/src/fields/Relationship/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.relationship { position: relative; diff --git a/packages/ui/src/forms/fields/Relationship/index.tsx b/packages/ui/src/fields/Relationship/index.tsx similarity index 94% rename from packages/ui/src/forms/fields/Relationship/index.tsx rename to packages/ui/src/fields/Relationship/index.tsx index ec0e0c59fb9..16e338ea80b 100644 --- a/packages/ui/src/forms/fields/Relationship/index.tsx +++ b/packages/ui/src/fields/Relationship/index.tsx @@ -6,24 +6,24 @@ import { wordBoundariesRegex } from 'payload/utilities' import qs from 'qs' import React, { useCallback, useEffect, useReducer, useRef, useState } from 'react' -import type { DocumentDrawerProps } from '../../../elements/DocumentDrawer/types.js' +import type { DocumentDrawerProps } from '../../elements/DocumentDrawer/types.js' import type { GetResults, Option, RelationshipFieldProps, Value } from './types.js' -import ReactSelect from '../../../elements/ReactSelect/index.js' -import { useDebouncedCallback } from '../../../hooks/useDebouncedCallback.js' -import { useAuth } from '../../../providers/Auth/index.js' -import { useConfig } from '../../../providers/Config/index.js' -import { useLocale } from '../../../providers/Locale/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import { useFormProcessing } from '../../Form/context.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import ReactSelect from '../../elements/ReactSelect/index.js' +import { useFormProcessing } from '../../forms/Form/context.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useDebouncedCallback } from '../../hooks/useDebouncedCallback.js' +import { useAuth } from '../../providers/Auth/index.js' +import { useConfig } from '../../providers/Config/index.js' +import { useLocale } from '../../providers/Locale/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import { AddNewRelation } from './AddNew/index.js' import { createRelationMap } from './createRelationMap.js' import { findOptionsByValue } from './findOptionsByValue.js' import './index.scss' -import optionsReducer from './optionsReducer.js' +import { optionsReducer } from './optionsReducer.js' import { MultiValueLabel } from './select-components/MultiValueLabel/index.js' import { SingleValue } from './select-components/SingleValue/index.js' @@ -31,7 +31,9 @@ const maxResultsPerRequest = 10 const baseClass = 'relationship' -const Relationship: React.FC<RelationshipFieldProps> = (props) => { +export { RelationshipFieldProps } + +const RelationshipField: React.FC<RelationshipFieldProps> = (props) => { const { name, Description, @@ -530,4 +532,4 @@ const Relationship: React.FC<RelationshipFieldProps> = (props) => { ) } -export default withCondition(Relationship) +export const Relationship = withCondition(RelationshipField) diff --git a/packages/ui/src/forms/fields/Relationship/optionsReducer.ts b/packages/ui/src/fields/Relationship/optionsReducer.ts similarity index 94% rename from packages/ui/src/forms/fields/Relationship/optionsReducer.ts rename to packages/ui/src/fields/Relationship/optionsReducer.ts index e545b05bf82..b350ac3c50e 100644 --- a/packages/ui/src/forms/fields/Relationship/optionsReducer.ts +++ b/packages/ui/src/fields/Relationship/optionsReducer.ts @@ -2,7 +2,7 @@ import { getTranslation } from '@payloadcms/translations' import type { Action, Option, OptionGroup } from './types.js' -import { formatDocTitle } from '../../../utilities/formatDocTitle.js' +import { formatDocTitle } from '../../utilities/formatDocTitle.js' const reduceToIDs = (options) => options.reduce((ids, option) => { @@ -25,7 +25,7 @@ const sortOptions = (options: Option[]): Option[] => return 0 }) -const optionsReducer = (state: OptionGroup[], action: Action): OptionGroup[] => { +export const optionsReducer = (state: OptionGroup[], action: Action): OptionGroup[] => { switch (action.type) { case 'CLEAR': { return [] @@ -125,5 +125,3 @@ const optionsReducer = (state: OptionGroup[], action: Action): OptionGroup[] => } } } - -export default optionsReducer diff --git a/packages/ui/src/forms/fields/Relationship/select-components/MultiValueLabel/index.scss b/packages/ui/src/fields/Relationship/select-components/MultiValueLabel/index.scss similarity index 93% rename from packages/ui/src/forms/fields/Relationship/select-components/MultiValueLabel/index.scss rename to packages/ui/src/fields/Relationship/select-components/MultiValueLabel/index.scss index 74184f7e514..eeea3a13f4e 100644 --- a/packages/ui/src/forms/fields/Relationship/select-components/MultiValueLabel/index.scss +++ b/packages/ui/src/fields/Relationship/select-components/MultiValueLabel/index.scss @@ -1,4 +1,4 @@ -@import '../../../../../scss/styles.scss'; +@import '../../../../scss/styles.scss'; .relationship--multi-value-label { display: flex; diff --git a/packages/ui/src/forms/fields/Relationship/select-components/MultiValueLabel/index.tsx b/packages/ui/src/fields/Relationship/select-components/MultiValueLabel/index.tsx similarity index 87% rename from packages/ui/src/forms/fields/Relationship/select-components/MultiValueLabel/index.tsx rename to packages/ui/src/fields/Relationship/select-components/MultiValueLabel/index.tsx index ce207b01463..af320b8a761 100644 --- a/packages/ui/src/forms/fields/Relationship/select-components/MultiValueLabel/index.tsx +++ b/packages/ui/src/fields/Relationship/select-components/MultiValueLabel/index.tsx @@ -6,11 +6,11 @@ import { components } from 'react-select' import type { Option } from '../../types.js' -import { useDocumentDrawer } from '../../../../../elements/DocumentDrawer/index.js' -import { Tooltip } from '../../../../../elements/Tooltip/index.js' -import { Edit } from '../../../../../icons/Edit/index.js' -import { useAuth } from '../../../../../providers/Auth/index.js' -import { useTranslation } from '../../../../../providers/Translation/index.js' +import { useDocumentDrawer } from '../../../../elements/DocumentDrawer/index.js' +import { Tooltip } from '../../../../elements/Tooltip/index.js' +import { Edit } from '../../../../icons/Edit/index.js' +import { useAuth } from '../../../../providers/Auth/index.js' +import { useTranslation } from '../../../../providers/Translation/index.js' import './index.scss' const baseClass = 'relationship--multi-value-label' diff --git a/packages/ui/src/forms/fields/Relationship/select-components/SingleValue/index.scss b/packages/ui/src/fields/Relationship/select-components/SingleValue/index.scss similarity index 94% rename from packages/ui/src/forms/fields/Relationship/select-components/SingleValue/index.scss rename to packages/ui/src/fields/Relationship/select-components/SingleValue/index.scss index 96c65d26d60..ef8b4314db0 100644 --- a/packages/ui/src/forms/fields/Relationship/select-components/SingleValue/index.scss +++ b/packages/ui/src/fields/Relationship/select-components/SingleValue/index.scss @@ -1,4 +1,4 @@ -@import '../../../../../scss/styles.scss'; +@import '../../../../scss/styles.scss'; .relationship--single-value { &.rs__single-value { diff --git a/packages/ui/src/forms/fields/Relationship/select-components/SingleValue/index.tsx b/packages/ui/src/fields/Relationship/select-components/SingleValue/index.tsx similarity index 87% rename from packages/ui/src/forms/fields/Relationship/select-components/SingleValue/index.tsx rename to packages/ui/src/fields/Relationship/select-components/SingleValue/index.tsx index 842b464a26c..393c4bc6e8c 100644 --- a/packages/ui/src/forms/fields/Relationship/select-components/SingleValue/index.tsx +++ b/packages/ui/src/fields/Relationship/select-components/SingleValue/index.tsx @@ -6,11 +6,11 @@ import { components as SelectComponents } from 'react-select' import type { Option } from '../../types.js' -import { useDocumentDrawer } from '../../../../../elements/DocumentDrawer/index.js' -import { Tooltip } from '../../../../../elements/Tooltip/index.js' -import { Edit } from '../../../../../icons/Edit/index.js' -import { useAuth } from '../../../../../providers/Auth/index.js' -import { useTranslation } from '../../../../../providers/Translation/index.js' +import { useDocumentDrawer } from '../../../../elements/DocumentDrawer/index.js' +import { Tooltip } from '../../../../elements/Tooltip/index.js' +import { Edit } from '../../../../icons/Edit/index.js' +import { useAuth } from '../../../../providers/Auth/index.js' +import { useTranslation } from '../../../../providers/Translation/index.js' import './index.scss' const baseClass = 'relationship--single-value' diff --git a/packages/ui/src/forms/fields/Relationship/types.ts b/packages/ui/src/fields/Relationship/types.ts similarity index 100% rename from packages/ui/src/forms/fields/Relationship/types.ts rename to packages/ui/src/fields/Relationship/types.ts diff --git a/packages/ui/src/fields/RichText/index.tsx b/packages/ui/src/fields/RichText/index.tsx new file mode 100644 index 00000000000..eb9e159a9a9 --- /dev/null +++ b/packages/ui/src/fields/RichText/index.tsx @@ -0,0 +1,12 @@ +import type React from 'react' + +import type { MappedField } from '../../utilities/buildComponentMap/types.js' +import type { FormFieldBase } from '../shared.js' + +export type RichTextFieldProps = FormFieldBase & { + richTextComponentMap?: Map<string, MappedField[] | React.ReactNode> +} + +export const RichText: React.FC<RichTextFieldProps> = () => { + return null +} diff --git a/packages/ui/src/forms/fields/Row/index.scss b/packages/ui/src/fields/Row/index.scss similarity index 94% rename from packages/ui/src/forms/fields/Row/index.scss rename to packages/ui/src/fields/Row/index.scss index ef8a100eb22..0d8fcaf459b 100644 --- a/packages/ui/src/forms/fields/Row/index.scss +++ b/packages/ui/src/fields/Row/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.row { .row__fields { diff --git a/packages/ui/src/forms/fields/Row/index.tsx b/packages/ui/src/fields/Row/index.tsx similarity index 66% rename from packages/ui/src/forms/fields/Row/index.tsx rename to packages/ui/src/fields/Row/index.tsx index 25444460a90..ecacf8f1834 100644 --- a/packages/ui/src/forms/fields/Row/index.tsx +++ b/packages/ui/src/fields/Row/index.tsx @@ -3,16 +3,18 @@ import React from 'react' import type { RowFieldProps } from './types.js' -import { useFieldProps } from '../../FieldPropsProvider/index.js' -import { RenderFields } from '../../RenderFields/index.js' -import { withCondition } from '../../withCondition/index.js' +import { useFieldProps } from '../../forms/FieldPropsProvider/index.js' +import { RenderFields } from '../../forms/RenderFields/index.js' +import { withCondition } from '../../forms/withCondition/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' -import { RowProvider } from './provider.js' +import { RowProvider, useRow } from './provider.js' + +export { RowProvider, useRow } const baseClass = 'row' -const Row: React.FC<RowFieldProps> = (props) => { +const RowField: React.FC<RowFieldProps> = (props) => { const { className, fieldMap, forceRender = false } = props const { path, readOnly, schemaPath, siblingPermissions } = useFieldProps() @@ -33,4 +35,4 @@ const Row: React.FC<RowFieldProps> = (props) => { ) } -export default withCondition(Row) +export const Row = withCondition(RowField) diff --git a/packages/ui/src/forms/fields/Row/provider.tsx b/packages/ui/src/fields/Row/provider.tsx similarity index 84% rename from packages/ui/src/forms/fields/Row/provider.tsx rename to packages/ui/src/fields/Row/provider.tsx index ed6cb97e7e9..b2c718fce6f 100644 --- a/packages/ui/src/forms/fields/Row/provider.tsx +++ b/packages/ui/src/fields/Row/provider.tsx @@ -1,7 +1,7 @@ 'use client' import React, { createContext, useContext } from 'react' -const Context = createContext(false) +export const Context = createContext(false) export const RowProvider: React.FC<{ children?: React.ReactNode; withinRow?: boolean }> = ({ children, @@ -11,5 +11,3 @@ export const RowProvider: React.FC<{ children?: React.ReactNode; withinRow?: boo } export const useRow = (): boolean => useContext(Context) - -export default Context diff --git a/packages/ui/src/forms/fields/Row/types.ts b/packages/ui/src/fields/Row/types.ts similarity index 79% rename from packages/ui/src/forms/fields/Row/types.ts rename to packages/ui/src/fields/Row/types.ts index e4a4ed7ed09..d509931cc56 100644 --- a/packages/ui/src/forms/fields/Row/types.ts +++ b/packages/ui/src/fields/Row/types.ts @@ -1,6 +1,6 @@ -import type { FieldMap } from '@payloadcms/ui' import type { FieldPermissions } from 'payload/auth' +import type { FieldMap } from '../../utilities/buildComponentMap/types.js' import type { FormFieldBase } from '../shared.js' export type RowFieldProps = FormFieldBase & { diff --git a/packages/ui/src/forms/fields/Select/index.scss b/packages/ui/src/fields/Select/index.scss similarity index 89% rename from packages/ui/src/forms/fields/Select/index.scss rename to packages/ui/src/fields/Select/index.scss index f2a26ef448d..9507c99ad41 100644 --- a/packages/ui/src/forms/fields/Select/index.scss +++ b/packages/ui/src/fields/Select/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.select { position: relative; diff --git a/packages/ui/src/forms/fields/Select/index.tsx b/packages/ui/src/fields/Select/index.tsx similarity index 81% rename from packages/ui/src/forms/fields/Select/index.tsx rename to packages/ui/src/fields/Select/index.tsx index 08fa496d20c..ba66c6d7301 100644 --- a/packages/ui/src/forms/fields/Select/index.tsx +++ b/packages/ui/src/fields/Select/index.tsx @@ -1,20 +1,33 @@ /* eslint-disable react/destructuring-assignment */ 'use client' -import type { ClientValidate, Option, OptionObject } from 'payload/types' +import type { ClientValidate, FieldBase, Option, OptionObject } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React, { useCallback, useState } from 'react' -import type { SelectFieldProps } from './types.js' +import type { FormFieldBase } from '../shared.js' -import ReactSelect from '../../../elements/ReactSelect/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import ReactSelect from '../../elements/ReactSelect/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' +export type SelectFieldProps = FormFieldBase & { + hasMany?: boolean + isClearable?: boolean + isSortable?: boolean + label?: FieldBase['label'] + name?: string + onChange?: (e: string) => void + options?: Option[] + path?: string + value?: string + width?: string +} + const formatOptions = (options: Option[]): OptionObject[] => options.map((option) => { if (typeof option === 'object' && (option.value || option.value === '')) { @@ -27,7 +40,7 @@ const formatOptions = (options: Option[]): OptionObject[] => } as OptionObject }) -export const Select: React.FC<SelectFieldProps> = (props) => { +export const SelectField: React.FC<SelectFieldProps> = (props) => { const { name, AfterInput, @@ -154,4 +167,4 @@ export const Select: React.FC<SelectFieldProps> = (props) => { ) } -export default withCondition(Select) +export const Select = withCondition(SelectField) diff --git a/packages/ui/src/forms/fields/Tabs/Tab/index.scss b/packages/ui/src/fields/Tabs/Tab/index.scss similarity index 96% rename from packages/ui/src/forms/fields/Tabs/Tab/index.scss rename to packages/ui/src/fields/Tabs/Tab/index.scss index 6dcf67aa6d6..2312a65f294 100644 --- a/packages/ui/src/forms/fields/Tabs/Tab/index.scss +++ b/packages/ui/src/fields/Tabs/Tab/index.scss @@ -1,4 +1,4 @@ -@import '../../../../scss/styles.scss'; +@import '../../../scss/styles.scss'; .tabs-field__tab-button { @extend %btn-reset; diff --git a/packages/ui/src/forms/fields/Tabs/Tab/index.tsx b/packages/ui/src/fields/Tabs/Tab/index.tsx similarity index 80% rename from packages/ui/src/forms/fields/Tabs/Tab/index.tsx rename to packages/ui/src/fields/Tabs/Tab/index.tsx index 9993d6a407d..e057e6bc1d1 100644 --- a/packages/ui/src/forms/fields/Tabs/Tab/index.tsx +++ b/packages/ui/src/fields/Tabs/Tab/index.tsx @@ -2,11 +2,11 @@ import { getTranslation } from '@payloadcms/translations' import React, { useState } from 'react' -import type { MappedTab } from '../../../../utilities/buildComponentMap/types.js' +import type { MappedTab } from '../../../utilities/buildComponentMap/types.js' -import { ErrorPill } from '../../../../elements/ErrorPill/index.js' -import { useTranslation } from '../../../../providers/Translation/index.js' -import { WatchChildErrors } from '../../../WatchChildErrors/index.js' +import { ErrorPill } from '../../../elements/ErrorPill/index.js' +import { WatchChildErrors } from '../../../forms/WatchChildErrors/index.js' +import { useTranslation } from '../../../providers/Translation/index.js' import './index.scss' const baseClass = 'tabs-field__tab-button' diff --git a/packages/ui/src/forms/fields/Tabs/index.scss b/packages/ui/src/fields/Tabs/index.scss similarity index 96% rename from packages/ui/src/forms/fields/Tabs/index.scss rename to packages/ui/src/fields/Tabs/index.scss index f6eae344d68..39d293b9397 100644 --- a/packages/ui/src/forms/fields/Tabs/index.scss +++ b/packages/ui/src/fields/Tabs/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .tabs-field { margin-top: base(2); diff --git a/packages/ui/src/forms/fields/Tabs/index.tsx b/packages/ui/src/fields/Tabs/index.tsx similarity index 83% rename from packages/ui/src/forms/fields/Tabs/index.tsx rename to packages/ui/src/fields/Tabs/index.tsx index 9b727c41f57..c48574907e9 100644 --- a/packages/ui/src/forms/fields/Tabs/index.tsx +++ b/packages/ui/src/fields/Tabs/index.tsx @@ -1,19 +1,21 @@ 'use client' +import type { FieldPermissions } from 'payload/auth' import type { DocumentPreferences } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import { toKebabCase } from 'payload/utilities' import React, { useCallback, useEffect, useState } from 'react' -import type { TabsFieldProps } from './types.js' +import type { FieldMap, MappedTab } from '../../utilities/buildComponentMap/types.js' +import type { FormFieldBase } from '../shared.js' -import { useCollapsible } from '../../../elements/Collapsible/provider.js' -import { useDocumentInfo } from '../../../providers/DocumentInfo/index.js' -import { usePreferences } from '../../../providers/Preferences/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import { useFieldProps } from '../../FieldPropsProvider/index.js' -import { RenderFields } from '../../RenderFields/index.js' -import { withCondition } from '../../withCondition/index.js' +import { useCollapsible } from '../../elements/Collapsible/provider.js' +import { useFieldProps } from '../../forms/FieldPropsProvider/index.js' +import { RenderFields } from '../../forms/RenderFields/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useDocumentInfo } from '../../providers/DocumentInfo/index.js' +import { usePreferences } from '../../providers/Preferences/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import { TabComponent } from './Tab/index.js' import './index.scss' @@ -21,6 +23,19 @@ import { TabsProvider } from './provider.js' const baseClass = 'tabs-field' +export { TabsProvider } + +export type TabsFieldProps = FormFieldBase & { + fieldMap: FieldMap + forceRender?: boolean + indexPath: string + name?: string + path?: string + permissions: FieldPermissions + tabs?: MappedTab[] + width?: string +} + const TabsField: React.FC<TabsFieldProps> = (props) => { const { name, @@ -156,4 +171,4 @@ const TabsField: React.FC<TabsFieldProps> = (props) => { ) } -export default withCondition(TabsField) +export const Tabs = withCondition(TabsField) diff --git a/packages/ui/src/forms/fields/Tabs/provider.tsx b/packages/ui/src/fields/Tabs/provider.tsx similarity index 94% rename from packages/ui/src/forms/fields/Tabs/provider.tsx rename to packages/ui/src/fields/Tabs/provider.tsx index fba83fbb1ff..eed7a70efe4 100644 --- a/packages/ui/src/forms/fields/Tabs/provider.tsx +++ b/packages/ui/src/fields/Tabs/provider.tsx @@ -11,5 +11,3 @@ export const TabsProvider: React.FC<{ children?: React.ReactNode; withinTab?: bo } export const useTabs = (): boolean => useContext(Context) - -export default Context diff --git a/packages/ui/src/forms/fields/Text/Input.tsx b/packages/ui/src/fields/Text/Input.tsx similarity index 76% rename from packages/ui/src/forms/fields/Text/Input.tsx rename to packages/ui/src/fields/Text/Input.tsx index 22edd9959d9..92db9bf534b 100644 --- a/packages/ui/src/forms/fields/Text/Input.tsx +++ b/packages/ui/src/fields/Text/Input.tsx @@ -1,30 +1,14 @@ 'use client' -import type { ChangeEvent } from 'react' - import { getTranslation } from '@payloadcms/translations' -import { TextField } from 'payload/types.js' import React from 'react' -import type { Option } from '../../../elements/ReactSelect/types.js' -import type { TextareaFieldProps } from '../Textarea/types.js' +import type { TextInputProps } from './types.js' -import ReactSelect from '../../../elements/ReactSelect/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' +import ReactSelect from '../../elements/ReactSelect/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' -export type TextInputProps = Omit<TextareaFieldProps, 'type'> & { - hasMany?: boolean - inputRef?: React.MutableRefObject<HTMLInputElement> - maxRows?: number - minRows?: number - onChange?: (e: ChangeEvent<HTMLInputElement>) => void - onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> - showError?: boolean - value?: string - valueToRender?: Option[] -} - export const TextInput: React.FC<TextInputProps> = (props) => { const { AfterInput, diff --git a/packages/ui/src/forms/fields/Text/index.scss b/packages/ui/src/fields/Text/index.scss similarity index 90% rename from packages/ui/src/forms/fields/Text/index.scss rename to packages/ui/src/fields/Text/index.scss index 743136b1e0d..fb02932ba8b 100644 --- a/packages/ui/src/forms/fields/Text/index.scss +++ b/packages/ui/src/fields/Text/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.text { position: relative; diff --git a/packages/ui/src/forms/fields/Text/index.tsx b/packages/ui/src/fields/Text/index.tsx similarity index 83% rename from packages/ui/src/forms/fields/Text/index.tsx rename to packages/ui/src/fields/Text/index.tsx index 6fde3b26627..fc654572938 100644 --- a/packages/ui/src/forms/fields/Text/index.tsx +++ b/packages/ui/src/fields/Text/index.tsx @@ -1,21 +1,25 @@ 'use client' import type { ClientValidate } from 'payload/types' +import type {} from 'payload/types' +import { TextField } from 'payload/types' import React, { useCallback, useEffect, useState } from 'react' -import type { Option } from '../../../elements/ReactSelect/types.js' -import type { TextFieldProps } from './types.js' +import type { Option } from '../../elements/ReactSelect/types.js' +import type { TextFieldProps, TextInputProps } from './types.js' -import { useConfig } from '../../../providers/Config/index.js' -import { useLocale } from '../../../providers/Locale/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useConfig } from '../../providers/Config/index.js' +import { useLocale } from '../../providers/Locale/index.js' import { isFieldRTL } from '../shared.js' import { TextInput } from './Input.js' import './index.scss' -const Text: React.FC<TextFieldProps> = (props) => { +export { TextFieldProps, TextInput, TextInputProps } + +const TextField: React.FC<TextFieldProps> = (props) => { const { name, AfterInput, @@ -141,4 +145,4 @@ const Text: React.FC<TextFieldProps> = (props) => { ) } -export default withCondition(Text) +export const Text = withCondition(TextField) diff --git a/packages/ui/src/fields/Text/types.ts b/packages/ui/src/fields/Text/types.ts new file mode 100644 index 00000000000..6449b521699 --- /dev/null +++ b/packages/ui/src/fields/Text/types.ts @@ -0,0 +1,32 @@ +import type { FieldBase, TextField } from 'payload/types' +import type { ChangeEvent } from 'react' + +import type { Option } from '../../elements/ReactSelect/types.js' +import type { FormFieldBase } from '../shared.js' + +export type TextFieldProps = FormFieldBase & { + hasMany?: boolean + inputRef?: React.MutableRefObject<HTMLInputElement> + label?: FieldBase['label'] + maxLength?: number + maxRows?: number + minLength?: number + minRows?: number + name?: string + onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> + path?: string + placeholder?: TextField['admin']['placeholder'] + width?: string +} + +export type TextInputProps = Omit<TextFieldProps, 'type'> & { + hasMany?: boolean + inputRef?: React.MutableRefObject<HTMLInputElement> + maxRows?: number + minRows?: number + onChange?: (e: ChangeEvent<HTMLInputElement>) => void + onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> + showError?: boolean + value?: string + valueToRender?: Option[] +} diff --git a/packages/ui/src/forms/fields/Textarea/Input.tsx b/packages/ui/src/fields/Textarea/Input.tsx similarity index 80% rename from packages/ui/src/forms/fields/Textarea/Input.tsx rename to packages/ui/src/fields/Textarea/Input.tsx index 2563f41b6bc..201c71c3984 100644 --- a/packages/ui/src/forms/fields/Textarea/Input.tsx +++ b/packages/ui/src/fields/Textarea/Input.tsx @@ -1,20 +1,13 @@ 'use client' import { getTranslation } from '@payloadcms/translations' -import React, { type ChangeEvent } from 'react' +import React from 'react' -import type { TextareaFieldProps } from './types.js' +import type { TextAreaInputProps } from './types.js' -import { useTranslation } from '../../../providers/Translation/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' -export type TextAreaInputProps = TextareaFieldProps & { - onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void - rows?: number - showError?: boolean - value?: string -} - export const TextareaInput: React.FC<TextAreaInputProps> = (props) => { const { AfterInput, diff --git a/packages/ui/src/forms/fields/Textarea/index.scss b/packages/ui/src/fields/Textarea/index.scss similarity index 98% rename from packages/ui/src/forms/fields/Textarea/index.scss rename to packages/ui/src/fields/Textarea/index.scss index 6985a772340..9dae4247ce5 100644 --- a/packages/ui/src/forms/fields/Textarea/index.scss +++ b/packages/ui/src/fields/Textarea/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .field-type.textarea { position: relative; diff --git a/packages/ui/src/forms/fields/Textarea/index.tsx b/packages/ui/src/fields/Textarea/index.tsx similarity index 76% rename from packages/ui/src/forms/fields/Textarea/index.tsx rename to packages/ui/src/fields/Textarea/index.tsx index f861d079777..0c8fed027dd 100644 --- a/packages/ui/src/forms/fields/Textarea/index.tsx +++ b/packages/ui/src/fields/Textarea/index.tsx @@ -5,18 +5,20 @@ import type { ClientValidate } from 'payload/types' import { getTranslation } from '@payloadcms/translations' import React, { useCallback } from 'react' -import type { TextareaFieldProps } from './types.js' +import type { TextAreaInputProps, TextareaFieldProps } from './types.js' -import { useConfig } from '../../../providers/Config/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' -import { withCondition } from '../../withCondition/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { withCondition } from '../../forms/withCondition/index.js' +import { useConfig } from '../../providers/Config/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { isFieldRTL } from '../shared.js' import { TextareaInput } from './Input.js' import './index.scss' -const Textarea: React.FC<TextareaFieldProps> = (props) => { +export { TextAreaInputProps, TextareaFieldProps, TextareaInput } + +const TextareaField: React.FC<TextareaFieldProps> = (props) => { const { name, AfterInput, @@ -91,4 +93,4 @@ const Textarea: React.FC<TextareaFieldProps> = (props) => { ) } -export default withCondition(Textarea) +export const Textarea = withCondition(TextareaField) diff --git a/packages/ui/src/fields/Textarea/types.ts b/packages/ui/src/fields/Textarea/types.ts new file mode 100644 index 00000000000..f72b0a4c04c --- /dev/null +++ b/packages/ui/src/fields/Textarea/types.ts @@ -0,0 +1,23 @@ +import type { FieldBase, TextareaField as TextareaFieldType } from 'payload/types' + +import { type ChangeEvent } from 'react' + +import type { FormFieldBase } from '../shared.js' + +export type TextareaFieldProps = FormFieldBase & { + label?: FieldBase['label'] + maxLength?: number + minLength?: number + name?: string + path?: string + placeholder?: TextareaFieldType['admin']['placeholder'] + rows?: number + width?: string +} + +export type TextAreaInputProps = TextareaFieldProps & { + onChange?: (e: ChangeEvent<HTMLTextAreaElement>) => void + rows?: number + showError?: boolean + value?: string +} diff --git a/packages/ui/src/forms/fields/UI/index.tsx b/packages/ui/src/fields/UI/index.tsx similarity index 50% rename from packages/ui/src/forms/fields/UI/index.tsx rename to packages/ui/src/fields/UI/index.tsx index 0011fcd68a8..2fffe56d08c 100644 --- a/packages/ui/src/forms/fields/UI/index.tsx +++ b/packages/ui/src/fields/UI/index.tsx @@ -1,7 +1,5 @@ import type React from 'react' -const UI: React.FC = () => { +export const UI: React.FC = () => { return null } - -export default UI diff --git a/packages/ui/src/forms/fields/Upload/Input.tsx b/packages/ui/src/fields/Upload/Input.tsx similarity index 89% rename from packages/ui/src/forms/fields/Upload/Input.tsx rename to packages/ui/src/fields/Upload/Input.tsx index bf6db70f9a2..03b4f407367 100644 --- a/packages/ui/src/forms/fields/Upload/Input.tsx +++ b/packages/ui/src/fields/Upload/Input.tsx @@ -5,16 +5,16 @@ import type { FilterOptionsResult, SanitizedCollectionConfig, UploadField } from import { getTranslation } from '@payloadcms/translations' import React, { useCallback, useEffect, useState } from 'react' -import type { DocumentDrawerProps } from '../../../elements/DocumentDrawer/types.js' -import type { ListDrawerProps } from '../../../elements/ListDrawer/types.js' +import type { DocumentDrawerProps } from '../../elements/DocumentDrawer/types.js' +import type { ListDrawerProps } from '../../elements/ListDrawer/types.js' import type { UploadFieldProps } from './types.js' -import { Button } from '../../../elements/Button/index.js' -import { useDocumentDrawer } from '../../../elements/DocumentDrawer/index.js' -import FileDetails from '../../../elements/FileDetails/index.js' -import { useListDrawer } from '../../../elements/ListDrawer/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' -import LabelComp from '../../Label/index.js' +import { Button } from '../../elements/Button/index.js' +import { useDocumentDrawer } from '../../elements/DocumentDrawer/index.js' +import FileDetails from '../../elements/FileDetails/index.js' +import { useListDrawer } from '../../elements/ListDrawer/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useTranslation } from '../../providers/Translation/index.js' import { fieldBaseClass } from '../shared.js' import './index.scss' diff --git a/packages/ui/src/forms/fields/Upload/index.scss b/packages/ui/src/fields/Upload/index.scss similarity index 100% rename from packages/ui/src/forms/fields/Upload/index.scss rename to packages/ui/src/fields/Upload/index.scss diff --git a/packages/ui/src/forms/fields/Upload/index.tsx b/packages/ui/src/fields/Upload/index.tsx similarity index 85% rename from packages/ui/src/forms/fields/Upload/index.tsx rename to packages/ui/src/fields/Upload/index.tsx index fb3c579b6d9..2644b1b6f4f 100644 --- a/packages/ui/src/forms/fields/Upload/index.tsx +++ b/packages/ui/src/fields/Upload/index.tsx @@ -3,13 +3,15 @@ import React, { useCallback } from 'react' import type { UploadFieldProps } from './types.js' -import { useConfig } from '../../../providers/Config/index.js' -import LabelComp from '../../Label/index.js' -import { useField } from '../../useField/index.js' +import { Label as LabelComp } from '../../forms/Label/index.js' +import { useField } from '../../forms/useField/index.js' +import { useConfig } from '../../providers/Config/index.js' import { UploadInput } from './Input.js' import './index.scss' -const Upload: React.FC<UploadFieldProps> = (props) => { +export { UploadFieldProps, UploadInput } + +export const Upload: React.FC<UploadFieldProps> = (props) => { const { Description, Error, @@ -83,5 +85,3 @@ const Upload: React.FC<UploadFieldProps> = (props) => { return null } - -export default Upload diff --git a/packages/ui/src/forms/fields/Upload/types.ts b/packages/ui/src/fields/Upload/types.ts similarity index 100% rename from packages/ui/src/forms/fields/Upload/types.ts rename to packages/ui/src/fields/Upload/types.ts diff --git a/packages/ui/src/fields/index.tsx b/packages/ui/src/fields/index.tsx new file mode 100644 index 00000000000..506b80225bc --- /dev/null +++ b/packages/ui/src/fields/index.tsx @@ -0,0 +1,53 @@ +import type { FieldTypes } from 'payload/config' + +import { ArrayField as array } from './Array/index.js' +import { BlocksField as blocks } from './Blocks/index.js' +import { Checkbox as checkbox } from './Checkbox/index.js' +import { Code as code } from './Code/index.js' +import { Collapsible as collapsible } from './Collapsible/index.js' +import { ConfirmPassword as confirmPassword } from './ConfirmPassword/index.js' +import { DateTime as date } from './DateTime/index.js' +import { Email as email } from './Email/index.js' +import { Group as group } from './Group/index.js' +import { HiddenInput as hidden } from './HiddenInput/index.js' +import { JSONField as json } from './JSON/index.js' +import { NumberField as number } from './Number/index.js' +import { Password as password } from './Password/index.js' +import { Point as point } from './Point/index.js' +import { RadioGroup as radio } from './RadioGroup/index.js' +import { Relationship as relationship } from './Relationship/index.js' +import { RichText as richText } from './RichText/index.js' +import { Row as row } from './Row/index.js' +import { Select as select } from './Select/index.js' +import { Tabs as tabs } from './Tabs/index.js' +import { Text as text } from './Text/index.js' +import { Textarea as textarea } from './Textarea/index.js' +import { UI as ui } from './UI/index.js' +import { Upload as upload } from './Upload/index.js' + +export const fieldComponents: FieldTypes = { + array, + blocks, + checkbox, + code, + collapsible, + confirmPassword, + date, + email, + group, + hidden, + json, + number, + password, + point, + radio, + relationship, + richText, + row, + select, + tabs, + text, + textarea, + ui, + upload, +} diff --git a/packages/ui/src/forms/fields/shared.ts b/packages/ui/src/fields/shared.ts similarity index 95% rename from packages/ui/src/forms/fields/shared.ts rename to packages/ui/src/fields/shared.ts index 45d33a866a7..65bd0ff0e5a 100644 --- a/packages/ui/src/forms/fields/shared.ts +++ b/packages/ui/src/fields/shared.ts @@ -1,6 +1,6 @@ import type { User } from 'payload/auth' import type { Locale, SanitizedLocalizationConfig } from 'payload/config' -import type { DocumentPreferences, FormState, Validate } from 'payload/types' +import type { DocumentPreferences, Validate } from 'payload/types' export const fieldBaseClass = 'field-type' diff --git a/packages/ui/src/forms/Error/index.tsx b/packages/ui/src/forms/Error/index.tsx index 8f8e34dfe5e..6c25e38b9a6 100644 --- a/packages/ui/src/forms/Error/index.tsx +++ b/packages/ui/src/forms/Error/index.tsx @@ -10,7 +10,7 @@ import './index.scss' const baseClass = 'field-error' -const Error: React.FC<ErrorProps> = (props) => { +export const Error: React.FC<ErrorProps> = (props) => { const { alignCaret = 'right', message: messageFromProps, @@ -39,5 +39,3 @@ const Error: React.FC<ErrorProps> = (props) => { return null } - -export default Error diff --git a/packages/ui/src/forms/FieldDescription/index.tsx b/packages/ui/src/forms/FieldDescription/index.tsx index 869f74b1578..d0ccdcf20ee 100644 --- a/packages/ui/src/forms/FieldDescription/index.tsx +++ b/packages/ui/src/forms/FieldDescription/index.tsx @@ -8,9 +8,11 @@ import { useTranslation } from '../../providers/Translation/index.js' import { useFieldProps } from '../FieldPropsProvider/index.js' import './index.scss' +export { Props as FieldDescriptionProps } + const baseClass = 'field-description' -const FieldDescription: React.FC<Props> = (props) => { +export const FieldDescription: React.FC<Props> = (props) => { const { className, description, marginPlacement } = props const { path } = useFieldProps() @@ -36,5 +38,3 @@ const FieldDescription: React.FC<Props> = (props) => { return null } - -export default FieldDescription diff --git a/packages/ui/src/forms/FieldPropsProvider/index.tsx b/packages/ui/src/forms/FieldPropsProvider/index.tsx index cee7129666b..982c61530b4 100644 --- a/packages/ui/src/forms/FieldPropsProvider/index.tsx +++ b/packages/ui/src/forms/FieldPropsProvider/index.tsx @@ -3,7 +3,7 @@ import type { FieldPermissions } from 'payload/types' import React from 'react' -type FieldPropsContextType = { +export type FieldPropsContextType = { path: string permissions?: FieldPermissions readOnly: boolean @@ -21,7 +21,7 @@ const FieldPropsContext = React.createContext<FieldPropsContextType>({ siblingPermissions: {}, }) -type Props = { +export type Props = { children: React.ReactNode path: string permissions?: FieldPermissions diff --git a/packages/ui/src/forms/Label/index.tsx b/packages/ui/src/forms/Label/index.tsx index a6e7f456777..b0afc118cbb 100644 --- a/packages/ui/src/forms/Label/index.tsx +++ b/packages/ui/src/forms/Label/index.tsx @@ -10,7 +10,7 @@ import { useFieldProps } from '../FieldPropsProvider/index.js' import { useForm } from '../Form/context.js' import './index.scss' -const Label: React.FC<LabelProps> = (props) => { +export const Label: React.FC<LabelProps> = (props) => { const { htmlFor: htmlForFromProps, label: labelFromProps, required = false } = props const { uuid } = useForm() const { path } = useFieldProps() @@ -29,5 +29,3 @@ const Label: React.FC<LabelProps> = (props) => { return null } - -export default Label diff --git a/packages/ui/src/forms/NullifyField/index.tsx b/packages/ui/src/forms/NullifyField/index.tsx index 039815d1083..6155b3b6848 100644 --- a/packages/ui/src/forms/NullifyField/index.tsx +++ b/packages/ui/src/forms/NullifyField/index.tsx @@ -3,11 +3,11 @@ import * as React from 'react' import { Banner } from '../../elements/Banner/index.js' +import { CheckboxInput } from '../../fields/Checkbox/Input.js' import { useConfig } from '../../providers/Config/index.js' import { useLocale } from '../../providers/Locale/index.js' import { useTranslation } from '../../providers/Translation/index.js' import { useForm } from '../Form/context.js' -import CheckboxInput from '../fields/Checkbox/index.js' type NullifyLocaleFieldProps = { fieldValue?: [] | null | number diff --git a/packages/ui/src/forms/RenderFields/index.tsx b/packages/ui/src/forms/RenderFields/index.tsx index 8acf0eb8b3c..e1a88d6d11d 100644 --- a/packages/ui/src/forms/RenderFields/index.tsx +++ b/packages/ui/src/forms/RenderFields/index.tsx @@ -10,6 +10,8 @@ import './index.scss' const baseClass = 'render-fields' +export { Props } + export const RenderFields: React.FC<Props> = (props) => { const { className, fieldMap, forceRender, margins, path, permissions, schemaPath } = props diff --git a/packages/ui/src/forms/Submit/index.tsx b/packages/ui/src/forms/Submit/index.tsx index 05a68fca716..4cfce56f099 100644 --- a/packages/ui/src/forms/Submit/index.tsx +++ b/packages/ui/src/forms/Submit/index.tsx @@ -9,7 +9,7 @@ import './index.scss' const baseClass = 'form-submit' -const FormSubmit = forwardRef<HTMLButtonElement, Props>((props, ref) => { +export const FormSubmit = forwardRef<HTMLButtonElement, Props>((props, ref) => { const { type = 'submit', buttonId: id, children, disabled: disabledFromProps } = props const processing = useFormProcessing() const { disabled } = useForm() @@ -23,5 +23,3 @@ const FormSubmit = forwardRef<HTMLButtonElement, Props>((props, ref) => { </div> ) }) - -export default FormSubmit diff --git a/packages/ui/src/forms/fields/Array/types.ts b/packages/ui/src/forms/fields/Array/types.ts deleted file mode 100644 index 5d7444df7b4..00000000000 --- a/packages/ui/src/forms/fields/Array/types.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { FieldMap } from '@payloadcms/ui' -import type { FieldPermissions } from 'payload/auth' -import type { ArrayField, FieldBase, RowLabel } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type ArrayFieldProps = FormFieldBase & { - RowLabel?: React.ReactNode - fieldMap: FieldMap - forceRender?: boolean - indexPath: string - label?: FieldBase['label'] - labels?: ArrayField['labels'] - maxRows?: ArrayField['maxRows'] - minRows?: ArrayField['minRows'] - name?: string - permissions: FieldPermissions - width?: string -} diff --git a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/types.ts b/packages/ui/src/forms/fields/Blocks/BlocksDrawer/types.ts deleted file mode 100644 index 24189544a63..00000000000 --- a/packages/ui/src/forms/fields/Blocks/BlocksDrawer/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Labels } from 'payload/types' - -import type { ReducedBlock } from '../../../../utilities/buildComponentMap/types.js' - -export type Props = { - addRow: (index: number, blockType?: string) => void - addRowIndex: number - blocks: ReducedBlock[] - drawerSlug: string - labels: Labels -} diff --git a/packages/ui/src/forms/fields/Blocks/SectionTitle/types.ts b/packages/ui/src/forms/fields/Blocks/SectionTitle/types.ts deleted file mode 100644 index 8dac5d42079..00000000000 --- a/packages/ui/src/forms/fields/Blocks/SectionTitle/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type Props = { - customOnChange?: (e: React.ChangeEvent<HTMLInputElement>) => void - customValue?: string - path: string - readOnly: boolean -} diff --git a/packages/ui/src/forms/fields/Blocks/types.ts b/packages/ui/src/forms/fields/Blocks/types.ts deleted file mode 100644 index 08e41fc84e8..00000000000 --- a/packages/ui/src/forms/fields/Blocks/types.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { FieldMap, ReducedBlock } from '@payloadcms/ui' -import type { FieldPermissions } from 'payload/auth' -import type { BlockField, FieldBase } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type BlocksFieldProps = FormFieldBase & { - blocks?: ReducedBlock[] - fieldMap: FieldMap - forceRender?: boolean - indexPath: string - label?: FieldBase['label'] - labels?: BlockField['labels'] - maxRows?: number - minRows?: number - name?: string - permissions: FieldPermissions - slug?: string - width?: string -} diff --git a/packages/ui/src/forms/fields/Code/types.ts b/packages/ui/src/forms/fields/Code/types.ts deleted file mode 100644 index 0f983bad0e7..00000000000 --- a/packages/ui/src/forms/fields/Code/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { CodeField, FieldBase } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type CodeFieldProps = FormFieldBase & { - editorOptions?: CodeField['admin']['editorOptions'] - label?: FieldBase['label'] - language?: CodeField['admin']['language'] - name?: string - path?: string - width: string -} diff --git a/packages/ui/src/forms/fields/Collapsible/types.ts b/packages/ui/src/forms/fields/Collapsible/types.ts deleted file mode 100644 index 24cabe54dd0..00000000000 --- a/packages/ui/src/forms/fields/Collapsible/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { FieldMap } from '@payloadcms/ui' -import type { FieldPermissions } from 'payload/auth' -import type { FieldBase } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type CollapsibleFieldProps = FormFieldBase & { - fieldMap: FieldMap - indexPath: string - initCollapsed?: boolean - label?: FieldBase['label'] - permissions: FieldPermissions - width?: string -} diff --git a/packages/ui/src/forms/fields/ConfirmPassword/types.ts b/packages/ui/src/forms/fields/ConfirmPassword/types.ts deleted file mode 100644 index 85edd42577e..00000000000 --- a/packages/ui/src/forms/fields/ConfirmPassword/types.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type ConfirmPasswordFieldProps = { - disabled?: boolean -} diff --git a/packages/ui/src/forms/fields/DateTime/types.ts b/packages/ui/src/forms/fields/DateTime/types.ts deleted file mode 100644 index 7cab1bb7dd5..00000000000 --- a/packages/ui/src/forms/fields/DateTime/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { DateField, FieldBase } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type DateFieldProps = FormFieldBase & { - date?: DateField['admin']['date'] - label?: FieldBase['label'] - name?: string - path?: string - placeholder?: DateField['admin']['placeholder'] | string - width?: string -} diff --git a/packages/ui/src/forms/fields/Email/types.ts b/packages/ui/src/forms/fields/Email/types.ts deleted file mode 100644 index 44a4f943323..00000000000 --- a/packages/ui/src/forms/fields/Email/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { EmailField, FieldBase } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type EmailFieldProps = FormFieldBase & { - autoComplete?: string - label?: FieldBase['label'] - name?: string - path?: string - placeholder?: EmailField['admin']['placeholder'] - width?: string -} diff --git a/packages/ui/src/forms/fields/Group/types.ts b/packages/ui/src/forms/fields/Group/types.ts deleted file mode 100644 index 44680167cc0..00000000000 --- a/packages/ui/src/forms/fields/Group/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { FieldMap } from '@payloadcms/ui' -import type { FieldPermissions } from 'payload/auth' -import type { FieldBase } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type GroupFieldProps = FormFieldBase & { - fieldMap: FieldMap - forceRender?: boolean - hideGutter?: boolean - indexPath: string - label?: FieldBase['label'] - name?: string - permissions: FieldPermissions - width?: string -} diff --git a/packages/ui/src/forms/fields/HiddenInput/types.ts b/packages/ui/src/forms/fields/HiddenInput/types.ts deleted file mode 100644 index 73d88f56d0d..00000000000 --- a/packages/ui/src/forms/fields/HiddenInput/types.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type HiddenInputFieldProps = { - disableModifyingForm?: false - name: string - path?: string - value?: unknown -} diff --git a/packages/ui/src/forms/fields/JSON/types.ts b/packages/ui/src/forms/fields/JSON/types.ts deleted file mode 100644 index 165a319123d..00000000000 --- a/packages/ui/src/forms/fields/JSON/types.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { FieldBase, JSONField } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type JSONFieldProps = FormFieldBase & { - editorOptions?: JSONField['admin']['editorOptions'] - label?: FieldBase['label'] - name?: string - path?: string - width?: string -} diff --git a/packages/ui/src/forms/fields/Number/types.ts b/packages/ui/src/forms/fields/Number/types.ts deleted file mode 100644 index c5bcf842b78..00000000000 --- a/packages/ui/src/forms/fields/Number/types.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { FieldBase, NumberField } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type NumberFieldProps = FormFieldBase & { - hasMany?: boolean - label?: FieldBase['label'] - max?: number - maxRows?: number - min?: number - name?: string - onChange?: (e: number) => void - path?: string - placeholder?: NumberField['admin']['placeholder'] - step?: number - width?: string -} diff --git a/packages/ui/src/forms/fields/Password/types.ts b/packages/ui/src/forms/fields/Password/types.ts deleted file mode 100644 index 76db0a2cc11..00000000000 --- a/packages/ui/src/forms/fields/Password/types.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Validate } from 'payload/types' -import type { Description } from 'payload/types' -import type React from 'react' - -import type { FormFieldBase } from '../shared.js' - -export type PasswordFieldProps = FormFieldBase & { - autoComplete?: string - className?: string - description?: Description - disabled?: boolean - label?: string - name: string - path?: string - required?: boolean - style?: React.CSSProperties - validate?: Validate - width?: string -} diff --git a/packages/ui/src/forms/fields/Point/types.ts b/packages/ui/src/forms/fields/Point/types.ts deleted file mode 100644 index decc7d7ad29..00000000000 --- a/packages/ui/src/forms/fields/Point/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FieldBase } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type PointFieldProps = FormFieldBase & { - label?: FieldBase['label'] - name?: string - path?: string - placeholder?: string - step?: number - width?: string -} diff --git a/packages/ui/src/forms/fields/RadioGroup/types.ts b/packages/ui/src/forms/fields/RadioGroup/types.ts deleted file mode 100644 index 9bb573e22ae..00000000000 --- a/packages/ui/src/forms/fields/RadioGroup/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { FieldBase, Option } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type RadioFieldProps = FormFieldBase & { - label?: FieldBase['label'] - layout?: 'horizontal' | 'vertical' - name?: string - onChange?: OnChange - options?: Option[] - path?: string - value?: string - width?: string -} - -export type OnChange<T = string> = (value: T) => void diff --git a/packages/ui/src/forms/fields/RichText/index.tsx b/packages/ui/src/forms/fields/RichText/index.tsx deleted file mode 100644 index 289ca049174..00000000000 --- a/packages/ui/src/forms/fields/RichText/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import type React from 'react' - -import type { RichTextFieldProps } from './types.js' - -const RichText: React.FC<RichTextFieldProps> = (props) => { - return null -} - -export default RichText diff --git a/packages/ui/src/forms/fields/RichText/types.ts b/packages/ui/src/forms/fields/RichText/types.ts deleted file mode 100644 index 8e116ba9fe2..00000000000 --- a/packages/ui/src/forms/fields/RichText/types.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { MappedField } from '@payloadcms/ui' - -import type { FormFieldBase } from '../shared.js' - -export type RichTextFieldProps = FormFieldBase & { - richTextComponentMap?: Map<string, MappedField[] | React.ReactNode> -} diff --git a/packages/ui/src/forms/fields/Select/types.ts b/packages/ui/src/forms/fields/Select/types.ts deleted file mode 100644 index 433a5405092..00000000000 --- a/packages/ui/src/forms/fields/Select/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { FieldBase, Option } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type SelectFieldProps = FormFieldBase & { - hasMany?: boolean - isClearable?: boolean - isSortable?: boolean - label?: FieldBase['label'] - name?: string - onChange?: (e: string) => void - options?: Option[] - path?: string - value?: string - width?: string -} diff --git a/packages/ui/src/forms/fields/Tabs/types.ts b/packages/ui/src/forms/fields/Tabs/types.ts deleted file mode 100644 index ac0cd29cb09..00000000000 --- a/packages/ui/src/forms/fields/Tabs/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { FieldPermissions } from 'payload/auth' - -import type { FieldMap, MappedTab } from '../../../utilities/buildComponentMap/types.js' -import type { FormFieldBase } from '../shared.js' - -export type TabsFieldProps = FormFieldBase & { - fieldMap: FieldMap - forceRender?: boolean - indexPath: string - name?: string - path?: string - permissions: FieldPermissions - tabs?: MappedTab[] - width?: string -} diff --git a/packages/ui/src/forms/fields/Text/types.ts b/packages/ui/src/forms/fields/Text/types.ts deleted file mode 100644 index 5b7ca3fc666..00000000000 --- a/packages/ui/src/forms/fields/Text/types.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { FieldBase, TextField } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type TextFieldProps = FormFieldBase & { - hasMany?: boolean - inputRef?: React.MutableRefObject<HTMLInputElement> - label?: FieldBase['label'] - maxLength?: number - maxRows?: number - minLength?: number - minRows?: number - name?: string - onKeyDown?: React.KeyboardEventHandler<HTMLInputElement> - path?: string - placeholder?: TextField['admin']['placeholder'] - width?: string -} diff --git a/packages/ui/src/forms/fields/Textarea/types.ts b/packages/ui/src/forms/fields/Textarea/types.ts deleted file mode 100644 index 647fecc3010..00000000000 --- a/packages/ui/src/forms/fields/Textarea/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { FieldBase, TextareaField } from 'payload/types.js' - -import type { FormFieldBase } from '../shared.js' - -export type TextareaFieldProps = FormFieldBase & { - label?: FieldBase['label'] - maxLength?: number - minLength?: number - name?: string - path?: string - placeholder?: TextareaField['admin']['placeholder'] - rows?: number - width?: string -} diff --git a/packages/ui/src/forms/fields/index.tsx b/packages/ui/src/forms/fields/index.tsx deleted file mode 100644 index d23e2350b94..00000000000 --- a/packages/ui/src/forms/fields/index.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import type { FieldTypes } from 'payload/config' - -import array from './Array/index.js' -import blocks from './Blocks/index.js' -import checkbox from './Checkbox/index.js' -import code from './Code/index.js' -import collapsible from './Collapsible/index.js' -import confirmPassword from './ConfirmPassword/index.js' -import date from './DateTime/index.js' -import email from './Email/index.js' -import group from './Group/index.js' -import hidden from './HiddenInput/index.js' -import json from './JSON/index.js' -import number from './Number/index.js' -import password from './Password/index.js' -import point from './Point/index.js' -import radio from './RadioGroup/index.js' -import relationship from './Relationship/index.js' -import richText from './RichText/index.js' -import row from './Row/index.js' -import select from './Select/index.js' -import tabs from './Tabs/index.js' -import text from './Text/index.js' -import textarea from './Textarea/index.js' -import ui from './UI/index.js' -import upload from './Upload/index.js' - -export const fieldComponents: FieldTypes = { - array, - blocks, - checkbox, - code, - collapsible, - confirmPassword, - date, - email, - group, - hidden, - json, - number, - password, - point, - radio, - relationship, - richText, - row, - select, - tabs, - text, - textarea, - ui, - upload, -} diff --git a/packages/ui/src/hooks/useAdminThumbnail.tsx b/packages/ui/src/hooks/useAdminThumbnail.ts similarity index 100% rename from packages/ui/src/hooks/useAdminThumbnail.tsx rename to packages/ui/src/hooks/useAdminThumbnail.ts diff --git a/packages/ui/src/hooks/useDebounce.tsx b/packages/ui/src/hooks/useDebounce.ts similarity index 80% rename from packages/ui/src/hooks/useDebounce.tsx rename to packages/ui/src/hooks/useDebounce.ts index 0dac1cca9b3..98638eede3b 100644 --- a/packages/ui/src/hooks/useDebounce.tsx +++ b/packages/ui/src/hooks/useDebounce.ts @@ -1,8 +1,7 @@ 'use client' import { useEffect, useState } from 'react' -// Our hook -export default function useDebounce<T = unknown>(value: T, delay: number): T { +export function useDebounce<T = unknown>(value: T, delay: number): T { // State and setters for debounced value const [debouncedValue, setDebouncedValue] = useState(value) diff --git a/packages/ui/src/hooks/useUseAsTitle.tsx b/packages/ui/src/hooks/useUseAsTitle.ts similarity index 100% rename from packages/ui/src/hooks/useUseAsTitle.tsx rename to packages/ui/src/hooks/useUseAsTitle.ts diff --git a/packages/ui/src/utilities/buildComponentMap/mapFields.tsx b/packages/ui/src/utilities/buildComponentMap/mapFields.tsx index 0c7bae03c1b..9c59f34cea8 100644 --- a/packages/ui/src/utilities/buildComponentMap/mapFields.tsx +++ b/packages/ui/src/utilities/buildComponentMap/mapFields.tsx @@ -4,26 +4,26 @@ import { fieldAffectsData, fieldIsPresentationalOnly } from 'payload/types' import { isPlainObject } from 'payload/utilities' import React, { Fragment } from 'react' +import type { ArrayFieldProps } from '../../fields/Array/index.js' +import type { BlocksFieldProps } from '../../fields/Blocks/index.js' +import type { CheckboxFieldProps } from '../../fields/Checkbox/index.js' +import type { CodeFieldProps } from '../../fields/Code/index.js' +import type { CollapsibleFieldProps } from '../../fields/Collapsible/index.js' +import type { DateFieldProps } from '../../fields/DateTime/index.js' +import type { EmailFieldProps } from '../../fields/Email/index.js' +import type { GroupFieldProps } from '../../fields/Group/index.js' +import type { JSONFieldProps } from '../../fields/JSON/index.js' +import type { NumberFieldProps } from '../../fields/Number/index.js' +import type { PointFieldProps } from '../../fields/Point/index.js' +import type { RelationshipFieldProps } from '../../fields/Relationship/types.js' +import type { RowFieldProps } from '../../fields/Row/types.js' +import type { SelectFieldProps } from '../../fields/Select/index.js' +import type { TabsFieldProps } from '../../fields/Tabs/index.js' +import type { TextFieldProps } from '../../fields/Text/types.js' +import type { TextareaFieldProps } from '../../fields/Textarea/types.js' +import type { UploadFieldProps } from '../../fields/Upload/types.js' +import type { FormFieldBase } from '../../fields/shared.js' import type { Props as FieldDescription } from '../../forms/FieldDescription/types.js' -import type { ArrayFieldProps } from '../../forms/fields/Array/types.js' -import type { BlocksFieldProps } from '../../forms/fields/Blocks/types.js' -import type { CheckboxFieldProps } from '../../forms/fields/Checkbox/types.js' -import type { CodeFieldProps } from '../../forms/fields/Code/types.js' -import type { CollapsibleFieldProps } from '../../forms/fields/Collapsible/types.js' -import type { DateFieldProps } from '../../forms/fields/DateTime/types.js' -import type { EmailFieldProps } from '../../forms/fields/Email/types.js' -import type { GroupFieldProps } from '../../forms/fields/Group/types.js' -import type { JSONFieldProps } from '../../forms/fields/JSON/types.js' -import type { NumberFieldProps } from '../../forms/fields/Number/types.js' -import type { PointFieldProps } from '../../forms/fields/Point/types.js' -import type { RelationshipFieldProps } from '../../forms/fields/Relationship/types.js' -import type { RowFieldProps } from '../../forms/fields/Row/types.js' -import type { SelectFieldProps } from '../../forms/fields/Select/types.js' -import type { TabsFieldProps } from '../../forms/fields/Tabs/types.js' -import type { TextFieldProps } from '../../forms/fields/Text/types.js' -import type { TextareaFieldProps } from '../../forms/fields/Textarea/types.js' -import type { UploadFieldProps } from '../../forms/fields/Upload/types.js' -import type { FormFieldBase } from '../../forms/fields/shared.js' import type { FieldComponentProps, FieldMap, @@ -34,10 +34,10 @@ import type { import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js' import { SortColumn } from '../../elements/SortColumn/index.js' -import DefaultError from '../../forms/Error/index.js' -import DefaultDescription from '../../forms/FieldDescription/index.js' -import DefaultLabel from '../../forms/Label/index.js' -import { HiddenInput } from '../../index.js' +import { HiddenInput } from '../../fields/HiddenInput/index.js' +import { Error as DefaultError } from '../../forms/Error/index.js' +import { FieldDescription as DefaultDescription } from '../../forms/FieldDescription/index.js' +import { Label as DefaultLabel } from '../../forms/Label/index.js' export const mapFields = (args: { DefaultCell?: React.FC<any> diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 726a01c8e59..fa027bb41ce 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -28,6 +28,6 @@ "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json" - ], +, "src/hooks/useUseAsTitle.sx" ], "references": [{ "path": "../payload" }, { "path": "../translations" }] } diff --git a/tsconfig.json b/tsconfig.json index 8350e3acf05..8ffa99e281d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -36,63 +36,6 @@ } ], "paths": { - "payload": [ - "./packages/payload/src" - ], - "payload/*": [ - "./packages/payload/src/exports/*" - ], - "@payloadcms/db-mongodb": [ - "./packages/db-mongodb/src" - ], - "@payloadcms/live-preview": [ - "./packages/live-preview/src" - ], - "@payloadcms/live-preview-react": [ - "./packages/live-preview-react/src/index.ts" - ], - "@payloadcms/richtext-lexical": [ - "./packages/richtext-lexical/src" - ], - "@payloadcms/richtext-slate": [ - "./packages/richtext-slate/src" - ], - "@payloadcms/plugin-cloud": [ - "./packages/plugin-cloud/src" - ], - "@payloadcms/plugin-cloud-storage": [ - "./packages/plugin-cloud-storage/src" - ], - "@payloadcms/ui": [ - "./packages/ui/src/exports/index.ts" - ], - "@payloadcms/ui/*": [ - "./packages/ui/src/exports/*" - ], - "@payloadcms/ui/scss": [ - "./packages/ui/src/scss/styles.scss" - ], - "@payloadcms/ui/scss/app.scss": [ - "./packages/ui/src/scss/app.scss" - ], - "@payloadcms/translations": [ - "./packages/translations/src/exports/index.ts" - ], - "@payloadcms/translations/client": [ - "./packages/translations/src/_generatedFiles_/client/index.ts" - ], - "@payloadcms/translations/api": [ - "./packages/translations/src/_generatedFiles_/api/index.ts" - ], - "@payloadcms/next/*": [ - "./packages/next/src/*" - ], - "@payloadcms/next": [ - "./packages/next/src/exports/*" - ], - "@payloadcms/graphql": [ - "./packages/graphql/src" - ], "@payload-config": [ "./test/_community/config.ts" ] @@ -167,8 +110,6 @@ "include": [ "next-env.d.ts", ".next/types/**/*.ts", - "app/**/*.ts", - "app/**/*.tsx", "scripts/**/*.ts" ] } \ No newline at end of file
2a932ea28e50e4aa10b598e7cc194ff6d54c7cea
2023-07-20 23:36:26
Jacob Fletcher
chore: updates auth example (#3026)
false
updates auth example (#3026)
chore
diff --git a/examples/auth/cms/README.md b/examples/auth/cms/README.md index 4ceee99dbd1..54f62a4e0f1 100644 --- a/examples/auth/cms/README.md +++ b/examples/auth/cms/README.md @@ -1,8 +1,11 @@ # Payload Auth Example -This example demonstrates how to implement [Payload Authentication](https://payloadcms.com/docs/authentication/overview). +This example demonstrates how to implement [Payload Authentication](https://payloadcms.com/docs/authentication/overview). Follow the [Quick Start](#quick-start) to get up and running quickly. There are various fully working front-ends made explicitly for this example, including: -There is a fully working Next.js app made explicitly for this example which can be found [here](../next-app). Follow the instructions there to get started. If you are setting up authentication for another front-end, please consider contributing to this repo with your own example! +- [Next.js App Router](../next-app) +- [Next.js Pages Router](../next-pages) + +Follow the instructions in each respective README to get started. If you are setting up authentication for another front-end, please consider contributing to this repo with your own example! ## Quick Start diff --git a/examples/auth/next-app/README.md b/examples/auth/next-app/README.md index b0140e6ea0b..b6623743df9 100644 --- a/examples/auth/next-app/README.md +++ b/examples/auth/next-app/README.md @@ -1,6 +1,6 @@ # Payload Auth Example Front-End -This is a [Next.js](https://nextjs.org) app using the [App Router](https://nextjs.org/docs/app). It was made explicitly for Payload's [Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth/cms). +This is a [Payload](https://payloadcms.com) + [Next.js](https://nextjs.org) app using the [App Router](https://nextjs.org/docs/app) made explicitly for the [Payload Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth). It demonstrates how to authenticate your Next.js app using [Payload Authentication](https://payloadcms.com/docs/authentication/overview). > This example uses the App Router, the latest API of Next.js. If your app is using the legacy [Pages Router](https://nextjs.org/docs/pages), check out the official [Pages Router Example](https://github.com/payloadcms/payload/tree/master/examples/auth/next-pages). @@ -8,7 +8,7 @@ This is a [Next.js](https://nextjs.org) app using the [App Router](https://nextj ### Payload -First you'll need a running [Payload](https://github.com/payloadcms/payload) app. If you have not done so already, open up the `cms` folder and follow the setup instructions. Take note of your `serverURL`, you'll need this in the next step. +First you'll need a running Payload app. If you have not done so already, clone down the [`cms`](../cms) folder and follow the setup instructions there to get it up and running. This will provide all the necessary APIs that your Next.js app will be using for authentication. ### Next.js @@ -18,7 +18,7 @@ First you'll need a running [Payload](https://github.com/payloadcms/payload) app 4. `yarn dev` or `npm run dev` to start the server 5. `open http://localhost:3001` to see the result -Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the [Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth/cms) for full details. +Once running, a user is automatically seeded in your local environment with some basic instructions. See the [Payload Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth) for full details. ## Learn More @@ -35,3 +35,7 @@ You can check out [the Payload GitHub repository](https://github.com/payloadcms/ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new) from the creators of Next.js. You could also combine this app into a [single Express server](https://github.com/payloadcms/payload/tree/master/examples/custom-server) and deploy in to [Payload Cloud](https://payloadcms.com/new/import). Check out our [Payload deployment documentation](https://payloadcms.com/docs/production/deployment) or the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. + +## Questions + +If you have any issues or questions, reach out to us on [Discord](https://discord.com/invite/payload) or start a [GitHub discussion](https://github.com/payloadcms/payload/discussions). diff --git a/examples/auth/next-app/app/_components/Button/index.module.scss b/examples/auth/next-app/app/_components/Button/index.module.scss new file mode 100644 index 00000000000..aa8b5ac784a --- /dev/null +++ b/examples/auth/next-app/app/_components/Button/index.module.scss @@ -0,0 +1,40 @@ +@import '../../_css/type.scss'; + +.button { + border: none; + cursor: pointer; + display: inline-flex; + justify-content: center; + background-color: transparent; + text-decoration: none; + display: inline-flex; + padding: 12px 24px; +} + +.content { + display: flex; + align-items: center; + justify-content: space-around; +} + +.label { + @extend %label; + text-align: center; + display: flex; + align-items: center; +} + +.appearance--primary { + background-color: var(--theme-elevation-1000); + color: var(--theme-elevation-0); +} + +.appearance--secondary { + background-color: transparent; + box-shadow: inset 0 0 0 1px var(--theme-elevation-1000); +} + +.appearance--default { + padding: 0; + color: var(--theme-text); +} diff --git a/examples/auth/next-app/app/_components/Button/index.tsx b/examples/auth/next-app/app/_components/Button/index.tsx new file mode 100644 index 00000000000..eb4e2737b50 --- /dev/null +++ b/examples/auth/next-app/app/_components/Button/index.tsx @@ -0,0 +1,75 @@ +'use client' + +import React, { ElementType } from 'react' +import Link from 'next/link' + +import classes from './index.module.scss' + +export type Props = { + label?: string + appearance?: 'default' | 'primary' | 'secondary' + el?: 'button' | 'link' | 'a' + onClick?: () => void + href?: string + newTab?: boolean + className?: string + type?: 'submit' | 'button' + disabled?: boolean + invert?: boolean +} + +export const Button: React.FC<Props> = ({ + el: elFromProps = 'link', + label, + newTab, + href, + appearance, + className: classNameFromProps, + onClick, + type = 'button', + disabled, + invert, +}) => { + let el = elFromProps + const newTabProps = newTab ? { target: '_blank', rel: 'noopener noreferrer' } : {} + + const className = [ + classes.button, + classNameFromProps, + classes[`appearance--${appearance}`], + invert && classes[`${appearance}--invert`], + ] + .filter(Boolean) + .join(' ') + + const content = ( + <div className={classes.content}> + <span className={classes.label}>{label}</span> + </div> + ) + + if (onClick || type === 'submit') el = 'button' + + if (el === 'link') { + return ( + <Link href={href || ''} className={className} {...newTabProps} onClick={onClick}> + {content} + </Link> + ) + } + + const Element: ElementType = el + + return ( + <Element + href={href} + className={className} + type={type} + {...newTabProps} + onClick={onClick} + disabled={disabled} + > + {content} + </Element> + ) +} diff --git a/examples/auth/next-app/app/_components/Gutter/index.module.scss b/examples/auth/next-app/app/_components/Gutter/index.module.scss index 09f9f61be3d..be9e377a789 100644 --- a/examples/auth/next-app/app/_components/Gutter/index.module.scss +++ b/examples/auth/next-app/app/_components/Gutter/index.module.scss @@ -1,7 +1,7 @@ .gutter { - max-width: var(--max-width); - width: 100%; - margin: auto; + max-width: 1920px; + margin-left: auto; + margin-right: auto; } .gutterLeft { diff --git a/examples/auth/next-app/app/_components/Header/Nav/index.module.scss b/examples/auth/next-app/app/_components/Header/Nav/index.module.scss new file mode 100644 index 00000000000..6aa7cb85cf6 --- /dev/null +++ b/examples/auth/next-app/app/_components/Header/Nav/index.module.scss @@ -0,0 +1,20 @@ +@use '../../../_css/queries.scss' as *; + +.nav { + display: flex; + gap: calc(var(--base) / 4) var(--base); + align-items: center; + flex-wrap: wrap; + opacity: 1; + transition: opacity 100ms linear; + visibility: visible; + + > * { + text-decoration: none; + } +} + +.hide { + opacity: 0; + visibility: hidden; +} diff --git a/examples/auth/next-app/app/_components/Header/Nav/index.tsx b/examples/auth/next-app/app/_components/Header/Nav/index.tsx new file mode 100644 index 00000000000..0015b0ec8a9 --- /dev/null +++ b/examples/auth/next-app/app/_components/Header/Nav/index.tsx @@ -0,0 +1,38 @@ +'use client' + +import React from 'react' +import Link from 'next/link' + +import { useAuth } from '../../../_providers/Auth' + +import classes from './index.module.scss' + +export const HeaderNav: React.FC = () => { + const { user } = useAuth() + + return ( + <nav + className={[ + classes.nav, + // fade the nav in on user load to avoid flash of content and layout shift + // Vercel also does this in their own website header, see https://vercel.com + user === undefined && classes.hide, + ] + .filter(Boolean) + .join(' ')} + > + {user && ( + <React.Fragment> + <Link href="/account">Account</Link> + <Link href="/logout">Logout</Link> + </React.Fragment> + )} + {!user && ( + <React.Fragment> + <Link href="/login">Login</Link> + <Link href="/create-account">Create Account</Link> + </React.Fragment> + )} + </nav> + ) +} diff --git a/examples/auth/next-app/app/_components/Header/index.client.tsx b/examples/auth/next-app/app/_components/Header/index.client.tsx deleted file mode 100644 index 81683e616f8..00000000000 --- a/examples/auth/next-app/app/_components/Header/index.client.tsx +++ /dev/null @@ -1,31 +0,0 @@ -'use client' - -import React, { Fragment } from 'react' -import Link from 'next/link' - -import { useAuth } from '../Auth' - -import classes from './index.module.scss' - -export function HeaderClient() { - const { user } = useAuth() - - return ( - <nav className={classes.nav}> - {!user && ( - <Fragment> - <Link href="/login">Login</Link> - <Link href="/create-account">Create Account</Link> - </Fragment> - )} - {user && ( - <Fragment> - <Link href="/account">Account</Link> - <Link href="/logout">Logout</Link> - </Fragment> - )} - </nav> - ) -} - -export default HeaderClient diff --git a/examples/auth/next-app/app/_components/Header/index.module.scss b/examples/auth/next-app/app/_components/Header/index.module.scss index e71cfd33fb3..9478b92ec83 100644 --- a/examples/auth/next-app/app/_components/Header/index.module.scss +++ b/examples/auth/next-app/app/_components/Header/index.module.scss @@ -1,3 +1,5 @@ +@use '../../_css/queries.scss' as *; + .header { padding: var(--base) 0; } @@ -5,28 +7,16 @@ .wrap { display: flex; justify-content: space-between; - gap: calc(var(--base) / 2); flex-wrap: wrap; + gap: calc(var(--base) / 2) var(--base); } .logo { - flex-shrink: 0; + width: 150px; } -.nav { - display: flex; - align-items: center; - gap: var(--base); - white-space: nowrap; - overflow: hidden; - flex-wrap: wrap; - - a { - display: block; - text-decoration: none; - } - - @media (max-width: 1000px) { - gap: 0 calc(var(--base) / 2); +:global([data-theme="light"]) { + .logo { + filter: invert(1); } } diff --git a/examples/auth/next-app/app/_components/Header/index.tsx b/examples/auth/next-app/app/_components/Header/index.tsx index 7ac6f746ca7..ba6015f8420 100644 --- a/examples/auth/next-app/app/_components/Header/index.tsx +++ b/examples/auth/next-app/app/_components/Header/index.tsx @@ -3,7 +3,7 @@ import Image from 'next/image' import Link from 'next/link' import { Gutter } from '../Gutter' -import { HeaderClient } from './index.client' +import { HeaderNav } from './Nav' import classes from './index.module.scss' @@ -25,7 +25,7 @@ export function Header() { /> </picture> </Link> - <HeaderClient /> + <HeaderNav /> </Gutter> </header> ) diff --git a/examples/auth/next-app/app/_components/Input/index.module.css b/examples/auth/next-app/app/_components/Input/index.module.css deleted file mode 100644 index 655128696e6..00000000000 --- a/examples/auth/next-app/app/_components/Input/index.module.css +++ /dev/null @@ -1,23 +0,0 @@ -.input { - margin-bottom: 15px; -} - -.input input { - width: 100%; - font-family: system-ui; - border-radius: 0; - box-shadow: 0; - border: 1px solid #d8d8d8; - height: 30px; - line-height: 30px; -} - -.label { - margin-bottom: 10px; - display: block; -} - -.error { - margin-top: 5px; - color: red; -} diff --git a/examples/auth/next-app/app/_components/Input/index.module.scss b/examples/auth/next-app/app/_components/Input/index.module.scss new file mode 100644 index 00000000000..e2dfab23bdd --- /dev/null +++ b/examples/auth/next-app/app/_components/Input/index.module.scss @@ -0,0 +1,56 @@ +@import '../../_css/common'; + +.inputWrap { + width: 100%; +} + +.input { + width: 100%; + font-family: system-ui; + border-radius: 0; + box-shadow: none; + border: none; + background: none; + background-color: var(--theme-elevation-100); + color: var(--theme-elevation-1000); + height: calc(var(--base) * 2); + line-height: calc(var(--base) * 2); + padding: 0 calc(var(--base) / 2); + + &:focus { + border: none; + outline: none; + } + + &:-webkit-autofill, + &:-webkit-autofill:hover, + &:-webkit-autofill:focus { + -webkit-text-fill-color: var(--theme-text); + -webkit-box-shadow: 0 0 0px 1000px var(--theme-elevation-150) inset; + transition: background-color 5000s ease-in-out 0s; + } +} + +@media (prefers-color-scheme: dark) { + .input { + background-color: var(--theme-elevation-150); + } +} + +.error { + background-color: var(--theme-error-150); +} + +.label { + margin-bottom: 0; + display: block; + line-height: 1; + margin-bottom: calc(var(--base) / 2); +} + +.errorMessage { + font-size: small; + line-height: 1.25; + margin-top: 4px; + color: red; +} diff --git a/examples/auth/next-app/app/_components/Input/index.tsx b/examples/auth/next-app/app/_components/Input/index.tsx index 8d4aaf5b4e8..771626cf0a2 100644 --- a/examples/auth/next-app/app/_components/Input/index.tsx +++ b/examples/auth/next-app/app/_components/Input/index.tsx @@ -1,7 +1,7 @@ import React from 'react' -import { FieldValues, UseFormRegister } from 'react-hook-form' +import { FieldValues, UseFormRegister, Validate } from 'react-hook-form' -import classes from './index.module.css' +import classes from './index.module.scss' type Props = { name: string @@ -9,7 +9,8 @@ type Props = { register: UseFormRegister<FieldValues & any> required?: boolean error: any - type?: 'text' | 'number' | 'password' + type?: 'text' | 'number' | 'password' | 'email' + validate?: (value: string) => boolean | string } export const Input: React.FC<Props> = ({ @@ -19,14 +20,36 @@ export const Input: React.FC<Props> = ({ register, error, type = 'text', + validate, }) => { return ( - <div className={classes.input}> + <div className={classes.inputWrap}> <label htmlFor="name" className={classes.label}> - {label} + {`${label} ${required ? '*' : ''}`} </label> - <input {...{ type }} {...register(name, { required })} /> - {error && <div className={classes.error}>This field is required</div>} + <input + className={[classes.input, error && classes.error].filter(Boolean).join(' ')} + {...{ type }} + {...register(name, { + required, + validate, + ...(type === 'email' + ? { + pattern: { + value: /\S+@\S+\.\S+/, + message: 'Please enter a valid email', + }, + } + : {}), + })} + /> + {error && ( + <div className={classes.errorMessage}> + {!error?.message && error?.type === 'required' + ? 'This field is required' + : error?.message} + </div> + )} </div> ) } diff --git a/examples/auth/next-app/app/_components/Message/index.module.scss b/examples/auth/next-app/app/_components/Message/index.module.scss new file mode 100644 index 00000000000..21273d940c3 --- /dev/null +++ b/examples/auth/next-app/app/_components/Message/index.module.scss @@ -0,0 +1,46 @@ +@import '../../_css/common'; + +.message { + padding: calc(var(--base) / 2) calc(var(--base) / 2); + line-height: 1.25; + width: 100%; +} + +.default { + background-color: var(--theme-elevation-100); + color: var(--theme-elevation-1000); +} + +.warning { + background-color: var(--theme-warning-500); + color: var(--theme-warning-900); +} + +.error { + background-color: var(--theme-error-500); + color: var(--theme-error-900); +} + +.success { + background-color: var(--theme-success-500); + color: var(--theme-success-900); +} + +@media (prefers-color-scheme: dark) { + .default { + background-color: var(--theme-elevation-900); + color: var(--theme-elevation-100); + } + + .warning { + color: var(--theme-warning-100); + } + + .error { + color: var(--theme-error-100); + } + + .success { + color: var(--theme-success-100); + } +} diff --git a/examples/auth/next-app/app/_components/Message/index.tsx b/examples/auth/next-app/app/_components/Message/index.tsx new file mode 100644 index 00000000000..3cd80608683 --- /dev/null +++ b/examples/auth/next-app/app/_components/Message/index.tsx @@ -0,0 +1,33 @@ +import React from 'react' + +import classes from './index.module.scss' + +export const Message: React.FC<{ + message?: React.ReactNode + error?: React.ReactNode + success?: React.ReactNode + warning?: React.ReactNode + className?: string +}> = ({ message, error, success, warning, className }) => { + const messageToRender = message || error || success || warning + + if (messageToRender) { + return ( + <div + className={[ + classes.message, + className, + error && classes.error, + success && classes.success, + warning && classes.warning, + !error && !success && !warning && classes.default, + ] + .filter(Boolean) + .join(' ')} + > + {messageToRender} + </div> + ) + } + return null +} diff --git a/examples/auth/next-app/app/_components/RenderParams/index.tsx b/examples/auth/next-app/app/_components/RenderParams/index.tsx new file mode 100644 index 00000000000..b758a3fa8c9 --- /dev/null +++ b/examples/auth/next-app/app/_components/RenderParams/index.tsx @@ -0,0 +1,29 @@ +'use client' + +import { useSearchParams } from 'next/navigation' + +import { Message } from '../Message' + +export const RenderParams: React.FC<{ + params?: string[] + message?: string + className?: string +}> = ({ params = ['error', 'message', 'success'], message, className }) => { + const searchParams = useSearchParams() + const paramValues = params.map(param => searchParams.get(param)).filter(Boolean) + + if (paramValues.length) { + return ( + <div className={className}> + {paramValues.map(paramValue => ( + <Message + key={paramValue} + message={(message || 'PARAM')?.replace('PARAM', paramValue || '')} + /> + ))} + </div> + ) + } + + return null +} diff --git a/examples/auth/next-app/app/_css/app.scss b/examples/auth/next-app/app/_css/app.scss new file mode 100644 index 00000000000..fcf6af75664 --- /dev/null +++ b/examples/auth/next-app/app/_css/app.scss @@ -0,0 +1,117 @@ +@use './queries.scss' as *; +@use './colors.scss' as *; +@use './type.scss' as *; +@import "./theme.scss"; + +:root { + --base: 24px; + --font-body: system-ui; + --font-mono: 'Roboto Mono', monospace; + + --gutter-h: 180px; + --block-padding: 120px; + + @include large-break { + --gutter-h: 144px; + --block-padding: 96px; + } + + @include mid-break { + --gutter-h: 24px; + --block-padding: 60px; + } +} + +* { + box-sizing: border-box; +} + +html { + @extend %body; + background: var(--theme-bg); + -webkit-font-smoothing: antialiased; +} + +html, +body, +#app { + height: 100%; +} + +body { + font-family: var(--font-body); + margin: 0; + color: var(--theme-text); +} + +::selection { + background: var(--theme-success-500); + color: var(--color-base-800); +} + +::-moz-selection { + background: var(--theme-success-500); + color: var(--color-base-800); +} + +img { + max-width: 100%; + height: auto; + display: block; +} + +h1 { + @extend %h1; +} + +h2 { + @extend %h2; +} + +h3 { + @extend %h3; +} + +h4 { + @extend %h4; +} + +h5 { + @extend %h5; +} + +h6 { + @extend %h6; +} + +p { + margin: var(--base) 0; + + @include mid-break { + margin: calc(var(--base) * .75) 0; + } +} + +ul, +ol { + padding-left: var(--base); + margin: 0 0 var(--base); +} + +a { + color: currentColor; + + &:focus { + opacity: .8; + outline: none; + } + + &:active { + opacity: .7; + outline: none; + } +} + +svg { + vertical-align: middle; +} diff --git a/examples/auth/next-app/app/_css/colors.scss b/examples/auth/next-app/app/_css/colors.scss new file mode 100644 index 00000000000..68bcbc2d594 --- /dev/null +++ b/examples/auth/next-app/app/_css/colors.scss @@ -0,0 +1,83 @@ +:root { + --color-base-0: rgb(255, 255, 255); + --color-base-50: rgb(245, 245, 245); + --color-base-100: rgb(235, 235, 235); + --color-base-150: rgb(221, 221, 221); + --color-base-200: rgb(208, 208, 208); + --color-base-250: rgb(195, 195, 195); + --color-base-300: rgb(181, 181, 181); + --color-base-350: rgb(168, 168, 168); + --color-base-400: rgb(154, 154, 154); + --color-base-450: rgb(141, 141, 141); + --color-base-500: rgb(128, 128, 128); + --color-base-550: rgb(114, 114, 114); + --color-base-600: rgb(101, 101, 101); + --color-base-650: rgb(87, 87, 87); + --color-base-700: rgb(74, 74, 74); + --color-base-750: rgb(60, 60, 60); + --color-base-800: rgb(47, 47, 47); + --color-base-850: rgb(34, 34, 34); + --color-base-900: rgb(20, 20, 20); + --color-base-950: rgb(7, 7, 7); + --color-base-1000: rgb(0, 0, 0); + + --color-success-50: rgb(247, 255, 251); + --color-success-100: rgb(240, 255, 247); + --color-success-150: rgb(232, 255, 243); + --color-success-200: rgb(224, 255, 239); + --color-success-250: rgb(217, 255, 235); + --color-success-300: rgb(209, 255, 230); + --color-success-350: rgb(201, 255, 226); + --color-success-400: rgb(193, 255, 222); + --color-success-450: rgb(186, 255, 218); + --color-success-500: rgb(178, 255, 214); + --color-success-550: rgb(160, 230, 193); + --color-success-600: rgb(142, 204, 171); + --color-success-650: rgb(125, 179, 150); + --color-success-700: rgb(107, 153, 128); + --color-success-750: rgb(89, 128, 107); + --color-success-800: rgb(71, 102, 86); + --color-success-850: rgb(53, 77, 64); + --color-success-900: rgb(36, 51, 43); + --color-success-950: rgb(18, 25, 21); + + --color-warning-50: rgb(255, 255, 246); + --color-warning-100: rgb(255, 255, 237); + --color-warning-150: rgb(254, 255, 228); + --color-warning-200: rgb(254, 255, 219); + --color-warning-250: rgb(254, 255, 210); + --color-warning-300: rgb(254, 255, 200); + --color-warning-350: rgb(254, 255, 191); + --color-warning-400: rgb(253, 255, 182); + --color-warning-450: rgb(253, 255, 173); + --color-warning-500: rgb(253, 255, 164); + --color-warning-550: rgb(228, 230, 148); + --color-warning-600: rgb(202, 204, 131); + --color-warning-650: rgb(177, 179, 115); + --color-warning-700: rgb(152, 153, 98); + --color-warning-750: rgb(127, 128, 82); + --color-warning-800: rgb(101, 102, 66); + --color-warning-850: rgb(76, 77, 49); + --color-warning-900: rgb(51, 51, 33); + --color-warning-950: rgb(25, 25, 16); + + --color-error-50: rgb(255, 241, 241); + --color-error-100: rgb(255, 226, 228); + --color-error-150: rgb(255, 212, 214); + --color-error-200: rgb(255, 197, 200); + --color-error-250: rgb(255, 183, 187); + --color-error-300: rgb(255, 169, 173); + --color-error-350: rgb(255, 154, 159); + --color-error-400: rgb(255, 140, 145); + --color-error-450: rgb(255, 125, 132); + --color-error-500: rgb(255, 111, 118); + --color-error-550: rgb(230, 100, 106); + --color-error-600: rgb(204, 89, 94); + --color-error-650: rgb(179, 78, 83); + --color-error-700: rgb(153, 67, 71); + --color-error-750: rgb(128, 56, 59); + --color-error-800: rgb(102, 44, 47); + --color-error-850: rgb(77, 33, 35); + --color-error-900: rgb(51, 22, 24); + --color-error-950: rgb(25, 11, 12); +} diff --git a/examples/auth/next-app/app/_css/common.scss b/examples/auth/next-app/app/_css/common.scss new file mode 100644 index 00000000000..bebb9f3aa20 --- /dev/null +++ b/examples/auth/next-app/app/_css/common.scss @@ -0,0 +1 @@ +@forward './queries.scss'; diff --git a/examples/auth/next-app/app/_css/queries.scss b/examples/auth/next-app/app/_css/queries.scss new file mode 100644 index 00000000000..8f84ac7097e --- /dev/null +++ b/examples/auth/next-app/app/_css/queries.scss @@ -0,0 +1,28 @@ +$breakpoint-xs-width: 400px; +$breakpoint-s-width: 768px; +$breakpoint-m-width: 1024px; +$breakpoint-l-width: 1440px; + +@mixin extra-small-break { + @media (max-width: #{$breakpoint-xs-width}) { + @content; + } +} + +@mixin small-break { + @media (max-width: #{$breakpoint-s-width}) { + @content; + } +} + +@mixin mid-break { + @media (max-width: #{$breakpoint-m-width}) { + @content; + } +} + +@mixin large-break { + @media (max-width: #{$breakpoint-l-width}) { + @content; + } +} diff --git a/examples/auth/next-app/app/_css/theme.scss b/examples/auth/next-app/app/_css/theme.scss new file mode 100644 index 00000000000..0c93d334fdf --- /dev/null +++ b/examples/auth/next-app/app/_css/theme.scss @@ -0,0 +1,241 @@ +@media (prefers-color-scheme: light) { + :root { + --theme-success-50: var(--color-success-50); + --theme-success-100: var(--color-success-100); + --theme-success-150: var(--color-success-150); + --theme-success-200: var(--color-success-200); + --theme-success-250: var(--color-success-250); + --theme-success-300: var(--color-success-300); + --theme-success-350: var(--color-success-350); + --theme-success-400: var(--color-success-400); + --theme-success-450: var(--color-success-450); + --theme-success-500: var(--color-success-500); + --theme-success-550: var(--color-success-550); + --theme-success-600: var(--color-success-600); + --theme-success-650: var(--color-success-650); + --theme-success-700: var(--color-success-700); + --theme-success-750: var(--color-success-750); + --theme-success-800: var(--color-success-800); + --theme-success-850: var(--color-success-850); + --theme-success-900: var(--color-success-900); + --theme-success-950: var(--color-success-950); + + --theme-warning-50: var(--color-warning-50); + --theme-warning-100: var(--color-warning-100); + --theme-warning-150: var(--color-warning-150); + --theme-warning-200: var(--color-warning-200); + --theme-warning-250: var(--color-warning-250); + --theme-warning-300: var(--color-warning-300); + --theme-warning-350: var(--color-warning-350); + --theme-warning-400: var(--color-warning-400); + --theme-warning-450: var(--color-warning-450); + --theme-warning-500: var(--color-warning-500); + --theme-warning-550: var(--color-warning-550); + --theme-warning-600: var(--color-warning-600); + --theme-warning-650: var(--color-warning-650); + --theme-warning-700: var(--color-warning-700); + --theme-warning-750: var(--color-warning-750); + --theme-warning-800: var(--color-warning-800); + --theme-warning-850: var(--color-warning-850); + --theme-warning-900: var(--color-warning-900); + --theme-warning-950: var(--color-warning-950); + + --theme-error-50: var(--color-error-50); + --theme-error-100: var(--color-error-100); + --theme-error-150: var(--color-error-150); + --theme-error-200: var(--color-error-200); + --theme-error-250: var(--color-error-250); + --theme-error-300: var(--color-error-300); + --theme-error-350: var(--color-error-350); + --theme-error-400: var(--color-error-400); + --theme-error-450: var(--color-error-450); + --theme-error-500: var(--color-error-500); + --theme-error-550: var(--color-error-550); + --theme-error-600: var(--color-error-600); + --theme-error-650: var(--color-error-650); + --theme-error-700: var(--color-error-700); + --theme-error-750: var(--color-error-750); + --theme-error-800: var(--color-error-800); + --theme-error-850: var(--color-error-850); + --theme-error-900: var(--color-error-900); + --theme-error-950: var(--color-error-950); + + --theme-elevation-0: var(--color-base-0); + --theme-elevation-50: var(--color-base-50); + --theme-elevation-100: var(--color-base-100); + --theme-elevation-150: var(--color-base-150); + --theme-elevation-200: var(--color-base-200); + --theme-elevation-250: var(--color-base-250); + --theme-elevation-300: var(--color-base-300); + --theme-elevation-350: var(--color-base-350); + --theme-elevation-400: var(--color-base-400); + --theme-elevation-450: var(--color-base-450); + --theme-elevation-500: var(--color-base-500); + --theme-elevation-550: var(--color-base-550); + --theme-elevation-600: var(--color-base-600); + --theme-elevation-650: var(--color-base-650); + --theme-elevation-700: var(--color-base-700); + --theme-elevation-750: var(--color-base-750); + --theme-elevation-800: var(--color-base-800); + --theme-elevation-850: var(--color-base-850); + --theme-elevation-900: var(--color-base-900); + --theme-elevation-950: var(--color-base-950); + --theme-elevation-1000: var(--color-base-1000); + + --theme-bg: var(--theme-elevation-0); + --theme-input-bg: var(--theme-elevation-50); + --theme-text: var(--theme-elevation-750); + --theme-border-color: var(--theme-elevation-150); + + color-scheme: light; + color: var(--theme-text); + + --highlight-default-bg-color: var(--theme-success-400); + --highlight-default-text-color: var(--theme-text); + + --highlight-danger-bg-color: var(--theme-error-150); + --highlight-danger-text-color: var(--theme-text); + } + + h1 a, + h2 a, + h3 a, + h4 a, + h5 a, + h6 a { + color: var(--theme-elevation-750); + + &:hover { + color: var(--theme-elevation-800); + } + + &:visited { + color: var(--theme-elevation-750); + + &:hover { + color: var(--theme-elevation-800); + } + } + } +} + +@media (prefers-color-scheme: dark) { + :root { + --theme-elevation-0: var(--color-base-1000); + --theme-elevation-50: var(--color-base-950); + --theme-elevation-100: var(--color-base-900); + --theme-elevation-150: var(--color-base-850); + --theme-elevation-200: var(--color-base-800); + --theme-elevation-250: var(--color-base-750); + --theme-elevation-300: var(--color-base-700); + --theme-elevation-350: var(--color-base-650); + --theme-elevation-400: var(--color-base-600); + --theme-elevation-450: var(--color-base-550); + --theme-elevation-500: var(--color-base-500); + --theme-elevation-550: var(--color-base-450); + --theme-elevation-600: var(--color-base-400); + --theme-elevation-650: var(--color-base-350); + --theme-elevation-700: var(--color-base-300); + --theme-elevation-750: var(--color-base-250); + --theme-elevation-800: var(--color-base-200); + --theme-elevation-850: var(--color-base-150); + --theme-elevation-900: var(--color-base-100); + --theme-elevation-950: var(--color-base-50); + --theme-elevation-1000: var(--color-base-0); + + --theme-success-50: var(--color-success-950); + --theme-success-100: var(--color-success-900); + --theme-success-150: var(--color-success-850); + --theme-success-200: var(--color-success-800); + --theme-success-250: var(--color-success-750); + --theme-success-300: var(--color-success-700); + --theme-success-350: var(--color-success-650); + --theme-success-400: var(--color-success-600); + --theme-success-450: var(--color-success-550); + --theme-success-500: var(--color-success-500); + --theme-success-550: var(--color-success-450); + --theme-success-600: var(--color-success-400); + --theme-success-650: var(--color-success-350); + --theme-success-700: var(--color-success-300); + --theme-success-750: var(--color-success-250); + --theme-success-800: var(--color-success-200); + --theme-success-850: var(--color-success-150); + --theme-success-900: var(--color-success-100); + --theme-success-950: var(--color-success-50); + + --theme-warning-50: var(--color-warning-950); + --theme-warning-100: var(--color-warning-900); + --theme-warning-150: var(--color-warning-850); + --theme-warning-200: var(--color-warning-800); + --theme-warning-250: var(--color-warning-750); + --theme-warning-300: var(--color-warning-700); + --theme-warning-350: var(--color-warning-650); + --theme-warning-400: var(--color-warning-600); + --theme-warning-450: var(--color-warning-550); + --theme-warning-500: var(--color-warning-500); + --theme-warning-550: var(--color-warning-450); + --theme-warning-600: var(--color-warning-400); + --theme-warning-650: var(--color-warning-350); + --theme-warning-700: var(--color-warning-300); + --theme-warning-750: var(--color-warning-250); + --theme-warning-800: var(--color-warning-200); + --theme-warning-850: var(--color-warning-150); + --theme-warning-900: var(--color-warning-100); + --theme-warning-950: var(--color-warning-50); + + --theme-error-50: var(--color-error-950); + --theme-error-100: var(--color-error-900); + --theme-error-150: var(--color-error-850); + --theme-error-200: var(--color-error-800); + --theme-error-250: var(--color-error-750); + --theme-error-300: var(--color-error-700); + --theme-error-350: var(--color-error-650); + --theme-error-400: var(--color-error-600); + --theme-error-450: var(--color-error-550); + --theme-error-500: var(--color-error-500); + --theme-error-550: var(--color-error-450); + --theme-error-600: var(--color-error-400); + --theme-error-650: var(--color-error-350); + --theme-error-700: var(--color-error-300); + --theme-error-750: var(--color-error-250); + --theme-error-800: var(--color-error-200); + --theme-error-850: var(--color-error-150); + --theme-error-900: var(--color-error-100); + --theme-error-950: var(--color-error-50); + + --theme-bg: var(--theme-elevation-100); + --theme-text: var(--theme-elevation-900); + --theme-input-bg: var(--theme-elevation-150); + --theme-border-color: var(--theme-elevation-250); + + color-scheme: dark; + color: var(--theme-text); + + --highlight-default-bg-color: var(--theme-success-100); + --highlight-default-text-color: var(--theme-success-600); + + --highlight-danger-bg-color: var(--theme-error-100); + --highlight-danger-text-color: var(--theme-error-550); + } + + h1 a, + h2 a, + h3 a, + h4 a, + h5 a, + h6 a { + color: var(--theme-success-600); + + &:hover { + color: var(--theme-success-400); + } + + &:visited { + color: var(--theme-success-700); + + &:hover { + color: var(--theme-success-500); + } + } + } +} diff --git a/examples/auth/next-app/app/_css/type.scss b/examples/auth/next-app/app/_css/type.scss new file mode 100644 index 00000000000..f8d1d07162e --- /dev/null +++ b/examples/auth/next-app/app/_css/type.scss @@ -0,0 +1,110 @@ +@use 'queries' as *; + +%h1, +%h2, +%h3, +%h4, +%h5, +%h6 { + font-weight: 700; +} + +%h1 { + margin: 40px 0; + font-size: 64px; + line-height: 70px; + font-weight: bold; + + @include mid-break { + margin: 24px 0; + font-size: 42px; + line-height: 42px; + } +} + +%h2 { + margin: 28px 0; + font-size: 48px; + line-height: 54px; + font-weight: bold; + + @include mid-break { + margin: 22px 0; + font-size: 32px; + line-height: 40px; + } +} + +%h3 { + margin: 24px 0; + font-size: 32px; + line-height: 40px; + font-weight: bold; + + @include mid-break { + margin: 20px 0; + font-size: 26px; + line-height: 32px; + } +} + +%h4 { + margin: 20px 0; + font-size: 26px; + line-height: 32px; + font-weight: bold; + + @include mid-break { + font-size: 22px; + line-height: 30px; + } +} + +%h5 { + margin: 20px 0; + font-size: 22px; + line-height: 30px; + font-weight: bold; + + @include mid-break { + font-size: 18px; + line-height: 24px; + } +} + +%h6 { + margin: 20px 0; + font-size: inherit; + line-height: inherit; + font-weight: bold; +} + +%body { + font-size: 18px; + line-height: 32px; + + @include mid-break { + font-size: 15px; + line-height: 24px; + } +} + +%large-body { + font-size: 25px; + line-height: 32px; + + @include mid-break { + font-size: 22px; + line-height: 30px; + } +} + +%label { + font-size: 16px; + line-height: 24px; + text-transform: uppercase; + + @include mid-break { + font-size: 13px; + } +} diff --git a/examples/auth/next-app/app/_components/Auth/gql.ts b/examples/auth/next-app/app/_providers/Auth/gql.ts similarity index 100% rename from examples/auth/next-app/app/_components/Auth/gql.ts rename to examples/auth/next-app/app/_providers/Auth/gql.ts diff --git a/examples/auth/next-app/app/_components/Auth/index.tsx b/examples/auth/next-app/app/_providers/Auth/index.tsx similarity index 100% rename from examples/auth/next-app/app/_components/Auth/index.tsx rename to examples/auth/next-app/app/_providers/Auth/index.tsx diff --git a/examples/auth/next-app/app/_components/Auth/rest.ts b/examples/auth/next-app/app/_providers/Auth/rest.ts similarity index 100% rename from examples/auth/next-app/app/_components/Auth/rest.ts rename to examples/auth/next-app/app/_providers/Auth/rest.ts diff --git a/examples/auth/next-app/app/_components/Auth/types.ts b/examples/auth/next-app/app/_providers/Auth/types.ts similarity index 100% rename from examples/auth/next-app/app/_components/Auth/types.ts rename to examples/auth/next-app/app/_providers/Auth/types.ts diff --git a/examples/auth/next-app/app/_utilities/getMeUser.ts b/examples/auth/next-app/app/_utilities/getMeUser.ts new file mode 100644 index 00000000000..8d361bb425b --- /dev/null +++ b/examples/auth/next-app/app/_utilities/getMeUser.ts @@ -0,0 +1,41 @@ +import { cookies } from 'next/headers' +import { redirect } from 'next/navigation' + +import type { User } from '../payload-types' + +export const getMeUser = async (args?: { + nullUserRedirect?: string + validUserRedirect?: string +}): Promise<{ + user: User + token: string | undefined +}> => { + const { nullUserRedirect, validUserRedirect } = args || {} + const cookieStore = cookies() + const token = cookieStore.get('payload-token')?.value + + const meUserReq = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users/me`, { + headers: { + Authorization: `JWT ${token}`, + }, + }) + + const { + user, + }: { + user: User + } = await meUserReq.json() + + if (validUserRedirect && meUserReq.ok && user) { + redirect(validUserRedirect) + } + + if (nullUserRedirect && (!meUserReq.ok || !user)) { + redirect(nullUserRedirect) + } + + return { + user, + token, + } +} diff --git a/examples/auth/next-app/app/account/AccountForm/index.module.scss b/examples/auth/next-app/app/account/AccountForm/index.module.scss new file mode 100644 index 00000000000..568d504e088 --- /dev/null +++ b/examples/auth/next-app/app/account/AccountForm/index.module.scss @@ -0,0 +1,24 @@ +@import "../../_css/common"; + +.form { + margin-bottom: var(--base); + display: flex; + flex-direction: column; + gap: calc(var(--base) / 2); + align-items: flex-start; + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.changePassword { + all: unset; + cursor: pointer; + text-decoration: underline; +} + +.submit { + margin-top: calc(var(--base) / 2); +} diff --git a/examples/auth/next-app/app/account/AccountForm/index.tsx b/examples/auth/next-app/app/account/AccountForm/index.tsx new file mode 100644 index 00000000000..5fe2f8d352f --- /dev/null +++ b/examples/auth/next-app/app/account/AccountForm/index.tsx @@ -0,0 +1,152 @@ +'use client' + +import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react' +import { useForm } from 'react-hook-form' +import { useRouter } from 'next/navigation' + +import { Button } from '../../_components/Button' +import { Input } from '../../_components/Input' +import { Message } from '../../_components/Message' +import { useAuth } from '../../_providers/Auth' + +import classes from './index.module.scss' + +type FormData = { + email: string + name: string + password: string + passwordConfirm: string +} + +export const AccountForm: React.FC = () => { + const [error, setError] = useState('') + const [success, setSuccess] = useState('') + const { user, setUser } = useAuth() + const [changePassword, setChangePassword] = useState(false) + const router = useRouter() + + const { + register, + handleSubmit, + formState: { errors, isLoading }, + reset, + watch, + } = useForm<FormData>() + + const password = useRef({}) + password.current = watch('password', '') + + const onSubmit = useCallback( + async (data: FormData) => { + if (user) { + const response = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users/${user.id}`, { + // Make sure to include cookies with fetch + credentials: 'include', + method: 'PATCH', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (response.ok) { + const json = await response.json() + setUser(json.doc) + setSuccess('Successfully updated account.') + setError('') + setChangePassword(false) + reset({ + email: json.doc.email, + name: json.doc.name, + password: '', + passwordConfirm: '', + }) + } else { + setError('There was a problem updating your account.') + } + } + }, + [user, setUser, reset], + ) + + useEffect(() => { + if (user === null) { + router.push(`/login?unauthorized=account`) + } + + // Once user is loaded, reset form to have default values + if (user) { + reset({ + email: user.email, + password: '', + passwordConfirm: '', + }) + } + }, [user, router, reset, changePassword]) + + return ( + <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <Message error={error} success={success} className={classes.message} /> + {!changePassword ? ( + <Fragment> + <p> + {'To change your password, '} + <button + type="button" + className={classes.changePassword} + onClick={() => setChangePassword(!changePassword)} + > + click here + </button> + . + </p> + <Input + name="email" + label="Email Address" + required + register={register} + error={errors.email} + type="email" + /> + </Fragment> + ) : ( + <Fragment> + <p> + {'Change your password below, or '} + <button + type="button" + className={classes.changePassword} + onClick={() => setChangePassword(!changePassword)} + > + cancel + </button> + . + </p> + <Input + name="password" + type="password" + label="Password" + required + register={register} + error={errors.password} + /> + <Input + name="passwordConfirm" + type="password" + label="Confirm Password" + required + register={register} + validate={value => value === password.current || 'The passwords do not match'} + error={errors.passwordConfirm} + /> + </Fragment> + )} + <Button + type="submit" + className={classes.submit} + label={isLoading ? 'Processing' : changePassword ? 'Change password' : 'Update account'} + appearance="primary" + /> + </form> + ) +} diff --git a/examples/auth/next-app/app/account/index.module.css b/examples/auth/next-app/app/account/index.module.css deleted file mode 100644 index 9a5decbddb3..00000000000 --- a/examples/auth/next-app/app/account/index.module.css +++ /dev/null @@ -1,17 +0,0 @@ -.form { - margin-bottom: 30px; -} - -.success, -.error, -.message { - margin-bottom: 30px; -} - -.success { - color: green; -} - -.error { - color: red; -} diff --git a/examples/auth/next-app/app/account/index.module.scss b/examples/auth/next-app/app/account/index.module.scss new file mode 100644 index 00000000000..682ced83cfb --- /dev/null +++ b/examples/auth/next-app/app/account/index.module.scss @@ -0,0 +1,7 @@ +.account { + margin-bottom: var(--block-padding); +} + +.params { + margin-top: var(--base); +} diff --git a/examples/auth/next-app/app/account/page.tsx b/examples/auth/next-app/app/account/page.tsx index de2c43042e0..5d563b05da0 100644 --- a/examples/auth/next-app/app/account/page.tsx +++ b/examples/auth/next-app/app/account/page.tsx @@ -1,111 +1,34 @@ -'use client' - -import React, { useCallback, useEffect, useState } from 'react' -import { useForm } from 'react-hook-form' +import React from 'react' import Link from 'next/link' -import { useRouter, useSearchParams } from 'next/navigation' -import { useAuth } from '../_components/Auth' +import { Button } from '../_components/Button' import { Gutter } from '../_components/Gutter' -import { Input } from '../_components/Input' -import classes from './index.module.css' - -type FormData = { - email: string - firstName: string - lastName: string -} - -const Account: React.FC = () => { - const [error, setError] = useState('') - const [success, setSuccess] = useState('') - const { user, setUser } = useAuth() - const router = useRouter() - const params = useSearchParams() - const queryMsg = params.get('message') - - const { - register, - handleSubmit, - formState: { errors }, - reset, - } = useForm<FormData>() - - const onSubmit = useCallback( - async (data: FormData) => { - if (user) { - const response = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users/${user.id}`, { - // Make sure to include cookies with fetch - credentials: 'include', - method: 'PATCH', - body: JSON.stringify(data), - headers: { - 'Content-Type': 'application/json', - }, - }) - - if (response.ok) { - const json = await response.json() +import { RenderParams } from '../_components/RenderParams' +import { getMeUser } from '../_utilities/getMeUser' +import { AccountForm } from './AccountForm' - // Update the user in auth state with new values - setUser(json.doc) +import classes from './index.module.scss' - // Set success message for user - setSuccess('Successfully updated account.') - - // Clear any existing errors - setError('') - } else { - setError('There was a problem updating your account.') - } - } - }, - [user, setUser], - ) - - useEffect(() => { - if (user === null) { - router.push(`/login?unauthorized=account`) - } - - // Once user is loaded, reset form to have default values - if (user) { - reset({ - email: user.email, - firstName: user.firstName, - lastName: user.lastName, - }) - } - }, [user, reset, router]) - - useEffect(() => { - const success = params.get('success') - if (success) { - setSuccess(success) - } - }, [router, params]) +export default async function Account() { + await getMeUser({ + nullUserRedirect: `/login?error=${encodeURIComponent( + 'You must be logged in to access your account.', + )}&redirect=${encodeURIComponent('/account')}`, + }) return ( - <Gutter> + <Gutter className={classes.account}> + <RenderParams className={classes.params} /> <h1>Account</h1> - {queryMsg && <div className={classes.message}>{queryMsg}</div>} - {error && <div className={classes.error}>{error}</div>} - {success && <div className={classes.success}>{success}</div>} - <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> - <Input - name="email" - label="Email Address" - required - register={register} - error={errors.email} - /> - <Input name="firstName" label="First Name" register={register} error={errors.firstName} /> - <Input name="lastName" label="Last Name" register={register} error={errors.lastName} /> - <button type="submit">Update account</button> - </form> - <Link href="/logout">Log out</Link> + <p> + {`This is your account dashboard. Here you can update your account information and more. To manage all users, `} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + {'.'} + </p> + <AccountForm /> + <Button href="/logout" appearance="secondary" label="Log out" /> </Gutter> ) } - -export default Account diff --git a/examples/auth/next-app/app/app.scss b/examples/auth/next-app/app/app.scss deleted file mode 100644 index 21f01bb945c..00000000000 --- a/examples/auth/next-app/app/app.scss +++ /dev/null @@ -1,107 +0,0 @@ -$breakpoint: 1000px; - -:root { - --max-width: 1600px; - --foreground-rgb: 0, 0, 0; - --background-rgb: 255, 255, 255; - --block-spacing: 2rem; - --gutter-h: 4rem; - --base: 1rem; - - @media (max-width: $breakpoint) { - --block-spacing: 1rem; - --gutter-h: 2rem; - --base: 0.75rem; - } -} - -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-rgb: 7, 7, 7; - } -} - -* { - box-sizing: border-box; -} - -html { - font-size: 20px; - line-height: 1.5; - font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - - @media (max-width: $breakpoint) { - font-size: 16px; - } -} - -html, -body { - max-width: 100vw; - overflow-x: hidden; -} - -body { - margin: 0; - color: rgb(var(--foreground-rgb)); - background: rgb(var(--background-rgb)); -} - -img { - height: auto; - max-width: 100%; - display: block; -} - -h1 { - font-size: 4.5rem; - line-height: 1.2; - margin: 0 0 2.5rem 0; - - @media (max-width: $breakpoint) { - font-size: 3rem; - margin: 0 0 1.5rem 0; - } -} - -h2 { - font-size: 3.5rem; - line-height: 1.2; - margin: 0 0 2.5rem 0; -} - -h3 { - font-size: 2.5rem; - line-height: 1.2; - margin: 0 0 2rem 0; -} - -h4 { - font-size: 1.5rem; - line-height: 1.2; - margin: 0 0 1rem 0; -} - -h5 { - font-size: 1.25rem; - line-height: 1.2; - margin: 0 0 1rem 0; -} - -h6 { - font-size: 1rem; - line-height: 1.2; - margin: 0 0 1rem 0; -} - -a { - color: inherit; - text-decoration: none; -} - -@media (prefers-color-scheme: dark) { - html { - color-scheme: dark; - } -} diff --git a/examples/auth/next-app/app/create-account/CreateAccountForm/index.module.scss b/examples/auth/next-app/app/create-account/CreateAccountForm/index.module.scss new file mode 100644 index 00000000000..9c686ec6d88 --- /dev/null +++ b/examples/auth/next-app/app/create-account/CreateAccountForm/index.module.scss @@ -0,0 +1,22 @@ +@import "../../_css/common"; + +.form { + margin-bottom: var(--base); + display: flex; + flex-direction: column; + gap: calc(var(--base) / 2); + align-items: flex-start; + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.submit { + margin-top: calc(var(--base) / 2); +} + +.message { + margin-bottom: var(--base); +} diff --git a/examples/auth/next-app/app/create-account/CreateAccountForm/index.tsx b/examples/auth/next-app/app/create-account/CreateAccountForm/index.tsx new file mode 100644 index 00000000000..36135217cd4 --- /dev/null +++ b/examples/auth/next-app/app/create-account/CreateAccountForm/index.tsx @@ -0,0 +1,121 @@ +'use client' + +import React, { useCallback, useRef, useState } from 'react' +import { useForm } from 'react-hook-form' +import Link from 'next/link' +import { useRouter, useSearchParams } from 'next/navigation' + +import { Button } from '../../_components/Button' +import { Input } from '../../_components/Input' +import { Message } from '../../_components/Message' +import { useAuth } from '../../_providers/Auth' + +import classes from './index.module.scss' + +type FormData = { + email: string + password: string + passwordConfirm: string +} + +export const CreateAccountForm: React.FC = () => { + const searchParams = useSearchParams() + const allParams = searchParams.toString() ? `?${searchParams.toString()}` : '' + const { login } = useAuth() + const router = useRouter() + const [loading, setLoading] = useState(false) + const [error, setError] = useState<string | null>(null) + + const { + register, + handleSubmit, + formState: { errors }, + watch, + } = useForm<FormData>() + + const password = useRef({}) + password.current = watch('password', '') + + const onSubmit = useCallback( + async (data: FormData) => { + const response = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users`, { + method: 'POST', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (!response.ok) { + const message = response.statusText || 'There was an error creating the account.' + setError(message) + return + } + + const redirect = searchParams.get('redirect') + + const timer = setTimeout(() => { + setLoading(true) + }, 1000) + + try { + await login(data) + clearTimeout(timer) + if (redirect) router.push(redirect as string) + else router.push(`/account?success=${encodeURIComponent('Account created successfully')}`) + } catch (_) { + clearTimeout(timer) + setError('There was an error with the credentials provided. Please try again.') + } + }, + [login, router, searchParams], + ) + + return ( + <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <p> + {`This is where new customers can signup and create a new account. To manage all users, `} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + {'.'} + </p> + <Message error={error} className={classes.message} /> + <Input + name="email" + label="Email Address" + required + register={register} + error={errors.email} + type="email" + /> + <Input + name="password" + type="password" + label="Password" + required + register={register} + error={errors.password} + /> + <Input + name="passwordConfirm" + type="password" + label="Confirm Password" + required + register={register} + validate={value => value === password.current || 'The passwords do not match'} + error={errors.passwordConfirm} + /> + <Button + type="submit" + className={classes.submit} + label={loading ? 'Processing' : 'Create Account'} + appearance="primary" + /> + <div> + {'Already have an account? '} + <Link href={`/login${allParams}`}>Login</Link> + </div> + </form> + ) +} diff --git a/examples/auth/next-app/app/create-account/index.module.css b/examples/auth/next-app/app/create-account/index.module.css deleted file mode 100644 index c873f1ac88a..00000000000 --- a/examples/auth/next-app/app/create-account/index.module.css +++ /dev/null @@ -1,8 +0,0 @@ -.form { - margin-bottom: 30px; -} - -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-app/app/create-account/index.module.scss b/examples/auth/next-app/app/create-account/index.module.scss new file mode 100644 index 00000000000..8d5460a2e97 --- /dev/null +++ b/examples/auth/next-app/app/create-account/index.module.scss @@ -0,0 +1,5 @@ +@import "../_css/common"; + +.createAccount { + margin-bottom: var(--block-padding); +} diff --git a/examples/auth/next-app/app/create-account/page.tsx b/examples/auth/next-app/app/create-account/page.tsx index 3e594fcd89b..f839d1822b8 100644 --- a/examples/auth/next-app/app/create-account/page.tsx +++ b/examples/auth/next-app/app/create-account/page.tsx @@ -1,92 +1,24 @@ -'use client' +import React from 'react' -import React, { useCallback, useState } from 'react' -import { useForm } from 'react-hook-form' -import Link from 'next/link' - -import { useAuth } from '../_components/Auth' import { Gutter } from '../_components/Gutter' -import { Input } from '../_components/Input' -import classes from './index.module.css' - -type FormData = { - email: string - password: string - firstName: string - lastName: string -} +import { RenderParams } from '../_components/RenderParams' +import { getMeUser } from '../_utilities/getMeUser' +import { CreateAccountForm } from './CreateAccountForm' -const CreateAccount: React.FC = () => { - const [error, setError] = useState('') - const [success, setSuccess] = useState(false) - const { login, create, user } = useAuth() +import classes from './index.module.scss' - const { - register, - handleSubmit, - formState: { errors }, - } = useForm<FormData>() - - const onSubmit = useCallback( - async (data: FormData) => { - try { - await create(data as Parameters<typeof create>[0]) - // Automatically log the user in after creating their account - await login({ email: data.email, password: data.password }) - setSuccess(true) - } catch (err: any) { - setError(err?.message || 'An error occurred while attempting to create your account.') - } - }, - [login, create], - ) +export default async function CreateAccount() { + await getMeUser({ + validUserRedirect: `/account?message=${encodeURIComponent( + 'Cannot create a new account while logged in, please log out and try again.', + )}`, + }) return ( - <Gutter> - {!success && ( - <React.Fragment> - <h1>Create Account</h1> - {error && <div className={classes.error}>{error}</div>} - <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> - <Input - name="email" - label="Email Address" - required - register={register} - error={errors.email} - /> - <Input - name="password" - type="password" - label="Password" - required - register={register} - error={errors.password} - /> - <Input - name="firstName" - label="First Name" - register={register} - error={errors.firstName} - /> - <Input name="lastName" label="Last Name" register={register} error={errors.lastName} /> - <button type="submit">Create account</button> - </form> - <p> - {'Already have an account? '} - <Link href="/login">Login</Link> - </p> - </React.Fragment> - )} - {success && ( - <React.Fragment> - <h1>Account created successfully</h1> - <p>You are now logged in.</p> - <Link href="/account">Go to your account</Link> - </React.Fragment> - )} + <Gutter className={classes.createAccount}> + <h1>Create Account</h1> + <RenderParams /> + <CreateAccountForm /> </Gutter> ) } - -export default CreateAccount diff --git a/examples/auth/next-app/app/index.module.scss b/examples/auth/next-app/app/index.module.scss deleted file mode 100644 index 3ae99a675a4..00000000000 --- a/examples/auth/next-app/app/index.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.page { - margin-top: calc(var(--base) * 2); -} diff --git a/examples/auth/next-app/app/layout.tsx b/examples/auth/next-app/app/layout.tsx index 6080261d396..1511091ecad 100644 --- a/examples/auth/next-app/app/layout.tsx +++ b/examples/auth/next-app/app/layout.tsx @@ -1,9 +1,7 @@ -import { AuthProvider } from './_components/Auth' import { Header } from './_components/Header' +import { AuthProvider } from './_providers/Auth' -import './app.scss' - -import classes from './index.module.scss' +import './_css/app.scss' export const metadata = { title: 'Payload Auth + Next.js App Router Example', @@ -16,9 +14,13 @@ export default async function RootLayout(props: { children: React.ReactNode }) { return ( <html lang="en"> <body> - <AuthProvider> + <AuthProvider + // To toggle between the REST and GraphQL APIs, + // change the `api` prop to either `rest` or `gql` + api="rest" // change this to `gql` to use the GraphQL API + > <Header /> - <div className={classes.page}>{children}</div> + <main>{children}</main> </AuthProvider> </body> </html> diff --git a/examples/auth/next-app/app/login/LoginForm/index.module.scss b/examples/auth/next-app/app/login/LoginForm/index.module.scss new file mode 100644 index 00000000000..9c686ec6d88 --- /dev/null +++ b/examples/auth/next-app/app/login/LoginForm/index.module.scss @@ -0,0 +1,22 @@ +@import "../../_css/common"; + +.form { + margin-bottom: var(--base); + display: flex; + flex-direction: column; + gap: calc(var(--base) / 2); + align-items: flex-start; + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.submit { + margin-top: calc(var(--base) / 2); +} + +.message { + margin-bottom: var(--base); +} diff --git a/examples/auth/next-app/app/login/LoginForm/index.tsx b/examples/auth/next-app/app/login/LoginForm/index.tsx new file mode 100644 index 00000000000..865985ee85c --- /dev/null +++ b/examples/auth/next-app/app/login/LoginForm/index.tsx @@ -0,0 +1,96 @@ +'use client' + +import React, { useCallback, useRef } from 'react' +import { useForm } from 'react-hook-form' +import Link from 'next/link' +import { useRouter, useSearchParams } from 'next/navigation' + +import { Button } from '../../_components/Button' +import { Input } from '../../_components/Input' +import { Message } from '../../_components/Message' +import { useAuth } from '../../_providers/Auth' + +import classes from './index.module.scss' + +type FormData = { + email: string + password: string +} + +export const LoginForm: React.FC = () => { + const searchParams = useSearchParams() + const allParams = searchParams.toString() ? `?${searchParams.toString()}` : '' + const redirect = useRef(searchParams.get('redirect')) + const { login } = useAuth() + const router = useRouter() + const [error, setError] = React.useState<string | null>(null) + + const { + register, + handleSubmit, + formState: { errors, isLoading }, + } = useForm<FormData>({ + defaultValues: { + email: '[email protected]', + password: 'demo', + }, + }) + + const onSubmit = useCallback( + async (data: FormData) => { + try { + await login(data) + if (redirect?.current) router.push(redirect.current as string) + else router.push('/account') + } catch (_) { + setError('There was an error with the credentials provided. Please try again.') + } + }, + [login, router], + ) + + return ( + <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <p> + {'To log in, use the email '} + <b>[email protected]</b> + {' with the password '} + <b>demo</b> + {'. To manage your users, '} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + . + </p> + <Message error={error} className={classes.message} /> + <Input + name="email" + label="Email Address" + required + register={register} + error={errors.email} + type="email" + /> + <Input + name="password" + type="password" + label="Password" + required + register={register} + error={errors.password} + /> + <Button + type="submit" + disabled={isLoading} + className={classes.submit} + label={isLoading ? 'Processing' : 'Login'} + appearance="primary" + /> + <div> + <Link href={`/create-account${allParams}`}>Create an account</Link> + <br /> + <Link href={`/recover-password${allParams}`}>Recover your password</Link> + </div> + </form> + ) +} diff --git a/examples/auth/next-app/app/login/index.module.css b/examples/auth/next-app/app/login/index.module.css deleted file mode 100644 index c873f1ac88a..00000000000 --- a/examples/auth/next-app/app/login/index.module.css +++ /dev/null @@ -1,8 +0,0 @@ -.form { - margin-bottom: 30px; -} - -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-app/app/login/index.module.scss b/examples/auth/next-app/app/login/index.module.scss new file mode 100644 index 00000000000..67d60ecaa86 --- /dev/null +++ b/examples/auth/next-app/app/login/index.module.scss @@ -0,0 +1,9 @@ +@import "../_css/common"; + +.login { + margin-bottom: var(--block-padding); +} + +.params { + margin-top: var(--base); +} diff --git a/examples/auth/next-app/app/login/page.tsx b/examples/auth/next-app/app/login/page.tsx index f83999f326f..1de0fd9b45f 100644 --- a/examples/auth/next-app/app/login/page.tsx +++ b/examples/auth/next-app/app/login/page.tsx @@ -1,85 +1,22 @@ -'use client' +import React from 'react' -import React, { useCallback, useEffect, useState } from 'react' -import { useForm } from 'react-hook-form' -import Link from 'next/link' -import { redirect, useRouter, useSearchParams } from 'next/navigation' - -import { useAuth } from '../_components/Auth' import { Gutter } from '../_components/Gutter' -import { Input } from '../_components/Input' -import classes from './index.module.css' - -type FormData = { - email: string - password: string -} - -const Login: React.FC = () => { - const [error, setError] = useState('') - const router = useRouter() - const params = useSearchParams() - const { login, user } = useAuth() +import { RenderParams } from '../_components/RenderParams' +import { getMeUser } from '../_utilities/getMeUser' +import { LoginForm } from './LoginForm' - const { - register, - handleSubmit, - formState: { errors }, - } = useForm<FormData>() +import classes from './index.module.scss' - const onSubmit = useCallback( - async (data: FormData) => { - try { - await login(data) - router.push('/account') - } catch (err: any) { - setError(err?.message || 'An error occurred while attempting to login.') - } - }, - [login, router], - ) - - useEffect(() => { - const unauthorized = params.get('unauthorized') - if (unauthorized) { - setError(`To visit the ${unauthorized} page, you need to be logged in.`) - } - }, [params]) - - if (user) { - redirect('/account') - } +export default async function Login() { + await getMeUser({ + validUserRedirect: `/account?message=${encodeURIComponent('You are already logged in.')}`, + }) return ( - <Gutter> + <Gutter className={classes.login}> + <RenderParams className={classes.params} /> <h1>Log in</h1> - <p> - To log in, use the email <b>[email protected]</b> with the password <b>demo</b>. - </p> - {error && <div className={classes.error}>{error}</div>} - <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> - <Input - name="email" - label="Email Address" - required - register={register} - error={errors.email} - /> - <Input - name="password" - type="password" - label="Password" - required - register={register} - error={errors.password} - /> - <input type="submit" /> - </form> - <Link href="/create-account">Create an account</Link> - <br /> - <Link href="/recover-password">Recover your password</Link> + <LoginForm /> </Gutter> ) } - -export default Login diff --git a/examples/auth/next-app/app/logout/LogoutPage/index.tsx b/examples/auth/next-app/app/logout/LogoutPage/index.tsx new file mode 100644 index 00000000000..6aca0f4b143 --- /dev/null +++ b/examples/auth/next-app/app/logout/LogoutPage/index.tsx @@ -0,0 +1,42 @@ +'use client' + +import React, { Fragment, useEffect, useState } from 'react' +import Link from 'next/link' + +import { useAuth } from '../../_providers/Auth' + +export const LogoutPage: React.FC = props => { + const { logout } = useAuth() + const [success, setSuccess] = useState('') + const [error, setError] = useState('') + + useEffect(() => { + const performLogout = async () => { + try { + await logout() + setSuccess('Logged out successfully.') + } catch (_) { + setError('You are already logged out.') + } + } + + performLogout() + }, [logout]) + + return ( + <Fragment> + {(error || success) && ( + <div> + <h1>{error || success}</h1> + <p> + {'What would you like to do next? '} + <Link href="/">Click here</Link> + {` to go to the home page. To log back in, `} + <Link href="login">click here</Link> + {'.'} + </p> + </div> + )} + </Fragment> + ) +} diff --git a/examples/auth/next-app/app/logout/index.module.css b/examples/auth/next-app/app/logout/index.module.css deleted file mode 100644 index 7d2f0a0af18..00000000000 --- a/examples/auth/next-app/app/logout/index.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-app/app/logout/index.module.scss b/examples/auth/next-app/app/logout/index.module.scss new file mode 100644 index 00000000000..d7032f8cfc5 --- /dev/null +++ b/examples/auth/next-app/app/logout/index.module.scss @@ -0,0 +1,3 @@ +.logout { + margin-bottom: var(--block-padding); +} diff --git a/examples/auth/next-app/app/logout/page.tsx b/examples/auth/next-app/app/logout/page.tsx index 9aec96acd58..24a6bf552db 100644 --- a/examples/auth/next-app/app/logout/page.tsx +++ b/examples/auth/next-app/app/logout/page.tsx @@ -1,44 +1,14 @@ -'use client' +import React from 'react' -import React, { Fragment, useEffect, useState } from 'react' -import Link from 'next/link' - -import { useAuth } from '../_components/Auth' import { Gutter } from '../_components/Gutter' -import classes from './index.module.css' - -const Logout: React.FC = () => { - const { logout } = useAuth() - const [success, setSuccess] = useState('') - const [error, setError] = useState('') +import { LogoutPage } from './LogoutPage' - useEffect(() => { - const performLogout = async () => { - try { - await logout() - setSuccess('Logged out successfully.') - } catch (err: any) { - setError(err?.message || 'An error occurred while attempting to logout.') - } - } - - performLogout() - }, [logout]) +import classes from './index.module.scss' +export default async function Logout() { return ( - <Gutter> - {success && <h1>{success}</h1>} - {error && <div className={classes.error}>{error}</div>} - <p> - {'What would you like to do next? '} - <Fragment> - {' To log back in, '} - <Link href={`/login`}>click here</Link> - {'.'} - </Fragment> - </p> + <Gutter className={classes.logout}> + <LogoutPage /> </Gutter> ) } - -export default Logout diff --git a/examples/auth/next-app/app/page.tsx b/examples/auth/next-app/app/page.tsx index f2e7b1d5a76..e281b49fa96 100644 --- a/examples/auth/next-app/app/page.tsx +++ b/examples/auth/next-app/app/page.tsx @@ -19,20 +19,26 @@ export default function Home() { <Link href="https://nextjs.org/docs/app" target="_blank" rel="noopener noreferrer"> App Router </Link> - {" made explicitly for Payload's "} - <Link href="https://github.com/payloadcms/payload/tree/master/examples/auth/cms"> - Auth Example + {' made explicitly for the '} + <Link href="https://github.com/payloadcms/payload/tree/master/examples/auth"> + Payload Auth Example </Link> {". This example demonstrates how to implement Payload's "} <Link href="https://payloadcms.com/docs/authentication/overview">Authentication</Link> - {' strategies in both the REST and GraphQL APIs.'} + { + ' strategies in both the REST and GraphQL APIs. To toggle between these APIs, see `_layout.tsx`.' + } </p> <p> {'Visit the '} - <Link href="/login">Login</Link> - {' page to start the authentication flow. Once logged in, you will be redirected to the '} - <Link href="/account">Account</Link> - {` page which is restricted to users only. To toggle APIs, simply toggle the "api" prop between "rest" and "gql" in "_app.tsx".`} + <Link href="/login">login page</Link> + {' to start the authentication flow. Once logged in, you will be redirected to the '} + <Link href="/account">account page</Link> + {` which is restricted to users only. To manage all users, `} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + {'.'} </p> </Gutter> ) diff --git a/examples/auth/next-app/app/recover-password/RecoverPasswordForm/index.module.scss b/examples/auth/next-app/app/recover-password/RecoverPasswordForm/index.module.scss new file mode 100644 index 00000000000..de6a9a46ff7 --- /dev/null +++ b/examples/auth/next-app/app/recover-password/RecoverPasswordForm/index.module.scss @@ -0,0 +1,23 @@ +@import "../../_css/common"; + +.error { + color: red; + margin-bottom: 15px; +} + +.formWrapper { + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.submit { + margin-top: var(--base); +} + +.message { + margin-bottom: var(--base); +} + diff --git a/examples/auth/next-app/app/recover-password/RecoverPasswordForm/index.tsx b/examples/auth/next-app/app/recover-password/RecoverPasswordForm/index.tsx new file mode 100644 index 00000000000..3649e593de9 --- /dev/null +++ b/examples/auth/next-app/app/recover-password/RecoverPasswordForm/index.tsx @@ -0,0 +1,88 @@ +'use client' + +import React, { Fragment, useCallback, useState } from 'react' +import { useForm } from 'react-hook-form' +import Link from 'next/link' + +import { Button } from '../../_components/Button' +import { Input } from '../../_components/Input' +import { Message } from '../../_components/Message' + +import classes from './index.module.scss' + +type FormData = { + email: string +} + +export const RecoverPasswordForm: React.FC = () => { + const [error, setError] = useState('') + const [success, setSuccess] = useState(false) + + const { + register, + handleSubmit, + formState: { errors }, + } = useForm<FormData>() + + const onSubmit = useCallback(async (data: FormData) => { + const response = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users/forgot-password`, { + method: 'POST', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (response.ok) { + setSuccess(true) + setError('') + } else { + setError( + 'There was a problem while attempting to send you a password reset email. Please try again.', + ) + } + }, []) + + return ( + <Fragment> + {!success && ( + <React.Fragment> + <h1>Recover Password</h1> + <div className={classes.formWrapper}> + <p> + {`Please enter your email below. You will receive an email message with instructions on + how to reset your password. To manage your all users, `} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + {'.'} + </p> + <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <Message error={error} className={classes.message} /> + <Input + name="email" + label="Email Address" + required + register={register} + error={errors.email} + type="email" + /> + <Button + type="submit" + className={classes.submit} + label="Recover Password" + appearance="primary" + /> + </form> + </div> + </React.Fragment> + )} + {success && ( + <React.Fragment> + <h1>Request submitted</h1> + <p>Check your email for a link that will allow you to securely reset your password.</p> + </React.Fragment> + )} + </Fragment> + ) +} diff --git a/examples/auth/next-app/app/recover-password/index.module.css b/examples/auth/next-app/app/recover-password/index.module.css deleted file mode 100644 index 7d2f0a0af18..00000000000 --- a/examples/auth/next-app/app/recover-password/index.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-app/app/recover-password/index.module.scss b/examples/auth/next-app/app/recover-password/index.module.scss new file mode 100644 index 00000000000..2967d35eecf --- /dev/null +++ b/examples/auth/next-app/app/recover-password/index.module.scss @@ -0,0 +1,5 @@ +@import "../_css/common"; + +.recoverPassword { + margin-bottom: var(--block-padding); +} diff --git a/examples/auth/next-app/app/recover-password/page.tsx b/examples/auth/next-app/app/recover-password/page.tsx index eb4032e1d2f..48c9661e30d 100644 --- a/examples/auth/next-app/app/recover-password/page.tsx +++ b/examples/auth/next-app/app/recover-password/page.tsx @@ -1,74 +1,14 @@ -'use client' +import React from 'react' -import React, { useCallback, useState } from 'react' -import { useForm } from 'react-hook-form' - -import { useAuth } from '../_components/Auth' import { Gutter } from '../_components/Gutter' -import { Input } from '../_components/Input' -import classes from './index.module.css' - -type FormData = { - email: string -} - -const RecoverPassword: React.FC = () => { - const [error, setError] = useState('') - const [success, setSuccess] = useState(false) - const { forgotPassword } = useAuth() +import { RecoverPasswordForm } from './RecoverPasswordForm' - const { - register, - handleSubmit, - formState: { errors }, - } = useForm<FormData>() - - const onSubmit = useCallback( - async (data: FormData) => { - try { - const user = await forgotPassword(data as Parameters<typeof forgotPassword>[0]) - - if (user) { - setSuccess(true) - setError('') - } - } catch (err: any) { - setError(err?.message || 'An error occurred while attempting to recover password.') - } - }, - [forgotPassword], - ) +import classes from './index.module.scss' +export default async function RecoverPassword() { return ( - <Gutter> - {!success && ( - <React.Fragment> - <h1>Recover Password</h1> - <p> - Please enter your email below. You will receive an email message with instructions on - how to reset your password. - </p> - {error && <div className={classes.error}>{error}</div>} - <form onSubmit={handleSubmit(onSubmit)}> - <Input - name="email" - label="Email Address" - required - register={register} - error={errors.email} - /> - <button type="submit">Submit</button> - </form> - </React.Fragment> - )} - {success && ( - <React.Fragment> - <h1>Request submitted</h1> - <p>Check your email for a link that will allow you to securely reset your password.</p> - </React.Fragment> - )} + <Gutter className={classes.recoverPassword}> + <RecoverPasswordForm /> </Gutter> ) } - -export default RecoverPassword diff --git a/examples/auth/next-app/app/reset-password/ResetPasswordForm/index.module.scss b/examples/auth/next-app/app/reset-password/ResetPasswordForm/index.module.scss new file mode 100644 index 00000000000..2f77346032d --- /dev/null +++ b/examples/auth/next-app/app/reset-password/ResetPasswordForm/index.module.scss @@ -0,0 +1,13 @@ +@import "../../_css/common"; + +.form { + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.submit { + margin-top: var(--base); +} diff --git a/examples/auth/next-app/app/reset-password/ResetPasswordForm/index.tsx b/examples/auth/next-app/app/reset-password/ResetPasswordForm/index.tsx new file mode 100644 index 00000000000..80e59f7315f --- /dev/null +++ b/examples/auth/next-app/app/reset-password/ResetPasswordForm/index.tsx @@ -0,0 +1,84 @@ +'use client' + +import React, { useCallback, useEffect, useState } from 'react' +import { useForm } from 'react-hook-form' +import { useRouter, useSearchParams } from 'next/navigation' + +import { Button } from '../../_components/Button' +import { Input } from '../../_components/Input' +import { Message } from '../../_components/Message' +import { useAuth } from '../../_providers/Auth' + +import classes from './index.module.scss' + +type FormData = { + password: string + token: string +} + +export const ResetPasswordForm: React.FC = () => { + const [error, setError] = useState('') + const { login } = useAuth() + const router = useRouter() + const searchParams = useSearchParams() + const token = searchParams.get('token') + + const { + register, + handleSubmit, + formState: { errors }, + reset, + } = useForm<FormData>() + + const onSubmit = useCallback( + async (data: FormData) => { + const response = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users/reset-password`, { + method: 'POST', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (response.ok) { + const json = await response.json() + + // Automatically log the user in after they successfully reset password + await login({ email: json.user.email, password: data.password }) + + // Redirect them to `/account` with success message in URL + router.push('/account?success=Password reset successfully.') + } else { + setError('There was a problem while resetting your password. Please try again later.') + } + }, + [router, login], + ) + + // when Next.js populates token within router, + // reset form with new token value + useEffect(() => { + reset({ token: token || undefined }) + }, [reset, token]) + + return ( + <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <Message error={error} className={classes.message} /> + <Input + name="password" + type="password" + label="New Password" + required + register={register} + error={errors.password} + /> + <input type="hidden" {...register('token')} /> + <Button + type="submit" + className={classes.submit} + label="Reset Password" + appearance="primary" + /> + </form> + ) +} diff --git a/examples/auth/next-app/app/reset-password/index.module.css b/examples/auth/next-app/app/reset-password/index.module.css deleted file mode 100644 index 7d2f0a0af18..00000000000 --- a/examples/auth/next-app/app/reset-password/index.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-app/app/reset-password/index.module.scss b/examples/auth/next-app/app/reset-password/index.module.scss new file mode 100644 index 00000000000..b1b2b03c4df --- /dev/null +++ b/examples/auth/next-app/app/reset-password/index.module.scss @@ -0,0 +1,3 @@ +.resetPassword { + margin-bottom: var(--block-padding); +} diff --git a/examples/auth/next-app/app/reset-password/page.tsx b/examples/auth/next-app/app/reset-password/page.tsx index a56c6ea7d4c..98fc6a1677d 100644 --- a/examples/auth/next-app/app/reset-password/page.tsx +++ b/examples/auth/next-app/app/reset-password/page.tsx @@ -1,75 +1,16 @@ -'use client' +import React from 'react' -import React, { useCallback, useEffect, useState } from 'react' -import { useForm } from 'react-hook-form' -import { useRouter, useSearchParams } from 'next/navigation' - -import { useAuth } from '../_components/Auth' import { Gutter } from '../_components/Gutter' -import { Input } from '../_components/Input' -import classes from './index.module.css' - -type FormData = { - password: string - token: string | null -} - -const ResetPassword: React.FC = () => { - const [error, setError] = useState('') - const { login, resetPassword } = useAuth() - const router = useRouter() - const params = useSearchParams() - const token = params.get('token') - - const { - register, - handleSubmit, - formState: { errors }, - reset, - } = useForm<FormData>() +import { ResetPasswordForm } from './ResetPasswordForm' - const onSubmit = useCallback( - async (data: FormData) => { - try { - const user = await resetPassword(data as Parameters<typeof resetPassword>[0]) - - if (user) { - // Automatically log the user in after they successfully reset password - // Then redirect them to /account with success message in URL - await login({ email: user.email, password: data.password }) - router.push('/account?success=Password reset successfully.') - } - } catch (err: any) { - setError(err?.message || 'An error occurred while attempting to reset password.') - } - }, - [router, login, resetPassword], - ) - - // When Next.js populates token within router, reset form with new token value - useEffect(() => { - reset({ token }) - }, [reset, token]) +import classes from './index.module.scss' +export default async function ResetPassword() { return ( - <Gutter> + <Gutter className={classes.resetPassword}> <h1>Reset Password</h1> <p>Please enter a new password below.</p> - {error && <div className={classes.error}>{error}</div>} - <form onSubmit={handleSubmit(onSubmit)}> - <Input - name="password" - type="password" - label="New Password" - required - register={register} - error={errors.password} - /> - <input type="hidden" {...register('token')} /> - <button type="submit">Submit</button> - </form> + <ResetPasswordForm /> </Gutter> ) } - -export default ResetPassword diff --git a/examples/auth/next-pages/README.md b/examples/auth/next-pages/README.md index d0628b0e213..a9e740f8845 100644 --- a/examples/auth/next-pages/README.md +++ b/examples/auth/next-pages/README.md @@ -1,6 +1,6 @@ # Payload Auth Example Front-End -This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nextjs.org/docs/pages). It was made explicitly for Payload's [Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth/cms). +This is a [Payload](https://payloadcms.com) + [Next.js](https://nextjs.org) app using the [Pages Router](https://nextjs.org/docs/pages) made explicitly for the [Payload Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth). It demonstrates how to authenticate your Next.js app using [Payload Authentication](https://payloadcms.com/docs/authentication/overview). > This example uses the Pages Router, the legacy API of Next.js. If your app is using the latest [App Router](https://nextjs.org/docs/pages), check out the official [App Router Example](https://github.com/payloadcms/payload/tree/master/examples/auth/next-app). @@ -8,7 +8,7 @@ This is a [Next.js](https://nextjs.org) app using the [Pages Router](https://nex ### Payload -First you'll need a running [Payload](https://github.com/payloadcms/payload) app. If you have not done so already, open up the `cms` folder and follow the setup instructions. Take note of your `serverURL`, you'll need this in the next step. +First you'll need a running Payload app. If you have not done so already, clone down the [`cms`](../cms) folder and follow the setup instructions there to get it up and running. This will provide all the necessary APIs that your Next.js app will be using for authentication. ### Next.js @@ -18,20 +18,24 @@ First you'll need a running [Payload](https://github.com/payloadcms/payload) app 4. `yarn dev` or `npm run dev` to start the server 5. `open http://localhost:3001` to see the result -Once running you will find a couple seeded pages on your local environment with some basic instructions. You can also start editing the pages by modifying the documents within Payload. See the [Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth/cms) for full details. +Once running, a user is automatically seeded in your local environment with some basic instructions. See the [Payload Auth Example](https://github.com/payloadcms/payload/tree/master/examples/auth) for full details. ## Learn More -To learn more about PayloadCMS and Next.js, take a look at the following resources: +To learn more about Payload and Next.js, take a look at the following resources: - [Payload Documentation](https://payloadcms.com/docs) - learn about Payload features and API. - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. -You can check out [the Payload GitHub repository](https://github.com/payloadcms/payload/) as well as [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! +You can check out [the Payload GitHub repository](https://github.com/payloadcms/payload) as well as [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! ## Deployment The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new) from the creators of Next.js. You could also combine this app into a [single Express server](https://github.com/payloadcms/payload/tree/master/examples/custom-server) and deploy in to [Payload Cloud](https://payloadcms.com/new/import). Check out our [Payload deployment documentation](https://payloadcms.com/docs/production/deployment) or the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. + +## Questions + +If you have any issues or questions, reach out to us on [Discord](https://discord.com/invite/payload) or start a [GitHub discussion](https://github.com/payloadcms/payload/discussions). diff --git a/examples/auth/next-pages/src/components/Button/index.module.scss b/examples/auth/next-pages/src/components/Button/index.module.scss new file mode 100644 index 00000000000..304cdba561f --- /dev/null +++ b/examples/auth/next-pages/src/components/Button/index.module.scss @@ -0,0 +1,40 @@ +@import '../../css/type.scss'; + +.button { + border: none; + cursor: pointer; + display: inline-flex; + justify-content: center; + background-color: transparent; + text-decoration: none; + display: inline-flex; + padding: 12px 24px; +} + +.content { + display: flex; + align-items: center; + justify-content: space-around; +} + +.label { + @extend %label; + text-align: center; + display: flex; + align-items: center; +} + +.appearance--primary { + background-color: var(--theme-elevation-1000); + color: var(--theme-elevation-0); +} + +.appearance--secondary { + background-color: transparent; + box-shadow: inset 0 0 0 1px var(--theme-elevation-1000); +} + +.appearance--default { + padding: 0; + color: var(--theme-text); +} diff --git a/examples/auth/next-pages/src/components/Button/index.tsx b/examples/auth/next-pages/src/components/Button/index.tsx new file mode 100644 index 00000000000..61130c1a91e --- /dev/null +++ b/examples/auth/next-pages/src/components/Button/index.tsx @@ -0,0 +1,73 @@ +import React, { ElementType } from 'react' +import Link from 'next/link' + +import classes from './index.module.scss' + +export type Props = { + label?: string + appearance?: 'default' | 'primary' | 'secondary' + el?: 'button' | 'link' | 'a' + onClick?: () => void + href?: string + newTab?: boolean + className?: string + type?: 'submit' | 'button' + disabled?: boolean + invert?: boolean +} + +export const Button: React.FC<Props> = ({ + el: elFromProps = 'link', + label, + newTab, + href, + appearance, + className: classNameFromProps, + onClick, + type = 'button', + disabled, + invert, +}) => { + let el = elFromProps + const newTabProps = newTab ? { target: '_blank', rel: 'noopener noreferrer' } : {} + + const className = [ + classes.button, + classNameFromProps, + classes[`appearance--${appearance}`], + invert && classes[`${appearance}--invert`], + ] + .filter(Boolean) + .join(' ') + + const content = ( + <div className={classes.content}> + <span className={classes.label}>{label}</span> + </div> + ) + + if (onClick || type === 'submit') el = 'button' + + if (el === 'link') { + return ( + <Link href={href || ''} className={className} {...newTabProps} onClick={onClick}> + {content} + </Link> + ) + } + + const Element: ElementType = el + + return ( + <Element + href={href} + className={className} + type={type} + {...newTabProps} + onClick={onClick} + disabled={disabled} + > + {content} + </Element> + ) +} diff --git a/examples/auth/next-pages/src/components/Gutter/index.module.scss b/examples/auth/next-pages/src/components/Gutter/index.module.scss index 09f9f61be3d..be9e377a789 100644 --- a/examples/auth/next-pages/src/components/Gutter/index.module.scss +++ b/examples/auth/next-pages/src/components/Gutter/index.module.scss @@ -1,7 +1,7 @@ .gutter { - max-width: var(--max-width); - width: 100%; - margin: auto; + max-width: 1920px; + margin-left: auto; + margin-right: auto; } .gutterLeft { diff --git a/examples/auth/next-pages/src/components/Header/Nav/index.module.scss b/examples/auth/next-pages/src/components/Header/Nav/index.module.scss new file mode 100644 index 00000000000..4558716b16a --- /dev/null +++ b/examples/auth/next-pages/src/components/Header/Nav/index.module.scss @@ -0,0 +1,20 @@ +@use '../../../css/queries.scss' as *; + +.nav { + display: flex; + gap: calc(var(--base) / 4) var(--base); + align-items: center; + flex-wrap: wrap; + opacity: 1; + transition: opacity 100ms linear; + visibility: visible; + + > * { + text-decoration: none; + } +} + +.hide { + opacity: 0; + visibility: hidden; +} diff --git a/examples/auth/next-pages/src/components/Header/Nav/index.tsx b/examples/auth/next-pages/src/components/Header/Nav/index.tsx new file mode 100644 index 00000000000..66a098beeeb --- /dev/null +++ b/examples/auth/next-pages/src/components/Header/Nav/index.tsx @@ -0,0 +1,36 @@ +import React from 'react' +import Link from 'next/link' + +import { useAuth } from '../../../providers/Auth' + +import classes from './index.module.scss' + +export const HeaderNav: React.FC = () => { + const { user } = useAuth() + + return ( + <nav + className={[ + classes.nav, + // fade the nav in on user load to avoid flash of content and layout shift + // Vercel also does this in their own website header, see https://vercel.com + user === undefined && classes.hide, + ] + .filter(Boolean) + .join(' ')} + > + {user && ( + <React.Fragment> + <Link href="/account">Account</Link> + <Link href="/logout">Logout</Link> + </React.Fragment> + )} + {!user && ( + <React.Fragment> + <Link href="/login">Login</Link> + <Link href="/create-account">Create Account</Link> + </React.Fragment> + )} + </nav> + ) +} diff --git a/examples/auth/next-pages/src/components/Header/index.module.scss b/examples/auth/next-pages/src/components/Header/index.module.scss index c99ebda4c8a..ee7aa03fd34 100644 --- a/examples/auth/next-pages/src/components/Header/index.module.scss +++ b/examples/auth/next-pages/src/components/Header/index.module.scss @@ -1,16 +1,22 @@ +@use '../../css/queries.scss' as *; + .header { padding: var(--base) 0; - z-index: var(--header-z-index); } .wrap { display: flex; justify-content: space-between; + flex-wrap: wrap; + gap: calc(var(--base) / 2) var(--base); +} + +.logo { + width: 150px; } -.nav { - a { - text-decoration: none; - margin-left: var(--base); +:global([data-theme="light"]) { + .logo { + filter: invert(1); } } diff --git a/examples/auth/next-pages/src/components/Header/index.tsx b/examples/auth/next-pages/src/components/Header/index.tsx index 8ac42249ce6..7b7ebec73f9 100644 --- a/examples/auth/next-pages/src/components/Header/index.tsx +++ b/examples/auth/next-pages/src/components/Header/index.tsx @@ -1,15 +1,13 @@ -import React, { Fragment } from 'react' +import React from 'react' import Image from 'next/image' import Link from 'next/link' -import { useAuth } from '../Auth' import { Gutter } from '../Gutter' +import { HeaderNav } from './Nav' import classes from './index.module.scss' export const Header: React.FC = () => { - const { user } = useAuth() - return ( <header className={classes.header}> <Gutter className={classes.wrap}> @@ -27,20 +25,7 @@ export const Header: React.FC = () => { /> </picture> </Link> - <nav className={classes.nav}> - {!user && ( - <Fragment> - <Link href="/login">Login</Link> - <Link href="/create-account">Create Account</Link> - </Fragment> - )} - {user && ( - <Fragment> - <Link href="/account">Account</Link> - <Link href="/logout">Logout</Link> - </Fragment> - )} - </nav> + <HeaderNav /> </Gutter> </header> ) diff --git a/examples/auth/next-pages/src/components/Input/index.module.css b/examples/auth/next-pages/src/components/Input/index.module.css deleted file mode 100644 index 655128696e6..00000000000 --- a/examples/auth/next-pages/src/components/Input/index.module.css +++ /dev/null @@ -1,23 +0,0 @@ -.input { - margin-bottom: 15px; -} - -.input input { - width: 100%; - font-family: system-ui; - border-radius: 0; - box-shadow: 0; - border: 1px solid #d8d8d8; - height: 30px; - line-height: 30px; -} - -.label { - margin-bottom: 10px; - display: block; -} - -.error { - margin-top: 5px; - color: red; -} diff --git a/examples/auth/next-pages/src/components/Input/index.module.scss b/examples/auth/next-pages/src/components/Input/index.module.scss new file mode 100644 index 00000000000..ac587ba491c --- /dev/null +++ b/examples/auth/next-pages/src/components/Input/index.module.scss @@ -0,0 +1,56 @@ +@import '../../css/common'; + +.inputWrap { + width: 100%; +} + +.input { + width: 100%; + font-family: system-ui; + border-radius: 0; + box-shadow: none; + border: none; + background: none; + background-color: var(--theme-elevation-100); + color: var(--theme-elevation-1000); + height: calc(var(--base) * 2); + line-height: calc(var(--base) * 2); + padding: 0 calc(var(--base) / 2); + + &:focus { + border: none; + outline: none; + } + + &:-webkit-autofill, + &:-webkit-autofill:hover, + &:-webkit-autofill:focus { + -webkit-text-fill-color: var(--theme-text); + -webkit-box-shadow: 0 0 0px 1000px var(--theme-elevation-150) inset; + transition: background-color 5000s ease-in-out 0s; + } +} + +@media (prefers-color-scheme: dark) { + .input { + background-color: var(--theme-elevation-150); + } +} + +.error { + background-color: var(--theme-error-150); +} + +.label { + margin-bottom: 0; + display: block; + line-height: 1; + margin-bottom: calc(var(--base) / 2); +} + +.errorMessage { + font-size: small; + line-height: 1.25; + margin-top: 4px; + color: red; +} diff --git a/examples/auth/next-pages/src/components/Input/index.tsx b/examples/auth/next-pages/src/components/Input/index.tsx index 8d4aaf5b4e8..771626cf0a2 100644 --- a/examples/auth/next-pages/src/components/Input/index.tsx +++ b/examples/auth/next-pages/src/components/Input/index.tsx @@ -1,7 +1,7 @@ import React from 'react' -import { FieldValues, UseFormRegister } from 'react-hook-form' +import { FieldValues, UseFormRegister, Validate } from 'react-hook-form' -import classes from './index.module.css' +import classes from './index.module.scss' type Props = { name: string @@ -9,7 +9,8 @@ type Props = { register: UseFormRegister<FieldValues & any> required?: boolean error: any - type?: 'text' | 'number' | 'password' + type?: 'text' | 'number' | 'password' | 'email' + validate?: (value: string) => boolean | string } export const Input: React.FC<Props> = ({ @@ -19,14 +20,36 @@ export const Input: React.FC<Props> = ({ register, error, type = 'text', + validate, }) => { return ( - <div className={classes.input}> + <div className={classes.inputWrap}> <label htmlFor="name" className={classes.label}> - {label} + {`${label} ${required ? '*' : ''}`} </label> - <input {...{ type }} {...register(name, { required })} /> - {error && <div className={classes.error}>This field is required</div>} + <input + className={[classes.input, error && classes.error].filter(Boolean).join(' ')} + {...{ type }} + {...register(name, { + required, + validate, + ...(type === 'email' + ? { + pattern: { + value: /\S+@\S+\.\S+/, + message: 'Please enter a valid email', + }, + } + : {}), + })} + /> + {error && ( + <div className={classes.errorMessage}> + {!error?.message && error?.type === 'required' + ? 'This field is required' + : error?.message} + </div> + )} </div> ) } diff --git a/examples/auth/next-pages/src/components/Message/index.module.scss b/examples/auth/next-pages/src/components/Message/index.module.scss new file mode 100644 index 00000000000..2ee67605686 --- /dev/null +++ b/examples/auth/next-pages/src/components/Message/index.module.scss @@ -0,0 +1,46 @@ +@import '../../css/common'; + +.message { + padding: calc(var(--base) / 2) calc(var(--base) / 2); + line-height: 1.25; + width: 100%; +} + +.default { + background-color: var(--theme-elevation-100); + color: var(--theme-elevation-1000); +} + +.warning { + background-color: var(--theme-warning-500); + color: var(--theme-warning-900); +} + +.error { + background-color: var(--theme-error-500); + color: var(--theme-error-900); +} + +.success { + background-color: var(--theme-success-500); + color: var(--theme-success-900); +} + +@media (prefers-color-scheme: dark) { + .default { + background-color: var(--theme-elevation-900); + color: var(--theme-elevation-100); + } + + .warning { + color: var(--theme-warning-100); + } + + .error { + color: var(--theme-error-100); + } + + .success { + color: var(--theme-success-100); + } +} diff --git a/examples/auth/next-pages/src/components/Message/index.tsx b/examples/auth/next-pages/src/components/Message/index.tsx new file mode 100644 index 00000000000..3cd80608683 --- /dev/null +++ b/examples/auth/next-pages/src/components/Message/index.tsx @@ -0,0 +1,33 @@ +import React from 'react' + +import classes from './index.module.scss' + +export const Message: React.FC<{ + message?: React.ReactNode + error?: React.ReactNode + success?: React.ReactNode + warning?: React.ReactNode + className?: string +}> = ({ message, error, success, warning, className }) => { + const messageToRender = message || error || success || warning + + if (messageToRender) { + return ( + <div + className={[ + classes.message, + className, + error && classes.error, + success && classes.success, + warning && classes.warning, + !error && !success && !warning && classes.default, + ] + .filter(Boolean) + .join(' ')} + > + {messageToRender} + </div> + ) + } + return null +} diff --git a/examples/auth/next-pages/src/components/RenderParams/index.tsx b/examples/auth/next-pages/src/components/RenderParams/index.tsx new file mode 100644 index 00000000000..2abb2c43623 --- /dev/null +++ b/examples/auth/next-pages/src/components/RenderParams/index.tsx @@ -0,0 +1,25 @@ +import { useRouter } from 'next/router' + +import { Message } from '../Message' + +export const RenderParams: React.FC<{ + params?: string[] + message?: string + className?: string +}> = ({ params = ['error', 'message', 'success'], message, className }) => { + const router = useRouter() + const searchParams = new URLSearchParams(router.query as any) + const paramValues = params.map(param => searchParams.get(param)).filter(Boolean) + + if (paramValues.length) { + return ( + <div className={className}> + {paramValues.map(paramValue => ( + <Message key={paramValue} message={(message || 'PARAM')?.replace('PARAM', paramValue)} /> + ))} + </div> + ) + } + + return null +} diff --git a/examples/auth/next-pages/src/css/app.scss b/examples/auth/next-pages/src/css/app.scss new file mode 100644 index 00000000000..fcf6af75664 --- /dev/null +++ b/examples/auth/next-pages/src/css/app.scss @@ -0,0 +1,117 @@ +@use './queries.scss' as *; +@use './colors.scss' as *; +@use './type.scss' as *; +@import "./theme.scss"; + +:root { + --base: 24px; + --font-body: system-ui; + --font-mono: 'Roboto Mono', monospace; + + --gutter-h: 180px; + --block-padding: 120px; + + @include large-break { + --gutter-h: 144px; + --block-padding: 96px; + } + + @include mid-break { + --gutter-h: 24px; + --block-padding: 60px; + } +} + +* { + box-sizing: border-box; +} + +html { + @extend %body; + background: var(--theme-bg); + -webkit-font-smoothing: antialiased; +} + +html, +body, +#app { + height: 100%; +} + +body { + font-family: var(--font-body); + margin: 0; + color: var(--theme-text); +} + +::selection { + background: var(--theme-success-500); + color: var(--color-base-800); +} + +::-moz-selection { + background: var(--theme-success-500); + color: var(--color-base-800); +} + +img { + max-width: 100%; + height: auto; + display: block; +} + +h1 { + @extend %h1; +} + +h2 { + @extend %h2; +} + +h3 { + @extend %h3; +} + +h4 { + @extend %h4; +} + +h5 { + @extend %h5; +} + +h6 { + @extend %h6; +} + +p { + margin: var(--base) 0; + + @include mid-break { + margin: calc(var(--base) * .75) 0; + } +} + +ul, +ol { + padding-left: var(--base); + margin: 0 0 var(--base); +} + +a { + color: currentColor; + + &:focus { + opacity: .8; + outline: none; + } + + &:active { + opacity: .7; + outline: none; + } +} + +svg { + vertical-align: middle; +} diff --git a/examples/auth/next-pages/src/css/colors.scss b/examples/auth/next-pages/src/css/colors.scss new file mode 100644 index 00000000000..68bcbc2d594 --- /dev/null +++ b/examples/auth/next-pages/src/css/colors.scss @@ -0,0 +1,83 @@ +:root { + --color-base-0: rgb(255, 255, 255); + --color-base-50: rgb(245, 245, 245); + --color-base-100: rgb(235, 235, 235); + --color-base-150: rgb(221, 221, 221); + --color-base-200: rgb(208, 208, 208); + --color-base-250: rgb(195, 195, 195); + --color-base-300: rgb(181, 181, 181); + --color-base-350: rgb(168, 168, 168); + --color-base-400: rgb(154, 154, 154); + --color-base-450: rgb(141, 141, 141); + --color-base-500: rgb(128, 128, 128); + --color-base-550: rgb(114, 114, 114); + --color-base-600: rgb(101, 101, 101); + --color-base-650: rgb(87, 87, 87); + --color-base-700: rgb(74, 74, 74); + --color-base-750: rgb(60, 60, 60); + --color-base-800: rgb(47, 47, 47); + --color-base-850: rgb(34, 34, 34); + --color-base-900: rgb(20, 20, 20); + --color-base-950: rgb(7, 7, 7); + --color-base-1000: rgb(0, 0, 0); + + --color-success-50: rgb(247, 255, 251); + --color-success-100: rgb(240, 255, 247); + --color-success-150: rgb(232, 255, 243); + --color-success-200: rgb(224, 255, 239); + --color-success-250: rgb(217, 255, 235); + --color-success-300: rgb(209, 255, 230); + --color-success-350: rgb(201, 255, 226); + --color-success-400: rgb(193, 255, 222); + --color-success-450: rgb(186, 255, 218); + --color-success-500: rgb(178, 255, 214); + --color-success-550: rgb(160, 230, 193); + --color-success-600: rgb(142, 204, 171); + --color-success-650: rgb(125, 179, 150); + --color-success-700: rgb(107, 153, 128); + --color-success-750: rgb(89, 128, 107); + --color-success-800: rgb(71, 102, 86); + --color-success-850: rgb(53, 77, 64); + --color-success-900: rgb(36, 51, 43); + --color-success-950: rgb(18, 25, 21); + + --color-warning-50: rgb(255, 255, 246); + --color-warning-100: rgb(255, 255, 237); + --color-warning-150: rgb(254, 255, 228); + --color-warning-200: rgb(254, 255, 219); + --color-warning-250: rgb(254, 255, 210); + --color-warning-300: rgb(254, 255, 200); + --color-warning-350: rgb(254, 255, 191); + --color-warning-400: rgb(253, 255, 182); + --color-warning-450: rgb(253, 255, 173); + --color-warning-500: rgb(253, 255, 164); + --color-warning-550: rgb(228, 230, 148); + --color-warning-600: rgb(202, 204, 131); + --color-warning-650: rgb(177, 179, 115); + --color-warning-700: rgb(152, 153, 98); + --color-warning-750: rgb(127, 128, 82); + --color-warning-800: rgb(101, 102, 66); + --color-warning-850: rgb(76, 77, 49); + --color-warning-900: rgb(51, 51, 33); + --color-warning-950: rgb(25, 25, 16); + + --color-error-50: rgb(255, 241, 241); + --color-error-100: rgb(255, 226, 228); + --color-error-150: rgb(255, 212, 214); + --color-error-200: rgb(255, 197, 200); + --color-error-250: rgb(255, 183, 187); + --color-error-300: rgb(255, 169, 173); + --color-error-350: rgb(255, 154, 159); + --color-error-400: rgb(255, 140, 145); + --color-error-450: rgb(255, 125, 132); + --color-error-500: rgb(255, 111, 118); + --color-error-550: rgb(230, 100, 106); + --color-error-600: rgb(204, 89, 94); + --color-error-650: rgb(179, 78, 83); + --color-error-700: rgb(153, 67, 71); + --color-error-750: rgb(128, 56, 59); + --color-error-800: rgb(102, 44, 47); + --color-error-850: rgb(77, 33, 35); + --color-error-900: rgb(51, 22, 24); + --color-error-950: rgb(25, 11, 12); +} diff --git a/examples/auth/next-pages/src/css/common.scss b/examples/auth/next-pages/src/css/common.scss new file mode 100644 index 00000000000..bebb9f3aa20 --- /dev/null +++ b/examples/auth/next-pages/src/css/common.scss @@ -0,0 +1 @@ +@forward './queries.scss'; diff --git a/examples/auth/next-pages/src/css/queries.scss b/examples/auth/next-pages/src/css/queries.scss new file mode 100644 index 00000000000..8f84ac7097e --- /dev/null +++ b/examples/auth/next-pages/src/css/queries.scss @@ -0,0 +1,28 @@ +$breakpoint-xs-width: 400px; +$breakpoint-s-width: 768px; +$breakpoint-m-width: 1024px; +$breakpoint-l-width: 1440px; + +@mixin extra-small-break { + @media (max-width: #{$breakpoint-xs-width}) { + @content; + } +} + +@mixin small-break { + @media (max-width: #{$breakpoint-s-width}) { + @content; + } +} + +@mixin mid-break { + @media (max-width: #{$breakpoint-m-width}) { + @content; + } +} + +@mixin large-break { + @media (max-width: #{$breakpoint-l-width}) { + @content; + } +} diff --git a/examples/auth/next-pages/src/css/theme.scss b/examples/auth/next-pages/src/css/theme.scss new file mode 100644 index 00000000000..0c93d334fdf --- /dev/null +++ b/examples/auth/next-pages/src/css/theme.scss @@ -0,0 +1,241 @@ +@media (prefers-color-scheme: light) { + :root { + --theme-success-50: var(--color-success-50); + --theme-success-100: var(--color-success-100); + --theme-success-150: var(--color-success-150); + --theme-success-200: var(--color-success-200); + --theme-success-250: var(--color-success-250); + --theme-success-300: var(--color-success-300); + --theme-success-350: var(--color-success-350); + --theme-success-400: var(--color-success-400); + --theme-success-450: var(--color-success-450); + --theme-success-500: var(--color-success-500); + --theme-success-550: var(--color-success-550); + --theme-success-600: var(--color-success-600); + --theme-success-650: var(--color-success-650); + --theme-success-700: var(--color-success-700); + --theme-success-750: var(--color-success-750); + --theme-success-800: var(--color-success-800); + --theme-success-850: var(--color-success-850); + --theme-success-900: var(--color-success-900); + --theme-success-950: var(--color-success-950); + + --theme-warning-50: var(--color-warning-50); + --theme-warning-100: var(--color-warning-100); + --theme-warning-150: var(--color-warning-150); + --theme-warning-200: var(--color-warning-200); + --theme-warning-250: var(--color-warning-250); + --theme-warning-300: var(--color-warning-300); + --theme-warning-350: var(--color-warning-350); + --theme-warning-400: var(--color-warning-400); + --theme-warning-450: var(--color-warning-450); + --theme-warning-500: var(--color-warning-500); + --theme-warning-550: var(--color-warning-550); + --theme-warning-600: var(--color-warning-600); + --theme-warning-650: var(--color-warning-650); + --theme-warning-700: var(--color-warning-700); + --theme-warning-750: var(--color-warning-750); + --theme-warning-800: var(--color-warning-800); + --theme-warning-850: var(--color-warning-850); + --theme-warning-900: var(--color-warning-900); + --theme-warning-950: var(--color-warning-950); + + --theme-error-50: var(--color-error-50); + --theme-error-100: var(--color-error-100); + --theme-error-150: var(--color-error-150); + --theme-error-200: var(--color-error-200); + --theme-error-250: var(--color-error-250); + --theme-error-300: var(--color-error-300); + --theme-error-350: var(--color-error-350); + --theme-error-400: var(--color-error-400); + --theme-error-450: var(--color-error-450); + --theme-error-500: var(--color-error-500); + --theme-error-550: var(--color-error-550); + --theme-error-600: var(--color-error-600); + --theme-error-650: var(--color-error-650); + --theme-error-700: var(--color-error-700); + --theme-error-750: var(--color-error-750); + --theme-error-800: var(--color-error-800); + --theme-error-850: var(--color-error-850); + --theme-error-900: var(--color-error-900); + --theme-error-950: var(--color-error-950); + + --theme-elevation-0: var(--color-base-0); + --theme-elevation-50: var(--color-base-50); + --theme-elevation-100: var(--color-base-100); + --theme-elevation-150: var(--color-base-150); + --theme-elevation-200: var(--color-base-200); + --theme-elevation-250: var(--color-base-250); + --theme-elevation-300: var(--color-base-300); + --theme-elevation-350: var(--color-base-350); + --theme-elevation-400: var(--color-base-400); + --theme-elevation-450: var(--color-base-450); + --theme-elevation-500: var(--color-base-500); + --theme-elevation-550: var(--color-base-550); + --theme-elevation-600: var(--color-base-600); + --theme-elevation-650: var(--color-base-650); + --theme-elevation-700: var(--color-base-700); + --theme-elevation-750: var(--color-base-750); + --theme-elevation-800: var(--color-base-800); + --theme-elevation-850: var(--color-base-850); + --theme-elevation-900: var(--color-base-900); + --theme-elevation-950: var(--color-base-950); + --theme-elevation-1000: var(--color-base-1000); + + --theme-bg: var(--theme-elevation-0); + --theme-input-bg: var(--theme-elevation-50); + --theme-text: var(--theme-elevation-750); + --theme-border-color: var(--theme-elevation-150); + + color-scheme: light; + color: var(--theme-text); + + --highlight-default-bg-color: var(--theme-success-400); + --highlight-default-text-color: var(--theme-text); + + --highlight-danger-bg-color: var(--theme-error-150); + --highlight-danger-text-color: var(--theme-text); + } + + h1 a, + h2 a, + h3 a, + h4 a, + h5 a, + h6 a { + color: var(--theme-elevation-750); + + &:hover { + color: var(--theme-elevation-800); + } + + &:visited { + color: var(--theme-elevation-750); + + &:hover { + color: var(--theme-elevation-800); + } + } + } +} + +@media (prefers-color-scheme: dark) { + :root { + --theme-elevation-0: var(--color-base-1000); + --theme-elevation-50: var(--color-base-950); + --theme-elevation-100: var(--color-base-900); + --theme-elevation-150: var(--color-base-850); + --theme-elevation-200: var(--color-base-800); + --theme-elevation-250: var(--color-base-750); + --theme-elevation-300: var(--color-base-700); + --theme-elevation-350: var(--color-base-650); + --theme-elevation-400: var(--color-base-600); + --theme-elevation-450: var(--color-base-550); + --theme-elevation-500: var(--color-base-500); + --theme-elevation-550: var(--color-base-450); + --theme-elevation-600: var(--color-base-400); + --theme-elevation-650: var(--color-base-350); + --theme-elevation-700: var(--color-base-300); + --theme-elevation-750: var(--color-base-250); + --theme-elevation-800: var(--color-base-200); + --theme-elevation-850: var(--color-base-150); + --theme-elevation-900: var(--color-base-100); + --theme-elevation-950: var(--color-base-50); + --theme-elevation-1000: var(--color-base-0); + + --theme-success-50: var(--color-success-950); + --theme-success-100: var(--color-success-900); + --theme-success-150: var(--color-success-850); + --theme-success-200: var(--color-success-800); + --theme-success-250: var(--color-success-750); + --theme-success-300: var(--color-success-700); + --theme-success-350: var(--color-success-650); + --theme-success-400: var(--color-success-600); + --theme-success-450: var(--color-success-550); + --theme-success-500: var(--color-success-500); + --theme-success-550: var(--color-success-450); + --theme-success-600: var(--color-success-400); + --theme-success-650: var(--color-success-350); + --theme-success-700: var(--color-success-300); + --theme-success-750: var(--color-success-250); + --theme-success-800: var(--color-success-200); + --theme-success-850: var(--color-success-150); + --theme-success-900: var(--color-success-100); + --theme-success-950: var(--color-success-50); + + --theme-warning-50: var(--color-warning-950); + --theme-warning-100: var(--color-warning-900); + --theme-warning-150: var(--color-warning-850); + --theme-warning-200: var(--color-warning-800); + --theme-warning-250: var(--color-warning-750); + --theme-warning-300: var(--color-warning-700); + --theme-warning-350: var(--color-warning-650); + --theme-warning-400: var(--color-warning-600); + --theme-warning-450: var(--color-warning-550); + --theme-warning-500: var(--color-warning-500); + --theme-warning-550: var(--color-warning-450); + --theme-warning-600: var(--color-warning-400); + --theme-warning-650: var(--color-warning-350); + --theme-warning-700: var(--color-warning-300); + --theme-warning-750: var(--color-warning-250); + --theme-warning-800: var(--color-warning-200); + --theme-warning-850: var(--color-warning-150); + --theme-warning-900: var(--color-warning-100); + --theme-warning-950: var(--color-warning-50); + + --theme-error-50: var(--color-error-950); + --theme-error-100: var(--color-error-900); + --theme-error-150: var(--color-error-850); + --theme-error-200: var(--color-error-800); + --theme-error-250: var(--color-error-750); + --theme-error-300: var(--color-error-700); + --theme-error-350: var(--color-error-650); + --theme-error-400: var(--color-error-600); + --theme-error-450: var(--color-error-550); + --theme-error-500: var(--color-error-500); + --theme-error-550: var(--color-error-450); + --theme-error-600: var(--color-error-400); + --theme-error-650: var(--color-error-350); + --theme-error-700: var(--color-error-300); + --theme-error-750: var(--color-error-250); + --theme-error-800: var(--color-error-200); + --theme-error-850: var(--color-error-150); + --theme-error-900: var(--color-error-100); + --theme-error-950: var(--color-error-50); + + --theme-bg: var(--theme-elevation-100); + --theme-text: var(--theme-elevation-900); + --theme-input-bg: var(--theme-elevation-150); + --theme-border-color: var(--theme-elevation-250); + + color-scheme: dark; + color: var(--theme-text); + + --highlight-default-bg-color: var(--theme-success-100); + --highlight-default-text-color: var(--theme-success-600); + + --highlight-danger-bg-color: var(--theme-error-100); + --highlight-danger-text-color: var(--theme-error-550); + } + + h1 a, + h2 a, + h3 a, + h4 a, + h5 a, + h6 a { + color: var(--theme-success-600); + + &:hover { + color: var(--theme-success-400); + } + + &:visited { + color: var(--theme-success-700); + + &:hover { + color: var(--theme-success-500); + } + } + } +} diff --git a/examples/auth/next-pages/src/css/type.scss b/examples/auth/next-pages/src/css/type.scss new file mode 100644 index 00000000000..f8d1d07162e --- /dev/null +++ b/examples/auth/next-pages/src/css/type.scss @@ -0,0 +1,110 @@ +@use 'queries' as *; + +%h1, +%h2, +%h3, +%h4, +%h5, +%h6 { + font-weight: 700; +} + +%h1 { + margin: 40px 0; + font-size: 64px; + line-height: 70px; + font-weight: bold; + + @include mid-break { + margin: 24px 0; + font-size: 42px; + line-height: 42px; + } +} + +%h2 { + margin: 28px 0; + font-size: 48px; + line-height: 54px; + font-weight: bold; + + @include mid-break { + margin: 22px 0; + font-size: 32px; + line-height: 40px; + } +} + +%h3 { + margin: 24px 0; + font-size: 32px; + line-height: 40px; + font-weight: bold; + + @include mid-break { + margin: 20px 0; + font-size: 26px; + line-height: 32px; + } +} + +%h4 { + margin: 20px 0; + font-size: 26px; + line-height: 32px; + font-weight: bold; + + @include mid-break { + font-size: 22px; + line-height: 30px; + } +} + +%h5 { + margin: 20px 0; + font-size: 22px; + line-height: 30px; + font-weight: bold; + + @include mid-break { + font-size: 18px; + line-height: 24px; + } +} + +%h6 { + margin: 20px 0; + font-size: inherit; + line-height: inherit; + font-weight: bold; +} + +%body { + font-size: 18px; + line-height: 32px; + + @include mid-break { + font-size: 15px; + line-height: 24px; + } +} + +%large-body { + font-size: 25px; + line-height: 32px; + + @include mid-break { + font-size: 22px; + line-height: 30px; + } +} + +%label { + font-size: 16px; + line-height: 24px; + text-transform: uppercase; + + @include mid-break { + font-size: 13px; + } +} diff --git a/examples/auth/next-pages/src/pages/_app.tsx b/examples/auth/next-pages/src/pages/_app.tsx index b08c429e84e..efcddc0da44 100644 --- a/examples/auth/next-pages/src/pages/_app.tsx +++ b/examples/auth/next-pages/src/pages/_app.tsx @@ -1,26 +1,24 @@ import type { AppProps } from 'next/app' -import { AuthProvider } from '../components/Auth' import { Header } from '../components/Header' +import { AuthProvider } from '../providers/Auth' -import './app.scss' - -import classes from './index.module.scss' +import '../css/app.scss' export default function MyApp({ Component, pageProps }: AppProps) { return ( - // The `AuthProvider` can be used with either REST or GraphQL APIs - // Just change the `api` prop to "graphql" or "rest", that's it! - <AuthProvider api="rest"> + <AuthProvider + // To toggle between the REST and GraphQL APIs, + // change the `api` prop to either `rest` or `gql` + api="rest" // change this to `gql` to use the GraphQL API + > <Header /> - <div className={classes.page}> - {/* typescript flags this `@ts-expect-error` declaration as unneeded, but types are breaking the build process + {/* typescript flags this `@ts-expect-error` declaration as unneeded, but types are breaking the build process Remove these comments when the issue is resolved See more here: https://github.com/facebook/react/issues/24304 */} - {/* @ts-expect-error */} - <Component {...pageProps} /> - </div> + {/* @ts-expect-error */} + <Component {...pageProps} /> </AuthProvider> ) } diff --git a/examples/auth/next-pages/src/pages/account/index.module.css b/examples/auth/next-pages/src/pages/account/index.module.css deleted file mode 100644 index 9a5decbddb3..00000000000 --- a/examples/auth/next-pages/src/pages/account/index.module.css +++ /dev/null @@ -1,17 +0,0 @@ -.form { - margin-bottom: 30px; -} - -.success, -.error, -.message { - margin-bottom: 30px; -} - -.success { - color: green; -} - -.error { - color: red; -} diff --git a/examples/auth/next-pages/src/pages/account/index.module.scss b/examples/auth/next-pages/src/pages/account/index.module.scss new file mode 100644 index 00000000000..9d9b9d879b7 --- /dev/null +++ b/examples/auth/next-pages/src/pages/account/index.module.scss @@ -0,0 +1,32 @@ +@import "../../css/common"; + +.account { + margin-bottom: var(--block-padding); +} + +.params { + margin-top: var(--base); +} + +.form { + margin-bottom: var(--base); + display: flex; + flex-direction: column; + gap: calc(var(--base) / 2); + align-items: flex-start; + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.changePassword { + all: unset; + cursor: pointer; + text-decoration: underline; +} + +.submit { + margin-top: calc(var(--base) / 2); +} diff --git a/examples/auth/next-pages/src/pages/account/index.tsx b/examples/auth/next-pages/src/pages/account/index.tsx index b2678c71b2a..f161dd1c598 100644 --- a/examples/auth/next-pages/src/pages/account/index.tsx +++ b/examples/auth/next-pages/src/pages/account/index.tsx @@ -1,32 +1,42 @@ -import React, { useCallback, useEffect, useState } from 'react' +import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react' import { useForm } from 'react-hook-form' import Link from 'next/link' import { useRouter } from 'next/router' -import { useAuth } from '../../components/Auth' +import { Button } from '../../components/Button' import { Gutter } from '../../components/Gutter' import { Input } from '../../components/Input' -import classes from './index.module.css' +import { Message } from '../../components/Message' +import { RenderParams } from '../../components/RenderParams' +import { useAuth } from '../../providers/Auth' + +import classes from './index.module.scss' type FormData = { email: string - firstName: string - lastName: string + name: string + password: string + passwordConfirm: string } const Account: React.FC = () => { const [error, setError] = useState('') const [success, setSuccess] = useState('') const { user, setUser } = useAuth() + const [changePassword, setChangePassword] = useState(false) const router = useRouter() const { register, handleSubmit, - formState: { errors }, + formState: { errors, isLoading }, reset, + watch, } = useForm<FormData>() + const password = useRef({}) + password.current = watch('password', '') + const onSubmit = useCallback( async (data: FormData) => { if (user) { @@ -42,21 +52,22 @@ const Account: React.FC = () => { if (response.ok) { const json = await response.json() - - // Update the user in auth state with new values setUser(json.doc) - - // Set success message for user setSuccess('Successfully updated account.') - - // Clear any existing errors setError('') + setChangePassword(false) + reset({ + email: json.doc.email, + name: json.doc.name, + password: '', + passwordConfirm: '', + }) } else { setError('There was a problem updating your account.') } } }, - [user, setUser], + [user, setUser, reset], ) useEffect(() => { @@ -68,37 +79,87 @@ const Account: React.FC = () => { if (user) { reset({ email: user.email, - firstName: user.firstName, - lastName: user.lastName, + password: '', + passwordConfirm: '', }) } - }, [user, reset, router]) - - useEffect(() => { - if (typeof router.query.success === 'string') { - setSuccess(router.query.success) - } - }, [router]) + }, [user, router, reset, changePassword]) return ( - <Gutter> + <Gutter className={classes.account}> + <RenderParams className={classes.params} /> <h1>Account</h1> - {router.query.message && <div className={classes.message}>{router.query.message}</div>} - {error && <div className={classes.error}>{error}</div>} - {success && <div className={classes.success}>{success}</div>} + <p> + {`This is your account dashboard. Here you can update your account information and more. To manage all users, `} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + {'.'} + </p> <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> - <Input - name="email" - label="Email Address" - required - register={register} - error={errors.email} + <Message error={error} success={success} className={classes.message} /> + {!changePassword ? ( + <Fragment> + <p> + {'Change your account details below, or '} + <button + type="button" + className={classes.changePassword} + onClick={() => setChangePassword(!changePassword)} + > + click here + </button> + {' to change your password.'} + </p> + <Input + name="email" + label="Email Address" + required + register={register} + error={errors.email} + type="email" + /> + </Fragment> + ) : ( + <Fragment> + <p> + {'Change your password below, or '} + <button + type="button" + className={classes.changePassword} + onClick={() => setChangePassword(!changePassword)} + > + cancel + </button> + . + </p> + <Input + name="password" + type="password" + label="Password" + required + register={register} + error={errors.password} + /> + <Input + name="passwordConfirm" + type="password" + label="Confirm Password" + required + register={register} + validate={value => value === password.current || 'The passwords do not match'} + error={errors.passwordConfirm} + /> + </Fragment> + )} + <Button + type="submit" + className={classes.submit} + label={isLoading ? 'Processing' : changePassword ? 'Change password' : 'Update account'} + appearance="primary" /> - <Input name="firstName" label="First Name" register={register} error={errors.firstName} /> - <Input name="lastName" label="Last Name" register={register} error={errors.lastName} /> - <button type="submit">Update account</button> </form> - <Link href="/logout">Log out</Link> + <Button href="/logout" appearance="secondary" label="Log out" /> </Gutter> ) } diff --git a/examples/auth/next-pages/src/pages/app.scss b/examples/auth/next-pages/src/pages/app.scss deleted file mode 100644 index 21f01bb945c..00000000000 --- a/examples/auth/next-pages/src/pages/app.scss +++ /dev/null @@ -1,107 +0,0 @@ -$breakpoint: 1000px; - -:root { - --max-width: 1600px; - --foreground-rgb: 0, 0, 0; - --background-rgb: 255, 255, 255; - --block-spacing: 2rem; - --gutter-h: 4rem; - --base: 1rem; - - @media (max-width: $breakpoint) { - --block-spacing: 1rem; - --gutter-h: 2rem; - --base: 0.75rem; - } -} - -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-rgb: 7, 7, 7; - } -} - -* { - box-sizing: border-box; -} - -html { - font-size: 20px; - line-height: 1.5; - font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - - @media (max-width: $breakpoint) { - font-size: 16px; - } -} - -html, -body { - max-width: 100vw; - overflow-x: hidden; -} - -body { - margin: 0; - color: rgb(var(--foreground-rgb)); - background: rgb(var(--background-rgb)); -} - -img { - height: auto; - max-width: 100%; - display: block; -} - -h1 { - font-size: 4.5rem; - line-height: 1.2; - margin: 0 0 2.5rem 0; - - @media (max-width: $breakpoint) { - font-size: 3rem; - margin: 0 0 1.5rem 0; - } -} - -h2 { - font-size: 3.5rem; - line-height: 1.2; - margin: 0 0 2.5rem 0; -} - -h3 { - font-size: 2.5rem; - line-height: 1.2; - margin: 0 0 2rem 0; -} - -h4 { - font-size: 1.5rem; - line-height: 1.2; - margin: 0 0 1rem 0; -} - -h5 { - font-size: 1.25rem; - line-height: 1.2; - margin: 0 0 1rem 0; -} - -h6 { - font-size: 1rem; - line-height: 1.2; - margin: 0 0 1rem 0; -} - -a { - color: inherit; - text-decoration: none; -} - -@media (prefers-color-scheme: dark) { - html { - color-scheme: dark; - } -} diff --git a/examples/auth/next-pages/src/pages/create-account/index.module.css b/examples/auth/next-pages/src/pages/create-account/index.module.css deleted file mode 100644 index c873f1ac88a..00000000000 --- a/examples/auth/next-pages/src/pages/create-account/index.module.css +++ /dev/null @@ -1,8 +0,0 @@ -.form { - margin-bottom: 30px; -} - -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-pages/src/pages/create-account/index.module.scss b/examples/auth/next-pages/src/pages/create-account/index.module.scss new file mode 100644 index 00000000000..ed0ca4112cb --- /dev/null +++ b/examples/auth/next-pages/src/pages/create-account/index.module.scss @@ -0,0 +1,26 @@ +@import "../../css/common"; + +.createAccount { + margin-bottom: var(--block-padding); +} + +.form { + margin-bottom: var(--base); + display: flex; + flex-direction: column; + gap: calc(var(--base) / 2); + align-items: flex-start; + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.submit { + margin-top: calc(var(--base) / 2); +} + +.message { + margin-bottom: var(--base); +} diff --git a/examples/auth/next-pages/src/pages/create-account/index.tsx b/examples/auth/next-pages/src/pages/create-account/index.tsx index 217b1d99e71..fe638003856 100644 --- a/examples/auth/next-pages/src/pages/create-account/index.tsx +++ b/examples/auth/next-pages/src/pages/create-account/index.tsx @@ -1,88 +1,125 @@ -import React, { useCallback, useState } from 'react' +import React, { useCallback, useMemo, useRef, useState } from 'react' import { useForm } from 'react-hook-form' import Link from 'next/link' +import { useRouter } from 'next/router' -import { useAuth } from '../../components/Auth' +import { Button } from '../../components/Button' import { Gutter } from '../../components/Gutter' import { Input } from '../../components/Input' -import classes from './index.module.css' +import { Message } from '../../components/Message' +import { RenderParams } from '../../components/RenderParams' +import { useAuth } from '../../providers/Auth' + +import classes from './index.module.scss' type FormData = { email: string password: string - firstName: string - lastName: string + passwordConfirm: string } const CreateAccount: React.FC = () => { - const [error, setError] = useState('') - const [success, setSuccess] = useState(false) - const { login, create, user } = useAuth() + const router = useRouter() + const searchParams = useMemo(() => new URLSearchParams(router.query as any), [router.query]) + const allParams = searchParams.toString() ? `?${searchParams.toString()}` : '' + const { login } = useAuth() + const [loading, setLoading] = useState(false) + const [error, setError] = useState<string | null>(null) const { register, handleSubmit, formState: { errors }, + watch, } = useForm<FormData>() + const password = useRef({}) + password.current = watch('password', '') + const onSubmit = useCallback( async (data: FormData) => { + const response = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users`, { + method: 'POST', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (!response.ok) { + const message = response.statusText || 'There was an error creating the account.' + setError(message) + return + } + + const redirect = searchParams.get('redirect') + + const timer = setTimeout(() => { + setLoading(true) + }, 1000) + try { - await create(data as Parameters<typeof create>[0]) - // Automatically log the user in after creating their account - await login({ email: data.email, password: data.password }) - setSuccess(true) - } catch (err) { - setError(err?.message || 'An error occurred while attempting to create your account.') + await login(data) + clearTimeout(timer) + if (redirect) router.push(redirect as string) + else router.push(`/account?success=${encodeURIComponent('Account created successfully')}`) + } catch (_) { + clearTimeout(timer) + setError('There was an error with the credentials provided. Please try again.') } }, - [login, create], + [login, router, searchParams], ) return ( - <Gutter> - {!success && ( - <React.Fragment> - <h1>Create Account</h1> - {error && <div className={classes.error}>{error}</div>} - <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> - <Input - name="email" - label="Email Address" - required - register={register} - error={errors.email} - /> - <Input - name="password" - type="password" - label="Password" - required - register={register} - error={errors.password} - /> - <Input - name="firstName" - label="First Name" - register={register} - error={errors.firstName} - /> - <Input name="lastName" label="Last Name" register={register} error={errors.lastName} /> - <button type="submit">Create account</button> - </form> - <p> - {'Already have an account? '} - <Link href="/login">Login</Link> - </p> - </React.Fragment> - )} - {success && ( - <React.Fragment> - <h1>Account created successfully</h1> - <p>You are now logged in.</p> - <Link href="/account">Go to your account</Link> - </React.Fragment> - )} + <Gutter className={classes.createAccount}> + <h1>Create Account</h1> + <RenderParams /> + <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <p> + {`This is where new customers can signup and create a new account. To manage all users, `} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + {'.'} + </p> + <Message error={error} className={classes.message} /> + <Input + name="email" + label="Email Address" + required + register={register} + error={errors.email} + type="email" + /> + <Input + name="password" + type="password" + label="Password" + required + register={register} + error={errors.password} + /> + <Input + name="passwordConfirm" + type="password" + label="Confirm Password" + required + register={register} + validate={value => value === password.current || 'The passwords do not match'} + error={errors.passwordConfirm} + /> + <Button + type="submit" + className={classes.submit} + label={loading ? 'Processing' : 'Create Account'} + appearance="primary" + /> + <div> + {'Already have an account? '} + <Link href={`/login${allParams}`}>Login</Link> + </div> + </form> </Gutter> ) } diff --git a/examples/auth/next-pages/src/pages/index.module.scss b/examples/auth/next-pages/src/pages/index.module.scss deleted file mode 100644 index 3ae99a675a4..00000000000 --- a/examples/auth/next-pages/src/pages/index.module.scss +++ /dev/null @@ -1,3 +0,0 @@ -.page { - margin-top: calc(var(--base) * 2); -} diff --git a/examples/auth/next-pages/src/pages/index.tsx b/examples/auth/next-pages/src/pages/index.tsx index 99028e8fc04..65d4eead620 100644 --- a/examples/auth/next-pages/src/pages/index.tsx +++ b/examples/auth/next-pages/src/pages/index.tsx @@ -1,9 +1,8 @@ -import React from 'react' import Link from 'next/link' import { Gutter } from '../components/Gutter' -const Home: React.FC = () => { +export default function Home() { return ( <Gutter> <h1>Payload Auth Example</h1> @@ -13,40 +12,34 @@ const Home: React.FC = () => { Payload </Link> {' + '} - <Link href="https://nextjs.org/" target="_blank" rel="noopener noreferrer"> + <Link href="https://nextjs.org" target="_blank" rel="noopener noreferrer"> Next.js </Link> {' app using the '} <Link href="https://nextjs.org/docs/pages" target="_blank" rel="noopener noreferrer"> Pages Router </Link> - {" made explicitly for Payload's "} - <Link - href="https://github.com/payloadcms/payload/tree/master/examples/auth/cms" - target="_blank" - rel="noopener noreferrer" - > - Auth Example + {' made explicitly for the '} + <Link href="https://github.com/payloadcms/payload/tree/master/examples/auth"> + Payload Auth Example </Link> {". This example demonstrates how to implement Payload's "} - <Link - href="https://payloadcms.com/docs/authentication/overview" - target="_blank" - rel="noopener noreferrer" - > - Authentication - </Link> - {' strategies in both the REST and GraphQL APIs.'} + <Link href="https://payloadcms.com/docs/authentication/overview">Authentication</Link> + { + ' strategies in both the REST and GraphQL APIs. To toggle between these APIs, see `_app.tsx`.' + } </p> <p> {'Visit the '} - <Link href="/login">Login</Link> - {' page to start the authentication flow. Once logged in, you will be redirected to the '} - <Link href="/account">Account</Link> - {` page which is restricted to users only. To toggle APIs, simply toggle the "api" prop between "rest" and "gql" in "_app.tsx".`} + <Link href="/login">login page</Link> + {' to start the authentication flow. Once logged in, you will be redirected to the '} + <Link href="/account">account page</Link> + {` which is restricted to users only. To manage all users, `} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + {'.'} </p> </Gutter> ) } - -export default Home diff --git a/examples/auth/next-pages/src/pages/login/index.module.css b/examples/auth/next-pages/src/pages/login/index.module.css deleted file mode 100644 index c873f1ac88a..00000000000 --- a/examples/auth/next-pages/src/pages/login/index.module.css +++ /dev/null @@ -1,8 +0,0 @@ -.form { - margin-bottom: 30px; -} - -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-pages/src/pages/login/index.module.scss b/examples/auth/next-pages/src/pages/login/index.module.scss new file mode 100644 index 00000000000..ab597dcc291 --- /dev/null +++ b/examples/auth/next-pages/src/pages/login/index.module.scss @@ -0,0 +1,30 @@ +@import "../../css/common"; + +.login { + margin-bottom: var(--block-padding); +} + +.params { + margin-top: var(--base); +} + +.form { + margin-bottom: var(--base); + display: flex; + flex-direction: column; + gap: calc(var(--base) / 2); + align-items: flex-start; + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.submit { + margin-top: calc(var(--base) / 2); +} + +.message { + margin-bottom: var(--base); +} diff --git a/examples/auth/next-pages/src/pages/login/index.tsx b/examples/auth/next-pages/src/pages/login/index.tsx index bcf26ea3128..4bd9f54420a 100644 --- a/examples/auth/next-pages/src/pages/login/index.tsx +++ b/examples/auth/next-pages/src/pages/login/index.tsx @@ -1,12 +1,16 @@ -import React, { useCallback, useEffect, useState } from 'react' +import React, { useCallback, useMemo, useRef } from 'react' import { useForm } from 'react-hook-form' import Link from 'next/link' import { useRouter } from 'next/router' -import { useAuth } from '../../components/Auth' +import { Button } from '../../components/Button' import { Gutter } from '../../components/Gutter' import { Input } from '../../components/Input' -import classes from './index.module.css' +import { Message } from '../../components/Message' +import { RenderParams } from '../../components/RenderParams' +import { useAuth } from '../../providers/Auth' + +import classes from './index.module.scss' type FormData = { email: string @@ -14,52 +18,61 @@ type FormData = { } const Login: React.FC = () => { - const [error, setError] = useState('') const router = useRouter() - const { login, user } = useAuth() + const searchParams = useMemo(() => new URLSearchParams(router.query as any), [router.query]) + const allParams = searchParams.toString() ? `?${searchParams.toString()}` : '' + const redirect = useRef(searchParams.get('redirect')) + const { login } = useAuth() + const [error, setError] = React.useState<string | null>(null) const { register, handleSubmit, - formState: { errors }, - } = useForm<FormData>() + formState: { errors, isLoading }, + } = useForm<FormData>({ + defaultValues: { + email: '[email protected]', + password: 'demo', + }, + }) const onSubmit = useCallback( async (data: FormData) => { try { await login(data) - router.push('/account') - } catch (err) { - setError(err?.message || 'An error occurred while attempting to login.') + if (redirect?.current) router.push(redirect.current as string) + else router.push('/account') + } catch (_) { + setError('There was an error with the credentials provided. Please try again.') } }, [login, router], ) - useEffect(() => { - if (router.query.unauthorized) { - setError(`To visit the ${router.query.unauthorized} page, you need to be logged in.`) - } - }, [router]) - - if (user) { - router.push('/account') - } - return ( - <Gutter> + <Gutter className={classes.login}> + <RenderParams className={classes.params} /> <h1>Log in</h1> - <p> - To log in, use the email <b>[email protected]</b> with the password <b>demo</b>. - </p> - {error && <div className={classes.error}>{error}</div>} <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <p> + {'To log in, use the email '} + <b>[email protected]</b> + {' with the password '} + <b>demo</b> + {'. To manage your users, '} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + . + </p> + <Message error={error} className={classes.message} /> <Input name="email" label="Email Address" required register={register} error={errors.email} + type="email" /> <Input name="password" @@ -69,11 +82,19 @@ const Login: React.FC = () => { register={register} error={errors.password} /> - <input type="submit" /> + <Button + type="submit" + disabled={isLoading} + className={classes.submit} + label={isLoading ? 'Processing' : 'Login'} + appearance="primary" + /> + <div> + <Link href={`/create-account${allParams}`}>Create an account</Link> + <br /> + <Link href={`/recover-password${allParams}`}>Recover your password</Link> + </div> </form> - <Link href="/create-account">Create an account</Link> - <br /> - <Link href="/recover-password">Recover your password</Link> </Gutter> ) } diff --git a/examples/auth/next-pages/src/pages/logout/index.module.css b/examples/auth/next-pages/src/pages/logout/index.module.css deleted file mode 100644 index 7d2f0a0af18..00000000000 --- a/examples/auth/next-pages/src/pages/logout/index.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-pages/src/pages/logout/index.module.scss b/examples/auth/next-pages/src/pages/logout/index.module.scss new file mode 100644 index 00000000000..d7032f8cfc5 --- /dev/null +++ b/examples/auth/next-pages/src/pages/logout/index.module.scss @@ -0,0 +1,3 @@ +.logout { + margin-bottom: var(--block-padding); +} diff --git a/examples/auth/next-pages/src/pages/logout/index.tsx b/examples/auth/next-pages/src/pages/logout/index.tsx index bebbef34357..a02b79f424a 100644 --- a/examples/auth/next-pages/src/pages/logout/index.tsx +++ b/examples/auth/next-pages/src/pages/logout/index.tsx @@ -1,9 +1,10 @@ -import React, { Fragment, useEffect, useState } from 'react' +import React, { useEffect, useState } from 'react' import Link from 'next/link' -import { useAuth } from '../../components/Auth' import { Gutter } from '../../components/Gutter' -import classes from './index.module.css' +import { useAuth } from '../../providers/Auth' + +import classes from './index.module.scss' const Logout: React.FC = () => { const { logout } = useAuth() @@ -15,8 +16,8 @@ const Logout: React.FC = () => { try { await logout() setSuccess('Logged out successfully.') - } catch (err) { - setError(err?.message || 'An error occurred while attempting to logout.') + } catch (_) { + setError('You are already logged out.') } } @@ -24,17 +25,19 @@ const Logout: React.FC = () => { }, [logout]) return ( - <Gutter> - {success && <h1>{success}</h1>} - {error && <div className={classes.error}>{error}</div>} - <p> - {'What would you like to do next? '} - <Fragment> - {' To log back in, '} - <Link href={`/login`}>click here</Link> - {'.'} - </Fragment> - </p> + <Gutter className={classes.logout}> + {(error || success) && ( + <div> + <h1>{error || success}</h1> + <p> + {'What would you like to do next? '} + <Link href="/">Click here</Link> + {` to go to the home page. To log back in, `} + <Link href="login">click here</Link> + {'.'} + </p> + </div> + )} </Gutter> ) } diff --git a/examples/auth/next-pages/src/pages/recover-password/index.module.css b/examples/auth/next-pages/src/pages/recover-password/index.module.css deleted file mode 100644 index 7d2f0a0af18..00000000000 --- a/examples/auth/next-pages/src/pages/recover-password/index.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-pages/src/pages/recover-password/index.module.scss b/examples/auth/next-pages/src/pages/recover-password/index.module.scss new file mode 100644 index 00000000000..08d3d74feea --- /dev/null +++ b/examples/auth/next-pages/src/pages/recover-password/index.module.scss @@ -0,0 +1,27 @@ +@import "../../css/common"; + +.recoverPassword { + margin-bottom: var(--block-padding); +} + +.error { + color: red; + margin-bottom: 15px; +} + +.formWrapper { + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.submit { + margin-top: var(--base); +} + +.message { + margin-bottom: var(--base); +} + diff --git a/examples/auth/next-pages/src/pages/recover-password/index.tsx b/examples/auth/next-pages/src/pages/recover-password/index.tsx index fac6f3099bc..797fe5acab3 100644 --- a/examples/auth/next-pages/src/pages/recover-password/index.tsx +++ b/examples/auth/next-pages/src/pages/recover-password/index.tsx @@ -1,10 +1,13 @@ import React, { useCallback, useState } from 'react' import { useForm } from 'react-hook-form' +import Link from 'next/link' -import { useAuth } from '../../components/Auth' +import { Button } from '../../components/Button' import { Gutter } from '../../components/Gutter' import { Input } from '../../components/Input' -import classes from './index.module.css' +import { Message } from '../../components/Message' + +import classes from './index.module.scss' type FormData = { email: string @@ -13,7 +16,6 @@ type FormData = { const RecoverPassword: React.FC = () => { const [error, setError] = useState('') const [success, setSuccess] = useState(false) - const { forgotPassword } = useAuth() const { register, @@ -21,42 +23,57 @@ const RecoverPassword: React.FC = () => { formState: { errors }, } = useForm<FormData>() - const onSubmit = useCallback( - async (data: FormData) => { - try { - const user = await forgotPassword(data as Parameters<typeof forgotPassword>[0]) + const onSubmit = useCallback(async (data: FormData) => { + const response = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users/forgot-password`, { + method: 'POST', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) - if (user) { - setSuccess(true) - setError('') - } - } catch (err) { - setError(err?.message || 'An error occurred while attempting to recover password.') - } - }, - [forgotPassword], - ) + if (response.ok) { + setSuccess(true) + setError('') + } else { + setError( + 'There was a problem while attempting to send you a password reset email. Please try again.', + ) + } + }, []) return ( - <Gutter> + <Gutter className={classes.recoverPassword}> {!success && ( <React.Fragment> <h1>Recover Password</h1> - <p> - Please enter your email below. You will receive an email message with instructions on - how to reset your password. - </p> - {error && <div className={classes.error}>{error}</div>} - <form onSubmit={handleSubmit(onSubmit)}> - <Input - name="email" - label="Email Address" - required - register={register} - error={errors.email} - /> - <button type="submit">Submit</button> - </form> + <div className={classes.formWrapper}> + <p> + {`Please enter your email below. You will receive an email message with instructions on + how to reset your password. To manage your all users, `} + <Link href={`${process.env.NEXT_PUBLIC_CMS_URL}/admin/collections/users`}> + login to the admin dashboard + </Link> + {'.'} + </p> + <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <Message error={error} className={classes.message} /> + <Input + name="email" + label="Email Address" + required + register={register} + error={errors.email} + type="email" + /> + <Button + type="submit" + className={classes.submit} + label="Recover Password" + appearance="primary" + /> + </form> + </div> </React.Fragment> )} {success && ( diff --git a/examples/auth/next-pages/src/pages/reset-password/index.module.css b/examples/auth/next-pages/src/pages/reset-password/index.module.css deleted file mode 100644 index 7d2f0a0af18..00000000000 --- a/examples/auth/next-pages/src/pages/reset-password/index.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.error { - color: red; - margin-bottom: 30px; -} diff --git a/examples/auth/next-pages/src/pages/reset-password/index.module.scss b/examples/auth/next-pages/src/pages/reset-password/index.module.scss new file mode 100644 index 00000000000..26f7c247978 --- /dev/null +++ b/examples/auth/next-pages/src/pages/reset-password/index.module.scss @@ -0,0 +1,17 @@ +@import "../../css/common"; + +.resetPassword { + margin-bottom: var(--block-padding); +} + +.form { + width: 66.66%; + + @include mid-break { + width: 100%; + } +} + +.submit { + margin-top: var(--base); +} diff --git a/examples/auth/next-pages/src/pages/reset-password/index.tsx b/examples/auth/next-pages/src/pages/reset-password/index.tsx index 1030e5bb53a..22bde59c690 100644 --- a/examples/auth/next-pages/src/pages/reset-password/index.tsx +++ b/examples/auth/next-pages/src/pages/reset-password/index.tsx @@ -1,11 +1,14 @@ -import React, { useCallback, useEffect, useState } from 'react' +import React, { useCallback, useEffect, useMemo, useState } from 'react' import { useForm } from 'react-hook-form' import { useRouter } from 'next/router' -import { useAuth } from '../../components/Auth' +import { Button } from '../../components/Button' import { Gutter } from '../../components/Gutter' import { Input } from '../../components/Input' -import classes from './index.module.css' +import { Message } from '../../components/Message' +import { useAuth } from '../../providers/Auth' + +import classes from './index.module.scss' type FormData = { password: string @@ -14,10 +17,10 @@ type FormData = { const ResetPassword: React.FC = () => { const [error, setError] = useState('') - const { login, resetPassword } = useAuth() + const { login } = useAuth() const router = useRouter() - - const token = typeof router.query.token === 'string' ? router.query.token : undefined + const searchParams = useMemo(() => new URLSearchParams(router.query as any), [router.query]) + const token = searchParams.get('token') const { register, @@ -28,33 +31,41 @@ const ResetPassword: React.FC = () => { const onSubmit = useCallback( async (data: FormData) => { - try { - const user = await resetPassword(data as Parameters<typeof resetPassword>[0]) + const response = await fetch(`${process.env.NEXT_PUBLIC_CMS_URL}/api/users/reset-password`, { + method: 'POST', + body: JSON.stringify(data), + headers: { + 'Content-Type': 'application/json', + }, + }) + + if (response.ok) { + const json = await response.json() - if (user) { - // Automatically log the user in after they successfully reset password - // Then redirect them to /account with success message in URL - await login({ email: user.email, password: data.password }) - router.push('/account?success=Password reset successfully.') - } - } catch (err) { - setError(err?.message || 'An error occurred while attempting to reset password.') + // Automatically log the user in after they successfully reset password + await login({ email: json.user.email, password: data.password }) + + // Redirect them to `/account` with success message in URL + router.push('/account?success=Password reset successfully.') + } else { + setError('There was a problem while resetting your password. Please try again later.') } }, - [router, login, resetPassword], + [router, login], ) - // When Next.js populates token within router, reset form with new token value + // when Next.js populates token within router, + // reset form with new token value useEffect(() => { - reset({ token }) + reset({ token: token || undefined }) }, [reset, token]) return ( - <Gutter> + <Gutter className={classes.resetPassword}> <h1>Reset Password</h1> <p>Please enter a new password below.</p> - {error && <div className={classes.error}>{error}</div>} - <form onSubmit={handleSubmit(onSubmit)}> + <form onSubmit={handleSubmit(onSubmit)} className={classes.form}> + <Message error={error} className={classes.message} /> <Input name="password" type="password" @@ -64,7 +75,12 @@ const ResetPassword: React.FC = () => { error={errors.password} /> <input type="hidden" {...register('token')} /> - <button type="submit">Submit</button> + <Button + type="submit" + className={classes.submit} + label="Reset Password" + appearance="primary" + /> </form> </Gutter> ) diff --git a/examples/auth/next-pages/src/components/Auth/gql.ts b/examples/auth/next-pages/src/providers/Auth/gql.ts similarity index 100% rename from examples/auth/next-pages/src/components/Auth/gql.ts rename to examples/auth/next-pages/src/providers/Auth/gql.ts diff --git a/examples/auth/next-pages/src/components/Auth/index.tsx b/examples/auth/next-pages/src/providers/Auth/index.tsx similarity index 100% rename from examples/auth/next-pages/src/components/Auth/index.tsx rename to examples/auth/next-pages/src/providers/Auth/index.tsx diff --git a/examples/auth/next-pages/src/components/Auth/rest.ts b/examples/auth/next-pages/src/providers/Auth/rest.ts similarity index 100% rename from examples/auth/next-pages/src/components/Auth/rest.ts rename to examples/auth/next-pages/src/providers/Auth/rest.ts diff --git a/examples/auth/next-pages/src/components/Auth/types.ts b/examples/auth/next-pages/src/providers/Auth/types.ts similarity index 100% rename from examples/auth/next-pages/src/components/Auth/types.ts rename to examples/auth/next-pages/src/providers/Auth/types.ts
480c6e7c099b407d05e41d9aed225d7573079ba8
2025-02-11 23:23:51
Elliot DeNolf
chore(release): v3.23.0 [skip ci]
false
v3.23.0 [skip ci]
chore
diff --git a/package.json b/package.json index 6a0db58f662..5a3f80a86d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "payload-monorepo", - "version": "3.22.0", + "version": "3.23.0", "private": true, "type": "module", "scripts": { diff --git a/packages/create-payload-app/package.json b/packages/create-payload-app/package.json index 6db4f72481a..b8c225f7156 100644 --- a/packages/create-payload-app/package.json +++ b/packages/create-payload-app/package.json @@ -1,6 +1,6 @@ { "name": "create-payload-app", - "version": "3.22.0", + "version": "3.23.0", "homepage": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/db-mongodb/package.json b/packages/db-mongodb/package.json index 7ccd369d3aa..6e73ea67aa0 100644 --- a/packages/db-mongodb/package.json +++ b/packages/db-mongodb/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/db-mongodb", - "version": "3.22.0", + "version": "3.23.0", "description": "The officially supported MongoDB database adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/db-postgres/package.json b/packages/db-postgres/package.json index 3376f3ef947..1f41d9f7e97 100644 --- a/packages/db-postgres/package.json +++ b/packages/db-postgres/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/db-postgres", - "version": "3.22.0", + "version": "3.23.0", "description": "The officially supported Postgres database adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/db-sqlite/package.json b/packages/db-sqlite/package.json index 82265f2580b..e115cafeeb8 100644 --- a/packages/db-sqlite/package.json +++ b/packages/db-sqlite/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/db-sqlite", - "version": "3.22.0", + "version": "3.23.0", "description": "The officially supported SQLite database adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/db-vercel-postgres/package.json b/packages/db-vercel-postgres/package.json index 6dd2483388c..474c18e2a8b 100644 --- a/packages/db-vercel-postgres/package.json +++ b/packages/db-vercel-postgres/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/db-vercel-postgres", - "version": "3.22.0", + "version": "3.23.0", "description": "Vercel Postgres adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/drizzle/package.json b/packages/drizzle/package.json index 41809b02119..55d13b2938e 100644 --- a/packages/drizzle/package.json +++ b/packages/drizzle/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/drizzle", - "version": "3.22.0", + "version": "3.23.0", "description": "A library of shared functions used by different payload database adapters", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/email-nodemailer/package.json b/packages/email-nodemailer/package.json index f0553932a32..4cc0e24abea 100644 --- a/packages/email-nodemailer/package.json +++ b/packages/email-nodemailer/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/email-nodemailer", - "version": "3.22.0", + "version": "3.23.0", "description": "Payload Nodemailer Email Adapter", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/email-resend/package.json b/packages/email-resend/package.json index 613d1a03021..da0d58e1322 100644 --- a/packages/email-resend/package.json +++ b/packages/email-resend/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/email-resend", - "version": "3.22.0", + "version": "3.23.0", "description": "Payload Resend Email Adapter", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/graphql/package.json b/packages/graphql/package.json index 30936277568..b39dbe13416 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/graphql", - "version": "3.22.0", + "version": "3.23.0", "homepage": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/live-preview-react/package.json b/packages/live-preview-react/package.json index b86c58fe510..0c6e36ba9e9 100644 --- a/packages/live-preview-react/package.json +++ b/packages/live-preview-react/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/live-preview-react", - "version": "3.22.0", + "version": "3.23.0", "description": "The official React SDK for Payload Live Preview", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/live-preview-vue/package.json b/packages/live-preview-vue/package.json index e79bdd51aee..495cb745bec 100644 --- a/packages/live-preview-vue/package.json +++ b/packages/live-preview-vue/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/live-preview-vue", - "version": "3.22.0", + "version": "3.23.0", "description": "The official Vue SDK for Payload Live Preview", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/live-preview/package.json b/packages/live-preview/package.json index 6cb00b4789a..d3f8ae930e9 100644 --- a/packages/live-preview/package.json +++ b/packages/live-preview/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/live-preview", - "version": "3.22.0", + "version": "3.23.0", "description": "The official live preview JavaScript SDK for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/next/package.json b/packages/next/package.json index 9a16bb3b6a9..c074c8c9b1a 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/next", - "version": "3.22.0", + "version": "3.23.0", "homepage": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/payload-cloud/package.json b/packages/payload-cloud/package.json index 07e98f342f6..7be6232c427 100644 --- a/packages/payload-cloud/package.json +++ b/packages/payload-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/payload-cloud", - "version": "3.22.0", + "version": "3.23.0", "description": "The official Payload Cloud plugin", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/payload/package.json b/packages/payload/package.json index 44f82655554..70dc5ebf8d8 100644 --- a/packages/payload/package.json +++ b/packages/payload/package.json @@ -1,6 +1,6 @@ { "name": "payload", - "version": "3.22.0", + "version": "3.23.0", "description": "Node, React, Headless CMS and Application Framework built on Next.js", "keywords": [ "admin panel", diff --git a/packages/plugin-cloud-storage/package.json b/packages/plugin-cloud-storage/package.json index 91d48c3ba54..1eb99fe0bf1 100644 --- a/packages/plugin-cloud-storage/package.json +++ b/packages/plugin-cloud-storage/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-cloud-storage", - "version": "3.22.0", + "version": "3.23.0", "description": "The official cloud storage plugin for Payload CMS", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/plugin-form-builder/package.json b/packages/plugin-form-builder/package.json index ffca0b1aada..9d0fcf9c31f 100644 --- a/packages/plugin-form-builder/package.json +++ b/packages/plugin-form-builder/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-form-builder", - "version": "3.22.0", + "version": "3.23.0", "description": "Form builder plugin for Payload CMS", "keywords": [ "payload", diff --git a/packages/plugin-multi-tenant/package.json b/packages/plugin-multi-tenant/package.json index 1a614746437..9e5863de9ac 100644 --- a/packages/plugin-multi-tenant/package.json +++ b/packages/plugin-multi-tenant/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-multi-tenant", - "version": "3.22.0", + "version": "3.23.0", "description": "Multi Tenant plugin for Payload", "keywords": [ "payload", diff --git a/packages/plugin-nested-docs/package.json b/packages/plugin-nested-docs/package.json index 6c51799bf03..9fd90f140c6 100644 --- a/packages/plugin-nested-docs/package.json +++ b/packages/plugin-nested-docs/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-nested-docs", - "version": "3.22.0", + "version": "3.23.0", "description": "The official Nested Docs plugin for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/plugin-redirects/package.json b/packages/plugin-redirects/package.json index a3ad351ae80..e72bcf92499 100644 --- a/packages/plugin-redirects/package.json +++ b/packages/plugin-redirects/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-redirects", - "version": "3.22.0", + "version": "3.23.0", "description": "Redirects plugin for Payload", "keywords": [ "payload", diff --git a/packages/plugin-search/package.json b/packages/plugin-search/package.json index 5ca7c16b52b..c952bf025c7 100644 --- a/packages/plugin-search/package.json +++ b/packages/plugin-search/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-search", - "version": "3.22.0", + "version": "3.23.0", "description": "Search plugin for Payload", "keywords": [ "payload", diff --git a/packages/plugin-sentry/package.json b/packages/plugin-sentry/package.json index adb0193b3e4..ca4cf880e0b 100644 --- a/packages/plugin-sentry/package.json +++ b/packages/plugin-sentry/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-sentry", - "version": "3.22.0", + "version": "3.23.0", "description": "Sentry plugin for Payload", "keywords": [ "payload", diff --git a/packages/plugin-seo/package.json b/packages/plugin-seo/package.json index 24352467fda..c47e1a24b8b 100644 --- a/packages/plugin-seo/package.json +++ b/packages/plugin-seo/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-seo", - "version": "3.22.0", + "version": "3.23.0", "description": "SEO plugin for Payload", "keywords": [ "payload", diff --git a/packages/plugin-stripe/package.json b/packages/plugin-stripe/package.json index b08686ec84b..63103c4960b 100644 --- a/packages/plugin-stripe/package.json +++ b/packages/plugin-stripe/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-stripe", - "version": "3.22.0", + "version": "3.23.0", "description": "Stripe plugin for Payload", "keywords": [ "payload", diff --git a/packages/richtext-lexical/package.json b/packages/richtext-lexical/package.json index d62dd5d29d1..4dbe5149af5 100644 --- a/packages/richtext-lexical/package.json +++ b/packages/richtext-lexical/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/richtext-lexical", - "version": "3.22.0", + "version": "3.23.0", "description": "The officially supported Lexical richtext adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/richtext-slate/package.json b/packages/richtext-slate/package.json index 08849eae71a..41c33b7bf99 100644 --- a/packages/richtext-slate/package.json +++ b/packages/richtext-slate/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/richtext-slate", - "version": "3.22.0", + "version": "3.23.0", "description": "The officially supported Slate richtext adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-azure/package.json b/packages/storage-azure/package.json index 694b0ed2e92..d735176cfb5 100644 --- a/packages/storage-azure/package.json +++ b/packages/storage-azure/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-azure", - "version": "3.22.0", + "version": "3.23.0", "description": "Payload storage adapter for Azure Blob Storage", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-gcs/package.json b/packages/storage-gcs/package.json index 5ab8c8e5312..09ebc7dc4c5 100644 --- a/packages/storage-gcs/package.json +++ b/packages/storage-gcs/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-gcs", - "version": "3.22.0", + "version": "3.23.0", "description": "Payload storage adapter for Google Cloud Storage", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-s3/package.json b/packages/storage-s3/package.json index 79b06b31508..8b7096693ff 100644 --- a/packages/storage-s3/package.json +++ b/packages/storage-s3/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-s3", - "version": "3.22.0", + "version": "3.23.0", "description": "Payload storage adapter for Amazon S3", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-uploadthing/package.json b/packages/storage-uploadthing/package.json index 337a776f7c5..e4ecd140b01 100644 --- a/packages/storage-uploadthing/package.json +++ b/packages/storage-uploadthing/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-uploadthing", - "version": "3.22.0", + "version": "3.23.0", "description": "Payload storage adapter for uploadthing", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-vercel-blob/package.json b/packages/storage-vercel-blob/package.json index e082c8175a2..750a922d093 100644 --- a/packages/storage-vercel-blob/package.json +++ b/packages/storage-vercel-blob/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-vercel-blob", - "version": "3.22.0", + "version": "3.23.0", "description": "Payload storage adapter for Vercel Blob Storage", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/translations/package.json b/packages/translations/package.json index 666337314ef..c063f71230e 100644 --- a/packages/translations/package.json +++ b/packages/translations/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/translations", - "version": "3.22.0", + "version": "3.23.0", "homepage": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/ui/package.json b/packages/ui/package.json index 0a43ec63d8b..76fa08c4558 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/ui", - "version": "3.22.0", + "version": "3.23.0", "homepage": "https://payloadcms.com", "repository": { "type": "git",
fcaf59176df315630b32bd480a0ded307aa10134
2025-03-01 00:00:29
Violet Rosenzweig
docs: custom auth strategy requires the collection slug in return value (#11327)
false
custom auth strategy requires the collection slug in return value (#11327)
docs
diff --git a/docs/authentication/custom-strategies.mdx b/docs/authentication/custom-strategies.mdx index c8fdb2dbd6c..f42973b3580 100644 --- a/docs/authentication/custom-strategies.mdx +++ b/docs/authentication/custom-strategies.mdx @@ -62,9 +62,12 @@ export const Users: CollectionConfig = { }) return { - // Send the user back to authenticate, + // Send the user with the collection slug back to authenticate, // or send null if no user should be authenticated - user: usersQuery.docs[0] || null, + user: usersQuery.docs[0] ? { + collection: 'users' + ...usersQuery.docs[0], + } : null, // Optionally, you can return headers // that you'd like Payload to set here when
6145accb830f8c5a57b77046669f77f32a2c5240
2024-11-19 06:55:52
Elliot DeNolf
chore(templates): bump all templates to 3.0
false
bump all templates to 3.0
chore
diff --git a/templates/_template/package.json b/templates/_template/package.json index e0f51f0d2df..d960ce0a807 100644 --- a/templates/_template/package.json +++ b/templates/_template/package.json @@ -15,14 +15,14 @@ "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-mongodb": "beta", - "@payloadcms/next": "beta", - "@payloadcms/payload-cloud": "beta", - "@payloadcms/richtext-lexical": "beta", + "@payloadcms/db-mongodb": "latest", + "@payloadcms/next": "latest", + "@payloadcms/payload-cloud": "latest", + "@payloadcms/richtext-lexical": "latest", "cross-env": "^7.0.3", "graphql": "^16.8.1", "next": "15.0.0", - "payload": "beta", + "payload": "latest", "react": "19.0.0-rc-65a56d0e-20241020", "react-dom": "19.0.0-rc-65a56d0e-20241020", "sharp": "0.32.6" diff --git a/templates/blank/package.json b/templates/blank/package.json index e0f51f0d2df..d960ce0a807 100644 --- a/templates/blank/package.json +++ b/templates/blank/package.json @@ -15,14 +15,14 @@ "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-mongodb": "beta", - "@payloadcms/next": "beta", - "@payloadcms/payload-cloud": "beta", - "@payloadcms/richtext-lexical": "beta", + "@payloadcms/db-mongodb": "latest", + "@payloadcms/next": "latest", + "@payloadcms/payload-cloud": "latest", + "@payloadcms/richtext-lexical": "latest", "cross-env": "^7.0.3", "graphql": "^16.8.1", "next": "15.0.0", - "payload": "beta", + "payload": "latest", "react": "19.0.0-rc-65a56d0e-20241020", "react-dom": "19.0.0-rc-65a56d0e-20241020", "sharp": "0.32.6" diff --git a/templates/blank/pnpm-lock.yaml b/templates/blank/pnpm-lock.yaml index 6222562d2c0..63c705ce6df 100644 --- a/templates/blank/pnpm-lock.yaml +++ b/templates/blank/pnpm-lock.yaml @@ -13,17 +13,17 @@ importers: .: dependencies: '@payloadcms/db-mongodb': - specifier: beta - version: 3.0.0-beta.124(@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) + specifier: latest + version: 3.0.0(@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]) '@payloadcms/next': - specifier: beta - version: 3.0.0-beta.124([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]) + specifier: latest + version: 3.0.0([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) '@payloadcms/payload-cloud': - specifier: beta - version: 3.0.0-beta.123(@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) + specifier: latest + version: 3.0.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])) '@payloadcms/richtext-lexical': - specifier: beta - version: 3.0.0-beta.124(2to4e6mqbisfrnxm27hae6ljmi) + specifier: latest + version: 3.0.0(5jjnjo5dfbrhmv2fivsioaxbxu) cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -34,8 +34,8 @@ importers: specifier: 15.0.0 version: 15.0.0([email protected]([email protected]))([email protected])([email protected]) payload: - specifier: beta - version: 3.0.0-beta.124([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + specifier: latest + version: 3.0.0([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]) react: specifier: 19.0.0-rc-65a56d0e-20241020 version: 19.0.0-rc-65a56d0e-20241020 @@ -880,68 +880,68 @@ packages: '@one-ini/[email protected]': resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==} - '@payloadcms/[email protected]': - resolution: {integrity: sha512-ahNGvc6kqfvR3lZjDMNrGT8Kwp4McJ4U8vkU1g2CT6ZU/DlVbdITp6gHXFStpld6YGtW0rI4R/dse69EPK/42Q==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-FTlL9+BpkMLWxWXYoQq5LLdSkT1L9lHfnJY1xS/f1B8YySCFu46DrkaIHwOo9MITBHM8kAc5CS9xCP0RrQUwug==} peerDependencies: - payload: 3.0.0-beta.124 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-/EAqOCZcoSaMdQec26Qpf4KD5BGxmA95kcpIdKgwwAM1j/b0pqKQ1Dqyfq6k1a0WQXpvSFxhhPevj7Ps0EklEw==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-2lJF7e0BY8iNVOMrq9ely5FdtOT5mxNLTAdJS793QMxcVn/kIaB7vbD8DKs7KI4JtbksVzKTy3/vZ9/iukltdw==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: - payload: 3.0.0-beta.123 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-FkyVg0P3RnvltmngmC+FFP61qzTcahDQsdu6i4YFpaHK1btaebEEvHf/FTHPu8+70qOwnmJwNxMDeS42AxSW9Q==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-JqxoxsYuk4aevQP9U0aEzqcqYmM7/SpOH1n6YNa4v28mtLAOJCiDpO+79oyu3KIy0mBbZw1bDV4GyiOD/NKdSA==} hasBin: true peerDependencies: graphql: ^16.8.1 - payload: 3.0.0-beta.124 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-0+U0rBIDEF20Janp0YyWcXWf2HUXJezE6A21T9UvovAAJYvg8xNyphzABRdtv2tIcDuOiK1GA37Pb/9TNRpR0A==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-DkfjgUTCAmuQ+8shqu/LIueDD23g2ZsyiwG+i0WvlPj1Fdoi/g/CUj8fVdrGPKSyceUELAJAs9B7cYsqHMej8w==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: graphql: ^16.8.1 next: ^15.0.0 - payload: 3.0.0-beta.124 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-c8ZAcAeHV5r4qPie/M8J0zrGWbmPkAohvqL1nqys51bIHcZdauRD/zEVwMuBjo+WAUjfaofDmzgKrrRQjY4vYA==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-4Eiv7PFI+6+5uriaaaWWOx8ZmElNjqI0XlzhP5xleiSqsTt396xutD0vazgyiLcqifAjMOZtCWXGqS/Xo2oqnw==} peerDependencies: - payload: 3.0.0-beta.123 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-nB3yyaxoVj/zfRaH16E2rilBIJ52wpvzKfsMk5BhGSJHuR0CY0djsFDxTCF2KrG4qAcTTFmwHk0zmOvjvg0WGg==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-pX+msGFwGJeQNpg8+k1IOFSf9AZWsjeNaovD010XzcoO9bQUtUktUpAjGRfsegAkXXHDDYXFFdlqVUNxpjzIPQ==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: '@faceless-ui/modal': 3.0.0-beta.2 '@faceless-ui/scroll-info': 2.0.0-beta.0 - '@lexical/headless': 0.18.0 - '@lexical/link': 0.18.0 - '@lexical/list': 0.18.0 - '@lexical/mark': 0.18.0 - '@lexical/markdown': 0.18.0 - '@lexical/react': 0.18.0 - '@lexical/rich-text': 0.18.0 - '@lexical/selection': 0.18.0 - '@lexical/table': 0.18.0 - '@lexical/utils': 0.18.0 - '@payloadcms/next': 3.0.0-beta.124 - lexical: 0.18.0 - payload: 3.0.0-beta.124 + '@lexical/headless': 0.20.0 + '@lexical/link': 0.20.0 + '@lexical/list': 0.20.0 + '@lexical/mark': 0.20.0 + '@lexical/markdown': 0.20.0 + '@lexical/react': 0.20.0 + '@lexical/rich-text': 0.20.0 + '@lexical/selection': 0.20.0 + '@lexical/table': 0.20.0 + '@lexical/utils': 0.20.0 + '@payloadcms/next': 3.0.0 + lexical: 0.20.0 + payload: 3.0.0 react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-1mAAfCxBNtqOrD1zpM2xVueWxOa6NGT3C0vIvq10a0sXRKhQCaeo0VwAtK3YO9JM90fbdpxhNLTJoJWYydaXaQ==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-kp1pQphABFEJP0wNSg/G/nom0n1xZ5WnxbeYYkY1t/lxIfrBd8p9j48LLa5cSpb2+ckGjuLi7I/8j0/eKxt38Q==} - '@payloadcms/[email protected]': - resolution: {integrity: sha512-9fymV0B+BVcPM55BaWW56eNXYMTOqh5TlpF9jzpke6DCUld0lPoqXjPMlSXTpEAGGDs7fdFGRSyHjr3PcvTGkw==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-J/x8HITWEC97Uz61FeHNnCqqN+H9tMswXelxkqktdbF4kcgHMlJYF5CeeujmVKys8V+capbUOHhw4ndkHtfhjQ==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: next: ^15.0.0 - payload: 3.0.0-beta.124 + payload: 3.0.0 react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 @@ -1177,15 +1177,39 @@ packages: '@tokenizer/[email protected]': resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} + '@types/[email protected]': + resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} + '@types/[email protected]': resolution: {integrity: sha512-kG7WrUuAKK0NoyxfQHsVE6j1m01s6kMma64E+OZenQABMQyTJop1DumUWcLwAQ2JzpefU7PDYoRDKl8uZosFjw==} + '@types/[email protected]': + resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + + '@types/[email protected]': + resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} + + '@types/[email protected]': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + + '@types/[email protected]': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/[email protected]': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} '@types/[email protected]': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + '@types/[email protected]': + resolution: {integrity: sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==} + + '@types/[email protected]': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + + '@types/[email protected]': + resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} + '@types/[email protected]': resolution: {integrity: sha512-tosuJYKrIqjQIlVCM4PEGxOmyg3FCPa/fViuJChnGeEIhjA46oy8FMVoF9su1/v8PNs2a8Q0iFNyOx0uOF91nw==} @@ -1195,14 +1219,20 @@ packages: '@types/[email protected]': resolution: {integrity: sha512-RM05tAniPZ5DZPzzNFP+DmrcOdD0efDUxMy3145oljWSl3x9ZV5vhme98gTxFrj2lhXvmGNnUiuDyJgY9IKkNA==} + '@types/[email protected]': + resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} + + '@types/[email protected]': + resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + '@types/[email protected]': resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} '@types/[email protected]': resolution: {integrity: sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==} - '@types/[email protected]': - resolution: {integrity: sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==} + '@types/[email protected]': + resolution: {integrity: sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==} '@typescript-eslint/[email protected]': resolution: {integrity: sha512-gQxbxM8mcxBwaEmWdtLCIGLfixBMHhQjBqR8sVWNTPpcj45WlYL2IObS/DNMLH1DBP0n8qz+aiiLTGfopPEebw==} @@ -1268,15 +1298,16 @@ packages: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - [email protected]: - resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} - engines: {node: '>=6.5'} - [email protected]: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + [email protected]: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + engines: {node: '>=0.4.0'} + hasBin: true + [email protected]: resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} @@ -1429,9 +1460,9 @@ packages: [email protected]: resolution: {integrity: sha512-vgnKAUzcDoa+AeyYwXCoHyF2q6u/8H46dxu5JN+4/TZeq/Dlinn0K6GvxsCLb3LHUJl0m/TLiEK31kUwtgocMQ==} - [email protected]: - resolution: {integrity: sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==} - engines: {node: '>=6.9.0'} + [email protected]: + resolution: {integrity: sha512-X9hJeyeM0//Fus+0pc5dSUMhhrrmWwQUtdavaQeF3Ta6m69matZkGWV/MrBcnwUeLC8W9kwwc2hfkZgUuCX3Ig==} + engines: {node: '>=16.20.1'} [email protected]: resolution: {integrity: sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==} @@ -1442,9 +1473,6 @@ packages: [email protected]: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - [email protected]: - resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - [email protected]: resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} engines: {node: '>=6.14.2'} @@ -1464,10 +1492,25 @@ packages: [email protected]: resolution: {integrity: sha512-Qz6zwGCiPghQXGJvgQAem79esjitvJ+CxSbSQkW9H/UX5hg8XM88d4lp2W+MEQ81j+Hip58Il+jGVdazk1z9cw==} + [email protected]: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + [email protected]: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + [email protected]: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + + [email protected]: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + + [email protected]: + resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + + [email protected]: + resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} + [email protected]: resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} @@ -1530,8 +1573,8 @@ packages: [email protected]: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} - [email protected]: - resolution: {integrity: sha512-uuUHie0sfPP542TKGzPFal0W1wo1beuKAqIZdaavcONx8OoqdnJRKjkinbRTOta4FaCa1RcIL+7mMJWX3pQGVg==} + [email protected]: + resolution: {integrity: sha512-wKGOQRRvdnd89pCeH96e2Fn4wkbenSP6LMHfjfyNLMbGuHEFbMqQNuxXqd0oXG9caIOQ1FTvc5Uijp9/4jujnQ==} [email protected]: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} @@ -1540,8 +1583,8 @@ packages: resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} engines: {node: '>=10'} - [email protected]: - resolution: {integrity: sha512-ypfPFcAXHuAZRCzo3vJL6ltENzniTjwe/qsLleH1V2/7SRDjgvRQyrLmumFTLmjFax4IuSxfGXEn79fozXcJog==} + [email protected]: + resolution: {integrity: sha512-onMB0OkDjkXunhdW9htFjEhqrD54+M94i6ackoUkjHKbRnXdyEyKRelp4nJ1kAz32+s27jP1FsebpJCVl0BsvA==} engines: {node: '>=18.0'} [email protected]: @@ -1583,6 +1626,9 @@ packages: [email protected]: resolution: {integrity: sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==} + [email protected]: + resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} + [email protected]: resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} @@ -1603,6 +1649,9 @@ packages: supports-color: optional: true + [email protected]: + resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} + [email protected]: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -1638,6 +1687,9 @@ packages: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} + [email protected]: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + [email protected]: resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} engines: {node: '>=0.3.1'} @@ -1841,14 +1893,16 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + [email protected]: + resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} + + [email protected]: + resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==} + [email protected]: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - [email protected]: - resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} - engines: {node: '>=6'} - [email protected]: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -1904,6 +1958,14 @@ packages: [email protected]: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + [email protected]: + resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + [email protected]: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -2128,6 +2190,12 @@ packages: resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} engines: {node: '>= 12'} + [email protected]: + resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} + + [email protected]: + resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} + [email protected]: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} @@ -2175,6 +2243,9 @@ packages: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} + [email protected]: + resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} + [email protected]: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} engines: {node: '>=0.10.0'} @@ -2198,6 +2269,9 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + [email protected]: + resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} + [email protected]: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} @@ -2279,8 +2353,8 @@ packages: [email protected]: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} - [email protected]: - resolution: {integrity: sha512-ILI2xx/I57b20sd7rHZvgiiQrmp2mcotwsAH+5ajbpFQbrYVQdNHYlQhoA5cFb78CgtBOxtC05TeA+mcgkuCqQ==} + [email protected]: + resolution: {integrity: sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==} [email protected]: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} @@ -2319,8 +2393,8 @@ packages: [email protected]: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - [email protected]: - resolution: {integrity: sha512-gSSg20skxv+ZQqR8Y8itZt+2iYFGNgneuTgf/Va0TBw+zo6JsykDG1bqhkhMs5g/vIdqmZx55oQJLbgOEuxPJw==} + [email protected]: + resolution: {integrity: sha512-iOKdzTUWEVM4nlxpFudFsWyUiu/Jakkga4OZPEt7CGoSEsAsUgdOZqR6pcgx2STBek9Gm4hcarJpXSzIvZ/hKA==} engines: {node: '>=16.0.0'} hasBin: true @@ -2341,8 +2415,8 @@ packages: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} - [email protected]: - resolution: {integrity: sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==} + [email protected]: + resolution: {integrity: sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==} engines: {node: '>=12.0.0'} [email protected]: @@ -2391,6 +2465,9 @@ packages: [email protected]: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + [email protected]: + resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} + [email protected]: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -2401,6 +2478,21 @@ packages: [email protected]: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} + [email protected]: + resolution: {integrity: sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==} + + [email protected]: + resolution: {integrity: sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ==} + + [email protected]: + resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + + [email protected]: + resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==} + + [email protected]: + resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + [email protected]: resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==} @@ -2411,6 +2503,78 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + [email protected]: + resolution: {integrity: sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w==} + + [email protected]: + resolution: {integrity: sha512-vNuFb9czP8QCtAQcEJn0UJQJZA8Dk6DXKBqx+bg/w0WGuSxDxNr7hErW89tHUY31dUW4NqEOWwmEUNhjTFmHkg==} + + [email protected]: + resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==} + + [email protected]: + resolution: {integrity: sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==} + + [email protected]: + resolution: {integrity: sha512-5E5I2pFzJyg2CtemqAbcyCktpHXuJbABnsb32wX2U8IQKhhVFBqkcZR5LRm1WVoFqa4kTueZK4abep7wdo9nrw==} + + [email protected]: + resolution: {integrity: sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==} + + [email protected]: + resolution: {integrity: sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==} + + [email protected]: + resolution: {integrity: sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==} + + [email protected]: + resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} + + [email protected]: + resolution: {integrity: sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==} + + [email protected]: + resolution: {integrity: sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==} + + [email protected]: + resolution: {integrity: sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==} + + [email protected]: + resolution: {integrity: sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==} + + [email protected]: + resolution: {integrity: sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==} + + [email protected]: + resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==} + + [email protected]: + resolution: {integrity: sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA==} + + [email protected]: + resolution: {integrity: sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==} + + [email protected]: + resolution: {integrity: sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==} + + [email protected]: + resolution: {integrity: sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==} + + [email protected]: + resolution: {integrity: sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==} + + [email protected]: + resolution: {integrity: sha512-xKxhkB62vwHUuuxHe9Xqty3UaAsizV2YKq5OV344u3hFBbf8zIYrhYOWhAQb94MtMPkjTOzzjJ/hid9/dR5vFA==} + + [email protected]: + resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==} + + [email protected]: + resolution: {integrity: sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==} + + [email protected]: + resolution: {integrity: sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw==} + [email protected]: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -2451,32 +2615,55 @@ packages: [email protected]: resolution: {integrity: sha512-OeWhNpABLCeTqubfqLMXGsqf6OmPU6pHM85kF3dhy6kq5hnhuVS1p3VrEW/XhWHc71P2tHyS5JFySD8mgs1crw==} - [email protected]: - resolution: {integrity: sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==} + [email protected]: + resolution: {integrity: sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==} - [email protected]: - resolution: {integrity: sha512-MBuyYiPUPRTqfH2dV0ya4dcr2E5N52ocBuZ8Sgg/M030nGF78v855B3Z27mZJnp8PxjnUquEnAtjOsphgMZOlQ==} - engines: {node: '>=12.9.0'} + [email protected]: + resolution: {integrity: sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg==} + engines: {node: '>=16.20.1'} + peerDependencies: + '@aws-sdk/credential-providers': ^3.188.0 + '@mongodb-js/zstd': ^1.1.0 + gcp-metadata: ^5.2.0 + kerberos: ^2.0.1 + mongodb-client-encryption: '>=6.0.0 <7' + snappy: ^7.2.2 + socks: ^2.7.1 + peerDependenciesMeta: + '@aws-sdk/credential-providers': + optional: true + '@mongodb-js/zstd': + optional: true + gcp-metadata: + optional: true + kerberos: + optional: true + mongodb-client-encryption: + optional: true + snappy: + optional: true + socks: + optional: true - [email protected]: - resolution: {integrity: sha512-UuALu+mjhQa1K9lMQvjLL3vm3iALvNw8PQNIh2gp1b+tO5hUa0NC0Wf6/8QrT9PSJVTihXaD8hQVy3J4e0jO0Q==} + [email protected]: + resolution: {integrity: sha512-Ai478tHedZy3U2ITBEp2H4rQEviRan3TK4p/umlFqIzgPF1R0hNKvzzQGIb1l2h+Z32QLU3NqaoWKu4vOOUElQ==} engines: {node: '>=4.0.0'} - [email protected]: - resolution: {integrity: sha512-xW5GugkE21DJiu9e13EOxKt4ejEKQkRP/S1PkkXRjnk2rRZVKBcld1nPV+VJ/YCPfm8hb3sz9OvI7O38RmixkA==} + [email protected]: + resolution: {integrity: sha512-kFxhot+yw9KmpAGSSrF/o+f00aC2uawgNUbhyaM0USS9L7dln1NA77/pLg4lgOaRgXMtfgCENamjqZwIM1Zrig==} engines: {node: '>=4.0.0'} - [email protected]: - resolution: {integrity: sha512-MNJymaaXali7w7rHBxVUoQ3HzHHMk/7I/+yeeoSa4rUzdjZwIWQznBNvVgc0A8ghuJwsuIkb5LyLV6gSjGjWyQ==} - engines: {node: '>=12.0.0'} + [email protected]: + resolution: {integrity: sha512-l7DgeY1szT98+EKU8GYnga5WnyatAu+kOQ2VlVX1Mxif6A0Umt0YkSiksCiyGxzx8SPhGe9a53ND1GD4yVDrPA==} + engines: {node: '>=16.20.1'} [email protected]: resolution: {integrity: sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==} engines: {node: '>=4.0.0'} - [email protected]: - resolution: {integrity: sha512-J5heI+P08I6VJ2Ky3+33IpCdAvlYGTSUjwTPxkAr8i8EoduPMBX2OY/wa3IKZIQl7MU4SbFk8ndgSKyB/cl1zA==} - engines: {node: '>=12.0.0'} + [email protected]: + resolution: {integrity: sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==} + engines: {node: '>=14.0.0'} [email protected]: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -2607,6 +2794,9 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} + [email protected]: + resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} + [email protected]: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -2640,8 +2830,8 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - [email protected]: - resolution: {integrity: sha512-+H3AikIZSSgIpJzkNFUMJATiRUwLV5uBEKEivq4ufCT9TVEQYq2TdrWoDTstP4UlHsA0ycPx7qJcMSLOz1gzFQ==} + [email protected]: + resolution: {integrity: sha512-CV+sDpTPTJAtr3Zv2I7BbR19Mu1Dpu4jlmFU5yqjpoaMW6xVeUUtgBA7NhCUF3gen7MLMoSZgXyrgy3RLgT4vA==} engines: {node: ^18.20.2 || >=20.9.0} hasBin: true peerDependencies: @@ -2661,11 +2851,15 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + [email protected]: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + [email protected]: resolution: {integrity: sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==} - [email protected]: - resolution: {integrity: sha512-oXwn7ICywaZPHmu3epHGU2oJX4nPmKvHvB/bwrJHlGcbEWaVcotkpyVHMKLKmiVryWYByNp0jpgAcXpFJDXJzA==} + [email protected]: + resolution: {integrity: sha512-cQBBIVG3YajgoUjo1FdKVRX6t9XPxwB9lcNJVD5GCnNM4Y6T12YYx8c6zEejxQsU0wrg9TwmDulcE9LR7qcJqA==} hasBin: true [email protected]: @@ -2712,10 +2906,6 @@ packages: [email protected]: resolution: {integrity: sha512-/MyYDxttz7DfGMMHiysAsFE4qF+pQYAA8ziO/3NcRVrQ5fSk+Mns4QZA/oRPFzvcqNoVJXQNWNAsdwBXLUkQKw==} - [email protected]: - resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} - engines: {node: '>= 0.6.0'} - [email protected]: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} @@ -2835,10 +3025,6 @@ packages: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} - [email protected]: - resolution: {integrity: sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - [email protected]: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -2970,8 +3156,8 @@ packages: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} engines: {node: '>= 0.4'} - [email protected]: - resolution: {integrity: sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==} + [email protected]: + resolution: {integrity: sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==} [email protected]: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -3073,6 +3259,9 @@ packages: [email protected]: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + [email protected]: + resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + [email protected]: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -3153,6 +3342,10 @@ packages: [email protected]: resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==} + [email protected]: + resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} + engines: {node: '>=12.0.0'} + [email protected]: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -3164,9 +3357,9 @@ packages: [email protected]: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - [email protected]: - resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} - engines: {node: '>=12'} + [email protected]: + resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==} + engines: {node: '>=14'} [email protected]: resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==} @@ -3177,8 +3370,8 @@ packages: peerDependencies: typescript: '>=4.2.0' - [email protected]: - resolution: {integrity: sha512-Xwag0TULqriaugXqVdDiGZ5wuZpqABZlpwQ2Ho4GDyiu/R2Xjkp/9+zcFxL7uzeLl/QCPrflnvpVYyS3ouT7Zw==} + [email protected]: + resolution: {integrity: sha512-/FrVAZ76JLTWxJOERk04fm8hYENDo0PWSP3YLQKxevLwWtxemGcl5JJEzN4iqfDlRve0ckyfFaOBu4xbNH/wZw==} peerDependencies: typescript: '>=4.5.0' peerDependenciesMeta: @@ -3194,8 +3387,8 @@ packages: [email protected]: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - [email protected]: - resolution: {integrity: sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==} + [email protected]: + resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} engines: {node: '>=18.0.0'} hasBin: true @@ -3254,6 +3447,21 @@ packages: [email protected]: resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==} + [email protected]: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + + [email protected]: + resolution: {integrity: sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==} + + [email protected]: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + + [email protected]: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} + + [email protected]: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + [email protected]: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -3290,6 +3498,9 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true + [email protected]: + resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} + [email protected]: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -3297,9 +3508,9 @@ packages: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} - [email protected]: - resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==} - engines: {node: '>=12'} + [email protected]: + resolution: {integrity: sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==} + engines: {node: '>=16'} [email protected]: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} @@ -3368,6 +3579,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + [email protected]: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} + snapshots: '@apidevtools/[email protected]': @@ -4566,7 +4780,6 @@ snapshots: '@mongodb-js/[email protected]': dependencies: sparse-bitfield: 3.0.3 - optional: true '@next/[email protected]': {} @@ -4616,43 +4829,47 @@ snapshots: '@one-ini/[email protected]': {} - '@payloadcms/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': + '@payloadcms/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])': dependencies: - bson-objectid: 2.0.4 http-status: 1.6.2 - mongoose: 6.12.3(@aws-sdk/[email protected](@aws-sdk/[email protected])) - mongoose-aggregate-paginate-v2: 1.0.6 - mongoose-paginate-v2: 1.7.22 - payload: 3.0.0-beta.124([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + mongoose: 8.8.1(@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]) + mongoose-aggregate-paginate-v2: 1.1.2 + mongoose-paginate-v2: 1.8.5 + payload: 3.0.0([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]) prompts: 2.4.2 uuid: 10.0.0 transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks - supports-color - '@payloadcms/[email protected]([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': + '@payloadcms/[email protected]([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))': dependencies: nodemailer: 6.9.10 - payload: 3.0.0-beta.124([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]) - '@payloadcms/[email protected]([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])': + '@payloadcms/[email protected]([email protected])([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected])': dependencies: graphql: 16.9.0 graphql-scalars: 1.22.2([email protected]) - payload: 3.0.0-beta.124([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]) pluralize: 8.0.0 - ts-essentials: 10.0.2([email protected]) - tsx: 4.19.1 + ts-essentials: 10.0.3([email protected]) + tsx: 4.19.2 transitivePeerDependencies: - typescript - '@payloadcms/[email protected]([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])': + '@payloadcms/[email protected]([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': dependencies: '@dnd-kit/core': 6.0.8([email protected]([email protected]))([email protected]) - '@payloadcms/graphql': 3.0.0-beta.124([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]) - '@payloadcms/translations': 3.0.0-beta.124 - '@payloadcms/ui': 3.0.0-beta.124([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + '@payloadcms/graphql': 3.0.0([email protected])([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]) + '@payloadcms/translations': 3.0.0 + '@payloadcms/ui': 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) busboy: 1.6.0 file-type: 19.3.0 graphql: 16.9.0 @@ -4661,33 +4878,30 @@ snapshots: http-status: 1.6.2 next: 15.0.0([email protected]([email protected]))([email protected])([email protected]) path-to-regexp: 6.3.0 - payload: 3.0.0-beta.124([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]) qs-esm: 7.0.2 react-diff-viewer-continued: 3.2.6([email protected]([email protected]))([email protected]) sass: 1.77.4 sonner: 1.5.0([email protected]([email protected]))([email protected]) uuid: 10.0.0 - ws: 8.18.0([email protected])([email protected]) transitivePeerDependencies: - '@types/react' - - bufferutil - monaco-editor - react - react-dom - supports-color - typescript - - utf-8-validate - '@payloadcms/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': + '@payloadcms/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))': dependencies: '@aws-sdk/client-cognito-identity': 3.685.0 '@aws-sdk/client-s3': 3.685.0 '@aws-sdk/credential-providers': 3.685.0(@aws-sdk/[email protected](@aws-sdk/[email protected])) '@aws-sdk/lib-storage': 3.685.0(@aws-sdk/[email protected]) - '@payloadcms/email-nodemailer': 3.0.0-beta.123([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) + '@payloadcms/email-nodemailer': 3.0.0([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])) amazon-cognito-identity-js: 6.3.12 nodemailer: 6.9.10 - payload: 3.0.0-beta.124([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]) resend: 0.17.2 transitivePeerDependencies: - '@aws-sdk/client-sso-oidc' @@ -4695,7 +4909,7 @@ snapshots: - debug - encoding - '@payloadcms/[email protected](2to4e6mqbisfrnxm27hae6ljmi)': + '@payloadcms/[email protected](5jjnjo5dfbrhmv2fivsioaxbxu)': dependencies: '@faceless-ui/modal': 3.0.0-beta.2([email protected]([email protected]))([email protected]) '@faceless-ui/scroll-info': 2.0.0-beta.0([email protected]([email protected]))([email protected]) @@ -4709,18 +4923,23 @@ snapshots: '@lexical/selection': 0.18.0 '@lexical/table': 0.18.0 '@lexical/utils': 0.18.0 - '@payloadcms/next': 3.0.0-beta.124([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected]) - '@payloadcms/translations': 3.0.0-beta.124 - '@payloadcms/ui': 3.0.0-beta.124([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + '@payloadcms/next': 3.0.0([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + '@payloadcms/translations': 3.0.0 + '@payloadcms/ui': 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) '@types/uuid': 10.0.0 + acorn: 8.12.1 bson-objectid: 2.0.4 dequal: 2.0.3 escape-html: 1.0.3 lexical: 0.18.0 - payload: 3.0.0-beta.124([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + mdast-util-from-markdown: 2.0.2 + mdast-util-mdx-jsx: 3.1.3 + micromark-extension-mdx-jsx: 3.0.1 + payload: 3.0.0([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]) react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020([email protected]) react-error-boundary: 4.0.13([email protected]) + ts-essentials: 10.0.3([email protected]) uuid: 10.0.0 transitivePeerDependencies: - '@types/react' @@ -4729,11 +4948,11 @@ snapshots: - supports-color - typescript - '@payloadcms/[email protected]': + '@payloadcms/[email protected]': dependencies: - date-fns: 3.3.1 + date-fns: 4.1.0 - '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': + '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': dependencies: '@dnd-kit/core': 6.0.8([email protected]([email protected]))([email protected]) '@dnd-kit/sortable': 7.0.2(@dnd-kit/[email protected]([email protected]([email protected]))([email protected]))([email protected]) @@ -4741,15 +4960,15 @@ snapshots: '@faceless-ui/scroll-info': 2.0.0-beta.0([email protected]([email protected]))([email protected]) '@faceless-ui/window-info': 3.0.0-beta.0([email protected]([email protected]))([email protected]) '@monaco-editor/react': 4.6.0([email protected])([email protected]([email protected]))([email protected]) - '@payloadcms/translations': 3.0.0-beta.124 + '@payloadcms/translations': 3.0.0 body-scroll-lock: 4.0.0-beta.0 bson-objectid: 2.0.4 - date-fns: 3.3.1 + date-fns: 4.1.0 dequal: 2.0.3 md5: 2.3.0 next: 15.0.0([email protected]([email protected]))([email protected])([email protected]) object-to-formdata: 4.5.1 - payload: 3.0.0-beta.124([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]) qs-esm: 7.0.2 react: 19.0.0-rc-65a56d0e-20241020 react-animate-height: 2.1.2([email protected]([email protected]))([email protected]) @@ -4759,7 +4978,7 @@ snapshots: react-select: 5.8.0([email protected]([email protected]))([email protected])([email protected]) scheduler: 0.0.0-experimental-3edc000d-20240926 sonner: 1.5.0([email protected]([email protected]))([email protected]) - ts-essentials: 10.0.2([email protected]) + ts-essentials: 10.0.3([email protected]) use-context-selector: 2.0.0([email protected])([email protected]) uuid: 10.0.0 transitivePeerDependencies: @@ -5134,14 +5353,40 @@ snapshots: '@tokenizer/[email protected]': {} + '@types/[email protected]': + dependencies: + '@types/estree': 1.0.6 + '@types/[email protected]': dependencies: '@types/node': 22.8.6 + '@types/[email protected]': + dependencies: + '@types/ms': 0.7.34 + + '@types/[email protected]': + dependencies: + '@types/estree': 1.0.6 + + '@types/[email protected]': {} + + '@types/[email protected]': + dependencies: + '@types/unist': 3.0.3 + '@types/[email protected]': {} '@types/[email protected]': {} + '@types/[email protected]': {} + + '@types/[email protected]': + dependencies: + '@types/unist': 3.0.3 + + '@types/[email protected]': {} + '@types/[email protected]': dependencies: undici-types: 6.19.8 @@ -5152,13 +5397,16 @@ snapshots: dependencies: '@types/react': [email protected] + '@types/[email protected]': {} + + '@types/[email protected]': {} + '@types/[email protected]': {} '@types/[email protected]': {} - '@types/[email protected]': + '@types/[email protected]': dependencies: - '@types/node': 22.8.6 '@types/webidl-conversions': 7.0.3 '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': @@ -5246,14 +5494,12 @@ snapshots: [email protected]: {} - [email protected]: - dependencies: - event-target-shim: 5.0.1 - [email protected]([email protected]): dependencies: acorn: 8.14.0 + [email protected]: {} + [email protected]: {} [email protected]: @@ -5448,9 +5694,7 @@ snapshots: [email protected]: {} - [email protected]: - dependencies: - buffer: 5.7.1 + [email protected]: {} [email protected]: dependencies: @@ -5468,11 +5712,6 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 - [email protected]: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - [email protected]: dependencies: node-gyp-build: 4.8.2 @@ -5494,11 +5733,21 @@ snapshots: [email protected]: {} + [email protected]: {} + [email protected]: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + [email protected]: {} [email protected]: @@ -5562,7 +5811,7 @@ snapshots: ini: 1.3.8 proto-list: 1.2.4 - [email protected]: + [email protected]: dependencies: simple-wcswidth: 1.0.1 @@ -5576,7 +5825,7 @@ snapshots: path-type: 4.0.0 yaml: 1.10.2 - [email protected]: {} + [email protected]: {} [email protected]: dependencies: @@ -5618,6 +5867,8 @@ snapshots: [email protected]: {} + [email protected]: {} + [email protected]: {} [email protected]: @@ -5628,6 +5879,10 @@ snapshots: dependencies: ms: 2.1.3 + [email protected]: + dependencies: + character-entities: 2.0.2 + [email protected]: dependencies: mimic-response: 3.1.0 @@ -5656,6 +5911,10 @@ snapshots: [email protected]: {} + [email protected]: + dependencies: + dequal: 2.0.3 + [email protected]: {} [email protected]: @@ -6038,9 +6297,14 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: {} - [email protected]: {} + [email protected]: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/unist': 3.0.3 + + [email protected]: {} [email protected]: {} @@ -6092,6 +6356,10 @@ snapshots: dependencies: reusify: 1.0.4 + [email protected]([email protected]): + optionalDependencies: + picomatch: 4.0.2 + [email protected]: dependencies: flat-cache: 3.2.0 @@ -6319,6 +6587,14 @@ snapshots: dependencies: jsbn: 1.1.0 sprintf-js: 1.1.3 + optional: true + + [email protected]: {} + + [email protected]: + dependencies: + is-alphabetical: 2.0.1 + is-decimal: 2.0.1 [email protected]: dependencies: @@ -6366,6 +6642,8 @@ snapshots: dependencies: has-tostringtag: 1.0.2 + [email protected]: {} + [email protected]: {} [email protected]: {} @@ -6384,6 +6662,8 @@ snapshots: dependencies: is-extglob: 2.1.1 + [email protected]: {} + [email protected]: {} [email protected]: {} @@ -6461,7 +6741,7 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - [email protected]: {} + [email protected]: {} [email protected]: {} @@ -6483,7 +6763,8 @@ snapshots: dependencies: argparse: 2.0.1 - [email protected]: {} + [email protected]: + optional: true [email protected]: {} @@ -6491,16 +6772,17 @@ snapshots: [email protected]: {} - [email protected]: + [email protected]: dependencies: '@apidevtools/json-schema-ref-parser': 11.7.2 '@types/json-schema': 7.0.15 - glob: 10.4.5 + '@types/lodash': 4.17.13 is-glob: 4.0.3 js-yaml: 4.1.0 lodash: 4.17.21 minimist: 1.2.8 prettier: 3.3.3 + tinyglobby: 0.2.10 [email protected]: {} @@ -6519,7 +6801,7 @@ snapshots: object.assign: 4.1.5 object.values: 1.2.0 - [email protected]: {} + [email protected]: {} [email protected]: dependencies: @@ -6560,6 +6842,8 @@ snapshots: [email protected]: {} + [email protected]: {} + [email protected]: dependencies: js-tokens: 4.0.0 @@ -6572,13 +6856,237 @@ snapshots: crypt: 0.0.2 is-buffer: 1.1.6 + [email protected]: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + mdast-util-to-string: 4.0.0 + micromark: 4.0.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-decode-string: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + unist-util-stringify-position: 4.0.0 + transitivePeerDependencies: + - supports-color + + [email protected]: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + parse-entities: 4.0.1 + stringify-entities: 4.0.4 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + + [email protected]: + dependencies: + '@types/mdast': 4.0.4 + unist-util-is: 6.0.0 + + [email protected]: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + longest-streak: 3.1.0 + mdast-util-phrasing: 4.1.0 + mdast-util-to-string: 4.0.0 + micromark-util-classify-character: 2.0.1 + micromark-util-decode-string: 2.0.1 + unist-util-visit: 5.0.0 + zwitch: 2.0.4 + + [email protected]: + dependencies: + '@types/mdast': 4.0.4 + [email protected]: {} - [email protected]: - optional: true + [email protected]: {} [email protected]: {} + [email protected]: + dependencies: + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-factory-destination: 2.0.1 + micromark-factory-label: 2.0.1 + micromark-factory-space: 2.0.1 + micromark-factory-title: 2.0.1 + micromark-factory-whitespace: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-classify-character: 2.0.1 + micromark-util-html-tag-name: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-subtokenize: 2.0.2 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + '@types/acorn': 4.0.6 + '@types/estree': 1.0.6 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + micromark-factory-mdx-expression: 2.0.2 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + vfile-message: 4.0.2 + + [email protected]: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + devlop: 1.1.0 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + '@types/estree': 1.0.6 + devlop: 1.1.0 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + unist-util-position-from-estree: 2.0.0 + vfile-message: 4.0.2 + + [email protected]: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-symbol: 2.0.1 + + [email protected]: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-chunked: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-symbol: 2.0.1 + + [email protected]: + dependencies: + decode-named-character-reference: 1.0.2 + micromark-util-character: 2.1.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-symbol: 2.0.1 + + [email protected]: {} + + [email protected]: + dependencies: + '@types/acorn': 4.0.6 + '@types/estree': 1.0.6 + '@types/unist': 3.0.3 + devlop: 1.1.0 + estree-util-visit: 2.0.0 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + vfile-message: 4.0.2 + + [email protected]: {} + + [email protected]: + dependencies: + micromark-util-symbol: 2.0.1 + + [email protected]: + dependencies: + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-encode: 2.0.1 + micromark-util-symbol: 2.0.1 + + [email protected]: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: {} + + [email protected]: {} + + [email protected]: + dependencies: + '@types/debug': 4.1.12 + debug: 4.3.7 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.2 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-combine-extensions: 2.0.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-encode: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-subtokenize: 2.0.2 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + transitivePeerDependencies: + - supports-color + [email protected]: dependencies: braces: 3.0.3 @@ -6612,44 +7120,46 @@ snapshots: [email protected]: {} - [email protected]: + [email protected]: dependencies: - '@types/whatwg-url': 8.2.2 - whatwg-url: 11.0.0 + '@types/whatwg-url': 11.0.5 + whatwg-url: 13.0.0 - [email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])): + [email protected](@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]): dependencies: - bson: 4.7.2 - mongodb-connection-string-url: 2.6.0 - socks: 2.8.3 + '@mongodb-js/saslprep': 1.1.9 + bson: 6.9.0 + mongodb-connection-string-url: 3.0.1 optionalDependencies: '@aws-sdk/credential-providers': 3.685.0(@aws-sdk/[email protected](@aws-sdk/[email protected])) - '@mongodb-js/saslprep': 1.1.9 - transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt + socks: 2.8.3 - [email protected]: {} + [email protected]: {} - [email protected]: {} + [email protected]: {} - [email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])): + [email protected](@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]): dependencies: - bson: 4.7.2 - kareem: 2.5.1 - mongodb: 4.17.1(@aws-sdk/[email protected](@aws-sdk/[email protected])) + bson: 6.9.0 + kareem: 2.6.3 + mongodb: 6.10.0(@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]) mpath: 0.9.0 - mquery: 4.0.3 + mquery: 5.0.0 ms: 2.1.3 - sift: 16.0.1 + sift: 17.1.3 transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks - supports-color [email protected]: {} - [email protected]: + [email protected]: dependencies: debug: 4.3.7 transitivePeerDependencies: @@ -6779,6 +7289,17 @@ snapshots: dependencies: callsites: 3.1.0 + [email protected]: + dependencies: + '@types/unist': 2.0.11 + character-entities: 2.0.2 + character-entities-legacy: 3.0.0 + character-reference-invalid: 2.0.1 + decode-named-character-reference: 1.0.2 + is-alphanumerical: 2.0.1 + is-decimal: 2.0.1 + is-hexadecimal: 2.0.1 + [email protected]: dependencies: '@babel/code-frame': 7.26.2 @@ -6808,17 +7329,17 @@ snapshots: [email protected]: {} - [email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]): + [email protected]([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected]): dependencies: '@monaco-editor/react': 4.6.0([email protected])([email protected]([email protected]))([email protected]) '@next/env': 15.0.2 - '@payloadcms/translations': 3.0.0-beta.124 + '@payloadcms/translations': 3.0.0 '@types/busboy': 1.5.4 ajv: 8.17.1 bson-objectid: 2.0.4 ci-info: 4.0.0 - console-table-printer: 2.11.2 - croner: 8.1.2 + console-table-printer: 2.12.1 + croner: 9.0.0 dataloader: 2.2.2 deepmerge: 4.3.1 file-type: 19.3.0 @@ -6826,22 +7347,25 @@ snapshots: graphql: 16.9.0 http-status: 1.6.2 image-size: 1.1.1 - jose: 5.9.2 - json-schema-to-typescript: 15.0.1 + jose: 5.9.6 + json-schema-to-typescript: 15.0.3 minimist: 1.2.8 pino: 9.5.0 - pino-pretty: 11.3.0 + pino-pretty: 13.0.0 pluralize: 8.0.0 sanitize-filename: 1.6.3 scmp: 2.1.0 - ts-essentials: 10.0.2([email protected]) - tsx: 4.19.1 + ts-essentials: 10.0.3([email protected]) + tsx: 4.19.2 uuid: 10.0.0 + ws: 8.18.0([email protected])([email protected]) transitivePeerDependencies: + - bufferutil - monaco-editor - react - react-dom - typescript + - utf-8-validate [email protected]: {} @@ -6851,11 +7375,13 @@ snapshots: [email protected]: {} + [email protected]: {} + [email protected]: dependencies: split2: 4.2.0 - [email protected]: + [email protected]: dependencies: colorette: 2.0.20 dateformat: 4.6.3 @@ -6867,7 +7393,6 @@ snapshots: on-exit-leak-free: 2.1.2 pino-abstract-transport: 2.0.0 pump: 3.0.2 - readable-stream: 4.5.2 secure-json-parse: 2.7.0 sonic-boom: 4.2.0 strip-json-comments: 3.1.1 @@ -6927,8 +7452,6 @@ snapshots: [email protected]: {} - [email protected]: {} - [email protected]: dependencies: kleur: 3.0.3 @@ -7069,14 +7592,6 @@ snapshots: string_decoder: 1.3.0 util-deprecate: 1.0.2 - [email protected]: - dependencies: - abort-controller: 3.0.0 - buffer: 6.0.3 - events: 3.3.0 - process: 0.11.10 - string_decoder: 1.3.0 - [email protected]: dependencies: picomatch: 2.3.1 @@ -7252,7 +7767,7 @@ snapshots: get-intrinsic: 1.2.4 object-inspect: 1.13.2 - [email protected]: {} + [email protected]: {} [email protected]: {} @@ -7272,12 +7787,14 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: + optional: true [email protected]: dependencies: ip-address: 9.0.5 smart-buffer: 4.2.0 + optional: true [email protected]: dependencies: @@ -7295,11 +7812,11 @@ snapshots: [email protected]: dependencies: memory-pager: 1.5.0 - optional: true [email protected]: {} - [email protected]: {} + [email protected]: + optional: true [email protected]: {} @@ -7379,6 +7896,11 @@ snapshots: dependencies: safe-buffer: 5.2.1 + [email protected]: + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + [email protected]: dependencies: ansi-regex: 5.0.1 @@ -7454,6 +7976,11 @@ snapshots: dependencies: real-require: 0.2.0 + [email protected]: + dependencies: + fdir: 6.4.2([email protected]) + picomatch: 4.0.2 + [email protected]: dependencies: is-number: 7.0.0 @@ -7465,7 +7992,7 @@ snapshots: [email protected]: {} - [email protected]: + [email protected]: dependencies: punycode: 2.3.1 @@ -7477,7 +8004,7 @@ snapshots: dependencies: typescript: 5.6.3 - [email protected]([email protected]): + [email protected]([email protected]): optionalDependencies: typescript: 5.6.3 @@ -7492,7 +8019,7 @@ snapshots: [email protected]: {} - [email protected]: + [email protected]: dependencies: esbuild: 0.23.1 get-tsconfig: 4.8.1 @@ -7566,6 +8093,29 @@ snapshots: [email protected]: {} + [email protected]: + dependencies: + '@types/unist': 3.0.3 + + [email protected]: + dependencies: + '@types/unist': 3.0.3 + + [email protected]: + dependencies: + '@types/unist': 3.0.3 + + [email protected]: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + + [email protected]: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + [email protected]: dependencies: punycode: 2.3.1 @@ -7594,13 +8144,18 @@ snapshots: [email protected]: {} + [email protected]: + dependencies: + '@types/unist': 3.0.3 + unist-util-stringify-position: 4.0.0 + [email protected]: {} [email protected]: {} - [email protected]: + [email protected]: dependencies: - tr46: 3.0.0 + tr46: 4.1.1 webidl-conversions: 7.0.0 [email protected]: @@ -7683,3 +8238,5 @@ snapshots: lib0: 0.2.98 [email protected]: {} + + [email protected]: {} diff --git a/templates/website/package.json b/templates/website/package.json index 1bd7c3f5c3e..a4e1bbb79c2 100644 --- a/templates/website/package.json +++ b/templates/website/package.json @@ -18,17 +18,17 @@ "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-mongodb": "beta", - "@payloadcms/live-preview-react": "beta", - "@payloadcms/next": "beta", - "@payloadcms/payload-cloud": "beta", - "@payloadcms/plugin-form-builder": "beta", - "@payloadcms/plugin-nested-docs": "beta", - "@payloadcms/plugin-redirects": "beta", - "@payloadcms/plugin-search": "beta", - "@payloadcms/plugin-seo": "beta", - "@payloadcms/richtext-lexical": "beta", - "@payloadcms/ui": "beta", + "@payloadcms/db-mongodb": "latest", + "@payloadcms/live-preview-react": "latest", + "@payloadcms/next": "latest", + "@payloadcms/payload-cloud": "latest", + "@payloadcms/plugin-form-builder": "latest", + "@payloadcms/plugin-nested-docs": "latest", + "@payloadcms/plugin-redirects": "latest", + "@payloadcms/plugin-search": "latest", + "@payloadcms/plugin-seo": "latest", + "@payloadcms/richtext-lexical": "latest", + "@payloadcms/ui": "latest", "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-select": "^2.0.0", @@ -41,7 +41,7 @@ "jsonwebtoken": "9.0.2", "lucide-react": "^0.378.0", "next": "15.0.0", - "payload": "beta", + "payload": "latest", "payload-admin-bar": "^1.0.6", "prism-react-renderer": "^2.3.1", "react": "19.0.0-rc-65a56d0e-20241020", diff --git a/templates/website/pnpm-lock.yaml b/templates/website/pnpm-lock.yaml index 42d079a62e3..9f6ceb44054 100644 --- a/templates/website/pnpm-lock.yaml +++ b/templates/website/pnpm-lock.yaml @@ -13,38 +13,38 @@ importers: .: dependencies: '@payloadcms/db-mongodb': - specifier: beta - version: 3.0.0-beta.129(@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) + specifier: latest + version: 3.0.0(@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]) '@payloadcms/live-preview-react': - specifier: beta - version: 3.0.0-beta.129([email protected]([email protected]))([email protected]) + specifier: latest + version: 3.0.0([email protected]([email protected]))([email protected]) '@payloadcms/next': - specifier: beta - version: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + specifier: latest + version: 3.0.0([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) '@payloadcms/payload-cloud': - specifier: beta - version: 3.0.0-beta.129(@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) + specifier: latest + version: 3.0.0(@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) '@payloadcms/plugin-form-builder': - specifier: beta - version: 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + specifier: latest + version: 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) '@payloadcms/plugin-nested-docs': - specifier: beta - version: 3.0.0-beta.129([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) + specifier: latest + version: 3.0.0([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) '@payloadcms/plugin-redirects': - specifier: beta - version: 3.0.0-beta.129([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) + specifier: latest + version: 3.0.0([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) '@payloadcms/plugin-search': - specifier: beta - version: 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + specifier: latest + version: 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) '@payloadcms/plugin-seo': - specifier: beta - version: 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + specifier: latest + version: 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) '@payloadcms/richtext-lexical': - specifier: beta - version: 3.0.0-beta.129(azre6glzvbzmawkxstou4xhewi) + specifier: latest + version: 3.0.0(vlzkhyw3w7pts26llqmwmgptie) '@payloadcms/ui': - specifier: beta - version: 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + specifier: latest + version: 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) '@radix-ui/react-checkbox': specifier: ^1.0.4 version: 1.1.2([email protected]([email protected]))([email protected])([email protected])([email protected]) @@ -82,8 +82,8 @@ importers: specifier: 15.0.0 version: 15.0.0([email protected]([email protected]))([email protected])([email protected]) payload: - specifier: beta - version: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + specifier: latest + version: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) payload-admin-bar: specifier: ^1.0.6 version: 1.0.6([email protected]([email protected]))([email protected]) @@ -989,82 +989,82 @@ packages: '@one-ini/[email protected]': resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==} - '@payloadcms/[email protected]': - resolution: {integrity: sha512-yOzQ64SMm+eMcPicRBgmO8krGCWHxdb5UxqJCGIyqnl+9ARL9AQFYDudXO68Ju8Z/pmCRS2n9smeHNow7Wf8NQ==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-FTlL9+BpkMLWxWXYoQq5LLdSkT1L9lHfnJY1xS/f1B8YySCFu46DrkaIHwOo9MITBHM8kAc5CS9xCP0RrQUwug==} peerDependencies: - payload: 3.0.0-beta.129 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-HRtjHbl4a6reP7iGF3e//PbHqd/1nP9X4LsCcJZM+IG0nKW6/O4MrQ9hgGBaKn7JqeecbUVMzQwNCBg3V0KzaA==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-2lJF7e0BY8iNVOMrq9ely5FdtOT5mxNLTAdJS793QMxcVn/kIaB7vbD8DKs7KI4JtbksVzKTy3/vZ9/iukltdw==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: - payload: 3.0.0-beta.129 + payload: 3.0.0 '@payloadcms/[email protected]': resolution: {integrity: sha512-LSf9oEPb6aMEMqdTFqj1v+7p/bdrJWG6hp7748xjVO3RL3yQESTKLK/NbjsMYITN4tKFXjfPWDUtcwHv0hS6/A==} - '@payloadcms/[email protected]': - resolution: {integrity: sha512-ntpqN/SKn5ufohfybltk8Z/nI+gaKEOgnCIIrUgspI4QXj2NdTJPxHiS53HZIprizfAiBSnnCvbJTipVusIgrw==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-JqxoxsYuk4aevQP9U0aEzqcqYmM7/SpOH1n6YNa4v28mtLAOJCiDpO+79oyu3KIy0mBbZw1bDV4GyiOD/NKdSA==} hasBin: true peerDependencies: graphql: ^16.8.1 - payload: 3.0.0-beta.129 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-1TKSOLN8ovzFSb/Ir/dPifkjGSgVQjLjNcy+25kF8z8E9X3L7VLlcrTTv9D7Wb2H25X7jsTrKht1qJ18yamaeA==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-R3oVvOHoJDceoFlCbbSKZCDRYNRN/df6eABDws/w5UDyUPsVxEZoJxxxcuAcg8NkRzYvve4PzWXf5jbJNFM0mQ==} peerDependencies: react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-QFSEwkSdrNpM07EctFSKzosVgPE97fqoJE/tPk1w9Uymp08imhMOlBzqjTW4Ueac4BO9bRt13G8+oxt+zPlsZA==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-gGsBBbyEn0WJWrANs6YNQJkpav1nQzj3B0Qdxr2kcnZzfnex/tPMrqN9lZTeSUFpBcgVydDSO6zgX84SoS8tew==} - '@payloadcms/[email protected]': - resolution: {integrity: sha512-CVxRkYW7sr/l7lc7llRQaE10lkWN5rd7Q6lN6Y+h5crIX0ow9Jke4c6h53CYTrjSS+66mMDcxhFb+6/nHgZwdQ==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-DkfjgUTCAmuQ+8shqu/LIueDD23g2ZsyiwG+i0WvlPj1Fdoi/g/CUj8fVdrGPKSyceUELAJAs9B7cYsqHMej8w==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: graphql: ^16.8.1 next: ^15.0.0 - payload: 3.0.0-beta.129 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-V44O9ItxDSyupGkKxR7VuHWixeBIPST2mwnyVZUzzjmZsrtKguSeZUwmkaOTeyEEy9jL8957BoPg/ltPvLcrOA==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-4Eiv7PFI+6+5uriaaaWWOx8ZmElNjqI0XlzhP5xleiSqsTt396xutD0vazgyiLcqifAjMOZtCWXGqS/Xo2oqnw==} peerDependencies: - payload: 3.0.0-beta.129 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-gg5Fva1BxNk2OZcEaEGDHiNgEsAiHWITODuMPNQN5aNEtGMEoeh5MQpoNcUMELY8spPbKMf2y/W/+pE3xrgyrQ==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-q2myYcHYDxJtA+tzskpxqYqcw/Si1zq5+GT3jP1PAlkfIGaZmfK0q+1fZsH96Z74dIKFn1f1O3WOxAxvPA4Byg==} peerDependencies: - payload: 3.0.0-beta.129 + payload: 3.0.0 react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-heWjBsukKVZs4wb/fEy3A9SJB7P85EYlY779sVf106NjJOKc/6TGQL9g5+WOpGKSH2DvW3PgtYtKSQfjI55GiQ==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-k18632I+7KJ3BWyRAHJJ1dQ/rn62ou0DzOXtGfum6mEnRIoiR9VCILqTXj88SVmvhg1uh/Lua8qJPgxDfkqeIQ==} peerDependencies: - payload: 3.0.0-beta.129 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-shB1R5ASfFw6qQs4kJxtSGy/6MieHymfOCDtnCDIoeFfofO9YdmHkebam5/NKsC4NBlmv171pHTlzzyl1sD7VA==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-JFjecQBeEJg/w7QHLNgbvhscyqpTT7eAOGdyXN1RzzCa7rW0rCfOMhJL4FacUGedL+sLbhTTUj9KAo9Fo+HHqg==} peerDependencies: - payload: 3.0.0-beta.129 + payload: 3.0.0 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-AjD20iTUR+NLJeSyiWuII7/nze4bNqzadqY9C32exqFuZsHuWtT1XTlwjDwcelks4FeLMV0Zmwp+Mq05NFK8ag==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-LjrNqkZz504Fz3x2Y49WPEwM+R3LRnp++X3Iqqv0GPcm/dgnqz5XAaVuiA08ozdCakLG7GESY0ewxr4Wk60oVQ==} peerDependencies: - payload: 3.0.0-beta.129 + payload: 3.0.0 react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-GVZ66g9pov5oWemqN9aQTpcs3nPAwAlLM8287X5QwZb/IaqxGD318yJsQfIQ79ikEPL70411lIHjUuUKGS6kbQ==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-M4UhQisUQ07nJiu2QDyemqEyr/cDD+MQiND5Heu1plzx+NYUKZannjfJRzC8VEQg675dNrjBuvUgqtLDtyX3yQ==} peerDependencies: - payload: 3.0.0-beta.129 + payload: 3.0.0 react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-/V9hPIe9DoOY3M7YkRni9W+1s+VzTgcXb/2f7UKp4KbvbduOn3GJ7VWeFJMxiMNdGWteBd+V4HnPpktppQxzJA==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-pX+msGFwGJeQNpg8+k1IOFSf9AZWsjeNaovD010XzcoO9bQUtUktUpAjGRfsegAkXXHDDYXFFdlqVUNxpjzIPQ==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: '@faceless-ui/modal': 3.0.0-beta.2 @@ -1079,21 +1079,21 @@ packages: '@lexical/selection': 0.20.0 '@lexical/table': 0.20.0 '@lexical/utils': 0.20.0 - '@payloadcms/next': 3.0.0-beta.129 + '@payloadcms/next': 3.0.0 lexical: 0.20.0 - payload: 3.0.0-beta.129 + payload: 3.0.0 react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 - '@payloadcms/[email protected]': - resolution: {integrity: sha512-c6EOIB8rCQeqiHz/DuZwS8Yk7ifjpHdS7ajCAni92xhe9Cbsgy1RzpNXveGNzouV2p0auSMjbXKxXPO/f4EFEg==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-kp1pQphABFEJP0wNSg/G/nom0n1xZ5WnxbeYYkY1t/lxIfrBd8p9j48LLa5cSpb2+ckGjuLi7I/8j0/eKxt38Q==} - '@payloadcms/[email protected]': - resolution: {integrity: sha512-0fr6wfYvUtDfH64Q3VGfFrMKyHm2HlAlJmOgg2y2ci8uqprIW82JlZJ3f0XGkF0JIENE9HHZM2w5qQgEd2a7mg==} + '@payloadcms/[email protected]': + resolution: {integrity: sha512-J/x8HITWEC97Uz61FeHNnCqqN+H9tMswXelxkqktdbF4kcgHMlJYF5CeeujmVKys8V+capbUOHhw4ndkHtfhjQ==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: next: ^15.0.0 - payload: 3.0.0-beta.129 + payload: 3.0.0 react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 @@ -1622,18 +1622,30 @@ packages: '@tokenizer/[email protected]': resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} + '@types/[email protected]': + resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} + '@types/[email protected]': resolution: {integrity: sha512-kG7WrUuAKK0NoyxfQHsVE6j1m01s6kMma64E+OZenQABMQyTJop1DumUWcLwAQ2JzpefU7PDYoRDKl8uZosFjw==} + '@types/[email protected]': + resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/[email protected]': resolution: {integrity: sha512-qZ72SFTgUAZ5a7Tj6kf2SHLetiH5S6f8G5frB2SPQ3EyF02kxdyBFf4Tz4banE3xCgGnKgWLt//a6VuYHKYJTg==} '@types/[email protected]': resolution: {integrity: sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==} + '@types/[email protected]': + resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} + '@types/[email protected]': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + '@types/[email protected]': + resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/[email protected]': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} @@ -1646,6 +1658,12 @@ packages: '@types/[email protected]': resolution: {integrity: sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==} + '@types/[email protected]': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + + '@types/[email protected]': + resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} + '@types/[email protected]': resolution: {integrity: sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==} @@ -1661,14 +1679,20 @@ packages: '@types/[email protected]': resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} + '@types/[email protected]': + resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} + + '@types/[email protected]': + resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} + '@types/[email protected]': resolution: {integrity: sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==} '@types/[email protected]': resolution: {integrity: sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==} - '@types/[email protected]': - resolution: {integrity: sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==} + '@types/[email protected]': + resolution: {integrity: sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==} '@typescript-eslint/[email protected]': resolution: {integrity: sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==} @@ -1851,6 +1875,11 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + [email protected]: + resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + engines: {node: '>=0.4.0'} + hasBin: true + [email protected]: resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} @@ -2036,9 +2065,9 @@ packages: [email protected]: resolution: {integrity: sha512-vgnKAUzcDoa+AeyYwXCoHyF2q6u/8H46dxu5JN+4/TZeq/Dlinn0K6GvxsCLb3LHUJl0m/TLiEK31kUwtgocMQ==} - [email protected]: - resolution: {integrity: sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==} - engines: {node: '>=6.9.0'} + [email protected]: + resolution: {integrity: sha512-X9hJeyeM0//Fus+0pc5dSUMhhrrmWwQUtdavaQeF3Ta6m69matZkGWV/MrBcnwUeLC8W9kwwc2hfkZgUuCX3Ig==} + engines: {node: '>=16.20.1'} [email protected]: resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} @@ -2071,10 +2100,25 @@ packages: [email protected]: resolution: {integrity: sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==} + [email protected]: + resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + [email protected]: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + [email protected]: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + + [email protected]: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + + [email protected]: + resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + + [email protected]: + resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} + [email protected]: resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} @@ -2220,6 +2264,9 @@ packages: [email protected]: resolution: {integrity: sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==} + [email protected]: + resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} + [email protected]: resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} @@ -2240,6 +2287,9 @@ packages: supports-color: optional: true + [email protected]: + resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} + [email protected]: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -2278,6 +2328,9 @@ packages: [email protected]: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} + [email protected]: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + [email protected]: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -2625,6 +2678,12 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + [email protected]: + resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} + + [email protected]: + resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==} + [email protected]: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -2950,6 +3009,12 @@ packages: resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} engines: {node: '>= 12'} + [email protected]: + resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} + + [email protected]: + resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} + [email protected]: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} @@ -2997,6 +3062,9 @@ packages: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} + [email protected]: + resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} + [email protected]: resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==} engines: {node: '>=0.10.0'} @@ -3020,6 +3088,9 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + [email protected]: + resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} + [email protected]: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} @@ -3185,8 +3256,8 @@ packages: [email protected]: resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} - [email protected]: - resolution: {integrity: sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==} + [email protected]: + resolution: {integrity: sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==} engines: {node: '>=12.0.0'} [email protected]: @@ -3270,6 +3341,9 @@ packages: [email protected]: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + [email protected]: + resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} + [email protected]: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true @@ -3285,6 +3359,21 @@ packages: [email protected]: resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} + [email protected]: + resolution: {integrity: sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==} + + [email protected]: + resolution: {integrity: sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ==} + + [email protected]: + resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + + [email protected]: + resolution: {integrity: sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==} + + [email protected]: + resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + [email protected]: resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==} @@ -3295,6 +3384,78 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + [email protected]: + resolution: {integrity: sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w==} + + [email protected]: + resolution: {integrity: sha512-vNuFb9czP8QCtAQcEJn0UJQJZA8Dk6DXKBqx+bg/w0WGuSxDxNr7hErW89tHUY31dUW4NqEOWwmEUNhjTFmHkg==} + + [email protected]: + resolution: {integrity: sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==} + + [email protected]: + resolution: {integrity: sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==} + + [email protected]: + resolution: {integrity: sha512-5E5I2pFzJyg2CtemqAbcyCktpHXuJbABnsb32wX2U8IQKhhVFBqkcZR5LRm1WVoFqa4kTueZK4abep7wdo9nrw==} + + [email protected]: + resolution: {integrity: sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==} + + [email protected]: + resolution: {integrity: sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==} + + [email protected]: + resolution: {integrity: sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==} + + [email protected]: + resolution: {integrity: sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==} + + [email protected]: + resolution: {integrity: sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==} + + [email protected]: + resolution: {integrity: sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==} + + [email protected]: + resolution: {integrity: sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==} + + [email protected]: + resolution: {integrity: sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==} + + [email protected]: + resolution: {integrity: sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==} + + [email protected]: + resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==} + + [email protected]: + resolution: {integrity: sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA==} + + [email protected]: + resolution: {integrity: sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==} + + [email protected]: + resolution: {integrity: sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==} + + [email protected]: + resolution: {integrity: sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==} + + [email protected]: + resolution: {integrity: sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==} + + [email protected]: + resolution: {integrity: sha512-xKxhkB62vwHUuuxHe9Xqty3UaAsizV2YKq5OV344u3hFBbf8zIYrhYOWhAQb94MtMPkjTOzzjJ/hid9/dR5vFA==} + + [email protected]: + resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==} + + [email protected]: + resolution: {integrity: sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==} + + [email protected]: + resolution: {integrity: sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw==} + [email protected]: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -3344,32 +3505,55 @@ packages: [email protected]: resolution: {integrity: sha512-OeWhNpABLCeTqubfqLMXGsqf6OmPU6pHM85kF3dhy6kq5hnhuVS1p3VrEW/XhWHc71P2tHyS5JFySD8mgs1crw==} - [email protected]: - resolution: {integrity: sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==} + [email protected]: + resolution: {integrity: sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==} - [email protected]: - resolution: {integrity: sha512-MBuyYiPUPRTqfH2dV0ya4dcr2E5N52ocBuZ8Sgg/M030nGF78v855B3Z27mZJnp8PxjnUquEnAtjOsphgMZOlQ==} - engines: {node: '>=12.9.0'} + [email protected]: + resolution: {integrity: sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg==} + engines: {node: '>=16.20.1'} + peerDependencies: + '@aws-sdk/credential-providers': ^3.188.0 + '@mongodb-js/zstd': ^1.1.0 + gcp-metadata: ^5.2.0 + kerberos: ^2.0.1 + mongodb-client-encryption: '>=6.0.0 <7' + snappy: ^7.2.2 + socks: ^2.7.1 + peerDependenciesMeta: + '@aws-sdk/credential-providers': + optional: true + '@mongodb-js/zstd': + optional: true + gcp-metadata: + optional: true + kerberos: + optional: true + mongodb-client-encryption: + optional: true + snappy: + optional: true + socks: + optional: true - [email protected]: - resolution: {integrity: sha512-UuALu+mjhQa1K9lMQvjLL3vm3iALvNw8PQNIh2gp1b+tO5hUa0NC0Wf6/8QrT9PSJVTihXaD8hQVy3J4e0jO0Q==} + [email protected]: + resolution: {integrity: sha512-Ai478tHedZy3U2ITBEp2H4rQEviRan3TK4p/umlFqIzgPF1R0hNKvzzQGIb1l2h+Z32QLU3NqaoWKu4vOOUElQ==} engines: {node: '>=4.0.0'} - [email protected]: - resolution: {integrity: sha512-xW5GugkE21DJiu9e13EOxKt4ejEKQkRP/S1PkkXRjnk2rRZVKBcld1nPV+VJ/YCPfm8hb3sz9OvI7O38RmixkA==} + [email protected]: + resolution: {integrity: sha512-kFxhot+yw9KmpAGSSrF/o+f00aC2uawgNUbhyaM0USS9L7dln1NA77/pLg4lgOaRgXMtfgCENamjqZwIM1Zrig==} engines: {node: '>=4.0.0'} - [email protected]: - resolution: {integrity: sha512-MNJymaaXali7w7rHBxVUoQ3HzHHMk/7I/+yeeoSa4rUzdjZwIWQznBNvVgc0A8ghuJwsuIkb5LyLV6gSjGjWyQ==} - engines: {node: '>=12.0.0'} + [email protected]: + resolution: {integrity: sha512-l7DgeY1szT98+EKU8GYnga5WnyatAu+kOQ2VlVX1Mxif6A0Umt0YkSiksCiyGxzx8SPhGe9a53ND1GD4yVDrPA==} + engines: {node: '>=16.20.1'} [email protected]: resolution: {integrity: sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==} engines: {node: '>=4.0.0'} - [email protected]: - resolution: {integrity: sha512-J5heI+P08I6VJ2Ky3+33IpCdAvlYGTSUjwTPxkAr8i8EoduPMBX2OY/wa3IKZIQl7MU4SbFk8ndgSKyB/cl1zA==} - engines: {node: '>=12.0.0'} + [email protected]: + resolution: {integrity: sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==} + engines: {node: '>=14.0.0'} [email protected]: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -3520,6 +3704,9 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} + [email protected]: + resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} + [email protected]: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -3559,8 +3746,8 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 - [email protected]: - resolution: {integrity: sha512-zCizHbqHrDeEd44G0aYIYu8RAe1SDPNKFNieTZs5Kq4Xbyz9CBR7ADOiwmJK0nKsDcvISWRINhrHUXZmMfIH+g==} + [email protected]: + resolution: {integrity: sha512-CV+sDpTPTJAtr3Zv2I7BbR19Mu1Dpu4jlmFU5yqjpoaMW6xVeUUtgBA7NhCUF3gen7MLMoSZgXyrgy3RLgT4vA==} engines: {node: ^18.20.2 || >=20.9.0} hasBin: true peerDependencies: @@ -4017,8 +4204,8 @@ packages: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} engines: {node: '>= 0.4'} - [email protected]: - resolution: {integrity: sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==} + [email protected]: + resolution: {integrity: sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==} [email protected]: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} @@ -4130,6 +4317,9 @@ packages: [email protected]: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + [email protected]: + resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + [email protected]: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -4253,9 +4443,9 @@ packages: [email protected]: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - [email protected]: - resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} - engines: {node: '>=12'} + [email protected]: + resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==} + engines: {node: '>=14'} [email protected]: resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==} @@ -4352,6 +4542,21 @@ packages: [email protected]: resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==} + [email protected]: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + + [email protected]: + resolution: {integrity: sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==} + + [email protected]: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + + [email protected]: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} + + [email protected]: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + [email protected]: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} engines: {node: '>=8'} @@ -4414,6 +4619,9 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true + [email protected]: + resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} + [email protected]: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -4421,9 +4629,9 @@ packages: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} - [email protected]: - resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==} - engines: {node: '>=12'} + [email protected]: + resolution: {integrity: sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==} + engines: {node: '>=16'} [email protected]: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} @@ -4513,6 +4721,9 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + [email protected]: + resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} + snapshots: '@alloc/[email protected]': {} @@ -5730,7 +5941,6 @@ snapshots: '@mongodb-js/[email protected]': dependencies: sparse-bitfield: 3.0.3 - optional: true '@next/[email protected]': {} @@ -5784,25 +5994,29 @@ snapshots: '@one-ini/[email protected]': {} - '@payloadcms/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': + '@payloadcms/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])': dependencies: - bson-objectid: 2.0.4 http-status: 1.6.2 - mongoose: 6.12.3(@aws-sdk/[email protected](@aws-sdk/[email protected])) - mongoose-aggregate-paginate-v2: 1.0.6 - mongoose-paginate-v2: 1.7.22 - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + mongoose: 8.8.1(@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]) + mongoose-aggregate-paginate-v2: 1.1.2 + mongoose-paginate-v2: 1.8.5 + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) prompts: 2.4.2 uuid: 10.0.0 transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks - supports-color - '@payloadcms/[email protected]([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': + '@payloadcms/[email protected]([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': dependencies: nodemailer: 6.9.10 - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) '@payloadcms/[email protected]([email protected])': dependencies: @@ -5833,31 +6047,31 @@ snapshots: - typescript - vue-eslint-parser - '@payloadcms/[email protected]([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])': + '@payloadcms/[email protected]([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])': dependencies: graphql: 16.9.0 graphql-scalars: 1.22.2([email protected]) - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) pluralize: 8.0.0 ts-essentials: 10.0.3([email protected]) tsx: 4.19.2 transitivePeerDependencies: - typescript - '@payloadcms/[email protected]([email protected]([email protected]))([email protected])': + '@payloadcms/[email protected]([email protected]([email protected]))([email protected])': dependencies: - '@payloadcms/live-preview': 3.0.0-beta.129 + '@payloadcms/live-preview': 3.0.0 react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020([email protected]) - '@payloadcms/[email protected]': {} + '@payloadcms/[email protected]': {} - '@payloadcms/[email protected]([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': + '@payloadcms/[email protected]([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': dependencies: '@dnd-kit/core': 6.0.8([email protected]([email protected]))([email protected]) - '@payloadcms/graphql': 3.0.0-beta.129([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]) - '@payloadcms/translations': 3.0.0-beta.129 - '@payloadcms/ui': 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + '@payloadcms/graphql': 3.0.0([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]) + '@payloadcms/translations': 3.0.0 + '@payloadcms/ui': 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) busboy: 1.6.0 file-type: 19.3.0 graphql: 16.9.0 @@ -5866,33 +6080,30 @@ snapshots: http-status: 1.6.2 next: 15.0.0([email protected]([email protected]))([email protected])([email protected]) path-to-regexp: 6.3.0 - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) qs-esm: 7.0.2 react-diff-viewer-continued: 3.2.6([email protected]([email protected]))([email protected]) sass: 1.77.4 sonner: 1.7.0([email protected]([email protected]))([email protected]) uuid: 10.0.0 - ws: 8.18.0 transitivePeerDependencies: - '@types/react' - - bufferutil - monaco-editor - react - react-dom - supports-color - typescript - - utf-8-validate - '@payloadcms/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': + '@payloadcms/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': dependencies: '@aws-sdk/client-cognito-identity': 3.687.0 '@aws-sdk/client-s3': 3.689.0 '@aws-sdk/credential-providers': 3.687.0(@aws-sdk/[email protected](@aws-sdk/[email protected])) '@aws-sdk/lib-storage': 3.689.0(@aws-sdk/[email protected]) - '@payloadcms/email-nodemailer': 3.0.0-beta.129([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) + '@payloadcms/email-nodemailer': 3.0.0([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])) amazon-cognito-identity-js: 6.3.12 nodemailer: 6.9.10 - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) resend: 0.17.2 transitivePeerDependencies: - '@aws-sdk/client-sso-oidc' @@ -5900,11 +6111,11 @@ snapshots: - debug - encoding - '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': + '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': dependencies: - '@payloadcms/ui': 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + '@payloadcms/ui': 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) escape-html: 1.0.3 - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020([email protected]) transitivePeerDependencies: @@ -5914,18 +6125,18 @@ snapshots: - supports-color - typescript - '@payloadcms/[email protected]([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': + '@payloadcms/[email protected]([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': dependencies: - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) - '@payloadcms/[email protected]([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': + '@payloadcms/[email protected]([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))': dependencies: - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) - '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': + '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': dependencies: - '@payloadcms/ui': 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + '@payloadcms/ui': 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020([email protected]) transitivePeerDependencies: @@ -5935,11 +6146,11 @@ snapshots: - supports-color - typescript - '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': + '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': dependencies: - '@payloadcms/translations': 3.0.0-beta.129 - '@payloadcms/ui': 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + '@payloadcms/translations': 3.0.0 + '@payloadcms/ui': 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020([email protected]) transitivePeerDependencies: @@ -5949,7 +6160,7 @@ snapshots: - supports-color - typescript - '@payloadcms/[email protected](azre6glzvbzmawkxstou4xhewi)': + '@payloadcms/[email protected](vlzkhyw3w7pts26llqmwmgptie)': dependencies: '@faceless-ui/modal': 3.0.0-beta.2([email protected]([email protected]))([email protected]) '@faceless-ui/scroll-info': 2.0.0-beta.0([email protected]([email protected]))([email protected]) @@ -5963,15 +6174,19 @@ snapshots: '@lexical/selection': 0.20.0 '@lexical/table': 0.20.0 '@lexical/utils': 0.20.0 - '@payloadcms/next': 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) - '@payloadcms/translations': 3.0.0-beta.129 - '@payloadcms/ui': 3.0.0-beta.129([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + '@payloadcms/next': 3.0.0([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) + '@payloadcms/translations': 3.0.0 + '@payloadcms/ui': 3.0.0([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected]) '@types/uuid': 10.0.0 + acorn: 8.12.1 bson-objectid: 2.0.4 dequal: 2.0.3 escape-html: 1.0.3 lexical: 0.20.0 - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + mdast-util-from-markdown: 2.0.2 + mdast-util-mdx-jsx: 3.1.3 + micromark-extension-mdx-jsx: 3.0.1 + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020([email protected]) react-error-boundary: 4.0.13([email protected]) @@ -5984,11 +6199,11 @@ snapshots: - supports-color - typescript - '@payloadcms/[email protected]': + '@payloadcms/[email protected]': dependencies: - date-fns: 3.3.1 + date-fns: 4.1.0 - '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': + '@payloadcms/[email protected]([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])([email protected])': dependencies: '@dnd-kit/core': 6.0.8([email protected]([email protected]))([email protected]) '@dnd-kit/sortable': 7.0.2(@dnd-kit/[email protected]([email protected]([email protected]))([email protected]))([email protected]) @@ -5996,15 +6211,15 @@ snapshots: '@faceless-ui/scroll-info': 2.0.0-beta.0([email protected]([email protected]))([email protected]) '@faceless-ui/window-info': 3.0.0-beta.0([email protected]([email protected]))([email protected]) '@monaco-editor/react': 4.6.0([email protected])([email protected]([email protected]))([email protected]) - '@payloadcms/translations': 3.0.0-beta.129 + '@payloadcms/translations': 3.0.0 body-scroll-lock: 4.0.0-beta.0 bson-objectid: 2.0.4 - date-fns: 3.3.1 + date-fns: 4.1.0 dequal: 2.0.3 md5: 2.3.0 next: 15.0.0([email protected]([email protected]))([email protected])([email protected]) object-to-formdata: 4.5.1 - payload: 3.0.0-beta.129([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + payload: 3.0.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) qs-esm: 7.0.2 react: 19.0.0-rc-65a56d0e-20241020 react-animate-height: 2.1.2([email protected]([email protected]))([email protected]) @@ -6640,10 +6855,18 @@ snapshots: '@tokenizer/[email protected]': {} + '@types/[email protected]': + dependencies: + '@types/estree': 1.0.6 + '@types/[email protected]': dependencies: '@types/node': 22.5.4 + '@types/[email protected]': + dependencies: + '@types/ms': 0.7.34 + '@types/[email protected]': {} '@types/[email protected]': @@ -6651,8 +6874,16 @@ snapshots: '@types/estree': 1.0.6 '@types/json-schema': 7.0.15 + '@types/[email protected]': + dependencies: + '@types/estree': 1.0.6 + '@types/[email protected]': {} + '@types/[email protected]': + dependencies: + '@types/unist': 3.0.3 + '@types/[email protected]': {} '@types/[email protected]': {} @@ -6663,6 +6894,12 @@ snapshots: '@types/[email protected]': {} + '@types/[email protected]': + dependencies: + '@types/unist': 3.0.3 + + '@types/[email protected]': {} + '@types/[email protected]': dependencies: undici-types: 6.19.8 @@ -6677,13 +6914,16 @@ snapshots: '@types/[email protected]': {} + '@types/[email protected]': {} + + '@types/[email protected]': {} + '@types/[email protected]': {} '@types/[email protected]': {} - '@types/[email protected]': + '@types/[email protected]': dependencies: - '@types/node': 22.5.4 '@types/webidl-conversions': 7.0.3 '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': @@ -6942,6 +7182,8 @@ snapshots: dependencies: acorn: 8.14.0 + [email protected]: {} + [email protected]: {} [email protected]: @@ -7167,9 +7409,7 @@ snapshots: [email protected]: {} - [email protected]: - dependencies: - buffer: 5.7.1 + [email protected]: {} [email protected]: {} @@ -7207,11 +7447,21 @@ snapshots: [email protected]: {} + [email protected]: {} + [email protected]: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + [email protected]: {} [email protected]: @@ -7361,6 +7611,8 @@ snapshots: [email protected]: {} + [email protected]: {} + [email protected]: {} [email protected]: @@ -7371,6 +7623,10 @@ snapshots: dependencies: ms: 2.1.3 + [email protected]: + dependencies: + character-entities: 2.0.2 + [email protected]: dependencies: mimic-response: 3.1.0 @@ -7401,6 +7657,10 @@ snapshots: [email protected]: {} + [email protected]: + dependencies: + dequal: 2.0.3 + [email protected]: {} [email protected]: {} @@ -8000,6 +8260,13 @@ snapshots: [email protected]: {} + [email protected]: {} + + [email protected]: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/unist': 3.0.3 + [email protected]: {} [email protected]: {} @@ -8319,6 +8586,14 @@ snapshots: dependencies: jsbn: 1.1.0 sprintf-js: 1.1.3 + optional: true + + [email protected]: {} + + [email protected]: + dependencies: + is-alphabetical: 2.0.1 + is-decimal: 2.0.1 [email protected]: dependencies: @@ -8366,6 +8641,8 @@ snapshots: dependencies: has-tostringtag: 1.0.2 + [email protected]: {} + [email protected]: {} [email protected]: {} @@ -8384,6 +8661,8 @@ snapshots: dependencies: is-extglob: 2.1.1 + [email protected]: {} + [email protected]: {} [email protected]: {} @@ -8487,7 +8766,8 @@ snapshots: dependencies: argparse: 2.0.1 - [email protected]: {} + [email protected]: + optional: true [email protected]: {} @@ -8550,7 +8830,7 @@ snapshots: jwa: 1.4.1 safe-buffer: 5.2.1 - [email protected]: {} + [email protected]: {} [email protected]: dependencies: @@ -8615,6 +8895,8 @@ snapshots: [email protected]: {} + [email protected]: {} + [email protected]: dependencies: js-tokens: 4.0.0 @@ -8631,13 +8913,237 @@ snapshots: crypt: 0.0.2 is-buffer: 1.1.6 + [email protected]: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + mdast-util-to-string: 4.0.0 + micromark: 4.0.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-decode-string: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + unist-util-stringify-position: 4.0.0 + transitivePeerDependencies: + - supports-color + + [email protected]: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.2 + mdast-util-to-markdown: 2.1.2 + parse-entities: 4.0.1 + stringify-entities: 4.0.4 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + + [email protected]: + dependencies: + '@types/mdast': 4.0.4 + unist-util-is: 6.0.0 + + [email protected]: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 + longest-streak: 3.1.0 + mdast-util-phrasing: 4.1.0 + mdast-util-to-string: 4.0.0 + micromark-util-classify-character: 2.0.1 + micromark-util-decode-string: 2.0.1 + unist-util-visit: 5.0.0 + zwitch: 2.0.4 + + [email protected]: + dependencies: + '@types/mdast': 4.0.4 + [email protected]: {} - [email protected]: - optional: true + [email protected]: {} [email protected]: {} + [email protected]: + dependencies: + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-factory-destination: 2.0.1 + micromark-factory-label: 2.0.1 + micromark-factory-space: 2.0.1 + micromark-factory-title: 2.0.1 + micromark-factory-whitespace: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-classify-character: 2.0.1 + micromark-util-html-tag-name: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-subtokenize: 2.0.2 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + '@types/acorn': 4.0.6 + '@types/estree': 1.0.6 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + micromark-factory-mdx-expression: 2.0.2 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + vfile-message: 4.0.2 + + [email protected]: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + devlop: 1.1.0 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + '@types/estree': 1.0.6 + devlop: 1.1.0 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + unist-util-position-from-estree: 2.0.0 + vfile-message: 4.0.2 + + [email protected]: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-symbol: 2.0.1 + + [email protected]: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-chunked: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-symbol: 2.0.1 + + [email protected]: + dependencies: + decode-named-character-reference: 1.0.2 + micromark-util-character: 2.1.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-symbol: 2.0.1 + + [email protected]: {} + + [email protected]: + dependencies: + '@types/acorn': 4.0.6 + '@types/estree': 1.0.6 + '@types/unist': 3.0.3 + devlop: 1.1.0 + estree-util-visit: 2.0.0 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + vfile-message: 4.0.2 + + [email protected]: {} + + [email protected]: + dependencies: + micromark-util-symbol: 2.0.1 + + [email protected]: + dependencies: + micromark-util-types: 2.0.1 + + [email protected]: + dependencies: + micromark-util-character: 2.1.1 + micromark-util-encode: 2.0.1 + micromark-util-symbol: 2.0.1 + + [email protected]: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.1 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + + [email protected]: {} + + [email protected]: {} + + [email protected]: + dependencies: + '@types/debug': 4.1.12 + debug: 4.3.7 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.2 + micromark-factory-space: 2.0.1 + micromark-util-character: 2.1.1 + micromark-util-chunked: 2.0.1 + micromark-util-combine-extensions: 2.0.1 + micromark-util-decode-numeric-character-reference: 2.0.2 + micromark-util-encode: 2.0.1 + micromark-util-normalize-identifier: 2.0.1 + micromark-util-resolve-all: 2.0.1 + micromark-util-sanitize-uri: 2.0.1 + micromark-util-subtokenize: 2.0.2 + micromark-util-symbol: 2.0.1 + micromark-util-types: 2.0.1 + transitivePeerDependencies: + - supports-color + [email protected]: dependencies: braces: 3.0.3 @@ -8677,44 +9183,46 @@ snapshots: [email protected]: {} - [email protected]: + [email protected]: dependencies: - '@types/whatwg-url': 8.2.2 - whatwg-url: 11.0.0 + '@types/whatwg-url': 11.0.5 + whatwg-url: 13.0.0 - [email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])): + [email protected](@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]): dependencies: - bson: 4.7.2 - mongodb-connection-string-url: 2.6.0 - socks: 2.8.3 + '@mongodb-js/saslprep': 1.1.9 + bson: 6.9.0 + mongodb-connection-string-url: 3.0.1 optionalDependencies: '@aws-sdk/credential-providers': 3.687.0(@aws-sdk/[email protected](@aws-sdk/[email protected])) - '@mongodb-js/saslprep': 1.1.9 - transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt + socks: 2.8.3 - [email protected]: {} + [email protected]: {} - [email protected]: {} + [email protected]: {} - [email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])): + [email protected](@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]): dependencies: - bson: 4.7.2 - kareem: 2.5.1 - mongodb: 4.17.1(@aws-sdk/[email protected](@aws-sdk/[email protected])) + bson: 6.9.0 + kareem: 2.6.3 + mongodb: 6.10.0(@aws-sdk/[email protected](@aws-sdk/[email protected](@aws-sdk/[email protected])))([email protected]) mpath: 0.9.0 - mquery: 4.0.3 + mquery: 5.0.0 ms: 2.1.3 - sift: 16.0.1 + sift: 17.1.3 transitivePeerDependencies: - - '@aws-sdk/client-sso-oidc' - - aws-crt + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks - supports-color [email protected]: {} - [email protected]: + [email protected]: dependencies: debug: 4.3.7 transitivePeerDependencies: @@ -8866,6 +9374,17 @@ snapshots: dependencies: callsites: 3.1.0 + [email protected]: + dependencies: + '@types/unist': 2.0.11 + character-entities: 2.0.2 + character-entities-legacy: 3.0.0 + character-reference-invalid: 2.0.1 + decode-named-character-reference: 1.0.2 + is-alphanumerical: 2.0.1 + is-decimal: 2.0.1 + is-hexadecimal: 2.0.1 + [email protected]: dependencies: '@babel/code-frame': 7.26.2 @@ -8900,11 +9419,11 @@ snapshots: react: 19.0.0-rc-65a56d0e-20241020 react-dom: 19.0.0-rc-65a56d0e-20241020([email protected]) - [email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]): + [email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]): dependencies: '@monaco-editor/react': 4.6.0([email protected])([email protected]([email protected]))([email protected]) '@next/env': 15.0.3 - '@payloadcms/translations': 3.0.0-beta.129 + '@payloadcms/translations': 3.0.0 '@types/busboy': 1.5.4 ajv: 8.17.1 bson-objectid: 2.0.4 @@ -8929,11 +9448,14 @@ snapshots: ts-essentials: 10.0.3([email protected]) tsx: 4.19.2 uuid: 10.0.0 + ws: 8.18.0 transitivePeerDependencies: + - bufferutil - monaco-editor - react - react-dom - typescript + - utf-8-validate [email protected]: {} @@ -9465,7 +9987,7 @@ snapshots: get-intrinsic: 1.2.4 object-inspect: 1.13.3 - [email protected]: {} + [email protected]: {} [email protected]: {} @@ -9487,12 +10009,14 @@ snapshots: [email protected]: {} - [email protected]: {} + [email protected]: + optional: true [email protected]: dependencies: ip-address: 9.0.5 smart-buffer: 4.2.0 + optional: true [email protected]: dependencies: @@ -9510,11 +10034,11 @@ snapshots: [email protected]: dependencies: memory-pager: 1.5.0 - optional: true [email protected]: {} - [email protected]: {} + [email protected]: + optional: true [email protected]: {} @@ -9600,6 +10124,11 @@ snapshots: dependencies: safe-buffer: 5.2.1 + [email protected]: + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + [email protected]: dependencies: ansi-regex: 5.0.1 @@ -9747,7 +10276,7 @@ snapshots: [email protected]: {} - [email protected]: + [email protected]: dependencies: punycode: 2.3.1 @@ -9855,6 +10384,29 @@ snapshots: [email protected]: {} + [email protected]: + dependencies: + '@types/unist': 3.0.3 + + [email protected]: + dependencies: + '@types/unist': 3.0.3 + + [email protected]: + dependencies: + '@types/unist': 3.0.3 + + [email protected]: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + + [email protected]: + dependencies: + '@types/unist': 3.0.3 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + [email protected]: {} [email protected]([email protected]): @@ -9901,13 +10453,18 @@ snapshots: [email protected]: {} + [email protected]: + dependencies: + '@types/unist': 3.0.3 + unist-util-stringify-position: 4.0.0 + [email protected]: {} [email protected]: {} - [email protected]: + [email protected]: dependencies: - tr46: 3.0.0 + tr46: 4.1.1 webidl-conversions: 7.0.0 [email protected]: @@ -10005,3 +10562,5 @@ snapshots: lib0: 0.2.98 [email protected]: {} + + [email protected]: {} diff --git a/templates/with-payload-cloud/package.json b/templates/with-payload-cloud/package.json index de829d5ba4a..4df49c2e9e0 100644 --- a/templates/with-payload-cloud/package.json +++ b/templates/with-payload-cloud/package.json @@ -15,14 +15,14 @@ "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-mongodb": "beta", - "@payloadcms/next": "beta", - "@payloadcms/payload-cloud": "beta", - "@payloadcms/richtext-lexical": "beta", + "@payloadcms/db-mongodb": "latest", + "@payloadcms/next": "latest", + "@payloadcms/payload-cloud": "latest", + "@payloadcms/richtext-lexical": "latest", "cross-env": "^7.0.3", "graphql": "^16.8.1", "next": "15.0.0", - "payload": "beta", + "payload": "latest", "react": "19.0.0-rc-65a56d0e-20241020", "react-dom": "19.0.0-rc-65a56d0e-20241020", "sharp": "0.32.6" diff --git a/templates/with-postgres/package.json b/templates/with-postgres/package.json index dcbe60e2fc2..573a9631f4f 100644 --- a/templates/with-postgres/package.json +++ b/templates/with-postgres/package.json @@ -16,14 +16,14 @@ "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-postgres": "beta", - "@payloadcms/next": "beta", - "@payloadcms/payload-cloud": "beta", - "@payloadcms/richtext-lexical": "beta", + "@payloadcms/db-postgres": "latest", + "@payloadcms/next": "latest", + "@payloadcms/payload-cloud": "latest", + "@payloadcms/richtext-lexical": "latest", "cross-env": "^7.0.3", "graphql": "^16.8.1", "next": "15.0.0", - "payload": "beta", + "payload": "latest", "react": "19.0.0-rc-65a56d0e-20241020", "react-dom": "19.0.0-rc-65a56d0e-20241020", "sharp": "0.32.6" diff --git a/templates/with-vercel-mongodb/package.json b/templates/with-vercel-mongodb/package.json index c0a436af9fd..324a5a85efc 100644 --- a/templates/with-vercel-mongodb/package.json +++ b/templates/with-vercel-mongodb/package.json @@ -15,15 +15,15 @@ "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-mongodb": "beta", - "@payloadcms/next": "beta", - "@payloadcms/payload-cloud": "beta", - "@payloadcms/richtext-lexical": "beta", - "@payloadcms/storage-vercel-blob": "beta", + "@payloadcms/db-mongodb": "latest", + "@payloadcms/next": "latest", + "@payloadcms/payload-cloud": "latest", + "@payloadcms/richtext-lexical": "latest", + "@payloadcms/storage-vercel-blob": "latest", "cross-env": "^7.0.3", "graphql": "^16.8.1", "next": "15.0.0", - "payload": "beta", + "payload": "latest", "react": "19.0.0-rc-65a56d0e-20241020", "react-dom": "19.0.0-rc-65a56d0e-20241020" }, diff --git a/templates/with-vercel-postgres/package.json b/templates/with-vercel-postgres/package.json index 0c3ff07c02d..0379f14283b 100644 --- a/templates/with-vercel-postgres/package.json +++ b/templates/with-vercel-postgres/package.json @@ -16,15 +16,15 @@ "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-vercel-postgres": "beta", - "@payloadcms/next": "beta", - "@payloadcms/payload-cloud": "beta", - "@payloadcms/richtext-lexical": "beta", - "@payloadcms/storage-vercel-blob": "beta", + "@payloadcms/db-vercel-postgres": "latest", + "@payloadcms/next": "latest", + "@payloadcms/payload-cloud": "latest", + "@payloadcms/richtext-lexical": "latest", + "@payloadcms/storage-vercel-blob": "latest", "cross-env": "^7.0.3", "graphql": "^16.8.1", "next": "15.0.0", - "payload": "beta", + "payload": "latest", "react": "19.0.0-rc-65a56d0e-20241020", "react-dom": "19.0.0-rc-65a56d0e-20241020" }, diff --git a/templates/with-vercel-website/package.json b/templates/with-vercel-website/package.json index fcb0bb4d415..264bbfaadf1 100644 --- a/templates/with-vercel-website/package.json +++ b/templates/with-vercel-website/package.json @@ -19,18 +19,18 @@ "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-vercel-postgres": "beta", - "@payloadcms/live-preview-react": "beta", - "@payloadcms/next": "beta", - "@payloadcms/payload-cloud": "beta", - "@payloadcms/plugin-form-builder": "beta", - "@payloadcms/plugin-nested-docs": "beta", - "@payloadcms/plugin-redirects": "beta", - "@payloadcms/plugin-search": "beta", - "@payloadcms/plugin-seo": "beta", - "@payloadcms/richtext-lexical": "beta", - "@payloadcms/storage-vercel-blob": "beta", - "@payloadcms/ui": "beta", + "@payloadcms/db-vercel-postgres": "latest", + "@payloadcms/live-preview-react": "latest", + "@payloadcms/next": "latest", + "@payloadcms/payload-cloud": "latest", + "@payloadcms/plugin-form-builder": "latest", + "@payloadcms/plugin-nested-docs": "latest", + "@payloadcms/plugin-redirects": "latest", + "@payloadcms/plugin-search": "latest", + "@payloadcms/plugin-seo": "latest", + "@payloadcms/richtext-lexical": "latest", + "@payloadcms/storage-vercel-blob": "latest", + "@payloadcms/ui": "latest", "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-select": "^2.0.0", @@ -43,7 +43,7 @@ "jsonwebtoken": "9.0.2", "lucide-react": "^0.378.0", "next": "15.0.0", - "payload": "beta", + "payload": "latest", "payload-admin-bar": "^1.0.6", "prism-react-renderer": "^2.3.1", "react": "19.0.0-rc-65a56d0e-20241020",
9247d2986af1cd081f5803d9e9b40ba271459478
2021-09-23 02:11:15
James
chore(release): v0.10.4
false
v0.10.4
chore
diff --git a/CHANGELOG.md b/CHANGELOG.md index 38cf071d5f3..4946ae25fc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +## [0.10.4](https://github.com/payloadcms/payload/compare/v0.10.0...v0.10.4) (2021-09-22) + + +### Bug Fixes + +* allows image resizing if either width or height is larger ([8661115](https://github.com/payloadcms/payload/commit/866111528377808009fa71595691e6a08ec77dc5)) +* array objects now properly save IDs ([2b8f925](https://github.com/payloadcms/payload/commit/2b8f925e81c58f6aa010bf13a318236f211ea091)) +* date field error message position ([03c0435](https://github.com/payloadcms/payload/commit/03c0435e3b3ecdfa0713e3e5026b80f8985ca290)) +* properly types optional req in local findByID ([02e7fe3](https://github.com/payloadcms/payload/commit/02e7fe3f1f3763f32f100cf2e5a8596aa16f3bd9)) + + +### Features + +* adjusts empty group population to be virtual only ([8a890fd](https://github.com/payloadcms/payload/commit/8a890fdc15b646c24963a1ef7584237b1d3c5783)) +* allows local update api to replace existing files with newly uploaded ones ([dbbff4c](https://github.com/payloadcms/payload/commit/dbbff4cfa41aa20077e47c8c7b87d4d00683c571)) +* defaults empty group fields to empty object ([39a8e2c](https://github.com/payloadcms/payload/commit/39a8e2c20fa7e999c89c1ab09e886d874dbfda25)) +* defaults empty group fields to empty object ([e39ece4](https://github.com/payloadcms/payload/commit/e39ece4823c9104bd698642e42fd9d1eab67e7b3)) +* exposes Pill component for re-use ([7e8df10](https://github.com/payloadcms/payload/commit/7e8df100bbf86798de292466afd4c00c455ecb35)) +* performance improvement while saving large docs ([901ad49](https://github.com/payloadcms/payload/commit/901ad498b47bcb8ae995ade18f2fc08cd33f0645)) + ## [0.10.4-beta.0](https://github.com/payloadcms/payload/compare/v0.10.0...v0.10.4-beta.0) (2021-09-22) diff --git a/package.json b/package.json index 7c863578a63..50440da0bb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "payload", - "version": "0.10.4-beta.0", + "version": "0.10.4", "description": "Node, React and MongoDB Headless CMS and Application Framework", "license": "SEE LICENSE IN license.md", "author": {
4d1249dd03f441ee872e66437118c3e8703aaefc
2021-07-27 00:03:03
James
fix: missing richtext gutter
false
missing richtext gutter
fix
diff --git a/src/admin/components/forms/field-types/RichText/RichText.tsx b/src/admin/components/forms/field-types/RichText/RichText.tsx index e38c6da2291..cf939a8c6c6 100644 --- a/src/admin/components/forms/field-types/RichText/RichText.tsx +++ b/src/admin/components/forms/field-types/RichText/RichText.tsx @@ -177,8 +177,8 @@ const RichText: React.FC<Props> = (props) => { width, }} > - { !hideGutter && (<FieldTypeGutter />) } <div className={`${baseClass}__wrap`}> + { !hideGutter && (<FieldTypeGutter />) } <Error showError={showError} message={errorMessage}
570c610eedbc30d1ca1b10834f49fb0737be18b6
2024-11-12 05:05:51
Alessio Gravili
docs: fix queue docs examples, link to qs-esm instead of qs (#9120)
false
fix queue docs examples, link to qs-esm instead of qs (#9120)
docs
diff --git a/docs/jobs-queue/overview.mdx b/docs/jobs-queue/overview.mdx index ac57fcbb73b..7834e7f090e 100644 --- a/docs/jobs-queue/overview.mdx +++ b/docs/jobs-queue/overview.mdx @@ -166,7 +166,7 @@ If a task within a workflow fails, the Workflow will automatically "pick back up #### Defining a workflow -The most important aspect of a Workflow is the `handler`, where you can declare when and how the tasks should run by simply calling the `runTask` function. If any task within the workflow, fails, the entire `handler` function will re-run. +The most important aspect of a Workflow is the `handler`, where you can declare when and how the tasks should run by simply calling the task function, which you can find under the `tasks` object. If any task within the workflow, fails, the entire `handler` function will re-run. However, importantly, tasks that have successfully been completed will simply re-return the cached and saved output without running again. The Workflow will pick back up where it failed and only task from the failure point onward will be re-executed. @@ -204,17 +204,16 @@ export default buildConfig({ ], // The handler that defines the "control flow" of the workflow - // Notice how it calls `runTask` to execute tasks - handler: async ({ job, runTask }) => { + // Notice how it calls `tasks.[task name]` to execute tasks + handler: async ({ job, tasks }) => { // This workflow first runs a task called `createPost` - const output = await runTask({ - task: 'createPost', + // You need to pass a unique ID for this task invocation as the first argument + // that will always be the same if this workflow fails + // and is re-executed in the future. + // Do not use IDs that change between invocations, like Date.now(), Math.random() or uuid() + const output = await tasks.createPost('1',{ - // You need to define a unique ID for this task invocation - // that will always be the same if this workflow fails - // and is re-executed in the future - id: '1', input: { title: job.input.title, }, @@ -222,9 +221,7 @@ export default buildConfig({ // Once the prior task completes, it will run a task // called `updatePost` - await runTask({ - task: 'updatePost', - id: '2', + await tasks.updatePost('2', { input: { post: job.taskStatus.createPost['1'].output.postID, // or output.postID title: job.input.title + '2', @@ -241,7 +238,7 @@ export default buildConfig({ In the above example, our workflow was executing tasks that we already had defined in our Payload config. But, you can also run tasks without predefining them. -To do this, you can use the `runTaskInline` function. +To do this, you can use the `inlineTask` function. The drawbacks of this approach are that tasks cannot be re-used across workflows as easily, and the **task data stored in the job** will not be typed. In the following example, the inline task data will be stored on the job under `job.taskStatus.inline['2']` but completely untyped, as types for dynamic tasks like these cannot be generated beforehand. @@ -264,13 +261,11 @@ export default buildConfig({ required: true, }, ], - handler: async ({ job, runTask }) => { + handler: async ({ job, tasks, inlineTask }) => { // Here, we run a predefined task. // The `createPost` handler arguments and return type // are both strongly typed - const output = await runTask({ - task: 'createPost', - id: '1', + const output = await tasks.createPost('1', { input: { title: job.input.title, }, @@ -280,7 +275,7 @@ export default buildConfig({ // Here, this task is not defined in the Payload config // and is "inline". Its output will be stored on the Job in the database // however its arguments will be untyped. - const { newPost } = await runTaskInline({ + const { newPost } = await inlineTask('2', { task: async ({ req }) => { const newPost = await req.payload.update({ collection: 'post', @@ -296,8 +291,7 @@ export default buildConfig({ newPost }, } - }, - id: '2', + } }) }, } as WorkflowConfig<'updatePost'> diff --git a/docs/queries/overview.mdx b/docs/queries/overview.mdx index d8bac3363a6..23b5427d7c8 100644 --- a/docs/queries/overview.mdx +++ b/docs/queries/overview.mdx @@ -151,7 +151,7 @@ With the [REST API](../rest-api/overview), you can use the full power of Payload To understand the syntax, you need to understand that complex URL search strings are parsed into a JSON object. This one isn't too bad, but more complex queries get unavoidably more difficult to write. -For this reason, we recommend to use the extremely helpful and ubiquitous [`qs`](https://www.npmjs.com/package/qs) package to parse your JSON / object-formatted queries into query strings: +For this reason, we recommend to use the extremely helpful and ubiquitous [`qs-esm`](https://www.npmjs.com/package/qs-esm) package to parse your JSON / object-formatted queries into query strings: ```ts import { stringify } from 'qs-esm' diff --git a/docs/queries/select.mdx b/docs/queries/select.mdx index 4a90b80b9b1..99c2d8c137c 100644 --- a/docs/queries/select.mdx +++ b/docs/queries/select.mdx @@ -67,7 +67,7 @@ fetch('https://localhost:3000/api/posts?select[color]=true&select[group][number] To understand the syntax, you need to understand that complex URL search strings are parsed into a JSON object. This one isn't too bad, but more complex queries get unavoidably more difficult to write. -For this reason, we recommend to use the extremely helpful and ubiquitous [`qs`](https://www.npmjs.com/package/qs) package to parse your JSON / object-formatted queries into query strings: +For this reason, we recommend to use the extremely helpful and ubiquitous [`qs-esm`](https://www.npmjs.com/package/qs-esm) package to parse your JSON / object-formatted queries into query strings: ```ts import { stringify } from 'qs-esm'
f477a215cf4e9ccc2fa1fc79c42ee8f4c430f01b
2024-02-29 23:17:13
Jacob Fletcher
fix(next): metadata base url
false
metadata base url
fix
diff --git a/packages/next/src/utilities/meta.ts b/packages/next/src/utilities/meta.ts index 49e030d86d1..a0118c03440 100644 --- a/packages/next/src/utilities/meta.ts +++ b/packages/next/src/utilities/meta.ts @@ -25,10 +25,11 @@ export const meta = async (args: { }, ], keywords, - metadataBase: + metadataBase: new URL( config?.serverURL || - process.env.PAYLOAD_PUBLIC_SERVER_URL || - `http://localhost:${process.env.PORT || 3000}`, + process.env.PAYLOAD_PUBLIC_SERVER_URL || + `http://localhost:${process.env.PORT || 3000}`, + ), openGraph: { type: 'website', description,
3d1589404c59b5350265185c93899026dac2fe67
2024-03-26 02:23:07
Alessio Gravili
fix: race condition between form modified setter and form onSubmit. Caused e2e flakes
false
race condition between form modified setter and form onSubmit. Caused e2e flakes
fix
diff --git a/packages/ui/src/forms/useField/index.tsx b/packages/ui/src/forms/useField/index.tsx index bdb63890cb7..17103157837 100644 --- a/packages/ui/src/forms/useField/index.tsx +++ b/packages/ui/src/forms/useField/index.tsx @@ -13,7 +13,13 @@ import { useDocumentInfo } from '../../providers/DocumentInfo/index.js' import { useOperation } from '../../providers/Operation/index.js' import { useTranslation } from '../../providers/Translation/index.js' import { useFieldProps } from '../FieldPropsProvider/index.js' -import { useForm, useFormFields, useFormProcessing, useFormSubmitted } from '../Form/context.js' +import { + useForm, + useFormFields, + useFormModified, + useFormProcessing, + useFormSubmitted, +} from '../Form/context.js' /** * Get and set the value of a form field. @@ -43,6 +49,7 @@ export const useField = <T,>(options: Options): FieldType<T> => { const config = useConfig() const { getData, getDataByPath, getSiblingData, setModified } = useForm() + const modified = useFormModified() const filterOptions = field?.filterOptions const value = field?.value as T @@ -60,11 +67,26 @@ export const useField = <T,>(options: Options): FieldType<T> => { if (!disableModifyingForm) { if (typeof setModified === 'function') { - // Update modified state after field value comes back - // to avoid cursor jump caused by state value / DOM mismatch - setTimeout(() => { - setModified(true) - }, 10) + // Only update setModified to true if the form is not already set to modified. Otherwise the following could happen: + // 1. Text field: someone types in it in an unmodified form + // 2. After setTimeout triggers setModified(true): form is set to modified. Save Button becomes available. Good! + // 3. Type something in text field + // 4. Click on save button before setTimeout in useField has finished (so setModified(true) has not been run yet) + // 5. Form is saved, setModified(false) is set in the Form/index.tsx `submit` function, "saved successfully" toast appears + // 6. setModified(true) inside the timeout is run, form is set to modified again, even though it was already saved and thus set to unmodified. Bad! This should have happened before the form is saved. Now the form should be unmodified and stay that way + // until a NEW change happens. Due to this, the "Leave without saving" modal appears even though it should not when leaving the page fast immediately after saving the document. + // This is only an issue for forms which have already been set to modified true, as that causes the save button to be enabled. If we prevent this setTimeout to be run + // for already-modified forms first place (which is unnecessary), we can avoid this issue. As for unmodified forms, this race issue will not happen, because you cannot click the save button faster + // than the timeout in useField is run. That's because the save button won't even be enabled for clicking until the setTimeout in useField has run. + // This fixes e2e test flakes, as e2e tests were often so fast that they were saving the form before the timeout in useField has run. + // Specifically, this fixes the 'should not warn about unsaved changes when navigating to lexical editor with blocks node and then leaving the page after making a change and saving' lexical e2e test. + if (modified === false) { + // Update modified state after field value comes back + // to avoid cursor jump caused by state value / DOM mismatch + setTimeout(() => { + setModified(true) + }, 10) + } } } @@ -75,7 +97,7 @@ export const useField = <T,>(options: Options): FieldType<T> => { value: val, }) }, - [setModified, path, dispatchField, disableFormData, hasRows], + [setModified, path, dispatchField, disableFormData, hasRows, modified], ) // Store result from hook as ref
3e1523f0075d1c95619ca1d04e3bac2e03c419dd
2024-04-24 00:57:43
Jarrod Flesch
fix: move graphql-http from devDep to dep in next package (#5982)
false
move graphql-http from devDep to dep in next package (#5982)
fix
diff --git a/packages/next/package.json b/packages/next/package.json index 391550700c5..463905cf7a4 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -47,7 +47,6 @@ "css-loader": "^6.10.0", "css-minimizer-webpack-plugin": "^6.0.0", "file-type": "16.5.4", - "graphql-http": "^1.22.0", "mini-css-extract-plugin": "1.6.2", "payload": "workspace:*", "postcss-loader": "^8.1.1", @@ -73,6 +72,7 @@ "react-diff-viewer-continued": "3.2.6", "react-toastify": "8.2.0", "sass": "^1.71.1", + "graphql-http": "^1.22.0", "ws": "^8.16.0" }, "peerDependencies": {
7f5aaad6a5ac104d436331793c67410e0f370afd
2025-02-19 08:13:20
Alessio Gravili
fix(ui): do not pass req in handleFormStateLocking (#11269)
false
do not pass req in handleFormStateLocking (#11269)
fix
diff --git a/packages/ui/src/utilities/handleFormStateLocking.ts b/packages/ui/src/utilities/handleFormStateLocking.ts index 43a2ef1c7e9..23765cc6656 100644 --- a/packages/ui/src/utilities/handleFormStateLocking.ts +++ b/packages/ui/src/utilities/handleFormStateLocking.ts @@ -64,7 +64,7 @@ export const handleFormStateLocking = async ({ limit: 1, overrideAccess: false, pagination: false, - req, + user: req.user, where: lockedDocumentQuery, }) @@ -85,7 +85,6 @@ export const handleFormStateLocking = async ({ id: lockedDocument.docs[0].id, collection: 'payload-locked-documents', data: {}, - req, }) } } else { @@ -119,7 +118,6 @@ export const handleFormStateLocking = async ({ await req.payload.db.deleteMany({ collection: 'payload-locked-documents', - req, where: deleteExpiredLocksQuery, }) @@ -138,7 +136,6 @@ export const handleFormStateLocking = async ({ value: req.user.id, }, }, - req, }) result = {
aaf3a39f7e600c46625946404f4acd80df1b3ff5
2024-07-30 20:39:28
Alessio Gravili
chore: upgrade typescript from 5.5.3 to 5.5.4 (#7435)
false
upgrade typescript from 5.5.3 to 5.5.4 (#7435)
chore
diff --git a/package.json b/package.json index e23f248004c..13a01d75d9f 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,7 @@ "tempy": "1.0.1", "tsx": "4.16.2", "turbo": "^1.13.3", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "peerDependencies": { "react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610", diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 4468a23efeb..01d83a66c99 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -33,7 +33,7 @@ "eslint-plugin-react-hooks": "5.1.0-rc-85acf2d195-20240711", "eslint-plugin-regexp": "2.6.0", "globals": "15.8.0", - "typescript": "5.5.3", + "typescript": "5.5.4", "typescript-eslint": "7.16.0" } } diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index fab59b4a647..9922aee88f7 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -32,7 +32,7 @@ "eslint-plugin-react-hooks": "5.1.0-rc-85acf2d195-20240711", "eslint-plugin-regexp": "2.6.0", "globals": "15.8.0", - "typescript": "5.5.3", + "typescript": "5.5.4", "typescript-eslint": "7.16.0" } } diff --git a/packages/translations/package.json b/packages/translations/package.json index 119c2338073..e6fb556e9d4 100644 --- a/packages/translations/package.json +++ b/packages/translations/package.json @@ -52,7 +52,7 @@ "@types/react-dom": "npm:[email protected]", "dotenv": "16.4.5", "prettier": "3.3.2", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "publishConfig": { "exports": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a2b6db1354..a2180c5f7c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,7 +15,7 @@ overrides: mongodb-memory-server: ^9.0 react: ^19.0.0-rc-6230622a1a-20240610 react-dom: ^19.0.0-rc-6230622a1a-20240610 - typescript: 5.5.3 + typescript: 5.5.4 patchedDependencies: [email protected]: @@ -195,8 +195,8 @@ importers: specifier: ^1.13.3 version: 1.13.4 typescript: - specifier: 5.5.3 - version: 5.5.3 + specifier: 5.5.4 + version: 5.5.4 packages/create-payload-app: dependencies: @@ -442,7 +442,7 @@ importers: dependencies: '@eslint-react/eslint-plugin': specifier: 1.5.25-next.4 - version: 1.5.25-next.4([email protected])([email protected]) + version: 1.5.25-next.4([email protected])([email protected]) '@eslint/js': specifier: 9.6.0 version: 9.6.0 @@ -457,7 +457,7 @@ importers: version: 8.42.3 '@typescript-eslint/parser': specifier: 7.16.0 - version: 7.16.0([email protected])([email protected]) + version: 7.16.0([email protected])([email protected]) eslint: specifier: 9.6.0 version: 9.6.0 @@ -466,10 +466,10 @@ importers: version: 9.1.0([email protected]) eslint-plugin-import-x: specifier: 3.0.0 - version: 3.0.0([email protected])([email protected]) + version: 3.0.0([email protected])([email protected]) eslint-plugin-jest: specifier: 28.6.0 - version: 28.6.0([email protected])([email protected])([email protected]) + version: 28.6.0([email protected])([email protected])([email protected]) eslint-plugin-jest-dom: specifier: 5.4.0 version: 5.4.0([email protected]) @@ -478,7 +478,7 @@ importers: version: 6.9.0([email protected]) eslint-plugin-perfectionist: specifier: 2.11.0 - version: 2.11.0([email protected])([email protected]) + version: 2.11.0([email protected])([email protected]) eslint-plugin-react-hooks: specifier: 5.1.0-rc-85acf2d195-20240711 version: 5.1.0-rc-85acf2d195-20240711([email protected]) @@ -489,17 +489,17 @@ importers: specifier: 15.8.0 version: 15.8.0 typescript: - specifier: 5.5.3 - version: 5.5.3 + specifier: 5.5.4 + version: 5.5.4 typescript-eslint: specifier: 7.16.0 - version: 7.16.0([email protected])([email protected]) + version: 7.16.0([email protected])([email protected]) packages/eslint-plugin: dependencies: '@eslint-react/eslint-plugin': specifier: 1.5.25-next.4 - version: 1.5.25-next.4([email protected])([email protected]) + version: 1.5.25-next.4([email protected])([email protected]) '@eslint/js': specifier: 9.6.0 version: 9.6.0 @@ -511,7 +511,7 @@ importers: version: 8.42.3 '@typescript-eslint/parser': specifier: 7.16.0 - version: 7.16.0([email protected])([email protected]) + version: 7.16.0([email protected])([email protected]) eslint: specifier: 9.6.0 version: 9.6.0 @@ -520,10 +520,10 @@ importers: version: 9.1.0([email protected]) eslint-plugin-import-x: specifier: 3.0.0 - version: 3.0.0([email protected])([email protected]) + version: 3.0.0([email protected])([email protected]) eslint-plugin-jest: specifier: 28.6.0 - version: 28.6.0([email protected])([email protected])([email protected]) + version: 28.6.0([email protected])([email protected])([email protected]) eslint-plugin-jest-dom: specifier: 5.4.0 version: 5.4.0([email protected]) @@ -532,7 +532,7 @@ importers: version: 6.9.0([email protected]) eslint-plugin-perfectionist: specifier: 2.11.0 - version: 2.11.0([email protected])([email protected]) + version: 2.11.0([email protected])([email protected]) eslint-plugin-react-hooks: specifier: 5.1.0-rc-85acf2d195-20240711 version: 5.1.0-rc-85acf2d195-20240711([email protected]) @@ -543,11 +543,11 @@ importers: specifier: 15.8.0 version: 15.8.0 typescript: - specifier: 5.5.3 - version: 5.5.3 + specifier: 5.5.4 + version: 5.5.4 typescript-eslint: specifier: 7.16.0 - version: 7.16.0([email protected])([email protected]) + version: 7.16.0([email protected])([email protected]) packages/graphql: dependencies: @@ -562,7 +562,7 @@ importers: version: 8.0.0 ts-essentials: specifier: 7.0.3 - version: 7.0.3([email protected]) + version: 7.0.3([email protected]) devDependencies: '@payloadcms/eslint-config': specifier: workspace:* @@ -625,7 +625,7 @@ importers: version: link:../payload vue: specifier: ^3.0.0 - version: 3.4.31([email protected]) + version: 3.4.31([email protected]) packages/next: dependencies: @@ -800,7 +800,7 @@ importers: version: 2.1.0 ts-essentials: specifier: 7.0.3 - version: 7.0.3([email protected]) + version: 7.0.3([email protected]) uuid: specifier: 10.0.0 version: 10.0.0 @@ -895,7 +895,7 @@ importers: version: link:../payload ts-jest: specifier: ^29.1.0 - version: 29.2.2(@babel/[email protected])([email protected])([email protected]) + version: 29.2.2(@babel/[email protected])([email protected])([email protected]) packages/plugin-cloud-storage: dependencies: @@ -1092,7 +1092,7 @@ importers: version: link:../payload ts-jest: specifier: ^29.1.0 - version: 29.2.2(@babel/[email protected])([email protected])([email protected]) + version: 29.2.2(@babel/[email protected])([email protected])([email protected]) packages/plugin-seo: dependencies: @@ -1419,8 +1419,8 @@ importers: specifier: 3.3.2 version: 3.3.2 typescript: - specifier: 5.5.3 - version: 5.5.3 + specifier: 5.5.4 + version: 5.5.4 packages/ui: dependencies: @@ -1690,8 +1690,8 @@ importers: specifier: 4.0.0 version: 4.0.0 lexical: - specifier: 0.15.0 - version: 0.15.0 + specifier: 0.16.1 + version: 0.16.1 payload: specifier: workspace:* version: link:../packages/payload @@ -1709,10 +1709,10 @@ importers: version: 1.0.1 ts-essentials: specifier: 7.0.3 - version: 7.0.3([email protected]) + version: 7.0.3([email protected]) typescript: - specifier: 5.5.3 - version: 5.5.3 + specifier: 5.5.4 + version: 5.5.4 uploadthing: specifier: ^6.10.1 version: 6.13.2([email protected]) @@ -4967,88 +4967,88 @@ packages: resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - /@eslint-react/[email protected]([email protected])([email protected]): + /@eslint-react/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-9VKkiR/p3O2+BZpzh5OX1qodH+gZ9HSbdcQYmGaXAy1CPVByBX925cE/BQu2qjkclDklKvx6322ASuyPwlejnw==} dependencies: '@eslint-community/eslint-utils': 4.4.0([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) transitivePeerDependencies: - eslint - supports-color - typescript dev: false - /@eslint-react/[email protected]([email protected])([email protected]): + /@eslint-react/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-dtdQiQyFEyE37qmf42Q9Ltw6v1k8mrxgana56LQQJzJuyWpM7hjgFJvSMWJB4AewHyuTADLj4OHkRpfc/WTtig==} dependencies: - '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) transitivePeerDependencies: - eslint - supports-color - typescript dev: false - /@eslint-react/[email protected]([email protected])([email protected]): + /@eslint-react/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-BNftQDh68rRotygErpZ4EIjPx+UNRICzlHdAYw1kmXE2YTBvzbkZIY0kUQtePRgaa3esvTohk0J3HjRpOFQ31g==} engines: {bun: '>=1.0.15', node: '>=18.18.0'} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.5.3 + typescript: 5.5.4 peerDependenciesMeta: typescript: optional: true dependencies: - '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 - eslint-plugin-react-debug: 1.5.25-next.4([email protected])([email protected]) - eslint-plugin-react-dom: 1.5.25-next.4([email protected])([email protected]) - eslint-plugin-react-hooks-extra: 1.5.25-next.4([email protected])([email protected]) - eslint-plugin-react-naming-convention: 1.5.25-next.4([email protected])([email protected]) - eslint-plugin-react-x: 1.5.25-next.4([email protected])([email protected]) - typescript: 5.5.3 + eslint-plugin-react-debug: 1.5.25-next.4([email protected])([email protected]) + eslint-plugin-react-dom: 1.5.25-next.4([email protected])([email protected]) + eslint-plugin-react-hooks-extra: 1.5.25-next.4([email protected])([email protected]) + eslint-plugin-react-naming-convention: 1.5.25-next.4([email protected])([email protected]) + eslint-plugin-react-x: 1.5.25-next.4([email protected])([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false - /@eslint-react/[email protected]([email protected])([email protected]): + /@eslint-react/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-BpiL8C4YKBhOqwG2TkNT8H8wvC+rWY2jZSOb5ykrhG05fXufIpiNR3iG/XyQxuVn0oC9iWVVoJ3K3qiqlPDOcg==} dependencies: - '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) transitivePeerDependencies: - eslint - supports-color - typescript dev: false - /@eslint-react/[email protected]([email protected])([email protected]): + /@eslint-react/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-2QeA5AuM7HVmZ1Zd5QP8idrNcv5a+dcgT43CFuNFkpMBXlcYluiE/kb/m8YXCkFavCWsAV1df8QEvh9XHD3FdQ==} dependencies: - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) valibot: 0.36.0 transitivePeerDependencies: - eslint @@ -5060,27 +5060,27 @@ packages: resolution: {integrity: sha512-jFwkbc7p6OEoLLWUIUcUJuLxZJuZSpGeoa4TWaukePhyupkrke8x92Nf7+9HM4vms7c/u8FEir4sTLXMskACLA==} dev: false - /@eslint-react/[email protected]([email protected])([email protected]): + /@eslint-react/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-XwIs8nfGg3MoohJmw9+TM0DXHNVMhufmqc9YsLgPcbZ3DNBkTiuEbdoZlMbhvzYyxcIy2ocVqc+gIu03xlN8dw==} dependencies: '@eslint-react/tools': 1.5.25-next.4 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) transitivePeerDependencies: - eslint - supports-color - typescript dev: false - /@eslint-react/[email protected]([email protected])([email protected]): + /@eslint-react/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-n7ZqKf7a0msz2xrqhncA4l+YVw+eF6Uk5PaCYnJVy7dRE8lWDHGL6U/wvVfm/Hyllh6tjUORRR7SV5yURXGoHw==} dependencies: - '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) transitivePeerDependencies: - eslint - supports-color @@ -7306,7 +7306,7 @@ packages: dependencies: '@types/yargs-parser': 21.0.3 - /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): + /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -7318,22 +7318,22 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) + '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) '@typescript-eslint/visitor-keys': 7.16.0 eslint: 9.6.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-ar9E+k7CU8rWi2e5ErzQiC93KKEFAXA2Kky0scAlPcxYblLt8+XZuHUZwlyfXILyQa95P6lQg+eZgh/dDs3+Vw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -7345,11 +7345,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 7.16.0 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/typescript-estree': 7.16.0([email protected]) + '@typescript-eslint/typescript-estree': 7.16.0([email protected]) '@typescript-eslint/visitor-keys': 7.16.0 debug: 4.3.5([email protected]) eslint: 9.6.0 - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false @@ -7362,7 +7362,7 @@ packages: '@typescript-eslint/visitor-keys': 7.16.0 dev: false - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -7372,12 +7372,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.16.0([email protected]) - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/typescript-estree': 7.16.0([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) debug: 4.3.5([email protected]) eslint: 9.6.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false @@ -7387,7 +7387,7 @@ packages: engines: {node: ^18.18.0 || >=20.0.0} dev: false - /@typescript-eslint/[email protected]([email protected]): + /@typescript-eslint/[email protected]([email protected]): resolution: {integrity: sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -7403,13 +7403,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.2 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -7418,7 +7418,7 @@ packages: '@eslint-community/eslint-utils': 4.4.0([email protected]) '@typescript-eslint/scope-manager': 7.16.0 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/typescript-estree': 7.16.0([email protected]) + '@typescript-eslint/typescript-estree': 7.16.0([email protected]) eslint: 9.6.0 transitivePeerDependencies: - supports-color @@ -7519,7 +7519,7 @@ packages: dependencies: '@vue/compiler-ssr': 3.4.31 '@vue/shared': 3.4.31 - vue: 3.4.31([email protected]) + vue: 3.4.31([email protected]) dev: true /@vue/[email protected]: @@ -9648,13 +9648,13 @@ packages: - supports-color dev: false - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-zk3QklFELk7mrSlhP9C27NpKx86G5YtIEvDV1dIJRS3VOIm5tCHQCln2JkwbO5lpYOvyYSoro35PCAAVG9lY8w==} engines: {node: '>=16'} peerDependencies: eslint: ^8.56.0 || ^9.0.0-0 dependencies: - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) debug: 4.3.5([email protected]) doctrine: 3.0.0 eslint: 9.6.0 @@ -9685,7 +9685,7 @@ packages: requireindex: 1.2.0 dev: false - /[email protected]([email protected])([email protected])([email protected]): + /[email protected]([email protected])([email protected])([email protected]): resolution: {integrity: sha512-YG28E1/MIKwnz+e2H7VwYPzHUYU4aMa19w0yGcwXnnmJH6EfgHahTJ2un3IyraUxNfnz/KUhJAFXNNwWPo12tg==} engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} peerDependencies: @@ -9698,7 +9698,7 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 jest: 29.7.0(@types/[email protected]) transitivePeerDependencies: @@ -9731,7 +9731,7 @@ packages: string.prototype.includes: 2.0.0 dev: false - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-XrtBtiu5rbQv88gl+1e2RQud9te9luYNvKIgM9emttQ2zutHPzY/AQUucwxscDKV4qlTkvLTxjOFvxqeDpPorw==} peerDependencies: astro-eslint-parser: ^1.0.2 @@ -9749,7 +9749,7 @@ packages: vue-eslint-parser: optional: true dependencies: - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 minimatch: 9.0.5 natural-compare-lite: 1.4.0 @@ -9772,82 +9772,82 @@ packages: globals: 13.24.0 dev: true - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-xdv36T0Fyh1mlLrE8k+Mw+6wq/YTowuI45lGqKySKQEuQ1IhNu/LmBpf9K/OW9FU7tOPaTvK4RYl+QBT0zuJHg==} engines: {bun: '>=1.0.15', node: '>=18.18.0'} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.5.3 + typescript: 5.5.4 peerDependenciesMeta: typescript: optional: true dependencies: - '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 string-ts: 2.2.0 - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-Lejg6y1YUPHTD1v4uag/n+iaHCeKSmATgTDT/EE4X0mmfSskh4a6hr2zYQdI57kMO6baWJ20l4nenipRwt+aLQ==} engines: {bun: '>=1.0.15', node: '>=18.18.0'} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.5.3 + typescript: 5.5.4 peerDependenciesMeta: typescript: optional: true dependencies: - '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-HTS/MYSR/XXyqTamZQ2X/qUtmNctUhP0FeNrCW35scHGV2wB9FmlESo3YKmF50nYrJEJU/IMnhVlbzVAuK5R/Q==} engines: {bun: '>=1.0.15', node: '>=18.18.0'} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.5.3 + typescript: 5.5.4 peerDependenciesMeta: typescript: optional: true dependencies: - '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false @@ -9861,56 +9861,56 @@ packages: eslint: 9.6.0 dev: false - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-3NSX/dPftjAw8Y/j6udilCgkV8caKlwIG0VIJzMytGVs/7rfsnG4sx0i0eKH/GL83oQtbGEg8dvDeIfTEnEMDA==} engines: {bun: '>=1.0.15', node: '>=18.18.0'} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.5.3 + typescript: 5.5.4 peerDependenciesMeta: typescript: optional: true dependencies: - '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-sQl/YScM/xOwawSmWzKKOHuhq3qHQoDCIO04wflHZ0s0ullVwIYEJfI8j/RSjy3l6TUh5IeAttsiEUFXob7LmA==} engines: {bun: '>=1.0.15', node: '>=18.18.0'} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: 5.5.3 + typescript: 5.5.4 peerDependenciesMeta: typescript: optional: true dependencies: - '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/ast': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/core': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/jsx': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/shared': 1.5.25-next.4([email protected])([email protected]) '@eslint-react/tools': 1.5.25-next.4 - '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) - '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/types': 1.5.25-next.4([email protected])([email protected]) + '@eslint-react/var': 1.5.25-next.4([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 - is-immutable-type: 4.0.0([email protected])([email protected]) - typescript: 5.5.3 + is-immutable-type: 4.0.0([email protected])([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false @@ -11366,17 +11366,17 @@ packages: resolution: {integrity: sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==} dev: false - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-gyFBCXv+NikTs8/PGZhgjbMmFZQ5jvHGZIsVu6+/9Bk4K7imlWBIDN7hTr9fNioGzFg71I4YM3z8f0aKXarTAw==} peerDependencies: eslint: '*' - typescript: 5.5.3 + typescript: 5.5.4 dependencies: - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 - ts-api-utils: 1.3.0([email protected]) - ts-declaration-location: 1.0.2([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + ts-declaration-location: 1.0.2([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false @@ -12349,10 +12349,6 @@ packages: prelude-ls: 1.2.1 type-check: 0.4.0 - /[email protected]: - resolution: {integrity: sha512-/7HrPAmtgsc1F+qpv5bFwoQZ6CbH/w3mPPL2AW5P75/QYrqKz4bhvJrc2jozIX0GxtuT/YUYT7w+1sZMtUWbOg==} - dev: true - /[email protected]: resolution: {integrity: sha512-+R05d3+N945OY8pTUjTqQrWoApjC+ctzvjnmNETtx9WmVAaiW0tQVG+AYLt5pDGY8dQXtd4RPorvnxBTECt9SA==} @@ -15586,32 +15582,32 @@ packages: utf8-byte-length: 1.0.5 dev: false - /[email protected]([email protected]): + /[email protected]([email protected]): resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} peerDependencies: - typescript: 5.5.3 + typescript: 5.5.4 dependencies: - typescript: 5.5.3 + typescript: 5.5.4 dev: false - /[email protected]([email protected]): + /[email protected]([email protected]): resolution: {integrity: sha512-F7+4QiD/WguzLqviTNu+4tgR5SJtW4orC9RDCYzkwbeyHNq7hfGpq4Y8odaf0w9Z6orH+y98jgUdVaUFOPNRhg==} peerDependencies: - typescript: 5.5.3 + typescript: 5.5.4 dependencies: minimatch: 9.0.5 - typescript: 5.5.3 + typescript: 5.5.4 dev: false - /[email protected]([email protected]): + /[email protected]([email protected]): resolution: {integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==} peerDependencies: - typescript: 5.5.3 + typescript: 5.5.4 dependencies: - typescript: 5.5.3 + typescript: 5.5.4 - /[email protected](@babel/[email protected])([email protected])([email protected]): + /[email protected](@babel/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-sSW7OooaKT34AAngP6k1VS669a0HdLxkQZnlC7T76sckGCokXFnvJ3yRlQZGRTAoV5K19HfSgCiSwWOSIfcYlg==} engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} hasBin: true @@ -15622,7 +15618,7 @@ packages: babel-jest: ^29.0.0 esbuild: '*' jest: ^29.0.0 - typescript: 5.5.3 + typescript: 5.5.4 peerDependenciesMeta: '@babel/core': optional: true @@ -15645,7 +15641,7 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.6.2 - typescript: 5.5.3 + typescript: 5.5.4 yargs-parser: 21.1.1 dev: true @@ -15829,7 +15825,7 @@ packages: dependencies: csstype: 3.1.3 - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-kaVRivQjOzuoCXU6+hLnjo3/baxyzWVO5GrnExkFzETRYJKVHYkrJglOu2OCm8Hi9RPDWX1PTNNTpU5KRV0+RA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -15839,17 +15835,17 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 7.16.0(@typescript-eslint/[email protected])([email protected])([email protected]) - '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/eslint-plugin': 7.16.0(@typescript-eslint/[email protected])([email protected])([email protected]) + '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) eslint: 9.6.0 - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: false - /[email protected]: - resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} + /[email protected]: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} hasBin: true @@ -16063,10 +16059,10 @@ packages: engines: {node: '>= 0.8'} dev: false - /[email protected]([email protected]): + /[email protected]([email protected]): resolution: {integrity: sha512-njqRrOy7W3YLAlVqSKpBebtZpDVg21FPoaq1I7f/+qqBThK9ChAIjkRWgeP6Eat+8C+iia4P3OYqpATP21BCoQ==} peerDependencies: - typescript: 5.5.3 + typescript: 5.5.4 peerDependenciesMeta: typescript: optional: true @@ -16076,7 +16072,7 @@ packages: '@vue/runtime-dom': 3.4.31 '@vue/server-renderer': 3.4.31([email protected]) '@vue/shared': 3.4.31 - typescript: 5.5.3 + typescript: 5.5.4 dev: true /[email protected]: diff --git a/templates/_template/package.json b/templates/_template/package.json index 13a42885965..9b0f8946d8e 100644 --- a/templates/_template/package.json +++ b/templates/_template/package.json @@ -32,7 +32,7 @@ "@types/react-dom": "npm:[email protected]", "eslint": "^8", "eslint-config-next": "15.0.0-canary.53", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "engines": { "node": "^18.20.2 || >=20.9.0" diff --git a/templates/blank-3.0/package.json b/templates/blank-3.0/package.json index 9095fa3a9ab..2dbe1b34438 100644 --- a/templates/blank-3.0/package.json +++ b/templates/blank-3.0/package.json @@ -32,7 +32,7 @@ "@types/react-dom": "npm:[email protected]", "eslint": "^8", "eslint-config-next": "15.0.0-canary.53", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "engines": { "node": "^18.20.2 || >=20.9.0" diff --git a/templates/blank/package.json b/templates/blank/package.json index 327f37a5b6c..42b1455bf83 100644 --- a/templates/blank/package.json +++ b/templates/blank/package.json @@ -32,7 +32,7 @@ "@types/react-dom": "npm:[email protected]", "eslint": "^8", "eslint-config-next": "15.0.0-canary.53", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "engines": { "node": "^18.20.2 || >=20.9.0" diff --git a/templates/vercel-postgres/package.json b/templates/vercel-postgres/package.json index 4c1becbc35c..d6a314a5af2 100644 --- a/templates/vercel-postgres/package.json +++ b/templates/vercel-postgres/package.json @@ -33,7 +33,7 @@ "eslint-config-next": "15.0.0-canary.53", "postcss": "^8", "tailwindcss": "^3.3.0", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "engines": { "node": "^18.20.2 || >=20.9.0" diff --git a/templates/website/package.json b/templates/website/package.json index c149c6aa8ee..89d896d784e 100644 --- a/templates/website/package.json +++ b/templates/website/package.json @@ -65,7 +65,7 @@ "postcss": "^8.4.38", "prettier": "^3.0.3", "tailwindcss": "^3.4.3", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "engines": { "node": "^18.20.2 || >=20.9.0" diff --git a/templates/website/pnpm-lock.yaml b/templates/website/pnpm-lock.yaml index 5f25fc831ed..1f852a0ba95 100644 --- a/templates/website/pnpm-lock.yaml +++ b/templates/website/pnpm-lock.yaml @@ -17,7 +17,7 @@ dependencies: version: 3.0.0-beta.67([email protected])([email protected]) '@payloadcms/next': specifier: 3.0.0-beta.67 - version: 3.0.0-beta.67([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) + version: 3.0.0-beta.67([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) '@payloadcms/plugin-cloud': specifier: 3.0.0-beta.67 version: 3.0.0-beta.67(@aws-sdk/[email protected])([email protected]) @@ -80,7 +80,7 @@ dependencies: version: 15.0.0-canary.58([email protected])([email protected]) payload: specifier: 3.0.0-beta.67 - version: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + version: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) payload-admin-bar: specifier: ^1.0.6 version: 1.0.6([email protected])([email protected]) @@ -112,7 +112,7 @@ devDependencies: version: 13.5.6 '@payloadcms/eslint-config': specifier: ^1.1.1 - version: 1.1.1([email protected]) + version: 1.1.1([email protected]) '@tailwindcss/typography': specifier: ^0.5.13 version: 0.5.13([email protected]) @@ -139,7 +139,7 @@ devDependencies: version: 8.57.0 eslint-config-next: specifier: 15.0.0-canary.58 - version: 15.0.0-canary.58([email protected])([email protected]) + version: 15.0.0-canary.58([email protected])([email protected]) postcss: specifier: ^8.4.38 version: 8.4.39 @@ -150,8 +150,8 @@ devDependencies: specifier: ^3.4.3 version: 3.4.4 typescript: - specifier: 5.5.3 - version: 5.5.3 + specifier: 5.5.4 + version: 5.5.4 packages: @@ -1947,7 +1947,7 @@ packages: http-status: 1.6.2 mongoose: 6.12.3(@aws-sdk/[email protected]) mongoose-paginate-v2: 1.7.22 - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) prompts: 2.4.2 uuid: 10.0.0 transitivePeerDependencies: @@ -1963,23 +1963,23 @@ packages: payload: 3.0.0-beta.67 dependencies: nodemailer: 6.9.10 - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) dev: false - /@payloadcms/[email protected]([email protected]): + /@payloadcms/[email protected]([email protected]): resolution: {integrity: sha512-LSf9oEPb6aMEMqdTFqj1v+7p/bdrJWG6hp7748xjVO3RL3yQESTKLK/NbjsMYITN4tKFXjfPWDUtcwHv0hS6/A==} dependencies: '@types/eslint': 8.44.2 - '@typescript-eslint/eslint-plugin': 6.6.0(@typescript-eslint/[email protected])([email protected])([email protected]) - '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) + '@typescript-eslint/eslint-plugin': 6.6.0(@typescript-eslint/[email protected])([email protected])([email protected]) + '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) eslint: 8.48.0 eslint-config-prettier: 9.0.0([email protected]) eslint-plugin-import: 2.28.1(@typescript-eslint/[email protected])([email protected]) - eslint-plugin-jest: 27.2.3(@typescript-eslint/[email protected])([email protected])([email protected]) + eslint-plugin-jest: 27.2.3(@typescript-eslint/[email protected])([email protected])([email protected]) eslint-plugin-jest-dom: 5.1.0([email protected]) eslint-plugin-jsx-a11y: 6.7.1([email protected]) eslint-plugin-node: 11.1.0([email protected]) - eslint-plugin-perfectionist: 2.0.0([email protected])([email protected]) + eslint-plugin-perfectionist: 2.0.0([email protected])([email protected]) eslint-plugin-playwright: 0.16.0([email protected])([email protected]) eslint-plugin-react: 7.33.2([email protected]) eslint-plugin-react-hooks: 4.6.0([email protected]) @@ -1997,7 +1997,7 @@ packages: - vue-eslint-parser dev: true - /@payloadcms/[email protected]([email protected])([email protected])([email protected]): + /@payloadcms/[email protected]([email protected])([email protected])([email protected]): resolution: {integrity: sha512-gvLd16Ndi2gLCA+Nt3RbkUJH2YdirloeHUzfvldTH7teeslsgYxxzAHopsKiHrQBB565+Q7aWBI2vrS01XF7SA==} hasBin: true peerDependencies: @@ -2006,9 +2006,9 @@ packages: dependencies: graphql: 16.9.0 graphql-scalars: 1.22.2([email protected]) - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) pluralize: 8.0.0 - ts-essentials: 7.0.3([email protected]) + ts-essentials: 7.0.3([email protected]) transitivePeerDependencies: - typescript dev: false @@ -2028,7 +2028,7 @@ packages: resolution: {integrity: sha512-fq/ntibiaP7kRAIuHgSoOSm/+3DD3MHQStlppPzRLyD3kvmizKtH71ngBZRx9wyg2aH2lqkTLDWLswyHp8KHzQ==} dev: false - /@payloadcms/[email protected]([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]): + /@payloadcms/[email protected]([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]): resolution: {integrity: sha512-rmR8hX+W6ZNsFD7QxUXoV/6Yq71oDNZVy0GX4PHBXvw/C2EPeTRCuopBsRFPp8PyvooLt7l3WUskIEmfkMdnGw==} engines: {node: ^18.20.2 || >=20.9.0} peerDependencies: @@ -2037,7 +2037,7 @@ packages: payload: 3.0.0-beta.67 dependencies: '@dnd-kit/core': 6.0.8([email protected])([email protected]) - '@payloadcms/graphql': 3.0.0-beta.67([email protected])([email protected])([email protected]) + '@payloadcms/graphql': 3.0.0-beta.67([email protected])([email protected])([email protected]) '@payloadcms/translations': 3.0.0-beta.67 '@payloadcms/ui': 3.0.0-beta.67([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) busboy: 1.6.0 @@ -2048,7 +2048,7 @@ packages: http-status: 1.6.2 next: 15.0.0-canary.58([email protected])([email protected]) path-to-regexp: 6.2.2 - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) qs-esm: 7.0.2 react-diff-viewer-continued: 3.2.6([email protected])([email protected]) sass: 1.77.4 @@ -2078,7 +2078,7 @@ packages: '@payloadcms/email-nodemailer': 3.0.0-beta.67([email protected]) amazon-cognito-identity-js: 6.3.12 nodemailer: 6.9.10 - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) resend: 0.17.2 transitivePeerDependencies: - '@aws-sdk/client-sso-oidc' @@ -2097,7 +2097,7 @@ packages: '@payloadcms/ui': 3.0.0-beta.67([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) deepmerge: 4.3.1 escape-html: 1.0.3 - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) react: 19.0.0-rc-6230622a1a-20240610 react-dom: 19.0.0-rc-6230622a1a-20240610([email protected]) transitivePeerDependencies: @@ -2112,7 +2112,7 @@ packages: peerDependencies: payload: 3.0.0-beta.67 dependencies: - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) dev: false /@payloadcms/[email protected]([email protected]): @@ -2120,7 +2120,7 @@ packages: peerDependencies: payload: 3.0.0-beta.67 dependencies: - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) dev: false /@payloadcms/[email protected](@payloadcms/[email protected])(@payloadcms/[email protected])([email protected])([email protected])([email protected]): @@ -2134,7 +2134,7 @@ packages: dependencies: '@payloadcms/translations': 3.0.0-beta.67 '@payloadcms/ui': 3.0.0-beta.67([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) react: 19.0.0-rc-6230622a1a-20240610 react-dom: 19.0.0-rc-6230622a1a-20240610([email protected]) dev: false @@ -2175,14 +2175,14 @@ packages: '@lexical/selection': 0.16.1 '@lexical/table': 0.16.1 '@lexical/utils': 0.16.1 - '@payloadcms/next': 3.0.0-beta.67([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) + '@payloadcms/next': 3.0.0-beta.67([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) '@payloadcms/translations': 3.0.0-beta.67 '@payloadcms/ui': 3.0.0-beta.67([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) '@types/uuid': 10.0.0 bson-objectid: 2.0.4 dequal: 2.0.3 lexical: 0.16.1 - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) react: 19.0.0-rc-6230622a1a-20240610 react-dom: 19.0.0-rc-6230622a1a-20240610([email protected]) react-error-boundary: 4.0.13([email protected]) @@ -2218,7 +2218,7 @@ packages: md5: 2.3.0 next: 15.0.0-canary.58([email protected])([email protected]) object-to-formdata: 4.5.1 - payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.0.0-beta.67(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) qs-esm: 7.0.2 react: 19.0.0-rc-6230622a1a-20240610 react-animate-height: 2.1.2([email protected])([email protected]) @@ -3471,7 +3471,7 @@ packages: '@types/webidl-conversions': 7.0.3 dev: false - /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): + /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3483,10 +3483,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) + '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) '@typescript-eslint/scope-manager': 6.6.0 - '@typescript-eslint/type-utils': 6.6.0([email protected])([email protected]) - '@typescript-eslint/utils': 6.6.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 6.6.0([email protected])([email protected]) + '@typescript-eslint/utils': 6.6.0([email protected])([email protected]) '@typescript-eslint/visitor-keys': 6.6.0 debug: 4.3.5 eslint: 8.48.0 @@ -3494,13 +3494,13 @@ packages: ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.2 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): + /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-py1miT6iQpJcs1BiJjm54AMzeuMPBSPuKPlnT8HlfudbcS5rYeX5jajpLf3mrdRh9dA/Ec2FVUY0ifeVNDIhZw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -3512,22 +3512,22 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) + '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) '@typescript-eslint/scope-manager': 7.16.0 - '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) '@typescript-eslint/visitor-keys': 7.16.0 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-setq5aJgUwtzGrhW177/i+DMLqBaJbdwGj2CPIVFFLE0NCliy5ujIdLHd2D1ysmlmsjdL2GWW+hR85neEfc12w==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3539,16 +3539,16 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.6.0 '@typescript-eslint/types': 6.6.0 - '@typescript-eslint/typescript-estree': 6.6.0([email protected]) + '@typescript-eslint/typescript-estree': 6.6.0([email protected]) '@typescript-eslint/visitor-keys': 6.6.0 debug: 4.3.5 eslint: 8.48.0 - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-ar9E+k7CU8rWi2e5ErzQiC93KKEFAXA2Kky0scAlPcxYblLt8+XZuHUZwlyfXILyQa95P6lQg+eZgh/dDs3+Vw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -3560,11 +3560,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 7.16.0 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/typescript-estree': 7.16.0([email protected]) + '@typescript-eslint/typescript-estree': 7.16.0([email protected]) '@typescript-eslint/visitor-keys': 7.16.0 debug: 4.3.5 eslint: 8.57.0 - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true @@ -3601,7 +3601,7 @@ packages: '@typescript-eslint/visitor-keys': 7.16.0 dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-8m16fwAcEnQc69IpeDyokNO+D5spo0w1jepWWY2Q6y5ZKNuj5EhVQXjtVAeDDqvW6Yg7dhclbsz6rTtOvcwpHg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3611,17 +3611,17 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.6.0([email protected]) - '@typescript-eslint/utils': 6.6.0([email protected])([email protected]) + '@typescript-eslint/typescript-estree': 6.6.0([email protected]) + '@typescript-eslint/utils': 6.6.0([email protected])([email protected]) debug: 4.3.5 eslint: 8.48.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-j0fuUswUjDHfqV/UdW6mLtOQQseORqfdmoBNDFOqs9rvNVR2e+cmu6zJu/Ku4SDuqiJko6YnhwcL8x45r8Oqxg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -3631,12 +3631,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.16.0([email protected]) - '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) + '@typescript-eslint/typescript-estree': 7.16.0([email protected]) + '@typescript-eslint/utils': 7.16.0([email protected])([email protected]) debug: 4.3.5 eslint: 8.57.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true @@ -3661,7 +3661,7 @@ packages: engines: {node: ^18.18.0 || >=20.0.0} dev: true - /@typescript-eslint/[email protected]([email protected]): + /@typescript-eslint/[email protected]([email protected]): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3676,13 +3676,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 - tsutils: 3.21.0([email protected]) - typescript: 5.5.3 + tsutils: 3.21.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/[email protected]([email protected]): + /@typescript-eslint/[email protected]([email protected]): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3698,13 +3698,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.2 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/[email protected]([email protected]): + /@typescript-eslint/[email protected]([email protected]): resolution: {integrity: sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3719,13 +3719,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.2 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/[email protected]([email protected]): + /@typescript-eslint/[email protected]([email protected]): resolution: {integrity: sha512-a5NTvk51ZndFuOLCh5OaJBELYc2O3Zqxfl3Js78VFE1zE46J2AaVuW+rEbVkQznjkmlzWsUI15BG5tQMixzZLw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -3741,13 +3741,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.2 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.5.3 + ts-api-utils: 1.3.0([email protected]) + typescript: 5.5.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -3758,7 +3758,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0([email protected]) + '@typescript-eslint/typescript-estree': 5.62.0([email protected]) eslint: 8.48.0 eslint-scope: 5.1.1 semver: 7.6.2 @@ -3767,7 +3767,7 @@ packages: - typescript dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3778,7 +3778,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0([email protected]) + '@typescript-eslint/typescript-estree': 6.21.0([email protected]) eslint: 8.48.0 semver: 7.6.2 transitivePeerDependencies: @@ -3786,7 +3786,7 @@ packages: - typescript dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-mPHFoNa2bPIWWglWYdR0QfY9GN0CfvvXX1Sv6DlSTive3jlMTUy+an67//Gysc+0Me9pjitrq0LJp0nGtLgftw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -3797,7 +3797,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.6.0 '@typescript-eslint/types': 6.6.0 - '@typescript-eslint/typescript-estree': 6.6.0([email protected]) + '@typescript-eslint/typescript-estree': 6.6.0([email protected]) eslint: 8.48.0 semver: 7.6.2 transitivePeerDependencies: @@ -3805,7 +3805,7 @@ packages: - typescript dev: true - /@typescript-eslint/[email protected]([email protected])([email protected]): + /@typescript-eslint/[email protected]([email protected])([email protected]): resolution: {integrity: sha512-PqP4kP3hb4r7Jav+NiRCntlVzhxBNWq6ZQ+zQwII1y/G/1gdIPeYDCKr2+dH6049yJQsWZiHU6RlwvIFBXXGNA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -3814,7 +3814,7 @@ packages: '@eslint-community/eslint-utils': 4.4.0([email protected]) '@typescript-eslint/scope-manager': 7.16.0 '@typescript-eslint/types': 7.16.0 - '@typescript-eslint/typescript-estree': 7.16.0([email protected]) + '@typescript-eslint/typescript-estree': 7.16.0([email protected]) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -5026,7 +5026,7 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-/lXrLXcEQ2w8dmvFBtzpfTkakVyLSm4uYCyzkV3YSx2mhx/VW4UH8q1jnv7GPmnpZJdtDr7r5Hd5Ffh1+Qlkmg==} peerDependencies: eslint: ^7.23.0 || ^8.0.0 @@ -5037,8 +5037,8 @@ packages: dependencies: '@next/eslint-plugin-next': 15.0.0-canary.58 '@rushstack/eslint-patch': 1.10.3 - '@typescript-eslint/eslint-plugin': 7.16.0(@typescript-eslint/[email protected])([email protected])([email protected]) - '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) + '@typescript-eslint/eslint-plugin': 7.16.0(@typescript-eslint/[email protected])([email protected])([email protected]) + '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/[email protected])([email protected])([email protected])([email protected]) @@ -5046,7 +5046,7 @@ packages: eslint-plugin-jsx-a11y: 6.9.0([email protected]) eslint-plugin-react: 7.34.3([email protected]) eslint-plugin-react-hooks: 4.6.2([email protected]) - typescript: 5.5.3 + typescript: 5.5.4 transitivePeerDependencies: - eslint-import-resolver-webpack - supports-color @@ -5115,7 +5115,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) + '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) debug: 3.2.7 eslint: 8.48.0 eslint-import-resolver-node: 0.3.9 @@ -5144,7 +5144,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) + '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 @@ -5174,7 +5174,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) + '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -5209,7 +5209,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) + '@typescript-eslint/parser': 7.16.0([email protected])([email protected]) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -5249,7 +5249,7 @@ packages: requireindex: 1.2.0 dev: true - /[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): + /[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -5262,8 +5262,8 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.6.0(@typescript-eslint/[email protected])([email protected])([email protected]) - '@typescript-eslint/utils': 5.62.0([email protected])([email protected]) + '@typescript-eslint/eslint-plugin': 6.6.0(@typescript-eslint/[email protected])([email protected])([email protected]) + '@typescript-eslint/utils': 5.62.0([email protected])([email protected]) eslint: 8.48.0 transitivePeerDependencies: - supports-color @@ -5335,7 +5335,7 @@ packages: semver: 6.3.1 dev: true - /[email protected]([email protected])([email protected]): + /[email protected]([email protected])([email protected]): resolution: {integrity: sha512-VqUk5WR7Dj8L0gNPqn7bl7NTHFYB8l5um4wo7hkMp0Dl+k8RHDAsOef4pPrty6G8vjnzvb3xIZNNshmDJI8SdA==} peerDependencies: astro-eslint-parser: ^0.14.0 @@ -5353,7 +5353,7 @@ packages: vue-eslint-parser: optional: true dependencies: - '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) + '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) eslint: 8.48.0 minimatch: 9.0.5 natural-compare-lite: 1.4.0 @@ -5372,7 +5372,7 @@ packages: optional: true dependencies: eslint: 8.48.0 - eslint-plugin-jest: 27.2.3(@typescript-eslint/[email protected])([email protected])([email protected]) + eslint-plugin-jest: 27.2.3(@typescript-eslint/[email protected])([email protected])([email protected]) dev: true /[email protected]([email protected]): @@ -7265,7 +7265,7 @@ packages: react-dom: 19.0.0-rc-6230622a1a-20240610([email protected]) dev: false - /[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]): + /[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]): resolution: {integrity: sha512-VXJTJ/VRZzIdjTzzRBake63NXNnSZRNJ4hcTwkZZ3ZfRN123jzfqMg0DtAtMHOArC/W8PIIfnCWiBhN1YgWS8A==} engines: {node: ^18.20.2 || >=20.9.0} hasBin: true @@ -7303,7 +7303,7 @@ packages: pluralize: 8.0.0 sanitize-filename: 1.6.3 scmp: 2.1.0 - ts-essentials: 7.0.3([email protected]) + ts-essentials: 7.0.3([email protected]) uuid: 10.0.0 transitivePeerDependencies: - '@swc/types' @@ -8670,21 +8670,21 @@ packages: utf8-byte-length: 1.0.5 dev: false - /[email protected]([email protected]): + /[email protected]([email protected]): resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.5.3 + typescript: 5.5.4 dev: true - /[email protected]([email protected]): + /[email protected]([email protected]): resolution: {integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==} peerDependencies: typescript: '>=3.7.0' dependencies: - typescript: 5.5.3 + typescript: 5.5.4 dev: false /[email protected]: @@ -8706,14 +8706,14 @@ packages: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} dev: false - /[email protected]([email protected]): + /[email protected]([email protected]): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.5.3 + typescript: 5.5.4 dev: true /[email protected]: @@ -8797,8 +8797,8 @@ packages: dependencies: csstype: 3.1.3 - /[email protected]: - resolution: {integrity: sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==} + /[email protected]: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} hasBin: true diff --git a/templates/with-payload-cloud/package.json b/templates/with-payload-cloud/package.json index d088e5c5fbe..dad8ccb87e6 100644 --- a/templates/with-payload-cloud/package.json +++ b/templates/with-payload-cloud/package.json @@ -32,7 +32,7 @@ "@types/react-dom": "npm:[email protected]", "eslint": "^8", "eslint-config-next": "15.0.0-canary.53", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "engines": { "node": "^18.20.2 || >=20.9.0" diff --git a/templates/with-vercel-mongodb/package.json b/templates/with-vercel-mongodb/package.json index d11131a9fe1..f1dcd72d1b5 100644 --- a/templates/with-vercel-mongodb/package.json +++ b/templates/with-vercel-mongodb/package.json @@ -32,7 +32,7 @@ "@types/react-dom": "npm:[email protected]", "eslint": "^8", "eslint-config-next": "15.0.0-canary.53", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "engines": { "node": "^18.20.2 || >=20.9.0" diff --git a/templates/with-vercel-postgres/package.json b/templates/with-vercel-postgres/package.json index 0ce88d14b21..25efe3d1c78 100644 --- a/templates/with-vercel-postgres/package.json +++ b/templates/with-vercel-postgres/package.json @@ -32,7 +32,7 @@ "@types/react-dom": "npm:[email protected]", "eslint": "^8", "eslint-config-next": "15.0.0-canary.53", - "typescript": "5.5.3" + "typescript": "5.5.4" }, "engines": { "node": "^18.20.2 || >=20.9.0" diff --git a/test/package.json b/test/package.json index 54b6987abb3..c59229b085e 100644 --- a/test/package.json +++ b/test/package.json @@ -68,14 +68,14 @@ "file-type": "17.1.6", "http-status": "1.6.2", "jwt-decode": "4.0.0", - "lexical": "0.15.0", + "lexical": "0.16.1", "payload": "workspace:*", "qs-esm": "7.0.2", "server-only": "^0.0.1", "slate": "0.91.4", "tempy": "^1.0.1", "ts-essentials": "7.0.3", - "typescript": "5.5.3", + "typescript": "5.5.4", "uploadthing": "^6.10.1", "uuid": "10.0.0" },
dbdc7d930885145cfade4ffc050a97df0b488d46
2024-09-20 18:38:58
Dan Ribbens
chore: use updatedAt instead of editedAt for locked documents (#8324)
false
use updatedAt instead of editedAt for locked documents (#8324)
chore
diff --git a/packages/next/src/elements/DocumentLocked/index.tsx b/packages/next/src/elements/DocumentLocked/index.tsx index d839fda5738..a02eede8af2 100644 --- a/packages/next/src/elements/DocumentLocked/index.tsx +++ b/packages/next/src/elements/DocumentLocked/index.tsx @@ -25,13 +25,13 @@ const formatDate = (date) => { } export const DocumentLocked: React.FC<{ - editedAt?: null | number handleGoBack: () => void isActive: boolean onReadOnly: () => void onTakeOver: () => void + updatedAt?: null | number user?: ClientUser -}> = ({ editedAt, handleGoBack, isActive, onReadOnly, onTakeOver, user }) => { +}> = ({ handleGoBack, isActive, onReadOnly, onTakeOver, updatedAt, user }) => { const { closeModal, openModal } = useModal() const { t } = useTranslation() @@ -52,7 +52,7 @@ export const DocumentLocked: React.FC<{ <strong>{user?.email ?? user?.id}</strong> {t('general:currentlyEditing')} </p> <p> - {t('general:editedSince')} <strong>{formatDate(editedAt)}</strong> + {t('general:editedSince')} <strong>{formatDate(updatedAt)}</strong> </p> </div> <div className={`${baseClass}__controls`}> diff --git a/packages/next/src/views/Edit/Default/index.tsx b/packages/next/src/views/Edit/Default/index.tsx index 35416bc8340..3763e2c11f5 100644 --- a/packages/next/src/views/Edit/Default/index.tsx +++ b/packages/next/src/views/Edit/Default/index.tsx @@ -421,7 +421,6 @@ export const DefaultEditView: React.FC = () => { {BeforeDocument} {isLockingEnabled && shouldShowDocumentLockedModal && !isReadOnlyForIncomingUser && ( <DocumentLocked - editedAt={lastUpdateTime} handleGoBack={handleGoBack} isActive={shouldShowDocumentLockedModal} onReadOnly={() => { @@ -429,6 +428,7 @@ export const DefaultEditView: React.FC = () => { setShowTakeOverModal(false) }} onTakeOver={handleTakeOver} + updatedAt={lastUpdateTime} user={currentEditor} /> )} diff --git a/packages/payload/src/lockedDocuments/lockedDocumentsCollection.ts b/packages/payload/src/lockedDocuments/lockedDocumentsCollection.ts index 9cc0f1cd739..e2508ac3df8 100644 --- a/packages/payload/src/lockedDocuments/lockedDocumentsCollection.ts +++ b/packages/payload/src/lockedDocuments/lockedDocumentsCollection.ts @@ -14,17 +14,15 @@ export const getLockedDocumentsCollection = (config: Config): CollectionConfig = maxDepth: 0, relationTo: [...config.collections.map((collectionConfig) => collectionConfig.slug)], }, - { - name: 'editedAt', - type: 'date', - }, { name: 'globalSlug', type: 'text', + index: true, }, { name: 'user', type: 'relationship', + maxDepth: 1, relationTo: config.collections .filter((collectionConfig) => collectionConfig.auth) .map((collectionConfig) => collectionConfig.slug), diff --git a/packages/payload/src/utilities/checkDocumentLockStatus.ts b/packages/payload/src/utilities/checkDocumentLockStatus.ts index 4924f60d866..ff0dece07bb 100644 --- a/packages/payload/src/utilities/checkDocumentLockStatus.ts +++ b/packages/payload/src/utilities/checkDocumentLockStatus.ts @@ -55,9 +55,8 @@ export const checkDocumentLockStatus = async ({ const finalLockErrorMessage = lockErrorMessage || defaultLockErrorMessage - const lockedDocumentResult: PaginatedDocs<JsonObject & TypeWithID> = await payload.find({ + const lockedDocumentResult: PaginatedDocs<JsonObject & TypeWithID> = await payload.db.find({ collection: 'payload-locked-documents', - depth: 1, limit: 1, pagination: false, req, @@ -68,8 +67,8 @@ export const checkDocumentLockStatus = async ({ // If there's a locked document, check lock conditions const lockedDoc = lockedDocumentResult?.docs[0] if (lockedDoc) { - const lastEditedAt = new Date(lockedDoc?.editedAt) - const now = new Date() + const lastEditedAt = new Date(lockedDoc?.updatedAt).getTime() + const now = new Date().getTime() const lockDuration = typeof lockDocumentsProp === 'object' ? lockDocumentsProp.duration : lockDurationDefault @@ -79,8 +78,8 @@ export const checkDocumentLockStatus = async ({ // document is locked by another user and the lock hasn't expired if ( - lockedDoc.user?.value?.id !== currentUserId && - now.getTime() - lastEditedAt.getTime() <= lockDurationInMilliseconds + lockedDoc.user?.value !== currentUserId && + now - lastEditedAt <= lockDurationInMilliseconds ) { throw new Locked(finalLockErrorMessage) } diff --git a/packages/ui/src/providers/DocumentInfo/index.tsx b/packages/ui/src/providers/DocumentInfo/index.tsx index d4da4634004..3c0ad5815b6 100644 --- a/packages/ui/src/providers/DocumentInfo/index.tsx +++ b/packages/ui/src/providers/DocumentInfo/index.tsx @@ -193,7 +193,6 @@ const DocumentInfo: React.FC< // Send a patch request to update the _lastEdited info await requests.patch(`${serverURL}${api}/payload-locked-documents/${lockId}`, { body: JSON.stringify({ - editedAt: new Date(), user: { relationTo: user?.collection, value: user?.id }, }), headers: { diff --git a/packages/ui/src/utilities/buildFormState.ts b/packages/ui/src/utilities/buildFormState.ts index 7c0a74d42b8..f20249b3e84 100644 --- a/packages/ui/src/utilities/buildFormState.ts +++ b/packages/ui/src/utilities/buildFormState.ts @@ -265,9 +265,7 @@ export const buildFormState = async ({ await req.payload.db.updateOne({ id: lockedDocument.docs[0].id, collection: 'payload-locked-documents', - data: { - editedAt: new Date().toISOString(), - }, + data: {}, req, }) } @@ -284,7 +282,6 @@ export const buildFormState = async ({ value: id, } : undefined, - editedAt: new Date().toISOString(), globalSlug: globalSlug ? globalSlug : undefined, user: { relationTo: [req.user.collection], diff --git a/test/locked-documents/e2e.spec.ts b/test/locked-documents/e2e.spec.ts index 68d7b2319cb..d982c81c388 100644 --- a/test/locked-documents/e2e.spec.ts +++ b/test/locked-documents/e2e.spec.ts @@ -98,7 +98,6 @@ describe('locked documents', () => { relationTo: 'posts', value: postDoc.id, }, - editedAt: new Date().toISOString(), globalSlug: undefined, user: { relationTo: 'users', @@ -318,7 +317,6 @@ describe('locked documents', () => { relationTo: 'posts', value: postDoc.id, }, - editedAt: new Date().toISOString(), globalSlug: undefined, user: { relationTo: 'users', @@ -422,7 +420,6 @@ describe('locked documents', () => { relationTo: 'posts', value: postDoc.id, }, - editedAt: new Date().toISOString(), globalSlug: undefined, user: { relationTo: 'users', @@ -512,7 +509,6 @@ describe('locked documents', () => { relationTo: 'posts', value: postDoc.id, }, - editedAt: new Date().toISOString(), globalSlug: undefined, user: { relationTo: 'users', @@ -784,7 +780,6 @@ describe('locked documents', () => { collection: lockedDocumentCollection, data: { document: undefined, - editedAt: new Date().toISOString(), globalSlug: 'menu', user: { relationTo: 'users', diff --git a/test/locked-documents/int.spec.ts b/test/locked-documents/int.spec.ts index 370118d4e1f..8d23a601756 100644 --- a/test/locked-documents/int.spec.ts +++ b/test/locked-documents/int.spec.ts @@ -1,5 +1,8 @@ +import type { Payload, SanitizedCollectionConfig } from 'payload' + import path from 'path' -import { Locked, NotFound, type Payload } from 'payload' +import { Locked, NotFound } from 'payload' +import { wait } from 'payload/shared' import { fileURLToPath } from 'url' import type { NextRESTClient } from '../helpers/NextRESTClient.js' @@ -26,10 +29,13 @@ describe('Locked documents', () => { let menu: Menu let user: any let user2: any + let postConfig: SanitizedCollectionConfig beforeAll(async () => { ;({ payload, restClient } = await initPayloadInt(dirname)) + postConfig = payload.config.collections.find(({ slug }) => slug === postsSlug) + const loginResult = await payload.login({ collection: 'users', data: { @@ -77,6 +83,10 @@ describe('Locked documents', () => { } }) + afterEach(() => { + postConfig.lockDocuments = { duration: 300 } + }) + it('should update unlocked document - collection', async () => { const updatedPost = await payload.update({ collection: postsSlug, @@ -129,16 +139,13 @@ describe('Locked documents', () => { }, }) - // Subtract 3.5 minutes (210 seconds) from the current time - const pastEditedAt = new Date() - pastEditedAt.setMinutes(pastEditedAt.getMinutes() - 3) - pastEditedAt.setSeconds(pastEditedAt.getSeconds() - 30) + // Set lock duration to 1 second for testing purposes + postConfig.lockDocuments = { duration: 1 } // Give locking ownership to another user const lockedDocInstance = await payload.create({ collection: lockedDocumentCollection, data: { - editedAt: pastEditedAt.toISOString(), user: { relationTo: 'users', value: user2.id, @@ -151,6 +158,8 @@ describe('Locked documents', () => { }, }) + await wait(1100) + const updateLockedDoc = await payload.update({ collection: postsSlug, data: { @@ -159,6 +168,7 @@ describe('Locked documents', () => { overrideLock: false, id: newPost2.id, }) + postConfig.lockDocuments = { duration: 300 } // Should allow update since editedAt date is past expiration duration. // Therefore the document is considered stale @@ -187,16 +197,13 @@ describe('Locked documents', () => { }) it('should allow update of stale locked document - global', async () => { - // Subtract 5.5 minutes (330 seconds) from the current time - const pastEditedAt = new Date() - pastEditedAt.setMinutes(pastEditedAt.getMinutes() - 5) - pastEditedAt.setSeconds(pastEditedAt.getSeconds() - 30) - + // Set lock duration to 1 second for testing purposes + const globalConfig = payload.config.globals.find(({ slug }) => slug === menuSlug) + globalConfig.lockDocuments = { duration: 1 } // Give locking ownership to another user const lockedGlobalInstance = await payload.create({ collection: lockedDocumentCollection, data: { - editedAt: pastEditedAt.toISOString(), // stale date user: { relationTo: 'users', value: user2.id, @@ -206,6 +213,8 @@ describe('Locked documents', () => { }, }) + await wait(1100) + const updateGlobalLockedDoc = await payload.updateGlobal({ data: { globalText: 'global text 2', @@ -213,6 +222,7 @@ describe('Locked documents', () => { overrideLock: false, slug: menuSlug, }) + globalConfig.lockDocuments = { duration: 300 } // Should allow update since editedAt date is past expiration duration. // Therefore the document is considered stale @@ -379,16 +389,13 @@ describe('Locked documents', () => { }, }) - // Subtract 3.5 minutes (210 seconds) from the current time - const pastEditedAt = new Date() - pastEditedAt.setMinutes(pastEditedAt.getMinutes() - 3) - pastEditedAt.setSeconds(pastEditedAt.getSeconds() - 30) + // Set lock duration to 1 second for testing purposes + postConfig.lockDocuments = { duration: 1 } // Give locking ownership to another user const lockedDocInstance = await payload.create({ collection: lockedDocumentCollection, data: { - editedAt: pastEditedAt.toISOString(), // stale date user: { relationTo: 'users', value: user2.id, @@ -401,6 +408,8 @@ describe('Locked documents', () => { }, }) + await wait(1100) + await payload.delete({ collection: postsSlug, id: newPost4.id, diff --git a/test/locked-documents/payload-types.ts b/test/locked-documents/payload-types.ts index 44597368e81..229f66aa6d2 100644 --- a/test/locked-documents/payload-types.ts +++ b/test/locked-documents/payload-types.ts @@ -111,7 +111,6 @@ export interface PayloadLockedDocument { relationTo: 'users'; value: string | User; }; - editedAt?: string | null; updatedAt: string; createdAt: string; }
6ada450531c921dc9e9b27dbb042631da27de89d
2025-01-14 01:11:14
Alessio Gravili
fix(richtext-lexical): insert paragraph at end button overlaps floating link toolbar (#10552)
false
insert paragraph at end button overlaps floating link toolbar (#10552)
fix
diff --git a/packages/richtext-lexical/src/lexical/plugins/InsertParagraphAtEnd/index.scss b/packages/richtext-lexical/src/lexical/plugins/InsertParagraphAtEnd/index.scss index a4cd4228f60..806909d4b2f 100644 --- a/packages/richtext-lexical/src/lexical/plugins/InsertParagraphAtEnd/index.scss +++ b/packages/richtext-lexical/src/lexical/plugins/InsertParagraphAtEnd/index.scss @@ -10,7 +10,7 @@ height: 24px; margin-top: -16px; width: 100%; - z-index: 2; + z-index: 0; position: relative; padding: 4px 0px 2px 0px;
7292220109bb9c4c55c3f63c765b658144307541
2024-12-20 10:24:24
Jacob Fletcher
chore(examples): updates auth example to latest (#10090)
false
updates auth example to latest (#10090)
chore
diff --git a/examples/auth/.env.example b/examples/auth/.env.example index 0433f0c4bdb..23a57a3dcef 100644 --- a/examples/auth/.env.example +++ b/examples/auth/.env.example @@ -1,7 +1,11 @@ -# NOTE: Change port of `PAYLOAD_PUBLIC_SITE_URL` if front-end is running on another server -PAYLOAD_PUBLIC_SITE_URL=http://localhost:3000 -PAYLOAD_PUBLIC_SERVER_URL=http://localhost:3000 +# Database connection string +DATABASE_URI=mongodb://127.0.0.1/payload-draft-preview-example + +# Used to encrypt JWT tokens +PAYLOAD_SECRET=YOUR_SECRET_HERE + +# Used to configure CORS, format links and more. No trailing slash NEXT_PUBLIC_SERVER_URL=http://localhost:3000 -DATABASE_URI=mongodb://127.0.0.1/payload-example-auth -PAYLOAD_SECRET=PAYLOAD_AUTH_EXAMPLE_SECRET_KEY + +# Used to share cookies across subdomains COOKIE_DOMAIN=localhost diff --git a/examples/auth/.eslintignore b/examples/auth/.eslintignore deleted file mode 100644 index fa111f77021..00000000000 --- a/examples/auth/.eslintignore +++ /dev/null @@ -1,12 +0,0 @@ -.tmp -**/.git -**/.hg -**/.pnp.* -**/.svn -**/.yarn/** -**/build -**/dist/** -**/node_modules -**/temp -playwright.config.ts -jest.config.js diff --git a/examples/auth/.eslintrc.cjs b/examples/auth/.eslintrc.cjs index 82153554ae4..b69f00e730b 100644 --- a/examples/auth/.eslintrc.cjs +++ b/examples/auth/.eslintrc.cjs @@ -1,15 +1,4 @@ module.exports = { - extends: ['plugin:@next/next/core-web-vitals', '@payloadcms'], - ignorePatterns: ['**/payload-types.ts'], - overrides: [ - { - extends: ['plugin:@typescript-eslint/disable-type-checked'], - files: ['*.js', '*.cjs', '*.json', '*.md', '*.yml', '*.yaml'], - }, - ], - parserOptions: { - project: ['./tsconfig.json'], - tsconfigRootDir: __dirname, - }, root: true, + extends: ['@payloadcms'], } diff --git a/examples/auth/.gitignore b/examples/auth/.gitignore index 5af2a2fc951..d1247e70cc8 100644 --- a/examples/auth/.gitignore +++ b/examples/auth/.gitignore @@ -1,4 +1,5 @@ build dist node_modules -package - lock.json.env +package-lock.json +.env diff --git a/examples/auth/.swcrc b/examples/auth/.swcrc new file mode 100644 index 00000000000..b4fb882caaa --- /dev/null +++ b/examples/auth/.swcrc @@ -0,0 +1,24 @@ +{ + "$schema": "https://json.schemastore.org/swcrc", + "sourceMaps": true, + "jsc": { + "target": "esnext", + "parser": { + "syntax": "typescript", + "tsx": true, + "dts": true + }, + "transform": { + "react": { + "runtime": "automatic", + "pragmaFrag": "React.Fragment", + "throwIfNamespace": true, + "development": false, + "useBuiltins": true + } + } + }, + "module": { + "type": "es6" + } +} diff --git a/examples/auth/README.md b/examples/auth/README.md index e71790242c2..39e34bf7e16 100644 --- a/examples/auth/README.md +++ b/examples/auth/README.md @@ -2,28 +2,27 @@ This [Payload Auth Example](https://github.com/payloadcms/payload/tree/main/examples/auth) demonstrates how to implement [Payload Authentication](https://payloadcms.com/docs/authentication/overview) into all types of applications. Follow the [Quick Start](#quick-start) to get up and running quickly. -**IMPORTANT—This example includes a fully integrated Next.js App Router front-end that runs on the same server as Payload.** If you are working on an application running on an entirely separate server, the principals are generally the same. To learn more about this, [check out how Payload can be used in its various headless capacities](https://payloadcms.com/blog/the-ultimate-guide-to-using-nextjs-with-payload). - ## Quick Start -To spin up this example locally, follow these steps: +To spin up this example locally, follow the steps below: 1. Clone this repo -1. `cd` into this directory and run `pnpm i --ignore-workspace`\*, `yarn`, or `npm install` - - > \*If you are running using pnpm within the Payload Monorepo, the `--ignore-workspace` flag is needed so that pnpm generates a lockfile in this example's directory despite the fact that one exists in root. +1. Navigate into the project directory and install dependencies using your preferred package manager: -1. `cp .env.example .env` to copy the example environment variables +- `pnpm i --ignore-workspace`\*, `yarn`, or `npm install` - > Adjust `PAYLOAD_PUBLIC_SITE_URL` in the `.env` if your front-end is running on a separate domain or port. +> \*NOTE: The --ignore-workspace flag is needed if you are running this example within the Payload monorepo to avoid workspace conflicts. -1. `pnpm dev`, `yarn dev` or `npm run dev` to start the server - - Press `y` when prompted to seed the database -1. `open http://localhost:3000` to access the home page -1. `open http://localhost:3000/admin` to access the admin panel - - Login with email `[email protected]` and password `demo` +1. Start the server: + - Depending on your package manager, run `pnpm dev`, `yarn dev` or `npm run dev` + - When prompted, type `y` then `enter` to seed the database with sample data +1. Access the application: + - Open your browser and navigate to `http://localhost:3000` to access the homepage. + - Open `http://localhost:3000/admin` to access the admin panel. +1. Login: -That's it! Changes made in `./src` will be reflected in your app. See the [Development](#development) section for more details. +- Use the following credentials to log into the admin panel: + > `Email: [email protected]` > `Password: demo` ## How it works diff --git a/examples/auth/next-env.d.ts b/examples/auth/next-env.d.ts index 4f11a03dc6c..1b3be0840f3 100644 --- a/examples/auth/next-env.d.ts +++ b/examples/auth/next-env.d.ts @@ -2,4 +2,4 @@ /// <reference types="next/image-types/global" /> // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/examples/auth/package.json b/examples/auth/package.json index cccc145a99b..be92570246c 100644 --- a/examples/auth/package.json +++ b/examples/auth/package.json @@ -3,41 +3,39 @@ "version": "1.0.0", "description": "Payload authentication example.", "license": "MIT", + "type": "module", "main": "dist/server.js", "scripts": { - "build": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts NODE_OPTIONS=--no-deprecation next build", - "dev": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts && pnpm seed && cross-env NODE_OPTIONS=--no-deprecation next dev", - "generate:graphQLSchema": "PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:graphQLSchema", - "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types", - "lint": "cross-env NODE_OPTIONS=--no-deprecation next lint", - "lint:fix": "eslint --fix --ext .ts,.tsx src", - "payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload", + "build": "cross-env NODE_OPTIONS=--no-deprecation next build", + "dev": "cross-env NODE_OPTIONS=--no-deprecation && pnpm seed && next dev", + "generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap", + "generate:schema": "payload-graphql generate:schema", + "generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types", + "payload": "cross-env NODE_OPTIONS=--no-deprecation payload", "seed": "npm run payload migrate:fresh", "start": "cross-env NODE_OPTIONS=--no-deprecation next start" }, "dependencies": { - "@payloadcms/db-mongodb": "3.0.0-beta.24", - "@payloadcms/next": "3.0.0-beta.24", - "@payloadcms/richtext-slate": "3.0.0-beta.24", - "@payloadcms/ui": "3.0.0-beta.24", + "@payloadcms/db-mongodb": "latest", + "@payloadcms/next": "latest", + "@payloadcms/richtext-slate": "latest", + "@payloadcms/ui": "latest", "cross-env": "^7.0.3", - "next": "14.3.0-canary.68", - "payload": "3.0.0-beta.24", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "next": "^15.0.0", + "payload": "latest", + "react": "19.0.0", + "react-dom": "19.0.0", "react-hook-form": "^7.51.3" }, "devDependencies": { - "@next/eslint-plugin-next": "^13.1.6", - "@payloadcms/eslint-config": "^1.1.1", - "@swc/core": "^1.4.14", - "@swc/types": "^0.1.6", - "@types/node": "^20.11.25", - "@types/react": "^18.2.64", - "@types/react-dom": "^18.2.21", - "dotenv": "^16.4.5", + "@payloadcms/graphql": "latest", + "@swc/core": "^1.6.13", + "@types/ejs": "^3.1.5", + "@types/react": "19.0.1", + "@types/react-dom": "19.0.1", "eslint": "^8.57.0", - "tsx": "^4.7.1", - "typescript": "5.4.4" + "eslint-config-next": "^15.0.0", + "tsx": "^4.16.2", + "typescript": "5.5.2" } } diff --git a/examples/auth/pnpm-lock.yaml b/examples/auth/pnpm-lock.yaml index 69d7f29c12d..f470c8d816f 100644 --- a/examples/auth/pnpm-lock.yaml +++ b/examples/auth/pnpm-lock.yaml @@ -1,102 +1,3040 @@ -lockfileVersion: '6.0' +lockfileVersion: '9.0' settings: autoInstallPeers: true excludeLinksFromLockfile: false -dependencies: - '@payloadcms/db-mongodb': - specifier: 3.0.0-beta.24 - version: 3.0.0-beta.24([email protected]) - '@payloadcms/next': - specifier: 3.0.0-beta.24 - version: 3.0.0-beta.24(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) - '@payloadcms/richtext-slate': - specifier: 3.0.0-beta.24 - version: 3.0.0-beta.24(@payloadcms/[email protected])(@payloadcms/[email protected])([email protected])([email protected])([email protected]) - '@payloadcms/ui': - specifier: 3.0.0-beta.24 - version: 3.0.0-beta.24(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) - cross-env: - specifier: ^7.0.3 - version: 7.0.3 - next: - specifier: 14.3.0-canary.7 - version: 14.3.0-canary.7([email protected])([email protected]) - payload: - specifier: 3.0.0-beta.24 - version: 3.0.0-beta.24(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) - react: - specifier: ^18.2.0 - version: 18.2.0 - react-dom: - specifier: ^18.2.0 - version: 18.2.0([email protected]) - react-hook-form: - specifier: ^7.51.3 - version: 7.51.3([email protected]) - -devDependencies: - '@next/eslint-plugin-next': - specifier: ^13.1.6 - version: 13.5.6 - '@payloadcms/eslint-config': - specifier: ^1.1.1 - version: 1.1.1([email protected]) - '@swc/core': - specifier: ^1.4.14 - version: 1.4.17 - '@swc/types': - specifier: ^0.1.6 - version: 0.1.6 - '@types/node': - specifier: ^20.11.25 - version: 20.12.7 - '@types/react': - specifier: ^18.2.64 - version: 18.2.79 - '@types/react-dom': - specifier: ^18.2.21 - version: 18.2.25 - dotenv: - specifier: ^16.4.5 - version: 16.4.5 - eslint: - specifier: ^8.57.0 - version: 8.57.0 - tsx: - specifier: ^4.7.1 - version: 4.7.2 - typescript: - specifier: 5.4.4 - version: 5.4.4 +importers: + + .: + dependencies: + '@payloadcms/db-mongodb': + specifier: latest + version: 3.9.0(@aws-sdk/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]) + '@payloadcms/next': + specifier: latest + version: 3.9.0(@types/[email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected]) + '@payloadcms/richtext-slate': + specifier: latest + version: 3.9.0(@types/[email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected]) + '@payloadcms/ui': + specifier: latest + version: 3.9.0(@types/[email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected]) + cross-env: + specifier: ^7.0.3 + version: 7.0.3 + next: + specifier: ^15.0.0 + version: 15.1.2([email protected]([email protected]))([email protected])([email protected]) + payload: + specifier: latest + version: 3.9.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + react: + specifier: 19.0.0 + version: 19.0.0 + react-dom: + specifier: 19.0.0 + version: 19.0.0([email protected]) + react-hook-form: + specifier: ^7.51.3 + version: 7.51.3([email protected]) + devDependencies: + '@payloadcms/graphql': + specifier: latest + version: 3.9.0([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]) + '@swc/core': + specifier: ^1.6.13 + version: 1.10.1(@swc/[email protected]) + '@types/ejs': + specifier: ^3.1.5 + version: 3.1.5 + '@types/react': + specifier: 19.0.1 + version: 19.0.1 + '@types/react-dom': + specifier: 19.0.1 + version: 19.0.1 + eslint: + specifier: ^8.57.0 + version: 8.57.0 + eslint-config-next: + specifier: ^15.0.0 + version: 15.1.2([email protected])([email protected]) + tsx: + specifier: ^4.16.2 + version: 4.19.2 + typescript: + specifier: 5.5.2 + version: 5.5.2 + +packages: + + '@aashutoshrathi/[email protected]': + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + + '@apidevtools/[email protected]': + resolution: {integrity: sha512-WApSdLdXEBb/1FUPca2lteASewEfpjEYJ8oXZP+0gExK5qSfsEKBKcA+WjY6Q4wvXwyv0+W6Kvc372pSceib9w==} + engines: {node: '>= 16'} + + '@aws-crypto/[email protected]': + resolution: {integrity: sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==} + + '@aws-crypto/[email protected]': + resolution: {integrity: sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==} + + '@aws-crypto/[email protected]': + resolution: {integrity: sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==} + + '@aws-crypto/[email protected]': + resolution: {integrity: sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==} + + '@aws-crypto/[email protected]': + resolution: {integrity: sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-HWd7PyXCuY1Z9KBaufbzpIvS2QeUAak5wfYwylW2DrEvt6A4tjWCBSbbSXNoawqCv/HitA39v953N/1PojJVVQ==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-AXKd2TB6nNrksu+OfmHl8uI07PdgzOo4o8AxoRO8SHlwoMAGvcT9optDGVSYoVfgOKTymCoE7h8/UoUfPc11wQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + '@aws-sdk/credential-provider-node': ^3.556.0 + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-unXdWS7uvHqCcOyC1de+Fr8m3F2vMg2m24GPea0bg7rVGTYmiyn9mhUX11VCt+ozydrw+F50FQwL6OqoqPocmw==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-TsK3js7Suh9xEmC886aY+bv0KdLLYtzrcmVt6sJ/W6EnDXYQhBuKYFhp03NrN2+vSvMGpqJwR62DyfKe1G0QzQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + '@aws-sdk/credential-provider-node': ^3.556.0 + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-vJaSaHw2kPQlo11j/Rzuz0gk1tEaKdz+2ser0f0qZ5vwFlANjt08m/frU17ctnVKC1s58bxpctO/1P894fHLrA==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-PKYBjfpLHJZhrIv0M9eJ47yeDaV8NUMVe4vsiHG5tvlvwWGP84k9GJlr51U/s84OzIyXzVpiqP8PU5yKovUFIg==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-XppwO8c0GCGSAvdzyJOhbtktSEaShg14VJKg8mpMa1XcgqzmcqqHQjtDWbx5rZheY1VdpXZhpEzJkB6LpQejpA==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-vsmu7Cz1i45pFEqzVb4JcFmAmVnWFNLsGheZc8SCptlqCO5voETrZZILHYIl4cjKkSDk3pblBOf0PhyjqWW6WQ==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-0Nz4ErOlXhe3muxWYMbPwRMgfKmVbBp36BAE2uv/z5wTbfdBkcgUwaflEvlKCLUTdHzuZsQk+BFS/gVyaUeOuA==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-s1xVtKjyGc60O8qcNIzS1X3H+pWEwEfZ7TgNznVDNyuXvLrlNWiAcigPWGl2aAkc8tGcsSG0Qpyw2KYC939LFg==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-9O1OaprGCnlb/kYl8RwmH7Mlg8JREZctB8r9sa1KhSsWFq/SWO0AuJTyowxD7zL5PkeS4eTvzFFHWCa3OO5epA==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-ETuBgcnpfxqadEAqhQFWpKoV1C/NAgvs5CbBc5EJbelJ8f4prTdErIHjrRtVT8c02MXj92QwczsiNYd5IoOqyw==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-R/YAL8Uh8i+dzVjzMnbcWLIGeeRi2mioHVGnVF+minmaIkCiQMZg2HPrdlKm49El+RljT28Nl5YHRuiqzEIwMA==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-CnWP/AEF+sPeO8fabrHy4Oeo52xDFuDQMpjKcI7oJzGF6Ne2ZPTq6wTJQPLeXeg4OzLcK0tT3G4z/27MLdsLsw==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-0h6TWjBWtDaYwHMQJI9ulafeS4lLaw1vIxRjbpH0svFRt6Eve+Sy8NlVhECfTU2hNz/fLubvrUxsXoThaLBIew==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-huNHpONOrEDrdRTvSQr1cJiRMNf0S52NDXtaPzdxiubTkP+vni2MohmZANMOai/qT0olmEVX01LhZ0ZAOgmg6A==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-am2qgGs+gwqmR4wHLWpzlZ8PWhm4ktj5bYSgDrsOfjhdBlWNxvPoID9/pDAz5RWL48+oH7I6SQzMqxXsFDikrw==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-8Rd6wPeXDnOYzWj1XCmOKcx/Q87L0K1/EHqOBocGjLVbN3gmRxBvpmR1pRTjf7IsWfnnzN5btqtcAkfDPYQUMQ==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-IXOznDiaItBjsQy4Fil0kzX/J3HxIOknEphqHbOfUf+LpA5ugcsxuQQONrbEQusCBnfJyymrldBvBhFmtlU9Wg==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-tvIiugNF0/+2wfuImMrpKjXMx4nCnFWQjQvouObny+wrif/PGqqQYrybwxPJDvzbd965bu1I+QuSv85/ug7xsg==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-aY4MYfduNj+sRR37U7XxYR8wemfbKP6lx00ze2M2uubn7mZotuVrWYAafbMSXrdEMSToE5JDhr28vArSOoLcSg==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-1kMyQFAWx6f8alaI6UT65/5YW/7pDWAKAdNwL6vuJLea03KrZRX3PMoONOSJpAS5m3Ot7HlWZvf3wZDNTLELZw==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-PHJ3SL6d2jpcgbqdgiPxkXpu7Drc2PYViwxSIqvvMKhDwzSB1W3mMvtpzwKM4IE7zLFodZo0GKjJ9AsoXndXhA==} + engines: {node: '>=14.0.0'} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-RWMcF/xV5n+nhaA/Ff5P3yNP3Kur/I+VNZngog4TEs92oB/nwOdAg/2JL8bVAhUbMrjTjpwm7PItziYFQoqyig==} + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-dRek0zUuIT25wOWJlsRm97nTkUlh1NDcLsQZIN2Y8KxhwoXXWtJs5vaDPT+qAg+OpcNj80i1zLR/CirqlFg/TQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + aws-crt: '>=1.0.0' + peerDependenciesMeta: + aws-crt: + optional: true + + '@aws-sdk/[email protected]': + resolution: {integrity: sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==} + + '@babel/[email protected]': + resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} + engines: {node: '>=6.9.0'} + + '@babel/[email protected]': + resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} + engines: {node: '>=6.9.0'} + + '@babel/[email protected]': + resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} + engines: {node: '>=6.9.0'} + + '@babel/[email protected]': + resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + engines: {node: '>=6.9.0'} + + '@babel/[email protected]': + resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} + engines: {node: '>=6.9.0'} + + '@babel/[email protected]': + resolution: {integrity: sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==} + engines: {node: '>=6.9.0'} + + '@babel/[email protected]': + resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} + engines: {node: '>=6.9.0'} + + '@dnd-kit/[email protected]': + resolution: {integrity: sha512-ea7IkhKvlJUv9iSHJOnxinBcoOI3ppGnnL+VDJ75O45Nss6HtZd8IdN8touXPDtASfeI2T2LImb8VOZcL47wjQ==} + peerDependencies: + react: '>=16.8.0' + + '@dnd-kit/[email protected]': + resolution: {integrity: sha512-lYaoP8yHTQSLlZe6Rr9qogouGUz9oRUj4AHhDQGQzq/hqaJRpFo65X+JKsdHf8oUFBzx5A+SJPUvxAwTF2OabA==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + + '@dnd-kit/[email protected]': + resolution: {integrity: sha512-wDkBHHf9iCi1veM834Gbk1429bd4lHX4RpAwT0y2cHLf246GAvU2sVw/oxWNpPKQNQRQaeGXhAVgrOl1IT+iyA==} + peerDependencies: + '@dnd-kit/core': ^6.0.7 + react: '>=16.8.0' + + '@dnd-kit/[email protected]': + resolution: {integrity: sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg==} + peerDependencies: + react: '>=16.8.0' + + '@emnapi/[email protected]': + resolution: {integrity: sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-VJxe1ucoMYMS7DkiMdC2T7PWNbrEI0a39YRiyDvK2qq4lXwjRbVP/z4lpG+odCsRzadlR+1ywwrTzhdm5HNdew==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==} + peerDependencies: + '@types/react': '*' + react: '>=16.8.0' + peerDependenciesMeta: + '@types/react': + optional: true + + '@emotion/[email protected]': + resolution: {integrity: sha512-RIN04MBT8g+FnDwgvIUi8czvr1LU1alUMI05LekWB5DGyTm8cCBMCRpq3GqaiyEDRptEXOyXnvZ58GZYu4kBxQ==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} + peerDependencies: + react: '>=16.8.0' + + '@emotion/[email protected]': + resolution: {integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==} + + '@emotion/[email protected]': + resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==} + + '@esbuild/[email protected]': + resolution: {integrity: sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/[email protected]': + resolution: {integrity: sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@eslint-community/[email protected]': + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + + '@eslint-community/[email protected]': + resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + '@eslint/[email protected]': + resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@eslint/[email protected]': + resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + '@faceless-ui/[email protected]': + resolution: {integrity: sha512-UmXvz7Iw3KMO4Pm3llZczU4uc5pPQDb6rdqwoBvYDFgWvkraOAHKx0HxSZgwqQvqOhn8joEFBfFp6/Do2562ow==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc.0 + + '@faceless-ui/[email protected]': + resolution: {integrity: sha512-pUBhQP8vduA7rVndNsjhaCcds1BykA/Q4iV23JWijU6ZFL/M3Fm9P3ypDS+0VVxolqemNhw8S3FXPwZGgjH4Rw==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc.0 + + '@faceless-ui/[email protected]': + resolution: {integrity: sha512-Qs8xRA+fl4sU2aFVe9xawxfi5TVZ9VTPuhdQpx9aSv7U5a2F0AXwT61lJfnaJ9Flm8tOcxzq67p8cVZsXNCVeQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc.0 + + '@floating-ui/[email protected]': + resolution: {integrity: sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==} + + '@floating-ui/[email protected]': + resolution: {integrity: sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==} + + '@floating-ui/[email protected]': + resolution: {integrity: sha512-06okr5cgPzMNBy+Ycse2A6udMi4bqwW/zgBF/rwjcNqWkyr82Mcg8b0vjX8OJpZFy/FKjJmw6wV7t44kK6kW7A==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + + '@floating-ui/[email protected]': + resolution: {integrity: sha512-yORQuuAtVpiRjpMhdc0wJj06b9JFjrYF4qp96j++v2NBpbi6SEGF7donUJ3TMieerQ6qVkAv1tgr7L4r5roTqw==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + + '@floating-ui/[email protected]': + resolution: {integrity: sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==} + + '@floating-ui/[email protected]': + resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==} + + '@humanwhocodes/[email protected]': + resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} + engines: {node: '>=10.10.0'} + + '@humanwhocodes/[email protected]': + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} + engines: {node: '>=12.22'} + + '@humanwhocodes/[email protected]': + resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} + + '@img/[email protected]': + resolution: {integrity: sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [darwin] + + '@img/[email protected]': + resolution: {integrity: sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [darwin] + + '@img/[email protected]': + resolution: {integrity: sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==} + cpu: [arm64] + os: [darwin] + + '@img/[email protected]': + resolution: {integrity: sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==} + cpu: [x64] + os: [darwin] + + '@img/[email protected]': + resolution: {integrity: sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==} + cpu: [arm64] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==} + cpu: [arm] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==} + cpu: [s390x] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==} + cpu: [x64] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==} + cpu: [arm64] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==} + cpu: [x64] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [s390x] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [arm64] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [linux] + + '@img/[email protected]': + resolution: {integrity: sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [wasm32] + + '@img/[email protected]': + resolution: {integrity: sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [ia32] + os: [win32] + + '@img/[email protected]': + resolution: {integrity: sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + cpu: [x64] + os: [win32] + + '@jsdevtools/[email protected]': + resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} + + '@juggle/[email protected]': + resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} + + '@monaco-editor/[email protected]': + resolution: {integrity: sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==} + peerDependencies: + monaco-editor: '>= 0.21.0 < 1' + + '@monaco-editor/[email protected]': + resolution: {integrity: sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==} + peerDependencies: + monaco-editor: '>= 0.25.0 < 1' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@mongodb-js/[email protected]': + resolution: {integrity: sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA==} + + '@next/[email protected]': + resolution: {integrity: sha512-Hm3jIGsoUl6RLB1vzY+dZeqb+/kWPZ+h34yiWxW0dV87l8Im/eMOwpOA+a0L78U0HM04syEjXuRlCozqpwuojQ==} + + '@next/[email protected]': + resolution: {integrity: sha512-sgfw3+WdaYOGPKCvM1L+UucBmRfh8V2Ygefp7ELON0+0vY7uohQwXXnVWg3rY7mXDKharQR3o7uedpfvnU2hlQ==} + + '@next/[email protected]': + resolution: {integrity: sha512-b9TN7q+j5/7+rGLhFAVZiKJGIASuo8tWvInGfAd8wsULjB1uNGRCj1z1WZwwPWzVQbIKWFYqc+9L7W09qwt52w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@next/[email protected]': + resolution: {integrity: sha512-caR62jNDUCU+qobStO6YJ05p9E+LR0EoXh1EEmyU69cYydsAy7drMcOlUlRtQihM6K6QfvNwJuLhsHcCzNpqtA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@next/[email protected]': + resolution: {integrity: sha512-fHHXBusURjBmN6VBUtu6/5s7cCeEkuGAb/ZZiGHBLVBXMBy4D5QpM8P33Or8JD1nlOjm/ZT9sEE5HouQ0F+hUA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@next/[email protected]': + resolution: {integrity: sha512-9CF1Pnivij7+M3G74lxr+e9h6o2YNIe7QtExWq1KUK4hsOLTBv6FJikEwCaC3NeYTflzrm69E5UfwEAbV2U9/g==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@next/[email protected]': + resolution: {integrity: sha512-tINV7WmcTUf4oM/eN3Yuu/f8jQ5C6AkueZPKeALs/qfdfX57eNv4Ij7rt0SA6iZ8+fMobVfcFVv664Op0caCCg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@next/[email protected]': + resolution: {integrity: sha512-jf2IseC4WRsGkzeUw/cK3wci9pxR53GlLAt30+y+B+2qAQxMw6WAC3QrANIKxkcoPU3JFh/10uFfmoMDF9JXKg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@next/[email protected]': + resolution: {integrity: sha512-wvg7MlfnaociP7k8lxLX4s2iBJm4BrNiNFhVUY+Yur5yhAJHfkS8qPPeDEUH8rQiY0PX3u/P7Q/wcg6Mv6GSAA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@next/[email protected]': + resolution: {integrity: sha512-D3cNA8NoT3aWISWmo7HF5Eyko/0OdOO+VagkoJuiTk7pyX3P/b+n8XA/MYvyR+xSVcbKn68B1rY9fgqjNISqzQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@nodelib/[email protected]': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/[email protected]': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/[email protected]': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@nolyfill/[email protected]': + resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} + engines: {node: '>=12.4.0'} + + '@payloadcms/[email protected]': + resolution: {integrity: sha512-PysyhAv1QLLXhDb3SNCRgGEHD5Rwks87+5H1b4f+Cyp7/1aGVxAIE7rleJwJDZZjKI0DaETZrO7nmlFtD3JV2A==} + peerDependencies: + payload: 3.9.0 + + '@payloadcms/[email protected]': + resolution: {integrity: sha512-QkrlcvmVI3x1bHzzDcf3LAQo5q2BRO+kFVIe+ruyz1qHupGtbbKCZzhjZYzti46MWBVEocoTO0krF2YmA5BTeQ==} + hasBin: true + peerDependencies: + graphql: ^16.8.1 + payload: 3.9.0 + + '@payloadcms/[email protected]': + resolution: {integrity: sha512-/vu3kbZowEg4tSfFaOOwhKT65VHOTKyEeUpt8qMZsz9aggKdbEbJ+P59JlXT1kqJrpK4zvx4YRfiE+c6aPRpew==} + engines: {node: ^18.20.2 || >=20.9.0} + peerDependencies: + graphql: ^16.8.1 + next: ^15.0.0 + payload: 3.9.0 + + '@payloadcms/[email protected]': + resolution: {integrity: sha512-4omACG+Hj+t3FmJQHR/I/yjetTnzOieAlsSggRjxHZshlvi+tqemoSCGuMbRYTMe3d9/WraNMS2wV6U64/XsHg==} + engines: {node: ^18.20.2 || >=20.9.0} + peerDependencies: + payload: 3.9.0 + react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 + + '@payloadcms/[email protected]': + resolution: {integrity: sha512-GN8tHKksO1s+jGA9GCWTdY1JDXV4PMl/RjPTrxjT+EhDRtk75OPm3nIdbBeBs/NlmpLYrISbjiRvV1fXjDBILA==} + + '@payloadcms/[email protected]': + resolution: {integrity: sha512-gWUdhYx3Wza5z+ea+TLVVgSe41VlsW7/HWR14tQHdUTGBRs/2qocW1pPMEx2aXEaJOTsXYeAyQRlmoyH45zu+w==} + engines: {node: ^18.20.2 || >=20.9.0} + peerDependencies: + next: ^15.0.0 + payload: 3.9.0 + react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 + react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 + + '@rtsao/[email protected]': + resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} + + '@rushstack/[email protected]': + resolution: {integrity: sha512-WJgX9nzTqknM393q1QJDJmoW28kUfEnybeTfVNcNAPnIx210RXm2DiXiHzfNPJNIUUb1tJnz/l4QGtJ30PgWmA==} + + '@smithy/[email protected]': + resolution: {integrity: sha512-wRlta7GuLWpTqtFfGo+nZyOO1vEvewdNR1R4rTxpC8XU6vG/NDyrFBhwLZsqg1NUoR1noVaXJPC/7ZK47QCySw==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-fsiMgd8toyUba6n1WRmr+qACzXltpdDkPTAaDqc8QqPBUzO+/JKwL6bUBseHVi8tu9l+3JOK+tSf7cay+4B3LA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-2fek3I0KZHWJlRLvRTqxTEri+qV0GRHrJIoLFuBMZB4EMg4WgeBGfF0X6abnrNYpq55KJ6R4D6x4f0vLnhzinA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-BWB9mIukO1wjEOo1Ojgl6LrG4avcaC7T/ZP6ptmAaW4xluhSIPZhY+/PI5YKzlk+jsm+4sQZB45Bt1OfMeQa3w==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-BOWEBeppWhLn/no/JxUL/ghTfANTjT7kg3Ww2rPqTUY9R4yHPXxJ9JhMe3Z03LN3aPwiwlpDIUcVw1xDyHqEhw==} + + '@smithy/[email protected]': + resolution: {integrity: sha512-zLWaC/5aWpMrHKpoDF6nqpNtBhlAYKF/7+9yMN7GpdR8CzohnWfGtMznPybnwSS8saaXBMxIGwJqR4HmRp6b3g==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-nEDASdbKFKPXN2O6lOlTgrEEOO9NHIeO+HVvZnkqc8h5U9g3BIhWsvzFo+UcUbliMHvKNPD/zVxDrkP1Sbgp8Q==} + + '@smithy/[email protected]': + resolution: {integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-5bl2LG1Ah/7E5cMSC+q+h3IpVHMeOkG0yLRyQT1p2aMJkSrZG7RlXHPuAgb7EyaFeidKEnnd/fNaLLaKlHGzDQ==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-1/8kFp6Fl4OsSIVTWHnNjLnTL8IqpIb/D3sTSczrKFnrE9VMNWxnrRKNvpUHOJ6zpGD5f62TPm7+17ilTJpiCQ==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-P2bGufFpFdYcWvqpyqqmalRtwFUNUA8vHjJR5iGqbfR6mp65qKOLcUd6lTr4S9Gn/enynSrSf3p3FVgVAf6bXA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-sIADe7ojwqTyvEQBe1nc/GXB9wdHhi9UwyX0lTyttmUWDJLP655ZYE1WngnNyXREme8I27KCaUhyhZWRXL0q7Q==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-Qntc3jrtwwrsAC+X8wms8zhrTr0sFXnyEGhZd9sLtsJ/6gGQKFzNB+wWbOcpJd7BR8ThNCoKt76BuQahfMvpeA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-0elK5/03a1JPWMDPaS726Iw6LpQg80gFut1tNpPfxFuChEEklo2yL823V94SpTZTxmKlXFtFgsP55uh3dErnIg==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-mVGyPBzkkGQsPoxQUbxlEfRjrj6FPyA3u3u2VXGr9hT8wilsoQdZdvKpMBFMB8Crfhv5dNkKHIW0Yyuc7eABqA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-+xiil2lFhtTRzXkx8F053AV46QnIw6e7MV8od5Mi68E1ICOjCeCHw2XfLnDEUHnT9WGUIkwcqavXjfwuJbGlpg==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-Xy5XK1AFWW2nlY/biWZXu6/krgbaf2dg0q492D8M5qthsnU2H+UgFeZLbM76FnH7s6RO/xhQRkj+T6KBO3JzgQ==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-L1kSeviUWL+emq3CUVSgdogoM/D9QMFaqxL/dd0X7PCNWmPXqt+ExtrBjqT0V7HLN03Vs9SuiLrG3zy3JGnE5A==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-BvHCDrKfbG5Yhbpj4vsbuPV2GgcpHiAkLeIlcA1LtfpMz3jrqizP1+OguSNSj1MwBHEiN+jwNisXLGdajGDQJA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-uBDTIBBEdAQryvHdc5W8sS5YX7RQzF683XrHePVdFmAgKiMofU15FLSM0/HU03hKTnazdNRFa0YHS7+ArwoUSQ==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-WyujUJL8e1B6Z4PBfAqC/aGY1+C7T0w20Gih3yrvJSk97gpiVfB+y7c46T4Nunk+ZngLq0rOIdeVeIklk0R3OA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-ui/NlpILU+6HAQBfJX8BBsDXuKSNrjTSuOYArRblcrErwKFutjrCNb/OExfVRyj9+26F9J+ZmfWT+fKWuDrH3Q==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-jrbSQrYCho0yDaaf92qWgd+7nAeap5LtHTI51KXqmpIFCceKU3K9+vIVTUH72bOJngBMqa4kyu1VJhRcSrk/CQ==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-QwYgloJ0sVNBeBuBs65cIkTbfzV/Q6ZNPCJ99EICFEdJYG50nGIY/uYXp+TbsdJReIuPr0a0kXmCvren3MbRRw==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-hoA4zm61q1mNTpksiSWp2nEl1dt3j726HdRhiNgVJQMj7mLp7dprtF57mOB6JvEk/x9d2bsuL5hlqZbBuHQylQ==} + + '@smithy/[email protected]': + resolution: {integrity: sha512-s3+eVwNeJuXUwuMbusncZNViuhv2LjVJ1nMwTqSA0XAC7gjKhqqxRdJPhR8+YrkoZ9IiIbFk/yK6ACe/xlF+hw==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-dtpw9uQP7W+n3vOtx0CfBD5EWd7EPdIdsQnWTDoFf77e3VUf05uA7R7TGipIo8e4WL2kuPdnsr3hMQn9ziYj5w==} + + '@smithy/[email protected]': + resolution: {integrity: sha512-ITWT1Wqjubf2CJthb0BuT9+bpzBfXeMokH/AAa5EJQgbv9aPMVfnM76iFIZVFf50hYXGbtiV71BHAthNWd6+dw==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-HZkzrRcuFN1k70RLqlNK4FnPXKOpkik1+4JaBoHNJn+RnJGYqaa3c5/+XtLOXhlKzlRgNvyaLieHTW2VwGN0VQ==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-RtKW+8j8skk17SYowucwRUjeh4mCtnm5odCL0Lm2NtHQBsYKrNW0od9Rhopu9wF1gHMfHeWF7i90NwBz/U22Kw==} + engines: {node: '>= 10.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-vkMXHQ0BcLFysBMWgSBLSk3+leMpFSyyFj8zQtv5ZyUBx8/owVh1/pPEkzmW/DR/Gy/5c8vjLDD9gZjXNKbrpA==} + engines: {node: '>= 10.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-BuDHv8zRjsE5zXd3PxFXFknzBG3owCpjq8G3FcsXW3CykYXuEqM3nTSsmLzw5q+T12ZYuDlVUZKBdpNbhVtlrQ==} + engines: {node: '>= 14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-7iKXR+/4TpLK194pVjKiasIyqMtTYJsgKgM242Y9uzt5dhHnUDvMNb+3xIhRJ9QhvqGii/5cRUt4fJn3dtXNHQ==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-L1qpleXf9QD6LwLCJ5jddGkgWyuSvWBkJwWAZ6kFkdifdso+sk3L3O1HdmPvCdnCK3IS4qWyPxev01QMnfHSBw==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-q9+pAFPTfftHXRytmZ7GzLFFrEGavqapFc06XxzZFcSIGERXMerXxCitjOG1prVDR9QdjqotF40SWvbqcCpf8g==} + engines: {node: '>= 14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-17faEXbYWIRst1aU9SvPZyMdWmqIrduZjVOqCPMIsWFNxs5yQQgFrJL6b2SdiCzyW9mJoDjFtgi53xx7EH+BXA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-jtmJMyt1xMD/d8OtbVJ2gFZOSKc+ueYJZPW20ULW1GOp/q/YIM0wNh+u8ZFao9UaIGz4WoPW8hC64qlWLIfoDA==} + engines: {node: '>=14.0.0'} + + '@smithy/[email protected]': + resolution: {integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==} + engines: {node: '>=14.0.0'} + + '@swc/[email protected]': + resolution: {integrity: sha512-NyELPp8EsVZtxH/mEqvzSyWpfPJ1lugpTQcSlMduZLj1EASLO4sC8wt8hmL1aizRlsbjCX+r0PyL+l0xQ64/6Q==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + + '@swc/[email protected]': + resolution: {integrity: sha512-L4BNt1fdQ5ZZhAk5qoDfUnXRabDOXKnXBxMDJ+PWLSxOGBbWE6aJTnu4zbGjJvtot0KM46m2LPAPY8ttknqaZA==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + + '@swc/[email protected]': + resolution: {integrity: sha512-Y1u9OqCHgvVp2tYQAJ7hcU9qO5brDMIrA5R31rwWQIAKDkJKtv3IlTHF0hrbWk1wPR0ZdngkQSJZple7G+Grvw==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + + '@swc/[email protected]': + resolution: {integrity: sha512-tNQHO/UKdtnqjc7o04iRXng1wTUXPgVd8Y6LI4qIbHVoVPwksZydISjMcilKNLKIwOoUQAkxyJ16SlOAeADzhQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/[email protected]': + resolution: {integrity: sha512-x0L2Pd9weQ6n8dI1z1Isq00VHFvpBClwQJvrt3NHzmR+1wCT/gcYl1tp9P5xHh3ldM8Cn4UjWCw+7PaUgg8FcQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/[email protected]': + resolution: {integrity: sha512-yyYEwQcObV3AUsC79rSzN9z6kiWxKAVJ6Ntwq2N9YoZqSPYph+4/Am5fM1xEQYf/kb99csj0FgOelomJSobxQA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/[email protected]': + resolution: {integrity: sha512-tcaS43Ydd7Fk7sW5ROpaf2Kq1zR+sI5K0RM+0qYLYYurvsJruj3GhBCaiN3gkzd8m/8wkqNqtVklWaQYSDsyqA==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/[email protected]': + resolution: {integrity: sha512-D3Qo1voA7AkbOzQ2UGuKNHfYGKL6eejN8VWOoQYtGHHQi1p5KK/Q7V1ku55oxXBsj79Ny5FRMqiRJpVGad7bjQ==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + + '@swc/[email protected]': + resolution: {integrity: sha512-WalYdFoU3454Og+sDKHM1MrjvxUGwA2oralknXkXL8S0I/8RkWZOB++p3pLaGbTvOO++T+6znFbQdR8KRaa7DA==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + + '@swc/[email protected]': + resolution: {integrity: sha512-JWobfQDbTnoqaIwPKQ3DVSywihVXlQMbDuwik/dDWlj33A8oEHcjPOGs4OqcA3RHv24i+lfCQpM3Mn4FAMfacA==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + + '@swc/[email protected]': + resolution: {integrity: sha512-rQ4dS6GAdmtzKiCRt3LFVxl37FaY1cgL9kSUTnhQ2xc3fmHOd7jdJK/V4pSZMG1ruGTd0bsi34O2R0Olg9Zo/w==} + engines: {node: '>=10'} + peerDependencies: + '@swc/helpers': '*' + peerDependenciesMeta: + '@swc/helpers': + optional: true + + '@swc/[email protected]': + resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + + '@swc/[email protected]': + resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} + + '@swc/[email protected]': + resolution: {integrity: sha512-V5gRru+aD8YVyCOMAjMpWR1Ui577DD5KSJsHP8RAxopAH22jFz6GZd/qxqjO6MJHQhcsjvjOFXyDhyLQUnMveQ==} + + '@tokenizer/[email protected]': + resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} + + '@types/[email protected]': + resolution: {integrity: sha512-kG7WrUuAKK0NoyxfQHsVE6j1m01s6kMma64E+OZenQABMQyTJop1DumUWcLwAQ2JzpefU7PDYoRDKl8uZosFjw==} + + '@types/[email protected]': + resolution: {integrity: sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==} + + '@types/[email protected]': + resolution: {integrity: sha512-RvC8KMw5BCac1NvRRyaHgMMEtBaZ6wh0pyPTBu7izn4Sj/AX9Y4aXU5c7rX8PnM/knsuUpC1IeoBkANtxBypsQ==} + + '@types/[email protected]': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + + '@types/[email protected]': + resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + + '@types/[email protected]': + resolution: {integrity: sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==} + + '@types/[email protected]': + resolution: {integrity: sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg==} + + '@types/[email protected]': + resolution: {integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==} + + '@types/[email protected]': + resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} + + '@types/[email protected]': + resolution: {integrity: sha512-hljHij7MpWPKF6u5vojuyfV0YA4YURsQG7KT6SzV0Zs2BXAtgdTxG6A229Ub/xiWV4w/7JL8fi6aAyjshH4meA==} + + '@types/[email protected]': + resolution: {integrity: sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==} + + '@types/[email protected]': + resolution: {integrity: sha512-YW6614BDhqbpR5KtUYzTA+zlA7nayzJRA9ljz9CQoxthR0sDisYZLuvSMsil36t4EH/uAt8T52Xb4sVw17G+SQ==} + + '@types/[email protected]': + resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} + + '@types/[email protected]': + resolution: {integrity: sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==} + + '@types/[email protected]': + resolution: {integrity: sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==} + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-setq5aJgUwtzGrhW177/i+DMLqBaJbdwGj2CPIVFFLE0NCliy5ujIdLHd2D1ysmlmsjdL2GWW+hR85neEfc12w==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw==} + engines: {node: ^16.0.0 || >=18.0.0} + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-8m16fwAcEnQc69IpeDyokNO+D5spo0w1jepWWY2Q6y5ZKNuj5EhVQXjtVAeDDqvW6Yg7dhclbsz6rTtOvcwpHg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==} + engines: {node: ^16.0.0 || >=18.0.0} + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-mPHFoNa2bPIWWglWYdR0QfY9GN0CfvvXX1Sv6DlSTive3jlMTUy+an67//Gysc+0Me9pjitrq0LJp0nGtLgftw==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + + '@typescript-eslint/[email protected]': + resolution: {integrity: sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==} + engines: {node: ^16.0.0 || >=18.0.0} + + '@ungap/[email protected]': + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + + [email protected]: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + + [email protected]: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + + [email protected]: + resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==} + + [email protected]: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + [email protected]: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + + [email protected]: + resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} + + [email protected]: + resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} + engines: {node: '>=8.0.0'} + + [email protected]: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} + engines: {node: '>=10', npm: '>=6'} + + [email protected]: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + [email protected]: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==} + + [email protected]: + resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} + + [email protected]: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + + [email protected]: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-vgnKAUzcDoa+AeyYwXCoHyF2q6u/8H46dxu5JN+4/TZeq/Dlinn0K6GvxsCLb3LHUJl0m/TLiEK31kUwtgocMQ==} + + [email protected]: + resolution: {integrity: sha512-P92xmHDQjSKPLHqFxefqMxASNq/aWJMEZugpCjf+AF/pgcUpMMQCg7t7+ewko0/u8AapvF3luf/FoehddEK+sA==} + engines: {node: '>=16.20.1'} + + [email protected]: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + + [email protected]: + resolution: {integrity: sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==} + + [email protected]: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} + + [email protected]: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + + [email protected]: + resolution: {integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} + + [email protected]: + resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + + [email protected]: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + + [email protected]: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + [email protected]: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + [email protected]: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + [email protected]: + resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} + + [email protected]: + resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} + engines: {node: '>=12.5.0'} + + [email protected]: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + + [email protected]: + resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + + [email protected]: + resolution: {integrity: sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==} + + [email protected]: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + [email protected]: + resolution: {integrity: sha512-wKGOQRRvdnd89pCeH96e2Fn4wkbenSP6LMHfjfyNLMbGuHEFbMqQNuxXqd0oXG9caIOQ1FTvc5Uijp9/4jujnQ==} + + [email protected]: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + + [email protected]: + resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-onMB0OkDjkXunhdW9htFjEhqrD54+M94i6ackoUkjHKbRnXdyEyKRelp4nJ1kAz32+s27jP1FsebpJCVl0BsvA==} + engines: {node: '>=18.0'} + + [email protected]: + resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} + engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + + [email protected]: + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} + + [email protected]: + resolution: {integrity: sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==} + + [email protected]: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + + [email protected]: + resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} + + [email protected]: + resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-y2krtASINtPFS1rSDjacrFgn1dcUuoREVabwlOGOe4SdxenREqwjwjElAdwvbGM7kgZz9a3KVicWR7vcz8rnzA==} + + [email protected]: + resolution: {integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==} + + [email protected]: + resolution: {integrity: sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==} + + [email protected]: + resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} + + [email protected]: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + [email protected]: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + [email protected]: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + [email protected]: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + [email protected]: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} + engines: {node: '>=0.3.1'} + + [email protected]: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + + [email protected]: + resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==} + + [email protected]: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + + [email protected]: + resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} + + [email protected]: + resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} + engines: {node: '>=10.13.0'} + + [email protected]: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + + [email protected]: + resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Ifco6n3yj2tMZDWNLyloZrytt9lqqlwvS83P3HtaETR0NUOYnIULGGHpktqYGObGy+8wc1okO25p8TjemhImvA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-tpxqxncxnpw3c93u8n3VOzACmRFoVmWJqbWXvX/JfKbkhBw1oslgPrUfeSt2psuqyEJFD6N/9lg5i7bsKpoq+Q==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} + + [email protected]: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==} + engines: {node: '>=18'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + [email protected]: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-PrMm1/4zWSJ689wd/ypWIR5ZF1uvmp3EkgpgBV1Yu6PhEobBjXMGgT8bVNelwl17LXojO8D5ePFRiI4qXjsPRA==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 || ^9.0.0 + typescript: '>=3.3.1' + peerDependenciesMeta: + typescript: + optional: true + + [email protected]: + resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} + + [email protected]: + resolution: {integrity: sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' + eslint-plugin-import-x: '*' + peerDependenciesMeta: + eslint-plugin-import: + optional: true + eslint-plugin-import-x: + optional: true + + [email protected]: + resolution: {integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + + [email protected]: + resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + + [email protected]: + resolution: {integrity: sha512-scB3nz4WmG75pV8+3eRUQOHZlNSUhFNq37xnpgRkCCELU3XMvXAxLk1eqWWyE22Ki4Q01Fnsw9BA3cJHDPgn2Q==} + engines: {node: '>=4.0'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 + + [email protected]: + resolution: {integrity: sha512-mpJRtPgHN2tNAvZ35AMfqeB3Xqeo273QxrHJsbBEPWODRM4r0yB6jfoROqKEYrOn27UtRPpcpHc2UqyBSuUNTw==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 + + [email protected]: + resolution: {integrity: sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w==} + engines: {node: '>=4'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 + + [email protected]: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + [email protected]: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + [email protected]: + resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + + [email protected]: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} + engines: {node: '>=0.10'} + + [email protected]: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + + [email protected]: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + [email protected]: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==} + + [email protected]: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + [email protected]: + resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} + engines: {node: '>=8.6.0'} + + [email protected]: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} + engines: {node: '>=8.6.0'} + + [email protected]: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + [email protected]: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + [email protected]: + resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + + [email protected]: + resolution: {integrity: sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==} + + [email protected]: + resolution: {integrity: sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + + [email protected]: + resolution: {integrity: sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + + [email protected]: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + + [email protected]: + resolution: {integrity: sha512-mROwiKLZf/Kwa/2Rol+OOZQn1eyTkPB3ZTwC0ExY6OLFCbgxHYZvBm7xI77NvfZFMKBsmuXfmLJnD4eEftEhrA==} + engines: {node: '>=18'} + + [email protected]: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} + + [email protected]: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} + engines: {node: ^10.12.0 || >=12.0.0} + + [email protected]: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + + [email protected]: + resolution: {integrity: sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==} + + [email protected]: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + + [email protected]: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + [email protected]: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + [email protected]: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + [email protected]: + resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-2g4x+HqTJKM9zcJqBSpjoRmdcPFtJM60J3xJisTQSXBWka5XqyBN/2tNUgma1mztTXyDuUsEtYe5qcs7xYzYQA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + + [email protected]: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==} + + [email protected]: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + [email protected]: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + [email protected]: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + + [email protected]: + resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + + [email protected]: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + [email protected]: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + + [email protected]: + resolution: {integrity: sha512-4Jor+LRbA7SfSaw7dfDUs2UBzvWg3cKrykfHRgKsOIvQaLuf+QOcG2t3Mx5N9GzSNJcuqMqJWz0ta5+BryEmXg==} + engines: {node: '>=12'} + peerDependencies: + graphql: '>=0.11 <=16' + + [email protected]: + resolution: {integrity: sha512-tpCujhsJMva4aqE8ULnF7/l3xw4sNRZcSHu+R00VV+W0mfp+Q20Plvcrp+5UXD+2yS6oyCXncA+zoQJQqhGCEw==} + + [email protected]: + resolution: {integrity: sha512-my9FB4GtghqXqi/lWSVAOPiTzTnnEzdOXCsAC2bb5V7EFNQjVjwy3cSSbUvgYOtDuDibd+ZsCDhz+4eykYOlhQ==} + engines: {node: '>=10'} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + [email protected]: + resolution: {integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + + [email protected]: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + + [email protected]: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + + [email protected]: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==} + + [email protected]: + resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} + + [email protected]: + resolution: {integrity: sha512-oUExvfNckrpTpDazph7kNG8sQi5au3BeTo0idaZFXEhTaJKu7GNJCLHI0rYY2wljm548MSTM+Ljj/c6anqu2zQ==} + engines: {node: '>= 0.4.0'} + + [email protected]: + resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} + + [email protected]: + resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} + engines: {node: '>= 4'} + + [email protected]: + resolution: {integrity: sha512-541xKlUw6jr/6gGuk92F+mYM5zaFAc5ahphvkqvNe2bQ6gVBkd6bfrmVJ2t4KDAfikAYZyIqTnktX3i6/aQDrQ==} + engines: {node: '>=16.x'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} + + [email protected]: + resolution: {integrity: sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==} + + [email protected]: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + [email protected]: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + + [email protected]: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + [email protected]: + resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} + engines: {node: '>= 12'} + + [email protected]: + resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + + [email protected]: + resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} + + [email protected]: + resolution: {integrity: sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + + [email protected]: + resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==} + + [email protected]: + resolution: {integrity: sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==} + + [email protected]: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} + + [email protected]: + resolution: {integrity: sha512-urTSINYfAYgcbLb0yDQ6egFm6h3Mo1DcF9EkyXSRjjzdHbsulg01qhwWuXdOoUBuTkbQ80KDboXa0vFJ+BDH+g==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-qs3NZ1INIS+H+yeo7cD9pDfwYV/jqRh1JG9S9zYrNudkoUQg7OL7ziXqRKu+InFjUIDoP2o6HIkLYMh1pcWgyQ==} + + [email protected]: + resolution: {integrity: sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==} + + [email protected]: + resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + [email protected]: + resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + + [email protected]: + resolution: {integrity: sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + + [email protected]: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + [email protected]: + resolution: {integrity: sha512-x4WH0BWmrMmg4oHHl+duwubhrvczGlyuGAZu3nvrf0UXOfPu8IhZObFEr7DE/iv01YgVZrsOiRcqw2srkKEDIA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==} + + [email protected]: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + [email protected]: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} + + [email protected]: + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + + [email protected]: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + + [email protected]: + resolution: {integrity: sha512-iOKdzTUWEVM4nlxpFudFsWyUiu/Jakkga4OZPEt7CGoSEsAsUgdOZqR6pcgx2STBek9Gm4hcarJpXSzIvZ/hKA==} + engines: {node: '>=16.0.0'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + [email protected]: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + [email protected]: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + [email protected]: + resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} + engines: {node: '>=4.0'} + + [email protected]: + resolution: {integrity: sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==} + engines: {node: '>=12.0.0'} + + [email protected]: + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} + + [email protected]: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} + + [email protected]: + resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} + engines: {node: '>=0.10'} + + [email protected]: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + + [email protected]: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + [email protected]: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + [email protected]: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + + [email protected]: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==} + + [email protected]: + resolution: {integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==} + + [email protected]: + resolution: {integrity: sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==} + + [email protected]: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + [email protected]: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + + [email protected]: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + + [email protected]: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + + [email protected]: + resolution: {integrity: sha512-goSDElNqFfw7iDHMg8WDATkfcyeLTNpBHQpO8incK6p5qZt5G/1j41X0xdGzpIkGojGXM+QiRQyLjnfDVvrpwA==} + + [email protected]: + resolution: {integrity: sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==} + + [email protected]: + resolution: {integrity: sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg==} + engines: {node: '>=16.20.1'} + peerDependencies: + '@aws-sdk/credential-providers': ^3.188.0 + '@mongodb-js/zstd': ^1.1.0 + gcp-metadata: ^5.2.0 + kerberos: ^2.0.1 + mongodb-client-encryption: '>=6.0.0 <7' + snappy: ^7.2.2 + socks: ^2.7.1 + peerDependenciesMeta: + '@aws-sdk/credential-providers': + optional: true + '@mongodb-js/zstd': + optional: true + gcp-metadata: + optional: true + kerberos: + optional: true + mongodb-client-encryption: + optional: true + snappy: + optional: true + socks: + optional: true + + [email protected]: + resolution: {integrity: sha512-Ai478tHedZy3U2ITBEp2H4rQEviRan3TK4p/umlFqIzgPF1R0hNKvzzQGIb1l2h+Z32QLU3NqaoWKu4vOOUElQ==} + engines: {node: '>=4.0.0'} + + [email protected]: + resolution: {integrity: sha512-kFxhot+yw9KmpAGSSrF/o+f00aC2uawgNUbhyaM0USS9L7dln1NA77/pLg4lgOaRgXMtfgCENamjqZwIM1Zrig==} + engines: {node: '>=4.0.0'} + + [email protected]: + resolution: {integrity: sha512-/I4n/DcXqXyIiLRfAmUIiTjj3vXfeISke8dt4U4Y8Wfm074Wa6sXnQrXN49NFOFf2mM1kUdOXryoBvkuCnr+Qw==} + engines: {node: '>=16.20.1'} + + [email protected]: + resolution: {integrity: sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==} + engines: {node: '>=4.0.0'} + + [email protected]: + resolution: {integrity: sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==} + engines: {node: '>=14.0.0'} + + [email protected]: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + [email protected]: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + [email protected]: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + [email protected]: + resolution: {integrity: sha512-nLJDV7peNy+0oHlmY2JZjzMfJ8Aj0/dd3jCwSZS8ZiO5nkQfcZRqDrRN3U5rJtqVTQneIOGZzb6LCNrk7trMCQ==} + engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} + hasBin: true + peerDependencies: + '@opentelemetry/api': ^1.1.0 + '@playwright/test': ^1.41.2 + babel-plugin-react-compiler: '*' + react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 + react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0 + sass: ^1.3.0 + peerDependenciesMeta: + '@opentelemetry/api': + optional: true + '@playwright/test': + optional: true + babel-plugin-react-compiler: + optional: true + sass: + optional: true + + [email protected]: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==} + + [email protected]: + resolution: {integrity: sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-QiM9D0NiU5jV6J6tjE1g7b4Z2tcUnKs1OPUi4iMb2zH+7jwlcUrASghgkFk9GtzqNNq8rTQJtT8AzjBAvLoNMw==} + + [email protected]: + resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} + engines: {node: '>=14.0.0'} + + [email protected]: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + + [email protected]: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} + engines: {node: '>= 0.8.0'} + + [email protected]: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + [email protected]: + resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} + + [email protected]: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-7RYx64ZHyEXJCgNpzGBgzpwDYCBRQUqKhfB8FhozQQ6OHn9uOHTn6htUngfx0/d0ijSdoDsK8cyMFD09xUfuPw==} + engines: {node: ^18.20.2 || >=20.9.0} + hasBin: true + peerDependencies: + graphql: ^16.8.1 + + [email protected]: + resolution: {integrity: sha512-GVlENSDW6KHaXcd9zkZltB7tCLosKB/4Hg0fqBJkAoBgYG2Tn1xtMgXtSUuMU9AK/gCm/tTdT8mgAeF4YNeeqw==} + engines: {node: '>=14.16'} + + [email protected]: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + [email protected]: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + [email protected]: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + + [email protected]: + resolution: {integrity: sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw==} + + [email protected]: + resolution: {integrity: sha512-cQBBIVG3YajgoUjo1FdKVRX6t9XPxwB9lcNJVD5GCnNM4Y6T12YYx8c6zEejxQsU0wrg9TwmDulcE9LR7qcJqA==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==} + + [email protected]: + resolution: {integrity: sha512-xSEmD4pLnV54t0NOUN16yCl7RIB1c5UUOse5HSyEXtBp+FgFQyPeDutc+Q2ZO7/22vImV7VfEjH/1zV2QuqvYw==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} + engines: {node: ^10 || ^12 || >=14} + + [email protected]: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + [email protected]: + resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} + engines: {node: '>=14'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-/MyYDxttz7DfGMMHiysAsFE4qF+pQYAA8ziO/3NcRVrQ5fSk+Mns4QZA/oRPFzvcqNoVJXQNWNAsdwBXLUkQKw==} + + [email protected]: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + + [email protected]: + resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + + [email protected]: + resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + + [email protected]: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-D8NAthKSD7SGn748v+GLaaO6k08Mvpoqroa35PqIQC4gtUa8/Pb/k+r0m0NnGBVbHDP1gKZ2nVywqfMisRhV5A==} + engines: {node: '>=18'} + + [email protected]: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + [email protected]: + resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} + + [email protected]: + resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} + + [email protected]: + resolution: {integrity: sha512-6MzeamV8cWSOcduwePHfGqY40acuGlS1cG//ePHT6bVbLxWyqngaStenfH03n1wbzOibFggF66kWaBTb1SbTtQ==} + peerDependencies: + react: ^16.9.0 || ^17 || ^18 + react-dom: ^16.9.0 || ^17 || ^18 + + [email protected]: + resolution: {integrity: sha512-GrzyqQnjIMoej+jMjWvtVSsQqhXgzEGqpXlJ2dAGfOk7Q26qcm8Gu6xtI430PBUyZsERe8BJSQf+7VZZo8IBNQ==} + engines: {node: '>= 8'} + peerDependencies: + react: ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react-dom: ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + + [email protected]: + resolution: {integrity: sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==} + peerDependencies: + react: ^19.0.0 + + [email protected]: + resolution: {integrity: sha512-cvJ/wbHdhYx8aviSWh28w9ImjmVsb5Y05n1+FW786vEZQJV5STNM0pW6ujS+oiBecb0ARBxJFyAnXj9+GHXACQ==} + engines: {node: '>=12.22.0'} + peerDependencies: + react: ^16.8.0 || ^17 || ^18 + + [email protected]: + resolution: {integrity: sha512-4rb8XtXNx7ZaOZarKKnckgz4xLMvds/YrU6mpJfGhGAsy2Mg4mIw1x+DCCGngVGq2soTBVVOxx2s/C6mTX9+pA==} + peerDependencies: + react: '>=16.13.1' + + [email protected]: + resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + + [email protected]: + resolution: {integrity: sha512-nwRKGanVHGjdccsnzhFte/PULziueZxGD8LL2WojON78Mvnq7LdAMEtu2frrwld1fr3geixg3iiMBIc/LLAZpw==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + + [email protected]: + resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==} + peerDependencies: + react: '>=16.6.0' + react-dom: '>=16.6.0' + + [email protected]: + resolution: {integrity: sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + [email protected]: + resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} + engines: {node: '>= 12.13.0'} + + [email protected]: + resolution: {integrity: sha512-r0Ay04Snci87djAsI4U+WNRcSw5S4pOH7qFjd/veA5gC7TbqESR3tcj28ia95L/fYUDw11JKP7uqUKUAfVvV5Q==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} + + [email protected]: + resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + + [email protected]: + resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + [email protected]: + resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + engines: {node: '>=0.4'} + + [email protected]: + resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} + engines: {node: '>=0.4'} + + [email protected]: + resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==} + + [email protected]: + resolution: {integrity: sha512-vcF3Ckow6g939GMA4PeU7b2K/9FALXk2KF9J87txdHzXbUF9XRQRwSxcAs/fGaTnJeBFd7UoV22j3lzMLdM0Pw==} + engines: {node: '>=14.0.0'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==} + + [email protected]: + resolution: {integrity: sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==} + + [email protected]: + resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==} + + [email protected]: + resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} + + [email protected]: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==} + engines: {node: '>=10'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==} + engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} + + [email protected]: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==} + + [email protected]: + resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} + + [email protected]: + resolution: {integrity: sha512-xMO/8eNREtaROt7tJvWJqHBDTMFN4eiQ5I4JRMuilwfnFcV5W9u7RUkueNkdw0jPqGMX36iCywelS5yilTuOxg==} + + [email protected]: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + + [email protected]: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-OxObL9tbhgwvSlnKSCpGIh7wnuaqvOj5jRExGjEyCU2Ke8ctf22HjT+jw7GEi9ttLzNTUmTEU3YIzqKGeqN+og==} + peerDependencies: + slate: '>=0.65.3' + + [email protected]: + resolution: {integrity: sha512-A/jvoLTAgeRcJaUPQCYOikCJxSws6+/jkL7mM+QuZljNd7EA5YqafGA7sVBJRFpcoSsDRUIah1yNiC/7vxZPYg==} + peerDependencies: + slate: '>=0.65.3' + + [email protected]: + resolution: {integrity: sha512-xEDKu5RKw5f0N95l1UeNQnrB0Pxh4JPjpIZR/BVsMo0ININnLAknR99gLo46bl/Ffql4mr7LeaxQRoXxbFtJOQ==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + slate: '>=0.65.3' + + [email protected]: + resolution: {integrity: sha512-aUJ3rpjrdi5SbJ5G1Qjr3arytfRkEStTmHjBfWq2A2Q8MybacIzkScSvGJjQkdTk3djCK9C9SEOt39sSeZFwTw==} + + [email protected]: + resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} + engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} + + [email protected]: + resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==} + engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} + + [email protected]: + resolution: {integrity: sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==} + + [email protected]: + resolution: {integrity: sha512-b6LHBfH32SoVasRFECrdY8p8s7hXPDn3OHUFbZZbiB1ctLS9Gdh6rpX2dVrpQA0kiL5jcRzDDldwwLkSKk3+QQ==} + peerDependencies: + react: ^18.0.0 || ^19.0.0 || ^19.0.0-rc + react-dom: ^18.0.0 || ^19.0.0 || ^19.0.0-rc + + [email protected]: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} + engines: {node: '>=0.10.0'} + + [email protected]: + resolution: {integrity: sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==} + + [email protected]: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + + [email protected]: + resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + + [email protected]: + resolution: {integrity: sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==} + + [email protected]: + resolution: {integrity: sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==} + + [email protected]: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + + [email protected]: + resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==} + + [email protected]: + resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} + + [email protected]: + resolution: {integrity: sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} + + [email protected]: + resolution: {integrity: sha512-ExzDvHYPj6F6QkSNe/JxSlBxTh3OrI6wrAIz53ulxo1c4hBJ1bT9C/JrAthEKHWG9riVH3Xzg7B03Oxty6S2Lw==} + engines: {node: '>=16'} + + [email protected]: + resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + + [email protected]: + resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} + + [email protected]: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + + [email protected]: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==} + + [email protected]: + resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} + engines: {node: '>=6'} + + [email protected]: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + [email protected]: + resolution: {integrity: sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A==} + + [email protected]: + resolution: {integrity: sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA==} + + [email protected]: + resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==} + + [email protected]: + resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} + engines: {node: '>=12.0.0'} + + [email protected]: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + + [email protected]: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + [email protected]: + resolution: {integrity: sha512-lbDrTLVsHhOMljPscd0yitpozq7Ga2M5Cvez5AjGg8GASBjtt6iERCAJ93yommPmz62fb45oFIXHEZ3u9bfJEA==} + engines: {node: '>=14.16'} + + [email protected]: + resolution: {integrity: sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==} + engines: {node: '>=14'} + + [email protected]: + resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==} + + [email protected]: + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + engines: {node: '>=16'} + peerDependencies: + typescript: '>=4.2.0' + + [email protected]: + resolution: {integrity: sha512-/FrVAZ76JLTWxJOERk04fm8hYENDo0PWSP3YLQKxevLwWtxemGcl5JJEzN4iqfDlRve0ckyfFaOBu4xbNH/wZw==} + peerDependencies: + typescript: '>=4.5.0' + peerDependenciesMeta: + typescript: + optional: true + + [email protected]: + resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} + + [email protected]: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + + [email protected]: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + + [email protected]: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + + [email protected]: + resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} + engines: {node: '>=18.0.0'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + + [email protected]: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + + [email protected]: + resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==} + engines: {node: '>=14.17'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-ZPtzy0hu4cZjv3z5NW9gfKnNLjoz4y6uv4HlelAjDK7sY/xOkKZv9xK/WQpcsBB3jEybChz9DPC2U/+cusjJVQ==} + engines: {node: '>=18'} + + [email protected]: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + + [email protected]: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + + [email protected]: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + [email protected]: + resolution: {integrity: sha512-owfuSmUNd3eNp3J9CdDl0kMgfidV+MkDvHPpvthN5ThqM+ibMccNE0k+Iq7TWC6JPFvGZqanqiGCuQx6DyV24g==} + peerDependencies: + react: '>=18.0.0' + scheduler: '>=0.19.0' + + [email protected]: + resolution: {integrity: sha512-q6ayo8DWoPZT0VdG4u3D3uxcgONP3Mevx2i2b0434cwWBoL+aelL1DzkXI6w3PhTZzUeR2kaVlZn70iCiseP6w==} + peerDependencies: + '@types/react': '*' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + + [email protected]: + resolution: {integrity: sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==} + + [email protected]: + resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + + [email protected]: + resolution: {integrity: sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==} + engines: {node: '>=16'} + + [email protected]: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + + [email protected]: + resolution: {integrity: sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==} + engines: {node: '>= 0.4'} + + [email protected]: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + [email protected]: + resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + + [email protected]: + resolution: {integrity: sha512-FVdlVVC67WOIPvfOwhoMETV72f6GbW7aOabBC3WxN/oUdoEMDyLz4OgRv5/gck2ZeNqEQu+Tb0kloovXOfpYVg==} + engines: {node: '>= 0.10.0'} + hasBin: true + + [email protected]: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + + [email protected]: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + + [email protected]: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + +snapshots: + + '@aashutoshrathi/[email protected]': {} + + '@apidevtools/[email protected]': + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.0 -packages: - /@aashutoshrathi/[email protected]: - resolution: - { - integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==, - } - engines: { node: '>=0.10.0' } - dev: true - - /@aws-crypto/[email protected]: - resolution: - { - integrity: sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==, - } - requiresBuild: true + '@aws-crypto/[email protected]': dependencies: tslib: 1.14.1 - dev: false optional: true - /@aws-crypto/[email protected]: - resolution: - { - integrity: sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==, - } - requiresBuild: true + '@aws-crypto/[email protected]': dependencies: '@aws-crypto/ie11-detection': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 @@ -106,53 +3044,28 @@ packages: '@aws-sdk/util-locate-window': 3.535.0 '@aws-sdk/util-utf8-browser': 3.259.0 tslib: 1.14.1 - dev: false optional: true - /@aws-crypto/[email protected]: - resolution: - { - integrity: sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==, - } - requiresBuild: true + '@aws-crypto/[email protected]': dependencies: '@aws-crypto/util': 3.0.0 '@aws-sdk/types': 3.535.0 tslib: 1.14.1 - dev: false optional: true - /@aws-crypto/[email protected]: - resolution: - { - integrity: sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==, - } - requiresBuild: true + '@aws-crypto/[email protected]': dependencies: tslib: 1.14.1 - dev: false optional: true - /@aws-crypto/[email protected]: - resolution: - { - integrity: sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==, - } - requiresBuild: true + '@aws-crypto/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@aws-sdk/util-utf8-browser': 3.259.0 tslib: 1.14.1 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-HWd7PyXCuY1Z9KBaufbzpIvS2QeUAak5wfYwylW2DrEvt6A4tjWCBSbbSXNoawqCv/HitA39v953N/1PojJVVQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 @@ -196,18 +3109,9 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - aws-crt - dev: false optional: true - /@aws-sdk/[email protected](@aws-sdk/[email protected]): - resolution: - { - integrity: sha512-AXKd2TB6nNrksu+OfmHl8uI07PdgzOo4o8AxoRO8SHlwoMAGvcT9optDGVSYoVfgOKTymCoE7h8/UoUfPc11wQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true - peerDependencies: - '@aws-sdk/credential-provider-node': ^3.556.0 + '@aws-sdk/[email protected](@aws-sdk/[email protected])': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 @@ -251,16 +3155,9 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - aws-crt - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-unXdWS7uvHqCcOyC1de+Fr8m3F2vMg2m24GPea0bg7rVGTYmiyn9mhUX11VCt+ozydrw+F50FQwL6OqoqPocmw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 @@ -302,18 +3199,9 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - aws-crt - dev: false optional: true - /@aws-sdk/[email protected](@aws-sdk/[email protected]): - resolution: - { - integrity: sha512-TsK3js7Suh9xEmC886aY+bv0KdLLYtzrcmVt6sJ/W6EnDXYQhBuKYFhp03NrN2+vSvMGpqJwR62DyfKe1G0QzQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true - peerDependencies: - '@aws-sdk/credential-provider-node': ^3.556.0 + '@aws-sdk/[email protected](@aws-sdk/[email protected])': dependencies: '@aws-crypto/sha256-browser': 3.0.0 '@aws-crypto/sha256-js': 3.0.0 @@ -356,16 +3244,9 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - aws-crt - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-vJaSaHw2kPQlo11j/Rzuz0gk1tEaKdz+2ser0f0qZ5vwFlANjt08m/frU17ctnVKC1s58bxpctO/1P894fHLrA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@smithy/core': 1.4.2 '@smithy/protocol-http': 3.3.0 @@ -374,16 +3255,9 @@ packages: '@smithy/types': 2.12.0 fast-xml-parser: 4.2.5 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-PKYBjfpLHJZhrIv0M9eJ47yeDaV8NUMVe4vsiHG5tvlvwWGP84k9GJlr51U/s84OzIyXzVpiqP8PU5yKovUFIg==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/client-cognito-identity': 3.556.0 '@aws-sdk/types': 3.535.0 @@ -392,31 +3266,17 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - aws-crt - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-XppwO8c0GCGSAvdzyJOhbtktSEaShg14VJKg8mpMa1XcgqzmcqqHQjtDWbx5rZheY1VdpXZhpEzJkB6LpQejpA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/property-provider': 2.2.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-vsmu7Cz1i45pFEqzVb4JcFmAmVnWFNLsGheZc8SCptlqCO5voETrZZILHYIl4cjKkSDk3pblBOf0PhyjqWW6WQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/fetch-http-handler': 2.5.0 @@ -427,16 +3287,9 @@ packages: '@smithy/types': 2.12.0 '@smithy/util-stream': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected](@aws-sdk/[email protected]): - resolution: - { - integrity: sha512-0Nz4ErOlXhe3muxWYMbPwRMgfKmVbBp36BAE2uv/z5wTbfdBkcgUwaflEvlKCLUTdHzuZsQk+BFS/gVyaUeOuA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected](@aws-sdk/[email protected])': dependencies: '@aws-sdk/client-sts': 3.556.0(@aws-sdk/[email protected]) '@aws-sdk/credential-provider-env': 3.535.0 @@ -452,16 +3305,9 @@ packages: transitivePeerDependencies: - '@aws-sdk/credential-provider-node' - aws-crt - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-s1xVtKjyGc60O8qcNIzS1X3H+pWEwEfZ7TgNznVDNyuXvLrlNWiAcigPWGl2aAkc8tGcsSG0Qpyw2KYC939LFg==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/credential-provider-env': 3.535.0 '@aws-sdk/credential-provider-http': 3.552.0 @@ -477,32 +3323,18 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - aws-crt - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-9O1OaprGCnlb/kYl8RwmH7Mlg8JREZctB8r9sa1KhSsWFq/SWO0AuJTyowxD7zL5PkeS4eTvzFFHWCa3OO5epA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/property-provider': 2.2.0 '@smithy/shared-ini-file-loader': 2.4.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected](@aws-sdk/[email protected]): - resolution: - { - integrity: sha512-ETuBgcnpfxqadEAqhQFWpKoV1C/NAgvs5CbBc5EJbelJ8f4prTdErIHjrRtVT8c02MXj92QwczsiNYd5IoOqyw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected](@aws-sdk/[email protected])': dependencies: '@aws-sdk/client-sso': 3.556.0 '@aws-sdk/token-providers': 3.556.0(@aws-sdk/[email protected]) @@ -514,16 +3346,9 @@ packages: transitivePeerDependencies: - '@aws-sdk/credential-provider-node' - aws-crt - dev: false optional: true - /@aws-sdk/[email protected](@aws-sdk/[email protected]): - resolution: - { - integrity: sha512-R/YAL8Uh8i+dzVjzMnbcWLIGeeRi2mioHVGnVF+minmaIkCiQMZg2HPrdlKm49El+RljT28Nl5YHRuiqzEIwMA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected](@aws-sdk/[email protected])': dependencies: '@aws-sdk/client-sts': 3.556.0(@aws-sdk/[email protected]) '@aws-sdk/types': 3.535.0 @@ -533,16 +3358,9 @@ packages: transitivePeerDependencies: - '@aws-sdk/credential-provider-node' - aws-crt - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-CnWP/AEF+sPeO8fabrHy4Oeo52xDFuDQMpjKcI7oJzGF6Ne2ZPTq6wTJQPLeXeg4OzLcK0tT3G4z/27MLdsLsw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/client-cognito-identity': 3.556.0 '@aws-sdk/client-sso': 3.556.0 @@ -562,76 +3380,41 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - aws-crt - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-0h6TWjBWtDaYwHMQJI9ulafeS4lLaw1vIxRjbpH0svFRt6Eve+Sy8NlVhECfTU2hNz/fLubvrUxsXoThaLBIew==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/protocol-http': 3.3.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-huNHpONOrEDrdRTvSQr1cJiRMNf0S52NDXtaPzdxiubTkP+vni2MohmZANMOai/qT0olmEVX01LhZ0ZAOgmg6A==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-am2qgGs+gwqmR4wHLWpzlZ8PWhm4ktj5bYSgDrsOfjhdBlWNxvPoID9/pDAz5RWL48+oH7I6SQzMqxXsFDikrw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/protocol-http': 3.3.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-8Rd6wPeXDnOYzWj1XCmOKcx/Q87L0K1/EHqOBocGjLVbN3gmRxBvpmR1pRTjf7IsWfnnzN5btqtcAkfDPYQUMQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@aws-sdk/util-endpoints': 3.540.0 '@smithy/protocol-http': 3.3.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-IXOznDiaItBjsQy4Fil0kzX/J3HxIOknEphqHbOfUf+LpA5ugcsxuQQONrbEQusCBnfJyymrldBvBhFmtlU9Wg==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/node-config-provider': 2.3.0 @@ -639,16 +3422,9 @@ packages: '@smithy/util-config-provider': 2.3.0 '@smithy/util-middleware': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected](@aws-sdk/[email protected]): - resolution: - { - integrity: sha512-tvIiugNF0/+2wfuImMrpKjXMx4nCnFWQjQvouObny+wrif/PGqqQYrybwxPJDvzbd965bu1I+QuSv85/ug7xsg==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected](@aws-sdk/[email protected])': dependencies: '@aws-sdk/client-sso-oidc': 3.556.0(@aws-sdk/[email protected]) '@aws-sdk/types': 3.535.0 @@ -659,237 +3435,109 @@ packages: transitivePeerDependencies: - '@aws-sdk/credential-provider-node' - aws-crt - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-aY4MYfduNj+sRR37U7XxYR8wemfbKP6lx00ze2M2uubn7mZotuVrWYAafbMSXrdEMSToE5JDhr28vArSOoLcSg==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-1kMyQFAWx6f8alaI6UT65/5YW/7pDWAKAdNwL6vuJLea03KrZRX3PMoONOSJpAS5m3Ot7HlWZvf3wZDNTLELZw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/types': 2.12.0 '@smithy/util-endpoints': 1.2.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-PHJ3SL6d2jpcgbqdgiPxkXpu7Drc2PYViwxSIqvvMKhDwzSB1W3mMvtpzwKM4IE7zLFodZo0GKjJ9AsoXndXhA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-RWMcF/xV5n+nhaA/Ff5P3yNP3Kur/I+VNZngog4TEs92oB/nwOdAg/2JL8bVAhUbMrjTjpwm7PItziYFQoqyig==, - } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/types': 2.12.0 bowser: 2.11.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-dRek0zUuIT25wOWJlsRm97nTkUlh1NDcLsQZIN2Y8KxhwoXXWtJs5vaDPT+qAg+OpcNj80i1zLR/CirqlFg/TQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true - peerDependencies: - aws-crt: '>=1.0.0' - peerDependenciesMeta: - aws-crt: - optional: true + '@aws-sdk/[email protected]': dependencies: '@aws-sdk/types': 3.535.0 '@smithy/node-config-provider': 2.3.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@aws-sdk/[email protected]: - resolution: - { - integrity: sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==, - } - requiresBuild: true + '@aws-sdk/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@babel/[email protected]: - resolution: - { - integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==, - } - engines: { node: '>=6.9.0' } + '@babel/[email protected]': dependencies: '@babel/highlight': 7.24.2 picocolors: 1.0.0 - dev: false - /@babel/[email protected]: - resolution: - { - integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==, - } - engines: { node: '>=6.9.0' } + '@babel/[email protected]': dependencies: '@babel/types': 7.24.0 - dev: false - - /@babel/[email protected]: - resolution: - { - integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==, - } - engines: { node: '>=6.9.0' } - dev: false - - /@babel/[email protected]: - resolution: - { - integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==, - } - engines: { node: '>=6.9.0' } - dev: false - - /@babel/[email protected]: - resolution: - { - integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==, - } - engines: { node: '>=6.9.0' } + + '@babel/[email protected]': {} + + '@babel/[email protected]': {} + + '@babel/[email protected]': dependencies: '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.0.0 - dev: false - /@babel/[email protected]: - resolution: - { - integrity: sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==, - } - engines: { node: '>=6.9.0' } + '@babel/[email protected]': dependencies: regenerator-runtime: 0.14.1 - /@babel/[email protected]: - resolution: - { - integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==, - } - engines: { node: '>=6.9.0' } + '@babel/[email protected]': dependencies: '@babel/helper-string-parser': 7.24.1 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - dev: false - /@bcherny/[email protected]: - resolution: - { - integrity: sha512-vmEmnJCfpkLdas++9OYg6riIezTYqTHpqUTODJzHLzs5UnXujbOJW9VwcVCnyo1mVRt32FRr23iXBx/sX8YbeQ==, - } + '@dnd-kit/[email protected]([email protected])': dependencies: - '@jsdevtools/ono': 7.1.3 - '@types/json-schema': 7.0.15 - call-me-maybe: 1.0.2 - js-yaml: 4.1.0 - dev: false + react: 19.0.0 + tslib: 2.6.2 - /@dnd-kit/[email protected]([email protected]): - resolution: - { - integrity: sha512-ea7IkhKvlJUv9iSHJOnxinBcoOI3ppGnnL+VDJ75O45Nss6HtZd8IdN8touXPDtASfeI2T2LImb8VOZcL47wjQ==, - } - peerDependencies: - react: '>=16.8.0' + '@dnd-kit/[email protected]([email protected]([email protected]))([email protected])': dependencies: - react: 18.2.0 + '@dnd-kit/accessibility': 3.1.0([email protected]) + '@dnd-kit/utilities': 3.2.2([email protected]) + react: 19.0.0 + react-dom: 19.0.0([email protected]) tslib: 2.6.2 - dev: false - /@dnd-kit/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-lYaoP8yHTQSLlZe6Rr9qogouGUz9oRUj4AHhDQGQzq/hqaJRpFo65X+JKsdHf8oUFBzx5A+SJPUvxAwTF2OabA==, - } - peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' + '@dnd-kit/[email protected](@dnd-kit/[email protected]([email protected]([email protected]))([email protected]))([email protected])': dependencies: - '@dnd-kit/accessibility': 3.1.0([email protected]) - '@dnd-kit/utilities': 3.2.2([email protected]) - react: 18.2.0 - react-dom: 18.2.0([email protected]) + '@dnd-kit/core': 6.0.8([email protected]([email protected]))([email protected]) + '@dnd-kit/utilities': 3.2.2([email protected]) + react: 19.0.0 tslib: 2.6.2 - dev: false - /@dnd-kit/[email protected](@dnd-kit/[email protected])([email protected]): - resolution: - { - integrity: sha512-wDkBHHf9iCi1veM834Gbk1429bd4lHX4RpAwT0y2cHLf246GAvU2sVw/oxWNpPKQNQRQaeGXhAVgrOl1IT+iyA==, - } - peerDependencies: - '@dnd-kit/core': ^6.0.7 - react: '>=16.8.0' + '@dnd-kit/[email protected]([email protected])': dependencies: - '@dnd-kit/core': 6.0.8([email protected])([email protected]) - '@dnd-kit/utilities': 3.2.2([email protected]) - react: 18.2.0 + react: 19.0.0 tslib: 2.6.2 - dev: false - /@dnd-kit/[email protected]([email protected]): - resolution: - { - integrity: sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg==, - } - peerDependencies: - react: '>=16.8.0' + '@emnapi/[email protected]': dependencies: - react: 18.2.0 tslib: 2.6.2 - dev: false + optional: true - /@emotion/[email protected]: - resolution: - { - integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==, - } + '@emotion/[email protected]': dependencies: '@babel/helper-module-imports': 7.24.3 '@babel/runtime': 7.24.4 @@ -902,440 +3550,141 @@ packages: find-root: 1.1.0 source-map: 0.5.7 stylis: 4.2.0 - dev: false - /@emotion/[email protected]: - resolution: - { - integrity: sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==, - } + '@emotion/[email protected]': dependencies: '@emotion/memoize': 0.8.1 '@emotion/sheet': 1.2.2 '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 stylis: 4.2.0 - dev: false - /@emotion/[email protected]: - resolution: - { - integrity: sha512-VJxe1ucoMYMS7DkiMdC2T7PWNbrEI0a39YRiyDvK2qq4lXwjRbVP/z4lpG+odCsRzadlR+1ywwrTzhdm5HNdew==, - } + '@emotion/[email protected]': dependencies: '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.4 '@emotion/sheet': 1.2.2 '@emotion/utils': 1.2.1 - dev: false - - /@emotion/[email protected]: - resolution: - { - integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==, - } - dev: false - - /@emotion/[email protected]: - resolution: - { - integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==, - } - dev: false - - /@emotion/[email protected](@types/[email protected])([email protected]): - resolution: - { - integrity: sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==, - } - peerDependencies: - '@types/react': '*' - react: '>=16.8.0' - peerDependenciesMeta: - '@types/react': - optional: true + + '@emotion/[email protected]': {} + + '@emotion/[email protected]': {} + + '@emotion/[email protected](@types/[email protected])([email protected])': dependencies: '@babel/runtime': 7.24.4 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.4 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected]) + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1([email protected]) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.2.79 hoist-non-react-statics: 3.3.2 - react: 18.2.0 - dev: false + react: 19.0.0 + optionalDependencies: + '@types/react': 19.0.1 - /@emotion/[email protected]: - resolution: - { - integrity: sha512-RIN04MBT8g+FnDwgvIUi8czvr1LU1alUMI05LekWB5DGyTm8cCBMCRpq3GqaiyEDRptEXOyXnvZ58GZYu4kBxQ==, - } + '@emotion/[email protected]': dependencies: '@emotion/hash': 0.9.1 '@emotion/memoize': 0.8.1 '@emotion/unitless': 0.8.1 '@emotion/utils': 1.2.1 csstype: 3.1.3 - dev: false - - /@emotion/[email protected]: - resolution: - { - integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==, - } - dev: false - - /@emotion/[email protected]: - resolution: - { - integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==, - } - dev: false - - /@emotion/[email protected]([email protected]): - resolution: - { - integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==, - } - peerDependencies: - react: '>=16.8.0' + + '@emotion/[email protected]': {} + + '@emotion/[email protected]': {} + + '@emotion/[email protected]([email protected])': dependencies: - react: 18.2.0 - dev: false - - /@emotion/[email protected]: - resolution: - { - integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==, - } - dev: false - - /@emotion/[email protected]: - resolution: - { - integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==, - } - dev: false - - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==, - } - engines: { node: '>=12' } - cpu: [ppc64] - os: [aix] - requiresBuild: true - dev: true + react: 19.0.0 + + '@emotion/[email protected]': {} + + '@emotion/[email protected]': {} + + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==, - } - engines: { node: '>=12' } - cpu: [arm] - os: [android] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [android] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==, - } - engines: { node: '>=12' } - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==, - } - engines: { node: '>=12' } - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==, - } - engines: { node: '>=12' } - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==, - } - engines: { node: '>=12' } - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==, - } - engines: { node: '>=12' } - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==, - } - engines: { node: '>=12' } - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==, - } - engines: { node: '>=12' } - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==, - } - engines: { node: '>=12' } - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@esbuild/[email protected]: - resolution: - { - integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true + '@esbuild/[email protected]': optional: true - /@eslint-community/[email protected]([email protected]): - resolution: - { - integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 8.48.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@eslint-community/[email protected]([email protected]): - resolution: - { - integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + '@esbuild/[email protected]': + optional: true + + '@eslint-community/[email protected]([email protected])': dependencies: eslint: 8.57.0 eslint-visitor-keys: 3.4.3 - dev: true - - /@eslint-community/[email protected]: - resolution: - { - integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==, - } - engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } - dev: true - - /@eslint/[email protected]: - resolution: - { - integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + + '@eslint-community/[email protected]': {} + + '@eslint/[email protected]': dependencies: ajv: 6.12.6 debug: 4.3.4 @@ -1348,629 +3697,337 @@ packages: strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color - dev: true - - /@eslint/[email protected]: - resolution: - { - integrity: sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - dev: true - - /@eslint/[email protected]: - resolution: - { - integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - dev: true - - /@faceless-ui/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-CtwUn+hHEaoYUjREzQKGRbEp55VzUx7sC+hxIxmCPwg7Yd5KXkQzSfoUfRAHqT/1MFfE1B2QCHVVbhtSnFL9BA==, - } - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@eslint/[email protected]': {} + + '@faceless-ui/[email protected]([email protected]([email protected]))([email protected])': dependencies: - body-scroll-lock: 3.1.5 - focus-trap: 6.9.4 - qs: 6.12.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - react-transition-group: 4.4.5([email protected])([email protected]) - dev: false - - /@faceless-ui/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-X+doJMzQqyVGpwV/YgXUAalNWepP2W8ThgZspKZLFG43zTYLVTU17BYCjjY+ggKuA3b0W3JyXZ2M8f247AdmHw==, - } - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + body-scroll-lock: 4.0.0-beta.0 + focus-trap: 7.5.4 + react: 19.0.0 + react-dom: 19.0.0([email protected]) + react-transition-group: 4.4.5([email protected]([email protected]))([email protected]) + + '@faceless-ui/[email protected]([email protected]([email protected]))([email protected])': dependencies: - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false + react: 19.0.0 + react-dom: 19.0.0([email protected]) - /@faceless-ui/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-IvZM6mLWFRin904180115Y6BgsvAN9M5uCMJEHhiQgTgzDMiYVtUww7GlWRsvemubMRF6c9Q+j79qW7uPPuMBg==, - } - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + '@faceless-ui/[email protected]([email protected]([email protected]))([email protected])': dependencies: - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false + react: 19.0.0 + react-dom: 19.0.0([email protected]) - /@floating-ui/[email protected]: - resolution: - { - integrity: sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==, - } + '@floating-ui/[email protected]': dependencies: '@floating-ui/utils': 0.2.1 - dev: false - /@floating-ui/[email protected]: - resolution: - { - integrity: sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==, - } + '@floating-ui/[email protected]': dependencies: '@floating-ui/core': 1.6.0 '@floating-ui/utils': 0.2.1 - dev: false - /@floating-ui/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==, - } - peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' + '@floating-ui/[email protected]([email protected]([email protected]))([email protected])': dependencies: '@floating-ui/dom': 1.6.3 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false - - /@floating-ui/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-D09o62HrWdIkstF2kGekIKAC0/N/Dl6wo3CQsnLcOmO3LkW6Ik8uIb3kw8JYkwxNCcg+uJ2bpWUiIijTBep05w==, - } - peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' + react: 19.0.0 + react-dom: 19.0.0([email protected]) + + '@floating-ui/[email protected]([email protected]([email protected]))([email protected])': dependencies: - '@floating-ui/react-dom': 2.0.8([email protected])([email protected]) - '@floating-ui/utils': 0.2.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) + '@floating-ui/react-dom': 2.1.2([email protected]([email protected]))([email protected]) + '@floating-ui/utils': 0.2.8 + react: 19.0.0 + react-dom: 19.0.0([email protected]) tabbable: 6.2.0 - dev: false - - /@floating-ui/[email protected]: - resolution: - { - integrity: sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==, - } - dev: false - - /@hapi/[email protected]: - resolution: - { - integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==, - } - dev: false - - /@hapi/[email protected]: - resolution: - { - integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==, - } - dependencies: - '@hapi/hoek': 9.3.0 - dev: false - - /@humanwhocodes/[email protected]: - resolution: - { - integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==, - } - engines: { node: '>=10.10.0' } + + '@floating-ui/[email protected]': {} + + '@floating-ui/[email protected]': {} + + '@humanwhocodes/[email protected]': dependencies: '@humanwhocodes/object-schema': 2.0.3 debug: 4.3.4 minimatch: 3.1.2 transitivePeerDependencies: - supports-color - dev: true - - /@humanwhocodes/[email protected]: - resolution: - { - integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==, - } - engines: { node: '>=12.22' } - dev: true - - /@humanwhocodes/[email protected]: - resolution: - { - integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==, - } - dev: true - - /@jsdevtools/[email protected]: - resolution: - { - integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==, - } - dev: false - - /@juggle/[email protected]: - resolution: - { - integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==, - } - dev: false - - /@monaco-editor/[email protected]([email protected]): - resolution: - { - integrity: sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==, - } - peerDependencies: - monaco-editor: '>= 0.21.0 < 1' + + '@humanwhocodes/[email protected]': {} + + '@humanwhocodes/[email protected]': {} + + '@img/[email protected]': + optionalDependencies: + '@img/sharp-libvips-darwin-arm64': 1.0.4 + optional: true + + '@img/[email protected]': + optionalDependencies: + '@img/sharp-libvips-darwin-x64': 1.0.4 + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optionalDependencies: + '@img/sharp-libvips-linux-arm64': 1.0.4 + optional: true + + '@img/[email protected]': + optionalDependencies: + '@img/sharp-libvips-linux-arm': 1.0.5 + optional: true + + '@img/[email protected]': + optionalDependencies: + '@img/sharp-libvips-linux-s390x': 1.0.4 + optional: true + + '@img/[email protected]': + optionalDependencies: + '@img/sharp-libvips-linux-x64': 1.0.4 + optional: true + + '@img/[email protected]': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-arm64': 1.0.4 + optional: true + + '@img/[email protected]': + optionalDependencies: + '@img/sharp-libvips-linuxmusl-x64': 1.0.4 + optional: true + + '@img/[email protected]': + dependencies: + '@emnapi/runtime': 1.3.1 + optional: true + + '@img/[email protected]': + optional: true + + '@img/[email protected]': + optional: true + + '@jsdevtools/[email protected]': {} + + '@juggle/[email protected]': {} + + '@monaco-editor/[email protected]([email protected])': dependencies: monaco-editor: 0.48.0 state-local: 1.0.7 - dev: false - /@monaco-editor/[email protected]([email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-NNDFdP+2HojtNhCkRfE6/D6ro6pBNihaOzMbGK84lNWzRu+CfBjwzGt4jmnqimLuqp5yE5viHS2vi+QOAnD5FQ==, - } - peerDependencies: - monaco-editor: '>= 0.25.0 < 1' - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + '@monaco-editor/[email protected]([email protected])([email protected]([email protected]))([email protected])': dependencies: '@monaco-editor/loader': 1.4.0([email protected]) monaco-editor: 0.48.0 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false + react: 19.0.0 + react-dom: 19.0.0([email protected]) - /@mongodb-js/[email protected]: - resolution: - { - integrity: sha512-XLNOMH66KhJzUJNwT/qlMnS4WsNDWD5ASdyaSH3EtK+F4r/CFGa3jT4GNi4mfOitGvWXtdLgQJkQjxSVrio+jA==, - } - requiresBuild: true + '@mongodb-js/[email protected]': dependencies: sparse-bitfield: 3.0.3 - dev: false - optional: true - - /@next/[email protected]: - resolution: - { - integrity: sha512-FXmIhrOXLCAC3CFfsphwr9B4sd42TdJWJ95UgvXJErnS2XgT0iv0BtMULybWOBzpJVWQavYzl+CkFDQC2EFJiw==, - } - dev: false - - /@next/[email protected]: - resolution: - { - integrity: sha512-ng7pU/DDsxPgT6ZPvuprxrkeew3XaRf4LAT4FabaEO/hAbvVx4P7wqnqdbTdDn1kgTvsI4tpIgT4Awn/m0bGbg==, - } - dependencies: - glob: 7.1.7 - dev: true - - /@next/[email protected]: - resolution: - { - integrity: sha512-AwYIdp0HHJQFI+LDAzTp7gj4suyl9KZgWFvHd79DljG4DLJMVEDb669AXpwV1m9WgVzWgnUsTJgF/XHDhaIRfg==, - } - engines: { node: '>= 10' } - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - /@next/[email protected]: - resolution: - { - integrity: sha512-NeXcmZdRycTNG3aMROgaTVuW3espy8CX9dVC7KQT9/YnRPItNhP/maU7kgIA5C43bgjCgwg1f9ABNB2NX99eWw==, - } - engines: { node: '>= 10' } - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false + '@next/[email protected]': {} + + '@next/[email protected]': + dependencies: + fast-glob: 3.3.1 + + '@next/[email protected]': optional: true - /@next/[email protected]: - resolution: - { - integrity: sha512-Qct3FFELGR8Vl97GBHuend1X94ykEzF7Cvyi8TX1I1uCZZHhRzHzJMo7TjrI+YNbJF804sc/+VsNxVxR197/Nw==, - } - engines: { node: '>= 10' } - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false + '@next/[email protected]': optional: true - /@next/[email protected]: - resolution: - { - integrity: sha512-sxLnN5QKp8JwEuABmArZ6uV8wjO9ozt7qbne/Y1zhKIyYl+WSgoPxznJz98bEGjd7o7sntSm1djYwZd+Ra1v1w==, - } - engines: { node: '>= 10' } - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false + '@next/[email protected]': optional: true - /@next/[email protected]: - resolution: - { - integrity: sha512-s3i4CFmsk7QcSDyScrMOQQ9EZPNRzkw2pUXI/SweKQC0qLXQ6agthCH0Ks69b/niMxzG+P4pen50qm1svsBHog==, - } - engines: { node: '>= 10' } - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false + '@next/[email protected]': optional: true - /@next/[email protected]: - resolution: - { - integrity: sha512-I3Js4g8ylkFGUb8ICI4ya1j89D/jw/SnItrGce03UWQhOdczlWixSFabE2RqSYtVM+cOWVLJ8SSmeoi98YQPNg==, - } - engines: { node: '>= 10' } - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false + '@next/[email protected]': optional: true - /@next/[email protected]: - resolution: - { - integrity: sha512-H8iTu2VPOmm2QXhWRkItS3Vfieh52pdg6IGBnm4xp+RJ6UVBEluTT2VDYB7vqjPnbof/dq6woflZkq2/KujSrQ==, - } - engines: { node: '>= 10' } - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: false + '@next/[email protected]': optional: true - /@next/[email protected]: - resolution: - { - integrity: sha512-OwdUlF/N+nJRXqFdwdRtSuilFlBDctIJSV30TdNNTdnTCCYtI9cyrJ+8Sx3EVhQQVTxySPUgmhJitgmgyDMmkQ==, - } - engines: { node: '>= 10' } - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: false + '@next/[email protected]': optional: true - /@next/[email protected]: - resolution: - { - integrity: sha512-pirSoMkVeWG7VuBEw6kISWUT1AaMeRj6TtcDuj7lJUoD2AQUO17yxRXMDLJ7Kf1ymOAxOEUf+Toys9V8NpSjKA==, - } - engines: { node: '>= 10' } - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false + '@next/[email protected]': optional: true - /@nodelib/[email protected]: - resolution: - { - integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==, - } - engines: { node: '>= 8' } + '@nodelib/[email protected]': dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: true - - /@nodelib/[email protected]: - resolution: - { - integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==, - } - engines: { node: '>= 8' } - dev: true - - /@nodelib/[email protected]: - resolution: - { - integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==, - } - engines: { node: '>= 8' } + + '@nodelib/[email protected]': {} + + '@nodelib/[email protected]': dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - dev: true - /@payloadcms/[email protected]([email protected]): - resolution: - { - integrity: sha512-RhMd3Dr+dGHk91Wk0afuXD0FdtC7WQ0sf3tPwyA+OIJQXJm2sHdmH2IbRxnqwVBFxK+tMxHaces97/WX2BbeqA==, - } - peerDependencies: - payload: 3.0.0-beta.24 + '@nolyfill/[email protected]': {} + + '@payloadcms/[email protected](@aws-sdk/[email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])': dependencies: - bson-objectid: 2.0.4 - deepmerge: 4.3.1 - get-port: 5.1.1 http-status: 1.6.2 - mongoose: 6.12.3 - mongoose-paginate-v2: 1.7.22 - payload: 3.0.0-beta.24(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + mongoose: 8.8.3(@aws-sdk/[email protected])([email protected]) + mongoose-aggregate-paginate-v2: 1.1.2 + mongoose-paginate-v2: 1.8.5 + payload: 3.9.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) prompts: 2.4.2 - uuid: 9.0.0 - transitivePeerDependencies: - - aws-crt - - supports-color - dev: false - - /@payloadcms/[email protected]([email protected]): - resolution: - { - integrity: sha512-LSf9oEPb6aMEMqdTFqj1v+7p/bdrJWG6hp7748xjVO3RL3yQESTKLK/NbjsMYITN4tKFXjfPWDUtcwHv0hS6/A==, - } - dependencies: - '@types/eslint': 8.44.2 - '@typescript-eslint/eslint-plugin': 6.6.0(@typescript-eslint/[email protected])([email protected])([email protected]) - '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) - eslint: 8.48.0 - eslint-config-prettier: 9.0.0([email protected]) - eslint-plugin-import: 2.28.1(@typescript-eslint/[email protected])([email protected]) - eslint-plugin-jest: 27.2.3(@typescript-eslint/[email protected])([email protected])([email protected]) - eslint-plugin-jest-dom: 5.1.0([email protected]) - eslint-plugin-jsx-a11y: 6.7.1([email protected]) - eslint-plugin-node: 11.1.0([email protected]) - eslint-plugin-perfectionist: 2.0.0([email protected])([email protected]) - eslint-plugin-playwright: 0.16.0([email protected])([email protected]) - eslint-plugin-react: 7.33.2([email protected]) - eslint-plugin-react-hooks: 4.6.0([email protected]) - eslint-plugin-regexp: 1.15.0([email protected]) + uuid: 10.0.0 transitivePeerDependencies: - - '@testing-library/dom' - - astro-eslint-parser - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - jest + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks - supports-color - - svelte - - svelte-eslint-parser - - typescript - - vue-eslint-parser - dev: true - - /@payloadcms/[email protected]([email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-6MNuU/6UhgdGjFtXIsEQN/qrRiM+HBp8yhvc6wey8afil9Fq5Ij+33/ICR6kI4d6i7dyeEdOufl8pYtldpfDyA==, - } - peerDependencies: - graphql: ^16.8.1 - payload: 3.0.0-beta.24 + + '@payloadcms/[email protected]([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])': dependencies: graphql: 16.8.1 graphql-scalars: 1.22.2([email protected]) - payload: 3.0.0-beta.24(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) + payload: 3.9.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) pluralize: 8.0.0 - ts-essentials: 7.0.3([email protected]) + ts-essentials: 10.0.3([email protected]) + tsx: 4.19.2 transitivePeerDependencies: - typescript - dev: false - - /@payloadcms/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-E6PZz87FjiQ3O44e7oMbzT+/ZKpXtdKFEU4Cg7WKXsf45AzMhgBc7GprZfq+WrYxHVXm6wSeSnTxvuhP4SD1Pw==, - } - engines: { node: '>=18.20.2' } - peerDependencies: - graphql: ^16.8.1 - next: ^14.3.0-canary.7 - payload: 3.0.0-beta.24 - dependencies: - '@dnd-kit/core': 6.0.8([email protected])([email protected]) - '@payloadcms/graphql': 3.0.0-beta.24([email protected])([email protected])([email protected]) - '@payloadcms/translations': 3.0.0-beta.24 - '@payloadcms/ui': 3.0.0-beta.24(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) - '@types/busboy': 1.5.3 + + '@payloadcms/[email protected](@types/[email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])': + dependencies: + '@dnd-kit/core': 6.0.8([email protected]([email protected]))([email protected]) + '@payloadcms/graphql': 3.9.0([email protected])([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]) + '@payloadcms/translations': 3.9.0 + '@payloadcms/ui': 3.9.0(@types/[email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected]) busboy: 1.6.0 - deep-equal: 2.2.2 - file-type: 19.0.0 + file-type: 19.3.0 graphql: 16.8.1 graphql-http: 1.22.1([email protected]) graphql-playground-html: 1.6.30 http-status: 1.6.2 - next: 14.3.0-canary.7([email protected])([email protected]) + next: 15.1.2([email protected]([email protected]))([email protected])([email protected]) path-to-regexp: 6.2.2 - payload: 3.0.0-beta.24(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) - qs: 6.11.2 - react-diff-viewer-continued: 3.2.6([email protected])([email protected]) - react-toastify: 8.2.0([email protected])([email protected]) - sass: 1.75.0 - ws: 8.16.0 + payload: 3.9.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + qs-esm: 7.0.2 + react-diff-viewer-continued: 3.2.6([email protected]([email protected]))([email protected]) + sass: 1.77.4 + sonner: 1.7.1([email protected]([email protected]))([email protected]) + uuid: 10.0.0 transitivePeerDependencies: - '@types/react' - - bufferutil - monaco-editor - react - react-dom - - react-native - - scheduler - typescript - - utf-8-validate - dev: false - - /@payloadcms/[email protected](@payloadcms/[email protected])(@payloadcms/[email protected])([email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-RdTMG5hH0+JWhRDIBtf4/OHCpSFQrqz5AdIvagsrI3uA6vgnSRp6Ah9Yl7vRpwEQp1nrA13QObUSCJ5qlr+q4Q==, - } - engines: { node: '>=18.20.2' } - peerDependencies: - '@payloadcms/translations': 3.0.0-beta.24 - '@payloadcms/ui': 3.0.0-beta.24 - payload: 3.0.0-beta.24 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@payloadcms/[email protected](@types/[email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])': dependencies: - '@faceless-ui/modal': 2.0.2([email protected])([email protected]) - '@payloadcms/translations': 3.0.0-beta.24 - '@payloadcms/ui': 3.0.0-beta.24(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]) + '@payloadcms/translations': 3.9.0 + '@payloadcms/ui': 3.9.0(@types/[email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected]) is-hotkey: 0.2.0 - payload: 3.0.0-beta.24(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) - react: 18.2.0 + payload: 3.9.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + react: 19.0.0 slate: 0.91.4 slate-history: 0.86.0([email protected]) slate-hyperscript: 0.81.3([email protected]) - slate-react: 0.92.0([email protected])([email protected])([email protected]) + slate-react: 0.92.0([email protected]([email protected]))([email protected])([email protected]) transitivePeerDependencies: + - '@types/react' + - monaco-editor + - next - react-dom - dev: false - - /@payloadcms/[email protected]: - resolution: - { - integrity: sha512-OCckgf4LTYrQdqpMCHrS8T6AkbF2UYAaQJpj7SyMIZTLOb5DSoN88bk+jHDkfjJ3AUWqePZSH887Af6/pdP+hQ==, - } - dev: false - - /@payloadcms/[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-9Y3L5zkefGDwcy1uOb0KYrvQWThzPuFe2NpNuqarzWkD/zUra9vYii4qyrX+dTo/Yhqx99uFdJ2XHwUYYt1HVQ==, - } - engines: { node: '>=18.20.2' } - peerDependencies: - next: ^14.3.0-canary.7 - payload: 3.0.0-beta.24 - react: ^18.0.0 - react-dom: ^18.0.0 - dependencies: - '@dnd-kit/core': 6.0.8([email protected])([email protected]) - '@dnd-kit/sortable': 7.0.2(@dnd-kit/[email protected])([email protected]) - '@faceless-ui/modal': 2.0.2([email protected])([email protected]) - '@faceless-ui/scroll-info': 1.3.0([email protected])([email protected]) - '@faceless-ui/window-info': 2.1.2([email protected])([email protected]) - '@monaco-editor/react': 4.5.1([email protected])([email protected])([email protected]) - '@payloadcms/translations': 3.0.0-beta.24 + - typescript + + '@payloadcms/[email protected]': + dependencies: + date-fns: 4.1.0 + + '@payloadcms/[email protected](@types/[email protected])([email protected])([email protected]([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected]([email protected]))([email protected])([email protected])': + dependencies: + '@dnd-kit/core': 6.0.8([email protected]([email protected]))([email protected]) + '@dnd-kit/sortable': 7.0.2(@dnd-kit/[email protected]([email protected]([email protected]))([email protected]))([email protected]) + '@faceless-ui/modal': 3.0.0-beta.2([email protected]([email protected]))([email protected]) + '@faceless-ui/scroll-info': 2.0.0-beta.0([email protected]([email protected]))([email protected]) + '@faceless-ui/window-info': 3.0.0-beta.0([email protected]([email protected]))([email protected]) + '@monaco-editor/react': 4.6.0([email protected])([email protected]([email protected]))([email protected]) + '@payloadcms/translations': 3.9.0 body-scroll-lock: 4.0.0-beta.0 bson-objectid: 2.0.4 - date-fns: 3.3.1 - deep-equal: 2.2.2 - flatley: 5.2.0 + date-fns: 4.1.0 + dequal: 2.0.3 md5: 2.3.0 - next: 14.3.0-canary.7([email protected])([email protected]) + next: 15.1.2([email protected]([email protected]))([email protected])([email protected]) object-to-formdata: 4.5.1 - payload: 3.0.0-beta.24(@swc/[email protected])(@swc/[email protected])([email protected])([email protected]) - qs: 6.11.2 - react: 18.2.0 - react-animate-height: 2.1.2([email protected])([email protected]) - react-datepicker: 6.2.0([email protected])([email protected]) - react-dom: 18.2.0([email protected]) - react-image-crop: 10.1.8([email protected]) - react-select: 5.7.4(@types/[email protected])([email protected])([email protected]) - react-toastify: 10.0.4([email protected])([email protected]) - use-context-selector: 1.4.1([email protected])([email protected])([email protected]) - uuid: 9.0.1 + payload: 3.9.0([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]) + qs-esm: 7.0.2 + react: 19.0.0 + react-datepicker: 7.5.0([email protected]([email protected]))([email protected]) + react-dom: 19.0.0([email protected]) + react-image-crop: 10.1.8([email protected]) + react-select: 5.9.0(@types/[email protected])([email protected]([email protected]))([email protected]) + scheduler: 0.25.0 + sonner: 1.7.1([email protected]([email protected]))([email protected]) + ts-essentials: 10.0.3([email protected]) + use-context-selector: 2.0.0([email protected])([email protected]) + uuid: 10.0.0 transitivePeerDependencies: - '@types/react' - monaco-editor - - react-native - - scheduler - dev: false - - /@sideway/[email protected]: - resolution: - { - integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==, - } - dependencies: - '@hapi/hoek': 9.3.0 - dev: false - - /@sideway/[email protected]: - resolution: - { - integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==, - } - dev: false - - /@sideway/[email protected]: - resolution: - { - integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==, - } - dev: false - - /@smithy/[email protected]: - resolution: - { - integrity: sha512-wRlta7GuLWpTqtFfGo+nZyOO1vEvewdNR1R4rTxpC8XU6vG/NDyrFBhwLZsqg1NUoR1noVaXJPC/7ZK47QCySw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + - typescript + + '@rtsao/[email protected]': {} + + '@rushstack/[email protected]': {} + + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-fsiMgd8toyUba6n1WRmr+qACzXltpdDkPTAaDqc8QqPBUzO+/JKwL6bUBseHVi8tu9l+3JOK+tSf7cay+4B3LA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/node-config-provider': 2.3.0 '@smithy/types': 2.12.0 '@smithy/util-config-provider': 2.3.0 '@smithy/util-middleware': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-2fek3I0KZHWJlRLvRTqxTEri+qV0GRHrJIoLFuBMZB4EMg4WgeBGfF0X6abnrNYpq55KJ6R4D6x4f0vLnhzinA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/middleware-endpoint': 2.5.1 '@smithy/middleware-retry': 2.3.1 @@ -1980,100 +4037,53 @@ packages: '@smithy/types': 2.12.0 '@smithy/util-middleware': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-BWB9mIukO1wjEOo1Ojgl6LrG4avcaC7T/ZP6ptmAaW4xluhSIPZhY+/PI5YKzlk+jsm+4sQZB45Bt1OfMeQa3w==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/node-config-provider': 2.3.0 '@smithy/property-provider': 2.2.0 '@smithy/types': 2.12.0 '@smithy/url-parser': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-BOWEBeppWhLn/no/JxUL/ghTfANTjT7kg3Ww2rPqTUY9R4yHPXxJ9JhMe3Z03LN3aPwiwlpDIUcVw1xDyHqEhw==, - } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/protocol-http': 3.3.0 '@smithy/querystring-builder': 2.2.0 '@smithy/types': 2.12.0 '@smithy/util-base64': 2.3.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-zLWaC/5aWpMrHKpoDF6nqpNtBhlAYKF/7+9yMN7GpdR8CzohnWfGtMznPybnwSS8saaXBMxIGwJqR4HmRp6b3g==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 '@smithy/util-buffer-from': 2.2.0 '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-nEDASdbKFKPXN2O6lOlTgrEEOO9NHIeO+HVvZnkqc8h5U9g3BIhWsvzFo+UcUbliMHvKNPD/zVxDrkP1Sbgp8Q==, - } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-5bl2LG1Ah/7E5cMSC+q+h3IpVHMeOkG0yLRyQT1p2aMJkSrZG7RlXHPuAgb7EyaFeidKEnnd/fNaLLaKlHGzDQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/protocol-http': 3.3.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-1/8kFp6Fl4OsSIVTWHnNjLnTL8IqpIb/D3sTSczrKFnrE9VMNWxnrRKNvpUHOJ6zpGD5f62TPm7+17ilTJpiCQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/middleware-serde': 2.3.0 '@smithy/node-config-provider': 2.3.0 @@ -2082,16 +4092,9 @@ packages: '@smithy/url-parser': 2.2.0 '@smithy/util-middleware': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-P2bGufFpFdYcWvqpyqqmalRtwFUNUA8vHjJR5iGqbfR6mp65qKOLcUd6lTr4S9Gn/enynSrSf3p3FVgVAf6bXA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/node-config-provider': 2.3.0 '@smithy/protocol-http': 3.3.0 @@ -2102,151 +4105,74 @@ packages: '@smithy/util-retry': 2.2.0 tslib: 2.6.2 uuid: 9.0.1 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-sIADe7ojwqTyvEQBe1nc/GXB9wdHhi9UwyX0lTyttmUWDJLP655ZYE1WngnNyXREme8I27KCaUhyhZWRXL0q7Q==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-Qntc3jrtwwrsAC+X8wms8zhrTr0sFXnyEGhZd9sLtsJ/6gGQKFzNB+wWbOcpJd7BR8ThNCoKt76BuQahfMvpeA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-0elK5/03a1JPWMDPaS726Iw6LpQg80gFut1tNpPfxFuChEEklo2yL823V94SpTZTxmKlXFtFgsP55uh3dErnIg==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/property-provider': 2.2.0 '@smithy/shared-ini-file-loader': 2.4.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-mVGyPBzkkGQsPoxQUbxlEfRjrj6FPyA3u3u2VXGr9hT8wilsoQdZdvKpMBFMB8Crfhv5dNkKHIW0Yyuc7eABqA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/abort-controller': 2.2.0 '@smithy/protocol-http': 3.3.0 '@smithy/querystring-builder': 2.2.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-+xiil2lFhtTRzXkx8F053AV46QnIw6e7MV8od5Mi68E1ICOjCeCHw2XfLnDEUHnT9WGUIkwcqavXjfwuJbGlpg==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-Xy5XK1AFWW2nlY/biWZXu6/krgbaf2dg0q492D8M5qthsnU2H+UgFeZLbM76FnH7s6RO/xhQRkj+T6KBO3JzgQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-L1kSeviUWL+emq3CUVSgdogoM/D9QMFaqxL/dd0X7PCNWmPXqt+ExtrBjqT0V7HLN03Vs9SuiLrG3zy3JGnE5A==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 '@smithy/util-uri-escape': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-BvHCDrKfbG5Yhbpj4vsbuPV2GgcpHiAkLeIlcA1LtfpMz3jrqizP1+OguSNSj1MwBHEiN+jwNisXLGdajGDQJA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-uBDTIBBEdAQryvHdc5W8sS5YX7RQzF683XrHePVdFmAgKiMofU15FLSM0/HU03hKTnazdNRFa0YHS7+ArwoUSQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-WyujUJL8e1B6Z4PBfAqC/aGY1+C7T0w20Gih3yrvJSk97gpiVfB+y7c46T4Nunk+ZngLq0rOIdeVeIklk0R3OA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-ui/NlpILU+6HAQBfJX8BBsDXuKSNrjTSuOYArRblcrErwKFutjrCNb/OExfVRyj9+26F9J+ZmfWT+fKWuDrH3Q==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/is-array-buffer': 2.2.0 '@smithy/types': 2.12.0 @@ -2255,16 +4181,9 @@ packages: '@smithy/util-uri-escape': 2.2.0 '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-jrbSQrYCho0yDaaf92qWgd+7nAeap5LtHTI51KXqmpIFCceKU3K9+vIVTUH72bOJngBMqa4kyu1VJhRcSrk/CQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/middleware-endpoint': 2.5.1 '@smithy/middleware-stack': 2.2.0 @@ -2272,119 +4191,58 @@ packages: '@smithy/types': 2.12.0 '@smithy/util-stream': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-QwYgloJ0sVNBeBuBs65cIkTbfzV/Q6ZNPCJ99EICFEdJYG50nGIY/uYXp+TbsdJReIuPr0a0kXmCvren3MbRRw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-hoA4zm61q1mNTpksiSWp2nEl1dt3j726HdRhiNgVJQMj7mLp7dprtF57mOB6JvEk/x9d2bsuL5hlqZbBuHQylQ==, - } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/querystring-parser': 2.2.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-s3+eVwNeJuXUwuMbusncZNViuhv2LjVJ1nMwTqSA0XAC7gjKhqqxRdJPhR8+YrkoZ9IiIbFk/yK6ACe/xlF+hw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/util-buffer-from': 2.2.0 '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-dtpw9uQP7W+n3vOtx0CfBD5EWd7EPdIdsQnWTDoFf77e3VUf05uA7R7TGipIo8e4WL2kuPdnsr3hMQn9ziYj5w==, - } - requiresBuild: true + '@smithy/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-ITWT1Wqjubf2CJthb0BuT9+bpzBfXeMokH/AAa5EJQgbv9aPMVfnM76iFIZVFf50hYXGbtiV71BHAthNWd6+dw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/is-array-buffer': 2.2.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-HZkzrRcuFN1k70RLqlNK4FnPXKOpkik1+4JaBoHNJn+RnJGYqaa3c5/+XtLOXhlKzlRgNvyaLieHTW2VwGN0VQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-RtKW+8j8skk17SYowucwRUjeh4mCtnm5odCL0Lm2NtHQBsYKrNW0od9Rhopu9wF1gHMfHeWF7i90NwBz/U22Kw==, - } - engines: { node: '>= 10.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/property-provider': 2.2.0 '@smithy/smithy-client': 2.5.1 '@smithy/types': 2.12.0 bowser: 2.11.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-vkMXHQ0BcLFysBMWgSBLSk3+leMpFSyyFj8zQtv5ZyUBx8/owVh1/pPEkzmW/DR/Gy/5c8vjLDD9gZjXNKbrpA==, - } - engines: { node: '>= 10.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/config-resolver': 2.2.0 '@smithy/credential-provider-imds': 2.3.0 @@ -2393,69 +4251,34 @@ packages: '@smithy/smithy-client': 2.5.1 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-BuDHv8zRjsE5zXd3PxFXFknzBG3owCpjq8G3FcsXW3CykYXuEqM3nTSsmLzw5q+T12ZYuDlVUZKBdpNbhVtlrQ==, - } - engines: { node: '>= 14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/node-config-provider': 2.3.0 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-7iKXR+/4TpLK194pVjKiasIyqMtTYJsgKgM242Y9uzt5dhHnUDvMNb+3xIhRJ9QhvqGii/5cRUt4fJn3dtXNHQ==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-L1qpleXf9QD6LwLCJ5jddGkgWyuSvWBkJwWAZ6kFkdifdso+sk3L3O1HdmPvCdnCK3IS4qWyPxev01QMnfHSBw==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-q9+pAFPTfftHXRytmZ7GzLFFrEGavqapFc06XxzZFcSIGERXMerXxCitjOG1prVDR9QdjqotF40SWvbqcCpf8g==, - } - engines: { node: '>= 14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/service-error-classification': 2.1.5 '@smithy/types': 2.12.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-17faEXbYWIRst1aU9SvPZyMdWmqIrduZjVOqCPMIsWFNxs5yQQgFrJL6b2SdiCzyW9mJoDjFtgi53xx7EH+BXA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/fetch-http-handler': 2.5.0 '@smithy/node-http-handler': 2.5.0 @@ -2465,590 +4288,173 @@ packages: '@smithy/util-hex-encoding': 2.2.0 '@smithy/util-utf8': 2.3.0 tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-jtmJMyt1xMD/d8OtbVJ2gFZOSKc+ueYJZPW20ULW1GOp/q/YIM0wNh+u8ZFao9UaIGz4WoPW8hC64qlWLIfoDA==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: tslib: 2.6.2 - dev: false optional: true - /@smithy/[email protected]: - resolution: - { - integrity: sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==, - } - engines: { node: '>=14.0.0' } - requiresBuild: true + '@smithy/[email protected]': dependencies: '@smithy/util-buffer-from': 2.2.0 - tslib: 2.6.2 - dev: false - optional: true - - /@swc-node/[email protected](@swc/[email protected])(@swc/[email protected]): - resolution: - { - integrity: sha512-lFPD4nmy4ifAOVMChFjwlpXN5KQXvegqeyuzz1KQz42q1lf+cL3Qux1/GteGuZjh8HC+Rj1RdNrHpE/MCfJSTw==, - } - engines: { node: '>= 10' } - peerDependencies: - '@swc/core': '>= 1.3' - '@swc/types': '>= 0.1' - dependencies: - '@swc/core': 1.4.17 - '@swc/types': 0.1.6 - dev: false - - /@swc-node/[email protected]: - resolution: - { - integrity: sha512-fbhjL5G0YvFoWwNhWleuBUfotiX+USiA9oJqu9STFw+Hb0Cgnddn+HVS/K5fI45mn92e8V+cHD2jgFjk4w2T9Q==, - } - dependencies: - source-map-support: 0.5.21 - tslib: 2.6.2 - dev: false - - /@swc/[email protected]: - resolution: - { - integrity: sha512-HVl+W4LezoqHBAYg2JCqR+s9ife9yPfgWSj37iIawLWzOmuuJ7jVdIB7Ee2B75bEisSEKyxRlTl6Y1Oq3owBgw==, - } - engines: { node: '>=10' } - cpu: [arm64] - os: [darwin] - requiresBuild: true + tslib: 2.6.2 optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-WYRO9Fdzq4S/he8zjW5I95G1zcvyd9yyD3Tgi4/ic84P5XDlSMpBDpBLbr/dCPjmSg7aUXxNQqKqGkl6dQxYlA==, - } - engines: { node: '>=10' } - cpu: [x64] - os: [darwin] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-cgbvpWOvtMH0XFjvwppUCR+Y+nf6QPaGu6AQ5hqCP+5Lv2zO5PG0RfasC4zBIjF53xgwEaaWmGP5/361P30X8Q==, - } - engines: { node: '>=10' } - cpu: [arm] - os: [linux] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-l7zHgaIY24cF9dyQ/FOWbmZDsEj2a9gRFbmgx2u19e3FzOPuOnaopFj0fRYXXKCmtdx+anD750iBIYnTR+pq/Q==, - } - engines: { node: '>=10' } - cpu: [arm64] - os: [linux] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-qhH4gr9gAlVk8MBtzXbzTP3BJyqbAfUOATGkyUtohh85fPXQYuzVlbExix3FZXTwFHNidGHY8C+ocscI7uDaYw==, - } - engines: { node: '>=10' } - cpu: [arm64] - os: [linux] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-vRDFATL1oN5oZMImkwbgSHEkp8xG1ofEASBypze01W1Tqto8t+yo6gsp69wzCZBlxldsvPpvFZW55Jq0Rn+UnA==, - } - engines: { node: '>=10' } - cpu: [x64] - os: [linux] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-zQNPXAXn3nmPqv54JVEN8k2JMEcMTQ6veVuU0p5O+A7KscJq+AGle/7ZQXzpXSfUCXlLMX4wvd+rwfGhh3J4cw==, - } - engines: { node: '>=10' } - cpu: [x64] - os: [linux] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-z86n7EhOwyzxwm+DLE5NoLkxCTme2lq7QZlDjbQyfCxOt6isWz8rkW5QowTX8w9Rdmk34ncrjSLvnHOeLY17+w==, - } - engines: { node: '>=10' } - cpu: [arm64] - os: [win32] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-JBwuSTJIgiJJX6wtr4wmXbfvOswHFj223AumUrK544QV69k60FJ9q2adPW9Csk+a8wm1hLxq4HKa2K334UHJ/g==, - } - engines: { node: '>=10' } - cpu: [ia32] - os: [win32] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-jFkOnGQamtVDBm3MF5Kq1lgW8vx4Rm1UvJWRUfg+0gx7Uc3Jp3QMFeMNw/rDNQYRDYPG3yunCC+2463ycd5+dg==, - } - engines: { node: '>=10' } - cpu: [x64] - os: [win32] - requiresBuild: true + '@swc/[email protected]': optional: true - /@swc/[email protected]: - resolution: - { - integrity: sha512-tq+mdWvodMBNBBZbwFIMTVGYHe9N7zvEaycVVjfvAx20k1XozHbHhRv+9pEVFJjwRxLdXmtvFZd3QZHRAOpoNQ==, - } - engines: { node: '>=10' } - requiresBuild: true - peerDependencies: - '@swc/helpers': ^0.5.0 - peerDependenciesMeta: - '@swc/helpers': - optional: true + '@swc/[email protected]': + optional: true + + '@swc/[email protected](@swc/[email protected])': dependencies: '@swc/counter': 0.1.3 - '@swc/types': 0.1.6 + '@swc/types': 0.1.17 optionalDependencies: - '@swc/core-darwin-arm64': 1.4.17 - '@swc/core-darwin-x64': 1.4.17 - '@swc/core-linux-arm-gnueabihf': 1.4.17 - '@swc/core-linux-arm64-gnu': 1.4.17 - '@swc/core-linux-arm64-musl': 1.4.17 - '@swc/core-linux-x64-gnu': 1.4.17 - '@swc/core-linux-x64-musl': 1.4.17 - '@swc/core-win32-arm64-msvc': 1.4.17 - '@swc/core-win32-ia32-msvc': 1.4.17 - '@swc/core-win32-x64-msvc': 1.4.17 - - /@swc/[email protected]: - resolution: - { - integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==, - } - - /@swc/[email protected]: - resolution: - { - integrity: sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==, - } + '@swc/core-darwin-arm64': 1.10.1 + '@swc/core-darwin-x64': 1.10.1 + '@swc/core-linux-arm-gnueabihf': 1.10.1 + '@swc/core-linux-arm64-gnu': 1.10.1 + '@swc/core-linux-arm64-musl': 1.10.1 + '@swc/core-linux-x64-gnu': 1.10.1 + '@swc/core-linux-x64-musl': 1.10.1 + '@swc/core-win32-arm64-msvc': 1.10.1 + '@swc/core-win32-ia32-msvc': 1.10.1 + '@swc/core-win32-x64-msvc': 1.10.1 + '@swc/helpers': 0.5.15 + + '@swc/[email protected]': {} + + '@swc/[email protected]': dependencies: - '@swc/counter': 0.1.3 - tslib: 2.6.2 - dev: false + tslib: 2.8.1 - /@swc/[email protected]: - resolution: - { - integrity: sha512-/JLo/l2JsT/LRd80C3HfbmVpxOAJ11FO2RCEslFrgzLltoP9j8XIbsyDcfCt2WWyX+CM96rBoNM+IToAkFOugg==, - } + '@swc/[email protected]': dependencies: '@swc/counter': 0.1.3 - /@tokenizer/[email protected]: - resolution: - { - integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==, - } - dev: false + '@tokenizer/[email protected]': {} - /@types/[email protected]: - resolution: - { - integrity: sha512-YMBLFN/xBD8bnqywIlGyYqsNFXu6bsiY7h3Ae0kO17qEuTjsqeyYMRPSUDacIKIquws2Y6KjmxAyNx8xB3xQbw==, - } + '@types/[email protected]': dependencies: '@types/node': 20.12.7 - dev: false - /@types/[email protected]: - resolution: - { - integrity: sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==, - } + '@types/[email protected]': {} + + '@types/[email protected]': {} + + '@types/[email protected]': {} + + '@types/[email protected]': {} + + '@types/[email protected]': {} + + '@types/[email protected]': {} + + '@types/[email protected]': dependencies: - '@types/estree': 1.0.5 - '@types/json-schema': 7.0.15 - dev: true - - /@types/[email protected]: - resolution: - { - integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==, - } - dev: true - - /@types/[email protected]: - resolution: - { - integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==, - } - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 20.12.7 - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-RvC8KMw5BCac1NvRRyaHgMMEtBaZ6wh0pyPTBu7izn4Sj/AX9Y4aXU5c7rX8PnM/knsuUpC1IeoBkANtxBypsQ==, - } - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==, - } - - /@types/[email protected]: - resolution: - { - integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==, - } - dev: true - - /@types/[email protected]: - resolution: - { - integrity: sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==, - } - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==, - } - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-UFIuc1gdyzAqeVUYpSL+cliw2MmU/ZUhVZKE7Zo4wPbgc8hbljeKSnn6ls6iG8r5jpegPXLUIhJ+Wb2kLVs8cg==, - } + undici-types: 5.26.5 + + '@types/[email protected]': {} + + '@types/[email protected]': dependencies: - '@types/node': 20.12.7 - dev: false + '@types/react': 19.0.1 - /@types/[email protected]: - resolution: - { - integrity: sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==, - } + '@types/[email protected]': dependencies: - undici-types: 5.26.5 + '@types/react': 19.0.1 - /@types/[email protected]: - resolution: - { - integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==, - } - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==, - } - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-HVqYj3L+D+S/6qpQRv5qMxrD/5pglzZuhP7ZIqgVSZ+Ck4z1TCFkNIRG8WesFueQTqWFTSgkkAl6f8lwxFPQSw==, - } - dependencies: - '@types/needle': 3.3.0 - '@types/node': 20.12.7 - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==, - } - - /@types/[email protected]: - resolution: - { - integrity: sha512-o/V48vf4MQh7juIKZU2QGDfli6p1+OOi5oXx36Hffpc9adsHeXjVp8rHuPkjd8VT8sOJ2Zp05HR7CdpGTIUFUA==, - } - dependencies: - '@types/react': 18.2.79 - dev: true - - /@types/[email protected]: - resolution: - { - integrity: sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==, - } - dependencies: - '@types/react': 18.2.79 - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-RwGAGXPl9kSXwdNTafkOEuFrTBD5SA2B3iEB96xi8+xu5ddUa/cpvyVCSNn+asgLCTHkb5ZxN8gbuibYJi4s1w==, - } - dependencies: - '@types/prop-types': 15.7.12 + '@types/[email protected]': + dependencies: csstype: 3.1.3 - /@types/[email protected]: - resolution: - { - integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==, - } - dev: true - - /@types/[email protected]: - resolution: - { - integrity: sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==, - } - dev: false - - /@types/[email protected]: - resolution: - { - integrity: sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==, - } + '@types/[email protected]': {} + + '@types/[email protected]': {} + + '@types/[email protected]': dependencies: - '@types/node': 20.12.7 '@types/webidl-conversions': 7.0.3 - dev: false - - /@typescript-eslint/[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-CW9YDGTQnNYMIo5lMeuiIG08p4E0cXrXTbcZ2saT/ETE7dWUrNxlijsQeU04qAAKkILiLzdQz+cGFxCJjaZUmA==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - peerDependencies: - '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + + '@typescript-eslint/[email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) + '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) '@typescript-eslint/scope-manager': 6.6.0 - '@typescript-eslint/type-utils': 6.6.0([email protected])([email protected]) - '@typescript-eslint/utils': 6.6.0([email protected])([email protected]) + '@typescript-eslint/type-utils': 6.6.0([email protected])([email protected]) + '@typescript-eslint/utils': 6.6.0([email protected])([email protected]) '@typescript-eslint/visitor-keys': 6.6.0 debug: 4.3.4 - eslint: 8.48.0 + eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.4.4 + ts-api-utils: 1.3.0([email protected]) + optionalDependencies: + typescript: 5.5.2 transitivePeerDependencies: - supports-color - dev: true - - /@typescript-eslint/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-setq5aJgUwtzGrhW177/i+DMLqBaJbdwGj2CPIVFFLE0NCliy5ujIdLHd2D1ysmlmsjdL2GWW+hR85neEfc12w==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: '@typescript-eslint/scope-manager': 6.6.0 '@typescript-eslint/types': 6.6.0 - '@typescript-eslint/typescript-estree': 6.6.0([email protected]) + '@typescript-eslint/typescript-estree': 6.6.0([email protected]) '@typescript-eslint/visitor-keys': 6.6.0 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.4.4 + optionalDependencies: + typescript: 5.5.2 transitivePeerDependencies: - supports-color - dev: true - - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - dev: true - - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 - dev: true - - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-pT08u5W/GT4KjPUmEtc2kSYvrH8x89cVzkA0Sy2aaOUIw6YxOIjA8ilwLr/1fLjOedX1QAuBpG9XggWqIIfERw==, - } - engines: { node: ^16.0.0 || >=18.0.0 } + + '@typescript-eslint/[email protected]': dependencies: '@typescript-eslint/types': 6.6.0 '@typescript-eslint/visitor-keys': 6.6.0 - dev: true - - /@typescript-eslint/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-8m16fwAcEnQc69IpeDyokNO+D5spo0w1jepWWY2Q6y5ZKNuj5EhVQXjtVAeDDqvW6Yg7dhclbsz6rTtOvcwpHg==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 6.6.0([email protected]) - '@typescript-eslint/utils': 6.6.0([email protected])([email protected]) - debug: 4.3.4 - eslint: 8.48.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.4.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - dev: true - - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - dev: true - - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-CB6QpJQ6BAHlJXdwUmiaXDBmTqIE2bzGTDLADgvqtHWuhfNP3rAOK7kAgRMAET5rDRr9Utt+qAzRBdu3AhR3sg==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - dev: true - - /@typescript-eslint/[email protected]([email protected]): - resolution: - { - integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.6.0 - tsutils: 3.21.0([email protected]) - typescript: 5.4.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/[email protected]([email protected]): - resolution: - { - integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/visitor-keys': 6.21.0 + '@typescript-eslint/typescript-estree': 6.6.0([email protected]) + '@typescript-eslint/utils': 6.6.0([email protected])([email protected]) debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.6.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.4.4 + eslint: 8.57.0 + ts-api-utils: 1.3.0([email protected]) + optionalDependencies: + typescript: 5.5.2 transitivePeerDependencies: - supports-color - dev: true - - /@typescript-eslint/[email protected]([email protected]): - resolution: - { - integrity: sha512-hMcTQ6Al8MP2E6JKBAaSxSVw5bDhdmbCEhGW/V8QXkb9oNsFkA4SBuOMYVPxD3jbtQ4R/vSODBsr76R6fP3tbA==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + + '@typescript-eslint/[email protected]': {} + + '@typescript-eslint/[email protected]([email protected])': dependencies: '@typescript-eslint/types': 6.6.0 '@typescript-eslint/visitor-keys': 6.6.0 @@ -3056,264 +4462,78 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.0 - ts-api-utils: 1.3.0([email protected]) - typescript: 5.4.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0([email protected]) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0([email protected]) - eslint: 8.48.0 - eslint-scope: 5.1.1 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0([email protected]) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0([email protected]) - eslint: 8.48.0 - semver: 7.6.0 + ts-api-utils: 1.3.0([email protected]) + optionalDependencies: + typescript: 5.5.2 transitivePeerDependencies: - supports-color - - typescript - dev: true - - /@typescript-eslint/[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-mPHFoNa2bPIWWglWYdR0QfY9GN0CfvvXX1Sv6DlSTive3jlMTUy+an67//Gysc+0Me9pjitrq0LJp0nGtLgftw==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - peerDependencies: - eslint: ^7.0.0 || ^8.0.0 + + '@typescript-eslint/[email protected]([email protected])([email protected])': dependencies: - '@eslint-community/eslint-utils': 4.4.0([email protected]) + '@eslint-community/eslint-utils': 4.4.0([email protected]) '@types/json-schema': 7.0.15 '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.6.0 '@typescript-eslint/types': 6.6.0 - '@typescript-eslint/typescript-estree': 6.6.0([email protected]) - eslint: 8.48.0 + '@typescript-eslint/typescript-estree': 6.6.0([email protected]) + eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: - supports-color - typescript - dev: true - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + '@typescript-eslint/[email protected]': dependencies: - '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/types': 6.6.0 eslint-visitor-keys: 3.4.3 - dev: true - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - dependencies: - '@typescript-eslint/types': 6.21.0 - eslint-visitor-keys: 3.4.3 - dev: true + '@ungap/[email protected]': {} - /@typescript-eslint/[email protected]: - resolution: - { - integrity: sha512-L61uJT26cMOfFQ+lMZKoJNbAEckLe539VhTxiGHrWl5XSKQgA0RTBZJW2HFPy5T0ZvPVSD93QsrTKDkfNwJGyQ==, - } - engines: { node: ^16.0.0 || >=18.0.0 } - dependencies: - '@typescript-eslint/types': 6.6.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@ungap/[email protected]: - resolution: - { - integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==, - } - engines: { node: '>=6.5' } - dependencies: - event-target-shim: 5.0.1 - dev: false - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==, - } - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + [email protected]([email protected]): dependencies: acorn: 8.11.3 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==, - } - engines: { node: '>=0.4.0' } - hasBin: true - dev: true - /[email protected]([email protected]): - resolution: - { - integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==, - } - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true - dependencies: - ajv: 8.12.0 - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==, - } + [email protected]: dependencies: fast-deep-equal: 3.1.3 fast-json-stable-stringify: 2.1.0 json-schema-traverse: 0.4.1 uri-js: 4.4.1 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==, - } + [email protected]: dependencies: fast-deep-equal: 3.1.3 + fast-uri: 3.0.3 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - uri-js: 4.4.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==, - } - engines: { node: '>=8' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==, - } - engines: { node: '>=4' } + + [email protected]: {} + + [email protected]: dependencies: color-convert: 1.9.3 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==, - } - engines: { node: '>=8' } + [email protected]: dependencies: color-convert: 2.0.1 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==, - } - engines: { node: '>= 8' } + + [email protected]: dependencies: normalize-path: 3.0.0 picomatch: 2.3.1 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==, - } + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==, - } - dependencies: - dequal: 2.0.3 - dev: true + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 is-array-buffer: 3.0.4 - /[email protected]: - resolution: - { - integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 @@ -3321,22 +4541,19 @@ packages: es-object-atoms: 1.0.0 get-intrinsic: 1.2.4 is-string: 1.0.7 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==, - } - engines: { node: '>=8' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==, - } - engines: { node: '>= 0.4' } + + [email protected]: {} + + [email protected]: + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-shim-unscopables: 1.0.2 + + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 @@ -3344,53 +4561,30 @@ packages: es-errors: 1.3.0 es-object-atoms: 1.0.0 es-shim-unscopables: 1.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==, - } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 es-errors: 1.3.0 es-shim-unscopables: 1.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: array-buffer-byte-length: 1.0.1 call-bind: 1.0.7 @@ -3400,206 +4594,67 @@ packages: get-intrinsic: 1.2.4 is-array-buffer: 3.0.4 is-shared-array-buffer: 1.0.3 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==, - } - engines: { node: '>=8.0.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==, - } - engines: { node: '>=10.12.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==, - } - engines: { node: '>= 0.4' } + + [email protected]: dependencies: - possible-typed-array-names: 1.0.0 + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.23.6 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + is-array-buffer: 3.0.4 - /[email protected]: - resolution: - { - integrity: sha512-H5orY+M2Fr56DWmMFpMrq5Ge93qjNdPVqzBv5gWK3aD1OvjBEJlEzxf09z93dGVQeI0LiW+aCMIx1QtShC/zUw==, - } - engines: { node: '>=4' } - dev: true + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==, - } + [email protected]: {} + + [email protected]: dependencies: - dequal: 2.0.3 - dev: true + possible-typed-array-names: 1.0.0 + + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==, - } - engines: { node: '>=10', npm: '>=6' } + [email protected]: {} + + [email protected]: dependencies: '@babel/runtime': 7.24.4 cosmiconfig: 7.1.0 resolve: 1.22.8 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==, - } - - /[email protected]: - resolution: - { - integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==, - } - engines: { node: '>=8' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Yi1Xaml0EvNA0OYWxXiYNqY24AfWkbA6w5vxE7GWxtKfzIbZM+Qw+aSmkgsbWzbHiy/RCSkUZBplVxTA+E4jJg==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==, - } - requiresBuild: true - dev: false - optional: true - - /[email protected]: - resolution: - { - integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==, - } - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - /[email protected]: - resolution: - { - integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==, - } + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: + optional: true + + [email protected]: dependencies: balanced-match: 1.0.2 + concat-map: 0.0.1 - /[email protected]: - resolution: - { - integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==, - } - engines: { node: '>=8' } + [email protected]: dependencies: fill-range: 7.0.1 - /[email protected]: - resolution: - { - integrity: sha512-vgnKAUzcDoa+AeyYwXCoHyF2q6u/8H46dxu5JN+4/TZeq/Dlinn0K6GvxsCLb3LHUJl0m/TLiEK31kUwtgocMQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==, - } - engines: { node: '>=6.9.0' } - dependencies: - buffer: 5.7.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==, - } - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==, - } - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==, - } - engines: { node: '>=10.16.0' } + [email protected]: dependencies: streamsearch: 1.1.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==, - } - engines: { node: '>= 0.4' } + [email protected]: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + [email protected]: dependencies: es-define-property: 1.0.0 es-errors: 1.3.0 @@ -3607,63 +4662,36 @@ packages: get-intrinsic: 1.2.4 set-function-length: 1.2.2 - /[email protected]: - resolution: - { - integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==, - } - engines: { node: '>=6' } - - /[email protected]: - resolution: - { - integrity: sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==, - } - engines: { node: '>=4' } + [email protected]: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-define-property: 1.0.0 + get-intrinsic: 1.2.6 + set-function-length: 1.2.2 + + [email protected]: + dependencies: + call-bind-apply-helpers: 1.0.1 + get-intrinsic: 1.2.6 + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==, - } - engines: { node: '>=10' } + [email protected]: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==, - } - engines: { node: '>= 8.10.0' } + + [email protected]: {} + + [email protected]: dependencies: anymatch: 3.1.3 braces: 3.0.2 @@ -3674,533 +4702,183 @@ packages: readdirp: 3.6.0 optionalDependencies: fsevents: 2.3.3 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg==, - } - engines: { node: '>=8' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==, - } - engines: { node: '>=0.10' } - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-iterator: 2.0.3 - memoizee: 0.4.15 - timers-ext: 0.1.7 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==, - } - engines: { node: '>=6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==, - } - engines: { node: '>=6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==, - } + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: color-name: 1.1.3 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==, - } - engines: { node: '>=7.0.0' } + [email protected]: dependencies: color-name: 1.1.4 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==, - } - engines: { node: '>= 12.0.0' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==, - } - - /[email protected]: - resolution: - { - integrity: sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg==, - } - engines: { node: '>=12' } - dependencies: - ajv: 8.12.0 - ajv-formats: 2.1.1([email protected]) - atomically: 1.7.0 - debounce-fn: 4.0.0 - dot-prop: 6.0.1 - env-paths: 2.2.1 - json-schema-typed: 7.0.3 - onetime: 5.1.2 - pkg-up: 3.1.0 - semver: 7.6.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-uuUHie0sfPP542TKGzPFal0W1wo1beuKAqIZdaavcONx8OoqdnJRKjkinbRTOta4FaCa1RcIL+7mMJWX3pQGVg==, - } + [email protected]: {} + + [email protected]: {} + + [email protected]: + dependencies: + color-name: 1.1.4 + simple-swizzle: 0.2.2 + optional: true + + [email protected]: + dependencies: + color-convert: 2.0.1 + color-string: 1.9.1 + optional: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: simple-wcswidth: 1.0.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==, - } - engines: { node: '>=10' } + + [email protected]: {} + + [email protected]: dependencies: '@types/parse-json': 4.0.2 import-fresh: 3.3.0 parse-json: 5.2.0 path-type: 4.0.0 yaml: 1.10.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==, - } - engines: { node: '>=10.14', npm: '>=6', yarn: '>=1' } - hasBin: true + + [email protected]: {} + + [email protected]: dependencies: cross-spawn: 7.0.3 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==, - } - engines: { node: '>= 8' } + [email protected]: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - /[email protected]: - resolution: - { - integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==, - } - - /[email protected]: - resolution: - { - integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==, - } - engines: { node: '>=0.12' } - dependencies: - es5-ext: 0.10.64 - type: 2.7.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==, - } - engines: { node: '>= 0.4' } + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 is-data-view: 1.0.1 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 is-data-view: 1.0.1 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 is-data-view: 1.0.1 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==, - } - engines: { node: '>=10' } - dependencies: - mimic-fn: 3.1.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==, - } - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.3 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==, - } - engines: { node: '>=6.0' } - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - /[email protected]: - resolution: - { - integrity: sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==, - } - dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 - es-get-iterator: 1.1.3 - get-intrinsic: 1.2.4 - is-arguments: 1.1.1 - is-array-buffer: 3.0.4 - is-date-object: 1.0.5 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 - isarray: 2.0.5 - object-is: 1.1.6 - object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - side-channel: 1.0.6 - which-boxed-primitive: 1.0.2 - which-collection: 1.0.2 - which-typed-array: 1.1.15 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==, - } - engines: { node: '>=0.10.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==, - } - engines: { node: '>= 0.4' } + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: + dependencies: + ms: 2.1.3 + + [email protected]: + dependencies: + ms: 2.1.2 + + [email protected]: + dependencies: + ms: 2.1.3 + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: es-define-property: 1.0.0 es-errors: 1.3.0 gopd: 1.0.1 - /[email protected]: - resolution: - { - integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: define-data-property: 1.1.4 has-property-descriptors: 1.0.2 object-keys: 1.1.1 - /[email protected]: - resolution: - { - integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==, - } - engines: { node: '>=6' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==, - } - engines: { node: '>=0.3.1' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==, - } - engines: { node: '>=8' } + [email protected]: {} + + [email protected]: + optional: true + + [email protected]: {} + + [email protected]: dependencies: path-type: 4.0.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-GYqKi1aH7PJXxdhTeZBFrg8vUBeKXi+cNprXsC1kpJcbcVnV9wBsrOu1cQEdG0WeQwlfHiy3XvnKfIrJ2R0NzQ==, - } - hasBin: true - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==, - } - engines: { node: '>=0.10.0' } + [email protected]: dependencies: esutils: 2.0.3 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==, - } - engines: { node: '>=6.0.0' } + [email protected]: dependencies: esutils: 2.0.3 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==, - } + [email protected]: dependencies: '@babel/runtime': 7.24.4 csstype: 3.1.3 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==, - } - engines: { node: '>=10' } - dependencies: - is-obj: 2.0.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==, - } - engines: { node: '>=12' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==, - } - engines: { node: '>=10' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==, - } - dependencies: - safe-buffer: 5.2.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==, - } + + [email protected]: + dependencies: + call-bind-apply-helpers: 1.0.1 + es-errors: 1.3.0 + gopd: 1.2.0 + + [email protected]: {} + + [email protected]: dependencies: once: 1.4.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==, - } - engines: { node: '>=6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==, - } + + [email protected]: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.2.1 + + [email protected]: dependencies: is-arrayish: 0.2.1 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: array-buffer-byte-length: 1.0.1 arraybuffer.prototype.slice: 1.0.3 @@ -4248,47 +4926,67 @@ packages: typed-array-length: 1.0.6 unbox-primitive: 1.0.2 which-typed-array: 1.1.15 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: - get-intrinsic: 1.2.4 - - /[email protected]: - resolution: - { - integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==, - } - engines: { node: '>= 0.4' } + array-buffer-byte-length: 1.0.1 + arraybuffer.prototype.slice: 1.0.4 + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.3 + data-view-buffer: 1.0.1 + data-view-byte-length: 1.0.1 + data-view-byte-offset: 1.0.0 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-set-tostringtag: 2.0.3 + es-to-primitive: 1.3.0 + function.prototype.name: 1.1.7 + get-intrinsic: 1.2.6 + get-symbol-description: 1.0.2 + globalthis: 1.0.4 + gopd: 1.2.0 + has-property-descriptors: 1.0.2 + has-proto: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + internal-slot: 1.1.0 + is-array-buffer: 3.0.4 + is-callable: 1.2.7 + is-data-view: 1.0.2 + is-negative-zero: 2.0.3 + is-regex: 1.2.1 + is-shared-array-buffer: 1.0.3 + is-string: 1.1.1 + is-typed-array: 1.1.13 + is-weakref: 1.1.0 + math-intrinsics: 1.1.0 + object-inspect: 1.13.3 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.3 + safe-array-concat: 1.1.3 + safe-regex-test: 1.1.0 + string.prototype.trim: 1.2.10 + string.prototype.trimend: 1.0.9 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.2 + typed-array-byte-length: 1.0.1 + typed-array-byte-offset: 1.0.4 + typed-array-length: 1.0.7 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.18 - /[email protected]: - resolution: - { - integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==, - } + [email protected]: dependencies: - call-bind: 1.0.7 get-intrinsic: 1.2.4 - has-symbols: 1.0.3 - is-arguments: 1.1.1 - is-map: 2.0.3 - is-set: 2.0.3 - is-string: 1.0.7 - isarray: 2.0.5 - stop-iteration-iterator: 1.0.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-scxAJaewsahbqTYrGKJihhViaM6DDZDDoucfvzNbK0pOren1g/daDQ3IAhzn+1G14rBG7w+i5N+qul60++zlKA==, - } - engines: { node: '>= 0.4' } + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 @@ -4297,562 +4995,209 @@ packages: es-set-tostringtag: 2.0.3 function-bind: 1.1.2 get-intrinsic: 1.2.4 - globalthis: 1.0.3 + globalthis: 1.0.4 + gopd: 1.0.1 has-property-descriptors: 1.0.2 has-proto: 1.0.3 has-symbols: 1.0.3 internal-slot: 1.0.7 - iterator.prototype: 1.1.2 + iterator.prototype: 1.1.4 safe-array-concat: 1.1.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: es-errors: 1.3.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: get-intrinsic: 1.2.4 has-tostringtag: 1.0.2 hasown: 2.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==, - } + [email protected]: dependencies: hasown: 2.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: is-callable: 1.2.7 is-date-object: 1.0.5 is-symbol: 1.0.4 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==, - } - engines: { node: '>=0.10' } - requiresBuild: true - dependencies: - es6-iterator: 2.0.3 - es6-symbol: 3.1.4 - esniff: 2.0.1 - next-tick: 1.1.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==, - } - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-symbol: 3.1.4 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==, - } - engines: { node: '>=0.12' } - dependencies: - d: 1.0.2 - ext: 1.7.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==, - } - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-iterator: 2.0.3 - es6-symbol: 3.1.4 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==, - } - engines: { node: '>=12' } - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/aix-ppc64': 0.19.12 - '@esbuild/android-arm': 0.19.12 - '@esbuild/android-arm64': 0.19.12 - '@esbuild/android-x64': 0.19.12 - '@esbuild/darwin-arm64': 0.19.12 - '@esbuild/darwin-x64': 0.19.12 - '@esbuild/freebsd-arm64': 0.19.12 - '@esbuild/freebsd-x64': 0.19.12 - '@esbuild/linux-arm': 0.19.12 - '@esbuild/linux-arm64': 0.19.12 - '@esbuild/linux-ia32': 0.19.12 - '@esbuild/linux-loong64': 0.19.12 - '@esbuild/linux-mips64el': 0.19.12 - '@esbuild/linux-ppc64': 0.19.12 - '@esbuild/linux-riscv64': 0.19.12 - '@esbuild/linux-s390x': 0.19.12 - '@esbuild/linux-x64': 0.19.12 - '@esbuild/netbsd-x64': 0.19.12 - '@esbuild/openbsd-x64': 0.19.12 - '@esbuild/sunos-x64': 0.19.12 - '@esbuild/win32-arm64': 0.19.12 - '@esbuild/win32-ia32': 0.19.12 - '@esbuild/win32-x64': 0.19.12 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==, - } - engines: { node: '>=0.8.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==, - } - engines: { node: '>=10' } - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==, - } - hasBin: true - peerDependencies: - eslint: '>=7.0.0' + + [email protected]: dependencies: - eslint: 8.48.0 - dev: true + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + + [email protected]: + optionalDependencies: + '@esbuild/aix-ppc64': 0.23.1 + '@esbuild/android-arm': 0.23.1 + '@esbuild/android-arm64': 0.23.1 + '@esbuild/android-x64': 0.23.1 + '@esbuild/darwin-arm64': 0.23.1 + '@esbuild/darwin-x64': 0.23.1 + '@esbuild/freebsd-arm64': 0.23.1 + '@esbuild/freebsd-x64': 0.23.1 + '@esbuild/linux-arm': 0.23.1 + '@esbuild/linux-arm64': 0.23.1 + '@esbuild/linux-ia32': 0.23.1 + '@esbuild/linux-loong64': 0.23.1 + '@esbuild/linux-mips64el': 0.23.1 + '@esbuild/linux-ppc64': 0.23.1 + '@esbuild/linux-riscv64': 0.23.1 + '@esbuild/linux-s390x': 0.23.1 + '@esbuild/linux-x64': 0.23.1 + '@esbuild/netbsd-x64': 0.23.1 + '@esbuild/openbsd-arm64': 0.23.1 + '@esbuild/openbsd-x64': 0.23.1 + '@esbuild/sunos-x64': 0.23.1 + '@esbuild/win32-arm64': 0.23.1 + '@esbuild/win32-ia32': 0.23.1 + '@esbuild/win32-x64': 0.23.1 + + [email protected]: {} + + [email protected]: {} + + [email protected]([email protected])([email protected]): + dependencies: + '@next/eslint-plugin-next': 15.1.2 + '@rushstack/eslint-patch': 1.10.4 + '@typescript-eslint/eslint-plugin': 6.6.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]) + '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.7.0([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))([email protected]) + eslint-plugin-import: 2.31.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))([email protected]))([email protected]) + eslint-plugin-jsx-a11y: 6.10.2([email protected]) + eslint-plugin-react: 7.37.2([email protected]) + eslint-plugin-react-hooks: 5.1.0([email protected]) + optionalDependencies: + typescript: 5.5.2 + transitivePeerDependencies: + - eslint-import-resolver-webpack + - eslint-plugin-import-x + - supports-color - /[email protected]: - resolution: - { - integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==, - } + [email protected]: dependencies: debug: 3.2.7 is-core-module: 2.13.1 resolve: 1.22.8 transitivePeerDependencies: - supports-color - dev: true - - /[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==, - } - engines: { node: '>=4' } - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: '*' - eslint-import-resolver-node: '*' - eslint-import-resolver-typescript: '*' - eslint-import-resolver-webpack: '*' - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - eslint: - optional: true - eslint-import-resolver-node: - optional: true - eslint-import-resolver-typescript: - optional: true - eslint-import-resolver-webpack: - optional: true + + [email protected]([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))([email protected]): + dependencies: + '@nolyfill/is-core-module': 1.0.39 + debug: 4.4.0 + enhanced-resolve: 5.17.1 + eslint: 8.57.0 + fast-glob: 3.3.2 + get-tsconfig: 4.8.1 + is-bun-module: 1.3.0 + is-glob: 4.0.3 + stable-hash: 0.0.4 + optionalDependencies: + eslint-plugin-import: 2.31.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))([email protected]))([email protected]) + transitivePeerDependencies: + - supports-color + + [email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))([email protected]))([email protected]): dependencies: - '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) debug: 3.2.7 - eslint: 8.48.0 + optionalDependencies: + '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) + eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.7.0([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))([email protected]) transitivePeerDependencies: - supports-color - dev: true - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==, - } - engines: { node: '>=8.10.0' } - peerDependencies: - eslint: '>=4.19.1' - dependencies: - eslint: 8.48.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 - dev: true - - /[email protected](@typescript-eslint/[email protected])([email protected]): - resolution: - { - integrity: sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==, - } - engines: { node: '>=4' } - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true + + [email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))([email protected]))([email protected]): dependencies: - '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) + '@rtsao/scc': 1.1.0 array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.48.0 + eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/[email protected])([email protected])([email protected]) - has: 1.0.4 - is-core-module: 2.13.1 + eslint-module-utils: 2.12.0(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected]([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))([email protected]))([email protected]) + hasown: 2.0.2 + is-core-module: 2.16.0 is-glob: 4.0.3 minimatch: 3.1.2 object.fromentries: 2.0.8 object.groupby: 1.0.3 object.values: 1.2.0 semver: 6.3.1 + string.prototype.trimend: 1.0.8 tsconfig-paths: 3.15.0 + optionalDependencies: + '@typescript-eslint/parser': 6.6.0([email protected])([email protected]) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - dev: true - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-JIXZp+E/h/aGlP/rQc4tuOejiHlZXg65qw8JAJMIJA5VsdjOkss/SYcRSqBrQuEOytEM8JvngUjcz31d1RrCrA==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6', yarn: '>=1' } - peerDependencies: - '@testing-library/dom': ^8.0.0 || ^9.0.0 - eslint: ^6.8.0 || ^7.0.0 || ^8.0.0 - peerDependenciesMeta: - '@testing-library/dom': - optional: true - dependencies: - '@babel/runtime': 7.24.4 - eslint: 8.48.0 - requireindex: 1.2.0 - dev: true - - /[email protected](@typescript-eslint/[email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==, - } - engines: { node: ^14.15.0 || ^16.10.0 || >=18.0.0 } - peerDependencies: - '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 - eslint: ^7.0.0 || ^8.0.0 - jest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - jest: - optional: true - dependencies: - '@typescript-eslint/eslint-plugin': 6.6.0(@typescript-eslint/[email protected])([email protected])([email protected]) - '@typescript-eslint/utils': 5.62.0([email protected])([email protected]) - eslint: 8.48.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA==, - } - engines: { node: '>=4.0' } - peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + + [email protected]([email protected]): dependencies: - '@babel/runtime': 7.24.4 - aria-query: 5.3.0 + aria-query: 5.3.2 array-includes: 3.1.8 array.prototype.flatmap: 1.3.2 - ast-types-flow: 0.0.7 - axe-core: 4.9.0 - axobject-query: 3.2.1 + ast-types-flow: 0.0.8 + axe-core: 4.10.2 + axobject-query: 4.1.0 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 - eslint: 8.48.0 - has: 1.0.4 + eslint: 8.57.0 + hasown: 2.0.2 jsx-ast-utils: 3.3.5 - language-tags: 1.0.5 + language-tags: 1.0.9 minimatch: 3.1.2 - object.entries: 1.1.8 object.fromentries: 2.0.8 - semver: 6.3.1 - dev: true - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==, - } - engines: { node: '>=8.10.0' } - peerDependencies: - eslint: '>=5.16.0' - dependencies: - eslint: 8.48.0 - eslint-plugin-es: 3.0.1([email protected]) - eslint-utils: 2.1.0 - ignore: 5.3.1 - minimatch: 3.1.2 - resolve: 1.22.8 - semver: 6.3.1 - dev: true - - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-VqUk5WR7Dj8L0gNPqn7bl7NTHFYB8l5um4wo7hkMp0Dl+k8RHDAsOef4pPrty6G8vjnzvb3xIZNNshmDJI8SdA==, - } - peerDependencies: - astro-eslint-parser: ^0.14.0 - eslint: '>=8.0.0' - svelte: '>=3.0.0' - svelte-eslint-parser: ^0.32.0 - vue-eslint-parser: '>=9.0.0' - peerDependenciesMeta: - astro-eslint-parser: - optional: true - svelte: - optional: true - svelte-eslint-parser: - optional: true - vue-eslint-parser: - optional: true - dependencies: - '@typescript-eslint/utils': 6.21.0([email protected])([email protected]) - eslint: 8.48.0 - minimatch: 9.0.4 - natural-compare-lite: 1.4.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-DcHpF0SLbNeh9MT4pMzUGuUSnJ7q5MWbP8sSEFIMS6j7Ggnduq8ghNlfhURgty4c1YFny7Ge9xYTO1FSAoV2Vw==, - } - peerDependencies: - eslint: '>=7' - eslint-plugin-jest: '>=25' - peerDependenciesMeta: - eslint-plugin-jest: - optional: true - dependencies: - eslint: 8.48.0 - eslint-plugin-jest: 27.2.3(@typescript-eslint/[email protected])([email protected])([email protected]) - dev: true + safe-regex-test: 1.0.3 + string.prototype.includes: 2.0.1 - /[email protected]([email protected]): - resolution: - { - integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==, - } - engines: { node: '>=10' } - peerDependencies: - eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + [email protected]([email protected]): dependencies: - eslint: 8.48.0 - dev: true + eslint: 8.57.0 - /[email protected]([email protected]): - resolution: - { - integrity: sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==, - } - engines: { node: '>=4' } - peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + [email protected]([email protected]): dependencies: array-includes: 3.1.8 + array.prototype.findlast: 1.2.5 array.prototype.flatmap: 1.3.2 - array.prototype.tosorted: 1.1.3 + array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 - es-iterator-helpers: 1.0.18 - eslint: 8.48.0 + es-iterator-helpers: 1.2.0 + eslint: 8.57.0 estraverse: 5.3.0 + hasown: 2.0.2 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 object.entries: 1.1.8 object.fromentries: 2.0.8 - object.hasown: 1.1.4 object.values: 1.2.0 prop-types: 15.8.1 resolve: 2.0.0-next.5 semver: 6.3.1 string.prototype.matchall: 4.0.11 - dev: true - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-YEtQPfdudafU7RBIFci81R/Q1yErm0mVh3BkGnXD2Dk8DLwTFdc2ITYH1wCnHKim2gnHfPFgrkh+b2ozyyU7ag==, - } - engines: { node: ^12 || >=14 } - peerDependencies: - eslint: '>=6.0.0' - dependencies: - '@eslint-community/eslint-utils': 4.4.0([email protected]) - '@eslint-community/regexpp': 4.10.0 - comment-parser: 1.4.1 - eslint: 8.48.0 - grapheme-splitter: 1.0.4 - jsdoctypeparser: 9.0.0 - refa: 0.11.0 - regexp-ast-analysis: 0.6.0 - scslre: 0.2.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==, - } - engines: { node: '>=8.0.0' } - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - dev: true + string.prototype.repeat: 1.0.0 - /[email protected]: - resolution: - { - integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + [email protected]: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==, - } - engines: { node: '>=6' } - dependencies: - eslint-visitor-keys: 1.3.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==, - } - engines: { node: '>=4' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-sb6DLeIuRXxeM1YljSe1KEx9/YYeZFQWcV8Rq9HfigmdDEugjLEVEa1ozDjL6YDjBpQHPJxJzze+alxi4T3OLg==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - hasBin: true - dependencies: - '@eslint-community/eslint-utils': 4.4.0([email protected]) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.48.0 - '@humanwhocodes/config-array': 0.11.14 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4 - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 - ignore: 5.3.1 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.3 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - hasBin: true + + [email protected]: {} + + [email protected]: dependencies: '@eslint-community/eslint-utils': 4.4.0([email protected]) '@eslint-community/regexpp': 4.10.0 @@ -4894,457 +5239,169 @@ packages: text-table: 0.2.0 transitivePeerDependencies: - supports-color - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==, - } - engines: { node: '>=0.10' } - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - event-emitter: 0.3.5 - type: 2.7.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + + [email protected]: dependencies: acorn: 8.11.3 acorn-jsx: 5.3.2([email protected]) eslint-visitor-keys: 3.4.3 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==, - } - engines: { node: '>=0.10' } + [email protected]: dependencies: estraverse: 5.3.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==, - } - engines: { node: '>=4.0' } + [email protected]: dependencies: estraverse: 5.3.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==, - } - engines: { node: '>=4.0' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==, - } - engines: { node: '>=4.0' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==, - } - engines: { node: '>=0.10.0' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==, - } - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==, - } - engines: { node: '>=6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==, - } - engines: { node: '>=0.8.x' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==, - } - dependencies: - type: 2.7.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==, - } - - /[email protected]: - resolution: - { - integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==, - } - engines: { node: '>=8.6.0' } + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: '@nodelib/fs.stat': 2.0.5 '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==, - } - engines: { node: '>=6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==, - } - hasBin: true - requiresBuild: true + + [email protected]: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: strnum: 1.0.5 - dev: false optional: true - /[email protected]: - resolution: - { - integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==, - } + [email protected]: dependencies: reusify: 1.0.4 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==, - } - engines: { node: ^10.12.0 || >=12.0.0 } + [email protected]([email protected]): + optionalDependencies: + picomatch: 4.0.2 + + [email protected]: dependencies: flat-cache: 3.2.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-/yFHK0aGjFEgDJjEKP0pWCplsPFPhwyfwevf/pVxiN0tmE4L9LmwWxWukdJSHdoCli4VgQLehjJtwQBnqmsKcw==, - } - engines: { node: '>=10' } - dependencies: - readable-web-to-node-stream: 3.0.2 - strtok3: 6.3.0 - token-types: 4.2.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-s7cxa7/leUWLiXO78DVVfBVse+milos9FitauDLG1pI7lNaJ2+5lzPnr2N24ym+84HVwJL6hVuGfgVE+ALvU8Q==, - } - engines: { node: '>=18' } - dependencies: - readable-web-to-node-stream: 3.0.2 - strtok3: 7.0.0 - token-types: 5.0.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==, - } - engines: { node: '>=8' } + + [email protected]: + dependencies: + strtok3: 8.1.0 + token-types: 6.0.0 + uint8array-extras: 1.4.0 + + [email protected]: dependencies: to-regex-range: 5.0.1 - /[email protected]: - resolution: - { - integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==, - } - engines: { node: '>=6' } - dependencies: - locate-path: 3.0.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==, - } - engines: { node: '>=8' } - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==, - } - engines: { node: '>=10' } + [email protected]: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==, - } - engines: { node: ^10.12.0 || >=12.0.0 } + [email protected]: dependencies: flatted: 3.3.1 keyv: 4.5.4 rimraf: 3.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-vsb0/03uIHu7/3jRqABweblFUJMLokz1uMrcgFlvx6OAr6V3FiSic2iXeiJCj+cciTiQeumSDsIFAAnN1yvu4w==, - } + [email protected]: {} + + [email protected]: dependencies: - is-buffer: 1.1.6 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-v2NTsZe2FF59Y+sDykKY+XjqZ0cPfhq/hikWVL88BqLivnNiEffAsac6rP6H45ff9wG9LL5ToiDqrLEP9GX9mw==, - } - dependencies: - tabbable: 5.3.3 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==, - } + tabbable: 6.2.0 + + [email protected]: dependencies: is-callable: 1.2.7 - /[email protected]: - resolution: - { - integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==, - } - - /[email protected]: - resolution: - { - integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==, - } - engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 } - os: [darwin] - requiresBuild: true + [email protected]: {} + + [email protected]: optional: true - /[email protected]: - resolution: - { - integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==, - } + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 functions-have-names: 1.2.3 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==, - } + [email protected]: + dependencies: + call-bind: 1.0.8 + define-properties: 1.2.1 + functions-have-names: 1.2.3 + hasown: 2.0.2 + is-callable: 1.2.7 + + [email protected]: {} + + [email protected]: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 - /[email protected]: - resolution: - { - integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: + call-bind-apply-helpers: 1.0.1 + dunder-proto: 1.0.1 + es-define-property: 1.0.1 es-errors: 1.3.0 + es-object-atoms: 1.0.0 function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 + gopd: 1.2.0 + has-symbols: 1.1.0 hasown: 2.0.2 + math-intrinsics: 1.1.0 - /[email protected]: - resolution: - { - integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==, - } - engines: { node: '>=8' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==, - } - engines: { node: '>=10' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 get-intrinsic: 1.2.4 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-ZvkrzoUA0PQZM6fy6+/Hce561s+faD1rsNwhnO5FelNjyy7EMGJ3Rz1AQ8GYDWjhRs/7dBLOEJvhK8MiEJOAFg==, - } + [email protected]: dependencies: resolve-pkg-maps: 1.0.0 - /[email protected]: - resolution: - { - integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==, - } - engines: { node: '>= 6' } + [email protected]: dependencies: is-glob: 4.0.3 - /[email protected]: - resolution: - { - integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==, - } - engines: { node: '>=10.13.0' } + [email protected]: dependencies: is-glob: 4.0.3 - dev: true - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-xcUzJ8NWN5bktoTIX7eOclO1Npxd/dyVqUJxlLIDasT4C7KZyqlPIwkdJ0Ypiy3p2ZKahTjK4M9uC3sNSfNMzw==, - } - engines: { node: '>=12' } - peerDependencies: - glob: ^7.1.6 - dependencies: - '@types/glob': 7.2.0 - glob: 7.2.3 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==, - } - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==, - } + [email protected]: dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -5353,46 +5410,20 @@ packages: once: 1.4.0 path-is-absolute: 1.0.1 - /[email protected]: - resolution: - { - integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==, - } - engines: { node: '>=12' } + [email protected]: dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.6 - once: 1.4.0 - dev: false + type-fest: 0.20.2 - /[email protected]: - resolution: - { - integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==, - } - engines: { node: '>=8' } + [email protected]: dependencies: - type-fest: 0.20.2 - dev: true + define-properties: 1.2.1 - /[email protected]: - resolution: - { - integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: define-properties: 1.2.1 - dev: true + gopd: 1.0.1 - /[email protected]: - resolution: - { - integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==, - } - engines: { node: '>=10' } + [email protected]: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 @@ -5400,1368 +5431,533 @@ packages: ignore: 5.3.1 merge2: 1.4.1 slash: 3.0.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==, - } + [email protected]: dependencies: get-intrinsic: 1.2.4 - /[email protected]: - resolution: - { - integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==, - } - dev: true - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-4Jor+LRbA7SfSaw7dfDUs2UBzvWg3cKrykfHRgKsOIvQaLuf+QOcG2t3Mx5N9GzSNJcuqMqJWz0ta5+BryEmXg==, - } - engines: { node: '>=12' } - peerDependencies: - graphql: '>=0.11 <=16' + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]([email protected]): dependencies: graphql: 16.8.1 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-tpCujhsJMva4aqE8ULnF7/l3xw4sNRZcSHu+R00VV+W0mfp+Q20Plvcrp+5UXD+2yS6oyCXncA+zoQJQqhGCEw==, - } + [email protected]: dependencies: xss: 1.0.15 - dev: false - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-my9FB4GtghqXqi/lWSVAOPiTzTnnEzdOXCsAC2bb5V7EFNQjVjwy3cSSbUvgYOtDuDibd+ZsCDhz+4eykYOlhQ==, - } - engines: { node: '>=10' } - peerDependencies: - graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 + + [email protected]([email protected]): dependencies: graphql: 16.8.1 tslib: 2.6.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==, - } - engines: { node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0 } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==, - } - - /[email protected]: - resolution: - { - integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==, - } - engines: { node: '>=4' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==, - } - engines: { node: '>=8' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==, - } + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: es-define-property: 1.0.0 - /[email protected]: - resolution: - { - integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==, - } - engines: { node: '>= 0.4' } - - /[email protected]: - resolution: - { - integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==, - } - engines: { node: '>= 0.4' } - - /[email protected]: - resolution: - { - integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==, - } - engines: { node: '>= 0.4' } + [email protected]: {} + + [email protected]: + dependencies: + dunder-proto: 1.0.1 + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: has-symbols: 1.0.3 - /[email protected]: - resolution: - { - integrity: sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==, - } - engines: { node: '>= 0.4.0' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: function-bind: 1.1.2 - /[email protected]: - resolution: - { - integrity: sha512-TAOnTB8Tz5Dw8penUuzHVrKNKlCIbwwbHnXraNJxPwf8LRtE2HlM84RYuezMFcwOJmoYOCWVDyJ8TQGxn9PgxA==, - } - dependencies: - glob: 8.1.0 - readable-stream: 3.6.2 - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==, - } + [email protected]: dependencies: react-is: 16.13.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-oUExvfNckrpTpDazph7kNG8sQi5au3BeTo0idaZFXEhTaJKu7GNJCLHI0rYY2wljm548MSTM+Ljj/c6anqu2zQ==, - } - engines: { node: '>= 0.4.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==, - } - engines: { node: '>= 4' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-541xKlUw6jr/6gGuk92F+mYM5zaFAc5ahphvkqvNe2bQ6gVBkd6bfrmVJ2t4KDAfikAYZyIqTnktX3i6/aQDrQ==, - } - engines: { node: '>=16.x' } - hasBin: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: queue: 6.0.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==, - } - engines: { node: '>=6' } + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 - /[email protected]: - resolution: - { - integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==, - } - engines: { node: '>=0.8.19' } - dev: true + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==, - } + [email protected]: dependencies: once: 1.4.0 wrappy: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==, - } + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: es-errors: 1.3.0 hasown: 2.0.2 side-channel: 1.0.6 - /[email protected]: - resolution: - { - integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==, - } - engines: { node: '>= 12' } + [email protected]: dependencies: - jsbn: 1.1.0 - sprintf-js: 1.1.3 - dev: false + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.1.0 - /[email protected]: - resolution: - { - integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: - call-bind: 1.0.7 - has-tostringtag: 1.0.2 - dev: false + jsbn: 1.1.0 + sprintf-js: 1.1.3 + optional: true - /[email protected]: - resolution: - { - integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 get-intrinsic: 1.2.4 - /[email protected]: - resolution: - { - integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==, - } - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==, - } - engines: { node: '>= 0.4' } + [email protected]: + optional: true + + [email protected]: dependencies: has-tostringtag: 1.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==, - } + [email protected]: + dependencies: + has-bigints: 1.0.2 + + [email protected]: dependencies: has-bigints: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==, - } - engines: { node: '>=8' } + [email protected]: dependencies: binary-extensions: 2.3.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 has-tostringtag: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==, - } - engines: { node: '>= 0.4' } - - /[email protected]: - resolution: - { - integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==, - } + [email protected]: + dependencies: + call-bound: 1.0.3 + has-tostringtag: 1.0.2 + + [email protected]: {} + + [email protected]: + dependencies: + semver: 7.6.3 + + [email protected]: {} + + [email protected]: dependencies: hasown: 2.0.2 - /[email protected]: - resolution: - { - integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: + hasown: 2.0.2 + + [email protected]: + dependencies: + is-typed-array: 1.1.13 + + [email protected]: + dependencies: + call-bound: 1.0.3 + get-intrinsic: 1.2.6 is-typed-array: 1.1.13 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==, - } - engines: { node: '>= 0.4' } + [email protected]: + dependencies: + has-tostringtag: 1.0.2 + + [email protected]: dependencies: + call-bound: 1.0.3 has-tostringtag: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==, - } - engines: { node: '>=0.10.0' } + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==, - } + [email protected]: dependencies: - call-bind: 1.0.7 - dev: true + call-bound: 1.0.3 - /[email protected]: - resolution: - { - integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: has-tostringtag: 1.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==, - } - engines: { node: '>=0.10.0' } + [email protected]: dependencies: is-extglob: 2.1.1 - /[email protected]: - resolution: - { - integrity: sha512-qs3NZ1INIS+H+yeo7cD9pDfwYV/jqRh1JG9S9zYrNudkoUQg7OL7ziXqRKu+InFjUIDoP2o6HIkLYMh1pcWgyQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==, - } - engines: { node: '>= 0.4' } - - /[email protected]: - resolution: - { - integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==, - } - engines: { node: '>= 0.4' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==, - } - engines: { node: '>= 0.4' } + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: + dependencies: + has-tostringtag: 1.0.2 + + [email protected]: dependencies: + call-bound: 1.0.3 has-tostringtag: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==, - } - engines: { node: '>=0.12.0' } - - /[email protected]: - resolution: - { - integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==, - } - engines: { node: '>=8' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==, - } - engines: { node: '>=8' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==, - } - engines: { node: '>=0.10.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==, - } - engines: { node: '>= 0.4' } + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: call-bind: 1.0.7 has-tostringtag: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==, - } - engines: { node: '>= 0.4' } + [email protected]: + dependencies: + call-bound: 1.0.3 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 - /[email protected]: - resolution: - { - integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: has-tostringtag: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==, - } - engines: { node: '>= 0.4' } + [email protected]: + dependencies: + call-bound: 1.0.3 + has-tostringtag: 1.0.2 + + [email protected]: dependencies: has-symbols: 1.0.3 - /[email protected]: - resolution: - { - integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==, - } - engines: { node: '>= 0.4' } + [email protected]: + dependencies: + call-bound: 1.0.3 + has-symbols: 1.1.0 + safe-regex-test: 1.1.0 + + [email protected]: dependencies: which-typed-array: 1.1.15 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==, - } - engines: { node: '>= 0.4' } + [email protected]: + dependencies: + which-typed-array: 1.1.18 + + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==, - } + [email protected]: dependencies: call-bind: 1.0.7 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bound: 1.0.3 + + [email protected]: + dependencies: + call-bind: 1.0.8 + get-intrinsic: 1.2.6 - /[email protected]: - resolution: - { - integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==, - } + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==, - } + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==, - } + [email protected]: dependencies: - define-properties: 1.2.1 - get-intrinsic: 1.2.4 - has-symbols: 1.0.3 - reflect.getprototypeof: 1.0.6 + define-data-property: 1.1.4 + es-object-atoms: 1.0.0 + get-intrinsic: 1.2.6 + has-symbols: 1.1.0 + reflect.getprototypeof: 1.0.9 set-function-name: 2.0.2 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-9qcrTyoBmFZRNHeVP4edKqIUEgFzq7MHvTNSDuHSqkpOPtiBkgNgcmTSqmiw1kw9tdKaiddvIDv/eCJDxmqWCA==, - } - dependencies: - '@hapi/hoek': 9.3.0 - '@hapi/topo': 5.1.0 - '@sideway/address': 4.1.5 - '@sideway/formula': 3.0.1 - '@sideway/pinpoint': 2.0.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==, - } - engines: { node: '>=10' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==, - } - - /[email protected]: - resolution: - { - integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==, - } - hasBin: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: argparse: 2.0.1 - /[email protected]: - resolution: - { - integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==, - } - engines: { node: '>=10' } - hasBin: true - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-EaEE9Y4VZ8b9jW5zce5a9L3+p4C9AqgIRHbNVDJahfMnoKzcd4sDb98BLxLdQhJEuRAXyKLg4H66NKm80W8ilg==, - } - engines: { node: '>=12.0.0' } - hasBin: true + [email protected]: + optional: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: - '@bcherny/json-schema-ref-parser': 9.0.9 + '@apidevtools/json-schema-ref-parser': 11.7.3 '@types/json-schema': 7.0.15 - '@types/lodash': 4.17.0 - '@types/prettier': 2.7.3 - cli-color: 2.0.4 - get-stdin: 8.0.0 - glob: 7.2.3 - glob-promise: 4.2.2([email protected]) + '@types/lodash': 4.17.13 is-glob: 4.0.3 + js-yaml: 4.1.0 lodash: 4.17.21 minimist: 1.2.8 - mkdirp: 1.0.4 - mz: 2.7.0 - prettier: 2.8.8 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==, - } - hasBin: true - dependencies: - minimist: 1.2.8 - dev: true + prettier: 3.4.2 + tinyglobby: 0.2.10 + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-K8wx7eJ5TPvEjuiVSkv167EVboBDv9PZdDoF7BgeQnBLVvZWW9clr2PsQHVJDTKaEIH5JBIwHujGcHp7GgI2eg==, - } - engines: { node: '>=12', npm: '>=6' } + [email protected]: dependencies: - jws: 3.2.2 - lodash: 4.17.21 - ms: 2.1.3 - semver: 7.6.0 - dev: false + minimist: 1.2.8 - /[email protected]: - resolution: - { - integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==, - } - engines: { node: '>=4.0' } + [email protected]: dependencies: array-includes: 3.1.8 array.prototype.flat: 1.3.2 object.assign: 4.1.5 object.values: 1.2.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==, - } - dependencies: - buffer-equal-constant-time: 1.0.1 - ecdsa-sig-formatter: 1.0.11 - safe-buffer: 5.2.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==, - } - dependencies: - jwa: 1.4.1 - safe-buffer: 5.2.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-7jFxRVm+jD+rkq3kY0iZDJfsO2/t4BBPeEb2qKn2lR/9KhuksYk5hxzfRYWMPV8P/x2d0kHD306YyWLzjjH+uA==, - } - engines: { node: '>=12.0.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==, - } + + [email protected]: {} + + [email protected]: dependencies: json-buffer: 3.0.1 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==, - } - engines: { node: '>=6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==, - } + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: language-subtag-registry: 0.3.22 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==, - } - engines: { node: '>= 0.8.0' } + [email protected]: dependencies: prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==, - } - engines: { node: '>=6' } - dependencies: - p-locate: 3.0.0 - path-exists: 3.0.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==, - } - engines: { node: '>=8' } - dependencies: - p-locate: 4.1.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==, - } - engines: { node: '>=10' } + + [email protected]: {} + + [email protected]: dependencies: p-locate: 5.0.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==, - } - hasBin: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: js-tokens: 4.0.0 - /[email protected]: - resolution: - { - integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==, - } - engines: { node: '>=10' } + [email protected]: dependencies: yallist: 4.0.0 - /[email protected]: - resolution: - { - integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==, - } - dependencies: - es5-ext: 0.10.64 - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==, - } + [email protected]: dependencies: charenc: 0.0.2 crypt: 0.0.2 is-buffer: 1.1.6 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ==, - } - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-weak-map: 2.0.3 - event-emitter: 0.3.5 - is-promise: 2.2.2 - lru-queue: 0.1.0 - next-tick: 1.1.0 - timers-ext: 0.1.7 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==, - } - requiresBuild: true - dev: false - optional: true - - /[email protected]: - resolution: - { - integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==, - } - engines: { node: '>= 8' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==, - } - engines: { node: '>=8.6' } + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: braces: 3.0.2 picomatch: 2.3.1 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==, - } - engines: { node: '>=6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==, - } - engines: { node: '>=8' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==, - } + + [email protected]: dependencies: brace-expansion: 1.1.11 - /[email protected]: - resolution: - { - integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==, - } - engines: { node: '>=10' } - dependencies: - brace-expansion: 2.0.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==, - } - engines: { node: '>=16 || 14 >=14.17' } - dependencies: - brace-expansion: 2.0.1 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==, - } - engines: { node: '>=16 || 14 >=14.17' } - dependencies: - brace-expansion: 2.0.1 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==, - } - - /[email protected]: - resolution: - { - integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==, - } - engines: { node: '>=10' } - hasBin: true - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-11Fkh6yzEmwx7O0YoLxeae0qEGFwmyPRlVxpg7oF9czOOCB/iCjdJrG5I67da5WiXK3YJCxoz9TJFE8Tfq/v9A==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-goSDElNqFfw7iDHMg8WDATkfcyeLTNpBHQpO8incK6p5qZt5G/1j41X0xdGzpIkGojGXM+QiRQyLjnfDVvrpwA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==, - } - dependencies: - '@types/whatwg-url': 8.2.2 - whatwg-url: 11.0.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-MBuyYiPUPRTqfH2dV0ya4dcr2E5N52ocBuZ8Sgg/M030nGF78v855B3Z27mZJnp8PxjnUquEnAtjOsphgMZOlQ==, - } - engines: { node: '>=12.9.0' } - dependencies: - bson: 4.7.2 - mongodb-connection-string-url: 2.6.0 - socks: 2.8.3 + [email protected]: {} + + [email protected]: {} + + [email protected]: + dependencies: + '@types/whatwg-url': 11.0.5 + whatwg-url: 13.0.0 + + [email protected](@aws-sdk/[email protected])([email protected]): + dependencies: + '@mongodb-js/saslprep': 1.1.5 + bson: 6.10.1 + mongodb-connection-string-url: 3.0.1 optionalDependencies: '@aws-sdk/credential-providers': 3.556.0 - '@mongodb-js/saslprep': 1.1.5 - transitivePeerDependencies: - - aws-crt - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-xW5GugkE21DJiu9e13EOxKt4ejEKQkRP/S1PkkXRjnk2rRZVKBcld1nPV+VJ/YCPfm8hb3sz9OvI7O38RmixkA==, - } - engines: { node: '>=4.0.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-MNJymaaXali7w7rHBxVUoQ3HzHHMk/7I/+yeeoSa4rUzdjZwIWQznBNvVgc0A8ghuJwsuIkb5LyLV6gSjGjWyQ==, - } - engines: { node: '>=12.0.0' } - dependencies: - bson: 4.7.2 - kareem: 2.5.1 - mongodb: 4.17.1 + socks: 2.8.3 + + [email protected]: {} + + [email protected]: {} + + [email protected](@aws-sdk/[email protected])([email protected]): + dependencies: + bson: 6.10.1 + kareem: 2.6.3 + mongodb: 6.10.0(@aws-sdk/[email protected])([email protected]) mpath: 0.9.0 - mquery: 4.0.3 + mquery: 5.0.0 ms: 2.1.3 - sift: 16.0.1 + sift: 17.1.3 transitivePeerDependencies: - - aws-crt + - '@aws-sdk/credential-providers' + - '@mongodb-js/zstd' + - gcp-metadata + - kerberos + - mongodb-client-encryption + - snappy + - socks - supports-color - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==, - } - engines: { node: '>=4.0.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-J5heI+P08I6VJ2Ky3+33IpCdAvlYGTSUjwTPxkAr8i8EoduPMBX2OY/wa3IKZIQl7MU4SbFk8ndgSKyB/cl1zA==, - } - engines: { node: '>=12.0.0' } + + [email protected]: {} + + [email protected]: dependencies: debug: 4.3.4 transitivePeerDependencies: - supports-color - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==, - } - - /[email protected]: - resolution: - { - integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==, - } - - /[email protected]: - resolution: - { - integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==, - } - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==, - } - engines: { node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 } - hasBin: true - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==, - } - dev: false - - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-loPrWTCvHvZgOy3rgL9+2WpxNDxlRNt462ihqm/DUuyK8LUZV1F4H920YTAu1wEiYC8RrpNUbpz8K7KRYAkQiA==, - } - engines: { node: '>=18.17.0' } - hasBin: true - peerDependencies: - '@opentelemetry/api': ^1.1.0 - '@playwright/test': ^1.41.2 - react: ^18.2.0 - react-dom: ^18.2.0 - sass: ^1.3.0 - peerDependenciesMeta: - '@opentelemetry/api': - optional: true - '@playwright/test': - optional: true - sass: - optional: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]([email protected]([email protected]))([email protected])([email protected]): dependencies: - '@next/env': 14.3.0-canary.7 - '@swc/helpers': 0.5.5 + '@next/env': 15.1.2 + '@swc/counter': 0.1.3 + '@swc/helpers': 0.5.15 busboy: 1.6.0 caniuse-lite: 1.0.30001612 - graceful-fs: 4.2.11 postcss: 8.4.31 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - styled-jsx: 5.1.1([email protected]) + react: 19.0.0 + react-dom: 19.0.0([email protected]) + styled-jsx: 5.1.6([email protected]) optionalDependencies: - '@next/swc-darwin-arm64': 14.3.0-canary.7 - '@next/swc-darwin-x64': 14.3.0-canary.7 - '@next/swc-linux-arm64-gnu': 14.3.0-canary.7 - '@next/swc-linux-arm64-musl': 14.3.0-canary.7 - '@next/swc-linux-x64-gnu': 14.3.0-canary.7 - '@next/swc-linux-x64-musl': 14.3.0-canary.7 - '@next/swc-win32-arm64-msvc': 14.3.0-canary.7 - '@next/swc-win32-ia32-msvc': 14.3.0-canary.7 - '@next/swc-win32-x64-msvc': 14.3.0-canary.7 + '@next/swc-darwin-arm64': 15.1.2 + '@next/swc-darwin-x64': 15.1.2 + '@next/swc-linux-arm64-gnu': 15.1.2 + '@next/swc-linux-arm64-musl': 15.1.2 + '@next/swc-linux-x64-gnu': 15.1.2 + '@next/swc-linux-x64-musl': 15.1.2 + '@next/swc-win32-arm64-msvc': 15.1.2 + '@next/swc-win32-x64-msvc': 15.1.2 + sass: 1.77.4 + sharp: 0.33.5 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==, - } - engines: { node: '>=0.10.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==, - } - engines: { node: '>=0.10.0' } - - /[email protected]: - resolution: - { - integrity: sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==, - } - - /[email protected]: - resolution: - { - integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==, - } - engines: { node: '>= 0.4' } - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==, - } - engines: { node: '>= 0.4' } - - /[email protected]: - resolution: - { - integrity: sha512-QiM9D0NiU5jV6J6tjE1g7b4Z2tcUnKs1OPUi4iMb2zH+7jwlcUrASghgkFk9GtzqNNq8rTQJtT8AzjBAvLoNMw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==, - } - engines: { node: '>= 0.4' } + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 has-symbols: 1.0.3 object-keys: 1.1.1 - /[email protected]: - resolution: - { - integrity: sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-object-atoms: 1.0.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 es-object-atoms: 1.0.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==, - } - engines: { node: '>= 0.4' } - dependencies: - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-object-atoms: 1.0.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==, - } - engines: { node: '>=14.0.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==, - } - dependencies: - wrappy: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==, - } - engines: { node: '>=6' } + [email protected]: {} + + [email protected]: dependencies: - mimic-fn: 2.1.0 - dev: false + wrappy: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==, - } - engines: { node: '>= 0.8.0' } + [email protected]: dependencies: '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 @@ -6769,951 +5965,344 @@ packages: levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==, - } - engines: { node: '>=6' } - dependencies: - p-try: 2.2.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==, - } - engines: { node: '>=10' } + [email protected]: dependencies: yocto-queue: 0.1.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==, - } - engines: { node: '>=6' } - dependencies: - p-limit: 2.3.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==, - } - engines: { node: '>=8' } - dependencies: - p-limit: 2.3.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==, - } - engines: { node: '>=10' } + + [email protected]: dependencies: p-limit: 3.1.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==, - } - engines: { node: '>=6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==, - } - engines: { node: '>=6' } + + [email protected]: dependencies: callsites: 3.1.0 - /[email protected]: - resolution: - { - integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==, - } - engines: { node: '>=8' } + [email protected]: dependencies: '@babel/code-frame': 7.24.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==, - } - engines: { node: '>=4' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==, - } - engines: { node: '>=8' } - - /[email protected]: - resolution: - { - integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==, - } - engines: { node: '>=0.10.0' } - - /[email protected]: - resolution: - { - integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==, - } - engines: { node: '>=8' } - - /[email protected]: - resolution: - { - integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==, - } - - /[email protected]: - resolution: - { - integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==, - } - engines: { node: '>=8' } - - /[email protected](@swc/[email protected])(@swc/[email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-th0l+dEl2QUcLf9I/M90YkhPtDmdW6r7/d4CMGaEKUcQURnqow9Owm8OiNsmFsHHO7dN92h4RgmnWqyuCc7smQ==, - } - engines: { node: ^18.20.2 || >=20.6.0 } - hasBin: true - peerDependencies: - '@swc/core': ^1.4.13 - graphql: ^16.8.1 - peerDependenciesMeta: - '@swc/core': - optional: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]): dependencies: - '@payloadcms/translations': 3.0.0-beta.24 - '@swc-node/core': 1.13.0(@swc/[email protected])(@swc/[email protected]) - '@swc-node/sourcemap-support': 0.5.0 - '@swc/core': 1.4.17 - '@types/probe-image-size': 7.2.4 - ajv: 8.12.0 + '@monaco-editor/react': 4.6.0([email protected])([email protected]([email protected]))([email protected]) + '@next/env': 15.1.2 + '@payloadcms/translations': 3.9.0 + '@types/busboy': 1.5.4 + ajv: 8.17.1 bson-objectid: 2.0.4 ci-info: 4.0.0 - conf: 10.2.0 - console-table-printer: 2.11.2 - dataloader: 2.2.2 + console-table-printer: 2.12.1 + croner: 9.0.0 + dataloader: 2.2.3 deepmerge: 4.3.1 - dotenv: 8.6.0 - file-type: 16.5.4 - find-up: 4.1.0 - get-tsconfig: 4.7.3 + file-type: 19.3.0 + get-tsconfig: 4.8.1 graphql: 16.8.1 http-status: 1.6.2 image-size: 1.1.1 - joi: 17.13.0 - json-schema-to-typescript: 11.0.3 - jsonwebtoken: 9.0.1 + jose: 5.9.6 + json-schema-to-typescript: 15.0.3 minimist: 1.2.8 - mkdirp: 1.0.4 - monaco-editor: 0.38.0 - pino: 8.15.0 - pino-pretty: 10.2.0 + pino: 9.5.0 + pino-pretty: 13.0.0 pluralize: 8.0.0 sanitize-filename: 1.6.3 - scheduler: 0.23.0 scmp: 2.1.0 - ts-essentials: 7.0.3([email protected]) - uuid: 9.0.1 + ts-essentials: 10.0.3([email protected]) + tsx: 4.19.2 + uuid: 10.0.0 + ws: 8.16.0 transitivePeerDependencies: - - '@swc/types' + - bufferutil + - monaco-editor + - react + - react-dom - typescript - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-ZI3LnwUv5nOGbQzD9c2iDG6toheuXSZP5esSHBjopsXH4dg19soufvpUGA3uohi5anFtGb2lhAVdHzH6R/Evvg==, - } - engines: { node: '>=8' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A==, - } - engines: { node: '>=14.16' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==, - } - engines: { node: '>=8.6' } - - /[email protected]: - resolution: - { - integrity: sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA==, - } - dependencies: - readable-stream: 4.5.2 - split2: 4.2.0 - dev: false + - utf-8-validate + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q==, - } + [email protected]: {} + + [email protected]: dependencies: - readable-stream: 4.5.2 split2: 4.2.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-tRvpyEmGtc2D+Lr3FulIZ+R1baggQ4S3xD2Ar93KixFEDx6SEAUP3W5aYuEw1C73d6ROrNcB2IXLteW8itlwhA==, - } - hasBin: true + [email protected]: dependencies: colorette: 2.0.20 dateformat: 4.6.3 fast-copy: 3.0.2 fast-safe-stringify: 2.1.1 - help-me: 4.2.0 + help-me: 5.0.0 joycon: 3.1.1 minimist: 1.2.8 on-exit-leak-free: 2.1.2 - pino-abstract-transport: 1.2.0 + pino-abstract-transport: 2.0.0 pump: 3.0.0 - readable-stream: 4.5.2 secure-json-parse: 2.7.0 - sonic-boom: 3.8.1 + sonic-boom: 4.2.0 strip-json-comments: 3.1.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-olUADJByk4twxccmAxb1RiGKOSvddHugCV3wkqjyv+3Sooa2KLrmXrKEWOKi0XPCLasRR5jBXxioE1jxUa4KzQ==, - } - hasBin: true + + [email protected]: {} + + [email protected]: dependencies: atomic-sleep: 1.0.0 fast-redact: 3.5.0 on-exit-leak-free: 2.1.2 - pino-abstract-transport: 1.0.0 - pino-std-serializers: 6.2.2 - process-warning: 2.3.2 + pino-abstract-transport: 2.0.0 + pino-std-serializers: 7.0.0 + process-warning: 4.0.0 quick-format-unescaped: 4.0.4 real-require: 0.2.0 safe-stable-stringify: 2.4.3 - sonic-boom: 3.8.1 - thread-stream: 2.6.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==, - } - engines: { node: '>=8' } - dependencies: - find-up: 3.0.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==, - } - engines: { node: '>=4' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==, - } - engines: { node: '>= 0.4' } - - /[email protected]: - resolution: - { - integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==, - } - engines: { node: ^10 || ^12 || >=14 } + sonic-boom: 4.2.0 + thread-stream: 3.1.0 + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.2.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==, - } - engines: { node: '>= 0.8.0' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==, - } - engines: { node: '>=10.13.0' } - hasBin: true - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-n9wh8tvBe5sFmsqlg+XQhaQLumwpqoAUruLwjCopgTmUBjJ/fjtBsJzKleCaIGBOMXYEhp1YfKl4d7rJ5ZKJGA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==, - } - engines: { node: '>= 0.6.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==, - } - engines: { node: '>= 6' } + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: kleur: 3.0.3 sisteransi: 1.0.5 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==, - } + [email protected]: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 react-is: 16.13.1 - /[email protected]: - resolution: - { - integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==, - } + [email protected]: dependencies: end-of-stream: 1.4.4 - once: 1.4.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==, - } - engines: { node: '>=6' } - - /[email protected]: - resolution: - { - integrity: sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==, - } - engines: { node: '>=0.6' } - dependencies: - side-channel: 1.0.6 - dev: false + once: 1.4.0 - /[email protected]: - resolution: - { - integrity: sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==, - } - engines: { node: '>=0.6' } - dependencies: - side-channel: 1.0.6 - dev: false + [email protected]: {} + + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==, - } - dev: true + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==, - } + [email protected]: dependencies: inherits: 2.0.4 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==, - } - dev: false - - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-A9jfz/4CTdsIsE7WCQtO9UkOpMBcBRh8LxyHl2eoZz1ki02jpyUL5xt58gabd0CyeLQ8fRyQ+s2lyV2Ufu8Owg==, - } - engines: { node: '>= 6.0.0' } - peerDependencies: - react: '>=15.6.2' - react-dom: '>=15.6.2' - dependencies: - classnames: 2.5.1 - prop-types: 15.8.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false - - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-GzEOiE6yLfp9P6XNkOhXuYtZHzoAx3tirbi7/dj2WHlGM+NGE1lefceqGR0ZrYsYaqsNJhIJFTgwUpzVzA+mjw==, - } - peerDependencies: - react: ^16.9.0 || ^17 || ^18 - react-dom: ^16.9.0 || ^17 || ^18 + + [email protected]: {} + + [email protected]([email protected]([email protected]))([email protected]): dependencies: - '@floating-ui/react': 0.26.12([email protected])([email protected]) - classnames: 2.5.1 - date-fns: 3.3.1 + '@floating-ui/react': 0.26.28([email protected]([email protected]))([email protected]) + clsx: 2.1.1 + date-fns: 3.6.0 prop-types: 15.8.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - react-onclickoutside: 6.13.0([email protected])([email protected]) - dev: false - - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-GrzyqQnjIMoej+jMjWvtVSsQqhXgzEGqpXlJ2dAGfOk7Q26qcm8Gu6xtI430PBUyZsERe8BJSQf+7VZZo8IBNQ==, - } - engines: { node: '>= 8' } - peerDependencies: - react: ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 - react-dom: ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react: 19.0.0 + react-dom: 19.0.0([email protected]) + + [email protected]([email protected]([email protected]))([email protected]): dependencies: '@emotion/css': 11.11.2 classnames: 2.5.1 diff: 5.2.0 memoize-one: 6.0.0 prop-types: 15.8.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==, - } - peerDependencies: - react: ^18.2.0 + react: 19.0.0 + react-dom: 19.0.0([email protected]) + + [email protected]([email protected]): dependencies: - loose-envify: 1.4.0 - react: 18.2.0 - scheduler: 0.23.0 - dev: false - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-cvJ/wbHdhYx8aviSWh28w9ImjmVsb5Y05n1+FW786vEZQJV5STNM0pW6ujS+oiBecb0ARBxJFyAnXj9+GHXACQ==, - } - engines: { node: '>=12.22.0' } - peerDependencies: - react: ^16.8.0 || ^17 || ^18 + react: 19.0.0 + scheduler: 0.25.0 + + [email protected]([email protected]): dependencies: - react: 18.2.0 - dev: false + react: 19.0.0 - /[email protected]([email protected]): - resolution: - { - integrity: sha512-4rb8XtXNx7ZaOZarKKnckgz4xLMvds/YrU6mpJfGhGAsy2Mg4mIw1x+DCCGngVGq2soTBVVOxx2s/C6mTX9+pA==, - } - peerDependencies: - react: '>=16.13.1' + [email protected]([email protected]): dependencies: - react: 18.2.0 - dev: false + react: 19.0.0 - /[email protected]: - resolution: - { - integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==, - } + [email protected]: {} - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-ty8So6tcUpIb+ZE+1HAhbLROvAIJYyJe/1vRrrcmW+jLsaM+/powDRqxzo6hSh9CuRZGSL1Q8mvcF5WRD93a0A==, - } - peerDependencies: - react: ^15.5.x || ^16.x || ^17.x || ^18.x - react-dom: ^15.5.x || ^16.x || ^17.x || ^18.x - dependencies: - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false - - /[email protected](@types/[email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-NhuE56X+p9QDFh4BgeygHFIvJJszO1i1KSkg/JPcIJrbovyRtI+GuOEa4XzFCEpZRAEoEI8u/cAHK+jG/PgUzQ==, - } - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + [email protected](@types/[email protected])([email protected]([email protected]))([email protected]): dependencies: '@babel/runtime': 7.24.4 '@emotion/cache': 11.11.0 - '@emotion/react': 11.11.4(@types/[email protected])([email protected]) + '@emotion/react': 11.11.4(@types/[email protected])([email protected]) '@floating-ui/dom': 1.6.3 '@types/react-transition-group': 4.4.10 memoize-one: 6.0.0 prop-types: 15.8.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - react-transition-group: 4.4.5([email protected])([email protected]) - use-isomorphic-layout-effect: 1.1.2(@types/[email protected])([email protected]) + react: 19.0.0 + react-dom: 19.0.0([email protected]) + react-transition-group: 4.4.5([email protected]([email protected]))([email protected]) + use-isomorphic-layout-effect: 1.2.0(@types/[email protected])([email protected]) transitivePeerDependencies: - '@types/react' - dev: false - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-etR3RgueY8pe88SA67wLm8rJmL1h+CLqUGHuAoNsseW35oTGJEri6eBTyaXnFKNQ80v/eO10hBYLgz036XRGgA==, - } - peerDependencies: - react: '>=16' - react-dom: '>=16' - dependencies: - clsx: 2.1.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false - - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-Pg2Ju7NngAamarFvLwqrFomJ57u/Ay6i6zfLurt/qPynWkAkOthu6vxfqYpJCyNhHRhR4hu7+bySSeWWJu6PAg==, - } - peerDependencies: - react: '>=16' - react-dom: '>=16' - dependencies: - clsx: 1.2.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false - - /[email protected]([email protected])([email protected]): - resolution: - { - integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==, - } - peerDependencies: - react: '>=16.6.0' - react-dom: '>=16.6.0' + [email protected]([email protected]([email protected]))([email protected]): dependencies: '@babel/runtime': 7.24.4 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 - react: 18.2.0 - react-dom: 18.2.0([email protected]) - dev: false + react: 19.0.0 + react-dom: 19.0.0([email protected]) - /[email protected]: - resolution: - { - integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==, - } - engines: { node: '>=0.10.0' } - dependencies: - loose-envify: 1.4.0 - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==, - } - engines: { node: '>= 6' } - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==, - } - engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } - dependencies: - abort-controller: 3.0.0 - buffer: 6.0.3 - events: 3.3.0 - process: 0.11.10 - string_decoder: 1.3.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw==, - } - engines: { node: '>=8' } - dependencies: - readable-stream: 3.6.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==, - } - engines: { node: '>=8.10.0' } + [email protected]: dependencies: picomatch: 2.3.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==, - } - engines: { node: '>= 12.13.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-486O8/pQXwj9jV0mVvUnTsxq0uknpBnNJ0eCUhkZqJRQ8KutrT1PhzmumdCeM1hSBF2eMlFPmwECRER4IbKXlQ==, - } - engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } + + [email protected]: {} + + [email protected]: dependencies: - '@eslint-community/regexpp': 4.10.0 - dev: true + call-bind: 1.0.8 + define-properties: 1.2.1 + dunder-proto: 1.0.1 + es-abstract: 1.23.6 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + gopd: 1.2.0 + which-builtin-type: 1.2.1 + + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.23.3 es-errors: 1.3.0 - get-intrinsic: 1.2.4 - globalthis: 1.0.3 - which-builtin-type: 1.1.3 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==, - } - - /[email protected]: - resolution: - { - integrity: sha512-OLxjyjPkVH+rQlBLb1I/P/VTmamSjGkvN5PTV5BXP432k3uVz727J7H29GA5IFiY0m7e1xBN7049Wn59FY3DEQ==, - } - engines: { node: ^12.0.0 || ^14.0.0 || >=16.0.0 } - dependencies: - '@eslint-community/regexpp': 4.10.0 - refa: 0.11.0 - dev: true + set-function-name: 2.0.2 - /[email protected]: - resolution: - { - integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 es-errors: 1.3.0 set-function-name: 2.0.2 - /[email protected]: - resolution: - { - integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==, - } - engines: { node: '>=8' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==, - } - engines: { node: '>=0.10.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==, - } - engines: { node: '>=0.10.5' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==, - } - engines: { node: '>=4' } - - /[email protected]: - resolution: - { - integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==, - } - - /[email protected]: - resolution: - { - integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==, - } - hasBin: true + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - /[email protected]: - resolution: - { - integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==, - } - hasBin: true + [email protected]: dependencies: is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==, - } - engines: { iojs: '>=1.0.0', node: '>=0.10.0' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==, - } - hasBin: true + + [email protected]: {} + + [email protected]: dependencies: glob: 7.2.3 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==, - } + [email protected]: dependencies: queue-microtask: 1.2.3 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==, - } - engines: { node: '>=0.4' } + [email protected]: dependencies: call-bind: 1.0.7 get-intrinsic: 1.2.4 has-symbols: 1.0.3 isarray: 2.0.5 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==, - } - engines: { node: '>= 0.4' } + + [email protected]: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + get-intrinsic: 1.2.6 + has-symbols: 1.1.0 + isarray: 2.0.5 + + [email protected]: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 is-regex: 1.1.4 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==, - } - engines: { node: '>=10' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-y/52Mcy7aw3gRm7IrcGDFx/bCk4AhRh2eI9luHOQM86nZsqwiRkkq2GekHXBBD+SmPidc8i2PqtYZl+pWJ8Oeg==, - } + + [email protected]: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + is-regex: 1.2.1 + + [email protected]: {} + + [email protected]: dependencies: truncate-utf8-bytes: 1.0.2 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-ShMYi3WkrDWxExyxSZPst4/okE9ts46xZmJDSawJQrnte7M1V9fScVB+uNXOVKRBt0PggHOwoZcn8mYX4trnBw==, - } - engines: { node: '>=14.0.0' } - hasBin: true + + [email protected]: dependencies: chokidar: 3.6.0 immutable: 4.3.5 source-map-js: 1.2.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==, - } - dependencies: - loose-envify: 1.4.0 - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==, - } - dev: false + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==, - } + [email protected]: dependencies: compute-scroll-into-view: 1.0.20 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-4hc49fUMmX3jM0XdFUAPBrs1xwEcdHa0KyjEsjFs+Zfc66mpFpq5YmRgDtl+Ffo6AtJIilfei+yKw8fUn3N88w==, - } - dependencies: - '@eslint-community/regexpp': 4.10.0 - refa: 0.11.0 - regexp-ast-analysis: 0.6.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==, - } - hasBin: true - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==, - } - engines: { node: '>=10' } - hasBin: true + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: lru-cache: 6.0.0 - /[email protected]: - resolution: - { - integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==, - } - engines: { node: '>= 0.4' } + [email protected]: {} + + [email protected]: dependencies: define-data-property: 1.1.4 es-errors: 1.3.0 @@ -7722,108 +6311,105 @@ packages: gopd: 1.0.1 has-property-descriptors: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: define-data-property: 1.1.4 es-errors: 1.3.0 functions-have-names: 1.2.3 has-property-descriptors: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==, - } - engines: { node: '>=8' } + [email protected]: + dependencies: + color: 4.2.3 + detect-libc: 2.0.3 + semver: 7.6.3 + optionalDependencies: + '@img/sharp-darwin-arm64': 0.33.5 + '@img/sharp-darwin-x64': 0.33.5 + '@img/sharp-libvips-darwin-arm64': 1.0.4 + '@img/sharp-libvips-darwin-x64': 1.0.4 + '@img/sharp-libvips-linux-arm': 1.0.5 + '@img/sharp-libvips-linux-arm64': 1.0.4 + '@img/sharp-libvips-linux-s390x': 1.0.4 + '@img/sharp-libvips-linux-x64': 1.0.4 + '@img/sharp-libvips-linuxmusl-arm64': 1.0.4 + '@img/sharp-libvips-linuxmusl-x64': 1.0.4 + '@img/sharp-linux-arm': 0.33.5 + '@img/sharp-linux-arm64': 0.33.5 + '@img/sharp-linux-s390x': 0.33.5 + '@img/sharp-linux-x64': 0.33.5 + '@img/sharp-linuxmusl-arm64': 0.33.5 + '@img/sharp-linuxmusl-x64': 0.33.5 + '@img/sharp-wasm32': 0.33.5 + '@img/sharp-win32-ia32': 0.33.5 + '@img/sharp-win32-x64': 0.33.5 + optional: true + + [email protected]: dependencies: shebang-regex: 3.0.0 - /[email protected]: - resolution: - { - integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==, - } - engines: { node: '>=8' } + [email protected]: {} + + [email protected]: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.3 + + [email protected]: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + object-inspect: 1.13.3 + + [email protected]: + dependencies: + call-bound: 1.0.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.6 + object-inspect: 1.13.3 + side-channel-map: 1.0.1 - /[email protected]: - resolution: - { - integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 get-intrinsic: 1.2.4 object-inspect: 1.13.1 - /[email protected]: - resolution: - { - integrity: sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-xMO/8eNREtaROt7tJvWJqHBDTMFN4eiQ5I4JRMuilwfnFcV5W9u7RUkueNkdw0jPqGMX36iCywelS5yilTuOxg==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==, - } - engines: { node: '>=8' } - dev: true - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-OxObL9tbhgwvSlnKSCpGIh7wnuaqvOj5jRExGjEyCU2Ke8ctf22HjT+jw7GEi9ttLzNTUmTEU3YIzqKGeqN+og==, - } - peerDependencies: - slate: '>=0.65.3' + [email protected]: + dependencies: + es-errors: 1.3.0 + object-inspect: 1.13.3 + side-channel-list: 1.0.0 + side-channel-map: 1.0.1 + side-channel-weakmap: 1.0.2 + + [email protected]: {} + + [email protected]: + dependencies: + is-arrayish: 0.3.2 + optional: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]([email protected]): dependencies: is-plain-object: 5.0.0 slate: 0.91.4 - dev: false - /[email protected]([email protected]): - resolution: - { - integrity: sha512-A/jvoLTAgeRcJaUPQCYOikCJxSws6+/jkL7mM+QuZljNd7EA5YqafGA7sVBJRFpcoSsDRUIah1yNiC/7vxZPYg==, - } - peerDependencies: - slate: '>=0.65.3' + [email protected]([email protected]): dependencies: is-plain-object: 5.0.0 slate: 0.91.4 - dev: false - /[email protected]([email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-xEDKu5RKw5f0N95l1UeNQnrB0Pxh4JPjpIZR/BVsMo0ININnLAknR99gLo46bl/Ffql4mr7LeaxQRoXxbFtJOQ==, - } - peerDependencies: - react: '>=16.8.0' - react-dom: '>=16.8.0' - slate: '>=0.65.3' + [email protected]([email protected]([email protected]))([email protected])([email protected]): dependencies: '@juggle/resize-observer': 3.4.0 '@types/is-hotkey': 0.1.10 @@ -7832,143 +6418,62 @@ packages: is-hotkey: 0.1.8 is-plain-object: 5.0.0 lodash: 4.17.21 - react: 18.2.0 - react-dom: 18.2.0([email protected]) + react: 19.0.0 + react-dom: 19.0.0([email protected]) scroll-into-view-if-needed: 2.2.31 slate: 0.91.4 tiny-invariant: 1.0.6 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-aUJ3rpjrdi5SbJ5G1Qjr3arytfRkEStTmHjBfWq2A2Q8MybacIzkScSvGJjQkdTk3djCK9C9SEOt39sSeZFwTw==, - } + [email protected]: dependencies: immer: 9.0.21 is-plain-object: 5.0.0 tiny-warning: 1.0.3 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==, - } - engines: { node: '>= 6.0.0', npm: '>= 3.0.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==, - } - engines: { node: '>= 10.0.0', npm: '>= 3.0.0' } + + [email protected]: + optional: true + + [email protected]: dependencies: ip-address: 9.0.5 smart-buffer: 4.2.0 - dev: false + optional: true - /[email protected]: - resolution: - { - integrity: sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg==, - } + [email protected]: dependencies: atomic-sleep: 1.0.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==, - } - engines: { node: '>=0.10.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==, - } - dependencies: - buffer-from: 1.1.2 - source-map: 0.6.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==, - } - engines: { node: '>=0.10.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, - } - engines: { node: '>=0.10.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==, - } - requiresBuild: true + + [email protected]([email protected]([email protected]))([email protected]): + dependencies: + react: 19.0.0 + react-dom: 19.0.0([email protected]) + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: memory-pager: 1.5.0 - dev: false - optional: true - - /[email protected]: - resolution: - { - integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==, - } - engines: { node: '>= 10.x' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==, - } - engines: { node: '>= 0.4' } + + [email protected]: {} + + [email protected]: + optional: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: - internal-slot: 1.0.7 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==, - } - engines: { node: '>=10.0.0' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==, - } - engines: { node: '>= 0.4' } + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 @@ -7982,426 +6487,169 @@ packages: regexp.prototype.flags: 1.5.2 set-function-name: 2.0.2 side-channel: 1.0.6 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: - call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 + + [email protected]: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-data-property: 1.1.4 + define-properties: 1.2.1 + es-abstract: 1.23.6 es-object-atoms: 1.0.0 - dev: true + has-property-descriptors: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==, - } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 + es-abstract: 1.23.3 es-object-atoms: 1.0.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 es-object-atoms: 1.0.0 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==, - } + [email protected]: + dependencies: + call-bind: 1.0.8 + call-bound: 1.0.3 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + + [email protected]: dependencies: - safe-buffer: 5.2.1 - dev: false + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 - /[email protected]: - resolution: - { - integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==, - } - engines: { node: '>=8' } + [email protected]: dependencies: ansi-regex: 5.0.1 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==, - } - engines: { node: '>=4' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==, - } - engines: { node: '>=8' } - - /[email protected]: - resolution: - { - integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==, - } - requiresBuild: true - dev: false - optional: true - - /[email protected]: - resolution: - { - integrity: sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==, - } - engines: { node: '>=10' } - dependencies: - '@tokenizer/token': 0.3.0 - peek-readable: 4.1.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ==, - } - engines: { node: '>=14.16' } + [email protected]: {} + + [email protected]: {} + + [email protected]: + optional: true + + [email protected]: dependencies: '@tokenizer/token': 0.3.0 - peek-readable: 5.0.0 - dev: false - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==, - } - engines: { node: '>= 12.0.0' } - peerDependencies: - '@babel/core': '*' - babel-plugin-macros: '*' - react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' - peerDependenciesMeta: - '@babel/core': - optional: true - babel-plugin-macros: - optional: true + peek-readable: 5.3.1 + + [email protected]([email protected]): dependencies: client-only: 0.0.1 - react: 18.2.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==, - } - engines: { node: '>=4' } + react: 19.0.0 + + [email protected]: {} + + [email protected]: dependencies: has-flag: 3.0.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==, - } - engines: { node: '>=8' } + [email protected]: dependencies: has-flag: 4.0.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==, - } - engines: { node: '>= 0.4' } - - /[email protected]: - resolution: - { - integrity: sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==, - } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==, - } - engines: { node: '>=0.8' } - dependencies: - thenify: 3.3.1 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==, - } - dependencies: - any-promise: 1.3.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-t4eNiKdGwd1EV6tx76mRbrOqwvkxz+ssOiQXEXw88m4p/Xp6679vg16sf39BAstRjHOiWIqp5+J2ylHk3pU30g==, - } + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: real-require: 0.2.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==, - } - dependencies: - es5-ext: 0.10.64 - next-tick: 1.1.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==, - } - engines: { node: '>=4' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==, - } - engines: { node: '>=8.0' } + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: - is-number: 7.0.0 + fdir: 6.4.2([email protected]) + picomatch: 4.0.2 + + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-6udB24Q737UD/SDsKAHI9FCRP7Bqc9D/MQUV02ORQg5iskjtLJlZJNdN4kKtcdtwCeWIwIHDGaUsTsCCAa8sFQ==, - } - engines: { node: '>=10' } + [email protected]: dependencies: - '@tokenizer/token': 0.3.0 - ieee754: 1.2.1 - dev: false + is-number: 7.0.0 - /[email protected]: - resolution: - { - integrity: sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg==, - } - engines: { node: '>=14.16' } + [email protected]: dependencies: '@tokenizer/token': 0.3.0 ieee754: 1.2.1 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==, - } - engines: { node: '>=12' } + [email protected]: dependencies: punycode: 2.3.1 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==, - } + [email protected]: dependencies: utf8-byte-length: 1.0.4 - dev: false - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==, - } - engines: { node: '>=16' } - peerDependencies: - typescript: '>=4.2.0' - dependencies: - typescript: 5.4.4 - dev: true - /[email protected]([email protected]): - resolution: - { - integrity: sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==, - } - peerDependencies: - typescript: '>=3.7.0' + [email protected]([email protected]): dependencies: - typescript: 5.4.4 - dev: false + typescript: 5.5.2 + + [email protected]([email protected]): + optionalDependencies: + typescript: 5.5.2 - /[email protected]: - resolution: - { - integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==, - } + [email protected]: dependencies: '@types/json5': 0.0.29 json5: 1.0.2 minimist: 1.2.8 strip-bom: 3.0.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==, - } - - /[email protected]: - resolution: - { - integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==, - } - dev: false - - /[email protected]([email protected]): - resolution: - { - integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==, - } - engines: { node: '>= 6' } - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - dependencies: - tslib: 1.14.1 - typescript: 5.4.4 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-BCNd4kz6fz12fyrgCTEdZHGJ9fWTGeUzXmQysh0RVocDY3h4frk05ZNCXSy4kIenF7y/QnrdiVpTsyNRn6vlAw==, - } - engines: { node: '>=18.0.0' } - hasBin: true + + [email protected]: + optional: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: - esbuild: 0.19.12 - get-tsconfig: 4.7.3 + esbuild: 0.23.1 + get-tsconfig: 4.8.1 optionalDependencies: fsevents: 2.3.3 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==, - } - engines: { node: '>= 0.8.0' } + [email protected]: dependencies: prelude-ls: 1.2.1 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==, - } - engines: { node: '>=10' } - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==, - } - engines: { node: '>= 0.4' } + + [email protected]: {} + + [email protected]: dependencies: call-bind: 1.0.7 es-errors: 1.3.0 is-typed-array: 1.1.13 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: call-bind: 1.0.7 for-each: 0.3.3 gopd: 1.0.1 has-proto: 1.0.3 is-typed-array: 1.1.13 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.7 @@ -8409,14 +6657,18 @@ packages: gopd: 1.0.1 has-proto: 1.0.3 is-typed-array: 1.1.13 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==, - } - engines: { node: '>= 0.4' } + [email protected]: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + has-proto: 1.2.0 + is-typed-array: 1.1.15 + reflect.getprototypeof: 1.0.9 + + [email protected]: dependencies: call-bind: 1.0.7 for-each: 0.3.3 @@ -8424,133 +6676,59 @@ packages: has-proto: 1.0.3 is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - dev: true - - /[email protected]: - resolution: - { - integrity: sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==, - } - engines: { node: '>=14.17' } - hasBin: true - /[email protected]: - resolution: - { - integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==, - } + [email protected]: + dependencies: + call-bind: 1.0.8 + for-each: 0.3.3 + gopd: 1.2.0 + is-typed-array: 1.1.13 + possible-typed-array-names: 1.0.0 + reflect.getprototypeof: 1.0.9 + + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: call-bind: 1.0.7 has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 - dev: true - /[email protected]: - resolution: - { - integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==, - } + [email protected]: {} - /[email protected]: - resolution: - { - integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==, - } + [email protected]: dependencies: punycode: 2.3.1 - /[email protected]([email protected])([email protected])([email protected]): - resolution: - { - integrity: sha512-Io2ArvcRO+6MWIhkdfMFt+WKQX+Vb++W8DS2l03z/Vw/rz3BclKpM0ynr4LYGyU85Eke+Yx5oIhTY++QR0ZDoA==, - } - peerDependencies: - react: '>=16.8.0' - react-dom: '*' - react-native: '*' - scheduler: '>=0.19.0' - peerDependenciesMeta: - react-dom: - optional: true - react-native: - optional: true + [email protected]([email protected])([email protected]): dependencies: - react: 18.2.0 - react-dom: 18.2.0([email protected]) - scheduler: 0.23.0 - dev: false + react: 19.0.0 + scheduler: 0.25.0 - /[email protected](@types/[email protected])([email protected]): - resolution: - { - integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==, - } - peerDependencies: - '@types/react': '*' - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - '@types/react': - optional: true + [email protected](@types/[email protected])([email protected]): dependencies: - '@types/react': 18.2.79 - react: 18.2.0 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-4+wkEYLBbWxqTahEsWrhxepcoVOJ+1z5PGIjPZxRkytcdSUaNjIjBM7Xn8E+pdSuV7SzvWovBFA54FO0JSoqhA==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==, - } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==, - } - hasBin: true - dev: false + react: 19.0.0 + optionalDependencies: + '@types/react': 19.0.1 - /[email protected]: - resolution: - { - integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==, - } - hasBin: true - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==, - } - engines: { node: '>=12' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==, - } - engines: { node: '>=12' } - dependencies: - tr46: 3.0.0 + [email protected]: {} + + [email protected]: {} + + [email protected]: + optional: true + + [email protected]: {} + + [email protected]: + dependencies: + tr46: 4.1.1 webidl-conversions: 7.0.0 - dev: false - /[email protected]: - resolution: - { - integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==, - } + [email protected]: dependencies: is-bigint: 1.0.4 is-boolean-object: 1.1.2 @@ -8558,45 +6736,38 @@ packages: is-string: 1.0.7 is-symbol: 1.0.4 - /[email protected]: - resolution: - { - integrity: sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==, - } - engines: { node: '>= 0.4' } + [email protected]: + dependencies: + is-bigint: 1.1.0 + is-boolean-object: 1.2.1 + is-number-object: 1.1.1 + is-string: 1.1.1 + is-symbol: 1.1.1 + + [email protected]: dependencies: + call-bound: 1.0.3 function.prototype.name: 1.1.6 has-tostringtag: 1.0.2 is-async-function: 2.0.0 - is-date-object: 1.0.5 - is-finalizationregistry: 1.0.2 + is-date-object: 1.1.0 + is-finalizationregistry: 1.1.1 is-generator-function: 1.0.10 - is-regex: 1.1.4 + is-regex: 1.2.1 is-weakref: 1.0.2 isarray: 2.0.5 - which-boxed-primitive: 1.0.2 + which-boxed-primitive: 1.1.1 which-collection: 1.0.2 - which-typed-array: 1.1.15 - dev: true + which-typed-array: 1.1.18 - /[email protected]: - resolution: - { - integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: is-map: 2.0.3 is-set: 2.0.3 is-weakmap: 2.0.2 is-weakset: 2.0.3 - /[email protected]: - resolution: - { - integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==, - } - engines: { node: '>= 0.4' } + [email protected]: dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.7 @@ -8604,68 +6775,30 @@ packages: gopd: 1.0.1 has-tostringtag: 1.0.2 - /[email protected]: - resolution: - { - integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==, - } - engines: { node: '>= 8' } - hasBin: true + [email protected]: + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.3 + for-each: 0.3.3 + gopd: 1.2.0 + has-tostringtag: 1.0.2 + + [email protected]: dependencies: isexe: 2.0.0 - /[email protected]: - resolution: - { - integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==, - } - - /[email protected]: - resolution: - { - integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==, - } - engines: { node: '>=10.0.0' } - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-FVdlVVC67WOIPvfOwhoMETV72f6GbW7aOabBC3WxN/oUdoEMDyLz4OgRv5/gck2ZeNqEQu+Tb0kloovXOfpYVg==, - } - engines: { node: '>= 0.10.0' } - hasBin: true + [email protected]: {} + + [email protected]: {} + + [email protected]: dependencies: commander: 2.20.3 cssfilter: 0.0.10 - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==, - } - - /[email protected]: - resolution: - { - integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==, - } - engines: { node: '>= 6' } - dev: false - - /[email protected]: - resolution: - { - integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==, - } - engines: { node: '>=10' } - dev: true + + [email protected]: {} + + [email protected]: {} + + [email protected]: {} diff --git a/examples/auth/src/app/(app)/_components/Header/index.tsx b/examples/auth/src/app/(app)/_components/Header/index.tsx index e95a508ead4..9d6abeb4f6d 100644 --- a/examples/auth/src/app/(app)/_components/Header/index.tsx +++ b/examples/auth/src/app/(app)/_components/Header/index.tsx @@ -3,6 +3,7 @@ import Link from 'next/link' import React from 'react' import { Gutter } from '../Gutter' +import { HeaderNav } from './Nav' import classes from './index.module.scss' export const Header = () => { @@ -23,6 +24,7 @@ export const Header = () => { /> </picture> </Link> + <HeaderNav /> </Gutter> </header> ) diff --git a/examples/auth/src/app/(payload)/admin/[[...segments]]/not-found.tsx b/examples/auth/src/app/(payload)/admin/[[...segments]]/not-found.tsx index 361b404e293..180e6f81cdf 100644 --- a/examples/auth/src/app/(payload)/admin/[[...segments]]/not-found.tsx +++ b/examples/auth/src/app/(payload)/admin/[[...segments]]/not-found.tsx @@ -5,18 +5,21 @@ import type { Metadata } from 'next' import config from '@payload-config' import { generatePageMetadata, NotFoundPage } from '@payloadcms/next/views' +import { importMap } from '../importMap.js' + type Args = { - params: { + params: Promise<{ segments: string[] - } - searchParams: { + }> + searchParams: Promise<{ [key: string]: string | string[] - } + }> } export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> => generatePageMetadata({ config, params, searchParams }) -const NotFound = ({ params, searchParams }: Args) => NotFoundPage({ config, params, searchParams }) +const NotFound = ({ params, searchParams }: Args) => + NotFoundPage({ config, importMap, params, searchParams }) export default NotFound diff --git a/examples/auth/src/app/(payload)/admin/[[...segments]]/page.tsx b/examples/auth/src/app/(payload)/admin/[[...segments]]/page.tsx index 4e484451ea7..4ff779a080e 100644 --- a/examples/auth/src/app/(payload)/admin/[[...segments]]/page.tsx +++ b/examples/auth/src/app/(payload)/admin/[[...segments]]/page.tsx @@ -5,18 +5,20 @@ import type { Metadata } from 'next' import config from '@payload-config' import { generatePageMetadata, RootPage } from '@payloadcms/next/views' +import { importMap } from '../importMap.js' + type Args = { - params: { + params: Promise<{ segments: string[] - } - searchParams: { + }> + searchParams: Promise<{ [key: string]: string | string[] - } + }> } - export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> => generatePageMetadata({ config, params, searchParams }) -const Page = ({ params, searchParams }: Args) => RootPage({ config, params, searchParams }) +const Page = ({ params, searchParams }: Args) => + RootPage({ config, importMap, params, searchParams }) export default Page diff --git a/examples/auth/src/app/(payload)/admin/importMap.js b/examples/auth/src/app/(payload)/admin/importMap.js new file mode 100644 index 00000000000..628c80f502c --- /dev/null +++ b/examples/auth/src/app/(payload)/admin/importMap.js @@ -0,0 +1,5 @@ +import { BeforeLogin as BeforeLogin_8a7ab0eb7ab5c511aba12e68480bfe5e } from '@/components/BeforeLogin' + +export const importMap = { + '@/components/BeforeLogin#BeforeLogin': BeforeLogin_8a7ab0eb7ab5c511aba12e68480bfe5e, +} diff --git a/examples/auth/src/app/(payload)/layout.tsx b/examples/auth/src/app/(payload)/layout.tsx index cfcc0bcb0c3..d75f6b2371e 100644 --- a/examples/auth/src/app/(payload)/layout.tsx +++ b/examples/auth/src/app/(payload)/layout.tsx @@ -1,16 +1,32 @@ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ -import configPromise from '@payload-config' +import type { ServerFunctionClient } from 'payload' + import '@payloadcms/next/css' -import { RootLayout } from '@payloadcms/next/layouts' +import config from '@payload-config' +import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts' import React from 'react' +import { importMap } from './admin/importMap.js' import './custom.scss' type Args = { children: React.ReactNode } -const Layout = ({ children }: Args) => <RootLayout config={configPromise}>{children}</RootLayout> +const serverFunction: ServerFunctionClient = async function (args) { + 'use server' + return handleServerFunctions({ + ...args, + config, + importMap, + }) +} + +const Layout = ({ children }: Args) => ( + <RootLayout config={config} importMap={importMap} serverFunction={serverFunction}> + {children} + </RootLayout> +) export default Layout diff --git a/examples/auth/src/collections/Users.ts b/examples/auth/src/collections/Users.ts index 96a8831d0f9..c02b1a5ec20 100644 --- a/examples/auth/src/collections/Users.ts +++ b/examples/auth/src/collections/Users.ts @@ -1,13 +1,62 @@ import type { CollectionConfig } from 'payload/types' +import { admins } from './access/admins' +import adminsAndUser from './access/adminsAndUser' +import { anyone } from './access/anyone' +import { checkRole } from './access/checkRole' +import { loginAfterCreate } from './hooks/loginAfterCreate' +import { protectRoles } from './hooks/protectRoles' + export const Users: CollectionConfig = { slug: 'users', + auth: { + tokenExpiration: 28800, // 8 hours + cookies: { + sameSite: 'none', + secure: true, + domain: process.env.COOKIE_DOMAIN, + }, + }, admin: { useAsTitle: 'email', }, - auth: true, + access: { + read: adminsAndUser, + create: anyone, + update: adminsAndUser, + delete: admins, + admin: ({ req: { user } }) => checkRole(['admin'], user), + }, + hooks: { + afterChange: [loginAfterCreate], + }, fields: [ - // Email added by default - // Add more fields as needed + { + name: 'firstName', + type: 'text', + }, + { + name: 'lastName', + type: 'text', + }, + { + name: 'roles', + type: 'select', + hasMany: true, + saveToJWT: true, + hooks: { + beforeChange: [protectRoles], + }, + options: [ + { + label: 'Admin', + value: 'admin', + }, + { + label: 'User', + value: 'user', + }, + ], + }, ], } diff --git a/examples/auth/src/components/BeforeLogin/index.tsx b/examples/auth/src/components/BeforeLogin/index.tsx index 5108a4fef6c..8d1613a06f5 100644 --- a/examples/auth/src/components/BeforeLogin/index.tsx +++ b/examples/auth/src/components/BeforeLogin/index.tsx @@ -1,6 +1,6 @@ import React from 'react' -const BeforeLogin: React.FC = () => { +export const BeforeLogin: React.FC = () => { if (process.env.PAYLOAD_PUBLIC_SEED === 'true') { return ( <p> @@ -13,5 +13,3 @@ const BeforeLogin: React.FC = () => { } return null } - -export default BeforeLogin diff --git a/examples/auth/src/payload-types.ts b/examples/auth/src/payload-types.ts index 66fdedb6792..c6140c0f1fd 100644 --- a/examples/auth/src/payload-types.ts +++ b/examples/auth/src/payload-types.ts @@ -7,16 +7,53 @@ */ export interface Config { + auth: { + users: UserAuthOperations; + }; collections: { users: User; + 'payload-locked-documents': PayloadLockedDocument; 'payload-preferences': PayloadPreference; 'payload-migrations': PayloadMigration; }; + collectionsJoins: {}; + collectionsSelect: { + users: UsersSelect<false> | UsersSelect<true>; + 'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>; + 'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>; + 'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>; + }; + db: { + defaultIDType: string; + }; globals: {}; + globalsSelect: {}; locale: null; user: User & { collection: 'users'; }; + jobs: { + tasks: unknown; + workflows: unknown; + }; +} +export interface UserAuthOperations { + forgotPassword: { + email: string; + password: string; + }; + login: { + email: string; + password: string; + }; + registerFirstUser: { + email: string; + password: string; + }; + unlock: { + email: string; + password: string; + }; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -38,6 +75,24 @@ export interface User { lockUntil?: string | null; password?: string | null; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-locked-documents". + */ +export interface PayloadLockedDocument { + id: string; + document?: { + relationTo: 'users'; + value: string | User; + } | null; + globalSlug?: string | null; + user: { + relationTo: 'users'; + value: string | User; + }; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-preferences". @@ -72,6 +127,63 @@ export interface PayloadMigration { updatedAt: string; createdAt: string; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "users_select". + */ +export interface UsersSelect<T extends boolean = true> { + firstName?: T; + lastName?: T; + roles?: T; + updatedAt?: T; + createdAt?: T; + email?: T; + resetPasswordToken?: T; + resetPasswordExpiration?: T; + salt?: T; + hash?: T; + loginAttempts?: T; + lockUntil?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-locked-documents_select". + */ +export interface PayloadLockedDocumentsSelect<T extends boolean = true> { + document?: T; + globalSlug?: T; + user?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-preferences_select". + */ +export interface PayloadPreferencesSelect<T extends boolean = true> { + user?: T; + key?: T; + value?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-migrations_select". + */ +export interface PayloadMigrationsSelect<T extends boolean = true> { + name?: T; + batch?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "auth". + */ +export interface Auth { + [k: string]: unknown; +} declare module 'payload' { diff --git a/examples/auth/src/payload.config.ts b/examples/auth/src/payload.config.ts index b52d2a295f6..e6f1a51cae7 100644 --- a/examples/auth/src/payload.config.ts +++ b/examples/auth/src/payload.config.ts @@ -2,28 +2,21 @@ import { mongooseAdapter } from '@payloadcms/db-mongodb' import { slateEditor } from '@payloadcms/richtext-slate' import { fileURLToPath } from 'node:url' import path from 'path' -import { buildConfig } from 'payload/config' +import { buildConfig } from 'payload' import { Users } from './collections/Users' -import BeforeLogin from './components/BeforeLogin' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) export default buildConfig({ admin: { components: { - beforeLogin: [BeforeLogin], + beforeLogin: ['@/components/BeforeLogin#BeforeLogin'], }, }, collections: [Users], - cors: [ - process.env.PAYLOAD_PUBLIC_SERVER_URL || '', - process.env.PAYLOAD_PUBLIC_SITE_URL || '', - ].filter(Boolean), - csrf: [ - process.env.PAYLOAD_PUBLIC_SERVER_URL || '', - process.env.PAYLOAD_PUBLIC_SITE_URL || '', - ].filter(Boolean), + cors: [process.env.NEXT_PUBLIC_SERVER_URL || ''].filter(Boolean), + csrf: [process.env.NEXT_PUBLIC_SERVER_URL || ''].filter(Boolean), db: mongooseAdapter({ url: process.env.DATABASE_URI || '', }), diff --git a/examples/auth/tsconfig.json b/examples/auth/tsconfig.json index 02d944fdeb8..0c6f225a40b 100644 --- a/examples/auth/tsconfig.json +++ b/examples/auth/tsconfig.json @@ -23,10 +23,25 @@ } ], "paths": { - "@/*": ["./src/*"], - "@payload-config": ["src/payload.config.ts"] - } + "@/*": [ + "./src/*" + ], + "@payload-config": [ + "src/payload.config.ts" + ], + "@payload-types": [ + "src/payload-types.ts" + ] + }, + "target": "ES2022", }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] } diff --git a/examples/custom-components/src/app/(payload)/layout.tsx b/examples/custom-components/src/app/(payload)/layout.tsx index 7f8698e1380..d75f6b2371e 100644 --- a/examples/custom-components/src/app/(payload)/layout.tsx +++ b/examples/custom-components/src/app/(payload)/layout.tsx @@ -1,8 +1,8 @@ +/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ +/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import type { ServerFunctionClient } from 'payload' import '@payloadcms/next/css' -/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ -/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ import config from '@payload-config' import { handleServerFunctions, RootLayout } from '@payloadcms/next/layouts' import React from 'react'
3538c2132d60b1fcaa1eb6ca55477503abd62b5e
2023-10-05 23:42:48
Jarrod Flesch
fix: doc title not rendering in breadcrumbs (#3444)
false
doc title not rendering in breadcrumbs (#3444)
fix
diff --git a/packages/payload/src/admin/components/views/collections/Edit/SetStepNav.tsx b/packages/payload/src/admin/components/views/collections/Edit/SetStepNav.tsx index 62daa389d6a..0ae12863cfc 100644 --- a/packages/payload/src/admin/components/views/collections/Edit/SetStepNav.tsx +++ b/packages/payload/src/admin/components/views/collections/Edit/SetStepNav.tsx @@ -29,9 +29,6 @@ export const SetStepNav: React.FC< let isEditing = false let id: string | undefined - // This only applies to collections - const title = useTitle(collection) - if ('collection' in props) { const { id: idFromProps, @@ -52,6 +49,9 @@ export const SetStepNav: React.FC< slug = globalFromProps?.slug } + // This only applies to collections + const title = useTitle(collection) + const { setStepNav } = useStepNav() const { i18n, t } = useTranslation('general')
25cb146fde10492ba75ba21cbbd630204a1ed6f9
2024-04-06 23:05:09
James
feat: moduleResolution: bundler in config loaders
false
moduleResolution: bundler in config loaders
feat
diff --git a/packages/payload/src/bin/register/index.ts b/packages/payload/src/bin/register/index.ts index ef20abb3b96..a44daa0e188 100644 --- a/packages/payload/src/bin/register/index.ts +++ b/packages/payload/src/bin/register/index.ts @@ -27,7 +27,13 @@ const locatedConfig = getTsconfig() const tsconfig = locatedConfig.config.compilerOptions as unknown as ts.CompilerOptions tsconfig.module = ts.ModuleKind.ESNext -tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeNext + +// Specify bundler resolution for Next.js compatibility. +// We will use TS to resolve file paths for most flexibility +tsconfig.moduleResolution = ts.ModuleResolutionKind.Bundler + +// Don't resolve d.ts files, because we aren't type-checking +tsconfig.noDtsResolution = true const moduleResolutionCache = ts.createModuleResolutionCache( ts.sys.getCurrentDirectory(), @@ -78,16 +84,21 @@ export const resolve: ResolveFn = async (specifier, context, nextResolve) => { ) // import from local project to local project TS file - if ( - resolvedModule && - !resolvedModule.resolvedFileName.includes('/node_modules/') && - EXTENSIONS.includes(resolvedModule.extension) - ) { - return { - format: 'ts', - shortCircuit: true, - url: pathToFileURL(resolvedModule.resolvedFileName).href, + if (resolvedModule) { + const resolvedIsNodeModule = resolvedModule.resolvedFileName.includes('/node_modules/') + const resolvedIsTS = EXTENSIONS.includes(resolvedModule.extension) + + if (!resolvedIsNodeModule && resolvedIsTS) { + return { + format: 'ts', + shortCircuit: true, + url: pathToFileURL(resolvedModule.resolvedFileName).href, + } } + + // We want to use TS "Bundler" moduleResolution for just about all files + // so we pass the TS result here + return nextResolve(pathToFileURL(resolvedModule.resolvedFileName).href) } // import from local project to either: diff --git a/test/config-loader/int.spec.ts b/test/config-loader/int.spec.ts new file mode 100644 index 00000000000..bf3cc1fad60 --- /dev/null +++ b/test/config-loader/int.spec.ts @@ -0,0 +1,8 @@ +import { load } from './load.js' + +describe('Config Loader', () => { + it('should load using TS moduleResolution: bundler', async () => { + const file = await load('./next-navigation-test.js') + expect(typeof file.redirect).toStrictEqual('function') + }) +}) diff --git a/test/config-loader/load.ts b/test/config-loader/load.ts new file mode 100644 index 00000000000..c32f8fd2dbe --- /dev/null +++ b/test/config-loader/load.ts @@ -0,0 +1,16 @@ +import { register } from 'node:module' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' + +export const load = async (filePath) => { + const filename = fileURLToPath(import.meta.url) + const dirname = path.dirname(filename) + const url = pathToFileURL(dirname).toString() + '/' + + // Need to register loader from payload/dist for a true test of functionality + register('../../packages/payload/dist/bin/register/index.js', url) + + const result = await import(filePath) + + return result +} diff --git a/test/config-loader/next-navigation-test.js b/test/config-loader/next-navigation-test.js new file mode 100644 index 00000000000..fc44a00f82b --- /dev/null +++ b/test/config-loader/next-navigation-test.js @@ -0,0 +1,3 @@ +import { redirect } from 'next/navigation' + +export { redirect } diff --git a/test/tsconfig.json b/test/tsconfig.json index e2ac241919c..cbdf7dc6918 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -25,6 +25,7 @@ "name": "next" } ], + "baseUrl": ".", "paths": { "@payloadcms/ui/assets": ["./packages/ui/src/assets/index.ts"], "@payloadcms/ui/elements/*": ["./packages/ui/src/elements/*/index.tsx"], diff --git a/tsconfig.json b/tsconfig.json index cb0b346566d..99002cb0357 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -164,4 +164,4 @@ ".next/types/**/*.ts", "scripts/**/*.ts" ] -} \ No newline at end of file +}
6af1c4d45d1f65cd7f5b368583817e44a37ab351
2023-11-21 03:06:41
Elliot DeNolf
chore(release): payload/2.2.0 [skip ci]
false
payload/2.2.0 [skip ci]
chore
diff --git a/CHANGELOG.md b/CHANGELOG.md index 32b32b25f56..d8dfe9a9672 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,38 @@ +## [2.2.0](https://github.com/payloadcms/payload/compare/v2.1.1...v2.2.0) (2023-11-20) + + +### Features + +* allow richtext adapters to control type generation, improve generated lexical types ([#4036](https://github.com/payloadcms/payload/issues/4036)) ([989c10e](https://github.com/payloadcms/payload/commit/989c10e0e0b36a8c34822263b19f5cb4b9ed6e72)) +* hide publish button based on permissions ([#4203](https://github.com/payloadcms/payload/issues/4203)) ([de02490](https://github.com/payloadcms/payload/commit/de02490231fbc8936973c1b81ac87add39878d8b)) +* **richtext-lexical:** Add new position: 'top' property for plugins ([eed4f43](https://github.com/payloadcms/payload/commit/eed4f4361cd012adf4e777820adbe7ad330ffef6)) + + +### Bug Fixes + +* fully define the define property for esbuild string replacement ([#4099](https://github.com/payloadcms/payload/issues/4099)) ([e22b95b](https://github.com/payloadcms/payload/commit/e22b95bdf3b2911ae67a07a76ec109c76416ea56)) +* **i18n:** polish translations ([#4134](https://github.com/payloadcms/payload/issues/4134)) ([782e118](https://github.com/payloadcms/payload/commit/782e1185698abb2fff3556052fd16d2b725611b9)) +* improves live preview breakpoints and zoom options in dark mode ([#4090](https://github.com/payloadcms/payload/issues/4090)) ([b91711a](https://github.com/payloadcms/payload/commit/b91711a74ad9379ed820b6675060209626b1c2d0)) +* **plugin-nested-docs:** await populate breadcrumbs on resaveChildren ([#4226](https://github.com/payloadcms/payload/issues/4226)) ([4e41dd1](https://github.com/payloadcms/payload/commit/4e41dd1bf2706001fa03130adb1c69403795ac96)) +* rename tab button classname to prevent unintentional styling ([#4121](https://github.com/payloadcms/payload/issues/4121)) ([967eff1](https://github.com/payloadcms/payload/commit/967eff1aabcc9ba7f29573fc2706538d691edfdd)) +* **richtext-lexical:** add missing 'use client' to TestRecorder feature plugin ([fc26275](https://github.com/payloadcms/payload/commit/fc26275b7a85fd34f424f7693b8383ad4efe0121)) +* **richtext-lexical:** Blocks: Array row data is not removed ([#4209](https://github.com/payloadcms/payload/issues/4209)) ([0af9c4d](https://github.com/payloadcms/payload/commit/0af9c4d3985a6c46a071ef5ac28c8359cb320571)) +* **richtext-lexical:** Blocks: fields without fulfilled condition are now skipped for validation ([50fab90](https://github.com/payloadcms/payload/commit/50fab902bd7baa1702ae0d995b4f58c1f5fca374)) +* **richtext-lexical:** Blocks: make sure fields are wrapped in a uniquely-named group, change block node data format, fix react key error ([#3995](https://github.com/payloadcms/payload/issues/3995)) ([c068a87](https://github.com/payloadcms/payload/commit/c068a8784ec5780dbdca5416b25ba654afd05458)) +* **richtext-lexical:** Blocks: z-index issue, e.g. select field dropdown in blocks hidden behind blocks below, or slash menu inside nested editor hidden behind blocks below ([09f17f4](https://github.com/payloadcms/payload/commit/09f17f44508539cfcb8722f7f462ef40d9ed54fd)) +* **richtext-lexical:** Floating Select Toolbar: Buttons and Dropdown Buttons not clickable in nested editors ([615702b](https://github.com/payloadcms/payload/commit/615702b858e76994a174159cb69f034ef811e016)), closes [#4025](https://github.com/payloadcms/payload/issues/4025) +* **richtext-lexical:** HTMLConverter: cannot find nested lexical fields ([#4103](https://github.com/payloadcms/payload/issues/4103)) ([a6d5f2e](https://github.com/payloadcms/payload/commit/a6d5f2e3dea178e1fbde90c0d6a5ce254a8db0d1)), closes [#4034](https://github.com/payloadcms/payload/issues/4034) +* **richtext-lexical:** incorrect caret positioning when selecting second line of multi-line paragraph ([#4165](https://github.com/payloadcms/payload/issues/4165)) ([b210af4](https://github.com/payloadcms/payload/commit/b210af46968b77d96ffd6ef60adc3b8d8bdc9376)) +* **richtext-lexical:** make lexicalHTML() function work for globals ([dbfc835](https://github.com/payloadcms/payload/commit/dbfc83520ca8b5e55198a3c4b517ae3a80f9cac6)) +* **richtext-lexical:** nested editor may lose focus when writing ([#4139](https://github.com/payloadcms/payload/issues/4139)) ([859c2f4](https://github.com/payloadcms/payload/commit/859c2f4a6d299a42e572133502b3841a74a11002)) +* **richtext-lexical:** remove optional chaining after `this` as transpilers are not handling it well ([#4145](https://github.com/payloadcms/payload/issues/4145)) ([2c8d34d](https://github.com/payloadcms/payload/commit/2c8d34d2aadf2fcaf0655c0abef233f341d9945f)) +* **richtext-lexical:** visual bug after rearranging blocks ([a6b4860](https://github.com/payloadcms/payload/commit/a6b486007dc26195adc5d576d937e35471c2868f)) +* simplifies block/array/hasMany-number field validations ([#4052](https://github.com/payloadcms/payload/issues/4052)) ([803a37e](https://github.com/payloadcms/payload/commit/803a37eaa947397fa0a93b9f4f7d702c6b94ceaa)) +* synchronous transaction errors ([#4164](https://github.com/payloadcms/payload/issues/4164)) ([1510baf](https://github.com/payloadcms/payload/commit/1510baf46e33540c72784f2d3f98330a8ff90923)) +* thread locale through to access routes from admin panel ([#4183](https://github.com/payloadcms/payload/issues/4183)) ([05f3169](https://github.com/payloadcms/payload/commit/05f3169a75b3b62962e7fe7842fbb6df6699433d)) +* transactionID isolation for GraphQL ([#4095](https://github.com/payloadcms/payload/issues/4095)) ([195a952](https://github.com/payloadcms/payload/commit/195a952c4314e0d53fd579517035373b49d6ccae)) +* upload fit not accounted for when editing focal point or crop ([#4142](https://github.com/payloadcms/payload/issues/4142)) ([45e9a55](https://github.com/payloadcms/payload/commit/45e9a559bbb16b2171465c8a439044011cebf102)) + ## [2.1.1](https://github.com/payloadcms/payload/compare/v2.1.0...v2.1.1) (2023-11-10) diff --git a/packages/payload/package.json b/packages/payload/package.json index 8af1e92d256..397e9886ae4 100644 --- a/packages/payload/package.json +++ b/packages/payload/package.json @@ -1,6 +1,6 @@ { "name": "payload", - "version": "2.1.1", + "version": "2.2.0", "description": "Node, React and MongoDB Headless CMS and Application Framework", "license": "MIT", "main": "./dist/index.js",
7edab5d3543db27c444b180548fc076dd483848a
2021-01-24 23:05:05
James
fix: ensures modal heights are 100% of viewport
false
ensures modal heights are 100% of viewport
fix
diff --git a/src/admin/scss/app.scss b/src/admin/scss/app.scss index 391c10d0bb2..e6a5692302c 100644 --- a/src/admin/scss/app.scss +++ b/src/admin/scss/app.scss @@ -116,6 +116,10 @@ dialog { padding: 0; } +.payload__modal-item { + min-height: 100vh; +} + .payload__modal-container--enterDone { overflow: scroll; }
bd0b1df560671bd0c2c46d3984f20b422a8dbbf5
2021-07-23 19:30:28
James
chore(release): v0.7.7
false
v0.7.7
chore
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0666644e245..a41b7796a39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [0.7.7](https://github.com/payloadcms/payload/compare/v0.7.6...v0.7.7) (2021-07-23) + + +### Bug Fixes + +* accurately documents the props for the datepicker field ([dcd8052](https://github.com/payloadcms/payload/commit/dcd8052498dd2900f228eaffcf6142b63e8e5a9b)) + + +### Features + +* only attempts to find config when payload is initialized ([266ccb3](https://github.com/payloadcms/payload/commit/266ccb374449b0a131a574d9b12275b6bb7e5c60)) + ## [0.7.6](https://github.com/payloadcms/payload/compare/v0.7.5...v0.7.6) (2021-07-07) ## [0.7.5](https://github.com/payloadcms/payload/compare/v0.7.4...v0.7.5) (2021-07-07) diff --git a/package.json b/package.json index 9a37702f856..87f48fa13aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "payload", - "version": "0.7.6", + "version": "0.7.7", "description": "Node, React and MongoDB Headless CMS and Application Framework", "license": "SEE LICENSE IN license.md", "author": {
079623f40a1f5b7bd559f9c6ab2bfedea30fe987
2022-07-19 01:20:20
James
fix: responsive improvements to rich text upload
false
responsive improvements to rich text upload
fix
diff --git a/docs/authentication/config.mdx b/docs/authentication/config.mdx index 10f22997091..b47ec292811 100644 --- a/docs/authentication/config.mdx +++ b/docs/authentication/config.mdx @@ -12,16 +12,18 @@ To enable Authentication on a collection, define an `auth` property and set it t ## Options -| Option | Description | -| ---------------------- | -------------| -| **`useAPIKey`** | Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection. [More](/docs/authentication/config#api-keys) | -| **`tokenExpiration`** | How long (in seconds) to keep the user logged in. JWTs and HTTP-only cookies will both expire at the same time. | -| **`maxLoginAttempts`** | Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to `0` to disable. | -| **`lockTime`** | Set the time that a user should be locked out if they fail authentication more times than `maxLoginAttempts` allows for. | -| **`depth`** | How many levels deep a `user` document should be populated when creating the JWT and binding the `user` to the express `req`. Defaults to `0` and should only be modified if absolutely necessary, as this will affect performance. | -| **`cookies`** | Set cookie options, including `secure`, `sameSite`, and `domain`. For advanced users. | -| **`forgotPassword`** | Customize the way that the `forgotPassword` operation functions. [More](/docs/authentication/config#forgot-password) | -| **`verify`** | Set to `true` or pass an object with verification options to require users to verify by email before they are allowed to log into your app. [More](/docs/authentication/config#email-verification) | +| Option | Description | +| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`useAPIKey`** | Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection. [More](/docs/authentication/config#api-keys) | +| **`tokenExpiration`** | How long (in seconds) to keep the user logged in. JWTs and HTTP-only cookies will both expire at the same time. | +| **`maxLoginAttempts`** | Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to `0` to disable. | +| **`lockTime`** | Set the time that a user should be locked out if they fail authentication more times than `maxLoginAttempts` allows for. | +| **`depth`** | How many levels deep a `user` document should be populated when creating the JWT and binding the `user` to the express `req`. Defaults to `0` and should only be modified if absolutely necessary, as this will affect performance. | +| **`cookies`** | Set cookie options, including `secure`, `sameSite`, and `domain`. For advanced users. | +| **`forgotPassword`** | Customize the way that the `forgotPassword` operation functions. [More](/docs/authentication/config#forgot-password) | +| **`verify`** | Set to `true` or pass an object with verification options to require users to verify by email before they are allowed to log into your app. [More](/docs/authentication/config#email-verification) | +| **`disableLocalStrategy`** | Advanced - disable Payload's built-in local auth strategy. Only use this property if you have replaced Payload's auth mechanisms with your own. | +| **`strategies`** | Advanced - an array of PassportJS authentication strategies to extend this collection's authentication with. [More](/docs/authentication/config#strategies) | ### API keys @@ -37,7 +39,8 @@ Technically, both of these options will work for third-party integrations but th To enable API keys on a collection, set the `useAPIKey` auth option to `true`. From there, a new interface will appear in the Admin panel for each document within the collection that allows you to generate an API key for each user in the Collection. <Banner type="success"> - User API keys are encrypted within the database, meaning that if your database is compromised, your API keys will not be. + User API keys are encrypted within the database, meaning that if your database + is compromised, your API keys will not be. </Banner> ##### Authenticating via API Key @@ -45,8 +48,9 @@ To enable API keys on a collection, set the `useAPIKey` auth option to `true`. F To utilize your API key while interacting with the REST or GraphQL API, add the `Authorization` header. **For example, using Fetch:** + ```js -const response = await fetch('http://localhost:3000/api/pages', { +const response = await fetch("http://localhost:3000/api/pages", { headers: { Authorization: `${collection.labels.singular} API-Key ${YOUR_API_KEY}`, }, @@ -62,8 +66,13 @@ You can customize how the Forgot Password workflow operates with the following o Function that accepts one argument, containing `{ req, token, user }`, that allows for overriding the HTML within emails that are sent to users attempting to reset their password. The function should return a string that supports HTML, which can be a full HTML email. <Banner type="success"> - <strong>Tip:</strong><br /> - HTML templating can be used to create custom email templates, inline CSS automatically, and more. You can make a reusable function that standardizes all email sent from Payload, which makes sending custom emails more DRY. Payload doesn't ship with an HTML templating engine, so you are free to choose your own. + <strong>Tip:</strong> + <br /> + HTML templating can be used to create custom email templates, inline CSS + automatically, and more. You can make a reusable function that standardizes + all email sent from Payload, which makes sending custom emails more DRY. + Payload doesn't ship with an HTML templating engine, so you are free to choose + your own. </Banner> Example: @@ -99,8 +108,13 @@ Example: ``` <Banner type="warning"> - <strong>Important:</strong><br /> - If you specify a different URL to send your users to for resetting their password, such as a page on the frontend of your app or similar, you need to handle making the call to the Payload REST or GraphQL reset-password operation yourself on your frontend, using the token that was provided for you. Above, it was passed via query parameter. + <strong>Important:</strong> + <br /> + If you specify a different URL to send your users to for resetting their + password, such as a page on the frontend of your app or similar, you need to + handle making the call to the Payload REST or GraphQL reset-password operation + yourself on your frontend, using the token that was provided for you. Above, + it was passed via query parameter. </Banner> **`generateEmailSubject`** @@ -153,8 +167,13 @@ Example: ``` <Banner type="warning"> - <strong>Important:</strong><br /> - If you specify a different URL to send your users to for email verification, such as a page on the frontend of your app or similar, you need to handle making the call to the Payload REST or GraphQL verification operation yourself on your frontend, using the token that was provided for you. Above, it was passed via query parameter. + <strong>Important:</strong> + <br /> + If you specify a different URL to send your users to for email verification, + such as a page on the frontend of your app or similar, you need to handle + making the call to the Payload REST or GraphQL verification operation yourself + on your frontend, using the token that was provided for you. Above, it was + passed via query parameter. </Banner> **`generateEmailSubject`** @@ -177,3 +196,15 @@ Example: } } ``` + +### Strategies + +As of Payload `1.0.0`, you can add additional authentication strategies to Payload easily by passing them to your collection's `auth.strategies` array. + +Behind the scenes, Payload uses PassportJS to power its local authentication strategy, so most strategies listed on the PassportJS website will work seamlessly. Combined with adding custom components to the admin panel's `Login` view, you can create advanced authentication strategies directly within Payload. + +<Banner type="warning"> + This is an advanced feature, so only attempt this if you are an experienced + developer. Otherwise, just let Payload's built-in authentication handle user + auth for you. +</Banner> diff --git a/src/admin/components/forms/field-types/RichText/elements/upload/Element/index.scss b/src/admin/components/forms/field-types/RichText/elements/upload/Element/index.scss index 5834f9f8bf5..36c36b03b9a 100644 --- a/src/admin/components/forms/field-types/RichText/elements/upload/Element/index.scss +++ b/src/admin/components/forms/field-types/RichText/elements/upload/Element/index.scss @@ -35,6 +35,7 @@ height: auto; position: relative; overflow: hidden; + flex-shrink: 0; img, svg { @@ -52,11 +53,13 @@ align-items: center; padding: base(.75) base(1); justify-content: space-between; + overflow: hidden; } &__actions { display: flex; align-items: center; + flex-shrink: 0; } &__actionButton { @@ -74,7 +77,9 @@ } &__collectionLabel { - margin-right: base(3); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } &__bottomRow { @@ -99,4 +104,10 @@ box-shadow: $focus-box-shadow; outline: none; } + + @include small-break { + &__topRowRightPanel { + padding: base(.75) base(.5); + } + } } diff --git a/src/admin/components/forms/field-types/RichText/index.scss b/src/admin/components/forms/field-types/RichText/index.scss index 5dea0512ea9..730fbe1950f 100644 --- a/src/admin/components/forms/field-types/RichText/index.scss +++ b/src/admin/components/forms/field-types/RichText/index.scss @@ -45,6 +45,7 @@ h5, h6 { font-family: var(--font-body); + line-height: 1.125; } h1[data-slate-node=element] { @@ -124,6 +125,12 @@ background-color: var(--theme-elevation-150); } } + + @include mid-break { + &__toolbar { + top: base(3); + } + } } [data-slate-node=element] { diff --git a/src/admin/scss/type.scss b/src/admin/scss/type.scss index 3b5975b0d81..4d94425cc8e 100644 --- a/src/admin/scss/type.scss +++ b/src/admin/scss/type.scss @@ -28,7 +28,7 @@ letter-spacing: -1px; @include small-break { - letter-spacing: base(0); + letter-spacing: -.5px; font-size: base(1.25); line-height: base(1.25); }
8874e871d4a48d5d3fccb8233464437d8ea61ad4
2022-12-04 00:14:46
Jarrod Flesch
fix: uses pathOrName to pass to internal Relationship field components
false
uses pathOrName to pass to internal Relationship field components
fix
diff --git a/src/admin/components/forms/field-types/Relationship/index.tsx b/src/admin/components/forms/field-types/Relationship/index.tsx index fc04cb11345..be887f95835 100644 --- a/src/admin/components/forms/field-types/Relationship/index.tsx +++ b/src/admin/components/forms/field-types/Relationship/index.tsx @@ -74,6 +74,8 @@ const Relationship: React.FC<Props> = (props) => { const [enableWordBoundarySearch, setEnableWordBoundarySearch] = useState(false); const firstRun = useRef(true); + const pathOrName = path || name; + const memoizedValidate = useCallback((value, validationOptions) => { return validate(value, { ...validationOptions, required }); }, [validate, required]); @@ -85,7 +87,7 @@ const Relationship: React.FC<Props> = (props) => { setValue, initialValue, } = useField<Value | Value[]>({ - path: path || name, + path: pathOrName, validate: memoizedValidate, condition, }); @@ -307,7 +309,7 @@ const Relationship: React.FC<Props> = (props) => { return ( <div - id={`field-${(path || name).replace(/\./gi, '__')}`} + id={`field-${(pathOrName).replace(/\./gi, '__')}`} className={classes} style={{ ...style, @@ -319,11 +321,11 @@ const Relationship: React.FC<Props> = (props) => { message={errorMessage} /> <Label - htmlFor={path} + htmlFor={pathOrName} label={label} required={required} /> - <GetFilterOptions {...{ filterOptionsResult, setFilterOptionsResult, filterOptions, path, relationTo }} /> + <GetFilterOptions {...{ filterOptionsResult, setFilterOptionsResult, filterOptions, path: pathOrName, relationTo }} /> {!errorLoading && ( <div className={`${baseClass}__wrap`}> <ReactSelect @@ -387,7 +389,7 @@ const Relationship: React.FC<Props> = (props) => { /> {!readOnly && ( <AddNewRelation - {...{ path, hasMany, relationTo, value, setValue, dispatchOptions }} + {...{ path: pathOrName, hasMany, relationTo, value, setValue, dispatchOptions }} /> )} </div>
4884f0d2973a4f8814875d4bcaa47f019d10416b
2024-05-30 20:41:40
Elliot DeNolf
fix(cpa): safer command exists check (#6569)
false
safer command exists check (#6569)
fix
diff --git a/packages/create-payload-app/package.json b/packages/create-payload-app/package.json index 0556f9bd748..d737ebe7b44 100644 --- a/packages/create-payload-app/package.json +++ b/packages/create-payload-app/package.json @@ -38,7 +38,6 @@ "@sindresorhus/slugify": "^1.1.0", "arg": "^5.0.0", "chalk": "^4.1.0", - "command-exists": "^1.2.9", "comment-json": "^4.2.3", "degit": "^2.8.4", "esprima-next": "^6.0.3", @@ -49,7 +48,6 @@ "terminal-link": "^2.1.1" }, "devDependencies": { - "@types/command-exists": "^1.2.0", "@types/degit": "^2.8.3", "@types/esprima": "^4.0.6", "@types/fs-extra": "^9.0.12", diff --git a/packages/create-payload-app/src/lib/get-package-manager.ts b/packages/create-payload-app/src/lib/get-package-manager.ts index a1e33b0ccad..e9d6f8674e4 100644 --- a/packages/create-payload-app/src/lib/get-package-manager.ts +++ b/packages/create-payload-app/src/lib/get-package-manager.ts @@ -1,4 +1,4 @@ -import commandExists from 'command-exists' +import execa from 'execa' import fse from 'fs-extra' import type { CliArgs, PackageManager } from '../types.js' @@ -9,22 +9,36 @@ export async function getPackageManager(args: { }): Promise<PackageManager> { const { cliArgs, projectDir } = args - // Check for yarn.lock, package-lock.json, or pnpm-lock.yaml - let detected: PackageManager = 'npm' - if ( - cliArgs?.['--use-pnpm'] || - fse.existsSync(`${projectDir}/pnpm-lock.yaml`) || - (await commandExists('pnpm')) - ) { - detected = 'pnpm' - } else if ( - cliArgs?.['--use-yarn'] || - fse.existsSync(`${projectDir}/yarn.lock`) || - (await commandExists('yarn')) - ) { - detected = 'yarn' - } else if (cliArgs?.['--use-npm'] || fse.existsSync(`${projectDir}/package-lock.json`)) { - detected = 'npm' + try { + // Check for yarn.lock, package-lock.json, or pnpm-lock.yaml + let detected: PackageManager = 'npm' + if ( + cliArgs?.['--use-pnpm'] || + fse.existsSync(`${projectDir}/pnpm-lock.yaml`) || + (await commandExists('pnpm')) + ) { + detected = 'pnpm' + } else if ( + cliArgs?.['--use-yarn'] || + fse.existsSync(`${projectDir}/yarn.lock`) || + (await commandExists('yarn')) + ) { + detected = 'yarn' + } else if (cliArgs?.['--use-npm'] || fse.existsSync(`${projectDir}/package-lock.json`)) { + detected = 'npm' + } + + return detected + } catch (error) { + return 'npm' + } +} + +async function commandExists(command: string): Promise<boolean> { + try { + await execa.command(`command -v ${command}`) + return true + } catch { + return false } - return detected || 'npm' } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc496215cf3..4448d596a78 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -281,9 +281,6 @@ importers: chalk: specifier: ^4.1.0 version: 4.1.2 - command-exists: - specifier: ^1.2.9 - version: 1.2.9 comment-json: specifier: ^4.2.3 version: 4.2.3 @@ -309,9 +306,6 @@ importers: specifier: ^2.1.1 version: 2.1.1 devDependencies: - '@types/command-exists': - specifier: ^1.2.0 - version: 1.2.3 '@types/degit': specifier: ^2.8.3 version: 2.8.6 @@ -7049,10 +7043,6 @@ packages: /@types/[email protected]: resolution: {integrity: sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg==} - /@types/[email protected]: - resolution: {integrity: sha512-PpbaE2XWLaWYboXD6k70TcXO/OdOyyRFq5TVpmlUELNxdkkmXU9fkImNosmXU1DtsNrqdUgWd/nJQYXgwmtdXQ==} - dev: true - /@types/[email protected]: resolution: {integrity: sha512-lwEL4M/uAGWngWFLSG87ZDr2kLrbuR8p7X+QZB1OQlT+qkHsCPDVFnHPyXf4Vyl4yDDorNY+mAhosxkCvppatg==} dependencies: @@ -9119,10 +9109,6 @@ packages: dependencies: delayed-stream: 1.0.0 - /[email protected]: - resolution: {integrity: sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==} - dev: false - /[email protected]: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'}
6be665f88708c99d77ad9622fe0a35e3ecb03f6e
2024-10-14 04:40:47
Sasha
chore(eslint): payload-logger proper usage works with template literals (#8660)
false
payload-logger proper usage works with template literals (#8660)
chore
diff --git a/packages/db-postgres/src/connect.ts b/packages/db-postgres/src/connect.ts index a88a62dfa81..37c077c0f3d 100644 --- a/packages/db-postgres/src/connect.ts +++ b/packages/db-postgres/src/connect.ts @@ -88,7 +88,10 @@ export const connect: Connect = async function connect( return } } else { - this.payload.logger.error(`Error: cannot connect to Postgres. Details: ${err.message}`, err) + this.payload.logger.error({ + err, + msg: `Error: cannot connect to Postgres. Details: ${err.message}`, + }) } if (typeof this.rejectInitializing === 'function') { diff --git a/packages/db-vercel-postgres/src/connect.ts b/packages/db-vercel-postgres/src/connect.ts index 30644bc908b..1da8676f9aa 100644 --- a/packages/db-vercel-postgres/src/connect.ts +++ b/packages/db-vercel-postgres/src/connect.ts @@ -51,7 +51,10 @@ export const connect: Connect = async function connect( return } } else { - this.payload.logger.error(`Error: cannot connect to Postgres. Details: ${err.message}`, err) + this.payload.logger.error({ + err, + msg: `Error: cannot connect to Postgres. Details: ${err.message}`, + }) } if (typeof this.rejectInitializing === 'function') { diff --git a/packages/drizzle/src/migrateReset.ts b/packages/drizzle/src/migrateReset.ts index bf5588204a7..b6111406983 100644 --- a/packages/drizzle/src/migrateReset.ts +++ b/packages/drizzle/src/migrateReset.ts @@ -84,7 +84,7 @@ export async function migrateReset(this: DrizzleAdapter): Promise<void> { }, }) } catch (err: unknown) { - payload.logger.error({ error: err, msg: 'Error deleting dev migration' }) + payload.logger.error({ err, msg: 'Error deleting dev migration' }) } } } diff --git a/packages/drizzle/src/postgres/createDatabase.ts b/packages/drizzle/src/postgres/createDatabase.ts index a19dc717939..f7524d2dbf2 100644 --- a/packages/drizzle/src/postgres/createDatabase.ts +++ b/packages/drizzle/src/postgres/createDatabase.ts @@ -98,10 +98,10 @@ export const createDatabase = async function (this: BasePostgresAdapter, args: A return true } catch (err) { - this.payload.logger.error( - `Error: failed to create database ${dbName}. Details: ${err.message}`, + this.payload.logger.error({ err, - ) + msg: `Error: failed to create database ${dbName}. Details: ${err.message}`, + }) return false } finally { diff --git a/packages/eslint-plugin/customRules/proper-payload-logger-usage.js b/packages/eslint-plugin/customRules/proper-payload-logger-usage.js index 01817687f9f..84b00762184 100644 --- a/packages/eslint-plugin/customRules/proper-payload-logger-usage.js +++ b/packages/eslint-plugin/customRules/proper-payload-logger-usage.js @@ -34,11 +34,11 @@ export const rule = { if (isPayloadLoggerError(callee)) { const args = node.arguments - // Case 1: Single string is passed as the argument + // Case 1: Single string / templated string is passed as the argument if ( args.length === 1 && - args[0].type === 'Literal' && - typeof args[0].value === 'string' + ((args[0].type === 'Literal' && typeof args[0].value === 'string') || + args[0].type === 'TemplateLiteral') ) { return // Valid: single string argument } @@ -67,11 +67,11 @@ export const rule = { return // Valid object, checked for 'err'/'error' keys } - // Case 3: Improper usage (string + error or additional err/error) + // Case 3: Improper usage (string / templated string + error or additional err/error) if ( args.length > 1 && - args[0].type === 'Literal' && - typeof args[0].value === 'string' && + ((args[0].type === 'Literal' && typeof args[0].value === 'string') || + args[0].type === 'TemplateLiteral') && args[1].type === 'Identifier' && (args[1].name === 'err' || args[1].name === 'error') ) { diff --git a/packages/eslint-plugin/tests/proper-payload-logger-usage.js b/packages/eslint-plugin/tests/proper-payload-logger-usage.js index 1eccd5123fb..050b21a9630 100644 --- a/packages/eslint-plugin/tests/proper-payload-logger-usage.js +++ b/packages/eslint-plugin/tests/proper-payload-logger-usage.js @@ -14,6 +14,10 @@ ruleTester.run('no-improper-payload-logger-error', rule, { { code: "payload.logger.error('Some error message')", }, + // Valid: payload.logger.error with a templated string + { + code: 'payload.logger.error(`Some error message`)', + }, // Valid: *.payload.logger.error with object { code: "this.payload.logger.error({ msg: 'another message', err })", @@ -33,6 +37,15 @@ ruleTester.run('no-improper-payload-logger-error', rule, { }, ], }, + // Invalid: payload.logger.error with both templated string and error + { + code: 'payload.logger.error(`Some error message`, err)', + errors: [ + { + messageId: 'improperUsage', + }, + ], + }, // Invalid: *.payload.logger.error with both string and error { code: "this.payload.logger.error('Some error message', error)", diff --git a/packages/payload/src/database/migrations/migrateReset.ts b/packages/payload/src/database/migrations/migrateReset.ts index 070a3571630..7cd1b0b0acf 100644 --- a/packages/payload/src/database/migrations/migrateReset.ts +++ b/packages/payload/src/database/migrations/migrateReset.ts @@ -62,6 +62,6 @@ export async function migrateReset(this: BaseDatabaseAdapter): Promise<void> { }, }) } catch (err: unknown) { - payload.logger.error({ error: err, msg: 'Error deleting dev migration' }) + payload.logger.error({ err, msg: 'Error deleting dev migration' }) } }
98438175cfd16a26bea1bf07fe133db132556650
2024-04-09 22:01:25
James
chore: handles server errors
false
handles server errors
chore
diff --git a/packages/ui/src/forms/Form/fieldReducer.ts b/packages/ui/src/forms/Form/fieldReducer.ts index 7ed0bc78e09..143dbf41a6c 100644 --- a/packages/ui/src/forms/Form/fieldReducer.ts +++ b/packages/ui/src/forms/Form/fieldReducer.ts @@ -47,6 +47,68 @@ export function fieldReducer(state: FormState, action: FieldAction): FormState { return newState } + case 'ADD_SERVER_ERRORS': { + let newState = { ...state } + + const errorPaths: { fieldErrorPath: string; parentPath: string }[] = [] + + action.errors.forEach(({ field, message }) => { + newState[field] = { + ...(newState[field] || { + initialValue: null, + value: null, + }), + errorMessage: message, + valid: false, + } + + const segments = field.split('.') + if (segments.length > 1) { + errorPaths.push({ + fieldErrorPath: field, + parentPath: segments.slice(0, segments.length - 1).join('.'), + }) + } + }) + + newState = Object.entries(newState).reduce((acc, [path, fieldState]) => { + const fieldErrorPaths = errorPaths.reduce((errorACC, { fieldErrorPath, parentPath }) => { + if (parentPath.startsWith(path)) { + errorACC.push(fieldErrorPath) + } + return errorACC + }, []) + + let changed = false + + if (fieldErrorPaths.length > 0) { + const newErrorPaths = Array.isArray(fieldState.errorPaths) ? fieldState.errorPaths : [] + + fieldErrorPaths.forEach((fieldErrorPath) => { + if (!newErrorPaths.includes(fieldErrorPath)) { + newErrorPaths.push(fieldErrorPath) + changed = true + } + }) + + if (changed) { + acc[path] = { + ...fieldState, + errorPaths: newErrorPaths, + } + } + } + + if (!changed) { + acc[path] = fieldState + } + + return acc + }, {}) + + return newState + } + case 'UPDATE': { const newField = Object.entries(action).reduce( (field, [key, value]) => { diff --git a/packages/ui/src/forms/Form/index.tsx b/packages/ui/src/forms/Form/index.tsx index 7ab6ddacd9b..23d81406dc4 100644 --- a/packages/ui/src/forms/Form/index.tsx +++ b/packages/ui/src/forms/Form/index.tsx @@ -317,14 +317,9 @@ export const Form: React.FC<FormProps> = (props) => { [[], []], ) - fieldErrors.forEach((err) => { - dispatchFields({ - type: 'UPDATE', - ...(contextRef.current?.fields?.[err.field] || {}), - errorMessage: err.message, - path: err.field, - valid: false, - }) + dispatchFields({ + type: 'ADD_SERVER_ERRORS', + errors: fieldErrors, }) nonFieldErrors.forEach((err) => { diff --git a/packages/ui/src/forms/Form/types.ts b/packages/ui/src/forms/Form/types.ts index ec48eb4a4b8..fbaef436676 100644 --- a/packages/ui/src/forms/Form/types.ts +++ b/packages/ui/src/forms/Form/types.ts @@ -129,6 +129,14 @@ export type MOVE_ROW = { type: 'MOVE_ROW' } +export type ADD_SERVER_ERRORS = { + errors: { + field: string + message: string + }[] + type: 'ADD_SERVER_ERRORS' +} + export type SET_ROW_COLLAPSED = { collapsed: boolean path: string @@ -146,6 +154,7 @@ export type SET_ALL_ROWS_COLLAPSED = { export type FieldAction = | ADD_ROW + | ADD_SERVER_ERRORS | DUPLICATE_ROW | MODIFY_CONDITION | MOVE_ROW diff --git a/test/fields/e2e.spec.ts b/test/fields/e2e.spec.ts index 291a9c46c23..c40595accd5 100644 --- a/test/fields/e2e.spec.ts +++ b/test/fields/e2e.spec.ts @@ -254,7 +254,7 @@ describe('fields', () => { }) // TODO - This test is flaky. Rarely, but sometimes it randomly fails. - test.skip('should display unique constraint error in ui', async () => { + test('should display unique constraint error in ui', async () => { const uniqueText = 'uniqueText' await payload.create({ collection: 'indexed-fields', diff --git a/test/tsconfig.json b/test/tsconfig.json index 209f12718c9..1c52f71df40 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -40,8 +40,12 @@ "@payloadcms/ui/scss": ["../packages/ui/src/scss.scss"], "@payloadcms/ui/scss/app.scss": ["../packages/ui/src/scss/app.scss"], "payload/types": ["../packages/payload/src/exports/types/index.ts"], - "@payloadcms/next/*": ["../packages/next/src/*"], - "@payloadcms/next": ["../packages/next/src/exports/*"], + "@payloadcms/next/*": [ + "./packages/next/src/exports/*" + ], + "@payloadcms/next": [ + "./packages/next/src/exports/*" + ], "@payload-config": ["./_community/config.ts"] } },
7e25abf87a8c6b64ccfdc4bc8c0c7ce6c6a53107
2022-10-24 21:56:25
James
chore: type fixes
false
type fixes
chore
diff --git a/src/admin/components/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx b/src/admin/components/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx index 2e7845cda92..762037b293e 100644 --- a/src/admin/components/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx +++ b/src/admin/components/views/Version/RenderFieldsToDiff/fields/Relationship/index.tsx @@ -22,7 +22,7 @@ const generateLabelFromValue = ( ): string => { let relation: string; let relatedDoc: RelationshipValue; - let valueToReturn = ''; + let valueToReturn = '' as any; if (Array.isArray(field.relationTo)) { if (typeof value === 'object') { @@ -58,7 +58,7 @@ const generateLabelFromValue = ( return valueToReturn; }; -const Relationship: React.FC<Props & { field: RelationshipField}> = ({ field, version, comparison }) => { +const Relationship: React.FC<Props & { field: RelationshipField }> = ({ field, version, comparison }) => { const { collections } = useConfig(); const locale = useLocale();
c83ad752ca61c5859909cc92f2569c825997af04
2023-01-20 02:49:11
James
chore: only sets local to false if local is undefined
false
only sets local to false if local is undefined
chore
diff --git a/src/initHTTP.ts b/src/initHTTP.ts index f40bcc6cad8..f2c6c92baad 100644 --- a/src/initHTTP.ts +++ b/src/initHTTP.ts @@ -21,7 +21,7 @@ import mountEndpoints from './express/mountEndpoints'; import { Payload, getPayload } from './payload'; export const initHTTP = async (options: InitOptions): Promise<Payload> => { - options.local = false; + if (typeof options.local === 'undefined') options.local = false; const payload = await getPayload(options); if (!options.local) {
91a0f90649cc2ec30fe87f6ef9fcd394fce624c5
2025-02-10 23:50:34
James Mikrut
fix(next): allows relative live preview urls (#11083)
false
allows relative live preview urls (#11083)
fix
diff --git a/docs/live-preview/overview.mdx b/docs/live-preview/overview.mdx index 5f7c7fe02bd..6a940f8c86d 100644 --- a/docs/live-preview/overview.mdx +++ b/docs/live-preview/overview.mdx @@ -109,7 +109,9 @@ The following arguments are provided to the `url` function: | **`globalConfig`** | The Global Admin Config of the Document being edited. [More details](../configuration/globals#admin-options). | | **`req`** | The Payload Request object. | -If your application requires a fully qualified URL, such as within deploying to Vercel Preview Deployments, you can use the `req` property to build this URL: +You can return either an absolute URL or relative URL from this function. If you don't know the URL of your frontend at build-time, you can return a relative URL, and in that case, Payload will automatically construct an absolute URL by injecting the protocol, domain, and port from your browser window. Returning a relative URL is helpful for platforms like Vercel where you may have preview deployment URLs that are unknown at build time. + +If your application requires a fully qualified URL, or you are attempting to preview with a frontend on a different domain, you can use the `req` property to build this URL: ```ts url: ({ data, req }) => `${req.protocol}//${req.host}/${data.slug}` // highlight-line diff --git a/packages/next/src/views/LivePreview/index.client.tsx b/packages/next/src/views/LivePreview/index.client.tsx index 33c3c9997dd..d1c28a17700 100644 --- a/packages/next/src/views/LivePreview/index.client.tsx +++ b/packages/next/src/views/LivePreview/index.client.tsx @@ -61,6 +61,14 @@ type Props = { readonly serverURL: string } & DocumentSlots +const getAbsoluteUrl = (url) => { + try { + return new URL(url, window.location.origin).href + } catch { + return url + } +} + const PreviewView: React.FC<Props> = ({ collectionConfig, config, @@ -552,7 +560,7 @@ export const LivePreviewClient: React.FC< readonly url: string } & DocumentSlots > = (props) => { - const { breakpoints, url } = props + const { breakpoints, url: incomingUrl } = props const { collectionSlug, globalSlug } = useDocumentInfo() const { @@ -564,6 +572,11 @@ export const LivePreviewClient: React.FC< getEntityConfig, } = useConfig() + const url = + incomingUrl.startsWith('http://') || incomingUrl.startsWith('https://') + ? incomingUrl + : getAbsoluteUrl(incomingUrl) + const { isPopupOpen, openPopupWindow, popupRef } = usePopupWindow({ eventType: 'payload-live-preview', url, diff --git a/templates/website/src/utilities/generatePreviewPath.ts b/templates/website/src/utilities/generatePreviewPath.ts index 9f71be07eff..72093dd97e8 100644 --- a/templates/website/src/utilities/generatePreviewPath.ts +++ b/templates/website/src/utilities/generatePreviewPath.ts @@ -11,7 +11,7 @@ type Props = { req: PayloadRequest } -export const generatePreviewPath = ({ collection, slug, req }: Props) => { +export const generatePreviewPath = ({ collection, slug }: Props) => { const encodedParams = new URLSearchParams({ slug, collection, @@ -19,12 +19,7 @@ export const generatePreviewPath = ({ collection, slug, req }: Props) => { previewSecret: process.env.PREVIEW_SECRET || '', }) - const isProduction = - process.env.NODE_ENV === 'production' || Boolean(process.env.VERCEL_PROJECT_PRODUCTION_URL) - - const protocol = isProduction ? 'https:' : req.protocol - - const url = `${protocol}//${req.host}/next/preview?${encodedParams.toString()}` + const url = `/next/preview?${encodedParams.toString()}` return url } diff --git a/templates/with-vercel-website/src/utilities/generatePreviewPath.ts b/templates/with-vercel-website/src/utilities/generatePreviewPath.ts index 9f71be07eff..72093dd97e8 100644 --- a/templates/with-vercel-website/src/utilities/generatePreviewPath.ts +++ b/templates/with-vercel-website/src/utilities/generatePreviewPath.ts @@ -11,7 +11,7 @@ type Props = { req: PayloadRequest } -export const generatePreviewPath = ({ collection, slug, req }: Props) => { +export const generatePreviewPath = ({ collection, slug }: Props) => { const encodedParams = new URLSearchParams({ slug, collection, @@ -19,12 +19,7 @@ export const generatePreviewPath = ({ collection, slug, req }: Props) => { previewSecret: process.env.PREVIEW_SECRET || '', }) - const isProduction = - process.env.NODE_ENV === 'production' || Boolean(process.env.VERCEL_PROJECT_PRODUCTION_URL) - - const protocol = isProduction ? 'https:' : req.protocol - - const url = `${protocol}//${req.host}/next/preview?${encodedParams.toString()}` + const url = `/next/preview?${encodedParams.toString()}` return url } diff --git a/test/live-preview/next-env.d.ts b/test/live-preview/next-env.d.ts index 40c3d68096c..1b3be0840f3 100644 --- a/test/live-preview/next-env.d.ts +++ b/test/live-preview/next-env.d.ts @@ -2,4 +2,4 @@ /// <reference types="next/image-types/global" /> // NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/test/live-preview/payload-types.ts b/test/live-preview/payload-types.ts index 6a9157119bb..1792c3981ac 100644 --- a/test/live-preview/payload-types.ts +++ b/test/live-preview/payload-types.ts @@ -135,6 +135,9 @@ export interface Page { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('primary' | 'secondary') | null; }; id?: string | null; @@ -169,6 +172,9 @@ export interface Page { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('default' | 'primary' | 'secondary') | null; }; id?: string | null; @@ -202,12 +208,18 @@ export interface Page { value: string | Post; }[] | null; + /** + * This field is auto-populated after-read + */ populatedDocs?: | { relationTo: 'posts'; value: string | Post; }[] | null; + /** + * This field is auto-populated after-read + */ populatedDocsTotal?: number | null; id?: string | null; blockName?: string | null; @@ -367,6 +379,9 @@ export interface Post { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('primary' | 'secondary') | null; }; id?: string | null; @@ -401,6 +416,9 @@ export interface Post { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('default' | 'primary' | 'secondary') | null; }; id?: string | null; @@ -434,12 +452,18 @@ export interface Post { value: string | Post; }[] | null; + /** + * This field is auto-populated after-read + */ populatedDocs?: | { relationTo: 'posts'; value: string | Post; }[] | null; + /** + * This field is auto-populated after-read + */ populatedDocsTotal?: number | null; id?: string | null; blockName?: string | null; @@ -510,6 +534,9 @@ export interface Ssr { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('primary' | 'secondary') | null; }; id?: string | null; @@ -544,6 +571,9 @@ export interface Ssr { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('default' | 'primary' | 'secondary') | null; }; id?: string | null; @@ -577,12 +607,18 @@ export interface Ssr { value: string | Post; }[] | null; + /** + * This field is auto-populated after-read + */ populatedDocs?: | { relationTo: 'posts'; value: string | Post; }[] | null; + /** + * This field is auto-populated after-read + */ populatedDocsTotal?: number | null; id?: string | null; blockName?: string | null; @@ -641,6 +677,9 @@ export interface SsrAutosave { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('primary' | 'secondary') | null; }; id?: string | null; @@ -675,6 +714,9 @@ export interface SsrAutosave { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('default' | 'primary' | 'secondary') | null; }; id?: string | null; @@ -708,12 +750,18 @@ export interface SsrAutosave { value: string | Post; }[] | null; + /** + * This field is auto-populated after-read + */ populatedDocs?: | { relationTo: 'posts'; value: string | Post; }[] | null; + /** + * This field is auto-populated after-read + */ populatedDocsTotal?: number | null; id?: string | null; blockName?: string | null; @@ -1345,6 +1393,9 @@ export interface Header { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('default' | 'primary' | 'secondary') | null; }; id?: string | null; @@ -1375,6 +1426,9 @@ export interface Footer { } | null); url?: string | null; label: string; + /** + * Choose how the link should be rendered. + */ appearance?: ('default' | 'primary' | 'secondary') | null; }; id?: string | null; diff --git a/test/live-preview/utilities/formatLivePreviewURL.ts b/test/live-preview/utilities/formatLivePreviewURL.ts index ede3d95f67b..089e40ac31e 100644 --- a/test/live-preview/utilities/formatLivePreviewURL.ts +++ b/test/live-preview/utilities/formatLivePreviewURL.ts @@ -5,7 +5,7 @@ export const formatLivePreviewURL: LivePreviewConfig['url'] = async ({ collectionConfig, req, }) => { - let baseURL = `${req.protocol}//${req.host}/live-preview` + let baseURL = `/live-preview` // You can run async requests here, if needed // For example, multi-tenant apps may need to lookup additional data
0f2feacc1956840162021eb5eaa8d88e119f03c6
2024-12-04 08:24:19
Nate
docs: fix typo in Collections.mdx (#9696)
false
fix typo in Collections.mdx (#9696)
docs
diff --git a/docs/access-control/collections.mdx b/docs/access-control/collections.mdx index b752a82e4d5..5b9085e1596 100644 --- a/docs/access-control/collections.mdx +++ b/docs/access-control/collections.mdx @@ -259,7 +259,7 @@ The following arguments are provided to the `delete` function: ### Admin -If the Collection is use to access the [Admin Panel](../admin/overview#the-admin-user-collection), the `Admin` Access Control function determines whether or not the currently logged in user can access the admin UI. +If the Collection is used to access the [Admin Panel](../admin/overview#the-admin-user-collection), the `Admin` Access Control function determines whether or not the currently logged in user can access the admin UI. To add Admin Access Control to a Collection, use the `admin` property in the [Collection Config](../collections/overview):
4b5453e8e5484f7afcadbf5bccf8369b552969c6
2023-12-06 19:17:34
Patrik
fix: simplifies query validation and fixes nested relationship fields (#4391)
false
simplifies query validation and fixes nested relationship fields (#4391)
fix
diff --git a/packages/payload/src/database/queryValidation/validateSearchParams.ts b/packages/payload/src/database/queryValidation/validateSearchParams.ts index f1d9d6c29d8..d7e4a3cec8a 100644 --- a/packages/payload/src/database/queryValidation/validateSearchParams.ts +++ b/packages/payload/src/database/queryValidation/validateSearchParams.ts @@ -101,7 +101,6 @@ export async function validateSearchParam({ errors.push({ path: incomingPath }) } } - let fieldAccess let fieldPath = path // remove locale from end of path if (path.endsWith(`.${req.locale}`)) { @@ -115,51 +114,29 @@ export async function validateSearchParam({ const entitySlug = collectionSlug || globalConfig.slug const segments = fieldPath.split('.') + let fieldAccess if (versionFields) { fieldAccess = policies[entityType][entitySlug] if (segments[0] === 'parent' || segments[0] === 'version') { segments.shift() - } else { - if (['json', 'relationship', 'richText'].includes(field.type)) { - fieldAccess = fieldAccess[field.name] - } else { - segments.forEach((segment, pathIndex) => { - if (fieldAccess[segment]) { - if (pathIndex === segments.length - 1) { - fieldAccess = fieldAccess[segment] - } else if ('fields' in fieldAccess[segment]) { - fieldAccess = fieldAccess[segment].fields - } else if ('blocks' in fieldAccess[segment]) { - fieldAccess = fieldAccess[segment] - } - } - }) - } } - - fieldAccess = fieldAccess.read.permission } else { fieldAccess = policies[entityType][entitySlug].fields + } - if (['json', 'relationship', 'richText'].includes(field.type)) { - fieldAccess = fieldAccess[field.name] - } else { - segments.forEach((segment, pathIndex) => { - if (fieldAccess[segment]) { - if (pathIndex === segments.length - 1) { - fieldAccess = fieldAccess[segment] - } else if ('fields' in fieldAccess[segment]) { - fieldAccess = fieldAccess[segment].fields - } else if ('blocks' in fieldAccess[segment]) { - fieldAccess = fieldAccess[segment] - } - } - }) + segments.forEach((segment) => { + if (fieldAccess[segment]) { + if ('fields' in fieldAccess[segment]) { + fieldAccess = fieldAccess[segment].fields + } else if ('blocks' in fieldAccess[segment]) { + fieldAccess = fieldAccess[segment] + } else { + fieldAccess = fieldAccess[segment] + } } + }) - fieldAccess = fieldAccess.read.permission - } - if (!fieldAccess) { + if (!fieldAccess?.read?.permission) { errors.push({ path: fieldPath }) } }
aa6cb4f25be93a1687afe3fb00b4ac713f68bd81
2024-03-22 02:39:15
Elliot DeNolf
fix(next): prod css output webpack
false
prod css output webpack
fix
diff --git a/packages/next/src/webpackEntry.ts b/packages/next/src/webpackEntry.ts new file mode 100644 index 00000000000..05abef645f1 --- /dev/null +++ b/packages/next/src/webpackEntry.ts @@ -0,0 +1,4 @@ +export { RootLayout } from './layouts/Root/index.js' +export { Dashboard as DashboardPage } from './views/Dashboard/index.js' +export { Login } from './views/Login/index.js' +export { RootPage } from './views/Root/index.js' diff --git a/packages/next/webpack.config.js b/packages/next/webpack.config.js index 7f1c106904c..8eb051b796b 100644 --- a/packages/next/webpack.config.js +++ b/packages/next/webpack.config.js @@ -8,8 +8,9 @@ import webpack from 'webpack' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) +/** @type {import('webpack').Configuration} */ const componentWebpackConfig = { - entry: path.resolve(dirname, './src/index.js'), + entry: path.resolve(dirname, './src/webpackEntry.ts'), externals: [ 'react', 'react-dom',
7af8f29b4a8dddf389356e4db142f8d434cdc964
2023-12-06 22:20:50
Alessio Gravili
feat(richtext-lexical): Link & Relationship Feature: field-level configurable allowed relationships (#4182)
false
Link & Relationship Feature: field-level configurable allowed relationships (#4182)
feat
diff --git a/packages/richtext-lexical/src/field/features/Link/drawer/baseFields.ts b/packages/richtext-lexical/src/field/features/Link/drawer/baseFields.ts index 0bed87bfe9c..d4da6b15849 100644 --- a/packages/richtext-lexical/src/field/features/Link/drawer/baseFields.ts +++ b/packages/richtext-lexical/src/field/features/Link/drawer/baseFields.ts @@ -1,5 +1,6 @@ import type { Config } from 'payload/config' import type { Field } from 'payload/types' +import type { RadioField, TextField } from 'payload/types' import { extractTranslations } from 'payload/utilities' @@ -14,73 +15,103 @@ const translations = extractTranslations([ 'fields:openInNewTab', ]) -export const getBaseFields = (config: Config): Field[] => [ - { - name: 'text', - label: translations['fields:textToDisplay'], - required: true, - type: 'text', - }, - { - name: 'fields', - admin: { - style: { - borderBottom: 0, - borderTop: 0, - margin: 0, - padding: 0, - }, +export const getBaseFields = ( + config: Config, + enabledCollections: false | string[], + disabledCollections: false | string[], +): Field[] => { + let enabledRelations: string[] + + /** + * Figure out which relations should be enabled (enabledRelations) based on a collection's admin.enableRichTextLink property, + * or the Link Feature's enabledCollections and disabledCollections properties which override it. + */ + if (enabledCollections) { + enabledRelations = enabledCollections + } else if (disabledCollections) { + enabledRelations = config.collections + .filter(({ slug }) => !disabledCollections.includes(slug)) + .map(({ slug }) => slug) + } else { + enabledRelations = config.collections + .filter(({ admin: { enableRichTextLink } }) => enableRichTextLink) + .map(({ slug }) => slug) + } + + const baseFields = [ + { + name: 'text', + label: translations['fields:textToDisplay'], + required: true, + type: 'text', }, - fields: [ - { - name: 'linkType', - admin: { - description: translations['fields:chooseBetweenCustomTextOrDocument'], - }, - defaultValue: 'custom', - label: translations['fields:linkType'], - options: [ - { - label: translations['fields:customURL'], - value: 'custom', - }, - { - label: translations['fields:internalLink'], - value: 'internal', - }, - ], - required: true, - type: 'radio', - }, - { - name: 'url', - admin: { - condition: ({ fields }) => fields?.linkType !== 'internal', + { + name: 'fields', + admin: { + style: { + borderBottom: 0, + borderTop: 0, + margin: 0, + padding: 0, }, - label: translations['fields:enterURL'], - required: true, - type: 'text', }, - { - name: 'doc', - admin: { - condition: ({ fields }) => { - return fields?.linkType === 'internal' + fields: [ + { + name: 'linkType', + admin: { + description: translations['fields:chooseBetweenCustomTextOrDocument'], }, + defaultValue: 'custom', + label: translations['fields:linkType'], + options: [ + { + label: translations['fields:customURL'], + value: 'custom', + }, + ], + required: true, + type: 'radio', + }, + { + name: 'url', + label: translations['fields:enterURL'], + required: true, + type: 'text', + }, + ] as Field[], + type: 'group', + }, + ] + + // Only display internal link-specific fields / options / conditions if there are enabled relations + if (enabledRelations?.length) { + ;(baseFields[1].fields[0] as RadioField).options.push({ + label: translations['fields:internalLink'], + value: 'internal', + }) + ;(baseFields[1].fields[1] as TextField).admin = { + condition: ({ fields }) => fields?.linkType !== 'internal', + } + + baseFields[1].fields.push({ + name: 'doc', + admin: { + condition: ({ fields }) => { + return fields?.linkType === 'internal' }, - label: translations['fields:chooseDocumentToLink'], - relationTo: config.collections - .filter(({ admin: { enableRichTextLink } }) => enableRichTextLink) - .map(({ slug }) => slug), - required: true, - type: 'relationship', - }, - { - name: 'newTab', - label: translations['fields:openInNewTab'], - type: 'checkbox', }, - ], - type: 'group', - }, -] + label: translations['fields:chooseDocumentToLink'], + relationTo: enabledRelations, + required: true, + type: 'relationship', + }) + } + + baseFields[1].fields.push({ + name: 'newTab', + label: translations['fields:openInNewTab'], + type: 'checkbox', + }) + + return baseFields as Field[] +} diff --git a/packages/richtext-lexical/src/field/features/Link/index.ts b/packages/richtext-lexical/src/field/features/Link/index.ts index 89a3b08489d..384a00bd1f7 100644 --- a/packages/richtext-lexical/src/field/features/Link/index.ts +++ b/packages/richtext-lexical/src/field/features/Link/index.ts @@ -18,11 +18,38 @@ import { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from './nodes/LinkNode' import { TOGGLE_LINK_WITH_MODAL_COMMAND } from './plugins/floatingLinkEditor/LinkEditor/commands' import { linkPopulationPromiseHOC } from './populationPromise' -export type LinkFeatureProps = { +type ExclusiveLinkCollectionsProps = + | { + /** + * The collections that should be disabled for internal linking. Overrides the `enableRichTextLink` property in the collection config. + * When this property is set, `enabledCollections` will not be available. + **/ + disabledCollections?: string[] + + // Ensures that enabledCollections is not available when disabledCollections is set + enabledCollections?: never + } + | { + // Ensures that disabledCollections is not available when enabledCollections is set + disabledCollections?: never + + /** + * The collections that should be enabled for internal linking. Overrides the `enableRichTextLink` property in the collection config + * When this property is set, `disabledCollections` will not be available. + **/ + enabledCollections?: string[] + } + +export type LinkFeatureProps = ExclusiveLinkCollectionsProps & { + /** + * A function or array defining additional fields for the link feature. These will be + * displayed in the link editor drawer. + */ fields?: | ((args: { config: SanitizedConfig; defaultFields: Field[]; i18n: i18n }) => Field[]) | Field[] } + export const LinkFeature = (props: LinkFeatureProps): FeatureProvider => { return { feature: () => { diff --git a/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/LinkEditor/index.tsx b/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/LinkEditor/index.tsx index a33674c6e2e..4331c233d83 100644 --- a/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/LinkEditor/index.tsx +++ b/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/LinkEditor/index.tsx @@ -40,6 +40,8 @@ import { TOGGLE_LINK_WITH_MODAL_COMMAND } from './commands' export function LinkEditor({ anchorElem, + disabledCollections, + enabledCollections, fields: customFieldSchema, }: { anchorElem: HTMLElement } & LinkFeatureProps): JSX.Element { const [editor] = useLexicalComposerContext() @@ -61,7 +63,13 @@ export function LinkEditor({ const [initialState, setInitialState] = useState<Fields>({}) const [fieldSchema] = useState(() => { - const fieldsUnsanitized = transformExtraFields(customFieldSchema, config, i18n) + const fieldsUnsanitized = transformExtraFields( + customFieldSchema, + config, + i18n, + enabledCollections, + disabledCollections, + ) // Sanitize custom fields here const validRelationships = config.collections.map((c) => c.slug) || [] const fields = sanitizeFields({ diff --git a/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/index.tsx b/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/index.tsx index 34aa07a7aff..7e39b50cd93 100644 --- a/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/index.tsx +++ b/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/index.tsx @@ -9,8 +9,10 @@ import './index.scss' export const FloatingLinkEditorPlugin: React.FC< { - anchorElem?: HTMLElement + anchorElem: HTMLElement } & LinkFeatureProps -> = ({ anchorElem = document.body, fields = [] }) => { - return createPortal(<LinkEditor anchorElem={anchorElem} fields={fields} />, anchorElem) +> = (props) => { + const { anchorElem = document.body } = props + + return createPortal(<LinkEditor {...props} anchorElem={anchorElem} />, anchorElem) } diff --git a/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/utilities.ts b/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/utilities.ts index e3cc51c578d..881654f364c 100644 --- a/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/utilities.ts +++ b/packages/richtext-lexical/src/field/features/Link/plugins/floatingLinkEditor/utilities.ts @@ -13,8 +13,10 @@ export function transformExtraFields( | Field[], config: SanitizedConfig, i18n: i18n, + enabledCollections?: false | string[], + disabledCollections?: false | string[], ): Field[] { - const baseFields: Field[] = getBaseFields(config) + const baseFields: Field[] = getBaseFields(config, enabledCollections, disabledCollections) const fields = typeof customFieldSchema === 'function' diff --git a/packages/richtext-lexical/src/field/features/Relationship/drawer/index.tsx b/packages/richtext-lexical/src/field/features/Relationship/drawer/index.tsx index ed97a71fa1e..1fcabae00f9 100644 --- a/packages/richtext-lexical/src/field/features/Relationship/drawer/index.tsx +++ b/packages/richtext-lexical/src/field/features/Relationship/drawer/index.tsx @@ -9,8 +9,6 @@ import { INSERT_RELATIONSHIP_COMMAND } from '../plugins' import { EnabledRelationshipsCondition } from '../utils/EnabledRelationshipsCondition' import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './commands' -const baseClass = 'lexical-relationship-drawer' - const insertRelationship = ({ id, editor, @@ -40,7 +38,7 @@ const insertRelationship = ({ } type Props = { - enabledCollectionSlugs: string[] + enabledCollectionSlugs: null | string[] } const RelationshipDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs }) => { @@ -92,7 +90,9 @@ const RelationshipDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs } } export const RelationshipDrawer = (props: Props): React.ReactNode => { - return ( + return props?.enabledCollectionSlugs?.length > 0 ? ( // If enabledCollectionSlugs it overrides what EnabledRelationshipsCondition is doing + <RelationshipDrawerComponent {...props} /> + ) : ( <EnabledRelationshipsCondition {...props}> <RelationshipDrawerComponent {...props} /> </EnabledRelationshipsCondition> diff --git a/packages/richtext-lexical/src/field/features/Relationship/index.ts b/packages/richtext-lexical/src/field/features/Relationship/index.ts index 0f7376e0243..4e9c83fa8ff 100644 --- a/packages/richtext-lexical/src/field/features/Relationship/index.ts +++ b/packages/richtext-lexical/src/field/features/Relationship/index.ts @@ -5,7 +5,29 @@ import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands' import { RelationshipNode } from './nodes/RelationshipNode' import { relationshipPopulationPromise } from './populationPromise' -export const RelationshipFeature = (): FeatureProvider => { +export type RelationshipFeatureProps = + | { + /** + * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config. + * When this property is set, `enabledCollections` will not be available. + **/ + disabledCollections?: string[] + + // Ensures that enabledCollections is not available when disabledCollections is set + enabledCollections?: never + } + | { + // Ensures that disabledCollections is not available when enabledCollections is set + disabledCollections?: never + + /** + * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config + * When this property is set, `disabledCollections` will not be available. + **/ + enabledCollections?: string[] + } + +export const RelationshipFeature = (props?: RelationshipFeatureProps): FeatureProvider => { return { feature: () => { return { @@ -21,11 +43,19 @@ export const RelationshipFeature = (): FeatureProvider => { { Component: () => // @ts-expect-error - import('./plugins').then((module) => module.RelationshipPlugin), + import('./plugins').then((module) => { + const RelationshipPlugin = module.RelationshipPlugin + return import('payload/utilities').then((module2) => + module2.withMergedProps({ + Component: RelationshipPlugin, + toMergeIntoProps: props, + }), + ) + }), position: 'normal', }, ], - props: null, + props: props, slashMenu: { options: [ { diff --git a/packages/richtext-lexical/src/field/features/Relationship/nodes/components/RelationshipComponent.tsx b/packages/richtext-lexical/src/field/features/Relationship/nodes/components/RelationshipComponent.tsx index c99d85742b6..13261b9fe17 100644 --- a/packages/richtext-lexical/src/field/features/Relationship/nodes/components/RelationshipComponent.tsx +++ b/packages/richtext-lexical/src/field/features/Relationship/nodes/components/RelationshipComponent.tsx @@ -14,7 +14,6 @@ import type { RelationshipData } from '../RelationshipNode' import { useEditorConfigContext } from '../../../../lexical/config/EditorConfigProvider' import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../../drawer/commands' -import { EnabledRelationshipsCondition } from '../../utils/EnabledRelationshipsCondition' import './index.scss' const baseClass = 'lexical-relationship' @@ -140,9 +139,5 @@ const Component: React.FC<Props> = (props) => { } export const RelationshipComponent = (props: Props): React.ReactNode => { - return ( - <EnabledRelationshipsCondition {...props}> - <Component {...props} /> - </EnabledRelationshipsCondition> - ) + return <Component {...props} /> } diff --git a/packages/richtext-lexical/src/field/features/Relationship/plugins/index.tsx b/packages/richtext-lexical/src/field/features/Relationship/plugins/index.tsx index b816de82869..7f4b02cf15d 100644 --- a/packages/richtext-lexical/src/field/features/Relationship/plugins/index.tsx +++ b/packages/richtext-lexical/src/field/features/Relationship/plugins/index.tsx @@ -6,6 +6,7 @@ import { useConfig } from 'payload/components/utilities' import { useEffect } from 'react' import React from 'react' +import type { RelationshipFeatureProps } from '../index' import type { RelationshipData } from '../nodes/RelationshipNode' import { RelationshipDrawer } from '../drawer' @@ -15,10 +16,20 @@ export const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = cre 'INSERT_RELATIONSHIP_COMMAND', ) -export function RelationshipPlugin(): JSX.Element | null { +export function RelationshipPlugin(props?: RelationshipFeatureProps): JSX.Element | null { const [editor] = useLexicalComposerContext() const { collections } = useConfig() + let enabledRelations: string[] = null + + if (props?.enabledCollections) { + enabledRelations = props?.enabledCollections + } else if (props?.disabledCollections) { + enabledRelations = collections + .filter(({ slug }) => !(props?.disabledCollections).includes(slug)) + .map(({ slug }) => slug) + } + useEffect(() => { if (!editor.hasNodes([RelationshipNode])) { throw new Error('RelationshipPlugin: RelationshipNode not registered on editor') @@ -36,5 +47,5 @@ export function RelationshipPlugin(): JSX.Element | null { ) }, [editor]) - return <RelationshipDrawer enabledCollectionSlugs={collections.map(({ slug }) => slug)} /> + return <RelationshipDrawer enabledCollectionSlugs={enabledRelations} /> }
c74e41fc76090a7b54646fc3b0179bbb4ab9693c
2024-04-07 23:23:49
Elliot DeNolf
chore(release): v3.0.0-alpha.56 [skip ci]
false
v3.0.0-alpha.56 [skip ci]
chore
diff --git a/package.json b/package.json index 25304146d77..9869f20e5ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "payload-monorepo", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "private": true, "type": "module", "workspaces:": [ diff --git a/packages/db-mongodb/package.json b/packages/db-mongodb/package.json index df9c2ca2cf1..25712d971a2 100644 --- a/packages/db-mongodb/package.json +++ b/packages/db-mongodb/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/db-mongodb", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "description": "The officially supported MongoDB database adapter for Payload", "repository": { "type": "git", diff --git a/packages/db-postgres/package.json b/packages/db-postgres/package.json index 011729e3f6f..63dc303aeaa 100644 --- a/packages/db-postgres/package.json +++ b/packages/db-postgres/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/db-postgres", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "description": "The officially supported Postgres database adapter for Payload", "repository": { "type": "git", diff --git a/packages/graphql/package.json b/packages/graphql/package.json index a9ae07beaed..d20bf5d6cd7 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/graphql", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "main": "./src/index.ts", "types": "./src/index.d.ts", "type": "module", diff --git a/packages/next/package.json b/packages/next/package.json index dceaa98526f..9fa9ac5353e 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/next", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "main": "./src/index.js", "types": "./src/index.js", "type": "module", diff --git a/packages/payload/package.json b/packages/payload/package.json index 823b902b42d..21f15218195 100644 --- a/packages/payload/package.json +++ b/packages/payload/package.json @@ -1,6 +1,6 @@ { "name": "payload", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "description": "Node, React and MongoDB Headless CMS and Application Framework", "license": "MIT", "main": "./src/index.ts", diff --git a/packages/plugin-cloud-storage/package.json b/packages/plugin-cloud-storage/package.json index a9b126cbecf..9c15956f438 100644 --- a/packages/plugin-cloud-storage/package.json +++ b/packages/plugin-cloud-storage/package.json @@ -1,7 +1,7 @@ { "name": "@payloadcms/plugin-cloud-storage", "description": "The official cloud storage plugin for Payload CMS", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "main": "./src/index.ts", "types": "./src/index.ts", "type": "module", diff --git a/packages/plugin-cloud/package.json b/packages/plugin-cloud/package.json index 323cb72d066..28a9a29e0e6 100644 --- a/packages/plugin-cloud/package.json +++ b/packages/plugin-cloud/package.json @@ -1,7 +1,7 @@ { "name": "@payloadcms/plugin-cloud", "description": "The official Payload Cloud plugin", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "main": "./src/index.ts", "types": "./src/index.ts", "license": "MIT", diff --git a/packages/plugin-form-builder/package.json b/packages/plugin-form-builder/package.json index 4b23c4cb036..87ee9c7ad68 100644 --- a/packages/plugin-form-builder/package.json +++ b/packages/plugin-form-builder/package.json @@ -1,7 +1,7 @@ { "name": "@payloadcms/plugin-form-builder", "description": "Form builder plugin for Payload CMS", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "homepage:": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/plugin-nested-docs/package.json b/packages/plugin-nested-docs/package.json index 70fa7a77a8e..bf5cdc4b754 100644 --- a/packages/plugin-nested-docs/package.json +++ b/packages/plugin-nested-docs/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-nested-docs", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "description": "The official Nested Docs plugin for Payload", "repository": { "type": "git", diff --git a/packages/plugin-redirects/package.json b/packages/plugin-redirects/package.json index 72517954b1a..c4b074a4d3d 100644 --- a/packages/plugin-redirects/package.json +++ b/packages/plugin-redirects/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-redirects", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "homepage:": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/plugin-search/package.json b/packages/plugin-search/package.json index a08ed0306dd..08b1dc49545 100644 --- a/packages/plugin-search/package.json +++ b/packages/plugin-search/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-search", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "homepage:": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/plugin-seo/package.json b/packages/plugin-seo/package.json index 458f9e47f9e..e1c58d684fa 100644 --- a/packages/plugin-seo/package.json +++ b/packages/plugin-seo/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-seo", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "homepage:": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/richtext-lexical/package.json b/packages/richtext-lexical/package.json index 0606e6d1cb8..e70be894bff 100644 --- a/packages/richtext-lexical/package.json +++ b/packages/richtext-lexical/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/richtext-lexical", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "description": "The officially supported Lexical richtext adapter for Payload", "repository": { "type": "git", diff --git a/packages/richtext-slate/package.json b/packages/richtext-slate/package.json index b1c17d87639..89567a64ca7 100644 --- a/packages/richtext-slate/package.json +++ b/packages/richtext-slate/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/richtext-slate", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "description": "The officially supported Slate richtext adapter for Payload", "repository": { "type": "git", diff --git a/packages/ui/package.json b/packages/ui/package.json index 2b14f11b7b6..df697aa208a 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/ui", - "version": "3.0.0-alpha.55", + "version": "3.0.0-alpha.56", "type": "module", "homepage": "https://payloadcms.com", "repository": {
1ceea645b6ff380b21b8bfca738e0fc27324e6c8
2023-05-18 02:05:55
Jacob Fletcher
chore: replaces instances of the text Mongo with MongoDB
false
replaces instances of the text Mongo with MongoDB
chore
diff --git a/.gitignore b/.gitignore index e57314eb505..7de28afdba7 100644 --- a/.gitignore +++ b/.gitignore @@ -164,7 +164,7 @@ GitHub.sublime-settings # CMake cmake-build-debug/ -# Mongo Explorer plugin: +# MongoDB Explorer plugin: .idea/**/mongoSettings.xml ## File-based project format: diff --git a/CHANGELOG.md b/CHANGELOG.md index a6ff9391c45..8d9b845959b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -589,7 +589,7 @@ If not already defined, add the following to your `compilerOptions`: #### ✋ Versions may need to be migrated -This release includes a substantial simplification / optimization of how Versions work within Payload. They are now significantly more performant and easier to understand behind-the-scenes. We've removed ~600 lines of code and have ensured that Payload can be compatible with all flavors of Mongo - including versions earlier than 4.0, Azure Cosmos MongoDB, AWS' DocumentDB and more. +This release includes a substantial simplification / optimization of how Versions work within Payload. They are now significantly more performant and easier to understand behind-the-scenes. We've removed ~600 lines of code and have ensured that Payload can be compatible with all flavors of MongoDB - including versions earlier than 4.0, Azure Cosmos MongoDB, AWS' DocumentDB and more. But, some of your draft-enabled documents may need to be migrated. diff --git a/docs/email/overview.mdx b/docs/email/overview.mdx index 420323919a7..b973ff56c5d 100644 --- a/docs/email/overview.mdx +++ b/docs/email/overview.mdx @@ -143,7 +143,7 @@ payload.init({ [06:37:21] INFO (payload): Starting Payload... [06:37:22] INFO (payload): Payload Demo Initialized [06:37:22] INFO (payload): listening on 3000... -[06:37:22] INFO (payload): Connected to Mongo server successfully! +[06:37:22] INFO (payload): Connected to MongoDB server successfully! [06:37:23] INFO (payload): E-mail configured with mock configuration [06:37:23] INFO (payload): Log into mock email provider at https://ethereal.email [06:37:23] INFO (payload): Mock email account username: [email protected] diff --git a/docs/fields/relationship.mdx b/docs/fields/relationship.mdx index 702a9abc88c..f42f8489351 100644 --- a/docs/fields/relationship.mdx +++ b/docs/fields/relationship.mdx @@ -146,7 +146,7 @@ The shape of the data to save for a document with the field configured this way ```json { - // Mongo ObjectID of the related user + // MongoDB ObjectID of the related user "owner": "6031ac9e1289176380734024" } ``` diff --git a/docs/getting-started/installation.mdx b/docs/getting-started/installation.mdx index 5b24ae11c6f..697837744ef 100644 --- a/docs/getting-started/installation.mdx +++ b/docs/getting-started/installation.mdx @@ -12,7 +12,7 @@ Payload requires the following software: - Yarn or NPM - Node.js version 14+ -- A Mongo Database +- A MongoDB Database <Banner type="warning"> Before proceeding any further, please ensure that you have the above @@ -110,15 +110,15 @@ Payload uses this secret key to generate secure user tokens (JWT). Behind the sc ##### `mongoURL` -**Required**. This is a fully qualified MongoDB connection string that points to your Mongo database. If you don't have Mongo installed locally, you can [follow these steps for Mac OSX](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/) and [these steps](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/) for Windows 10. If you want to use a local database and you know you have MongoDB installed locally, a typical connection string will look like this: +**Required**. This is a fully qualified MongoDB connection string that points to your MongoDB database. If you don't have MongoDB installed locally, you can [follow these steps for Mac OSX](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/) and [these steps](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/) for Windows 10. If you want to use a local database and you know you have MongoDB installed locally, a typical connection string will look like this: `mongodb://localhost/payload` -In contrast to running Mongo locally, a popular option is to sign up for a free [MongoDB Atlas account](https://www.mongodb.com/cloud/atlas), which is a fully hosted and cloud-based installation of Mongo that you don't need to ever worry about. +In contrast to running MongoDB locally, a popular option is to sign up for a free [MongoDB Atlas account](https://www.mongodb.com/cloud/atlas), which is a fully hosted and cloud-based installation of MongoDB that you don't need to ever worry about. ##### `mongoOptions` -Customize Mongo connection options. Payload will connect to your MongoDB database using default options which you can override and extend to include all the [options](https://mongoosejs.com/docs/connections.html#options) available to mongoose. +Customize MongoDB connection options. Payload will connect to your MongoDB database using default options which you can override and extend to include all the [options](https://mongoosejs.com/docs/connections.html#options) available to mongoose. ##### `email` diff --git a/docs/getting-started/what-is-payload.mdx b/docs/getting-started/what-is-payload.mdx index 15eb2e986b1..a6fe0d787f6 100644 --- a/docs/getting-started/what-is-payload.mdx +++ b/docs/getting-started/what-is-payload.mdx @@ -19,7 +19,7 @@ keywords: documentation, getting started, guide, Content Management System, cms, Out of the box, Payload gives you a lot of the things that you often need when developing a new website, web app, or native app: -- A Mongo database to store your data +- A MongoDB database to store your data - A way to store, retrieve, and manipulate data of any shape via full REST and GraphQL APIs - Authentication—complete with commonly required functionality like registration, email verification, login, & password reset - Deep access control to your data, based on document or field-level functions diff --git a/src/config/types.ts b/src/config/types.ts index 9b1a83bb141..0720666988c 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -79,9 +79,9 @@ export type GraphQLExtension = ( export type InitOptions = { /** Express app for Payload to use */ express?: Express; - /** Mongo connection URL, starts with `mongo` */ + /** MongoDB connection URL, starts with `mongo` */ mongoURL: string | false; - /** Extra configuration options that will be passed to Mongo */ + /** Extra configuration options that will be passed to MongoDB */ mongoOptions?: ConnectOptions & { /** Set false to disable $facet aggregation in non-supporting databases, Defaults to true */ useFacet?: boolean @@ -124,7 +124,7 @@ export type InitOptions = { * and then sent to the client allowing the dashboard to show accessible data and actions. * * If the result is `true`, the user has access. - * If the result is an object, it is interpreted as a Mongo query. + * If the result is an object, it is interpreted as a MongoDB query. * * @example `{ createdBy: { equals: id } }` * diff --git a/src/express/types.ts b/src/express/types.ts index 0f42f44f1ab..41f15177b56 100644 --- a/src/express/types.ts +++ b/src/express/types.ts @@ -22,7 +22,7 @@ export declare type PayloadRequest<U = any> = Request & { fallbackLocale?: string; /** Information about the collection that is being accessed * - Configuration from payload-config.ts - * - Mongo model for this collection + * - MongoDB model for this collection * - GraphQL type metadata * */ collection?: Collection; diff --git a/src/graphql/schema/buildWhereInputType.ts b/src/graphql/schema/buildWhereInputType.ts index 79f914fc861..5d53dabcb2b 100644 --- a/src/graphql/schema/buildWhereInputType.ts +++ b/src/graphql/schema/buildWhereInputType.ts @@ -23,7 +23,7 @@ import fieldToSchemaMap from './fieldToWhereInputSchemaMap'; // 1. Everything needs to be a GraphQLInputObjectType or scalar / enum // 2. Relationships, groups, repeaters and flex content are not // directly searchable. Instead, we need to build a chained pathname -// using dot notation so Mongo can properly search nested paths. +// using dot notation so MongoDB can properly search nested paths. const buildWhereInputType = (name: string, fields: Field[], parentName: string): GraphQLInputObjectType => { // This is the function that builds nested paths for all // field types with nested paths. diff --git a/src/mongoose/connect.ts b/src/mongoose/connect.ts index c345d497598..eab1477cb99 100644 --- a/src/mongoose/connect.ts +++ b/src/mongoose/connect.ts @@ -11,7 +11,7 @@ const connectMongoose = async ( logger: pino.Logger, ): Promise<void | any> => { let urlToConnect = url; - let successfulConnectionMessage = 'Connected to Mongo server successfully!'; + let successfulConnectionMessage = 'Connected to MongoDB server successfully!'; const connectionOptions: ConnectOptions & { useFacet: undefined } = { autoIndex: true, @@ -35,7 +35,7 @@ const connectMongoose = async ( }); urlToConnect = mongoMemoryServer.getUri(); - successfulConnectionMessage = 'Connected to in-memory Mongo server successfully!'; + successfulConnectionMessage = 'Connected to in-memory MongoDB server successfully!'; } try {
62a2341ab4556ac9ef134d8d8374770aa9a07c90
2024-03-07 03:12:55
James
chore: builds translations without swc
false
builds translations without swc
chore
diff --git a/packages/translations/package.json b/packages/translations/package.json index 6e9b546325a..3d17707a01e 100644 --- a/packages/translations/package.json +++ b/packages/translations/package.json @@ -5,9 +5,8 @@ "types": "./dist/types.d.ts", "type": "module", "scripts": { - "build:swc": "swc ./src -d ./dist --config-file --copy-files .swcrc", - "build:types": "tsc --emitDeclarationOnly --outDir dist", - "build": "pnpm writeFiles && pnpm build:swc && pnpm build:types", + "build:types": "tsc --outDir dist", + "build": "pnpm writeFiles && pnpm build:types", "clean": "rimraf {dist,*.tsbuildinfo}", "writeFiles": "npx tsx ./writeTranslationFiles.ts", "prepublishOnly": "pnpm clean && pnpm turbo build" diff --git a/packages/translations/src/_generatedFiles_/api/index.ts b/packages/translations/src/_generatedFiles_/api/index.ts index fb2376ff6ee..7ab7ae98b26 100644 --- a/packages/translations/src/_generatedFiles_/api/index.ts +++ b/packages/translations/src/_generatedFiles_/api/index.ts @@ -1,33 +1,33 @@ -const { default: ar } = await import('./ar.json', { assert: { type: 'json' } }) -const { default: az } = await import('./az.json', { assert: { type: 'json' } }) -const { default: bg } = await import('./bg.json', { assert: { type: 'json' } }) -const { default: cs } = await import('./cs.json', { assert: { type: 'json' } }) -const { default: de } = await import('./de.json', { assert: { type: 'json' } }) -const { default: en } = await import('./en.json', { assert: { type: 'json' } }) -const { default: es } = await import('./es.json', { assert: { type: 'json' } }) -const { default: fa } = await import('./fa.json', { assert: { type: 'json' } }) -const { default: fr } = await import('./fr.json', { assert: { type: 'json' } }) -const { default: hr } = await import('./hr.json', { assert: { type: 'json' } }) -const { default: hu } = await import('./hu.json', { assert: { type: 'json' } }) -const { default: it } = await import('./it.json', { assert: { type: 'json' } }) -const { default: ja } = await import('./ja.json', { assert: { type: 'json' } }) -const { default: ko } = await import('./ko.json', { assert: { type: 'json' } }) -const { default: my } = await import('./my.json', { assert: { type: 'json' } }) -const { default: nb } = await import('./nb.json', { assert: { type: 'json' } }) -const { default: nl } = await import('./nl.json', { assert: { type: 'json' } }) -const { default: pl } = await import('./pl.json', { assert: { type: 'json' } }) -const { default: pt } = await import('./pt.json', { assert: { type: 'json' } }) -const { default: ro } = await import('./ro.json', { assert: { type: 'json' } }) -const { default: rs } = await import('./rs.json', { assert: { type: 'json' } }) -const { default: rsLatin } = await import('./rs-latin.json', { assert: { type: 'json' } }) -const { default: ru } = await import('./ru.json', { assert: { type: 'json' } }) -const { default: sv } = await import('./sv.json', { assert: { type: 'json' } }) -const { default: th } = await import('./th.json', { assert: { type: 'json' } }) -const { default: tr } = await import('./tr.json', { assert: { type: 'json' } }) -const { default: ua } = await import('./ua.json', { assert: { type: 'json' } }) -const { default: vi } = await import('./vi.json', { assert: { type: 'json' } }) -const { default: zh } = await import('./zh.json', { assert: { type: 'json' } }) -const { default: zhTw } = await import('./zh-tw.json', { assert: { type: 'json' } }) +import ar from './ar.json' assert { type: 'json' } +import az from './az.json' assert { type: 'json' } +import bg from './bg.json' assert { type: 'json' } +import cs from './cs.json' assert { type: 'json' } +import de from './de.json' assert { type: 'json' } +import en from './en.json' assert { type: 'json' } +import es from './es.json' assert { type: 'json' } +import fa from './fa.json' assert { type: 'json' } +import fr from './fr.json' assert { type: 'json' } +import hr from './hr.json' assert { type: 'json' } +import hu from './hu.json' assert { type: 'json' } +import it from './it.json' assert { type: 'json' } +import ja from './ja.json' assert { type: 'json' } +import ko from './ko.json' assert { type: 'json' } +import my from './my.json' assert { type: 'json' } +import nb from './nb.json' assert { type: 'json' } +import nl from './nl.json' assert { type: 'json' } +import pl from './pl.json' assert { type: 'json' } +import pt from './pt.json' assert { type: 'json' } +import ro from './ro.json' assert { type: 'json' } +import rs from './rs.json' assert { type: 'json' } +import rsLatin from './rs-latin.json' assert { type: 'json' } +import ru from './ru.json' assert { type: 'json' } +import sv from './sv.json' assert { type: 'json' } +import th from './th.json' assert { type: 'json' } +import tr from './tr.json' assert { type: 'json' } +import ua from './ua.json' assert { type: 'json' } +import vi from './vi.json' assert { type: 'json' } +import zh from './zh.json' assert { type: 'json' } +import zhTw from './zh-tw.json' assert { type: 'json' } export const translations = { ar, diff --git a/packages/translations/src/_generatedFiles_/client/index.ts b/packages/translations/src/_generatedFiles_/client/index.ts index fb2376ff6ee..7ab7ae98b26 100644 --- a/packages/translations/src/_generatedFiles_/client/index.ts +++ b/packages/translations/src/_generatedFiles_/client/index.ts @@ -1,33 +1,33 @@ -const { default: ar } = await import('./ar.json', { assert: { type: 'json' } }) -const { default: az } = await import('./az.json', { assert: { type: 'json' } }) -const { default: bg } = await import('./bg.json', { assert: { type: 'json' } }) -const { default: cs } = await import('./cs.json', { assert: { type: 'json' } }) -const { default: de } = await import('./de.json', { assert: { type: 'json' } }) -const { default: en } = await import('./en.json', { assert: { type: 'json' } }) -const { default: es } = await import('./es.json', { assert: { type: 'json' } }) -const { default: fa } = await import('./fa.json', { assert: { type: 'json' } }) -const { default: fr } = await import('./fr.json', { assert: { type: 'json' } }) -const { default: hr } = await import('./hr.json', { assert: { type: 'json' } }) -const { default: hu } = await import('./hu.json', { assert: { type: 'json' } }) -const { default: it } = await import('./it.json', { assert: { type: 'json' } }) -const { default: ja } = await import('./ja.json', { assert: { type: 'json' } }) -const { default: ko } = await import('./ko.json', { assert: { type: 'json' } }) -const { default: my } = await import('./my.json', { assert: { type: 'json' } }) -const { default: nb } = await import('./nb.json', { assert: { type: 'json' } }) -const { default: nl } = await import('./nl.json', { assert: { type: 'json' } }) -const { default: pl } = await import('./pl.json', { assert: { type: 'json' } }) -const { default: pt } = await import('./pt.json', { assert: { type: 'json' } }) -const { default: ro } = await import('./ro.json', { assert: { type: 'json' } }) -const { default: rs } = await import('./rs.json', { assert: { type: 'json' } }) -const { default: rsLatin } = await import('./rs-latin.json', { assert: { type: 'json' } }) -const { default: ru } = await import('./ru.json', { assert: { type: 'json' } }) -const { default: sv } = await import('./sv.json', { assert: { type: 'json' } }) -const { default: th } = await import('./th.json', { assert: { type: 'json' } }) -const { default: tr } = await import('./tr.json', { assert: { type: 'json' } }) -const { default: ua } = await import('./ua.json', { assert: { type: 'json' } }) -const { default: vi } = await import('./vi.json', { assert: { type: 'json' } }) -const { default: zh } = await import('./zh.json', { assert: { type: 'json' } }) -const { default: zhTw } = await import('./zh-tw.json', { assert: { type: 'json' } }) +import ar from './ar.json' assert { type: 'json' } +import az from './az.json' assert { type: 'json' } +import bg from './bg.json' assert { type: 'json' } +import cs from './cs.json' assert { type: 'json' } +import de from './de.json' assert { type: 'json' } +import en from './en.json' assert { type: 'json' } +import es from './es.json' assert { type: 'json' } +import fa from './fa.json' assert { type: 'json' } +import fr from './fr.json' assert { type: 'json' } +import hr from './hr.json' assert { type: 'json' } +import hu from './hu.json' assert { type: 'json' } +import it from './it.json' assert { type: 'json' } +import ja from './ja.json' assert { type: 'json' } +import ko from './ko.json' assert { type: 'json' } +import my from './my.json' assert { type: 'json' } +import nb from './nb.json' assert { type: 'json' } +import nl from './nl.json' assert { type: 'json' } +import pl from './pl.json' assert { type: 'json' } +import pt from './pt.json' assert { type: 'json' } +import ro from './ro.json' assert { type: 'json' } +import rs from './rs.json' assert { type: 'json' } +import rsLatin from './rs-latin.json' assert { type: 'json' } +import ru from './ru.json' assert { type: 'json' } +import sv from './sv.json' assert { type: 'json' } +import th from './th.json' assert { type: 'json' } +import tr from './tr.json' assert { type: 'json' } +import ua from './ua.json' assert { type: 'json' } +import vi from './vi.json' assert { type: 'json' } +import zh from './zh.json' assert { type: 'json' } +import zhTw from './zh-tw.json' assert { type: 'json' } export const translations = { ar, diff --git a/packages/translations/src/all/index.ts b/packages/translations/src/all/index.ts index fb2376ff6ee..7ab7ae98b26 100644 --- a/packages/translations/src/all/index.ts +++ b/packages/translations/src/all/index.ts @@ -1,33 +1,33 @@ -const { default: ar } = await import('./ar.json', { assert: { type: 'json' } }) -const { default: az } = await import('./az.json', { assert: { type: 'json' } }) -const { default: bg } = await import('./bg.json', { assert: { type: 'json' } }) -const { default: cs } = await import('./cs.json', { assert: { type: 'json' } }) -const { default: de } = await import('./de.json', { assert: { type: 'json' } }) -const { default: en } = await import('./en.json', { assert: { type: 'json' } }) -const { default: es } = await import('./es.json', { assert: { type: 'json' } }) -const { default: fa } = await import('./fa.json', { assert: { type: 'json' } }) -const { default: fr } = await import('./fr.json', { assert: { type: 'json' } }) -const { default: hr } = await import('./hr.json', { assert: { type: 'json' } }) -const { default: hu } = await import('./hu.json', { assert: { type: 'json' } }) -const { default: it } = await import('./it.json', { assert: { type: 'json' } }) -const { default: ja } = await import('./ja.json', { assert: { type: 'json' } }) -const { default: ko } = await import('./ko.json', { assert: { type: 'json' } }) -const { default: my } = await import('./my.json', { assert: { type: 'json' } }) -const { default: nb } = await import('./nb.json', { assert: { type: 'json' } }) -const { default: nl } = await import('./nl.json', { assert: { type: 'json' } }) -const { default: pl } = await import('./pl.json', { assert: { type: 'json' } }) -const { default: pt } = await import('./pt.json', { assert: { type: 'json' } }) -const { default: ro } = await import('./ro.json', { assert: { type: 'json' } }) -const { default: rs } = await import('./rs.json', { assert: { type: 'json' } }) -const { default: rsLatin } = await import('./rs-latin.json', { assert: { type: 'json' } }) -const { default: ru } = await import('./ru.json', { assert: { type: 'json' } }) -const { default: sv } = await import('./sv.json', { assert: { type: 'json' } }) -const { default: th } = await import('./th.json', { assert: { type: 'json' } }) -const { default: tr } = await import('./tr.json', { assert: { type: 'json' } }) -const { default: ua } = await import('./ua.json', { assert: { type: 'json' } }) -const { default: vi } = await import('./vi.json', { assert: { type: 'json' } }) -const { default: zh } = await import('./zh.json', { assert: { type: 'json' } }) -const { default: zhTw } = await import('./zh-tw.json', { assert: { type: 'json' } }) +import ar from './ar.json' assert { type: 'json' } +import az from './az.json' assert { type: 'json' } +import bg from './bg.json' assert { type: 'json' } +import cs from './cs.json' assert { type: 'json' } +import de from './de.json' assert { type: 'json' } +import en from './en.json' assert { type: 'json' } +import es from './es.json' assert { type: 'json' } +import fa from './fa.json' assert { type: 'json' } +import fr from './fr.json' assert { type: 'json' } +import hr from './hr.json' assert { type: 'json' } +import hu from './hu.json' assert { type: 'json' } +import it from './it.json' assert { type: 'json' } +import ja from './ja.json' assert { type: 'json' } +import ko from './ko.json' assert { type: 'json' } +import my from './my.json' assert { type: 'json' } +import nb from './nb.json' assert { type: 'json' } +import nl from './nl.json' assert { type: 'json' } +import pl from './pl.json' assert { type: 'json' } +import pt from './pt.json' assert { type: 'json' } +import ro from './ro.json' assert { type: 'json' } +import rs from './rs.json' assert { type: 'json' } +import rsLatin from './rs-latin.json' assert { type: 'json' } +import ru from './ru.json' assert { type: 'json' } +import sv from './sv.json' assert { type: 'json' } +import th from './th.json' assert { type: 'json' } +import tr from './tr.json' assert { type: 'json' } +import ua from './ua.json' assert { type: 'json' } +import vi from './vi.json' assert { type: 'json' } +import zh from './zh.json' assert { type: 'json' } +import zhTw from './zh-tw.json' assert { type: 'json' } export const translations = { ar, diff --git a/packages/translations/tsconfig.json b/packages/translations/tsconfig.json index 622a742ee69..263ef414b9c 100644 --- a/packages/translations/tsconfig.json +++ b/packages/translations/tsconfig.json @@ -8,7 +8,7 @@ "rootDir": "./src", "lib": ["dom", "dom.iterable", "esnext"], "noEmit": false /* Do not emit outputs. */, - "emitDeclarationOnly": true + "emitDeclarationOnly": false }, "include": ["src/**/*.ts", "src/**/*.json"], "exclude": ["src/all"]
2ef8a1e35a9ecd67d7d809fb446f3549a347a930
2022-07-17 22:33:22
James
fix: ensures point field doesn't interrupt version creation
false
ensures point field doesn't interrupt version creation
fix
diff --git a/src/admin/components/views/Version/Version.tsx b/src/admin/components/views/Version/Version.tsx index 7b8defcd30b..0225213ae74 100644 --- a/src/admin/components/views/Version/Version.tsx +++ b/src/admin/components/views/Version/Version.tsx @@ -210,7 +210,7 @@ const VersionView: React.FC<Props> = ({ collection, global }) => { )} {doc?.version && ( <RenderFieldsToDiff - locales={locales.map(({ value }) => value)} + locales={locales ? locales.map(({ value }) => value) : []} fields={fields} fieldComponents={fieldComponents} fieldPermissions={fieldPermissions} diff --git a/src/mongoose/buildSchema.ts b/src/mongoose/buildSchema.ts index 4e2058f9c33..2d4e6ad9a47 100644 --- a/src/mongoose/buildSchema.ts +++ b/src/mongoose/buildSchema.ts @@ -196,7 +196,7 @@ const fieldToSchemaMap = { type: [Number], sparse: field.unique && field.localized, unique: field.unique || false, - required: (field.required && !field.localized && !field?.admin?.condition && !field?.access?.create) || false, + required: false, default: field.defaultValue || undefined, }, }; diff --git a/test/fields/collections/Point/index.ts b/test/fields/collections/Point/index.ts index 0087e4dec8e..d6b3787c724 100644 --- a/test/fields/collections/Point/index.ts +++ b/test/fields/collections/Point/index.ts @@ -5,6 +5,7 @@ const PointFields: CollectionConfig = { admin: { useAsTitle: 'point', }, + versions: true, fields: [ { name: 'point',
8f98eff0d7084b0b2d3731c33422e13a40a4278d
2023-10-09 03:43:29
dependabot[bot]
chore(deps): bump graphql from 16.8.0 to 16.8.1 in /examples/testing (#3479)
false
bump graphql from 16.8.0 to 16.8.1 in /examples/testing (#3479)
chore
diff --git a/examples/testing/yarn.lock b/examples/testing/yarn.lock index 6b5e3cabd6e..4ebeefbbb40 100644 --- a/examples/testing/yarn.lock +++ b/examples/testing/yarn.lock @@ -4341,9 +4341,9 @@ graphql-type-json@^0.3.2: integrity sha512-J+vjof74oMlCWXSvt0DOf2APEdZOCdubEvGDUAlqH//VBYcOYsGgRW7Xzorr44LvkjiuvecWc8fChxuZZbChtg== graphql@^16.6.0: - version "16.8.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.0.tgz#374478b7f27b2dc6153c8f42c1b80157f79d79d4" - integrity sha512-0oKGaR+y3qcS5mCu1vb7KG+a89vjn06C7Ihq/dDl3jA+A8B3TKomvi3CiEcVLJQGalbu8F52LxkOym7U5sSfbg== + version "16.8.1" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07" + integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw== gzip-size@^6.0.0: version "6.0.0"
1fe6761d43fdba951436aa3c7e32f4bff1386935
2024-07-17 22:49:08
Alessio Gravili
fix: maxListenersExceeded warning due to atomically, which is a peerdep of conf (#7182)
false
maxListenersExceeded warning due to atomically, which is a peerdep of conf (#7182)
fix
diff --git a/packages/next/src/utilities/getPayloadHMR.ts b/packages/next/src/utilities/getPayloadHMR.ts index 30a27664c4c..ee0cd366ab2 100644 --- a/packages/next/src/utilities/getPayloadHMR.ts +++ b/packages/next/src/utilities/getPayloadHMR.ts @@ -7,10 +7,11 @@ let cached: { payload: Payload | null promise: Promise<Payload> | null reload: Promise<void> | boolean + ws: WebSocket | null } = global._payload if (!cached) { - cached = global._payload = { payload: null, promise: null, reload: false } + cached = global._payload = { payload: null, promise: null, reload: false, ws: null } } export const reload = async (config: SanitizedConfig, payload: Payload): Promise<void> => { @@ -85,17 +86,18 @@ export const getPayloadHMR = async (options: InitOptions): Promise<Payload> => { cached.payload = await cached.promise if ( + !cached.ws && process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test' && process.env.DISABLE_PAYLOAD_HMR !== 'true' ) { try { const port = process.env.PORT || '3000' - const ws = new WebSocket( + cached.ws = new WebSocket( `ws://localhost:${port}${process.env.NEXT_BASE_PATH ?? ''}/_next/webpack-hmr`, ) - ws.onmessage = (event) => { + cached.ws.onmessage = (event) => { if (typeof event.data === 'string') { const data = JSON.parse(event.data) diff --git a/packages/payload/bundle.js b/packages/payload/bundle.js index 5e4ed18b9c3..b48bcedd310 100644 --- a/packages/payload/bundle.js +++ b/packages/payload/bundle.js @@ -23,7 +23,6 @@ async function build() { 'pino-pretty', 'pino', //'ajv', - //'conf', //'image-size', ], minify: true, @@ -50,7 +49,6 @@ async function build() { 'pino-pretty', 'pino', //'ajv', - //'conf', //'image-size', ], minify: true, diff --git a/packages/payload/package.json b/packages/payload/package.json index 06dd26e9d18..9bf09c25c8f 100644 --- a/packages/payload/package.json +++ b/packages/payload/package.json @@ -91,7 +91,6 @@ "ajv": "8.14.0", "bson-objectid": "2.0.4", "ci-info": "^4.0.0", - "conf": "12.0.0", "console-table-printer": "2.11.2", "dataloader": "2.2.2", "deepmerge": "4.3.1", diff --git a/packages/payload/src/utilities/telemetry/conf/envPaths.ts b/packages/payload/src/utilities/telemetry/conf/envPaths.ts new file mode 100644 index 00000000000..3a284ff6f3c --- /dev/null +++ b/packages/payload/src/utilities/telemetry/conf/envPaths.ts @@ -0,0 +1,82 @@ +/** + * Taken from https://github.com/sindresorhus/env-paths/blob/main/index.js + * + * MIT License + * + * Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +import os from 'node:os' +import path from 'node:path' +import process from 'node:process' + +const homedir = os.homedir() +const tmpdir = os.tmpdir() +const { env } = process + +const macos = (name) => { + const library = path.join(homedir, 'Library') + + return { + cache: path.join(library, 'Caches', name), + config: path.join(library, 'Preferences', name), + data: path.join(library, 'Application Support', name), + log: path.join(library, 'Logs', name), + temp: path.join(tmpdir, name), + } +} + +const windows = (name) => { + const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming') + const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local') + + return { + // Data/config/cache/log are invented by me as Windows isn't opinionated about this + cache: path.join(localAppData, name, 'Cache'), + config: path.join(appData, name, 'Config'), + data: path.join(localAppData, name, 'Data'), + log: path.join(localAppData, name, 'Log'), + temp: path.join(tmpdir, name), + } +} + +// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html +const linux = (name) => { + const username = path.basename(homedir) + + return { + cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name), + config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name), + data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name), + // https://wiki.debian.org/XDGBaseDirectorySpecification#state + log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name), + temp: path.join(tmpdir, username, name), + } +} + +export function envPaths(name, { suffix = 'nodejs' } = {}) { + if (typeof name !== 'string') { + throw new TypeError(`Expected a string, got ${typeof name}`) + } + + if (suffix) { + // Add suffix to prevent possible conflict with native apps + name += `-${suffix}` + } + + if (process.platform === 'darwin') { + return macos(name) + } + + if (process.platform === 'win32') { + return windows(name) + } + + return linux(name) +} diff --git a/packages/payload/src/utilities/telemetry/conf/index.ts b/packages/payload/src/utilities/telemetry/conf/index.ts new file mode 100644 index 00000000000..bd5578800ec --- /dev/null +++ b/packages/payload/src/utilities/telemetry/conf/index.ts @@ -0,0 +1,215 @@ +/** + * Taken & simplified from https://github.com/sindresorhus/conf/blob/main/source/index.ts + * + * MIT License + * + * Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +import assert from 'node:assert' +import fs from 'node:fs' +import path from 'node:path' + +import { envPaths } from './envPaths.js' + +const createPlainObject = <T = Record<string, unknown>>(): T => Object.create(null) + +const checkValueType = (key: string, value: unknown): void => { + const nonJsonTypes = new Set(['undefined', 'symbol', 'function']) + + const type = typeof value + + if (nonJsonTypes.has(type)) { + throw new TypeError( + `Setting a value of type \`${type}\` for key \`${key}\` is not allowed as it's not supported by JSON`, + ) + } +} + +export class Conf<T extends Record<string, any> = Record<string, unknown>> + implements Iterable<[keyof T, T[keyof T]]> +{ + readonly #options: Readonly<Partial<Options>> + private readonly _deserialize: Deserialize<T> = (value) => JSON.parse(value) + private readonly _serialize: Serialize<T> = (value) => JSON.stringify(value, undefined, '\t') + + readonly events: EventTarget + + readonly path: string + + constructor() { + const options: Partial<Options> = { + configFileMode: 0o666, + configName: 'config', + fileExtension: 'json', + projectSuffix: 'nodejs', + } + + const cwd = envPaths('payload', { suffix: options.projectSuffix }).config + + this.#options = options + + this.events = new EventTarget() + + const fileExtension = options.fileExtension ? `.${options.fileExtension}` : '' + this.path = path.resolve(cwd, `${options.configName ?? 'config'}${fileExtension}`) + + const fileStore = this.store + const store = Object.assign(createPlainObject(), fileStore) + + try { + assert.deepEqual(fileStore, store) + } catch { + this.store = store + } + } + + private _ensureDirectory(): void { + // Ensure the directory exists as it could have been deleted in the meantime. + fs.mkdirSync(path.dirname(this.path), { recursive: true }) + } + + private _write(value: T): void { + const data: Uint8Array | string = this._serialize(value) + + fs.writeFileSync(this.path, data, { mode: this.#options.configFileMode }) + } + + *[Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]> { + for (const [key, value] of Object.entries(this.store)) { + yield [key, value] + } + } + + /** + Delete an item. + + @param key - The key of the item to delete. + */ + delete(key: string): void { + const { store } = this + delete store[key] + + this.store = store + } + + /** + Get an item. + + @param key - The key of the item to get. + */ + get<Key extends keyof T>(key: Key): T[Key] { + const { store } = this + return store[key] + } + + /** + Set an item or multiple items at once. + + @param key - You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a key to access nested properties. Or a hashmap of items to set at once. + @param value - Must be JSON serializable. Trying to set the type `undefined`, `function`, or `symbol` will result in a `TypeError`. + */ + set<Key extends keyof T>(key: string, value?: T[Key] | unknown): void { + if (typeof key !== 'string' && typeof key !== 'object') { + throw new TypeError( + `Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof key}`, + ) + } + + if (typeof key !== 'object' && value === undefined) { + throw new TypeError('Use `delete()` to clear values') + } + + const { store } = this + + const set = (key: string, value?: T | T[Key] | unknown): void => { + checkValueType(key, value) + store[key as Key] = value as T[Key] + } + + if (typeof key === 'object') { + const object = key + for (const [key, value] of Object.entries(object)) { + set(key, value) + } + } else { + set(key, value) + } + + this.store = store + } + get size(): number { + return Object.keys(this.store).length + } + get store(): T { + try { + const dataString = fs.readFileSync(this.path, 'utf8') + const deserializedData = this._deserialize(dataString) + return Object.assign(createPlainObject(), deserializedData) + } catch (error: unknown) { + if ((error as any)?.code === 'ENOENT') { + this._ensureDirectory() + return createPlainObject() + } + + throw error + } + } + + set store(value: T) { + this._ensureDirectory() + + this._write(value) + + this.events.dispatchEvent(new Event('change')) + } +} + +export type Options = { + /** + The config is cleared if reading the config file causes a `SyntaxError`. This is a good behavior for unimportant data, as the config file is not intended to be hand-edited, so it usually means the config is corrupt and there's nothing the user can do about it anyway. However, if you let the user edit the config file directly, mistakes might happen and it could be more useful to throw an error when the config is invalid instead of clearing. + + @default false + */ + clearInvalidConfig?: boolean + + /** + The [mode](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation) that will be used for the config file. + + You would usually not need this, but it could be useful if you want to restrict the permissions of the config file. Setting a permission such as `0o600` would result in a config file that can only be accessed by the user running the program. + + Note that setting restrictive permissions can cause problems if different users need to read the file. A common problem is a user running your tool with and without `sudo` and then not being able to access the config the second time. + + @default 0o666 + */ + readonly configFileMode?: number + + /** + Name of the config file (without extension). + + Useful if you need multiple config files for your app or module. For example, different config files between two major versions. + + @default 'config' + */ + configName?: string + + /** + Extension of the config file. + + You would usually not need this, but could be useful if you want to interact with a file with a custom file extension that can be associated with your app. These might be simple save/export/preference files that are intended to be shareable or saved outside of the app. + + @default 'json' + */ + fileExtension?: string + + readonly projectSuffix?: string +} + +export type Serialize<T> = (value: T) => string +export type Deserialize<T> = (text: string) => T diff --git a/packages/payload/src/utilities/telemetry/index.ts b/packages/payload/src/utilities/telemetry/index.ts index c240fdc5c06..5d8cfb8025c 100644 --- a/packages/payload/src/utilities/telemetry/index.ts +++ b/packages/payload/src/utilities/telemetry/index.ts @@ -1,6 +1,5 @@ import { execSync } from 'child_process' import ciInfo from 'ci-info' -import Conf from 'conf' import { randomBytes } from 'crypto' import { findUp } from 'find-up' import fs from 'fs' @@ -11,6 +10,7 @@ import type { Payload } from '../../types/index.js' import type { AdminInitEvent } from './events/adminInit.js' import type { ServerInitEvent } from './events/serverInit.js' +import { Conf } from './conf/index.js' import { oneWayHash } from './oneWayHash.js' export type BaseEvent = { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 663beceb3a0..1b747bb8de9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -670,9 +670,6 @@ importers: ci-info: specifier: ^4.0.0 version: 4.0.0 - conf: - specifier: 12.0.0 - version: 12.0.0 console-table-printer: specifier: 2.11.2 version: 2.11.2 @@ -7532,17 +7529,6 @@ packages: indent-string: 4.0.0 dev: true - /[email protected]([email protected]): - resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==} - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true - dependencies: - ajv: 8.14.0 - dev: false - /[email protected]: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} dependencies: @@ -7749,13 +7735,6 @@ packages: engines: {node: '>=8.0.0'} dev: false - /[email protected]: - resolution: {integrity: sha512-kU6FmrwZ3Lx7/7y3hPS5QnbJfaohcIul5fGqf7ok+4KklIEk9tJ0C2IQPdacSbVUWv6zVHXEBWoWd6NrVMT7Cw==} - dependencies: - stubborn-fs: 1.2.5 - when-exit: 2.1.3 - dev: false - /[email protected]: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} @@ -8500,21 +8479,6 @@ packages: kind-of: 3.2.2 dev: false - /[email protected]: - resolution: {integrity: sha512-fIWyWUXrJ45cHCIQX+Ck1hrZDIf/9DR0P0Zewn3uNht28hbt5OfGUq8rRWsxi96pZWPyBEd0eY9ama01JTaknA==} - engines: {node: '>=18'} - dependencies: - ajv: 8.14.0 - ajv-formats: 2.1.1([email protected]) - atomically: 2.0.3 - debounce-fn: 5.1.2 - dot-prop: 8.0.2 - env-paths: 3.0.0 - json-schema-typed: 8.0.1 - semver: 7.6.2 - uint8array-extras: 0.3.0 - dev: false - /[email protected]: resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} dev: true @@ -8741,13 +8705,6 @@ packages: resolution: {integrity: sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==} dev: false - /[email protected]: - resolution: {integrity: sha512-Sr4SdOZ4vw6eQDvPYNxHogvrxmCIld/VenC5JbNrFwMiwd7lY/Z18ZFfo+EWNG4DD9nFlAujWAo/wGuOPHmy5A==} - engines: {node: '>=12'} - dependencies: - mimic-fn: 4.0.0 - dev: false - /[email protected]: resolution: {integrity: sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==} dev: true @@ -9048,13 +9005,6 @@ packages: domhandler: 5.0.3 dev: false - /[email protected]: - resolution: {integrity: sha512-xaBe6ZT4DHPkg0k4Ytbvn5xoxgpG0jOS1dYxSOwAHPuNLjP3/OzN0gH55SrLqpx8cBfSaVt91lXYkApjb+nYdQ==} - engines: {node: '>=16'} - dependencies: - type-fest: 3.13.1 - dev: false - /[email protected]: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} @@ -12198,10 +12148,6 @@ packages: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} dev: false - /[email protected]: - resolution: {integrity: sha512-XQmWYj2Sm4kn4WeTYvmpKEbyPsL7nBsb647c7pMe6l02/yx2+Jfc4dT6UZkEXnIUb5LhD55r2HPsJ1milQ4rDg==} - dev: false - /[email protected]: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} @@ -12612,6 +12558,7 @@ packages: /[email protected]: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} + dev: true /[email protected]: resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} @@ -15248,10 +15195,6 @@ packages: '@tokenizer/token': 0.3.0 peek-readable: 5.1.1 - /[email protected]: - resolution: {integrity: sha512-H2N9c26eXjzL/S/K+i/RHHcFanE74dptvvjM8iwzwbVcWY/zjBbgRqF3K0DY4+OD+uTTASTBvDoxPDaPN02D7g==} - dev: false - /[email protected]: resolution: {integrity: sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==} @@ -15736,11 +15679,6 @@ packages: engines: {node: '>=14.16'} dev: false - /[email protected]: - resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} - engines: {node: '>=14.16'} - dev: false - /[email protected]: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} @@ -15835,11 +15773,6 @@ packages: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} dev: true - /[email protected]: - resolution: {integrity: sha512-erJsJwQ0tKdwuqI0359U8ijkFmfiTcq25JvvzRVc1VP+2son1NJRXhxcAKJmAW3ajM8JSGAfsAXye8g4s+znxA==} - engines: {node: '>=18'} - dev: false - /[email protected]: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: @@ -16129,10 +16062,6 @@ packages: tr46: 0.0.3 webidl-conversions: 3.0.1 - /[email protected]: - resolution: {integrity: sha512-uVieSTccFIr/SFQdFWN/fFaQYmV37OKtuaGphMAzi4DmmUlrvRBJW5WSLkHyjNQY/ePJMz3LoiX9R3yy1Su6Hw==} - dev: false - /[email protected]: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies:
18489facebe5d7b0abc87dcc30fae28510b6bb19
2022-05-02 22:16:52
James Mikrut
feat: optimizes field operations
false
optimizes field operations
feat
diff --git a/demo/collections/DefaultValues.ts b/demo/collections/DefaultValues.ts index 898fe7b2532..352ebcd3c48 100644 --- a/demo/collections/DefaultValues.ts +++ b/demo/collections/DefaultValues.ts @@ -112,7 +112,6 @@ const DefaultValues: CollectionConfig = { label: 'Group', name: 'group', defaultValue: { - nestedText1: 'this should take priority', nestedText2: 'nested default text 2', nestedText3: 'neat', }, @@ -124,6 +123,7 @@ const DefaultValues: CollectionConfig = { name: 'nestedText1', label: 'Nested Text 1', type: 'text', + defaultValue: 'this should take priority', }, { name: 'nestedText2', diff --git a/src/auth/operations/login.ts b/src/auth/operations/login.ts index 3cfc7cbe925..2ff28e0bf19 100644 --- a/src/auth/operations/login.ts +++ b/src/auth/operations/login.ts @@ -9,6 +9,7 @@ import { Field, fieldHasSubFields, fieldAffectsData } from '../../fields/config/ import { User } from '../types'; import { Collection } from '../../collections/config/types'; import { Payload } from '../..'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Result = { user?: User, @@ -171,15 +172,12 @@ async function login(this: Payload, incomingArgs: Arguments): Promise<Result> { // afterRead - Fields // ///////////////////////////////////// - user = await this.performFieldOperations(collectionConfig, { + user = await afterRead({ depth, - req, - id: user.id, - data: user, - hook: 'afterRead', - operation: 'read', + doc: user, + entityConfig: collectionConfig, overrideAccess, - flattenLocales: true, + req, showHiddenFields, }); diff --git a/src/collections/operations/create.ts b/src/collections/operations/create.ts index 35215a77b9a..fa748fbf092 100644 --- a/src/collections/operations/create.ts +++ b/src/collections/operations/create.ts @@ -12,6 +12,10 @@ import { Document } from '../../types'; import { Payload } from '../..'; import { fieldAffectsData } from '../../fields/config/types'; import uploadFile from '../../uploads/uploadFile'; +import { beforeChange } from '../../fields/hooks/beforeChange'; +import { beforeValidate } from '../../fields/hooks/beforeValidate'; +import { afterChange } from '../../fields/hooks/afterChange'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { collection: Collection @@ -99,12 +103,13 @@ async function create(this: Payload, incomingArgs: Arguments): Promise<Document> // beforeValidate - Fields // ///////////////////////////////////// - data = await this.performFieldOperations(collectionConfig, { + data = await beforeValidate({ data, - req, - hook: 'beforeValidate', + doc: {}, + entityConfig: collectionConfig, operation: 'create', overrideAccess, + req, }); // ///////////////////////////////////// @@ -139,13 +144,13 @@ async function create(this: Payload, incomingArgs: Arguments): Promise<Document> // beforeChange - Fields // ///////////////////////////////////// - const resultWithLocales = await this.performFieldOperations(collectionConfig, { + const resultWithLocales = await beforeChange({ data, - hook: 'beforeChange', + doc: {}, + docWithLocales: {}, + entityConfig: collectionConfig, operation: 'create', req, - overrideAccess, - unflattenLocales: true, skipValidation: shouldSaveDraft, }); @@ -214,14 +219,12 @@ async function create(this: Payload, incomingArgs: Arguments): Promise<Document> // afterRead - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(collectionConfig, { + result = await afterRead({ depth, - req, - data: result, - hook: 'afterRead', - operation: 'create', + doc: result, + entityConfig: collectionConfig, overrideAccess, - flattenLocales: true, + req, showHiddenFields, }); @@ -242,14 +245,12 @@ async function create(this: Payload, incomingArgs: Arguments): Promise<Document> // afterChange - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(collectionConfig, { - data: result, - hook: 'afterChange', + result = await afterChange({ + data, + doc: result, + entityConfig: collectionConfig, operation: 'create', req, - depth, - overrideAccess, - showHiddenFields, }); // ///////////////////////////////////// diff --git a/src/collections/operations/delete.ts b/src/collections/operations/delete.ts index 14155309f52..47c3d814380 100644 --- a/src/collections/operations/delete.ts +++ b/src/collections/operations/delete.ts @@ -10,6 +10,7 @@ import { Document, Where } from '../../types'; import { hasWhereAccessResult } from '../../auth/types'; import { FileData } from '../../uploads/types'; import fileExists from '../../uploads/fileExists'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { depth?: number @@ -173,14 +174,12 @@ async function deleteQuery(incomingArgs: Arguments): Promise<Document> { // afterRead - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(collectionConfig, { + result = await afterRead({ depth, - req, - data: result, - hook: 'afterRead', - operation: 'delete', + doc: result, + entityConfig: collectionConfig, overrideAccess, - flattenLocales: true, + req, showHiddenFields, }); diff --git a/src/collections/operations/find.ts b/src/collections/operations/find.ts index 3fc14723226..3c4ee955016 100644 --- a/src/collections/operations/find.ts +++ b/src/collections/operations/find.ts @@ -9,6 +9,7 @@ import flattenWhereConstraints from '../../utilities/flattenWhereConstraints'; import { buildSortParam } from '../../mongoose/buildSortParam'; import replaceWithDraftIfAvailable from '../../versions/drafts/replaceWithDraftIfAvailable'; import { AccessResult } from '../../config/types'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { collection: Collection @@ -169,20 +170,14 @@ async function find<T extends TypeWithID = any>(incomingArgs: Arguments): Promis result = { ...result, - docs: await Promise.all(result.docs.map(async (data) => this.performFieldOperations( - collectionConfig, - { - depth, - data, - req, - id: data.id, - hook: 'afterRead', - operation: 'read', - overrideAccess, - flattenLocales: true, - showHiddenFields, - }, - ))), + docs: await Promise.all(result.docs.map(async (doc) => afterRead<T>({ + depth, + doc, + entityConfig: collectionConfig, + overrideAccess, + req, + showHiddenFields, + }))), }; // ///////////////////////////////////// diff --git a/src/collections/operations/findByID.ts b/src/collections/operations/findByID.ts index 33e4060f695..d50172b669d 100644 --- a/src/collections/operations/findByID.ts +++ b/src/collections/operations/findByID.ts @@ -9,6 +9,7 @@ import executeAccess from '../../auth/executeAccess'; import { Where } from '../../types'; import { hasWhereAccessResult } from '../../auth/types'; import replaceWithDraftIfAvailable from '../../versions/drafts/replaceWithDraftIfAvailable'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { collection: Collection @@ -149,16 +150,13 @@ async function findByID<T extends TypeWithID = any>(this: Payload, incomingArgs: // afterRead - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(collectionConfig, { - depth, - req, - id, - data: result, - hook: 'afterRead', - operation: 'read', + result = await afterRead({ currentDepth, + doc: result, + depth, + entityConfig: collectionConfig, overrideAccess, - flattenLocales: true, + req, showHiddenFields, }); diff --git a/src/collections/operations/findVersionByID.ts b/src/collections/operations/findVersionByID.ts index 5463e4c2307..39d1b101741 100644 --- a/src/collections/operations/findVersionByID.ts +++ b/src/collections/operations/findVersionByID.ts @@ -9,6 +9,7 @@ import executeAccess from '../../auth/executeAccess'; import { Where } from '../../types'; import { hasWhereAccessResult } from '../../auth/types'; import { TypeWithVersion } from '../../versions/types'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { collection: Collection @@ -113,16 +114,13 @@ async function findVersionByID<T extends TypeWithVersion<T> = any>(this: Payload // afterRead - Fields // ///////////////////////////////////// - result.version = await this.performFieldOperations(collectionConfig, { - depth, - req, - id, - data: result.version, - hook: 'afterRead', - operation: 'read', + result.version = await afterRead({ currentDepth, + depth, + doc: result.version, + entityConfig: collectionConfig, overrideAccess, - flattenLocales: true, + req, showHiddenFields, }); diff --git a/src/collections/operations/findVersions.ts b/src/collections/operations/findVersions.ts index 3432092440b..f5168132335 100644 --- a/src/collections/operations/findVersions.ts +++ b/src/collections/operations/findVersions.ts @@ -9,6 +9,7 @@ import { buildSortParam } from '../../mongoose/buildSortParam'; import { PaginatedDocs } from '../../mongoose/types'; import { TypeWithVersion } from '../../versions/types'; import { Payload } from '../../index'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { collection: Collection @@ -131,21 +132,14 @@ async function findVersions<T extends TypeWithVersion<T> = any>(this: Payload, a ...result, docs: await Promise.all(result.docs.map(async (data) => ({ ...data, - version: await this.performFieldOperations( - collectionConfig, - { - depth, - data: data.version, - req, - id: data.version.id, - hook: 'afterRead', - operation: 'read', - overrideAccess, - flattenLocales: true, - showHiddenFields, - isVersion: true, - }, - ), + version: await afterRead({ + depth, + doc: data.version, + entityConfig: collectionConfig, + overrideAccess, + req, + showHiddenFields, + }), }))), }; diff --git a/src/collections/operations/restoreVersion.ts b/src/collections/operations/restoreVersion.ts index 1fde3d17057..dc8e2c3bc1e 100644 --- a/src/collections/operations/restoreVersion.ts +++ b/src/collections/operations/restoreVersion.ts @@ -8,6 +8,8 @@ import { Payload } from '../../index'; import { hasWhereAccessResult } from '../../auth/types'; import { Where } from '../../types'; import sanitizeInternalFields from '../../utilities/sanitizeInternalFields'; +import { afterChange } from '../../fields/hooks/afterChange'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { collection: Collection @@ -114,15 +116,12 @@ async function restoreVersion<T extends TypeWithID = any>(this: Payload, args: A // afterRead - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(collectionConfig, { - id: parentDocID, + result = await afterRead({ depth, + doc: result, + entityConfig: collectionConfig, req, - data: result, - hook: 'afterRead', - operation: 'update', overrideAccess, - flattenLocales: true, showHiddenFields, }); @@ -143,15 +142,12 @@ async function restoreVersion<T extends TypeWithID = any>(this: Payload, args: A // afterChange - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(collectionConfig, { + result = await afterChange({ data: result, - hook: 'afterChange', + doc: result, + entityConfig: collectionConfig, operation: 'update', req, - id: parentDocID, - depth, - overrideAccess, - showHiddenFields, }); // ///////////////////////////////////// diff --git a/src/collections/operations/update.ts b/src/collections/operations/update.ts index 98ed7929ffe..6d1ab15227b 100644 --- a/src/collections/operations/update.ts +++ b/src/collections/operations/update.ts @@ -12,6 +12,10 @@ import { saveCollectionVersion } from '../../versions/saveCollectionVersion'; import uploadFile from '../../uploads/uploadFile'; import cleanUpFailedVersion from '../../versions/cleanUpFailedVersion'; import { ensurePublishedCollectionVersion } from '../../versions/ensurePublishedCollectionVersion'; +import { beforeChange } from '../../fields/hooks/beforeChange'; +import { beforeValidate } from '../../fields/hooks/beforeValidate'; +import { afterChange } from '../../fields/hooks/afterChange'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { collection: Collection @@ -110,15 +114,12 @@ async function update(this: Payload, incomingArgs: Arguments): Promise<Document> docWithLocales = JSON.stringify(docWithLocales); docWithLocales = JSON.parse(docWithLocales); - const originalDoc = await this.performFieldOperations(collectionConfig, { - id, + const originalDoc = await afterRead({ depth: 0, + doc: docWithLocales, + entityConfig: collectionConfig, req, - data: docWithLocales, - hook: 'afterRead', - operation: 'update', overrideAccess: true, - flattenLocales: true, showHiddenFields, }); @@ -139,14 +140,14 @@ async function update(this: Payload, incomingArgs: Arguments): Promise<Document> // beforeValidate - Fields // ///////////////////////////////////// - data = await this.performFieldOperations(collectionConfig, { + data = await beforeValidate({ data, - req, + doc: originalDoc, + entityConfig: collectionConfig, id, - originalDoc, - hook: 'beforeValidate', operation: 'update', overrideAccess, + req, }); // // ///////////////////////////////////// @@ -183,16 +184,14 @@ async function update(this: Payload, incomingArgs: Arguments): Promise<Document> // beforeChange - Fields // ///////////////////////////////////// - let result = await this.performFieldOperations(collectionConfig, { + let result = await beforeChange({ data, - req, + doc: originalDoc, + docWithLocales, + entityConfig: collectionConfig, id, - originalDoc, - hook: 'beforeChange', operation: 'update', - overrideAccess, - unflattenLocales: true, - docWithLocales, + req, skipValidation: shouldSaveDraft, }); @@ -266,8 +265,8 @@ async function update(this: Payload, incomingArgs: Arguments): Promise<Document> : error; } - result = JSON.stringify(result); - result = JSON.parse(result); + const resultString = JSON.stringify(result); + result = JSON.parse(resultString); // custom id type reset result.id = result._id; @@ -279,15 +278,12 @@ async function update(this: Payload, incomingArgs: Arguments): Promise<Document> // afterRead - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(collectionConfig, { - id, + result = await afterRead({ depth, + doc: result, + entityConfig: collectionConfig, req, - data: result, - hook: 'afterRead', - operation: 'update', overrideAccess, - flattenLocales: true, showHiddenFields, }); @@ -308,15 +304,12 @@ async function update(this: Payload, incomingArgs: Arguments): Promise<Document> // afterChange - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(collectionConfig, { - data: result, - hook: 'afterChange', + result = await afterChange({ + data, + doc: result, + entityConfig: collectionConfig, operation: 'update', req, - id, - depth, - overrideAccess, - showHiddenFields, }); // ///////////////////////////////////// diff --git a/src/fields/accessPromise.ts b/src/fields/accessPromise.ts deleted file mode 100644 index 5039aa5f162..00000000000 --- a/src/fields/accessPromise.ts +++ /dev/null @@ -1,73 +0,0 @@ -import { Payload } from '..'; -import { HookName, FieldAffectingData } from './config/types'; -import relationshipPopulationPromise from './relationshipPopulationPromise'; -import { Operation } from '../types'; -import { PayloadRequest } from '../express/types'; - -type Arguments = { - data: Record<string, unknown> - fullData: Record<string, unknown> - originalDoc: Record<string, unknown> - field: FieldAffectingData - operation: Operation - overrideAccess: boolean - req: PayloadRequest - id: string | number - relationshipPopulations: (() => Promise<void>)[] - depth: number - currentDepth: number - hook: HookName - payload: Payload - showHiddenFields: boolean -} - -const accessPromise = async ({ - data, - fullData, - field, - operation, - overrideAccess, - req, - id, - relationshipPopulations, - depth, - currentDepth, - hook, - payload, - showHiddenFields, - originalDoc, -}: Arguments): Promise<void> => { - const resultingData = data; - - let accessOperation; - - if (hook === 'afterRead') { - accessOperation = 'read'; - } else if (hook === 'beforeValidate') { - if (operation === 'update') accessOperation = 'update'; - if (operation === 'create') accessOperation = 'create'; - } - - if (field.access && field.access[accessOperation]) { - const result = overrideAccess ? true : await field.access[accessOperation]({ req, id, siblingData: data, data: fullData, doc: originalDoc }); - - if (!result) { - delete resultingData[field.name]; - } - } - - if ((field.type === 'relationship' || field.type === 'upload') && hook === 'afterRead') { - relationshipPopulations.push(relationshipPopulationPromise({ - showHiddenFields, - data, - field, - depth, - currentDepth, - req, - overrideAccess, - payload, - })); - } -}; - -export default accessPromise; diff --git a/src/fields/config/types.ts b/src/fields/config/types.ts index 44f90ea00d9..1b1acc23f54 100644 --- a/src/fields/config/types.ts +++ b/src/fields/config/types.ts @@ -22,7 +22,7 @@ export type FieldHook<T extends TypeWithID = any, P = any, S = any> = (args: Fie export type FieldAccess<T extends TypeWithID = any, P = any> = (args: { req: PayloadRequest - id?: string + id?: string | number data?: Partial<T> siblingData?: Partial<P> doc?: T @@ -228,6 +228,10 @@ export type ValueWithRelation = { value: string | number } +export function valueIsValueWithRelation(value: unknown): value is ValueWithRelation { + return typeof value === 'object' && 'relationTo' in value && 'value' in value; +} + export type RelationshipValue = (string | number) | (string | number)[] | ValueWithRelation diff --git a/src/fields/hookPromise.ts b/src/fields/hookPromise.ts deleted file mode 100644 index bb1e2c9794f..00000000000 --- a/src/fields/hookPromise.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { PayloadRequest } from '../express/types'; -import { Operation } from '../types'; -import { HookName, FieldAffectingData, FieldHook } from './config/types'; - -type Arguments = { - data: Record<string, unknown> - field: FieldAffectingData - hook: HookName - req: PayloadRequest - operation: Operation - fullOriginalDoc: Record<string, unknown> - fullData: Record<string, unknown> - flattenLocales: boolean - isVersion: boolean -} - -type ExecuteHookArguments = { - currentHook: FieldHook - value: unknown -} & Arguments; - -const executeHook = async ({ - currentHook, - fullOriginalDoc, - fullData, - data, - operation, - req, - value, -}: ExecuteHookArguments) => { - let hookedValue = await currentHook({ - value, - originalDoc: fullOriginalDoc, - data: fullData, - siblingData: data, - operation, - req, - }); - - if (typeof hookedValue === 'undefined') { - hookedValue = value; - } - - return hookedValue; -}; - -const hookPromise = async (args: Arguments): Promise<void> => { - const { - field, - hook, - req, - flattenLocales, - data, - } = args; - - if (field.hooks && field.hooks[hook]) { - await field.hooks[hook].reduce(async (priorHook, currentHook) => { - await priorHook; - - const shouldRunHookOnAllLocales = hook === 'afterRead' - && field.localized - && (req.locale === 'all' || !flattenLocales) - && typeof data[field.name] === 'object'; - - if (shouldRunHookOnAllLocales) { - const hookPromises = Object.entries(data[field.name]).map(([locale, value]) => (async () => { - const hookedValue = await executeHook({ - ...args, - currentHook, - value, - }); - - if (hookedValue !== undefined) { - data[field.name][locale] = hookedValue; - } - })()); - - await Promise.all(hookPromises); - } else { - const hookedValue = await executeHook({ - ...args, - value: data[field.name], - currentHook, - }); - - if (hookedValue !== undefined) { - data[field.name] = hookedValue; - } - } - }, Promise.resolve()); - } -}; - -export default hookPromise; diff --git a/src/fields/hooks/afterChange/index.ts b/src/fields/hooks/afterChange/index.ts new file mode 100644 index 00000000000..a4851bb430c --- /dev/null +++ b/src/fields/hooks/afterChange/index.ts @@ -0,0 +1,40 @@ +import { SanitizedCollectionConfig } from '../../../collections/config/types'; +import { SanitizedGlobalConfig } from '../../../globals/config/types'; +import { PayloadRequest } from '../../../express/types'; +import { traverseFields } from './traverseFields'; +import deepCopyObject from '../../../utilities/deepCopyObject'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + entityConfig: SanitizedCollectionConfig | SanitizedGlobalConfig + operation: 'create' | 'update' + req: PayloadRequest +} + +export const afterChange = async ({ + data, + doc: incomingDoc, + entityConfig, + operation, + req, +}: Args): Promise<Record<string, unknown>> => { + const promises = []; + + const doc = deepCopyObject(incomingDoc); + + traverseFields({ + data, + doc, + fields: entityConfig.fields, + operation, + promises, + req, + siblingDoc: doc, + siblingData: data, + }); + + await Promise.all(promises); + + return doc; +}; diff --git a/src/fields/hooks/afterChange/promise.ts b/src/fields/hooks/afterChange/promise.ts new file mode 100644 index 00000000000..5a8b08ba167 --- /dev/null +++ b/src/fields/hooks/afterChange/promise.ts @@ -0,0 +1,133 @@ +/* eslint-disable no-param-reassign */ +import { PayloadRequest } from '../../../express/types'; +import { Field, fieldAffectsData } from '../../config/types'; +import { traverseFields } from './traverseFields'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + field: Field + operation: 'create' | 'update' + promises: Promise<void>[] + req: PayloadRequest + siblingData: Record<string, unknown> + siblingDoc: Record<string, unknown> +} + +// This function is responsible for the following actions, in order: +// - Execute field hooks + +export const promise = async ({ + data, + doc, + field, + operation, + promises, + req, + siblingData, + siblingDoc, +}: Args): Promise<void> => { + if (fieldAffectsData(field)) { + // Execute hooks + if (field.hooks?.afterChange) { + await field.hooks.afterChange.reduce(async (priorHook, currentHook) => { + await priorHook; + + const hookedValue = await currentHook({ + value: siblingData[field.name], + originalDoc: doc, + data, + siblingData, + operation, + req, + }); + + if (hookedValue !== undefined) { + siblingDoc[field.name] = hookedValue; + } + }, Promise.resolve()); + } + } + + // Traverse subfields + switch (field.type) { + case 'group': { + traverseFields({ + data, + doc, + fields: field.fields, + operation, + promises, + req, + siblingData: siblingData[field.name] as Record<string, unknown> || {}, + siblingDoc: siblingDoc[field.name] as Record<string, unknown>, + }); + + break; + } + + case 'array': { + const rows = siblingDoc[field.name]; + + if (Array.isArray(rows)) { + rows.forEach((row, i) => { + traverseFields({ + data, + doc, + fields: field.fields, + operation, + promises, + req, + siblingData: siblingData[field.name]?.[i] || {}, + siblingDoc: { ...row } || {}, + }); + }); + } + break; + } + + case 'blocks': { + const rows = siblingDoc[field.name]; + + if (Array.isArray(rows)) { + rows.forEach((row, i) => { + const block = field.blocks.find((blockType) => blockType.slug === row.blockType); + + if (block) { + traverseFields({ + data, + doc, + fields: block.fields, + operation, + promises, + req, + siblingData: siblingData[field.name]?.[i] || {}, + siblingDoc: { ...row } || {}, + }); + } + }); + } + + break; + } + + case 'row': { + traverseFields({ + data, + doc, + fields: field.fields, + operation, + promises, + req, + siblingData: siblingData || {}, + siblingDoc: { ...siblingDoc }, + }); + + break; + } + + default: { + break; + } + } +}; diff --git a/src/fields/hooks/afterChange/traverseFields.ts b/src/fields/hooks/afterChange/traverseFields.ts new file mode 100644 index 00000000000..2da6d8cd4b7 --- /dev/null +++ b/src/fields/hooks/afterChange/traverseFields.ts @@ -0,0 +1,38 @@ +import { Field } from '../../config/types'; +import { promise } from './promise'; +import { PayloadRequest } from '../../../express/types'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + fields: Field[] + operation: 'create' | 'update' + promises: Promise<void>[] + req: PayloadRequest + siblingData: Record<string, unknown> + siblingDoc: Record<string, unknown> +} + +export const traverseFields = ({ + data, + doc, + fields, + operation, + promises, + req, + siblingData, + siblingDoc, +}: Args): void => { + fields.forEach((field) => { + promises.push(promise({ + data, + doc, + field, + operation, + promises, + req, + siblingData, + siblingDoc, + })); + }); +}; diff --git a/src/fields/hooks/afterRead/index.ts b/src/fields/hooks/afterRead/index.ts new file mode 100644 index 00000000000..2d083956e30 --- /dev/null +++ b/src/fields/hooks/afterRead/index.ts @@ -0,0 +1,62 @@ +import { SanitizedCollectionConfig } from '../../../collections/config/types'; +import { SanitizedGlobalConfig } from '../../../globals/config/types'; +import { PayloadRequest } from '../../../express/types'; +import { traverseFields } from './traverseFields'; +import deepCopyObject from '../../../utilities/deepCopyObject'; + +type Args = { + currentDepth?: number + depth: number + doc: Record<string, unknown> + entityConfig: SanitizedCollectionConfig | SanitizedGlobalConfig + flattenLocales?: boolean + req: PayloadRequest + overrideAccess: boolean + showHiddenFields: boolean +} + +export async function afterRead<T = any>(args: Args): Promise<T> { + const { + currentDepth: incomingCurrentDepth, + depth: incomingDepth, + doc: incomingDoc, + entityConfig, + flattenLocales = true, + req, + overrideAccess, + showHiddenFields, + } = args; + + const doc = deepCopyObject(incomingDoc); + const fieldPromises = []; + const populationPromises = []; + + let depth = 0; + + if (req.payloadAPI === 'REST' || req.payloadAPI === 'local') { + depth = (incomingDepth || incomingDepth === 0) ? parseInt(String(incomingDepth), 10) : req.payload.config.defaultDepth; + + if (depth > req.payload.config.maxDepth) depth = req.payload.config.maxDepth; + } + + const currentDepth = incomingCurrentDepth || 1; + + traverseFields({ + currentDepth, + depth, + doc, + fields: entityConfig.fields, + fieldPromises, + flattenLocales, + overrideAccess, + populationPromises, + req, + siblingDoc: doc, + showHiddenFields, + }); + + await Promise.all(fieldPromises); + await Promise.all(populationPromises); + + return doc; +} diff --git a/src/fields/hooks/afterRead/promise.ts b/src/fields/hooks/afterRead/promise.ts new file mode 100644 index 00000000000..7f2d5f8b940 --- /dev/null +++ b/src/fields/hooks/afterRead/promise.ts @@ -0,0 +1,265 @@ +/* eslint-disable no-param-reassign */ +import { Field, fieldAffectsData } from '../../config/types'; +import { PayloadRequest } from '../../../express/types'; +import { traverseFields } from './traverseFields'; +import richTextRelationshipPromise from '../../richText/relationshipPromise'; +import relationshipPopulationPromise from './relationshipPopulationPromise'; + +type Args = { + currentDepth: number + depth: number + doc: Record<string, unknown> + field: Field + fieldPromises: Promise<void>[] + flattenLocales: boolean + populationPromises: Promise<void>[] + req: PayloadRequest + overrideAccess: boolean + siblingDoc: Record<string, unknown> + showHiddenFields: boolean +} + +// This function is responsible for the following actions, in order: +// - Remove hidden fields from response +// - Flatten locales into requested locale +// - Sanitize outgoing data (point field, etc) +// - Execute field hooks +// - Execute read access control +// - Populate relationships + +export const promise = async ({ + currentDepth, + depth, + doc, + field, + fieldPromises, + flattenLocales, + overrideAccess, + populationPromises, + req, + siblingDoc, + showHiddenFields, +}: Args): Promise<void> => { + if (fieldAffectsData(field) && field.hidden && typeof siblingDoc[field.name] !== 'undefined' && !showHiddenFields) { + delete siblingDoc[field.name]; + } + + const hasLocalizedValue = flattenLocales + && fieldAffectsData(field) + && (typeof siblingDoc[field.name] === 'object' && siblingDoc[field.name] !== null) + && field.name + && field.localized + && req.locale !== 'all'; + + if (hasLocalizedValue) { + let localizedValue = siblingDoc[field.name][req.locale]; + if (typeof localizedValue === 'undefined' && req.fallbackLocale) localizedValue = siblingDoc[field.name][req.fallbackLocale]; + if (typeof localizedValue === 'undefined' && field.type === 'group') localizedValue = {}; + if (typeof localizedValue === 'undefined') localizedValue = null; + siblingDoc[field.name] = localizedValue; + } + + // Sanitize outgoing data + switch (field.type) { + case 'group': { + // Fill groups with empty objects so fields with hooks within groups can populate + // themselves virtually as necessary + if (typeof siblingDoc[field.name] === 'undefined') { + siblingDoc[field.name] = {}; + } + + break; + } + + case 'richText': { + if (((field.admin?.elements?.includes('relationship') || field.admin?.elements?.includes('upload')) || !field?.admin?.elements)) { + populationPromises.push(richTextRelationshipPromise({ + currentDepth, + depth, + field, + overrideAccess, + req, + siblingDoc, + showHiddenFields, + })); + } + + break; + } + + case 'point': { + const pointDoc = siblingDoc[field.name] as any; + if (Array.isArray(pointDoc?.coordinates) && pointDoc.coordinates.length === 2) { + siblingDoc[field.name] = pointDoc.coordinates; + } + + break; + } + + default: { + break; + } + } + + if (fieldAffectsData(field)) { + // Execute hooks + if (field.hooks?.afterRead) { + await field.hooks.afterRead.reduce(async (priorHook, currentHook) => { + await priorHook; + + const shouldRunHookOnAllLocales = field.localized + && (req.locale === 'all' || !flattenLocales) + && typeof siblingDoc[field.name] === 'object'; + + if (shouldRunHookOnAllLocales) { + const hookPromises = Object.entries(siblingDoc[field.name]).map(([locale, value]) => (async () => { + const hookedValue = await currentHook({ + value, + originalDoc: doc, + data: doc, + siblingData: siblingDoc[field.name], + operation: 'read', + req, + }); + + if (hookedValue !== undefined) { + siblingDoc[field.name][locale] = hookedValue; + } + })()); + + await Promise.all(hookPromises); + } else { + const hookedValue = await currentHook({ + value: siblingDoc[field.name], + originalDoc: doc, + data: doc, + siblingData: siblingDoc[field.name], + operation: 'read', + req, + }); + + if (hookedValue !== undefined) { + siblingDoc[field.name] = hookedValue; + } + } + }, Promise.resolve()); + } + + // Execute access control + if (field.access && field.access.read) { + const result = overrideAccess ? true : await field.access.read({ req, id: doc.id as string | number, siblingData: siblingDoc, data: doc, doc }); + + if (!result) { + delete siblingDoc[field.name]; + } + } + + if (field.type === 'relationship' || field.type === 'upload') { + populationPromises.push(relationshipPopulationPromise({ + currentDepth, + depth, + field, + overrideAccess, + req, + showHiddenFields, + siblingDoc, + })); + } + } + + switch (field.type) { + case 'group': { + let groupDoc = siblingDoc[field.name] as Record<string, unknown>; + if (typeof siblingDoc[field.name] !== 'object') groupDoc = {}; + + traverseFields({ + currentDepth, + depth, + doc, + fieldPromises, + fields: field.fields, + flattenLocales, + overrideAccess, + populationPromises, + req, + siblingDoc: groupDoc, + showHiddenFields, + }); + + break; + } + + case 'array': { + const rows = siblingDoc[field.name]; + + if (Array.isArray(rows)) { + rows.forEach((row, i) => { + traverseFields({ + currentDepth, + depth, + doc, + fields: field.fields, + fieldPromises, + flattenLocales, + overrideAccess, + populationPromises, + req, + siblingDoc: row || {}, + showHiddenFields, + }); + }); + } + break; + } + + case 'blocks': { + const rows = siblingDoc[field.name]; + + if (Array.isArray(rows)) { + rows.forEach((row, i) => { + const block = field.blocks.find((blockType) => blockType.slug === row.blockType); + + if (block) { + traverseFields({ + currentDepth, + depth, + doc, + fields: block.fields, + fieldPromises, + flattenLocales, + overrideAccess, + populationPromises, + req, + siblingDoc: row || {}, + showHiddenFields, + }); + } + }); + } + + break; + } + + case 'row': { + traverseFields({ + currentDepth, + depth, + doc, + fieldPromises, + fields: field.fields, + flattenLocales, + overrideAccess, + populationPromises, + req, + siblingDoc, + showHiddenFields, + }); + + break; + } + + default: { + break; + } + } +}; diff --git a/src/fields/relationshipPopulationPromise.ts b/src/fields/hooks/afterRead/relationshipPopulationPromise.ts similarity index 80% rename from src/fields/relationshipPopulationPromise.ts rename to src/fields/hooks/afterRead/relationshipPopulationPromise.ts index 5eba1d1df59..35195bc708e 100644 --- a/src/fields/relationshipPopulationPromise.ts +++ b/src/fields/hooks/afterRead/relationshipPopulationPromise.ts @@ -1,6 +1,5 @@ -import { PayloadRequest } from '../express/types'; -import { RelationshipField, fieldSupportsMany, fieldHasMaxDepth, UploadField } from './config/types'; -import { Payload } from '..'; +import { PayloadRequest } from '../../../express/types'; +import { RelationshipField, fieldSupportsMany, fieldHasMaxDepth, UploadField } from '../../config/types'; type PopulateArgs = { depth: number @@ -11,7 +10,6 @@ type PopulateArgs = { data: Record<string, unknown> field: RelationshipField | UploadField index?: number - payload: Payload showHiddenFields: boolean } @@ -24,13 +22,12 @@ const populate = async ({ data, field, index, - payload, showHiddenFields, }: PopulateArgs) => { const dataToUpdate = dataReference; const relation = Array.isArray(field.relationTo) ? (data.relationTo as string) : field.relationTo; - const relatedCollection = payload.collections[relation]; + const relatedCollection = req.payload.collections[relation]; if (relatedCollection) { let idString = Array.isArray(field.relationTo) ? data.value : data; @@ -42,7 +39,7 @@ const populate = async ({ let populatedRelationship; if (depth && currentDepth <= depth) { - populatedRelationship = await payload.findByID({ + populatedRelationship = await req.payload.findByID({ req, collection: relatedCollection.config.slug, id: idString as string, @@ -72,33 +69,31 @@ const populate = async ({ }; type PromiseArgs = { - data: Record<string, any> + siblingDoc: Record<string, any> field: RelationshipField | UploadField depth: number currentDepth: number req: PayloadRequest overrideAccess: boolean - payload: Payload showHiddenFields: boolean } -const relationshipPopulationPromise = ({ - data, +const relationshipPopulationPromise = async ({ + siblingDoc, field, depth, currentDepth, req, overrideAccess, - payload, showHiddenFields, -}: PromiseArgs) => async (): Promise<void> => { - const resultingData = data; +}: PromiseArgs): Promise<void> => { + const resultingDoc = siblingDoc; const populateDepth = fieldHasMaxDepth(field) && field.maxDepth < depth ? field.maxDepth : depth; - if (fieldSupportsMany(field) && field.hasMany && Array.isArray(data[field.name])) { + if (fieldSupportsMany(field) && field.hasMany && Array.isArray(siblingDoc[field.name])) { const rowPromises = []; - data[field.name].forEach((relatedDoc, index) => { + siblingDoc[field.name].forEach((relatedDoc, index) => { const rowPromise = async () => { if (relatedDoc) { await populate({ @@ -107,10 +102,9 @@ const relationshipPopulationPromise = ({ req, overrideAccess, data: relatedDoc, - dataReference: resultingData, + dataReference: resultingDoc, field, index, - payload, showHiddenFields, }); } @@ -120,16 +114,15 @@ const relationshipPopulationPromise = ({ }); await Promise.all(rowPromises); - } else if (data[field.name]) { + } else if (siblingDoc[field.name]) { await populate({ depth: populateDepth, currentDepth, req, overrideAccess, - dataReference: resultingData, - data: data[field.name], + dataReference: resultingDoc, + data: siblingDoc[field.name], field, - payload, showHiddenFields, }); } diff --git a/src/fields/hooks/afterRead/traverseFields.ts b/src/fields/hooks/afterRead/traverseFields.ts new file mode 100644 index 00000000000..1fcad81a8c9 --- /dev/null +++ b/src/fields/hooks/afterRead/traverseFields.ts @@ -0,0 +1,47 @@ +import { Field } from '../../config/types'; +import { promise } from './promise'; +import { PayloadRequest } from '../../../express/types'; + +type Args = { + currentDepth: number + depth: number + doc: Record<string, unknown> + fieldPromises: Promise<void>[] + fields: Field[] + flattenLocales: boolean + populationPromises: Promise<void>[] + req: PayloadRequest + overrideAccess: boolean + siblingDoc: Record<string, unknown> + showHiddenFields: boolean +} + +export const traverseFields = ({ + currentDepth, + depth, + doc, + fieldPromises, + fields, + flattenLocales, + overrideAccess, + populationPromises, + req, + siblingDoc, + showHiddenFields, +}: Args): void => { + fields.forEach((field) => { + fieldPromises.push(promise({ + currentDepth, + depth, + doc, + field, + fieldPromises, + flattenLocales, + overrideAccess, + populationPromises, + req, + siblingDoc, + showHiddenFields, + })); + }); +}; diff --git a/src/fields/hooks/beforeChange/index.ts b/src/fields/hooks/beforeChange/index.ts new file mode 100644 index 00000000000..ed1ba991bf5 --- /dev/null +++ b/src/fields/hooks/beforeChange/index.ts @@ -0,0 +1,62 @@ +import { SanitizedCollectionConfig } from '../../../collections/config/types'; +import { SanitizedGlobalConfig } from '../../../globals/config/types'; +import { Operation } from '../../../types'; +import { PayloadRequest } from '../../../express/types'; +import { traverseFields } from './traverseFields'; +import { ValidationError } from '../../../errors'; +import deepCopyObject from '../../../utilities/deepCopyObject'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + docWithLocales: Record<string, unknown> + entityConfig: SanitizedCollectionConfig | SanitizedGlobalConfig + id?: string | number + operation: Operation + req: PayloadRequest + skipValidation?: boolean +} + +export const beforeChange = async ({ + data: incomingData, + doc, + docWithLocales, + entityConfig, + id, + operation, + req, + skipValidation, +}: Args): Promise<Record<string, unknown>> => { + const data = deepCopyObject(incomingData); + const promises = []; + const mergeLocaleActions = []; + const errors: { message: string, field: string }[] = []; + + traverseFields({ + data, + doc, + docWithLocales, + errors, + id, + operation, + path: '', + mergeLocaleActions, + promises, + req, + siblingData: data, + siblingDoc: doc, + siblingDocWithLocales: docWithLocales, + fields: entityConfig.fields, + skipValidation, + }); + + await Promise.all(promises); + + if (errors.length > 0) { + throw new ValidationError(errors); + } + + mergeLocaleActions.forEach((action) => action()); + + return data; +}; diff --git a/src/fields/hooks/beforeChange/promise.ts b/src/fields/hooks/beforeChange/promise.ts new file mode 100644 index 00000000000..91e5646de7a --- /dev/null +++ b/src/fields/hooks/beforeChange/promise.ts @@ -0,0 +1,285 @@ +/* eslint-disable no-param-reassign */ +import merge from 'deepmerge'; +import { Field, fieldAffectsData } from '../../config/types'; +import { Operation } from '../../../types'; +import { PayloadRequest } from '../../../express/types'; +import getValueWithDefault from '../../getDefaultValue'; +import { traverseFields } from './traverseFields'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + docWithLocales: Record<string, unknown> + errors: { message: string, field: string }[] + field: Field + id?: string | number + mergeLocaleActions: (() => void)[] + operation: Operation + path: string + promises: Promise<void>[] + req: PayloadRequest + siblingData: Record<string, unknown> + siblingDoc: Record<string, unknown> + siblingDocWithLocales?: Record<string, unknown> + skipValidation: boolean +} + +// This function is responsible for the following actions, in order: +// - Run condition +// - Merge original document data into incoming data +// - Compute default values for undefined fields +// - Execute field hooks +// - Validate data +// - Transform data for storage +// - Unflatten locales + +export const promise = async ({ + data, + doc, + docWithLocales, + errors, + field, + id, + mergeLocaleActions, + operation, + path, + promises, + req, + siblingData, + siblingDoc, + siblingDocWithLocales, + skipValidation, +}: Args): Promise<void> => { + const passesCondition = (field.admin?.condition) ? field.admin.condition(data, siblingData) : true; + const skipValidationFromHere = skipValidation || !passesCondition; + + if (fieldAffectsData(field)) { + if (typeof siblingData[field.name] === 'undefined') { + // If no incoming data, but existing document data is found, merge it in + if (typeof siblingDoc[field.name] !== 'undefined') { + if (field.localized && typeof siblingDoc[field.name] === 'object') { + siblingData[field.name] = siblingDoc[field.name][req.locale]; + } else { + siblingData[field.name] = siblingDoc[field.name]; + } + + // Otherwise compute default value + } else if (typeof field.defaultValue !== 'undefined') { + siblingData[field.name] = await getValueWithDefault({ + value: siblingData[field.name], + defaultValue: field.defaultValue, + locale: req.locale, + user: req.user, + }); + } + } + + // Execute hooks + if (field.hooks?.beforeChange) { + await field.hooks.beforeChange.reduce(async (priorHook, currentHook) => { + await priorHook; + + const hookedValue = await currentHook({ + value: siblingData[field.name], + originalDoc: doc, + data, + siblingData, + operation, + req, + }); + + if (hookedValue !== undefined) { + siblingData[field.name] = hookedValue; + } + }, Promise.resolve()); + } + + // Validate + if (!skipValidationFromHere && field.validate) { + let valueToValidate; + + if (['array', 'blocks'].includes(field.type)) { + const rows = siblingData[field.name]; + valueToValidate = Array.isArray(rows) ? rows.length : 0; + } else { + valueToValidate = siblingData[field.name]; + } + + const validationResult = await field.validate(valueToValidate, { + ...field, + data: merge(doc, data), + siblingData: merge(siblingDoc, siblingData), + id, + operation, + user: req.user, + payload: req.payload, + }); + + if (typeof validationResult === 'string') { + errors.push({ + message: validationResult, + field: `${path}${field.name}`, + }); + } + } + + // Push merge locale action if applicable + if (field.localized) { + mergeLocaleActions.push(() => { + const localeData = req.payload.config.localization.locales.reduce((locales, localeID) => { + let valueToSet = siblingData[field.name]; + + if (localeID !== req.locale) { + valueToSet = siblingDocWithLocales?.[field.name]?.[localeID]; + } + + if (typeof valueToSet !== 'undefined') { + return { + ...locales, + [localeID]: valueToSet, + }; + } + + return locales; + }, {}); + + // If there are locales with data, set the data + if (Object.keys(localeData).length > 0) { + siblingData[field.name] = localeData; + } + }); + } + } + + switch (field.type) { + case 'point': { + // Transform point data for storage + if (Array.isArray(siblingData[field.name]) && siblingData[field.name][0] !== null && siblingData[field.name][1] !== null) { + siblingData[field.name] = { + type: 'Point', + coordinates: [ + parseFloat(siblingData[field.name][0]), + parseFloat(siblingData[field.name][1]), + ], + }; + } + + break; + } + + case 'group': { + let groupData = siblingData[field.name] as Record<string, unknown>; + let groupDoc = siblingDoc[field.name] as Record<string, unknown>; + let groupDocWithLocales = siblingDocWithLocales[field.name] as Record<string, unknown>; + + if (typeof siblingData[field.name] !== 'object') groupData = {}; + if (typeof siblingDoc[field.name] !== 'object') groupDoc = {}; + if (typeof siblingDocWithLocales[field.name] !== 'object') groupDocWithLocales = {}; + + traverseFields({ + data, + doc, + docWithLocales, + errors, + fields: field.fields, + id, + mergeLocaleActions, + operation, + path: `${path}${field.name}.`, + promises, + req, + siblingData: groupData, + siblingDoc: groupDoc, + siblingDocWithLocales: groupDocWithLocales, + skipValidation: skipValidationFromHere, + }); + + break; + } + + case 'array': { + const rows = siblingData[field.name]; + + if (Array.isArray(rows)) { + rows.forEach((row, i) => { + traverseFields({ + data, + doc, + docWithLocales, + errors, + fields: field.fields, + id, + mergeLocaleActions, + operation, + path: `${path}${field.name}.${i}.`, + promises, + req, + siblingData: row, + siblingDoc: siblingDoc[field.name]?.[i] || {}, + siblingDocWithLocales: siblingDocWithLocales[field.name]?.[i] || {}, + skipValidation: skipValidationFromHere, + }); + }); + } + break; + } + + case 'blocks': { + const rows = siblingData[field.name]; + + if (Array.isArray(rows)) { + rows.forEach((row, i) => { + const block = field.blocks.find((blockType) => blockType.slug === row.blockType); + + if (block) { + traverseFields({ + data, + doc, + docWithLocales, + errors, + fields: block.fields, + id, + mergeLocaleActions, + operation, + path: `${path}${field.name}.${i}.`, + promises, + req, + siblingData: row, + siblingDoc: siblingDoc[field.name]?.[i] || {}, + siblingDocWithLocales: siblingDocWithLocales[field.name]?.[i] || {}, + skipValidation: skipValidationFromHere, + }); + } + }); + } + + break; + } + + case 'row': { + traverseFields({ + data, + doc, + docWithLocales, + errors, + fields: field.fields, + id, + mergeLocaleActions, + operation, + path, + promises, + req, + siblingData, + siblingDoc, + siblingDocWithLocales, + skipValidation: skipValidationFromHere, + }); + + break; + } + + default: { + break; + } + } +}; diff --git a/src/fields/hooks/beforeChange/traverseFields.ts b/src/fields/hooks/beforeChange/traverseFields.ts new file mode 100644 index 00000000000..2c25e8695aa --- /dev/null +++ b/src/fields/hooks/beforeChange/traverseFields.ts @@ -0,0 +1,60 @@ +import { Field } from '../../config/types'; +import { promise } from './promise'; +import { Operation } from '../../../types'; +import { PayloadRequest } from '../../../express/types'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + docWithLocales: Record<string, unknown> + errors: { message: string, field: string }[] + fields: Field[] + id?: string | number + mergeLocaleActions: (() => void)[] + operation: Operation + path: string + promises: Promise<void>[] + req: PayloadRequest + siblingData: Record<string, unknown> + siblingDoc: Record<string, unknown> + siblingDocWithLocales: Record<string, unknown> + skipValidation?: boolean +} + +export const traverseFields = ({ + data, + doc, + docWithLocales, + errors, + fields, + id, + mergeLocaleActions, + operation, + path, + promises, + req, + siblingData, + siblingDoc, + siblingDocWithLocales, + skipValidation, +}: Args): void => { + fields.forEach((field) => { + promises.push(promise({ + data, + doc, + docWithLocales, + errors, + field, + id, + mergeLocaleActions, + operation, + path, + promises, + req, + siblingData, + siblingDoc, + siblingDocWithLocales, + skipValidation, + })); + }); +}; diff --git a/src/fields/hooks/beforeValidate/index.ts b/src/fields/hooks/beforeValidate/index.ts new file mode 100644 index 00000000000..b69645e23ef --- /dev/null +++ b/src/fields/hooks/beforeValidate/index.ts @@ -0,0 +1,45 @@ +import { SanitizedCollectionConfig } from '../../../collections/config/types'; +import { SanitizedGlobalConfig } from '../../../globals/config/types'; +import { PayloadRequest } from '../../../express/types'; +import { traverseFields } from './traverseFields'; +import deepCopyObject from '../../../utilities/deepCopyObject'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + entityConfig: SanitizedCollectionConfig | SanitizedGlobalConfig + id?: string | number + operation: 'create' | 'update' + overrideAccess: boolean + req: PayloadRequest +} + +export const beforeValidate = async ({ + data: incomingData, + doc, + entityConfig, + id, + operation, + overrideAccess, + req, +}: Args): Promise<Record<string, unknown>> => { + const promises = []; + const data = deepCopyObject(incomingData); + + traverseFields({ + data, + doc, + fields: entityConfig.fields, + id, + operation, + overrideAccess, + promises, + req, + siblingData: data, + siblingDoc: doc, + }); + + await Promise.all(promises); + + return data; +}; diff --git a/src/fields/hooks/beforeValidate/promise.ts b/src/fields/hooks/beforeValidate/promise.ts new file mode 100644 index 00000000000..b1983f1651e --- /dev/null +++ b/src/fields/hooks/beforeValidate/promise.ts @@ -0,0 +1,273 @@ +/* eslint-disable no-param-reassign */ +import { PayloadRequest } from '../../../express/types'; +import { Field, fieldAffectsData, valueIsValueWithRelation } from '../../config/types'; +import { traverseFields } from './traverseFields'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + field: Field + id?: string | number + operation: 'create' | 'update' + overrideAccess: boolean + promises: Promise<void>[] + req: PayloadRequest + siblingData: Record<string, unknown> + siblingDoc: Record<string, unknown> +} + +// This function is responsible for the following actions, in order: +// - Sanitize incoming data +// - Execute field hooks +// - Execute field access control + +export const promise = async ({ + data, + doc, + field, + id, + operation, + overrideAccess, + promises, + req, + siblingData, + siblingDoc, +}: Args): Promise<void> => { + if (fieldAffectsData(field)) { + if (field.name === 'id') { + if (field.type === 'number' && typeof siblingData[field.name] === 'string') { + const value = siblingData[field.name] as string; + + siblingData[field.name] = parseFloat(value); + } + + if (field.type === 'text' && typeof siblingData[field.name]?.toString === 'function' && typeof siblingData[field.name] !== 'string') { + siblingData[field.name] = siblingData[field.name].toString(); + } + } + + // Sanitize incoming data + switch (field.type) { + case 'number': { + if (typeof siblingData[field.name] === 'string') { + const value = siblingData[field.name] as string; + const trimmed = value.trim(); + siblingData[field.name] = (trimmed.length === 0) ? null : parseFloat(trimmed); + } + + break; + } + + case 'checkbox': { + if (siblingData[field.name] === 'true') siblingData[field.name] = true; + if (siblingData[field.name] === 'false') siblingData[field.name] = false; + if (siblingData[field.name] === '') siblingData[field.name] = false; + + break; + } + + case 'richText': { + if (typeof siblingData[field.name] === 'string') { + try { + const richTextJSON = JSON.parse(siblingData[field.name] as string); + siblingData[field.name] = richTextJSON; + } catch { + // Disregard this data as it is not valid. + // Will be reported to user by field validation + } + } + + break; + } + + case 'relationship': + case 'upload': { + if (siblingData[field.name] === '' || siblingData[field.name] === 'none' || siblingData[field.name] === 'null' || siblingData[field.name] === null) { + if (field.type === 'relationship' && field.hasMany === true) { + siblingData[field.name] = []; + } else { + siblingData[field.name] = null; + } + } + + const value = siblingData[field.name]; + + if (Array.isArray(field.relationTo)) { + if (Array.isArray(value)) { + value.forEach((relatedDoc: { value: unknown, relationTo: string }, i) => { + const relatedCollection = req.payload.config.collections.find((collection) => collection.slug === relatedDoc.relationTo); + const relationshipIDField = relatedCollection.fields.find((collectionField) => fieldAffectsData(collectionField) && collectionField.name === 'id'); + if (relationshipIDField?.type === 'number') { + siblingData[field.name][i] = { ...relatedDoc, value: parseFloat(relatedDoc.value as string) }; + } + }); + } + if (field.type === 'relationship' && field.hasMany !== true && valueIsValueWithRelation(value)) { + const relatedCollection = req.payload.config.collections.find((collection) => collection.slug === value.relationTo); + const relationshipIDField = relatedCollection.fields.find((collectionField) => fieldAffectsData(collectionField) && collectionField.name === 'id'); + if (relationshipIDField?.type === 'number') { + siblingData[field.name] = { ...value, value: parseFloat(value.value as string) }; + } + } + } else { + if (Array.isArray(value)) { + value.forEach((relatedDoc: unknown, i) => { + const relatedCollection = req.payload.config.collections.find((collection) => collection.slug === field.relationTo); + const relationshipIDField = relatedCollection.fields.find((collectionField) => fieldAffectsData(collectionField) && collectionField.name === 'id'); + if (relationshipIDField?.type === 'number') { + siblingData[field.name][i] = parseFloat(relatedDoc as string); + } + }); + } + if (field.type === 'relationship' && field.hasMany !== true && value) { + const relatedCollection = req.payload.config.collections.find((collection) => collection.slug === field.relationTo); + const relationshipIDField = relatedCollection.fields.find((collectionField) => fieldAffectsData(collectionField) && collectionField.name === 'id'); + if (relationshipIDField?.type === 'number') { + siblingData[field.name] = parseFloat(value as string); + } + } + } + break; + } + + case 'array': + case 'blocks': { + // Handle cases of arrays being intentionally set to 0 + if (siblingData[field.name] === '0' || siblingData[field.name] === 0 || siblingData[field.name] === null) { + siblingData[field.name] = []; + } + + break; + } + + default: { + break; + } + } + + // Execute hooks + if (field.hooks?.beforeValidate) { + await field.hooks.beforeValidate.reduce(async (priorHook, currentHook) => { + await priorHook; + + const hookedValue = await currentHook({ + value: siblingData[field.name], + originalDoc: doc, + data, + siblingData, + operation, + req, + }); + + if (hookedValue !== undefined) { + siblingData[field.name] = hookedValue; + } + }, Promise.resolve()); + } + + // Execute access control + if (field.access && field.access[operation]) { + const result = overrideAccess ? true : await field.access[operation]({ req, id, siblingData, data, doc }); + + if (!result) { + delete siblingData[field.name]; + } + } + } + + // Traverse subfields + switch (field.type) { + case 'group': { + let groupData = siblingData[field.name] as Record<string, unknown>; + let groupDoc = siblingDoc[field.name] as Record<string, unknown>; + + if (typeof siblingData[field.name] !== 'object') groupData = {}; + if (typeof siblingDoc[field.name] !== 'object') groupDoc = {}; + + traverseFields({ + data, + doc, + fields: field.fields, + id, + operation, + overrideAccess, + promises, + req, + siblingData: groupData, + siblingDoc: groupDoc, + }); + + break; + } + + case 'array': { + const rows = siblingData[field.name]; + + if (Array.isArray(rows)) { + rows.forEach((row, i) => { + traverseFields({ + data, + doc, + fields: field.fields, + id, + operation, + overrideAccess, + promises, + req, + siblingData: row, + siblingDoc: siblingDoc[field.name]?.[i] || {}, + }); + }); + } + break; + } + + case 'blocks': { + const rows = siblingData[field.name]; + + if (Array.isArray(rows)) { + rows.forEach((row, i) => { + const block = field.blocks.find((blockType) => blockType.slug === row.blockType); + + if (block) { + traverseFields({ + data, + doc, + fields: block.fields, + id, + operation, + overrideAccess, + promises, + req, + siblingData: row, + siblingDoc: siblingDoc[field.name]?.[i] || {}, + }); + } + }); + } + + break; + } + + case 'row': { + traverseFields({ + data, + doc, + fields: field.fields, + id, + operation, + overrideAccess, + promises, + req, + siblingData, + siblingDoc, + }); + + break; + } + + default: { + break; + } + } +}; diff --git a/src/fields/hooks/beforeValidate/traverseFields.ts b/src/fields/hooks/beforeValidate/traverseFields.ts new file mode 100644 index 00000000000..eff408587fc --- /dev/null +++ b/src/fields/hooks/beforeValidate/traverseFields.ts @@ -0,0 +1,44 @@ +import { PayloadRequest } from '../../../express/types'; +import { Field } from '../../config/types'; +import { promise } from './promise'; + +type Args = { + data: Record<string, unknown> + doc: Record<string, unknown> + fields: Field[] + id?: string | number + operation: 'create' | 'update' + overrideAccess: boolean + promises: Promise<void>[] + req: PayloadRequest + siblingData: Record<string, unknown> + siblingDoc: Record<string, unknown> +} + +export const traverseFields = ({ + data, + doc, + fields, + id, + operation, + overrideAccess, + promises, + req, + siblingData, + siblingDoc, +}: Args): void => { + fields.forEach((field) => { + promises.push(promise({ + data, + doc, + field, + id, + operation, + overrideAccess, + promises, + req, + siblingData, + siblingDoc, + })); + }); +}; diff --git a/src/fields/performFieldOperations.ts b/src/fields/performFieldOperations.ts deleted file mode 100644 index 884c12fa973..00000000000 --- a/src/fields/performFieldOperations.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { Payload } from '..'; -import { ValidationError } from '../errors'; -import sanitizeFallbackLocale from '../localization/sanitizeFallbackLocale'; -import traverseFields from './traverseFields'; -import { SanitizedCollectionConfig } from '../collections/config/types'; -import { SanitizedGlobalConfig } from '../globals/config/types'; -import { Operation } from '../types'; -import { PayloadRequest } from '../express/types'; -import { HookName } from './config/types'; -import deepCopyObject from '../utilities/deepCopyObject'; - -type Arguments = { - data: Record<string, unknown> - operation: Operation - hook?: HookName - req: PayloadRequest - overrideAccess: boolean - flattenLocales?: boolean - unflattenLocales?: boolean - originalDoc?: Record<string, unknown> - docWithLocales?: Record<string, unknown> - id?: string | number - showHiddenFields?: boolean - depth?: number - currentDepth?: number - isVersion?: boolean - skipValidation?: boolean -} - -export default async function performFieldOperations(this: Payload, entityConfig: SanitizedCollectionConfig | SanitizedGlobalConfig, args: Arguments): Promise<any> { - const { - data, - originalDoc: fullOriginalDoc, - docWithLocales, - operation, - hook, - req, - id, - req: { - payloadAPI, - locale, - }, - overrideAccess, - flattenLocales, - unflattenLocales = false, - showHiddenFields = false, - isVersion = false, - skipValidation = false, - } = args; - - const fullData = deepCopyObject(data); - - const fallbackLocale = sanitizeFallbackLocale(req.fallbackLocale); - - let depth = 0; - - if (payloadAPI === 'REST' || payloadAPI === 'local') { - depth = (args.depth || args.depth === 0) ? parseInt(String(args.depth), 10) : this.config.defaultDepth; - - if (depth > this.config.maxDepth) depth = this.config.maxDepth; - } - - const currentDepth = args.currentDepth || 1; - - // Maintain a top-level list of promises - // so that all async field access / validations / hooks - // can run in parallel - const valuePromises = []; - const validationPromises = []; - const accessPromises = []; - const relationshipPopulations = []; - const hookPromises = []; - const unflattenLocaleActions = []; - const transformActions = []; - const errors: { message: string, field: string }[] = []; - - // ////////////////////////////////////////// - // Entry point for field validation - // ////////////////////////////////////////// - - traverseFields({ - fields: entityConfig.fields, - data: fullData, - originalDoc: fullOriginalDoc, - path: '', - flattenLocales, - locale, - fallbackLocale, - accessPromises, - operation, - overrideAccess, - req, - id, - relationshipPopulations, - depth, - currentDepth, - hook, - hookPromises, - fullOriginalDoc, - fullData, - valuePromises, - validationPromises, - errors, - payload: this, - showHiddenFields, - unflattenLocales, - unflattenLocaleActions, - transformActions, - docWithLocales, - isVersion, - skipValidation, - }); - - if (hook === 'afterRead') { - transformActions.forEach((action) => action()); - } - - const hookResults = hookPromises.map((promise) => promise()); - await Promise.all(hookResults); - - const valueResults = valuePromises.map((promise) => promise()); - await Promise.all(valueResults); - - const validationResults = validationPromises.map((promise) => promise()); - await Promise.all(validationResults); - - if (errors.length > 0) { - throw new ValidationError(errors); - } - - if (hook === 'beforeChange') { - transformActions.forEach((action) => action()); - } - - unflattenLocaleActions.forEach((action) => action()); - - const accessResults = accessPromises.map((promise) => promise()); - await Promise.all(accessResults); - - const relationshipPopulationResults = relationshipPopulations.map((population) => population()); - await Promise.all(relationshipPopulationResults); - - return fullData; -} diff --git a/src/fields/richText/populate.ts b/src/fields/richText/populate.ts index ad019ef39d3..82382da2176 100644 --- a/src/fields/richText/populate.ts +++ b/src/fields/richText/populate.ts @@ -1,6 +1,5 @@ /* eslint-disable @typescript-eslint/no-use-before-define */ import { Collection } from '../../collections/config/types'; -import { Payload } from '../..'; import { RichTextField, Field } from '../config/types'; import { PayloadRequest } from '../../express/types'; @@ -10,7 +9,6 @@ type Arguments = { key: string | number depth: number currentDepth?: number - payload: Payload field: RichTextField req: PayloadRequest showHiddenFields: boolean @@ -24,7 +22,6 @@ export const populate = async ({ overrideAccess, depth, currentDepth, - payload, req, showHiddenFields, }: Omit<Arguments, 'field'> & { @@ -34,7 +31,7 @@ export const populate = async ({ }): Promise<void> => { const dataRef = data as Record<string, unknown>; - const doc = await payload.findByID({ + const doc = await req.payload.findByID({ req, collection: collection.config.slug, id, diff --git a/src/fields/richText/recurseNestedFields.ts b/src/fields/richText/recurseNestedFields.ts index 921c28028f3..4bdb19738cd 100644 --- a/src/fields/richText/recurseNestedFields.ts +++ b/src/fields/richText/recurseNestedFields.ts @@ -1,5 +1,4 @@ /* eslint-disable @typescript-eslint/no-use-before-define */ -import { Payload } from '../..'; import { Field, fieldHasSubFields, fieldIsArrayType, fieldAffectsData } from '../config/types'; import { PayloadRequest } from '../../express/types'; import { populate } from './populate'; @@ -10,7 +9,6 @@ type NestedRichTextFieldsArgs = { data: unknown fields: Field[] req: PayloadRequest - payload: Payload overrideAccess: boolean depth: number currentDepth?: number @@ -22,7 +20,6 @@ export const recurseNestedFields = ({ data, fields, req, - payload, overrideAccess = false, depth, currentDepth = 0, @@ -34,7 +31,7 @@ export const recurseNestedFields = ({ if (field.hasMany && Array.isArray(data[field.name])) { if (Array.isArray(field.relationTo)) { data[field.name].forEach(({ relationTo, value }, i) => { - const collection = payload.collections[relationTo]; + const collection = req.payload.collections[relationTo]; if (collection) { promises.push(populate({ id: value, @@ -45,7 +42,6 @@ export const recurseNestedFields = ({ overrideAccess, depth, currentDepth, - payload, req, showHiddenFields, })); @@ -53,7 +49,7 @@ export const recurseNestedFields = ({ }); } else { data[field.name].forEach((id, i) => { - const collection = payload.collections[field.relationTo as string]; + const collection = req.payload.collections[field.relationTo as string]; if (collection) { promises.push(populate({ id, @@ -64,7 +60,6 @@ export const recurseNestedFields = ({ overrideAccess, depth, currentDepth, - payload, req, showHiddenFields, })); @@ -72,7 +67,7 @@ export const recurseNestedFields = ({ }); } } else if (Array.isArray(field.relationTo) && data[field.name]?.value && data[field.name]?.relationTo) { - const collection = payload.collections[data[field.name].relationTo]; + const collection = req.payload.collections[data[field.name].relationTo]; promises.push(populate({ id: data[field.name].value, field, @@ -82,14 +77,13 @@ export const recurseNestedFields = ({ overrideAccess, depth, currentDepth, - payload, req, showHiddenFields, })); } } if (typeof data[field.name] !== 'undefined' && typeof field.relationTo === 'string') { - const collection = payload.collections[field.relationTo]; + const collection = req.payload.collections[field.relationTo]; promises.push(populate({ id: data[field.name], field, @@ -99,7 +93,6 @@ export const recurseNestedFields = ({ overrideAccess, depth, currentDepth, - payload, req, showHiddenFields, })); @@ -111,7 +104,6 @@ export const recurseNestedFields = ({ data: data[field.name], fields: field.fields, req, - payload, overrideAccess, depth, currentDepth, @@ -123,7 +115,6 @@ export const recurseNestedFields = ({ data, fields: field.fields, req, - payload, overrideAccess, depth, currentDepth, @@ -140,7 +131,6 @@ export const recurseNestedFields = ({ data: data[field.name][i], fields: block.fields, req, - payload, overrideAccess, depth, currentDepth, @@ -157,7 +147,6 @@ export const recurseNestedFields = ({ data: data[field.name][i], fields: field.fields, req, - payload, overrideAccess, depth, currentDepth, @@ -173,7 +162,6 @@ export const recurseNestedFields = ({ recurseRichText({ req, children: node.children, - payload, overrideAccess, depth, currentDepth, diff --git a/src/fields/richText/relationshipPromise.ts b/src/fields/richText/relationshipPromise.ts index 8d3d963fbe8..f6a4bfbc0d4 100644 --- a/src/fields/richText/relationshipPromise.ts +++ b/src/fields/richText/relationshipPromise.ts @@ -1,17 +1,15 @@ -import { Payload } from '../..'; import { RichTextField } from '../config/types'; import { PayloadRequest } from '../../express/types'; import { recurseNestedFields } from './recurseNestedFields'; import { populate } from './populate'; -type Arguments = { - data: unknown - overrideAccess?: boolean - depth: number +type Args = { currentDepth?: number - payload: Payload + depth: number field: RichTextField + overrideAccess?: boolean req: PayloadRequest + siblingDoc: Record<string, unknown> showHiddenFields: boolean } @@ -20,7 +18,6 @@ type RecurseRichTextArgs = { overrideAccess: boolean depth: number currentDepth: number - payload: Payload field: RichTextField req: PayloadRequest promises: Promise<void>[] @@ -30,7 +27,6 @@ type RecurseRichTextArgs = { export const recurseRichText = ({ req, children, - payload, overrideAccess = false, depth, currentDepth = 0, @@ -40,7 +36,7 @@ export const recurseRichText = ({ }: RecurseRichTextArgs): void => { if (Array.isArray(children)) { (children as any[]).forEach((element) => { - const collection = payload.collections[element?.relationTo]; + const collection = req.payload.collections[element?.relationTo]; if ((element.type === 'relationship' || element.type === 'upload') && element?.value?.id @@ -52,7 +48,6 @@ export const recurseRichText = ({ data: element.fields || {}, fields: field.admin.upload.collections[element.relationTo].fields, req, - payload, overrideAccess, depth, currentDepth, @@ -67,7 +62,6 @@ export const recurseRichText = ({ overrideAccess, depth, currentDepth, - payload, field, collection, showHiddenFields, @@ -76,14 +70,13 @@ export const recurseRichText = ({ if (element?.children) { recurseRichText({ - req, children: element.children, - payload, - overrideAccess, - depth, currentDepth, + depth, field, + overrideAccess, promises, + req, showHiddenFields, }); } @@ -91,27 +84,25 @@ export const recurseRichText = ({ } }; -const richTextRelationshipPromise = ({ - req, - data, - payload, - overrideAccess, - depth, +const richTextRelationshipPromise = async ({ currentDepth, + depth, field, + overrideAccess, + req, + siblingDoc, showHiddenFields, -}: Arguments) => async (): Promise<void> => { +}: Args): Promise<void> => { const promises = []; recurseRichText({ - req, - children: data[field.name], - payload, - overrideAccess, - depth, + children: siblingDoc[field.name] as unknown[], currentDepth, + depth, field, + overrideAccess, promises, + req, showHiddenFields, }); diff --git a/src/fields/traverseFields.ts b/src/fields/traverseFields.ts deleted file mode 100644 index 105e0e4a6e4..00000000000 --- a/src/fields/traverseFields.ts +++ /dev/null @@ -1,427 +0,0 @@ -import validationPromise from './validationPromise'; -import accessPromise from './accessPromise'; -import hookPromise from './hookPromise'; -import { - Field, - fieldHasSubFields, - fieldIsArrayType, - fieldIsBlockType, - fieldAffectsData, - HookName, -} from './config/types'; -import { Operation } from '../types'; -import { PayloadRequest } from '../express/types'; -import { Payload } from '..'; -import richTextRelationshipPromise from './richText/relationshipPromise'; -import getValueWithDefault from './getDefaultValue'; - -type Arguments = { - fields: Field[] - data: Record<string, any> - originalDoc: Record<string, any> - path: string - flattenLocales: boolean - locale: string - fallbackLocale: string - accessPromises: (() => Promise<void>)[] - operation: Operation - overrideAccess: boolean - req: PayloadRequest - id?: string | number - relationshipPopulations: (() => Promise<void>)[] - depth: number - currentDepth: number - hook: HookName - hookPromises: (() => Promise<void>)[] - fullOriginalDoc: Record<string, any> - fullData: Record<string, any> - valuePromises: (() => Promise<void>)[] - validationPromises: (() => Promise<string | boolean>)[] - errors: { message: string, field: string }[] - payload: Payload - showHiddenFields: boolean - unflattenLocales: boolean - unflattenLocaleActions: (() => void)[] - transformActions: (() => void)[] - docWithLocales?: Record<string, any> - skipValidation?: boolean - isVersion: boolean -} - -const traverseFields = (args: Arguments): void => { - const { - fields, - data = {}, - originalDoc = {}, - path, - flattenLocales, - locale, - fallbackLocale, - accessPromises, - operation, - overrideAccess, - req, - id, - relationshipPopulations, - depth, - currentDepth, - hook, - hookPromises, - fullOriginalDoc, - fullData, - valuePromises, - validationPromises, - errors, - payload, - showHiddenFields, - unflattenLocaleActions, - unflattenLocales, - transformActions, - docWithLocales = {}, - skipValidation, - isVersion, - } = args; - - fields.forEach((field) => { - const dataCopy = data; - - if (hook === 'afterRead') { - if (field.type === 'group') { - // Fill groups with empty objects so fields with hooks within groups can populate - // themselves virtually as necessary - if (typeof data[field.name] === 'undefined' && typeof originalDoc[field.name] === 'undefined') { - data[field.name] = {}; - } - } - - if (fieldAffectsData(field) && field.hidden && typeof data[field.name] !== 'undefined' && !showHiddenFields) { - delete data[field.name]; - } - - if (field.type === 'point') { - transformActions.push(() => { - if (data[field.name]?.coordinates && Array.isArray(data[field.name].coordinates) && data[field.name].coordinates.length === 2) { - data[field.name] = data[field.name].coordinates; - } - }); - } - } - - if ((field.type === 'upload' || field.type === 'relationship') - && (data[field.name] === '' || data[field.name] === 'none' || data[field.name] === 'null')) { - if (field.type === 'relationship' && field.hasMany === true) { - dataCopy[field.name] = []; - } else { - dataCopy[field.name] = null; - } - } - - if (field.type === 'relationship' && field.hasMany && (data[field.name] === '' || data[field.name] === 'none' || data[field.name] === 'null' || data[field.name] === null)) { - dataCopy[field.name] = []; - } - - if (field.type === 'number' && typeof data[field.name] === 'string') { - const trimmed = data[field.name].trim(); - dataCopy[field.name] = (trimmed.length === 0) ? null : parseFloat(trimmed); - } - - if (fieldAffectsData(field) && field.name === 'id') { - if (field.type === 'number' && typeof data[field.name] === 'string') { - dataCopy[field.name] = parseFloat(data[field.name]); - } - if (field.type === 'text' && typeof data[field.name]?.toString === 'function' && typeof data[field.name] !== 'string') { - dataCopy[field.name] = dataCopy[field.name].toString(); - } - } - - if (field.type === 'checkbox') { - if (data[field.name] === 'true') dataCopy[field.name] = true; - if (data[field.name] === 'false') dataCopy[field.name] = false; - if (data[field.name] === '') dataCopy[field.name] = false; - } - - if (field.type === 'richText') { - if (typeof data[field.name] === 'string') { - try { - const richTextJSON = JSON.parse(data[field.name] as string); - dataCopy[field.name] = richTextJSON; - } catch { - // Disregard this data as it is not valid. - // Will be reported to user by field validation - } - } - - if (((field.admin?.elements?.includes('relationship') || field.admin?.elements?.includes('upload')) || !field?.admin?.elements) && hook === 'afterRead') { - relationshipPopulations.push(richTextRelationshipPromise({ - req, - data, - payload, - overrideAccess, - depth, - field, - currentDepth, - showHiddenFields, - })); - } - } - - const hasLocalizedValue = fieldAffectsData(field) - && (typeof data?.[field.name] === 'object' && data?.[field.name] !== null) - && field.name - && field.localized - && locale !== 'all' - && flattenLocales; - - if (hasLocalizedValue) { - let localizedValue = data[field.name][locale]; - if (typeof localizedValue === 'undefined' && fallbackLocale) localizedValue = data[field.name][fallbackLocale]; - if (typeof localizedValue === 'undefined' && field.type === 'group') localizedValue = {}; - if (typeof localizedValue === 'undefined') localizedValue = null; - dataCopy[field.name] = localizedValue; - } - - if (fieldAffectsData(field) && field.localized && unflattenLocales) { - unflattenLocaleActions.push(() => { - const localeData = payload.config.localization.locales.reduce((locales, localeID) => { - let valueToSet; - - if (localeID === locale) { - if (typeof data[field.name] !== 'undefined') { - valueToSet = data[field.name]; - } else if (docWithLocales?.[field.name]?.[localeID]) { - valueToSet = docWithLocales?.[field.name]?.[localeID]; - } - } else { - valueToSet = docWithLocales?.[field.name]?.[localeID]; - } - - if (typeof valueToSet !== 'undefined') { - return { - ...locales, - [localeID]: valueToSet, - }; - } - - return locales; - }, {}); - - // If there are locales with data, set the data - if (Object.keys(localeData).length > 0) { - data[field.name] = localeData; - } - }); - } - - if (fieldAffectsData(field)) { - accessPromises.push(() => accessPromise({ - data, - fullData, - originalDoc, - field, - operation, - overrideAccess, - req, - id, - relationshipPopulations, - depth, - currentDepth, - hook, - payload, - showHiddenFields, - })); - - hookPromises.push(() => hookPromise({ - data, - field, - hook, - req, - operation, - fullOriginalDoc, - fullData, - flattenLocales, - isVersion, - })); - } - - - const passesCondition = (field.admin?.condition && hook === 'beforeChange') ? field.admin.condition(fullData, data) : true; - const skipValidationFromHere = skipValidation || !passesCondition; - - if (fieldHasSubFields(field)) { - if (!fieldAffectsData(field)) { - traverseFields({ - ...args, - fields: field.fields, - skipValidation: skipValidationFromHere, - }); - } else if (fieldIsArrayType(field)) { - if (Array.isArray(data[field.name])) { - for (let i = 0; i < data[field.name].length; i += 1) { - if (typeof (data[field.name][i]) === 'undefined') { - data[field.name][i] = {}; - } - - traverseFields({ - ...args, - fields: field.fields, - data: data[field.name][i] || {}, - originalDoc: originalDoc?.[field.name]?.[i], - docWithLocales: docWithLocales?.[field.name]?.[i], - path: `${path}${field.name}.${i}.`, - skipValidation: skipValidationFromHere, - showHiddenFields, - }); - } - } - } else { - traverseFields({ - ...args, - fields: field.fields, - data: data[field.name] as Record<string, unknown>, - originalDoc: originalDoc[field.name], - docWithLocales: docWithLocales?.[field.name], - path: `${path}${field.name}.`, - skipValidation: skipValidationFromHere, - showHiddenFields, - }); - } - } - - if (fieldIsBlockType(field)) { - if (Array.isArray(data[field.name])) { - (data[field.name] as Record<string, unknown>[]).forEach((rowData, i) => { - const block = field.blocks.find((blockType) => blockType.slug === rowData.blockType); - - if (block) { - traverseFields({ - ...args, - fields: block.fields, - data: rowData || {}, - originalDoc: originalDoc?.[field.name]?.[i], - docWithLocales: docWithLocales?.[field.name]?.[i], - path: `${path}${field.name}.${i}.`, - skipValidation: skipValidationFromHere, - showHiddenFields, - }); - } - }); - } - } - - if (hook === 'beforeChange' && fieldAffectsData(field)) { - const updatedData = data; - - if (data?.[field.name] === undefined && originalDoc?.[field.name] === undefined && field.defaultValue) { - valuePromises.push(async () => { - let valueToUpdate = data?.[field.name]; - - if (typeof valueToUpdate === 'undefined' && typeof originalDoc?.[field.name] !== 'undefined') { - valueToUpdate = originalDoc?.[field.name]; - } - - const value = await getValueWithDefault({ value: valueToUpdate, defaultValue: field.defaultValue, locale, user: req.user }); - updatedData[field.name] = value; - }); - } - - if (field.type === 'relationship' || field.type === 'upload') { - if (Array.isArray(field.relationTo)) { - if (Array.isArray(dataCopy[field.name])) { - dataCopy[field.name].forEach((relatedDoc: { value: unknown, relationTo: string }, i) => { - const relatedCollection = payload.config.collections.find((collection) => collection.slug === relatedDoc.relationTo); - const relationshipIDField = relatedCollection.fields.find((collectionField) => fieldAffectsData(collectionField) && collectionField.name === 'id'); - if (relationshipIDField?.type === 'number') { - dataCopy[field.name][i] = { ...relatedDoc, value: parseFloat(relatedDoc.value as string) }; - } - }); - } - if (field.type === 'relationship' && field.hasMany !== true && dataCopy[field.name]?.relationTo) { - const relatedCollection = payload.config.collections.find((collection) => collection.slug === dataCopy[field.name].relationTo); - const relationshipIDField = relatedCollection.fields.find((collectionField) => fieldAffectsData(collectionField) && collectionField.name === 'id'); - if (relationshipIDField?.type === 'number') { - dataCopy[field.name] = { ...dataCopy[field.name], value: parseFloat(dataCopy[field.name].value as string) }; - } - } - } else { - if (Array.isArray(dataCopy[field.name])) { - dataCopy[field.name].forEach((relatedDoc: unknown, i) => { - const relatedCollection = payload.config.collections.find((collection) => collection.slug === field.relationTo); - const relationshipIDField = relatedCollection.fields.find((collectionField) => fieldAffectsData(collectionField) && collectionField.name === 'id'); - if (relationshipIDField?.type === 'number') { - dataCopy[field.name][i] = parseFloat(relatedDoc as string); - } - }); - } - if (field.type === 'relationship' && field.hasMany !== true && dataCopy[field.name]) { - const relatedCollection = payload.config.collections.find((collection) => collection.slug === field.relationTo); - const relationshipIDField = relatedCollection.fields.find((collectionField) => fieldAffectsData(collectionField) && collectionField.name === 'id'); - if (relationshipIDField?.type === 'number') { - dataCopy[field.name] = parseFloat(dataCopy[field.name]); - } - } - } - } - - if (field.type === 'point' && data[field.name]) { - transformActions.push(() => { - if (Array.isArray(data[field.name]) && data[field.name][0] !== null && data[field.name][1] !== null) { - data[field.name] = { - type: 'Point', - coordinates: [ - parseFloat(data[field.name][0]), - parseFloat(data[field.name][1]), - ], - }; - } - }); - } - - if (field.type === 'array' || field.type === 'blocks') { - const hasRowsOfNewData = Array.isArray(data[field.name]); - const newRowCount = hasRowsOfNewData ? (data[field.name] as Record<string, unknown>[]).length : undefined; - - // Handle cases of arrays being intentionally set to 0 - if (data[field.name] === '0' || data[field.name] === 0 || data[field.name] === null) { - updatedData[field.name] = []; - } - - const hasRowsOfExistingData = Array.isArray(originalDoc[field.name]); - const existingRowCount = hasRowsOfExistingData ? originalDoc[field.name].length : 0; - - validationPromises.push(() => validationPromise({ - errors, - hook, - data: { [field.name]: newRowCount }, - fullData, - originalDoc: { [field.name]: existingRowCount }, - fullOriginalDoc, - field, - path, - skipValidation: skipValidationFromHere, - payload: req.payload, - user: req.user, - operation, - id, - })); - } else if (fieldAffectsData(field)) { - validationPromises.push(() => validationPromise({ - errors, - hook, - data, - fullData, - originalDoc, - fullOriginalDoc, - field, - path, - skipValidation: skipValidationFromHere, - user: req.user, - operation, - id, - payload: req.payload, - })); - } - } - }); -}; - -export default traverseFields; diff --git a/src/fields/validationPromise.ts b/src/fields/validationPromise.ts deleted file mode 100644 index 3d7d47d560d..00000000000 --- a/src/fields/validationPromise.ts +++ /dev/null @@ -1,67 +0,0 @@ -import merge from 'deepmerge'; -import { Payload } from '..'; -import { User } from '../auth'; -import { Operation } from '../types'; -import { HookName, FieldAffectingData } from './config/types'; - -type Arguments = { - hook: HookName - field: FieldAffectingData - path: string - errors: {message: string, field: string}[] - data: Record<string, unknown> - fullData: Record<string, unknown> - originalDoc: Record<string, unknown> - fullOriginalDoc: Record<string, unknown> - id?: string | number - skipValidation?: boolean - user: User - operation: Operation - payload: Payload -} - -const validationPromise = async ({ - errors, - hook, - originalDoc, - fullOriginalDoc, - data, - fullData, - id, - field, - path, - skipValidation, - user, - operation, - payload, -}: Arguments): Promise<string | boolean> => { - if (hook !== 'beforeChange' || skipValidation) return true; - - const hasCondition = field.admin && field.admin.condition; - const shouldValidate = field.validate && !hasCondition; - - let valueToValidate = data?.[field.name]; - if (valueToValidate === undefined) valueToValidate = originalDoc?.[field.name]; - if (valueToValidate === undefined) valueToValidate = field.defaultValue; - - const result = shouldValidate ? await field.validate(valueToValidate, { - ...field, - data: merge(fullOriginalDoc, fullData), - siblingData: merge(originalDoc, data), - id, - operation, - user, - payload, - }) : true; - - if (typeof result === 'string') { - errors.push({ - message: result, - field: `${path}${field.name}`, - }); - } - - return result; -}; - -export default validationPromise; diff --git a/src/globals/operations/findOne.ts b/src/globals/operations/findOne.ts index 2a4aa21e3ee..d27eab6b3b9 100644 --- a/src/globals/operations/findOne.ts +++ b/src/globals/operations/findOne.ts @@ -4,6 +4,7 @@ import { Where } from '../../types'; import { AccessResult } from '../../config/types'; import sanitizeInternalFields from '../../utilities/sanitizeInternalFields'; import replaceWithDraftIfAvailable from '../../versions/drafts/replaceWithDraftIfAvailable'; +import { afterRead } from '../../fields/hooks/afterRead'; async function findOne(args) { const { globals: { Model } } = this; @@ -79,7 +80,7 @@ async function findOne(args) { } // ///////////////////////////////////// - // 3. Execute before collection hook + // Execute before global hook // ///////////////////////////////////// await globalConfig.hooks.beforeRead.reduce(async (priorHook, hook) => { @@ -92,21 +93,20 @@ async function findOne(args) { }, Promise.resolve()); // ///////////////////////////////////// - // 4. Execute field-level hooks and access + // Execute field-level hooks and access // ///////////////////////////////////// - doc = await this.performFieldOperations(globalConfig, { - data: doc, - hook: 'afterRead', - operation: 'read', - req, + doc = await afterRead({ depth, - flattenLocales: true, + doc, + entityConfig: globalConfig, + req, + overrideAccess, showHiddenFields, }); // ///////////////////////////////////// - // 5. Execute after collection hook + // Execute after global hook // ///////////////////////////////////// await globalConfig.hooks.afterRead.reduce(async (priorHook, hook) => { @@ -119,7 +119,7 @@ async function findOne(args) { }, Promise.resolve()); // ///////////////////////////////////// - // 6. Return results + // Return results // ///////////////////////////////////// return doc; diff --git a/src/globals/operations/findVersionByID.ts b/src/globals/operations/findVersionByID.ts index d6a07c606fd..f06ded0698c 100644 --- a/src/globals/operations/findVersionByID.ts +++ b/src/globals/operations/findVersionByID.ts @@ -7,6 +7,7 @@ import { Where } from '../../types'; import { hasWhereAccessResult } from '../../auth/types'; import { TypeWithVersion } from '../../versions/types'; import { SanitizedGlobalConfig } from '../config/types'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { globalConfig: SanitizedGlobalConfig @@ -105,16 +106,12 @@ async function findVersionByID<T extends TypeWithVersion<T> = any>(args: Argumen // afterRead - Fields // ///////////////////////////////////// - result.version = await this.performFieldOperations(globalConfig, { + result.version = await afterRead({ depth, + doc: result.version, + entityConfig: globalConfig, req, - id, - data: result.version, - hook: 'afterRead', - operation: 'read', - currentDepth, overrideAccess, - flattenLocales: true, showHiddenFields, }); diff --git a/src/globals/operations/findVersions.ts b/src/globals/operations/findVersions.ts index f4238aeb855..e53ebc4cdc1 100644 --- a/src/globals/operations/findVersions.ts +++ b/src/globals/operations/findVersions.ts @@ -8,6 +8,7 @@ import flattenWhereConstraints from '../../utilities/flattenWhereConstraints'; import { buildSortParam } from '../../mongoose/buildSortParam'; import { TypeWithVersion } from '../../versions/types'; import { SanitizedGlobalConfig } from '../config/types'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { globalConfig: SanitizedGlobalConfig @@ -108,21 +109,14 @@ async function findVersions<T extends TypeWithVersion<T> = any>(args: Arguments) ...paginatedDocs, docs: await Promise.all(paginatedDocs.docs.map(async (data) => ({ ...data, - version: await this.performFieldOperations( - globalConfig, - { - depth, - data: data.version, - req, - id: data.version.id, - hook: 'afterRead', - operation: 'read', - overrideAccess, - flattenLocales: true, - showHiddenFields, - isVersion: true, - }, - ), + version: await afterRead({ + depth, + doc: data.version, + entityConfig: globalConfig, + req, + overrideAccess, + showHiddenFields, + }), }))), }; diff --git a/src/globals/operations/restoreVersion.ts b/src/globals/operations/restoreVersion.ts index 0d4ffdf5cf8..e47f88ede8d 100644 --- a/src/globals/operations/restoreVersion.ts +++ b/src/globals/operations/restoreVersion.ts @@ -6,6 +6,8 @@ import { TypeWithVersion } from '../../versions/types'; import { SanitizedGlobalConfig } from '../config/types'; import { Payload } from '../..'; import { NotFound } from '../../errors'; +import { afterChange } from '../../fields/hooks/afterChange'; +import { afterRead } from '../../fields/hooks/afterRead'; export type Arguments = { globalConfig: SanitizedGlobalConfig @@ -83,22 +85,20 @@ async function restoreVersion<T extends TypeWithVersion<T> = any>(this: Payload, // afterRead - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(globalConfig, { - data: result, - hook: 'afterRead', - operation: 'read', - req, + result = await afterRead({ depth, - showHiddenFields, - flattenLocales: true, + doc: result, + entityConfig: globalConfig, + req, overrideAccess, + showHiddenFields, }); // ///////////////////////////////////// // afterRead - Global // ///////////////////////////////////// - await globalConfig.hooks.afterChange.reduce(async (priorHook, hook) => { + await globalConfig.hooks.afterRead.reduce(async (priorHook, hook) => { await priorHook; result = await hook({ @@ -111,14 +111,12 @@ async function restoreVersion<T extends TypeWithVersion<T> = any>(this: Payload, // afterChange - Fields // ///////////////////////////////////// - result = await this.performFieldOperations(globalConfig, { + result = await afterChange({ data: result, - hook: 'afterChange', + doc: result, + entityConfig: globalConfig, operation: 'update', req, - depth, - overrideAccess, - showHiddenFields, }); // ///////////////////////////////////// diff --git a/src/globals/operations/update.ts b/src/globals/operations/update.ts index e49ca2adaf1..57ba9ee789f 100644 --- a/src/globals/operations/update.ts +++ b/src/globals/operations/update.ts @@ -8,6 +8,10 @@ import { saveGlobalDraft } from '../../versions/drafts/saveGlobalDraft'; import { ensurePublishedGlobalVersion } from '../../versions/ensurePublishedGlobalVersion'; import cleanUpFailedVersion from '../../versions/cleanUpFailedVersion'; import { hasWhereAccessResult } from '../../auth'; +import { beforeChange } from '../../fields/hooks/beforeChange'; +import { beforeValidate } from '../../fields/hooks/beforeValidate'; +import { afterChange } from '../../fields/hooks/afterChange'; +import { afterRead } from '../../fields/hooks/afterRead'; async function update<T extends TypeWithID = any>(this: Payload, args): Promise<T> { const { globals: { Model } } = this; @@ -63,26 +67,24 @@ async function update<T extends TypeWithID = any>(this: Payload, args): Promise< // ///////////////////////////////////// let global: any = await Model.findOne(query); - let globalJSON; + let globalJSON: Record<string, unknown> = {}; if (global) { globalJSON = global.toJSON({ virtuals: true }); - globalJSON = JSON.stringify(globalJSON); - globalJSON = JSON.parse(globalJSON); + const globalJSONString = JSON.stringify(globalJSON); + globalJSON = JSON.parse(globalJSONString); if (globalJSON._id) { delete globalJSON._id; } } - const originalDoc = await this.performFieldOperations(globalConfig, { + const originalDoc = await afterRead({ depth, + doc: globalJSON, + entityConfig: globalConfig, req, - data: globalJSON, - hook: 'afterRead', - operation: 'update', overrideAccess: true, - flattenLocales: true, showHiddenFields, }); @@ -90,13 +92,13 @@ async function update<T extends TypeWithID = any>(this: Payload, args): Promise< // beforeValidate - Fields // ///////////////////////////////////// - data = await this.performFieldOperations(globalConfig, { + data = await beforeValidate({ data, - req, - originalDoc, - hook: 'beforeValidate', + doc: originalDoc, + entityConfig: globalConfig, operation: 'update', overrideAccess, + req, }); // ///////////////////////////////////// @@ -131,15 +133,13 @@ async function update<T extends TypeWithID = any>(this: Payload, args): Promise< // beforeChange - Fields // ///////////////////////////////////// - const result = await this.performFieldOperations(globalConfig, { + const result = await beforeChange({ data, - req, - hook: 'beforeChange', - operation: 'update', - unflattenLocales: true, - originalDoc, + doc: originalDoc, docWithLocales: globalJSON, - overrideAccess, + entityConfig: globalConfig, + operation: 'update', + req, skipValidation: shouldSaveDraft, }); @@ -205,15 +205,13 @@ async function update<T extends TypeWithID = any>(this: Payload, args): Promise< // afterRead - Fields // ///////////////////////////////////// - global = await this.performFieldOperations(globalConfig, { - data: global, - hook: 'afterRead', - operation: 'read', - req, + global = await afterRead({ depth, - showHiddenFields, - flattenLocales: true, + doc: global, + entityConfig: globalConfig, + req, overrideAccess, + showHiddenFields, }); // ///////////////////////////////////// @@ -233,14 +231,12 @@ async function update<T extends TypeWithID = any>(this: Payload, args): Promise< // afterChange - Fields // ///////////////////////////////////// - global = await this.performFieldOperations(globalConfig, { - data: global, - hook: 'afterChange', + global = await afterChange({ + data, + doc: global, + entityConfig: globalConfig, operation: 'update', req, - depth, - overrideAccess, - showHiddenFields, }); // ///////////////////////////////////// diff --git a/src/graphql/schema/buildObjectType.ts b/src/graphql/schema/buildObjectType.ts index 4d1ff6643a6..0fb961128fe 100644 --- a/src/graphql/schema/buildObjectType.ts +++ b/src/graphql/schema/buildObjectType.ts @@ -14,7 +14,7 @@ import { GraphQLUnionType, } from 'graphql'; import { DateTimeResolver, EmailAddressResolver } from 'graphql-scalars'; -import { Field, RadioField, RelationshipField, SelectField, UploadField, optionIsObject, ArrayField, GroupField, RichTextField, fieldAffectsData, NumberField, TextField, EmailField, TextareaField, CodeField, DateField, PointField, CheckboxField, BlockField, RowField, fieldIsPresentationalOnly } from '../../fields/config/types'; +import { Field, RadioField, RelationshipField, SelectField, UploadField, ArrayField, GroupField, RichTextField, fieldAffectsData, NumberField, TextField, EmailField, TextareaField, CodeField, DateField, PointField, CheckboxField, BlockField, RowField, fieldIsPresentationalOnly } from '../../fields/config/types'; import formatName from '../utilities/formatName'; import combineParentName from '../utilities/combineParentName'; import withNullableType from './withNullableType'; @@ -50,16 +50,13 @@ function buildObjectType(name: string, fields: Field[], parentName: string, base type: withNullableType(field, GraphQLJSON), async resolve(parent, args, context) { if (args.depth > 0) { - const richTextRelationshipPromise = createRichTextRelationshipPromise({ + await createRichTextRelationshipPromise({ req: context.req, - data: parent, - payload: context.req.payload, + siblingDoc: parent, depth: args.depth, field, showHiddenFields: false, }); - - await richTextRelationshipPromise(); } return parent[field.name]; diff --git a/src/index.ts b/src/index.ts index 139e9cf60f2..2b953925b8b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,7 +34,6 @@ import bindResolvers, { GraphQLResolvers } from './graphql/bindResolvers'; import buildEmail from './email/build'; import identifyAPI from './express/middleware/identifyAPI'; import errorHandler, { ErrorHandler } from './express/middleware/errorHandler'; -import performFieldOperations from './fields/performFieldOperations'; import localOperations from './collections/operations/local'; import localGlobalOperations from './globals/operations/local'; import { encrypt, decrypt } from './auth/crypto'; @@ -110,8 +109,6 @@ export class Payload { authenticate: PayloadAuthenticate; - performFieldOperations: typeof performFieldOperations; - requestHandlers: RequestHandlers; /** @@ -148,8 +145,6 @@ export class Payload { bindRequestHandlers(this); bindResolvers(this); - this.performFieldOperations = performFieldOperations.bind(this); - // If not initializing locally, scaffold router if (!this.local) { this.router = express.Router(); diff --git a/src/versions/drafts/saveCollectionDraft.ts b/src/versions/drafts/saveCollectionDraft.ts index 21308a44947..3656d1ce10b 100644 --- a/src/versions/drafts/saveCollectionDraft.ts +++ b/src/versions/drafts/saveCollectionDraft.ts @@ -18,7 +18,7 @@ export const saveCollectionDraft = async ({ id, data, autosave, -}: Args): Promise<void> => { +}: Args): Promise<Record<string, unknown>> => { const VersionsModel = payload.versions[config.slug]; let existingAutosaveVersion; diff --git a/src/versions/ensurePublishedCollectionVersion.ts b/src/versions/ensurePublishedCollectionVersion.ts index c3ef36e2fd9..b7700ecc800 100644 --- a/src/versions/ensurePublishedCollectionVersion.ts +++ b/src/versions/ensurePublishedCollectionVersion.ts @@ -2,6 +2,7 @@ import { Payload } from '..'; import { SanitizedCollectionConfig } from '../collections/config/types'; import { enforceMaxVersions } from './enforceMaxVersions'; import { PayloadRequest } from '../express/types'; +import { afterRead } from '../fields/hooks/afterRead'; type Args = { payload: Payload @@ -43,15 +44,12 @@ export const ensurePublishedCollectionVersion = async ({ }); if (moreRecentDrafts?.length === 0) { - const version = await payload.performFieldOperations(config, { - id, + const version = await afterRead({ depth: 0, + doc: docWithLocales, + entityConfig: config, req, - data: docWithLocales, - hook: 'afterRead', - operation: 'update', overrideAccess: true, - flattenLocales: false, showHiddenFields: true, }); diff --git a/src/versions/ensurePublishedGlobalVersion.ts b/src/versions/ensurePublishedGlobalVersion.ts index 570d051b65e..9f5520c0e12 100644 --- a/src/versions/ensurePublishedGlobalVersion.ts +++ b/src/versions/ensurePublishedGlobalVersion.ts @@ -2,6 +2,7 @@ import { Payload } from '..'; import { enforceMaxVersions } from './enforceMaxVersions'; import { PayloadRequest } from '../express/types'; import { SanitizedGlobalConfig } from '../globals/config/types'; +import { afterRead } from '../fields/hooks/afterRead'; type Args = { payload: Payload @@ -38,14 +39,12 @@ export const ensurePublishedGlobalVersion = async ({ }); if (moreRecentDrafts?.length === 0) { - const version = await payload.performFieldOperations(config, { + const version = await afterRead({ depth: 0, + doc: docWithLocales, + entityConfig: config, req, - data: docWithLocales, - hook: 'afterRead', - operation: 'update', overrideAccess: true, - flattenLocales: false, showHiddenFields: true, }); diff --git a/src/versions/saveCollectionVersion.ts b/src/versions/saveCollectionVersion.ts index 85f0cd7983b..55a596d65f3 100644 --- a/src/versions/saveCollectionVersion.ts +++ b/src/versions/saveCollectionVersion.ts @@ -3,6 +3,7 @@ import { SanitizedCollectionConfig } from '../collections/config/types'; import { enforceMaxVersions } from './enforceMaxVersions'; import { PayloadRequest } from '../express/types'; import sanitizeInternalFields from '../utilities/sanitizeInternalFields'; +import { afterRead } from '../fields/hooks/afterRead'; type Args = { payload: Payload @@ -55,16 +56,14 @@ export const saveCollectionVersion = async ({ } } - version = await payload.performFieldOperations(config, { - id, + version = await afterRead({ depth: 0, + doc: version, + entityConfig: config, req, - data: version, - hook: 'afterRead', - operation: 'update', overrideAccess: true, - flattenLocales: false, showHiddenFields: true, + flattenLocales: false, }); if (version._id) delete version._id; diff --git a/src/versions/saveGlobalVersion.ts b/src/versions/saveGlobalVersion.ts index b7c2e488511..e4239c2dde6 100644 --- a/src/versions/saveGlobalVersion.ts +++ b/src/versions/saveGlobalVersion.ts @@ -3,6 +3,7 @@ import { enforceMaxVersions } from './enforceMaxVersions'; import { PayloadRequest } from '../express/types'; import { SanitizedGlobalConfig } from '../globals/config/types'; import sanitizeInternalFields from '../utilities/sanitizeInternalFields'; +import { afterRead } from '../fields/hooks/afterRead'; type Args = { payload: Payload @@ -50,14 +51,13 @@ export const saveGlobalVersion = async ({ } } - version = await payload.performFieldOperations(config, { + version = await afterRead({ depth: 0, - req, - data: version, - hook: 'afterRead', - operation: 'update', - overrideAccess: true, + doc: version, + entityConfig: config, flattenLocales: false, + overrideAccess: true, + req, showHiddenFields: true, });
9705e351b3e1427fb0173a0147560541c517df9a
2022-08-08 05:35:28
James
chore: improves comments
false
improves comments
chore
diff --git a/src/plugin.ts b/src/plugin.ts index ae5d30db7f2..61377af1656 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -9,8 +9,8 @@ import { getFields } from './fields/getFields' // to cloud storage instead of solely storing files locally. // It is based on an adapter approach, where adapters can be written for any cloud provider. -// Adapters are responsible for providing three actions that this plugin will use: -// 1. handleUpload, 2. handleDelete, 3. generateURL +// Adapters are responsible for providing four actions that this plugin will use: +// 1. handleUpload, 2. handleDelete, 3. generateURL, 4. staticHandler // Optionally, the adapter can specify any Webpack config overrides if they are necessary.
3d2e167e781267502b6407c40b86d69af7b8b2bb
2023-10-06 19:32:04
Elliot DeNolf
chore: proper postgres adapter import replacement
false
proper postgres adapter import replacement
chore
diff --git a/src/lib/packages.ts b/src/lib/packages.ts index c9ccd54b3e2..0fe53a6346b 100644 --- a/src/lib/packages.ts +++ b/src/lib/packages.ts @@ -23,11 +23,11 @@ const mongodbReplacement: DbAdapterReplacement = { ], } -const postgresqlReplacement: DbAdapterReplacement = { - packageName: '@payloadcms/db-postgresql', - importReplacement: "import { postgresqlAdapter } from '@payloadcms/db-postgresql'", +const postgresReplacement: DbAdapterReplacement = { + packageName: '@payloadcms/db-postgres', + importReplacement: "import { postgresAdapter } from '@payloadcms/db-postgres'", configReplacement: [ - ' db: postgresqlAdapter({', + ' db: postgresAdapter({', ' client: {', ' connectionString: process.env.DATABASE_URI,', ' },', @@ -37,7 +37,7 @@ const postgresqlReplacement: DbAdapterReplacement = { export const dbPackages: Record<DbType, DbAdapterReplacement> = { mongodb: mongodbReplacement, - postgres: postgresqlReplacement, + postgres: postgresReplacement, } const webpackReplacement: BundlerReplacement = {
e8b47eef2ff821945547dc70f41773cb4d74de9b
2024-03-14 21:45:58
Elliot DeNolf
chore(plugin-sentry): migrate esm, remove webpack
false
migrate esm, remove webpack
chore
diff --git a/packages/plugin-sentry/src/plugin.ts b/packages/plugin-sentry/src/plugin.ts index 3706ea1e97d..c371bfdb777 100644 --- a/packages/plugin-sentry/src/plugin.ts +++ b/packages/plugin-sentry/src/plugin.ts @@ -1,22 +1,15 @@ /* eslint-disable no-console */ import type { Config } from 'payload/config' -import type { PluginOptions } from './types' +import type { PluginOptions } from './types.js' -import { captureException } from './captureException' -import { startSentry } from './startSentry' -import { extendWebpackConfig } from './webpack' +import { captureException } from './captureException.js' +import { startSentry } from './startSentry.js' export const sentry = (pluginOptions: PluginOptions) => (incomingConfig: Config): Config => { const config = { ...incomingConfig } - const webpack = extendWebpackConfig(incomingConfig) - - config.admin = { - ...(config.admin || {}), - webpack, - } if (pluginOptions.enabled === false || !pluginOptions.dsn) { return config diff --git a/packages/plugin-sentry/src/webpack.ts b/packages/plugin-sentry/src/webpack.ts deleted file mode 100644 index e1221d7a072..00000000000 --- a/packages/plugin-sentry/src/webpack.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Config } from 'payload/config' -import type { Configuration as WebpackConfig } from 'webpack' - -import path from 'path' - -export const extendWebpackConfig = - (config: Config): ((webpackConfig: WebpackConfig) => WebpackConfig) => - (webpackConfig) => { - const existingWebpackConfig = - typeof config.admin?.webpack === 'function' - ? config.admin.webpack(webpackConfig) - : webpackConfig - - const mockModulePath = path.resolve(__dirname, './mocks/mockFile.js') - - const newWebpack = { - ...existingWebpackConfig, - resolve: { - ...(existingWebpackConfig.resolve || {}), - alias: { - ...(existingWebpackConfig.resolve?.alias ? existingWebpackConfig.resolve.alias : {}), - [path.resolve(__dirname, './captureException')]: mockModulePath, - [path.resolve(__dirname, './startSentry')]: mockModulePath, - }, - }, - } - - return newWebpack - } diff --git a/test/plugin-sentry/config.ts b/test/plugin-sentry/config.ts index e0ecd81086c..a02be63fae8 100644 --- a/test/plugin-sentry/config.ts +++ b/test/plugin-sentry/config.ts @@ -6,34 +6,34 @@ import { Users } from './collections/Users.js' import { testErrors } from './components.js' export default buildConfigWithDefaults({ - collections: [Posts, Users], admin: { - user: Users.slug, components: { beforeDashboard: [testErrors], }, + user: Users.slug, + }, + collections: [Posts, Users], + onInit: async (payload) => { + await payload.create({ + collection: 'users', + data: { + email: devUser.email, + password: devUser.password, + }, + }) }, plugins: [ sentry({ dsn: 'https://61edebe5ee6d4d38a9d6459c7323d777@o4505289711681536.ingest.sentry.io/4505357688242176', options: { + captureErrors: [400, 403, 404], init: { debug: true, }, requestHandler: { serverName: false, }, - captureErrors: [400, 403, 404], }, }), ], - onInit: async (payload) => { - await payload.create({ - collection: 'users', - data: { - email: devUser.email, - password: devUser.password, - }, - }) - }, })
4607dbf97694bc899e597e9c7df50b6c878874f5
2023-10-31 02:43:40
James
fix: ensures dataloader does not run requests in parallel
false
ensures dataloader does not run requests in parallel
fix
diff --git a/packages/payload/src/collections/dataloader.ts b/packages/payload/src/collections/dataloader.ts index 8824af77ec0..d9556408899 100644 --- a/packages/payload/src/collections/dataloader.ts +++ b/packages/payload/src/collections/dataloader.ts @@ -88,7 +88,9 @@ const batchAndLoadDocs = // Run find requests in parallel - const results = Object.entries(batchByFindArgs).map(async ([batchKey, ids]) => { + await Object.entries(batchByFindArgs).reduce(async (priorFind, [batchKey, ids]) => { + await priorFind + const [ transactionID, collection, @@ -141,9 +143,7 @@ const batchAndLoadDocs = docs[docsIndex] = doc } }) - }) - - await Promise.all(results) + }, Promise.resolve()) // Return docs array, // which has now been injected with all fetched docs
9c0aadd04696857ffc5731ae171f62c7b015ea38
2023-09-26 08:57:58
Elliot DeNolf
chore: migration dir and migration template updates
false
migration dir and migration template updates
chore
diff --git a/.gitignore b/.gitignore index 267459bd148..e2acfc06623 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ dist .idea test-results .devcontainer -.migrations +/migrations # Created by https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode # Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,windows,webstorm,sublimetext,visualstudiocode diff --git a/.vscode/launch.json b/.vscode/launch.json index ebd1e7e69bc..14f63a57762 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -34,7 +34,7 @@ "command": "ts-node ./packages/payload/src/bin/index.ts migrate", "env": { "PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts", - "PAYLOAD_DATABASE": "mongoose", + "PAYLOAD_DATABASE": "postgres", "DISABLE_SWC": "true" // SWC messes up debugging the bin scripts // "PAYLOAD_DROP_DATABASE": "true", }, @@ -47,7 +47,7 @@ "command": "ts-node ./packages/payload/src/bin/index.ts migrate:status", "env": { "PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts", - "PAYLOAD_DATABASE": "mongoose", + "PAYLOAD_DATABASE": "postgres", "DISABLE_SWC": "true" // SWC messes up debugging the bin scripts // "PAYLOAD_DROP_DATABASE": "true", }, @@ -60,7 +60,7 @@ "command": "ts-node ./packages/payload/src/bin/index.ts migrate:create yass", "env": { "PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts", - "PAYLOAD_DATABASE": "mongoose", + "PAYLOAD_DATABASE": "postgres", "DISABLE_SWC": "true" // SWC messes up debugging the bin scripts // "PAYLOAD_DROP_DATABASE": "true", }, diff --git a/packages/db-postgres/.gitignore b/packages/db-postgres/.gitignore new file mode 100644 index 00000000000..fc990800176 --- /dev/null +++ b/packages/db-postgres/.gitignore @@ -0,0 +1 @@ +/migrations diff --git a/packages/db-postgres/src/connect.ts b/packages/db-postgres/src/connect.ts index be7707a01ac..6850f5c1bec 100644 --- a/packages/db-postgres/src/connect.ts +++ b/packages/db-postgres/src/connect.ts @@ -29,8 +29,8 @@ export const connect: Connect = async function connect(this: PostgresAdapter, pa this.pool = new Pool(this.client) await this.pool.connect() + this.db = drizzle(this.pool, { schema: this.schema }) if (process.env.PAYLOAD_DROP_DATABASE === 'true') { - this.db = drizzle(this.pool, { schema: this.schema }) this.payload.logger.info('---- DROPPING TABLES ----') await this.db.execute(sql`drop schema public cascade;\ncreate schema public;`) this.payload.logger.info('---- DROPPED TABLES ----') @@ -43,7 +43,7 @@ export const connect: Connect = async function connect(this: PostgresAdapter, pa this.payload.logger.info('Connected to Postgres successfully') // Only push schema if not in production - if (process.env.NODE_ENV === 'production') return + if (process.env.NODE_ENV === 'production' || process.env.PAYLOAD_MIGRATING === 'true') return // This will prompt if clarifications are needed for Drizzle to push new schema const { apply, hasDataLoss, statementsToExecute, warnings } = await pushSchema( diff --git a/packages/db-postgres/src/createMigration.ts b/packages/db-postgres/src/createMigration.ts index 02c57aa4814..816def5f2f1 100644 --- a/packages/db-postgres/src/createMigration.ts +++ b/packages/db-postgres/src/createMigration.ts @@ -8,13 +8,20 @@ import fs from 'fs' import type { PostgresAdapter } from './types' const migrationTemplate = (upSQL?: string) => ` -import payload, { Payload } from 'payload'; +import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/db-postgres/types' +import { sql } from 'drizzle-orm' -export async function up(payload: Payload): Promise<void> { - ${upSQL ? `await payload.db.db.execute(\`${upSQL}\`);` : '// Migration code'} +export async function up({ payload }: MigrateUpArgs): Promise<void> { +${ + upSQL + ? `await payload.db.db.execute(sql\` +${upSQL}\`); + ` + : '// Migration code' +} }; -export async function down(payload: Payload): Promise<void> { +export async function down({ payload }: MigrateDownArgs): Promise<void> { // Migration code }; ` @@ -22,11 +29,10 @@ export async function down(payload: Payload): Promise<void> { export const createMigration: CreateMigration = async function createMigration( this: PostgresAdapter, payload, - migrationDir, migrationName, ) { payload.logger.info({ msg: 'Creating migration from postgres adapter...' }) - const dir = migrationDir || 'migrations' + const dir = payload.db.migrationDir if (!fs.existsSync(dir)) { fs.mkdirSync(dir) } @@ -41,32 +47,36 @@ export const createMigration: CreateMigration = async function createMigration( const fileName = `${timestamp}_${formattedName}.ts` const filePath = `${dir}/${fileName}` - const migrationQuery = await payload.find({ - collection: 'payload-migrations', - limit: 1, - sort: '-name', - }) - - const drizzleJsonBefore = migrationQuery.docs[0]?.schema as DrizzleSnapshotJSON - - const drizzleJsonAfter = generateDrizzleJson(this.schema) - const sqlStatements = await generateMigration( - drizzleJsonBefore || { - id: '00000000-0000-0000-0000-000000000000', - _meta: { - columns: {}, - schemas: {}, - tables: {}, - }, - dialect: 'pg', - enums: {}, - prevId: '00000000-0000-0000-0000-000000000000', + let drizzleJsonBefore: DrizzleSnapshotJSON = { + id: '00000000-0000-0000-0000-000000000000', + _meta: { + columns: {}, schemas: {}, tables: {}, - version: '5', }, - drizzleJsonAfter, - ) + dialect: 'pg', + enums: {}, + prevId: '00000000-0000-0000-0000-000000000000', + schemas: {}, + tables: {}, + version: '5', + } + + const exists = false // TODO: Check if migrations table exists + if (exists) { + const migrationQuery = await payload.find({ + collection: 'payload-migrations', + limit: 1, + sort: '-name', + }) + + if (migrationQuery.docs?.[0]?.schema) { + drizzleJsonBefore = migrationQuery.docs[0]?.schema as DrizzleSnapshotJSON + } + } + + const drizzleJsonAfter = generateDrizzleJson(this.schema) + const sqlStatements = await generateMigration(drizzleJsonBefore, drizzleJsonAfter) fs.writeFileSync( filePath, diff --git a/packages/db-postgres/src/index.ts b/packages/db-postgres/src/index.ts index 047991a15cb..5765e2a6f99 100644 --- a/packages/db-postgres/src/index.ts +++ b/packages/db-postgres/src/index.ts @@ -1,5 +1,6 @@ import type { Payload } from 'payload' +import path from 'path' import { createDatabaseAdapter } from 'payload/database' import type { Args, PostgresAdapter, PostgresAdapterResult } from './types' @@ -19,6 +20,7 @@ import { findGlobalVersions } from './findGlobalVersions' import { findOne } from './findOne' import { findVersions } from './findVersions' import { init } from './init' +import { migrate } from './migrate' import { queryDrafts } from './queryDrafts' import { beginTransaction } from './transactions/beginTransaction' import { commitTransaction } from './transactions/commitTransaction' @@ -33,12 +35,12 @@ import { webpack } from './webpack' export function postgresAdapter(args: Args): PostgresAdapterResult { function adapter({ payload }: { payload: Payload }) { + const migrationDir = args.migrationDir || path.resolve(__dirname, '../../../migrations') + return createDatabaseAdapter<PostgresAdapter>({ ...args, beginTransaction, commitTransaction, - pool: undefined, - ...(args.migrationDir && { migrationDir: args.migrationDir }), connect, create, createGlobal, @@ -48,6 +50,8 @@ export function postgresAdapter(args: Args): PostgresAdapterResult { db: undefined, defaultIDType: 'number', findGlobalVersions, + migrationDir, + pool: undefined, // destroy, name: 'postgres', deleteMany, @@ -59,6 +63,7 @@ export function postgresAdapter(args: Args): PostgresAdapterResult { findOne, findVersions, init, + migrate, payload, queryDrafts, relations: {}, diff --git a/packages/db-postgres/src/migrate.ts b/packages/db-postgres/src/migrate.ts index eafb2ef8a66..8e0941f56f1 100644 --- a/packages/db-postgres/src/migrate.ts +++ b/packages/db-postgres/src/migrate.ts @@ -10,19 +10,26 @@ import type { PostgresAdapter } from './types' export async function migrate(this: PostgresAdapter): Promise<void> { const { payload } = this const migrationFiles = await readMigrationFiles({ payload }) - const migrationQuery = await payload.find({ - collection: 'payload-migrations', - limit: 0, - sort: '-name', - }) - const latestBatch = Number(migrationQuery.docs[0]?.batch ?? 0) + let latestBatch = 0 + let existingMigrations = [] + const exists = false + if (exists) { + ;({ docs: existingMigrations } = await payload.find({ + collection: 'payload-migrations', + limit: 0, + sort: '-name', + })) + if (typeof existingMigrations[0]?.batch !== 'undefined') { + latestBatch = Number(existingMigrations[0]?.batch) + } + } const newBatch = latestBatch + 1 // Execute 'up' function for each migration sequentially for (const migration of migrationFiles) { - const existingMigration = migrationQuery.docs.find( + const existingMigration = existingMigrations.find( (existing) => existing.name === migration.name, ) diff --git a/packages/db-postgres/src/types.ts b/packages/db-postgres/src/types.ts index ca9b6d440fd..1080ab319d7 100644 --- a/packages/db-postgres/src/types.ts +++ b/packages/db-postgres/src/types.ts @@ -62,3 +62,6 @@ export type PostgresAdapter = DatabaseAdapter & } export type PostgresAdapterResult = (args: { payload: Payload }) => PostgresAdapter + +export type MigrateUpArgs = { payload: Payload } +export type MigrateDownArgs = { payload: Payload } diff --git a/packages/payload/src/bin/migrate.ts b/packages/payload/src/bin/migrate.ts index b028dec6f12..23f160dfbde 100644 --- a/packages/payload/src/bin/migrate.ts +++ b/packages/payload/src/bin/migrate.ts @@ -13,10 +13,12 @@ const availableCommands = [ const availableCommandsMsg = `Available commands: ${availableCommands.join(', ')}` export const migrate = async (args: string[]): Promise<void> => { + process.env.PAYLOAD_MIGRATING = 'true' + // Barebones instance to access database adapter await payload.init({ local: true, - secret: '--unused--', + secret: process.env.PAYLOAD_SECRET || '--unused--', }) const adapter = payload.db diff --git a/packages/payload/src/database/migrations/migrateStatus.ts b/packages/payload/src/database/migrations/migrateStatus.ts index 7969c16a8c3..571dbec2071 100644 --- a/packages/payload/src/database/migrations/migrateStatus.ts +++ b/packages/payload/src/database/migrations/migrateStatus.ts @@ -13,7 +13,14 @@ export async function migrateStatus(this: DatabaseAdapter): Promise<void> { msg: `Found ${migrationFiles.length} migration files.`, }) - const { existingMigrations } = await getMigrations({ payload }) + // TODO: check if migrations table exists + const exists = false + + let existingMigrations = [] + + if (exists) { + ;({ existingMigrations } = await getMigrations({ payload })) + } if (!migrationFiles.length) { payload.logger.info({ msg: 'No migrations found.' }) diff --git a/packages/payload/src/database/types.ts b/packages/payload/src/database/types.ts index 070ad38212f..6b7bb88ae63 100644 --- a/packages/payload/src/database/types.ts +++ b/packages/payload/src/database/types.ts @@ -101,7 +101,7 @@ export interface DatabaseAdapter { /** * Path to read and write migration files from */ - migrationDir?: string + migrationDir: string /** * The name of the database adapter */ diff --git a/test/buildConfigWithDefaults.ts b/test/buildConfigWithDefaults.ts index afee7a37d8d..c4443d7bb55 100644 --- a/test/buildConfigWithDefaults.ts +++ b/test/buildConfigWithDefaults.ts @@ -19,6 +19,7 @@ const databaseAdapters = { client: { connectionString: process.env.POSTGRES_URL || 'postgres://127.0.0.1:5432/payloadtests', }, + migrationDir: path.resolve(__dirname, '../packages/db-postgres/migrations'), }), }
de5bf6ea280f771e96de703b3732f851903b1fe5
2021-01-23 23:13:42
James
feat: adds contributing guidelines
false
adds contributing guidelines
feat
diff --git a/contributing.md b/contributing.md new file mode 100644 index 00000000000..a0dfa634986 --- /dev/null +++ b/contributing.md @@ -0,0 +1,33 @@ +# Contributing to Payload CMS + +Below you'll find a set of guidelines for how to contribute to Payload CMS. + +## Payload is proprietary software + +Even though you can read Payload's source code, it's technically not "open source". Payload requires an active license to be used in all production purposes. That said, we do not expect PRs from the public, but we still welcome pull requests of any kind. + +## Opening issues + +Before you submit an issue, please check all existing [open and closed issues](https://github.com/payloadcms/payload/issues) to see if your issue has previously been resolved or is already known. If there is already an issue logged, feel free to upvote it by adding a :thumbsup: [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). If you would like to submit a new issue, please fill out our Issue Template to the best of your ability so we can accurately understand your report. + +## Security issues & vulnerabilities + +If you come across an issue related to security, or a potential attack vector within Payload or one of its dependencies, please DO NOT create a publicly viewable issue. Instead, please contact us directly at [`[email protected]`](mailto:[email protected]). We will do everything we can to respond to the issue as soon as possible. + +If you find a vulnerability within the core Payload repository, and we determine that it is remediable and of significant nature, we will be happy to pay you a reward for your findings and diligence. [`Contact us`](mailto:[email protected]) to find out more. + +## Documentation edits + +Payload documentation can be found directly within its codebase and you can feel free to make changes / improvements to any of it through opening a PR. We utilize these files directly in our website and will periodically deploy documentation updates as necessary. + +## Building additional features + +If you're an incredibly awesome person and want to help us make Payload even better through new features or additions, we would be thrilled to work with you. If your proposed feature is accepted by our team and is significant enough, pending our discretion, we'd be happy to hook you up with a pro-bono license. + +To help us work on new features, you can reach out to our Development team at [`[email protected]`](mailto:[email protected]). Be as complete and descriptive as possible regarding your vision and we'll go from there! + +## Pull Requests + +For all Pull Requests, you should be extremely descriptive about both your problem and proposed solution. If there are any affected open or closed issues, please leave the issue number in your PR message. + +By opening a Pull Request against Payload's codebase, you automatically give the entirety of the contribution within your PR to Payload CMS, LLC and retain no personal ownership whatsoever afterward. For more information, please read the full [Payload license](https://github.com/payloadcms/payload/blob/master/license.md).
f1ba9ca82a78e35901dfd8b1f2910fc1312a9f4d
2024-11-07 03:19:06
Patrik
chore: updates flaky locked-documents e2e tests (#9055)
false
updates flaky locked-documents e2e tests (#9055)
chore
diff --git a/test/locked-documents/e2e.spec.ts b/test/locked-documents/e2e.spec.ts index 1b1059bb5fe..029b5bbad75 100644 --- a/test/locked-documents/e2e.spec.ts +++ b/test/locked-documents/e2e.spec.ts @@ -2,7 +2,6 @@ import type { Page } from '@playwright/test' import type { TypeWithID } from 'payload' import { expect, test } from '@playwright/test' -import exp from 'constants' import * as path from 'path' import { mapAsync } from 'payload' import { wait } from 'payload/shared' @@ -142,6 +141,11 @@ describe('locked documents', () => { }) afterAll(async () => { + await payload.delete({ + collection: 'users', + id: user2.id, + }) + await payload.delete({ collection: lockedDocumentCollection, id: lockedDoc.id, @@ -166,11 +170,6 @@ describe('locked documents', () => { collection: 'tests', id: testDoc.id, }) - - await payload.delete({ - collection: 'users', - id: user2.id, - }) }) test('should show lock icon on document row if locked', async () => { @@ -396,14 +395,19 @@ describe('locked documents', () => { }) afterAll(async () => { + await payload.delete({ + collection: 'users', + id: user2.id, + }) + await payload.delete({ collection: lockedDocumentCollection, - id: expiredDocOne.id, + id: expiredLockedDocOne.id, }) await payload.delete({ collection: lockedDocumentCollection, - id: expiredDocTwo.id, + id: expiredLockedDocTwo.id, }) await payload.delete({ @@ -640,7 +644,7 @@ describe('locked documents', () => { beforeAll(async () => { postDoc = await createPostDoc({ - text: 'hello', + text: 'new post doc', }) expiredTestDoc = await createTestDoc({ @@ -715,20 +719,6 @@ describe('locked documents', () => { }) test('should show Document Locked modal for incoming user when entering locked document', async () => { - const lockedDoc = await payload.find({ - collection: lockedDocumentCollection, - limit: 1, - pagination: false, - where: { - 'document.value': { equals: postDoc.id }, - }, - }) - - expect(lockedDoc.docs.length).toBe(1) - - // eslint-disable-next-line payload/no-wait-function - await wait(500) - await page.goto(postsUrl.list) await page.waitForURL(new RegExp(postsUrl.list)) @@ -748,20 +738,6 @@ describe('locked documents', () => { }) test('should not show Document Locked modal for incoming user when entering expired locked document', async () => { - const lockedDoc = await payload.find({ - collection: lockedDocumentCollection, - limit: 1, - pagination: false, - where: { - 'document.value': { equals: expiredTestDoc.id }, - }, - }) - - expect(lockedDoc.docs.length).toBe(1) - - // eslint-disable-next-line payload/no-wait-function - await wait(500) - await page.goto(testsUrl.list) await page.waitForURL(new RegExp(testsUrl.list)) @@ -1004,6 +980,11 @@ describe('locked documents', () => { collection: 'users', id: user2.id, }) + + await payload.delete({ + collection: 'posts', + id: postDoc.id, + }) }) test('should show Document Take Over modal for previous user if taken over', async () => { await page.goto(postsUrl.edit(postDoc.id)) @@ -1184,11 +1165,11 @@ describe('locked documents', () => { }, }) - lockedMenuGlobal = await payload.create({ + lockedAdminGlobal = await payload.create({ collection: lockedDocumentCollection, data: { document: undefined, - globalSlug: 'menu', + globalSlug: 'admin', user: { relationTo: 'users', value: user2.id, @@ -1196,11 +1177,11 @@ describe('locked documents', () => { }, }) - lockedAdminGlobal = await payload.create({ + lockedMenuGlobal = await payload.create({ collection: lockedDocumentCollection, data: { document: undefined, - globalSlug: 'admin', + globalSlug: 'menu', user: { relationTo: 'users', value: user2.id, @@ -1214,6 +1195,16 @@ describe('locked documents', () => { collection: 'users', id: user2.id, }) + + await payload.delete({ + collection: lockedDocumentCollection, + id: lockedAdminGlobal.id, + }) + + await payload.delete({ + collection: lockedDocumentCollection, + id: lockedMenuGlobal.id, + }) }) test('should show lock on document card in dashboard view if locked', async () => {
e20ea342c2e88f6943945e4436b8561c798d7657
2024-03-22 22:08:25
Elliot DeNolf
chore: more specific prettierignore
false
more specific prettierignore
chore
diff --git a/.prettierignore b/.prettierignore index 17883dc0e52..c357830ebe2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,4 +9,4 @@ **/node_modules **/temp **/docs/** -tsconfig.json +./tsconfig.json
84e03893fd737c09f755605e37927262b83e2960
2023-01-12 02:28:58
James
chore: begins local api abstraction
false
begins local api abstraction
chore
diff --git a/src/collections/initHTTP.ts b/src/collections/initHTTP.ts new file mode 100644 index 00000000000..038e4512583 --- /dev/null +++ b/src/collections/initHTTP.ts @@ -0,0 +1,41 @@ +import express from 'express'; +import passport from 'passport'; +import apiKeyStrategy from '../auth/strategies/apiKey'; +import bindCollectionMiddleware from './bindCollection'; +import { SanitizedCollectionConfig } from './config/types'; +import mountEndpoints from '../express/mountEndpoints'; +import buildEndpoints from './buildEndpoints'; +import { PayloadHTTP } from '..'; + +export default function initCollectionsHTTP(ctx: PayloadHTTP): void { + ctx.config.collections = ctx.config.collections.map((collection: SanitizedCollectionConfig) => { + const formattedCollection = collection; + + const router = express.Router(); + const { slug } = collection; + + router.all('*', bindCollectionMiddleware(ctx.collections[formattedCollection.slug])); + + if (collection.auth) { + const AuthCollection = ctx.collections[formattedCollection.slug]; + + if (collection.auth.useAPIKey) { + passport.use(`${AuthCollection.config.slug}-api-key`, apiKeyStrategy(ctx, AuthCollection)); + } + + if (Array.isArray(collection.auth.strategies)) { + collection.auth.strategies.forEach(({ name, strategy }, index) => { + const passportStrategy = typeof strategy === 'object' ? strategy : strategy(ctx); + passport.use(`${AuthCollection.config.slug}-${name ?? index}`, passportStrategy); + }); + } + } + + const endpoints = buildEndpoints(collection); + mountEndpoints(ctx.express, router, endpoints); + + ctx.router.use(`/${slug}`, router); + + return formattedCollection; + }); +} diff --git a/src/collections/init.ts b/src/collections/initLocal.ts similarity index 68% rename from src/collections/init.ts rename to src/collections/initLocal.ts index 00626d12528..cfb2f0d43c2 100644 --- a/src/collections/init.ts +++ b/src/collections/initLocal.ts @@ -1,21 +1,15 @@ import mongoose, { UpdateAggregationStage, UpdateQuery } from 'mongoose'; import paginate from 'mongoose-paginate-v2'; -import express from 'express'; -import passport from 'passport'; import passportLocalMongoose from 'passport-local-mongoose'; import { buildVersionCollectionFields } from '../versions/buildCollectionFields'; import buildQueryPlugin from '../mongoose/buildQuery'; -import apiKeyStrategy from '../auth/strategies/apiKey'; import buildCollectionSchema from './buildSchema'; import buildSchema from '../mongoose/buildSchema'; -import bindCollectionMiddleware from './bindCollection'; import { CollectionModel, SanitizedCollectionConfig } from './config/types'; -import { Payload } from '../index'; +import { Payload } from '../payload'; import { getVersionsModelName } from '../versions/getVersionsModelName'; -import mountEndpoints from '../express/mountEndpoints'; -import buildEndpoints from './buildEndpoints'; -export default function registerCollections(ctx: Payload): void { +export default function initCollectionsLocal(ctx: Payload): void { ctx.config.collections = ctx.config.collections.map((collection: SanitizedCollectionConfig) => { const formattedCollection = collection; @@ -91,34 +85,6 @@ export default function registerCollections(ctx: Payload): void { config: formattedCollection, }; - // If not local, open routes - if (!ctx.local) { - const router = express.Router(); - const { slug } = collection; - - router.all('*', bindCollectionMiddleware(ctx.collections[formattedCollection.slug])); - - if (collection.auth) { - const AuthCollection = ctx.collections[formattedCollection.slug]; - - if (collection.auth.useAPIKey) { - passport.use(`${AuthCollection.config.slug}-api-key`, apiKeyStrategy(ctx, AuthCollection)); - } - - if (Array.isArray(collection.auth.strategies)) { - collection.auth.strategies.forEach(({ name, strategy }, index) => { - const passportStrategy = typeof strategy === 'object' ? strategy : strategy(ctx); - passport.use(`${AuthCollection.config.slug}-${name ?? index}`, passportStrategy); - }); - } - } - - const endpoints = buildEndpoints(collection); - mountEndpoints(ctx.express, router, endpoints); - - ctx.router.use(`/${slug}`, router); - } - return formattedCollection; }); } diff --git a/src/globals/initHTTP.ts b/src/globals/initHTTP.ts new file mode 100644 index 00000000000..fb9e80c13a5 --- /dev/null +++ b/src/globals/initHTTP.ts @@ -0,0 +1,19 @@ +import express from 'express'; +import mountEndpoints from '../express/mountEndpoints'; +import buildEndpoints from './buildEndpoints'; +import { SanitizedGlobalConfig } from './config/types'; +import { PayloadHTTP } from '..'; + +export default function initGlobals(ctx: PayloadHTTP): void { + if (ctx.config.globals) { + ctx.config.globals.forEach((global: SanitizedGlobalConfig) => { + const router = express.Router(); + const { slug } = global; + + const endpoints = buildEndpoints(global); + mountEndpoints(ctx.express, router, endpoints); + + ctx.router.use(`/globals/${slug}`, router); + }); + } +} diff --git a/src/globals/init.ts b/src/globals/initLocal.ts similarity index 64% rename from src/globals/init.ts rename to src/globals/initLocal.ts index 8558aa2cbfb..15175a891e6 100644 --- a/src/globals/init.ts +++ b/src/globals/initLocal.ts @@ -1,18 +1,14 @@ -import express from 'express'; import mongoose from 'mongoose'; import paginate from 'mongoose-paginate-v2'; import buildQueryPlugin from '../mongoose/buildQuery'; import buildModel from './buildModel'; -import { Payload } from '../index'; +import { Payload } from '../payload'; import { getVersionsModelName } from '../versions/getVersionsModelName'; import { buildVersionGlobalFields } from '../versions/buildGlobalFields'; import buildSchema from '../mongoose/buildSchema'; import { CollectionModel } from '../collections/config/types'; -import mountEndpoints from '../express/mountEndpoints'; -import buildEndpoints from './buildEndpoints'; -import { SanitizedGlobalConfig } from './config/types'; -export default function initGlobals(ctx: Payload): void { +export default function initGlobalsLocal(ctx: Payload): void { if (ctx.config.globals) { ctx.globals = { Model: buildModel(ctx.config), @@ -41,18 +37,5 @@ export default function initGlobals(ctx: Payload): void { ctx.versions[global.slug] = mongoose.model(versionModelName, versionSchema) as CollectionModel; } }); - - // If not local, open routes - if (!ctx.local) { - ctx.config.globals.forEach((global: SanitizedGlobalConfig) => { - const router = express.Router(); - const { slug } = global; - - const endpoints = buildEndpoints(global); - mountEndpoints(ctx.express, router, endpoints); - - ctx.router.use(`/globals/${slug}`, router); - }); - } } } diff --git a/src/index.ts b/src/index.ts index 319a5e9fc53..5c73e690a6e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,280 +1,13 @@ -import { Express, Router } from 'express'; -import pino from 'pino'; -import { GraphQLError, GraphQLFormattedError, GraphQLSchema } from 'graphql'; import { - TypeWithID, - Collection, - CollectionModel, -} from './collections/config/types'; -import { - SanitizedConfig, - EmailOptions, InitOptions, } from './config/types'; -import { TypeWithVersion } from './versions/types'; -import { PaginatedDocs } from './mongoose/types'; - -import { PayloadAuthenticate } from './express/middleware/authenticate'; -import { Globals, TypeWithID as GlobalTypeWithID } from './globals/config/types'; -import { ErrorHandler } from './express/middleware/errorHandler'; -import localOperations from './collections/operations/local'; -import localGlobalOperations from './globals/operations/local'; -import { encrypt, decrypt } from './auth/crypto'; -import { BuildEmailResult, Message } from './email/types'; -import { Preferences } from './preferences/types'; - -import { Options as CreateOptions } from './collections/operations/local/create'; -import { Options as FindOptions } from './collections/operations/local/find'; -import { Options as FindByIDOptions } from './collections/operations/local/findByID'; -import { Options as UpdateOptions } from './collections/operations/local/update'; -import { Options as DeleteOptions } from './collections/operations/local/delete'; -import { Options as FindVersionsOptions } from './collections/operations/local/findVersions'; -import { Options as FindVersionByIDOptions } from './collections/operations/local/findVersionByID'; -import { Options as RestoreVersionOptions } from './collections/operations/local/restoreVersion'; -import { Options as FindGlobalVersionsOptions } from './globals/operations/local/findVersions'; -import { Options as FindGlobalVersionByIDOptions } from './globals/operations/local/findVersionByID'; -import { Options as RestoreGlobalVersionOptions } from './globals/operations/local/restoreVersion'; -import { Options as ForgotPasswordOptions } from './auth/operations/local/forgotPassword'; -import { Options as LoginOptions } from './auth/operations/local/login'; -import { Options as ResetPasswordOptions } from './auth/operations/local/resetPassword'; -import { Options as UnlockOptions } from './auth/operations/local/unlock'; -import { Options as VerifyEmailOptions } from './auth/operations/local/verifyEmail'; -import { Result as ForgotPasswordResult } from './auth/operations/forgotPassword'; -import { Result as ResetPasswordResult } from './auth/operations/resetPassword'; -import { Result as LoginResult } from './auth/operations/login'; -import { Options as FindGlobalOptions } from './globals/operations/local/findOne'; -import { Options as UpdateGlobalOptions } from './globals/operations/local/update'; -import { initSync, initAsync } from './init'; +import { initHTTP } from './initHTTP'; +import { Payload, getPayload } from './payload'; require('isomorphic-fetch'); -/** - * @description Payload - */ -export class Payload { - config: SanitizedConfig; - - collections: { - [slug: string]: Collection; - } = {} - - versions: { - [slug: string]: CollectionModel; - } = {} - - preferences: Preferences; - - globals: Globals; - - logger: pino.Logger; - - express: Express - - router: Router; - - emailOptions: EmailOptions; - - email: BuildEmailResult; - - sendEmail: (message: Message) => Promise<unknown>; - - secret: string; - - mongoURL: string | false; - - mongoMemoryServer: any - - local: boolean; - - encrypt = encrypt; - - decrypt = decrypt; - - errorHandler: ErrorHandler; - - authenticate: PayloadAuthenticate; - - types: { - blockTypes: any; - blockInputTypes: any; - localeInputType?: any; - fallbackLocaleInputType?: any; - }; - - Query: { name: string; fields: { [key: string]: any } } = { name: 'Query', fields: {} }; - - Mutation: { name: string; fields: { [key: string]: any } } = { name: 'Mutation', fields: {} }; - - schema: GraphQLSchema; - - extensions: (info: any) => Promise<any>; - - customFormatErrorFn: (error: GraphQLError) => GraphQLFormattedError; - - validationRules: any; - - errorResponses: GraphQLFormattedError[] = []; - - errorIndex: number; - - /** - * @description Initializes Payload - * @param options - */ - init(options: InitOptions): void { - initSync(this, options); - } - - async initAsync(options: InitOptions): Promise<void> { - await initAsync(this, options); - } - - getAdminURL = (): string => `${this.config.serverURL}${this.config.routes.admin}`; - - getAPIURL = (): string => `${this.config.serverURL}${this.config.routes.api}`; - - /** - * @description Performs create operation - * @param options - * @returns created document - */ - create = async <T = any>(options: CreateOptions<T>): Promise<T> => { - const { create } = localOperations; - return create(this, options); - } - - /** - * @description Find documents with criteria - * @param options - * @returns documents satisfying query - */ - find = async <T extends TypeWithID = any>(options: FindOptions): Promise<PaginatedDocs<T>> => { - const { find } = localOperations; - return find(this, options); - } - - findGlobal = async <T extends GlobalTypeWithID = any>(options: FindGlobalOptions): Promise<T> => { - const { findOne } = localGlobalOperations; - return findOne(this, options); - } - - updateGlobal = async <T extends GlobalTypeWithID = any>(options: UpdateGlobalOptions): Promise<T> => { - const { update } = localGlobalOperations; - return update(this, options); - } - - /** - * @description Find global versions with criteria - * @param options - * @returns versions satisfying query - */ - findGlobalVersions = async <T extends TypeWithVersion<T> = any>(options: FindGlobalVersionsOptions): Promise<PaginatedDocs<T>> => { - const { findVersions } = localGlobalOperations; - return findVersions<T>(this, options); - } - - /** - * @description Find global version by ID - * @param options - * @returns global version with specified ID - */ - findGlobalVersionByID = async <T extends TypeWithVersion<T> = any>(options: FindGlobalVersionByIDOptions): Promise<T> => { - const { findVersionByID } = localGlobalOperations; - return findVersionByID(this, options); - } - - /** - * @description Restore global version by ID - * @param options - * @returns version with specified ID - */ - restoreGlobalVersion = async <T extends TypeWithVersion<T> = any>(options: RestoreGlobalVersionOptions): Promise<T> => { - const { restoreVersion } = localGlobalOperations; - return restoreVersion(this, options); - } - - /** - * @description Find document by ID - * @param options - * @returns document with specified ID - */ - findByID = async <T extends TypeWithID = any>(options: FindByIDOptions): Promise<T> => { - const { findByID } = localOperations; - return findByID<T>(this, options); - } - - /** - * @description Update document - * @param options - * @returns Updated document - */ - update = async <T = any>(options: UpdateOptions<T>): Promise<T> => { - const { update } = localOperations; - return update<T>(this, options); - } - - delete = async <T extends TypeWithID = any>(options: DeleteOptions): Promise<T> => { - const { localDelete } = localOperations; - return localDelete<T>(this, options); - } - - /** - * @description Find versions with criteria - * @param options - * @returns versions satisfying query - */ - findVersions = async <T extends TypeWithVersion<T> = any>(options: FindVersionsOptions): Promise<PaginatedDocs<T>> => { - const { findVersions } = localOperations; - return findVersions<T>(this, options); - } - - /** - * @description Find version by ID - * @param options - * @returns version with specified ID - */ - findVersionByID = async <T extends TypeWithVersion<T> = any>(options: FindVersionByIDOptions): Promise<T> => { - const { findVersionByID } = localOperations; - return findVersionByID(this, options); - } - - /** - * @description Restore version by ID - * @param options - * @returns version with specified ID - */ - restoreVersion = async <T extends TypeWithVersion<T> = any>(options: RestoreVersionOptions): Promise<T> => { - const { restoreVersion } = localOperations; - return restoreVersion(this, options); - } - - login = async <T extends TypeWithID = any>(options: LoginOptions): Promise<LoginResult & { user: T }> => { - const { login } = localOperations.auth; - return login(this, options); - } - - forgotPassword = async (options: ForgotPasswordOptions): Promise<ForgotPasswordResult> => { - const { forgotPassword } = localOperations.auth; - return forgotPassword(this, options); - } - - resetPassword = async (options: ResetPasswordOptions): Promise<ResetPasswordResult> => { - const { resetPassword } = localOperations.auth; - return resetPassword(this, options); - } - - unlock = async (options: UnlockOptions): Promise<boolean> => { - const { unlock } = localOperations.auth; - return unlock(this, options); - } - - verifyEmail = async (options: VerifyEmailOptions): Promise<boolean> => { - const { verifyEmail } = localOperations.auth; - return verifyEmail(this, options); - } -} - -const payload = new Payload(); +export const init = async <T = any>(options: InitOptions): Promise<Payload<T>> => { + return initHTTP<T>(options); +}; -export default payload; -module.exports = payload; +export default getPayload; diff --git a/src/init.ts b/src/init.ts deleted file mode 100644 index fb1f2e61e54..00000000000 --- a/src/init.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* eslint-disable no-param-reassign */ -import express, { NextFunction, Response } from 'express'; -import crypto from 'crypto'; -import path from 'path'; -import mongoose from 'mongoose'; -import { InitOptions } from './config/types'; - -import authenticate from './express/middleware/authenticate'; -import connectMongoose from './mongoose/connect'; -import expressMiddleware from './express/middleware'; -import initAdmin from './express/admin'; -import initAuth from './auth/init'; -import access from './auth/requestHandlers/access'; -import initCollections from './collections/init'; -import initPreferences from './preferences/init'; -import initGlobals from './globals/init'; -import initGraphQLPlayground from './graphql/initPlayground'; -import initStatic from './express/static'; -import registerSchema from './graphql/registerSchema'; -import graphQLHandler from './graphql/graphQLHandler'; -import buildEmail from './email/build'; -import identifyAPI from './express/middleware/identifyAPI'; -import errorHandler from './express/middleware/errorHandler'; -import { PayloadRequest } from './express/types'; -import sendEmail from './email/sendEmail'; - -import { serverInit as serverInitTelemetry } from './utilities/telemetry/events/serverInit'; -import { Payload } from '.'; -import loadConfig from './config/load'; -import Logger from './utilities/logger'; -import { getDataLoader } from './collections/dataloader'; -import mountEndpoints from './express/mountEndpoints'; -import PreferencesModel from './preferences/model'; -import findConfig from './config/find'; - -export const init = (payload: Payload, options: InitOptions): void => { - payload.logger.info('Starting Payload...'); - if (!options.secret) { - throw new Error( - 'Error: missing secret key. A secret key is needed to secure Payload.', - ); - } - - if (options.mongoURL !== false && typeof options.mongoURL !== 'string') { - throw new Error('Error: missing MongoDB connection URL.'); - } - - payload.emailOptions = { ...(options.email) }; - payload.secret = crypto - .createHash('sha256') - .update(options.secret) - .digest('hex') - .slice(0, 32); - - payload.local = options.local; - - if (options.config) { - payload.config = options.config; - const configPath = findConfig(); - - payload.config = { - ...options.config, - paths: { - configDir: path.dirname(configPath), - config: configPath, - rawConfig: configPath, - }, - }; - } else { - payload.config = loadConfig(payload.logger); - } - - // If not initializing locally, scaffold router - if (!payload.local) { - payload.router = express.Router(); - payload.router.use(...expressMiddleware(payload)); - initAuth(payload); - } - - // Configure email service - payload.email = buildEmail(payload.emailOptions, payload.logger); - payload.sendEmail = sendEmail.bind(payload); - - // Initialize collections & globals - initCollections(payload); - initGlobals(payload); - - if (!payload.config.graphQL.disable) { - registerSchema(payload); - } - - payload.preferences = { Model: PreferencesModel }; - - // If not initializing locally, set up HTTP routing - if (!payload.local) { - options.express.use((req: PayloadRequest, res, next) => { - req.payload = payload; - next(); - }); - - options.express.use((req: PayloadRequest, res: Response, next: NextFunction): void => { - req.payloadDataLoader = getDataLoader(req); - return next(); - }); - - payload.express = options.express; - - if (payload.config.rateLimit.trustProxy) { - payload.express.set('trust proxy', 1); - } - - initAdmin(payload); - initPreferences(payload); - - payload.router.get('/access', access); - - if (!payload.config.graphQL.disable) { - payload.router.use( - payload.config.routes.graphQL, - (req, res, next): void => { - if (req.method === 'OPTIONS') { - res.sendStatus(204); - } else { - next(); - } - }, - identifyAPI('GraphQL'), - (req: PayloadRequest, res: Response) => graphQLHandler(req, res)(req, res), - ); - initGraphQLPlayground(payload); - } - - mountEndpoints(options.express, payload.router, payload.config.endpoints); - - // Bind router to API - payload.express.use(payload.config.routes.api, payload.router); - - // Enable static routes for all collections permitting upload - initStatic(payload); - - payload.errorHandler = errorHandler(payload.config, payload.logger); - payload.router.use(payload.errorHandler); - - payload.authenticate = authenticate(payload.config); - } - - serverInitTelemetry(payload); -}; - -export const initAsync = async (payload: Payload, options: InitOptions): Promise<void> => { - payload.logger = Logger('payload', options.loggerOptions); - payload.mongoURL = options.mongoURL; - - if (payload.mongoURL) { - mongoose.set('strictQuery', false); - payload.mongoMemoryServer = await connectMongoose(payload.mongoURL, options.mongoOptions, payload.logger); - } - - init(payload, options); - - if (typeof options.onInit === 'function') await options.onInit(payload); - if (typeof payload.config.onInit === 'function') await payload.config.onInit(payload); -}; - -export const initSync = (payload: Payload, options: InitOptions): void => { - payload.logger = Logger('payload', options.loggerOptions); - payload.mongoURL = options.mongoURL; - - if (payload.mongoURL) { - mongoose.set('strictQuery', false); - connectMongoose(payload.mongoURL, options.mongoOptions, payload.logger); - } - - init(payload, options); - - if (typeof options.onInit === 'function') options.onInit(payload); - if (typeof payload.config.onInit === 'function') payload.config.onInit(payload); -}; diff --git a/src/initHTTP.ts b/src/initHTTP.ts new file mode 100644 index 00000000000..46ae02b7f13 --- /dev/null +++ b/src/initHTTP.ts @@ -0,0 +1,84 @@ +/* eslint-disable no-param-reassign */ +import express, { NextFunction, Response } from 'express'; +import { InitOptions } from './config/types'; + +import authenticate from './express/middleware/authenticate'; +import expressMiddleware from './express/middleware'; +import initAdmin from './express/admin'; +import initAuth from './auth/init'; +import access from './auth/requestHandlers/access'; +import initCollectionsHTTP from './collections/initHTTP'; +import initPreferences from './preferences/init'; +import initGlobalsHTTP from './globals/initHTTP'; +import initGraphQLPlayground from './graphql/initPlayground'; +import initStatic from './express/static'; +import graphQLHandler from './graphql/graphQLHandler'; +import identifyAPI from './express/middleware/identifyAPI'; +import errorHandler from './express/middleware/errorHandler'; +import { PayloadRequest } from './express/types'; +import { getDataLoader } from './collections/dataloader'; +import mountEndpoints from './express/mountEndpoints'; +import { Payload, getPayload } from './payload'; + +export const initHTTP = async <T>(options: InitOptions): Promise<Payload<T>> => { + const payload = await getPayload<T>(options); + + payload.router = express.Router(); + payload.router.use(...expressMiddleware(payload)); + initAuth(payload); + + initCollectionsHTTP(payload); + initGlobalsHTTP(payload); + + options.express.use((req: PayloadRequest, res, next) => { + req.payload = payload; + next(); + }); + + options.express.use((req: PayloadRequest, res: Response, next: NextFunction): void => { + req.payloadDataLoader = getDataLoader(req); + return next(); + }); + + payload.express = options.express; + + if (payload.config.rateLimit.trustProxy) { + payload.express.set('trust proxy', 1); + } + + initAdmin(payload); + initPreferences(payload); + + payload.router.get('/access', access); + + if (!payload.config.graphQL.disable) { + payload.router.use( + payload.config.routes.graphQL, + (req, res, next): void => { + if (req.method === 'OPTIONS') { + res.sendStatus(204); + } else { + next(); + } + }, + identifyAPI('GraphQL'), + (req: PayloadRequest, res: Response) => graphQLHandler(req, res)(req, res), + ); + initGraphQLPlayground(payload); + } + + mountEndpoints(options.express, payload.router, payload.config.endpoints); + + // Bind router to API + payload.express.use(payload.config.routes.api, payload.router); + + // Enable static routes for all collections permitting upload + initStatic(payload); + + payload.errorHandler = errorHandler(payload.config, payload.logger); + payload.router.use(payload.errorHandler); + + payload.authenticate = authenticate(payload.config); + + return payload; +}; diff --git a/src/payload.ts b/src/payload.ts new file mode 100644 index 00000000000..02e0457e358 --- /dev/null +++ b/src/payload.ts @@ -0,0 +1,373 @@ +import pino from 'pino'; +import type { Express, Router } from 'express'; +import { GraphQLError, GraphQLFormattedError, GraphQLSchema } from 'graphql'; +import crypto from 'crypto'; +import path from 'path'; +import mongoose from 'mongoose'; +import { + TypeWithID, + Collection, + CollectionModel, +} from './collections/config/types'; +import { + SanitizedConfig, + EmailOptions, + InitOptions, +} from './config/types'; +import { TypeWithVersion } from './versions/types'; +import { PaginatedDocs } from './mongoose/types'; + +import { PayloadAuthenticate } from './express/middleware/authenticate'; +import { Globals, TypeWithID as GlobalTypeWithID } from './globals/config/types'; +import { ErrorHandler } from './express/middleware/errorHandler'; +import localOperations from './collections/operations/local'; +import localGlobalOperations from './globals/operations/local'; +import { encrypt, decrypt } from './auth/crypto'; +import { BuildEmailResult, Message } from './email/types'; +import { Preferences } from './preferences/types'; + +import { Options as CreateOptions } from './collections/operations/local/create'; +import { Options as FindOptions } from './collections/operations/local/find'; +import { Options as FindByIDOptions } from './collections/operations/local/findByID'; +import { Options as UpdateOptions } from './collections/operations/local/update'; +import { Options as DeleteOptions } from './collections/operations/local/delete'; +import { Options as FindVersionsOptions } from './collections/operations/local/findVersions'; +import { Options as FindVersionByIDOptions } from './collections/operations/local/findVersionByID'; +import { Options as RestoreVersionOptions } from './collections/operations/local/restoreVersion'; +import { Options as FindGlobalVersionsOptions } from './globals/operations/local/findVersions'; +import { Options as FindGlobalVersionByIDOptions } from './globals/operations/local/findVersionByID'; +import { Options as RestoreGlobalVersionOptions } from './globals/operations/local/restoreVersion'; +import { Options as ForgotPasswordOptions } from './auth/operations/local/forgotPassword'; +import { Options as LoginOptions } from './auth/operations/local/login'; +import { Options as ResetPasswordOptions } from './auth/operations/local/resetPassword'; +import { Options as UnlockOptions } from './auth/operations/local/unlock'; +import { Options as VerifyEmailOptions } from './auth/operations/local/verifyEmail'; +import { Result as ForgotPasswordResult } from './auth/operations/forgotPassword'; +import { Result as ResetPasswordResult } from './auth/operations/resetPassword'; +import { Result as LoginResult } from './auth/operations/login'; +import { Options as FindGlobalOptions } from './globals/operations/local/findOne'; +import { Options as UpdateGlobalOptions } from './globals/operations/local/update'; + +import connectMongoose from './mongoose/connect'; +import initCollections from './collections/initLocal'; +import initGlobals from './globals/initLocal'; +import registerSchema from './graphql/registerSchema'; +import buildEmail from './email/build'; +import sendEmail from './email/sendEmail'; + +import { serverInit as serverInitTelemetry } from './utilities/telemetry/events/serverInit'; +import loadConfig from './config/load'; +import Logger from './utilities/logger'; +import PreferencesModel from './preferences/model'; +import findConfig from './config/find'; + +/** + * @description Payload + */ +export class Payload<C = any> { + config: SanitizedConfig; + + collections: { + [slug: string]: Collection; + } = {} + + versions: { + [slug: string]: CollectionModel; + } = {} + + preferences: Preferences; + + globals: Globals; + + logger: pino.Logger; + + emailOptions: EmailOptions; + + email: BuildEmailResult; + + sendEmail: (message: Message) => Promise<unknown>; + + secret: string; + + mongoURL: string | false; + + mongoMemoryServer: any + + local: boolean; + + encrypt = encrypt; + + decrypt = decrypt; + + errorHandler: ErrorHandler; + + authenticate: PayloadAuthenticate; + + express?: Express + + router?: Router + + types: { + blockTypes: any; + blockInputTypes: any; + localeInputType?: any; + fallbackLocaleInputType?: any; + }; + + Query: { name: string; fields: { [key: string]: any } } = { name: 'Query', fields: {} }; + + Mutation: { name: string; fields: { [key: string]: any } } = { name: 'Mutation', fields: {} }; + + schema: GraphQLSchema; + + extensions: (info: any) => Promise<any>; + + customFormatErrorFn: (error: GraphQLError) => GraphQLFormattedError; + + validationRules: any; + + errorResponses: GraphQLFormattedError[] = []; + + errorIndex: number; + + getAdminURL = (): string => `${this.config.serverURL}${this.config.routes.admin}`; + + getAPIURL = (): string => `${this.config.serverURL}${this.config.routes.api}`; + + /** + * @description Initializes Payload + * @param options + */ + async init(options: InitOptions): Promise<Payload<C>> { + this.logger = Logger('payload', options.loggerOptions); + this.mongoURL = options.mongoURL; + + if (this.mongoURL) { + mongoose.set('strictQuery', false); + this.mongoMemoryServer = await connectMongoose(this.mongoURL, options.mongoOptions, this.logger); + } + + this.logger.info('Starting Payload...'); + if (!options.secret) { + throw new Error( + 'Error: missing secret key. A secret key is needed to secure Payload.', + ); + } + + if (options.mongoURL !== false && typeof options.mongoURL !== 'string') { + throw new Error('Error: missing MongoDB connection URL.'); + } + + this.emailOptions = { ...(options.email) }; + this.secret = crypto + .createHash('sha256') + .update(options.secret) + .digest('hex') + .slice(0, 32); + + this.local = options.local; + + if (options.config) { + this.config = options.config; + const configPath = findConfig(); + + this.config = { + ...options.config, + paths: { + configDir: path.dirname(configPath), + config: configPath, + rawConfig: configPath, + }, + }; + } else { + this.config = loadConfig(this.logger); + } + + // Configure email service + this.email = buildEmail(this.emailOptions, this.logger); + this.sendEmail = sendEmail.bind(this); + + // Initialize collections & globals + initCollections(this); + initGlobals(this); + + if (!this.config.graphQL.disable) { + registerSchema(this); + } + + this.preferences = { Model: PreferencesModel }; + + serverInitTelemetry(this); + + if (typeof options.onInit === 'function') await options.onInit(this); + if (typeof this.config.onInit === 'function') await this.config.onInit(this); + + return this; + } + + /** + * @description Performs create operation + * @param options + * @returns created document + */ + create = async <T = any>(options: CreateOptions<T>): Promise<T> => { + const { create } = localOperations; + return create(this, options); + } + + /** + * @description Find documents with criteria + * @param options + * @returns documents satisfying query + */ + find = async <T extends TypeWithID = any>(options: FindOptions): Promise<PaginatedDocs<T>> => { + const { find } = localOperations; + return find(this, options); + } + + findGlobal = async <T extends GlobalTypeWithID = any>(options: FindGlobalOptions): Promise<T> => { + const { findOne } = localGlobalOperations; + return findOne(this, options); + } + + updateGlobal = async <T extends GlobalTypeWithID = any>(options: UpdateGlobalOptions): Promise<T> => { + const { update } = localGlobalOperations; + return update(this, options); + } + + /** + * @description Find global versions with criteria + * @param options + * @returns versions satisfying query + */ + findGlobalVersions = async <T extends TypeWithVersion<T> = any>(options: FindGlobalVersionsOptions): Promise<PaginatedDocs<T>> => { + const { findVersions } = localGlobalOperations; + return findVersions<T>(this, options); + } + + /** + * @description Find global version by ID + * @param options + * @returns global version with specified ID + */ + findGlobalVersionByID = async <T extends TypeWithVersion<T> = any>(options: FindGlobalVersionByIDOptions): Promise<T> => { + const { findVersionByID } = localGlobalOperations; + return findVersionByID(this, options); + } + + /** + * @description Restore global version by ID + * @param options + * @returns version with specified ID + */ + restoreGlobalVersion = async <T extends TypeWithVersion<T> = any>(options: RestoreGlobalVersionOptions): Promise<T> => { + const { restoreVersion } = localGlobalOperations; + return restoreVersion(this, options); + } + + /** + * @description Find document by ID + * @param options + * @returns document with specified ID + */ + findByID = async <T extends TypeWithID = any>(options: FindByIDOptions): Promise<T> => { + const { findByID } = localOperations; + return findByID<T>(this, options); + } + + /** + * @description Update document + * @param options + * @returns Updated document + */ + update = async <T = any>(options: UpdateOptions<T>): Promise<T> => { + const { update } = localOperations; + return update<T>(this, options); + } + + delete = async <T extends TypeWithID = any>(options: DeleteOptions): Promise<T> => { + const { localDelete } = localOperations; + return localDelete<T>(this, options); + } + + /** + * @description Find versions with criteria + * @param options + * @returns versions satisfying query + */ + findVersions = async <T extends TypeWithVersion<T> = any>(options: FindVersionsOptions): Promise<PaginatedDocs<T>> => { + const { findVersions } = localOperations; + return findVersions<T>(this, options); + } + + /** + * @description Find version by ID + * @param options + * @returns version with specified ID + */ + findVersionByID = async <T extends TypeWithVersion<T> = any>(options: FindVersionByIDOptions): Promise<T> => { + const { findVersionByID } = localOperations; + return findVersionByID(this, options); + } + + /** + * @description Restore version by ID + * @param options + * @returns version with specified ID + */ + restoreVersion = async <T extends TypeWithVersion<T> = any>(options: RestoreVersionOptions): Promise<T> => { + const { restoreVersion } = localOperations; + return restoreVersion(this, options); + } + + login = async <T extends TypeWithID = any>(options: LoginOptions): Promise<LoginResult & { user: T }> => { + const { login } = localOperations.auth; + return login(this, options); + } + + forgotPassword = async (options: ForgotPasswordOptions): Promise<ForgotPasswordResult> => { + const { forgotPassword } = localOperations.auth; + return forgotPassword(this, options); + } + + resetPassword = async (options: ResetPasswordOptions): Promise<ResetPasswordResult> => { + const { resetPassword } = localOperations.auth; + return resetPassword(this, options); + } + + unlock = async (options: UnlockOptions): Promise<boolean> => { + const { unlock } = localOperations.auth; + return unlock(this, options); + } + + verifyEmail = async (options: VerifyEmailOptions): Promise<boolean> => { + const { verifyEmail } = localOperations.auth; + return verifyEmail(this, options); + } +} + +let cached = global.payload; + +if (!cached) { + // eslint-disable-next-line no-multi-assign + cached = global.payload = { payload: null, promise: null }; +} + +export const getPayload = async <T>(options: InitOptions): Promise<Payload<T>> => { + if (cached.payload) { + return cached.payload; + } + + if (!cached.promise) { + cached.promise = new Payload<T>().init(options); + } + + try { + cached.payload = await cached.promise; + } catch (e) { + cached.promise = null; + throw e; + } + + return cached.payload; +}; diff --git a/src/preferences/init.ts b/src/preferences/init.ts index 383b989ab2f..67a8fad1cf4 100644 --- a/src/preferences/init.ts +++ b/src/preferences/init.ts @@ -1,11 +1,10 @@ import express from 'express'; - -import { Payload } from '../index'; import findOne from './requestHandlers/findOne'; import update from './requestHandlers/update'; import deleteHandler from './requestHandlers/delete'; +import { PayloadHTTP } from '..'; -export default function initPreferences(ctx: Payload): void { +export default function initPreferences(ctx: PayloadHTTP): void { if (!ctx.local) { const router = express.Router(); router diff --git a/test/devServer.ts b/test/devServer.ts index 02c9b8778a0..d2dd70c29fd 100644 --- a/test/devServer.ts +++ b/test/devServer.ts @@ -1,12 +1,12 @@ import express from 'express'; import { v4 as uuid } from 'uuid'; -import payload from '../src'; +import { init as initPayload } from '../src'; const expressApp = express(); -const init = async () => { - await payload.initAsync({ +const startDev = async () => { + const payload = await initPayload({ secret: uuid(), mongoURL: process.env.MONGO_URL || 'mongodb://localhost/payload', express: expressApp, @@ -35,4 +35,4 @@ const init = async () => { }); }; -init(); +startDev();
931f6ff519672069db2e3ff7b106054d6dda35a8
2023-10-21 18:21:11
Alessio Gravili
fix(richtext-lexical): Field Description shows up twice (#3793)
false
Field Description shows up twice (#3793)
fix
diff --git a/packages/richtext-lexical/src/field/Field.tsx b/packages/richtext-lexical/src/field/Field.tsx index 8808f31e097..69171be2dda 100644 --- a/packages/richtext-lexical/src/field/Field.tsx +++ b/packages/richtext-lexical/src/field/Field.tsx @@ -49,19 +49,6 @@ const RichText: React.FC<FieldProps> = (props) => { const { errorMessage, setValue, showError, value } = fieldType - let valueToUse = value - - if (typeof valueToUse === 'string') { - try { - const parsedJSON = JSON.parse(valueToUse) - valueToUse = parsedJSON - } catch (err) { - valueToUse = null - } - } - - if (!valueToUse) valueToUse = defaultValueFromProps || defaultRichTextValueV2 - const classes = [ baseClass, 'field-type', @@ -102,7 +89,6 @@ const RichText: React.FC<FieldProps> = (props) => { readOnly={readOnly} value={value} /> - <FieldDescription description={description} value={value} /> </ErrorBoundary> <FieldDescription description={description} value={value} /> </div>
2b8f925e81c58f6aa010bf13a318236f211ea091
2021-09-15 23:15:49
James
fix: array objects now properly save IDs
false
array objects now properly save IDs
fix
diff --git a/src/mongoose/buildSchema.ts b/src/mongoose/buildSchema.ts index 19adb8853bc..9b7fedee24e 100644 --- a/src/mongoose/buildSchema.ts +++ b/src/mongoose/buildSchema.ts @@ -47,17 +47,19 @@ const formatBaseSchema = (field: Field) => ({ index: field.index || field.unique || false, }); -const buildSchema = (config: SanitizedConfig, configFields: Field[], options = {}): Schema => { +const buildSchema = (config: SanitizedConfig, configFields: Field[], options = {}, allowIDField = false): Schema => { let fields = {}; let schemaFields = configFields; const indexFields = []; - const idField = schemaFields.find(({ name }) => name === 'id'); - if (idField) { - fields = { - _id: idField.type === 'number' ? Number : String, - }; - schemaFields = schemaFields.filter(({ name }) => name !== 'id'); + if (!allowIDField) { + const idField = schemaFields.find(({ name }) => name === 'id'); + if (idField) { + fields = { + _id: idField.type === 'number' ? Number : String, + }; + schemaFields = schemaFields.filter(({ name }) => name !== 'id'); + } } schemaFields.forEach((field) => { @@ -421,7 +423,7 @@ const fieldToSchemaMap = { array: (field: ArrayField, fields: SchemaDefinition, config: SanitizedConfig) => { const baseSchema = { ...formatBaseSchema(field), - type: [buildSchema(config, field.fields, { _id: false, id: false })], + type: [buildSchema(config, field.fields, { _id: false, id: false }, true)], }; let schemaToReturn;
72efd56302df59a6739668b3a0d2e2203ba30ef0
2023-08-08 00:10:00
James
chore: WIP create
false
WIP create
chore
diff --git a/packages/db-postgres/package.json b/packages/db-postgres/package.json index 99b4e83fe66..876128ba2f4 100644 --- a/packages/db-postgres/package.json +++ b/packages/db-postgres/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "drizzle-kit": "^0.19.13-a511135", - "drizzle-orm": "^0.27.2", + "drizzle-orm": "^0.28.0", "pg": "^8.11.1", "to-snake-case": "^1.0.0" }, diff --git a/packages/db-postgres/src/create/index.ts b/packages/db-postgres/src/create/index.ts index 189ffba2235..0d2af5bfd4b 100644 --- a/packages/db-postgres/src/create/index.ts +++ b/packages/db-postgres/src/create/index.ts @@ -5,17 +5,18 @@ import { insertRows } from './insertRows'; export const create: Create = async function create({ collection: collectionSlug, data, - // fallbackLocale, - locale, + req, }) { const collection = this.payload.collections[collectionSlug].config; - return insertRows({ + const [result] = await insertRows({ adapter: this, - data, - fallbackLocale: false, + rows: [data], + fallbackLocale: req.fallbackLocale, fields: collection.fields, - locale, + locale: req.locale, tableName: toSnakeCase(collectionSlug), }); + + return result; }; diff --git a/packages/db-postgres/src/create/insertRows.ts b/packages/db-postgres/src/create/insertRows.ts index b78fe1978ba..4130f8a7e37 100644 --- a/packages/db-postgres/src/create/insertRows.ts +++ b/packages/db-postgres/src/create/insertRows.ts @@ -1,71 +1,168 @@ +/* eslint-disable no-param-reassign */ import { Field } from 'payload/types'; import toSnakeCase from 'to-snake-case'; -import { fieldAffectsData } from 'payload/dist/fields/config/types'; +import { Block, fieldAffectsData } from 'payload/dist/fields/config/types'; import { PostgresAdapter } from '../types'; import { traverseFields } from './traverseFields'; import { transform } from '../transform'; +import { ArrayRowPromisesMap, BlockRowsToInsert, RowInsertionGroup } from './types'; type Args = { adapter: PostgresAdapter - data: Record<string, unknown> + addRowIndexToPath?: boolean + rows: Record<string, unknown>[] fallbackLocale?: string | false fields: Field[] + initialRowData?: Record<string, unknown>[] + incomingRelationshipRows?: Record<string, unknown>[] + incomingBlockRows?: { [blockType: string]: BlockRowsToInsert } locale: string + operation: 'create' | 'update' + path?: string tableName: string } export const insertRows = async ({ adapter, - data, + addRowIndexToPath, + rows, fallbackLocale, fields, + initialRowData, + incomingBlockRows, + incomingRelationshipRows, locale, + operation, + path = '', tableName, -}: Args): Promise<Record<string, unknown>> => { - const row: Record<string, unknown> = {}; - const localeRow: Record<string, unknown> = {}; - const relationshipRows: Record<string, unknown>[] = []; - - await traverseFields({ - adapter, - data, - fields, - locale, - localeRow, - relationshipRows, - row, - tableName, - }); +}: Args): Promise<Record<string, unknown>[]> => { + const insertions: RowInsertionGroup[] = []; - const [insertedRow] = await adapter.db.insert(adapter.tables[tableName]) - .values(row).returning(); + await Promise.all(rows.map(async (data, i) => { + const insertion: RowInsertionGroup = { + row: { ...initialRowData?.[i] || {} }, + localeRow: {}, + relationshipRows: incomingRelationshipRows || [], + blockRows: incomingBlockRows || {}, + arrayRowPromises: {}, + }; - const result: Record<string, unknown> = { ...insertedRow }; + await traverseFields({ + adapter, + arrayRowPromises: insertion.arrayRowPromises, + blockRows: insertion.blockRows, + data, + fallbackLocale, + fields, + locale, + localeRow: insertion.localeRow, + operation, + path: addRowIndexToPath ? `${path}${i}.` : path, + relationshipRows: insertion.relationshipRows, + row: insertion.row, + tableName, + }); - if (Object.keys(localeRow).length > 0) { - localeRow._parentID = insertedRow.id; - localeRow._locale = locale; - const [insertedLocaleRow] = await adapter.db.insert(adapter.tables[`${tableName}_locales`]) - .values(localeRow).returning(); + insertions.push(insertion); + })); - result._locales = insertedLocaleRow; - } + const insertedRows = await adapter.db.insert(adapter.tables[tableName]) + .values(insertions.map(({ row }) => row)).returning(); + + let insertedLocaleRows: Record<string, unknown>[] = []; + let insertedRelationshipRows: Record<string, unknown>[] = []; + + const relatedRowPromises = []; + + // Fill related rows with parent IDs returned from database + insertedRows.forEach((row, i) => { + insertions[i].row = row; + const { localeRow, relationshipRows, blockRows, arrayRowPromises } = insertions[i]; + + if (Object.keys(arrayRowPromises).length > 0) { + Object.entries(arrayRowPromises).forEach(([key, func]) => { + relatedRowPromises.push(async () => { + insertions[i].row[key] = await func({ parentID: row.id as string }); + }); + }); + } + + if (!incomingBlockRows && Object.keys(blockRows).length > 0) { + Object.entries(blockRows).forEach(([blockType, { block, rows: blockRowsToInsert }]) => { + relatedRowPromises.push(async () => { + const result = await insertRows({ + adapter, + addRowIndexToPath: true, + rows: blockRowsToInsert, + fallbackLocale, + fields: block.fields, + initialRowData: blockRowsToInsert.map((initialBlockRow) => ({ + _order: initialBlockRow._order, + _parentID: row.id, + _path: initialBlockRow._path, + })), + incomingBlockRows, + incomingRelationshipRows, + locale, + operation, + path, + tableName: `${tableName}_${toSnakeCase(blockType)}`, + }); + + return result; + }); + }); + } - if (relationshipRows.length > 0) { - const insertedRelationshipRows = await adapter.db.insert(adapter.tables[`${tableName}_relationships`]) - .values(relationshipRows.map((relationRow) => ({ - ...relationRow, - parent: insertedRow.id, - }))).returning(); + if (Object.keys(localeRow).length > 0) { + localeRow._parentID = row.id; + localeRow._locale = locale; + insertedLocaleRows.push(localeRow); + } - result._relationships = insertedRelationshipRows; + if (relationshipRows.length > 0) { + insertedRelationshipRows = insertedRelationshipRows.concat(relationshipRows.map((relationshipRow) => { + relationshipRow.parent = row.id; + return relationshipRow; + })); + } + }); + + // Insert locales + if (insertedLocaleRows.length > 0) { + relatedRowPromises.push(async () => { + insertedLocaleRows = await adapter.db.insert(adapter.tables[`${tableName}_locales`]) + .values(insertedLocaleRows).returning(); + }); + } + + // Insert relationships + // NOTE - only do this if there are no incoming relationship rows + // because `insertRows` is recursive and relationships should only happen at the top level + if (!incomingRelationshipRows && insertedRelationshipRows.length > 0) { + relatedRowPromises.push(async () => { + insertedRelationshipRows = await adapter.db.insert(adapter.tables[`${tableName}_relationships`]) + .values(insertedRelationshipRows).returning(); + }); } - return transform({ - config: adapter.payload.config, - data: result, - fallbackLocale, - fields, - locale, + await Promise.all(relatedRowPromises.map((promise) => promise())); + + return insertedRows.map((row) => { + const matchedLocaleRow = insertedLocaleRows.find(({ _parentID }) => _parentID === row.id); + if (matchedLocaleRow) row._locales = [matchedLocaleRow]; + + const matchedRelationshipRows = insertedRelationshipRows.filter(({ parent }) => parent === row.id); + if (matchedRelationshipRows.length > 0) row._relationships = matchedRelationshipRows; + + const result = transform({ + config: adapter.payload.config, + data: row, + fallbackLocale, + fields, + locale, + }); + + return result; }); }; diff --git a/packages/db-postgres/src/create/traverseFields.ts b/packages/db-postgres/src/create/traverseFields.ts index 474671092d0..77d3a670df9 100644 --- a/packages/db-postgres/src/create/traverseFields.ts +++ b/packages/db-postgres/src/create/traverseFields.ts @@ -1,15 +1,24 @@ +/* eslint-disable no-param-reassign */ import { Field } from 'payload/types'; import toSnakeCase from 'to-snake-case'; -import { fieldAffectsData } from 'payload/dist/fields/config/types'; +import { fieldAffectsData, valueIsValueWithRelation } from 'payload/dist/fields/config/types'; import { PostgresAdapter } from '../types'; +import { ArrayRowPromise, ArrayRowPromisesMap, BlockRowsToInsert } from './types'; +import { insertRows } from './insertRows'; +import { isArrayOfRows } from '../utilities/isArrayOfRows'; type Args = { adapter: PostgresAdapter + arrayRowPromises: ArrayRowPromisesMap + blockRows: { [blockType: string]: BlockRowsToInsert } columnPrefix?: string data: Record<string, unknown> + fallbackLocale?: string | false fields: Field[] locale: string localeRow: Record<string, unknown> + operation: 'create' | 'update' + path: string relationshipRows: Record<string, unknown>[] row: Record<string, unknown> tableName: string @@ -17,32 +26,44 @@ type Args = { export const traverseFields = async ({ adapter, + arrayRowPromises, + blockRows, columnPrefix, data, + fallbackLocale, fields, locale, localeRow, + operation, + path, relationshipRows, row, tableName, }: Args) => { - let targetRow = row; - - fields.forEach((field) => { + await Promise.all(fields.map(async (field) => { + let targetRow = row; let columnName: string; + let fieldData: unknown; if (fieldAffectsData(field)) { - columnName = `${columnPrefix || ''}${toSnakeCase(field.name)}`; + columnName = `${columnPrefix || ''}${field.name}`; + fieldData = data[field.name]; if (field.localized) { targetRow = localeRow; + + if (typeof data[field.name] === 'object' + && data[field.name] !== null + && data[field.name][locale]) { + fieldData = data[field.name][locale]; + } } } switch (field.type) { case 'number': { // TODO: handle hasMany - targetRow[columnName] = data[columnName]; + targetRow[columnName] = fieldData; break; } @@ -51,150 +72,176 @@ export const traverseFields = async ({ } case 'array': { + if (isArrayOfRows(fieldData)) { + const arrayTableName = `${tableName}_${toSnakeCase(field.name)}`; + + const promise: ArrayRowPromise = async ({ parentID }) => { + const result = await insertRows({ + adapter, + addRowIndexToPath: true, + fallbackLocale, + fields: field.fields, + incomingBlockRows: blockRows, + incomingRelationshipRows: relationshipRows, + initialRowData: (fieldData as []).map((_, i) => ({ + _order: i + 1, + _parentID: parentID, + })), + locale, + operation, + rows: fieldData as Record<string, unknown>[], + tableName: arrayTableName, + }); + + return result.map((subRow) => { + delete subRow._order; + delete subRow._parentID; + return subRow; + }); + }; + + arrayRowPromises[columnName] = promise; + } + break; } case 'blocks': { - // field.blocks.forEach((block) => { - // const baseColumns: Record<string, AnyPgColumnBuilder> = { - // _order: integer('_order').notNull(), - // _path: text('_path').notNull(), - // _parentID: parentIDColumnMap[parentIDColType]('_parent_id').references(() => adapter.tables[tableName].id).notNull(), - // }; - - // if (field.localized && adapter.payload.config.localization) { - // baseColumns._locale = adapter.enums._locales('_locale').notNull(); - // } - - // const blockTableName = `${tableName}_${toSnakeCase(block.slug)}`; - - // if (!adapter.tables[blockTableName]) { - // const { arrayBlockRelations: subArrayBlockRelations } = buildTable({ - // adapter, - // baseColumns, - // fields: block.fields, - // tableName: blockTableName, - // }); - - // const blockTableRelations = relations(adapter.tables[blockTableName], ({ many, one }) => { - // const result: Record<string, Relation<string>> = { - // _parentID: one(adapter.tables[tableName], { - // fields: [adapter.tables[blockTableName]._parentID], - // references: [adapter.tables[tableName].id], - // }), - // }; - - // if (field.localized) { - // result._locales = many(adapter.tables[`${blockTableName}_locales`]); - // } - - // subArrayBlockRelations.forEach((val, key) => { - // result[key] = many(adapter.tables[val]); - // }); - - // return result; - // }); - - // adapter.relations[blockTableName] = blockTableRelations; - // } - - // arrayBlockRelations.set(`_${fieldPrefix || ''}${field.name}`, blockTableName); - // }); + if (isArrayOfRows(fieldData)) { + fieldData.forEach((blockRow, i) => { + if (typeof blockRow.blockType !== 'string') return; + const matchedBlock = field.blocks.find(({ slug }) => slug === blockRow.blockType); + if (!matchedBlock) return; + + if (!blockRows[blockRow.blockType]) { + blockRows[blockRow.blockType] = { + rows: [], + block: matchedBlock, + }; + } + blockRow._order = i + 1; + blockRow._path = `${path}${field.name}`; + blockRows[blockRow.blockType].rows.push(blockRow); + }); + } break; } case 'group': { - // Todo: determine what should happen if groups are set to localized - // const { hasLocalizedField: groupHasLocalizedField } = traverseFields({ - // adapter, - // arrayBlockRelations, - // buildRelationships, - // columnPrefix: `${columnName}_`, - // columns, - // fieldPrefix: `${fieldPrefix || ''}${field.name}_`, - // fields: field.fields, - // indexes, - // localesColumns, - // localesIndexes, - // tableName, - // relationships, - // }); - - // if (groupHasLocalizedField) hasLocalizedField = true; + if (typeof data[field.name] === 'object' && data[field.name] !== null) { + await traverseFields({ + adapter, + arrayRowPromises, + blockRows, + columnPrefix: `${columnName}_`, + data: data[field.name] as Record<string, unknown>, + fields: field.fields, + locale, + localeRow, + operation, + path: `${path || ''}${field.name}.`, + relationshipRows, + row, + tableName, + }); + } break; } case 'tabs': { - // field.tabs.forEach((tab) => { - // if ('name' in tab) { - // const { hasLocalizedField: tabHasLocalizedField } = traverseFields({ - // adapter, - // arrayBlockRelations, - // buildRelationships, - // columnPrefix: `${columnName}_`, - // columns, - // fieldPrefix: `${fieldPrefix || ''}${tab.name}_`, - // fields: tab.fields, - // indexes, - // localesColumns, - // localesIndexes, - // tableName, - // relationships, - // }); - - // if (tabHasLocalizedField) hasLocalizedField = true; - // } else { - // ({ hasLocalizedField } = traverseFields({ - // adapter, - // arrayBlockRelations, - // buildRelationships, - // columns, - // fields: tab.fields, - // indexes, - // localesColumns, - // localesIndexes, - // tableName, - // relationships, - // })); - // } - // }); + await Promise.all(field.tabs.map(async (tab) => { + if ('name' in tab) { + if (typeof data[tab.name] === 'object' && data[tab.name] !== null) { + await traverseFields({ + adapter, + arrayRowPromises, + blockRows, + columnPrefix: `${columnName}_`, + data: data[tab.name] as Record<string, unknown>, + fields: tab.fields, + locale, + localeRow, + operation, + path: `${path || ''}${tab.name}.`, + relationshipRows, + row, + tableName, + }); + } + } else { + await traverseFields({ + adapter, + arrayRowPromises, + blockRows, + columnPrefix, + data, + fields: tab.fields, + locale, + localeRow, + operation, + path, + relationshipRows, + row, + tableName, + }); + } + })); break; } case 'row': case 'collapsible': { - // ({ hasLocalizedField } = traverseFields({ - // adapter, - // arrayBlockRelations, - // buildRelationships, - // columns, - // fields: field.fields, - // indexes, - // localesColumns, - // localesIndexes, - // tableName, - // relationships, - // })); + await traverseFields({ + adapter, + arrayRowPromises, + blockRows, + columnPrefix, + data, + fields: field.fields, + locale, + localeRow, + operation, + path, + relationshipRows, + row, + tableName, + }); break; } case 'relationship': - case 'upload': - // if (Array.isArray(field.relationTo)) { - // field.relationTo.forEach((relation) => relationships.add(relation)); - // } else { - // relationships.add(field.relationTo); - // } + case 'upload': { + const relations = Array.isArray(fieldData) ? fieldData : [fieldData]; + + relations.forEach((relation, i) => { + const relationRow: Record<string, unknown> = { + path: `${path || ''}${field.name}`, + }; + + if ('hasMany' in field && field.hasMany) relationRow.order = i + 1; + if (field.localized) relationRow.locale = locale; + + if (Array.isArray(field.relationTo) && valueIsValueWithRelation(relation)) { + relationRow[`${relation.relationTo}ID`] = relation.value; + relationshipRows.push(relationRow); + } else { + relationRow[`${field.relationTo}ID`] = relation; + relationshipRows.push(relationRow); + } + }); + + break; + } default: { - if (typeof data[field.name] !== 'undefined') { - targetRow[field.name] = data[field.name]; + if (typeof fieldData !== 'undefined') { + targetRow[columnName] = fieldData; } break; } } - }); + })); }; diff --git a/packages/db-postgres/src/create/types.ts b/packages/db-postgres/src/create/types.ts new file mode 100644 index 00000000000..a2398ffbd97 --- /dev/null +++ b/packages/db-postgres/src/create/types.ts @@ -0,0 +1,20 @@ +import { Block } from 'payload/types'; + +export type ArrayRowPromise = (args: { parentID: string | number }) => Promise<Record<string, unknown>[]> + +export type ArrayRowPromisesMap = { + [tableName: string]: ArrayRowPromise +} + +export type BlockRowsToInsert = { + block: Block + rows: Record<string, unknown>[] +} + +export type RowInsertionGroup = { + row: Record<string, unknown> + localeRow: Record<string, unknown> + relationshipRows: Record<string, unknown>[] + arrayRowPromises: ArrayRowPromisesMap, + blockRows: { [blockType: string]: BlockRowsToInsert } +} diff --git a/packages/db-postgres/src/schema/build.ts b/packages/db-postgres/src/schema/build.ts index 2ad4860ec3c..680072c6d26 100644 --- a/packages/db-postgres/src/schema/build.ts +++ b/packages/db-postgres/src/schema/build.ts @@ -106,7 +106,7 @@ export const buildTable = ({ if (hasLocalizedField) { const localeTableName = `${formattedTableName}_locales`; - localesColumns.id = integer('id').primaryKey(); + localesColumns.id = serial('id').primaryKey(); localesColumns._locale = adapter.enums._locales('_locale').notNull(); localesColumns._parentID = parentIDColumnMap[idColType]('_parent_id').references(() => table.id).notNull(); diff --git a/packages/db-postgres/src/transform/traverseFields.ts b/packages/db-postgres/src/transform/traverseFields.ts index 58781114e4c..8e30fc12548 100644 --- a/packages/db-postgres/src/transform/traverseFields.ts +++ b/packages/db-postgres/src/transform/traverseFields.ts @@ -153,6 +153,7 @@ export const traverseFields = <T extends Record<string, unknown>>({ case 'relationship': { const relationPathMatch = relationships[`${sanitizedPath}${field.name}`]; + if (!relationPathMatch) break; if (!field.hasMany) { const relation = relationPathMatch[0]; diff --git a/packages/db-postgres/src/types.ts b/packages/db-postgres/src/types.ts index e3552474d51..d8546943d8f 100644 --- a/packages/db-postgres/src/types.ts +++ b/packages/db-postgres/src/types.ts @@ -1,6 +1,6 @@ -import { Relation, Relations } from 'drizzle-orm'; +import { ColumnBaseConfig, ColumnDataType, Relation, Relations } from 'drizzle-orm'; import { NodePgDatabase } from 'drizzle-orm/node-postgres'; -import { PgColumn, PgColumnHKT, PgEnum, PgTableWithColumns } from 'drizzle-orm/pg-core'; +import { PgColumn, PgEnum, PgTableWithColumns } from 'drizzle-orm/pg-core'; import { Payload } from 'payload'; import { DatabaseAdapter } from 'payload/dist/database/types'; import { ClientConfig, PoolConfig } from 'pg'; @@ -23,7 +23,7 @@ type PoolArgs = { export type Args = ClientArgs | PoolArgs -export type GenericColumn = PgColumn<PgColumnHKT, { +export type GenericColumn = PgColumn<ColumnBaseConfig<ColumnDataType, string>, { tableName: string; name: string; data: unknown; @@ -37,7 +37,7 @@ export type GenericColumns = { } export type GenericTable = PgTableWithColumns<{ - name: string, schema: undefined, columns: GenericColumns + name: string, schema: undefined, columns: GenericColumns, dialect: string }> export type GenericEnum = PgEnum<[string, ...string[]]> diff --git a/packages/db-postgres/src/utilities/isArrayOfRows.ts b/packages/db-postgres/src/utilities/isArrayOfRows.ts new file mode 100644 index 00000000000..3390d677395 --- /dev/null +++ b/packages/db-postgres/src/utilities/isArrayOfRows.ts @@ -0,0 +1,3 @@ +export function isArrayOfRows(data: unknown): data is Record<string, unknown>[] { + return Array.isArray(data); +} diff --git a/packages/db-postgres/yarn.lock b/packages/db-postgres/yarn.lock index c8b6d5bbec3..a6c367f7c5b 100644 --- a/packages/db-postgres/yarn.lock +++ b/packages/db-postgres/yarn.lock @@ -3120,10 +3120,10 @@ drizzle-kit@^0.19.13-a511135: minimatch "^7.4.3" zod "^3.20.2" -drizzle-orm@^0.27.2: - version "0.27.2" - resolved "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.27.2.tgz#bff4b9bb3dc53aa9f12ad2804bc8229f4c757cf8" - integrity sha512-ZvBvceff+JlgP7FxHKe0zOU9CkZ4RcOtibumIrqfYzDGuOeF0YUY0F9iMqYpRM7pxnLRfC+oO7rWOUH3T5oFQA== +drizzle-orm@^0.28.0: + version "0.28.0" + resolved "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.28.0.tgz#8412b32077028b664ce21fe946de0578af6a5837" + integrity sha512-iNNNtWM6YwXWI5vAkgFx+FPtZvo/ZnLh8uZV1e7+Alhan5ZS0q3tqbGFP8uCMngW+hNbJqsaHsxPw6AN87urmw== duplexer@^0.1.2: version "0.1.2"
d9f0b7bd30a7089af2e08aed292ad8745b4def42
2023-10-17 22:53:10
Elliot DeNolf
chore(release): live-preview-react/0.1.4
false
live-preview-react/0.1.4
chore
diff --git a/packages/live-preview-react/package.json b/packages/live-preview-react/package.json index 4113de4217f..34f0ad967ee 100644 --- a/packages/live-preview-react/package.json +++ b/packages/live-preview-react/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/live-preview-react", - "version": "0.1.3", + "version": "0.1.4", "description": "The official live preview React SDK for Payload", "repository": "https://github.com/payloadcms/payload", "license": "MIT",
182eaa343386b5f31628876782a6b928424db82d
2024-12-31 12:39:03
Alessio Gravili
feat(richtext-lexical): ability to override default placeholder (#10278)
false
ability to override default placeholder (#10278)
feat
diff --git a/docs/fields/rich-text.mdx b/docs/fields/rich-text.mdx index 6cabf213570..3e1ca83a7f0 100644 --- a/docs/fields/rich-text.mdx +++ b/docs/fields/rich-text.mdx @@ -45,7 +45,7 @@ _* An asterisk denotes that a property is required._ ## Admin Options -The customize the appearance and behavior of the Rich Text Field in the [Admin Panel](../admin/overview), you can use the `admin` option: +The customize the appearance and behavior of the Rich Text Field in the [Admin Panel](../admin/overview), you can use the `admin` option. The Rich Text Field inherits all of the default options from the base [Field Admin Config](../admin/fields#admin-options) ```ts import type { Field } from 'payload' @@ -58,13 +58,7 @@ export const MyRichTextField: Field = { } ``` -The Rich Text Field inherits all of the default options from the base [Field Admin Config](../admin/fields#admin-options), plus the following additional options: - -| Property | Description | -| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | -| **`placeholder`** | Set this property to define a placeholder string for the field. | -| **`hideGutter`** | Set this property to `true` to hide this field's gutter within the Admin Panel. | -| **`rtl`** | Override the default text direction of the Admin Panel for this field. Set to `true` to force right-to-left text direction. | +Further customization can be done with editor-specific options. ## Editor-specific Options diff --git a/docs/rich-text/overview.mdx b/docs/rich-text/overview.mdx index cab44b992c9..514e5d69e48 100644 --- a/docs/rich-text/overview.mdx +++ b/docs/rich-text/overview.mdx @@ -8,8 +8,8 @@ keywords: lexical, rich text, editor, headless cms <Banner type="warning"> - The Payload editor is based on Lexical, Meta's rich text editor. The previous default editor was - based on Slate and is still supported. You can read [its documentation](/docs/rich-text/slate), + The Payload editor is based on Lexical, Meta's rich text editor. The previous default editor was + based on Slate and is still supported. You can read [its documentation](/docs/rich-text/slate), or the optional [migration guide](/docs/rich-text/migration) to migrate from Slate to Lexical (recommended). </Banner> @@ -298,3 +298,43 @@ Make sure to only use types exported from `@payloadcms/richtext-lexical`, not fr ### Automatic type generation Lexical does not generate the accurate type definitions for your richText fields for you yet - this will be improved in the future. Currently, it only outputs the rough shape of the editor JSON which you can enhance using type assertions. + +## Admin customization + +The Rich Text Field editor configuration has an `admin` property with the following options: + +| Property | Description | +| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | +| **`placeholder`** | Set this property to define a placeholder string for the field. | +| **`hideGutter`** | Set this property to `true` to hide this field's gutter within the Admin Panel. | + +### Disable the gutter + +You can disable the gutter (the vertical line padding between the editor and the left edge of the screen) by setting the `hideGutter` prop to `true`: + +```ts +{ + name: 'richText', + type: 'richText', + editor: lexicalEditor({ + admin: { + hideGutter: true + }, + }), +} +``` + +### Customize the placeholder + +You can customize the placeholder (the text that appears in the editor when it's empty) by setting the `placeholder` prop: + +```ts +{ + name: 'richText', + type: 'richText', + editor: lexicalEditor({ + admin: { + placeholder: 'Type your content here...' + }, + }), +} diff --git a/packages/richtext-lexical/src/lexical/LexicalEditor.tsx b/packages/richtext-lexical/src/lexical/LexicalEditor.tsx index 723d4b679eb..fedd776a140 100644 --- a/packages/richtext-lexical/src/lexical/LexicalEditor.tsx +++ b/packages/richtext-lexical/src/lexical/LexicalEditor.tsx @@ -115,7 +115,7 @@ export const LexicalEditor: React.FC< contentEditable={ <div className="editor-scroller"> <div className="editor" ref={onRef} tabIndex={-1}> - <LexicalContentEditable /> + <LexicalContentEditable editorConfig={editorConfig} /> </div> </div> } diff --git a/packages/richtext-lexical/src/lexical/ui/ContentEditable.tsx b/packages/richtext-lexical/src/lexical/ui/ContentEditable.tsx index a0418f7db03..1d4f81f2b0d 100644 --- a/packages/richtext-lexical/src/lexical/ui/ContentEditable.tsx +++ b/packages/richtext-lexical/src/lexical/ui/ContentEditable.tsx @@ -6,15 +6,26 @@ import { useTranslation } from '@payloadcms/ui' import * as React from 'react' import './ContentEditable.scss' +import type { SanitizedClientEditorConfig } from '../config/types.js' -export function LexicalContentEditable({ className }: { className?: string }): JSX.Element { +export function LexicalContentEditable({ + className, + editorConfig, +}: { + className?: string + editorConfig: SanitizedClientEditorConfig +}): JSX.Element { const { t } = useTranslation<{}, string>() return ( <ContentEditable aria-placeholder={t('lexical:general:placeholder')} className={className ?? 'ContentEditable__root'} - placeholder={<p className="editor-placeholder">{t('lexical:general:placeholder')}</p>} + placeholder={ + <p className="editor-placeholder"> + {editorConfig?.admin?.placeholder ?? t('lexical:general:placeholder')} + </p> + } /> ) } diff --git a/packages/richtext-lexical/src/types.ts b/packages/richtext-lexical/src/types.ts index 5ece7741e03..c1032e2fdb8 100644 --- a/packages/richtext-lexical/src/types.ts +++ b/packages/richtext-lexical/src/types.ts @@ -22,6 +22,10 @@ export type LexicalFieldAdminProps = { * Controls if the gutter (padding to the left & gray vertical line) should be hidden. @default false */ hideGutter?: boolean + /** + * Changes the placeholder text in the editor if no content is present. + */ + placeholder?: string } export type LexicalEditorProps = {
d601300034c6ae73ea2f3eb0ab82898c073cce5b
2025-01-23 21:53:50
Sasha
fix(db-mongodb): querying polymorphic relationships with the `all` operator (#10704)
false
querying polymorphic relationships with the `all` operator (#10704)
fix
diff --git a/docs/queries/overview.mdx b/docs/queries/overview.mdx index fe12faff46d..30cbd7631db 100644 --- a/docs/queries/overview.mdx +++ b/docs/queries/overview.mdx @@ -39,23 +39,23 @@ _The exact query syntax will depend on the API you are using, but the concepts a The following operators are available for use in queries: -| Operator | Description | -| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `equals` | The value must be exactly equal. | -| `not_equals` | The query will return all documents where the value is not equal. | -| `greater_than` | For numeric or date-based fields. | -| `greater_than_equal` | For numeric or date-based fields. | -| `less_than` | For numeric or date-based fields. | -| `less_than_equal` | For numeric or date-based fields. | -| `like` | Case-insensitive string must be present. If string of words, all words must be present, in any order. | -| `contains` | Must contain the value entered, case-insensitive. | -| `in` | The value must be found within the provided comma-delimited list of values. | -| `not_in` | The value must NOT be within the provided comma-delimited list of values. | -| `all` | The value must contain all values provided in the comma-delimited list. | -| `exists` | Only return documents where the value either exists (`true`) or does not exist (`false`). | -| `near` | For distance related to a [Point Field](../fields/point) comma separated as `<longitude>, <latitude>, <maxDistance in meters (nullable)>, <minDistance in meters (nullable)>`. | -| `within` | For [Point Fields](../fields/point) to filter documents based on whether points are inside of the given area defined in GeoJSON. [Example](../fields/point#querying-within) | -| `intersects` | For [Point Fields](../fields/point) to filter documents based on whether points intersect with the given area defined in GeoJSON. [Example](../fields/point#querying-intersects) | +| Operator | Description | +| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `equals` | The value must be exactly equal. | +| `not_equals` | The query will return all documents where the value is not equal. | +| `greater_than` | For numeric or date-based fields. | +| `greater_than_equal` | For numeric or date-based fields. | +| `less_than` | For numeric or date-based fields. | +| `less_than_equal` | For numeric or date-based fields. | +| `like` | Case-insensitive string must be present. If string of words, all words must be present, in any order. | +| `contains` | Must contain the value entered, case-insensitive. | +| `in` | The value must be found within the provided comma-delimited list of values. | +| `not_in` | The value must NOT be within the provided comma-delimited list of values. | +| `all` | The value must contain all values provided in the comma-delimited list. Note: currently this operator is supported only with the MongoDB adapter. | +| `exists` | Only return documents where the value either exists (`true`) or does not exist (`false`). | +| `near` | For distance related to a [Point Field](../fields/point) comma separated as `<longitude>, <latitude>, <maxDistance in meters (nullable)>, <minDistance in meters (nullable)>`. | +| `within` | For [Point Fields](../fields/point) to filter documents based on whether points are inside of the given area defined in GeoJSON. [Example](../fields/point#querying-within) | +| `intersects` | For [Point Fields](../fields/point) to filter documents based on whether points intersect with the given area defined in GeoJSON. [Example](../fields/point#querying-intersects) | <Banner type="success"> **Tip:** diff --git a/packages/db-mongodb/src/queries/sanitizeQueryValue.ts b/packages/db-mongodb/src/queries/sanitizeQueryValue.ts index 872d35b5f88..219cbd2a44a 100644 --- a/packages/db-mongodb/src/queries/sanitizeQueryValue.ts +++ b/packages/db-mongodb/src/queries/sanitizeQueryValue.ts @@ -324,6 +324,19 @@ export const sanitizeQueryValue = ({ } } } + + if ( + operator === 'all' && + Array.isArray(relationTo) && + path.endsWith('.value') && + Array.isArray(formattedValue) + ) { + formattedValue.forEach((v, i) => { + if (Types.ObjectId.isValid(v)) { + formattedValue[i] = new Types.ObjectId(v) + } + }) + } } // Set up specific formatting necessary by operators diff --git a/packages/drizzle/src/queries/operatorMap.ts b/packages/drizzle/src/queries/operatorMap.ts index 0fe4a804f3d..18a3ee79232 100644 --- a/packages/drizzle/src/queries/operatorMap.ts +++ b/packages/drizzle/src/queries/operatorMap.ts @@ -48,6 +48,7 @@ export const operatorMap: Operators = { less_than_equal: lte, like: ilike, not_equals: ne, + // TODO: support this // all: all, not_in: notInArray, or, diff --git a/test/relationships/int.spec.ts b/test/relationships/int.spec.ts index 58834286ad5..73dabb9b00c 100644 --- a/test/relationships/int.spec.ts +++ b/test/relationships/int.spec.ts @@ -39,6 +39,8 @@ const dirname = path.dirname(filename) type EasierChained = { id: string; relation: EasierChained } +const mongoIt = process.env.PAYLOAD_DATABASE === 'mongodb' ? it : it.skip + describe('Relationships', () => { beforeAll(async () => { ;({ payload, restClient } = await initPayloadInt(dirname)) @@ -459,6 +461,46 @@ describe('Relationships', () => { expect(query2.totalDocs).toStrictEqual(2) }) + // all operator is not supported in Postgres yet for any fields + mongoIt('should query using "all" by hasMany relationship field', async () => { + const movie1 = await payload.create({ + collection: 'movies', + data: {}, + }) + const movie2 = await payload.create({ + collection: 'movies', + data: {}, + }) + + await payload.create({ + collection: 'directors', + data: { + name: 'Quentin Tarantino', + movies: [movie2.id, movie1.id], + }, + }) + + await payload.create({ + collection: 'directors', + data: { + name: 'Quentin Tarantino', + movies: [movie2.id], + }, + }) + + const query1 = await payload.find({ + collection: 'directors', + depth: 0, + where: { + movies: { + all: [movie1.id], + }, + }, + }) + + expect(query1.totalDocs).toStrictEqual(1) + }) + it('should sort by a property of a hasMany relationship', async () => { // no support for sort by relation in mongodb if (isMongoose(payload)) { @@ -1352,6 +1394,39 @@ describe('Relationships', () => { expect(queryTwo.docs).toHaveLength(1) }) + // all operator is not supported in Postgres yet for any fields + mongoIt('should allow REST all querying on polymorphic relationships', async () => { + const movie = await payload.create({ + collection: 'movies', + data: { + name: 'Pulp Fiction 2', + }, + }) + await payload.create({ + collection: polymorphicRelationshipsSlug, + data: { + polymorphic: { + relationTo: 'movies', + value: movie.id, + }, + }, + }) + + const queryOne = await restClient + .GET(`/${polymorphicRelationshipsSlug}`, { + query: { + where: { + 'polymorphic.value': { + all: [movie.id], + }, + }, + }, + }) + .then((res) => res.json()) + + expect(queryOne.docs).toHaveLength(1) + }) + it('should allow querying on polymorphic relationships with an object syntax', async () => { const movie = await payload.create({ collection: 'movies',
6ebcbe4504a0fbc16c20f1432f9d38a9a983f7f6
2025-01-17 05:00:11
Alessio Gravili
feat: support JPEG XL image size calculation (#10624)
false
support JPEG XL image size calculation (#10624)
feat
diff --git a/packages/payload/package.json b/packages/payload/package.json index 8b3f96e205c..432e2ee9ecc 100644 --- a/packages/payload/package.json +++ b/packages/payload/package.json @@ -99,7 +99,7 @@ "file-type": "19.3.0", "get-tsconfig": "4.8.1", "http-status": "1.6.2", - "image-size": "^1.1.1", + "image-size": "1.2.0", "jose": "5.9.6", "json-schema-to-typescript": "15.0.3", "minimist": "1.2.8", diff --git a/packages/payload/src/uploads/isImage.ts b/packages/payload/src/uploads/isImage.ts index 62e6e05863c..5a7212ff32e 100644 --- a/packages/payload/src/uploads/isImage.ts +++ b/packages/payload/src/uploads/isImage.ts @@ -1,7 +1,13 @@ export function isImage(mimeType: string): boolean { return ( - ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'image/webp', 'image/avif'].indexOf( - mimeType, - ) > -1 + [ + 'image/jpeg', + 'image/png', + 'image/gif', + 'image/svg+xml', + 'image/webp', + 'image/avif', + 'image/jxl', + ].indexOf(mimeType) > -1 ) } diff --git a/packages/ui/src/elements/Upload/index.tsx b/packages/ui/src/elements/Upload/index.tsx index d225bab5e0d..c368f512a7a 100644 --- a/packages/ui/src/elements/Upload/index.tsx +++ b/packages/ui/src/elements/Upload/index.tsx @@ -49,7 +49,8 @@ export const UploadActions = ({ }: UploadActionsArgs) => { const { t } = useTranslation() - const fileTypeIsAdjustable = isImage(mimeType) && mimeType !== 'image/svg+xml' + const fileTypeIsAdjustable = + isImage(mimeType) && mimeType !== 'image/svg+xml' && mimeType !== 'image/jxl' if (!fileTypeIsAdjustable && (!customActions || customActions.length === 0)) { return null diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 24df4b116a8..653a6aaf8f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,7 +45,7 @@ importers: version: 1.48.1 '@sentry/nextjs': specifier: ^8.33.1 - version: 8.37.1(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected](@swc/[email protected](@swc/[email protected]))) + version: 8.37.1(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected](@swc/[email protected](@swc/[email protected]))) '@sentry/node': specifier: ^8.33.1 version: 8.37.1 @@ -844,8 +844,8 @@ importers: specifier: 1.6.2 version: 1.6.2 image-size: - specifier: ^1.1.1 - version: 1.1.1 + specifier: 1.2.0 + version: 1.2.0 jose: specifier: 5.9.6 version: 5.9.6 @@ -1094,7 +1094,7 @@ importers: dependencies: '@sentry/nextjs': specifier: ^8.33.1 - version: 8.37.1(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected](@swc/[email protected](@swc/[email protected]))) + version: 8.37.1(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected](@swc/[email protected](@swc/[email protected]))) '@sentry/types': specifier: ^8.33.1 version: 8.37.1 @@ -1724,7 +1724,7 @@ importers: version: link:../packages/ui '@sentry/nextjs': specifier: ^8.33.1 - version: 8.37.1(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected](@swc/[email protected](@swc/[email protected]))) + version: 8.37.1(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected](@swc/[email protected](@swc/[email protected]))) '@sentry/react': specifier: ^7.77.0 version: 7.119.2([email protected]) @@ -7267,8 +7267,8 @@ packages: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} - [email protected]: - resolution: {integrity: sha512-541xKlUw6jr/6gGuk92F+mYM5zaFAc5ahphvkqvNe2bQ6gVBkd6bfrmVJ2t4KDAfikAYZyIqTnktX3i6/aQDrQ==} + [email protected]: + resolution: {integrity: sha512-4S8fwbO6w3GeCVN6OPtA9I5IGKkcDMPcKndtUlpJuCwu7JLjtj7JZpwqLuyY2nrmQT3AWsCJLSKPsc2mPBSl3w==} engines: {node: '>=16.x'} hasBin: true @@ -13679,7 +13679,7 @@ snapshots: '@sentry/utils': 7.119.2 localforage: 1.10.0 - '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected](@swc/[email protected](@swc/[email protected])))': + '@sentry/[email protected](@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected](@opentelemetry/[email protected])(@playwright/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])([email protected](@swc/[email protected](@swc/[email protected])))': dependencies: '@opentelemetry/api': 1.9.0 '@opentelemetry/instrumentation-http': 0.53.0(@opentelemetry/[email protected]) @@ -17052,7 +17052,7 @@ snapshots: [email protected]: {} - [email protected]: + [email protected]: dependencies: queue: 6.0.2
9d1997e6a0dfe830a89995f00b29cd1b56fef736
2024-08-14 21:52:11
Paul
chore: update docs for redirects plugin for new redirect type feature (#7672)
false
update docs for redirects plugin for new redirect type feature (#7672)
chore
diff --git a/docs/plugins/redirects.mdx b/docs/plugins/redirects.mdx index 8226d41734d..1cf4c636344 100644 --- a/docs/plugins/redirects.mdx +++ b/docs/plugins/redirects.mdx @@ -66,6 +66,8 @@ export default config | ------------- | ---------- | ----------------------------------------------------------------------------------------------- | | `collections` | `string[]` | An array of collection slugs to populate in the `to` field of each redirect. | | `overrides` | `object` | A partial collection config that allows you to override anything on the `redirects` collection. | +| `redirectTypes` | `string[]` | Provide an array of redirects if you want to provide options for the type of redirects to be supported. | +| `redirectTypeFieldOverride` | `Field` | A partial Field config that allows you to override the Redirect Type field if enabled above. | Note that the fields in overrides take a function that receives the default fields and returns an array of fields. This allows you to add fields to the collection. @@ -83,6 +85,10 @@ redirectsPlugin({ ] }, }, + redirectTypes: ['301', '302'], + redirectTypeFieldOverride: { + label: 'Redirect Type (Overridden)', + }, }) ```
d9ff2e08dc823144a470d759bcb96ee04167c684
2025-01-09 01:44:56
Paul
templates: adjusted the cron job schedule so its compatible with hobby tiers as well (#10457)
false
adjusted the cron job schedule so its compatible with hobby tiers as well (#10457)
templates
diff --git a/templates/with-vercel-website/vercel.json b/templates/with-vercel-website/vercel.json index 4451e68973d..2d2980815a6 100644 --- a/templates/with-vercel-website/vercel.json +++ b/templates/with-vercel-website/vercel.json @@ -2,7 +2,7 @@ "crons": [ { "path": "/api/payload-jobs/run", - "schedule": "*/5 * * * *" + "schedule": "0 0 * * *" } ] }
6eabc99e019b5ef1b14eaa705612f12a065f35f9
2024-05-03 20:14:43
Jessica Chowdhury
chore: translate checkbox result in collection list view (#6165)
false
translate checkbox result in collection list view (#6165)
chore
diff --git a/packages/translations/src/clientKeys.ts b/packages/translations/src/clientKeys.ts index 02f75a520db..0f5e8cbf67a 100644 --- a/packages/translations/src/clientKeys.ts +++ b/packages/translations/src/clientKeys.ts @@ -146,6 +146,7 @@ export const clientTranslationKeys = [ 'general:error', 'general:errors', 'general:fallbackToDefaultLocale', + 'general:false', 'general:filters', 'general:filterWhere', 'general:globals', @@ -199,6 +200,7 @@ export const clientTranslationKeys = [ 'general:successfullyDeleted', 'general:thisLanguage', 'general:titleDeleted', + 'general:true', 'general:users', 'general:user', 'general:unauthorized', diff --git a/packages/translations/src/languages/ar.ts b/packages/translations/src/languages/ar.ts index def0ede3283..f0d5d6d1bd0 100644 --- a/packages/translations/src/languages/ar.ts +++ b/packages/translations/src/languages/ar.ts @@ -208,6 +208,7 @@ export const ar: Language = { error: 'خطأ', errors: 'أخطاء', fallbackToDefaultLocale: 'الرجوع إلى اللغة الافتراضية', + false: 'كاذب', filter: 'تصفية', filterWhere: 'تصفية {{label}} حيث', filters: 'عوامل التصفية', @@ -264,6 +265,7 @@ export const ar: Language = { successfullyDuplicated: '{{label}} تم استنساخها بنجاح.', thisLanguage: 'العربية', titleDeleted: 'تم حذف {{label}} "{{title}}" بنجاح.', + true: 'صحيح', unauthorized: 'غير مصرح به', unsavedChangesDuplicate: 'لديك تغييرات لم يتم حفظها. هل تريد الاستمرار في الاستنساخ؟', untitled: 'بدون عنوان', diff --git a/packages/translations/src/languages/az.ts b/packages/translations/src/languages/az.ts index 77dd8d905cb..83a9b0c667c 100644 --- a/packages/translations/src/languages/az.ts +++ b/packages/translations/src/languages/az.ts @@ -210,6 +210,7 @@ export const az: Language = { error: 'Xəta', errors: 'Xətalar', fallbackToDefaultLocale: 'Standart lokalə keçid', + false: 'Yalan', filter: 'Filter', filterWhere: '{{label}} filtrlə', filters: 'Filtərlər', @@ -266,6 +267,7 @@ export const az: Language = { successfullyDuplicated: '{{label}} uğurla dublikatlandı.', thisLanguage: 'Azərbaycan dili', titleDeleted: '{{label}} "{{title}}" uğurla silindi.', + true: 'Doğru', unauthorized: 'İcazəsiz', unsavedChangesDuplicate: 'Saxlanılmamış dəyişiklikləriniz var. Dublikatla davam etmək istəyirsiniz?', diff --git a/packages/translations/src/languages/bg.ts b/packages/translations/src/languages/bg.ts index de899b5b195..7cd0e4bb14e 100644 --- a/packages/translations/src/languages/bg.ts +++ b/packages/translations/src/languages/bg.ts @@ -208,6 +208,7 @@ export const bg: Language = { error: 'Грешка', errors: 'Грешки', fallbackToDefaultLocale: 'Използвай локализация по подразбиране', + false: 'Ложно', filter: 'Филтрирай', filterWhere: 'Филтрирай {{label}} където', filters: 'Филтри', @@ -264,6 +265,7 @@ export const bg: Language = { successfullyDuplicated: '{{label}} успешно дупликиран.', thisLanguage: 'Български', titleDeleted: '{{label}} "{{title}}" успешно изтрит.', + true: 'Истина', unauthorized: 'Неавторизиран', unsavedChangesDuplicate: 'Имаш незапазени промени. Искаш ли да продължиш да дупликираш?', untitled: 'Неозаглавен', diff --git a/packages/translations/src/languages/cs.ts b/packages/translations/src/languages/cs.ts index 4891c3d9602..ca62bd505e3 100644 --- a/packages/translations/src/languages/cs.ts +++ b/packages/translations/src/languages/cs.ts @@ -209,6 +209,7 @@ export const cs: Language = { error: 'Chyba', errors: 'Chyby', fallbackToDefaultLocale: 'Zpětné přepnutí do výchozího locale', + false: 'Nepravda', filter: 'Filtr', filterWhere: 'Filtrovat {{label}} kde', filters: 'Filtry', @@ -265,6 +266,7 @@ export const cs: Language = { successfullyDuplicated: '{{label}} úspěšně duplikováno.', thisLanguage: 'Čeština', titleDeleted: '{{label}} "{{title}}" úspěšně smazáno.', + true: 'Pravda', unauthorized: 'Neoprávněný', unsavedChangesDuplicate: 'Máte neuložené změny. Chtěli byste pokračovat v duplikování?', untitled: 'Bez názvu', diff --git a/packages/translations/src/languages/de.ts b/packages/translations/src/languages/de.ts index b1fd9d53064..f3668fe9425 100644 --- a/packages/translations/src/languages/de.ts +++ b/packages/translations/src/languages/de.ts @@ -212,6 +212,7 @@ export const de: Language = { error: 'Fehler', errors: 'Fehler', fallbackToDefaultLocale: 'Rückgriff auf das Standardgebietsschema', + false: 'Falsch', filter: 'Filter', filterWhere: 'Filter {{label}} wo', filters: 'Filter', @@ -268,6 +269,7 @@ export const de: Language = { successfullyDuplicated: '{{label}} wurde erfolgreich dupliziert.', thisLanguage: 'Deutsch', titleDeleted: '{{label}} {{title}} wurde erfolgreich gelöscht.', + true: 'Wahr', unauthorized: 'Nicht autorisiert', unsavedChangesDuplicate: 'Du hast ungespeicherte Änderungen, möchtest du mit dem Duplizieren fortfahren?', diff --git a/packages/translations/src/languages/en.ts b/packages/translations/src/languages/en.ts index 5d98f298276..c01873e7f0d 100644 --- a/packages/translations/src/languages/en.ts +++ b/packages/translations/src/languages/en.ts @@ -219,6 +219,7 @@ export const en: Language = { error: 'Error', errors: 'Errors', fallbackToDefaultLocale: 'Fallback to default locale', + false: 'False', filter: 'Filter', filterWhere: 'Filter {{label}} where', filters: 'Filters', @@ -276,6 +277,7 @@ export const en: Language = { successfullyDuplicated: '{{label}} successfully duplicated.', thisLanguage: 'English', titleDeleted: '{{label}} "{{title}}" successfully deleted.', + true: 'True', unauthorized: 'Unauthorized', unsavedChangesDuplicate: 'You have unsaved changes. Would you like to continue to duplicate?', untitled: 'Untitled', diff --git a/packages/translations/src/languages/es.ts b/packages/translations/src/languages/es.ts index 621a161e67c..1504ff54409 100644 --- a/packages/translations/src/languages/es.ts +++ b/packages/translations/src/languages/es.ts @@ -211,6 +211,7 @@ export const es: Language = { error: 'Error', errors: 'Errores', fallbackToDefaultLocale: 'Volver a la configuración regional por defecto', + false: 'Falso', filter: 'Filtro', filterWhere: 'Filtrar {{label}} donde', filters: 'Filtros', @@ -267,6 +268,7 @@ export const es: Language = { successfullyDuplicated: '{{label}} duplicado correctamente.', thisLanguage: 'Español', titleDeleted: '{{label}} {{title}} eliminado correctamente.', + true: 'Verdadero', unauthorized: 'No autorizado', unsavedChangesDuplicate: 'Tienes cambios sin guardar. ¿Deseas continuar para duplicar?', untitled: 'Sin título', diff --git a/packages/translations/src/languages/fa.ts b/packages/translations/src/languages/fa.ts index 539b479f042..1a0484731d9 100644 --- a/packages/translations/src/languages/fa.ts +++ b/packages/translations/src/languages/fa.ts @@ -209,6 +209,7 @@ export const fa: Language = { error: 'خطا', errors: 'خطاها', fallbackToDefaultLocale: 'بازگردان پیشفرض زبان', + false: 'غلط', filter: 'علامت‌گذاری', filterWhere: 'علامت گذاری کردن {{label}} جایی که', filters: 'علامت‌گذاری‌ها', @@ -265,6 +266,7 @@ export const fa: Language = { successfullyDuplicated: '{{label}} با موفقیت رونوشت شد.', thisLanguage: 'فارسی', titleDeleted: '{{label}} "{{title}}" با موفقیت پاک شد.', + true: 'درست', unauthorized: 'غیرمجاز', unsavedChangesDuplicate: 'شما تغییرات ذخیره نشده دارید. مطمئنید میخواهید به رونوشت ادامه دهید؟', diff --git a/packages/translations/src/languages/fr.ts b/packages/translations/src/languages/fr.ts index d3af3535488..529f1569b04 100644 --- a/packages/translations/src/languages/fr.ts +++ b/packages/translations/src/languages/fr.ts @@ -215,6 +215,7 @@ export const fr: Language = { error: 'Erreur', errors: 'Erreurs', fallbackToDefaultLocale: 'Retour à la locale par défaut', + false: 'Faux', filter: 'Filtrer', filterWhere: 'Filtrer {{label}} où', filters: 'Filtres', @@ -271,6 +272,7 @@ export const fr: Language = { successfullyDuplicated: '{{label}} dupliqué(e) avec succès.', thisLanguage: 'Français', titleDeleted: '{{label}} "{{title}}" supprimé(e) avec succès.', + true: 'Vrai', unauthorized: 'Non autorisé', unsavedChangesDuplicate: 'Vous avez des changements non enregistrés. Souhaitez-vous continuer la duplication ?', diff --git a/packages/translations/src/languages/hr.ts b/packages/translations/src/languages/hr.ts index 7ddbfb19895..031874e00f0 100644 --- a/packages/translations/src/languages/hr.ts +++ b/packages/translations/src/languages/hr.ts @@ -209,6 +209,7 @@ export const hr: Language = { error: 'Greška', errors: 'Greške', fallbackToDefaultLocale: 'Vraćanje na zadani jezik', + false: 'Netočno', filter: 'Filter', filterWhere: 'Filter {{label}} gdje', filters: 'Filteri', @@ -265,6 +266,7 @@ export const hr: Language = { successfullyDuplicated: '{{label}} uspješno duplicirano.', thisLanguage: 'Hrvatski', titleDeleted: '{{label}} "{{title}}" uspješno obrisano.', + true: 'Istinito', unauthorized: 'Neovlašteno', unsavedChangesDuplicate: 'Imate nespremljene promjene. Želite li nastaviti s dupliciranjem?', untitled: 'Bez naslova', diff --git a/packages/translations/src/languages/hu.ts b/packages/translations/src/languages/hu.ts index fd836c1884f..f65495dfc84 100644 --- a/packages/translations/src/languages/hu.ts +++ b/packages/translations/src/languages/hu.ts @@ -211,6 +211,7 @@ export const hu: Language = { error: 'Hiba', errors: 'Hibák', fallbackToDefaultLocale: 'Visszatérés az alapértelmezett nyelvhez', + false: 'Hamis', filter: 'Szűrő', filterWhere: 'Szűrő {{label}} ahol', filters: 'Szűrők', @@ -267,6 +268,7 @@ export const hu: Language = { successfullyDuplicated: '{{label}} sikeresen duplikálódott.', thisLanguage: 'Magyar', titleDeleted: '{{label}} "{{title}}" sikeresen törölve.', + true: 'Igaz', unauthorized: 'Jogosulatlan', unsavedChangesDuplicate: 'Nem mentett módosításai vannak. Szeretné folytatni a duplikációt?', untitled: 'Névtelen', diff --git a/packages/translations/src/languages/it.ts b/packages/translations/src/languages/it.ts index b04ecc13e83..d470d044d94 100644 --- a/packages/translations/src/languages/it.ts +++ b/packages/translations/src/languages/it.ts @@ -211,6 +211,7 @@ export const it: Language = { error: 'Errore', errors: 'Errori', fallbackToDefaultLocale: 'Fallback al locale predefinito', + false: 'Falso', filter: 'Filtro', filterWhere: 'Filtra {{label}} se', filters: 'Filtri', @@ -268,6 +269,7 @@ export const it: Language = { successfullyDuplicated: '{{label}} duplicato con successo.', thisLanguage: 'Italiano', titleDeleted: '{{label}} {{title}} eliminato con successo.', + true: 'Vero', unauthorized: 'Non autorizzato', unsavedChangesDuplicate: 'Sono presenti modifiche non salvate. Vuoi continuare a duplicare?', untitled: 'Senza titolo', diff --git a/packages/translations/src/languages/ja.ts b/packages/translations/src/languages/ja.ts index fe1a2d94918..83a79cab554 100644 --- a/packages/translations/src/languages/ja.ts +++ b/packages/translations/src/languages/ja.ts @@ -209,6 +209,7 @@ export const ja: Language = { error: 'エラー', errors: 'エラー', fallbackToDefaultLocale: 'デフォルトロケールへのフォールバック', + false: '偽', filter: '絞り込み', filterWhere: '{{label}} の絞り込み', filters: '絞り込み', @@ -265,6 +266,7 @@ export const ja: Language = { successfullyDuplicated: '{{label}} が複製されました。', thisLanguage: 'Japanese', titleDeleted: '{{label}} "{{title}}" が削除されました。', + true: '真実', unauthorized: '未認証', unsavedChangesDuplicate: '未保存の変更があります。複製を続けますか?', untitled: 'Untitled', diff --git a/packages/translations/src/languages/ko.ts b/packages/translations/src/languages/ko.ts index 8d43e13383c..a115e5fa9cb 100644 --- a/packages/translations/src/languages/ko.ts +++ b/packages/translations/src/languages/ko.ts @@ -209,6 +209,7 @@ export const ko: Language = { error: '오류', errors: '오류', fallbackToDefaultLocale: '기본 locale로 대체', + false: '거짓', filter: '필터', filterWhere: '{{label}} 필터링 조건', filters: '필터', @@ -265,6 +266,7 @@ export const ko: Language = { successfullyDuplicated: '{{label}}이(가) 복제되었습니다.', thisLanguage: '한국어', titleDeleted: '{{label}} "{{title}}"을(를) 삭제했습니다.', + true: '참', unauthorized: '권한 없음', unsavedChangesDuplicate: '저장되지 않은 변경 사항이 있습니다. 복제를 계속하시겠습니까?', untitled: '제목 없음', diff --git a/packages/translations/src/languages/my.ts b/packages/translations/src/languages/my.ts index 86782765294..47772cc8416 100644 --- a/packages/translations/src/languages/my.ts +++ b/packages/translations/src/languages/my.ts @@ -211,6 +211,7 @@ export const my: Language = { error: 'အမှား', errors: 'အမှားများ', fallbackToDefaultLocale: 'မူရင်းဒေသသို့ ပြန်ပြောင်းပါ။', + false: 'မှား', filter: 'ဇကာ', filterWhere: 'နေရာတွင် စစ်ထုတ်ပါ။', filters: 'စစ်ထုတ်မှုများ', @@ -267,6 +268,7 @@ export const my: Language = { successfullyDuplicated: '{{label}} အောင်မြင်စွာ ပုံတူပွားခဲ့သည်။', thisLanguage: 'မြန်မာစာ', titleDeleted: '{{label}} {{title}} အောင်မြင်စွာ ဖျက်သိမ်းခဲ့သည်။', + true: 'အမှန်', unauthorized: 'အခွင့်မရှိပါ။', unsavedChangesDuplicate: 'သင့်တွင် မသိမ်းဆည်းရသေးသော ပြောင်းလဲမှုများ ရှိနေပါသည်။ ပုံတူပွားမှာ သေချာပြီလား။', diff --git a/packages/translations/src/languages/nb.ts b/packages/translations/src/languages/nb.ts index 9c8abe24cca..1d499be3842 100644 --- a/packages/translations/src/languages/nb.ts +++ b/packages/translations/src/languages/nb.ts @@ -209,6 +209,7 @@ export const nb: Language = { error: 'Feil', errors: 'Feil', fallbackToDefaultLocale: 'Tilbakestilling til standard lokalitet', + false: 'Falsk', filter: 'Filtrer', filterWhere: 'Filtrer {{label}} der', filters: 'Filter', @@ -265,6 +266,7 @@ export const nb: Language = { successfullyDuplicated: '{{label}} ble duplisert.', thisLanguage: 'Norsk', titleDeleted: '{{label}} "{{title}}" ble slettet.', + true: 'Sann', unauthorized: 'Ikke autorisert', unsavedChangesDuplicate: 'Du har ulagrede endringer. Vil du fortsette å duplisere?', untitled: 'Uten tittel', diff --git a/packages/translations/src/languages/nl.ts b/packages/translations/src/languages/nl.ts index 4b86ae28d0d..49a90a61eed 100644 --- a/packages/translations/src/languages/nl.ts +++ b/packages/translations/src/languages/nl.ts @@ -211,6 +211,7 @@ export const nl: Language = { error: 'Fout', errors: 'Fouten', fallbackToDefaultLocale: 'Terugval naar standaardtaal', + false: 'Onwaar', filter: 'Filter', filterWhere: 'Filter {{label}} waar', filters: 'Filters', @@ -267,6 +268,7 @@ export const nl: Language = { successfullyDuplicated: '{{label}} succesvol gedupliceerd.', thisLanguage: 'Nederlands', titleDeleted: '{{label}} "{{title}}" succesvol verwijderd.', + true: 'Waar', unauthorized: 'Onbevoegd', unsavedChangesDuplicate: 'U heeft onbewaarde wijzigingen. Wilt u doorgaan met dupliceren?', untitled: 'Zonder titel', diff --git a/packages/translations/src/languages/pl.ts b/packages/translations/src/languages/pl.ts index 28d4f7f880a..d3a1e6d8617 100644 --- a/packages/translations/src/languages/pl.ts +++ b/packages/translations/src/languages/pl.ts @@ -211,6 +211,7 @@ export const pl: Language = { error: 'Błąd', errors: 'Błędy', fallbackToDefaultLocale: 'Powrót do domyślnych ustawień regionalnych', + false: 'Fałszywe', filter: 'Filtr', filterWhere: 'Filtruj gdzie', filters: 'Filtry', @@ -267,6 +268,7 @@ export const pl: Language = { successfullyDuplicated: 'Pomyślnie zduplikowano {{label}}', thisLanguage: 'Polski', titleDeleted: 'Pomyślnie usunięto {{label}} {{title}}', + true: 'Prawda', unauthorized: 'Brak autoryzacji', unsavedChangesDuplicate: 'Masz niezapisane zmiany. Czy chcesz kontynuować duplikowanie?', untitled: 'Bez nazwy', diff --git a/packages/translations/src/languages/pt.ts b/packages/translations/src/languages/pt.ts index 04bac6e5666..c29a95ff852 100644 --- a/packages/translations/src/languages/pt.ts +++ b/packages/translations/src/languages/pt.ts @@ -210,6 +210,7 @@ export const pt: Language = { error: 'Erro', errors: 'Erros', fallbackToDefaultLocale: 'Recuo para o local padrão', + false: 'Falso', filter: 'Filtro', filterWhere: 'Filtrar {{label}} em que', filters: 'Filtros', @@ -266,6 +267,7 @@ export const pt: Language = { successfullyDuplicated: '{{label}} duplicado com sucesso.', thisLanguage: 'Português', titleDeleted: '{{label}} {{title}} excluído com sucesso.', + true: 'Verdadeiro', unauthorized: 'Não autorizado', unsavedChangesDuplicate: 'Você tem mudanças não salvas. Você gostaria de continuar a duplicar?', diff --git a/packages/translations/src/languages/ro.ts b/packages/translations/src/languages/ro.ts index 7329c0986d8..499c733e292 100644 --- a/packages/translations/src/languages/ro.ts +++ b/packages/translations/src/languages/ro.ts @@ -212,6 +212,7 @@ export const ro: Language = { error: 'Eroare', errors: 'Erori', fallbackToDefaultLocale: 'Revenire la locația implicită', + false: 'Fals', filter: 'Filtru', filterWhere: 'Filtrează {{label}} unde', filters: 'Filtre', @@ -268,6 +269,7 @@ export const ro: Language = { successfullyDuplicated: '{{label}} duplicat(ă) cu succes.', thisLanguage: 'Română', titleDeleted: '{{label}} "{{title}}" șters cu succes.', + true: 'Adevărat', unauthorized: 'neautorizat(ă)', unsavedChangesDuplicate: 'Aveți modificări nesalvate. Doriți să continuați să duplicați?', untitled: 'Fără titlu', diff --git a/packages/translations/src/languages/rs.ts b/packages/translations/src/languages/rs.ts index 48fcc52bc8c..8d60b96a724 100644 --- a/packages/translations/src/languages/rs.ts +++ b/packages/translations/src/languages/rs.ts @@ -208,6 +208,7 @@ export const rs: Language = { error: 'Грешка', errors: 'Грешке', fallbackToDefaultLocale: 'Враћање на задати језик', + false: 'Lažno', filter: 'Филтер', filterWhere: 'Филтер {{label}} где', filters: 'Филтери', @@ -264,6 +265,7 @@ export const rs: Language = { successfullyDuplicated: '{{label}} успешно дуплицирано.', thisLanguage: 'Српски (ћирилица)', titleDeleted: '{{label}} "{{title}}" успешно обрисано.', + true: 'Istinito', unauthorized: 'Нисте ауторизовани', unsavedChangesDuplicate: 'Имате несачуване промене. Да ли желите наставити са дуплицирањем?', untitled: 'Без наслова', diff --git a/packages/translations/src/languages/rsLatin.ts b/packages/translations/src/languages/rsLatin.ts index e10bb4d3c7e..05175de1405 100644 --- a/packages/translations/src/languages/rsLatin.ts +++ b/packages/translations/src/languages/rsLatin.ts @@ -208,6 +208,7 @@ export const rsLatin: Language = { error: 'Greška', errors: 'Greške', fallbackToDefaultLocale: 'Vraćanje na zadati jezik', + false: 'Lažno', filter: 'Filter', filterWhere: 'Filter {{label}} gde', filters: 'Filteri', @@ -264,6 +265,7 @@ export const rsLatin: Language = { successfullyDuplicated: '{{label}} uspešno duplicirano.', thisLanguage: 'Srpski (latinica)', titleDeleted: '{{label}} "{{title}}" uspešno obrisano.', + true: 'Istinito', unauthorized: 'Niste autorizovani', unsavedChangesDuplicate: 'Imate nesačuvane promene. Da li želite nastaviti sa dupliciranjem?', untitled: 'Bez naslova', diff --git a/packages/translations/src/languages/ru.ts b/packages/translations/src/languages/ru.ts index f93b788157a..f9d1129cb05 100644 --- a/packages/translations/src/languages/ru.ts +++ b/packages/translations/src/languages/ru.ts @@ -211,6 +211,7 @@ export const ru: Language = { error: 'Ошибка', errors: 'Ошибки', fallbackToDefaultLocale: 'Возврат к локали по умолчанию', + false: 'Ложь', filter: 'Фильтр', filterWhere: 'Где фильтровать', filters: 'Фильтры', @@ -267,6 +268,7 @@ export const ru: Language = { successfullyDuplicated: '{{label}} успешно продублирован.', thisLanguage: 'Русский', titleDeleted: '{{label}} {{title}} успешно удалено.', + true: 'Правда', unauthorized: 'Нет доступа', unsavedChangesDuplicate: 'У вас есть несохраненные изменения. Вы хотите продолжить дублирование?', diff --git a/packages/translations/src/languages/sv.ts b/packages/translations/src/languages/sv.ts index 3854cea2a41..e96bab16990 100644 --- a/packages/translations/src/languages/sv.ts +++ b/packages/translations/src/languages/sv.ts @@ -210,6 +210,7 @@ export const sv: Language = { error: 'Fel', errors: 'Fel', fallbackToDefaultLocale: 'Återgång till standardlokalspråk', + false: 'Falskt', filter: 'Filter', filterWhere: 'Filtrera {{label}} där', filters: 'Filter', @@ -266,6 +267,7 @@ export const sv: Language = { successfullyDuplicated: '{{label}} duplicerades framgångsrikt.', thisLanguage: 'Svenska', titleDeleted: '{{label}} "{{title}}" togs bort framgångsrikt.', + true: 'Sann', unauthorized: 'Obehörig', unsavedChangesDuplicate: 'Du har osparade ändringar. Vill du fortsätta att duplicera?', untitled: 'Namnlös', diff --git a/packages/translations/src/languages/th.ts b/packages/translations/src/languages/th.ts index d75049ad103..0327b358f52 100644 --- a/packages/translations/src/languages/th.ts +++ b/packages/translations/src/languages/th.ts @@ -205,6 +205,7 @@ export const th: Language = { error: 'ข้อผิดพลาด', errors: 'ข้อผิดพลาด', fallbackToDefaultLocale: 'สำรองไปยังตำแหน่งที่ตั้งเริ่มต้น', + false: 'เท็จ', filter: 'กรอง', filterWhere: 'กรอง {{label}} เฉพาะ', filters: 'กรอง', @@ -261,6 +262,7 @@ export const th: Language = { successfullyDuplicated: 'สำเนา {{label}} สำเร็จ', thisLanguage: 'ไทย', titleDeleted: 'ลบ {{label}} "{{title}}" สำเร็จ', + true: 'จริง', unauthorized: 'ไม่ได้รับอนุญาต', unsavedChangesDuplicate: 'คุณมีการแก้ไขที่ยังไม่ถูกบันทึก คุณต้องการทำสำเนาต่อหรือไม่?', untitled: 'ไม่มีชื่อ', diff --git a/packages/translations/src/languages/tr.ts b/packages/translations/src/languages/tr.ts index 6471d2236c0..e544d2ca026 100644 --- a/packages/translations/src/languages/tr.ts +++ b/packages/translations/src/languages/tr.ts @@ -212,6 +212,7 @@ export const tr: Language = { error: 'Hata', errors: 'Hatalar', fallbackToDefaultLocale: 'Varsayılan yerel ayara geri dönme', + false: 'Yanlış', filter: 'Filtrele', filterWhere: '{{label}} filtrele:', filters: 'Filtreler', @@ -268,6 +269,7 @@ export const tr: Language = { successfullyDuplicated: '{{label}} başarıyla kopyalandı.', thisLanguage: 'Türkçe', titleDeleted: '{{label}} {{title}} başarıyla silindi.', + true: 'Doğru', unauthorized: 'Yetkisiz', unsavedChangesDuplicate: 'Kaydedilmemiş değişiklikler var. Çoğaltma işlemine devam etmek istiyor musunuz?', diff --git a/packages/translations/src/languages/uk.ts b/packages/translations/src/languages/uk.ts index d331fc4a8f3..96356dd115f 100644 --- a/packages/translations/src/languages/uk.ts +++ b/packages/translations/src/languages/uk.ts @@ -211,6 +211,7 @@ export const uk: Language = { error: 'Помилка', errors: 'Помилки', fallbackToDefaultLocale: 'Відновлення локалі за замовчуванням', + false: 'Неправда', filter: 'Фільтрувати', filterWhere: 'Де фільтрувати {{label}}', filters: 'Фільтри', @@ -267,6 +268,7 @@ export const uk: Language = { successfullyDuplicated: '{{label}} успішно продубльовано.', thisLanguage: 'Українська', titleDeleted: '{{label}} "{{title}}" успішно видалено.', + true: 'Правда', unauthorized: 'Немає доступу', unsavedChangesDuplicate: 'Ви маєте незбережені зміни. Чи бажаєте ви продовжити дублювання?', untitled: 'Без назви', diff --git a/packages/translations/src/languages/vi.ts b/packages/translations/src/languages/vi.ts index cc7d19de92b..67a726bbdd5 100644 --- a/packages/translations/src/languages/vi.ts +++ b/packages/translations/src/languages/vi.ts @@ -208,6 +208,7 @@ export const vi: Language = { error: 'Lỗi', errors: 'Lỗi', fallbackToDefaultLocale: 'Ngôn ngữ mặc định', + false: 'Sai', filter: 'Lọc', filterWhere: 'Lọc {{label}} với điều kiện:', filters: 'Bộ lọc', @@ -264,6 +265,7 @@ export const vi: Language = { successfullyDuplicated: '{{label}} đã được sao chép thành công.', thisLanguage: 'Vietnamese (Tiếng Việt)', titleDeleted: '{{label}} {{title}} đã được xóa thành công.', + true: 'Thật', unauthorized: 'Không có quyền truy cập.', unsavedChangesDuplicate: 'Bạn chưa lưu các thay đổi. Bạn có muốn tiếp tục tạo bản sao?', untitled: 'Chưa có tiêu đề', diff --git a/packages/translations/src/languages/zh.ts b/packages/translations/src/languages/zh.ts index 6063be39ea3..68d3120a41c 100644 --- a/packages/translations/src/languages/zh.ts +++ b/packages/translations/src/languages/zh.ts @@ -203,6 +203,7 @@ export const zh: Language = { error: '错误', errors: '错误', fallbackToDefaultLocale: '回退到默认语言环境', + false: '假的', filter: '过滤器', filterWhere: '过滤{{label}}', filters: '过滤器', @@ -258,6 +259,7 @@ export const zh: Language = { successfullyDuplicated: '成功复制{{label}}', thisLanguage: '中文 (简体)', titleDeleted: '{{label}} "{{title}}"已被成功删除。', + true: '真实', unauthorized: '未经授权', unsavedChangesDuplicate: '您有未保存的修改。您确定要继续重复吗?', untitled: '无标题', diff --git a/packages/translations/src/languages/zhTw.ts b/packages/translations/src/languages/zhTw.ts index 0cdfb9f477b..efcb807c5cb 100644 --- a/packages/translations/src/languages/zhTw.ts +++ b/packages/translations/src/languages/zhTw.ts @@ -201,6 +201,7 @@ export const zhTw: Language = { error: '錯誤', errors: '錯誤', fallbackToDefaultLocale: '回到預設的語言', + false: '假的', filter: '過濾器', filterWhere: '過濾{{label}}', filters: '過濾器', @@ -256,6 +257,7 @@ export const zhTw: Language = { successfullyDuplicated: '成功複製{{label}}', thisLanguage: '中文 (繁體)', titleDeleted: '{{label}} "{{title}}"已被成功刪除。', + true: '真實', unauthorized: '未經授權', unsavedChangesDuplicate: '您有還沒儲存的修改,確定要繼續複製嗎?', untitled: '無標題', diff --git a/packages/ui/src/elements/Table/DefaultCell/fields/Checkbox/index.tsx b/packages/ui/src/elements/Table/DefaultCell/fields/Checkbox/index.tsx index 45b2c09da99..bbbe32162f5 100644 --- a/packages/ui/src/elements/Table/DefaultCell/fields/Checkbox/index.tsx +++ b/packages/ui/src/elements/Table/DefaultCell/fields/Checkbox/index.tsx @@ -1,12 +1,16 @@ 'use client' import type { DefaultCellComponentProps } from 'payload/types' +import { useTranslation } from '@payloadcms/ui/providers/Translation' import React from 'react' import './index.scss' -export const CheckboxCell: React.FC<DefaultCellComponentProps<boolean>> = ({ cellData }) => ( - <code className="bool-cell"> - <span>{JSON.stringify(cellData)}</span> - </code> -) +export const CheckboxCell: React.FC<DefaultCellComponentProps<boolean>> = ({ cellData }) => { + const { t } = useTranslation() + return ( + <code className="bool-cell"> + <span>{t(`general:${cellData}`).toLowerCase()}</span> + </code> + ) +} diff --git a/packages/ui/src/elements/Table/DefaultCell/index.tsx b/packages/ui/src/elements/Table/DefaultCell/index.tsx index 836436e4b29..dd04e987719 100644 --- a/packages/ui/src/elements/Table/DefaultCell/index.tsx +++ b/packages/ui/src/elements/Table/DefaultCell/index.tsx @@ -82,7 +82,8 @@ export const DefaultCell: React.FC<CellComponentProps> = (props) => { ) } - const DefaultCellComponent: React.FC<DefaultCellComponentProps> = cellComponents[fieldType] + const DefaultCellComponent: React.FC<DefaultCellComponentProps> = + typeof cellData !== 'undefined' && cellComponents[fieldType] let CellComponent: React.ReactNode = cellData &&
171ee121e9df4ed6ccc8f3d53453e496946c043a
2023-10-13 02:48:12
Elliot DeNolf
chore: remove workspace file
false
remove workspace file
chore
diff --git a/templates/website/core.code-workspace b/templates/website/core.code-workspace deleted file mode 100644 index 2a549a9cbb8..00000000000 --- a/templates/website/core.code-workspace +++ /dev/null @@ -1,13 +0,0 @@ -{ - "folders": [ - { - "path": "../.." - }, - { - "path": "../../../cloud-cms" - } - ], - "settings": { - "typescript.tsdk": "node_modules/typescript/lib" - } -}
5d6c29f3dffac5e3aa58ccd41514119972515ccf
2025-01-14 13:16:56
Alessio Gravili
perf(richtext-lexical): ensure internal link nodes do not store url field, and vice versa (#10564)
false
ensure internal link nodes do not store url field, and vice versa (#10564)
perf
diff --git a/packages/richtext-lexical/src/exports/react/components/RichText/converter/converters/link.tsx b/packages/richtext-lexical/src/exports/react/components/RichText/converter/converters/link.tsx index 9d94e3602d7..810f47a01d4 100644 --- a/packages/richtext-lexical/src/exports/react/components/RichText/converter/converters/link.tsx +++ b/packages/richtext-lexical/src/exports/react/components/RichText/converter/converters/link.tsx @@ -26,7 +26,7 @@ export const LinkJSXConverter: (args: { const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined const target: string | undefined = node.fields.newTab ? '_blank' : undefined - let href: string = node.fields.url + let href: string = node.fields.url ?? '' if (node.fields.linkType === 'internal') { if (internalDocToHref) { href = internalDocToHref({ linkNode: node }) diff --git a/packages/richtext-lexical/src/features/link/client/plugins/autoLink/index.tsx b/packages/richtext-lexical/src/features/link/client/plugins/autoLink/index.tsx index 756b7d01b71..b4969d2788a 100644 --- a/packages/richtext-lexical/src/features/link/client/plugins/autoLink/index.tsx +++ b/packages/richtext-lexical/src/features/link/client/plugins/autoLink/index.tsx @@ -357,7 +357,7 @@ function handleBadNeighbors( if ($isAutoLinkNode(previousSibling)) { const isEmailURI = previousSibling.getFields()?.url - ? previousSibling.getFields()?.url?.startsWith('mailto:') + ? (previousSibling.getFields()?.url?.startsWith('mailto:') ?? false) : false if (!startsWithSeparator(text) || startsWithTLD(text, isEmailURI)) { previousSibling.append(textNode) diff --git a/packages/richtext-lexical/src/features/link/nodes/LinkNode.ts b/packages/richtext-lexical/src/features/link/nodes/LinkNode.ts index b6b72467df7..a61cb96c2d3 100644 --- a/packages/richtext-lexical/src/features/link/nodes/LinkNode.ts +++ b/packages/richtext-lexical/src/features/link/nodes/LinkNode.ts @@ -35,10 +35,8 @@ export class LinkNode extends ElementNode { constructor({ id, fields = { - doc: null, linkType: 'custom', newTab: false, - url: '', }, key, }: { @@ -127,10 +125,18 @@ export class LinkNode extends ElementNode { } exportJSON(): SerializedLinkNode { + const fields = this.getFields() + + if (fields?.linkType === 'internal') { + delete fields.url + } else if (fields?.linkType === 'custom') { + delete fields.doc + } + const returnObject: SerializedLinkNode = { ...super.exportJSON(), type: 'link', - fields: this.getFields(), + fields, version: 3, } const id = this.getID() diff --git a/packages/richtext-lexical/src/features/link/nodes/types.ts b/packages/richtext-lexical/src/features/link/nodes/types.ts index d6877ce0b87..c89e2466891 100644 --- a/packages/richtext-lexical/src/features/link/nodes/types.ts +++ b/packages/richtext-lexical/src/features/link/nodes/types.ts @@ -3,7 +3,7 @@ import type { DefaultDocumentIDType, JsonValue } from 'payload' export type LinkFields = { [key: string]: JsonValue - doc: { + doc?: { relationTo: string value: | { @@ -15,7 +15,7 @@ export type LinkFields = { } | null linkType: 'custom' | 'internal' newTab: boolean - url: string + url?: string } export type SerializedLinkNode<T extends SerializedLexicalNode = SerializedLexicalNode> = Spread< diff --git a/packages/richtext-lexical/src/features/link/server/baseFields.ts b/packages/richtext-lexical/src/features/link/server/baseFields.ts index ec1dcc2cf9b..d6f2009b07d 100644 --- a/packages/richtext-lexical/src/features/link/server/baseFields.ts +++ b/packages/richtext-lexical/src/features/link/server/baseFields.ts @@ -67,6 +67,10 @@ export const getBaseFields = ( hooks: { beforeChange: [ ({ value }) => { + if (!value) { + return + } + if (!validateUrl(value)) { return encodeURIComponent(value) } @@ -77,7 +81,10 @@ export const getBaseFields = ( label: ({ t }) => t('fields:enterURL'), required: true, // @ts-expect-error - TODO: fix this - validate: (value: string) => { + validate: (value: string, options) => { + if (options?.siblingData?.linkType === 'internal') { + return // no validation needed, as no url should exist for internal links + } if (!validateUrlMinimal(value)) { return 'Invalid URL' } diff --git a/packages/richtext-lexical/src/features/link/server/index.ts b/packages/richtext-lexical/src/features/link/server/index.ts index 9e7e88e6942..7691b5cffdd 100644 --- a/packages/richtext-lexical/src/features/link/server/index.ts +++ b/packages/richtext-lexical/src/features/link/server/index.ts @@ -180,7 +180,7 @@ export const LinkFeature = createServerFeature< const rel: string = node.fields.newTab ? ' rel="noopener noreferrer"' : '' const target: string = node.fields.newTab ? ' target="_blank"' : '' - let href: string = node.fields.url + let href: string = node.fields.url ?? '' if (node.fields.linkType === 'internal') { href = typeof node.fields.doc?.value !== 'object'
506f82127bee2667309dc84d1513cb3469c75b9a
2023-09-28 01:59:40
Elliot DeNolf
chore: add dotenv to root package.json
false
add dotenv to root package.json
chore
diff --git a/package.json b/package.json index 9135b22cf07..bf0b2a927a9 100644 --- a/package.json +++ b/package.json @@ -47,10 +47,11 @@ "@types/testing-library__jest-dom": "5.14.8", "copyfiles": "2.4.1", "cross-env": "7.0.3", - "graphql-request": "6.1.0", + "dotenv": "8.6.0", "express": "4.18.2", "form-data": "3.0.1", "get-port": "5.1.1", + "graphql-request": "6.1.0", "isomorphic-fetch": "3.0.0", "jest": "29.6.4", "jest-environment-jsdom": "29.6.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00d5440f8fd..08e00ff6a4d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,6 +57,9 @@ importers: cross-env: specifier: 7.0.3 version: 7.0.3 + dotenv: + specifier: 8.6.0 + version: 8.6.0 express: specifier: 4.18.2 version: 4.18.2 @@ -6812,7 +6815,6 @@ packages: /[email protected]: resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==} engines: {node: '>=10'} - dev: false /[email protected]: resolution: {integrity: sha512-vyJTp8+mC+G+5dfgsY+r3ckxlz+QMX40VjPQsZc5gxVAxLmi64TBoVkP54A/pRAXMXsbu2GMMBrZPxNv23waMg==} @@ -14073,6 +14075,7 @@ packages: /[email protected]: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + requiresBuild: true /[email protected]: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} @@ -14428,6 +14431,7 @@ packages: /[email protected]: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} hasBin: true + requiresBuild: true /[email protected]: resolution: {integrity: sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==}
42114a3680ca41dc9008194a1deac02864937871
2024-03-06 21:39:41
James
chore: adds db-postgres to serverComponentsExternalPackages
false
adds db-postgres to serverComponentsExternalPackages
chore
diff --git a/packages/next/src/withPayload.js b/packages/next/src/withPayload.js index fd3571d4413..2b59eb5bcca 100644 --- a/packages/next/src/withPayload.js +++ b/packages/next/src/withPayload.js @@ -15,6 +15,7 @@ const withPayload = (nextConfig = {}) => { serverComponentsExternalPackages: [ ...(nextConfig?.experimental?.serverComponentsExternalPackages || []), '@payloadcms/db-mongodb', + '@payloadcms/db-postgres', 'drizzle-kit', 'drizzle-kit/payload', 'libsql',
793dfe96b910566ecbc8a38df9ae55c34c1bf6b5
2022-07-19 11:02:31
Dan Ribbens
test: promise hooks
false
promise hooks
test
diff --git a/test/fields/int.spec.ts b/test/fields/int.spec.ts index 4f7fb8eb605..8ee87e4aa62 100644 --- a/test/fields/int.spec.ts +++ b/test/fields/int.spec.ts @@ -80,7 +80,6 @@ describe('Fields', () => { }); describe('array', () => { let doc; - let arrayInGroupDoc; const collection = arrayFieldsSlug; beforeAll(async () => { @@ -90,7 +89,7 @@ describe('Fields', () => { }); }); - it('should create with ids and nested ids', async () => { + it.skip('should create with ids and nested ids', async () => { const docWithIDs = await payload.create<GroupField>({ collection: groupFieldsSlug, data: groupDoc,
182c57b191010ce3dcf659f39c1dc2f7cf80662e
2023-11-08 08:59:41
Jarrod Flesch
fix: hasMany number and select fields unable to save within arrays (#4047)
false
hasMany number and select fields unable to save within arrays (#4047)
fix
diff --git a/packages/db-postgres/src/init.ts b/packages/db-postgres/src/init.ts index 8f68389b486..736c74b7568 100644 --- a/packages/db-postgres/src/init.ts +++ b/packages/db-postgres/src/init.ts @@ -23,6 +23,7 @@ export const init: Init = async function init(this: PostgresAdapter) { buildTable({ adapter: this, + buildNumbers: true, buildRelationships: true, disableNotNull: !!collection?.versions?.drafts, disableUnique: false, @@ -37,6 +38,7 @@ export const init: Init = async function init(this: PostgresAdapter) { buildTable({ adapter: this, + buildNumbers: true, buildRelationships: true, disableNotNull: !!collection.versions?.drafts, disableUnique: true, @@ -52,6 +54,7 @@ export const init: Init = async function init(this: PostgresAdapter) { buildTable({ adapter: this, + buildNumbers: true, buildRelationships: true, disableNotNull: !!global?.versions?.drafts, disableUnique: false, @@ -66,6 +69,7 @@ export const init: Init = async function init(this: PostgresAdapter) { buildTable({ adapter: this, + buildNumbers: true, buildRelationships: true, disableNotNull: !!global.versions?.drafts, disableUnique: true, diff --git a/packages/db-postgres/src/schema/build.ts b/packages/db-postgres/src/schema/build.ts index 93179e53131..e6fa91804fe 100644 --- a/packages/db-postgres/src/schema/build.ts +++ b/packages/db-postgres/src/schema/build.ts @@ -26,6 +26,7 @@ type Args = { adapter: PostgresAdapter baseColumns?: Record<string, PgColumnBuilder> baseExtraConfig?: Record<string, (cols: GenericColumns) => IndexBuilder | UniqueConstraintBuilder> + buildNumbers?: boolean buildRelationships?: boolean disableNotNull: boolean disableUnique: boolean @@ -39,6 +40,7 @@ type Args = { } type Result = { + hasManyNumberField: 'index' | boolean relationsToBuild: Map<string, string> } @@ -46,6 +48,7 @@ export const buildTable = ({ adapter, baseColumns = {}, baseExtraConfig = {}, + buildNumbers, buildRelationships, disableNotNull, disableUnique = false, @@ -53,10 +56,11 @@ export const buildTable = ({ rootRelationsToBuild, rootRelationships, rootTableIDColType, - rootTableName, + rootTableName: incomingRootTableName, tableName, timestamps, }: Args): Result => { + const rootTableName = incomingRootTableName || tableName const columns: Record<string, PgColumnBuilder> = baseColumns const indexes: Record<string, (cols: GenericColumns) => IndexBuilder> = {} @@ -102,6 +106,7 @@ export const buildTable = ({ hasManyNumberField, } = traverseFields({ adapter, + buildNumbers, buildRelationships, columns, disableNotNull, @@ -116,7 +121,7 @@ export const buildTable = ({ relationships, rootRelationsToBuild: rootRelationsToBuild || relationsToBuild, rootTableIDColType: rootTableIDColType || idColType, - rootTableName: rootTableName || tableName, + rootTableName, })) if (timestamps) { @@ -185,8 +190,8 @@ export const buildTable = ({ adapter.relations[`relations_${localeTableName}`] = localesTableRelations } - if (hasManyNumberField) { - const numbersTableName = `${tableName}_numbers` + if (hasManyNumberField && buildNumbers) { + const numbersTableName = `${rootTableName}_numbers` const columns: Record<string, PgColumnBuilder> = { id: serial('id').primaryKey(), number: numeric('number'), @@ -327,5 +332,5 @@ export const buildTable = ({ adapter.relations[`relations_${tableName}`] = tableRelations - return { relationsToBuild } + return { hasManyNumberField, relationsToBuild } } diff --git a/packages/db-postgres/src/schema/traverseFields.ts b/packages/db-postgres/src/schema/traverseFields.ts index 5e707245c20..d916bdd22c2 100644 --- a/packages/db-postgres/src/schema/traverseFields.ts +++ b/packages/db-postgres/src/schema/traverseFields.ts @@ -1,23 +1,24 @@ /* eslint-disable no-param-reassign */ import type { Relation } from 'drizzle-orm' -import { relations } from 'drizzle-orm' import type { IndexBuilder, PgColumnBuilder, UniqueConstraintBuilder } from 'drizzle-orm/pg-core' +import type { Field, TabAsField } from 'payload/types' + +import { relations } from 'drizzle-orm' import { + PgNumericBuilder, + PgVarcharBuilder, boolean, index, integer, jsonb, numeric, pgEnum, - PgNumericBuilder, - PgVarcharBuilder, text, timestamp, varchar, } from 'drizzle-orm/pg-core' -import type { Field, TabAsField } from 'payload/types' -import { fieldAffectsData, optionIsObject } from 'payload/types' import { InvalidConfiguration } from 'payload/errors' +import { fieldAffectsData, optionIsObject } from 'payload/types' import toSnakeCase from 'to-snake-case' import type { GenericColumns, PostgresAdapter } from '../types' @@ -31,6 +32,7 @@ import { validateExistingBlockIsIdentical } from './validateExistingBlockIsIdent type Args = { adapter: PostgresAdapter + buildNumbers: boolean buildRelationships: boolean columnPrefix?: string columns: Record<string, PgColumnBuilder> @@ -60,6 +62,7 @@ type Result = { export const traverseFields = ({ adapter, + buildNumbers, buildRelationships, columnPrefix, columns, @@ -283,19 +286,25 @@ export const traverseFields = ({ baseExtraConfig._localeIdx = (cols) => index('_locale_idx').on(cols._locale) } - const { relationsToBuild: subRelationsToBuild } = buildTable({ - adapter, - baseColumns, - baseExtraConfig, - disableNotNull: disableNotNullFromHere, - disableUnique, - fields: disableUnique ? idToUUID(field.fields) : field.fields, - rootRelationsToBuild, - rootRelationships: relationships, - rootTableIDColType, - rootTableName, - tableName: arrayTableName, - }) + const { hasManyNumberField: subHasManyNumberField, relationsToBuild: subRelationsToBuild } = + buildTable({ + adapter, + baseColumns, + baseExtraConfig, + disableNotNull: disableNotNullFromHere, + disableUnique, + fields: disableUnique ? idToUUID(field.fields) : field.fields, + rootRelationsToBuild, + rootRelationships: relationships, + rootTableIDColType, + rootTableName, + tableName: arrayTableName, + }) + + if (subHasManyNumberField) { + if (!hasManyNumberField || subHasManyNumberField === 'index') + hasManyNumberField = subHasManyNumberField + } relationsToBuild.set(fieldName, arrayTableName) @@ -351,7 +360,10 @@ export const traverseFields = ({ baseExtraConfig._localeIdx = (cols) => index('locale_idx').on(cols._locale) } - const { relationsToBuild: subRelationsToBuild } = buildTable({ + const { + hasManyNumberField: subHasManyNumberField, + relationsToBuild: subRelationsToBuild, + } = buildTable({ adapter, baseColumns, baseExtraConfig, @@ -365,6 +377,11 @@ export const traverseFields = ({ tableName: blockTableName, }) + if (subHasManyNumberField) { + if (!hasManyNumberField || subHasManyNumberField === 'index') + hasManyNumberField = subHasManyNumberField + } + const blockTableRelations = relations( adapter.tables[blockTableName], ({ many, one }) => { @@ -413,6 +430,7 @@ export const traverseFields = ({ hasManyNumberField: groupHasManyNumberField, } = traverseFields({ adapter, + buildNumbers, buildRelationships, columnPrefix, columns, @@ -449,6 +467,7 @@ export const traverseFields = ({ hasManyNumberField: groupHasManyNumberField, } = traverseFields({ adapter, + buildNumbers, buildRelationships, columnPrefix: `${columnName}_`, columns, @@ -486,6 +505,7 @@ export const traverseFields = ({ hasManyNumberField: tabHasManyNumberField, } = traverseFields({ adapter, + buildNumbers, buildRelationships, columnPrefix, columns, @@ -524,6 +544,7 @@ export const traverseFields = ({ hasManyNumberField: rowHasManyNumberField, } = traverseFields({ adapter, + buildNumbers, buildRelationships, columnPrefix, columns, diff --git a/packages/db-postgres/src/transform/write/selects.ts b/packages/db-postgres/src/transform/write/selects.ts index daf36bb18f5..404fbd349df 100644 --- a/packages/db-postgres/src/transform/write/selects.ts +++ b/packages/db-postgres/src/transform/write/selects.ts @@ -3,16 +3,18 @@ import { isArrayOfRows } from '../../utilities/isArrayOfRows' type Args = { data: unknown + id?: unknown locale?: string } -export const transformSelects = ({ data, locale }: Args) => { +export const transformSelects = ({ id, data, locale }: Args) => { const newRows: Record<string, unknown>[] = [] if (isArrayOfRows(data)) { data.forEach((value, i) => { const newRow: Record<string, unknown> = { order: i + 1, + parent: id, value, } diff --git a/packages/db-postgres/src/transform/write/traverseFields.ts b/packages/db-postgres/src/transform/write/traverseFields.ts index 5057a569a89..cb0d2427d7e 100644 --- a/packages/db-postgres/src/transform/write/traverseFields.ts +++ b/packages/db-postgres/src/transform/write/traverseFields.ts @@ -422,6 +422,7 @@ export const traverseFields = ({ Object.entries(data[field.name]).forEach(([localeKey, localeData]) => { if (Array.isArray(localeData)) { const newRows = transformSelects({ + id: data._uuid || data.id, data: localeData, locale: localeKey, }) @@ -432,6 +433,7 @@ export const traverseFields = ({ } } else if (Array.isArray(data[field.name])) { const newRows = transformSelects({ + id: data._uuid || data.id, data: data[field.name], }) diff --git a/packages/db-postgres/src/upsertRow/index.ts b/packages/db-postgres/src/upsertRow/index.ts index 375f4e81da1..1482818e295 100644 --- a/packages/db-postgres/src/upsertRow/index.ts +++ b/packages/db-postgres/src/upsertRow/index.ts @@ -102,7 +102,9 @@ export const upsertRow = async <T extends TypeWithID>({ if (Object.keys(rowToInsert.selects).length > 0) { Object.entries(rowToInsert.selects).forEach(([selectTableName, selectRows]) => { selectRows.forEach((row) => { - row.parent = insertedRow.id + if (typeof row.parent === 'undefined') { + row.parent = insertedRow.id + } if (!selectsToInsert[selectTableName]) selectsToInsert[selectTableName] = [] selectsToInsert[selectTableName].push(row) })
136545d1fd0e281592e4a575ba67e753cf53f542
2024-04-06 02:14:41
Dan Ribbens
feat: move disableDuplicate out of admin and update APIs (#5620)
false
move disableDuplicate out of admin and update APIs (#5620)
feat
diff --git a/docs/configuration/collections.mdx b/docs/configuration/collections.mdx index 399bed4f100..e7e936b3b44 100644 --- a/docs/configuration/collections.mdx +++ b/docs/configuration/collections.mdx @@ -13,23 +13,24 @@ It's often best practice to write your Collections in separate files and then im ## Options -| Option | Description | -| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Collection. | -| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Collection. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. | -| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. | -| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-options). | -| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More](/docs/hooks/overview#collection-hooks) | -| **`access`** | Provide access control functions to define exactly who should be able to do what with Documents in this Collection. [More](/docs/access-control/overview/#collections) | -| **`auth`** | Specify options if you would like this Collection to feature authentication. For more, consult the [Authentication](/docs/authentication/config) documentation. | -| **`upload`** | Specify options if you would like this Collection to support file uploads. For more, consult the [Uploads](/docs/upload/overview) documentation. | -| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. | -| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#collection-config) | -| **`endpoints`** | Add custom routes to the REST API. Set to `false` to disable routes. [More](/docs/rest-api/overview#custom-endpoints) | -| **`graphQL`** | An object with `singularName` and `pluralName` strings used in schema generation. Auto-generated from slug if not defined. Set to `false` to disable GraphQL. | -| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. | -| **`defaultSort`** | Pass a top-level field to sort by default in the collection List view. Prefix the name of the field with a minus symbol ("-") to sort in descending order. | -| **`custom`** | Extension point for adding custom data (e.g. for plugins) | +| Option | Description | +|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Collection. | +| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Collection. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. | +| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. | +| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-options). | +| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More](/docs/hooks/overview#collection-hooks) | +| **`access`** | Provide access control functions to define exactly who should be able to do what with Documents in this Collection. [More](/docs/access-control/overview/#collections) | +| **`auth`** | Specify options if you would like this Collection to feature authentication. For more, consult the [Authentication](/docs/authentication/config) documentation. | +| **`upload`** | Specify options if you would like this Collection to support file uploads. For more, consult the [Uploads](/docs/upload/overview) documentation. | +| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. | +| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#collection-config) | +| **`endpoints`** | Add custom routes to the REST API. Set to `false` to disable routes. [More](/docs/rest-api/overview#custom-endpoints) | +| **`graphQL`** | An object with `singularName` and `pluralName` strings used in schema generation. Auto-generated from slug if not defined. Set to `false` to disable GraphQL. | +| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. | +| **`disableDuplicate`** | When true, do not show the "Duplicate" button while editing documents within this collection and prevent `duplicate` from all APIs. | +| **`defaultSort`** | Pass a top-level field to sort by default in the collection List view. Prefix the name of the field with a minus symbol ("-") to sort in descending order. | +| **`custom`** | Extension point for adding custom data (e.g. for plugins) | _\* An asterisk denotes that a property is required._ @@ -75,7 +76,6 @@ property on a collection's config. | `useAsTitle` | Specify a top-level field to use for a document title throughout the Admin panel. If no field is defined, the ID of the document is used as the title. | | `description` | Text or React component to display below the Collection label in the List view to give editors more information. | | `defaultColumns` | Array of field names that correspond to which columns to show by default in this collection's List view. | -| `disableDuplicate ` | Disables the "Duplicate" button while editing documents within this collection. | | `hideAPIURL` | Hides the "API URL" meta field while editing documents within this collection. | | `enableRichTextLink` | The [Rich Text](/docs/fields/rich-text) field features a `Link` element which allows for users to automatically reference related documents within their rich text. Set to `true` by default. | | `enableRichTextRelationship` | The [Rich Text](/docs/fields/rich-text) field features a `Relationship` element which allows for users to automatically reference related documents within their rich text. Set to `true` by default. | diff --git a/packages/graphql/src/schema/initCollections.ts b/packages/graphql/src/schema/initCollections.ts index 9cc3569b0e3..b9056b33466 100644 --- a/packages/graphql/src/schema/initCollections.ts +++ b/packages/graphql/src/schema/initCollections.ts @@ -238,12 +238,14 @@ function initCollectionsGraphQL({ config, graphqlResult }: InitCollectionsGraphQ resolve: getDeleteResolver(collection), } - graphqlResult.Mutation.fields[`duplicate${singularName}`] = { - type: collection.graphQL.type, - args: { - id: { type: new GraphQLNonNull(idType) }, - }, - resolve: duplicateResolver(collection), + if (collectionConfig.disableDuplicate !== true) { + graphqlResult.Mutation.fields[`duplicate${singularName}`] = { + type: collection.graphQL.type, + args: { + id: { type: new GraphQLNonNull(idType) }, + }, + resolve: duplicateResolver(collection), + } } if (collectionConfig.versions) { diff --git a/packages/next/src/routes/rest/index.ts b/packages/next/src/routes/rest/index.ts index a614c2a5627..323812ee2b0 100644 --- a/packages/next/src/routes/rest/index.ts +++ b/packages/next/src/routes/rest/index.ts @@ -378,7 +378,7 @@ export const POST = res = await ( endpoints.collection.POST[`doc-${slug2}-by-id`] as CollectionRouteHandlerWithID )({ id: slug3, collection, req }) - } else if (slug3 === 'duplicate') { + } else if (slug3 === 'duplicate' && collection.config.disableDuplicate !== true) { // /:collection/:id/duplicate res = await endpoints.collection.POST.duplicate({ id: slug2, collection, req }) } diff --git a/packages/payload/src/collections/config/sanitize.ts b/packages/payload/src/collections/config/sanitize.ts index 48b3f413439..abb87a9b28d 100644 --- a/packages/payload/src/collections/config/sanitize.ts +++ b/packages/payload/src/collections/config/sanitize.ts @@ -99,7 +99,7 @@ const sanitizeCollection = ( if (sanitized.upload === true) sanitized.upload = {} // disable duplicate for uploads by default - sanitized.admin.disableDuplicate = sanitized.admin.disableDuplicate || true + sanitized.disableDuplicate = sanitized.disableDuplicate || true sanitized.upload.staticDir = sanitized.upload.staticDir || sanitized.slug sanitized.admin.useAsTitle = @@ -140,7 +140,7 @@ const sanitizeCollection = ( } // disable duplicate for auth enabled collections by default - sanitized.admin.disableDuplicate = sanitized.admin.disableDuplicate || true + sanitized.disableDuplicate = sanitized.disableDuplicate || true if (!sanitized.auth.strategies) { sanitized.auth.strategies = [] diff --git a/packages/payload/src/collections/config/schema.ts b/packages/payload/src/collections/config/schema.ts index 504f48878df..00346016603 100644 --- a/packages/payload/src/collections/config/schema.ts +++ b/packages/payload/src/collections/config/schema.ts @@ -59,7 +59,6 @@ const collectionSchema = joi.object().keys({ }), defaultColumns: joi.array().items(joi.string()), description: joi.alternatives().try(joi.string(), componentSchema), - disableDuplicate: joi.bool(), enableRichTextLink: joi.boolean(), enableRichTextRelationship: joi.boolean(), group: joi.alternatives().try(joi.string(), joi.object().pattern(joi.string(), [joi.string()])), @@ -110,6 +109,7 @@ const collectionSchema = joi.object().keys({ ), custom: joi.object().pattern(joi.string(), joi.any()), defaultSort: joi.string(), + disableDuplicate: joi.bool(), endpoints: endpointsSchema, fields: joi.array(), graphQL: joi.alternatives().try( @@ -136,12 +136,6 @@ const collectionSchema = joi.object().keys({ beforeRead: joi.array().items(joi.func()), beforeValidate: joi.array().items(joi.func()), }), - indexes: joi.array().items( - joi.object().keys({ - fields: joi.object().required(), - options: joi.object(), - }), - ), labels: joi.object({ plural: joi .alternatives() diff --git a/packages/payload/src/collections/config/types.ts b/packages/payload/src/collections/config/types.ts index c796c14e7b7..97cf2abde36 100644 --- a/packages/payload/src/collections/config/types.ts +++ b/packages/payload/src/collections/config/types.ts @@ -251,7 +251,6 @@ export type CollectionAdminOptions = { * Custom description for collection */ description?: EntityDescription - disableDuplicate?: boolean enableRichTextLink?: boolean enableRichTextRelationship?: boolean /** @@ -318,6 +317,10 @@ export type CollectionConfig = { * Default field to sort by in collection list view */ defaultSort?: string + /** + * When true, do not show the "Duplicate" button while editing documents within this collection and prevent `duplicate` from all APIs + */ + disableDuplicate?: boolean /** * Custom rest api endpoints, set false to disable all rest endpoints for this collection. */ diff --git a/packages/payload/src/collections/operations/local/create.ts b/packages/payload/src/collections/operations/local/create.ts index 6efd40d7349..aa553cd6efa 100644 --- a/packages/payload/src/collections/operations/local/create.ts +++ b/packages/payload/src/collections/operations/local/create.ts @@ -58,7 +58,7 @@ export default async function createLocal<TSlug extends keyof GeneratedTypes['co ) } - const req = await createLocalReq(options, payload) + const req = createLocalReq(options, payload) req.file = file ?? (await getFileByPath(filePath)) return createOperation<TSlug>({ diff --git a/packages/payload/src/collections/operations/local/duplicate.ts b/packages/payload/src/collections/operations/local/duplicate.ts index 9a5cac881f5..d2a491ff1f9 100644 --- a/packages/payload/src/collections/operations/local/duplicate.ts +++ b/packages/payload/src/collections/operations/local/duplicate.ts @@ -43,7 +43,14 @@ export async function duplicate<TSlug extends keyof GeneratedTypes['collections' ) } - const req = await createLocalReq(options, payload) + if (collection.config.disableDuplicate === false) { + throw new APIError( + `The collection with slug ${String(collectionSlug)} cannot be duplicated.`, + 400, + ) + } + + const req = createLocalReq(options, payload) return duplicateOperation<TSlug>({ id, diff --git a/packages/ui/src/elements/DocumentControls/index.tsx b/packages/ui/src/elements/DocumentControls/index.tsx index e20d9f72b72..3a009232cbe 100644 --- a/packages/ui/src/elements/DocumentControls/index.tsx +++ b/packages/ui/src/elements/DocumentControls/index.tsx @@ -12,8 +12,7 @@ import { Autosave } from '../Autosave/index.js' import { DeleteDocument } from '../DeleteDocument/index.js' import { DuplicateDocument } from '../DuplicateDocument/index.js' import { Gutter } from '../Gutter/index.js' -import { PopupList } from '../Popup/index.js' -import { Popup } from '../Popup/index.js' +import { Popup, PopupList } from '../Popup/index.js' import { PreviewButton } from '../PreviewButton/index.js' import { Publish } from '../Publish/index.js' import { Save } from '../Save/index.js' @@ -198,7 +197,7 @@ export const DocumentControls: React.FC<{ > {i18n.t('general:createNew')} </PopupList.Button> - {!collectionConfig?.admin?.disableDuplicate && isEditing && ( + {!collectionConfig.disableDuplicate && isEditing && ( <DuplicateDocument id={id.toString()} singularLabel={collectionConfig?.labels?.singular} diff --git a/test/admin/collections/DisableDuplicate.ts b/test/admin/collections/DisableDuplicate.ts new file mode 100644 index 00000000000..9ebf8f34893 --- /dev/null +++ b/test/admin/collections/DisableDuplicate.ts @@ -0,0 +1,14 @@ +import type { CollectionConfig } from 'payload/types' + +import { disableDuplicateSlug } from '../slugs.js' + +export const DisableDuplicate: CollectionConfig = { + slug: disableDuplicateSlug, + disableDuplicate: true, + fields: [ + { + name: 'title', + type: 'text', + }, + ], +} diff --git a/test/admin/config.ts b/test/admin/config.ts index c693311dcf6..f121b63bb05 100644 --- a/test/admin/config.ts +++ b/test/admin/config.ts @@ -3,6 +3,7 @@ import { CustomIdRow } from './collections/CustomIdRow.js' import { CustomIdTab } from './collections/CustomIdTab.js' import { CustomViews1 } from './collections/CustomViews1.js' import { CustomViews2 } from './collections/CustomViews2.js' +import { DisableDuplicate } from './collections/DisableDuplicate.js' import { Geo } from './collections/Geo.js' import { CollectionGroup1A } from './collections/Group1A.js' import { CollectionGroup1B } from './collections/Group1B.js' @@ -89,6 +90,7 @@ export default buildConfigWithDefaults({ Geo, CustomIdTab, CustomIdRow, + DisableDuplicate, ], globals: [ GlobalHidden, diff --git a/test/admin/e2e.spec.ts b/test/admin/e2e.spec.ts index fad521a7712..511869fb4dc 100644 --- a/test/admin/e2e.spec.ts +++ b/test/admin/e2e.spec.ts @@ -37,6 +37,7 @@ import { import { customIdCollectionId, customViews2CollectionSlug, + disableDuplicateSlug, geoCollectionSlug, globalSlug, group1Collection1Slug, @@ -68,6 +69,7 @@ describe('admin', () => { let geoUrl: AdminUrlUtil let postsUrl: AdminUrlUtil let customViewsURL: AdminUrlUtil + let disableDuplicateURL: AdminUrlUtil let serverURL: string beforeAll(async ({ browser }) => { @@ -76,6 +78,7 @@ describe('admin', () => { geoUrl = new AdminUrlUtil(serverURL, geoCollectionSlug) postsUrl = new AdminUrlUtil(serverURL, postsCollectionSlug) customViewsURL = new AdminUrlUtil(serverURL, customViews2CollectionSlug) + disableDuplicateURL = new AdminUrlUtil(serverURL, disableDuplicateSlug) const context = await browser.newContext() page = await context.newPage() @@ -577,6 +580,14 @@ describe('admin', () => { await expect(page.locator('#field-title')).toHaveValue(title) }) + + test('should hide duplicate when disableDuplicate: true', async () => { + await page.goto(disableDuplicateURL.create) + await page.locator('#field-title').fill(title) + await saveDocAndAssert(page) + await page.locator('.doc-controls__popup >> .popup-button').click() + await expect(page.locator('#action-duplicate')).toBeHidden() + }) }) describe('custom IDs', () => { diff --git a/test/admin/slugs.ts b/test/admin/slugs.ts index 311885f8b57..ad51f9b711a 100644 --- a/test/admin/slugs.ts +++ b/test/admin/slugs.ts @@ -9,6 +9,7 @@ export const group2Collection1Slug = 'group-two-collection-ones' export const group2Collection2Slug = 'group-two-collection-twos' export const hiddenCollectionSlug = 'hidden-collection' export const noApiViewCollectionSlug = 'collection-no-api-view' +export const disableDuplicateSlug = 'disable-duplicate' export const uploadCollectionSlug = 'uploads' export const collectionSlugs = [ usersCollectionSlug, @@ -22,6 +23,7 @@ export const collectionSlugs = [ group2Collection2Slug, hiddenCollectionSlug, noApiViewCollectionSlug, + disableDuplicateSlug, ] export const customGlobalViews1GlobalSlug = 'custom-global-views-one'
cbc1f3b3f19e83547e6eb5b8437c2323ca93a354
2023-10-04 01:11:15
Jacob Fletcher
chore: improves edit view types (#3427)
false
improves edit view types (#3427)
chore
diff --git a/packages/payload/src/admin/components/views/Account/Default.tsx b/packages/payload/src/admin/components/views/Account/Default.tsx index 4eaa5ea863d..620a607eafe 100644 --- a/packages/payload/src/admin/components/views/Account/Default.tsx +++ b/packages/payload/src/admin/components/views/Account/Default.tsx @@ -2,6 +2,7 @@ import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' import type { Translation } from '../../../../translations/type' +import type { CollectionEditViewProps } from '../types' import { DocumentControls } from '../../elements/DocumentControls' import { DocumentHeader } from '../../elements/DocumentHeader' @@ -19,134 +20,127 @@ import { OperationContext } from '../../utilities/OperationProvider' import Auth from '../collections/Edit/Auth' import { ToggleTheme } from './ToggleTheme' import './index.scss' -import { EditViewProps } from '../types' const baseClass = 'account' -const DefaultAccount: React.FC<EditViewProps> = (props) => { - if ('collection' in props) { - const { - action, - apiURL, - collection, - data, - hasSavePermission, - initialState, - isLoading, - onSave: onSaveFromProps, - permissions, - } = props +const DefaultAccount: React.FC<CollectionEditViewProps> = (props) => { + const { + action, + apiURL, + collection, + data, + hasSavePermission, + initialState, + isLoading, + onSave: onSaveFromProps, + permissions, + } = props - const { auth, fields } = collection + const { auth, fields } = collection - const { refreshCookieAsync } = useAuth() - const { i18n, t } = useTranslation('authentication') + const { refreshCookieAsync } = useAuth() + const { i18n, t } = useTranslation('authentication') - const languageOptions = Object.entries(i18n.options.resources).map(([language, resource]) => ({ - label: (resource as Translation).general.thisLanguage, - value: language, - })) + const languageOptions = Object.entries(i18n.options.resources).map(([language, resource]) => ({ + label: (resource as Translation).general.thisLanguage, + value: language, + })) - const onSave = useCallback(async () => { - await refreshCookieAsync() - if (typeof onSaveFromProps === 'function') { - onSaveFromProps({}) - } - }, [onSaveFromProps, refreshCookieAsync]) + const onSave = useCallback(async () => { + await refreshCookieAsync() + if (typeof onSaveFromProps === 'function') { + onSaveFromProps({}) + } + }, [onSaveFromProps, refreshCookieAsync]) - const classes = [baseClass].filter(Boolean).join(' ') + const classes = [baseClass].filter(Boolean).join(' ') - return ( - <React.Fragment> - <LoadingOverlayToggle name="account" show={isLoading} type="withoutNav" /> - {!isLoading && ( - <div className={classes}> - <OperationContext.Provider value="update"> - <Form - action={action} - className={`${baseClass}__form`} - disabled={!hasSavePermission} - initialState={initialState} - method="patch" - onSuccess={onSave} - > - <DocumentHeader apiURL={apiURL} collection={collection} data={data} /> - <DocumentControls - apiURL={apiURL} - collection={collection} - data={data} - hasSavePermission={hasSavePermission} - permissions={permissions} - isAccountView + return ( + <React.Fragment> + <LoadingOverlayToggle name="account" show={isLoading} type="withoutNav" /> + {!isLoading && ( + <div className={classes}> + <OperationContext.Provider value="update"> + <Form + action={action} + className={`${baseClass}__form`} + disabled={!hasSavePermission} + initialState={initialState} + method="patch" + onSuccess={onSave} + > + <DocumentHeader apiURL={apiURL} collection={collection} data={data} /> + <DocumentControls + apiURL={apiURL} + collection={collection} + data={data} + hasSavePermission={hasSavePermission} + isAccountView + permissions={permissions} + /> + <div className={`${baseClass}__main`}> + <Meta + description={t('accountOfCurrentUser')} + keywords={t('account')} + title={t('account')} /> - <div className={`${baseClass}__main`}> - <Meta - description={t('accountOfCurrentUser')} - keywords={t('account')} - title={t('account')} - /> - {!(collection.versions?.drafts && collection.versions?.drafts?.autosave) && ( - <LeaveWithoutSaving /> - )} - <div className={`${baseClass}__edit`}> - <Gutter className={`${baseClass}__header`}> - <Auth - collection={collection} - email={data?.email} - operation="update" - readOnly={!hasSavePermission} - useAPIKey={auth.useAPIKey} - className={`${baseClass}__auth`} + {!(collection.versions?.drafts && collection.versions?.drafts?.autosave) && ( + <LeaveWithoutSaving /> + )} + <div className={`${baseClass}__edit`}> + <Gutter className={`${baseClass}__header`}> + <Auth + className={`${baseClass}__auth`} + collection={collection} + email={data?.email} + operation="update" + readOnly={!hasSavePermission} + useAPIKey={auth.useAPIKey} + /> + <RenderFields + fieldSchema={fields} + fieldTypes={fieldTypes} + filter={(field) => field?.admin?.position !== 'sidebar'} + permissions={permissions.fields} + readOnly={!hasSavePermission} + /> + </Gutter> + <Gutter className={`${baseClass}__payload-settings`}> + <h3>{t('general:payloadSettings')}</h3> + <div className={`${baseClass}__language`}> + <Label htmlFor="language-select" label={t('general:language')} /> + <ReactSelect + inputId="language-select" + onChange={({ value }) => i18n.changeLanguage(value)} + options={languageOptions} + value={languageOptions.find((language) => language.value === i18n.language)} /> + </div> + <ToggleTheme /> + </Gutter> + </div> + </div> + <div className={`${baseClass}__sidebar-wrap`}> + <div className={`${baseClass}__sidebar`}> + <div className={`${baseClass}__sidebar-sticky-wrap`}> + <div className={`${baseClass}__sidebar-fields`}> <RenderFields fieldSchema={fields} fieldTypes={fieldTypes} - filter={(field) => field?.admin?.position !== 'sidebar'} + filter={(field) => field?.admin?.position === 'sidebar'} permissions={permissions.fields} readOnly={!hasSavePermission} /> - </Gutter> - <Gutter className={`${baseClass}__payload-settings`}> - <h3>{t('general:payloadSettings')}</h3> - <div className={`${baseClass}__language`}> - <Label htmlFor="language-select" label={t('general:language')} /> - <ReactSelect - inputId="language-select" - onChange={({ value }) => i18n.changeLanguage(value)} - options={languageOptions} - value={languageOptions.find( - (language) => language.value === i18n.language, - )} - /> - </div> - <ToggleTheme /> - </Gutter> - </div> - </div> - <div className={`${baseClass}__sidebar-wrap`}> - <div className={`${baseClass}__sidebar`}> - <div className={`${baseClass}__sidebar-sticky-wrap`}> - <div className={`${baseClass}__sidebar-fields`}> - <RenderFields - fieldSchema={fields} - fieldTypes={fieldTypes} - filter={(field) => field?.admin?.position === 'sidebar'} - permissions={permissions.fields} - readOnly={!hasSavePermission} - /> - </div> </div> </div> </div> - </Form> - </OperationContext.Provider> - </div> - )} - </React.Fragment> - ) - } - - return null + </div> + </Form> + </OperationContext.Provider> + </div> + )} + </React.Fragment> + ) } export default DefaultAccount diff --git a/packages/payload/src/admin/components/views/Global/Default.tsx b/packages/payload/src/admin/components/views/Global/Default.tsx index f10f1aa1848..d50ba30cb2d 100644 --- a/packages/payload/src/admin/components/views/Global/Default.tsx +++ b/packages/payload/src/admin/components/views/Global/Default.tsx @@ -1,6 +1,8 @@ import React from 'react' import { useTranslation } from 'react-i18next' +import type { GlobalEditViewProps } from '../types' + import { getTranslation } from '../../../../utilities/getTranslation' import { DocumentHeader } from '../../elements/DocumentHeader' import { FormLoadingOverlayToggle } from '../../elements/Loading' @@ -9,67 +11,62 @@ import { OperationContext } from '../../utilities/OperationProvider' import { GlobalRoutes } from './Routes' import { CustomGlobalComponent } from './Routes/CustomComponent' import './index.scss' -import { EditViewProps } from '../types' const baseClass = 'global-edit' const DefaultGlobalView: React.FC< - EditViewProps & { + GlobalEditViewProps & { disableRoutes?: boolean } > = (props) => { - if ('global' in props) { - const { - action, - apiURL, - data, - disableRoutes, - global, - initialState, - isLoading, - onSave, - permissions, - } = props - - const { i18n } = useTranslation('general') + const { i18n } = useTranslation('general') - const { label } = global + const { + action, + apiURL, + data, + disableRoutes, + global, + initialState, + isLoading, + onSave, + permissions, + } = props - const hasSavePermission = permissions?.update?.permission + const { label } = global - return ( - <main className={baseClass}> - <OperationContext.Provider value="update"> - <Form - action={action} - className={`${baseClass}__form`} - disabled={!hasSavePermission} - initialState={initialState} - method="post" - onSuccess={onSave} - > - <FormLoadingOverlayToggle - action="update" - loadingSuffix={getTranslation(label, i18n)} - name={`global-edit--${typeof label === 'string' ? label : label?.en}`} - /> - {!isLoading && ( - <React.Fragment> - <DocumentHeader apiURL={apiURL} data={data} global={global} /> - {disableRoutes ? ( - <CustomGlobalComponent view="Default" {...props} /> - ) : ( - <GlobalRoutes {...props} /> - )} - </React.Fragment> - )} - </Form> - </OperationContext.Provider> - </main> - ) - } + const hasSavePermission = permissions?.update?.permission - return null + return ( + <main className={baseClass}> + <OperationContext.Provider value="update"> + <Form + action={action} + className={`${baseClass}__form`} + disabled={!hasSavePermission} + initialState={initialState} + method="post" + onSuccess={onSave} + > + <FormLoadingOverlayToggle + action="update" + loadingSuffix={getTranslation(label, i18n)} + name={`global-edit--${typeof label === 'string' ? label : label?.en}`} + /> + {!isLoading && ( + <React.Fragment> + <DocumentHeader apiURL={apiURL} data={data} global={global} /> + {disableRoutes ? ( + <CustomGlobalComponent view="Default" {...props} /> + ) : ( + <GlobalRoutes {...props} /> + )} + </React.Fragment> + )} + </Form> + </OperationContext.Provider> + </main> + ) } export default DefaultGlobalView diff --git a/packages/payload/src/admin/components/views/Global/Default/index.tsx b/packages/payload/src/admin/components/views/Global/Default/index.tsx index 8cff9bbc024..01722107c59 100644 --- a/packages/payload/src/admin/components/views/Global/Default/index.tsx +++ b/packages/payload/src/admin/components/views/Global/Default/index.tsx @@ -1,6 +1,8 @@ import React from 'react' import { useTranslation } from 'react-i18next' +import type { GlobalEditViewProps } from '../../types' + import { getTranslation } from '../../../../../utilities/getTranslation' import { DocumentControls } from '../../../elements/DocumentControls' import { Gutter } from '../../../elements/Gutter' @@ -10,100 +12,96 @@ import { filterFields } from '../../../forms/RenderFields/filterFields' import { fieldTypes } from '../../../forms/field-types' import LeaveWithoutSaving from '../../../modals/LeaveWithoutSaving' import Meta from '../../../utilities/Meta' +import { SetStepNav } from '../../collections/Edit/SetStepNav' import './index.scss' -import { EditViewProps } from '../../types' const baseClass = 'global-default-edit' -export const DefaultGlobalEdit: React.FC<EditViewProps> = (props) => { - if ('global' in props) { - const { apiURL, data, global, permissions } = props +export const DefaultGlobalEdit: React.FC<GlobalEditViewProps> = (props) => { + const { i18n } = useTranslation('general') - const { i18n } = useTranslation('general') + const { apiURL, data, global, permissions } = props - const { admin: { description } = {}, fields, label } = global + const { admin: { description } = {}, fields, label } = global - const hasSavePermission = permissions?.update?.permission + const hasSavePermission = permissions?.update?.permission - const sidebarFields = filterFields({ - fieldSchema: fields, - fieldTypes, - filter: (field) => field?.admin?.position === 'sidebar', - permissions: permissions.fields, - readOnly: !hasSavePermission, - }) + const sidebarFields = filterFields({ + fieldSchema: fields, + fieldTypes, + filter: (field) => field?.admin?.position === 'sidebar', + permissions: permissions.fields, + readOnly: !hasSavePermission, + }) - const hasSidebar = sidebarFields && sidebarFields.length > 0 + const hasSidebar = sidebarFields && sidebarFields.length > 0 - return ( - <React.Fragment> - {/* <SetStepNav collection={collection} id={id} isEditing={isEditing} /> */} - <DocumentControls - apiURL={apiURL} - data={data} - global={global} - hasSavePermission={hasSavePermission} - isEditing - permissions={permissions} - /> - <div - className={[ - baseClass, - hasSidebar ? `${baseClass}--has-sidebar` : `${baseClass}--no-sidebar`, - ] - .filter(Boolean) - .join(' ')} - > - <div className={`${baseClass}__main`}> - <Meta - description={getTranslation(label, i18n)} - keywords={`${getTranslation(label, i18n)}, Payload, CMS`} - title={getTranslation(label, i18n)} + return ( + <React.Fragment> + <SetStepNav global={global} /> + <DocumentControls + apiURL={apiURL} + data={data} + global={global} + hasSavePermission={hasSavePermission} + isEditing + permissions={permissions} + /> + <div + className={[ + baseClass, + hasSidebar ? `${baseClass}--has-sidebar` : `${baseClass}--no-sidebar`, + ] + .filter(Boolean) + .join(' ')} + > + <div className={`${baseClass}__main`}> + <Meta + description={getTranslation(label, i18n)} + keywords={`${getTranslation(label, i18n)}, Payload, CMS`} + title={getTranslation(label, i18n)} + /> + {!(global.versions?.drafts && global.versions?.drafts?.autosave) && ( + <LeaveWithoutSaving /> + )} + <Gutter className={`${baseClass}__edit`}> + <header className={`${baseClass}__header`}> + {description && ( + <div className={`${baseClass}__sub-header`}> + <ViewDescription description={description} /> + </div> + )} + </header> + <RenderFields + fieldSchema={fields} + fieldTypes={fieldTypes} + filter={(field) => + !field.admin.position || + (field.admin.position && field.admin.position !== 'sidebar') + } + permissions={permissions.fields} + readOnly={!hasSavePermission} /> - {!(global.versions?.drafts && global.versions?.drafts?.autosave) && ( - <LeaveWithoutSaving /> - )} - <Gutter className={`${baseClass}__edit`}> - <header className={`${baseClass}__header`}> - {description && ( - <div className={`${baseClass}__sub-header`}> - <ViewDescription description={description} /> - </div> - )} - </header> - <RenderFields - fieldSchema={fields} - fieldTypes={fieldTypes} - filter={(field) => - !field.admin.position || - (field.admin.position && field.admin.position !== 'sidebar') - } - permissions={permissions.fields} - readOnly={!hasSavePermission} - /> - </Gutter> - </div> - {hasSidebar && ( - <div className={`${baseClass}__sidebar-wrap`}> - <div className={`${baseClass}__sidebar`}> - <div className={`${baseClass}__sidebar-sticky-wrap`}> - <div className={`${baseClass}__sidebar-fields`}> - <RenderFields - fieldSchema={fields} - fieldTypes={fieldTypes} - filter={(field) => field.admin.position === 'sidebar'} - permissions={permissions.fields} - readOnly={!hasSavePermission} - /> - </div> + </Gutter> + </div> + {hasSidebar && ( + <div className={`${baseClass}__sidebar-wrap`}> + <div className={`${baseClass}__sidebar`}> + <div className={`${baseClass}__sidebar-sticky-wrap`}> + <div className={`${baseClass}__sidebar-fields`}> + <RenderFields + fieldSchema={fields} + fieldTypes={fieldTypes} + filter={(field) => field.admin.position === 'sidebar'} + permissions={permissions.fields} + readOnly={!hasSavePermission} + /> </div> </div> </div> - )} - </div> - </React.Fragment> - ) - } - - return null + </div> + )} + </div> + </React.Fragment> + ) } diff --git a/packages/payload/src/admin/components/views/Global/Routes/CustomComponent.tsx b/packages/payload/src/admin/components/views/Global/Routes/CustomComponent.tsx index 9c995968407..25f4418dac3 100644 --- a/packages/payload/src/admin/components/views/Global/Routes/CustomComponent.tsx +++ b/packages/payload/src/admin/components/views/Global/Routes/CustomComponent.tsx @@ -1,9 +1,10 @@ import React from 'react' +import type { GlobalEditViewProps } from '../../types' + import VersionView from '../../Version/Version' import VersionsView from '../../Versions' import { DefaultGlobalEdit } from '../Default/index' -import { EditViewProps } from '../../types' export type globalViewType = | 'API' @@ -27,37 +28,33 @@ export const defaultGlobalViews: { } export const CustomGlobalComponent = ( - args: EditViewProps & { + args: GlobalEditViewProps & { view: globalViewType }, ) => { - if ('global' in args) { - const { global, view } = args - - const { admin: { components: { views: { Edit } = {} } = {} } = {} } = global - - // Overriding components may come from multiple places in the config - // Need to cascade through the hierarchy to find the correct component to render - // For example, the Edit view: - // 1. Edit?.Default - // 2. Edit?.Default?.Component - // TODO: Remove the `@ts-ignore` when a Typescript wizard arrives - // For some reason `Component` does not exist on type `Edit[view]` no matter how narrow the type is - const Component = - typeof Edit === 'object' && typeof Edit[view] === 'function' - ? Edit[view] - : typeof Edit === 'object' && - typeof Edit?.[view] === 'object' && - // @ts-ignore - typeof Edit[view].Component === 'function' - ? // @ts-ignore - Edit[view].Component - : defaultGlobalViews[view] - - if (Component) { - return <Component {...args} /> - } + const { global, view } = args + + const { admin: { components: { views: { Edit } = {} } = {} } = {} } = global + + // Overriding components may come from multiple places in the config + // Need to cascade through the hierarchy to find the correct component to render + // For example, the Edit view: + // 1. Edit?.Default + // 2. Edit?.Default?.Component + // TODO: Remove the `@ts-ignore` when a Typescript wizard arrives + // For some reason `Component` does not exist on type `Edit[view]` no matter how narrow the type is + const Component = + typeof Edit === 'object' && typeof Edit[view] === 'function' + ? Edit[view] + : typeof Edit === 'object' && + typeof Edit?.[view] === 'object' && + // @ts-ignore + typeof Edit[view].Component === 'function' + ? // @ts-ignore + Edit[view].Component + : defaultGlobalViews[view] + + if (Component) { + return <Component {...args} /> } - - return null } diff --git a/packages/payload/src/admin/components/views/Global/Routes/index.tsx b/packages/payload/src/admin/components/views/Global/Routes/index.tsx index e979a91af59..2a1c2274944 100644 --- a/packages/payload/src/admin/components/views/Global/Routes/index.tsx +++ b/packages/payload/src/admin/components/views/Global/Routes/index.tsx @@ -2,74 +2,71 @@ import { lazy } from 'react' import React from 'react' import { Route, Switch, useRouteMatch } from 'react-router-dom' +import type { GlobalEditViewProps } from '../../types' + import { useAuth } from '../../../utilities/Auth' import { useConfig } from '../../../utilities/Config' import NotFound from '../../NotFound' import { CustomGlobalComponent } from './CustomComponent' import { globalCustomRoutes } from './custom' -import { EditViewProps } from '../../types' // @ts-expect-error Just TypeScript being broken // TODO: Open TypeScript issue const Unauthorized = lazy(() => import('../../Unauthorized')) -export const GlobalRoutes: React.FC<EditViewProps> = (props) => { - if ('global' in props) { - const { global, permissions } = props - - const match = useRouteMatch() +export const GlobalRoutes: React.FC<GlobalEditViewProps> = (props) => { + const { global, permissions } = props - const { - routes: { admin: adminRoute }, - } = useConfig() + const match = useRouteMatch() - const { user } = useAuth() + const { + routes: { admin: adminRoute }, + } = useConfig() - return ( - <Switch> - <Route - exact - key={`${global.slug}-versions`} - path={`${adminRoute}/globals/${global.slug}/versions`} - > - {permissions?.readVersions?.permission ? ( - <CustomGlobalComponent view="Versions" {...props} /> - ) : ( - <Unauthorized /> - )} - </Route> - <Route - exact - key={`${global.slug}-view-version`} - path={`${adminRoute}/globals/${global.slug}/versions/:versionID`} - > - {permissions?.readVersions?.permission ? ( - <CustomGlobalComponent view="Version" {...props} /> - ) : ( - <Unauthorized /> - )} - </Route> - <Route - exact - key={`${global.slug}-live-preview`} - path={`${adminRoute}/globals/${global.slug}/preview`} - > - <CustomGlobalComponent view="LivePreview" {...props} /> - </Route> - {globalCustomRoutes({ - global, - match, - permissions, - user, - })} - <Route exact key={`${global.slug}-view`} path={`${adminRoute}/globals/${global.slug}`}> - <CustomGlobalComponent view="Default" {...props} /> - </Route> - <Route path={`${match.url}*`}> - <NotFound marginTop="large" /> - </Route> - </Switch> - ) - } + const { user } = useAuth() - return null + return ( + <Switch> + <Route + exact + key={`${global.slug}-versions`} + path={`${adminRoute}/globals/${global.slug}/versions`} + > + {permissions?.readVersions?.permission ? ( + <CustomGlobalComponent view="Versions" {...props} /> + ) : ( + <Unauthorized /> + )} + </Route> + <Route + exact + key={`${global.slug}-view-version`} + path={`${adminRoute}/globals/${global.slug}/versions/:versionID`} + > + {permissions?.readVersions?.permission ? ( + <CustomGlobalComponent view="Version" {...props} /> + ) : ( + <Unauthorized /> + )} + </Route> + <Route + exact + key={`${global.slug}-live-preview`} + path={`${adminRoute}/globals/${global.slug}/preview`} + > + <CustomGlobalComponent view="LivePreview" {...props} /> + </Route> + {globalCustomRoutes({ + global, + match, + permissions, + user, + })} + <Route exact key={`${global.slug}-view`} path={`${adminRoute}/globals/${global.slug}`}> + <CustomGlobalComponent view="Default" {...props} /> + </Route> + <Route path={`${match.url}*`}> + <NotFound marginTop="large" /> + </Route> + </Switch> + ) } diff --git a/packages/payload/src/admin/components/views/Global/index.tsx b/packages/payload/src/admin/components/views/Global/index.tsx index ab693e0e8f5..1e0a530f8d1 100644 --- a/packages/payload/src/admin/components/views/Global/index.tsx +++ b/packages/payload/src/admin/components/views/Global/index.tsx @@ -3,27 +3,25 @@ import { useTranslation } from 'react-i18next' import { useLocation } from 'react-router-dom' import type { Fields } from '../../forms/Form/types' +import type { GlobalEditViewProps } from '../types' import type { IndexProps } from './types' import usePayloadAPI from '../../../hooks/usePayloadAPI' -import { useStepNav } from '../../elements/StepNav' import buildStateFromSchema from '../../forms/Form/buildStateFromSchema' import { useAuth } from '../../utilities/Auth' import { useConfig } from '../../utilities/Config' import { useDocumentInfo } from '../../utilities/DocumentInfo' +import { EditDepthContext } from '../../utilities/EditDepth' import { useLocale } from '../../utilities/Locale' import { usePreferences } from '../../utilities/Preferences' import RenderCustomComponent from '../../utilities/RenderCustomComponent' import DefaultGlobalView from './Default' -import { EditDepthContext } from '../../utilities/EditDepth' -import { EditViewProps } from '../types' const GlobalView: React.FC<IndexProps> = (props) => { const { global } = props const { state: locationState } = useLocation<{ data?: Record<string, unknown> }>() const { code: locale } = useLocale() - const { setStepNav } = useStepNav() const { permissions, user } = useAuth() const [initialState, setInitialState] = useState<Fields>() const [updatedAt, setUpdatedAt] = useState<string>() @@ -37,12 +35,7 @@ const GlobalView: React.FC<IndexProps> = (props) => { serverURL, } = useConfig() - const { - admin: { components: { views: { Edit: Edit } = {} } = {} } = {}, - fields, - label, - slug, - } = global + const { admin: { components: { views: { Edit: Edit } = {} } = {} } = {}, fields, slug } = global const onSave = useCallback( async (json) => { @@ -71,16 +64,6 @@ const GlobalView: React.FC<IndexProps> = (props) => { const dataToRender = locationState?.data || data - useEffect(() => { - const nav = [ - { - label, - }, - ] - - setStepNav(nav) - }, [setStepNav, label]) - useEffect(() => { const awaitInitialState = async () => { const preferences = await getDocPreferences() @@ -102,7 +85,7 @@ const GlobalView: React.FC<IndexProps> = (props) => { const isLoading = !initialState || !docPermissions || isLoadingData - const componentProps: EditViewProps = { + const componentProps: GlobalEditViewProps = { action: `${serverURL}${api}/globals/${slug}?locale=${locale}&fallback-locale=null`, apiURL: `${serverURL}${api}/globals/${slug}?locale=${locale}${ global.versions?.drafts ? '&draft=true' : '' diff --git a/packages/payload/src/admin/components/views/LivePreview/index.tsx b/packages/payload/src/admin/components/views/LivePreview/index.tsx index d89e6a57cc4..b5c3ceb1bc3 100644 --- a/packages/payload/src/admin/components/views/LivePreview/index.tsx +++ b/packages/payload/src/admin/components/views/LivePreview/index.tsx @@ -12,6 +12,7 @@ import { filterFields } from '../../forms/RenderFields/filterFields' import { fieldTypes } from '../../forms/field-types' import LeaveWithoutSaving from '../../modals/LeaveWithoutSaving' import Meta from '../../utilities/Meta' +import { SetStepNav } from '../collections/Edit/SetStepNav' import { LivePreview } from './Preview' import './index.scss' import { usePopupWindow } from './usePopupWindow' @@ -71,6 +72,7 @@ export const LivePreviewView: React.FC<EditViewProps> = (props) => { return ( <Fragment> + <SetStepNav collection={collection} global={global} id={id} isEditing={isEditing} /> <DocumentControls apiURL={apiURL} collection={collection} diff --git a/packages/payload/src/admin/components/views/Version/Version.tsx b/packages/payload/src/admin/components/views/Version/Version.tsx index 0d8e1f6dc7a..66c0cdc32f1 100644 --- a/packages/payload/src/admin/components/views/Version/Version.tsx +++ b/packages/payload/src/admin/components/views/Version/Version.tsx @@ -85,7 +85,7 @@ const VersionView: React.FC<Props> = ({ collection, global }) => { ? originalDocFetchURL : `${compareBaseURL}/${compareValue.value}` - const [{ data: doc, isError, isLoading: isLoadingData }] = usePayloadAPI(versionFetchURL, { + const [{ data: doc, isError }] = usePayloadAPI(versionFetchURL, { initialParams: { depth: 1, locale: '*' }, }) const [{ data: publishedDoc }] = usePayloadAPI(originalDocFetchURL, { diff --git a/packages/payload/src/admin/components/views/collections/Edit/Default.tsx b/packages/payload/src/admin/components/views/collections/Edit/Default.tsx index 675b0150422..c25aa0b58e2 100644 --- a/packages/payload/src/admin/components/views/collections/Edit/Default.tsx +++ b/packages/payload/src/admin/components/views/collections/Edit/Default.tsx @@ -1,6 +1,8 @@ import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' +import type { CollectionEditViewProps } from '../../types' + import { getTranslation } from '../../../../../utilities/getTranslation' import { DocumentHeader } from '../../../elements/DocumentHeader' import { FormLoadingOverlayToggle } from '../../../elements/Loading' @@ -9,104 +11,99 @@ import { useAuth } from '../../../utilities/Auth' import { OperationContext } from '../../../utilities/OperationProvider' import { CollectionRoutes } from './Routes' import { CustomCollectionComponent } from './Routes/CustomComponent' -import { EditViewProps } from '../../types' import './index.scss' const baseClass = 'collection-edit' const DefaultEditView: React.FC< - EditViewProps & { - disableRoutes?: boolean + CollectionEditViewProps & { customHeader?: React.ReactNode + disableRoutes?: boolean } > = (props) => { const { i18n } = useTranslation('general') const { refreshCookieAsync, user } = useAuth() - if ('collection' in props) { - const { - id, - action, - apiURL, - collection, - customHeader, - data, - disableRoutes, - hasSavePermission, - internalState, - isEditing, - isLoading, - onSave: onSaveFromProps, - } = props + const { + id, + action, + apiURL, + collection, + customHeader, + data, + disableRoutes, + hasSavePermission, + internalState, + isEditing, + isLoading, + onSave: onSaveFromProps, + } = props - const { auth } = collection + const { auth } = collection - const classes = [baseClass, isEditing && `${baseClass}--is-editing`].filter(Boolean).join(' ') + const classes = [baseClass, isEditing && `${baseClass}--is-editing`].filter(Boolean).join(' ') - const onSave = useCallback( - async (json) => { - if (auth && id === user.id) { - await refreshCookieAsync() - } + const onSave = useCallback( + async (json) => { + if (auth && id === user.id) { + await refreshCookieAsync() + } - if (typeof onSaveFromProps === 'function') { - onSaveFromProps({ - ...json, - operation: id ? 'update' : 'create', - }) - } - }, - [id, onSaveFromProps, auth, user, refreshCookieAsync], - ) + if (typeof onSaveFromProps === 'function') { + onSaveFromProps({ + ...json, + operation: id ? 'update' : 'create', + }) + } + }, + [id, onSaveFromProps, auth, user, refreshCookieAsync], + ) - const operation = isEditing ? 'update' : 'create' - - return ( - <main className={classes}> - <OperationContext.Provider value={operation}> - <Form - action={action} - className={`${baseClass}__form`} - disabled={!hasSavePermission} - initialState={internalState} - method={id ? 'patch' : 'post'} - onSuccess={onSave} - > - <FormLoadingOverlayToggle - action={isLoading ? 'loading' : operation} - formIsLoading={isLoading} - loadingSuffix={getTranslation(collection.labels.singular, i18n)} - name={`collection-edit--${ - typeof collection?.labels?.singular === 'string' - ? collection.labels.singular - : 'document' - }`} - type="withoutNav" - /> - {!isLoading && ( - <React.Fragment> - <DocumentHeader - apiURL={apiURL} - collection={collection} - customHeader={customHeader} - data={data} - id={id} - isEditing={isEditing} - /> - {disableRoutes ? ( - <CustomCollectionComponent view="Default" {...props} /> - ) : ( - <CollectionRoutes {...props} /> - )} - </React.Fragment> - )} - </Form> - </OperationContext.Provider> - </main> - ) - } + const operation = isEditing ? 'update' : 'create' - return null + return ( + <main className={classes}> + <OperationContext.Provider value={operation}> + <Form + action={action} + className={`${baseClass}__form`} + disabled={!hasSavePermission} + initialState={internalState} + method={id ? 'patch' : 'post'} + onSuccess={onSave} + > + <FormLoadingOverlayToggle + action={isLoading ? 'loading' : operation} + formIsLoading={isLoading} + loadingSuffix={getTranslation(collection.labels.singular, i18n)} + name={`collection-edit--${ + typeof collection?.labels?.singular === 'string' + ? collection.labels.singular + : 'document' + }`} + type="withoutNav" + /> + {!isLoading && ( + <React.Fragment> + <DocumentHeader + apiURL={apiURL} + collection={collection} + customHeader={customHeader} + data={data} + id={id} + isEditing={isEditing} + /> + {disableRoutes ? ( + <CustomCollectionComponent view="Default" {...props} /> + ) : ( + <CollectionRoutes {...props} /> + )} + </React.Fragment> + )} + </Form> + </OperationContext.Provider> + </main> + ) } export default DefaultEditView diff --git a/packages/payload/src/admin/components/views/collections/Edit/Default/index.tsx b/packages/payload/src/admin/components/views/collections/Edit/Default/index.tsx index bf3953de0c3..3b92781b9c8 100644 --- a/packages/payload/src/admin/components/views/collections/Edit/Default/index.tsx +++ b/packages/payload/src/admin/components/views/collections/Edit/Default/index.tsx @@ -1,6 +1,8 @@ import React, { Fragment } from 'react' import { useTranslation } from 'react-i18next' +import type { CollectionEditViewProps } from '../../../types' + import { getTranslation } from '../../../../../../utilities/getTranslation' import { DocumentControls } from '../../../../elements/DocumentControls' import { Gutter } from '../../../../elements/Gutter' @@ -13,115 +15,110 @@ import Auth from '../Auth' import { SetStepNav } from '../SetStepNav' import Upload from '../Upload' import './index.scss' -import { EditViewProps } from '../../../types' const baseClass = 'collection-default-edit' -export const DefaultCollectionEdit: React.FC<EditViewProps> = (props) => { - if ('collection' in props) { - const { i18n, t } = useTranslation('general') +export const DefaultCollectionEdit: React.FC<CollectionEditViewProps> = (props) => { + const { i18n, t } = useTranslation('general') - const { - id, - apiURL, - collection, - data, - disableActions, - disableLeaveWithoutSaving, - hasSavePermission, - internalState, - isEditing, - permissions, - } = props + const { + id, + apiURL, + collection, + data, + disableActions, + disableLeaveWithoutSaving, + hasSavePermission, + internalState, + isEditing, + permissions, + } = props - const { auth, fields, upload } = collection + const { auth, fields, upload } = collection - const operation = isEditing ? 'update' : 'create' + const operation = isEditing ? 'update' : 'create' - const sidebarFields = filterFields({ - fieldSchema: fields, - fieldTypes, - filter: (field) => field?.admin?.position === 'sidebar', - permissions: permissions.fields, - readOnly: !hasSavePermission, - }) + const sidebarFields = filterFields({ + fieldSchema: fields, + fieldTypes, + filter: (field) => field?.admin?.position === 'sidebar', + permissions: permissions.fields, + readOnly: !hasSavePermission, + }) - const hasSidebar = sidebarFields && sidebarFields.length > 0 + const hasSidebar = sidebarFields && sidebarFields.length > 0 - return ( - <Fragment> - <SetStepNav collection={collection} id={id} isEditing={isEditing} /> - <DocumentControls - apiURL={apiURL} - collection={collection} - data={data} - disableActions={disableActions} - hasSavePermission={hasSavePermission} - id={id} - isEditing={isEditing} - permissions={permissions} - /> - <div - className={[ - baseClass, - hasSidebar ? `${baseClass}--has-sidebar` : `${baseClass}--no-sidebar`, - ] - .filter(Boolean) - .join(' ')} - > - <div className={`${baseClass}__main`}> - <Meta - description={`${isEditing ? t('editing') : t('creating')} - ${getTranslation( - collection.labels.singular, - i18n, - )}`} - keywords={`${getTranslation(collection.labels.singular, i18n)}, Payload, CMS`} - title={`${isEditing ? t('editing') : t('creating')} - ${getTranslation( - collection.labels.singular, - i18n, - )}`} - /> - {!(collection.versions?.drafts && collection.versions?.drafts?.autosave) && - !disableLeaveWithoutSaving && <LeaveWithoutSaving />} - <Gutter className={`${baseClass}__edit`}> - {auth && ( - <Auth - className={`${baseClass}__auth`} - collection={collection} - email={data?.email} - operation={operation} - readOnly={!hasSavePermission} - requirePassword={!isEditing} - useAPIKey={auth.useAPIKey} - verify={auth.verify} - /> - )} - {upload && ( - <Upload collection={collection} data={data} internalState={internalState} /> - )} - <RenderFields - fieldSchema={fields} - fieldTypes={fieldTypes} - filter={(field) => !field?.admin?.position || field?.admin?.position !== 'sidebar'} - permissions={permissions.fields} + return ( + <Fragment> + <SetStepNav collection={collection} id={id} isEditing={isEditing} /> + <DocumentControls + apiURL={apiURL} + collection={collection} + data={data} + disableActions={disableActions} + hasSavePermission={hasSavePermission} + id={id} + isEditing={isEditing} + permissions={permissions} + /> + <div + className={[ + baseClass, + hasSidebar ? `${baseClass}--has-sidebar` : `${baseClass}--no-sidebar`, + ] + .filter(Boolean) + .join(' ')} + > + <div className={`${baseClass}__main`}> + <Meta + description={`${isEditing ? t('editing') : t('creating')} - ${getTranslation( + collection.labels.singular, + i18n, + )}`} + keywords={`${getTranslation(collection.labels.singular, i18n)}, Payload, CMS`} + title={`${isEditing ? t('editing') : t('creating')} - ${getTranslation( + collection.labels.singular, + i18n, + )}`} + /> + {!(collection.versions?.drafts && collection.versions?.drafts?.autosave) && + !disableLeaveWithoutSaving && <LeaveWithoutSaving />} + <Gutter className={`${baseClass}__edit`}> + {auth && ( + <Auth + className={`${baseClass}__auth`} + collection={collection} + email={data?.email} + operation={operation} readOnly={!hasSavePermission} - className={`${baseClass}__fields`} + requirePassword={!isEditing} + useAPIKey={auth.useAPIKey} + verify={auth.verify} /> - </Gutter> - </div> - {hasSidebar && ( - <div className={`${baseClass}__sidebar-wrap`}> - <div className={`${baseClass}__sidebar`}> - <div className={`${baseClass}__sidebar-sticky-wrap`}> - <div className={`${baseClass}__sidebar-fields`}> - <RenderFields fieldTypes={fieldTypes} fields={sidebarFields} /> - </div> + )} + {upload && <Upload collection={collection} data={data} internalState={internalState} />} + <RenderFields + className={`${baseClass}__fields`} + fieldSchema={fields} + fieldTypes={fieldTypes} + filter={(field) => !field?.admin?.position || field?.admin?.position !== 'sidebar'} + permissions={permissions.fields} + readOnly={!hasSavePermission} + /> + </Gutter> + </div> + {hasSidebar && ( + <div className={`${baseClass}__sidebar-wrap`}> + <div className={`${baseClass}__sidebar`}> + <div className={`${baseClass}__sidebar-sticky-wrap`}> + <div className={`${baseClass}__sidebar-fields`}> + <RenderFields fieldTypes={fieldTypes} fields={sidebarFields} /> </div> </div> </div> - )} - </div> - </Fragment> - ) - } + </div> + )} + </div> + </Fragment> + ) } diff --git a/packages/payload/src/admin/components/views/collections/Edit/Routes/CustomComponent.tsx b/packages/payload/src/admin/components/views/collections/Edit/Routes/CustomComponent.tsx index 393abedc3be..3ceae22d3bf 100644 --- a/packages/payload/src/admin/components/views/collections/Edit/Routes/CustomComponent.tsx +++ b/packages/payload/src/admin/components/views/collections/Edit/Routes/CustomComponent.tsx @@ -1,12 +1,12 @@ import React from 'react' -import type { EditViewProps } from '../../../types' +import type { CollectionEditViewProps } from '../../../types' +import { LivePreviewView } from '../../../LivePreview' import { QueryInspector } from '../../../RestAPI' import VersionView from '../../../Version/Version' import VersionsView from '../../../Versions' import { DefaultCollectionEdit } from '../Default/index' -import { LivePreviewView } from '../../../LivePreview' export type collectionViewType = | 'API' @@ -30,37 +30,33 @@ export const defaultCollectionViews: { } export const CustomCollectionComponent = ( - args: EditViewProps & { + args: CollectionEditViewProps & { view: collectionViewType }, ) => { - if ('collection' in args) { - const { collection, view } = args - - const { admin: { components: { views: { Edit } = {} } = {} } = {} } = collection - - // Overriding components may come from multiple places in the config - // Need to cascade through the hierarchy to find the correct component to render - // For example, the Edit view: - // 1. Edit?.Default - // 2. Edit?.Default?.Component - // TODO: Remove the `@ts-ignore` when a Typescript wizard arrives - // For some reason `Component` does not exist on type `Edit[view]` no matter how narrow the type is - const Component = - typeof Edit === 'object' && typeof Edit[view] === 'function' - ? Edit[view] - : typeof Edit === 'object' && - typeof Edit?.[view] === 'object' && - // @ts-ignore - typeof Edit[view].Component === 'function' - ? // @ts-ignore - Edit[view].Component - : defaultCollectionViews[view] - - if (Component) { - return <Component {...args} /> - } + const { collection, view } = args + + const { admin: { components: { views: { Edit } = {} } = {} } = {} } = collection + + // Overriding components may come from multiple places in the config + // Need to cascade through the hierarchy to find the correct component to render + // For example, the Edit view: + // 1. Edit?.Default + // 2. Edit?.Default?.Component + // TODO: Remove the `@ts-ignore` when a Typescript wizard arrives + // For some reason `Component` does not exist on type `Edit[view]` no matter how narrow the type is + const Component = + typeof Edit === 'object' && typeof Edit[view] === 'function' + ? Edit[view] + : typeof Edit === 'object' && + typeof Edit?.[view] === 'object' && + // @ts-ignore + typeof Edit[view].Component === 'function' + ? // @ts-ignore + Edit[view].Component + : defaultCollectionViews[view] + + if (Component) { + return <Component {...args} /> } - - return null } diff --git a/packages/payload/src/admin/components/views/collections/Edit/Routes/index.tsx b/packages/payload/src/admin/components/views/collections/Edit/Routes/index.tsx index fad0d88710f..69bb03a257e 100644 --- a/packages/payload/src/admin/components/views/collections/Edit/Routes/index.tsx +++ b/packages/payload/src/admin/components/views/collections/Edit/Routes/index.tsx @@ -2,7 +2,7 @@ import { lazy } from 'react' import React from 'react' import { Route, Switch, useRouteMatch } from 'react-router-dom' -import type { EditViewProps } from '../../../types' +import type { CollectionEditViewProps } from '../../../types' import { useAuth } from '../../../../utilities/Auth' import { useConfig } from '../../../../utilities/Config' @@ -13,77 +13,71 @@ import { collectionCustomRoutes } from './custom' // @ts-expect-error Just TypeScript being broken // TODO: Open TypeScript issue const Unauthorized = lazy(() => import('../../../Unauthorized')) -export const CollectionRoutes: React.FC<EditViewProps> = (props) => { - if ('collection' in props) { - const { collection, permissions } = props +export const CollectionRoutes: React.FC<CollectionEditViewProps> = (props) => { + const { collection, permissions } = props - const match = useRouteMatch() + const match = useRouteMatch() - const { - routes: { admin: adminRoute }, - } = useConfig() + const { + routes: { admin: adminRoute }, + } = useConfig() - const { user } = useAuth() + const { user } = useAuth() - return ( - <Switch> - <Route - exact - key={`${collection.slug}-versions`} - path={`${adminRoute}/collections/${collection.slug}/:id/versions`} - > - {permissions?.readVersions?.permission ? ( - <CustomCollectionComponent view="Versions" {...props} /> - ) : ( - <Unauthorized /> - )} - </Route> - <Route - exact - key={`${collection.slug}-api`} - path={`${adminRoute}/collections/${collection.slug}/:id/api`} - > - {permissions?.read ? ( - <CustomCollectionComponent view="API" {...props} /> - ) : ( - <Unauthorized /> - )} - </Route> - <Route - exact - key={`${collection.slug}-view-version`} - path={`${adminRoute}/collections/${collection.slug}/:id/versions/:versionID`} - > - {permissions?.readVersions?.permission ? ( - <CustomCollectionComponent view="Version" {...props} /> - ) : ( - <Unauthorized /> - )} - </Route> - <Route - exact - key={`${collection.slug}-live-preview`} - path={`${adminRoute}/collections/${collection.slug}/:id/preview`} - > - <CustomCollectionComponent view="LivePreview" {...props} /> - </Route> - {collectionCustomRoutes({ - collection, - match, - permissions, - user, - })} - <Route - exact - key={`${collection.slug}-view`} - path={`${adminRoute}/collections/${collection.slug}/:id`} - > - <CustomCollectionComponent view="Default" {...props} /> - </Route> - <Route path={`${match.url}*`}> - <NotFound marginTop="large" /> - </Route> - </Switch> - ) - } + return ( + <Switch> + <Route + exact + key={`${collection.slug}-versions`} + path={`${adminRoute}/collections/${collection.slug}/:id/versions`} + > + {permissions?.readVersions?.permission ? ( + <CustomCollectionComponent view="Versions" {...props} /> + ) : ( + <Unauthorized /> + )} + </Route> + <Route + exact + key={`${collection.slug}-api`} + path={`${adminRoute}/collections/${collection.slug}/:id/api`} + > + {permissions?.read ? <CustomCollectionComponent view="API" {...props} /> : <Unauthorized />} + </Route> + <Route + exact + key={`${collection.slug}-view-version`} + path={`${adminRoute}/collections/${collection.slug}/:id/versions/:versionID`} + > + {permissions?.readVersions?.permission ? ( + <CustomCollectionComponent view="Version" {...props} /> + ) : ( + <Unauthorized /> + )} + </Route> + <Route + exact + key={`${collection.slug}-live-preview`} + path={`${adminRoute}/collections/${collection.slug}/:id/preview`} + > + <CustomCollectionComponent view="LivePreview" {...props} /> + </Route> + {collectionCustomRoutes({ + collection, + match, + permissions, + user, + })} + <Route + exact + key={`${collection.slug}-view`} + path={`${adminRoute}/collections/${collection.slug}/:id`} + > + <CustomCollectionComponent view="Default" {...props} /> + </Route> + <Route path={`${match.url}*`}> + <NotFound marginTop="large" /> + </Route> + </Switch> + ) } diff --git a/packages/payload/src/admin/components/views/collections/Edit/SetStepNav.tsx b/packages/payload/src/admin/components/views/collections/Edit/SetStepNav.tsx index 0610a905a78..62daa389d6a 100644 --- a/packages/payload/src/admin/components/views/collections/Edit/SetStepNav.tsx +++ b/packages/payload/src/admin/components/views/collections/Edit/SetStepNav.tsx @@ -2,6 +2,7 @@ import { useEffect } from 'react' import { useTranslation } from 'react-i18next' import type { SanitizedCollectionConfig } from '../../../../../collections/config/types' +import type { SanitizedGlobalConfig } from '../../../../../exports/types' import type { StepNavItem } from '../../../elements/StepNav/types' import { getTranslation } from '../../../../../utilities/getTranslation' @@ -9,45 +10,96 @@ import useTitle from '../../../../hooks/useTitle' import { useStepNav } from '../../../elements/StepNav' import { useConfig } from '../../../utilities/Config' -export const SetStepNav: React.FC<{ - collection: SanitizedCollectionConfig - id: string - isEditing: boolean -}> = ({ id, collection, isEditing }) => { - const { - admin: { useAsTitle }, - labels: { plural: pluralLabel }, - slug, - } = collection +export const SetStepNav: React.FC< + | { + collection: SanitizedCollectionConfig + id: string + isEditing: boolean + } + | { + global: SanitizedGlobalConfig + } +> = (props) => { + let collection: SanitizedCollectionConfig | undefined + let global: SanitizedGlobalConfig | undefined + + let useAsTitle: string | undefined + let pluralLabel: SanitizedCollectionConfig['labels']['plural'] + let slug: string + let isEditing = false + let id: string | undefined + + // This only applies to collections + const title = useTitle(collection) + + if ('collection' in props) { + const { + id: idFromProps, + collection: collectionFromProps, + isEditing: isEditingFromProps, + } = props + collection = collectionFromProps + useAsTitle = collection.admin.useAsTitle + pluralLabel = collection.labels.plural + slug = collection.slug + isEditing = isEditingFromProps + id = idFromProps + } + + if ('global' in props) { + const { global: globalFromProps } = props + global = globalFromProps + slug = globalFromProps?.slug + } const { setStepNav } = useStepNav() + const { i18n, t } = useTranslation('general') + const { routes: { admin }, } = useConfig() - const title = useTitle(collection) - useEffect(() => { - const nav: StepNavItem[] = [ - { - label: getTranslation(pluralLabel, i18n), - url: `${admin}/collections/${slug}`, - }, - ] + const nav: StepNavItem[] = [] - if (isEditing) { + if (collection) { nav.push({ - label: useAsTitle && useAsTitle !== 'id' ? title || `[${t('untitled')}]` : id, + label: getTranslation(pluralLabel, i18n), + url: `${admin}/collections/${slug}`, }) - } else { + + if (isEditing) { + nav.push({ + label: useAsTitle && useAsTitle !== 'id' ? title || `[${t('untitled')}]` : id, + }) + } else { + nav.push({ + label: t('createNew'), + }) + } + } else if (global) { nav.push({ - label: t('createNew'), + label: getTranslation(global.label, i18n), + url: `${admin}/globals/${slug}`, }) } setStepNav(nav) - }, [setStepNav, isEditing, pluralLabel, id, slug, useAsTitle, admin, t, i18n, title]) + }, [ + setStepNav, + isEditing, + pluralLabel, + id, + slug, + useAsTitle, + admin, + t, + i18n, + title, + global, + collection, + ]) return null } diff --git a/packages/payload/src/admin/components/views/collections/Edit/index.tsx b/packages/payload/src/admin/components/views/collections/Edit/index.tsx index 16993d866b6..ed8ddb08b8c 100644 --- a/packages/payload/src/admin/components/views/collections/Edit/index.tsx +++ b/packages/payload/src/admin/components/views/collections/Edit/index.tsx @@ -4,6 +4,7 @@ import { useHistory, useRouteMatch } from 'react-router-dom' import type { CollectionPermission } from '../../../../../auth' import type { Fields } from '../../../forms/Form/types' +import type { CollectionEditViewProps } from '../../types' import type { IndexProps } from './types' import usePayloadAPI from '../../../../hooks/usePayloadAPI' @@ -17,7 +18,6 @@ import RenderCustomComponent from '../../../utilities/RenderCustomComponent' import NotFound from '../../NotFound' import DefaultEdit from './Default' import formatFields from './formatFields' -import { EditViewProps } from '../../types' const EditView: React.FC<IndexProps> = (props) => { const { collection: incomingCollection, isEditing } = props @@ -125,7 +125,7 @@ const EditView: React.FC<IndexProps> = (props) => { const isLoading = !internalState || !docPermissions || isLoadingData - const componentProps: EditViewProps = { + const componentProps: CollectionEditViewProps = { id, action, apiURL, diff --git a/packages/payload/src/admin/components/views/types.ts b/packages/payload/src/admin/components/views/types.ts index 6e430e38a93..f9e2a8d87af 100644 --- a/packages/payload/src/admin/components/views/types.ts +++ b/packages/payload/src/admin/components/views/types.ts @@ -5,24 +5,25 @@ import type { SanitizedGlobalConfig, } from '../../../exports/types' -export type EditViewProps = ( - | { - collection: SanitizedCollectionConfig - disableActions?: boolean - disableLeaveWithoutSaving?: boolean - hasSavePermission: boolean - id: string - initialState?: Fields - internalState: Fields - isEditing: boolean - permissions: CollectionPermission - } - | { - global: SanitizedGlobalConfig - initialState: Fields - permissions: GlobalPermission - } -) & { +export type CollectionEditViewProps = BaseEditViewProps & { + collection: SanitizedCollectionConfig + disableActions?: boolean + disableLeaveWithoutSaving?: boolean + hasSavePermission: boolean + id: string + initialState?: Fields + internalState: Fields + isEditing: boolean + permissions: CollectionPermission +} + +export type GlobalEditViewProps = BaseEditViewProps & { + global: SanitizedGlobalConfig + initialState: Fields + permissions: GlobalPermission +} + +export type BaseEditViewProps = { action: string apiURL: string canAccessAdmin: boolean @@ -32,3 +33,5 @@ export type EditViewProps = ( updatedAt: string user: User } + +export type EditViewProps = CollectionEditViewProps | GlobalEditViewProps diff --git a/packages/payload/src/admin/hooks/useTitle.tsx b/packages/payload/src/admin/hooks/useTitle.tsx index 63f24f09f23..2d30064aadc 100644 --- a/packages/payload/src/admin/hooks/useTitle.tsx +++ b/packages/payload/src/admin/hooks/useTitle.tsx @@ -52,11 +52,20 @@ export const formatUseAsTitle = (args: { return title } -const useTitle = (collection: SanitizedCollectionConfig): string => { +// Keep `collection` optional so that component do need to worry about conditionally rendering hooks +// This is so that components which take both `collection` and `global` props can use this hook +const useTitle = (collection?: SanitizedCollectionConfig): string => { const { i18n } = useTranslation() - const field = useFormFields(([formFields]) => formFields[collection?.admin?.useAsTitle]) + + const field = useFormFields(([formFields]) => { + if (!collection) return + return formFields[collection?.admin?.useAsTitle] + }) + const config = useConfig() + if (!collection) return '' + return formatUseAsTitle({ collection, config, field, i18n }) } diff --git a/packages/payload/src/config/types.ts b/packages/payload/src/config/types.ts index ae51cd09697..05f0870cc0f 100644 --- a/packages/payload/src/config/types.ts +++ b/packages/payload/src/config/types.ts @@ -13,7 +13,7 @@ import type { InlineConfig } from 'vite' import type { DocumentTab } from '../admin/components/elements/DocumentHeader/Tabs/types' import type { RichTextAdapter } from '../admin/components/forms/field-types/RichText/types' -import type { EditViewProps } from '../admin/components/views/types' +import type { CollectionEditViewProps, GlobalEditViewProps } from '../admin/components/views/types' import type { User } from '../auth/types' import type { PayloadBundler } from '../bundlers/types' import type { @@ -241,7 +241,7 @@ export type EditViewConfig = { path: string } -export type EditViewComponent = React.ComponentType<EditViewProps> +export type EditViewComponent = React.ComponentType<CollectionEditViewProps | GlobalEditViewProps> export type EditView = EditViewComponent | EditViewConfig diff --git a/test/admin/components/views/CustomDefault/index.tsx b/test/admin/components/views/CustomDefault/index.tsx index 05ac9af0be3..f210cfb9235 100644 --- a/test/admin/components/views/CustomDefault/index.tsx +++ b/test/admin/components/views/CustomDefault/index.tsx @@ -1,9 +1,10 @@ import React, { Fragment, useEffect } from 'react' import { Redirect } from 'react-router-dom' +import type { EditViewComponent } from '../../../../../packages/payload/src/config/types' + import { useStepNav } from '../../../../../packages/payload/src/admin/components/elements/StepNav' import { useConfig } from '../../../../../packages/payload/src/admin/components/utilities/Config' -import { EditViewComponent } from '../../../../../packages/payload/src/config/types' const CustomDefaultView: EditViewComponent = ({ canAccessAdmin, diff --git a/test/admin/components/views/CustomEdit/index.tsx b/test/admin/components/views/CustomEdit/index.tsx index 0f793bc1459..2f2b9e05a81 100644 --- a/test/admin/components/views/CustomEdit/index.tsx +++ b/test/admin/components/views/CustomEdit/index.tsx @@ -1,9 +1,10 @@ import React, { Fragment, useEffect } from 'react' import { Redirect } from 'react-router-dom' +import type { EditViewComponent } from '../../../../../packages/payload/src/config/types' + import { useStepNav } from '../../../../../packages/payload/src/admin/components/elements/StepNav' import { useConfig } from '../../../../../packages/payload/src/admin/components/utilities/Config' -import { EditViewComponent } from '../../../../../packages/payload/src/config/types' const CustomEditView: EditViewComponent = ({ canAccessAdmin, diff --git a/test/admin/components/views/CustomVersions/index.tsx b/test/admin/components/views/CustomVersions/index.tsx index 24694d010f9..872941da122 100644 --- a/test/admin/components/views/CustomVersions/index.tsx +++ b/test/admin/components/views/CustomVersions/index.tsx @@ -1,9 +1,10 @@ import React, { Fragment, useEffect } from 'react' import { Redirect } from 'react-router-dom' +import type { EditViewComponent } from '../../../../../packages/payload/src/config/types' + import { useStepNav } from '../../../../../packages/payload/src/admin/components/elements/StepNav' import { useConfig } from '../../../../../packages/payload/src/admin/components/utilities/Config' -import { EditViewComponent } from '../../../../../packages/payload/src/config/types' const CustomVersionsView: EditViewComponent = ({ canAccessAdmin, diff --git a/test/live-preview/config.ts b/test/live-preview/config.ts index 64a48a75542..3203aae7a50 100644 --- a/test/live-preview/config.ts +++ b/test/live-preview/config.ts @@ -19,7 +19,7 @@ export default buildConfigWithDefaults({ slug: 'users', auth: true, admin: { - useAsTitle: 'email', + useAsTitle: 'title', }, fields: [], }, diff --git a/test/live-preview/payload-types.ts b/test/live-preview/payload-types.ts index f374be5f7fe..0b67db742bc 100644 --- a/test/live-preview/payload-types.ts +++ b/test/live-preview/payload-types.ts @@ -9,21 +9,11 @@ export interface Config { collections: { users: User - 'hidden-collection': HiddenCollection - posts: Post - 'group-one-collection-ones': GroupOneCollectionOne - 'group-one-collection-twos': GroupOneCollectionTwo - 'group-two-collection-ones': GroupTwoCollectionOne - 'group-two-collection-twos': GroupTwoCollectionTwo + pages: Page 'payload-preferences': PayloadPreference 'payload-migrations': PayloadMigration } - globals: { - 'hidden-global': HiddenGlobal - global: Global - 'group-globals-one': GroupGlobalsOne - 'group-globals-two': GroupGlobalsTwo - } + globals: {} } export interface User { id: string @@ -38,52 +28,19 @@ export interface User { lockUntil?: string password?: string } -export interface HiddenCollection { - id: string - title?: string - updatedAt: string - createdAt: string -} -export interface Post { - id: string - title?: string - description?: string - number?: number - richText?: { - [k: string]: unknown - }[] - updatedAt: string - createdAt: string -} -export interface GroupOneCollectionOne { - id: string - title?: string - updatedAt: string - createdAt: string -} -export interface GroupOneCollectionTwo { - id: string - title?: string - updatedAt: string - createdAt: string -} -export interface GroupTwoCollectionOne { - id: string - title?: string - updatedAt: string - createdAt: string -} -export interface GroupTwoCollectionTwo { +export interface Page { id: string - title?: string + title: string + description: string + slug: string updatedAt: string createdAt: string } export interface PayloadPreference { id: string user: { - value: string | User relationTo: 'users' + value: string | User } key?: string value?: @@ -114,27 +71,14 @@ export interface PayloadMigration { updatedAt: string createdAt: string } -export interface HiddenGlobal { - id: string - title?: string - updatedAt?: string - createdAt?: string -} -export interface Global { - id: string - title?: string - updatedAt?: string - createdAt?: string -} -export interface GroupGlobalsOne { - id: string - title?: string - updatedAt?: string - createdAt?: string -} -export interface GroupGlobalsTwo { - id: string - title?: string - updatedAt?: string - createdAt?: string + +declare module 'payload' { + export interface GeneratedTypes { + collections: { + users: User + pages: Page + 'payload-preferences': PayloadPreference + 'payload-migrations': PayloadMigration + } + } }
6e561b11ca046faa6ec4f435a9665399e62b12cf
2024-08-29 09:21:03
Elliot DeNolf
chore(graphql): adjust default exports (#7946)
false
adjust default exports (#7946)
chore
diff --git a/packages/graphql/src/index.ts b/packages/graphql/src/index.ts index 7cf4c64c129..eee7a0ee81f 100644 --- a/packages/graphql/src/index.ts +++ b/packages/graphql/src/index.ts @@ -8,12 +8,12 @@ import { fieldExtensionsEstimator, simpleEstimator, } from './packages/graphql-query-complexity/index.js' -import accessResolver from './resolvers/auth/access.js' -import buildFallbackLocaleInputType from './schema/buildFallbackLocaleInputType.js' -import buildLocaleInputType from './schema/buildLocaleInputType.js' -import buildPoliciesType from './schema/buildPoliciesType.js' -import initCollections from './schema/initCollections.js' -import initGlobals from './schema/initGlobals.js' +import { accessResolver } from './resolvers/auth/access.js' +import { buildFallbackLocaleInputType } from './schema/buildFallbackLocaleInputType.js' +import { buildLocaleInputType } from './schema/buildLocaleInputType.js' +import { buildPoliciesType } from './schema/buildPoliciesType.js' +import { initCollections } from './schema/initCollections.js' +import { initGlobals } from './schema/initGlobals.js' import { wrapCustomFields } from './utilities/wrapCustomResolver.js' export function configToSchema(config: SanitizedConfig): { diff --git a/packages/graphql/src/packages/graphql-query-complexity/QueryComplexity.ts b/packages/graphql/src/packages/graphql-query-complexity/QueryComplexity.ts index 4d96a0ebdd4..60cc47add3f 100644 --- a/packages/graphql/src/packages/graphql-query-complexity/QueryComplexity.ts +++ b/packages/graphql/src/packages/graphql-query-complexity/QueryComplexity.ts @@ -122,7 +122,7 @@ export function getComplexity(options: { return visitor.complexity } -export default class QueryComplexity { +export class QueryComplexity { OperationDefinition: Record<string, any> complexity: number context: ValidationContext diff --git a/packages/graphql/src/packages/graphql-query-complexity/createComplexityRule.ts b/packages/graphql/src/packages/graphql-query-complexity/createComplexityRule.ts index e21680ee345..80415938d41 100644 --- a/packages/graphql/src/packages/graphql-query-complexity/createComplexityRule.ts +++ b/packages/graphql/src/packages/graphql-query-complexity/createComplexityRule.ts @@ -2,7 +2,7 @@ import type { ValidationContext } from 'graphql' import type { QueryComplexityOptions } from './QueryComplexity.js' -import QueryComplexity from './QueryComplexity.js' +import { QueryComplexity } from './QueryComplexity.js' export function createComplexityRule( options: QueryComplexityOptions, diff --git a/packages/graphql/src/resolvers/auth/access.ts b/packages/graphql/src/resolvers/auth/access.ts index 0ec80f0ba85..0c036baf95d 100644 --- a/packages/graphql/src/resolvers/auth/access.ts +++ b/packages/graphql/src/resolvers/auth/access.ts @@ -4,7 +4,7 @@ import { accessOperation, isolateObjectProperty } from 'payload' import type { Context } from '../types.js' -import formatName from '../../utilities/formatName.js' +import { formatName } from '../../utilities/formatName.js' const formatConfigNames = (results, configs) => { const formattedResults = { ...results } @@ -17,7 +17,7 @@ const formatConfigNames = (results, configs) => { return formattedResults } -function accessResolver(config: SanitizedConfig) { +export function accessResolver(config: SanitizedConfig) { async function resolver(_, args, context: Context) { const options = { req: isolateObjectProperty<any>(context.req, 'transactionID'), @@ -34,5 +34,3 @@ function accessResolver(config: SanitizedConfig) { return resolver } - -export default accessResolver diff --git a/packages/graphql/src/resolvers/auth/forgotPassword.ts b/packages/graphql/src/resolvers/auth/forgotPassword.ts index ea1dc7a7b48..44d931fd711 100644 --- a/packages/graphql/src/resolvers/auth/forgotPassword.ts +++ b/packages/graphql/src/resolvers/auth/forgotPassword.ts @@ -4,7 +4,7 @@ import { forgotPasswordOperation, isolateObjectProperty } from 'payload' import type { Context } from '../types.js' -function forgotPasswordResolver(collection: Collection): any { +export function forgotPassword(collection: Collection): any { async function resolver(_, args, context: Context) { const options = { collection, @@ -23,5 +23,3 @@ function forgotPasswordResolver(collection: Collection): any { return resolver } - -export default forgotPasswordResolver diff --git a/packages/graphql/src/resolvers/auth/init.ts b/packages/graphql/src/resolvers/auth/init.ts index e9d72cd628d..33fa577c266 100644 --- a/packages/graphql/src/resolvers/auth/init.ts +++ b/packages/graphql/src/resolvers/auth/init.ts @@ -2,7 +2,7 @@ import { initOperation, isolateObjectProperty } from 'payload' import type { Context } from '../types.js' -function initResolver(collection: string) { +export function init(collection: string) { async function resolver(_, args, context: Context) { const options = { collection, @@ -14,5 +14,3 @@ function initResolver(collection: string) { return resolver } - -export default initResolver diff --git a/packages/graphql/src/resolvers/auth/login.ts b/packages/graphql/src/resolvers/auth/login.ts index 88e1d1b7595..241c204ebec 100644 --- a/packages/graphql/src/resolvers/auth/login.ts +++ b/packages/graphql/src/resolvers/auth/login.ts @@ -4,7 +4,7 @@ import { generatePayloadCookie, isolateObjectProperty, loginOperation } from 'pa import type { Context } from '../types.js' -function loginResolver(collection: Collection): any { +export function login(collection: Collection): any { async function resolver(_, args, context: Context) { const options = { collection, @@ -35,5 +35,3 @@ function loginResolver(collection: Collection): any { return resolver } - -export default loginResolver diff --git a/packages/graphql/src/resolvers/auth/logout.ts b/packages/graphql/src/resolvers/auth/logout.ts index 73d9f175b97..c81dbb79942 100644 --- a/packages/graphql/src/resolvers/auth/logout.ts +++ b/packages/graphql/src/resolvers/auth/logout.ts @@ -4,7 +4,7 @@ import { generateExpiredPayloadCookie, isolateObjectProperty, logoutOperation } import type { Context } from '../types.js' -function logoutResolver(collection: Collection): any { +export function logout(collection: Collection): any { async function resolver(_, args, context: Context) { const options = { collection, @@ -22,5 +22,3 @@ function logoutResolver(collection: Collection): any { return resolver } - -export default logoutResolver diff --git a/packages/graphql/src/resolvers/auth/me.ts b/packages/graphql/src/resolvers/auth/me.ts index 4d5ab000707..29e3701ff03 100644 --- a/packages/graphql/src/resolvers/auth/me.ts +++ b/packages/graphql/src/resolvers/auth/me.ts @@ -4,7 +4,7 @@ import { extractJWT, isolateObjectProperty, meOperation } from 'payload' import type { Context } from '../types.js' -function meResolver(collection: Collection): any { +export function me(collection: Collection): any { async function resolver(_, args, context: Context) { const currentToken = extractJWT(context.req) @@ -26,5 +26,3 @@ function meResolver(collection: Collection): any { return resolver } - -export default meResolver diff --git a/packages/graphql/src/resolvers/auth/refresh.ts b/packages/graphql/src/resolvers/auth/refresh.ts index e2af3916ae5..ef25253e551 100644 --- a/packages/graphql/src/resolvers/auth/refresh.ts +++ b/packages/graphql/src/resolvers/auth/refresh.ts @@ -4,7 +4,7 @@ import { generatePayloadCookie, isolateObjectProperty, refreshOperation } from ' import type { Context } from '../types.js' -function refreshResolver(collection: Collection): any { +export function refresh(collection: Collection): any { async function resolver(_, __, context: Context) { const options = { collection, @@ -29,5 +29,3 @@ function refreshResolver(collection: Collection): any { return resolver } - -export default refreshResolver diff --git a/packages/graphql/src/resolvers/auth/resetPassword.ts b/packages/graphql/src/resolvers/auth/resetPassword.ts index 27d7eda0ebd..43632df7e48 100644 --- a/packages/graphql/src/resolvers/auth/resetPassword.ts +++ b/packages/graphql/src/resolvers/auth/resetPassword.ts @@ -4,7 +4,7 @@ import { generatePayloadCookie, isolateObjectProperty, resetPasswordOperation } import type { Context } from '../types.js' -function resetPasswordResolver(collection: Collection): any { +export function resetPassword(collection: Collection): any { async function resolver(_, args, context: Context) { if (args.locale) context.req.locale = args.locale if (args.fallbackLocale) context.req.fallbackLocale = args.fallbackLocale @@ -34,5 +34,3 @@ function resetPasswordResolver(collection: Collection): any { return resolver } - -export default resetPasswordResolver diff --git a/packages/graphql/src/resolvers/auth/unlock.ts b/packages/graphql/src/resolvers/auth/unlock.ts index cfc86e21459..20e4653ce97 100644 --- a/packages/graphql/src/resolvers/auth/unlock.ts +++ b/packages/graphql/src/resolvers/auth/unlock.ts @@ -4,7 +4,7 @@ import { isolateObjectProperty, unlockOperation } from 'payload' import type { Context } from '../types.js' -function unlockResolver(collection: Collection) { +export function unlock(collection: Collection) { async function resolver(_, args, context: Context) { const options = { collection, @@ -18,5 +18,3 @@ function unlockResolver(collection: Collection) { return resolver } - -export default unlockResolver diff --git a/packages/graphql/src/resolvers/auth/verifyEmail.ts b/packages/graphql/src/resolvers/auth/verifyEmail.ts index c6d50b055f6..4cc46350ebe 100644 --- a/packages/graphql/src/resolvers/auth/verifyEmail.ts +++ b/packages/graphql/src/resolvers/auth/verifyEmail.ts @@ -4,7 +4,7 @@ import { isolateObjectProperty, verifyEmailOperation } from 'payload' import type { Context } from '../types.js' -function verifyEmailResolver(collection: Collection) { +export function verifyEmail(collection: Collection) { async function resolver(_, args, context: Context) { if (args.locale) context.req.locale = args.locale if (args.fallbackLocale) context.req.fallbackLocale = args.fallbackLocale @@ -22,5 +22,3 @@ function verifyEmailResolver(collection: Collection) { return resolver } - -export default verifyEmailResolver diff --git a/packages/graphql/src/resolvers/collections/create.ts b/packages/graphql/src/resolvers/collections/create.ts index 9bd99e5d951..17ad5180d61 100644 --- a/packages/graphql/src/resolvers/collections/create.ts +++ b/packages/graphql/src/resolvers/collections/create.ts @@ -22,7 +22,7 @@ export type Resolver<TSlug extends CollectionSlug> = ( }, ) => Promise<DataFromCollectionSlug<TSlug>> -export default function createResolver<TSlug extends CollectionSlug>( +export function createResolver<TSlug extends CollectionSlug>( collection: Collection, ): Resolver<TSlug> { return async function resolver(_, args, context: Context) { diff --git a/packages/graphql/src/resolvers/collections/duplicate.ts b/packages/graphql/src/resolvers/collections/duplicate.ts index 922772a384d..b80609b30dd 100644 --- a/packages/graphql/src/resolvers/collections/duplicate.ts +++ b/packages/graphql/src/resolvers/collections/duplicate.ts @@ -17,7 +17,7 @@ export type Resolver<TData> = ( }, ) => Promise<TData> -export default function duplicateResolver<TSlug extends CollectionSlug>( +export function duplicateResolver<TSlug extends CollectionSlug>( collection: Collection, ): Resolver<DataFromCollectionSlug<TSlug>> { return async function resolver(_, args, context: Context) { diff --git a/packages/graphql/src/resolvers/collections/restoreVersion.ts b/packages/graphql/src/resolvers/collections/restoreVersion.ts index 942e3e473f3..5fac4fae11a 100644 --- a/packages/graphql/src/resolvers/collections/restoreVersion.ts +++ b/packages/graphql/src/resolvers/collections/restoreVersion.ts @@ -15,7 +15,7 @@ export type Resolver = ( }, ) => Promise<Document> -export default function restoreVersionResolver(collection: Collection): Resolver { +export function restoreVersionResolver(collection: Collection): Resolver { async function resolver(_, args, context: Context) { const options = { id: args.id, diff --git a/packages/graphql/src/resolvers/globals/findOne.ts b/packages/graphql/src/resolvers/globals/findOne.ts index b8bd357fda9..a436afd73d2 100644 --- a/packages/graphql/src/resolvers/globals/findOne.ts +++ b/packages/graphql/src/resolvers/globals/findOne.ts @@ -4,7 +4,7 @@ import { findOneOperation, isolateObjectProperty } from 'payload' import type { Context } from '../types.js' -export default function findOneResolver(globalConfig: SanitizedGlobalConfig): Document { +export function findOne(globalConfig: SanitizedGlobalConfig): Document { return async function resolver(_, args, context: Context) { if (args.locale) context.req.locale = args.locale if (args.fallbackLocale) context.req.fallbackLocale = args.fallbackLocale diff --git a/packages/graphql/src/resolvers/globals/findVersionByID.ts b/packages/graphql/src/resolvers/globals/findVersionByID.ts index 32f642f428f..d93552825c9 100644 --- a/packages/graphql/src/resolvers/globals/findVersionByID.ts +++ b/packages/graphql/src/resolvers/globals/findVersionByID.ts @@ -17,7 +17,7 @@ export type Resolver = ( }, ) => Promise<Document> -export default function findVersionByIDResolver(globalConfig: SanitizedGlobalConfig): Resolver { +export function findVersionByID(globalConfig: SanitizedGlobalConfig): Resolver { return async function resolver(_, args, context: Context) { if (args.locale) context.req.locale = args.locale if (args.fallbackLocale) context.req.fallbackLocale = args.fallbackLocale diff --git a/packages/graphql/src/resolvers/globals/findVersions.ts b/packages/graphql/src/resolvers/globals/findVersions.ts index 1a2151df3a7..500fe16c7db 100644 --- a/packages/graphql/src/resolvers/globals/findVersions.ts +++ b/packages/graphql/src/resolvers/globals/findVersions.ts @@ -19,7 +19,7 @@ export type Resolver = ( }, ) => Promise<Document> -export default function findVersionsResolver(globalConfig: SanitizedGlobalConfig): Resolver { +export function findVersions(globalConfig: SanitizedGlobalConfig): Resolver { return async function resolver(_, args, context: Context) { const options = { depth: 0, diff --git a/packages/graphql/src/resolvers/globals/index.ts b/packages/graphql/src/resolvers/globals/index.ts index 06a1258c4e6..5618c59f027 100644 --- a/packages/graphql/src/resolvers/globals/index.ts +++ b/packages/graphql/src/resolvers/globals/index.ts @@ -1,7 +1,7 @@ -import findOne from './findOne.js' -import findVersionByID from './findVersionByID.js' -import findVersions from './findVersions.js' -import restoreVersion from './restoreVersion.js' -import update from './update.js' +import { findOne } from './findOne.js' +import { findVersionByID } from './findVersionByID.js' +import { findVersions } from './findVersions.js' +import { restoreVersion } from './restoreVersion.js' +import { update } from './update.js' export { findOne, findVersionByID, findVersions, restoreVersion, update } diff --git a/packages/graphql/src/resolvers/globals/restoreVersion.ts b/packages/graphql/src/resolvers/globals/restoreVersion.ts index c7c1b9216c3..3bc8f2a80f6 100644 --- a/packages/graphql/src/resolvers/globals/restoreVersion.ts +++ b/packages/graphql/src/resolvers/globals/restoreVersion.ts @@ -14,7 +14,7 @@ type Resolver = ( req: PayloadRequest }, ) => Promise<Document> -export default function restoreVersionResolver(globalConfig: SanitizedGlobalConfig): Resolver { +export function restoreVersion(globalConfig: SanitizedGlobalConfig): Resolver { return async function resolver(_, args, context: Context) { const options = { id: args.id, diff --git a/packages/graphql/src/resolvers/globals/update.ts b/packages/graphql/src/resolvers/globals/update.ts index 9edce3ff3f7..421da1b8347 100644 --- a/packages/graphql/src/resolvers/globals/update.ts +++ b/packages/graphql/src/resolvers/globals/update.ts @@ -18,7 +18,7 @@ type Resolver<TSlug extends GlobalSlug> = ( }, ) => Promise<DataFromGlobalSlug<TSlug>> -export default function updateResolver<TSlug extends GlobalSlug>( +export function update<TSlug extends GlobalSlug>( globalConfig: SanitizedGlobalConfig, ): Resolver<TSlug> { return async function resolver(_, args, context: Context) { diff --git a/packages/graphql/src/schema/buildFallbackLocaleInputType.ts b/packages/graphql/src/schema/buildFallbackLocaleInputType.ts index 5b5ee0e8da7..d7cf5834e7c 100644 --- a/packages/graphql/src/schema/buildFallbackLocaleInputType.ts +++ b/packages/graphql/src/schema/buildFallbackLocaleInputType.ts @@ -2,9 +2,9 @@ import type { SanitizedLocalizationConfig } from 'payload' import { GraphQLEnumType } from 'graphql' -import formatName from '../utilities/formatName.js' +import { formatName } from '../utilities/formatName.js' -const buildFallbackLocaleInputType = ( +export const buildFallbackLocaleInputType = ( localization: SanitizedLocalizationConfig, ): GraphQLEnumType => { return new GraphQLEnumType({ @@ -20,5 +20,3 @@ const buildFallbackLocaleInputType = ( ), }) } - -export default buildFallbackLocaleInputType diff --git a/packages/graphql/src/schema/buildLocaleInputType.ts b/packages/graphql/src/schema/buildLocaleInputType.ts index 73d414e04ba..d6c36e90269 100644 --- a/packages/graphql/src/schema/buildLocaleInputType.ts +++ b/packages/graphql/src/schema/buildLocaleInputType.ts @@ -3,9 +3,9 @@ import type { SanitizedLocalizationConfig } from 'payload' import { GraphQLEnumType } from 'graphql' -import formatName from '../utilities/formatName.js' +import { formatName } from '../utilities/formatName.js' -const buildLocaleInputType = ( +export const buildLocaleInputType = ( localization: SanitizedLocalizationConfig, ): GraphQLEnumType | GraphQLScalarType => { return new GraphQLEnumType({ @@ -21,5 +21,3 @@ const buildLocaleInputType = ( ), }) } - -export default buildLocaleInputType diff --git a/packages/graphql/src/schema/buildMutationInputType.ts b/packages/graphql/src/schema/buildMutationInputType.ts index 87b31e7a7c5..cdfb10405c3 100644 --- a/packages/graphql/src/schema/buildMutationInputType.ts +++ b/packages/graphql/src/schema/buildMutationInputType.ts @@ -40,10 +40,10 @@ import { flattenTopLevelFields, toWords } from 'payload' import { fieldAffectsData, optionIsObject, tabHasName } from 'payload/shared' import { GraphQLJSON } from '../packages/graphql-type-json/index.js' -import combineParentName from '../utilities/combineParentName.js' -import formatName from '../utilities/formatName.js' +import { combineParentName } from '../utilities/combineParentName.js' +import { formatName } from '../utilities/formatName.js' import { groupOrTabHasRequiredSubfield } from '../utilities/groupOrTabHasRequiredSubfield.js' -import withNullableType from './withNullableType.js' +import { withNullableType } from './withNullableType.js' const idFieldTypes = { number: GraphQLInt, diff --git a/packages/graphql/src/schema/buildObjectType.ts b/packages/graphql/src/schema/buildObjectType.ts index 9ed68e9202b..eef1ff61b3b 100644 --- a/packages/graphql/src/schema/buildObjectType.ts +++ b/packages/graphql/src/schema/buildObjectType.ts @@ -44,24 +44,11 @@ import { tabHasName } from 'payload/shared' import type { Context } from '../resolvers/types.js' import { GraphQLJSON } from '../packages/graphql-type-json/index.js' -import combineParentName from '../utilities/combineParentName.js' -import formatName from '../utilities/formatName.js' -import formatOptions from '../utilities/formatOptions.js' -import buildWhereInputType from './buildWhereInputType.js' -import isFieldNullable from './isFieldNullable.js' -import withNullableType from './withNullableType.js' - -type LocaleInputType = { - fallbackLocale: { - type: GraphQLType - } - locale: { - type: GraphQLType - } - where: { - type: GraphQLType - } -} +import { combineParentName } from '../utilities/combineParentName.js' +import { formatName } from '../utilities/formatName.js' +import { formatOptions } from '../utilities/formatOptions.js' +import { isFieldNullable } from './isFieldNullable.js' +import { withNullableType } from './withNullableType.js' export type ObjectTypeConfig = { [path: string]: GraphQLFieldConfig<any, any> @@ -297,7 +284,7 @@ export function buildObjectType({ value: { type: new GraphQLUnionType({ name: relationshipName, - resolveType(data, { req }) { + resolveType(data) { return graphqlResult.collections[data.collection].graphQL.type.name }, types, @@ -626,7 +613,7 @@ export function buildObjectType({ value: { type: new GraphQLUnionType({ name: relationshipName, - resolveType(data, { req }) { + resolveType(data) { return graphqlResult.collections[data.collection].graphQL.type.name }, types, diff --git a/packages/graphql/src/schema/buildPoliciesType.ts b/packages/graphql/src/schema/buildPoliciesType.ts index 921045ccec9..086ba18186a 100644 --- a/packages/graphql/src/schema/buildPoliciesType.ts +++ b/packages/graphql/src/schema/buildPoliciesType.ts @@ -11,7 +11,7 @@ import { GraphQLBoolean, GraphQLNonNull, GraphQLObjectType } from 'graphql' import { toWords } from 'payload' import { GraphQLJSONObject } from '../packages/graphql-type-json/index.js' -import formatName from '../utilities/formatName.js' +import { formatName } from '../utilities/formatName.js' type OperationType = 'create' | 'delete' | 'read' | 'readVersions' | 'unlock' | 'update' @@ -199,7 +199,7 @@ export function buildPolicyType(args: BuildPolicyType): GraphQLObjectType { }) } -export default function buildPoliciesType(config: SanitizedConfig): GraphQLObjectType { +export function buildPoliciesType(config: SanitizedConfig): GraphQLObjectType { const fields = { canAccessAdmin: { type: new GraphQLNonNull(GraphQLBoolean), diff --git a/packages/graphql/src/schema/buildWhereInputType.ts b/packages/graphql/src/schema/buildWhereInputType.ts index 36627f7f955..ee8fe47af4c 100644 --- a/packages/graphql/src/schema/buildWhereInputType.ts +++ b/packages/graphql/src/schema/buildWhereInputType.ts @@ -4,8 +4,8 @@ import { GraphQLInputObjectType, GraphQLList } from 'graphql' import { flattenTopLevelFields } from 'payload' import { fieldAffectsData, fieldHasSubFields, fieldIsPresentationalOnly } from 'payload/shared' -import formatName from '../utilities/formatName.js' -import fieldToSchemaMap from './fieldToWhereInputSchemaMap.js' +import { formatName } from '../utilities/formatName.js' +import { fieldToSchemaMap } from './fieldToWhereInputSchemaMap.js' import { withOperators } from './withOperators.js' type Args = { @@ -28,7 +28,7 @@ type Args = { * directly searchable. Instead, we need to build a chained pathname * using dot notation so MongoDB can properly search nested paths. */ -const buildWhereInputType = ({ name, fields, parentName }: Args): GraphQLInputObjectType => { +export const buildWhereInputType = ({ name, fields, parentName }: Args): GraphQLInputObjectType => { // This is the function that builds nested paths for all // field types with nested paths. @@ -109,5 +109,3 @@ const buildWhereInputType = ({ name, fields, parentName }: Args): GraphQLInputOb }, }) } - -export default buildWhereInputType diff --git a/packages/graphql/src/schema/fieldToWhereInputSchemaMap.ts b/packages/graphql/src/schema/fieldToWhereInputSchemaMap.ts index c0378c98085..8a8f19a80e8 100644 --- a/packages/graphql/src/schema/fieldToWhereInputSchemaMap.ts +++ b/packages/graphql/src/schema/fieldToWhereInputSchemaMap.ts @@ -23,9 +23,9 @@ import type { import { GraphQLEnumType, GraphQLInputObjectType } from 'graphql' import { GraphQLJSON } from '../packages/graphql-type-json/index.js' -import combineParentName from '../utilities/combineParentName.js' -import formatName from '../utilities/formatName.js' -import recursivelyBuildNestedPaths from './recursivelyBuildNestedPaths.js' +import { combineParentName } from '../utilities/combineParentName.js' +import { formatName } from '../utilities/formatName.js' +import { recursivelyBuildNestedPaths } from './recursivelyBuildNestedPaths.js' import { withOperators } from './withOperators.js' type Args = { @@ -33,7 +33,7 @@ type Args = { parentName: string } -const fieldToSchemaMap = ({ nestedFieldName, parentName }: Args): any => ({ +export const fieldToSchemaMap = ({ nestedFieldName, parentName }: Args): any => ({ array: (field: ArrayField) => recursivelyBuildNestedPaths({ field, @@ -161,5 +161,3 @@ const fieldToSchemaMap = ({ nestedFieldName, parentName }: Args): any => ({ } }, }) - -export default fieldToSchemaMap diff --git a/packages/graphql/src/schema/initCollections.ts b/packages/graphql/src/schema/initCollections.ts index 5b81f9838bf..7a97a9db08b 100644 --- a/packages/graphql/src/schema/initCollections.ts +++ b/packages/graphql/src/schema/initCollections.ts @@ -18,38 +18,38 @@ import { fieldAffectsData } from 'payload/shared' import type { ObjectTypeConfig } from './buildObjectType.js' -import forgotPassword from '../resolvers/auth/forgotPassword.js' -import init from '../resolvers/auth/init.js' -import login from '../resolvers/auth/login.js' -import logout from '../resolvers/auth/logout.js' -import me from '../resolvers/auth/me.js' -import refresh from '../resolvers/auth/refresh.js' -import resetPassword from '../resolvers/auth/resetPassword.js' -import unlock from '../resolvers/auth/unlock.js' -import verifyEmail from '../resolvers/auth/verifyEmail.js' +import { forgotPassword } from '../resolvers/auth/forgotPassword.js' +import { init } from '../resolvers/auth/init.js' +import { login } from '../resolvers/auth/login.js' +import { logout } from '../resolvers/auth/logout.js' +import { me } from '../resolvers/auth/me.js' +import { refresh } from '../resolvers/auth/refresh.js' +import { resetPassword } from '../resolvers/auth/resetPassword.js' +import { unlock } from '../resolvers/auth/unlock.js' +import { verifyEmail } from '../resolvers/auth/verifyEmail.js' import { countResolver } from '../resolvers/collections/count.js' -import createResolver from '../resolvers/collections/create.js' +import { createResolver } from '../resolvers/collections/create.js' import { getDeleteResolver } from '../resolvers/collections/delete.js' import { docAccessResolver } from '../resolvers/collections/docAccess.js' -import duplicateResolver from '../resolvers/collections/duplicate.js' +import { duplicateResolver } from '../resolvers/collections/duplicate.js' import { findResolver } from '../resolvers/collections/find.js' import { findByIDResolver } from '../resolvers/collections/findByID.js' import { findVersionByIDResolver } from '../resolvers/collections/findVersionByID.js' import { findVersionsResolver } from '../resolvers/collections/findVersions.js' -import restoreVersionResolver from '../resolvers/collections/restoreVersion.js' +import { restoreVersionResolver } from '../resolvers/collections/restoreVersion.js' import { updateResolver } from '../resolvers/collections/update.js' -import formatName from '../utilities/formatName.js' +import { formatName } from '../utilities/formatName.js' import { buildMutationInputType, getCollectionIDType } from './buildMutationInputType.js' import { buildObjectType } from './buildObjectType.js' import { buildPaginatedListType } from './buildPaginatedListType.js' import { buildPolicyType } from './buildPoliciesType.js' -import buildWhereInputType from './buildWhereInputType.js' +import { buildWhereInputType } from './buildWhereInputType.js' type InitCollectionsGraphQLArgs = { config: SanitizedConfig graphqlResult: GraphQLInfo } -function initCollectionsGraphQL({ config, graphqlResult }: InitCollectionsGraphQLArgs): void { +export function initCollections({ config, graphqlResult }: InitCollectionsGraphQLArgs): void { Object.keys(graphqlResult.collections).forEach((slug) => { const collection: Collection = graphqlResult.collections[slug] const { @@ -514,5 +514,3 @@ function initCollectionsGraphQL({ config, graphqlResult }: InitCollectionsGraphQ } }) } - -export default initCollectionsGraphQL diff --git a/packages/graphql/src/schema/initGlobals.ts b/packages/graphql/src/schema/initGlobals.ts index 6f3273fbed5..b70a6ee23d8 100644 --- a/packages/graphql/src/schema/initGlobals.ts +++ b/packages/graphql/src/schema/initGlobals.ts @@ -7,23 +7,23 @@ import type { Field, GraphQLInfo, SanitizedConfig, SanitizedGlobalConfig } from import { buildVersionGlobalFields, toWords } from 'payload' import { docAccessResolver } from '../resolvers/globals/docAccess.js' -import findOneResolver from '../resolvers/globals/findOne.js' -import findVersionByIDResolver from '../resolvers/globals/findVersionByID.js' -import findVersionsResolver from '../resolvers/globals/findVersions.js' -import restoreVersionResolver from '../resolvers/globals/restoreVersion.js' -import updateResolver from '../resolvers/globals/update.js' -import formatName from '../utilities/formatName.js' +import { findOne } from '../resolvers/globals/findOne.js' +import { findVersionByID } from '../resolvers/globals/findVersionByID.js' +import { findVersions } from '../resolvers/globals/findVersions.js' +import { restoreVersion } from '../resolvers/globals/restoreVersion.js' +import { update } from '../resolvers/globals/update.js' +import { formatName } from '../utilities/formatName.js' import { buildMutationInputType } from './buildMutationInputType.js' import { buildObjectType } from './buildObjectType.js' import { buildPaginatedListType } from './buildPaginatedListType.js' import { buildPolicyType } from './buildPoliciesType.js' -import buildWhereInputType from './buildWhereInputType.js' +import { buildWhereInputType } from './buildWhereInputType.js' type InitGlobalsGraphQLArgs = { config: SanitizedConfig graphqlResult: GraphQLInfo } -function initGlobalsGraphQL({ config, graphqlResult }: InitGlobalsGraphQLArgs): void { +export function initGlobals({ config, graphqlResult }: InitGlobalsGraphQLArgs): void { Object.keys(graphqlResult.globals.config).forEach((slug) => { const global: SanitizedGlobalConfig = graphqlResult.globals.config[slug] const { fields, graphQL, versions } = global @@ -70,7 +70,7 @@ function initGlobalsGraphQL({ config, graphqlResult }: InitGlobalsGraphQLArgs): } : {}), }, - resolve: findOneResolver(global), + resolve: findOne(global), } graphqlResult.Mutation.fields[`update${formattedName}`] = { @@ -86,7 +86,7 @@ function initGlobalsGraphQL({ config, graphqlResult }: InitGlobalsGraphQLArgs): } : {}), }, - resolve: updateResolver(global), + resolve: update(global), } graphqlResult.Query.fields[`docAccess${formattedName}`] = { @@ -141,7 +141,7 @@ function initGlobalsGraphQL({ config, graphqlResult }: InitGlobalsGraphQLArgs): } : {}), }, - resolve: findVersionByIDResolver(global), + resolve: findVersionByID(global), } graphqlResult.Query.fields[`versions${formattedName}`] = { type: buildPaginatedListType( @@ -166,7 +166,7 @@ function initGlobalsGraphQL({ config, graphqlResult }: InitGlobalsGraphQLArgs): page: { type: GraphQLInt }, sort: { type: GraphQLString }, }, - resolve: findVersionsResolver(global), + resolve: findVersions(global), } graphqlResult.Mutation.fields[`restoreVersion${formatName(formattedName)}`] = { type: graphqlResult.globals.graphQL[slug].type, @@ -174,10 +174,8 @@ function initGlobalsGraphQL({ config, graphqlResult }: InitGlobalsGraphQLArgs): id: { type: idType }, draft: { type: GraphQLBoolean }, }, - resolve: restoreVersionResolver(global), + resolve: restoreVersion(global), } } }) } - -export default initGlobalsGraphQL diff --git a/packages/graphql/src/schema/isFieldNullable.ts b/packages/graphql/src/schema/isFieldNullable.ts index f85d64e7b6c..dd2ba85c69e 100644 --- a/packages/graphql/src/schema/isFieldNullable.ts +++ b/packages/graphql/src/schema/isFieldNullable.ts @@ -2,7 +2,7 @@ import type { FieldAffectingData } from 'payload' import { fieldAffectsData } from 'payload/shared' -const isFieldNullable = (field: FieldAffectingData, force: boolean): boolean => { +export const isFieldNullable = (field: FieldAffectingData, force: boolean): boolean => { const hasReadAccessControl = field.access && field.access.read const condition = field.admin && field.admin.condition return !( @@ -15,5 +15,3 @@ const isFieldNullable = (field: FieldAffectingData, force: boolean): boolean => !hasReadAccessControl ) } - -export default isFieldNullable diff --git a/packages/graphql/src/schema/operators.ts b/packages/graphql/src/schema/operators.ts index 8cd66333939..2cfe733c8f5 100644 --- a/packages/graphql/src/schema/operators.ts +++ b/packages/graphql/src/schema/operators.ts @@ -1,4 +1,4 @@ -const operators = { +export const operators = { comparison: ['greater_than_equal', 'greater_than', 'less_than_equal', 'less_than'], contains: ['in', 'not_in', 'all'], equality: ['equals', 'not_equals'], @@ -6,5 +6,3 @@ const operators = { geojson: ['within', 'intersects'], partial: ['like', 'contains'], } - -export default operators diff --git a/packages/graphql/src/schema/recursivelyBuildNestedPaths.ts b/packages/graphql/src/schema/recursivelyBuildNestedPaths.ts index aa0d21076d7..199b4ee5609 100644 --- a/packages/graphql/src/schema/recursivelyBuildNestedPaths.ts +++ b/packages/graphql/src/schema/recursivelyBuildNestedPaths.ts @@ -2,7 +2,7 @@ import type { FieldWithSubFields, TabsField } from 'payload' import { fieldAffectsData, fieldIsPresentationalOnly } from 'payload/shared' -import fieldToSchemaMap from './fieldToWhereInputSchemaMap.js' +import { fieldToSchemaMap } from './fieldToWhereInputSchemaMap.js' type Args = { field: FieldWithSubFields | TabsField @@ -10,7 +10,7 @@ type Args = { parentName: string } -const recursivelyBuildNestedPaths = ({ field, nestedFieldName2, parentName }: Args) => { +export const recursivelyBuildNestedPaths = ({ field, nestedFieldName2, parentName }: Args) => { const fieldName = fieldAffectsData(field) ? field.name : undefined const nestedFieldName = fieldName || nestedFieldName2 @@ -78,5 +78,3 @@ const recursivelyBuildNestedPaths = ({ field, nestedFieldName2, parentName }: Ar return nestedPaths } - -export default recursivelyBuildNestedPaths diff --git a/packages/graphql/src/schema/withNullableType.ts b/packages/graphql/src/schema/withNullableType.ts index 84f4a21d8d8..5cec0a23351 100644 --- a/packages/graphql/src/schema/withNullableType.ts +++ b/packages/graphql/src/schema/withNullableType.ts @@ -3,7 +3,7 @@ import type { FieldAffectingData } from 'payload' import { GraphQLNonNull } from 'graphql' -const withNullableType = ( +export const withNullableType = ( field: FieldAffectingData, type: GraphQLType, forceNullable = false, @@ -26,5 +26,3 @@ const withNullableType = ( return type } - -export default withNullableType diff --git a/packages/graphql/src/schema/withOperators.ts b/packages/graphql/src/schema/withOperators.ts index 71f9ad60f37..44ff25513d4 100644 --- a/packages/graphql/src/schema/withOperators.ts +++ b/packages/graphql/src/schema/withOperators.ts @@ -14,9 +14,9 @@ import { DateTimeResolver, EmailAddressResolver } from 'graphql-scalars' import { optionIsObject } from 'payload/shared' import { GraphQLJSON } from '../packages/graphql-type-json/index.js' -import combineParentName from '../utilities/combineParentName.js' -import formatName from '../utilities/formatName.js' -import operators from './operators.js' +import { combineParentName } from '../utilities/combineParentName.js' +import { formatName } from '../utilities/formatName.js' +import { operators } from './operators.js' type staticTypes = | 'checkbox' diff --git a/packages/graphql/src/utilities/combineParentName.ts b/packages/graphql/src/utilities/combineParentName.ts index 18f8e68cb32..1a121aa37e4 100644 --- a/packages/graphql/src/utilities/combineParentName.ts +++ b/packages/graphql/src/utilities/combineParentName.ts @@ -1,6 +1,4 @@ -import formatName from './formatName.js' +import { formatName } from './formatName.js' -const combineParentName = (parent: string, name: string): string => +export const combineParentName = (parent: string, name: string): string => formatName(`${parent ? `${parent}_` : ''}${name}`) - -export default combineParentName diff --git a/packages/graphql/src/utilities/formatName.spec.ts b/packages/graphql/src/utilities/formatName.spec.ts index 8ebb4a332ed..a450456495c 100644 --- a/packages/graphql/src/utilities/formatName.spec.ts +++ b/packages/graphql/src/utilities/formatName.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/prefer-strict-equal */ -import formatName from './formatName' +import { formatName } from './formatName' describe('formatName', () => { it.each` diff --git a/packages/graphql/src/utilities/formatName.ts b/packages/graphql/src/utilities/formatName.ts index ebe1a20d455..5b9400c3137 100644 --- a/packages/graphql/src/utilities/formatName.ts +++ b/packages/graphql/src/utilities/formatName.ts @@ -1,6 +1,6 @@ const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] -const formatName = (string: string): string => { +export const formatName = (string: string): string => { let sanitizedString = String(string) const firstLetter = sanitizedString.substring(0, 1) @@ -25,5 +25,3 @@ const formatName = (string: string): string => { return formatted || '_' } - -export default formatName diff --git a/packages/graphql/src/utilities/formatOptions.ts b/packages/graphql/src/utilities/formatOptions.ts index 2b137289b5b..e6ee39921b6 100644 --- a/packages/graphql/src/utilities/formatOptions.ts +++ b/packages/graphql/src/utilities/formatOptions.ts @@ -1,8 +1,8 @@ import type { RadioField, SelectField } from 'payload' -import formatName from './formatName.js' +import { formatName } from './formatName.js' -const formatOptions = (field: RadioField | SelectField) => { +export const formatOptions = (field: RadioField | SelectField) => { return field.options.reduce((values, option) => { if (typeof option === 'object') { return { @@ -21,5 +21,3 @@ const formatOptions = (field: RadioField | SelectField) => { } }, {}) } - -export default formatOptions diff --git a/packages/graphql/src/utilities/getCheckIfLocaleObject.ts b/packages/graphql/src/utilities/getCheckIfLocaleObject.ts deleted file mode 100644 index 5c716b74fcb..00000000000 --- a/packages/graphql/src/utilities/getCheckIfLocaleObject.ts +++ /dev/null @@ -1,4 +0,0 @@ -export default (localization: { locales: string[] }) => - (value: unknown): boolean => - typeof value === 'object' && - Object.keys(value).some((key) => localization.locales.indexOf(key) > -1) diff --git a/packages/graphql/src/utilities/uppercase.ts b/packages/graphql/src/utilities/uppercase.ts deleted file mode 100644 index 484160f6499..00000000000 --- a/packages/graphql/src/utilities/uppercase.ts +++ /dev/null @@ -1,11 +0,0 @@ -function uppercase(str: string): string { - const array1 = str.split(' ') - const newarray1 = [] - - for (let x = 0; x < array1.length; x += 1) { - newarray1.push(array1[x].charAt(0).toUpperCase() + array1[x].slice(1)) - } - return newarray1.join(' ') -} - -export default uppercase
7ac2d0dcff0388cd20ea2cbf9e5e1387f458172d
2020-10-13 01:52:40
Elliot DeNolf
test: remove beforeRead hook, messes with tests
false
remove beforeRead hook, messes with tests
test
diff --git a/demo/collections/Media.js b/demo/collections/Media.js index 0a8c27d40fb..7bbb10b41e7 100644 --- a/demo/collections/Media.js +++ b/demo/collections/Media.js @@ -43,11 +43,6 @@ module.exports = { type: 'text', required: true, localized: true, - hooks: { - afterRead: [ - ({ value }) => `${value} alt`, - ], - }, }, { name: 'sizes', diff --git a/src/collections/requestHandlers/collections.spec.js b/src/collections/requestHandlers/collections.spec.js index c2c4fbaa425..37de9265867 100644 --- a/src/collections/requestHandlers/collections.spec.js +++ b/src/collections/requestHandlers/collections.spec.js @@ -618,20 +618,30 @@ describe('Collections - REST', () => { expect(await fileExists(path.join(mediaDir, 'image-640x480.png'))).toBe(true); // Check api response - expect(data.doc.alt).not.toBeNull(); - expect(data.doc.filename).toBe('image.png'); - expect(data.doc.mimeType).not.toBeNull(); - expect(data.doc.sizes.icon.filesize).not.toBeLessThan(1); - - expect(data.doc.sizes.icon.filename).toBe('image-16x16.png'); - expect(data.doc.sizes.icon.width).toBe(16); - expect(data.doc.sizes.icon.height).toBe(16); - expect(data.doc.sizes.mobile.filename).toBe('image-320x240.png'); - expect(data.doc.sizes.mobile.width).toBe(320); - expect(data.doc.sizes.mobile.height).toBe(240); - expect(data.doc.sizes.tablet.filename).toBe('image-640x480.png'); - expect(data.doc.sizes.tablet.width).toBe(640); - expect(data.doc.sizes.tablet.height).toBe(480); + expect(data).toMatchObject({ + doc: { + alt: 'test media', + filename: 'image.png', + mimeType: 'image/png', + sizes: { + icon: { + filename: 'image-16x16.png', + width: 16, + height: 16, + }, + mobile: { + filename: 'image-320x240.png', + width: 320, + height: 240, + }, + tablet: { + filename: 'image-640x480.png', + width: 640, + height: 480, + }, + }, + }, + }); }); it('update', async () => {
fd9cbd2cdbe971229ed050ad26a85f5bd5e30fbd
2022-11-17 00:35:19
Jacob Fletcher
chore: ignores package-lock
false
ignores package-lock
chore
diff --git a/packages/plugin-form-builder/.gitignore b/packages/plugin-form-builder/.gitignore index 8cadf16f882..479ccff27d4 100644 --- a/packages/plugin-form-builder/.gitignore +++ b/packages/plugin-form-builder/.gitignore @@ -3,3 +3,4 @@ node_modules dist build .DS_Store +package-lock.json
ee8f691073354c3747e988c96582642309e289a5
2023-08-03 02:47:52
James
chore: progress to init
false
progress to init
chore
diff --git a/packages/db-postgres/src/connect.ts b/packages/db-postgres/src/connect.ts index be4a241a5bf..71a1ad86463 100644 --- a/packages/db-postgres/src/connect.ts +++ b/packages/db-postgres/src/connect.ts @@ -1,15 +1,16 @@ /* eslint-disable @typescript-eslint/no-var-requires */ import type { Connect } from 'payload/dist/database/types'; -import { drizzle, NodePgDatabase } from 'drizzle-orm/node-postgres'; +import { drizzle } from 'drizzle-orm/node-postgres'; import { Client, Pool } from 'pg'; import type { PostgresAdapter } from '.'; +import { DrizzleDB } from './types'; export const connect: Connect = async function connect( this: PostgresAdapter, payload, ) { - let db: NodePgDatabase<Record<string, never>>; + let db: DrizzleDB; try { if ('pool' in this && this.pool !== false) { diff --git a/packages/db-postgres/src/index.ts b/packages/db-postgres/src/index.ts index 17ad9657bc6..c27d1dc68cc 100644 --- a/packages/db-postgres/src/index.ts +++ b/packages/db-postgres/src/index.ts @@ -1,11 +1,9 @@ -import type { ClientConfig, PoolConfig } from 'pg'; -import { NodePgDatabase } from 'drizzle-orm/node-postgres'; import type { Payload } from 'payload'; -import type { DatabaseAdapter } from 'payload/dist/database/types'; import { createDatabaseAdapter } from 'payload/dist/database/createAdapter'; import { connect } from './connect'; import { init } from './init'; import { webpack } from './webpack'; +import { Args, PostgresAdapter, PostgresAdapterResult } from './types'; // import { createGlobal } from './createGlobal'; // import { createVersion } from './createVersion'; // import { beginTransaction } from './transactions/beginTransaction'; @@ -26,34 +24,14 @@ import { webpack } from './webpack'; // import { deleteMany } from './deleteMany'; // import { destroy } from './destroy'; -type BaseArgs = { - migrationDir?: string; -} - -type ClientArgs = { - /** Client connection options for the Node package `pg` */ - client?: ClientConfig | string | false -} & BaseArgs - -type PoolArgs = { - /** Pool connection options for the Node package `pg` */ - pool?: PoolConfig | false -} & BaseArgs - -export type Args = ClientArgs | PoolArgs - -export type PostgresAdapter = DatabaseAdapter & Args & { - db: NodePgDatabase<Record<string, never>> -} - -type PostgresAdapterResult = (args: { payload: Payload }) => PostgresAdapter - export function postgresAdapter(args: Args): PostgresAdapterResult { function adapter({ payload }: { payload: Payload }) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error return createDatabaseAdapter<PostgresAdapter>({ ...args, + tables: {}, + relations: {}, payload, connect, db: undefined, diff --git a/packages/db-postgres/src/init.ts b/packages/db-postgres/src/init.ts index a9527ed7d6e..722493fcc60 100644 --- a/packages/db-postgres/src/init.ts +++ b/packages/db-postgres/src/init.ts @@ -3,14 +3,15 @@ import { buildVersionCollectionFields } from 'payload/dist/versions/buildCollect import { SanitizedCollectionConfig } from 'payload/dist/collections/config/types'; import { getVersionsModelName } from 'payload/dist/versions/getVersionsModelName'; import type { Init } from 'payload/dist/database/types'; -import type { PostgresAdapter } from '.'; +import type { PostgresAdapter } from './types'; +import { buildTable } from './schema/build'; export const init: Init = async function init( this: PostgresAdapter, ) { this.payload.config.collections.forEach( (collection: SanitizedCollectionConfig) => { - // create collection model + buildTable({ adapter: this, name: collection.slug, fields: collection.fields }); }, ); diff --git a/packages/db-postgres/src/schema/build.ts b/packages/db-postgres/src/schema/build.ts new file mode 100644 index 00000000000..0632a47297b --- /dev/null +++ b/packages/db-postgres/src/schema/build.ts @@ -0,0 +1,109 @@ +/* eslint-disable no-param-reassign */ +import { AnyPgColumnBuilder, integer, pgEnum, pgTable, serial, uniqueIndex, text, varchar, PgColumn, PgTableExtraConfig, index, numeric, PgColumnHKT, IndexBuilder } from 'drizzle-orm/pg-core'; +import { Field } from 'payload/types'; +import { Relation, relations } from 'drizzle-orm'; +import { fieldAffectsData } from 'payload/dist/fields/config/types'; +import { GenericColumns, GenericTable, PostgresAdapter } from '../types'; +import { formatName } from '../utilities/formatName'; +import { mapFields } from './mapFields'; + +type Args = { + adapter: PostgresAdapter + tableName: string + fields: Field[] +} + +export const buildTable = ({ + adapter, + tableName, + fields, +}: Args): void => { + const formattedTableName = formatName(tableName); + const columns: Record<string, AnyPgColumnBuilder> = {}; + const indexes: Record<string, (cols: GenericColumns) => IndexBuilder> = {}; + + let hasLocalizedField = false; + const localesColumns: Record<string, AnyPgColumnBuilder> = {}; + const localesIndexes: Record<string, (cols: GenericColumns) => IndexBuilder> = {}; + let localesTable: GenericTable; + + const relationships: Set<string> = new Set(); + let relationshipsTable: GenericTable; + + const idField = fields.find((field) => fieldAffectsData(field) && field.name === 'id'); + + if (idField) { + columns.id = idField.type === 'number' ? integer('id').primaryKey() : text('id').primaryKey(); + } else { + columns.id = serial('id').primaryKey(); + } + + ({ hasLocalizedField } = mapFields({ + adapter, + columns, + fields, + indexes, + localesColumns, + localesIndexes, + tableName, + relationships, + })); + + const table = pgTable(formattedTableName, columns, (cols) => { + return Object.entries(indexes).reduce((acc, [colName, func]) => { + acc[colName] = func(cols); + return acc; + }, {}); + }); + + adapter.tables[formattedTableName] = table; + + if (hasLocalizedField) { + const localeTableName = `${formattedTableName}_locales`; + + localesTable = pgTable(localeTableName, localesColumns, (cols) => { + return Object.entries(localesIndexes).reduce((acc, [colName, func]) => { + acc[colName] = func(cols); + return acc; + }, {}); + }); + + adapter.tables[localeTableName] = localesTable; + } + + if (relationships.size) { + const relationshipColumns: Record<string, AnyPgColumnBuilder> = { + id: serial('id').primaryKey(), + parent: integer('parent_id').references(() => table.id).notNull(), + path: varchar('path').notNull(), + order: integer('order'), + }; + + relationships.forEach((relationTo) => { + const formattedRelationTo = formatName(relationTo); + relationshipColumns[`${relationTo}ID`] = integer(`${formattedRelationTo}_id`).references(() => adapter.tables[formattedRelationTo].id); + }); + + relationshipsTable = pgTable(`${formattedTableName}_relationships`, relationshipColumns); + + adapter.tables[`${formattedTableName}_relationships`] = relationshipsTable; + } + + const tableRelations = relations(table, ({ many }) => { + const result: Record<string, Relation<string>> = {}; + + if (hasLocalizedField) { + result._locales = many(localesTable); + } + + if (relationships.size) { + result._relationships = many(relationshipsTable, { + relationName: '_relationships', + }); + } + + return result; + }); + + adapter.relations[`${formattedTableName}`] = tableRelations; +}; diff --git a/packages/db-postgres/src/schema/createIndex.ts b/packages/db-postgres/src/schema/createIndex.ts new file mode 100644 index 00000000000..3dcc1c98ca5 --- /dev/null +++ b/packages/db-postgres/src/schema/createIndex.ts @@ -0,0 +1,16 @@ +/* eslint-disable no-param-reassign */ +import { uniqueIndex, index } from 'drizzle-orm/pg-core'; +import { GenericColumn } from '../types'; + +type CreateIndexArgs = { + name: string + formattedName: string + unique?: boolean +} + +export const createIndex = ({ name, formattedName, unique }: CreateIndexArgs) => { + return (table: { [x: string]: GenericColumn }) => { + if (unique) return uniqueIndex(`${formattedName}_idx`).on(table[name]); + return index(`${formattedName}_idx`).on(table[name]); + }; +}; diff --git a/packages/db-postgres/src/schema/mapFields.ts b/packages/db-postgres/src/schema/mapFields.ts new file mode 100644 index 00000000000..5769099e9aa --- /dev/null +++ b/packages/db-postgres/src/schema/mapFields.ts @@ -0,0 +1,91 @@ +/* eslint-disable no-param-reassign */ +import { AnyPgColumnBuilder, integer, pgEnum, pgTable, serial, uniqueIndex, text, varchar, PgColumn, PgTableExtraConfig, index, numeric, PgColumnHKT, IndexBuilder } from 'drizzle-orm/pg-core'; +import { Field } from 'payload/types'; +import { fieldAffectsData } from 'payload/dist/fields/config/types'; +import { GenericColumns, PostgresAdapter } from '../types'; +import { formatName } from '../utilities/formatName'; +import { createIndex } from './createIndex'; + +type Args = { + adapter: PostgresAdapter + columns: Record<string, AnyPgColumnBuilder> + fields: Field[] + indexes: Record<string, (cols: GenericColumns) => IndexBuilder> + localesColumns: Record<string, AnyPgColumnBuilder> + localesIndexes: Record<string, (cols: GenericColumns) => IndexBuilder> + tableName: string + relationships: Set<string> +} + +export const mapFields = ({ + adapter, + columns, + fields, + indexes, + localesColumns, + localesIndexes, + tableName, + relationships, +}: Args): { hasLocalizedField: boolean } => { + let hasLocalizedField = false; + + fields.forEach((field) => { + const formattedName = 'name' in field ? formatName(field.name) : ''; + let targetTable = columns; + let targetIndexes = indexes; + + if (fieldAffectsData(field)) { + // If field is localized, + // add the column to the locale table + if (field.localized) { + hasLocalizedField = true; + targetTable = localesColumns; + targetIndexes = localesIndexes; + } + + if (field.unique || field.index) { + targetIndexes[`${field.name}Idx`] = createIndex({ formattedName, name: field.name, unique: field.unique }); + } + } + + switch (field.type) { + case 'text': + case 'email': + case 'code': + case 'textarea': + targetTable[field.name] = varchar(formattedName); + break; + + case 'number': + targetTable[field.name] = numeric(formattedName); + break; + + case 'row': + ({ hasLocalizedField } = mapFields({ + adapter, + columns, + fields: field.fields, + indexes, + localesColumns, + localesIndexes, + tableName, + relationships, + })); + break; + + case 'relationship': + case 'upload': + if (Array.isArray(field.relationTo)) { + field.relationTo.forEach((relation) => relationships.add(relation)); + } else { + relationships.add(field.relationTo); + } + break; + + default: + break; + } + }); + + return { hasLocalizedField }; +}; diff --git a/packages/db-postgres/src/types.ts b/packages/db-postgres/src/types.ts new file mode 100644 index 00000000000..d0ddae9d570 --- /dev/null +++ b/packages/db-postgres/src/types.ts @@ -0,0 +1,49 @@ +import { Relation, Relations } from 'drizzle-orm'; +import { NodePgDatabase } from 'drizzle-orm/node-postgres'; +import { PgColumn, PgColumnHKT, PgTableWithColumns } from 'drizzle-orm/pg-core'; +import { Payload } from 'payload'; +import { DatabaseAdapter } from 'payload/dist/database/types'; +import { ClientConfig, PoolConfig } from 'pg'; + +export type DrizzleDB = NodePgDatabase<Record<string, never>> + +type BaseArgs = { + migrationDir?: string; +} + +type ClientArgs = { + /** Client connection options for the Node package `pg` */ + client?: ClientConfig | string | false +} & BaseArgs + +type PoolArgs = { + /** Pool connection options for the Node package `pg` */ + pool?: PoolConfig | false +} & BaseArgs + +export type Args = ClientArgs | PoolArgs + +export type GenericColumn = PgColumn<PgColumnHKT, { + tableName: string; + name: string; + data: unknown; + driverParam: unknown; + notNull: boolean; + hasDefault: boolean; +}> + +export type GenericColumns = { + [x: string]: GenericColumn +} + +export type GenericTable = PgTableWithColumns<{ + name: string, schema: undefined, columns: GenericColumns +}> + +export type PostgresAdapter = DatabaseAdapter & Args & { + db: DrizzleDB + tables: Record<string, GenericTable> + relations: Record<string, Relations<string, Record<string, Relation<string>>>> +} + +export type PostgresAdapterResult = (args: { payload: Payload }) => PostgresAdapter diff --git a/packages/db-postgres/src/utilities/formatName.ts b/packages/db-postgres/src/utilities/formatName.ts new file mode 100644 index 00000000000..76c481c960d --- /dev/null +++ b/packages/db-postgres/src/utilities/formatName.ts @@ -0,0 +1,17 @@ +export const formatName = (string: string): string => { + const formatted = string + // Convert accented characters + .normalize('NFKD') + .replace(/[\u0300-\u036f]/g, '') + + .replace(/\./g, '_') + .replace(/-|\//g, '_') + .replace(/\+/g, '_') + .replace(/,/g, '_') + .replace(/\(/g, '_') + .replace(/\)/g, '_') + .replace(/'/g, '_') + .replace(/ /g, ''); + + return formatted; +};
e1dcb9594c74536aa36bde03366bd0915a7a5d9e
2025-01-31 21:55:47
Sasha
fix(db-postgres): write operations on polymorphic joined collections throw error (#10854)
false
write operations on polymorphic joined collections throw error (#10854)
fix
diff --git a/packages/drizzle/src/upsertRow/index.ts b/packages/drizzle/src/upsertRow/index.ts index 8de8cc7d344..dfa0d6c3d59 100644 --- a/packages/drizzle/src/upsertRow/index.ts +++ b/packages/drizzle/src/upsertRow/index.ts @@ -20,7 +20,10 @@ export const upsertRow = async <T extends Record<string, unknown> | TypeWithID>( db, fields, ignoreResult, - joinQuery, + // TODO: + // When we support joins for write operations (create/update) - pass collectionSlug to the buildFindManyArgs + // Make a new argument in upsertRow.ts and pass the slug from every operation. + joinQuery: _joinQuery, operation, path = '', req, @@ -414,13 +417,11 @@ export const upsertRow = async <T extends Record<string, unknown> | TypeWithID>( // RETRIEVE NEWLY UPDATED ROW // ////////////////////////////////// - joinQuery = operation === 'create' ? false : joinQuery - const findManyArgs = buildFindManyArgs({ adapter, depth: 0, fields, - joinQuery, + joinQuery: false, select, tableName, }) @@ -438,7 +439,7 @@ export const upsertRow = async <T extends Record<string, unknown> | TypeWithID>( config: adapter.payload.config, data: doc, fields, - joinQuery, + joinQuery: false, }) return result diff --git a/test/relationships/config.ts b/test/relationships/config.ts index 71573c538be..5b90d7115eb 100644 --- a/test/relationships/config.ts +++ b/test/relationships/config.ts @@ -428,6 +428,32 @@ export default buildConfigWithDefaults({ }, ], }, + { + slug: 'relations', + fields: [ + { + name: 'item', + type: 'relationship', + relationTo: ['items'], + }, + ], + }, + { + slug: 'items', + fields: [ + { + type: 'select', + options: ['completed', 'failed', 'pending'], + name: 'status', + }, + { + type: 'join', + on: 'item', + collection: 'relations', + name: 'relation', + }, + ], + }, ], onInit: async (payload) => { await payload.create({ diff --git a/test/relationships/int.spec.ts b/test/relationships/int.spec.ts index 73dabb9b00c..9fbb1740e64 100644 --- a/test/relationships/int.spec.ts +++ b/test/relationships/int.spec.ts @@ -1577,6 +1577,23 @@ describe('Relationships', () => { expect(res.docs).toHaveLength(1) expect(res.docs[0].id).toBe(id) }) + + it('should update document that polymorphicaly joined to another collection', async () => { + const item = await payload.create({ collection: 'items', data: { status: 'pending' } }) + + await payload.create({ + collection: 'relations', + data: { item: { relationTo: 'items', value: item } }, + }) + + const updated = await payload.update({ + collection: 'items', + data: { status: 'completed' }, + id: item.id, + }) + + expect(updated.status).toBe('completed') + }) }) }) diff --git a/test/relationships/payload-types.ts b/test/relationships/payload-types.ts index e5d08b420e1..d8e34ae002e 100644 --- a/test/relationships/payload-types.ts +++ b/test/relationships/payload-types.ts @@ -29,12 +29,18 @@ export interface Config { 'rels-to-pages-and-custom-text-ids': RelsToPagesAndCustomTextId; 'object-writes': ObjectWrite; 'deep-nested': DeepNested; + relations: Relation1; + items: Item; users: User; 'payload-locked-documents': PayloadLockedDocument; 'payload-preferences': PayloadPreference; 'payload-migrations': PayloadMigration; }; - collectionsJoins: {}; + collectionsJoins: { + items: { + relation: 'relations'; + }; + }; collectionsSelect: { posts: PostsSelect<false> | PostsSelect<true>; postsLocalized: PostsLocalizedSelect<false> | PostsLocalizedSelect<true>; @@ -54,6 +60,8 @@ export interface Config { 'rels-to-pages-and-custom-text-ids': RelsToPagesAndCustomTextIdsSelect<false> | RelsToPagesAndCustomTextIdsSelect<true>; 'object-writes': ObjectWritesSelect<false> | ObjectWritesSelect<true>; 'deep-nested': DeepNestedSelect<false> | DeepNestedSelect<true>; + relations: RelationsSelect<false> | RelationsSelect<true>; + items: ItemsSelect<false> | ItemsSelect<true>; users: UsersSelect<false> | UsersSelect<true>; 'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>; 'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>; @@ -373,6 +381,33 @@ export interface DeepNested { updatedAt: string; createdAt: string; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "relations". + */ +export interface Relation1 { + id: string; + item?: { + relationTo: 'items'; + value: string | Item; + } | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "items". + */ +export interface Item { + id: string; + status?: ('completed' | 'failed' | 'pending') | null; + relation?: { + docs?: (string | Relation1)[] | null; + hasNextPage?: boolean | null; + } | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-locked-documents". @@ -452,6 +487,14 @@ export interface PayloadLockedDocument { relationTo: 'deep-nested'; value: string | DeepNested; } | null) + | ({ + relationTo: 'relations'; + value: string | Relation1; + } | null) + | ({ + relationTo: 'items'; + value: string | Item; + } | null) | ({ relationTo: 'users'; value: string | User; @@ -721,6 +764,25 @@ export interface DeepNestedSelect<T extends boolean = true> { updatedAt?: T; createdAt?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "relations_select". + */ +export interface RelationsSelect<T extends boolean = true> { + item?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "items_select". + */ +export interface ItemsSelect<T extends boolean = true> { + status?: T; + relation?: T; + updatedAt?: T; + createdAt?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "users_select".
0e9bbecbeecca181c96cb2656ac7d5b4639c5882
2024-05-15 03:03:28
Elliot DeNolf
chore(release): v3.0.0-beta.32 [skip ci]
false
v3.0.0-beta.32 [skip ci]
chore
diff --git a/package.json b/package.json index 77829331aef..d06a32d5b50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "payload-monorepo", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "private": true, "type": "module", "scripts": { diff --git a/packages/create-payload-app/package.json b/packages/create-payload-app/package.json index c3cea2cdc86..a685beb4bfb 100644 --- a/packages/create-payload-app/package.json +++ b/packages/create-payload-app/package.json @@ -1,6 +1,6 @@ { "name": "create-payload-app", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "homepage": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/db-mongodb/package.json b/packages/db-mongodb/package.json index 83ecec1e9d2..cd1fcae5216 100644 --- a/packages/db-mongodb/package.json +++ b/packages/db-mongodb/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/db-mongodb", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The officially supported MongoDB database adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/db-postgres/package.json b/packages/db-postgres/package.json index 562157496be..51ce63fda71 100644 --- a/packages/db-postgres/package.json +++ b/packages/db-postgres/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/db-postgres", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The officially supported Postgres database adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/email-nodemailer/package.json b/packages/email-nodemailer/package.json index 4000712afc4..fe602dc923e 100644 --- a/packages/email-nodemailer/package.json +++ b/packages/email-nodemailer/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/email-nodemailer", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Payload Nodemailer Email Adapter", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/email-resend/package.json b/packages/email-resend/package.json index ed54ad86e88..299f69b37fb 100644 --- a/packages/email-resend/package.json +++ b/packages/email-resend/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/email-resend", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Payload Resend Email Adapter", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/graphql/package.json b/packages/graphql/package.json index c2ec1175cd0..a349a46b9c7 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/graphql", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "homepage": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/live-preview-react/package.json b/packages/live-preview-react/package.json index 04e2eb95263..405577fc3ab 100644 --- a/packages/live-preview-react/package.json +++ b/packages/live-preview-react/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/live-preview-react", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The official live preview React SDK for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/live-preview/package.json b/packages/live-preview/package.json index 84a7ac49ccc..c601417083e 100644 --- a/packages/live-preview/package.json +++ b/packages/live-preview/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/live-preview", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The official live preview JavaScript SDK for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/next/package.json b/packages/next/package.json index 0924a1f0c25..b499841fc01 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/next", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "homepage": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/payload/package.json b/packages/payload/package.json index 3617f9e1971..72230f59518 100644 --- a/packages/payload/package.json +++ b/packages/payload/package.json @@ -1,6 +1,6 @@ { "name": "payload", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Node, React, Headless CMS and Application Framework built on Next.js", "keywords": [ "admin panel", diff --git a/packages/plugin-cloud-storage/package.json b/packages/plugin-cloud-storage/package.json index e7dcccd7ef3..98349838c88 100644 --- a/packages/plugin-cloud-storage/package.json +++ b/packages/plugin-cloud-storage/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-cloud-storage", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The official cloud storage plugin for Payload CMS", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/plugin-cloud/package.json b/packages/plugin-cloud/package.json index 5c192546590..c0eb5a74838 100644 --- a/packages/plugin-cloud/package.json +++ b/packages/plugin-cloud/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-cloud", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The official Payload Cloud plugin", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/plugin-form-builder/package.json b/packages/plugin-form-builder/package.json index d5f062aa82a..fb15e3ab2d8 100644 --- a/packages/plugin-form-builder/package.json +++ b/packages/plugin-form-builder/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-form-builder", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Form builder plugin for Payload CMS", "keywords": [ "payload", diff --git a/packages/plugin-nested-docs/package.json b/packages/plugin-nested-docs/package.json index 7eb1b95f9c4..5b98361758d 100644 --- a/packages/plugin-nested-docs/package.json +++ b/packages/plugin-nested-docs/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-nested-docs", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The official Nested Docs plugin for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/plugin-redirects/package.json b/packages/plugin-redirects/package.json index 6a3207b2ddd..feb5a749afe 100644 --- a/packages/plugin-redirects/package.json +++ b/packages/plugin-redirects/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-redirects", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Redirects plugin for Payload", "keywords": [ "payload", diff --git a/packages/plugin-relationship-object-ids/package.json b/packages/plugin-relationship-object-ids/package.json index bf1bd987446..8f95ba2735b 100644 --- a/packages/plugin-relationship-object-ids/package.json +++ b/packages/plugin-relationship-object-ids/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-relationship-object-ids", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "A Payload plugin to store all relationship IDs as ObjectIDs", "repository": { "type": "git", diff --git a/packages/plugin-search/package.json b/packages/plugin-search/package.json index 6c7efb8f81e..d9e1d4b908c 100644 --- a/packages/plugin-search/package.json +++ b/packages/plugin-search/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-search", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Search plugin for Payload", "keywords": [ "payload", diff --git a/packages/plugin-seo/package.json b/packages/plugin-seo/package.json index f232d50df59..778bd3d6ef2 100644 --- a/packages/plugin-seo/package.json +++ b/packages/plugin-seo/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-seo", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "SEO plugin for Payload", "keywords": [ "payload", diff --git a/packages/plugin-stripe/package.json b/packages/plugin-stripe/package.json index 148261589d9..967d0fcbab6 100644 --- a/packages/plugin-stripe/package.json +++ b/packages/plugin-stripe/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/plugin-stripe", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Stripe plugin for Payload", "keywords": [ "payload", diff --git a/packages/richtext-lexical/package.json b/packages/richtext-lexical/package.json index d0a14c65cce..3424b7c1fb6 100644 --- a/packages/richtext-lexical/package.json +++ b/packages/richtext-lexical/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/richtext-lexical", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The officially supported Lexical richtext adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/richtext-slate/package.json b/packages/richtext-slate/package.json index 1b968a26aa6..e27e56b3890 100644 --- a/packages/richtext-slate/package.json +++ b/packages/richtext-slate/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/richtext-slate", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "The officially supported Slate richtext adapter for Payload", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-azure/package.json b/packages/storage-azure/package.json index 77218999611..3a53e1bb285 100644 --- a/packages/storage-azure/package.json +++ b/packages/storage-azure/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-azure", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Payload storage adapter for Azure Blob Storage", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-gcs/package.json b/packages/storage-gcs/package.json index 475e396e9c5..ae08d5f6fd0 100644 --- a/packages/storage-gcs/package.json +++ b/packages/storage-gcs/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-gcs", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Payload storage adapter for Google Cloud Storage", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-s3/package.json b/packages/storage-s3/package.json index eb3db89c764..9300d927ebb 100644 --- a/packages/storage-s3/package.json +++ b/packages/storage-s3/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-s3", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Payload storage adapter for Amazon S3", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-uploadthing/package.json b/packages/storage-uploadthing/package.json index 5f4ac7eec91..a79cfb3ce99 100644 --- a/packages/storage-uploadthing/package.json +++ b/packages/storage-uploadthing/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-uploadthing", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Payload storage adapter for uploadthing", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/storage-vercel-blob/package.json b/packages/storage-vercel-blob/package.json index 731eb6622e6..18644840a16 100644 --- a/packages/storage-vercel-blob/package.json +++ b/packages/storage-vercel-blob/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/storage-vercel-blob", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "description": "Payload storage adapter for Vercel Blob Storage", "homepage": "https://payloadcms.com", "repository": { diff --git a/packages/translations/package.json b/packages/translations/package.json index 4f0cc9ef5e2..eded85b2d91 100644 --- a/packages/translations/package.json +++ b/packages/translations/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/translations", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "homepage": "https://payloadcms.com", "repository": { "type": "git", diff --git a/packages/ui/package.json b/packages/ui/package.json index 42e5f7ada3b..79b69077927 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@payloadcms/ui", - "version": "3.0.0-beta.31", + "version": "3.0.0-beta.32", "homepage": "https://payloadcms.com", "repository": { "type": "git",
d2571e10d6820955b7a53b815c787f2d64f0226e
2024-08-22 06:14:04
Paul
feat: upload hasmany (#7796)
false
upload hasmany (#7796)
feat
diff --git a/packages/db-mongodb/src/models/buildSchema.ts b/packages/db-mongodb/src/models/buildSchema.ts index f713f096a81..566c4ea36a9 100644 --- a/packages/db-mongodb/src/models/buildSchema.ts +++ b/packages/db-mongodb/src/models/buildSchema.ts @@ -595,14 +595,77 @@ const fieldToSchemaMap: Record<string, FieldSchemaGenerator> = { config: SanitizedConfig, buildSchemaOptions: BuildSchemaOptions, ): void => { - const baseSchema = { - ...formatBaseSchema(field, buildSchemaOptions), - type: mongoose.Schema.Types.Mixed, - ref: field.relationTo, + const hasManyRelations = Array.isArray(field.relationTo) + let schemaToReturn: { [key: string]: any } = {} + + if (field.localized && config.localization) { + schemaToReturn = { + type: config.localization.localeCodes.reduce((locales, locale) => { + let localeSchema: { [key: string]: any } = {} + + if (hasManyRelations) { + localeSchema = { + ...formatBaseSchema(field, buildSchemaOptions), + _id: false, + type: mongoose.Schema.Types.Mixed, + relationTo: { type: String, enum: field.relationTo }, + value: { + type: mongoose.Schema.Types.Mixed, + refPath: `${field.name}.${locale}.relationTo`, + }, + } + } else { + localeSchema = { + ...formatBaseSchema(field, buildSchemaOptions), + type: mongoose.Schema.Types.Mixed, + ref: field.relationTo, + } + } + + return { + ...locales, + [locale]: field.hasMany + ? { type: [localeSchema], default: formatDefaultValue(field) } + : localeSchema, + } + }, {}), + localized: true, + } + } else if (hasManyRelations) { + schemaToReturn = { + ...formatBaseSchema(field, buildSchemaOptions), + _id: false, + type: mongoose.Schema.Types.Mixed, + relationTo: { type: String, enum: field.relationTo }, + value: { + type: mongoose.Schema.Types.Mixed, + refPath: `${field.name}.relationTo`, + }, + } + + if (field.hasMany) { + schemaToReturn = { + type: [schemaToReturn], + default: formatDefaultValue(field), + } + } + } else { + schemaToReturn = { + ...formatBaseSchema(field, buildSchemaOptions), + type: mongoose.Schema.Types.Mixed, + ref: field.relationTo, + } + + if (field.hasMany) { + schemaToReturn = { + type: [schemaToReturn], + default: formatDefaultValue(field), + } + } } schema.add({ - [field.name]: localizeSchema(field, baseSchema, config.localization), + [field.name]: schemaToReturn, }) }, } diff --git a/packages/db-sqlite/src/schema/traverseFields.ts b/packages/db-sqlite/src/schema/traverseFields.ts index 5f6ff8841fe..3a1a72bba76 100644 --- a/packages/db-sqlite/src/schema/traverseFields.ts +++ b/packages/db-sqlite/src/schema/traverseFields.ts @@ -717,7 +717,7 @@ export const traverseFields = ({ case 'upload': if (Array.isArray(field.relationTo)) { field.relationTo.forEach((relation) => relationships.add(relation)) - } else if (field.type === 'relationship' && field.hasMany) { + } else if (field.hasMany) { relationships.add(field.relationTo) } else { // simple relationships get a column on the targetTable with a foreign key to the relationTo table diff --git a/packages/drizzle/src/find/traverseFields.ts b/packages/drizzle/src/find/traverseFields.ts index c8d1534022b..94f3c1d13bd 100644 --- a/packages/drizzle/src/find/traverseFields.ts +++ b/packages/drizzle/src/find/traverseFields.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-param-reassign */ import type { Field } from 'payload' import { fieldAffectsData, tabHasName } from 'payload/shared' @@ -34,8 +33,9 @@ export const traverseFields = ({ // handle simple relationship if ( depth > 0 && - (field.type === 'upload' || - (field.type === 'relationship' && !field.hasMany && typeof field.relationTo === 'string')) + (field.type === 'upload' || field.type === 'relationship') && + !field.hasMany && + typeof field.relationTo === 'string' ) { if (field.localized) { _locales.with[`${path}${field.name}`] = true diff --git a/packages/drizzle/src/postgres/schema/traverseFields.ts b/packages/drizzle/src/postgres/schema/traverseFields.ts index 9efa42c5468..2b0e325d519 100644 --- a/packages/drizzle/src/postgres/schema/traverseFields.ts +++ b/packages/drizzle/src/postgres/schema/traverseFields.ts @@ -726,7 +726,7 @@ export const traverseFields = ({ case 'upload': if (Array.isArray(field.relationTo)) { field.relationTo.forEach((relation) => relationships.add(relation)) - } else if (field.type === 'relationship' && field.hasMany) { + } else if (field.hasMany) { relationships.add(field.relationTo) } else { // simple relationships get a column on the targetTable with a foreign key to the relationTo table diff --git a/packages/drizzle/src/queries/getTableColumnFromPath.ts b/packages/drizzle/src/queries/getTableColumnFromPath.ts index 822173d7e93..f311ad1d816 100644 --- a/packages/drizzle/src/queries/getTableColumnFromPath.ts +++ b/packages/drizzle/src/queries/getTableColumnFromPath.ts @@ -445,7 +445,7 @@ export const getTableColumnFromPath = ({ case 'relationship': case 'upload': { const newCollectionPath = pathSegments.slice(1).join('.') - if (Array.isArray(field.relationTo) || (field.type === 'relationship' && field.hasMany)) { + if (Array.isArray(field.relationTo) || field.hasMany) { let relationshipFields const relationTableName = `${rootTableName}${adapter.relationshipsSuffix}` const { diff --git a/packages/graphql/src/schema/buildMutationInputType.ts b/packages/graphql/src/schema/buildMutationInputType.ts index 1260b6883c6..87b31e7a7c5 100644 --- a/packages/graphql/src/schema/buildMutationInputType.ts +++ b/packages/graphql/src/schema/buildMutationInputType.ts @@ -307,10 +307,51 @@ export function buildMutationInputType({ ...inputObjectTypeConfig, [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) }, }), - upload: (inputObjectTypeConfig: InputObjectTypeConfig, field: UploadField) => ({ - ...inputObjectTypeConfig, - [field.name]: { type: withNullableType(field, GraphQLString, forceNullable) }, - }), + upload: (inputObjectTypeConfig: InputObjectTypeConfig, field: UploadField) => { + const { relationTo } = field + type PayloadGraphQLRelationshipType = + | GraphQLInputObjectType + | GraphQLList<GraphQLScalarType> + | GraphQLScalarType + let type: PayloadGraphQLRelationshipType + + if (Array.isArray(relationTo)) { + const fullName = `${combineParentName( + parentName, + toWords(field.name, true), + )}RelationshipInput` + type = new GraphQLInputObjectType({ + name: fullName, + fields: { + relationTo: { + type: new GraphQLEnumType({ + name: `${fullName}RelationTo`, + values: relationTo.reduce( + (values, option) => ({ + ...values, + [formatName(option)]: { + value: option, + }, + }), + {}, + ), + }), + }, + value: { type: GraphQLJSON }, + }, + }) + } else { + type = getCollectionIDType( + config.db.defaultIDType, + graphqlResult.collections[relationTo].config, + ) + } + + return { + ...inputObjectTypeConfig, + [field.name]: { type: field.hasMany ? new GraphQLList(type) : type }, + } + }, } const fieldName = formatName(name) diff --git a/packages/graphql/src/schema/buildObjectType.ts b/packages/graphql/src/schema/buildObjectType.ts index e17d87aab25..bc1d6cf9a4e 100644 --- a/packages/graphql/src/schema/buildObjectType.ts +++ b/packages/graphql/src/schema/buildObjectType.ts @@ -594,49 +594,164 @@ export function buildObjectType({ }), upload: (objectTypeConfig: ObjectTypeConfig, field: UploadField) => { const { relationTo } = field + const isRelatedToManyCollections = Array.isArray(relationTo) + const hasManyValues = field.hasMany + const relationshipName = combineParentName(parentName, toWords(field.name, true)) + + let type + let relationToType = null + + if (Array.isArray(relationTo)) { + relationToType = new GraphQLEnumType({ + name: `${relationshipName}_RelationTo`, + values: relationTo.reduce( + (relations, relation) => ({ + ...relations, + [formatName(relation)]: { + value: relation, + }, + }), + {}, + ), + }) + + const types = relationTo.map((relation) => graphqlResult.collections[relation].graphQL.type) - const uploadName = combineParentName(parentName, toWords(field.name, true)) + type = new GraphQLObjectType({ + name: `${relationshipName}_Relationship`, + fields: { + relationTo: { + type: relationToType, + }, + value: { + type: new GraphQLUnionType({ + name: relationshipName, + resolveType(data, { req }) { + return graphqlResult.collections[data.collection].graphQL.type.name + }, + types, + }), + }, + }, + }) + } else { + ;({ type } = graphqlResult.collections[relationTo].graphQL) + } // If the relationshipType is undefined at this point, // it can be assumed that this blockType can have a relationship // to itself. Therefore, we set the relationshipType equal to the blockType // that is currently being created. - const type = withNullableType( - field, - graphqlResult.collections[relationTo].graphQL.type || newlyCreatedBlockType, - forceNullable, + type = type || newlyCreatedBlockType + + const relationshipArgs: { + draft?: unknown + fallbackLocale?: unknown + limit?: unknown + locale?: unknown + page?: unknown + where?: unknown + } = {} + + const relationsUseDrafts = (Array.isArray(relationTo) ? relationTo : [relationTo]).some( + (relation) => graphqlResult.collections[relation].config.versions?.drafts, ) - const uploadArgs = {} as LocaleInputType + if (relationsUseDrafts) { + relationshipArgs.draft = { + type: GraphQLBoolean, + } + } if (config.localization) { - uploadArgs.locale = { + relationshipArgs.locale = { type: graphqlResult.types.localeInputType, } - uploadArgs.fallbackLocale = { + relationshipArgs.fallbackLocale = { type: graphqlResult.types.fallbackLocaleInputType, } } - const relatedCollectionSlug = field.relationTo - - const upload = { - type, - args: uploadArgs, - extensions: { complexity: 20 }, + const relationship = { + type: withNullableType( + field, + hasManyValues ? new GraphQLList(new GraphQLNonNull(type)) : type, + forceNullable, + ), + args: relationshipArgs, + extensions: { complexity: 10 }, async resolve(parent, args, context: Context) { const value = parent[field.name] const locale = args.locale || context.req.locale const fallbackLocale = args.fallbackLocale || context.req.fallbackLocale - const id = value + let relatedCollectionSlug = field.relationTo const draft = Boolean(args.draft ?? context.req.query?.draft) + if (hasManyValues) { + const results = [] + const resultPromises = [] + + const createPopulationPromise = async (relatedDoc, i) => { + let id = relatedDoc + let collectionSlug = field.relationTo + + if (isRelatedToManyCollections) { + collectionSlug = relatedDoc.relationTo + id = relatedDoc.value + } + + const result = await context.req.payloadDataLoader.load( + createDataloaderCacheKey({ + collectionSlug: collectionSlug as string, + currentDepth: 0, + depth: 0, + docID: id, + draft, + fallbackLocale, + locale, + overrideAccess: false, + showHiddenFields: false, + transactionID: context.req.transactionID, + }), + ) + + if (result) { + if (isRelatedToManyCollections) { + results[i] = { + relationTo: collectionSlug, + value: { + ...result, + collection: collectionSlug, + }, + } + } else { + results[i] = result + } + } + } + + if (value) { + value.forEach((relatedDoc, i) => { + resultPromises.push(createPopulationPromise(relatedDoc, i)) + }) + } + + await Promise.all(resultPromises) + return results + } + + let id = value + if (isRelatedToManyCollections && value) { + id = value.value + relatedCollectionSlug = value.relationTo + } + if (id) { const relatedDocument = await context.req.payloadDataLoader.load( createDataloaderCacheKey({ - collectionSlug: relatedCollectionSlug, + collectionSlug: relatedCollectionSlug as string, currentDepth: 0, depth: 0, docID: id, @@ -649,26 +764,30 @@ export function buildObjectType({ }), ) - return relatedDocument || null + if (relatedDocument) { + if (isRelatedToManyCollections) { + return { + relationTo: relatedCollectionSlug, + value: { + ...relatedDocument, + collection: relatedCollectionSlug, + }, + } + } + + return relatedDocument + } + + return null } return null }, } - const whereFields = graphqlResult.collections[relationTo].config.fields - - upload.args.where = { - type: buildWhereInputType({ - name: uploadName, - fields: whereFields, - parentName: uploadName, - }), - } - return { ...objectTypeConfig, - [field.name]: upload, + [field.name]: relationship, } }, } diff --git a/packages/graphql/src/schema/fieldToWhereInputSchemaMap.ts b/packages/graphql/src/schema/fieldToWhereInputSchemaMap.ts index 69b0f3da5d2..c0378c98085 100644 --- a/packages/graphql/src/schema/fieldToWhereInputSchemaMap.ts +++ b/packages/graphql/src/schema/fieldToWhereInputSchemaMap.ts @@ -130,9 +130,36 @@ const fieldToSchemaMap = ({ nestedFieldName, parentName }: Args): any => ({ textarea: (field: TextareaField) => ({ type: withOperators(field, parentName), }), - upload: (field: UploadField) => ({ - type: withOperators(field, parentName), - }), + upload: (field: UploadField) => { + if (Array.isArray(field.relationTo)) { + return { + type: new GraphQLInputObjectType({ + name: `${combineParentName(parentName, field.name)}_Relation`, + fields: { + relationTo: { + type: new GraphQLEnumType({ + name: `${combineParentName(parentName, field.name)}_Relation_RelationTo`, + values: field.relationTo.reduce( + (values, relation) => ({ + ...values, + [formatName(relation)]: { + value: relation, + }, + }), + {}, + ), + }), + }, + value: { type: GraphQLJSON }, + }, + }), + } + } + + return { + type: withOperators(field, parentName), + } + }, }) export default fieldToSchemaMap diff --git a/packages/graphql/src/schema/withOperators.ts b/packages/graphql/src/schema/withOperators.ts index f1e7b9dcdbd..71f9ad60f37 100644 --- a/packages/graphql/src/schema/withOperators.ts +++ b/packages/graphql/src/schema/withOperators.ts @@ -230,9 +230,9 @@ const defaults: DefaultsType = { }, upload: { operators: [ - ...operators.equality.map((operator) => ({ + ...[...operators.equality, ...operators.contains].map((operator) => ({ name: operator, - type: GraphQLString, + type: GraphQLJSON, })), ], }, diff --git a/packages/next/src/views/List/Default/index.tsx b/packages/next/src/views/List/Default/index.tsx index 1391ffd2493..51f62872591 100644 --- a/packages/next/src/views/List/Default/index.tsx +++ b/packages/next/src/views/List/Default/index.tsx @@ -46,7 +46,16 @@ const baseClass = 'collection-list' const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default export const DefaultListView: React.FC = () => { - const { Header, collectionSlug, hasCreatePermission, newDocumentURL } = useListInfo() + const { + Header, + beforeActions, + collectionSlug, + disableBulkDelete, + disableBulkEdit, + hasCreatePermission, + newDocumentURL, + } = useListInfo() + const { data, defaultLimit, handlePageChange, handlePerPageChange } = useListQuery() const { searchParams } = useSearchParams() const { openModal } = useModal() @@ -221,10 +230,15 @@ export const DefaultListView: React.FC = () => { <div className={`${baseClass}__list-selection`}> <ListSelection label={getTranslation(collectionConfig.labels.plural, i18n)} /> <div className={`${baseClass}__list-selection-actions`}> - <EditMany collection={collectionConfig} fields={fields} /> - <PublishMany collection={collectionConfig} /> - <UnpublishMany collection={collectionConfig} /> - <DeleteMany collection={collectionConfig} /> + {beforeActions && beforeActions} + {!disableBulkEdit && ( + <Fragment> + <EditMany collection={collectionConfig} fields={fields} /> + <PublishMany collection={collectionConfig} /> + <UnpublishMany collection={collectionConfig} /> + </Fragment> + )} + {!disableBulkDelete && <DeleteMany collection={collectionConfig} />} </div> </div> )} diff --git a/packages/payload/src/database/queryValidation/validateSearchParams.ts b/packages/payload/src/database/queryValidation/validateSearchParams.ts index f1884583442..5433e6685ae 100644 --- a/packages/payload/src/database/queryValidation/validateSearchParams.ts +++ b/packages/payload/src/database/queryValidation/validateSearchParams.ts @@ -105,7 +105,10 @@ export async function validateSearchParam({ fieldPath = path.slice(0, -(req.locale.length + 1)) } // remove ".value" from ends of polymorphic relationship paths - if (field.type === 'relationship' && Array.isArray(field.relationTo)) { + if ( + (field.type === 'relationship' || field.type === 'upload') && + Array.isArray(field.relationTo) + ) { fieldPath = fieldPath.replace('.value', '') } const entityType: 'collections' | 'globals' = globalConfig ? 'globals' : 'collections' diff --git a/packages/payload/src/fields/config/sanitize.ts b/packages/payload/src/fields/config/sanitize.ts index d4c213d40e7..dbbb41bea7f 100644 --- a/packages/payload/src/fields/config/sanitize.ts +++ b/packages/payload/src/fields/config/sanitize.ts @@ -99,19 +99,26 @@ export const sanitizeFields = async ({ }) } - if (field.type === 'relationship') { - if (field.min && !field.minRows) { - console.warn( - `(payload): The "min" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "minRows" instead.`, - ) - } - if (field.max && !field.maxRows) { - console.warn( - `(payload): The "max" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "maxRows" instead.`, - ) + if (field.min && !field.minRows) { + console.warn( + `(payload): The "min" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "minRows" instead.`, + ) + } + if (field.max && !field.maxRows) { + console.warn( + `(payload): The "max" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "maxRows" instead.`, + ) + } + field.minRows = field.minRows || field.min + field.maxRows = field.maxRows || field.max + } + + if (field.type === 'upload') { + if (!field.admin || !('isSortable' in field.admin)) { + field.admin = { + isSortable: true, + ...field.admin, } - field.minRows = field.minRows || field.min - field.maxRows = field.maxRows || field.max } } diff --git a/packages/payload/src/fields/config/types.ts b/packages/payload/src/fields/config/types.ts index fe80667b3e4..10a6386e32f 100644 --- a/packages/payload/src/fields/config/types.ts +++ b/packages/payload/src/fields/config/types.ts @@ -824,35 +824,106 @@ export type UIFieldClient = { } & Omit<DeepUndefinable<FieldBaseClient>, '_isPresentational' | 'admin'> & // still include FieldBaseClient (even if it's undefinable) so that we don't need constant type checks (e.g. if('xy' in field)) Pick<UIField, 'label' | 'name' | 'type'> -export type UploadField = { - admin?: { - components?: { - Error?: CustomComponent<UploadFieldErrorClientComponent | UploadFieldErrorServerComponent> - Label?: CustomComponent<UploadFieldLabelClientComponent | UploadFieldLabelServerComponent> - } & Admin['components'] - } +type SharedUploadProperties = { + /** + * Toggle the preview in the admin interface. + */ displayPreview?: boolean filterOptions?: FilterOptions + hasMany?: boolean /** * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached. * * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth} */ maxDepth?: number - relationTo: CollectionSlug type: 'upload' - validate?: Validate<unknown, unknown, unknown, UploadField> -} & FieldBase + validate?: Validate<unknown, unknown, unknown, SharedUploadProperties> +} & ( + | { + hasMany: true + /** + * @deprecated Use 'maxRows' instead + */ + max?: number + maxRows?: number + /** + * @deprecated Use 'minRows' instead + */ + min?: number + minRows?: number + } + | { + hasMany?: false | undefined + /** + * @deprecated Use 'maxRows' instead + */ + max?: undefined + maxRows?: undefined + /** + * @deprecated Use 'minRows' instead + */ + min?: undefined + minRows?: undefined + } +) & + FieldBase -export type UploadFieldClient = { +type SharedUploadPropertiesClient = FieldBaseClient & + Pick< + SharedUploadProperties, + 'hasMany' | 'max' | 'maxDepth' | 'maxRows' | 'min' | 'minRows' | 'type' + > + +type UploadAdmin = { + allowCreate?: boolean + components?: { + Error?: CustomComponent< + RelationshipFieldErrorClientComponent | RelationshipFieldErrorServerComponent + > + Label?: CustomComponent< + RelationshipFieldLabelClientComponent | RelationshipFieldLabelServerComponent + > + } & Admin['components'] + isSortable?: boolean +} & Admin +type UploadAdminClient = { + components?: { + Error?: MappedComponent + Label?: MappedComponent + } & AdminClient['components'] +} & AdminClient & + Pick<UploadAdmin, 'allowCreate' | 'isSortable'> + +export type PolymorphicUploadField = { admin?: { - components?: { - Error?: MappedComponent - Label?: MappedComponent - } & AdminClient['components'] - } -} & FieldBaseClient & - Pick<UploadField, 'displayPreview' | 'maxDepth' | 'relationTo' | 'type'> + sortOptions?: { [collectionSlug: CollectionSlug]: string } + } & UploadAdmin + relationTo: CollectionSlug[] +} & SharedUploadProperties + +export type PolymorphicUploadFieldClient = { + admin?: { + sortOptions?: Pick<PolymorphicUploadField['admin'], 'sortOptions'> + } & UploadAdminClient +} & Pick<PolymorphicUploadField, 'displayPreview' | 'maxDepth' | 'relationTo' | 'type'> & + SharedUploadPropertiesClient + +export type SingleUploadField = { + admin?: { + sortOptions?: string + } & UploadAdmin + relationTo: CollectionSlug +} & SharedUploadProperties + +export type SingleUploadFieldClient = { + admin?: Pick<SingleUploadField['admin'], 'sortOptions'> & UploadAdminClient +} & Pick<SingleUploadField, 'displayPreview' | 'maxDepth' | 'relationTo' | 'type'> & + SharedUploadPropertiesClient + +export type UploadField = /* PolymorphicUploadField | */ SingleUploadField + +export type UploadFieldClient = /* PolymorphicUploadFieldClient | */ SingleUploadFieldClient export type CodeField = { admin?: { diff --git a/packages/payload/src/fields/hooks/beforeValidate/promise.ts b/packages/payload/src/fields/hooks/beforeValidate/promise.ts index 35e6f4ad440..f1d74e81d9f 100644 --- a/packages/payload/src/fields/hooks/beforeValidate/promise.ts +++ b/packages/payload/src/fields/hooks/beforeValidate/promise.ts @@ -138,7 +138,7 @@ export const promise = async <T>({ siblingData[field.name] === 'null' || siblingData[field.name] === null ) { - if (field.type === 'relationship' && field.hasMany === true) { + if (field.hasMany === true) { siblingData[field.name] = [] } else { siblingData[field.name] = null @@ -153,32 +153,32 @@ export const promise = async <T>({ const relatedCollection = req.payload.config.collections.find( (collection) => collection.slug === relatedDoc.relationTo, ) - const relationshipIDField = relatedCollection.fields.find( - (collectionField) => - fieldAffectsData(collectionField) && collectionField.name === 'id', - ) - if (relationshipIDField?.type === 'number') { - siblingData[field.name][i] = { - ...relatedDoc, - value: parseFloat(relatedDoc.value as string), + if (relatedCollection?.fields) { + const relationshipIDField = relatedCollection.fields.find( + (collectionField) => + fieldAffectsData(collectionField) && collectionField.name === 'id', + ) + if (relationshipIDField?.type === 'number') { + siblingData[field.name][i] = { + ...relatedDoc, + value: parseFloat(relatedDoc.value as string), + } } } }) } - if ( - field.type === 'relationship' && - field.hasMany !== true && - valueIsValueWithRelation(value) - ) { + if (field.hasMany !== true && valueIsValueWithRelation(value)) { const relatedCollection = req.payload.config.collections.find( (collection) => collection.slug === value.relationTo, ) - const relationshipIDField = relatedCollection.fields.find( - (collectionField) => - fieldAffectsData(collectionField) && collectionField.name === 'id', - ) - if (relationshipIDField?.type === 'number') { - siblingData[field.name] = { ...value, value: parseFloat(value.value as string) } + if (relatedCollection?.fields) { + const relationshipIDField = relatedCollection.fields.find( + (collectionField) => + fieldAffectsData(collectionField) && collectionField.name === 'id', + ) + if (relationshipIDField?.type === 'number') { + siblingData[field.name] = { ...value, value: parseFloat(value.value as string) } + } } } } else { @@ -187,25 +187,31 @@ export const promise = async <T>({ const relatedCollection = req.payload.config.collections.find( (collection) => collection.slug === field.relationTo, ) - const relationshipIDField = relatedCollection.fields.find( - (collectionField) => - fieldAffectsData(collectionField) && collectionField.name === 'id', - ) - if (relationshipIDField?.type === 'number') { - siblingData[field.name][i] = parseFloat(relatedDoc as string) + + if (relatedCollection?.fields) { + const relationshipIDField = relatedCollection.fields.find( + (collectionField) => + fieldAffectsData(collectionField) && collectionField.name === 'id', + ) + if (relationshipIDField?.type === 'number') { + siblingData[field.name][i] = parseFloat(relatedDoc as string) + } } }) } - if (field.type === 'relationship' && field.hasMany !== true && value) { + if (field.hasMany !== true && value) { const relatedCollection = req.payload.config.collections.find( (collection) => collection.slug === field.relationTo, ) - const relationshipIDField = relatedCollection.fields.find( - (collectionField) => - fieldAffectsData(collectionField) && collectionField.name === 'id', - ) - if (relationshipIDField?.type === 'number') { - siblingData[field.name] = parseFloat(value as string) + + if (relatedCollection?.fields) { + const relationshipIDField = relatedCollection.fields.find( + (collectionField) => + fieldAffectsData(collectionField) && collectionField.name === 'id', + ) + if (relationshipIDField?.type === 'number') { + siblingData[field.name] = parseFloat(value as string) + } } } } diff --git a/packages/payload/src/fields/validations.ts b/packages/payload/src/fields/validations.ts index 8cc3f2dde58..f58c2ab1d7c 100644 --- a/packages/payload/src/fields/validations.ts +++ b/packages/payload/src/fields/validations.ts @@ -571,18 +571,76 @@ const validateFilterOptions: Validate< } export type UploadFieldValidation = Validate<unknown, unknown, unknown, UploadField> -export const upload: UploadFieldValidation = (value: string, options) => { - if (!value && options.required) { - return options?.req?.t('validation:required') + +export const upload: UploadFieldValidation = async (value, options) => { + const { + maxRows, + minRows, + relationTo, + req: { payload, t }, + required, + } = options + + if ( + ((!value && typeof value !== 'number') || (Array.isArray(value) && value.length === 0)) && + required + ) { + return t('validation:required') + } + + if (Array.isArray(value) && value.length > 0) { + if (minRows && value.length < minRows) { + return t('validation:lessThanMin', { + label: t('general:rows'), + min: minRows, + value: value.length, + }) + } + + if (maxRows && value.length > maxRows) { + return t('validation:greaterThanMax', { + label: t('general:rows'), + max: maxRows, + value: value.length, + }) + } } if (typeof value !== 'undefined' && value !== null) { - const idType = - options?.req?.payload?.collections[options.relationTo]?.customIDType || - options?.req?.payload?.db?.defaultIDType + const values = Array.isArray(value) ? value : [value] - if (!isValidID(value, idType)) { - return options.req?.t('validation:validUploadID') + const invalidRelationships = values.filter((val) => { + let collectionSlug: string + let requestedID + + if (typeof relationTo === 'string') { + collectionSlug = relationTo + + // custom id + if (val || typeof val === 'number') { + requestedID = val + } + } + + if (Array.isArray(relationTo) && typeof val === 'object' && val?.relationTo) { + collectionSlug = val.relationTo + requestedID = val.value + } + + if (requestedID === null) return false + + const idType = + payload.collections[collectionSlug]?.customIDType || payload?.db?.defaultIDType || 'text' + + return !isValidID(requestedID, idType) + }) + + if (invalidRelationships.length > 0) { + return `This relationship field has the following invalid relationships: ${invalidRelationships + .map((err, invalid) => { + return `${err} ${JSON.stringify(invalid)}` + }) + .join(', ')}` } } diff --git a/packages/payload/src/utilities/configToJSONSchema.ts b/packages/payload/src/utilities/configToJSONSchema.ts index 006a53582ab..d7f0d821c3c 100644 --- a/packages/payload/src/utilities/configToJSONSchema.ts +++ b/packages/payload/src/utilities/configToJSONSchema.ts @@ -291,6 +291,7 @@ export function fieldsToJSONSchema( break } + case 'upload': case 'relationship': { if (Array.isArray(field.relationTo)) { if (field.hasMany) { @@ -380,21 +381,6 @@ export function fieldsToJSONSchema( break } - case 'upload': { - fieldSchema = { - oneOf: [ - { - type: collectionIDFieldTypes[field.relationTo], - }, - { - $ref: `#/definitions/${field.relationTo}`, - }, - ], - } - if (!isRequired) fieldSchema.oneOf.push({ type: 'null' }) - break - } - case 'blocks': { // Check for a case where no blocks are provided. // We need to generate an empty array for this case, note that JSON schema 4 doesn't support empty arrays diff --git a/packages/ui/src/fields/Relationship/AddNew/index.scss b/packages/ui/src/elements/AddNewRelation/index.scss similarity index 74% rename from packages/ui/src/fields/Relationship/AddNew/index.scss rename to packages/ui/src/elements/AddNewRelation/index.scss index 3e3bd731ef4..98c42f785fc 100644 --- a/packages/ui/src/fields/Relationship/AddNew/index.scss +++ b/packages/ui/src/elements/AddNewRelation/index.scss @@ -1,4 +1,4 @@ -@import '../../../scss/styles.scss'; +@import '../../scss/styles.scss'; .relationship-add-new { display: flex; @@ -10,8 +10,12 @@ height: 100%; } - &__add-button, - &__add-button.doc-drawer__toggler { + &__add-button { + position: relative; + } + + &__add-button--unstyled, + &__add-button--unstyled.doc-drawer__toggler { @include formInput; margin: 0; border-top-left-radius: 0; diff --git a/packages/ui/src/fields/Relationship/AddNew/index.tsx b/packages/ui/src/elements/AddNewRelation/index.tsx similarity index 78% rename from packages/ui/src/fields/Relationship/AddNew/index.tsx rename to packages/ui/src/elements/AddNewRelation/index.tsx index d9318081dda..e06803b9e5a 100644 --- a/packages/ui/src/fields/Relationship/AddNew/index.tsx +++ b/packages/ui/src/elements/AddNewRelation/index.tsx @@ -4,29 +4,30 @@ import type { ClientCollectionConfig } from 'payload' import { getTranslation } from '@payloadcms/translations' import React, { Fragment, useCallback, useEffect, useState } from 'react' -import type { DocumentInfoContext } from '../../../providers/DocumentInfo/types.js' -import type { Value } from '../types.js' +import type { Value } from '../../fields/Relationship/types.js' +import type { DocumentInfoContext } from '../../providers/DocumentInfo/types.js' import type { Props } from './types.js' -import { Button } from '../../../elements/Button/index.js' -import { useDocumentDrawer } from '../../../elements/DocumentDrawer/index.js' -import * as PopupList from '../../../elements/Popup/PopupButtonList/index.js' -import { Popup } from '../../../elements/Popup/index.js' -import { Tooltip } from '../../../elements/Tooltip/index.js' -import { PlusIcon } from '../../../icons/Plus/index.js' -import { useAuth } from '../../../providers/Auth/index.js' -import { useTranslation } from '../../../providers/Translation/index.js' +import { PlusIcon } from '../../icons/Plus/index.js' +import { useAuth } from '../../providers/Auth/index.js' +import { useTranslation } from '../../providers/Translation/index.js' +import { Button } from '../Button/index.js' +import { useDocumentDrawer } from '../DocumentDrawer/index.js' +import * as PopupList from '../Popup/PopupButtonList/index.js' +import { Popup } from '../Popup/index.js' +import { Tooltip } from '../Tooltip/index.js' import './index.scss' import { useRelatedCollections } from './useRelatedCollections.js' const baseClass = 'relationship-add-new' export const AddNewRelation: React.FC<Props> = ({ - // dispatchOptions, + Button: ButtonFromProps, hasMany, path, relationTo, setValue, + unstyled, value, }) => { const relatedCollections = useRelatedCollections(relationTo) @@ -129,23 +130,34 @@ export const AddNewRelation: React.FC<Props> = ({ } }, [isDrawerOpen, relatedToMany]) + const label = t('fields:addNewLabel', { + label: getTranslation(relatedCollections[0].labels.singular, i18n), + }) + if (show) { return ( <div className={baseClass} id={`${path}-add-new`}> {relatedCollections.length === 1 && ( <Fragment> <DocumentDrawerToggler - className={`${baseClass}__add-button`} + className={[ + `${baseClass}__add-button`, + !unstyled && `${baseClass}__add-button--styled`, + ].join(' ')} onClick={() => setShowTooltip(false)} onMouseEnter={() => setShowTooltip(true)} onMouseLeave={() => setShowTooltip(false)} > - <Tooltip className={`${baseClass}__tooltip`} show={showTooltip}> - {t('fields:addNewLabel', { - label: getTranslation(relatedCollections[0].labels.singular, i18n), - })} - </Tooltip> - <PlusIcon /> + {ButtonFromProps ? ( + ButtonFromProps + ) : ( + <Fragment> + <Tooltip className={`${baseClass}__tooltip`} show={showTooltip}> + {label} + </Tooltip> + <PlusIcon /> + </Fragment> + )} </DocumentDrawerToggler> <DocumentDrawer onSave={onSave} /> </Fragment> @@ -154,13 +166,17 @@ export const AddNewRelation: React.FC<Props> = ({ <Fragment> <Popup button={ - <Button - buttonStyle="none" - className={`${baseClass}__add-button`} - tooltip={popupOpen ? undefined : t('fields:addNew')} - > - <PlusIcon /> - </Button> + ButtonFromProps ? ( + ButtonFromProps + ) : ( + <Button + buttonStyle="none" + className={`${baseClass}__add-button`} + tooltip={popupOpen ? undefined : t('fields:addNew')} + > + <PlusIcon /> + </Button> + ) } buttonType="custom" horizontalAlign="center" diff --git a/packages/ui/src/elements/AddNewRelation/types.ts b/packages/ui/src/elements/AddNewRelation/types.ts new file mode 100644 index 00000000000..11be5938045 --- /dev/null +++ b/packages/ui/src/elements/AddNewRelation/types.ts @@ -0,0 +1,11 @@ +import type { Value } from '../../fields/Relationship/types.js' + +export type Props = { + readonly Button?: React.ReactNode + readonly hasMany: boolean + readonly path: string + readonly relationTo: string | string[] + readonly setValue: (value: unknown) => void + readonly unstyled?: boolean + readonly value: Value | Value[] +} diff --git a/packages/ui/src/fields/Relationship/AddNew/useRelatedCollections.ts b/packages/ui/src/elements/AddNewRelation/useRelatedCollections.ts similarity index 90% rename from packages/ui/src/fields/Relationship/AddNew/useRelatedCollections.ts rename to packages/ui/src/elements/AddNewRelation/useRelatedCollections.ts index 82997a8ca38..0667b5408c8 100644 --- a/packages/ui/src/fields/Relationship/AddNew/useRelatedCollections.ts +++ b/packages/ui/src/elements/AddNewRelation/useRelatedCollections.ts @@ -3,7 +3,7 @@ import type { ClientCollectionConfig } from 'payload' import { useState } from 'react' -import { useConfig } from '../../../providers/Config/index.js' +import { useConfig } from '../../providers/Config/index.js' export const useRelatedCollections = (relationTo: string | string[]): ClientCollectionConfig[] => { const { config } = useConfig() diff --git a/packages/ui/src/elements/DocumentDrawer/DrawerContent.tsx b/packages/ui/src/elements/DocumentDrawer/DrawerContent.tsx index 1fcbe01cb47..394e25a9a00 100644 --- a/packages/ui/src/elements/DocumentDrawer/DrawerContent.tsx +++ b/packages/ui/src/elements/DocumentDrawer/DrawerContent.tsx @@ -6,13 +6,13 @@ import { toast } from 'sonner' import type { DocumentDrawerProps } from './types.js' -import { useRelatedCollections } from '../../fields/Relationship/AddNew/useRelatedCollections.js' import { XIcon } from '../../icons/X/index.js' import { RenderComponent } from '../../providers/Config/RenderComponent.js' import { useConfig } from '../../providers/Config/index.js' import { DocumentInfoProvider, useDocumentInfo } from '../../providers/DocumentInfo/index.js' import { useLocale } from '../../providers/Locale/index.js' import { useTranslation } from '../../providers/Translation/index.js' +import { useRelatedCollections } from '../AddNewRelation/useRelatedCollections.js' import { Gutter } from '../Gutter/index.js' import { IDLabel } from '../IDLabel/index.js' import { RenderTitle } from '../RenderTitle/index.js' diff --git a/packages/ui/src/elements/DocumentDrawer/index.tsx b/packages/ui/src/elements/DocumentDrawer/index.tsx index de34cae6135..b9bae4d5a0e 100644 --- a/packages/ui/src/elements/DocumentDrawer/index.tsx +++ b/packages/ui/src/elements/DocumentDrawer/index.tsx @@ -5,9 +5,9 @@ import React, { useCallback, useEffect, useId, useMemo, useState } from 'react' import type { DocumentDrawerProps, DocumentTogglerProps, UseDocumentDrawer } from './types.js' -import { useRelatedCollections } from '../../fields/Relationship/AddNew/useRelatedCollections.js' import { useEditDepth } from '../../providers/EditDepth/index.js' import { useTranslation } from '../../providers/Translation/index.js' +import { useRelatedCollections } from '../AddNewRelation/useRelatedCollections.js' import { Drawer, DrawerToggler } from '../Drawer/index.js' import { DocumentDrawerContent } from './DrawerContent.js' import './index.scss' diff --git a/packages/ui/src/elements/FileDetails/DraggableFileDetails/index.scss b/packages/ui/src/elements/FileDetails/DraggableFileDetails/index.scss new file mode 100644 index 00000000000..1aa27226e32 --- /dev/null +++ b/packages/ui/src/elements/FileDetails/DraggableFileDetails/index.scss @@ -0,0 +1,33 @@ +@import '../../../scss/styles.scss'; + +.file-details-draggable { + display: flex; + gap: 0.6rem; + //justify-content: space-between; + align-items: center; + background: var(--theme-elevation-50); + border-radius: 3px; + padding: 0.7rem 0.8rem; + + &--drag-wrapper { + display: flex; + gap: 0.6rem; + align-items: center; + } + + &__thumbnail { + max-width: 1.5rem; + } + + &__actions { + flex-grow: 2; + display: flex; + gap: 0.6rem; + align-items: center; + justify-content: flex-end; + } + + &__remove.btn--style-icon-label { + margin: 0; + } +} diff --git a/packages/ui/src/elements/FileDetails/DraggableFileDetails/index.tsx b/packages/ui/src/elements/FileDetails/DraggableFileDetails/index.tsx new file mode 100644 index 00000000000..4a8f1cfb08f --- /dev/null +++ b/packages/ui/src/elements/FileDetails/DraggableFileDetails/index.tsx @@ -0,0 +1,115 @@ +'use client' +import React from 'react' + +import { Button } from '../../Button/index.js' +import { Thumbnail } from '../../Thumbnail/index.js' +import { UploadActions } from '../../Upload/index.js' +import { FileMeta } from '../FileMeta/index.js' +import './index.scss' + +const baseClass = 'file-details-draggable' + +import type { Data, FileSizes, SanitizedCollectionConfig } from 'payload' + +import { DraggableSortableItem } from '../../../elements/DraggableSortable/DraggableSortableItem/index.js' +import { DragHandleIcon } from '../../../icons/DragHandle/index.js' +import { EditIcon } from '../../../icons/Edit/index.js' +import { useDocumentDrawer } from '../../DocumentDrawer/index.js' + +export type DraggableFileDetailsProps = { + collectionSlug: string + customUploadActions?: React.ReactNode[] + doc: { + sizes?: FileSizes + } & Data + enableAdjustments?: boolean + hasImageSizes?: boolean + hasMany: boolean + imageCacheTag?: string + isSortable?: boolean + removeItem?: (index: number) => void + rowIndex: number + uploadConfig: SanitizedCollectionConfig['upload'] +} + +export const DraggableFileDetails: React.FC<DraggableFileDetailsProps> = (props) => { + const { + collectionSlug, + customUploadActions, + doc, + enableAdjustments, + hasImageSizes, + hasMany, + imageCacheTag, + isSortable, + removeItem, + rowIndex, + uploadConfig, + } = props + + const { id, filename, filesize, height, mimeType, thumbnailURL, url, width } = doc + + const [DocumentDrawer, DocumentDrawerToggler] = useDocumentDrawer({ + id, + collectionSlug, + }) + + return ( + <DraggableSortableItem id={id} key={id}> + {(draggableSortableItemProps) => ( + <div + className={[ + baseClass, + draggableSortableItemProps && isSortable && `${baseClass}--has-drag-handle`, + ] + .filter(Boolean) + .join(' ')} + ref={draggableSortableItemProps.setNodeRef} + style={{ + transform: draggableSortableItemProps.transform, + transition: draggableSortableItemProps.transition, + zIndex: draggableSortableItemProps.isDragging ? 1 : undefined, + }} + > + <div className={`${baseClass}--drag-wrapper`}> + {isSortable && draggableSortableItemProps && ( + <div + className={`${baseClass}__drag`} + {...draggableSortableItemProps.attributes} + {...draggableSortableItemProps.listeners} + > + <DragHandleIcon /> + </div> + )} + <Thumbnail + className={`${baseClass}__thumbnail`} + collectionSlug={collectionSlug} + doc={doc} + fileSrc={thumbnailURL || url} + imageCacheTag={imageCacheTag} + uploadConfig={uploadConfig} + /> + </div> + <div className={`${baseClass}__main-detail`}>{filename}</div> + + <div className={`${baseClass}__actions`}> + <DocumentDrawer /> + <DocumentDrawerToggler> + <EditIcon /> + </DocumentDrawerToggler> + {removeItem && ( + <Button + buttonStyle="icon-label" + className={`${baseClass}__remove`} + icon="x" + iconStyle="none" + onClick={() => removeItem(rowIndex)} + round + /> + )} + </div> + </div> + )} + </DraggableSortableItem> + ) +} diff --git a/packages/ui/src/elements/FileDetails/index.scss b/packages/ui/src/elements/FileDetails/StaticFileDetails/index.scss similarity index 98% rename from packages/ui/src/elements/FileDetails/index.scss rename to packages/ui/src/elements/FileDetails/StaticFileDetails/index.scss index aa409a5938d..ee7f61b7c2b 100644 --- a/packages/ui/src/elements/FileDetails/index.scss +++ b/packages/ui/src/elements/FileDetails/StaticFileDetails/index.scss @@ -1,4 +1,4 @@ -@import '../../scss/styles.scss'; +@import '../../../scss/styles.scss'; .file-details { background: var(--theme-elevation-50); diff --git a/packages/ui/src/elements/FileDetails/StaticFileDetails/index.tsx b/packages/ui/src/elements/FileDetails/StaticFileDetails/index.tsx new file mode 100644 index 00000000000..5664ace1a0f --- /dev/null +++ b/packages/ui/src/elements/FileDetails/StaticFileDetails/index.tsx @@ -0,0 +1,87 @@ +'use client' +import React from 'react' + +import { Button } from '../../Button/index.js' +import { Thumbnail } from '../../Thumbnail/index.js' +import { UploadActions } from '../../Upload/index.js' +import { FileMeta } from '../FileMeta/index.js' +import './index.scss' + +const baseClass = 'file-details' + +import type { Data, FileSizes, SanitizedCollectionConfig } from 'payload' + +export type StaticFileDetailsProps = { + collectionSlug: string + customUploadActions?: React.ReactNode[] + doc: { + sizes?: FileSizes + } & Data + enableAdjustments?: boolean + handleRemove?: () => void + hasImageSizes?: boolean + imageCacheTag?: string + uploadConfig: SanitizedCollectionConfig['upload'] +} + +export const StaticFileDetails: React.FC<StaticFileDetailsProps> = (props) => { + const { + collectionSlug, + customUploadActions, + doc, + enableAdjustments, + handleRemove, + hasImageSizes, + imageCacheTag, + uploadConfig, + } = props + + const { id, filename, filesize, height, mimeType, thumbnailURL, url, width } = doc + + return ( + <div className={baseClass}> + <header> + <Thumbnail + // size="small" + className={`${baseClass}__thumbnail`} + collectionSlug={collectionSlug} + doc={doc} + fileSrc={thumbnailURL || url} + imageCacheTag={imageCacheTag} + uploadConfig={uploadConfig} + /> + <div className={`${baseClass}__main-detail`}> + <FileMeta + collection={collectionSlug} + filename={filename as string} + filesize={filesize as number} + height={height as number} + id={id as string} + mimeType={mimeType as string} + url={url as string} + width={width as number} + /> + + {(enableAdjustments || customUploadActions) && ( + <UploadActions + customActions={customUploadActions} + enableAdjustments={Boolean(enableAdjustments)} + enablePreviewSizes={hasImageSizes && doc.filename} + mimeType={mimeType} + /> + )} + </div> + {handleRemove && ( + <Button + buttonStyle="icon-label" + className={`${baseClass}__remove`} + icon="x" + iconStyle="with-border" + onClick={handleRemove} + round + /> + )} + </header> + </div> + ) +} diff --git a/packages/ui/src/elements/FileDetails/index.tsx b/packages/ui/src/elements/FileDetails/index.tsx index 7272352326f..9f0954c9ac7 100644 --- a/packages/ui/src/elements/FileDetails/index.tsx +++ b/packages/ui/src/elements/FileDetails/index.tsx @@ -1,87 +1,49 @@ 'use client' -import React from 'react' +import type { Data, FileSizes, SanitizedCollectionConfig } from 'payload' -import { UploadActions } from '../../elements/Upload/index.js' -import { Button } from '../Button/index.js' -import { Thumbnail } from '../Thumbnail/index.js' -import { FileMeta } from './FileMeta/index.js' -import './index.scss' +import React from 'react' -const baseClass = 'file-details' +import { DraggableFileDetails } from './DraggableFileDetails/index.js' +import { StaticFileDetails } from './StaticFileDetails/index.js' -import type { Data, FileSizes, SanitizedCollectionConfig } from 'payload' - -export type FileDetailsProps = { +type SharedFileDetailsProps = { collectionSlug: string customUploadActions?: React.ReactNode[] doc: { sizes?: FileSizes } & Data enableAdjustments?: boolean - handleRemove?: () => void hasImageSizes?: boolean imageCacheTag?: string uploadConfig: SanitizedCollectionConfig['upload'] } -export const FileDetails: React.FC<FileDetailsProps> = (props) => { - const { - collectionSlug, - customUploadActions, - doc, - enableAdjustments, - handleRemove, - hasImageSizes, - imageCacheTag, - uploadConfig, - } = props +type StaticFileDetailsProps = { + draggableItemProps?: never + handleRemove?: () => void + hasMany?: never + isSortable?: never + removeItem?: never + rowIndex?: never +} + +type DraggableFileDetailsProps = { + handleRemove?: never + hasMany: boolean + isSortable?: boolean + removeItem?: (index: number) => void + rowIndex: number +} + +export type FileDetailsProps = (DraggableFileDetailsProps | StaticFileDetailsProps) & + SharedFileDetailsProps - const { id, filename, filesize, height, mimeType, thumbnailURL, url, width } = doc +export const FileDetails: React.FC<FileDetailsProps> = (props) => { + const { hasMany } = props - return ( - <div className={baseClass}> - <header> - <Thumbnail - // size="small" - className={`${baseClass}__thumbnail`} - collectionSlug={collectionSlug} - doc={doc} - fileSrc={thumbnailURL || url} - imageCacheTag={imageCacheTag} - uploadConfig={uploadConfig} - /> - <div className={`${baseClass}__main-detail`}> - <FileMeta - collection={collectionSlug} - filename={filename as string} - filesize={filesize as number} - height={height as number} - id={id as string} - mimeType={mimeType as string} - url={url as string} - width={width as number} - /> + if (hasMany) { + return <DraggableFileDetails {...props} /> + } - {(enableAdjustments || customUploadActions) && ( - <UploadActions - customActions={customUploadActions} - enableAdjustments={enableAdjustments} - enablePreviewSizes={hasImageSizes && doc.filename} - mimeType={mimeType} - /> - )} - </div> - {handleRemove && ( - <Button - buttonStyle="icon-label" - className={`${baseClass}__remove`} - icon="x" - iconStyle="with-border" - onClick={handleRemove} - round - /> - )} - </header> - </div> - ) + return <StaticFileDetails {...props} /> } diff --git a/packages/ui/src/elements/ListControls/index.tsx b/packages/ui/src/elements/ListControls/index.tsx index 8ac1917fc00..892f75f9131 100644 --- a/packages/ui/src/elements/ListControls/index.tsx +++ b/packages/ui/src/elements/ListControls/index.tsx @@ -3,7 +3,7 @@ import type { ClientCollectionConfig, ClientField, Where } from 'payload' import { useWindowInfo } from '@faceless-ui/window-info' import { getTranslation } from '@payloadcms/translations' -import React, { useEffect, useRef, useState } from 'react' +import React, { Fragment, useEffect, useRef, useState } from 'react' import AnimateHeightImport from 'react-animate-height' const AnimateHeight = (AnimateHeightImport.default || @@ -49,7 +49,7 @@ export const ListControls: React.FC<ListControlsProps> = (props) => { const { collectionConfig, enableColumns = true, enableSort = false, fields } = props const { handleSearchChange } = useListQuery() - const { collectionSlug } = useListInfo() + const { beforeActions, collectionSlug, disableBulkDelete, disableBulkEdit } = useListInfo() const { searchParams } = useSearchParams() const titleField = useUseTitleField(collectionConfig, fields) const { i18n, t } = useTranslation() @@ -144,10 +144,15 @@ export const ListControls: React.FC<ListControlsProps> = (props) => { <div className={`${baseClass}__buttons-wrap`}> {!smallBreak && ( <React.Fragment> - <EditMany collection={collectionConfig} fields={fields} /> - <PublishMany collection={collectionConfig} /> - <UnpublishMany collection={collectionConfig} /> - <DeleteMany collection={collectionConfig} /> + {beforeActions && beforeActions} + {!disableBulkEdit && ( + <Fragment> + <EditMany collection={collectionConfig} fields={fields} /> + <PublishMany collection={collectionConfig} /> + <UnpublishMany collection={collectionConfig} /> + </Fragment> + )} + {!disableBulkDelete && <DeleteMany collection={collectionConfig} />} </React.Fragment> )} {enableColumns && ( diff --git a/packages/ui/src/elements/ListDrawer/DrawerContent.tsx b/packages/ui/src/elements/ListDrawer/DrawerContent.tsx index 43c46987732..894971734c1 100644 --- a/packages/ui/src/elements/ListDrawer/DrawerContent.tsx +++ b/packages/ui/src/elements/ListDrawer/DrawerContent.tsx @@ -7,6 +7,7 @@ import React, { useCallback, useEffect, useReducer, useState } from 'react' import type { ListDrawerProps } from './types.js' +import { SelectMany } from '../../elements/SelectMany/index.js' import { FieldLabel } from '../../fields/FieldLabel/index.js' import { usePayloadAPI } from '../../hooks/usePayloadAPI.js' import { XIcon } from '../../icons/X/index.js' @@ -45,7 +46,9 @@ export const ListDrawerContent: React.FC<ListDrawerProps> = ({ collectionSlugs, customHeader, drawerSlug, + enableRowSelections, filterOptions, + onBulkSelect, onSelect, selectedCollection, }) => { @@ -276,8 +279,13 @@ export const ListDrawerContent: React.FC<ListDrawerProps> = ({ )} </header> } + beforeActions={ + enableRowSelections ? [<SelectMany key="select-many" onClick={onBulkSelect} />] : undefined + } collectionConfig={selectedCollectionConfig} collectionSlug={selectedCollectionConfig.slug} + disableBulkDelete + disableBulkEdit hasCreatePermission={hasCreatePermission} newDocumentURL={null} > @@ -309,6 +317,7 @@ export const ListDrawerContent: React.FC<ListDrawerProps> = ({ }, ]} collectionSlug={selectedCollectionConfig.slug} + enableRowSelections={enableRowSelections} preferenceKey={preferenceKey} > <RenderComponent mappedComponent={List} /> diff --git a/packages/ui/src/elements/ListDrawer/index.tsx b/packages/ui/src/elements/ListDrawer/index.tsx index 954b716f04e..76b9c100de7 100644 --- a/packages/ui/src/elements/ListDrawer/index.tsx +++ b/packages/ui/src/elements/ListDrawer/index.tsx @@ -87,6 +87,7 @@ export const useListDrawer: UseListDrawer = ({ setCollectionSlugs(filteredCollectionSlugs.map(({ slug }) => slug)) } }, [collectionSlugs, uploads, collections]) + const toggleDrawer = useCallback(() => { toggleModal(drawerSlug) }, [toggleModal, drawerSlug]) diff --git a/packages/ui/src/elements/ListDrawer/types.ts b/packages/ui/src/elements/ListDrawer/types.ts index dfe55c54f0a..d5676321774 100644 --- a/packages/ui/src/elements/ListDrawer/types.ts +++ b/packages/ui/src/elements/ListDrawer/types.ts @@ -2,11 +2,15 @@ import type { FilterOptionsResult, SanitizedCollectionConfig } from 'payload' import type React from 'react' import type { HTMLAttributes } from 'react' +import type { useSelection } from '../../providers/Selection/index.js' + export type ListDrawerProps = { readonly collectionSlugs: string[] readonly customHeader?: React.ReactNode readonly drawerSlug?: string + readonly enableRowSelections?: boolean readonly filterOptions?: FilterOptionsResult + readonly onBulkSelect?: (selected: ReturnType<typeof useSelection>['selected']) => void readonly onSelect?: (args: { collectionSlug: SanitizedCollectionConfig['slug'] docID: string @@ -27,7 +31,7 @@ export type UseListDrawer = (args: { selectedCollection?: string uploads?: boolean // finds all collections with upload: true }) => [ - React.FC<Pick<ListDrawerProps, 'onSelect'>>, // drawer + React.FC<Pick<ListDrawerProps, 'enableRowSelections' | 'onBulkSelect' | 'onSelect'>>, // drawer React.FC<Pick<ListTogglerProps, 'children' | 'className' | 'disabled'>>, // toggler { closeDrawer: () => void diff --git a/packages/ui/src/elements/SelectMany/index.tsx b/packages/ui/src/elements/SelectMany/index.tsx new file mode 100644 index 00000000000..aef666d6ef6 --- /dev/null +++ b/packages/ui/src/elements/SelectMany/index.tsx @@ -0,0 +1,32 @@ +import React from 'react' + +import { useSelection } from '../../providers/Selection/index.js' +// import { useTranslation } from '../../providers/Translation/index.js' +import { Pill } from '../Pill/index.js' + +export const SelectMany: React.FC<{ + onClick?: (ids: ReturnType<typeof useSelection>['selected']) => void +}> = (props) => { + const { onClick } = props + + const { count, selected } = useSelection() + // const { t } = useTranslation() + + if (!selected || !count) { + return null + } + + return ( + <Pill + // className={`${baseClass}__toggle`} + onClick={() => { + if (typeof onClick === 'function') { + onClick(selected) + } + }} + pillStyle="white" + > + {`Select ${count}`} + </Pill> + ) +} diff --git a/packages/ui/src/fields/Relationship/AddNew/types.ts b/packages/ui/src/fields/Relationship/AddNew/types.ts deleted file mode 100644 index 6b0a97133ca..00000000000 --- a/packages/ui/src/fields/Relationship/AddNew/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type React from 'react' - -import type { Action, OptionGroup, Value } from '../types.js' - -export type Props = { - dispatchOptions: React.Dispatch<Action> - hasMany: boolean - options: OptionGroup[] - path: string - relationTo: string | string[] - setValue: (value: unknown) => void - value: Value | Value[] -} diff --git a/packages/ui/src/fields/Relationship/index.tsx b/packages/ui/src/fields/Relationship/index.tsx index ae34fc69384..cd39968025b 100644 --- a/packages/ui/src/fields/Relationship/index.tsx +++ b/packages/ui/src/fields/Relationship/index.tsx @@ -8,6 +8,7 @@ import React, { useCallback, useEffect, useReducer, useRef, useState } from 'rea import type { DocumentDrawerProps } from '../../elements/DocumentDrawer/types.js' import type { GetResults, Option, Value } from './types.js' +import { AddNewRelation } from '../../elements/AddNewRelation/index.js' import { ReactSelect } from '../../elements/ReactSelect/index.js' import { useFieldProps } from '../../forms/FieldPropsProvider/index.js' import { useField } from '../../forms/useField/index.js' @@ -21,7 +22,6 @@ import { FieldDescription } from '../FieldDescription/index.js' import { FieldError } from '../FieldError/index.js' import { FieldLabel } from '../FieldLabel/index.js' import { fieldBaseClass } from '../shared/index.js' -import { AddNewRelation } from './AddNew/index.js' import { createRelationMap } from './createRelationMap.js' import { findOptionsByValue } from './findOptionsByValue.js' import './index.scss' @@ -591,15 +591,11 @@ const RelationshipFieldComponent: React.FC<RelationshipFieldProps> = (props) => /> {!readOnly && allowCreate && ( <AddNewRelation - {...{ - dispatchOptions, - hasMany, - options, - path, - relationTo, - setValue, - value, - }} + hasMany={hasMany} + path={path} + relationTo={relationTo} + setValue={setValue} + value={value} /> )} </div> diff --git a/packages/ui/src/fields/Upload/HasMany/index.scss b/packages/ui/src/fields/Upload/HasMany/index.scss new file mode 100644 index 00000000000..c09b590b071 --- /dev/null +++ b/packages/ui/src/fields/Upload/HasMany/index.scss @@ -0,0 +1,47 @@ +@import '../../../scss/styles.scss'; + +.upload--has-many { + position: relative; + max-width: 100%; + + &__controls { + display: flex; + gap: base(2); + margin-top: base(1); + } + + &__buttons { + display: flex; + gap: base(1); + } + + &__add-new { + display: flex; + gap: base(0.5); + } + + &__clear-all { + all: unset; + flex-shrink: 0; + font-size: inherit; + font-family: inherit; + color: inherit; + cursor: pointer; + } + + &__draggable-rows { + display: flex; + flex-direction: column; + gap: 0.25rem; + } +} + +html[data-theme='light'] { + .upload { + } +} + +html[data-theme='dark'] { + .upload { + } +} diff --git a/packages/ui/src/fields/Upload/HasMany/index.tsx b/packages/ui/src/fields/Upload/HasMany/index.tsx new file mode 100644 index 00000000000..02d2afcb7ab --- /dev/null +++ b/packages/ui/src/fields/Upload/HasMany/index.tsx @@ -0,0 +1,256 @@ +'use client' +import type { FilterOptionsResult, Where } from 'payload' + +import * as qs from 'qs-esm' +import { Fragment, useCallback, useEffect, useMemo, useState } from 'react' + +import type { useSelection } from '../../../providers/Selection/index.js' +import type { UploadFieldPropsWithContext } from '../HasOne/index.js' + +import { AddNewRelation } from '../../../elements/AddNewRelation/index.js' +import { Button } from '../../../elements/Button/index.js' +import { DraggableSortable } from '../../../elements/DraggableSortable/index.js' +import { FileDetails } from '../../../elements/FileDetails/index.js' +import { useListDrawer } from '../../../elements/ListDrawer/index.js' +import { useConfig } from '../../../providers/Config/index.js' +import { useLocale } from '../../../providers/Locale/index.js' +import { useTranslation } from '../../../providers/Translation/index.js' +import { FieldLabel } from '../../FieldLabel/index.js' + +const baseClass = 'upload upload--has-many' + +import './index.scss' + +export const UploadComponentHasMany: React.FC<UploadFieldPropsWithContext<string[]>> = (props) => { + const { + canCreate, + field, + field: { + _path, + admin: { + components: { Label }, + isSortable, + }, + hasMany, + label, + relationTo, + }, + fieldHookResult: { filterOptions: filterOptionsFromProps, setValue, value }, + readOnly, + } = props + + const { i18n, t } = useTranslation() + + const { + config: { + collections, + routes: { api }, + serverURL, + }, + } = useConfig() + + const filterOptions: FilterOptionsResult = useMemo(() => { + if (typeof relationTo === 'string') { + return { + ...filterOptionsFromProps, + [relationTo]: { + ...((filterOptionsFromProps?.[relationTo] as any) || {}), + id: { + ...((filterOptionsFromProps?.[relationTo] as any)?.id || {}), + not_in: (filterOptionsFromProps?.[relationTo] as any)?.id?.not_in || value, + }, + }, + } + } + }, [value, relationTo, filterOptionsFromProps]) + + const [fileDocs, setFileDocs] = useState([]) + const [missingFiles, setMissingFiles] = useState(false) + + const { code } = useLocale() + + useEffect(() => { + if (value !== null && typeof value !== 'undefined' && value.length !== 0) { + const query: { + [key: string]: unknown + where: Where + } = { + depth: 0, + draft: true, + locale: code, + where: { + and: [ + { + id: { + in: value, + }, + }, + ], + }, + } + + const fetchFile = async () => { + const response = await fetch(`${serverURL}${api}/${relationTo}`, { + body: qs.stringify(query), + credentials: 'include', + headers: { + 'Accept-Language': i18n.language, + 'Content-Type': 'application/x-www-form-urlencoded', + 'X-HTTP-Method-Override': 'GET', + }, + method: 'POST', + }) + if (response.ok) { + const json = await response.json() + setFileDocs(json.docs) + } else { + setMissingFiles(true) + setFileDocs([]) + } + } + + void fetchFile() + } else { + setFileDocs([]) + } + }, [value, relationTo, api, serverURL, i18n, code]) + + function moveItemInArray<T>(array: T[], moveFromIndex: number, moveToIndex: number): T[] { + const newArray = [...array] + const [item] = newArray.splice(moveFromIndex, 1) + + newArray.splice(moveToIndex, 0, item) + + return newArray + } + + const moveRow = useCallback( + (moveFromIndex: number, moveToIndex: number) => { + const updatedArray = moveItemInArray(value, moveFromIndex, moveToIndex) + setValue(updatedArray) + }, + [value, setValue], + ) + + const removeItem = useCallback( + (index: number) => { + const updatedArray = [...value] + updatedArray.splice(index, 1) + setValue(updatedArray) + }, + [value, setValue], + ) + + const [ListDrawer, ListDrawerToggler] = useListDrawer({ + collectionSlugs: + typeof relationTo === 'string' + ? [relationTo] + : collections.map((collection) => collection.slug), + filterOptions, + }) + + const collection = collections.find((coll) => coll.slug === relationTo) + + const onBulkSelect = useCallback( + (selections: ReturnType<typeof useSelection>['selected']) => { + const selectedIDs = Object.entries(selections).reduce( + (acc, [key, value]) => (value ? [...acc, key] : acc), + [] as string[], + ) + setValue([...value, ...selectedIDs]) + }, + [setValue, value], + ) + + return ( + <Fragment> + <div className={[baseClass].join(' ')}> + <FieldLabel Label={Label} field={field} label={label} /> + + <div className={[baseClass].join(' ')}> + <div> + <DraggableSortable + className={`${baseClass}__draggable-rows`} + ids={value} + onDragEnd={({ moveFromIndex, moveToIndex }) => moveRow(moveFromIndex, moveToIndex)} + > + {Boolean(value.length) && + value.map((id, index) => { + const doc = fileDocs.find((doc) => doc.id === id) + const uploadConfig = collection?.upload + + if (!doc) { + return null + } + + return ( + <FileDetails + collectionSlug={relationTo} + doc={doc} + hasMany={true} + isSortable={isSortable} + key={id} + removeItem={removeItem} + rowIndex={index} + uploadConfig={uploadConfig} + /> + ) + })} + </DraggableSortable> + </div> + </div> + + <div className={[`${baseClass}__controls`].join(' ')}> + <div className={[`${baseClass}__buttons`].join(' ')}> + {canCreate && ( + <div className={[`${baseClass}__add-new`].join(' ')}> + <AddNewRelation + Button={ + <Button + buttonStyle="icon-label" + el="span" + icon="plus" + iconPosition="left" + iconStyle="with-border" + > + {t('fields:addNew')} + </Button> + } + hasMany={hasMany} + path={_path} + relationTo={relationTo} + setValue={setValue} + unstyled + value={value} + /> + </div> + )} + <ListDrawerToggler className={`${baseClass}__toggler`} disabled={readOnly}> + <div> + <Button + buttonStyle="icon-label" + el="span" + icon="plus" + iconPosition="left" + iconStyle="with-border" + > + {t('fields:chooseFromExisting')} + </Button> + </div> + </ListDrawerToggler> + </div> + <button className={`${baseClass}__clear-all`} onClick={() => setValue([])} type="button"> + Clear all + </button> + </div> + </div> + <ListDrawer + enableRowSelections + onBulkSelect={onBulkSelect} + onSelect={(selection) => { + setValue([...value, selection.docID]) + }} + /> + </Fragment> + ) +} diff --git a/packages/ui/src/fields/Upload/Input.tsx b/packages/ui/src/fields/Upload/HasOne/Input.tsx similarity index 87% rename from packages/ui/src/fields/Upload/Input.tsx rename to packages/ui/src/fields/Upload/HasOne/Input.tsx index 9bf3f2def05..87d78d9f3f8 100644 --- a/packages/ui/src/fields/Upload/Input.tsx +++ b/packages/ui/src/fields/Upload/HasOne/Input.tsx @@ -17,22 +17,21 @@ import type { MarkOptional } from 'ts-essentials' import { getTranslation } from '@payloadcms/translations' import React, { useCallback, useEffect, useState } from 'react' -import type { DocumentDrawerProps } from '../../elements/DocumentDrawer/types.js' -import type { ListDrawerProps } from '../../elements/ListDrawer/types.js' - -import { Button } from '../../elements/Button/index.js' -import { useDocumentDrawer } from '../../elements/DocumentDrawer/index.js' -import { FileDetails } from '../../elements/FileDetails/index.js' -import { useListDrawer } from '../../elements/ListDrawer/index.js' -import { useTranslation } from '../../providers/Translation/index.js' -import { FieldDescription } from '../FieldDescription/index.js' -import { FieldError } from '../FieldError/index.js' -import { FieldLabel } from '../FieldLabel/index.js' -import { fieldBaseClass } from '../shared/index.js' +import type { DocumentDrawerProps } from '../../../elements/DocumentDrawer/types.js' +import type { ListDrawerProps } from '../../../elements/ListDrawer/types.js' + +import { Button } from '../../../elements/Button/index.js' +import { useDocumentDrawer } from '../../../elements/DocumentDrawer/index.js' +import { FileDetails } from '../../../elements/FileDetails/index.js' +import { useListDrawer } from '../../../elements/ListDrawer/index.js' +import { useTranslation } from '../../../providers/Translation/index.js' +import { FieldDescription } from '../../FieldDescription/index.js' +import { FieldError } from '../../FieldError/index.js' +import { FieldLabel } from '../../FieldLabel/index.js' +import { fieldBaseClass } from '../../shared/index.js' +import { baseClass } from '../index.js' import './index.scss' -const baseClass = 'upload' - export type UploadInputProps = { readonly Description?: MappedComponent readonly Error?: MappedComponent @@ -63,7 +62,7 @@ export type UploadInputProps = { readonly width?: string } -export const UploadInput: React.FC<UploadInputProps> = (props) => { +export const UploadInputHasOne: React.FC<UploadInputProps> = (props) => { const { Description, Error, @@ -149,7 +148,7 @@ export const UploadInput: React.FC<UploadInputProps> = (props) => { [onChange, closeListDrawer], ) - if (collection.upload) { + if (collection.upload && typeof relationTo === 'string') { return ( <div className={[ diff --git a/packages/ui/src/fields/Upload/index.scss b/packages/ui/src/fields/Upload/HasOne/index.scss similarity index 97% rename from packages/ui/src/fields/Upload/index.scss rename to packages/ui/src/fields/Upload/HasOne/index.scss index e53bb3df192..2192613ef31 100644 --- a/packages/ui/src/fields/Upload/index.scss +++ b/packages/ui/src/fields/Upload/HasOne/index.scss @@ -1,4 +1,4 @@ -@import '../../scss/styles.scss'; +@import '../../../scss/styles.scss'; .upload { position: relative; diff --git a/packages/ui/src/fields/Upload/HasOne/index.tsx b/packages/ui/src/fields/Upload/HasOne/index.tsx new file mode 100644 index 00000000000..969beeafba3 --- /dev/null +++ b/packages/ui/src/fields/Upload/HasOne/index.tsx @@ -0,0 +1,76 @@ +'use client' + +import type { UploadFieldProps } from 'payload' + +import React from 'react' + +import type { useField } from '../../../forms/useField/index.js' + +import { useConfig } from '../../../providers/Config/index.js' +import { UploadInputHasOne } from './Input.js' +import './index.scss' + +export type UploadFieldPropsWithContext<TValue extends string | string[] = string> = { + readonly canCreate: boolean + readonly disabled: boolean + readonly fieldHookResult: ReturnType<typeof useField<TValue>> + readonly onChange: (value: unknown) => void +} & UploadFieldProps + +export const UploadComponentHasOne: React.FC<UploadFieldPropsWithContext> = (props) => { + const { + canCreate, + descriptionProps, + disabled, + errorProps, + field, + field: { admin: { className, style, width } = {}, label, relationTo, required }, + fieldHookResult, + labelProps, + onChange, + } = props + + const { + config: { + collections, + routes: { api: apiRoute }, + serverURL, + }, + } = useConfig() + + if (typeof relationTo === 'string') { + const collection = collections.find((coll) => coll.slug === relationTo) + + if (collection.upload) { + return ( + <UploadInputHasOne + Description={field?.admin?.components?.Description} + Error={field?.admin?.components?.Error} + Label={field?.admin?.components?.Label} + allowNewUpload={canCreate} + api={apiRoute} + className={className} + collection={collection} + descriptionProps={descriptionProps} + errorProps={errorProps} + filterOptions={fieldHookResult.filterOptions} + label={label} + labelProps={labelProps} + onChange={onChange} + readOnly={disabled} + relationTo={relationTo} + required={required} + serverURL={serverURL} + showError={fieldHookResult.showError} + style={style} + value={fieldHookResult.value} + width={width} + /> + ) + } + } else { + return <div>Polymorphic Has One Uploads Go Here</div> + } + + return null +} diff --git a/packages/ui/src/fields/Upload/index.tsx b/packages/ui/src/fields/Upload/index.tsx index 7b46b41fa01..db76d081e13 100644 --- a/packages/ui/src/fields/Upload/index.tsx +++ b/packages/ui/src/fields/Upload/index.tsx @@ -4,50 +4,38 @@ import type { UploadFieldProps } from 'payload' import React, { useCallback, useMemo } from 'react' -import type { UploadInputProps } from './Input.js' +import type { UploadInputProps } from './HasOne/Input.js' import { useFieldProps } from '../../forms/FieldPropsProvider/index.js' import { useField } from '../../forms/useField/index.js' import { withCondition } from '../../forms/withCondition/index.js' import { useAuth } from '../../providers/Auth/index.js' -import { useConfig } from '../../providers/Config/index.js' -import { UploadInput } from './Input.js' -import './index.scss' +import { UploadComponentHasMany } from './HasMany/index.js' +import { UploadInputHasOne } from './HasOne/Input.js' +import { UploadComponentHasOne } from './HasOne/index.js' -export { UploadFieldProps, UploadInput } +export { UploadFieldProps, UploadInputHasOne as UploadInput } export type { UploadInputProps } +export const baseClass = 'upload' + const UploadComponent: React.FC<UploadFieldProps> = (props) => { const { - descriptionProps, - errorProps, - field, field: { _path: pathFromProps, - admin: { className, readOnly: readOnlyFromAdmin, style, width } = {}, - label, + admin: { readOnly: readOnlyFromAdmin } = {}, + hasMany, relationTo, required, }, - labelProps, readOnly: readOnlyFromTopLevelProps, validate, } = props const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin - const { - config: { - collections, - routes: { api: apiRoute }, - serverURL, - }, - } = useConfig() - const { permissions } = useAuth() - const collection = collections.find((coll) => coll.slug === relationTo) - const memoizedValidate = useCallback( (value, options) => { if (typeof validate === 'function') { @@ -61,22 +49,29 @@ const UploadComponent: React.FC<UploadFieldProps> = (props) => { // Checks if the user has permissions to create a new document in the related collection const canCreate = useMemo(() => { - if (permissions?.collections && permissions.collections?.[relationTo]?.create) { - if (permissions.collections[relationTo].create?.permission === true) { - return true + if (typeof relationTo === 'string') { + if (permissions?.collections && permissions.collections?.[relationTo]?.create) { + if (permissions.collections[relationTo].create?.permission === true) { + return true + } } } return false }, [relationTo, permissions]) - const { filterOptions, formInitializing, formProcessing, setValue, showError, value } = - useField<string>({ - path: pathFromContext ?? pathFromProps, - validate: memoizedValidate, - }) + const fieldHookResult = useField<string | string[]>({ + path: pathFromContext ?? pathFromProps, + validate: memoizedValidate, + }) + + const setValue = useMemo(() => fieldHookResult.setValue, [fieldHookResult]) - const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing + const disabled = + readOnlyFromProps || + readOnlyFromContext || + fieldHookResult.formProcessing || + fieldHookResult.formInitializing const onChange = useCallback( (incomingValue) => { @@ -86,35 +81,31 @@ const UploadComponent: React.FC<UploadFieldProps> = (props) => { [setValue], ) - if (collection.upload) { + if (hasMany) { return ( - <UploadInput - Description={field?.admin?.components?.Description} - Error={field?.admin?.components?.Error} - Label={field?.admin?.components?.Label} - allowNewUpload={canCreate} - api={apiRoute} - className={className} - collection={collection} - descriptionProps={descriptionProps} - errorProps={errorProps} - filterOptions={filterOptions} - label={label} - labelProps={labelProps} + <UploadComponentHasMany + {...props} + canCreate={canCreate} + disabled={disabled} + // Note: the below TS error is thrown bc the field hook return result varies based on `hasMany` + // @ts-expect-error + fieldHookResult={fieldHookResult} onChange={onChange} - readOnly={disabled} - relationTo={relationTo} - required={required} - serverURL={serverURL} - showError={showError} - style={style} - value={value} - width={width} /> ) } - return null + return ( + <UploadComponentHasOne + {...props} + canCreate={canCreate} + disabled={disabled} + // Note: the below TS error is thrown bc the field hook return result varies based on `hasMany` + // @ts-expect-error + fieldHookResult={fieldHookResult} + onChange={onChange} + /> + ) } export const UploadField = withCondition(UploadComponent) diff --git a/packages/ui/src/forms/buildStateFromSchema/addFieldStatePromise.ts b/packages/ui/src/forms/buildStateFromSchema/addFieldStatePromise.ts index 42fba6b24e5..1fec00475ed 100644 --- a/packages/ui/src/forms/buildStateFromSchema/addFieldStatePromise.ts +++ b/packages/ui/src/forms/buildStateFromSchema/addFieldStatePromise.ts @@ -381,7 +381,7 @@ export const addFieldStatePromise = async (args: AddFieldStatePromiseArgs): Prom break } - + case 'upload': case 'relationship': { if (field.filterOptions) { if (typeof field.filterOptions === 'object') { @@ -467,41 +467,6 @@ export const addFieldStatePromise = async (args: AddFieldStatePromiseArgs): Prom break } - case 'upload': { - if (field.filterOptions) { - if (typeof field.filterOptions === 'object') { - fieldState.filterOptions = { - [field.relationTo]: field.filterOptions, - } - } - - if (typeof field.filterOptions === 'function') { - const query = await getFilterOptionsQuery(field.filterOptions, { - id, - data: fullData, - relationTo: field.relationTo, - siblingData: data, - user: req.user, - }) - - fieldState.filterOptions = query - } - } - - const relationshipValue = - data[field.name] && typeof data[field.name] === 'object' && 'id' in data[field.name] - ? data[field.name].id - : data[field.name] - fieldState.value = relationshipValue - fieldState.initialValue = relationshipValue - - if (!filter || filter(args)) { - state[`${path}${field.name}`] = fieldState - } - - break - } - default: { fieldState.value = data[field.name] fieldState.initialValue = data[field.name] diff --git a/packages/ui/src/providers/ListInfo/index.tsx b/packages/ui/src/providers/ListInfo/index.tsx index 79c1002fc80..a4acab574a9 100644 --- a/packages/ui/src/providers/ListInfo/index.tsx +++ b/packages/ui/src/providers/ListInfo/index.tsx @@ -9,8 +9,11 @@ export type ColumnPreferences = Pick<Column, 'accessor' | 'active'>[] export type ListInfoProps = { readonly Header?: React.ReactNode + readonly beforeActions?: React.ReactNode[] readonly collectionConfig: ClientConfig['collections'][0] readonly collectionSlug: SanitizedCollectionConfig['slug'] + readonly disableBulkDelete?: boolean + readonly disableBulkEdit?: boolean readonly hasCreatePermission: boolean readonly newDocumentURL: string readonly titleField?: FieldAffectingData @@ -18,7 +21,10 @@ export type ListInfoProps = { export type ListInfoContext = { readonly Header?: React.ReactNode + readonly beforeActions?: React.ReactNode[] readonly collectionSlug: string + readonly disableBulkDelete?: boolean + readonly disableBulkEdit?: boolean readonly hasCreatePermission: boolean readonly newDocumentURL: string } & ListInfoProps diff --git a/packages/ui/src/providers/Selection/index.tsx b/packages/ui/src/providers/Selection/index.tsx index 3d1f3649f61..4b3983eda86 100644 --- a/packages/ui/src/providers/Selection/index.tsx +++ b/packages/ui/src/providers/Selection/index.tsx @@ -16,6 +16,8 @@ export enum SelectAllStatus { type SelectionContext = { count: number + disableBulkDelete?: boolean + disableBulkEdit?: boolean getQueryParams: (additionalParams?: Where) => string selectAll: SelectAllStatus selected: Record<number | string, boolean> @@ -27,10 +29,11 @@ type SelectionContext = { const Context = createContext({} as SelectionContext) type Props = { - children: React.ReactNode - docs: any[] - totalDocs: number + readonly children: React.ReactNode + readonly docs: any[] + readonly totalDocs: number } + export const SelectionProvider: React.FC<Props> = ({ children, docs = [], totalDocs }) => { const contextRef = useRef({} as SelectionContext) diff --git a/test/fields/collections/UploadMulti/.gitignore b/test/fields/collections/UploadMulti/.gitignore new file mode 100644 index 00000000000..3f549faf910 --- /dev/null +++ b/test/fields/collections/UploadMulti/.gitignore @@ -0,0 +1 @@ +uploads diff --git a/test/fields/collections/UploadMulti/index.ts b/test/fields/collections/UploadMulti/index.ts new file mode 100644 index 00000000000..e0438365d49 --- /dev/null +++ b/test/fields/collections/UploadMulti/index.ts @@ -0,0 +1,21 @@ +import type { CollectionConfig } from 'payload' + +import { uploadsMulti, uploadsSlug } from '../../slugs.js' + +const Uploads: CollectionConfig = { + slug: uploadsMulti, + fields: [ + { + name: 'text', + type: 'text', + }, + { + name: 'media', + type: 'upload', + hasMany: true, + relationTo: uploadsSlug, + }, + ], +} + +export default Uploads diff --git a/test/fields/collections/UploadMulti/shared.ts b/test/fields/collections/UploadMulti/shared.ts new file mode 100644 index 00000000000..aa1f5c70dcd --- /dev/null +++ b/test/fields/collections/UploadMulti/shared.ts @@ -0,0 +1,5 @@ +import type { Upload } from '../../payload-types.js' + +export const uploadsDoc: Partial<Upload> = { + text: 'An upload here', +} diff --git a/test/fields/collections/UploadMultiPoly/.gitignore b/test/fields/collections/UploadMultiPoly/.gitignore new file mode 100644 index 00000000000..3f549faf910 --- /dev/null +++ b/test/fields/collections/UploadMultiPoly/.gitignore @@ -0,0 +1 @@ +uploads diff --git a/test/fields/collections/UploadMultiPoly/index.ts b/test/fields/collections/UploadMultiPoly/index.ts new file mode 100644 index 00000000000..00dfbace15d --- /dev/null +++ b/test/fields/collections/UploadMultiPoly/index.ts @@ -0,0 +1,21 @@ +import type { CollectionConfig } from 'payload' + +import { uploads2Slug, uploadsMultiPoly, uploadsSlug } from '../../slugs.js' + +const Uploads: CollectionConfig = { + slug: uploadsMultiPoly, + fields: [ + { + name: 'text', + type: 'text', + }, + { + name: 'media', + type: 'upload', + hasMany: true, + relationTo: [uploadsSlug, uploads2Slug], + }, + ], +} + +export default Uploads diff --git a/test/fields/collections/UploadMultiPoly/shared.ts b/test/fields/collections/UploadMultiPoly/shared.ts new file mode 100644 index 00000000000..aa1f5c70dcd --- /dev/null +++ b/test/fields/collections/UploadMultiPoly/shared.ts @@ -0,0 +1,5 @@ +import type { Upload } from '../../payload-types.js' + +export const uploadsDoc: Partial<Upload> = { + text: 'An upload here', +} diff --git a/test/fields/collections/UploadPoly/.gitignore b/test/fields/collections/UploadPoly/.gitignore new file mode 100644 index 00000000000..3f549faf910 --- /dev/null +++ b/test/fields/collections/UploadPoly/.gitignore @@ -0,0 +1 @@ +uploads diff --git a/test/fields/collections/UploadPoly/index.ts b/test/fields/collections/UploadPoly/index.ts new file mode 100644 index 00000000000..d53c3e5a107 --- /dev/null +++ b/test/fields/collections/UploadPoly/index.ts @@ -0,0 +1,20 @@ +import type { CollectionConfig } from 'payload' + +import { uploads2Slug, uploadsPoly, uploadsSlug } from '../../slugs.js' + +const Uploads: CollectionConfig = { + slug: uploadsPoly, + fields: [ + { + name: 'text', + type: 'text', + }, + { + name: 'media', + type: 'upload', + relationTo: [uploadsSlug, uploads2Slug], + }, + ], +} + +export default Uploads diff --git a/test/fields/collections/UploadPoly/shared.ts b/test/fields/collections/UploadPoly/shared.ts new file mode 100644 index 00000000000..aa1f5c70dcd --- /dev/null +++ b/test/fields/collections/UploadPoly/shared.ts @@ -0,0 +1,5 @@ +import type { Upload } from '../../payload-types.js' + +export const uploadsDoc: Partial<Upload> = { + text: 'An upload here', +} diff --git a/test/fields/config.ts b/test/fields/config.ts index e819672e6fd..7c5b7849fdf 100644 --- a/test/fields/config.ts +++ b/test/fields/config.ts @@ -33,6 +33,9 @@ import TextFields from './collections/Text/index.js' import UIFields from './collections/UI/index.js' import Uploads from './collections/Upload/index.js' import Uploads2 from './collections/Upload2/index.js' +import UploadsMulti from './collections/UploadMulti/index.js' +import UploadsMultiPoly from './collections/UploadMultiPoly/index.js' +import UploadsPoly from './collections/UploadPoly/index.js' import Uploads3 from './collections/Uploads3/index.js' import TabsWithRichText from './globals/TabsWithRichText.js' import { clearAndSeedEverything } from './seed.js' @@ -79,6 +82,9 @@ export const collectionSlugs: CollectionConfig[] = [ Uploads, Uploads2, Uploads3, + UploadsMulti, + UploadsPoly, + UploadsMultiPoly, UIFields, ] diff --git a/test/fields/payload-types.ts b/test/fields/payload-types.ts index 192ae24f4d0..dffca67267d 100644 --- a/test/fields/payload-types.ts +++ b/test/fields/payload-types.ts @@ -56,6 +56,9 @@ export interface Config { uploads: Upload; uploads2: Uploads2; uploads3: Uploads3; + 'uploads-multi': UploadsMulti; + 'uploads-poly': UploadsPoly; + 'uploads-multi-poly': UploadsMultiPoly; 'ui-fields': UiField; 'payload-preferences': PayloadPreference; 'payload-migrations': PayloadMigration; @@ -1311,7 +1314,7 @@ export interface TabsField { export interface Upload { id: string; text?: string | null; - media?: string | Upload | null; + media?: (string | null) | Upload; richText?: { root: { type: string; @@ -1346,7 +1349,7 @@ export interface Upload { export interface Uploads2 { id: string; text?: string | null; - media?: string | Uploads2 | null; + media?: (string | null) | Uploads2; updatedAt: string; createdAt: string; url?: string | null; @@ -1365,7 +1368,7 @@ export interface Uploads2 { */ export interface Uploads3 { id: string; - media?: string | Uploads3 | null; + media?: (string | null) | Uploads3; richText?: { root: { type: string; @@ -1393,6 +1396,58 @@ export interface Uploads3 { focalX?: number | null; focalY?: number | null; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "uploads-multi". + */ +export interface UploadsMulti { + id: string; + text?: string | null; + media?: (string | Upload)[] | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "uploads-poly". + */ +export interface UploadsPoly { + id: string; + text?: string | null; + media?: + | ({ + relationTo: 'uploads'; + value: string | Upload; + } | null) + | ({ + relationTo: 'uploads2'; + value: string | Uploads2; + } | null); + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "uploads-multi-poly". + */ +export interface UploadsMultiPoly { + id: string; + text?: string | null; + media?: + | ( + | { + relationTo: 'uploads'; + value: string | Upload; + } + | { + relationTo: 'uploads2'; + value: string | Uploads2; + } + )[] + | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "ui-fields". diff --git a/test/fields/seed.ts b/test/fields/seed.ts index 972414e5132..59fbda67f04 100644 --- a/test/fields/seed.ts +++ b/test/fields/seed.ts @@ -49,6 +49,10 @@ import { tabsFieldsSlug, textFieldsSlug, uiSlug, + uploads2Slug, + uploadsMulti, + uploadsMultiPoly, + uploadsPoly, uploadsSlug, usersSlug, } from './slugs.js' @@ -123,6 +127,50 @@ export const seed = async (_payload: Payload) => { overrideAccess: true, }) + // const createdJPGDocSlug2 = await _payload.create({ + // collection: uploads2Slug, + // data: { + // ...uploadsDoc, + // }, + // file: jpgFile, + // depth: 0, + // overrideAccess: true, + // }) + + // Create hasMany upload + await _payload.create({ + collection: uploadsMulti, + data: { + media: [createdPNGDoc.id, createdJPGDoc.id], + }, + }) + + // Create hasMany poly upload + // await _payload.create({ + // collection: uploadsMultiPoly, + // data: { + // media: [ + // { value: createdJPGDocSlug2.id, relationTo: uploads2Slug }, + // { value: createdJPGDoc.id, relationTo: uploadsSlug }, + // ], + // }, + // }) + + // Create poly upload + await _payload.create({ + collection: uploadsPoly, + data: { + media: { value: createdJPGDoc.id, relationTo: uploadsSlug }, + }, + }) + // Create poly upload + // await _payload.create({ + // collection: uploadsPoly, + // data: { + // media: { value: createdJPGDocSlug2.id, relationTo: uploads2Slug }, + // }, + // }) + const formattedID = _payload.db.defaultIDType === 'number' ? createdArrayDoc.id : `"${createdArrayDoc.id}"` diff --git a/test/fields/slugs.ts b/test/fields/slugs.ts index 1fa9de9b755..53258eed69f 100644 --- a/test/fields/slugs.ts +++ b/test/fields/slugs.ts @@ -26,6 +26,9 @@ export const textFieldsSlug = 'text-fields' export const uploadsSlug = 'uploads' export const uploads2Slug = 'uploads2' export const uploads3Slug = 'uploads3' +export const uploadsMulti = 'uploads-multi' +export const uploadsMultiPoly = 'uploads-multi-poly' +export const uploadsPoly = 'uploads-poly' export const uiSlug = 'ui-fields' export const collectionSlugs = [ diff --git a/test/uploads/payload-types.ts b/test/uploads/payload-types.ts index bb6d267390b..6cad1213a83 100644 --- a/test/uploads/payload-types.ts +++ b/test/uploads/payload-types.ts @@ -47,7 +47,7 @@ export interface Config { 'payload-migrations': PayloadMigration; }; db: { - defaultIDType: number; + defaultIDType: string; }; globals: {}; locale: null; @@ -78,9 +78,9 @@ export interface UserAuthOperations { * via the `definition` "relation". */ export interface Relation { - id: number; - image?: number | Media | null; - versionedImage?: number | Version | null; + id: string; + image?: (string | null) | Media; + versionedImage?: (string | null) | Version; updatedAt: string; createdAt: string; } @@ -89,7 +89,7 @@ export interface Relation { * via the `definition` "media". */ export interface Media { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -229,7 +229,7 @@ export interface Media { * via the `definition` "versions". */ export interface Version { - id: number; + id: string; title?: string | null; updatedAt: string; createdAt: string; @@ -249,8 +249,8 @@ export interface Version { * via the `definition` "audio". */ export interface Audio { - id: number; - audio?: number | Media | null; + id: string; + audio?: (string | null) | Media; updatedAt: string; createdAt: string; } @@ -259,7 +259,7 @@ export interface Audio { * via the `definition` "gif-resize". */ export interface GifResize { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -295,7 +295,7 @@ export interface GifResize { * via the `definition` "filename-compound-index". */ export interface FilenameCompoundIndex { - id: number; + id: string; alt?: string | null; updatedAt: string; createdAt: string; @@ -332,7 +332,7 @@ export interface FilenameCompoundIndex { * via the `definition` "no-image-sizes". */ export interface NoImageSize { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -350,7 +350,7 @@ export interface NoImageSize { * via the `definition` "object-fit". */ export interface ObjectFit { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -402,7 +402,7 @@ export interface ObjectFit { * via the `definition` "with-meta-data". */ export interface WithMetaDatum { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -430,7 +430,7 @@ export interface WithMetaDatum { * via the `definition` "without-meta-data". */ export interface WithoutMetaDatum { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -458,7 +458,7 @@ export interface WithoutMetaDatum { * via the `definition` "with-only-jpeg-meta-data". */ export interface WithOnlyJpegMetaDatum { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -486,7 +486,7 @@ export interface WithOnlyJpegMetaDatum { * via the `definition` "crop-only". */ export interface CropOnly { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -530,7 +530,7 @@ export interface CropOnly { * via the `definition` "focal-only". */ export interface FocalOnly { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -574,7 +574,7 @@ export interface FocalOnly { * via the `definition` "focal-no-sizes". */ export interface FocalNoSize { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -592,7 +592,7 @@ export interface FocalNoSize { * via the `definition` "animated-type-media". */ export interface AnimatedTypeMedia { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -644,7 +644,7 @@ export interface AnimatedTypeMedia { * via the `definition` "enlarge". */ export interface Enlarge { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -704,7 +704,7 @@ export interface Enlarge { * via the `definition` "reduce". */ export interface Reduce { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -756,7 +756,7 @@ export interface Reduce { * via the `definition` "media-trim". */ export interface MediaTrim { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -800,7 +800,7 @@ export interface MediaTrim { * via the `definition` "custom-file-name-media". */ export interface CustomFileNameMedia { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -828,7 +828,7 @@ export interface CustomFileNameMedia { * via the `definition` "unstored-media". */ export interface UnstoredMedia { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -846,7 +846,7 @@ export interface UnstoredMedia { * via the `definition` "externally-served-media". */ export interface ExternallyServedMedia { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -864,8 +864,8 @@ export interface ExternallyServedMedia { * via the `definition` "uploads-1". */ export interface Uploads1 { - id: number; - media?: number | Uploads2 | null; + id: string; + media?: (string | null) | Uploads2; richText?: { root: { type: string; @@ -898,7 +898,7 @@ export interface Uploads1 { * via the `definition` "uploads-2". */ export interface Uploads2 { - id: number; + id: string; title?: string | null; updatedAt: string; createdAt: string; @@ -917,7 +917,7 @@ export interface Uploads2 { * via the `definition` "admin-thumbnail-function". */ export interface AdminThumbnailFunction { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -935,7 +935,7 @@ export interface AdminThumbnailFunction { * via the `definition` "admin-thumbnail-size". */ export interface AdminThumbnailSize { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -971,7 +971,7 @@ export interface AdminThumbnailSize { * via the `definition` "optional-file". */ export interface OptionalFile { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -989,7 +989,7 @@ export interface OptionalFile { * via the `definition` "required-file". */ export interface RequiredFile { - id: number; + id: string; updatedAt: string; createdAt: string; url?: string | null; @@ -1007,7 +1007,7 @@ export interface RequiredFile { * via the `definition` "custom-upload-field". */ export interface CustomUploadField { - id: number; + id: string; alt?: string | null; updatedAt: string; createdAt: string; @@ -1026,7 +1026,7 @@ export interface CustomUploadField { * via the `definition` "media-with-relation-preview". */ export interface MediaWithRelationPreview { - id: number; + id: string; title?: string | null; updatedAt: string; createdAt: string; @@ -1045,7 +1045,7 @@ export interface MediaWithRelationPreview { * via the `definition` "media-without-relation-preview". */ export interface MediaWithoutRelationPreview { - id: number; + id: string; title?: string | null; updatedAt: string; createdAt: string; @@ -1064,13 +1064,13 @@ export interface MediaWithoutRelationPreview { * via the `definition` "relation-preview". */ export interface RelationPreview { - id: number; - imageWithPreview1?: number | MediaWithRelationPreview | null; - imageWithPreview2?: number | MediaWithRelationPreview | null; - imageWithoutPreview1?: number | MediaWithRelationPreview | null; - imageWithoutPreview2?: number | MediaWithoutRelationPreview | null; - imageWithPreview3?: number | MediaWithoutRelationPreview | null; - imageWithoutPreview3?: number | MediaWithoutRelationPreview | null; + id: string; + imageWithPreview1?: (string | null) | MediaWithRelationPreview; + imageWithPreview2?: (string | null) | MediaWithRelationPreview; + imageWithoutPreview1?: (string | null) | MediaWithRelationPreview; + imageWithoutPreview2?: (string | null) | MediaWithoutRelationPreview; + imageWithPreview3?: (string | null) | MediaWithoutRelationPreview; + imageWithoutPreview3?: (string | null) | MediaWithoutRelationPreview; updatedAt: string; createdAt: string; } @@ -1079,7 +1079,7 @@ export interface RelationPreview { * via the `definition` "users". */ export interface User { - id: number; + id: string; updatedAt: string; createdAt: string; email: string; @@ -1096,10 +1096,10 @@ export interface User { * via the `definition` "payload-preferences". */ export interface PayloadPreference { - id: number; + id: string; user: { relationTo: 'users'; - value: number | User; + value: string | User; }; key?: string | null; value?: @@ -1119,7 +1119,7 @@ export interface PayloadPreference { * via the `definition` "payload-migrations". */ export interface PayloadMigration { - id: number; + id: string; name?: string | null; batch?: number | null; updatedAt: string;
f0ea9185ef4fe3b8242be640fde88a6f99f0980c
2025-03-05 07:53:03
Sasha
chore: indexes are not iterable, corrects `indexes` default value sanitization (#11534)
false
indexes are not iterable, corrects `indexes` default value sanitization (#11534)
chore
diff --git a/packages/payload/src/collections/config/defaults.ts b/packages/payload/src/collections/config/defaults.ts index 32116883201..eb338df75ee 100644 --- a/packages/payload/src/collections/config/defaults.ts +++ b/packages/payload/src/collections/config/defaults.ts @@ -108,6 +108,8 @@ export const addDefaultsToCollectionConfig = (collection: CollectionConfig): Col collection.upload = collection.upload ?? false collection.versions = collection.versions ?? false + collection.indexes = collection.indexes ?? [] + return collection } diff --git a/packages/payload/src/collections/config/sanitize.ts b/packages/payload/src/collections/config/sanitize.ts index c97ad6d57e9..ae622932891 100644 --- a/packages/payload/src/collections/config/sanitize.ts +++ b/packages/payload/src/collections/config/sanitize.ts @@ -2,7 +2,6 @@ import type { Config, SanitizedConfig } from '../../config/types.js' import type { CollectionConfig, - CompoundIndex, SanitizedCollectionConfig, SanitizedJoin, SanitizedJoins,
312dca003bac5b95517ed730b53c7870315f1f8e
2024-04-11 02:02:19
Elliot DeNolf
feat(cpa): CJS next config AST parsing
false
CJS next config AST parsing
feat
diff --git a/packages/create-payload-app/src/lib/init-next.ts b/packages/create-payload-app/src/lib/init-next.ts index f7c1e980f9d..afdf23609dd 100644 --- a/packages/create-payload-app/src/lib/init-next.ts +++ b/packages/create-payload-app/src/lib/init-next.ts @@ -4,6 +4,7 @@ import * as p from '@clack/prompts' import { parse, stringify } from 'comment-json' import execa from 'execa' import fs from 'fs' +import fse from 'fs-extra' import globby from 'globby' import path from 'path' import { promisify } from 'util' @@ -31,6 +32,8 @@ type InitNextArgs = Pick<CliArgs, '--debug'> & { useDistFiles?: boolean } +type NextConfigType = 'cjs' | 'esm' + type InitNextResult = | { isSrcDir: boolean @@ -45,11 +48,22 @@ export async function initNext(args: InitNextArgs): Promise<InitNextResult> { const nextAppDetails = args.nextAppDetails || (await getNextAppDetails(projectDir)) - const { hasTopLevelLayout, isSrcDir, nextAppDir } = - nextAppDetails || (await getNextAppDetails(projectDir)) + if (!nextAppDetails.nextAppDir) { + warning(`Could not find app directory in ${projectDir}, creating...`) + const createdAppDir = path.resolve(projectDir, nextAppDetails.isSrcDir ? 'src/app' : 'app') + fse.mkdirSync(createdAppDir, { recursive: true }) + nextAppDetails.nextAppDir = createdAppDir + } + + const { hasTopLevelLayout, isSrcDir, nextAppDir, nextConfigType } = nextAppDetails - if (!nextAppDir) { - return { isSrcDir, reason: `Could not find app directory in ${projectDir}`, success: false } + if (!nextConfigType) { + return { + isSrcDir, + nextAppDir, + reason: `Could not determine Next Config type in ${projectDir}. Possibly try renaming next.config.js to next.config.cjs or next.config.mjs.`, + success: false, + } } if (hasTopLevelLayout) { @@ -69,6 +83,7 @@ export async function initNext(args: InitNextArgs): Promise<InitNextResult> { const configurationResult = installAndConfigurePayload({ ...args, nextAppDetails, + nextConfigType, useDistFiles: true, // Requires running 'pnpm pack-template-files' in cpa }) @@ -96,6 +111,13 @@ export async function initNext(args: InitNextArgs): Promise<InitNextResult> { async function addPayloadConfigToTsConfig(projectDir: string, isSrcDir: boolean) { const tsConfigPath = path.resolve(projectDir, 'tsconfig.json') + + // Check if tsconfig.json exists + if (!fs.existsSync(tsConfigPath)) { + warning(`Could not find tsconfig.json to add @payload-config path.`) + return + } + const userTsConfigContent = await readFile(tsConfigPath, { encoding: 'utf8', }) @@ -119,13 +141,18 @@ async function addPayloadConfigToTsConfig(projectDir: string, isSrcDir: boolean) } function installAndConfigurePayload( - args: InitNextArgs & { nextAppDetails: NextAppDetails; useDistFiles?: boolean }, + args: InitNextArgs & { + nextAppDetails: NextAppDetails + nextConfigType: NextConfigType + useDistFiles?: boolean + }, ): | { payloadConfigPath: string; success: true } | { payloadConfigPath?: string; reason: string; success: false } { const { '--debug': debug, nextAppDetails: { isSrcDir, nextAppDir, nextConfigPath } = {}, + nextConfigType, projectDir, useDistFiles, } = args @@ -172,6 +199,7 @@ function installAndConfigurePayload( logDebug(`nextAppDir: ${nextAppDir}`) logDebug(`projectDir: ${projectDir}`) logDebug(`nextConfigPath: ${nextConfigPath}`) + logDebug(`payloadConfigPath: ${path.resolve(projectDir, 'payload.config.ts')}`) logDebug( `isSrcDir: ${isSrcDir}. source: ${templateSrcDir}. dest: ${path.dirname(nextConfigPath)}`, @@ -181,7 +209,7 @@ function installAndConfigurePayload( copyRecursiveSync(templateSrcDir, path.dirname(nextConfigPath), debug) // Wrap next.config.js with withPayload - wrapNextConfig({ nextConfigPath }) + wrapNextConfig({ nextConfigPath, nextConfigType }) return { payloadConfigPath: path.resolve(nextAppDir, '../payload.config.ts'), @@ -226,6 +254,7 @@ type NextAppDetails = { isSrcDir: boolean nextAppDir?: string nextConfigPath?: string + nextConfigType?: NextConfigType } export async function getNextAppDetails(projectDir: string): Promise<NextAppDetails> { @@ -246,6 +275,7 @@ export async function getNextAppDetails(projectDir: string): Promise<NextAppDeta await globby(['**/app'], { absolute: true, cwd: projectDir, + ignore: ['**/node_modules/**'], onlyDirectories: true, }) )?.[0] @@ -254,9 +284,31 @@ export async function getNextAppDetails(projectDir: string): Promise<NextAppDeta nextAppDir = undefined } + const configType = await getProjectType(projectDir, nextConfigPath) + const hasTopLevelLayout = nextAppDir ? fs.existsSync(path.resolve(nextAppDir, 'layout.tsx')) : false - return { hasTopLevelLayout, isSrcDir, nextAppDir, nextConfigPath } + return { hasTopLevelLayout, isSrcDir, nextAppDir, nextConfigPath, nextConfigType: configType } +} + +async function getProjectType(projectDir: string, nextConfigPath: string): Promise<'cjs' | 'esm'> { + if (nextConfigPath.endsWith('.mjs')) { + return 'esm' + } + if (nextConfigPath.endsWith('.cjs')) { + return 'cjs' + } + + const packageObj = await fse.readJson(path.resolve(projectDir, 'package.json')) + const packageJsonType = packageObj.type + if (packageJsonType === 'module') { + return 'esm' + } + if (packageJsonType === 'commonjs') { + return 'cjs' + } + + return 'cjs' } diff --git a/packages/create-payload-app/src/lib/wrap-next-config.spec.ts b/packages/create-payload-app/src/lib/wrap-next-config.spec.ts index be41216f0f0..968b8a79ef4 100644 --- a/packages/create-payload-app/src/lib/wrap-next-config.spec.ts +++ b/packages/create-payload-app/src/lib/wrap-next-config.spec.ts @@ -1,61 +1,133 @@ -import { parseAndModifyConfigContent, withPayloadImportStatement } from './wrap-next-config.js' +import { parseAndModifyConfigContent, withPayloadStatement } from './wrap-next-config.js' import * as p from '@clack/prompts' -const defaultNextConfig = `/** @type {import('next').NextConfig} */ +const esmConfigs = { + defaultNextConfig: `/** @type {import('next').NextConfig} */ const nextConfig = {}; - export default nextConfig; -` - -const nextConfigWithFunc = `const nextConfig = { - // Your Next.js config here -} - -export default someFunc(nextConfig) -` -const nextConfigWithFuncMultiline = `const nextConfig = { - // Your Next.js config here -} - +`, + nextConfigWithFunc: `const nextConfig = {}; +export default someFunc(nextConfig); +`, + nextConfigWithFuncMultiline: `const nextConfig = {};; export default someFunc( nextConfig -) -` +); +`, + nextConfigExportNamedDefault: `const nextConfig = {}; +const wrapped = someFunc(asdf); +export { wrapped as default }; +`, +} -const nextConfigExportNamedDefault = `const nextConfig = { - // Your Next.js config here +const cjsConfigs = { + defaultNextConfig: ` + /** @type {import('next').NextConfig} */ +const nextConfig = {}; +module.exports = nextConfig; +`, + anonConfig: `module.exports = {};`, + nextConfigWithFunc: `const nextConfig = {}; +module.exports = someFunc(nextConfig); +`, + nextConfigWithFuncMultiline: `const nextConfig = {}; +module.exports = someFunc( + nextConfig +); +`, + nextConfigExportNamedDefault: `const nextConfig = {}; +const wrapped = someFunc(asdf); +module.exports = wrapped; +`, } -const wrapped = someFunc(asdf) -export { wrapped as default } -` describe('parseAndInsertWithPayload', () => { - it('should parse the default next config', () => { - const { modifiedConfigContent } = parseAndModifyConfigContent(defaultNextConfig) - expect(modifiedConfigContent).toContain(withPayloadImportStatement) - expect(modifiedConfigContent).toContain('withPayload(nextConfig)') - }) - it('should parse the config with a function', () => { - const { modifiedConfigContent } = parseAndModifyConfigContent(nextConfigWithFunc) - expect(modifiedConfigContent).toContain('withPayload(someFunc(nextConfig))') - }) + describe('esm', () => { + const configType = 'esm' + const importStatement = withPayloadStatement[configType] + it('should parse the default next config', () => { + const { modifiedConfigContent } = parseAndModifyConfigContent( + esmConfigs.defaultNextConfig, + configType, + ) + expect(modifiedConfigContent).toContain(importStatement) + expect(modifiedConfigContent).toContain('withPayload(nextConfig)') + }) + it('should parse the config with a function', () => { + const { modifiedConfigContent } = parseAndModifyConfigContent( + esmConfigs.nextConfigWithFunc, + configType, + ) + expect(modifiedConfigContent).toContain('withPayload(someFunc(nextConfig))') + }) - it('should parse the config with a function on a new line', () => { - const { modifiedConfigContent } = parseAndModifyConfigContent(nextConfigWithFuncMultiline) - expect(modifiedConfigContent).toContain(withPayloadImportStatement) - expect(modifiedConfigContent).toMatch(/withPayload\(someFunc\(\n nextConfig\n\)\)/) - }) + it('should parse the config with a function on a new line', () => { + const { modifiedConfigContent } = parseAndModifyConfigContent( + esmConfigs.nextConfigWithFuncMultiline, + configType, + ) + expect(modifiedConfigContent).toContain(importStatement) + expect(modifiedConfigContent).toMatch(/withPayload\(someFunc\(\n nextConfig\n\)\)/) + }) + + // Unsupported: export { wrapped as default } + it('should give warning with a named export as default', () => { + const warnLogSpy = jest.spyOn(p.log, 'warn').mockImplementation(() => {}) - // Unsupported: export { wrapped as default } - it('should give warning with a named export as default', () => { - const warnLogSpy = jest.spyOn(p.log, 'warn').mockImplementation(() => {}) + const { modifiedConfigContent, success } = parseAndModifyConfigContent( + esmConfigs.nextConfigExportNamedDefault, + configType, + ) + expect(modifiedConfigContent).toContain(importStatement) + expect(success).toBe(false) - const { modifiedConfigContent, success } = parseAndModifyConfigContent( - nextConfigExportNamedDefault, - ) - expect(modifiedConfigContent).toContain(withPayloadImportStatement) - expect(success).toBe(false) + expect(warnLogSpy).toHaveBeenCalledWith( + expect.stringContaining('Could not automatically wrap'), + ) + }) + }) - expect(warnLogSpy).toHaveBeenCalledWith(expect.stringContaining('Could not automatically wrap')) + describe('cjs', () => { + const configType = 'cjs' + const requireStatement = withPayloadStatement[configType] + it('should parse the default next config', () => { + const { modifiedConfigContent } = parseAndModifyConfigContent( + cjsConfigs.defaultNextConfig, + configType, + ) + expect(modifiedConfigContent).toContain(requireStatement) + expect(modifiedConfigContent).toContain('withPayload(nextConfig)') + }) + it('should parse anonymous default config', () => { + const { modifiedConfigContent } = parseAndModifyConfigContent( + cjsConfigs.anonConfig, + configType, + ) + expect(modifiedConfigContent).toContain(requireStatement) + expect(modifiedConfigContent).toContain('withPayload({})') + }) + it('should parse the config with a function', () => { + const { modifiedConfigContent } = parseAndModifyConfigContent( + cjsConfigs.nextConfigWithFunc, + configType, + ) + expect(modifiedConfigContent).toContain('withPayload(someFunc(nextConfig))') + }) + it('should parse the config with a function on a new line', () => { + const { modifiedConfigContent } = parseAndModifyConfigContent( + cjsConfigs.nextConfigWithFuncMultiline, + configType, + ) + expect(modifiedConfigContent).toContain(requireStatement) + expect(modifiedConfigContent).toMatch(/withPayload\(someFunc\(\n nextConfig\n\)\)/) + }) + it('should parse the config with a named export as default', () => { + const { modifiedConfigContent } = parseAndModifyConfigContent( + cjsConfigs.nextConfigExportNamedDefault, + configType, + ) + expect(modifiedConfigContent).toContain(requireStatement) + expect(modifiedConfigContent).toContain('withPayload(wrapped)') + }) }) }) diff --git a/packages/create-payload-app/src/lib/wrap-next-config.ts b/packages/create-payload-app/src/lib/wrap-next-config.ts index 93722e0c37d..ccc6ecdb98d 100644 --- a/packages/create-payload-app/src/lib/wrap-next-config.ts +++ b/packages/create-payload-app/src/lib/wrap-next-config.ts @@ -5,12 +5,23 @@ import fs from 'fs' import { warning } from '../utils/log.js' import { log } from '../utils/log.js' -export const withPayloadImportStatement = `import { withPayload } from '@payloadcms/next'\n` +export const withPayloadStatement = { + cjs: `const { withPayload } = require('@payloadcms/next/withPayload')\n`, + esm: `import { withPayload } from '@payloadcms/next/withPayload'\n`, +} + +type NextConfigType = 'cjs' | 'esm' -export const wrapNextConfig = (args: { nextConfigPath: string }) => { - const { nextConfigPath } = args +export const wrapNextConfig = (args: { + nextConfigPath: string + nextConfigType: NextConfigType +}) => { + const { nextConfigPath, nextConfigType: configType } = args const configContent = fs.readFileSync(nextConfigPath, 'utf8') - const { modifiedConfigContent: newConfig, success } = parseAndModifyConfigContent(configContent) + const { modifiedConfigContent: newConfig, success } = parseAndModifyConfigContent( + configContent, + configType, + ) if (!success) { return @@ -22,72 +33,110 @@ export const wrapNextConfig = (args: { nextConfigPath: string }) => { /** * Parses config content with AST and wraps it with withPayload function */ -export function parseAndModifyConfigContent(content: string): { - modifiedConfigContent: string - success: boolean -} { - content = withPayloadImportStatement + content +export function parseAndModifyConfigContent( + content: string, + configType: NextConfigType, +): { modifiedConfigContent: string; success: boolean } { + content = withPayloadStatement[configType] + content const ast = parseModule(content, { loc: true }) - const exportDefaultDeclaration = ast.body.find((p) => p.type === 'ExportDefaultDeclaration') as - | Directive - | undefined - const exportNamedDeclaration = ast.body.find((p) => p.type === 'ExportNamedDeclaration') as - | ExportNamedDeclaration - | undefined + if (configType === 'esm') { + const exportDefaultDeclaration = ast.body.find((p) => p.type === 'ExportDefaultDeclaration') as + | Directive + | undefined - if (!exportDefaultDeclaration && !exportNamedDeclaration) { - throw new Error('Could not find ExportDefaultDeclaration in next.config.js') - } + const exportNamedDeclaration = ast.body.find((p) => p.type === 'ExportNamedDeclaration') as + | ExportNamedDeclaration + | undefined + + if (!exportDefaultDeclaration && !exportNamedDeclaration) { + throw new Error('Could not find ExportDefaultDeclaration in next.config.js') + } - if (exportDefaultDeclaration && exportDefaultDeclaration.declaration?.loc) { - const modifiedConfigContent = insertBeforeAndAfter( - content, - exportDefaultDeclaration.declaration.loc, - ) - return { modifiedConfigContent, success: true } - } else if (exportNamedDeclaration) { - const exportSpecifier = exportNamedDeclaration.specifiers.find( - (s) => - s.type === 'ExportSpecifier' && - s.exported?.name === 'default' && - s.local?.type === 'Identifier' && - s.local?.name, - ) - - if (exportSpecifier) { - warning('Could not automatically wrap next.config.js with withPayload.') - warning('Automatic wrapping of named exports as default not supported yet.') - - warnUserWrapNotSuccessful() - return { - modifiedConfigContent: content, - success: false, + if (exportDefaultDeclaration && exportDefaultDeclaration.declaration?.loc) { + const modifiedConfigContent = insertBeforeAndAfter( + content, + exportDefaultDeclaration.declaration.loc, + configType, + ) + return { modifiedConfigContent, success: true } + } else if (exportNamedDeclaration) { + const exportSpecifier = exportNamedDeclaration.specifiers.find( + (s) => + s.type === 'ExportSpecifier' && + s.exported?.name === 'default' && + s.local?.type === 'Identifier' && + s.local?.name, + ) + + if (exportSpecifier) { + warning('Could not automatically wrap next.config.js with withPayload.') + warning('Automatic wrapping of named exports as default not supported yet.') + + warnUserWrapNotSuccessful(configType) + return { + modifiedConfigContent: content, + success: false, + } } } + + warning('Could not automatically wrap Next config with withPayload.') + warnUserWrapNotSuccessful(configType) + return { + modifiedConfigContent: content, + success: false, + } + } else if (configType === 'cjs') { + // Find `module.exports = X` + const moduleExports = ast.body.find( + (p) => + p.type === 'ExpressionStatement' && + p.expression?.type === 'AssignmentExpression' && + p.expression.left?.type === 'MemberExpression' && + p.expression.left.object?.type === 'Identifier' && + p.expression.left.object.name === 'module' && + p.expression.left.property?.type === 'Identifier' && + p.expression.left.property.name === 'exports', + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ) as any + + if (moduleExports && moduleExports.expression.right?.loc) { + const modifiedConfigContent = insertBeforeAndAfter( + content, + moduleExports.expression.right.loc, + configType, + ) + return { modifiedConfigContent, success: true } + } + + return { + modifiedConfigContent: content, + success: false, + } } - warning('Could not automatically wrap next.config.js with withPayload.') - warnUserWrapNotSuccessful() + warning('Could not automatically wrap Next config with withPayload.') + warnUserWrapNotSuccessful(configType) return { modifiedConfigContent: content, success: false, } } -function warnUserWrapNotSuccessful() { +function warnUserWrapNotSuccessful(configType: NextConfigType) { // Output directions for user to update next.config.js const withPayloadMessage = ` ${chalk.bold(`Please manually wrap your existing next.config.js with the withPayload function. Here is an example:`)} - import withPayload from '@payloadcms/next/withPayload' + ${withPayloadStatement[configType]} const nextConfig = { // Your Next.js config here } - export default withPayload(nextConfig) + ${configType === 'esm' ? 'export default withPayload(nextConfig)' : 'module.exports = withPayload(nextConfig)'} ` @@ -125,7 +174,7 @@ type Loc = { start: { column: number; line: number } } -function insertBeforeAndAfter(content: string, loc: Loc) { +function insertBeforeAndAfter(content: string, loc: Loc, configType: NextConfigType) { const { end, start } = loc const lines = content.split('\n')
0a42281de32815b5d344715e59d50eb115ef8adf
2024-06-28 01:52:10
Alessio Gravili
feat(richtext-lexical): new FieldsDrawer utility
false
new FieldsDrawer utility
feat
diff --git a/packages/richtext-lexical/src/exports/client/index.ts b/packages/richtext-lexical/src/exports/client/index.ts index 14140248fb9..45341c7920b 100644 --- a/packages/richtext-lexical/src/exports/client/index.ts +++ b/packages/richtext-lexical/src/exports/client/index.ts @@ -123,3 +123,5 @@ export { $isBlockNode, BlockNode, } from '../../features/blocks/nodes/BlocksNode.js' + +export { FieldsDrawer } from '../../utilities/fieldsDrawer/Drawer.js' diff --git a/packages/richtext-lexical/src/features/link/drawer/index.scss b/packages/richtext-lexical/src/features/link/drawer/index.scss deleted file mode 100644 index 0f502fff6fd..00000000000 --- a/packages/richtext-lexical/src/features/link/drawer/index.scss +++ /dev/null @@ -1,50 +0,0 @@ -@import '../../../scss/styles.scss'; - -.lexical-link-edit-drawer { - &__template { - position: relative; - z-index: 1; - padding-top: var(--base); - padding-bottom: calc(var(--base) * 2); - } - - &__header { - width: 100%; - margin-bottom: var(--base); - display: flex; - justify-content: space-between; - margin-top: calc(var(--base) * 2.5); - margin-bottom: var(--base); - - @include mid-break { - margin-top: calc(var(--base) * 1.5); - } - } - - &__header-text { - margin: 0; - } - - &__header-close { - border: 0; - background-color: transparent; - padding: 0; - cursor: pointer; - overflow: hidden; - width: var(--base); - height: var(--base); - - svg { - width: calc(var(--base) * 2.75); - height: calc(var(--base) * 2.75); - position: relative; - left: calc(var(--base) * -0.825); - top: calc(var(--base) * -0.825); - - .stroke { - stroke-width: 2px; - vector-effect: non-scaling-stroke; - } - } - } -} diff --git a/packages/richtext-lexical/src/features/link/drawer/types.ts b/packages/richtext-lexical/src/features/link/drawer/types.ts deleted file mode 100644 index cb85606ab58..00000000000 --- a/packages/richtext-lexical/src/features/link/drawer/types.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { FormState } from 'payload' - -import type { LinkFields } from '../nodes/types.js' - -export interface Props { - drawerSlug: string - handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void - stateData: {} | (LinkFields & { text: string }) -} diff --git a/packages/richtext-lexical/src/features/link/plugins/floatingLinkEditor/LinkEditor/index.tsx b/packages/richtext-lexical/src/features/link/plugins/floatingLinkEditor/LinkEditor/index.tsx index 38cc318dec7..8839fed388c 100644 --- a/packages/richtext-lexical/src/features/link/plugins/floatingLinkEditor/LinkEditor/index.tsx +++ b/packages/richtext-lexical/src/features/link/plugins/floatingLinkEditor/LinkEditor/index.tsx @@ -24,7 +24,7 @@ import type { LinkPayload } from '../types.js' import { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js' import { getSelectedNode } from '../../../../../lexical/utils/getSelectedNode.js' import { setFloatingElemPositionForLinkEditor } from '../../../../../lexical/utils/setFloatingElemPositionForLinkEditor.js' -import { LinkDrawer } from '../../../drawer/index.js' +import { FieldsDrawer } from '../../../../../utilities/fieldsDrawer/Drawer.js' import { $isAutoLinkNode } from '../../../nodes/AutoLinkNode.js' import { $createLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND } from '../../../nodes/LinkNode.js' import { TOGGLE_LINK_WITH_MODAL_COMMAND } from './commands.js' @@ -44,7 +44,7 @@ export function LinkEditor({ anchorElem }: { anchorElem: HTMLElement }): React.R const [stateData, setStateData] = useState<{} | (LinkFields & { id?: string; text: string })>({}) - const { closeModal, isModalOpen, toggleModal } = useModal() + const { closeModal, toggleModal } = useModal() const editDepth = useEditDepth() const [isLink, setIsLink] = useState(false) const [selectedNodes, setSelectedNodes] = useState<LexicalNode[]>([]) @@ -312,50 +312,52 @@ export function LinkEditor({ anchorElem }: { anchorElem: HTMLElement }): React.R )} </div> </div> - {isModalOpen(drawerSlug) && ( - <LinkDrawer - drawerSlug={drawerSlug} - handleModalSubmit={(fields: FormState, data: Data) => { - closeModal(drawerSlug) - - const newLinkPayload = data as LinkFields & { text: string } - - const bareLinkFields: LinkFields = { - ...newLinkPayload, - } - delete bareLinkFields.text - - // See: https://github.com/facebook/lexical/pull/5536. This updates autolink nodes to link nodes whenever a change was made (which is good!). - editor.update(() => { - const selection = $getSelection() - let linkParent = null - if ($isRangeSelection(selection)) { - linkParent = getSelectedNode(selection).getParent() - } else { - if (selectedNodes.length) { - linkParent = selectedNodes[0].getParent() - } + <FieldsDrawer + className="lexical-link-edit-drawer" + data={stateData} + drawerSlug={drawerSlug} + drawerTitle={t('fields:editLink')} + featureKey="link" + handleDrawerSubmit={(fields: FormState, data: Data) => { + closeModal(drawerSlug) + + const newLinkPayload = data as LinkFields & { text: string } + + const bareLinkFields: LinkFields = { + ...newLinkPayload, + } + delete bareLinkFields.text + + // See: https://github.com/facebook/lexical/pull/5536. This updates autolink nodes to link nodes whenever a change was made (which is good!). + editor.update(() => { + const selection = $getSelection() + let linkParent = null + if ($isRangeSelection(selection)) { + linkParent = getSelectedNode(selection).getParent() + } else { + if (selectedNodes.length) { + linkParent = selectedNodes[0].getParent() } + } - if (linkParent && $isAutoLinkNode(linkParent)) { - const linkNode = $createLinkNode({ - fields: bareLinkFields, - }) - linkParent.replace(linkNode, true) - } - }) - - // Needs to happen AFTER a potential auto link => link node conversion, as otherwise, the updated text to display may be lost due to - // it being applied to the auto link node instead of the link node. - editor.dispatchCommand(TOGGLE_LINK_COMMAND, { - fields: bareLinkFields, - selectedNodes, - text: newLinkPayload.text, - }) - }} - stateData={stateData} - /> - )} + if (linkParent && $isAutoLinkNode(linkParent)) { + const linkNode = $createLinkNode({ + fields: bareLinkFields, + }) + linkParent.replace(linkNode, true) + } + }) + + // Needs to happen AFTER a potential auto link => link node conversion, as otherwise, the updated text to display may be lost due to + // it being applied to the auto link node instead of the link node. + editor.dispatchCommand(TOGGLE_LINK_COMMAND, { + fields: bareLinkFields, + selectedNodes, + text: newLinkPayload.text, + }) + }} + schemaPathSuffix="fields" + /> </React.Fragment> ) } diff --git a/packages/richtext-lexical/src/features/upload/component/ExtraFieldsDrawer/index.tsx b/packages/richtext-lexical/src/features/upload/component/ExtraFieldsDrawer/index.tsx deleted file mode 100644 index 3eac8c64a25..00000000000 --- a/packages/richtext-lexical/src/features/upload/component/ExtraFieldsDrawer/index.tsx +++ /dev/null @@ -1,149 +0,0 @@ -'use client' -import type { FormProps } from '@payloadcms/ui' -import type { ClientCollectionConfig, FormState } from 'payload' - -import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js' -import { getTranslation } from '@payloadcms/translations' -import { - Drawer, - Form, - FormSubmit, - RenderFields, - useConfig, - useDocumentInfo, - useFieldProps, - useModal, - useTranslation, -} from '@payloadcms/ui' -import { getFormState } from '@payloadcms/ui/shared' -import { $getNodeByKey } from 'lexical' -import { deepCopyObject } from 'payload/shared' -import React, { useCallback, useEffect, useState } from 'react' -import { v4 as uuid } from 'uuid' - -import type { UploadData, UploadNode } from '../../nodes/UploadNode.js' -import type { ElementProps } from '../index.js' - -import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js' - -/** - * This handles the extra fields, e.g. captions or alt text, which are - * potentially added to the upload feature. - */ -export const ExtraFieldsUploadDrawer: React.FC< - ElementProps & { - drawerSlug: string - relatedCollection: ClientCollectionConfig - } -> = (props) => { - const { - data: { fields, relationTo, value }, - drawerSlug, - nodeKey, - relatedCollection, - } = props - - const [editor] = useLexicalComposerContext() - - const { closeModal } = useModal() - - const { i18n, t } = useTranslation() - const { id } = useDocumentInfo() - const { schemaPath } = useFieldProps() - const config = useConfig() - const [initialState, setInitialState] = useState<FormState | false>(false) - const { - field: { richTextComponentMap }, - } = useEditorConfigContext() - - const componentMapRenderedFieldsPath = `feature.upload.fields.${relatedCollection.slug}` - const schemaFieldsPath = `${schemaPath}.feature.upload.${relatedCollection.slug}` - - const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema - - useEffect(() => { - const awaitInitialState = async () => { - const state = await getFormState({ - apiRoute: config.routes.api, - body: { - id, - data: deepCopyObject(fields || {}), - operation: 'update', - schemaPath: schemaFieldsPath, - }, - serverURL: config.serverURL, - }) // Form State - - setInitialState(state) - } - - void awaitInitialState() - }, [config.routes.api, config.serverURL, schemaFieldsPath, id, fields]) - - const onChange: FormProps['onChange'][0] = useCallback( - async ({ formState: prevFormState }) => { - return await getFormState({ - apiRoute: config.routes.api, - body: { - id, - formState: prevFormState, - operation: 'update', - schemaPath: schemaFieldsPath, - }, - serverURL: config.serverURL, - }) - }, - - [config.routes.api, config.serverURL, schemaFieldsPath, id], - ) - - const handleUpdateEditData = useCallback( - (_, data) => { - // Update lexical node (with key nodeKey) with new data - editor.update(() => { - const uploadNode: UploadNode | null = $getNodeByKey(nodeKey) - if (uploadNode) { - const newData: UploadData = { - ...uploadNode.getData(), - fields: data, - } - uploadNode.setData(newData) - } - }) - - closeModal(drawerSlug) - }, - [closeModal, editor, drawerSlug, nodeKey], - ) - - return ( - <Drawer - slug={drawerSlug} - title={t('general:editLabel', { - label: getTranslation(relatedCollection.labels.singular, i18n), - })} - > - {initialState !== false && ( - <Form - beforeSubmit={[onChange]} - disableValidationOnSubmit - // @ts-expect-error TODO: Fix this - fields={fieldMap} - initialState={initialState} - onChange={[onChange]} - onSubmit={handleUpdateEditData} - uuid={uuid()} - > - <RenderFields - fieldMap={Array.isArray(fieldMap) ? fieldMap : []} - forceRender - path="" // See Blocks feature path for details as for why this is empty - readOnly={false} - schemaPath={schemaFieldsPath} - /> - <FormSubmit>{t('fields:saveChanges')}</FormSubmit> - </Form> - )} - </Drawer> - ) -} diff --git a/packages/richtext-lexical/src/features/upload/component/index.tsx b/packages/richtext-lexical/src/features/upload/component/index.tsx index be668413344..aa51ef4f458 100644 --- a/packages/richtext-lexical/src/features/upload/component/index.tsx +++ b/packages/richtext-lexical/src/features/upload/component/index.tsx @@ -1,5 +1,5 @@ 'use client' -import type { ClientCollectionConfig } from 'payload' +import type { ClientCollectionConfig, Data } from 'payload' import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js' import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js' @@ -12,6 +12,7 @@ import { useConfig, useDocumentDrawer, useDrawerSlug, + useModal, usePayloadAPI, useTranslation, } from '@payloadcms/ui' @@ -28,13 +29,13 @@ import React, { useCallback, useEffect, useReducer, useRef, useState } from 'rea import type { ClientComponentProps } from '../../typesClient.js' import type { UploadFeaturePropsClient } from '../feature.client.js' -import type { UploadData } from '../nodes/UploadNode.js' +import type { UploadData, UploadNode } from '../nodes/UploadNode.js' import { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js' +import { FieldsDrawer } from '../../../utilities/fieldsDrawer/Drawer.js' import { EnabledRelationshipsCondition } from '../../relationship/utils/EnabledRelationshipsCondition.js' import { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js' import { $isUploadNode } from '../nodes/UploadNode.js' -import { ExtraFieldsUploadDrawer } from './ExtraFieldsDrawer/index.js' import './index.scss' const baseClass = 'lexical-upload' @@ -60,6 +61,7 @@ const Component: React.FC<ElementProps> = (props) => { serverURL, } = useConfig() const uploadRef = useRef<HTMLDivElement | null>(null) + const { closeModal } = useModal() const [editor] = useLexicalComposerContext() const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey) @@ -68,7 +70,7 @@ const Component: React.FC<ElementProps> = (props) => { const { i18n, t } = useTranslation() const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0) - const [relatedCollection, setRelatedCollection] = useState<ClientCollectionConfig>(() => + const [relatedCollection] = useState<ClientCollectionConfig>(() => collections.find((coll) => coll.slug === relationTo), ) @@ -94,7 +96,7 @@ const Component: React.FC<ElementProps> = (props) => { }, [editor, nodeKey]) const updateUpload = useCallback( - (json) => { + (data: Data) => { setParams({ ...initialParams, cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed @@ -107,9 +109,8 @@ const Component: React.FC<ElementProps> = (props) => { ) const $onDelete = useCallback( - (payload: KeyboardEvent) => { + (event: KeyboardEvent) => { if (isSelected && $isNodeSelection($getSelection())) { - const event: KeyboardEvent = payload event.preventDefault() const node = $getNodeByKey(nodeKey) if ($isUploadNode(node)) { @@ -122,8 +123,7 @@ const Component: React.FC<ElementProps> = (props) => { [isSelected, nodeKey], ) const onClick = useCallback( - (payload: MouseEvent) => { - const event = payload + (event: MouseEvent) => { // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked if (event.target === uploadRef.current || uploadRef.current?.contains(event.target as Node)) { if (event.shiftKey) { @@ -156,6 +156,25 @@ const Component: React.FC<ElementProps> = (props) => { ?.sanitizedClientFeatureProps as ClientComponentProps<UploadFeaturePropsClient> ).collections?.[relatedCollection.slug]?.hasExtraFields + const onExtraFieldsDrawerSubmit = useCallback( + (_, data) => { + // Update lexical node (with key nodeKey) with new data + editor.update(() => { + const uploadNode: UploadNode | null = $getNodeByKey(nodeKey) + if (uploadNode) { + const newData: UploadData = { + ...uploadNode.getData(), + fields: data, + } + uploadNode.setData(newData) + } + }) + + closeModal(drawerSlug) + }, + [closeModal, editor, drawerSlug, nodeKey], + ) + return ( <div className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')} @@ -239,10 +258,15 @@ const Component: React.FC<ElementProps> = (props) => { </div> {value && <DocumentDrawer onSave={updateUpload} />} {hasExtraFields ? ( - <ExtraFieldsUploadDrawer + <FieldsDrawer + data={fields} drawerSlug={drawerSlug} - relatedCollection={relatedCollection} - {...props} + drawerTitle={t('general:editLabel', { + label: getTranslation(relatedCollection.labels.singular, i18n), + })} + featureKey="upload" + handleDrawerSubmit={onExtraFieldsDrawerSubmit} + schemaPathSuffix={relatedCollection.slug} /> ) : null} </div> diff --git a/packages/richtext-lexical/src/index.ts b/packages/richtext-lexical/src/index.ts index 52a10958f97..60426f83294 100644 --- a/packages/richtext-lexical/src/index.ts +++ b/packages/richtext-lexical/src/index.ts @@ -981,3 +981,5 @@ export { migrateSlateToLexical } from './utilities/migrateSlateToLexical/index.j export { upgradeLexicalData } from './utilities/upgradeLexicalData/index.js' export * from './nodeTypes.js' + +export type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js' diff --git a/packages/richtext-lexical/src/utilities/fieldsDrawer/Drawer.tsx b/packages/richtext-lexical/src/utilities/fieldsDrawer/Drawer.tsx new file mode 100644 index 00000000000..509a5e2ac50 --- /dev/null +++ b/packages/richtext-lexical/src/utilities/fieldsDrawer/Drawer.tsx @@ -0,0 +1,45 @@ +'use client' +import type { FormState } from 'payload' + +import { Drawer } from '@payloadcms/ui' +import React from 'react' + +import { DrawerContent } from './DrawerContent.js' + +export type FieldsDrawerProps = { + className?: string + data: any + drawerSlug: string + drawerTitle?: string + featureKey: string + handleDrawerSubmit: (fields: FormState, data: Record<string, unknown>) => void + schemaPathSuffix?: string +} + +/** + * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature. + * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only + * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts. + */ +export const FieldsDrawer: React.FC<FieldsDrawerProps> = ({ + className, + data, + drawerSlug, + drawerTitle, + featureKey, + handleDrawerSubmit, + schemaPathSuffix, +}) => { + // The Drawer only renders its children (and itself) if it's open. Thus, by extracting the main content + // to DrawerContent, this should be faster + return ( + <Drawer className={className} slug={drawerSlug} title={drawerTitle ?? ''}> + <DrawerContent + data={data} + featureKey={featureKey} + handleDrawerSubmit={handleDrawerSubmit} + schemaPathSuffix={schemaPathSuffix} + /> + </Drawer> + ) +} diff --git a/packages/richtext-lexical/src/features/link/drawer/index.tsx b/packages/richtext-lexical/src/utilities/fieldsDrawer/DrawerContent.tsx similarity index 56% rename from packages/richtext-lexical/src/features/link/drawer/index.tsx rename to packages/richtext-lexical/src/utilities/fieldsDrawer/DrawerContent.tsx index 83a9585286d..3cd971fa614 100644 --- a/packages/richtext-lexical/src/features/link/drawer/index.tsx +++ b/packages/richtext-lexical/src/utilities/fieldsDrawer/DrawerContent.tsx @@ -1,8 +1,8 @@ +'use client' import type { FormProps } from '@payloadcms/ui' import type { FormState } from 'payload' import { - Drawer, Form, FormSubmit, RenderFields, @@ -15,13 +15,16 @@ import { getFormState } from '@payloadcms/ui/shared' import React, { useCallback, useEffect, useState } from 'react' import { v4 as uuid } from 'uuid' -import { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js' -import './index.scss' -import { type Props } from './types.js' +import type { FieldsDrawerProps } from './Drawer.js' -const baseClass = 'lexical-link-edit-drawer' +import { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js' -export const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, stateData }) => { +export const DrawerContent: React.FC<Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>> = ({ + data, + featureKey, + handleDrawerSubmit, + schemaPathSuffix, +}) => { const { t } = useTranslation() const { id } = useDocumentInfo() const { schemaPath } = useFieldProps() @@ -31,8 +34,8 @@ export const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, sta field: { richTextComponentMap }, } = useEditorConfigContext() - const componentMapRenderedFieldsPath = `feature.link.fields.fields` - const schemaFieldsPath = `${schemaPath}.feature.link.fields` + const componentMapRenderedFieldsPath = `feature.${featureKey}.fields${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}` + const schemaFieldsPath = `${schemaPath}.feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}` const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema @@ -42,7 +45,7 @@ export const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, sta apiRoute: config.routes.api, body: { id, - data: stateData, + data, operation: 'update', schemaPath: schemaFieldsPath, }, @@ -52,10 +55,10 @@ export const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, sta setInitialState(state) } - if (stateData) { + if (data) { void awaitInitialState() } - }, [config.routes.api, config.serverURL, schemaFieldsPath, id, stateData]) + }, [config.routes.api, config.serverURL, schemaFieldsPath, id, data]) const onChange: FormProps['onChange'][0] = useCallback( async ({ formState: prevFormState }) => { @@ -74,29 +77,29 @@ export const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, sta [config.routes.api, config.serverURL, schemaFieldsPath, id], ) + if (initialState === false) { + return null + } + return ( - <Drawer className={baseClass} slug={drawerSlug} title={t('fields:editLink') ?? ''}> - {initialState !== false && ( - <Form - beforeSubmit={[onChange]} - disableValidationOnSubmit - fields={Array.isArray(fieldMap) ? fieldMap : []} - initialState={initialState} - onChange={[onChange]} - onSubmit={handleModalSubmit} - uuid={uuid()} - > - <RenderFields - fieldMap={Array.isArray(fieldMap) ? fieldMap : []} - forceRender - path="" // See Blocks feature path for details as for why this is empty - readOnly={false} - schemaPath={schemaFieldsPath} - /> + <Form + beforeSubmit={[onChange]} + disableValidationOnSubmit + fields={Array.isArray(fieldMap) ? fieldMap : []} + initialState={initialState} + onChange={[onChange]} + onSubmit={handleDrawerSubmit} + uuid={uuid()} + > + <RenderFields + fieldMap={Array.isArray(fieldMap) ? fieldMap : []} + forceRender + path="" // See Blocks feature path for details as for why this is empty + readOnly={false} + schemaPath={schemaFieldsPath} + /> - <FormSubmit>{t('general:submit')}</FormSubmit> - </Form> - )} - </Drawer> + <FormSubmit>{t('fields:saveChanges')}</FormSubmit> + </Form> ) }
b4d1eaf1fb02053a3b7d65fe0ec4f36828c6c146
2023-01-23 19:29:15
bencun
feat: field localization
false
field localization
feat
diff --git a/packages/plugin-form-builder/src/collections/Forms/fields.ts b/packages/plugin-form-builder/src/collections/Forms/fields.ts index b2364d130f9..5d8247bcb6c 100644 --- a/packages/plugin-form-builder/src/collections/Forms/fields.ts +++ b/packages/plugin-form-builder/src/collections/Forms/fields.ts @@ -14,6 +14,7 @@ const label: Field = { name: 'label', label: 'Label', type: 'text', + localized: true, }; const required: Field = { @@ -64,6 +65,7 @@ const Select: Block = { { name: 'defaultValue', label: 'Default Value', + localized: true, type: 'text', admin: { width: '50%', @@ -88,6 +90,7 @@ const Select: Block = { label: 'Label', type: 'text', required: true, + localized: true, admin: { width: '50%', }, @@ -146,6 +149,7 @@ const Text: Block = { name: 'defaultValue', label: 'Default Value', type: 'text', + localized: true, admin: { width: '50%', }, @@ -192,6 +196,7 @@ const TextArea: Block = { { name: 'defaultValue', label: 'Default Value', + localized: true, type: 'text', admin: { width: '50%', @@ -560,6 +565,7 @@ const Message: Block = { { name: 'message', type: 'richText', + localized: true, }, ], }; diff --git a/packages/plugin-form-builder/src/collections/Forms/index.ts b/packages/plugin-form-builder/src/collections/Forms/index.ts index 4b93775763b..ef21a13b79c 100644 --- a/packages/plugin-form-builder/src/collections/Forms/index.ts +++ b/packages/plugin-form-builder/src/collections/Forms/index.ts @@ -110,6 +110,7 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf { name: 'submitButtonLabel', type: 'text', + localized: true, }, { name: 'confirmationType', @@ -133,6 +134,7 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf { name: 'confirmationMessage', type: 'richText', + localized: true, required: true, admin: { condition: (_, siblingData) => siblingData?.confirmationType === 'message', @@ -206,11 +208,13 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf label: 'Subject', defaultValue: 'You\'ve received a new message.', required: true, + localized: true, }, { type: 'richText', name: 'message', label: 'Message', + localized: true, admin: { description: 'Enter the message that should be sent in this email.', },
3d6c3f7339371d2ea6ae014053010049d55b6567
2022-10-11 04:08:15
James
chore: cleanup
false
cleanup
chore
diff --git a/components/forms.ts b/components/forms.ts index d8dbc1fe44c..79a6ff87a64 100644 --- a/components/forms.ts +++ b/components/forms.ts @@ -1,7 +1,11 @@ export { useForm, + /** + * @deprecated useWatchForm is no longer preferred. If you need all form fields, prefer `useAllFormFields`. + */ useWatchForm, useFormFields, + useAllFormFields, useFormSubmitted, useFormProcessing, useFormModified, @@ -10,7 +14,7 @@ export { export { default as useField } from '../dist/admin/components/forms/useField'; /** - * @deprecated This method is now called useField. The useFieldType alias will be removed in an upcoming version.y + * @deprecated This method is now called useField. The useFieldType alias will be removed in an upcoming version. */ export { default as useFieldType } from '../dist/admin/components/forms/useField'; @@ -29,5 +33,6 @@ export { default as Submit } from '../dist/admin/components/forms/Submit'; export { default as Label } from '../dist/admin/components/forms/Label'; export { default as reduceFieldsToValues } from '../dist/admin/components/forms/Form/reduceFieldsToValues'; +export { default as getSiblingData } from '../dist/admin/components/forms/Form/getSiblingData'; export { default as withCondition } from '../dist/admin/components/forms/withCondition'; diff --git a/docs/admin/components.mdx b/docs/admin/components.mdx index 9950df5e402..5a514433069 100644 --- a/docs/admin/components.mdx +++ b/docs/admin/components.mdx @@ -161,51 +161,9 @@ const CustomTextField: React.FC<Props> = ({ path }) => { } ``` -### Getting other field values from the form - -There are times when a custom field component needs to have access to data from other fields. This can be done using `getDataByPath` from `useWatchForm` as follows: - -```tsx -import { useWatchForm } from 'payload/components/forms'; - -const DisplayFee: React.FC = () => { - const { getDataByPath } = useWatchForm(); - - const amount = getDataByPath('amount'); - const feePercentage = getDataByPath('feePercentage'); - - if (amount && feePercentage) { - return ( - <span>The fee is ${(amount * feePercentage) / 100}</span> - ); - } -}; -``` - -### Getting the document ID - -The document ID can be very useful for certain custom components. You can get the `id` from the `useDocumentInfo` hook. Here is an example of a `UI` field using `id` to link to related collections: - -```tsx -import { useDocumentInfo } from 'payload/components/utilities'; - -const LinkFromCategoryToPosts: React.FC = () => { - // highlight-start - const { id } = useDocumentInfo(); - // highlight-end - - // id will be undefined on the create form - if (!id) { - return null; - } - - return ( - <a href={`/admin/collections/posts?where[or][0][and][0][category][in][0]=[${id}]`} > - View posts - </a> - ) -}; -``` +<Banner type="success"> + For more information regarding the hooks that are available to you while you build custom components, including the <strong>useField</strong> hook, <a href="/docs/admin/hooks" style={{color: 'black'}}>click here</a>. +</Banner> ## Custom routes diff --git a/docs/admin/customizing-css.mdx b/docs/admin/customizing-css.mdx index 926307655de..85c79c8f5cb 100644 --- a/docs/admin/customizing-css.mdx +++ b/docs/admin/customizing-css.mdx @@ -1,7 +1,7 @@ --- title: Customizing CSS & SCSS label: Customizing CSS -order: 30 +order: 40 desc: Customize your Payload admin panel further by adding your own CSS or SCSS style sheet to the configuration, powerful theme and design options are waiting for you. keywords: admin, css, scss, documentation, Content Management System, cms, headless, javascript, node, react, express --- diff --git a/docs/admin/hooks.mdx b/docs/admin/hooks.mdx new file mode 100644 index 00000000000..b51e601bc01 --- /dev/null +++ b/docs/admin/hooks.mdx @@ -0,0 +1,271 @@ +--- +title: React Hooks +label: React Hooks +order: 30 +desc: Make use of all of the powerful React hooks that Payload provides. +keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, express +--- + +Payload provides a variety of powerful hooks that can be used within your own React components. With them, you can interface with Payload itself and build just about any type of complex customization you can think of—directly in familiar React code. + +### useField + +The `useField` hook is used internally within every applicable Payload field component, and it manages sending and receiving a field's state from its parent form. + +Outside of internal use, its most common use-case is in custom `Field` components. When you build a custom React `Field` component, you'll be responsible for sending and receiving the field's `value` from the form itself. To do so, import the `useField` hook as follows: + +```tsx +import { useField } from 'payload/components/forms' + +type Props = { path: string } + +const CustomTextField: React.FC<Props> = ({ path }) => { + // highlight-start + const { value, setValue } = useField<string>({ path }) + // highlight-end + + return <input onChange={e => setValue(e.target.value)} value={value.path} /> +} +``` + +The `useField` hook accepts an `args` object and sends back information and helpers for you to make use of: + +```ts +const field = useField<string>({ + path: 'fieldPathHere', // required + validate: myValidateFunc, // optional + disableFormData?: false, // if true, the field's data will be ignored + condition?: myConditionHere, // optional, used to skip validation if condition fails +}) + +// Here is what `useField` sends back +const { + showError, // whether or not the field should show as errored + errorMessage, // the error message to show, if showError + value, // the current value of the field from the form + formSubmitted, // if the form has been submitted + formProcessing, // if the form is currently processing + setValue, // method to set the field's value in form state + initialValue, // the initial value that the field mounted with +} = field; + +// The rest of your component goes here +``` + +### useFormFields + +There are times when a custom field component needs to have access to data from other fields, and you have a few options to do so. The `useFormFields` hook is a powerful and highly performant way to retrieve a form's field state, as well as to retrieve the `dispatchFields` method, which can be helpful for setting other fields' form states from anywhere within a form. + +<Banner type="success"> + <strong>This hook is great for retrieving only certain fields from form state</strong> because it ensures that it will only cause a rerender when the items that you ask for change. +</Banner> + +Thanks to the awesome package [`use-context-selector`](https://github.com/dai-shi/use-context-selector), you can retrieve a specific field's state easily. This is ideal because you can ensure you have an up-to-date field state, and your component will only re-render when _that field's state_ changes. + +You can pass a Redux-like selector into the hook, which will ensure that you retrieve only the field that you want. The selector takes an argument with type of `[fields: Fields, dispatch: React.Dispatch<Action>]]`. + +```tsx +import { useFormFields } from 'payload/components/forms'; + +const MyComponent: React.FC = () => { + // Get only the `amount` field state, and only cause a rerender when that field changes + const amount = useFormFields(([fields, dispatch]) => fields.amount); + + // Do the same thing as above, but to the `feePercentage` field + const feePercentage = useFormFields(([fields, dispatch]) => fields.feePercentage); + + if (typeof amount?.value !== 'undefined' && typeof feePercentage?.value !== 'undefined') { + return ( + <span>The fee is ${(amount.value * feePercentage.value) / 100}</span> + ); + } +}; +``` + +### useAllFormFields + +**To retrieve more than one field**, you can use the `useAllFormFields` hook. Your component will re-render when _any_ field changes, so use this hook only if you absolutely need to. Unlike the `useFormFields` hook, this hook does not accept a "selector", and it always returns an array with type of `[fields: Fields, dispatch: React.Dispatch<Action>]]`. + +You can do lots of powerful stuff by retrieving the full form state, like using built-in helper functions to reduce field state to values only, or to retrieve sibling data by path. + +```tsx +import { useAllFormFields, reduceFieldsToValues, getSiblingData } from 'payload/components/forms'; + +const ExampleComponent: React.FC = () => { + // the `fields` const will be equal to all fields' state, + // and the `dispatchFields` method is usable to send field state up to the form + const [fields, dispatchFields] = useAllFormFields(); + + // Pass in fields, and indicate if you'd like to "unflatten" field data. + // The result below will reflect the data stored in the form at the given time + const formData = reduceFieldsToValues(fields, true); + + // Pass in field state and a path, + // and you will be sent all sibling data of the path that you've specified + const siblingData = getSiblingData(fields, 'someFieldName'); + + return ( + // return some JSX here if necessary + ) +}; +``` + +##### Updating other fields' values + +If you are building a custom component, then you should use `setValue` which is returned from the `useField` hook to programmatically set your field's value. But if you're looking to update _another_ field's value, you can use `dispatchFields` returned from `useFormFields`. + +You can send the following actions to the `dispatchFields` function. + +| Action | Description | +|------------------------|----------------------------------------------------------------------------| +| **`ADD_ROW`** | Adds a row of data (useful in array / block field data) | +| **`DUPLICATE_ROW`** | Duplicates a row of data (useful in array / block field data) | +| **`MODIFY_CONDITION`** | Updates a field's conditional logic result (true / false) | +| **`MOVE_ROW`** | Moves a row of data (useful in array / block field data) | +| **`REMOVE`** | Removes a field from form state | +| **`REMOVE_ROW`** | Removes a row of data from form state (useful in array / block field data) | +| **`REPLACE_STATE`** | Completely replaces form state | +| **`UPDATE`** | Update any property of a specific field's state | + +To see types for each action supported within the `dispatchFields` hook, check out the Form types [here](https://github.com/payloadcms/payload/blob/master/src/admin/components/forms/Form/types.ts). + +### useForm + +The `useForm` hook can be used to interact with the form itself, and sends back many methods that can be used to reactively fetch form state without causing rerenders within your components each time a field is changed. This is useful if you have action-based callbacks that your components fire, and need to interact with form state _based on a user action_. + +<Banner type="warning"> + <strong>Warning:</strong><br/> + This hook is optimized to avoid causing rerenders when fields change, and as such, its `fields` property will be out of date. You should only leverage this hook if you need to perform actions against the form in response to your users' actions. Do not rely on its returned "fields" as being up-to-date. They will be removed from this hook's response in an upcoming version. +</Banner> + +The `useForm` hook returns an object with the following properties: + +| Action | Description | +|----------------------|---------------------------------------------------------------------| +| **`fields`** | Deprecated. This property cannot be relied on as up-to-date. | +| **`submit`** | Method to trigger the form to submit | +| **`dispatchFields`** | Dispatch actions to the form field state | +| **`validateForm`** | Trigger a validation of the form state | +| **`createFormData`** | Create a `multipart/form-data` object from the current form's state | +| **`disabled`** | Boolean denoting whether or not the form is disabled | +| **`getFields`** | Gets all fields from state | +| **`getField`** | Gets a single field from state by path | +| **`getData`** | Returns the data stored in the form | +| **`getSiblingData`** | Returns form sibling data for the given field path | +| **`setModified`** | Set the form's `modified` state | +| **`setProcessing`** | Set the form's `processing` state | +| **`setSubmitted`** | Set the form's `submitted` state | +| **`formRef`** | The ref from the form HTML element | +| **`reset`** | Method to reset the form to its initial state | + +### useDocumentInfo + +The `useDocumentInfo` hook provides lots of information about the document currently being edited, including the following: + +| Property | Description | +|---------------------------|------------------------------------------------------------------------------------| +| **`collection`** | If the doc is a collection, its collection config will be returned | +| **`global`** | If the doc is a global, its global config will be returned | +| **`type`** | The type of document being edited (collection or global) | +| **`id`** | If the doc is a collection, its ID will be returned | +| **`preferencesKey`** | The `preferences` key to use when interacting with document-level user preferences | +| **`versions`** | Versions of the current doc | +| **`unpublishedVersions`** | Unpublished versions of the current doc | +| **`publishedDoc`** | The currently published version of the doc being edited | +| **`getVersions`** | Method to trigger the retrieval of document versions | + +**Example:** + +```tsx +import { useDocumentInfo } from 'payload/components/utilities'; + +const LinkFromCategoryToPosts: React.FC = () => { + // highlight-start + const { id } = useDocumentInfo(); + // highlight-end + + // id will be undefined on the create form + if (!id) { + return null; + } + + return ( + <a href={`/admin/collections/posts?where[or][0][and][0][category][in][0]=[${id}]`} > + View posts + </a> + ) +}; +``` + +### useLocale + +In any custom component you can get the selected locale with the `useLocale` hook. Here is a simple example: + +```tsx +import { useLocale } from 'payload/components/utilities'; + +const Greeting: React.FC = () => { + // highlight-start + const locale = useLocale(); + // highlight-end + + const trans = { + en: 'Hello', + es: 'Hola', + }; + + return ( + <span> { trans[locale] } </span> + ); +}; +``` + +### useAuth + +Useful to retrieve info about the currently logged in user as well as methods for interacting with it. It sends back an object with the following properties: + +| Property | Description | +|---------------------|-----------------------------------------------------------------------------------------| +| **`user`** | The currently logged in user | +| **`logOut`** | A method to log out the currently logged in user | +| **`refreshCookie`** | A method to trigger the silent refreshing of a user's auth token | +| **`setToken`** | Set the token of the user, to be decoded and used to reset the user and token in memory | +| **`token`** | The logged in user's token (useful for creating preview links, etc.) | +| **`permissions`** | The permissions of the current user | + +```tsx +import { useAuth } from 'payload/components/utilities'; +import { User } from '../payload-types.ts'; + +const Greeting: React.FC = () => { + // highlight-start + const { user } = useConfig<User>(); + // highlight-end + + return ( + <span>Hi, {user.email}!</span> + ); +}; +``` + +### useConfig + +Used to easily fetch the full Payload config. + +```tsx +import { useConfig } from 'payload/components/utilities'; + +const MyComponent: React.FC = () => { + // highlight-start + const config = useConfig(); + // highlight-end + + return ( + <span>{config.serverURL}</span> + ); +}; +``` + +### usePreferences + +Returns methods to set and get user preferences. More info can be found [here](https://payloadcms.com/docs/admin/preferences). diff --git a/docs/admin/preferences.mdx b/docs/admin/preferences.mdx index 5842a3a204d..38ae6318367 100644 --- a/docs/admin/preferences.mdx +++ b/docs/admin/preferences.mdx @@ -1,7 +1,7 @@ --- title: Managing User Preferences label: Preferences -order: 40 +order: 50 desc: Store the preferences of your users as they interact with the Admin panel. keywords: admin, preferences, custom, customize, documentation, Content Management System, cms, headless, javascript, node, react, express --- diff --git a/docs/admin/webpack.mdx b/docs/admin/webpack.mdx index c696a678a6b..74f4b3c4cb0 100644 --- a/docs/admin/webpack.mdx +++ b/docs/admin/webpack.mdx @@ -1,7 +1,7 @@ --- title: Webpack label: Webpack -order: 50 +order: 60 desc: The Payload admin panel uses Webpack 5 and supports many common functionalities such as SCSS and Typescript out of the box to give you more freedom. keywords: admin, webpack, documentation, Content Management System, cms, headless, javascript, node, react, express --- diff --git a/src/admin/components/elements/Autosave/index.tsx b/src/admin/components/elements/Autosave/index.tsx index 6e710b350ae..9f91fa3fc79 100644 --- a/src/admin/components/elements/Autosave/index.tsx +++ b/src/admin/components/elements/Autosave/index.tsx @@ -1,10 +1,9 @@ import { formatDistance } from 'date-fns'; import { useHistory } from 'react-router-dom'; import { toast } from 'react-toastify'; -import { useContext } from 'use-context-selector'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useConfig } from '../../utilities/Config'; -import { useFormModified, FormFieldsContext } from '../../forms/Form/context'; +import { useFormModified, useAllFormFields } from '../../forms/Form/context'; import { useLocale } from '../../utilities/Locale'; import { Props } from './types'; import reduceFieldsToValues from '../../forms/Form/reduceFieldsToValues'; @@ -18,7 +17,7 @@ const baseClass = 'autosave'; const Autosave: React.FC<Props> = ({ collection, global, id, publishedDocUpdatedAt }) => { const { serverURL, routes: { api, admin } } = useConfig(); const { versions, getVersions } = useDocumentInfo(); - const [fields] = useContext(FormFieldsContext); + const [fields] = useAllFormFields(); const modified = useFormModified(); const locale = useLocale(); const { replace } = useHistory(); diff --git a/src/admin/components/forms/Form/context.ts b/src/admin/components/forms/Form/context.ts index 3e2c8a9ab03..c49b450a813 100644 --- a/src/admin/components/forms/Form/context.ts +++ b/src/admin/components/forms/Form/context.ts @@ -1,5 +1,5 @@ import { createContext, useContext } from 'react'; -import { useContextSelector, createContext as createSelectorContext } from 'use-context-selector'; +import { useContextSelector, createContext as createSelectorContext, useContext as useFullContext } from 'use-context-selector'; import { Context, FormFieldsContext as FormFieldsContextType } from './types'; const FormContext = createContext({} as Context); @@ -16,6 +16,7 @@ const useFormProcessing = (): boolean => useContext(ProcessingContext); const useFormModified = (): boolean => useContext(ModifiedContext); const useFormFields = <Value = unknown>(selector: (context: FormFieldsContextType) => Value): Value => useContextSelector(FormFieldsContext, selector); +const useAllFormFields = (): FormFieldsContextType => useFullContext(FormFieldsContext); export { SubmittedContext, @@ -25,9 +26,10 @@ export { useFormProcessing, useFormModified, useForm, - useWatchForm, FormContext, - FormWatchContext, FormFieldsContext, useFormFields, + useAllFormFields, + FormWatchContext, + useWatchForm, }; diff --git a/src/admin/components/forms/Form/index.tsx b/src/admin/components/forms/Form/index.tsx index f7dc2755d80..d25b439a002 100644 --- a/src/admin/components/forms/Form/index.tsx +++ b/src/admin/components/forms/Form/index.tsx @@ -299,7 +299,6 @@ const Form: React.FC<Props> = (props) => { const getData = useCallback(() => reduceFieldsToValues(contextRef.current.fields, true), [contextRef]); const getSiblingData = useCallback((path: string) => getSiblingDataFunc(contextRef.current.fields, path), [contextRef]); const getDataByPath = useCallback<GetDataByPath>((path: string) => getDataByPathFunc(contextRef.current.fields, path), [contextRef]); - const getUnflattenedValues = useCallback(() => reduceFieldsToValues(contextRef.current.fields), [contextRef]); const createFormData = useCallback((overrides: any = {}) => { const data = reduceFieldsToValues(contextRef.current.fields, true); @@ -337,7 +336,6 @@ const Form: React.FC<Props> = (props) => { contextRef.current.getData = getData; contextRef.current.getSiblingData = getSiblingData; contextRef.current.getDataByPath = getDataByPath; - contextRef.current.getUnflattenedValues = getUnflattenedValues; contextRef.current.validateForm = validateForm; contextRef.current.createFormData = createFormData; contextRef.current.setModified = setModified; diff --git a/src/admin/components/forms/Form/initContextState.ts b/src/admin/components/forms/Form/initContextState.ts index 7a48af2e052..2b2f3bccaa4 100644 --- a/src/admin/components/forms/Form/initContextState.ts +++ b/src/admin/components/forms/Form/initContextState.ts @@ -6,7 +6,6 @@ import { Submit, Context, GetSiblingData, - GetUnflattenedValues, ValidateForm, CreateFormData, SetModified, @@ -17,7 +16,6 @@ import { const submit: Submit = () => undefined; const getSiblingData: GetSiblingData = () => undefined; -const getUnflattenedValues: GetUnflattenedValues = () => ({}); const dispatchFields: DispatchFields = () => undefined; const validateForm: ValidateForm = () => undefined; const createFormData: CreateFormData = () => undefined; @@ -33,7 +31,6 @@ const initialContextState: Context = { getData: (): Data => undefined, getSiblingData, getDataByPath: () => undefined, - getUnflattenedValues, validateForm, createFormData, submit, diff --git a/src/admin/components/forms/Form/types.ts b/src/admin/components/forms/Form/types.ts index 6c53d8154d4..8e1e69dbd9e 100644 --- a/src/admin/components/forms/Form/types.ts +++ b/src/admin/components/forms/Form/types.ts @@ -57,7 +57,6 @@ export type GetFields = () => Fields; export type GetField = (path: string) => Field; export type GetData = () => Data; export type GetSiblingData = (path: string) => Data; -export type GetUnflattenedValues = () => Data; export type GetDataByPath = <T = unknown>(path: string) => T; export type SetModified = (modified: boolean) => void; export type SetSubmitted = (submitted: boolean) => void; @@ -126,8 +125,11 @@ export type FieldAction = export type FormFieldsContext = [Fields, Dispatch<FieldAction>] export type Context = { - submit: Submit + /** + * @deprecated Form context fields may be outdated and should not be relied on. Instead, prefer `useFormFields`. + */ fields: Fields + submit: Submit dispatchFields: Dispatch<FieldAction> validateForm: ValidateForm createFormData: CreateFormData @@ -136,7 +138,6 @@ export type Context = { getField: GetField getData: GetData getSiblingData: GetSiblingData - getUnflattenedValues: GetUnflattenedValues getDataByPath: GetDataByPath setModified: SetModified setProcessing: SetProcessing diff --git a/src/admin/components/forms/field-types/Code/Code.tsx b/src/admin/components/forms/field-types/Code/Code.tsx index 3ca5ca50b74..4e78dac8264 100644 --- a/src/admin/components/forms/field-types/Code/Code.tsx +++ b/src/admin/components/forms/field-types/Code/Code.tsx @@ -60,7 +60,6 @@ const Code: React.FC<Props> = (props) => { } = useField({ path, validate: memoizedValidate, - enableDebouncedValue: true, condition, }); diff --git a/src/admin/components/forms/field-types/ConfirmPassword/index.tsx b/src/admin/components/forms/field-types/ConfirmPassword/index.tsx index f04f0b6ad3a..5a1e0c388d9 100644 --- a/src/admin/components/forms/field-types/ConfirmPassword/index.tsx +++ b/src/admin/components/forms/field-types/ConfirmPassword/index.tsx @@ -31,7 +31,6 @@ const ConfirmPassword: React.FC = () => { path: 'confirm-password', disableFormData: true, validate, - enableDebouncedValue: true, }); const classes = [ diff --git a/src/admin/components/forms/field-types/Email/index.tsx b/src/admin/components/forms/field-types/Email/index.tsx index dc40bb43081..53d0122e4dd 100644 --- a/src/admin/components/forms/field-types/Email/index.tsx +++ b/src/admin/components/forms/field-types/Email/index.tsx @@ -37,7 +37,6 @@ const Email: React.FC<Props> = (props) => { const fieldType = useField({ path, validate: memoizedValidate, - enableDebouncedValue: true, condition, }); diff --git a/src/admin/components/forms/field-types/Number/index.tsx b/src/admin/components/forms/field-types/Number/index.tsx index f689a0739d9..137cf8d4009 100644 --- a/src/admin/components/forms/field-types/Number/index.tsx +++ b/src/admin/components/forms/field-types/Number/index.tsx @@ -44,7 +44,6 @@ const NumberField: React.FC<Props> = (props) => { } = useField({ path, validate: memoizedValidate, - enableDebouncedValue: true, condition, }); diff --git a/src/admin/components/forms/field-types/Password/index.tsx b/src/admin/components/forms/field-types/Password/index.tsx index 60de2a77c0c..a1b91a7844a 100644 --- a/src/admin/components/forms/field-types/Password/index.tsx +++ b/src/admin/components/forms/field-types/Password/index.tsx @@ -37,7 +37,6 @@ const Password: React.FC<Props> = (props) => { } = useField({ path, validate: memoizedValidate, - enableDebouncedValue: true, }); const classes = [ diff --git a/src/admin/components/forms/field-types/Point/index.tsx b/src/admin/components/forms/field-types/Point/index.tsx index 1e62dbdf324..ac072967217 100644 --- a/src/admin/components/forms/field-types/Point/index.tsx +++ b/src/admin/components/forms/field-types/Point/index.tsx @@ -44,7 +44,6 @@ const PointField: React.FC<Props> = (props) => { } = useField<[number, number]>({ path, validate: memoizedValidate, - enableDebouncedValue: true, condition, }); diff --git a/src/admin/components/forms/field-types/Relationship/index.tsx b/src/admin/components/forms/field-types/Relationship/index.tsx index 6c39011970c..5b08b9be14d 100644 --- a/src/admin/components/forms/field-types/Relationship/index.tsx +++ b/src/admin/components/forms/field-types/Relationship/index.tsx @@ -3,7 +3,6 @@ import React, { } from 'react'; import equal from 'deep-equal'; import qs from 'qs'; -import { useContext } from 'use-context-selector'; import { useConfig } from '../../../utilities/Config'; import { useAuth } from '../../../utilities/Auth'; import withCondition from '../../withCondition'; @@ -16,7 +15,7 @@ import FieldDescription from '../../FieldDescription'; import { relationship } from '../../../../../fields/validations'; import { Where } from '../../../../../types'; import { PaginatedDocs } from '../../../../../mongoose/types'; -import { useFormProcessing, FormFieldsContext } from '../../Form/context'; +import { useFormProcessing, useAllFormFields } from '../../Form/context'; import optionsReducer from './optionsReducer'; import { Props, Option, ValueWithRelation, GetResults } from './types'; import { createRelationMap } from './createRelationMap'; @@ -65,7 +64,7 @@ const Relationship: React.FC<Props> = (props) => { const { id } = useDocumentInfo(); const { user, permissions } = useAuth(); - const [fields] = useContext(FormFieldsContext); + const [fields] = useAllFormFields(); const formProcessing = useFormProcessing(); const hasMultipleRelations = Array.isArray(relationTo); const [options, dispatchOptions] = useReducer(optionsReducer, required || hasMany ? [] : [{ value: null, label: 'None' }]); diff --git a/src/admin/components/forms/field-types/Text/index.tsx b/src/admin/components/forms/field-types/Text/index.tsx index fff9b3d65bf..853b15b239f 100644 --- a/src/admin/components/forms/field-types/Text/index.tsx +++ b/src/admin/components/forms/field-types/Text/index.tsx @@ -35,7 +35,6 @@ const Text: React.FC<Props> = (props) => { const field = useField<string>({ path, validate: memoizedValidate, - enableDebouncedValue: true, condition, }); diff --git a/src/admin/components/forms/field-types/Textarea/index.tsx b/src/admin/components/forms/field-types/Textarea/index.tsx index 4e9ed1b0849..b7f4031be8d 100644 --- a/src/admin/components/forms/field-types/Textarea/index.tsx +++ b/src/admin/components/forms/field-types/Textarea/index.tsx @@ -42,7 +42,6 @@ const Textarea: React.FC<Props> = (props) => { } = useField({ path, validate: memoizedValidate, - enableDebouncedValue: true, condition, }); diff --git a/src/admin/components/forms/useField/index.tsx b/src/admin/components/forms/useField/index.tsx index bc0129141bc..cded6eccdf4 100644 --- a/src/admin/components/forms/useField/index.tsx +++ b/src/admin/components/forms/useField/index.tsx @@ -1,7 +1,6 @@ import { useCallback, useMemo } from 'react'; -import { useContextSelector } from 'use-context-selector'; import { useAuth } from '../../utilities/Auth'; -import { useFormProcessing, useFormSubmitted, useFormModified, FormFieldsContext, useForm } from '../Form/context'; +import { useFormProcessing, useFormSubmitted, useFormModified, useForm, useFormFields } from '../Form/context'; import { Options, FieldType } from './types'; import { useDocumentInfo } from '../../utilities/DocumentInfo'; import { useOperation } from '../../utilities/OperationProvider'; @@ -22,9 +21,9 @@ const useField = <T extends unknown>(options: Options): FieldType<T> => { const { user } = useAuth(); const { id } = useDocumentInfo(); const operation = useOperation(); + const field = useFormFields(([fields]) => fields[path]); + const dispatchField = useFormFields(([_, dispatch]) => dispatch); - const field = useContextSelector(FormFieldsContext, ([fields]) => fields[path]); - const dispatchField = useContextSelector(FormFieldsContext, ([_, dispatch]) => dispatch); const { getData, getSiblingData, setModified } = useForm(); const value = field?.value as T; diff --git a/src/admin/components/forms/useField/types.ts b/src/admin/components/forms/useField/types.ts index e2d6228f27a..1d873be67a2 100644 --- a/src/admin/components/forms/useField/types.ts +++ b/src/admin/components/forms/useField/types.ts @@ -3,9 +3,7 @@ import { Condition, Validate } from '../../../../fields/config/types'; export type Options = { path: string validate?: Validate - enableDebouncedValue?: boolean disableFormData?: boolean - ignoreWhileFlattening?: boolean condition?: Condition } diff --git a/src/admin/components/forms/withCondition/index.tsx b/src/admin/components/forms/withCondition/index.tsx index 55c0eaad188..e45fd8bb05a 100644 --- a/src/admin/components/forms/withCondition/index.tsx +++ b/src/admin/components/forms/withCondition/index.tsx @@ -1,7 +1,6 @@ import React, { useEffect } from 'react'; -import { useContext } from 'use-context-selector'; import { FieldBase } from '../../../../fields/config/types'; -import { FormFieldsContext } from '../Form/context'; +import { useAllFormFields } from '../Form/context'; import getSiblingData from '../Form/getSiblingData'; import reduceFieldsToValues from '../Form/reduceFieldsToValues'; @@ -33,7 +32,7 @@ const withCondition = <P extends Record<string, unknown>>(Field: React.Component const path = typeof pathFromProps === 'string' ? pathFromProps : name; - const [fields, dispatchFields] = useContext(FormFieldsContext); + const [fields, dispatchFields] = useAllFormFields(); const data = reduceFieldsToValues(fields, true); const siblingData = getSiblingData(fields, path);
b2037ecf6f1dc39e77a4b6386356645a03ec7a1c
2021-02-23 21:24:25
James
chore: update changelog
false
update changelog
chore
diff --git a/CHANGELOG.md b/CHANGELOG.md index f26ad711e48..4307bc030b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [0.3.0](https://github.com/payloadcms/payload/compare/v0.2.13...v0.3.0) (2021-02-23) + +### Bug Fixes +* properly exposes scss variables for re-use ([c1b2301](https://github.com/payloadcms/payload/commit/c1b230165033ed3cf382a6e42b590815489525f9)) +* explicitly sets modal z-index and css breakpoints ([c1b2301](https://github.com/payloadcms/payload/commit/c1b230165033ed3cf382a6e42b590815489525f9)) +* removes `overwrite` from update operation to ensure hidden fields don't get lost on document update ([a8e2cc1](https://github.com/payloadcms/payload/commit/a8e2cc11af177641409ff7726ed8c4f1a154dee4)) + + ## [0.2.13](https://github.com/payloadcms/payload/compare/v0.2.12...v0.2.13) (2021-02-20) ### Breaking Changes
ecabf130fd1b4b87c45196d4bdf675e76b20c9e3
2021-11-30 21:20:32
Jacob Fletcher
fix: select component rendered value
false
select component rendered value
fix
diff --git a/src/admin/components/forms/field-types/Select/Input.tsx b/src/admin/components/forms/field-types/Select/Input.tsx index 62f1309ca66..8ee6c8aafb5 100644 --- a/src/admin/components/forms/field-types/Select/Input.tsx +++ b/src/admin/components/forms/field-types/Select/Input.tsx @@ -16,7 +16,7 @@ export type SelectInputProps = Omit<SelectField, 'type' | 'value' | 'options'> & readOnly?: boolean path?: string required?: boolean - value?: string + value?: string | string[] description?: Description onChange?: (value: ReactSelectValue) => void style?: React.CSSProperties @@ -49,7 +49,13 @@ const SelectInput: React.FC<SelectInputProps> = (props) => { readOnly && 'read-only', ].filter(Boolean).join(' '); - const selectedOption = options.find((option) => option.value === value); + let valueToRender; + + if (hasMany && Array.isArray(value)) { + valueToRender = value.map((val) => options.find((option) => option.value === val)); + } else { + valueToRender = options.find((option) => option.value === value); + } return ( <div @@ -70,7 +76,7 @@ const SelectInput: React.FC<SelectInputProps> = (props) => { /> <ReactSelect onChange={onChange} - value={selectedOption as ReactSelectValue} + value={valueToRender as ReactSelectValue} showError={showError} isDisabled={readOnly} options={options} diff --git a/src/admin/components/forms/field-types/Select/index.tsx b/src/admin/components/forms/field-types/Select/index.tsx index 75e6be38df1..3a4a1451e4b 100644 --- a/src/admin/components/forms/field-types/Select/index.tsx +++ b/src/admin/components/forms/field-types/Select/index.tsx @@ -33,8 +33,6 @@ const Select: React.FC<Props> = (props) => { description, condition, } = {}, - value: valueFromProps, - onChange: onChangeFromProps, } = props; const path = pathFromProps || name; @@ -47,7 +45,7 @@ const Select: React.FC<Props> = (props) => { }, [validate, required, options]); const { - value: valueFromContext, + value, showError, setValue, errorMessage, @@ -70,33 +68,18 @@ const Select: React.FC<Props> = (props) => { newValue = selectedOption.value; } - if (typeof onChangeFromProps === 'function') { - onChangeFromProps(newValue); - } else { - setValue(newValue); - } + setValue(newValue); } }, [ readOnly, hasMany, - onChangeFromProps, setValue, ]); - let valueToRender; - - const value = valueFromProps || valueFromContext || ''; - - if (hasMany && Array.isArray(value)) { - valueToRender = value.map((val) => options.find((option) => option.value === val)); - } else { - valueToRender = options.find((option) => option.value === value); - } - return ( <SelectInput onChange={onChange} - value={valueToRender} + value={value as string | string[]} name={name} options={options} label={label} diff --git a/src/fields/config/types.ts b/src/fields/config/types.ts index ad05aeee5fc..99999de0244 100644 --- a/src/fields/config/types.ts +++ b/src/fields/config/types.ts @@ -187,8 +187,6 @@ export type SelectField = FieldBase & { type: 'select' options: Option[] hasMany?: boolean - value?: string - onChange?: (value: string) => void } export type RelationshipField = FieldBase & {
7cf268609787039ac662da4b520e56dc440f226c
2024-04-10 23:38:47
Jacob Fletcher
fix: optionally types req in auth operation (#5769)
false
optionally types req in auth operation (#5769)
fix
diff --git a/packages/payload/src/auth/operations/auth.ts b/packages/payload/src/auth/operations/auth.ts index 1627a01be6e..37e45782c22 100644 --- a/packages/payload/src/auth/operations/auth.ts +++ b/packages/payload/src/auth/operations/auth.ts @@ -10,7 +10,7 @@ import { getAccessResults } from '../getAccessResults.js' export type AuthArgs = { headers: Request['headers'] - req: Omit<PayloadRequest, 'user'> + req?: Omit<PayloadRequest, 'user'> } export type AuthResult = { @@ -19,7 +19,7 @@ export type AuthResult = { user: User | null } -export const auth = async (args: AuthArgs): Promise<AuthResult> => { +export const auth = async (args: Required<AuthArgs>): Promise<AuthResult> => { const { headers } = args const req = args.req as PayloadRequest const { payload } = req
4bde09a20096e83258e1868882674a34c4c87794
2025-01-21 03:43:45
Elliot DeNolf
ci: release notes emoji fix
false
release notes emoji fix
ci
diff --git a/tools/releaser/src/utils/generateReleaseNotes.ts b/tools/releaser/src/utils/generateReleaseNotes.ts index 2a19c7dd70c..4138042fafb 100755 --- a/tools/releaser/src/utils/generateReleaseNotes.ts +++ b/tools/releaser/src/utils/generateReleaseNotes.ts @@ -90,15 +90,15 @@ export const generateReleaseNotes = async (args: Args = {}): Promise<ChangelogRe const emojiHeaderMap: Record<Section, string> = { breaking: '⚠️ BREAKING CHANGES', - build: '� Build', + build: '🔨 Build', chore: '🏡 Chores', ci: '⚙️ CI', docs: '📚 Documentation', examples: '📓 Examples', feat: '🚀 Features', - fix: '� Bug Fixes', + fix: '🐛 Bug Fixes', perf: '⚡ Performance', - refactor: '� Refactors', + refactor: '🛠 Refactors', style: '🎨 Styles', templates: '📝 Templates', test: '🧪 Tests',
18bc4b708cbd4642cf45defe6e7ce3f0a69134b0
2024-05-25 00:50:07
Jarrod Flesch
fix: separate collection docs with same ids were excluded in selectable (#6499)
false
separate collection docs with same ids were excluded in selectable (#6499)
fix
diff --git a/packages/ui/src/fields/Relationship/index.tsx b/packages/ui/src/fields/Relationship/index.tsx index 648c12cf36f..a5145964486 100644 --- a/packages/ui/src/fields/Relationship/index.tsx +++ b/packages/ui/src/fields/Relationship/index.tsx @@ -495,6 +495,11 @@ const RelationshipField: React.FC<RelationshipFieldProps> = (props) => { }} disabled={readOnly || formProcessing || drawerIsOpen} filterOption={enableWordBoundarySearch ? filterOption : undefined} + getOptionValue={(option) => { + return hasMany && Array.isArray(relationTo) + ? `${option.relationTo}_${option.value}` + : option.value + }} isLoading={isLoading} isMulti={hasMany} isSortable={isSortable} diff --git a/test/fields-relationship/collectionSlugs.ts b/test/fields-relationship/collectionSlugs.ts index 94ed552a0b1..3ecb0cea92f 100644 --- a/test/fields-relationship/collectionSlugs.ts +++ b/test/fields-relationship/collectionSlugs.ts @@ -9,3 +9,6 @@ export const relationWithTitleSlug = 'relation-with-title' export const relationUpdatedExternallySlug = 'relation-updated-externally' export const collection1Slug = 'collection-1' export const collection2Slug = 'collection-2' +export const videoCollectionSlug = 'videos' +export const podcastCollectionSlug = 'podcasts' +export const mixedMediaCollectionSlug = 'mixed-media' diff --git a/test/fields-relationship/config.ts b/test/fields-relationship/config.ts index 77a2746d8bd..3bc97016008 100644 --- a/test/fields-relationship/config.ts +++ b/test/fields-relationship/config.ts @@ -9,6 +9,8 @@ import { PrePopulateFieldUI } from './PrePopulateFieldUI/index.js' import { collection1Slug, collection2Slug, + mixedMediaCollectionSlug, + podcastCollectionSlug, relationFalseFilterOptionSlug, relationOneSlug, relationRestrictedSlug, @@ -17,6 +19,7 @@ import { relationUpdatedExternallySlug, relationWithTitleSlug, slug, + videoCollectionSlug, } from './collectionSlugs.js' export interface FieldsRelationship { @@ -325,6 +328,51 @@ export default buildConfigWithDefaults({ ], slug: collection2Slug, }, + { + slug: videoCollectionSlug, + admin: { + useAsTitle: 'title', + }, + fields: [ + { + name: 'id', + type: 'number', + required: true, + }, + { + name: 'title', + type: 'text', + }, + ], + }, + { + slug: podcastCollectionSlug, + admin: { + useAsTitle: 'title', + }, + fields: [ + { + name: 'id', + type: 'number', + required: true, + }, + { + name: 'title', + type: 'text', + }, + ], + }, + { + slug: mixedMediaCollectionSlug, + fields: [ + { + type: 'relationship', + name: 'relatedMedia', + relationTo: [videoCollectionSlug, podcastCollectionSlug], + hasMany: true, + }, + ], + }, ], onInit: async (payload) => { await payload.create({ @@ -461,5 +509,22 @@ export default buildConfigWithDefaults({ }, }) } + + for (let i = 0; i < 2; i++) { + await payload.create({ + collection: videoCollectionSlug, + data: { + id: i, + title: `Video ${i}`, + }, + }) + await payload.create({ + collection: podcastCollectionSlug, + data: { + id: i, + title: `Podcast ${i}`, + }, + }) + } }, }) diff --git a/test/fields-relationship/e2e.spec.ts b/test/fields-relationship/e2e.spec.ts index f11d9177fe0..7df9e37ef47 100644 --- a/test/fields-relationship/e2e.spec.ts +++ b/test/fields-relationship/e2e.spec.ts @@ -1,5 +1,4 @@ import type { Page } from '@playwright/test' -import type { Payload } from 'payload' import { expect, test } from '@playwright/test' import path from 'path' @@ -22,12 +21,12 @@ import { openDocControls, openDocDrawer, saveDocAndAssert, - throttleTest, } from '../helpers.js' import { AdminUrlUtil } from '../helpers/adminUrlUtil.js' import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js' import { POLL_TOPASS_TIMEOUT, TEST_TIMEOUT_LONG } from '../playwright.config.js' import { + mixedMediaCollectionSlug, relationFalseFilterOptionSlug, relationOneSlug, relationRestrictedSlug, @@ -397,6 +396,26 @@ describe('fields - relationship', () => { await expect(options).toContainText('truth') }) + test('should allow docs with same ID but different collections to be selectable', async () => { + const mixedMedia = new AdminUrlUtil(serverURL, mixedMediaCollectionSlug) + await page.goto(mixedMedia.create) + // wait for relationship options to load + const podcastsFilterOptionsReq = page.waitForResponse(/api\/podcasts/) + const videosFilterOptionsReq = page.waitForResponse(/api\/videos/) + // select relationshipMany field that relies on siblingData field above + await page.locator('#field-relatedMedia .rs__control').click() + await podcastsFilterOptionsReq + await videosFilterOptionsReq + + const options = page.locator('.rs__option') + await expect(options).toHaveCount(4) // 4 docs + await options.locator(`text=Video 0`).click() + + await page.locator('#field-relatedMedia .rs__control').click() + const remainingOptions = page.locator('.rs__option') + await expect(remainingOptions).toHaveCount(3) // 3 docs + }) + // TODO: Flaky test in CI - fix. test.skip('should open document drawer from read-only relationships', async () => { const editURL = url.edit(docWithExistingRelations.id) diff --git a/test/fields-relationship/payload-types.ts b/test/fields-relationship/payload-types.ts index f751fff6e3d..53a28b41195 100644 --- a/test/fields-relationship/payload-types.ts +++ b/test/fields-relationship/payload-types.ts @@ -18,6 +18,9 @@ export interface Config { 'relation-updated-externally': RelationUpdatedExternally; 'collection-1': Collection1; 'collection-2': Collection2; + videos: Video; + podcasts: Podcast; + mixedMedia: MixedMedia; users: User; 'payload-preferences': PayloadPreference; 'payload-migrations': PayloadMigration; @@ -192,6 +195,47 @@ export interface Collection2 { updatedAt: string; createdAt: string; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "videos". + */ +export interface Video { + id: number; + title?: string | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "podcasts". + */ +export interface Podcast { + id: number; + title?: string | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "mixedMedia". + */ +export interface MixedMedia { + id: string; + relatedMedia?: + | ( + | { + relationTo: 'videos'; + value: number | Video; + } + | { + relationTo: 'podcasts'; + value: number | Podcast; + } + )[] + | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "users".
ac97bfdc47ade496109ffb1737014c7521e73902
2025-01-08 19:07:29
Jarrod Flesch
chore: import copy icon from nested folder (#9223)
false
import copy icon from nested folder (#9223)
chore
null
8a6d995425966c980f53bb0a77724502b9922c25
2025-01-28 23:51:42
Said Akhrarov
fix(ui): correctly reset blocksDrawer search state after close (#10847)
false
correctly reset blocksDrawer search state after close (#10847)
fix
diff --git a/packages/ui/src/fields/Blocks/BlocksDrawer/index.tsx b/packages/ui/src/fields/Blocks/BlocksDrawer/index.tsx index 6e6034b91f2..895f54dc394 100644 --- a/packages/ui/src/fields/Blocks/BlocksDrawer/index.tsx +++ b/packages/ui/src/fields/Blocks/BlocksDrawer/index.tsx @@ -42,10 +42,10 @@ export const BlocksDrawer: React.FC<Props> = (props) => { const { i18n, t } = useTranslation() useEffect(() => { - if (!isModalOpen) { + if (!isModalOpen(drawerSlug)) { setSearchTerm('') } - }, [isModalOpen]) + }, [isModalOpen, drawerSlug]) useEffect(() => { const searchTermToUse = searchTerm.toLowerCase() diff --git a/test/fields/collections/Blocks/e2e.spec.ts b/test/fields/collections/Blocks/e2e.spec.ts index c56fdbfe6fa..8ec1b4089eb 100644 --- a/test/fields/collections/Blocks/e2e.spec.ts +++ b/test/fields/collections/Blocks/e2e.spec.ts @@ -86,6 +86,33 @@ describe('Block fields', () => { ) }) + test('should reset search state in blocks drawer on re-open', async () => { + await page.goto(url.create) + const addButton = page.locator('#field-blocks > .blocks-field__drawer-toggler') + await expect(addButton).toContainText('Add Block') + await addButton.click() + + const blocksDrawer = page.locator('[id^=drawer_1_blocks-drawer-]') + await expect(blocksDrawer).toBeVisible() + + const searchInput = page.locator('.block-search__input') + await searchInput.fill('Number') + + // select the first block in the drawer + const firstBlockSelector = blocksDrawer + .locator('.blocks-drawer__blocks .blocks-drawer__block') + .first() + + await expect(firstBlockSelector).toContainText('Number') + + await page.locator('.drawer__header__close').click() + await addButton.click() + + await expect(blocksDrawer).toBeVisible() + await expect(searchInput).toHaveValue('') + await expect(firstBlockSelector).toContainText('Content') + }) + test('should open blocks drawer from block row and add below', async () => { await page.goto(url.create) const firstRow = page.locator('#field-blocks #blocks-row-0')
6d122905f45a71d5e952d653bde8d67c54609e1a
2024-04-09 06:49:03
Elliot DeNolf
chore: ignore new pointer files
false
ignore new pointer files
chore
diff --git a/packages/payload/.gitignore b/packages/payload/.gitignore index bf984651116..ffc0797a2d1 100644 --- a/packages/payload/.gitignore +++ b/packages/payload/.gitignore @@ -20,3 +20,7 @@ /versions.js /operations.js /operations.d.ts +/node.js +/node.d.ts +/uploads.js +/uploads.d.ts diff --git a/packages/payload/node.d.ts b/packages/payload/node.d.ts deleted file mode 100644 index 58a3d77ef77..00000000000 --- a/packages/payload/node.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { importConfig, importWithoutClientFiles } from './dist/utilities/importWithoutClientFiles.js'; -//# sourceMappingURL=node.d.ts.map \ No newline at end of file diff --git a/packages/payload/node.js b/packages/payload/node.js deleted file mode 100644 index 9973c022ede..00000000000 --- a/packages/payload/node.js +++ /dev/null @@ -1,3 +0,0 @@ -export { importConfig, importWithoutClientFiles } from './dist/utilities/importWithoutClientFiles.js'; - -//# sourceMappingURL=node.js.map \ No newline at end of file diff --git a/packages/payload/uploads.d.ts b/packages/payload/uploads.d.ts deleted file mode 100644 index d741ff4ea03..00000000000 --- a/packages/payload/uploads.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { getFileByPath } from './dist/uploads/getFileByPath.js'; -//# sourceMappingURL=uploads.d.ts.map diff --git a/packages/payload/uploads.js b/packages/payload/uploads.js deleted file mode 100644 index bae8119abf0..00000000000 --- a/packages/payload/uploads.js +++ /dev/null @@ -1,3 +0,0 @@ -export { getFileByPath } from './dist/uploads/getFileByPath.js'; - -//# sourceMappingURL=uploads.js.map
f234f68019f122bd46cb2af2e8f62cf07cd53c1b
2021-11-30 03:38:32
Jacob Fletcher
feat: abstracts upload component
false
abstracts upload component
feat
diff --git a/demo/collections/CustomComponents/components/fields/Upload/Field/index.tsx b/demo/collections/CustomComponents/components/fields/Upload/Field/index.tsx index dd5b0f49671..f5ee4865b99 100644 --- a/demo/collections/CustomComponents/components/fields/Upload/Field/index.tsx +++ b/demo/collections/CustomComponents/components/fields/Upload/Field/index.tsx @@ -1,7 +1,9 @@ -import React, { useCallback, useState } from 'react'; -import Upload from '../../../../../../../src/admin/components/forms/field-types/Upload'; +import { useConfig } from '@payloadcms/config-provider'; +import React, { useCallback } from 'react'; +import UploadInput from '../../../../../../../src/admin/components/forms/field-types/Upload/Input'; import { Props as UploadFieldType } from '../../../../../../../src/admin/components/forms/field-types/Upload/types'; import useField from '../../../../../../../src/admin/components/forms/useField'; +import { SanitizedCollectionConfig } from '../../../../../../../src/collections/config/types'; const Text: React.FC<UploadFieldType> = (props) => { const { @@ -9,30 +11,47 @@ const Text: React.FC<UploadFieldType> = (props) => { name, label, relationTo, - fieldTypes + fieldTypes, } = props; const { value, - setValue + setValue, + showError, } = useField({ - path + path, }); const onChange = useCallback((incomingValue) => { - setValue(incomingValue) - }, []) + const incomingID = incomingValue?.id || incomingValue; + setValue(incomingID); + }, [setValue]); + + const { + collections, + serverURL, + routes: { + api, + }, + } = useConfig(); + + const collection = collections.find((coll) => coll.slug === relationTo) || undefined; return ( - <Upload + <UploadInput + path={path} relationTo={relationTo} fieldTypes={fieldTypes} name={name} label={label} value={value as string} onChange={onChange} + showError={showError} + collection={collection as SanitizedCollectionConfig} + serverURL={serverURL} + api={api} /> - ) + ); }; export default Text; diff --git a/src/admin/components/forms/field-types/Upload/Input.tsx b/src/admin/components/forms/field-types/Upload/Input.tsx new file mode 100644 index 00000000000..c5636e56651 --- /dev/null +++ b/src/admin/components/forms/field-types/Upload/Input.tsx @@ -0,0 +1,173 @@ +import React, { useEffect, useState } from 'react'; +import { useModal } from '@faceless-ui/modal'; +import Button from '../../../elements/Button'; +import Label from '../../Label'; +import Error from '../../Error'; +import FileDetails from '../../../elements/FileDetails'; +import FieldDescription from '../../FieldDescription'; +import { UploadField } from '../../../../../fields/config/types'; +import { Description } from '../../FieldDescription/types'; +import { FieldTypes } from '..'; +import AddModal from './Add'; +import SelectExistingModal from './SelectExisting'; +import { SanitizedCollectionConfig } from '../../../../../collections/config/types'; + +import './index.scss'; + +const baseClass = 'upload'; + +export type UploadInputProps = Omit<UploadField, 'type'> & { + showError: boolean + errorMessage?: string + readOnly?: boolean + path?: string + required?: boolean + value?: string + description?: Description + onChange?: (e) => void + placeholder?: string + style?: React.CSSProperties + width?: string + fieldTypes?: FieldTypes + collection?: SanitizedCollectionConfig + serverURL?: string + api?: string +} + +const UploadInput: React.FC<UploadInputProps> = (props) => { + const { + path, + required, + readOnly, + style, + width, + description, + label, + relationTo, + fieldTypes, + value, + onChange, + showError, + serverURL = 'http://localhost:3000', + api = '/api', + collection, + errorMessage, + } = props; + + const { toggle } = useModal(); + + const addModalSlug = `${path}-add`; + const selectExistingModalSlug = `${path}-select-existing`; + + const [file, setFile] = useState(undefined); + const [missingFile, setMissingFile] = useState(false); + + const classes = [ + 'field-type', + baseClass, + showError && 'error', + readOnly && 'read-only', + ].filter(Boolean).join(' '); + + useEffect(() => { + if (typeof value === 'string' && value !== '') { + const fetchFile = async () => { + const response = await fetch(`${serverURL}${api}/${relationTo}/${value}`); + + if (response.ok) { + const json = await response.json(); + setFile(json); + } else { + setMissingFile(true); + setFile(undefined); + } + }; + + fetchFile(); + } else { + setFile(undefined); + } + }, [ + value, + relationTo, + api, + serverURL, + ]); + + return ( + <div + className={classes} + style={{ + ...style, + width, + }} + > + <Error + showError={showError} + message={errorMessage} + /> + <Label + htmlFor={path} + label={label} + required={required} + /> + {collection?.upload && ( + <React.Fragment> + {(file && !missingFile) && ( + <FileDetails + collection={collection} + doc={file} + handleRemove={() => { + onChange(null); + }} + /> + )} + {(!file || missingFile) && ( + <div className={`${baseClass}__wrap`}> + <Button + buttonStyle="secondary" + onClick={() => { + toggle(addModalSlug); + }} + > + Upload new + {' '} + {collection.labels.singular} + </Button> + <Button + buttonStyle="secondary" + onClick={() => { + toggle(selectExistingModalSlug); + }} + > + Choose from existing + </Button> + </div> + )} + <AddModal + {...{ + collection, + slug: addModalSlug, + fieldTypes, + setValue: onChange, + }} + /> + <SelectExistingModal + {...{ + collection, + slug: selectExistingModalSlug, + setValue: onChange, + addModalSlug, + }} + /> + <FieldDescription + value={file} + description={description} + /> + </React.Fragment> + )} + </div> + ); +}; + +export default UploadInput; diff --git a/src/admin/components/forms/field-types/Upload/index.tsx b/src/admin/components/forms/field-types/Upload/index.tsx index bb76e35c132..859bc5abbbf 100644 --- a/src/admin/components/forms/field-types/Upload/index.tsx +++ b/src/admin/components/forms/field-types/Upload/index.tsx @@ -1,27 +1,21 @@ -import React, { useState, useEffect, useCallback } from 'react'; -import { useModal } from '@faceless-ui/modal'; +import React, { useCallback } from 'react'; import { useConfig } from '@payloadcms/config-provider'; import useField from '../../useField'; import withCondition from '../../withCondition'; -import Button from '../../../elements/Button'; -import Label from '../../Label'; -import Error from '../../Error'; import { upload } from '../../../../../fields/validations'; -import FileDetails from '../../../elements/FileDetails'; -import AddModal from './Add'; -import SelectExistingModal from './SelectExisting'; import { Props } from './types'; +import UploadInput from './Input'; import './index.scss'; -import FieldDescription from '../../FieldDescription'; - -const baseClass = 'upload'; const Upload: React.FC<Props> = (props) => { - const { toggle } = useModal(); - const [internalValue, setInternalValue] = useState(undefined); - const [missingFile, setMissingFile] = useState(false); - const { collections, serverURL, routes: { api } } = useConfig(); + const { + collections, + serverURL, + routes: { + api, + }, + } = useConfig(); const { path: pathFromProps, @@ -38,15 +32,11 @@ const Upload: React.FC<Props> = (props) => { validate = upload, relationTo, fieldTypes, - value: valueFromProps, - onChange: onChangeFromProps, } = props; const collection = collections.find((coll) => coll.slug === relationTo); const path = pathFromProps || name; - const addModalSlug = `${path}-add`; - const selectExistingModalSlug = `${path}-select-existing`; const memoizedValidate = useCallback((value) => { const validationResult = validate(value, { required }); @@ -60,132 +50,42 @@ const Upload: React.FC<Props> = (props) => { }); const { - value: valueFromContext, + value, showError, setValue, errorMessage, } = fieldType; - const value = valueFromProps || valueFromContext || ''; - - const classes = [ - 'field-type', - baseClass, - showError && 'error', - readOnly && 'read-only', - ].filter(Boolean).join(' '); - - useEffect(() => { - if (typeof value === 'string') { - const fetchFile = async () => { - const response = await fetch(`${serverURL}${api}/${relationTo}/${value}`); - - if (response.ok) { - const json = await response.json(); - setInternalValue(json); - } else { - setInternalValue(undefined); - setMissingFile(true); - } - }; - - fetchFile(); - } + const onChange = useCallback((incomingValue) => { + const incomingID = incomingValue?.id || incomingValue; + setValue(incomingID); }, [ - value, - relationTo, - api, - serverURL, - setValue + setValue, ]); - useEffect(() => { - const { id: incomingID } = internalValue || {}; - if (typeof onChangeFromProps === 'function') { - onChangeFromProps(incomingID) - } else { - setValue(incomingID); - } - }, [internalValue]); - - return ( - <div - className={classes} - style={{ - ...style, - width, - }} - > - <Error - showError={showError} - message={errorMessage} - /> - <Label - htmlFor={path} + if (collection.upload) { + return ( + <UploadInput + value={value as string} + onChange={onChange} + description={description} label={label} required={required} + showError={showError} + serverURL={serverURL} + api={api} + errorMessage={errorMessage} + readOnly={readOnly} + style={style} + width={width} + collection={collection} + fieldTypes={fieldTypes} + name={name} + relationTo={relationTo} /> - {collection?.upload && ( - <React.Fragment> - {(internalValue && !missingFile) && ( - <FileDetails - collection={collection} - doc={internalValue} - handleRemove={() => { - setInternalValue(undefined); - setValue(null); - }} - /> - )} - {(!value || missingFile) && ( - <div className={`${baseClass}__wrap`}> - <Button - buttonStyle="secondary" - onClick={() => { - toggle(addModalSlug); - }} - > - Upload new - {' '} - {collection.labels.singular} - </Button> - <Button - buttonStyle="secondary" - onClick={() => { - toggle(selectExistingModalSlug); - }} - > - Choose from existing - </Button> - </div> - )} - <AddModal {...{ - collection, - slug: addModalSlug, - fieldTypes, - setValue: (val) => { - setMissingFile(false); - setInternalValue(val); - }, - }} - /> - <SelectExistingModal {...{ - collection, - slug: selectExistingModalSlug, - setValue: (val) => { - setMissingFile(false); - setInternalValue(val); - }, - addModalSlug, - }} - /> - <FieldDescription - value={value} - description={description} - /> - </React.Fragment> - )} - </div> - ); + ); + } + + return null; }; export default withCondition(Upload); diff --git a/src/admin/components/forms/useField/index.tsx b/src/admin/components/forms/useField/index.tsx index d87b7c5547c..2a6a9246043 100644 --- a/src/admin/components/forms/useField/index.tsx +++ b/src/admin/components/forms/useField/index.tsx @@ -113,6 +113,7 @@ const useField = <T extends unknown>(options: Options): FieldType<T> => { sendField(valueToSend); } }, [ + path, valueToSend, sendField, field, diff --git a/src/fields/config/types.ts b/src/fields/config/types.ts index d7f6e976679..6aeec910eb9 100644 --- a/src/fields/config/types.ts +++ b/src/fields/config/types.ts @@ -167,8 +167,6 @@ export type UploadField = FieldBase & { type: 'upload' relationTo: string maxDepth?: number - value?: string - onChange?: (value: string) => void } type CodeAdmin = Admin & {