payload 4.0.0-internal.1f9ae9a → 4.0.0-internal.293e026
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/RichText.d.ts +22 -10
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js.map +1 -1
- package/dist/admin/adapters/devReload.d.ts +9 -0
- package/dist/admin/adapters/devReload.d.ts.map +1 -0
- package/dist/admin/adapters/devReload.js +6 -0
- package/dist/admin/adapters/devReload.js.map +1 -0
- package/dist/admin/adapters/index.d.ts +3 -0
- package/dist/admin/adapters/index.d.ts.map +1 -1
- package/dist/admin/adapters/index.js.map +1 -1
- package/dist/admin/adapters/render.d.ts +16 -0
- package/dist/admin/adapters/render.d.ts.map +1 -0
- package/dist/admin/adapters/render.js +7 -0
- package/dist/admin/adapters/render.js.map +1 -0
- package/dist/admin/adapters/views.d.ts +36 -0
- package/dist/admin/adapters/views.d.ts.map +1 -0
- package/dist/admin/adapters/views.js +7 -0
- package/dist/admin/adapters/views.js.map +1 -0
- package/dist/admin/forms/Field.d.ts +7 -0
- package/dist/admin/forms/Field.d.ts.map +1 -1
- package/dist/admin/forms/Field.js.map +1 -1
- package/dist/admin/forms/Form.d.ts +29 -0
- package/dist/admin/forms/Form.d.ts.map +1 -1
- package/dist/admin/forms/Form.js.map +1 -1
- package/dist/admin/functions/index.d.ts +9 -0
- package/dist/admin/functions/index.d.ts.map +1 -1
- package/dist/admin/functions/index.js.map +1 -1
- package/dist/admin/types.d.ts +1 -1
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/admin/views/dashboard.d.ts +7 -0
- package/dist/admin/views/dashboard.d.ts.map +1 -1
- package/dist/admin/views/dashboard.js.map +1 -1
- package/dist/admin/views/document.d.ts +7 -1
- package/dist/admin/views/document.d.ts.map +1 -1
- package/dist/admin/views/document.js.map +1 -1
- package/dist/auth/defaultAccess.d.ts +1 -1
- package/dist/auth/defaultAccess.d.ts.map +1 -1
- package/dist/auth/defaultAccess.js +1 -1
- package/dist/auth/defaultAccess.js.map +1 -1
- package/dist/auth/defaultUser.d.ts.map +1 -1
- package/dist/auth/defaultUser.js +2 -1
- package/dist/auth/defaultUser.js.map +1 -1
- package/dist/bin/generateImportMap/index.d.ts.map +1 -1
- package/dist/bin/generateImportMap/index.js +8 -5
- package/dist/bin/generateImportMap/index.js.map +1 -1
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts +5 -1
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +1 -1
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js +24 -18
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js.map +1 -1
- package/dist/bin/generateTypes.d.ts +3 -2
- package/dist/bin/generateTypes.d.ts.map +1 -1
- package/dist/bin/generateTypes.js +11 -1
- package/dist/bin/generateTypes.js.map +1 -1
- package/dist/bin/loadEnv.d.ts +3 -1
- package/dist/bin/loadEnv.d.ts.map +1 -1
- package/dist/bin/loadEnv.js +40 -10
- package/dist/bin/loadEnv.js.map +1 -1
- package/dist/collections/config/defaults.js +2 -2
- package/dist/collections/config/defaults.js.map +1 -1
- package/dist/collections/config/defaults.spec.js +47 -0
- package/dist/collections/config/defaults.spec.js.map +1 -0
- package/dist/collections/config/types.d.ts +4 -7
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js +3 -0
- package/dist/collections/operations/delete.js.map +1 -1
- package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
- package/dist/collections/operations/local/duplicate.js.map +1 -1
- package/dist/collections/operations/local/find.d.ts.map +1 -1
- package/dist/collections/operations/local/find.js.map +1 -1
- package/dist/collections/operations/local/findByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findByID.js.map +1 -1
- package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersionByID.js.map +1 -1
- package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersions.js.map +1 -1
- package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/local/restoreVersion.js.map +1 -1
- package/dist/config/client.js.map +1 -1
- package/dist/config/types.d.ts +10 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +1 -0
- package/dist/config/types.js.map +1 -1
- package/dist/database/getLocalizedPaths.d.ts.map +1 -1
- package/dist/database/getLocalizedPaths.js +1 -1
- package/dist/database/getLocalizedPaths.js.map +1 -1
- package/dist/database/migrations/migrationsCollection.d.ts.map +1 -1
- package/dist/database/migrations/migrationsCollection.js +2 -1
- package/dist/database/migrations/migrationsCollection.js.map +1 -1
- package/dist/exports/shared.d.ts +20 -0
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js +20 -0
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/config/client.d.ts +2 -2
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/client.js +1 -9
- package/dist/fields/config/client.js.map +1 -1
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +1 -4
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/types.d.ts +9 -24
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/hooks/afterChange/promise.js +1 -1
- package/dist/fields/hooks/afterChange/promise.js.map +1 -1
- package/dist/fields/hooks/afterRead/promise.js +2 -2
- package/dist/fields/hooks/afterRead/promise.js.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.js +3 -3
- package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
- package/dist/fields/hooks/beforeDuplicate/promise.js +2 -2
- package/dist/fields/hooks/beforeDuplicate/promise.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/fields/validations.js +5 -4
- package/dist/fields/validations.js.map +1 -1
- package/dist/globals/config/sanitize.d.ts.map +1 -1
- package/dist/globals/config/sanitize.js +1 -0
- package/dist/globals/config/sanitize.js.map +1 -1
- package/dist/globals/config/sanitize.spec.js +43 -0
- package/dist/globals/config/sanitize.spec.js.map +1 -0
- package/dist/globals/operations/local/findOne.d.ts.map +1 -1
- package/dist/globals/operations/local/findOne.js.map +1 -1
- package/dist/globals/operations/local/update.d.ts.map +1 -1
- package/dist/globals/operations/local/update.js.map +1 -1
- package/dist/index.bundled.d.ts +244 -89
- package/dist/index.d.ts +8 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -33
- package/dist/index.js.map +1 -1
- package/dist/kv/adapters/DatabaseKVAdapter.d.ts.map +1 -1
- package/dist/kv/adapters/DatabaseKVAdapter.js +1 -0
- package/dist/kv/adapters/DatabaseKVAdapter.js.map +1 -1
- package/dist/locked-documents/config.d.ts.map +1 -1
- package/dist/locked-documents/config.js +2 -1
- package/dist/locked-documents/config.js.map +1 -1
- package/dist/preferences/config.d.ts.map +1 -1
- package/dist/preferences/config.js +2 -1
- package/dist/preferences/config.js.map +1 -1
- package/dist/query-presets/config.d.ts.map +1 -1
- package/dist/query-presets/config.js +2 -1
- package/dist/query-presets/config.js.map +1 -1
- package/dist/queues/config/collection.d.ts.map +1 -1
- package/dist/queues/config/collection.js +2 -1
- package/dist/queues/config/collection.js.map +1 -1
- package/dist/queues/config/generateJobsJSONSchemas.d.ts +1 -1
- package/dist/queues/config/generateJobsJSONSchemas.d.ts.map +1 -1
- package/dist/queues/config/generateJobsJSONSchemas.js +33 -12
- package/dist/queues/config/generateJobsJSONSchemas.js.map +1 -1
- package/dist/queues/config/global.d.ts.map +1 -1
- package/dist/queues/config/global.js +2 -1
- package/dist/queues/config/global.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
- package/dist/uploads/fetchAPI-multipart/processMultipart.js +14 -1
- package/dist/uploads/fetchAPI-multipart/processMultipart.js.map +1 -1
- package/dist/uploads/safeFetch.d.ts.map +1 -1
- package/dist/uploads/safeFetch.js +11 -5
- package/dist/uploads/safeFetch.js.map +1 -1
- package/dist/utilities/appendDateTimezoneSelectFields.js +2 -2
- package/dist/utilities/appendDateTimezoneSelectFields.js.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts +59 -16
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +158 -59
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/dist/utilities/configToJSONSchema.spec.js +225 -39
- package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
- package/dist/utilities/dependencies/dependencyChecker.js +1 -1
- package/dist/utilities/dependencies/dependencyChecker.js.map +1 -1
- package/dist/utilities/dependencies/getDependencies.d.ts.map +1 -1
- package/dist/utilities/dependencies/getDependencies.js +5 -5
- package/dist/utilities/dependencies/getDependencies.js.map +1 -1
- package/dist/utilities/dynamicImport.js +1 -1
- package/dist/utilities/dynamicImport.js.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.d.ts.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.js +5 -12
- package/dist/utilities/filterDataToSelectedLocales.js.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.spec.js +1 -2
- package/dist/utilities/filterDataToSelectedLocales.spec.js.map +1 -1
- package/dist/utilities/flattenAllFields.d.ts.map +1 -1
- package/dist/utilities/flattenAllFields.js +7 -22
- package/dist/utilities/flattenAllFields.js.map +1 -1
- package/dist/utilities/formatErrors.d.ts.map +1 -1
- package/dist/utilities/formatErrors.js +3 -1
- package/dist/utilities/formatErrors.js.map +1 -1
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts.map +1 -1
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.js +5 -5
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -1
- package/dist/utilities/getFieldByPath.d.ts.map +1 -1
- package/dist/utilities/getFieldByPath.js +1 -1
- package/dist/utilities/getFieldByPath.js.map +1 -1
- package/dist/utilities/getRequestLanguage.d.ts +2 -2
- package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
- package/dist/utilities/getRequestLanguage.js.map +1 -1
- package/dist/utilities/handleEndpoints.d.ts.map +1 -1
- package/dist/utilities/handleEndpoints.js +7 -3
- package/dist/utilities/handleEndpoints.js.map +1 -1
- package/dist/utilities/isRSCEnabled.d.ts +12 -0
- package/dist/utilities/isRSCEnabled.d.ts.map +1 -0
- package/dist/utilities/isRSCEnabled.js +14 -0
- package/dist/utilities/isRSCEnabled.js.map +1 -0
- package/dist/utilities/mergeLocalizedData.d.ts.map +1 -1
- package/dist/utilities/mergeLocalizedData.js +5 -12
- package/dist/utilities/mergeLocalizedData.js.map +1 -1
- package/dist/utilities/telemetry/conf/envPaths.d.ts.map +1 -1
- package/dist/utilities/telemetry/conf/envPaths.js +31 -40
- package/dist/utilities/telemetry/conf/envPaths.js.map +1 -1
- package/dist/utilities/transformColumnPreferences.js +4 -2
- package/dist/utilities/transformColumnPreferences.js.map +1 -1
- package/dist/utilities/traverseFields.d.ts.map +1 -1
- package/dist/utilities/traverseFields.js +2 -4
- package/dist/utilities/traverseFields.js.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.js +3 -0
- package/dist/utilities/traverseForLocalizedFields.js.map +1 -1
- package/package.json +7 -4
package/dist/admin/RichText.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { FieldAffectingData, RichTextField, RichTextFieldClient, Validate }
|
|
|
7
7
|
import type { SanitizedGlobalConfig } from '../globals/config/types.js';
|
|
8
8
|
import type { RequestContext, TypedFallbackLocale } from '../index.js';
|
|
9
9
|
import type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js';
|
|
10
|
+
import type { FieldsToJSONSchemaArgs } from '../utilities/configToJSONSchema.js';
|
|
10
11
|
import type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js';
|
|
11
12
|
import type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js';
|
|
12
13
|
export type AfterReadRichTextHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {
|
|
@@ -163,18 +164,9 @@ type RichTextAdapterBase<Value extends object = object, AdapterProps = any, Extr
|
|
|
163
164
|
* payload-types.ts)
|
|
164
165
|
*/
|
|
165
166
|
jsonSchema?: (args: {
|
|
166
|
-
collectionIDFieldTypes: {
|
|
167
|
-
[key: string]: 'number' | 'string';
|
|
168
|
-
};
|
|
169
|
-
config?: SanitizedConfig;
|
|
170
167
|
field: RichTextField<Value, AdapterProps, ExtraFieldProperties>;
|
|
171
|
-
i18n?: I18n;
|
|
172
|
-
/**
|
|
173
|
-
* Allows you to define new top-level interfaces that can be re-used in the output schema.
|
|
174
|
-
*/
|
|
175
|
-
interfaceNameDefinitions: Map<string, JSONSchema4>;
|
|
176
168
|
isRequired: boolean;
|
|
177
|
-
}) => JSONSchema4;
|
|
169
|
+
} & Pick<FieldsToJSONSchemaArgs, 'collectionIDFieldTypes' | 'config' | 'i18n' | 'interfaceNameDefinitions' | 'typeStringDefinitions'>) => JSONSchema4;
|
|
178
170
|
/**
|
|
179
171
|
* Provide validation function for the richText field. This function is run the same way
|
|
180
172
|
* as other field validation functions.
|
|
@@ -187,6 +179,13 @@ export type RichTextAdapter<Value extends object = any, AdapterProps = any, Extr
|
|
|
187
179
|
* `DefaultCellComponentProps` or `DefaultServerCellComponentProps`.
|
|
188
180
|
*/
|
|
189
181
|
CellComponent: PayloadComponent<never>;
|
|
182
|
+
/**
|
|
183
|
+
* Client-only field component for non-RSC adapters (e.g. TanStack Start).
|
|
184
|
+
* When provided, this component is used as a fallback when the RSC `FieldComponent`
|
|
185
|
+
* cannot be rendered (e.g. because customComponents are stripped during serialization).
|
|
186
|
+
* The component path is stored in field state and resolved from the import map on the client.
|
|
187
|
+
*/
|
|
188
|
+
ClientFieldComponent?: PayloadComponent<RichTextFieldClientProps>;
|
|
190
189
|
/**
|
|
191
190
|
* Component that will be displayed in the version diff view.
|
|
192
191
|
* If not provided, richtext content will be diffed as JSON.
|
|
@@ -196,6 +195,19 @@ export type RichTextAdapter<Value extends object = any, AdapterProps = any, Extr
|
|
|
196
195
|
* Component that will be displayed in the edit view.
|
|
197
196
|
*/
|
|
198
197
|
FieldComponent: PayloadComponent<RichTextFieldServerProps, RichTextFieldClientProps>;
|
|
198
|
+
/**
|
|
199
|
+
* Builds serializable props for the `ClientFieldComponent`.
|
|
200
|
+
* Called during `renderField` on the server; the returned object is stored
|
|
201
|
+
* in `fieldState.clientFieldComponentProps` and passed to the client component.
|
|
202
|
+
*/
|
|
203
|
+
getClientFieldProps?: (args: {
|
|
204
|
+
clientFieldSchemaMap: Map<string, any>;
|
|
205
|
+
path: string;
|
|
206
|
+
payload: {
|
|
207
|
+
importMap: Record<string, any>;
|
|
208
|
+
};
|
|
209
|
+
schemaPath: string;
|
|
210
|
+
}) => Record<string, any>;
|
|
199
211
|
} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>;
|
|
200
212
|
export type RichTextAdapterProvider<Value extends object = object, AdapterProps = any, ExtraFieldProperties = {}> = ({ config, isRoot, parentIsLocalized, }: {
|
|
201
213
|
config: SanitizedConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/admin/RichText.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oB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AAC,MAAM,EAAE,GAAG,CAAC,CAAA;QACtC,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;SAAE,CAAA;QAC3C,UAAU,EAAE,MAAM,CAAA;KACnB,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAC1B,GAAG,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAA;AAElE,MAAM,MAAM,uBAAuB,CACjC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,YAAY,GAAG,GAAG,EAClB,oBAAoB,GAAG,EAAE,IACvB,CAAC,EACH,MAAM,EACN,MAAM,EACN,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,OAAO,CAAA;CAC3B,KACG,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC,GACnE,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { ImportMapGenerators, PayloadComponent, SanitizedConfig } from '../config/types.js'\nimport type { ValidationFieldError } from '../errors/ValidationError.js'\nimport type {\n FieldAffectingData,\n RichTextField,\n RichTextFieldClient,\n Validate,\n} from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { RequestContext, TypedFallbackLocale } from '../index.js'\nimport type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js'\nimport type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js'\nimport type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js'\n\nexport type AfterReadRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TValue = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: TypedFallbackLocale\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populate?: PopulateType\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeValidateRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: ValidationFieldError[]\n /**\n * Built up field label\n *\n * @example \"Group Field > Tab Field > Rich Text Field\"\n */\n fieldLabelPath: string\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n overrideAccess: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\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 /** 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 /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n indexPath: number[]\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n parentIsLocalized: 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 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 /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n /**\n * Provide a function that can be used to add items to the import map. This is useful for\n * making modules available to the client.\n */\n generateImportMap?: ImportMapGenerators[0]\n /**\n * Provide a function that can be used to add items to the schema map. This is useful for\n * richtext sub-fields the server needs to \"know\" about in order to do things like calculate form state.\n *\n * This function is run within `buildFieldSchemaMap`.\n */\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18n<any, any>\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n parentIsLocalized: boolean\n populateArg?: PopulateType\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n /**\n * Return the JSON schema for the field value. The JSON schema is read by\n * `json-schema-to-typescript` which is used to generate types for this richtext field\n * payload-types.ts)\n */\n jsonSchema?: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n /**\n * Provide validation function for the richText field. This function is run the same way\n * as other field validation functions.\n */\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = any,\n AdapterProps = any,\n ExtraFieldProperties = any,\n> = {\n /**\n * Component that will be displayed in the list view. Can be typed as\n * `DefaultCellComponentProps` or `DefaultServerCellComponentProps`.\n */\n CellComponent: PayloadComponent<never>\n /**\n * Component that will be displayed in the version diff view.\n * If not provided, richtext content will be diffed as JSON.\n */\n DiffComponent?: PayloadComponent<\n FieldDiffServerProps<RichTextField, RichTextFieldClient>,\n FieldDiffClientProps<RichTextFieldClient>\n >\n /**\n * Component that will be displayed in the edit view.\n */\n FieldComponent: PayloadComponent<RichTextFieldServerProps, RichTextFieldClientProps>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the top-level `editor` property\n * of the Payload Config.\n *\n * @default false\n */\n isRoot?: boolean\n parentIsLocalized: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AAAA,qDAAqD,GA0SrD,WAoB8D"}
|
|
1
|
+
{"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { ImportMapGenerators, PayloadComponent, SanitizedConfig } from '../config/types.js'\nimport type { ValidationFieldError } from '../errors/ValidationError.js'\nimport type {\n FieldAffectingData,\n RichTextField,\n RichTextFieldClient,\n Validate,\n} from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { RequestContext, TypedFallbackLocale } from '../index.js'\nimport type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js'\nimport type { FieldsToJSONSchemaArgs } from '../utilities/configToJSONSchema.js'\nimport type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js'\nimport type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js'\n\nexport type AfterReadRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TValue = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: TypedFallbackLocale\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populate?: PopulateType\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeValidateRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: ValidationFieldError[]\n /**\n * Built up field label\n *\n * @example \"Group Field > Tab Field > Rich Text Field\"\n */\n fieldLabelPath: string\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n overrideAccess: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\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 /** 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 /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n indexPath: number[]\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n parentIsLocalized: 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 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 /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n /**\n * Provide a function that can be used to add items to the import map. This is useful for\n * making modules available to the client.\n */\n generateImportMap?: ImportMapGenerators[0]\n /**\n * Provide a function that can be used to add items to the schema map. This is useful for\n * richtext sub-fields the server needs to \"know\" about in order to do things like calculate form state.\n *\n * This function is run within `buildFieldSchemaMap`.\n */\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18n<any, any>\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n parentIsLocalized: boolean\n populateArg?: PopulateType\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n /**\n * Return the JSON schema for the field value. The JSON schema is read by\n * `json-schema-to-typescript` which is used to generate types for this richtext field\n * payload-types.ts)\n */\n jsonSchema?: (\n args: {\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n isRequired: boolean\n } & Pick<\n FieldsToJSONSchemaArgs,\n | 'collectionIDFieldTypes'\n | 'config'\n | 'i18n'\n | 'interfaceNameDefinitions'\n | 'typeStringDefinitions'\n >,\n ) => JSONSchema4\n /**\n * Provide validation function for the richText field. This function is run the same way\n * as other field validation functions.\n */\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = any,\n AdapterProps = any,\n ExtraFieldProperties = any,\n> = {\n /**\n * Component that will be displayed in the list view. Can be typed as\n * `DefaultCellComponentProps` or `DefaultServerCellComponentProps`.\n */\n CellComponent: PayloadComponent<never>\n /**\n * Client-only field component for non-RSC adapters (e.g. TanStack Start).\n * When provided, this component is used as a fallback when the RSC `FieldComponent`\n * cannot be rendered (e.g. because customComponents are stripped during serialization).\n * The component path is stored in field state and resolved from the import map on the client.\n */\n ClientFieldComponent?: PayloadComponent<RichTextFieldClientProps>\n /**\n * Component that will be displayed in the version diff view.\n * If not provided, richtext content will be diffed as JSON.\n */\n DiffComponent?: PayloadComponent<\n FieldDiffServerProps<RichTextField, RichTextFieldClient>,\n FieldDiffClientProps<RichTextFieldClient>\n >\n /**\n * Component that will be displayed in the edit view.\n */\n FieldComponent: PayloadComponent<RichTextFieldServerProps, RichTextFieldClientProps>\n /**\n * Builds serializable props for the `ClientFieldComponent`.\n * Called during `renderField` on the server; the returned object is stored\n * in `fieldState.clientFieldComponentProps` and passed to the client component.\n */\n getClientFieldProps?: (args: {\n clientFieldSchemaMap: Map<string, any>\n path: string\n payload: { importMap: Record<string, any> }\n schemaPath: string\n }) => Record<string, any>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the top-level `editor` property\n * of the Payload Config.\n *\n * @default false\n */\n isRoot?: boolean\n parentIsLocalized: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AAAA,qDAAqD,GA+TrD,WAoB8D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy for dev-mode HMR/reload detection.
|
|
3
|
+
* Each framework adapter provides its own implementation.
|
|
4
|
+
*/
|
|
5
|
+
export type DevReloadStrategy = {
|
|
6
|
+
connect: (onReload: () => void) => DevReloadCleanup;
|
|
7
|
+
};
|
|
8
|
+
export type DevReloadCleanup = () => void;
|
|
9
|
+
//# sourceMappingURL=devReload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devReload.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/devReload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,gBAAgB,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/devReload.ts"],"sourcesContent":["/**\n * Strategy for dev-mode HMR/reload detection.\n * Each framework adapter provides its own implementation.\n */\nexport type DevReloadStrategy = {\n connect: (onReload: () => void) => DevReloadCleanup\n}\n\nexport type DevReloadCleanup = () => void\n"],"names":[],"mappings":"AAAA;;;CAGC,GAKD,WAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/adapters/index.ts"],"sourcesContent":["export type * from './cookies.js'\nexport type * from './router.js'\nexport type * from './server.js'\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/index.ts"],"sourcesContent":["export type * from './cookies.js'\nexport type * from './devReload.js'\nexport type * from './render.js'\nexport type * from './router.js'\nexport type * from './server.js'\nexport type * from './views.js'\n"],"names":[],"mappings":"AAKA,WAA+B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ImportMap, PayloadComponent } from '../../index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Pluggable component renderer.
|
|
5
|
+
* RSC-capable frameworks use the current RenderServerComponent logic.
|
|
6
|
+
* Non-RSC frameworks treat all components as client components.
|
|
7
|
+
*/
|
|
8
|
+
export type ComponentRenderer = (args: {
|
|
9
|
+
readonly clientProps?: object;
|
|
10
|
+
readonly Component?: PayloadComponent | PayloadComponent[] | React.ComponentType | React.ComponentType[];
|
|
11
|
+
readonly Fallback?: React.ComponentType;
|
|
12
|
+
readonly importMap: ImportMap;
|
|
13
|
+
readonly key?: string;
|
|
14
|
+
readonly serverProps?: object;
|
|
15
|
+
}) => React.ReactNode;
|
|
16
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjE;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EACf,gBAAgB,GAChB,gBAAgB,EAAE,GAClB,KAAK,CAAC,aAAa,GACnB,KAAK,CAAC,aAAa,EAAE,CAAA;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B,KAAK,KAAK,CAAC,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/render.ts"],"sourcesContent":["import type React from 'react'\n\nimport type { ImportMap, PayloadComponent } from '../../index.js'\n\n/**\n * Pluggable component renderer.\n * RSC-capable frameworks use the current RenderServerComponent logic.\n * Non-RSC frameworks treat all components as client components.\n */\nexport type ComponentRenderer = (args: {\n readonly clientProps?: object\n readonly Component?:\n | PayloadComponent\n | PayloadComponent[]\n | React.ComponentType\n | React.ComponentType[]\n readonly Fallback?: React.ComponentType\n readonly importMap: ImportMap\n readonly key?: string\n readonly serverProps?: object\n}) => React.ReactNode\n"],"names":[],"mappings":"AAIA;;;;CAIC,GACD,WAWqB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { MetaConfig, SanitizedConfig } from '../../config/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Signature for ui-side view metadata generators. Returns a framework-agnostic
|
|
6
|
+
* `MetaConfig` that adapter-side code formats into framework metadata.
|
|
7
|
+
*/
|
|
8
|
+
export type GenerateViewMetadata = (args: {
|
|
9
|
+
config: SanitizedConfig;
|
|
10
|
+
i18n: I18nClient;
|
|
11
|
+
isEditing?: boolean;
|
|
12
|
+
params?: {
|
|
13
|
+
[key: string]: string | string[];
|
|
14
|
+
};
|
|
15
|
+
}) => Promise<MetaConfig>;
|
|
16
|
+
/**
|
|
17
|
+
* One entry in a framework's `AdminViewAdapter`. Pairs a React component with
|
|
18
|
+
* a metadata generator. `TComponentProps` and `TMetadata` are framework-specific
|
|
19
|
+
* (Next narrows `TMetadata` to `next`'s `Metadata` type).
|
|
20
|
+
*/
|
|
21
|
+
export type AdminView<TComponentProps = any, TMetadata = unknown> = {
|
|
22
|
+
Component: React.ComponentType<TComponentProps>;
|
|
23
|
+
generateMetadata: (args: Parameters<GenerateViewMetadata>[0]) => Promise<TMetadata>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The canonical set of admin view keys that every framework adapter must implement.
|
|
27
|
+
* Adding a new admin view requires adding its key here so all adapters stay in sync.
|
|
28
|
+
*/
|
|
29
|
+
export type AdminViewKey = 'account' | 'createFirstUser' | 'dashboard' | 'forgot' | 'login' | 'logout' | 'logoutInactivity' | 'notFound' | 'reset' | 'unauthorized' | 'unauthorizedWithGutter' | 'verify';
|
|
30
|
+
/**
|
|
31
|
+
* Keyed map of `AdminView` — exactly one entry per `AdminViewKey`.
|
|
32
|
+
* Framework adapters export an instance of this; missing or misspelled keys are
|
|
33
|
+
* a type error.
|
|
34
|
+
*/
|
|
35
|
+
export type AdminViewAdapter<TComponentProps = any, TMetadata = unknown> = Record<AdminViewKey, AdminView<TComponentProps, TMetadata>>;
|
|
36
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAExE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE;IACxC,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;CAC9C,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;AAEzB;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,eAAe,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO,IAAI;IAClE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAA;IAC/C,gBAAgB,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAA;CACpF,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,kBAAkB,GAClB,UAAU,GACV,OAAO,GACP,cAAc,GACd,wBAAwB,GACxB,QAAQ,CAAA;AAEZ;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,eAAe,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO,IAAI,MAAM,CAC/E,YAAY,EACZ,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,CACtC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/views.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { MetaConfig, SanitizedConfig } from '../../config/types.js'\n\n/**\n * Signature for ui-side view metadata generators. Returns a framework-agnostic\n * `MetaConfig` that adapter-side code formats into framework metadata.\n */\nexport type GenerateViewMetadata = (args: {\n config: SanitizedConfig\n i18n: I18nClient\n isEditing?: boolean\n params?: { [key: string]: string | string[] }\n}) => Promise<MetaConfig>\n\n/**\n * One entry in a framework's `AdminViewAdapter`. Pairs a React component with\n * a metadata generator. `TComponentProps` and `TMetadata` are framework-specific\n * (Next narrows `TMetadata` to `next`'s `Metadata` type).\n */\nexport type AdminView<TComponentProps = any, TMetadata = unknown> = {\n Component: React.ComponentType<TComponentProps>\n generateMetadata: (args: Parameters<GenerateViewMetadata>[0]) => Promise<TMetadata>\n}\n\n/**\n * The canonical set of admin view keys that every framework adapter must implement.\n * Adding a new admin view requires adding its key here so all adapters stay in sync.\n */\nexport type AdminViewKey =\n | 'account'\n | 'createFirstUser'\n | 'dashboard'\n | 'forgot'\n | 'login'\n | 'logout'\n | 'logoutInactivity'\n | 'notFound'\n | 'reset'\n | 'unauthorized'\n | 'unauthorizedWithGutter'\n | 'verify'\n\n/**\n * Keyed map of `AdminView` — exactly one entry per `AdminViewKey`.\n * Framework adapters export an instance of this; missing or misspelled keys are\n * a type error.\n */\nexport type AdminViewAdapter<TComponentProps = any, TMetadata = unknown> = Record<\n AdminViewKey,\n AdminView<TComponentProps, TMetadata>\n>\n"],"names":[],"mappings":"AA4CA;;;;CAIC,GACD,WAGC"}
|
|
@@ -5,6 +5,7 @@ import type { ClientBlock, ClientField, Field } from '../../fields/config/types.
|
|
|
5
5
|
import type { TypedUser } from '../../index.js';
|
|
6
6
|
import type { DocumentPreferences } from '../../preferences/types.js';
|
|
7
7
|
import type { Operation, Payload, PayloadRequest } from '../../types/index.js';
|
|
8
|
+
import type { ComponentRenderer } from '../adapters/render.js';
|
|
8
9
|
import type { ClientFieldSchemaMap, ClientTab, Data, FieldSchemaMap, FormField, FormState, RenderedField } from '../types.js';
|
|
9
10
|
export type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>;
|
|
10
11
|
export type ClientComponentProps = {
|
|
@@ -85,6 +86,12 @@ export type ServerComponentProps = {
|
|
|
85
86
|
payload: Payload;
|
|
86
87
|
permissions: SanitizedFieldPermissions;
|
|
87
88
|
preferences: DocumentPreferences;
|
|
89
|
+
/**
|
|
90
|
+
* Adapter-injected component renderer. Server components can use this
|
|
91
|
+
* to render other import map components without importing a
|
|
92
|
+
* framework-specific renderer directly.
|
|
93
|
+
*/
|
|
94
|
+
renderComponent?: ComponentRenderer;
|
|
88
95
|
req: PayloadRequest;
|
|
89
96
|
siblingData: Data;
|
|
90
97
|
user: TypedUser;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC9E,OAAO,KAAK,EACV,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,cAAc,EACd,SAAS,EACT,SAAS,EACT,aAAa,EACd,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,2BAA2B,GAAG,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AAE3E,MAAM,MAAM,oBAAoB,GAAG;IACj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,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACvE,KAAK,CAAC,aAAa,CAAC,eAAe,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC,CAAA;AAExE,MAAM,MAAM,oBAAoB,CAC9B,YAAY,SAAS,KAAK,GAAG,KAAK,EAClC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,EAC9E,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACvE,KAAK,CAAC,aAAa,CAAC,eAAe,GAAG,eAAe,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/forms/Field.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { MarkOptional } from 'ts-essentials'\n\nimport type { SanitizedFieldPermissions } from '../../auth/types.js'\nimport type { ClientBlock, ClientField, Field } from '../../fields/config/types.js'\nimport type { TypedUser } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, Payload, PayloadRequest } from '../../types/index.js'\nimport type {\n ClientFieldSchemaMap,\n ClientTab,\n Data,\n FieldSchemaMap,\n FormField,\n FormState,\n RenderedField,\n} from '../types.js'\n\nexport type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type ClientComponentProps = {\n customComponents?: FormField['customComponents']\n field: ClientBlock | ClientField | ClientTab\n /**\n * Controls the rendering behavior of the fields, i.e. defers rendering until they intersect with the viewport using the Intersection Observer API.\n *\n * If true, the fields will be rendered immediately, rather than waiting for them to intersect with the viewport.\n *\n * If a number is provided, will immediately render fields _up to that index_.\n */\n forceRender?: boolean\n permissions?: SanitizedFieldPermissions\n readOnly?: boolean\n renderedBlocks?: RenderedField[]\n /**\n * Used to extract field configs from a schemaMap.\n * Does not include indexes.\n *\n * @default field.name\n **/\n schemaPath?: string\n}\n\n// TODO: maybe we can come up with a better name?\nexport type FieldPaths = {\n /**\n * @default ''\n */\n indexPath?: string\n /**\n * @default ''\n */\n parentPath?: string\n /**\n * The path built up to the point of the field\n * excluding the field name.\n *\n * @default ''\n */\n parentSchemaPath?: string\n /**\n * A built up path to access FieldState in the form state.\n * Nested fields will have a path that includes the parent field names\n * if they are nested within a group, array, block or named tab.\n *\n * Collapsibles and unnamed tabs will have arbitrary paths\n * that look like _index-0, _index-1, etc.\n *\n * Row fields will not have a path.\n *\n * @example 'parentGroupField.childTextField'\n *\n * @default field.name\n */\n path: string\n}\n\n/**\n * TODO: This should be renamed to `FieldComponentServerProps` or similar\n */\nexport type ServerComponentProps = {\n clientField: ClientFieldWithOptionalType\n clientFieldSchemaMap: ClientFieldSchemaMap\n collectionSlug: string\n data: Data\n field: Field\n /**\n * The fieldSchemaMap that is created before form state is built is made available here.\n */\n fieldSchemaMap: FieldSchemaMap\n /**\n * Server Components will also have available to the entire form state.\n * We cannot add it to ClientComponentProps as that would blow up the size of the props sent to the client.\n */\n formState: FormState\n i18n: I18nClient\n id?: number | string\n operation: Operation\n payload: Payload\n permissions: SanitizedFieldPermissions\n preferences: DocumentPreferences\n req: PayloadRequest\n siblingData: Data\n user: TypedUser\n value?: unknown\n}\n\nexport type ClientFieldBase<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly field: TFieldClient\n} & Omit<ClientComponentProps, 'customComponents' | 'field'>\n\nexport type ServerFieldBase<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly clientField: TFieldClient\n readonly field: TFieldServer\n} & Omit<ClientComponentProps, 'field'> &\n Omit<ServerComponentProps, 'clientField' | 'field'>\n\nexport type FieldClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ClientFieldBase<TFieldClient>>\n\nexport type FieldServerComponent<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ServerFieldBase<TFieldServer, TFieldClient>>\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/forms/Field.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { MarkOptional } from 'ts-essentials'\n\nimport type { SanitizedFieldPermissions } from '../../auth/types.js'\nimport type { ClientBlock, ClientField, Field } from '../../fields/config/types.js'\nimport type { TypedUser } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, Payload, PayloadRequest } from '../../types/index.js'\nimport type { ComponentRenderer } from '../adapters/render.js'\nimport type {\n ClientFieldSchemaMap,\n ClientTab,\n Data,\n FieldSchemaMap,\n FormField,\n FormState,\n RenderedField,\n} from '../types.js'\n\nexport type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type ClientComponentProps = {\n customComponents?: FormField['customComponents']\n field: ClientBlock | ClientField | ClientTab\n /**\n * Controls the rendering behavior of the fields, i.e. defers rendering until they intersect with the viewport using the Intersection Observer API.\n *\n * If true, the fields will be rendered immediately, rather than waiting for them to intersect with the viewport.\n *\n * If a number is provided, will immediately render fields _up to that index_.\n */\n forceRender?: boolean\n permissions?: SanitizedFieldPermissions\n readOnly?: boolean\n renderedBlocks?: RenderedField[]\n /**\n * Used to extract field configs from a schemaMap.\n * Does not include indexes.\n *\n * @default field.name\n **/\n schemaPath?: string\n}\n\n// TODO: maybe we can come up with a better name?\nexport type FieldPaths = {\n /**\n * @default ''\n */\n indexPath?: string\n /**\n * @default ''\n */\n parentPath?: string\n /**\n * The path built up to the point of the field\n * excluding the field name.\n *\n * @default ''\n */\n parentSchemaPath?: string\n /**\n * A built up path to access FieldState in the form state.\n * Nested fields will have a path that includes the parent field names\n * if they are nested within a group, array, block or named tab.\n *\n * Collapsibles and unnamed tabs will have arbitrary paths\n * that look like _index-0, _index-1, etc.\n *\n * Row fields will not have a path.\n *\n * @example 'parentGroupField.childTextField'\n *\n * @default field.name\n */\n path: string\n}\n\n/**\n * TODO: This should be renamed to `FieldComponentServerProps` or similar\n */\nexport type ServerComponentProps = {\n clientField: ClientFieldWithOptionalType\n clientFieldSchemaMap: ClientFieldSchemaMap\n collectionSlug: string\n data: Data\n field: Field\n /**\n * The fieldSchemaMap that is created before form state is built is made available here.\n */\n fieldSchemaMap: FieldSchemaMap\n /**\n * Server Components will also have available to the entire form state.\n * We cannot add it to ClientComponentProps as that would blow up the size of the props sent to the client.\n */\n formState: FormState\n i18n: I18nClient\n id?: number | string\n operation: Operation\n payload: Payload\n permissions: SanitizedFieldPermissions\n preferences: DocumentPreferences\n /**\n * Adapter-injected component renderer. Server components can use this\n * to render other import map components without importing a\n * framework-specific renderer directly.\n */\n renderComponent?: ComponentRenderer\n req: PayloadRequest\n siblingData: Data\n user: TypedUser\n value?: unknown\n}\n\nexport type ClientFieldBase<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly field: TFieldClient\n} & Omit<ClientComponentProps, 'customComponents' | 'field'>\n\nexport type ServerFieldBase<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly clientField: TFieldClient\n readonly field: TFieldServer\n} & Omit<ClientComponentProps, 'field'> &\n Omit<ServerComponentProps, 'clientField' | 'field'>\n\nexport type FieldClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ClientFieldBase<TFieldClient>>\n\nexport type FieldServerComponent<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ServerFieldBase<TFieldServer, TFieldClient>>\n"],"names":[],"mappings":"AAsIA,WAIsF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type SupportedLanguages } from '@payloadcms/translations';
|
|
2
2
|
import type { SanitizedDocumentPermissions } from '../../auth/types.js';
|
|
3
|
+
import type { PayloadComponent } from '../../config/types.js';
|
|
3
4
|
import type { Field, Option, TabAsField, Validate } from '../../fields/config/types.js';
|
|
4
5
|
import type { TypedLocale } from '../../index.js';
|
|
5
6
|
import type { DocumentPreferences } from '../../preferences/types.js';
|
|
@@ -10,6 +11,9 @@ export type Data = {
|
|
|
10
11
|
export type Row = {
|
|
11
12
|
addedByServer?: FieldState['addedByServer'];
|
|
12
13
|
blockType?: string;
|
|
14
|
+
clientComponentPaths?: {
|
|
15
|
+
RowLabel?: PayloadComponent;
|
|
16
|
+
};
|
|
13
17
|
collapsed?: boolean;
|
|
14
18
|
customComponents?: {
|
|
15
19
|
RowLabel?: React.ReactNode;
|
|
@@ -35,6 +39,31 @@ export type FieldState = {
|
|
|
35
39
|
* If this is an empty array, no blocks are allowed.
|
|
36
40
|
*/
|
|
37
41
|
blocksFilterOptions?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* Serializable PayloadComponent references for field UI slots.
|
|
44
|
+
* Used by non-RSC adapters (e.g. TanStack) to resolve custom components from the import map
|
|
45
|
+
* when `customComponents` are unavailable (stripped during serialization).
|
|
46
|
+
*/
|
|
47
|
+
clientComponentPaths?: {
|
|
48
|
+
AfterInput?: PayloadComponent | PayloadComponent[];
|
|
49
|
+
BeforeInput?: PayloadComponent | PayloadComponent[];
|
|
50
|
+
Description?: PayloadComponent;
|
|
51
|
+
Error?: PayloadComponent;
|
|
52
|
+
Label?: PayloadComponent;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* PayloadComponent reference for a client-safe field component.
|
|
56
|
+
* Used by non-RSC adapters (e.g. TanStack) to resolve a fallback component from the import map
|
|
57
|
+
* when `customComponents.Field` is unavailable (stripped during serialization).
|
|
58
|
+
*/
|
|
59
|
+
clientFieldComponentPath?: {
|
|
60
|
+
clientProps?: Record<string, any>;
|
|
61
|
+
path: string;
|
|
62
|
+
} | string;
|
|
63
|
+
/**
|
|
64
|
+
* Serializable props for the client field component referenced by `clientFieldComponentPath`.
|
|
65
|
+
*/
|
|
66
|
+
clientFieldComponentProps?: Record<string, any>;
|
|
38
67
|
customComponents?: {
|
|
39
68
|
/**
|
|
40
69
|
* This is used by UI fields, as they can have arbitrary components defined if used
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAElE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE7E,MAAM,MAAM,IAAI,GAAG;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,GAAG,GAAG;IAChB,aAAa,CAAC,EAAE,UAAU,CAAC,eAAe,CAAC,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gBAAgB,CAAC,EAAE;QACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;KAC3B,CAAA;IACD,EAA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AM,CAAC,EAAE,UAAU,CAAA;IACnB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,CACA;IACE,cAAc,EAAE,MAAM,CAAA;IAGtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,GACD;IACE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,GACD;IACE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACnB,CACJ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/forms/Form.ts"],"sourcesContent":["import { type SupportedLanguages } from '@payloadcms/translations'\n\nimport type { SanitizedDocumentPermissions } from '../../auth/types.js'\nimport type { Field, Option, TabAsField, Validate } from '../../fields/config/types.js'\nimport type { TypedLocale } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { PayloadRequest, SelectType, Where } from '../../types/index.js'\n\nexport type Data = {\n [key: string]: any\n}\n\nexport type Row = {\n addedByServer?: FieldState['addedByServer']\n blockType?: string\n collapsed?: boolean\n customComponents?: {\n RowLabel?: React.ReactNode\n }\n id: string\n isLoading?: boolean\n lastRenderedPath?: string\n}\n\nexport type FilterOptionsResult = {\n [relation: string]: boolean | Where\n}\n\nexport type FieldState = {\n /**\n * This is used to determine if the field was added by the server.\n * This ensures the field is not ignored by the client when merging form state.\n * This can happen because the current local state is treated as the source of truth.\n * See `mergeServerFormState` for more details.\n */\n addedByServer?: boolean\n /**\n * If the field is a `blocks` field, this will contain the slugs of blocks that are allowed, based on the result of `field.filterOptions`.\n * If this is undefined, all blocks are allowed.\n * If this is an empty array, no blocks are allowed.\n */\n blocksFilterOptions?: string[]\n customComponents?: {\n /**\n * This is used by UI fields, as they can have arbitrary components defined if used\n * as a vessel to bring in custom components.\n */\n [key: string]: React.ReactNode | React.ReactNode[] | undefined\n AfterInput?: React.ReactNode\n BeforeInput?: React.ReactNode\n Description?: React.ReactNode\n Error?: React.ReactNode\n Field?: React.ReactNode\n Label?: React.ReactNode\n }\n disableFormData?: boolean\n errorMessage?: string\n errorPaths?: string[]\n /**\n * The fieldSchema may be part of the form state if `includeSchema: true` is passed to buildFormState.\n * This will never be in the form state of the client.\n */\n fieldSchema?: Field | TabAsField\n filterOptions?: FilterOptionsResult\n initialValue?: unknown\n /**\n * Every time a field is changed locally, this flag is set to true. Prevents form state from server from overwriting local changes.\n * After merging server form state, this flag is reset.\n *\n * @experimental This property is experimental and may change in the future. Use at your own risk.\n */\n isModified?: boolean\n /**\n * The path of the field when its custom components were last rendered.\n * This is used to denote if a field has been rendered, and if so,\n * what path it was rendered under last.\n *\n * If this path is undefined, or, if it is different\n * from the current path of a given field, the field's components will be re-rendered.\n */\n lastRenderedPath?: string\n passesCondition?: boolean\n rows?: Row[]\n /**\n * The result of running `field.filterOptions` on select fields.\n */\n selectFilterOptions?: Option[]\n valid?: boolean\n validate?: Validate\n value?: unknown\n}\n\nexport type FieldStateWithoutComponents = Omit<FieldState, 'customComponents'>\n\nexport type FormState = {\n [path: string]: FieldState\n}\n\nexport type FormStateWithoutComponents = {\n [path: string]: FieldStateWithoutComponents\n}\n\nexport type BuildFormStateArgs = {\n /**\n * If true, will check if the document has been modified since it was loaded.\n * This helps detect stale data when multiple users are editing the same document.\n */\n checkForStaleData?: boolean\n data?: Data\n docPermissions: SanitizedDocumentPermissions | undefined\n docPreferences: DocumentPreferences\n /**\n * In case `formState` is not the top-level, document form state, this can be passed to\n * provide the top-level form state.\n */\n documentFormState?: FormState\n fallbackLocale?: false | TypedLocale\n formState?: FormState\n id?: number | string\n initialBlockData?: Data\n initialBlockFormState?: FormState\n /*\n If not i18n was passed, the language can be passed to init i18n\n */\n language?: keyof SupportedLanguages\n locale?: string\n /**\n * If true, will not render RSCs and instead return a simple string in their place.\n * This is useful for environments that lack RSC support, such as Jest.\n * Form state can still be built, but any server components will be omitted.\n * @default false\n */\n mockRSCs?: boolean\n operation?: 'create' | 'update'\n /**\n * The original updatedAt timestamp from when the document was initially loaded.\n * Used with checkForStaleData to detect if the document has been modified.\n */\n originalUpdatedAt?: string\n readOnly?: boolean\n /**\n * If true, will render field components within their state object.\n * Performance optimization: Setting to `false` ensures that only fields that have changed paths will re-render, e.g. new array rows, etc.\n * For example, you only need to render ALL fields on initial render, not on every onChange.\n */\n renderAllFields?: boolean\n req: PayloadRequest\n /**\n * If true, will return a fresh URL for live preview based on the current form state.\n * Note: this will run on every form state event, so if your `livePreview.url` function is long running or expensive,\n * ensure it caches itself as needed.\n */\n returnLivePreviewURL?: boolean\n returnLockStatus?: boolean\n /**\n * If true, will return a fresh URL for preview based on the current form state.\n * Note: this will run on every form state event, so if your `preview` function is long running or expensive,\n * ensure it caches itself as needed.\n */\n returnPreviewURL?: boolean\n schemaPath: string\n select?: SelectType\n /**\n * When true, sets `user: true` when calling `getClientConfig`.\n * This will retrieve the client config in its entirety, even when unauthenticated.\n * For example, the create-first-user view needs the entire config, but there is no user yet.\n *\n * @experimental This property is experimental and may change in the future. Use at your own risk.\n */\n skipClientConfigAuth?: boolean\n skipValidation?: boolean\n updateLastEdited?: boolean\n} & (\n | {\n collectionSlug: string\n // Do not type it as never. This still makes it so that either collectionSlug or globalSlug is required, but makes it easier to provide both collectionSlug and globalSlug if it's\n // unclear which one is actually available.\n globalSlug?: string\n widgetSlug?: string\n }\n | {\n collectionSlug?: string\n globalSlug: string\n widgetSlug?: string\n }\n | {\n collectionSlug?: string\n globalSlug?: string\n widgetSlug: string\n }\n)\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/forms/Form.ts"],"sourcesContent":["import { type SupportedLanguages } from '@payloadcms/translations'\n\nimport type { SanitizedDocumentPermissions } from '../../auth/types.js'\nimport type { PayloadComponent } from '../../config/types.js'\nimport type { Field, Option, TabAsField, Validate } from '../../fields/config/types.js'\nimport type { TypedLocale } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { PayloadRequest, SelectType, Where } from '../../types/index.js'\n\nexport type Data = {\n [key: string]: any\n}\n\nexport type Row = {\n addedByServer?: FieldState['addedByServer']\n blockType?: string\n clientComponentPaths?: {\n RowLabel?: PayloadComponent\n }\n collapsed?: boolean\n customComponents?: {\n RowLabel?: React.ReactNode\n }\n id: string\n isLoading?: boolean\n lastRenderedPath?: string\n}\n\nexport type FilterOptionsResult = {\n [relation: string]: boolean | Where\n}\n\nexport type FieldState = {\n /**\n * This is used to determine if the field was added by the server.\n * This ensures the field is not ignored by the client when merging form state.\n * This can happen because the current local state is treated as the source of truth.\n * See `mergeServerFormState` for more details.\n */\n addedByServer?: boolean\n /**\n * If the field is a `blocks` field, this will contain the slugs of blocks that are allowed, based on the result of `field.filterOptions`.\n * If this is undefined, all blocks are allowed.\n * If this is an empty array, no blocks are allowed.\n */\n blocksFilterOptions?: string[]\n /**\n * Serializable PayloadComponent references for field UI slots.\n * Used by non-RSC adapters (e.g. TanStack) to resolve custom components from the import map\n * when `customComponents` are unavailable (stripped during serialization).\n */\n clientComponentPaths?: {\n AfterInput?: PayloadComponent | PayloadComponent[]\n BeforeInput?: PayloadComponent | PayloadComponent[]\n Description?: PayloadComponent\n Error?: PayloadComponent\n Label?: PayloadComponent\n }\n /**\n * PayloadComponent reference for a client-safe field component.\n * Used by non-RSC adapters (e.g. TanStack) to resolve a fallback component from the import map\n * when `customComponents.Field` is unavailable (stripped during serialization).\n */\n clientFieldComponentPath?: { clientProps?: Record<string, any>; path: string } | string\n /**\n * Serializable props for the client field component referenced by `clientFieldComponentPath`.\n */\n clientFieldComponentProps?: Record<string, any>\n customComponents?: {\n /**\n * This is used by UI fields, as they can have arbitrary components defined if used\n * as a vessel to bring in custom components.\n */\n [key: string]: React.ReactNode | React.ReactNode[] | undefined\n AfterInput?: React.ReactNode\n BeforeInput?: React.ReactNode\n Description?: React.ReactNode\n Error?: React.ReactNode\n Field?: React.ReactNode\n Label?: React.ReactNode\n }\n disableFormData?: boolean\n errorMessage?: string\n errorPaths?: string[]\n /**\n * The fieldSchema may be part of the form state if `includeSchema: true` is passed to buildFormState.\n * This will never be in the form state of the client.\n */\n fieldSchema?: Field | TabAsField\n filterOptions?: FilterOptionsResult\n initialValue?: unknown\n /**\n * Every time a field is changed locally, this flag is set to true. Prevents form state from server from overwriting local changes.\n * After merging server form state, this flag is reset.\n *\n * @experimental This property is experimental and may change in the future. Use at your own risk.\n */\n isModified?: boolean\n /**\n * The path of the field when its custom components were last rendered.\n * This is used to denote if a field has been rendered, and if so,\n * what path it was rendered under last.\n *\n * If this path is undefined, or, if it is different\n * from the current path of a given field, the field's components will be re-rendered.\n */\n lastRenderedPath?: string\n passesCondition?: boolean\n rows?: Row[]\n /**\n * The result of running `field.filterOptions` on select fields.\n */\n selectFilterOptions?: Option[]\n valid?: boolean\n validate?: Validate\n value?: unknown\n}\n\nexport type FieldStateWithoutComponents = Omit<FieldState, 'customComponents'>\n\nexport type FormState = {\n [path: string]: FieldState\n}\n\nexport type FormStateWithoutComponents = {\n [path: string]: FieldStateWithoutComponents\n}\n\nexport type BuildFormStateArgs = {\n /**\n * If true, will check if the document has been modified since it was loaded.\n * This helps detect stale data when multiple users are editing the same document.\n */\n checkForStaleData?: boolean\n data?: Data\n docPermissions: SanitizedDocumentPermissions | undefined\n docPreferences: DocumentPreferences\n /**\n * In case `formState` is not the top-level, document form state, this can be passed to\n * provide the top-level form state.\n */\n documentFormState?: FormState\n fallbackLocale?: false | TypedLocale\n formState?: FormState\n id?: number | string\n initialBlockData?: Data\n initialBlockFormState?: FormState\n /*\n If not i18n was passed, the language can be passed to init i18n\n */\n language?: keyof SupportedLanguages\n locale?: string\n /**\n * If true, will not render RSCs and instead return a simple string in their place.\n * This is useful for environments that lack RSC support, such as Jest.\n * Form state can still be built, but any server components will be omitted.\n * @default false\n */\n mockRSCs?: boolean\n operation?: 'create' | 'update'\n /**\n * The original updatedAt timestamp from when the document was initially loaded.\n * Used with checkForStaleData to detect if the document has been modified.\n */\n originalUpdatedAt?: string\n readOnly?: boolean\n /**\n * If true, will render field components within their state object.\n * Performance optimization: Setting to `false` ensures that only fields that have changed paths will re-render, e.g. new array rows, etc.\n * For example, you only need to render ALL fields on initial render, not on every onChange.\n */\n renderAllFields?: boolean\n req: PayloadRequest\n /**\n * If true, will return a fresh URL for live preview based on the current form state.\n * Note: this will run on every form state event, so if your `livePreview.url` function is long running or expensive,\n * ensure it caches itself as needed.\n */\n returnLivePreviewURL?: boolean\n returnLockStatus?: boolean\n /**\n * If true, will return a fresh URL for preview based on the current form state.\n * Note: this will run on every form state event, so if your `preview` function is long running or expensive,\n * ensure it caches itself as needed.\n */\n returnPreviewURL?: boolean\n schemaPath: string\n select?: SelectType\n /**\n * When true, sets `user: true` when calling `getClientConfig`.\n * This will retrieve the client config in its entirety, even when unauthenticated.\n * For example, the create-first-user view needs the entire config, but there is no user yet.\n *\n * @experimental This property is experimental and may change in the future. Use at your own risk.\n */\n skipClientConfigAuth?: boolean\n skipValidation?: boolean\n updateLastEdited?: boolean\n} & (\n | {\n collectionSlug: string\n // Do not type it as never. This still makes it so that either collectionSlug or globalSlug is required, but makes it easier to provide both collectionSlug and globalSlug if it's\n // unclear which one is actually available.\n globalSlug?: string\n widgetSlug?: string\n }\n | {\n collectionSlug?: string\n globalSlug: string\n widgetSlug?: string\n }\n | {\n collectionSlug?: string\n globalSlug?: string\n widgetSlug: string\n }\n)\n"],"names":[],"mappings":"AAgIA,WAwFC"}
|
|
@@ -6,6 +6,7 @@ import type { Slugify } from '../../fields/baseFields/slug/index.js';
|
|
|
6
6
|
import type { CollectionSlug, ColumnPreference, FieldPaths, GlobalSlug, SanitizedPermissions } from '../../index.js';
|
|
7
7
|
import type { PayloadRequest, Sort, Where } from '../../types/index.js';
|
|
8
8
|
import type { ColumnsFromURL } from '../../utilities/transformColumnPreferences.js';
|
|
9
|
+
import type { ComponentRenderer } from '../adapters/render.js';
|
|
9
10
|
export type InitReqResult = {
|
|
10
11
|
cookies: Map<string, string>;
|
|
11
12
|
headers: Headers;
|
|
@@ -14,8 +15,16 @@ export type InitReqResult = {
|
|
|
14
15
|
permissions: SanitizedPermissions;
|
|
15
16
|
req: PayloadRequest;
|
|
16
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Determines how server function handlers serialize their return values.
|
|
20
|
+
* - `'rsc'`: Return React nodes (JSX) — requires RSC flight serialization (Next.js)
|
|
21
|
+
* - `'data-only'`: Return JSON-serializable data — for non-RSC adapters (TanStack Start)
|
|
22
|
+
*/
|
|
23
|
+
export type ServerFunctionMode = 'data-only' | 'rsc';
|
|
17
24
|
export type DefaultServerFunctionArgs = {
|
|
18
25
|
importMap: ImportMap;
|
|
26
|
+
mode?: ServerFunctionMode;
|
|
27
|
+
renderComponent?: ComponentRenderer;
|
|
19
28
|
} & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>;
|
|
20
29
|
export type ServerFunctionArgs = {
|
|
21
30
|
args: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/functions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAA;AACpE,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB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,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/functions/index.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { Locale, SanitizedConfig } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { Slugify } from '../../fields/baseFields/slug/index.js'\nimport type {\n CollectionSlug,\n ColumnPreference,\n FieldPaths,\n GlobalSlug,\n SanitizedPermissions,\n} from '../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../types/index.js'\nimport type { ColumnsFromURL } from '../../utilities/transformColumnPreferences.js'\n\nexport type InitReqResult = {\n cookies: Map<string, string>\n // TODO: Remove in 4.0. Duplicative, already available in req.headers\n headers: Headers\n // TODO: Remove in 4.0. Duplicative, already available in req.i18n.language\n languageCode: AcceptedLanguages\n locale?: Locale\n permissions: SanitizedPermissions\n req: PayloadRequest\n}\n\nexport type DefaultServerFunctionArgs = {\n importMap: ImportMap\n} & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>\n\nexport type ServerFunctionArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClientArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClient = (args: ServerFunctionClientArgs) => Promise<unknown> | unknown\n\nexport type ServerFunction<\n TArgs extends object = Record<string, unknown>,\n TReturnType = Promise<unknown> | unknown,\n> = (args: DefaultServerFunctionArgs & TArgs) => TReturnType\n\nexport type ServerFunctionConfig = {\n fn: ServerFunction\n name: string\n}\n\nexport type ServerFunctionHandler = (\n args: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n /**\n * A map of server function names to their implementations. These are\n * registered alongside the base server functions and can be called\n * using the useServerFunctions() hook.\n *\n * @example\n * const { serverFunction } = useServerFunctions()\n *\n * const callServerFunction = useCallback(() => {\n *\n * async function call() {\n * const result = (await serverFunction({\n * name: 'record-key',\n * args: {\n * // Your args\n * },\n * }))\n *\n * // Do someting with the result\n * }\n *\n * void call()\n * }, [serverFunction])\n */\n serverFunctions?: Record<string, ServerFunction<any, any>>\n } & ServerFunctionClientArgs,\n) => Promise<unknown>\n\nexport type ListQuery = {\n /*\n * This is an of strings, i.e. `['title', '-slug']`\n * Use `transformColumnsToPreferences` and `transformColumnsToSearchParams` to convert it back and forth\n */\n columns?: ColumnsFromURL\n /*\n * A string representing the field to group by, e.g. `category`\n * A leading hyphen represents descending order, e.g. `-category`\n */\n groupBy?: string\n limit?: number\n page?: number\n preset?: number | string\n queryByGroup?: Record<string, ListQuery>\n /*\n When provided, is automatically injected into the `where` object\n */\n search?: string\n sort?: Sort\n where?: Where\n} & Record<string, unknown>\n\nexport type BuildTableStateArgs = {\n /**\n * If an array is provided, the table will be built to support polymorphic collections.\n */\n collectionSlug: string | string[]\n columns?: ColumnPreference[]\n data?: PaginatedDocs\n /**\n * @deprecated Use `data` instead\n */\n docs?: PaginatedDocs['docs']\n enableRowSelections?: boolean\n orderableFieldName: string\n parent?: {\n collectionSlug: CollectionSlug\n id: number | string\n joinPath: string\n }\n query?: ListQuery\n renderRowTypes?: boolean\n tableAppearance?: 'condensed' | 'default'\n}\n\nexport type SlugifyServerFunctionArgs = {\n collectionSlug?: CollectionSlug\n globalSlug?: GlobalSlug\n path?: FieldPaths['path']\n} & Omit<Parameters<Slugify>[0], 'req'>\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/functions/index.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { Locale, SanitizedConfig } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { Slugify } from '../../fields/baseFields/slug/index.js'\nimport type {\n CollectionSlug,\n ColumnPreference,\n FieldPaths,\n GlobalSlug,\n SanitizedPermissions,\n} from '../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../types/index.js'\nimport type { ColumnsFromURL } from '../../utilities/transformColumnPreferences.js'\nimport type { ComponentRenderer } from '../adapters/render.js'\n\nexport type InitReqResult = {\n cookies: Map<string, string>\n // TODO: Remove in 4.0. Duplicative, already available in req.headers\n headers: Headers\n // TODO: Remove in 4.0. Duplicative, already available in req.i18n.language\n languageCode: AcceptedLanguages\n locale?: Locale\n permissions: SanitizedPermissions\n req: PayloadRequest\n}\n\n/**\n * Determines how server function handlers serialize their return values.\n * - `'rsc'`: Return React nodes (JSX) — requires RSC flight serialization (Next.js)\n * - `'data-only'`: Return JSON-serializable data — for non-RSC adapters (TanStack Start)\n */\nexport type ServerFunctionMode = 'data-only' | 'rsc'\n\nexport type DefaultServerFunctionArgs = {\n importMap: ImportMap\n mode?: ServerFunctionMode\n renderComponent?: ComponentRenderer\n} & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>\n\nexport type ServerFunctionArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClientArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClient = (args: ServerFunctionClientArgs) => Promise<unknown> | unknown\n\nexport type ServerFunction<\n TArgs extends object = Record<string, unknown>,\n TReturnType = Promise<unknown> | unknown,\n> = (args: DefaultServerFunctionArgs & TArgs) => TReturnType\n\nexport type ServerFunctionConfig = {\n fn: ServerFunction\n name: string\n}\n\nexport type ServerFunctionHandler = (\n args: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n /**\n * A map of server function names to their implementations. These are\n * registered alongside the base server functions and can be called\n * using the useServerFunctions() hook.\n *\n * @example\n * const { serverFunction } = useServerFunctions()\n *\n * const callServerFunction = useCallback(() => {\n *\n * async function call() {\n * const result = (await serverFunction({\n * name: 'record-key',\n * args: {\n * // Your args\n * },\n * }))\n *\n * // Do someting with the result\n * }\n *\n * void call()\n * }, [serverFunction])\n */\n serverFunctions?: Record<string, ServerFunction<any, any>>\n } & ServerFunctionClientArgs,\n) => Promise<unknown>\n\nexport type ListQuery = {\n /*\n * This is an of strings, i.e. `['title', '-slug']`\n * Use `transformColumnsToPreferences` and `transformColumnsToSearchParams` to convert it back and forth\n */\n columns?: ColumnsFromURL\n /*\n * A string representing the field to group by, e.g. `category`\n * A leading hyphen represents descending order, e.g. `-category`\n */\n groupBy?: string\n limit?: number\n page?: number\n preset?: number | string\n queryByGroup?: Record<string, ListQuery>\n /*\n When provided, is automatically injected into the `where` object\n */\n search?: string\n sort?: Sort\n where?: Where\n} & Record<string, unknown>\n\nexport type BuildTableStateArgs = {\n /**\n * If an array is provided, the table will be built to support polymorphic collections.\n */\n collectionSlug: string | string[]\n columns?: ColumnPreference[]\n data?: PaginatedDocs\n /**\n * @deprecated Use `data` instead\n */\n docs?: PaginatedDocs['docs']\n enableRowSelections?: boolean\n orderableFieldName: string\n parent?: {\n collectionSlug: CollectionSlug\n id: number | string\n joinPath: string\n }\n query?: ListQuery\n renderRowTypes?: boolean\n tableAppearance?: 'condensed' | 'default'\n}\n\nexport type SlugifyServerFunctionArgs = {\n collectionSlug?: CollectionSlug\n globalSlug?: GlobalSlug\n path?: FieldPaths['path']\n} & Omit<Parameters<Slugify>[0], 'req'>\n"],"names":[],"mappings":"AA6IA,WAIuC"}
|
package/dist/admin/types.d.ts
CHANGED
|
@@ -152,7 +152,7 @@ export type DocumentSlots = {
|
|
|
152
152
|
Upload?: React.ReactNode;
|
|
153
153
|
UploadControls?: React.ReactNode;
|
|
154
154
|
};
|
|
155
|
-
export type { BuildTableStateArgs, DefaultServerFunctionArgs, InitReqResult, ListQuery, ServerFunction, ServerFunctionArgs, ServerFunctionClient, ServerFunctionClientArgs, ServerFunctionConfig, ServerFunctionHandler, SlugifyServerFunctionArgs, } from './functions/index.js';
|
|
155
|
+
export type { BuildTableStateArgs, DefaultServerFunctionArgs, InitReqResult, ListQuery, ServerFunction, ServerFunctionArgs, ServerFunctionClient, ServerFunctionClientArgs, ServerFunctionConfig, ServerFunctionHandler, ServerFunctionMode, SlugifyServerFunctionArgs, } from './functions/index.js';
|
|
156
156
|
export type { LanguageOptions } from './LanguageOptions.js';
|
|
157
157
|
export type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js';
|
|
158
158
|
export { type WidgetServerProps } from './views/dashboard.js';
|