Skip to content

Commit

Permalink
fix: wrong docs/type for fieldListType renderFor option
Browse files Browse the repository at this point in the history
  • Loading branch information
dulnan committed Oct 7, 2024
1 parent d9ae1d9 commit 3a64468
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/Extractor/BlockExtractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,14 @@ export default class BlockExtractor {
acc.push(
`${bundle}__parent_block_${entry.parentBundle}: ${v.componentName}`,
)
} else {
} else if ('fieldList' in entry) {
acc.push(
`${bundle}__field_list_type_${entry.fieldList}: ${v.componentName}`,
)
} else if ('fieldListType' in entry) {
acc.push(
`${bundle}__field_list_type_${entry.fieldListType}: ${v.componentName}`,
)
}
})
} else {
Expand Down Expand Up @@ -612,10 +616,14 @@ export function getBlokkliFragmentComponent(name: string): any {
acc.push(
`block_${bundle}__parent_block_${entry.parentBundle}: ${v.componentName}`,
)
} else {
} else if ('fieldList' in entry) {
acc.push(
`block_${bundle}__field_list_type_${entry.fieldList}: ${v.componentName}`,
)
} else if ('fieldListType' in entry) {
acc.push(
`block_${bundle}__field_list_type_${entry.fieldListType}: ${v.componentName}`,
)
}
})
}
Expand Down
10 changes: 9 additions & 1 deletion src/runtime/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,19 @@ export type BlockDefinitionRenderForParent = {
parentBundle: BlockBundleWithNested
}

export type BlockDefinitionRenderForFieldListType = {
export type BlockDefinitionRenderForFieldList = {
/**
* @deprecated Use `fieldListType` instead.
*/
fieldList: ValidFieldListTypes
}

export type BlockDefinitionRenderForFieldListType = {
fieldListType: ValidFieldListTypes
}
export type BlockDefinitionRenderFor =
| BlockDefinitionRenderForParent
| BlockDefinitionRenderForFieldList
| BlockDefinitionRenderForFieldListType

export type BlockDefinitionInput<
Expand Down

0 comments on commit 3a64468

Please sign in to comment.