feat(ui): provides payload as prop to all custom server components (#5775)

This commit is contained in:
Jacob Fletcher
2024-04-11 11:16:15 -04:00
committed by GitHub
parent d0869d9087
commit 1275c70187
35 changed files with 324 additions and 133 deletions

View File

@@ -14,7 +14,7 @@ import { defaultLeaves as leafTypes } from './field/leaves/index.js'
export const getGenerateComponentMap =
(args: AdapterArguments): RichTextAdapter['generateComponentMap'] =>
({ config, i18n }) => {
({ WithServerSideProps, config, i18n }) => {
const componentMap = new Map()
const validRelationships = config.collections.map((c) => c.slug) || []
@@ -73,6 +73,7 @@ export const getGenerateComponentMap =
})
const mappedFields = mapFields({
WithServerSideProps,
config,
fieldSchema: linkFields,
i18n,
@@ -104,6 +105,7 @@ export const getGenerateComponentMap =
})
const mappedFields = mapFields({
WithServerSideProps,
config,
fieldSchema: uploadFields,
i18n,