payload 3.0.0-beta.97 → 3.0.0-beta.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { EditorProps } from '@monaco-editor/react'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { CSSProperties } from 'react'\nimport type { DeepUndefinable } from 'ts-essentials'\n\nimport type { RichTextAdapter, RichTextAdapterProvider } from '../../admin/RichText.js'\nimport type {\n ArrayFieldErrorClientComponent,\n ArrayFieldErrorServerComponent,\n ArrayFieldLabelClientComponent,\n ArrayFieldLabelServerComponent,\n ArrayFieldProps,\n BlockFieldErrorClientComponent,\n BlockFieldErrorServerComponent,\n BlockFieldProps,\n CheckboxFieldErrorClientComponent,\n CheckboxFieldErrorServerComponent,\n CheckboxFieldLabelClientComponent,\n CheckboxFieldLabelServerComponent,\n CheckboxFieldProps,\n ClientTab,\n CodeFieldErrorClientComponent,\n CodeFieldErrorServerComponent,\n CodeFieldLabelClientComponent,\n CodeFieldLabelServerComponent,\n CodeFieldProps,\n CollapsibleFieldLabelClientComponent,\n CollapsibleFieldLabelServerComponent,\n CollapsibleFieldProps,\n ConditionalDateProps,\n DateFieldErrorClientComponent,\n DateFieldErrorServerComponent,\n DateFieldLabelClientComponent,\n DateFieldLabelServerComponent,\n DateFieldProps,\n Description,\n EmailFieldErrorClientComponent,\n EmailFieldErrorServerComponent,\n EmailFieldLabelClientComponent,\n EmailFieldLabelServerComponent,\n EmailFieldProps,\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n GroupFieldLabelClientComponent,\n GroupFieldLabelServerComponent,\n GroupFieldProps,\n HiddenFieldProps,\n JSONFieldErrorClientComponent,\n JSONFieldErrorServerComponent,\n JSONFieldLabelClientComponent,\n JSONFieldLabelServerComponent,\n JSONFieldProps,\n MappedComponent,\n NumberFieldErrorClientComponent,\n NumberFieldErrorServerComponent,\n NumberFieldLabelClientComponent,\n NumberFieldLabelServerComponent,\n NumberFieldProps,\n PointFieldErrorClientComponent,\n PointFieldErrorServerComponent,\n PointFieldLabelClientComponent,\n PointFieldLabelServerComponent,\n PointFieldProps,\n RadioFieldErrorClientComponent,\n RadioFieldErrorServerComponent,\n RadioFieldLabelClientComponent,\n RadioFieldLabelServerComponent,\n RadioFieldProps,\n RelationshipFieldErrorClientComponent,\n RelationshipFieldErrorServerComponent,\n RelationshipFieldLabelClientComponent,\n RelationshipFieldLabelServerComponent,\n RelationshipFieldProps,\n RichTextFieldProps,\n RowFieldProps,\n RowLabelComponent,\n SelectFieldErrorClientComponent,\n SelectFieldErrorServerComponent,\n SelectFieldLabelClientComponent,\n SelectFieldLabelServerComponent,\n SelectFieldProps,\n StaticDescription,\n TabsFieldProps,\n TextareaFieldErrorClientComponent,\n TextareaFieldErrorServerComponent,\n TextareaFieldLabelClientComponent,\n TextareaFieldLabelServerComponent,\n TextareaFieldProps,\n TextFieldErrorClientComponent,\n TextFieldErrorServerComponent,\n TextFieldLabelClientComponent,\n TextFieldLabelServerComponent,\n UploadFieldErrorClientComponent,\n UploadFieldErrorServerComponent,\n UploadFieldLabelClientComponent,\n UploadFieldLabelServerComponent,\n UploadFieldProps,\n} from '../../admin/types.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js'\nimport type {\n CustomComponent,\n LabelFunction,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, PayloadRequest, RequestContext, Where } from '../../types/index.js'\n\nexport type FieldHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n /**\n * Only available in `afterRead` hooks\n */\n currentDepth?: number /**\n * Only available in `afterRead` hooks\n */\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /**\n * Only available in the `afterRead` hook.\n */\n depth?: number\n draft?: boolean\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n overrideAccess?: boolean\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n /** The document before changes were applied, only in `afterChange` hooks. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied, only in `beforeChange`, `beforeValidate`, `beforeDuplicate` and `afterChange` field hooks. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes, only in `beforeChange`, `afterChange`, `beforeDuplicate` and `beforeValidate` field hooks. */\n previousValue?: TValue\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /**\n * Only available in the `afterRead` hook.\n */\n showHiddenFields?: boolean\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /**\n * The original siblingData with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n siblingDocWithLocales?: Record<string, unknown>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type FieldHook<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = (\n args: FieldHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type FieldAccess<TData extends TypeWithID = any, TSiblingData = any> = (args: {\n /**\n * The incoming data used to `create` or `update` the document with. `data` is undefined during the `read` operation.\n */\n data?: Partial<TData>\n /**\n * The original data of the document before the `update` is applied. `doc` is undefined during the `create` operation.\n */\n doc?: TData\n /**\n * The `id` of the current document being read or updated. `id` is undefined during the `create` operation.\n */\n id?: number | string\n /** The `payload` object to interface with the payload API */\n req: PayloadRequest\n /**\n * Immediately adjacent data to this field. For example, if this is a `group` field, then `siblingData` will be the other fields within the group.\n */\n siblingData?: Partial<TSiblingData>\n}) => boolean | Promise<boolean>\n\nexport type Condition<TData extends TypeWithID = any, TSiblingData = any> = (\n data: Partial<TData>,\n siblingData: Partial<TSiblingData>,\n { user }: { user: PayloadRequest['user'] },\n) => boolean\n\nexport type FilterOptionsProps<TData = any> = {\n /**\n * An object containing the full collection or global document currently being edited.\n */\n data: TData\n /**\n * The `id` of the current document being edited. `id` is undefined during the `create` operation.\n */\n id: number | string\n /**\n * The collection `slug` to filter against, limited to this field's `relationTo` property.\n */\n relationTo: CollectionSlug\n /**\n * An object containing document data that is scoped to only fields within the same parent of this field.\n */\n siblingData: unknown\n /**\n * An object containing the currently authenticated user.\n */\n user: Partial<PayloadRequest['user']>\n}\n\nexport type FilterOptionsFunc<TData = any> = (\n options: FilterOptionsProps<TData>,\n) => boolean | Promise<boolean | Where> | Where\n\nexport type FilterOptions<TData = any> =\n | ((options: FilterOptionsProps<TData>) => boolean | Promise<boolean | Where> | Where)\n | null\n | Where\n\ntype Admin = {\n className?: string\n components?: {\n Cell?: CustomComponent\n Description?: CustomComponent<FieldDescriptionClientComponent | FieldDescriptionServerComponent>\n Field?: CustomComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: PayloadComponent\n }\n /**\n * You can programmatically show / hide fields based on what other fields are doing.\n * This is also run on the server, to determine if the field should be validated.\n */\n condition?: Condition\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n description?: Description\n disableBulkEdit?: boolean\n disabled?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n /**\n * Shows / hides fields from appearing in the list view filter options.\n * @type boolean\n */\n disableListFilter?: boolean\n hidden?: boolean\n position?: 'sidebar'\n readOnly?: boolean\n style?: CSSProperties\n width?: string\n}\n\nexport type AdminClient = {\n className?: string\n components?: {\n Cell?: MappedComponent\n Description?: MappedComponent\n Field?: MappedComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: MappedComponent\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n description?: StaticDescription\n disableBulkEdit?: boolean\n disabled?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n /**\n * Shows / hides fields from appearing in the list view filter options.\n * @type boolean\n */\n disableListFilter?: boolean\n hidden?: boolean\n position?: 'sidebar'\n readOnly?: boolean\n style?: CSSProperties\n width?: string\n}\n\nexport type Labels = {\n plural: LabelFunction | StaticLabel\n singular: LabelFunction | StaticLabel\n}\n\nexport type LabelsClient = {\n plural: StaticLabel\n singular: StaticLabel\n}\n\nexport type BaseValidateOptions<TData, TSiblingData, TValue> = {\n collectionSlug?: string\n data: Partial<TData>\n id?: number | string\n operation?: Operation\n preferences: DocumentPreferences\n previousValue?: TValue\n req: PayloadRequest\n required?: boolean\n siblingData: Partial<TSiblingData>\n}\n\nexport type ValidateOptions<\n TData,\n TSiblingData,\n TFieldConfig extends object,\n TValue,\n> = BaseValidateOptions<TData, TSiblingData, TValue> & TFieldConfig\n\nexport type Validate<\n TValue = any,\n TData = any,\n TSiblingData = any,\n TFieldConfig extends object = object,\n> = (\n value: TValue,\n options: ValidateOptions<TData, TSiblingData, TFieldConfig, TValue>,\n) => Promise<string | true> | string | true\n\nexport type OptionObject = {\n label: LabelFunction | StaticLabel\n value: string\n}\n\nexport type Option = OptionObject | string\n\nexport interface FieldBase {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same field multiple times.\n */\n _sanitized?: boolean\n access?: {\n create?: FieldAccess\n read?: FieldAccess\n update?: FieldAccess\n }\n admin?: Admin\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n defaultValue?: any\n hidden?: boolean\n hooks?: {\n afterChange?: FieldHook[]\n afterRead?: FieldHook[]\n beforeChange?: FieldHook[]\n /**\n * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.\n */\n beforeDuplicate?: FieldHook[]\n beforeValidate?: FieldHook[]\n }\n index?: boolean\n label?: false | LabelFunction | StaticLabel\n localized?: boolean\n /**\n * The name of the field. Must be alphanumeric and cannot contain ' . '\n *\n * Must not be one of reserved field names: ['__v', 'salt', 'hash', 'file']\n * @link https://payloadcms.com/docs/fields/overview#field-names\n */\n name: string\n required?: boolean\n saveToJWT?: boolean | string\n /**\n * Allows you to modify the base JSON schema that is generated during generate:types for this field.\n * This JSON schema will be used to generate the TypeScript interface of this field.\n */\n typescriptSchema?: Array<(args: { jsonSchema: JSONSchema4 }) => JSONSchema4>\n unique?: boolean\n validate?: Validate\n}\n\nexport interface FieldBaseClient {\n _isPresentational?: undefined\n _path?: string\n _schemaPath?: string\n admin?: AdminClient\n hidden?: boolean\n index?: boolean\n label?: StaticLabel\n localized?: boolean\n /**\n * The name of the field. Must be alphanumeric and cannot contain ' . '\n *\n * Must not be one of reserved field names: ['__v', 'salt', 'hash', 'file']\n * @link https://payloadcms.com/docs/fields/overview#field-names\n */\n name?: string\n required?: boolean\n saveToJWT?: boolean | string\n /**\n * Allows you to modify the base JSON schema that is generated during generate:types for this field.\n * This JSON schema will be used to generate the TypeScript interface of this field.\n */\n typescriptSchema?: Array<(args: { jsonSchema: JSONSchema4 }) => JSONSchema4>\n unique?: boolean\n}\n\nexport type NumberField = {\n admin?: {\n /** Set this property to a string that will be used for browser autocomplete. */\n autoComplete?: string\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<NumberFieldErrorClientComponent | NumberFieldErrorServerComponent>\n Label?: CustomComponent<NumberFieldLabelClientComponent | NumberFieldLabelServerComponent>\n } & Admin['components']\n /** Set this property to define a placeholder string for the field. */\n placeholder?: Record<string, string> | string\n /** Set a value for the number field to increment / decrement using browser controls. */\n step?: number\n } & Admin\n /** Maximum value accepted. Used in the default `validate` function. */\n max?: number\n /** Minimum value accepted. Used in the default `validate` function. */\n min?: number\n type: 'number'\n validate?: Validate<number | number[], unknown, unknown, NumberField>\n} & (\n | {\n /** Makes this field an ordered array of numbers instead of just a single number. */\n hasMany: true\n /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */\n maxRows?: number\n /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */\n minRows?: number\n }\n | {\n /** Makes this field an ordered array of numbers instead of just a single number. */\n hasMany?: false | undefined\n /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */\n maxRows?: undefined\n /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */\n minRows?: undefined\n }\n) &\n FieldBase\n\nexport type NumberFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<NumberField['admin'], 'autoComplete' | 'placeholder' | 'step'>\n} & FieldBaseClient &\n Pick<NumberField, 'hasMany' | 'max' | 'maxRows' | 'min' | 'minRows' | 'type'>\n\nexport type TextField = {\n admin?: {\n autoComplete?: string\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<TextFieldErrorClientComponent | TextFieldErrorServerComponent>\n Label?: CustomComponent<TextFieldLabelClientComponent | TextFieldLabelServerComponent>\n } & Admin['components']\n placeholder?: Record<string, string> | string\n rtl?: boolean\n } & Admin\n maxLength?: number\n minLength?: number\n type: 'text'\n validate?: Validate<string | string[], unknown, unknown, TextField>\n} & (\n | {\n /** Makes this field an ordered array of strings instead of just a single string. */\n hasMany: true\n /** Maximum number of strings in the strings array, if `hasMany` is set to true. */\n maxRows?: number\n /** Minimum number of strings in the strings array, if `hasMany` is set to true. */\n minRows?: number\n }\n | {\n /** Makes this field an ordered array of strings instead of just a single string. */\n hasMany?: false | undefined\n /** Maximum number of strings in the strings array, if `hasMany` is set to true. */\n maxRows?: undefined\n /** Minimum number of strings in the strings array, if `hasMany` is set to true. */\n minRows?: undefined\n }\n) &\n FieldBase\n\nexport type TextFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<TextField['admin'], 'autoComplete' | 'placeholder' | 'rtl'>\n} & FieldBaseClient &\n Pick<TextField, 'hasMany' | 'maxLength' | 'maxRows' | 'minLength' | 'minRows' | 'type'>\n\nexport type EmailField = {\n admin?: {\n autoComplete?: string\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<EmailFieldErrorClientComponent | EmailFieldErrorServerComponent>\n Label?: CustomComponent<EmailFieldLabelClientComponent | EmailFieldLabelServerComponent>\n } & Admin['components']\n placeholder?: Record<string, string> | string\n } & Admin\n type: 'email'\n validate?: Validate<string, unknown, unknown, EmailField>\n} & FieldBase\n\nexport type EmailFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<EmailField['admin'], 'placeholder'>\n} & FieldBaseClient &\n Pick<EmailField, 'type'>\n\nexport type TextareaField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<TextareaFieldErrorClientComponent | TextareaFieldErrorServerComponent>\n Label?: CustomComponent<TextareaFieldLabelClientComponent | TextareaFieldLabelServerComponent>\n } & Admin['components']\n placeholder?: Record<string, string> | string\n rows?: number\n rtl?: boolean\n } & Admin\n maxLength?: number\n minLength?: number\n type: 'textarea'\n validate?: Validate<string, unknown, unknown, TextareaField>\n} & FieldBase\n\nexport type TextareaFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<TextareaField['admin'], 'placeholder' | 'rows' | 'rtl'>\n} & FieldBaseClient &\n Pick<TextareaField, 'maxLength' | 'minLength' | 'type'>\n\nexport type CheckboxField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<CheckboxFieldErrorClientComponent | CheckboxFieldErrorServerComponent>\n Label?: CustomComponent<CheckboxFieldLabelClientComponent | CheckboxFieldLabelServerComponent>\n } & Admin['components']\n } & Admin\n type: 'checkbox'\n validate?: Validate<unknown, unknown, unknown, CheckboxField>\n} & FieldBase\n\nexport type CheckboxFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient\n} & FieldBaseClient &\n Pick<CheckboxField, 'type'>\n\nexport type DateField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<DateFieldErrorClientComponent | DateFieldErrorServerComponent>\n Label?: CustomComponent<DateFieldLabelClientComponent | DateFieldLabelServerComponent>\n } & Admin['components']\n date?: ConditionalDateProps\n placeholder?: Record<string, string> | string\n } & Admin\n type: 'date'\n validate?: Validate<unknown, unknown, unknown, DateField>\n} & FieldBase\n\nexport type DateFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<DateField['admin'], 'date' | 'placeholder'>\n} & FieldBaseClient &\n Pick<DateField, 'type'>\n\nexport type GroupField = {\n admin?: {\n components?: {\n Label?: CustomComponent<GroupFieldLabelClientComponent | GroupFieldLabelServerComponent>\n } & Admin['components']\n hideGutter?: boolean\n } & Admin\n fields: Field[]\n /** Customize generated GraphQL and Typescript schema names.\n * By default, it is bound to the collection.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n type: 'group'\n validate?: Validate<unknown, unknown, unknown, GroupField>\n} & Omit<FieldBase, 'required'>\n\nexport type GroupFieldClient = {\n admin?: {\n components?: {\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<GroupField['admin'], 'hideGutter'>\n fields: ClientField[]\n} & Omit<FieldBaseClient, 'required'> &\n Pick<GroupField, 'interfaceName' | 'type'>\n\nexport type RowField = {\n admin?: Omit<Admin, 'description'>\n fields: Field[]\n type: 'row'\n} & Omit<FieldBase, 'admin' | 'label' | 'name' | 'validate'>\n\nexport type RowFieldClient = {\n admin?: Omit<AdminClient, 'description'>\n fields: ClientField[]\n} & Omit<FieldBaseClient, 'admin' | 'label' | 'name' | 'validate'> &\n Pick<RowField, 'type'>\n\nexport type CollapsibleField = {\n fields: Field[]\n type: 'collapsible'\n} & (\n | {\n admin: {\n components: {\n Label?: CustomComponent<\n CollapsibleFieldLabelClientComponent | CollapsibleFieldLabelServerComponent\n >\n RowLabel: RowLabelComponent\n } & Admin['components']\n initCollapsed?: boolean\n } & Admin\n label?: Required<FieldBase['label']>\n }\n | {\n admin?: {\n components?: {\n Label?: CustomComponent<\n CollapsibleFieldLabelClientComponent | CollapsibleFieldLabelServerComponent\n >\n } & Admin['components']\n initCollapsed?: boolean\n } & Admin\n label: Required<FieldBase['label']>\n }\n) &\n Omit<FieldBase, 'label' | 'name' | 'validate'>\n\nexport type CollapsibleFieldClient = {\n fields: ClientField[]\n} & (\n | {\n admin: {\n components: {\n RowLabel: MappedComponent\n } & AdminClient['components']\n initCollapsed?: boolean\n } & AdminClient\n label?: Required<FieldBaseClient['label']>\n }\n | {\n admin?: {\n initCollapsed?: boolean\n } & AdminClient\n label: Required<FieldBaseClient['label']>\n }\n) &\n Omit<FieldBaseClient, 'label' | 'name' | 'validate'> &\n Pick<CollapsibleField, 'type'>\n\ntype TabBase = {\n description?: Description\n fields: Field[]\n interfaceName?: string\n saveToJWT?: boolean | string\n} & Omit<FieldBase, 'required' | 'validate'>\n\nexport type NamedTab = {\n /** Customize generated GraphQL and Typescript schema names.\n * The slug is used by default.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n} & TabBase\n\nexport type UnnamedTab = {\n interfaceName?: never\n /**\n * Can be either:\n * - A string, which will be used as the tab's label.\n * - An object, where the key is the language code and the value is the label.\n */\n label:\n | {\n [selectedLanguage: string]: string\n }\n | LabelFunction\n | string\n localized?: never\n} & Omit<TabBase, 'name'>\n\nexport type Tab = NamedTab | UnnamedTab\n\nexport type TabsField = {\n admin?: Omit<Admin, 'description'>\n tabs: Tab[]\n type: 'tabs'\n} & Omit<FieldBase, 'admin' | 'localized' | 'name' | 'saveToJWT'>\n\nexport type TabsFieldClient = {\n admin?: Omit<AdminClient, 'description'>\n tabs: ClientTab[]\n} & Omit<FieldBaseClient, 'admin' | 'localized' | 'name' | 'saveToJWT'> &\n Pick<TabsField, 'type'>\n\nexport type TabAsField = {\n name?: string\n type: 'tab'\n} & Tab\n\nexport type TabAsFieldClient = ClientTab & Pick<TabAsField, 'name' | 'type'>\n\nexport type UIField = {\n admin: {\n components?: {\n Cell?: CustomComponent\n Field: CustomComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: PayloadComponent\n } & Admin['components']\n condition?: Condition\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n disableBulkEdit?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n position?: string\n width?: string\n }\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n label?: Record<string, string> | string\n name: string\n type: 'ui'\n}\n\nexport type UIFieldClient = {\n _isPresentational?: true\n // still include FieldBaseClient.admin (even if it's undefinable) so that we don't need constant type checks (e.g. if('xy' in field))\n // eslint-disable-next-line perfectionist/sort-intersection-types\n admin: DeepUndefinable<FieldBaseClient['admin']> & {\n components?: {\n Cell?: MappedComponent\n Field: MappedComponent\n Filter?: MappedComponent\n } & AdminClient['components']\n } & Pick<\n UIField['admin'],\n 'custom' | 'disableBulkEdit' | 'disableListColumn' | 'position' | 'width'\n >\n} & 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))\n Pick<UIField, 'label' | 'name' | 'type'>\n\ntype SharedUploadProperties = {\n /**\n * Toggle the preview in the admin interface.\n */\n displayPreview?: boolean\n filterOptions?: FilterOptions\n hasMany?: boolean\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'upload'\n validate?: Validate<unknown, unknown, unknown, SharedUploadProperties>\n} & (\n | {\n hasMany: true\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: number\n maxRows?: number\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: number\n minRows?: number\n }\n | {\n hasMany?: false | undefined\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: undefined\n maxRows?: undefined\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: undefined\n minRows?: undefined\n }\n) &\n FieldBase\n\ntype SharedUploadPropertiesClient = FieldBaseClient &\n Pick<\n SharedUploadProperties,\n 'hasMany' | 'max' | 'maxDepth' | 'maxRows' | 'min' | 'minRows' | 'type'\n >\n\ntype UploadAdmin = {\n allowCreate?: boolean\n components?: {\n Error?: CustomComponent<\n RelationshipFieldErrorClientComponent | RelationshipFieldErrorServerComponent\n >\n Label?: CustomComponent<\n RelationshipFieldLabelClientComponent | RelationshipFieldLabelServerComponent\n >\n } & Admin['components']\n isSortable?: boolean\n} & Admin\ntype UploadAdminClient = {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n} & AdminClient &\n Pick<UploadAdmin, 'allowCreate' | 'isSortable'>\n\nexport type PolymorphicUploadField = {\n admin?: {\n sortOptions?: { [collectionSlug: CollectionSlug]: string }\n } & UploadAdmin\n relationTo: CollectionSlug[]\n} & SharedUploadProperties\n\nexport type PolymorphicUploadFieldClient = {\n admin?: {\n sortOptions?: Pick<PolymorphicUploadField['admin'], 'sortOptions'>\n } & UploadAdminClient\n} & Pick<PolymorphicUploadField, 'displayPreview' | 'maxDepth' | 'relationTo' | 'type'> &\n SharedUploadPropertiesClient\n\nexport type SingleUploadField = {\n admin?: {\n sortOptions?: string\n } & UploadAdmin\n relationTo: CollectionSlug\n} & SharedUploadProperties\n\nexport type SingleUploadFieldClient = {\n admin?: Pick<SingleUploadField['admin'], 'sortOptions'> & UploadAdminClient\n} & Pick<SingleUploadField, 'displayPreview' | 'maxDepth' | 'relationTo' | 'type'> &\n SharedUploadPropertiesClient\n\nexport type UploadField = /* PolymorphicUploadField | */ SingleUploadField\n\nexport type UploadFieldClient = /* PolymorphicUploadFieldClient | */ SingleUploadFieldClient\n\nexport type CodeField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<CodeFieldErrorClientComponent | CodeFieldErrorServerComponent>\n Label?: CustomComponent<CodeFieldLabelClientComponent | CodeFieldLabelServerComponent>\n } & Admin['components']\n editorOptions?: EditorProps['options']\n language?: string\n } & Admin\n maxLength?: number\n minLength?: number\n type: 'code'\n validate?: Validate<string, unknown, unknown, CodeField>\n} & Omit<FieldBase, 'admin'>\n\nexport type CodeFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<CodeField['admin'], 'editorOptions' | 'language'>\n} & Omit<FieldBaseClient, 'admin'> &\n Pick<CodeField, 'maxLength' | 'minLength' | 'type'>\n\nexport type JSONField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<JSONFieldErrorClientComponent | JSONFieldErrorServerComponent>\n Label?: CustomComponent<JSONFieldLabelClientComponent | JSONFieldLabelServerComponent>\n } & Admin['components']\n editorOptions?: EditorProps['options']\n } & Admin\n\n jsonSchema?: {\n fileMatch: string[]\n schema: JSONSchema4\n uri: string\n }\n type: 'json'\n validate?: Validate<Record<string, unknown>, unknown, unknown, JSONField>\n} & Omit<FieldBase, 'admin'>\n\nexport type JSONFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<JSONField['admin'], 'editorOptions'>\n} & Omit<FieldBaseClient, 'admin'> &\n Pick<JSONField, 'jsonSchema' | 'type'>\n\nexport type SelectField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<SelectFieldErrorClientComponent | SelectFieldErrorServerComponent>\n Label?: CustomComponent<SelectFieldLabelClientComponent | SelectFieldLabelServerComponent>\n } & Admin['components']\n isClearable?: boolean\n isSortable?: boolean\n } & Admin\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n /**\n * Customize the DB enum name\n */\n enumName?: DBIdentifierName\n hasMany?: boolean\n options: Option[]\n type: 'select'\n validate?: Validate<string, unknown, unknown, SelectField>\n} & FieldBase\n\nexport type SelectFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<SelectField['admin'], 'isClearable' | 'isSortable'>\n} & FieldBaseClient &\n Pick<SelectField, 'hasMany' | 'options' | 'type'>\n\ntype SharedRelationshipProperties = {\n filterOptions?: FilterOptions\n hasMany?: boolean\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'relationship'\n validate?: Validate<unknown, unknown, unknown, SharedRelationshipProperties>\n} & (\n | {\n hasMany: true\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: number\n maxRows?: number\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: number\n minRows?: number\n }\n | {\n hasMany?: false | undefined\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: undefined\n maxRows?: undefined\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: undefined\n minRows?: undefined\n }\n) &\n FieldBase\n\ntype SharedRelationshipPropertiesClient = FieldBaseClient &\n Pick<\n SharedRelationshipProperties,\n 'hasMany' | 'max' | 'maxDepth' | 'maxRows' | 'min' | 'minRows' | 'type'\n >\n\ntype RelationshipAdmin = {\n allowCreate?: boolean\n components?: {\n Error?: CustomComponent<\n RelationshipFieldErrorClientComponent | RelationshipFieldErrorServerComponent\n >\n Label?: CustomComponent<\n RelationshipFieldLabelClientComponent | RelationshipFieldLabelServerComponent\n >\n } & Admin['components']\n isSortable?: boolean\n} & Admin\n\ntype RelationshipAdminClient = {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n} & AdminClient &\n Pick<RelationshipAdmin, 'allowCreate' | 'isSortable'>\n\nexport type PolymorphicRelationshipField = {\n admin?: {\n sortOptions?: { [collectionSlug: CollectionSlug]: string }\n } & RelationshipAdmin\n relationTo: CollectionSlug[]\n} & SharedRelationshipProperties\n\nexport type PolymorphicRelationshipFieldClient = {\n admin?: {\n sortOptions?: Pick<PolymorphicRelationshipField['admin'], 'sortOptions'>\n } & RelationshipAdminClient\n} & Pick<PolymorphicRelationshipField, 'relationTo'> &\n SharedRelationshipPropertiesClient\n\nexport type SingleRelationshipField = {\n admin?: {\n sortOptions?: string\n } & RelationshipAdmin\n relationTo: CollectionSlug\n} & SharedRelationshipProperties\n\nexport type SingleRelationshipFieldClient = {\n admin?: Pick<SingleRelationshipField['admin'], 'sortOptions'> & RelationshipAdminClient\n} & Pick<SingleRelationshipField, 'relationTo'> &\n SharedRelationshipPropertiesClient\n\nexport type RelationshipField = PolymorphicRelationshipField | SingleRelationshipField\n\nexport type RelationshipFieldClient =\n | PolymorphicRelationshipFieldClient\n | SingleRelationshipFieldClient\n\nexport type ValueWithRelation = {\n relationTo: CollectionSlug\n value: number | string\n}\n\nexport function valueIsValueWithRelation(value: unknown): value is ValueWithRelation {\n return value !== null && typeof value === 'object' && 'relationTo' in value && 'value' in value\n}\n\nexport type RelationshipValue =\n | (number | string)[]\n | (number | string)\n | ValueWithRelation\n | ValueWithRelation[]\n\nexport type RichTextField<\n TValue extends object = any,\n TAdapterProps = any,\n TExtraProperties = object,\n> = {\n admin?: {\n components?: {\n Error?: CustomComponent\n Label?: CustomComponent\n } & Admin['components']\n } & Admin\n editor?:\n | RichTextAdapter<TValue, TAdapterProps, TExtraProperties>\n | RichTextAdapterProvider<TValue, TAdapterProps, TExtraProperties>\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'richText'\n} & FieldBase &\n TExtraProperties\n\nexport type RichTextFieldClient<\n TValue extends object = any,\n TAdapterProps = any,\n TExtraProperties = object,\n> = {\n admin?: {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n placeholder?: Record<string, string> | string\n } & AdminClient\n richTextComponentMap?: Map<string, any>\n} & FieldBaseClient &\n Pick<RichTextField<TValue, TAdapterProps, TExtraProperties>, 'maxDepth' | 'type'> &\n TExtraProperties\n\nexport type ArrayField = {\n admin?: {\n components?: {\n Error?: CustomComponent<ArrayFieldErrorClientComponent | ArrayFieldErrorServerComponent>\n Label?: CustomComponent<ArrayFieldLabelClientComponent | ArrayFieldLabelServerComponent>\n RowLabel?: RowLabelComponent\n } & Admin['components']\n initCollapsed?: boolean\n /**\n * Disable drag and drop sorting\n */\n isSortable?: boolean\n } & Admin\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n fields: Field[]\n /** Customize generated GraphQL and Typescript schema names.\n * By default, it is bound to the collection.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n labels?: Labels\n maxRows?: number\n minRows?: number\n type: 'array'\n validate?: Validate<unknown[], unknown, unknown, ArrayField>\n} & FieldBase\n\nexport type ArrayFieldClient = {\n admin?: {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n RowLabel?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<ArrayField['admin'], 'initCollapsed' | 'isSortable'>\n fields: ClientField[]\n labels?: LabelsClient\n} & FieldBaseClient &\n Pick<ArrayField, 'interfaceName' | 'maxRows' | 'minRows' | 'type'>\n\nexport type RadioField = {\n admin?: {\n components?: {\n Error?: CustomComponent<RadioFieldErrorClientComponent | RadioFieldErrorServerComponent>\n Label?: CustomComponent<RadioFieldLabelClientComponent | RadioFieldLabelServerComponent>\n } & Admin['components']\n layout?: 'horizontal' | 'vertical'\n } & Admin\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n /**\n * Customize the DB enum name\n */\n enumName?: DBIdentifierName\n options: Option[]\n type: 'radio'\n validate?: Validate<string, unknown, unknown, RadioField>\n} & FieldBase\n\nexport type RadioFieldClient = {\n admin?: {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<RadioField['admin'], 'layout'>\n} & FieldBaseClient &\n Pick<RadioField, 'options' | 'type'>\n\nexport type Block = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same block multiple times.\n */\n _sanitized?: boolean\n admin?: {\n components?: {\n Label?: PayloadComponent<\n never,\n {\n blockKind: 'block' | 'lexicalBlock' | 'lexicalInlineBlock' | string\n /**\n * May contain the formData\n */\n formData: Record<string, any>\n }\n >\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n }\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n fields: Field[]\n /** @deprecated - please migrate to the interfaceName property instead. */\n graphQL?: {\n singularName?: string\n }\n imageAltText?: string\n imageURL?: string\n /** Customize generated GraphQL and Typescript schema names.\n * The slug is used by default.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n labels?: Labels\n slug: string\n}\nexport type ClientBlock = {\n admin?: {\n components?: {\n Label?: MappedComponent\n }\n } & Pick<Block['admin'], 'custom'>\n fields: ClientField[]\n labels?: LabelsClient\n} & Pick<Block, 'imageAltText' | 'imageURL' | 'slug'>\n\nexport type BlockField = {\n admin?: {\n components?: {\n Error?: CustomComponent<BlockFieldErrorClientComponent | BlockFieldErrorServerComponent>\n } & Admin['components']\n initCollapsed?: boolean\n /**\n * Disable drag and drop sorting\n */\n isSortable?: boolean\n } & Admin\n blocks: Block[]\n defaultValue?: unknown\n labels?: Labels\n maxRows?: number\n minRows?: number\n type: 'blocks'\n validate?: Validate<string, unknown, unknown, BlockField>\n} & FieldBase\n\nexport type BlockFieldClient = {\n admin?: {\n components?: {\n Error?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<BlockField['admin'], 'initCollapsed' | 'isSortable'>\n blocks: ClientBlock[]\n labels?: LabelsClient\n} & FieldBaseClient &\n Pick<BlockField, 'maxRows' | 'minRows' | 'type'>\n\nexport type PointField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<PointFieldErrorClientComponent | PointFieldErrorServerComponent>\n Label?: CustomComponent<PointFieldLabelClientComponent | PointFieldLabelServerComponent>\n } & Admin['components']\n placeholder?: Record<string, string> | string\n step?: number\n } & Admin\n type: 'point'\n validate?: Validate<unknown, unknown, unknown, PointField>\n} & FieldBase\n\nexport type PointFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<PointField['admin'], 'placeholder' | 'step'>\n} & FieldBaseClient &\n Pick<PointField, 'type'>\n\nexport type Field =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | CollapsibleField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | RowField\n | SelectField\n | TabsField\n | TextareaField\n | TextField\n | UIField\n | UploadField\n\nexport type ClientField =\n | ArrayFieldClient\n | BlockFieldClient\n | CheckboxFieldClient\n | CodeFieldClient\n | CollapsibleFieldClient\n | DateFieldClient\n | EmailFieldClient\n | GroupFieldClient\n | JSONFieldClient\n | NumberFieldClient\n | PointFieldClient\n | RadioFieldClient\n | RelationshipFieldClient\n | RichTextFieldClient\n | RowFieldClient\n | SelectFieldClient\n | TabsFieldClient\n | TextareaFieldClient\n | TextFieldClient\n | UIFieldClient\n | UploadFieldClient\n\nexport type ClientFieldProps =\n | ArrayFieldProps\n | BlockFieldProps\n | CheckboxFieldProps\n | CodeFieldProps\n | CollapsibleFieldProps\n | DateFieldProps\n | EmailFieldProps\n | GroupFieldProps\n | HiddenFieldProps\n | JSONFieldProps\n | NumberFieldProps\n | PointFieldProps\n | RadioFieldProps\n | RelationshipFieldProps\n | RichTextFieldProps\n | RowFieldProps\n | SelectFieldProps\n | TabsFieldProps\n | TextareaFieldProps\n | UploadFieldProps\n\ntype ExtractFieldTypes<T> = T extends { type: infer U } ? U : never\n\nexport type FieldTypes = ExtractFieldTypes<Field>\n\nexport type FieldAffectingData =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | SelectField\n | TabAsField\n | TextareaField\n | TextField\n | UploadField\n\nexport type FieldAffectingDataClient =\n | ArrayFieldClient\n | BlockFieldClient\n | CheckboxFieldClient\n | CodeFieldClient\n | DateFieldClient\n | EmailFieldClient\n | GroupFieldClient\n | JSONFieldClient\n | NumberFieldClient\n | PointFieldClient\n | RadioFieldClient\n | RelationshipFieldClient\n | RichTextFieldClient\n | SelectFieldClient\n | TabAsFieldClient\n | TextareaFieldClient\n | TextFieldClient\n | UploadFieldClient\n\nexport type NonPresentationalField =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | CollapsibleField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | RowField\n | SelectField\n | TabsField\n | TextareaField\n | TextField\n | UploadField\n\nexport type NonPresentationalFieldClient =\n | ArrayFieldClient\n | BlockFieldClient\n | CheckboxFieldClient\n | CodeFieldClient\n | CollapsibleFieldClient\n | DateFieldClient\n | EmailFieldClient\n | GroupFieldClient\n | JSONFieldClient\n | NumberFieldClient\n | PointFieldClient\n | RadioFieldClient\n | RelationshipFieldClient\n | RichTextFieldClient\n | RowFieldClient\n | SelectFieldClient\n | TabsFieldClient\n | TextareaFieldClient\n | TextFieldClient\n | UploadFieldClient\n\nexport type FieldWithPath = {\n path?: string\n} & Field\n\nexport type FieldWithPathClient = {\n path?: string\n} & ClientField\n\nexport type FieldWithSubFields = ArrayField | CollapsibleField | GroupField | RowField\n\nexport type FieldWithSubFieldsClient =\n | ArrayFieldClient\n | CollapsibleFieldClient\n | GroupFieldClient\n | RowFieldClient\n\nexport type FieldPresentationalOnly = UIField\nexport type FieldPresentationalOnlyClient = UIFieldClient\n\nexport type FieldWithMany = RelationshipField | SelectField\nexport type FieldWithManyClient = RelationshipFieldClient | SelectFieldClient\n\nexport type FieldWithMaxDepth = RelationshipField | UploadField\nexport type FieldWithMaxDepthClient = RelationshipFieldClient | UploadFieldClient\n\nexport function fieldHasSubFields<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? FieldWithSubFieldsClient : FieldWithSubFields) {\n return (\n field.type === 'group' ||\n field.type === 'array' ||\n field.type === 'row' ||\n field.type === 'collapsible'\n )\n}\n\nexport function fieldIsArrayType<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? ArrayFieldClient : ArrayField) {\n return field.type === 'array'\n}\n\nexport function fieldIsBlockType<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? BlockFieldClient : BlockField) {\n return field.type === 'blocks'\n}\n\nexport function fieldIsGroupType<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? GroupFieldClient : GroupField) {\n return field.type === 'group'\n}\n\nexport function optionIsObject(option: Option): option is OptionObject {\n return typeof option === 'object'\n}\n\nexport function optionsAreObjects(options: Option[]): options is OptionObject[] {\n return Array.isArray(options) && typeof options?.[0] === 'object'\n}\n\nexport function optionIsValue(option: Option): option is string {\n return typeof option === 'string'\n}\n\nexport function fieldSupportsMany<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? FieldWithManyClient : FieldWithMany) {\n return field.type === 'select' || field.type === 'relationship' || field.type === 'upload'\n}\n\nexport function fieldHasMaxDepth<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? FieldWithMaxDepthClient : FieldWithMaxDepth) {\n return (\n (field.type === 'upload' || field.type === 'relationship') && typeof field.maxDepth === 'number'\n )\n}\n\nexport function fieldIsPresentationalOnly<\n TField extends ClientField | Field | TabAsField | TabAsFieldClient,\n>(\n field: TField,\n): field is TField & (TField extends ClientField | TabAsFieldClient ? UIFieldClient : UIField) {\n return field.type === 'ui'\n}\n\nexport function fieldIsSidebar<TField extends ClientField | Field | TabAsField | TabAsFieldClient>(\n field: TField,\n): field is { admin: { position: 'sidebar' } } & TField {\n return 'admin' in field && 'position' in field.admin && field.admin.position === 'sidebar'\n}\n\nexport function fieldAffectsData<\n TField extends ClientField | Field | TabAsField | TabAsFieldClient,\n>(\n field: TField,\n): field is TField &\n (TField extends ClientField | TabAsFieldClient ? FieldAffectingDataClient : FieldAffectingData) {\n return 'name' in field && !fieldIsPresentationalOnly(field)\n}\n\nexport function tabHasName<TField extends ClientTab | Tab>(tab: TField): tab is NamedTab & TField {\n return 'name' in tab\n}\n\nexport function fieldIsLocalized(field: Field | Tab): boolean {\n return 'localized' in field && field.localized\n}\n\nexport type HookName =\n | 'afterChange'\n | 'afterRead'\n | 'beforeChange'\n | 'beforeRead'\n | 'beforeValidate'\n"],"names":["valueIsValueWithRelation","value","fieldHasSubFields","field","type","fieldIsArrayType","fieldIsBlockType","fieldIsGroupType","optionIsObject","option","optionsAreObjects","options","Array","isArray","optionIsValue","fieldSupportsMany","fieldHasMaxDepth","maxDepth","fieldIsPresentationalOnly","fieldIsSidebar","admin","position","fieldAffectsData","tabHasName","tab","fieldIsLocalized","localized"],"mappings":"AAAA,qDAAqD,GAonCrD,OAAO,SAASA,yBAAyBC,KAAc;IACrD,OAAOA,UAAU,QAAQ,OAAOA,UAAU,YAAY,gBAAgBA,SAAS,WAAWA;AAC5F;AAuaA,OAAO,SAASC,kBACdC,KAAa;IAEb,OACEA,MAAMC,IAAI,KAAK,WACfD,MAAMC,IAAI,KAAK,WACfD,MAAMC,IAAI,KAAK,SACfD,MAAMC,IAAI,KAAK;AAEnB;AAEA,OAAO,SAASC,iBACdF,KAAa;IAEb,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASE,iBACdH,KAAa;IAEb,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASG,iBACdJ,KAAa;IAEb,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASI,eAAeC,MAAc;IAC3C,OAAO,OAAOA,WAAW;AAC3B;AAEA,OAAO,SAASC,kBAAkBC,OAAiB;IACjD,OAAOC,MAAMC,OAAO,CAACF,YAAY,OAAOA,SAAS,CAAC,EAAE,KAAK;AAC3D;AAEA,OAAO,SAASG,cAAcL,MAAc;IAC1C,OAAO,OAAOA,WAAW;AAC3B;AAEA,OAAO,SAASM,kBACdZ,KAAa;IAEb,OAAOA,MAAMC,IAAI,KAAK,YAAYD,MAAMC,IAAI,KAAK,kBAAkBD,MAAMC,IAAI,KAAK;AACpF;AAEA,OAAO,SAASY,iBACdb,KAAa;IAEb,OACE,AAACA,CAAAA,MAAMC,IAAI,KAAK,YAAYD,MAAMC,IAAI,KAAK,cAAa,KAAM,OAAOD,MAAMc,QAAQ,KAAK;AAE5F;AAEA,OAAO,SAASC,0BAGdf,KAAa;IAEb,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASe,eACdhB,KAAa;IAEb,OAAO,WAAWA,SAAS,cAAcA,MAAMiB,KAAK,IAAIjB,MAAMiB,KAAK,CAACC,QAAQ,KAAK;AACnF;AAEA,OAAO,SAASC,iBAGdnB,KAAa;IAGb,OAAO,UAAUA,SAAS,CAACe,0BAA0Bf;AACvD;AAEA,OAAO,SAASoB,WAA2CC,GAAW;IACpE,OAAO,UAAUA;AACnB;AAEA,OAAO,SAASC,iBAAiBtB,KAAkB;IACjD,OAAO,eAAeA,SAASA,MAAMuB,SAAS;AAChD"}
1
+ {"version":3,"sources":["../../../src/fields/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { EditorProps } from '@monaco-editor/react'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { CSSProperties } from 'react'\nimport type { DeepUndefinable } from 'ts-essentials'\n\nimport type { RichTextAdapter, RichTextAdapterProvider } from '../../admin/RichText.js'\nimport type {\n ArrayFieldErrorClientComponent,\n ArrayFieldErrorServerComponent,\n ArrayFieldLabelClientComponent,\n ArrayFieldLabelServerComponent,\n ArrayFieldProps,\n BlockFieldErrorClientComponent,\n BlockFieldErrorServerComponent,\n BlockFieldProps,\n CheckboxFieldErrorClientComponent,\n CheckboxFieldErrorServerComponent,\n CheckboxFieldLabelClientComponent,\n CheckboxFieldLabelServerComponent,\n CheckboxFieldProps,\n ClientTab,\n CodeFieldErrorClientComponent,\n CodeFieldErrorServerComponent,\n CodeFieldLabelClientComponent,\n CodeFieldLabelServerComponent,\n CodeFieldProps,\n CollapsibleFieldLabelClientComponent,\n CollapsibleFieldLabelServerComponent,\n CollapsibleFieldProps,\n ConditionalDateProps,\n DateFieldErrorClientComponent,\n DateFieldErrorServerComponent,\n DateFieldLabelClientComponent,\n DateFieldLabelServerComponent,\n DateFieldProps,\n Description,\n EmailFieldErrorClientComponent,\n EmailFieldErrorServerComponent,\n EmailFieldLabelClientComponent,\n EmailFieldLabelServerComponent,\n EmailFieldProps,\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n GroupFieldLabelClientComponent,\n GroupFieldLabelServerComponent,\n GroupFieldProps,\n HiddenFieldProps,\n JSONFieldErrorClientComponent,\n JSONFieldErrorServerComponent,\n JSONFieldLabelClientComponent,\n JSONFieldLabelServerComponent,\n JSONFieldProps,\n MappedComponent,\n NumberFieldErrorClientComponent,\n NumberFieldErrorServerComponent,\n NumberFieldLabelClientComponent,\n NumberFieldLabelServerComponent,\n NumberFieldProps,\n PointFieldErrorClientComponent,\n PointFieldErrorServerComponent,\n PointFieldLabelClientComponent,\n PointFieldLabelServerComponent,\n PointFieldProps,\n RadioFieldErrorClientComponent,\n RadioFieldErrorServerComponent,\n RadioFieldLabelClientComponent,\n RadioFieldLabelServerComponent,\n RadioFieldProps,\n RelationshipFieldErrorClientComponent,\n RelationshipFieldErrorServerComponent,\n RelationshipFieldLabelClientComponent,\n RelationshipFieldLabelServerComponent,\n RelationshipFieldProps,\n RichTextFieldProps,\n RowFieldProps,\n RowLabelComponent,\n SelectFieldErrorClientComponent,\n SelectFieldErrorServerComponent,\n SelectFieldLabelClientComponent,\n SelectFieldLabelServerComponent,\n SelectFieldProps,\n StaticDescription,\n TabsFieldProps,\n TextareaFieldErrorClientComponent,\n TextareaFieldErrorServerComponent,\n TextareaFieldLabelClientComponent,\n TextareaFieldLabelServerComponent,\n TextareaFieldProps,\n TextFieldErrorClientComponent,\n TextFieldErrorServerComponent,\n TextFieldLabelClientComponent,\n TextFieldLabelServerComponent,\n UploadFieldProps,\n} from '../../admin/types.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js'\nimport type {\n CustomComponent,\n LabelFunction,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, PayloadRequest, RequestContext, Where } from '../../types/index.js'\n\nexport type FieldHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n /**\n * Only available in `afterRead` hooks\n */\n currentDepth?: number /**\n * Only available in `afterRead` hooks\n */\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /**\n * Only available in the `afterRead` hook.\n */\n depth?: number\n draft?: boolean\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n overrideAccess?: boolean\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n /** The document before changes were applied, only in `afterChange` hooks. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied, only in `beforeChange`, `beforeValidate`, `beforeDuplicate` and `afterChange` field hooks. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes, only in `beforeChange`, `afterChange`, `beforeDuplicate` and `beforeValidate` field hooks. */\n previousValue?: TValue\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /**\n * Only available in the `afterRead` hook.\n */\n showHiddenFields?: boolean\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /**\n * The original siblingData with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n siblingDocWithLocales?: Record<string, unknown>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type FieldHook<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = (\n args: FieldHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type FieldAccess<TData extends TypeWithID = any, TSiblingData = any> = (args: {\n /**\n * The incoming data used to `create` or `update` the document with. `data` is undefined during the `read` operation.\n */\n data?: Partial<TData>\n /**\n * The original data of the document before the `update` is applied. `doc` is undefined during the `create` operation.\n */\n doc?: TData\n /**\n * The `id` of the current document being read or updated. `id` is undefined during the `create` operation.\n */\n id?: number | string\n /** The `payload` object to interface with the payload API */\n req: PayloadRequest\n /**\n * Immediately adjacent data to this field. For example, if this is a `group` field, then `siblingData` will be the other fields within the group.\n */\n siblingData?: Partial<TSiblingData>\n}) => boolean | Promise<boolean>\n\nexport type Condition<TData extends TypeWithID = any, TSiblingData = any> = (\n data: Partial<TData>,\n siblingData: Partial<TSiblingData>,\n { user }: { user: PayloadRequest['user'] },\n) => boolean\n\nexport type FilterOptionsProps<TData = any> = {\n /**\n * An object containing the full collection or global document currently being edited.\n */\n data: TData\n /**\n * The `id` of the current document being edited. `id` is undefined during the `create` operation.\n */\n id: number | string\n /**\n * The collection `slug` to filter against, limited to this field's `relationTo` property.\n */\n relationTo: CollectionSlug\n /**\n * An object containing document data that is scoped to only fields within the same parent of this field.\n */\n siblingData: unknown\n /**\n * An object containing the currently authenticated user.\n */\n user: Partial<PayloadRequest['user']>\n}\n\nexport type FilterOptionsFunc<TData = any> = (\n options: FilterOptionsProps<TData>,\n) => boolean | Promise<boolean | Where> | Where\n\nexport type FilterOptions<TData = any> =\n | ((options: FilterOptionsProps<TData>) => boolean | Promise<boolean | Where> | Where)\n | null\n | Where\n\ntype Admin = {\n className?: string\n components?: {\n Cell?: CustomComponent\n Description?: CustomComponent<FieldDescriptionClientComponent | FieldDescriptionServerComponent>\n Field?: CustomComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: PayloadComponent\n }\n /**\n * You can programmatically show / hide fields based on what other fields are doing.\n * This is also run on the server, to determine if the field should be validated.\n */\n condition?: Condition\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n description?: Description\n disableBulkEdit?: boolean\n disabled?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n /**\n * Shows / hides fields from appearing in the list view filter options.\n * @type boolean\n */\n disableListFilter?: boolean\n hidden?: boolean\n position?: 'sidebar'\n readOnly?: boolean\n style?: CSSProperties\n width?: string\n}\n\nexport type AdminClient = {\n className?: string\n components?: {\n Cell?: MappedComponent\n Description?: MappedComponent\n Field?: MappedComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: MappedComponent\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n description?: StaticDescription\n disableBulkEdit?: boolean\n disabled?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n /**\n * Shows / hides fields from appearing in the list view filter options.\n * @type boolean\n */\n disableListFilter?: boolean\n hidden?: boolean\n position?: 'sidebar'\n readOnly?: boolean\n style?: CSSProperties\n width?: string\n}\n\nexport type Labels = {\n plural: LabelFunction | StaticLabel\n singular: LabelFunction | StaticLabel\n}\n\nexport type LabelsClient = {\n plural: StaticLabel\n singular: StaticLabel\n}\n\nexport type BaseValidateOptions<TData, TSiblingData, TValue> = {\n collectionSlug?: string\n data: Partial<TData>\n id?: number | string\n operation?: Operation\n preferences: DocumentPreferences\n previousValue?: TValue\n req: PayloadRequest\n required?: boolean\n siblingData: Partial<TSiblingData>\n}\n\nexport type ValidateOptions<\n TData,\n TSiblingData,\n TFieldConfig extends object,\n TValue,\n> = BaseValidateOptions<TData, TSiblingData, TValue> & TFieldConfig\n\nexport type Validate<\n TValue = any,\n TData = any,\n TSiblingData = any,\n TFieldConfig extends object = object,\n> = (\n value: TValue,\n options: ValidateOptions<TData, TSiblingData, TFieldConfig, TValue>,\n) => Promise<string | true> | string | true\n\nexport type OptionObject = {\n label: LabelFunction | StaticLabel\n value: string\n}\n\nexport type Option = OptionObject | string\n\nexport interface FieldBase {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same field multiple times.\n */\n _sanitized?: boolean\n access?: {\n create?: FieldAccess\n read?: FieldAccess\n update?: FieldAccess\n }\n admin?: Admin\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n defaultValue?: any\n hidden?: boolean\n hooks?: {\n afterChange?: FieldHook[]\n afterRead?: FieldHook[]\n beforeChange?: FieldHook[]\n /**\n * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.\n */\n beforeDuplicate?: FieldHook[]\n beforeValidate?: FieldHook[]\n }\n index?: boolean\n label?: false | LabelFunction | StaticLabel\n localized?: boolean\n /**\n * The name of the field. Must be alphanumeric and cannot contain ' . '\n *\n * Must not be one of reserved field names: ['__v', 'salt', 'hash', 'file']\n * @link https://payloadcms.com/docs/fields/overview#field-names\n */\n name: string\n required?: boolean\n saveToJWT?: boolean | string\n /**\n * Allows you to modify the base JSON schema that is generated during generate:types for this field.\n * This JSON schema will be used to generate the TypeScript interface of this field.\n */\n typescriptSchema?: Array<(args: { jsonSchema: JSONSchema4 }) => JSONSchema4>\n unique?: boolean\n validate?: Validate\n}\n\nexport interface FieldBaseClient {\n _isPresentational?: undefined\n _path?: string\n _schemaPath?: string\n admin?: AdminClient\n hidden?: boolean\n index?: boolean\n label?: StaticLabel\n localized?: boolean\n /**\n * The name of the field. Must be alphanumeric and cannot contain ' . '\n *\n * Must not be one of reserved field names: ['__v', 'salt', 'hash', 'file']\n * @link https://payloadcms.com/docs/fields/overview#field-names\n */\n name?: string\n required?: boolean\n saveToJWT?: boolean | string\n /**\n * Allows you to modify the base JSON schema that is generated during generate:types for this field.\n * This JSON schema will be used to generate the TypeScript interface of this field.\n */\n typescriptSchema?: Array<(args: { jsonSchema: JSONSchema4 }) => JSONSchema4>\n unique?: boolean\n}\n\nexport type NumberField = {\n admin?: {\n /** Set this property to a string that will be used for browser autocomplete. */\n autoComplete?: string\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<NumberFieldErrorClientComponent | NumberFieldErrorServerComponent>\n Label?: CustomComponent<NumberFieldLabelClientComponent | NumberFieldLabelServerComponent>\n } & Admin['components']\n /** Set this property to define a placeholder string for the field. */\n placeholder?: Record<string, string> | string\n /** Set a value for the number field to increment / decrement using browser controls. */\n step?: number\n } & Admin\n /** Maximum value accepted. Used in the default `validate` function. */\n max?: number\n /** Minimum value accepted. Used in the default `validate` function. */\n min?: number\n type: 'number'\n validate?: Validate<number | number[], unknown, unknown, NumberField>\n} & (\n | {\n /** Makes this field an ordered array of numbers instead of just a single number. */\n hasMany: true\n /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */\n maxRows?: number\n /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */\n minRows?: number\n }\n | {\n /** Makes this field an ordered array of numbers instead of just a single number. */\n hasMany?: false | undefined\n /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */\n maxRows?: undefined\n /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */\n minRows?: undefined\n }\n) &\n FieldBase\n\nexport type NumberFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<NumberField['admin'], 'autoComplete' | 'placeholder' | 'step'>\n} & FieldBaseClient &\n Pick<NumberField, 'hasMany' | 'max' | 'maxRows' | 'min' | 'minRows' | 'type'>\n\nexport type TextField = {\n admin?: {\n autoComplete?: string\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<TextFieldErrorClientComponent | TextFieldErrorServerComponent>\n Label?: CustomComponent<TextFieldLabelClientComponent | TextFieldLabelServerComponent>\n } & Admin['components']\n placeholder?: Record<string, string> | string\n rtl?: boolean\n } & Admin\n maxLength?: number\n minLength?: number\n type: 'text'\n validate?: Validate<string | string[], unknown, unknown, TextField>\n} & (\n | {\n /** Makes this field an ordered array of strings instead of just a single string. */\n hasMany: true\n /** Maximum number of strings in the strings array, if `hasMany` is set to true. */\n maxRows?: number\n /** Minimum number of strings in the strings array, if `hasMany` is set to true. */\n minRows?: number\n }\n | {\n /** Makes this field an ordered array of strings instead of just a single string. */\n hasMany?: false | undefined\n /** Maximum number of strings in the strings array, if `hasMany` is set to true. */\n maxRows?: undefined\n /** Minimum number of strings in the strings array, if `hasMany` is set to true. */\n minRows?: undefined\n }\n) &\n FieldBase\n\nexport type TextFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<TextField['admin'], 'autoComplete' | 'placeholder' | 'rtl'>\n} & FieldBaseClient &\n Pick<TextField, 'hasMany' | 'maxLength' | 'maxRows' | 'minLength' | 'minRows' | 'type'>\n\nexport type EmailField = {\n admin?: {\n autoComplete?: string\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<EmailFieldErrorClientComponent | EmailFieldErrorServerComponent>\n Label?: CustomComponent<EmailFieldLabelClientComponent | EmailFieldLabelServerComponent>\n } & Admin['components']\n placeholder?: Record<string, string> | string\n } & Admin\n type: 'email'\n validate?: Validate<string, unknown, unknown, EmailField>\n} & FieldBase\n\nexport type EmailFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<EmailField['admin'], 'placeholder'>\n} & FieldBaseClient &\n Pick<EmailField, 'type'>\n\nexport type TextareaField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<TextareaFieldErrorClientComponent | TextareaFieldErrorServerComponent>\n Label?: CustomComponent<TextareaFieldLabelClientComponent | TextareaFieldLabelServerComponent>\n } & Admin['components']\n placeholder?: Record<string, string> | string\n rows?: number\n rtl?: boolean\n } & Admin\n maxLength?: number\n minLength?: number\n type: 'textarea'\n validate?: Validate<string, unknown, unknown, TextareaField>\n} & FieldBase\n\nexport type TextareaFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<TextareaField['admin'], 'placeholder' | 'rows' | 'rtl'>\n} & FieldBaseClient &\n Pick<TextareaField, 'maxLength' | 'minLength' | 'type'>\n\nexport type CheckboxField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<CheckboxFieldErrorClientComponent | CheckboxFieldErrorServerComponent>\n Label?: CustomComponent<CheckboxFieldLabelClientComponent | CheckboxFieldLabelServerComponent>\n } & Admin['components']\n } & Admin\n type: 'checkbox'\n validate?: Validate<unknown, unknown, unknown, CheckboxField>\n} & FieldBase\n\nexport type CheckboxFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient\n} & FieldBaseClient &\n Pick<CheckboxField, 'type'>\n\nexport type DateField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<DateFieldErrorClientComponent | DateFieldErrorServerComponent>\n Label?: CustomComponent<DateFieldLabelClientComponent | DateFieldLabelServerComponent>\n } & Admin['components']\n date?: ConditionalDateProps\n placeholder?: Record<string, string> | string\n } & Admin\n type: 'date'\n validate?: Validate<unknown, unknown, unknown, DateField>\n} & FieldBase\n\nexport type DateFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<DateField['admin'], 'date' | 'placeholder'>\n} & FieldBaseClient &\n Pick<DateField, 'type'>\n\nexport type GroupField = {\n admin?: {\n components?: {\n Label?: CustomComponent<GroupFieldLabelClientComponent | GroupFieldLabelServerComponent>\n } & Admin['components']\n hideGutter?: boolean\n } & Admin\n fields: Field[]\n /** Customize generated GraphQL and Typescript schema names.\n * By default, it is bound to the collection.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n type: 'group'\n validate?: Validate<unknown, unknown, unknown, GroupField>\n} & Omit<FieldBase, 'required'>\n\nexport type GroupFieldClient = {\n admin?: {\n components?: {\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<GroupField['admin'], 'hideGutter'>\n fields: ClientField[]\n} & Omit<FieldBaseClient, 'required'> &\n Pick<GroupField, 'interfaceName' | 'type'>\n\nexport type RowField = {\n admin?: Omit<Admin, 'description'>\n fields: Field[]\n type: 'row'\n} & Omit<FieldBase, 'admin' | 'label' | 'name' | 'validate'>\n\nexport type RowFieldClient = {\n admin?: Omit<AdminClient, 'description'>\n fields: ClientField[]\n} & Omit<FieldBaseClient, 'admin' | 'label' | 'name' | 'validate'> &\n Pick<RowField, 'type'>\n\nexport type CollapsibleField = {\n fields: Field[]\n type: 'collapsible'\n} & (\n | {\n admin: {\n components: {\n Label?: CustomComponent<\n CollapsibleFieldLabelClientComponent | CollapsibleFieldLabelServerComponent\n >\n RowLabel: RowLabelComponent\n } & Admin['components']\n initCollapsed?: boolean\n } & Admin\n label?: Required<FieldBase['label']>\n }\n | {\n admin?: {\n components?: {\n Label?: CustomComponent<\n CollapsibleFieldLabelClientComponent | CollapsibleFieldLabelServerComponent\n >\n } & Admin['components']\n initCollapsed?: boolean\n } & Admin\n label: Required<FieldBase['label']>\n }\n) &\n Omit<FieldBase, 'label' | 'name' | 'validate'>\n\nexport type CollapsibleFieldClient = {\n fields: ClientField[]\n} & (\n | {\n admin: {\n components: {\n RowLabel: MappedComponent\n } & AdminClient['components']\n initCollapsed?: boolean\n } & AdminClient\n label?: Required<FieldBaseClient['label']>\n }\n | {\n admin?: {\n initCollapsed?: boolean\n } & AdminClient\n label: Required<FieldBaseClient['label']>\n }\n) &\n Omit<FieldBaseClient, 'label' | 'name' | 'validate'> &\n Pick<CollapsibleField, 'type'>\n\ntype TabBase = {\n description?: Description\n fields: Field[]\n interfaceName?: string\n saveToJWT?: boolean | string\n} & Omit<FieldBase, 'required' | 'validate'>\n\nexport type NamedTab = {\n /** Customize generated GraphQL and Typescript schema names.\n * The slug is used by default.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n} & TabBase\n\nexport type UnnamedTab = {\n interfaceName?: never\n /**\n * Can be either:\n * - A string, which will be used as the tab's label.\n * - An object, where the key is the language code and the value is the label.\n */\n label:\n | {\n [selectedLanguage: string]: string\n }\n | LabelFunction\n | string\n localized?: never\n} & Omit<TabBase, 'name'>\n\nexport type Tab = NamedTab | UnnamedTab\n\nexport type TabsField = {\n admin?: Omit<Admin, 'description'>\n tabs: Tab[]\n type: 'tabs'\n} & Omit<FieldBase, 'admin' | 'localized' | 'name' | 'saveToJWT'>\n\nexport type TabsFieldClient = {\n admin?: Omit<AdminClient, 'description'>\n tabs: ClientTab[]\n} & Omit<FieldBaseClient, 'admin' | 'localized' | 'name' | 'saveToJWT'> &\n Pick<TabsField, 'type'>\n\nexport type TabAsField = {\n name?: string\n type: 'tab'\n} & Tab\n\nexport type TabAsFieldClient = ClientTab & Pick<TabAsField, 'name' | 'type'>\n\nexport type UIField = {\n admin: {\n components?: {\n Cell?: CustomComponent\n Field: CustomComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: PayloadComponent\n } & Admin['components']\n condition?: Condition\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n disableBulkEdit?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n position?: string\n width?: string\n }\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n label?: Record<string, string> | string\n name: string\n type: 'ui'\n}\n\nexport type UIFieldClient = {\n _isPresentational?: true\n // still include FieldBaseClient.admin (even if it's undefinable) so that we don't need constant type checks (e.g. if('xy' in field))\n // eslint-disable-next-line perfectionist/sort-intersection-types\n admin: DeepUndefinable<FieldBaseClient['admin']> & {\n components?: {\n Cell?: MappedComponent\n Field: MappedComponent\n Filter?: MappedComponent\n } & AdminClient['components']\n } & Pick<\n UIField['admin'],\n 'custom' | 'disableBulkEdit' | 'disableListColumn' | 'position' | 'width'\n >\n} & 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))\n Pick<UIField, 'label' | 'name' | 'type'>\n\ntype SharedUploadProperties = {\n /**\n * Toggle the preview in the admin interface.\n */\n displayPreview?: boolean\n filterOptions?: FilterOptions\n hasMany?: boolean\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'upload'\n validate?: Validate<unknown, unknown, unknown, SharedUploadProperties>\n} & (\n | {\n hasMany: true\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: number\n maxRows?: number\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: number\n minRows?: number\n }\n | {\n hasMany?: false | undefined\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: undefined\n maxRows?: undefined\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: undefined\n minRows?: undefined\n }\n) &\n FieldBase\n\ntype SharedUploadPropertiesClient = FieldBaseClient &\n Pick<\n SharedUploadProperties,\n 'hasMany' | 'max' | 'maxDepth' | 'maxRows' | 'min' | 'minRows' | 'type'\n >\n\ntype UploadAdmin = {\n allowCreate?: boolean\n components?: {\n Error?: CustomComponent<\n RelationshipFieldErrorClientComponent | RelationshipFieldErrorServerComponent\n >\n Label?: CustomComponent<\n RelationshipFieldLabelClientComponent | RelationshipFieldLabelServerComponent\n >\n } & Admin['components']\n isSortable?: boolean\n} & Admin\ntype UploadAdminClient = {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n} & AdminClient &\n Pick<UploadAdmin, 'allowCreate' | 'isSortable'>\n\nexport type PolymorphicUploadField = {\n admin?: {\n sortOptions?: { [collectionSlug: CollectionSlug]: string }\n } & UploadAdmin\n relationTo: CollectionSlug[]\n} & SharedUploadProperties\n\nexport type PolymorphicUploadFieldClient = {\n admin?: {\n sortOptions?: Pick<PolymorphicUploadField['admin'], 'sortOptions'>\n } & UploadAdminClient\n} & Pick<PolymorphicUploadField, 'displayPreview' | 'maxDepth' | 'relationTo' | 'type'> &\n SharedUploadPropertiesClient\n\nexport type SingleUploadField = {\n admin?: {\n sortOptions?: string\n } & UploadAdmin\n relationTo: CollectionSlug\n} & SharedUploadProperties\n\nexport type SingleUploadFieldClient = {\n admin?: Pick<SingleUploadField['admin'], 'sortOptions'> & UploadAdminClient\n} & Pick<SingleUploadField, 'displayPreview' | 'maxDepth' | 'relationTo' | 'type'> &\n SharedUploadPropertiesClient\n\nexport type UploadField = /* PolymorphicUploadField | */ SingleUploadField\n\nexport type UploadFieldClient = /* PolymorphicUploadFieldClient | */ SingleUploadFieldClient\n\nexport type CodeField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<CodeFieldErrorClientComponent | CodeFieldErrorServerComponent>\n Label?: CustomComponent<CodeFieldLabelClientComponent | CodeFieldLabelServerComponent>\n } & Admin['components']\n editorOptions?: EditorProps['options']\n language?: string\n } & Admin\n maxLength?: number\n minLength?: number\n type: 'code'\n validate?: Validate<string, unknown, unknown, CodeField>\n} & Omit<FieldBase, 'admin'>\n\nexport type CodeFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<CodeField['admin'], 'editorOptions' | 'language'>\n} & Omit<FieldBaseClient, 'admin'> &\n Pick<CodeField, 'maxLength' | 'minLength' | 'type'>\n\nexport type JSONField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<JSONFieldErrorClientComponent | JSONFieldErrorServerComponent>\n Label?: CustomComponent<JSONFieldLabelClientComponent | JSONFieldLabelServerComponent>\n } & Admin['components']\n editorOptions?: EditorProps['options']\n } & Admin\n\n jsonSchema?: {\n fileMatch: string[]\n schema: JSONSchema4\n uri: string\n }\n type: 'json'\n validate?: Validate<Record<string, unknown>, unknown, unknown, JSONField>\n} & Omit<FieldBase, 'admin'>\n\nexport type JSONFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<JSONField['admin'], 'editorOptions'>\n} & Omit<FieldBaseClient, 'admin'> &\n Pick<JSONField, 'jsonSchema' | 'type'>\n\nexport type SelectField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<SelectFieldErrorClientComponent | SelectFieldErrorServerComponent>\n Label?: CustomComponent<SelectFieldLabelClientComponent | SelectFieldLabelServerComponent>\n } & Admin['components']\n isClearable?: boolean\n isSortable?: boolean\n } & Admin\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n /**\n * Customize the DB enum name\n */\n enumName?: DBIdentifierName\n hasMany?: boolean\n options: Option[]\n type: 'select'\n validate?: Validate<string, unknown, unknown, SelectField>\n} & FieldBase\n\nexport type SelectFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<SelectField['admin'], 'isClearable' | 'isSortable'>\n} & FieldBaseClient &\n Pick<SelectField, 'hasMany' | 'options' | 'type'>\n\ntype SharedRelationshipProperties = {\n filterOptions?: FilterOptions\n hasMany?: boolean\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'relationship'\n validate?: Validate<unknown, unknown, unknown, SharedRelationshipProperties>\n} & (\n | {\n hasMany: true\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: number\n maxRows?: number\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: number\n minRows?: number\n }\n | {\n hasMany?: false | undefined\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: undefined\n maxRows?: undefined\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: undefined\n minRows?: undefined\n }\n) &\n FieldBase\n\ntype SharedRelationshipPropertiesClient = FieldBaseClient &\n Pick<\n SharedRelationshipProperties,\n 'hasMany' | 'max' | 'maxDepth' | 'maxRows' | 'min' | 'minRows' | 'type'\n >\n\ntype RelationshipAdmin = {\n allowCreate?: boolean\n components?: {\n Error?: CustomComponent<\n RelationshipFieldErrorClientComponent | RelationshipFieldErrorServerComponent\n >\n Label?: CustomComponent<\n RelationshipFieldLabelClientComponent | RelationshipFieldLabelServerComponent\n >\n } & Admin['components']\n isSortable?: boolean\n} & Admin\n\ntype RelationshipAdminClient = {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n} & AdminClient &\n Pick<RelationshipAdmin, 'allowCreate' | 'isSortable'>\n\nexport type PolymorphicRelationshipField = {\n admin?: {\n sortOptions?: { [collectionSlug: CollectionSlug]: string }\n } & RelationshipAdmin\n relationTo: CollectionSlug[]\n} & SharedRelationshipProperties\n\nexport type PolymorphicRelationshipFieldClient = {\n admin?: {\n sortOptions?: Pick<PolymorphicRelationshipField['admin'], 'sortOptions'>\n } & RelationshipAdminClient\n} & Pick<PolymorphicRelationshipField, 'relationTo'> &\n SharedRelationshipPropertiesClient\n\nexport type SingleRelationshipField = {\n admin?: {\n sortOptions?: string\n } & RelationshipAdmin\n relationTo: CollectionSlug\n} & SharedRelationshipProperties\n\nexport type SingleRelationshipFieldClient = {\n admin?: Pick<SingleRelationshipField['admin'], 'sortOptions'> & RelationshipAdminClient\n} & Pick<SingleRelationshipField, 'relationTo'> &\n SharedRelationshipPropertiesClient\n\nexport type RelationshipField = PolymorphicRelationshipField | SingleRelationshipField\n\nexport type RelationshipFieldClient =\n | PolymorphicRelationshipFieldClient\n | SingleRelationshipFieldClient\n\nexport type ValueWithRelation = {\n relationTo: CollectionSlug\n value: number | string\n}\n\nexport function valueIsValueWithRelation(value: unknown): value is ValueWithRelation {\n return value !== null && typeof value === 'object' && 'relationTo' in value && 'value' in value\n}\n\nexport type RelationshipValue =\n | (number | string)[]\n | (number | string)\n | ValueWithRelation\n | ValueWithRelation[]\n\nexport type RichTextField<\n TValue extends object = any,\n TAdapterProps = any,\n TExtraProperties = object,\n> = {\n admin?: {\n components?: {\n Error?: CustomComponent\n Label?: CustomComponent\n } & Admin['components']\n } & Admin\n editor?:\n | RichTextAdapter<TValue, TAdapterProps, TExtraProperties>\n | RichTextAdapterProvider<TValue, TAdapterProps, TExtraProperties>\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'richText'\n} & FieldBase &\n TExtraProperties\n\nexport type RichTextFieldClient<\n TValue extends object = any,\n TAdapterProps = any,\n TExtraProperties = object,\n> = {\n admin?: {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n placeholder?: Record<string, string> | string\n } & AdminClient\n richTextComponentMap?: Map<string, any>\n} & FieldBaseClient &\n Pick<RichTextField<TValue, TAdapterProps, TExtraProperties>, 'maxDepth' | 'type'> &\n TExtraProperties\n\nexport type ArrayField = {\n admin?: {\n components?: {\n Error?: CustomComponent<ArrayFieldErrorClientComponent | ArrayFieldErrorServerComponent>\n Label?: CustomComponent<ArrayFieldLabelClientComponent | ArrayFieldLabelServerComponent>\n RowLabel?: RowLabelComponent\n } & Admin['components']\n initCollapsed?: boolean\n /**\n * Disable drag and drop sorting\n */\n isSortable?: boolean\n } & Admin\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n fields: Field[]\n /** Customize generated GraphQL and Typescript schema names.\n * By default, it is bound to the collection.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n labels?: Labels\n maxRows?: number\n minRows?: number\n type: 'array'\n validate?: Validate<unknown[], unknown, unknown, ArrayField>\n} & FieldBase\n\nexport type ArrayFieldClient = {\n admin?: {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n RowLabel?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<ArrayField['admin'], 'initCollapsed' | 'isSortable'>\n fields: ClientField[]\n labels?: LabelsClient\n} & FieldBaseClient &\n Pick<ArrayField, 'interfaceName' | 'maxRows' | 'minRows' | 'type'>\n\nexport type RadioField = {\n admin?: {\n components?: {\n Error?: CustomComponent<RadioFieldErrorClientComponent | RadioFieldErrorServerComponent>\n Label?: CustomComponent<RadioFieldLabelClientComponent | RadioFieldLabelServerComponent>\n } & Admin['components']\n layout?: 'horizontal' | 'vertical'\n } & Admin\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n /**\n * Customize the DB enum name\n */\n enumName?: DBIdentifierName\n options: Option[]\n type: 'radio'\n validate?: Validate<string, unknown, unknown, RadioField>\n} & FieldBase\n\nexport type RadioFieldClient = {\n admin?: {\n components?: {\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<RadioField['admin'], 'layout'>\n} & FieldBaseClient &\n Pick<RadioField, 'options' | 'type'>\n\nexport type Block = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same block multiple times.\n */\n _sanitized?: boolean\n admin?: {\n components?: {\n Label?: PayloadComponent<\n never,\n {\n blockKind: 'block' | 'lexicalBlock' | 'lexicalInlineBlock' | string\n /**\n * May contain the formData\n */\n formData: Record<string, any>\n }\n >\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n }\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n fields: Field[]\n /** @deprecated - please migrate to the interfaceName property instead. */\n graphQL?: {\n singularName?: string\n }\n imageAltText?: string\n imageURL?: string\n /** Customize generated GraphQL and Typescript schema names.\n * The slug is used by default.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n labels?: Labels\n slug: string\n}\nexport type ClientBlock = {\n admin?: {\n components?: {\n Label?: MappedComponent\n }\n } & Pick<Block['admin'], 'custom'>\n fields: ClientField[]\n labels?: LabelsClient\n} & Pick<Block, 'imageAltText' | 'imageURL' | 'slug'>\n\nexport type BlockField = {\n admin?: {\n components?: {\n Error?: CustomComponent<BlockFieldErrorClientComponent | BlockFieldErrorServerComponent>\n } & Admin['components']\n initCollapsed?: boolean\n /**\n * Disable drag and drop sorting\n */\n isSortable?: boolean\n } & Admin\n blocks: Block[]\n defaultValue?: unknown\n labels?: Labels\n maxRows?: number\n minRows?: number\n type: 'blocks'\n validate?: Validate<string, unknown, unknown, BlockField>\n} & FieldBase\n\nexport type BlockFieldClient = {\n admin?: {\n components?: {\n Error?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<BlockField['admin'], 'initCollapsed' | 'isSortable'>\n blocks: ClientBlock[]\n labels?: LabelsClient\n} & FieldBaseClient &\n Pick<BlockField, 'maxRows' | 'minRows' | 'type'>\n\nexport type PointField = {\n admin?: {\n components?: {\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n Error?: CustomComponent<PointFieldErrorClientComponent | PointFieldErrorServerComponent>\n Label?: CustomComponent<PointFieldLabelClientComponent | PointFieldLabelServerComponent>\n } & Admin['components']\n placeholder?: Record<string, string> | string\n step?: number\n } & Admin\n type: 'point'\n validate?: Validate<unknown, unknown, unknown, PointField>\n} & FieldBase\n\nexport type PointFieldClient = {\n admin?: {\n components?: {\n afterInput?: MappedComponent[]\n beforeInput?: MappedComponent[]\n Error?: MappedComponent\n Label?: MappedComponent\n } & AdminClient['components']\n } & AdminClient &\n Pick<PointField['admin'], 'placeholder' | 'step'>\n} & FieldBaseClient &\n Pick<PointField, 'type'>\n\nexport type Field =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | CollapsibleField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | RowField\n | SelectField\n | TabsField\n | TextareaField\n | TextField\n | UIField\n | UploadField\n\nexport type ClientField =\n | ArrayFieldClient\n | BlockFieldClient\n | CheckboxFieldClient\n | CodeFieldClient\n | CollapsibleFieldClient\n | DateFieldClient\n | EmailFieldClient\n | GroupFieldClient\n | JSONFieldClient\n | NumberFieldClient\n | PointFieldClient\n | RadioFieldClient\n | RelationshipFieldClient\n | RichTextFieldClient\n | RowFieldClient\n | SelectFieldClient\n | TabsFieldClient\n | TextareaFieldClient\n | TextFieldClient\n | UIFieldClient\n | UploadFieldClient\n\nexport type ClientFieldProps =\n | ArrayFieldProps\n | BlockFieldProps\n | CheckboxFieldProps\n | CodeFieldProps\n | CollapsibleFieldProps\n | DateFieldProps\n | EmailFieldProps\n | GroupFieldProps\n | HiddenFieldProps\n | JSONFieldProps\n | NumberFieldProps\n | PointFieldProps\n | RadioFieldProps\n | RelationshipFieldProps\n | RichTextFieldProps\n | RowFieldProps\n | SelectFieldProps\n | TabsFieldProps\n | TextareaFieldProps\n | UploadFieldProps\n\ntype ExtractFieldTypes<T> = T extends { type: infer U } ? U : never\n\nexport type FieldTypes = ExtractFieldTypes<Field>\n\nexport type FieldAffectingData =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | SelectField\n | TabAsField\n | TextareaField\n | TextField\n | UploadField\n\nexport type FieldAffectingDataClient =\n | ArrayFieldClient\n | BlockFieldClient\n | CheckboxFieldClient\n | CodeFieldClient\n | DateFieldClient\n | EmailFieldClient\n | GroupFieldClient\n | JSONFieldClient\n | NumberFieldClient\n | PointFieldClient\n | RadioFieldClient\n | RelationshipFieldClient\n | RichTextFieldClient\n | SelectFieldClient\n | TabAsFieldClient\n | TextareaFieldClient\n | TextFieldClient\n | UploadFieldClient\n\nexport type NonPresentationalField =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | CollapsibleField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | RowField\n | SelectField\n | TabsField\n | TextareaField\n | TextField\n | UploadField\n\nexport type NonPresentationalFieldClient =\n | ArrayFieldClient\n | BlockFieldClient\n | CheckboxFieldClient\n | CodeFieldClient\n | CollapsibleFieldClient\n | DateFieldClient\n | EmailFieldClient\n | GroupFieldClient\n | JSONFieldClient\n | NumberFieldClient\n | PointFieldClient\n | RadioFieldClient\n | RelationshipFieldClient\n | RichTextFieldClient\n | RowFieldClient\n | SelectFieldClient\n | TabsFieldClient\n | TextareaFieldClient\n | TextFieldClient\n | UploadFieldClient\n\nexport type FieldWithPath = {\n path?: string\n} & Field\n\nexport type FieldWithPathClient = {\n path?: string\n} & ClientField\n\nexport type FieldWithSubFields = ArrayField | CollapsibleField | GroupField | RowField\n\nexport type FieldWithSubFieldsClient =\n | ArrayFieldClient\n | CollapsibleFieldClient\n | GroupFieldClient\n | RowFieldClient\n\nexport type FieldPresentationalOnly = UIField\nexport type FieldPresentationalOnlyClient = UIFieldClient\n\nexport type FieldWithMany = RelationshipField | SelectField\nexport type FieldWithManyClient = RelationshipFieldClient | SelectFieldClient\n\nexport type FieldWithMaxDepth = RelationshipField | UploadField\nexport type FieldWithMaxDepthClient = RelationshipFieldClient | UploadFieldClient\n\nexport function fieldHasSubFields<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? FieldWithSubFieldsClient : FieldWithSubFields) {\n return (\n field.type === 'group' ||\n field.type === 'array' ||\n field.type === 'row' ||\n field.type === 'collapsible'\n )\n}\n\nexport function fieldIsArrayType<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? ArrayFieldClient : ArrayField) {\n return field.type === 'array'\n}\n\nexport function fieldIsBlockType<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? BlockFieldClient : BlockField) {\n return field.type === 'blocks'\n}\n\nexport function fieldIsGroupType<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? GroupFieldClient : GroupField) {\n return field.type === 'group'\n}\n\nexport function optionIsObject(option: Option): option is OptionObject {\n return typeof option === 'object'\n}\n\nexport function optionsAreObjects(options: Option[]): options is OptionObject[] {\n return Array.isArray(options) && typeof options?.[0] === 'object'\n}\n\nexport function optionIsValue(option: Option): option is string {\n return typeof option === 'string'\n}\n\nexport function fieldSupportsMany<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? FieldWithManyClient : FieldWithMany) {\n return field.type === 'select' || field.type === 'relationship' || field.type === 'upload'\n}\n\nexport function fieldHasMaxDepth<TField extends ClientField | Field>(\n field: TField,\n): field is TField & (TField extends ClientField ? FieldWithMaxDepthClient : FieldWithMaxDepth) {\n return (\n (field.type === 'upload' || field.type === 'relationship') && typeof field.maxDepth === 'number'\n )\n}\n\nexport function fieldIsPresentationalOnly<\n TField extends ClientField | Field | TabAsField | TabAsFieldClient,\n>(\n field: TField,\n): field is TField & (TField extends ClientField | TabAsFieldClient ? UIFieldClient : UIField) {\n return field.type === 'ui'\n}\n\nexport function fieldIsSidebar<TField extends ClientField | Field | TabAsField | TabAsFieldClient>(\n field: TField,\n): field is { admin: { position: 'sidebar' } } & TField {\n return 'admin' in field && 'position' in field.admin && field.admin.position === 'sidebar'\n}\n\nexport function fieldAffectsData<\n TField extends ClientField | Field | TabAsField | TabAsFieldClient,\n>(\n field: TField,\n): field is TField &\n (TField extends ClientField | TabAsFieldClient ? FieldAffectingDataClient : FieldAffectingData) {\n return 'name' in field && !fieldIsPresentationalOnly(field)\n}\n\nexport function tabHasName<TField extends ClientTab | Tab>(tab: TField): tab is NamedTab & TField {\n return 'name' in tab\n}\n\nexport function fieldIsLocalized(field: Field | Tab): boolean {\n return 'localized' in field && field.localized\n}\n\nexport type HookName =\n | 'afterChange'\n | 'afterRead'\n | 'beforeChange'\n | 'beforeRead'\n | 'beforeValidate'\n"],"names":["valueIsValueWithRelation","value","fieldHasSubFields","field","type","fieldIsArrayType","fieldIsBlockType","fieldIsGroupType","optionIsObject","option","optionsAreObjects","options","Array","isArray","optionIsValue","fieldSupportsMany","fieldHasMaxDepth","maxDepth","fieldIsPresentationalOnly","fieldIsSidebar","admin","position","fieldAffectsData","tabHasName","tab","fieldIsLocalized","localized"],"mappings":"AAAA,qDAAqD,GAgnCrD,OAAO,SAASA,yBAAyBC,KAAc;IACrD,OAAOA,UAAU,QAAQ,OAAOA,UAAU,YAAY,gBAAgBA,SAAS,WAAWA;AAC5F;AAuaA,OAAO,SAASC,kBACdC,KAAa;IAEb,OACEA,MAAMC,IAAI,KAAK,WACfD,MAAMC,IAAI,KAAK,WACfD,MAAMC,IAAI,KAAK,SACfD,MAAMC,IAAI,KAAK;AAEnB;AAEA,OAAO,SAASC,iBACdF,KAAa;IAEb,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASE,iBACdH,KAAa;IAEb,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASG,iBACdJ,KAAa;IAEb,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASI,eAAeC,MAAc;IAC3C,OAAO,OAAOA,WAAW;AAC3B;AAEA,OAAO,SAASC,kBAAkBC,OAAiB;IACjD,OAAOC,MAAMC,OAAO,CAACF,YAAY,OAAOA,SAAS,CAAC,EAAE,KAAK;AAC3D;AAEA,OAAO,SAASG,cAAcL,MAAc;IAC1C,OAAO,OAAOA,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A;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,uBAAuB,CAAA;CAClC;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,qBAAqB,EAAE,CAAA;IAC/B,OAAO,CAAC,EACJ;QACE,CAAC,IAAI,EAAE,MAAM,GAAG;YACd,iBAAiB,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;YACtC,IAAI,EAAE,iBAAiB,CAAA;YACvB,WAAW,CAAC,EAAE,iBAAiB,CAAA;SAChC,CAAA;KACF,GACD,KAAK,CAAA;CACV,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["import type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type {\n Access,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LivePreviewConfig,\n MetaConfig,\n OpenGraphConfig,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { GlobalSlug, TypedGlobal } from '../../index.js'\nimport type { PayloadRequest, RequestContext, Where } from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type DataFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobal[TSlug]\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n previousDoc: any\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n query?: Where\n req: PayloadRequest\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n elements?: {\n Description?: EntityDescriptionComponent\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n }\n views?: {\n /**\n * Set to a React component to replace the entire Edit View, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n edit?: EditConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Place globals into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the global from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit View\n */\n hideAPIURL?: boolean\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n}\n\nexport type GlobalConfig = {\n access?: {\n read?: Access\n readDrafts?: Access\n readVersions?: Access\n update?: Access\n }\n admin?: GlobalAdminOptions\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n graphQL?:\n | {\n name?: string\n }\n | false\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterRead?: AfterReadHook[]\n beforeChange?: BeforeChangeHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n label?: Record<string, string> | string\n slug: string\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n versions?: boolean | IncomingGlobalVersions\n}\n\nexport interface SanitizedGlobalConfig\n extends Omit<DeepRequired<GlobalConfig>, 'endpoints' | 'fields' | 'versions'> {\n endpoints: Endpoint[] | false\n fields: Field[]\n versions: SanitizedGlobalVersions\n}\n\nexport type Globals = {\n config: SanitizedGlobalConfig[]\n graphQL?:\n | {\n [slug: string]: {\n mutationInputType: GraphQLNonNull<any>\n type: GraphQLObjectType\n versionType?: GraphQLObjectType\n }\n }\n | false\n}\n"],"names":[],"mappings":"AA2LA,WAWC"}
1
+ {"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["import type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired } from 'ts-essentials'\n\nimport type {\n CustomPreviewButton,\n CustomPublishButton,\n CustomSaveButton,\n CustomSaveDraftButton,\n} from '../../admin/types.js'\nimport type {\n Access,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LivePreviewConfig,\n MetaConfig,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Field } from '../../fields/config/types.js'\nimport type { GlobalSlug, TypedGlobal } from '../../index.js'\nimport type { PayloadRequest, RequestContext, Where } from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type DataFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobal[TSlug]\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n originalDoc?: any\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n previousDoc: any\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n query?: Where\n req: PayloadRequest\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: {\n elements?: {\n Description?: EntityDescriptionComponent\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomPreviewButton\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomPublishButton\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomSaveButton\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomSaveDraftButton\n }\n views?: {\n /**\n * Set to a React component to replace the entire Edit View, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n edit?: EditConfig\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Place globals into a navigational group\n * */\n group?: Record<string, string> | string\n /**\n * Exclude the global from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit View\n */\n hideAPIURL?: boolean\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n}\n\nexport type GlobalConfig = {\n access?: {\n read?: Access\n readDrafts?: Access\n readVersions?: Access\n update?: Access\n }\n admin?: GlobalAdminOptions\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n graphQL?:\n | {\n name?: string\n }\n | false\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterRead?: AfterReadHook[]\n beforeChange?: BeforeChangeHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n }\n label?: Record<string, string> | string\n slug: string\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n versions?: boolean | IncomingGlobalVersions\n}\n\nexport interface SanitizedGlobalConfig\n extends Omit<DeepRequired<GlobalConfig>, 'endpoints' | 'fields' | 'versions'> {\n endpoints: Endpoint[] | false\n fields: Field[]\n versions: SanitizedGlobalVersions\n}\n\nexport type Globals = {\n config: SanitizedGlobalConfig[]\n graphQL?:\n | {\n [slug: string]: {\n mutationInputType: GraphQLNonNull<any>\n type: GraphQLObjectType\n versionType?: GraphQLObjectType\n }\n }\n | false\n}\n"],"names":[],"mappings":"AA0LA,WAWC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/preferences/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAAE,KAAK,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AG,uBAAuB,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,iBAAiB,CAAA;CAC1B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/preferences/types.ts"],"sourcesContent":["import type { User } from '../auth/index.js'\nimport type { PayloadRequest } from '../types/index.js'\n\nexport type PreferenceRequest = {\n key: string\n overrideAccess?: boolean\n req: PayloadRequest\n user: PayloadRequest['user']\n}\n\nexport type PreferenceUpdateRequest = { value: unknown } & PreferenceRequest\n\nexport type CollapsedPreferences = string[]\n\nexport type TabsPreferences = Array<{\n [path: string]: number\n}>\n\nexport type InsideFieldsPreferences = {\n collapsed: CollapsedPreferences\n tabIndex: number\n}\nexport type FieldsPreferences = {\n [key: string]: InsideFieldsPreferences\n}\n\nexport type DocumentPreferences = {\n fields: FieldsPreferences\n}\n"],"names":[],"mappings":"AA0BA,WAEC"}
1
+ {"version":3,"sources":["../../src/preferences/types.ts"],"sourcesContent":["import type { PayloadRequest } from '../types/index.js'\n\nexport type PreferenceRequest = {\n key: string\n overrideAccess?: boolean\n req: PayloadRequest\n user: PayloadRequest['user']\n}\n\nexport type PreferenceUpdateRequest = { value: unknown } & PreferenceRequest\n\nexport type CollapsedPreferences = string[]\n\nexport type TabsPreferences = Array<{\n [path: string]: number\n}>\n\nexport type InsideFieldsPreferences = {\n collapsed: CollapsedPreferences\n tabIndex: number\n}\nexport type FieldsPreferences = {\n [key: string]: InsideFieldsPreferences\n}\n\nexport type DocumentPreferences = {\n fields: FieldsPreferences\n}\n"],"names":[],"mappings":"AAyBA,WAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/uploads/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAA6B,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,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AAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp, Metadata as SharpMetadata } from 'sharp'\n\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { WithMetadata } from './optionallyAppendMetadata.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n focalX?: number\n focalY?: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp `toFormat()` function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type GenerateImageName = (args: {\n extension: string\n height: number\n originalName: string\n sizeName: string\n width: number\n}) => string\n\nexport type ImageSize = {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n /**\n * Generate a custom name for the file of this image size.\n */\n generateImageName?: GenerateImageName\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n} & Omit<ResizeOptions, 'withoutEnlargement'>\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type UploadConfig = {\n /**\n * The adapter name to use for uploads. Used for storage adapter telemetry.\n * @default undefined\n */\n adapter?: string\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n /**\n * Enables bulk upload of files from the list view.\n * @default true\n */\n bulkUpload?: boolean\n /**\n * Enables cropping of images.\n * @default true\n */\n crop?: boolean\n /**\n * Disable the ability to save files to disk.\n * @default false\n */\n disableLocalStorage?: boolean\n /**\n * Enable displaying preview of the uploaded file in Upload fields related to this Collection.\n * Can be locally overridden by `displayPreview` option in Upload field.\n * @default false\n */\n displayPreview?: boolean\n /**\n * Ability to filter/modify Request Headers when fetching a file.\n *\n * Useful for adding custom headers to fetch from external providers.\n * @default undefined\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n /**\n * Field slugs to use for a compount index instead of the default filename index.\n */\n filenameCompoundIndex?: string[]\n /**\n * Require files to be uploaded when creating a document.\n * @default true\n */\n filesRequiredOnCreate?: boolean\n /**\n * Enables focal point positioning for image manipulation.\n * @default false\n */\n focalPoint?: boolean\n /**\n * Format options for the uploaded file. Formatting image sizes needs to be done within each formatOptions individually.\n */\n formatOptions?: ImageUploadFormatOptions\n /**\n * Custom handlers to run when a file is fetched.\n *\n * - If a handler returns a Response, the response will be sent to the client and no further handlers will be run.\n * - If a handler returns null, the next handler will be run.\n * - If no handlers return a response the file will be returned by default.\n *\n * @default undefined\n */\n handlers?: ((\n req: PayloadRequest,\n args: {\n doc: TypeWithID\n params: { collection: string; filename: string }\n },\n ) => Promise<Response> | Promise<void> | Response | void)[]\n imageSizes?: ImageSize[]\n /**\n * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards\n * @example ['image/*', 'application/pdf']\n * @default undefined\n */\n mimeTypes?: string[]\n /**\n * Ability to modify the response headers fetching a file.\n * @default undefined\n */\n modifyResponseHeaders?: ({ headers }: { headers: Headers }) => Headers\n /**\n * Sharp resize options for the original image.\n * @link https://sharp.pixelplumbing.com/api-resize#resize\n * @default undefined\n */\n resizeOptions?: ResizeOptions\n /**\n * The directory to serve static files from. Defaults to collection slug.\n * @default undefined\n */\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * Optionally append metadata to the image during processing.\n *\n * Can be a boolean or a function.\n *\n * If true, metadata will be appended to the image.\n * If false, no metadata will be appended.\n * If a function, it will receive an object containing the metadata and should return a boolean indicating whether to append the metadata.\n * @default false\n */\n withMetadata?: WithMetadata\n}\n\nexport type SanitizedUploadConfig = {\n staticDir: UploadConfig['staticDir']\n} & UploadConfig\n\nexport type File = {\n /**\n * The buffer of the file.\n */\n data: Buffer\n /**\n * The mimetype of the file.\n */\n mimetype: string\n /**\n * The name of the file.\n */\n name: string\n /**\n * The size of the file in bytes.\n */\n size: number\n}\n\nexport type FileToSave = {\n /**\n * The buffer of the file.\n */\n buffer: Buffer\n /**\n * The path to save the file.\n */\n path: string\n}\n\ntype Crop = {\n height: number\n unit: '%' | 'px'\n width: number\n x: number\n y: number\n}\n\ntype FocalPoint = {\n x: number\n y: number\n}\n\nexport type UploadEdits = {\n crop?: Crop\n focalPoint?: FocalPoint\n heightInPixels?: number\n widthInPixels?: number\n}\n"],"names":[],"mappings":"AAmPA,WAKC"}
1
+ {"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp } from 'sharp'\n\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { WithMetadata } from './optionallyAppendMetadata.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n focalX?: number\n focalY?: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp `toFormat()` function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type GenerateImageName = (args: {\n extension: string\n height: number\n originalName: string\n sizeName: string\n width: number\n}) => string\n\nexport type ImageSize = {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n /**\n * Generate a custom name for the file of this image size.\n */\n generateImageName?: GenerateImageName\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n} & Omit<ResizeOptions, 'withoutEnlargement'>\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type UploadConfig = {\n /**\n * The adapter name to use for uploads. Used for storage adapter telemetry.\n * @default undefined\n */\n adapter?: string\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n /**\n * Enables bulk upload of files from the list view.\n * @default true\n */\n bulkUpload?: boolean\n /**\n * Enables cropping of images.\n * @default true\n */\n crop?: boolean\n /**\n * Disable the ability to save files to disk.\n * @default false\n */\n disableLocalStorage?: boolean\n /**\n * Enable displaying preview of the uploaded file in Upload fields related to this Collection.\n * Can be locally overridden by `displayPreview` option in Upload field.\n * @default false\n */\n displayPreview?: boolean\n /**\n * Ability to filter/modify Request Headers when fetching a file.\n *\n * Useful for adding custom headers to fetch from external providers.\n * @default undefined\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n /**\n * Field slugs to use for a compount index instead of the default filename index.\n */\n filenameCompoundIndex?: string[]\n /**\n * Require files to be uploaded when creating a document.\n * @default true\n */\n filesRequiredOnCreate?: boolean\n /**\n * Enables focal point positioning for image manipulation.\n * @default false\n */\n focalPoint?: boolean\n /**\n * Format options for the uploaded file. Formatting image sizes needs to be done within each formatOptions individually.\n */\n formatOptions?: ImageUploadFormatOptions\n /**\n * Custom handlers to run when a file is fetched.\n *\n * - If a handler returns a Response, the response will be sent to the client and no further handlers will be run.\n * - If a handler returns null, the next handler will be run.\n * - If no handlers return a response the file will be returned by default.\n *\n * @default undefined\n */\n handlers?: ((\n req: PayloadRequest,\n args: {\n doc: TypeWithID\n params: { collection: string; filename: string }\n },\n ) => Promise<Response> | Promise<void> | Response | void)[]\n imageSizes?: ImageSize[]\n /**\n * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards\n * @example ['image/*', 'application/pdf']\n * @default undefined\n */\n mimeTypes?: string[]\n /**\n * Ability to modify the response headers fetching a file.\n * @default undefined\n */\n modifyResponseHeaders?: ({ headers }: { headers: Headers }) => Headers\n /**\n * Sharp resize options for the original image.\n * @link https://sharp.pixelplumbing.com/api-resize#resize\n * @default undefined\n */\n resizeOptions?: ResizeOptions\n /**\n * The directory to serve static files from. Defaults to collection slug.\n * @default undefined\n */\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * Optionally append metadata to the image during processing.\n *\n * Can be a boolean or a function.\n *\n * If true, metadata will be appended to the image.\n * If false, no metadata will be appended.\n * If a function, it will receive an object containing the metadata and should return a boolean indicating whether to append the metadata.\n * @default false\n */\n withMetadata?: WithMetadata\n}\n\nexport type SanitizedUploadConfig = {\n staticDir: UploadConfig['staticDir']\n} & UploadConfig\n\nexport type File = {\n /**\n * The buffer of the file.\n */\n data: Buffer\n /**\n * The mimetype of the file.\n */\n mimetype: string\n /**\n * The name of the file.\n */\n name: string\n /**\n * The size of the file in bytes.\n */\n size: number\n}\n\nexport type FileToSave = {\n /**\n * The buffer of the file.\n */\n buffer: Buffer\n /**\n * The path to save the file.\n */\n path: string\n}\n\ntype Crop = {\n height: number\n unit: '%' | 'px'\n width: number\n x: number\n y: number\n}\n\ntype FocalPoint = {\n x: number\n y: number\n}\n\nexport type UploadEdits = {\n crop?: Crop\n focalPoint?: FocalPoint\n heightInPixels?: number\n widthInPixels?: number\n}\n"],"names":[],"mappings":"AAmPA,WAKC"}
@@ -1,3 +1,3 @@
1
- import type { Data, FormState } from 'payload';
1
+ import type { Data, FormState } from '../admin/types.js';
2
2
  export declare const getSiblingData: (fields: FormState, path: string) => Data;
3
3
  //# sourceMappingURL=getSiblingData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSiblingData.d.ts","sourceRoot":"","sources":["../../src/utilities/getSiblingData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAK9C,eAAO,MAAM,cAAc,WAAY,SAAS,QAAQ,MAAM,KAAG,IAqChE,CAAA"}
1
+ {"version":3,"file":"getSiblingData.d.ts","sourceRoot":"","sources":["../../src/utilities/getSiblingData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAKxD,eAAO,MAAM,cAAc,WAAY,SAAS,QAAQ,MAAM,KAAG,IAqChE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/getSiblingData.ts"],"sourcesContent":["import type { Data, FormState } from 'payload'\n\nimport { reduceFieldsToValues } from './reduceFieldsToValues.js'\nimport { unflatten } from './unflatten.js'\n\nexport const getSiblingData = (fields: FormState, path: string): Data => {\n if (!fields) {\n return null\n }\n\n if (path.indexOf('.') === -1) {\n return reduceFieldsToValues(fields, true)\n }\n\n const siblingFields = {}\n\n // Determine if the last segment of the path is an array-based row\n const pathSegments = path.split('.')\n const lastSegment = pathSegments[pathSegments.length - 1]\n const lastSegmentIsRowIndex = !Number.isNaN(Number(lastSegment))\n\n let parentFieldPath: string\n\n if (lastSegmentIsRowIndex) {\n // If the last segment is a row index,\n // the sibling data is that row's contents\n // so create a parent field path that will\n // retrieve all contents of that row index only\n parentFieldPath = `${path}.`\n } else {\n // Otherwise, the last path segment is a field name\n // and it should be removed\n parentFieldPath = path.substring(0, path.lastIndexOf('.') + 1)\n }\n\n Object.keys(fields).forEach((fieldKey) => {\n if (!fields[fieldKey].disableFormData && fieldKey.indexOf(parentFieldPath) === 0) {\n siblingFields[fieldKey.replace(parentFieldPath, '')] = fields[fieldKey].value\n }\n })\n\n return unflatten(siblingFields)\n}\n"],"names":["reduceFieldsToValues","unflatten","getSiblingData","fields","path","indexOf","siblingFields","pathSegments","split","lastSegment","length","lastSegmentIsRowIndex","Number","isNaN","parentFieldPath","substring","lastIndexOf","Object","keys","forEach","fieldKey","disableFormData","replace","value"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,SAAS,QAAQ,iBAAgB;AAE1C,OAAO,MAAMC,iBAAiB,CAACC,QAAmBC;IAChD,IAAI,CAACD,QAAQ;QACX,OAAO;IACT;IAEA,IAAIC,KAAKC,OAAO,CAAC,SAAS,CAAC,GAAG;QAC5B,OAAOL,qBAAqBG,QAAQ;IACtC;IAEA,MAAMG,gBAAgB,CAAC;IAEvB,kEAAkE;IAClE,MAAMC,eAAeH,KAAKI,KAAK,CAAC;IAChC,MAAMC,cAAcF,YAAY,CAACA,aAAaG,MAAM,GAAG,EAAE;IACzD,MAAMC,wBAAwB,CAACC,OAAOC,KAAK,CAACD,OAAOH;IAEnD,IAAIK;IAEJ,IAAIH,uBAAuB;QACzB,sCAAsC;QACtC,0CAA0C;QAC1C,0CAA0C;QAC1C,+CAA+C;QAC/CG,kBAAkB,CAAC,EAAEV,KAAK,CAAC,CAAC;IAC9B,OAAO;QACL,mDAAmD;QACnD,2BAA2B;QAC3BU,kBAAkBV,KAAKW,SAAS,CAAC,GAAGX,KAAKY,WAAW,CAAC,OAAO;IAC9D;IAEAC,OAAOC,IAAI,CAACf,QAAQgB,OAAO,CAAC,CAACC;QAC3B,IAAI,CAACjB,MAAM,CAACiB,SAAS,CAACC,eAAe,IAAID,SAASf,OAAO,CAACS,qBAAqB,GAAG;YAChFR,aAAa,CAACc,SAASE,OAAO,CAACR,iBAAiB,IAAI,GAAGX,MAAM,CAACiB,SAAS,CAACG,KAAK;QAC/E;IACF;IAEA,OAAOtB,UAAUK;AACnB,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/getSiblingData.ts"],"sourcesContent":["import type { Data, FormState } from '../admin/types.js'\n\nimport { reduceFieldsToValues } from './reduceFieldsToValues.js'\nimport { unflatten } from './unflatten.js'\n\nexport const getSiblingData = (fields: FormState, path: string): Data => {\n if (!fields) {\n return null\n }\n\n if (path.indexOf('.') === -1) {\n return reduceFieldsToValues(fields, true)\n }\n\n const siblingFields = {}\n\n // Determine if the last segment of the path is an array-based row\n const pathSegments = path.split('.')\n const lastSegment = pathSegments[pathSegments.length - 1]\n const lastSegmentIsRowIndex = !Number.isNaN(Number(lastSegment))\n\n let parentFieldPath: string\n\n if (lastSegmentIsRowIndex) {\n // If the last segment is a row index,\n // the sibling data is that row's contents\n // so create a parent field path that will\n // retrieve all contents of that row index only\n parentFieldPath = `${path}.`\n } else {\n // Otherwise, the last path segment is a field name\n // and it should be removed\n parentFieldPath = path.substring(0, path.lastIndexOf('.') + 1)\n }\n\n Object.keys(fields).forEach((fieldKey) => {\n if (!fields[fieldKey].disableFormData && fieldKey.indexOf(parentFieldPath) === 0) {\n siblingFields[fieldKey.replace(parentFieldPath, '')] = fields[fieldKey].value\n }\n })\n\n return unflatten(siblingFields)\n}\n"],"names":["reduceFieldsToValues","unflatten","getSiblingData","fields","path","indexOf","siblingFields","pathSegments","split","lastSegment","length","lastSegmentIsRowIndex","Number","isNaN","parentFieldPath","substring","lastIndexOf","Object","keys","forEach","fieldKey","disableFormData","replace","value"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,SAAS,QAAQ,iBAAgB;AAE1C,OAAO,MAAMC,iBAAiB,CAACC,QAAmBC;IAChD,IAAI,CAACD,QAAQ;QACX,OAAO;IACT;IAEA,IAAIC,KAAKC,OAAO,CAAC,SAAS,CAAC,GAAG;QAC5B,OAAOL,qBAAqBG,QAAQ;IACtC;IAEA,MAAMG,gBAAgB,CAAC;IAEvB,kEAAkE;IAClE,MAAMC,eAAeH,KAAKI,KAAK,CAAC;IAChC,MAAMC,cAAcF,YAAY,CAACA,aAAaG,MAAM,GAAG,EAAE;IACzD,MAAMC,wBAAwB,CAACC,OAAOC,KAAK,CAACD,OAAOH;IAEnD,IAAIK;IAEJ,IAAIH,uBAAuB;QACzB,sCAAsC;QACtC,0CAA0C;QAC1C,0CAA0C;QAC1C,+CAA+C;QAC/CG,kBAAkB,CAAC,EAAEV,KAAK,CAAC,CAAC;IAC9B,OAAO;QACL,mDAAmD;QACnD,2BAA2B;QAC3BU,kBAAkBV,KAAKW,SAAS,CAAC,GAAGX,KAAKY,WAAW,CAAC,OAAO;IAC9D;IAEAC,OAAOC,IAAI,CAACf,QAAQgB,OAAO,CAAC,CAACC;QAC3B,IAAI,CAACjB,MAAM,CAACiB,SAAS,CAACC,eAAe,IAAID,SAASf,OAAO,CAACS,qBAAqB,GAAG;YAChFR,aAAa,CAACc,SAASE,OAAO,CAACR,iBAAiB,IAAI,GAAGX,MAAM,CAACiB,SAAS,CAACG,KAAK;QAC/E;IACF;IAEA,OAAOtB,UAAUK;AACnB,EAAC"}
@@ -1,4 +1,4 @@
1
- import type { Data, FormState } from 'payload';
1
+ import type { Data, FormState } from '../admin/types.js';
2
2
  /**
3
3
  * Reduce flattened form fields (Fields) to just map to the respective values instead of the full FormField object
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"reduceFieldsToValues.d.ts","sourceRoot":"","sources":["../../src/utilities/reduceFieldsToValues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAG9C;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,WACvB,SAAS,cACL,OAAO,0BACK,OAAO,KAC9B,IAkBF,CAAA"}
1
+ {"version":3,"file":"reduceFieldsToValues.d.ts","sourceRoot":"","sources":["../../src/utilities/reduceFieldsToValues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGxD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,WACvB,SAAS,cACL,OAAO,0BACK,OAAO,KAC9B,IAkBF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/reduceFieldsToValues.ts"],"sourcesContent":["import type { Data, FormState } from 'payload'\n\nimport { unflatten as flatleyUnflatten } from './unflatten.js'\n/**\n * Reduce flattened form fields (Fields) to just map to the respective values instead of the full FormField object\n *\n * @param unflatten This also unflattens the data if `unflatten` is true. The unflattened data should match the original data structure\n * @param ignoreDisableFormData - if true, will include fields that have `disableFormData` set to true, for example, blocks or arrays fields.\n *\n */\nexport const reduceFieldsToValues = (\n fields: FormState,\n unflatten?: boolean,\n ignoreDisableFormData?: boolean,\n): Data => {\n let data = {}\n\n if (!fields) {\n return data\n }\n\n Object.keys(fields).forEach((key) => {\n if (ignoreDisableFormData === true || !fields[key]?.disableFormData) {\n data[key] = fields[key]?.value\n }\n })\n\n if (unflatten) {\n data = flatleyUnflatten(data)\n }\n\n return data\n}\n"],"names":["unflatten","flatleyUnflatten","reduceFieldsToValues","fields","ignoreDisableFormData","data","Object","keys","forEach","key","disableFormData","value"],"mappings":"AAEA,SAASA,aAAaC,gBAAgB,QAAQ,iBAAgB;AAC9D;;;;;;CAMC,GACD,OAAO,MAAMC,uBAAuB,CAClCC,QACAH,WACAI;IAEA,IAAIC,OAAO,CAAC;IAEZ,IAAI,CAACF,QAAQ;QACX,OAAOE;IACT;IAEAC,OAAOC,IAAI,CAACJ,QAAQK,OAAO,CAAC,CAACC;QAC3B,IAAIL,0BAA0B,QAAQ,CAACD,MAAM,CAACM,IAAI,EAAEC,iBAAiB;YACnEL,IAAI,CAACI,IAAI,GAAGN,MAAM,CAACM,IAAI,EAAEE;QAC3B;IACF;IAEA,IAAIX,WAAW;QACbK,OAAOJ,iBAAiBI;IAC1B;IAEA,OAAOA;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/reduceFieldsToValues.ts"],"sourcesContent":["import type { Data, FormState } from '../admin/types.js'\n\nimport { unflatten as flatleyUnflatten } from './unflatten.js'\n/**\n * Reduce flattened form fields (Fields) to just map to the respective values instead of the full FormField object\n *\n * @param unflatten This also unflattens the data if `unflatten` is true. The unflattened data should match the original data structure\n * @param ignoreDisableFormData - if true, will include fields that have `disableFormData` set to true, for example, blocks or arrays fields.\n *\n */\nexport const reduceFieldsToValues = (\n fields: FormState,\n unflatten?: boolean,\n ignoreDisableFormData?: boolean,\n): Data => {\n let data = {}\n\n if (!fields) {\n return data\n }\n\n Object.keys(fields).forEach((key) => {\n if (ignoreDisableFormData === true || !fields[key]?.disableFormData) {\n data[key] = fields[key]?.value\n }\n })\n\n if (unflatten) {\n data = flatleyUnflatten(data)\n }\n\n return data\n}\n"],"names":["unflatten","flatleyUnflatten","reduceFieldsToValues","fields","ignoreDisableFormData","data","Object","keys","forEach","key","disableFormData","value"],"mappings":"AAEA,SAASA,aAAaC,gBAAgB,QAAQ,iBAAgB;AAC9D;;;;;;CAMC,GACD,OAAO,MAAMC,uBAAuB,CAClCC,QACAH,WACAI;IAEA,IAAIC,OAAO,CAAC;IAEZ,IAAI,CAACF,QAAQ;QACX,OAAOE;IACT;IAEAC,OAAOC,IAAI,CAACJ,QAAQK,OAAO,CAAC,CAACC;QAC3B,IAAIL,0BAA0B,QAAQ,CAACD,MAAM,CAACM,IAAI,EAAEC,iBAAiB;YACnEL,IAAI,CAACI,IAAI,GAAGN,MAAM,CAACM,IAAI,EAAEE;QAC3B;IACF;IAEA,IAAIX,WAAW;QACbK,OAAOJ,iBAAiBI;IAC1B;IAEA,OAAOA;AACT,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "3.0.0-beta.97",
3
+ "version": "3.0.0-beta.98",
4
4
  "description": "Node, React, Headless CMS and Application Framework built on Next.js",
5
5
  "keywords": [
6
6
  "admin panel",
@@ -96,7 +96,7 @@
96
96
  "ts-essentials": "7.0.3",
97
97
  "tsx": "4.17.0",
98
98
  "uuid": "10.0.0",
99
- "@payloadcms/translations": "3.0.0-beta.97"
99
+ "@payloadcms/translations": "3.0.0-beta.98"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@hyrious/esbuild-plugin-commonjs": "^0.2.4",
@@ -113,7 +113,7 @@
113
113
  "graphql-http": "^1.22.0",
114
114
  "rimraf": "3.0.2",
115
115
  "sharp": "0.32.6",
116
- "@payloadcms/eslint-config": "3.0.0-beta.59"
116
+ "@payloadcms/eslint-config": "3.0.0-beta.97"
117
117
  },
118
118
  "peerDependencies": {
119
119
  "graphql": "^16.8.1"