/** * Portal root for the app's own full-screen overlays. * * The admin stylesheet pins ``#recomaze-app-container`` to the area right of * the WordPress admin menu and gives it layout containment, so a * ``position: fixed`` overlay rendered inside it covers the app instead of the * whole window. An overlay portalled to ``document.body`` escapes that: it * spans the viewport, and the admin menu - which paints above it - hides its * left edge. Rect-anchored layers (tooltips, popovers) must keep portalling to * ``document.body``, because the coordinates they measure are viewport ones. * * @return {HTMLElement} The app shell, or ``document.body`` outside it. */ export function appOverlayRoot(): HTMLElement { return document.getElementById('recomaze-app-container') ?? document.body; }