import { collection, fields } from '@keystatic/core'; import { createBaseArticleFields } from '@fields/base-article.ts'; import { createContentField } from '@fields/content.ts'; import { createElementsFields, createMateria } from '@fields/crucible'; export const kindred = collection({ label: 'Kindred', slugField: 'title', path: 'src/content/crucible/kindred/*/', format: { contentField: 'body', }, schema: { ...createBaseArticleFields(), body: createContentField(), crucible: fields.object( { baseline: fields.checkbox({ label: 'Baseline', description: 'Is this kindred the baseline?', defaultValue: false, }), deviations: fields.array( fields.object({ axis: fields.select({ defaultValue: 'size', label: 'Axis', options: [ { value: 'size', label: 'Size', }, { value: 'lifespan', label: 'Lifespan', }, { value: 'reproduction', label: 'Reproduction', }, { value: 'habitat', label: 'Habitat', }, { value: 'metabolism', label: 'Metabolism', }, { value: 'attunement', label: 'Attunement', }, { value: 'cognition', label: 'Cognition', }, ], }), position: fields.text({ label: 'Position', }), theme: fields.object({ name: fields.text({ label: 'Theme', }), elements: createElementsFields(), manifestation: fields.text({ multiline: true, label: 'Manifestation', }), }), }), { label: 'Deviations', itemLabel: (props) => `${props.fields.axis.value.toUpperCase()}: ${props.fields.theme.fields.name.value.toUpperCase()}`, }, ), drive: fields.object( { name: fields.text({ label: 'Name', }), elements: createElementsFields(), manifestation: fields.text({ multiline: true, label: 'Manifestation', }), }, { label: 'Drive', }, ), gifts: fields.array( fields.object({ name: fields.text({ label: 'Name', }), elements: createElementsFields(), description: fields.text({ multiline: true, label: 'Description', }), }), { label: 'Gifts', itemLabel: (props) => props.fields.name.value, }, ), leftover: createMateria(), }, { label: 'Crucible Data', }, ), }, });