A third settings mode next to 'inline' and 'modal': a large dialog where every consent category is a card with its on/off control, description and an expandable list of the cookies it covers (name, provider, purpose, duration), taken from Cookie Settings → Cookies — the same rows as <CookieTable>. The developer picks the mode with one prop; the component default stays 'inline', so existing sites are unchanged. Cookie Settings gets a localized detailLabels group (list labels, English fallback); getConsentTexts passes texts.cookies and texts.details, sharing the row mapping with getCookieTable. New classNames slots and data-ipal handles for the cards and lists. Docs for devs and agents: consent.md (modes compared, which to pick — new projects default to 'detailed' when the cookie list is filled), AGENT.md, PROGRAMISTA §2.8/§2.11/§6, skills ipal-setup, ipal-site, ipal-upgrade, ipal-locale-add, ipal-consent-check. Postgres/SQLite projects need migrate:create for the new fields. Co-Authored-By: Claude Opus 5.5 <[email protected]>
52 lines
1.8 KiB
TypeScript
52 lines
1.8 KiB
TypeScript
import type { ConsentCategory } from './categories.js'
|
|
|
|
export type ConsentTexts = {
|
|
/** Badge next to the necessary category (e.g. "Always active"). Empty = no badge. */
|
|
alwaysActiveLabel?: string
|
|
buttons: {
|
|
acceptAll: string
|
|
back: string
|
|
/** Accessible label of the ✕ button closing the settings dialog. */
|
|
close: string
|
|
reject: string
|
|
save: string
|
|
settings: string
|
|
}
|
|
categories: Record<ConsentCategory, { description: string; title: string }>
|
|
/**
|
|
* Cookie Settings → Cookies in this language — listed per category in the
|
|
* detailed settings window (<CookieBanner settings="detailed">). Optional so
|
|
* hand-built texts keep compiling; getConsentTexts always fills it.
|
|
*/
|
|
cookies?: CookieTableRow[]
|
|
/** Labels of the cookie list in the detailed settings window. No labels = no list. */
|
|
details?: {
|
|
/** Expander per category, e.g. "Cookies used" — the count is appended. */
|
|
cookies: string
|
|
duration: string
|
|
provider: string
|
|
purpose: string
|
|
}
|
|
/** Small label above the banner title (e.g. "Privacy & cookies"). Empty = not shown. */
|
|
eyebrow?: string
|
|
message: string
|
|
/** null = no privacy-policy link shown */
|
|
privacyLink: { href: string; label: string } | null
|
|
/** Intro under the settings title. Empty = not shown. */
|
|
settingsDescription?: string
|
|
settingsTitle: string
|
|
/** Banner heading (e.g. "We respect your privacy"). Empty = not shown. */
|
|
title?: string
|
|
/** Policy version from the panel — a stored consent from another version asks again. */
|
|
version?: number
|
|
}
|
|
|
|
/** One row of Cookie Settings → Cookies, resolved to a single language. */
|
|
export type CookieTableRow = {
|
|
category: ConsentCategory
|
|
duration?: string
|
|
name: string
|
|
provider?: string
|
|
purpose?: string
|
|
}
|