Theme key 'theme', storage keys in the cookie scanner, type in the cookie list

- Theme choice in localStorage under 'theme' (next-themes' key and values)
  instead of 'ipal-theme'. ThemeScript moves an old choice before the first
  paint and removes the old key; useTheme / ThemeSwitcher do the same
  without the script. ipalKit({ theme: { storageKey } }) sets an own key,
  which reaches ThemeScript through getSiteShell().theme and <html
  data-theme-storage>.
- The cookie scanner declares the theme key (Theme choice: local storage,
  necessary, until changed or site data is cleared) when the theme switch
  is on, so Scan cookies finds it without a crawl.
- Cookies -> Cookie list rows get a Type (cookie / local storage / session
  storage, default cookie, shared by every language), filled by scan, review
  and approval. The detailed settings window and <CookieTable> show it with
  English and Polish defaults; the approval page marks storage entries.
- Migration: adds cookie_settings_cookies.storage (DEFAULT 'cookie') and
  cookie_settings_locales.detail_labels_storage, nothing else.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 11:29:56 +01:00
co-authored by Claude Opus 5.5
parent 6998b44431
commit b5368cdc61
35 changed files with 522 additions and 78 deletions
+23 -1
View File
@@ -169,6 +169,16 @@ export const cookieSettingsFields: Field[] = [
{ name: 'duration', type: 'text', admin: { placeholder: { en: 'Duration', pl: 'Okres' } }, label: { en: 'Duration', pl: 'Okres' }, localized: true },
],
},
{
name: 'storage',
type: 'text',
admin: {
description: { en: 'Shown only for entries kept in browser storage.', pl: 'Widoczne tylko przy wpisach w pamięci przeglądarki.' },
placeholder: { en: 'Type', pl: 'Rodzaj' },
},
label: { en: 'Type', pl: 'Rodzaj' },
localized: true,
},
],
label: { en: 'Cookie list headings', pl: 'Nagłówki listy cookies' },
},
@@ -222,7 +232,18 @@ export const cookieSettingsFields: Field[] = [
type: 'row',
fields: [
{ name: 'name', type: 'text', admin: { placeholder: '_ga', width: '40%' }, label: { en: 'Name', pl: 'Nazwa' }, required: true },
{ name: 'provider', type: 'text', admin: { placeholder: 'Google', width: '30%' }, label: { en: 'Provider', pl: 'Dostawca' } },
{
name: 'storage',
type: 'select',
admin: { width: '30%' },
defaultValue: 'cookie',
label: { en: 'Type', pl: 'Rodzaj' },
options: [
{ label: { en: 'Cookie', pl: 'Plik cookie' }, value: 'cookie' },
{ label: { en: 'Local storage', pl: 'Pamięć lokalna' }, value: 'localStorage' },
{ label: { en: 'Session storage', pl: 'Pamięć sesji' }, value: 'sessionStorage' },
],
},
{
name: 'category',
type: 'select',
@@ -234,6 +255,7 @@ export const cookieSettingsFields: Field[] = [
},
],
},
{ name: 'provider', type: 'text', admin: { placeholder: 'Google' }, label: { en: 'Provider', pl: 'Dostawca' } },
{ name: 'purpose', type: 'textarea', label: { en: 'Purpose', pl: 'Cel' }, localized: true },
{
name: 'duration',