@press2ai/schema-types
v0.1.0
Published
Shared schema contract for self-describing themes. Theme exports SCHEMA: TemplateSchema; editor consumes it to generate forms dynamically.
Maintainers
Readme
@press2ai/schema-types
Shared schema contract for self-describing themes in the Press2AI ecosystem.
A theme exports SCHEMA: TemplateSchema next to its render function. An editor (therapist panel, admin landing) fetches that schema and generates a form dynamically — zero hardcoded UI.
import type { TemplateSchema } from '@press2ai/schema-types';
export const SCHEMA: TemplateSchema = {
meta: { id: 'minimal', name: 'Minimal', description: '...' },
sections: [
{ id: 'hero', label: 'Hero', fields: [
{ id: 'title', type: 'text', label: 'Tytuł', maxLength: 60 },
]},
],
};
export function render(props: { content: unknown }): string { /* ... */ }Field types
text, textarea, image, list, repeater — all serializable to JSON, all renderable by a generic FieldEditor.
Used by:
@press2ai/theme-site-minimal(therapist personal site)@press2ai/theme-katalog-marketplace(otwartyterapeuta.pl public catalog)
