34 lines
728 B
TypeScript
34 lines
728 B
TypeScript
import { fields } from '@keystatic/core'
|
|
import { inline } from '@keystatic/core/content-components'
|
|
|
|
import { NOTE_TYPES } from '@/lib/constants/blocks/notes'
|
|
|
|
export const sidenote = inline({
|
|
label: 'Sidenote',
|
|
schema: {
|
|
type: fields.select({
|
|
label: 'Type',
|
|
options: NOTE_TYPES,
|
|
defaultValue: 'default',
|
|
}),
|
|
marker: fields.text({
|
|
label: 'Marker',
|
|
description: 'One or two characters, e.g. * † ‡ a.',
|
|
defaultValue: '▾',
|
|
validation: {
|
|
isRequired: true,
|
|
length: {
|
|
max: 3,
|
|
},
|
|
},
|
|
}),
|
|
note: fields.text({
|
|
label: 'Note',
|
|
multiline: true,
|
|
validation: {
|
|
isRequired: true,
|
|
},
|
|
}),
|
|
},
|
|
})
|