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
+2 -1
View File
@@ -89,7 +89,8 @@ export const cookieSettingsFields: Field[] = [
{ name: 'acceptAll', type: 'text', localized: true },
{ name: 'reject', type: 'text', localized: true },
{ name: 'settings', type: 'text', localized: true },
{ name: 'save', type: 'text', localized: true },
// Not `save`: Mongoose reserves that path name and warns on every start/build.
{ name: 'savePreferences', type: 'text', label: 'Save', localized: true },
{ name: 'back', type: 'text', localized: true },
{
name: 'close',
+12 -1
View File
@@ -12,12 +12,13 @@ export const themeFields: Field[] = [
name: 'defaultTheme',
type: 'select',
admin: {
description: 'Theme applied on a visitor’s first visit.',
description: 'Theme applied on a visitor’s first visit. System = the visitor’s device setting.',
},
defaultValue: 'light',
options: [
{ label: 'Light', value: 'light' },
{ label: 'Dark', value: 'dark' },
{ label: 'System', value: 'system' },
],
required: true,
},
@@ -29,4 +30,14 @@ export const themeFields: Field[] = [
},
defaultValue: true,
},
{
name: 'themeToggleLabel',
type: 'text',
admin: {
condition: (data) => Boolean(data?.allowThemeToggle),
description: 'Name of the switch read by screen readers, e.g. "Dark mode".',
},
label: 'Toggle label',
localized: true,
},
]