import type { ReactNode } from 'react' import type { AnalyticsProps } from '../analytics/Analytics.js' import type { GpcMode } from '../consent/gpc.js' import type { ConsentCookieMap } from '../consent/useConsent.js' import type { LightboxProviderProps } from '../lightbox/LightboxProvider.js' import type { PageStatsProps } from '../stats/PageStats.js' import type { SiteShell } from './createContentHelpers.js' import { Analytics } from '../analytics/Analytics.js' import { ConsentProvider } from '../consent/ConsentContext.js' import { CookieBanner } from '../consent/CookieBanner.js' import { CookieButton } from '../consent/CookieButton.js' import { LightboxProvider } from '../lightbox/LightboxProvider.js' import { JsonLdGraph } from '../seo/JsonLdGraph.js' import { PageStats } from '../stats/PageStats.js' import { MediaPreconnect } from '../storage/MediaPreconnect.js' import { ThemeScript } from '../theme/ThemeScript.js' import { TurnstileProvider } from '../turnstile/TurnstileProvider.js' export type SiteProvidersProps = { /** `defer` etc. for ; `false` = no analytics tags at all. */ analytics?: false | Omit /** The cookie banner. Default ``; pass your own configured one (`settings`, classNames) or `false`. */ banner?: false | ReactNode children: ReactNode /** * Optional server read of the consent cookie: `(await cookies()).get(CONSENT_COOKIE)?.value ?? null`. The HTML * then has no banner for a visitor who already decided, and the page becomes dynamic (no static / ISR copy). * Leave out (default) to keep pages static: the banner decides before the first paint with an inline script. */ consentCookie?: null | string /** The "cookie settings" button. Default ``; your own or `false`. */ cookieButton?: false | ReactNode /** Extra cookies per category to delete when consent is withdrawn. */ cookieMap?: ConsentCookieMap /** * Global Privacy Control: `'honour'` (default), `'ask'` or `false`. See ConsentProvider `gpc` and * docs/consent.md → Global Privacy Control. */ gpc?: GpcMode /** More site-wide JSON-LD nodes next to shell.jsonLd (e.g. buildNavigationJsonLd). */ jsonLd?: (null | Record | undefined)[] /** * One shared image lightbox for the site: mounts around the * page, so every and `RenderRichText lightbox` uses it. * `true` (texts from shell.lightboxTexts = Notifications → Lightbox) or * `{ texts, classNames, icons, loop, unstyled }`. Default off. For renderImage / renderDialog (functions) mount the provider * yourself in a client component. */ lightbox?: boolean | Omit /** * Consent log endpoint. Default: the site shell's (`shell.consentLogEndpoint`, '/api/ipal/consent' whenever the * plugin's consent log is on — the default since 1.17.0). `false` = decisions are not posted. */ logEndpoint?: false | string /** Days a choice is kept before the banner asks again. Default 180. */ maxAgeDays?: number /** * CSP nonce for a nonce-based policy (createProxy `csp`): read it in the layout * with `(await headers()).get('x-nonce')`. Goes on the theme script, the cookie * banner's first-paint script and the analytics tags the plugin injects (GTM * passes it on to its own tags). */ nonce?: null | string /** to the media origin (R2_PUBLIC_URL). Default true. */ preconnect?: boolean /** getSiteShell(locale) from lib/content. */ shell: SiteShell /** * Built-in statistics (iapl stats: true): mounts . `true` or * `{ locale, endpoint }`. Default off. */ stats?: boolean | PageStatsProps /** * Light / dark theme from Site Settings → Theme: renders first, * so the theme is on before the first paint. Put first in * and add `suppressHydrationWarning` to . Default false. */ theme?: boolean } /** * The wiring every [locale] layout repeats — consent, Turnstile, analytics, * site JSON-LD, media preconnect — in the right order (Analytics inside the * consent provider, forms inside Turnstile). Renders no markup of its own: * , , header, footer and
stay in the layout. * * const shell = await getSiteShell(locale) * * }> *
{children}