export const HOMEPAGE_MAX_BLOCKS_PER_ROW = 2;
export const defaultHomepageConfig = () => ({
    version: 1,
    rows: [
        {
            id: 'row-1',
            blocks: [
                {
                    id: 'block-1',
                    type: 'markdown',
                    config: {
                        content: '## Welcome\n\nEdit this homepage to get started.',
                    },
                },
            ],
        },
    ],
});
// `hero` (Greeting) is no longer a block type. Convert any legacy stored hero
// block into a markdown block so old configs still load, save and render — its
// {name} token keeps personalizing via the markdown block's own interpolation.
const migrateBlock = (block) => {
    if (block.type !== 'hero')
        return block;
    const legacyConfig = block.config;
    const title = typeof legacyConfig.title === 'string' ? legacyConfig.title : '';
    const subtitle = typeof legacyConfig.subtitle === 'string' ? legacyConfig.subtitle : '';
    const content = subtitle ? `## ${title}\n\n${subtitle}` : `## ${title}`;
    return { id: block.id, type: 'markdown', config: { content } };
};
export const migrateHomepageConfig = (config) => ({
    ...config,
    rows: config.rows.map((row) => ({
        ...row,
        blocks: row.blocks.map(migrateBlock),
    })),
});
//# sourceMappingURL=types.js.map