Skip to content

Commit 3a64468

Browse files
committed
fix: wrong docs/type for fieldListType renderFor option
1 parent d9ae1d9 commit 3a64468

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/Extractor/BlockExtractor.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,14 @@ export default class BlockExtractor {
209209
acc.push(
210210
`${bundle}__parent_block_${entry.parentBundle}: ${v.componentName}`,
211211
)
212-
} else {
212+
} else if ('fieldList' in entry) {
213213
acc.push(
214214
`${bundle}__field_list_type_${entry.fieldList}: ${v.componentName}`,
215215
)
216+
} else if ('fieldListType' in entry) {
217+
acc.push(
218+
`${bundle}__field_list_type_${entry.fieldListType}: ${v.componentName}`,
219+
)
216220
}
217221
})
218222
} else {
@@ -612,10 +616,14 @@ export function getBlokkliFragmentComponent(name: string): any {
612616
acc.push(
613617
`block_${bundle}__parent_block_${entry.parentBundle}: ${v.componentName}`,
614618
)
615-
} else {
619+
} else if ('fieldList' in entry) {
616620
acc.push(
617621
`block_${bundle}__field_list_type_${entry.fieldList}: ${v.componentName}`,
618622
)
623+
} else if ('fieldListType' in entry) {
624+
acc.push(
625+
`block_${bundle}__field_list_type_${entry.fieldListType}: ${v.componentName}`,
626+
)
619627
}
620628
})
621629
}

src/runtime/types/index.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,19 @@ export type BlockDefinitionRenderForParent = {
262262
parentBundle: BlockBundleWithNested
263263
}
264264

265-
export type BlockDefinitionRenderForFieldListType = {
265+
export type BlockDefinitionRenderForFieldList = {
266+
/**
267+
* @deprecated Use `fieldListType` instead.
268+
*/
266269
fieldList: ValidFieldListTypes
267270
}
271+
272+
export type BlockDefinitionRenderForFieldListType = {
273+
fieldListType: ValidFieldListTypes
274+
}
268275
export type BlockDefinitionRenderFor =
269276
| BlockDefinitionRenderForParent
277+
| BlockDefinitionRenderForFieldList
270278
| BlockDefinitionRenderForFieldListType
271279

272280
export type BlockDefinitionInput<

0 commit comments

Comments
 (0)