feat: entry editor at /content/:key/new and /content/:key/:id

This commit is contained in:
Florian Sylvain committed 2026-10-21 00:12:34 +02:00
1 parent 91d916fb74
commit fba20f83c5
94 files changed
+7116 -423

No files matched your search

+4 -4
View File
@@ -1,6 +1,6 @@
export const FIELD_TYPES = ['text', 'richtext', 'number', 'boolean', 'date', 'select'] as const
import { FIELD_TYPE_SPECS, FIELD_TYPES, type FieldType } from '@/lib/fieldTypes'
export type FieldType = (typeof FIELD_TYPES)[number]
export { FIELD_TYPES, type FieldType }
export type KeyMode = 'auto' | 'manual'
export type KeyDisplayMode = KeyMode | 'empty'
export type BuilderStatus =
@@ -104,11 +104,11 @@ export function changeFieldType(field: BuilderField, type: FieldType): BuilderFi
}
export function supportsUnique(type: FieldType) {
return type !== 'richtext' && type !== 'boolean'
return FIELD_TYPE_SPECS[type].supportsUnique
}
export function supportsLimits(type: FieldType) {
return type === 'text' || type === 'richtext' || type === 'number' || type === 'date'
return FIELD_TYPE_SPECS[type].supportsLimits
}
export function hasDefaultValue(field: BuilderField) {