feat: AcfBuilder / SectionProse

This commit is contained in:
2026-03-27 09:27:15 -04:00
parent 0ebb530275
commit 12774b2df1
7 changed files with 50 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
fragment AcfBuilder on GroupAbstractBuilder_Fields {
sections @nullToEmpty @filterNullItems {
__typename
... on GroupAbstractBuilderSectionsProseLayout {
...SectionProse
}
}
}

View File

@@ -0,0 +1,20 @@
<script setup lang="ts">
import type { AcfBuilderFragment } from "#graphql/types";
const props = defineProps<{ builder: AcfBuilderFragment }>();
const sections = computed(() =>
props.builder.sections.map(({ __typename, ...section }) => ({
component: __typename.replace(/^GroupAbstractBuilderSections(.+?)Layout$/, "Section$1"),
section,
})),
);
</script>
<template>
<Component
v-for="({ component, section }, key) in sections"
:key="key"
:is="component"
:section="section"
/>
</template>