Theme switcher, table of contents, missing-page redirect, form placeholders and time field; audit and revalidate fixes

- buildRevalidateHook skips outside Next (no NEXT_RUNTIME) and with context.disableRevalidate
- BuilderForm focuses only on a real step change (no scroll to the form on remount)
- mediaImageProps: placeholder colour only for JPEG (placeholderColor); hook stores no colour for transparent images
- buildLinkField: interface name per shape (CmsLink, CmsLinkPlain, CmsLinkNoLabel) + interfaceName option
- Cookie Settings: buttons.save -> buttons.savePreferences (Mongoose reserved name)
- ThemeScript, ThemeSwitcher, useTheme; Site Settings defaultTheme 'system' + themeToggleLabel; Turnstile follows page theme
- extractHeadings, RenderRichText headingIds, TableOfContents, buildTableOfContentsField
- createPageRoute onMissing: 'redirectHome'
- Form builder: localized placeholder on text/email/textarea/number, new time field
- ipal-audit: no false positive for object keys between JSX elements; /md route not reported as dynamic

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-19 21:32:40 +02:00
co-authored by Claude Opus 5.5
parent 23e033d7d7
commit faa4ad679c
55 changed files with 1298 additions and 58 deletions
+304 -4
View File
@@ -213,6 +213,19 @@ export interface Form {
width?: number | null;
required?: boolean | null;
defaultValue?: boolean | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'checkbox';
@@ -231,6 +244,23 @@ export interface Form {
label?: string | null;
width?: number | null;
required?: boolean | null;
/**
* Hint shown inside the empty field, e.g. "e.g. 10:00–12:00". Empty → none.
*/
placeholder?: string | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'email';
@@ -251,6 +281,19 @@ export interface Form {
};
[k: string]: unknown;
} | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'message';
@@ -261,6 +304,23 @@ export interface Form {
width?: number | null;
defaultValue?: number | null;
required?: boolean | null;
/**
* Hint shown inside the empty field, e.g. "e.g. 10:00–12:00". Empty → none.
*/
placeholder?: string | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'number';
@@ -279,6 +339,19 @@ export interface Form {
}[]
| null;
required?: boolean | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'select';
@@ -298,6 +371,23 @@ export interface Form {
width?: number | null;
defaultValue?: string | null;
required?: boolean | null;
/**
* Hint shown inside the empty field, e.g. "e.g. 10:00–12:00". Empty → none.
*/
placeholder?: string | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'text';
@@ -308,6 +398,23 @@ export interface Form {
width?: number | null;
defaultValue?: string | null;
required?: boolean | null;
/**
* Hint shown inside the empty field, e.g. "e.g. 10:00–12:00". Empty → none.
*/
placeholder?: string | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'textarea';
@@ -335,6 +442,19 @@ export interface Form {
* Empty = no limit.
*/
maxSelected?: number | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'checkboxGroup';
@@ -345,6 +465,19 @@ export interface Form {
width?: number | null;
required?: boolean | null;
defaultValue?: string | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'date';
@@ -362,6 +495,19 @@ export interface Form {
}[]
| null;
required?: boolean | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'radio';
@@ -372,10 +518,48 @@ export interface Form {
*/
title?: string | null;
description?: string | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'step';
}
| {
/**
* Technical name, e.g. "services" — no spaces.
*/
name: string;
label?: string | null;
width?: number | null;
required?: boolean | null;
/**
* Leave empty to always show. Otherwise this appears only when the field named below has one of the values — e.g. field "areas", values "web, it".
*/
showWhen?: {
/**
* Technical name of another field.
*/
field?: string | null;
/**
* Comma-separated option values. Empty = when that field is filled in or ticked.
*/
values?: string | null;
};
id?: string | null;
blockName?: string | null;
blockType: 'time';
}
)[]
| null;
submitButtonLabel?: string | null;
@@ -701,6 +885,12 @@ export interface FormsSelect<T extends boolean = true> {
width?: T;
required?: T;
defaultValue?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -721,6 +911,13 @@ export interface FormsSelect<T extends boolean = true> {
label?: T;
width?: T;
required?: T;
placeholder?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -728,6 +925,12 @@ export interface FormsSelect<T extends boolean = true> {
| T
| {
message?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -739,6 +942,13 @@ export interface FormsSelect<T extends boolean = true> {
width?: T;
defaultValue?: T;
required?: T;
placeholder?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -758,6 +968,12 @@ export interface FormsSelect<T extends boolean = true> {
id?: T;
};
required?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -779,6 +995,13 @@ export interface FormsSelect<T extends boolean = true> {
width?: T;
defaultValue?: T;
required?: T;
placeholder?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -790,6 +1013,13 @@ export interface FormsSelect<T extends boolean = true> {
width?: T;
defaultValue?: T;
required?: T;
placeholder?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -809,6 +1039,12 @@ export interface FormsSelect<T extends boolean = true> {
};
minSelected?: T;
maxSelected?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -820,6 +1056,12 @@ export interface FormsSelect<T extends boolean = true> {
width?: T;
required?: T;
defaultValue?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -838,6 +1080,12 @@ export interface FormsSelect<T extends boolean = true> {
id?: T;
};
required?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -846,6 +1094,28 @@ export interface FormsSelect<T extends boolean = true> {
| {
title?: T;
description?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
time?:
| T
| {
name?: T;
label?: T;
width?: T;
required?: T;
showWhen?:
| T
| {
field?: T;
values?: T;
};
id?: T;
blockName?: T;
};
@@ -991,13 +1261,17 @@ export interface SiteSetting {
*/
favicon?: (number | null) | Media;
/**
* Theme applied on a visitor’s first visit.
* Theme applied on a visitor’s first visit. System = the visitor’s device setting.
*/
defaultTheme: 'light' | 'dark';
defaultTheme: 'light' | 'dark' | 'system';
/**
* Show a light/dark switch on the site.
*/
allowThemeToggle?: boolean | null;
/**
* Name of the switch read by screen readers, e.g. "Dark mode".
*/
themeToggleLabel?: string | null;
updatedAt?: string | null;
createdAt?: string | null;
}
@@ -1092,6 +1366,14 @@ export interface CookieSetting {
* Raise by 1 when you add a tool or change the cookie policy — every visitor is asked for consent again.
*/
policyVersion: number;
/**
* Small label above the banner title, e.g. "Privacy & cookies". Empty → not shown.
*/
eyebrow?: string | null;
/**
* Banner heading, e.g. "We respect your privacy". Empty → not shown.
*/
title?: string | null;
/**
* Main consent message shown in the banner.
*/
@@ -1100,6 +1382,14 @@ export interface CookieSetting {
* Heading for the detailed settings panel.
*/
settingsTitle?: string | null;
/**
* Intro under the settings heading — what cookies are for and that the choice can be changed later.
*/
settingsDescription?: string | null;
/**
* Badge next to the Necessary category, e.g. "Always active". Empty → a disabled switch/checkbox is shown instead.
*/
alwaysActiveLabel?: string | null;
/**
* Text of the privacy-policy link in the banner, e.g. "Privacy policy". The link target is the page assigned as Privacy Policy in Site Settings → System Pages. Empty → the page title is used.
*/
@@ -1111,8 +1401,12 @@ export interface CookieSetting {
acceptAll?: string | null;
reject?: string | null;
settings?: string | null;
save?: string | null;
savePreferences?: string | null;
back?: string | null;
/**
* Screen-reader label of the ✕ button in the settings dialog.
*/
close?: string | null;
};
/**
* Per-category titles and descriptions.
@@ -1206,6 +1500,7 @@ export interface SiteSettingsSelect<T extends boolean = true> {
favicon?: T;
defaultTheme?: T;
allowThemeToggle?: T;
themeToggleLabel?: T;
updatedAt?: T;
createdAt?: T;
globalType?: T;
@@ -1259,8 +1554,12 @@ export interface SiteIntegrationsSelect<T extends boolean = true> {
*/
export interface CookieSettingsSelect<T extends boolean = true> {
policyVersion?: T;
eyebrow?: T;
title?: T;
message?: T;
settingsTitle?: T;
settingsDescription?: T;
alwaysActiveLabel?: T;
privacyLinkLabel?: T;
buttons?:
| T
@@ -1268,8 +1567,9 @@ export interface CookieSettingsSelect<T extends boolean = true> {
acceptAll?: T;
reject?: T;
settings?: T;
save?: T;
savePreferences?: T;
back?: T;
close?: T;
};
categories?:
| T