{#snippet field(label: string, value: string, onInput: (value: string) => void, placeholder = '')} {/snippet} {#if !block}
Select a block to edit.
{:else}

{blockLabels[block.type as BlockType]}

{#if block.type === 'text'} updateData({ content })} />
updateData({ align: v })} /> updateData({ size: v })} formatLabel={(v) => (v === 'small' ? 'Small (footnote)' : 'Normal')} />
{:else if block.type === 'image_text'}
updateData({ url: image.url, alt: image.alt })} /> updateData({ imagePosition: v })} /> updateData({ content })} />
{:else if block.type === 'timeline'}
{#each block.data.items || [] as item, i}
Item {i + 1}
updateArray('items', i, { title: e.currentTarget.value })} />
{/each}
{:else if block.type === 'hero'} {@render field('Heading', block.data.heading || '', (heading) => updateData({ heading }))} {@render field('Subheading', block.data.subheading || '', (subheading) => updateData({ subheading }))}
{@render field('Button label', block.data.buttonLabel || '', (buttonLabel) => updateData({ buttonLabel }))} {@render field('Button URL', block.data.buttonUrl || '', (buttonUrl) => updateData({ buttonUrl }), 'Empty = the CTA button’s address')}
{:else if block.type === 'button'}
{@render field('Button label', block.data.label || '', (label) => updateData({ label }))} {@render field('URL', block.data.href || '', (href) => updateData({ href }), '/page or https://…')}
updateData({ variant: v })} /> updateData({ alignment: v })} /> updateData({ size: v })} formatLabel={(v) => sizeLabels[String(v)] || String(v)} /> updateData({ color })} />
{:else if block.type === 'spacer'} {:else if block.type === 'testimonials'} {@render field('Section title', block.data.title || '', (title) => updateData({ title }))}
{#each block.data.items || [] as item, i}
Testimonial {i + 1}
updateArray('items', i, { title: e.currentTarget.value })} />
{/each}
{:else if block.type === 'upcoming_calendar'} {@render field('Section title', block.data.title || '', (title) => updateData({ title }))}

Category filters

Choose categories to show in this block. Leave all unselected to show every published event.

{#if eventCategories?.length}
{#each eventCategories as category} {/each}
{:else}

No event categories exist yet. Add categories to events under Events first.

{/if}
{:else if block.type === 'shop'} {:else if block.type === 'checkout'} {:else if block.type === 'cards'} {@render field('Heading', block.data.heading || '', (heading) => updateData({ heading }), 'Optional')}
updateData({ align: v })} /> updateData({ style: v })} formatLabel={(v) => (v === 'image' ? 'A picture' : 'A number')} />
{#each block.data.items || [] as card, i}
Card {i + 1}
{#if block.data.style !== 'numbered'} updateArray('items', i, { imageUrl: image.url, imageAlt: image.alt })} /> {/if}
{@render field('Title', card.title || '', (title) => updateArray('items', i, { title }))} {@render field('Subtitle', card.subtitle || '', (subtitle) => updateArray('items', i, { subtitle }), 'Optional, shown lighter')}
Text updateArray('items', i, { text })} />
{@render field('Link', card.href || '', (href) => updateArray('items', i, { href }), '/page, #anchor or https://…')} {@render field('Link text', card.linkLabel || '', (linkLabel) => updateArray('items', i, { linkLabel }), 'Optional, e.g. Read more')}
{/each}

With a link, the whole card is clickable.

{:else if block.type === 'faq'} {@render field('Heading', block.data.heading || '', (heading) => updateData({ heading }), 'Optional')}
{#each block.data.items || [] as item, i}
Question {i + 1}
updateArray('items', i, { question: e.currentTarget.value })} /> updateArray('items', i, { answer })} />
{/each}

Visitors click a question to show its answer.

{:else if block.type === 'html'} {/if}

updateBackground({ type })} /> {#if block.data._background?.type === 'color'} updateBackground({ color })} /> {:else if block.data._background?.type === 'image'} updateBackground({ imageUrl: image.url, imageAlt: image.alt })} /> updateBackground({ attachment })} /> {@const overlay = block.data._background?.overlay ? (block.data._background?.overlayOpacity ?? 40) : 0}
{/if}
updateForeground({ mode })} /> {#if block.data._foreground?.mode === 'custom'} updateForeground({ headingColor })} /> updateForeground({ subheadingColor })} /> updateForeground({ textColor })} /> {/if}
{/if}