/** * Mounts the redesigned Static Front Page control into core's own * `static_front_page` section — see `override_static_front_page()` in * `Aureon\Customizer\Customizer`. * * Kept separate from `sections.tsx`'s generic `RENDERERS` map: that map * mounts one root per *Aureon* section (`aureon_`, backed by the shared * settings-tree store), where this is a single one-off root inside a *core* * section, backed directly by three core `wp.customize` settings the Aureon * tree knows nothing about — see `StaticFrontPageSection`. */ import { createRoot } from '@wordpress/element'; import { onControlEmbedded, onReady } from '../customize-bridge'; import StaticFrontPageSection from '../sections/static-front-page'; // Must match the ids `Customizer::override_static_front_page()` registers // the Mount_Control with. const MOUNT_ID = 'aureon-static_front_page-root'; const CONTROL_ID = 'aureon_static_front_page_mount'; export default function mountStaticFrontPage(): void { onReady( () => { onControlEmbedded( CONTROL_ID, () => { const node = document.getElementById( MOUNT_ID ); if ( ! node ) { return; } createRoot( node ).render( ); } ); } ); }