/** * Predefined footer layout presets. * * Each preset is a ready-made row/column layout applied to the currently * selected device's canvas (overwriting it). Mirrors the header presets in * `../header/header-templates.ts`; kept as plain data a Pro build can extend. */ import { __ } from '@wordpress/i18n'; import { uid, type HeaderRow, type ColumnAlign } from '../header/canvas-model'; import type { HeaderTemplate } from '../header/header-templates'; /** * Build a row from a list of columns described as [align, elements]. * @param cols Column descriptors. * @param general Optional overrides for the row's general settings (e.g. a * full-width content band for a CTA row). */ const row = ( cols: Array< [ ColumnAlign, string[] ] >, general: Record< string, unknown > = {} ): HeaderRow => ( { id: uid( 'row' ), general: { enabled: true, content_width: 'contained', vertical_align: 'center', ...general, }, design: {}, columns: cols.map( ( [ align, elements ] ) => ( { id: uid( 'col' ), align, width: 0, elements, } ) ), } ); export const FOOTER_TEMPLATES: HeaderTemplate[] = [ { id: 'columns', label: __( 'Columns', 'aureon' ), description: __( 'Brand beside the footer menu and social links — the classic footer.', 'aureon' ), preview: [ [ 'left', 'center', 'right' ] ], build: () => [ row( [ [ 'left', [ 'logo' ] ], [ 'center', [ 'link-list' ] ], [ 'right', [ 'social' ] ], ] ), ], }, { id: 'link-columns', label: __( 'Link columns', 'aureon' ), description: __( 'Brand plus three titled link columns — assign a menu to each.', 'aureon' ), preview: [ [ 'left', 'center', 'center', 'right' ] ], build: () => [ row( [ [ 'left', [ 'logo' ] ], [ 'center', [ 'link-list' ] ], [ 'center', [ 'link-list-2' ] ], [ 'right', [ 'link-list-3' ] ], ] ), ], }, { id: 'centered', label: __( 'Simple centered', 'aureon' ), description: __( 'A centered row of footer links above centered social icons.', 'aureon' ), preview: [ [ 'center' ], [ 'center' ] ], build: () => [ row( [ [ 'center', [ 'link-list' ] ] ] ), row( [ [ 'center', [ 'social' ] ] ] ), ], }, { id: 'minimal', label: __( 'Minimal', 'aureon' ), description: __( 'A single slim bar with the menu left and social links right.', 'aureon' ), preview: [ [ 'left', 'right' ] ], build: () => [ row( [ [ 'left', [ 'link-list' ] ], [ 'right', [ 'social' ] ], ] ), ], }, { id: 'cta', label: __( 'Call to action', 'aureon' ), description: __( 'A full-width prompt with a button above a logo and menu row.', 'aureon' ), preview: [ [ 'center' ], [ 'left', 'right' ] ], build: () => [ row( [ [ 'center', [ 'text-html', 'button' ] ] ], { content_width: 'full', } ), row( [ [ 'left', [ 'logo' ] ], [ 'right', [ 'link-list' ] ], ] ), ], }, ];