Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a92fc02cdf | ||
|
|
7aebe24236 | ||
|
|
c852d7bdae | ||
|
|
24fa3fdcdf | ||
|
|
73eacb09c2 | ||
|
|
2665cfa7b6 | ||
|
|
5c466b664c | ||
|
|
78e2f8fc7f | ||
|
|
13d669b757 | ||
|
|
a3938cacd9 | ||
|
|
2ef602b3ec | ||
|
|
1f55c2406e | ||
|
|
10d1806130 | ||
|
|
6be783bc5a |
@@ -194,7 +194,7 @@ Wpinaj w kolekcje gdzie dotyczy (patrz `hooks.md`):
|
||||
|
||||
- **buildSecurityHeaders** w next.config — HSTS, COOP, nosniff, Referrer-Policy (z automatu, uniwersalne).
|
||||
- **buildCsp** — generator CSP z twardymi regułami (base-uri, object-src, frame-ancestors). Flagi: turnstile, analytics, youtube, r2Url. Wdrażaj przez `report-only` → sprawdź konsolę → `enforce`.
|
||||
- **2FA WYMUSZONE** — `ipalKit({ twoFactor: { issuer: 'Nazwa Firmy' } })` + `pnpm add @clocklimited/payload-2fa@3.0.0-beta.7`. Wymuszone dla WSZYSTKICH użytkowników (forceSetup), bez opcji wyłączenia per user. NIE ustawiaj `twoFactor: false` (chyba że klient wprost odmawia). Bez zależności = błąd buildu. Patrz security.md.
|
||||
- **2FA WYMUSZONE** — `pnpm add @clocklimited/payload-2fa@3.0.0-beta.7`, potem WSTRZYKNIJ: `import { payloadTotp } from '@clocklimited/payload-2fa'` + `ipalKit({ twoFactor: { issuer: 'Nazwa Firmy', plugin: payloadTotp } })`. Wstrzyknięcie obowiązkowe — bez niego plugin robi dynamiczny import, którego Next nie wbundluje → „Cannot find module" na froncie. (Ewentualnie zamiast wstrzyknięcia: `serverExternalPackages: ['@clocklimited/payload-2fa']` w next.config.) Wymuszone dla WSZYSTKICH (forceSetup), bez opcji per user. NIE `twoFactor: false` (chyba że klient wprost odmawia). Patrz security.md.
|
||||
- **Ścieżka panelu** — `ipalKit({ adminRoute: '/its' })` ukrywa panel. WYMAGA przeniesienia folderu `app/(payload)/admin/` → `app/(payload)/its/`. To obscurity, nie security (2FA to prawdziwa ochrona).
|
||||
- CSP zostaje w projekcie (domeny), ale skeleton z pluginu. NIE Trusted Types (psuje Turnstile/GA).
|
||||
|
||||
@@ -236,6 +236,8 @@ Ten plik to skondensowane reguły. Szczegóły w `node_modules/@intecion/ipal-ki
|
||||
| Walidacja ENV na starcie (assertEnv) | `env.md` |
|
||||
| Czytelność dla AI: Markdown per strona, llms-full, boty AI w robots | `content.md`, `seo.md` |
|
||||
| Serwer MCP strony (Claude podłącza się do treści) | `mcp.md` |
|
||||
| GTM + Meta Pixel — konfiguracja krok po kroku | `gtm-meta-pixel.md` |
|
||||
| White-label panelu admina (logo/nazwa z SiteSettings) | `white-label.md` |
|
||||
| Bezpieczeństwo, CSP, COOP | `security.md` |
|
||||
| Formularze, Turnstile, submitForm, useForm/useContactForm | `forms.md`, `turnstile.md` |
|
||||
| i18n, strona jednojęzyczna, ścieżki | `i18n.md` |
|
||||
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Entry point: @intecion/ipal-kit/admin
|
||||
*
|
||||
* Admin-panel UI components (white-label branding). Separate export so Payload's
|
||||
* importMap can resolve them by a stable path when ipalKit injects
|
||||
* admin.components.graphics.Logo/Icon.
|
||||
*/
|
||||
export { AdminIcon, AdminLogo, IntecionCredit } from '../modules/branding/index.js';
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Entry point: @intecion/ipal-kit/admin
|
||||
*
|
||||
* Admin-panel UI components (white-label branding). Separate export so Payload's
|
||||
* importMap can resolve them by a stable path when ipalKit injects
|
||||
* admin.components.graphics.Logo/Icon.
|
||||
*/ export { AdminIcon, AdminLogo, IntecionCredit } from '../modules/branding/index.js';
|
||||
|
||||
//# sourceMappingURL=admin.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/exports/admin.ts"],"sourcesContent":["/**\n * Entry point: @intecion/ipal-kit/admin\n *\n * Admin-panel UI components (white-label branding). Separate export so Payload's\n * importMap can resolve them by a stable path when ipalKit injects\n * admin.components.graphics.Logo/Icon.\n */\nexport { AdminIcon, AdminLogo, IntecionCredit } from '../modules/branding/index.js'\n"],"names":["AdminIcon","AdminLogo","IntecionCredit"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,+BAA8B"}
|
||||
Vendored
+3
@@ -3,6 +3,7 @@ export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmai
|
||||
export { AccessibilityProvider, AccessibilityWidget, useAccessibility, } from '../modules/accessibility/client.js';
|
||||
export type { A11yClassNames, A11yState, A11yTexts } from '../modules/accessibility/client.js';
|
||||
export { Analytics } from '../modules/analytics/client.js';
|
||||
export { pushDataLayer } from '../modules/analytics/client.js';
|
||||
/**
|
||||
* Entry point: ipal-kit/client
|
||||
*
|
||||
@@ -12,6 +13,8 @@ export { Analytics } from '../modules/analytics/client.js';
|
||||
*/
|
||||
export { ConsentProvider, ConsentScript, CookieBanner, CookieButton, useConsent, useConsentContext, } from '../modules/consent/client.js';
|
||||
export type { CookieBannerClassNames } from '../modules/consent/client.js';
|
||||
export { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js';
|
||||
export type { FormAnalyticsConfig } from '../modules/forms/formAnalytics.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js';
|
||||
export { useContactForm } from '../modules/forms/useContactForm.js';
|
||||
export type { ContactFormErrors, ContactFormValues, SubmitAction, } from '../modules/forms/useContactForm.js';
|
||||
|
||||
Vendored
+2
@@ -3,6 +3,7 @@ export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.
|
||||
export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js';
|
||||
export { AccessibilityProvider, AccessibilityWidget, useAccessibility } from '../modules/accessibility/client.js';
|
||||
export { Analytics } from '../modules/analytics/client.js';
|
||||
export { pushDataLayer } from '../modules/analytics/client.js';
|
||||
/**
|
||||
* Entry point: ipal-kit/client
|
||||
*
|
||||
@@ -10,6 +11,7 @@ export { Analytics } from '../modules/analytics/client.js';
|
||||
* components. Kept separate from the main entry so server bundles don't pull in
|
||||
* client-only code.
|
||||
*/ export { ConsentProvider, ConsentScript, CookieBanner, CookieButton, useConsent, useConsentContext } from '../modules/consent/client.js';
|
||||
export { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js';
|
||||
export { useContactForm } from '../modules/forms/useContactForm.js';
|
||||
export { useForm } from '../modules/forms/useForm.js';
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\nexport { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'\nexport { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'\nexport {\n AccessibilityProvider,\n AccessibilityWidget,\n useAccessibility,\n} from '../modules/accessibility/client.js'\nexport type { A11yClassNames, A11yState, A11yTexts } from '../modules/accessibility/client.js'\nexport { Analytics } from '../modules/analytics/client.js'\n/**\n * Entry point: ipal-kit/client\n *\n * Client-side ('use client') exports — React hooks, providers, and UI\n * components. Kept separate from the main entry so server bundles don't pull in\n * client-only code.\n */\nexport {\n ConsentProvider,\n ConsentScript,\n CookieBanner,\n CookieButton,\n useConsent,\n useConsentContext,\n} from '../modules/consent/client.js'\n\nexport type { CookieBannerClassNames } from '../modules/consent/client.js'\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js'\nexport { useContactForm } from '../modules/forms/useContactForm.js'\nexport type {\n ContactFormErrors,\n ContactFormValues,\n SubmitAction,\n} from '../modules/forms/useContactForm.js'\nexport { useForm } from '../modules/forms/useForm.js'\nexport type { FormErrors, FormSubmitAction, Validator } from '../modules/forms/useForm.js'\nexport {\n buildValidator,\n checked,\n custom,\n email,\n isEmail,\n maxLength,\n minLength,\n pattern,\n required,\n} from '../modules/forms/validators.js'\nexport type { Rule } from '../modules/forms/validators.js'\n// Pure i18n path helpers — no server/RSC deps, safe to import in client\n// components (e.g. a LanguageSwitcher that computes locale URLs on the client).\nexport {\n buildLocalizedPath,\n getLocaleCodes,\n getLocalizedSlugs,\n switchLocalePath,\n} from '../modules/i18n/index.js'\nexport type { I18nConfig, LocalizedSlugs } from '../modules/i18n/index.js'\nexport {\n AlternateLinksProvider,\n AlternateLinksUpdater,\n LanguageSwitcher,\n useAlternateLinks,\n useSetAlternateLinks,\n} from '../modules/i18n/index.js'\nexport type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js'\nexport { Turnstile } from '../modules/turnstile/client.js'\nexport { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'\nexport type { TurnstileProps } from '../modules/turnstile/client.js'\n"],"names":["MaskedField","TestEmailButton","AccessibilityProvider","AccessibilityWidget","useAccessibility","Analytics","ConsentProvider","ConsentScript","CookieBanner","CookieButton","useConsent","useConsentContext","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","useContactForm","useForm","buildValidator","checked","custom","email","isEmail","maxLength","minLength","pattern","required","buildLocalizedPath","getLocaleCodes","getLocalizedSlugs","switchLocalePath","AlternateLinksProvider","AlternateLinksUpdater","LanguageSwitcher","useAlternateLinks","useSetAlternateLinks","Turnstile","TurnstileProvider","useTurnstile"],"mappings":"AAAA;AACA,SAASA,WAAW,QAAQ,wDAAuD;AACnF,SAASC,eAAe,QAAQ,4DAA2D;AAC3F,SACEC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,QACX,qCAAoC;AAE3C,SAASC,SAAS,QAAQ,iCAAgC;AAC1D;;;;;;CAMC,GACD,SACEC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,iBAAiB,QACZ,+BAA8B;AAGrC,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,+BAA8B;AACpG,SAASC,cAAc,QAAQ,qCAAoC;AAMnE,SAASC,OAAO,QAAQ,8BAA6B;AAErD,SACEC,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,iCAAgC;AAEvC,wEAAwE;AACxE,gFAAgF;AAChF,SACEC,kBAAkB,EAClBC,cAAc,EACdC,iBAAiB,EACjBC,gBAAgB,QACX,2BAA0B;AAEjC,SACEC,sBAAsB,EACtBC,qBAAqB,EACrBC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,QACf,2BAA0B;AAEjC,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,iCAAgC"}
|
||||
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\nexport { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'\nexport { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'\nexport {\n AccessibilityProvider,\n AccessibilityWidget,\n useAccessibility,\n} from '../modules/accessibility/client.js'\nexport type { A11yClassNames, A11yState, A11yTexts } from '../modules/accessibility/client.js'\nexport { Analytics } from '../modules/analytics/client.js'\nexport { pushDataLayer } from '../modules/analytics/client.js'\n\n/**\n * Entry point: ipal-kit/client\n *\n * Client-side ('use client') exports — React hooks, providers, and UI\n * components. Kept separate from the main entry so server bundles don't pull in\n * client-only code.\n */\nexport {\n ConsentProvider,\n ConsentScript,\n CookieBanner,\n CookieButton,\n useConsent,\n useConsentContext,\n} from '../modules/consent/client.js'\nexport type { CookieBannerClassNames } from '../modules/consent/client.js'\nexport { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js'\nexport type { FormAnalyticsConfig } from '../modules/forms/formAnalytics.js'\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js'\nexport { useContactForm } from '../modules/forms/useContactForm.js'\nexport type {\n ContactFormErrors,\n ContactFormValues,\n SubmitAction,\n} from '../modules/forms/useContactForm.js'\nexport { useForm } from '../modules/forms/useForm.js'\nexport type { FormErrors, FormSubmitAction, Validator } from '../modules/forms/useForm.js'\nexport {\n buildValidator,\n checked,\n custom,\n email,\n isEmail,\n maxLength,\n minLength,\n pattern,\n required,\n} from '../modules/forms/validators.js'\nexport type { Rule } from '../modules/forms/validators.js'\n// Pure i18n path helpers — no server/RSC deps, safe to import in client\n// components (e.g. a LanguageSwitcher that computes locale URLs on the client).\nexport {\n buildLocalizedPath,\n getLocaleCodes,\n getLocalizedSlugs,\n switchLocalePath,\n} from '../modules/i18n/index.js'\nexport type { I18nConfig, LocalizedSlugs } from '../modules/i18n/index.js'\nexport {\n AlternateLinksProvider,\n AlternateLinksUpdater,\n LanguageSwitcher,\n useAlternateLinks,\n useSetAlternateLinks,\n} from '../modules/i18n/index.js'\nexport type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js'\nexport { Turnstile } from '../modules/turnstile/client.js'\nexport { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'\nexport type { TurnstileProps } from '../modules/turnstile/client.js'\n"],"names":["MaskedField","TestEmailButton","AccessibilityProvider","AccessibilityWidget","useAccessibility","Analytics","pushDataLayer","ConsentProvider","ConsentScript","CookieBanner","CookieButton","useConsent","useConsentContext","formAnalyticsOnSuccess","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","useContactForm","useForm","buildValidator","checked","custom","email","isEmail","maxLength","minLength","pattern","required","buildLocalizedPath","getLocaleCodes","getLocalizedSlugs","switchLocalePath","AlternateLinksProvider","AlternateLinksUpdater","LanguageSwitcher","useAlternateLinks","useSetAlternateLinks","Turnstile","TurnstileProvider","useTurnstile"],"mappings":"AAAA;AACA,SAASA,WAAW,QAAQ,wDAAuD;AACnF,SAASC,eAAe,QAAQ,4DAA2D;AAC3F,SACEC,qBAAqB,EACrBC,mBAAmB,EACnBC,gBAAgB,QACX,qCAAoC;AAE3C,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,aAAa,QAAQ,iCAAgC;AAE9D;;;;;;CAMC,GACD,SACEC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,iBAAiB,QACZ,+BAA8B;AAErC,SAASC,sBAAsB,QAAQ,oCAAmC;AAE1E,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,+BAA8B;AACpG,SAASC,cAAc,QAAQ,qCAAoC;AAMnE,SAASC,OAAO,QAAQ,8BAA6B;AAErD,SACEC,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,iCAAgC;AAEvC,wEAAwE;AACxE,gFAAgF;AAChF,SACEC,kBAAkB,EAClBC,cAAc,EACdC,iBAAiB,EACjBC,gBAAgB,QACX,2BAA0B;AAEjC,SACEC,sBAAsB,EACtBC,qBAAqB,EACrBC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,QACf,2BAA0B;AAEjC,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,iCAAgC"}
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
import type { Field } from 'payload';
|
||||
/**
|
||||
* Analytics configuration — GA4 measurement ID and GTM container ID.
|
||||
* IDs are public (exposed client-side), so no read restriction needed.
|
||||
* Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no
|
||||
* read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only
|
||||
* after the matching consent category is granted (see modules/analytics).
|
||||
*/
|
||||
export declare const analyticsFields: Field[];
|
||||
|
||||
+37
-4
@@ -1,12 +1,13 @@
|
||||
/**
|
||||
* Analytics configuration — GA4 measurement ID and GTM container ID.
|
||||
* IDs are public (exposed client-side), so no read restriction needed.
|
||||
* Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no
|
||||
* read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only
|
||||
* after the matching consent category is granted (see modules/analytics).
|
||||
*/ export const analyticsFields = [
|
||||
{
|
||||
name: 'ga4MeasurementId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Google Analytics 4 Measurement ID.',
|
||||
description: 'Google Analytics 4 Measurement ID. (Google — Consent Mode)',
|
||||
placeholder: 'G-XXXXXXXXXX'
|
||||
}
|
||||
},
|
||||
@@ -14,9 +15,41 @@
|
||||
name: 'gtmContainerId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Google Tag Manager container ID.',
|
||||
description: 'Google Tag Manager container ID. (Google — Consent Mode)',
|
||||
placeholder: 'GTM-XXXXXXX'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'metaPixelId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Meta (Facebook) Pixel ID. Loads only after MARKETING consent.',
|
||||
placeholder: '1234567890123456'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'clarityProjectId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.',
|
||||
placeholder: 'abcdefghij'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'linkedInPartnerId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.',
|
||||
placeholder: '1234567'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'tiktokPixelId',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'TikTok Pixel ID. Loads only after MARKETING consent.',
|
||||
placeholder: 'CXXXXXXXXXXXXXXXXXXX'
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/analytics.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Analytics configuration — GA4 measurement ID and GTM container ID.\n * IDs are public (exposed client-side), so no read restriction needed.\n */\nexport const analyticsFields: Field[] = [\n {\n name: 'ga4MeasurementId',\n type: 'text',\n admin: {\n description: 'Google Analytics 4 Measurement ID.',\n placeholder: 'G-XXXXXXXXXX',\n },\n },\n {\n name: 'gtmContainerId',\n type: 'text',\n admin: {\n description: 'Google Tag Manager container ID.',\n placeholder: 'GTM-XXXXXXX',\n },\n },\n]\n"],"names":["analyticsFields","name","type","admin","description","placeholder"],"mappings":"AAEA;;;CAGC,GACD,OAAO,MAAMA,kBAA2B;IACtC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;CACD,CAAA"}
|
||||
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/analytics.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no\n * read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only\n * after the matching consent category is granted (see modules/analytics).\n */\nexport const analyticsFields: Field[] = [\n {\n name: 'ga4MeasurementId',\n type: 'text',\n admin: {\n description: 'Google Analytics 4 Measurement ID. (Google — Consent Mode)',\n placeholder: 'G-XXXXXXXXXX',\n },\n },\n {\n name: 'gtmContainerId',\n type: 'text',\n admin: {\n description: 'Google Tag Manager container ID. (Google — Consent Mode)',\n placeholder: 'GTM-XXXXXXX',\n },\n },\n {\n name: 'metaPixelId',\n type: 'text',\n admin: {\n description: 'Meta (Facebook) Pixel ID. Loads only after MARKETING consent.',\n placeholder: '1234567890123456',\n },\n },\n {\n name: 'clarityProjectId',\n type: 'text',\n admin: {\n description: 'Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.',\n placeholder: 'abcdefghij',\n },\n },\n {\n name: 'linkedInPartnerId',\n type: 'text',\n admin: {\n description: 'LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.',\n placeholder: '1234567',\n },\n },\n {\n name: 'tiktokPixelId',\n type: 'text',\n admin: {\n description: 'TikTok Pixel ID. Loads only after MARKETING consent.',\n placeholder: 'CXXXXXXXXXXXXXXXXXXX',\n },\n },\n]\n"],"names":["analyticsFields","name","type","admin","description","placeholder"],"mappings":"AAEA;;;;CAIC,GACD,OAAO,MAAMA,kBAA2B;IACtC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;CACD,CAAA"}
|
||||
Vendored
+2
-1
@@ -7,7 +7,7 @@ export { getAnalyticsConfig } from './modules/analytics/index.js';
|
||||
export { ACCEPT_ALL_CONSENT, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_MAX_AGE, CONSENT_VERSION, DEFAULT_CONSENT, getConsentTexts, parseConsent, REJECT_ALL_CONSENT, serializeConsent, setDefaultConsent, updateConsent, } from './modules/consent/index.js';
|
||||
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js';
|
||||
export type { ContentCollectionOption, ContentOption, ResolvedRoute, } from './modules/content/index.js';
|
||||
export { archiveFieldName, blocksToMarkdown, buildArchivePath, buildEntryPath, createMarkdownRenderer, createSearchRoute, getArchiveEntries, MARKDOWN_PREFIX, markdownHref, markdownResponse, parsePageParam, prefersMarkdown, resolveRedirect, resolveRoute, searchContent, } from './modules/content/index.js';
|
||||
export { archiveFieldName, blocksToMarkdown, buildArchivePath, buildEntryPath, createMarkdownRenderer, createSearchRoute, getArchiveEntries, MARKDOWN_PREFIX, markdownHref, markdownResponse, parsePageParam, prefersMarkdown, resolveNotFoundPage, resolveRedirect, resolveRoute, searchContent, } from './modules/content/index.js';
|
||||
export type { ArchiveEntries } from './modules/content/index.js';
|
||||
export type { SearchResult } from './modules/content/index.js';
|
||||
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||
@@ -18,6 +18,7 @@ export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
|
||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
||||
export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from './modules/env/index.js';
|
||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
||||
export type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption, } from './modules/forms/types.js';
|
||||
|
||||
Vendored
+3
-1
@@ -2,7 +2,7 @@ export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSe
|
||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
||||
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
||||
export { ACCEPT_ALL_CONSENT, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_MAX_AGE, CONSENT_VERSION, DEFAULT_CONSENT, getConsentTexts, parseConsent, REJECT_ALL_CONSENT, serializeConsent, setDefaultConsent, updateConsent } from './modules/consent/index.js';
|
||||
export { archiveFieldName, blocksToMarkdown, buildArchivePath, buildEntryPath, createMarkdownRenderer, createSearchRoute, getArchiveEntries, MARKDOWN_PREFIX, markdownHref, markdownResponse, parsePageParam, prefersMarkdown, resolveRedirect, resolveRoute, searchContent } from './modules/content/index.js';
|
||||
export { archiveFieldName, blocksToMarkdown, buildArchivePath, buildEntryPath, createMarkdownRenderer, createSearchRoute, getArchiveEntries, MARKDOWN_PREFIX, markdownHref, markdownResponse, parsePageParam, prefersMarkdown, resolveNotFoundPage, resolveRedirect, resolveRoute, searchContent } from './modules/content/index.js';
|
||||
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||
export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
||||
@@ -11,6 +11,8 @@ export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||
// Boot-time environment validation (fail fast on misconfigured deploys).
|
||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
||||
// Panel-managed form analytics (config-time field builder).
|
||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
||||
// Validation rules are pure — exported server-side too, for re-validating a
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -34,6 +34,16 @@ export type A11yClassNames = {
|
||||
* CookieBanner). Wrap the app in <AccessibilityProvider> first.
|
||||
*
|
||||
* <AccessibilityWidget classNames={{ button: 'a11y-btn', panel: 'a11y-panel' }} />
|
||||
*
|
||||
* Labels default to English; localize per locale by passing `texts` for the
|
||||
* active language. Keep the translations in the project (or a localized global)
|
||||
* and pass the active locale's set — the plugin stays content-agnostic:
|
||||
*
|
||||
* const A11Y: Record<string, A11yTexts> = {
|
||||
* pl: { title: 'Dostępność', textSize: 'Rozmiar tekstu', … },
|
||||
* de: { title: 'Barrierefreiheit', … },
|
||||
* }
|
||||
* <AccessibilityWidget texts={A11Y[locale]} classNames={…} />
|
||||
*/
|
||||
export declare function AccessibilityWidget({ classNames, texts, }: {
|
||||
classNames?: A11yClassNames;
|
||||
|
||||
+29
-15
@@ -2,21 +2,25 @@
|
||||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
import { useState } from 'react';
|
||||
import { useAccessibility } from './AccessibilityProvider.js';
|
||||
const DEFAULT_TEXTS = {
|
||||
bigCursor: 'Duży kursor',
|
||||
close: 'Zamknij',
|
||||
contrast: 'Kontrast',
|
||||
contrastHigh: 'Wysoki',
|
||||
contrastInverted: 'Odwrócony',
|
||||
grayscale: 'Skala szarości',
|
||||
lineHeight: 'Odstęp między liniami',
|
||||
open: 'Otwórz panel dostępności',
|
||||
readableFont: 'Czytelna czcionka',
|
||||
reduceMotion: 'Wyłącz animacje',
|
||||
reset: 'Resetuj',
|
||||
textSize: 'Rozmiar tekstu',
|
||||
title: 'Dostępność',
|
||||
underlineLinks: 'Podkreśl linki'
|
||||
/**
|
||||
* English defaults. The widget is end-user facing and multilingual projects run
|
||||
* in many locales, so the plugin ships a neutral English baseline — NOT Polish.
|
||||
* Localize by passing `texts` for the active locale (see the component doc).
|
||||
*/ const DEFAULT_TEXTS = {
|
||||
bigCursor: 'Large cursor',
|
||||
close: 'Close',
|
||||
contrast: 'Contrast',
|
||||
contrastHigh: 'High',
|
||||
contrastInverted: 'Inverted',
|
||||
grayscale: 'Grayscale',
|
||||
lineHeight: 'Line spacing',
|
||||
open: 'Open accessibility panel',
|
||||
readableFont: 'Readable font',
|
||||
reduceMotion: 'Reduce motion',
|
||||
reset: 'Reset',
|
||||
textSize: 'Text size',
|
||||
title: 'Accessibility',
|
||||
underlineLinks: 'Underline links'
|
||||
};
|
||||
/**
|
||||
* Accessibility toolbar: a floating button that opens a panel of options (text
|
||||
@@ -28,6 +32,16 @@ const DEFAULT_TEXTS = {
|
||||
* CookieBanner). Wrap the app in <AccessibilityProvider> first.
|
||||
*
|
||||
* <AccessibilityWidget classNames={{ button: 'a11y-btn', panel: 'a11y-panel' }} />
|
||||
*
|
||||
* Labels default to English; localize per locale by passing `texts` for the
|
||||
* active language. Keep the translations in the project (or a localized global)
|
||||
* and pass the active locale's set — the plugin stays content-agnostic:
|
||||
*
|
||||
* const A11Y: Record<string, A11yTexts> = {
|
||||
* pl: { title: 'Dostępność', textSize: 'Rozmiar tekstu', … },
|
||||
* de: { title: 'Barrierefreiheit', … },
|
||||
* }
|
||||
* <AccessibilityWidget texts={A11Y[locale]} classNames={…} />
|
||||
*/ export function AccessibilityWidget({ classNames, texts }) {
|
||||
const { reset, set, state } = useAccessibility();
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+12
-9
@@ -5,15 +5,18 @@ declare global {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Loads Google Analytics — GTM if a container ID is set, otherwise GA4 gtag.
|
||||
* Loads every configured analytics / marketing tag, each respecting consent:
|
||||
*
|
||||
* Consent Mode is initialised to the visitor's stored consent BEFORE the tag
|
||||
* loads (via setDefaultConsent from the consent module), so tags respect the
|
||||
* choice from the first hit; useConsent sends an update the moment the visitor
|
||||
* decides. IDs are public and come from SiteIntegrations, passed in as props
|
||||
* (the client project reads them server-side).
|
||||
* - **Google (GA4 / GTM)** — loaded immediately with Consent Mode: the visitor's
|
||||
* stored choice is set as the default BEFORE the tag loads, and useConsent
|
||||
* pushes an update the moment they decide. GTM wins if both IDs are set.
|
||||
* - **Non-Google (Meta Pixel, Clarity, LinkedIn, TikTok)** — these vendors have
|
||||
* no Consent Mode, so they load ONLY after the matching category is granted
|
||||
* (marketing for Pixel/LinkedIn/TikTok, analytics for Clarity). Reacts live to
|
||||
* the consent banner: accept → the tag loads immediately, no reload.
|
||||
*
|
||||
* Renders nothing — it only injects the scripts. Mount once, high in the tree
|
||||
* (e.g. root layout), inside ConsentProvider.
|
||||
* All IDs are public and come from SiteIntegrations (getAnalyticsConfig), passed
|
||||
* in as props. Renders nothing. Mount once, high in the tree, INSIDE
|
||||
* <ConsentProvider> (required — it reads live consent state).
|
||||
*/
|
||||
export declare function Analytics({ ga4MeasurementId, gtmContainerId }: AnalyticsConfig): null;
|
||||
export declare function Analytics(props: AnalyticsConfig): null;
|
||||
|
||||
Vendored
+44
-13
@@ -1,7 +1,9 @@
|
||||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
import { useConsentContext } from '../consent/client.js';
|
||||
import { gtag } from '../consent/googleConsent.js';
|
||||
import { CONSENT_COOKIE, DEFAULT_CONSENT, parseConsent, setDefaultConsent } from '../consent/index.js';
|
||||
import { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js';
|
||||
const GTM_SCRIPT = (id)=>`https://www.googletagmanager.com/gtm.js?id=${id}`;
|
||||
const GA4_SCRIPT = (id)=>`https://www.googletagmanager.com/gtag/js?id=${id}`;
|
||||
/** Reads the current consent state from cookie, or defaults if none. */ function readConsent() {
|
||||
@@ -21,24 +23,29 @@ function injectScript(src) {
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
/**
|
||||
* Loads Google Analytics — GTM if a container ID is set, otherwise GA4 gtag.
|
||||
* Loads every configured analytics / marketing tag, each respecting consent:
|
||||
*
|
||||
* Consent Mode is initialised to the visitor's stored consent BEFORE the tag
|
||||
* loads (via setDefaultConsent from the consent module), so tags respect the
|
||||
* choice from the first hit; useConsent sends an update the moment the visitor
|
||||
* decides. IDs are public and come from SiteIntegrations, passed in as props
|
||||
* (the client project reads them server-side).
|
||||
* - **Google (GA4 / GTM)** — loaded immediately with Consent Mode: the visitor's
|
||||
* stored choice is set as the default BEFORE the tag loads, and useConsent
|
||||
* pushes an update the moment they decide. GTM wins if both IDs are set.
|
||||
* - **Non-Google (Meta Pixel, Clarity, LinkedIn, TikTok)** — these vendors have
|
||||
* no Consent Mode, so they load ONLY after the matching category is granted
|
||||
* (marketing for Pixel/LinkedIn/TikTok, analytics for Clarity). Reacts live to
|
||||
* the consent banner: accept → the tag loads immediately, no reload.
|
||||
*
|
||||
* Renders nothing — it only injects the scripts. Mount once, high in the tree
|
||||
* (e.g. root layout), inside ConsentProvider.
|
||||
*/ export function Analytics({ ga4MeasurementId, gtmContainerId }) {
|
||||
* All IDs are public and come from SiteIntegrations (getAnalyticsConfig), passed
|
||||
* in as props. Renders nothing. Mount once, high in the tree, INSIDE
|
||||
* <ConsentProvider> (required — it reads live consent state).
|
||||
*/ export function Analytics(props) {
|
||||
const { clarityProjectId, ga4MeasurementId, gtmContainerId, linkedInPartnerId, metaPixelId, tiktokPixelId } = props;
|
||||
// Live consent state — drives the non-Google pixels.
|
||||
const { state } = useConsentContext();
|
||||
// --- Google: load once, Consent Mode handles gating ---
|
||||
useEffect(()=>{
|
||||
if (!ga4MeasurementId && !gtmContainerId) {
|
||||
return;
|
||||
}
|
||||
// 1. Consent Mode default = the visitor's stored choice, before tags load.
|
||||
setDefaultConsent(readConsent());
|
||||
// 2. Load the tag.
|
||||
if (gtmContainerId) {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.dataLayer.push({
|
||||
@@ -48,8 +55,6 @@ function injectScript(src) {
|
||||
injectScript(GTM_SCRIPT(gtmContainerId));
|
||||
} else if (ga4MeasurementId) {
|
||||
injectScript(GA4_SCRIPT(ga4MeasurementId));
|
||||
// Uses the shared gtag (pushes `arguments`, as Google's tags expect);
|
||||
// real gtag.js wires itself up once the script loads.
|
||||
gtag('js', new Date());
|
||||
gtag('config', ga4MeasurementId);
|
||||
}
|
||||
@@ -57,6 +62,32 @@ function injectScript(src) {
|
||||
ga4MeasurementId,
|
||||
gtmContainerId
|
||||
]);
|
||||
// --- Non-Google: load each when its consent category is granted ---
|
||||
// The loaders are idempotent, so re-running on state changes is safe; a tag
|
||||
// loads the first time its category flips to true and never doubles up.
|
||||
useEffect(()=>{
|
||||
if (state.marketing) {
|
||||
if (metaPixelId) {
|
||||
loadMetaPixel(metaPixelId);
|
||||
}
|
||||
if (linkedInPartnerId) {
|
||||
loadLinkedIn(linkedInPartnerId);
|
||||
}
|
||||
if (tiktokPixelId) {
|
||||
loadTikTok(tiktokPixelId);
|
||||
}
|
||||
}
|
||||
if (state.analytics && clarityProjectId) {
|
||||
loadClarity(clarityProjectId);
|
||||
}
|
||||
}, [
|
||||
state.marketing,
|
||||
state.analytics,
|
||||
metaPixelId,
|
||||
linkedInPartnerId,
|
||||
tiktokPixelId,
|
||||
clarityProjectId
|
||||
]);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
@@ -1 +1,3 @@
|
||||
export { Analytics } from './Analytics.js';
|
||||
export { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js';
|
||||
export { pushDataLayer } from './pushDataLayer.js';
|
||||
|
||||
Vendored
+4
@@ -1,4 +1,8 @@
|
||||
'use client';
|
||||
export { Analytics } from './Analytics.js';
|
||||
// Low-level pixel loaders — exported for manual conversion events if a project
|
||||
// needs them (Analytics loads them automatically, consent-gated).
|
||||
export { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js';
|
||||
export { pushDataLayer } from './pushDataLayer.js';
|
||||
|
||||
//# sourceMappingURL=client.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/analytics/client.ts"],"sourcesContent":["'use client'\nexport { Analytics } from './Analytics.js'\n"],"names":["Analytics"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,iBAAgB"}
|
||||
{"version":3,"sources":["../../../src/modules/analytics/client.ts"],"sourcesContent":["'use client'\nexport { Analytics } from './Analytics.js'\n// Low-level pixel loaders — exported for manual conversion events if a project\n// needs them (Analytics loads them automatically, consent-gated).\nexport { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js'\nexport { pushDataLayer } from './pushDataLayer.js'\n"],"names":["Analytics","loadClarity","loadLinkedIn","loadMetaPixel","loadTikTok","pushDataLayer"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,iBAAgB;AAC1C,+EAA+E;AAC/E,kEAAkE;AAClE,SAASC,WAAW,EAAEC,YAAY,EAAEC,aAAa,EAAEC,UAAU,QAAQ,cAAa;AAClF,SAASC,aAAa,QAAQ,qBAAoB"}
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
import type { BasePayload } from 'payload';
|
||||
import type { AnalyticsConfig } from './types.js';
|
||||
/**
|
||||
* Reads the public analytics IDs from SiteIntegrations, server-side.
|
||||
*
|
||||
* Returns only the two public IDs (GA4 / GTM) — safe to pass to the client
|
||||
* Reads the public analytics / marketing tag IDs from SiteIntegrations,
|
||||
* server-side. All are public (exposed client-side), so safe to pass to the
|
||||
* <Analytics> component. Does NOT expose any secret from SiteIntegrations.
|
||||
*/
|
||||
export declare function getAnalyticsConfig(payload: BasePayload): Promise<AnalyticsConfig>;
|
||||
|
||||
+7
-4
@@ -1,14 +1,17 @@
|
||||
import { getSiteIntegrations } from '../payload/index.js';
|
||||
/**
|
||||
* Reads the public analytics IDs from SiteIntegrations, server-side.
|
||||
*
|
||||
* Returns only the two public IDs (GA4 / GTM) — safe to pass to the client
|
||||
* Reads the public analytics / marketing tag IDs from SiteIntegrations,
|
||||
* server-side. All are public (exposed client-side), so safe to pass to the
|
||||
* <Analytics> component. Does NOT expose any secret from SiteIntegrations.
|
||||
*/ export async function getAnalyticsConfig(payload) {
|
||||
const integrations = await getSiteIntegrations(payload);
|
||||
return {
|
||||
clarityProjectId: integrations.clarityProjectId ?? null,
|
||||
ga4MeasurementId: integrations.ga4MeasurementId ?? null,
|
||||
gtmContainerId: integrations.gtmContainerId ?? null
|
||||
gtmContainerId: integrations.gtmContainerId ?? null,
|
||||
linkedInPartnerId: integrations.linkedInPartnerId ?? null,
|
||||
metaPixelId: integrations.metaPixelId ?? null,
|
||||
tiktokPixelId: integrations.tiktokPixelId ?? null
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/analytics/getAnalyticsConfig.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\nimport type { AnalyticsConfig } from './types.js'\n\nimport { getSiteIntegrations } from '../payload/index.js'\n\n/**\n * Reads the public analytics IDs from SiteIntegrations, server-side.\n *\n * Returns only the two public IDs (GA4 / GTM) — safe to pass to the client\n * <Analytics> component. Does NOT expose any secret from SiteIntegrations.\n */\nexport async function getAnalyticsConfig(payload: BasePayload): Promise<AnalyticsConfig> {\n const integrations = await getSiteIntegrations<AnalyticsConfig>(payload)\n return {\n ga4MeasurementId: integrations.ga4MeasurementId ?? null,\n gtmContainerId: integrations.gtmContainerId ?? null,\n }\n}\n"],"names":["getSiteIntegrations","getAnalyticsConfig","payload","integrations","ga4MeasurementId","gtmContainerId"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,sBAAqB;AAEzD;;;;;CAKC,GACD,OAAO,eAAeC,mBAAmBC,OAAoB;IAC3D,MAAMC,eAAe,MAAMH,oBAAqCE;IAChE,OAAO;QACLE,kBAAkBD,aAAaC,gBAAgB,IAAI;QACnDC,gBAAgBF,aAAaE,cAAc,IAAI;IACjD;AACF"}
|
||||
{"version":3,"sources":["../../../src/modules/analytics/getAnalyticsConfig.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\nimport type { AnalyticsConfig } from './types.js'\n\nimport { getSiteIntegrations } from '../payload/index.js'\n\n/**\n * Reads the public analytics / marketing tag IDs from SiteIntegrations,\n * server-side. All are public (exposed client-side), so safe to pass to the\n * <Analytics> component. Does NOT expose any secret from SiteIntegrations.\n */\nexport async function getAnalyticsConfig(payload: BasePayload): Promise<AnalyticsConfig> {\n const integrations = await getSiteIntegrations<AnalyticsConfig>(payload)\n return {\n clarityProjectId: integrations.clarityProjectId ?? null,\n ga4MeasurementId: integrations.ga4MeasurementId ?? null,\n gtmContainerId: integrations.gtmContainerId ?? null,\n linkedInPartnerId: integrations.linkedInPartnerId ?? null,\n metaPixelId: integrations.metaPixelId ?? null,\n tiktokPixelId: integrations.tiktokPixelId ?? null,\n }\n}\n"],"names":["getSiteIntegrations","getAnalyticsConfig","payload","integrations","clarityProjectId","ga4MeasurementId","gtmContainerId","linkedInPartnerId","metaPixelId","tiktokPixelId"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,sBAAqB;AAEzD;;;;CAIC,GACD,OAAO,eAAeC,mBAAmBC,OAAoB;IAC3D,MAAMC,eAAe,MAAMH,oBAAqCE;IAChE,OAAO;QACLE,kBAAkBD,aAAaC,gBAAgB,IAAI;QACnDC,kBAAkBF,aAAaE,gBAAgB,IAAI;QACnDC,gBAAgBH,aAAaG,cAAc,IAAI;QAC/CC,mBAAmBJ,aAAaI,iBAAiB,IAAI;QACrDC,aAAaL,aAAaK,WAAW,IAAI;QACzCC,eAAeN,aAAaM,aAAa,IAAI;IAC/C;AACF"}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Loaders for non-Google marketing/analytics pixels. Each is idempotent (guards
|
||||
* against double-init) and loads the vendor's own script + bootstrap.
|
||||
*
|
||||
* These are the one place `any` is unavoidable: vendor SDK bootstraps attach
|
||||
* untyped globals (fbq, clarity, lintrk, ttq) to `window`. Casts are contained
|
||||
* here; nothing else in the kit uses `any`.
|
||||
*
|
||||
* CONSENT: these vendors have no Google Consent Mode — the caller (Analytics)
|
||||
* loads each ONLY after the matching consent category is granted:
|
||||
* Meta Pixel / LinkedIn / TikTok → marketing
|
||||
* Microsoft Clarity → analytics
|
||||
*/
|
||||
/** Meta (Facebook) Pixel — fires PageView on load. */
|
||||
export declare function loadMetaPixel(id: string): void;
|
||||
/** Microsoft Clarity — heatmaps / session recordings (analytics category). */
|
||||
export declare function loadClarity(id: string): void;
|
||||
/** LinkedIn Insight Tag (marketing). */
|
||||
export declare function loadLinkedIn(partnerId: string): void;
|
||||
/** TikTok Pixel (marketing) — fires page view on load. */
|
||||
export declare function loadTikTok(id: string): void;
|
||||
Vendored
+134
@@ -0,0 +1,134 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */ /**
|
||||
* Loaders for non-Google marketing/analytics pixels. Each is idempotent (guards
|
||||
* against double-init) and loads the vendor's own script + bootstrap.
|
||||
*
|
||||
* These are the one place `any` is unavoidable: vendor SDK bootstraps attach
|
||||
* untyped globals (fbq, clarity, lintrk, ttq) to `window`. Casts are contained
|
||||
* here; nothing else in the kit uses `any`.
|
||||
*
|
||||
* CONSENT: these vendors have no Google Consent Mode — the caller (Analytics)
|
||||
* loads each ONLY after the matching consent category is granted:
|
||||
* Meta Pixel / LinkedIn / TikTok → marketing
|
||||
* Microsoft Clarity → analytics
|
||||
*/ /** Meta (Facebook) Pixel — fires PageView on load. */ export function loadMetaPixel(id) {
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
}
|
||||
const w = window;
|
||||
if (w.fbq) {
|
||||
return;
|
||||
}
|
||||
const n = w.fbq = function(...args) {
|
||||
if (n.callMethod) {
|
||||
n.callMethod.apply(n, args);
|
||||
} else {
|
||||
n.queue.push(args);
|
||||
}
|
||||
};
|
||||
if (!w._fbq) {
|
||||
w._fbq = n;
|
||||
}
|
||||
n.push = n;
|
||||
n.loaded = true;
|
||||
n.version = '2.0';
|
||||
n.queue = [];
|
||||
const s = document.createElement('script');
|
||||
s.async = true;
|
||||
s.src = 'https://connect.facebook.net/en_US/fbevents.js';
|
||||
document.head.appendChild(s);
|
||||
w.fbq('init', id);
|
||||
w.fbq('track', 'PageView');
|
||||
}
|
||||
/** Microsoft Clarity — heatmaps / session recordings (analytics category). */ export function loadClarity(id) {
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
}
|
||||
const w = window;
|
||||
if (w.clarity) {
|
||||
return;
|
||||
}
|
||||
w.clarity = function(...a) {
|
||||
;
|
||||
(w.clarity.q = w.clarity.q || []).push(a);
|
||||
};
|
||||
const s = document.createElement('script');
|
||||
s.async = true;
|
||||
s.src = `https://www.clarity.ms/tag/${id}`;
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
/** LinkedIn Insight Tag (marketing). */ export function loadLinkedIn(partnerId) {
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
}
|
||||
const w = window;
|
||||
w._linkedin_partner_id = partnerId;
|
||||
w._linkedin_data_partner_ids = w._linkedin_data_partner_ids || [];
|
||||
if (w._linkedin_data_partner_ids.includes(partnerId)) {
|
||||
if (document.getElementById('ipal-linkedin-insight')) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
w._linkedin_data_partner_ids.push(partnerId);
|
||||
}
|
||||
if (document.getElementById('ipal-linkedin-insight')) {
|
||||
return;
|
||||
}
|
||||
const s = document.createElement('script');
|
||||
s.async = true;
|
||||
s.id = 'ipal-linkedin-insight';
|
||||
s.src = 'https://snap.licdn.com/li.lms-analytics/insight.min.js';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
/** TikTok Pixel (marketing) — fires page view on load. */ export function loadTikTok(id) {
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
}
|
||||
const w = window;
|
||||
if (w.ttq) {
|
||||
return;
|
||||
}
|
||||
w.TiktokAnalyticsObject = 'ttq';
|
||||
const ttq = w.ttq = [];
|
||||
ttq.methods = [
|
||||
'page',
|
||||
'track',
|
||||
'identify',
|
||||
'instances',
|
||||
'debug',
|
||||
'on',
|
||||
'off',
|
||||
'once',
|
||||
'ready',
|
||||
'alias',
|
||||
'group',
|
||||
'enableCookie',
|
||||
'disableCookie'
|
||||
];
|
||||
ttq.setAndDefer = function(t, e) {
|
||||
t[e] = function(...args) {
|
||||
t.push([
|
||||
e,
|
||||
...args
|
||||
]);
|
||||
};
|
||||
};
|
||||
for (const m of ttq.methods){
|
||||
ttq.setAndDefer(ttq, m);
|
||||
}
|
||||
ttq.load = function(e) {
|
||||
const url = 'https://analytics.tiktok.com/i18n/pixel/events.js';
|
||||
ttq._i = ttq._i || {};
|
||||
ttq._i[e] = [];
|
||||
ttq._i[e]._u = url;
|
||||
ttq._t = ttq._t || {};
|
||||
ttq._t[e] = Number(new Date());
|
||||
const s = document.createElement('script');
|
||||
s.async = true;
|
||||
s.src = `${url}?sdkid=${e}&lib=ttq`;
|
||||
document.head.appendChild(s);
|
||||
};
|
||||
ttq.load(id);
|
||||
ttq.page();
|
||||
}
|
||||
|
||||
//# sourceMappingURL=pixels.js.map
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Pushes an event onto the GTM `window.dataLayer`. SSR-safe (no-op on the
|
||||
* server), and tolerant of GTM not being present yet — the array is created so
|
||||
* the event is buffered and picked up once GTM loads.
|
||||
*
|
||||
* The bridge between the form engine and GTM: fire a `form_submit` event after
|
||||
* a successful submit so a Meta Pixel / GA "Lead" tag can trigger on it.
|
||||
*
|
||||
* import { pushDataLayer } from '@intecion/ipal-kit/client'
|
||||
* const f = useContactForm({
|
||||
* submitAction,
|
||||
* onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic || 'kontakt' }),
|
||||
* })
|
||||
*
|
||||
* The GTM "Lead" tag then reads `form_name` via a Data Layer Variable
|
||||
* (`DLV – form_name`) and fires on the custom event `form_submit`. Consent still
|
||||
* gates the tag in GTM (ad_storage) — this only emits the event.
|
||||
*/
|
||||
export declare function pushDataLayer(event: string, params?: Record<string, unknown>): void;
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Pushes an event onto the GTM `window.dataLayer`. SSR-safe (no-op on the
|
||||
* server), and tolerant of GTM not being present yet — the array is created so
|
||||
* the event is buffered and picked up once GTM loads.
|
||||
*
|
||||
* The bridge between the form engine and GTM: fire a `form_submit` event after
|
||||
* a successful submit so a Meta Pixel / GA "Lead" tag can trigger on it.
|
||||
*
|
||||
* import { pushDataLayer } from '@intecion/ipal-kit/client'
|
||||
* const f = useContactForm({
|
||||
* submitAction,
|
||||
* onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic || 'kontakt' }),
|
||||
* })
|
||||
*
|
||||
* The GTM "Lead" tag then reads `form_name` via a Data Layer Variable
|
||||
* (`DLV – form_name`) and fires on the custom event `form_submit`. Consent still
|
||||
* gates the tag in GTM (ad_storage) — this only emits the event.
|
||||
*/ export function pushDataLayer(event, params = {}) {
|
||||
if (typeof window === 'undefined') return;
|
||||
const w = window;
|
||||
w.dataLayer = w.dataLayer || [];
|
||||
w.dataLayer.push({
|
||||
event,
|
||||
...params
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=pushDataLayer.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/analytics/pushDataLayer.ts"],"sourcesContent":["/**\n * Pushes an event onto the GTM `window.dataLayer`. SSR-safe (no-op on the\n * server), and tolerant of GTM not being present yet — the array is created so\n * the event is buffered and picked up once GTM loads.\n *\n * The bridge between the form engine and GTM: fire a `form_submit` event after\n * a successful submit so a Meta Pixel / GA \"Lead\" tag can trigger on it.\n *\n * import { pushDataLayer } from '@intecion/ipal-kit/client'\n * const f = useContactForm({\n * submitAction,\n * onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic || 'kontakt' }),\n * })\n *\n * The GTM \"Lead\" tag then reads `form_name` via a Data Layer Variable\n * (`DLV – form_name`) and fires on the custom event `form_submit`. Consent still\n * gates the tag in GTM (ad_storage) — this only emits the event.\n */\nexport function pushDataLayer(event: string, params: Record<string, unknown> = {}): void {\n if (typeof window === 'undefined') return\n const w = window as unknown as { dataLayer?: unknown[] }\n w.dataLayer = w.dataLayer || []\n w.dataLayer.push({ event, ...params })\n}\n"],"names":["pushDataLayer","event","params","window","w","dataLayer","push"],"mappings":"AAAA;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,SAASA,cAAcC,KAAa,EAAEC,SAAkC,CAAC,CAAC;IAC/E,IAAI,OAAOC,WAAW,aAAa;IACnC,MAAMC,IAAID;IACVC,EAAEC,SAAS,GAAGD,EAAEC,SAAS,IAAI,EAAE;IAC/BD,EAAEC,SAAS,CAACC,IAAI,CAAC;QAAEL;QAAO,GAAGC,MAAM;IAAC;AACtC"}
|
||||
Vendored
+13
-3
@@ -1,9 +1,19 @@
|
||||
/**
|
||||
* Analytics IDs, read from SiteIntegrations (public — safe on the client).
|
||||
* Analytics / marketing tag IDs, read from SiteIntegrations (all public — safe
|
||||
* on the client). Google tags (GA4/GTM) use Consent Mode; the rest load only
|
||||
* after the matching consent category is granted (see Analytics).
|
||||
*/
|
||||
export type AnalyticsConfig = {
|
||||
/** GA4 Measurement ID, e.g. 'G-XXXXXXXXXX'. */
|
||||
/** Microsoft Clarity project ID. (analytics consent) */
|
||||
clarityProjectId?: null | string;
|
||||
/** GA4 Measurement ID, e.g. 'G-XXXXXXXXXX'. (Google — Consent Mode) */
|
||||
ga4MeasurementId?: null | string;
|
||||
/** GTM Container ID, e.g. 'GTM-XXXXXXX'. */
|
||||
/** GTM Container ID, e.g. 'GTM-XXXXXXX'. (Google — Consent Mode) */
|
||||
gtmContainerId?: null | string;
|
||||
/** LinkedIn Insight Tag partner ID. (marketing consent) */
|
||||
linkedInPartnerId?: null | string;
|
||||
/** Meta (Facebook) Pixel ID, ~15–16 digits. (marketing consent) */
|
||||
metaPixelId?: null | string;
|
||||
/** TikTok Pixel ID. (marketing consent) */
|
||||
tiktokPixelId?: null | string;
|
||||
};
|
||||
|
||||
Vendored
+3
-1
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* Analytics IDs, read from SiteIntegrations (public — safe on the client).
|
||||
* Analytics / marketing tag IDs, read from SiteIntegrations (all public — safe
|
||||
* on the client). Google tags (GA4/GTM) use Consent Mode; the rest load only
|
||||
* after the matching consent category is granted (see Analytics).
|
||||
*/ export { };
|
||||
|
||||
//# sourceMappingURL=types.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/analytics/types.ts"],"sourcesContent":["/**\n * Analytics IDs, read from SiteIntegrations (public — safe on the client).\n */\nexport type AnalyticsConfig = {\n /** GA4 Measurement ID, e.g. 'G-XXXXXXXXXX'. */\n ga4MeasurementId?: null | string\n /** GTM Container ID, e.g. 'GTM-XXXXXXX'. */\n gtmContainerId?: null | string\n}\n"],"names":[],"mappings":"AAAA;;CAEC,GACD,WAKC"}
|
||||
{"version":3,"sources":["../../../src/modules/analytics/types.ts"],"sourcesContent":["/**\n * Analytics / marketing tag IDs, read from SiteIntegrations (all public — safe\n * on the client). Google tags (GA4/GTM) use Consent Mode; the rest load only\n * after the matching consent category is granted (see Analytics).\n */\nexport type AnalyticsConfig = {\n /** Microsoft Clarity project ID. (analytics consent) */\n clarityProjectId?: null | string\n /** GA4 Measurement ID, e.g. 'G-XXXXXXXXXX'. (Google — Consent Mode) */\n ga4MeasurementId?: null | string\n /** GTM Container ID, e.g. 'GTM-XXXXXXX'. (Google — Consent Mode) */\n gtmContainerId?: null | string\n /** LinkedIn Insight Tag partner ID. (marketing consent) */\n linkedInPartnerId?: null | string\n /** Meta (Facebook) Pixel ID, ~15–16 digits. (marketing consent) */\n metaPixelId?: null | string\n /** TikTok Pixel ID. (marketing consent) */\n tiktokPixelId?: null | string\n}\n"],"names":[],"mappings":"AAAA;;;;CAIC,GACD,WAaC"}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* White-label admin branding: the Payload admin panel's logo (login + nav) and
|
||||
* icon, pulled from the project's SiteSettings so each client sees THEIR brand,
|
||||
* set by the editor in the panel — not hardcoded per project. Wired
|
||||
* automatically by `ipalKit({ whiteLabel: true })` (it injects
|
||||
* admin.components.graphics.Logo/Icon pointing here).
|
||||
*
|
||||
* Server Components — they read the SiteSettings global at render. Data access
|
||||
* uses the project's `@payload-config` alias (universal in Payload 3 Next apps),
|
||||
* loaded via a variable specifier so the PLUGIN's own typecheck doesn't try to
|
||||
* resolve it (same pattern as the optional 2FA import). Everything is wrapped in
|
||||
* try/catch: on the login screen before the DB is ready, or a build with no DB,
|
||||
* the component falls back to the site name text, then to null (Payload's own
|
||||
* default) — never throws, never blocks the panel.
|
||||
*
|
||||
* A0: no client brand in code. The logo/name come from the panel; if nothing is
|
||||
* set, nothing is forced.
|
||||
*/
|
||||
type BrandingProps = {
|
||||
/** Upload field to render as the image. Default 'logo' (Logo) / 'favicon' (Icon). */
|
||||
imageField?: string;
|
||||
/** Field holding the site name. Default 'siteName'. */
|
||||
nameField?: string;
|
||||
/** SiteSettings global slug. Default 'site-settings'. */
|
||||
settingsSlug?: string;
|
||||
};
|
||||
/**
|
||||
* Admin panel logo — this is the LARGE logo on the login / unauthorized screens
|
||||
* (Payload uses `graphics.Icon` for the small nav glyph). SiteSettings `logo`,
|
||||
* falls back to `siteName` text. Sized generously for the login screen.
|
||||
*/
|
||||
export declare function AdminLogo(props?: BrandingProps): Promise<import("react/jsx-runtime").JSX.Element | null>;
|
||||
/** Admin panel icon (small nav glyph). SiteSettings `favicon`, falls back to initials. */
|
||||
export declare function AdminIcon(props?: BrandingProps): Promise<import("react/jsx-runtime").JSX.Element | null>;
|
||||
/**
|
||||
* Discreet vendor credit: "Technology supported by Intecion.com". This is the
|
||||
* PLUGIN VENDOR's credit (Intecion ships ipal-kit, the framework), not client
|
||||
* data — a sensible default here is fine and A0-safe. The client's own brand
|
||||
* still owns the logo/name; this is a small line stating who supports the tech.
|
||||
* Text/URL overridable; turn it off with `whiteLabel: { credit: false }`.
|
||||
*
|
||||
* Wired by ipalKit into admin.components.afterNavLinks (nav) AND afterLogin
|
||||
* (login screen footer). `variant` adjusts placement:
|
||||
* - 'nav' → left-aligned line under the nav links
|
||||
* - 'login' → centered line below the login form
|
||||
*/
|
||||
export declare function IntecionCredit(props?: {
|
||||
text?: string;
|
||||
url?: string;
|
||||
variant?: 'login' | 'nav';
|
||||
}): import("react/jsx-runtime").JSX.Element;
|
||||
export {};
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { getPayload } from 'payload';
|
||||
async function loadBranding(settingsSlug, nameField, imageField) {
|
||||
try {
|
||||
// Consumer alias — resolved in the project's build, hidden from plugin tsc.
|
||||
const spec = '@payload-config';
|
||||
const mod = await import(spec);
|
||||
const payload = await getPayload({
|
||||
config: mod.default
|
||||
});
|
||||
const settings = await payload.findGlobal({
|
||||
slug: settingsSlug,
|
||||
depth: 1
|
||||
});
|
||||
const name = typeof settings[nameField] === 'string' ? settings[nameField] : null;
|
||||
const image = settings[imageField];
|
||||
const url = image && typeof image === 'object' && typeof image.url === 'string' ? image.url : null;
|
||||
return {
|
||||
name,
|
||||
url
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
name: null,
|
||||
url: null
|
||||
};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Admin panel logo — this is the LARGE logo on the login / unauthorized screens
|
||||
* (Payload uses `graphics.Icon` for the small nav glyph). SiteSettings `logo`,
|
||||
* falls back to `siteName` text. Sized generously for the login screen.
|
||||
*/ export async function AdminLogo(props = {}) {
|
||||
const { imageField = 'logo', nameField = 'siteName', settingsSlug = 'site-settings' } = props;
|
||||
const { name, url } = await loadBranding(settingsSlug, nameField, imageField);
|
||||
if (url) {
|
||||
return /*#__PURE__*/ _jsx("img", {
|
||||
alt: name ?? '',
|
||||
src: url,
|
||||
style: {
|
||||
height: 'auto',
|
||||
maxHeight: 120,
|
||||
maxWidth: 420,
|
||||
width: 'auto'
|
||||
}
|
||||
});
|
||||
}
|
||||
if (name) {
|
||||
return /*#__PURE__*/ _jsx("div", {
|
||||
style: {
|
||||
fontSize: '2rem',
|
||||
fontWeight: 600
|
||||
},
|
||||
children: name
|
||||
});
|
||||
}
|
||||
return null // nothing configured → Payload's default
|
||||
;
|
||||
}
|
||||
/** Admin panel icon (small nav glyph). SiteSettings `favicon`, falls back to initials. */ export async function AdminIcon(props = {}) {
|
||||
const { imageField = 'favicon', nameField = 'siteName', settingsSlug = 'site-settings' } = props;
|
||||
const { name, url } = await loadBranding(settingsSlug, nameField, imageField);
|
||||
if (url) {
|
||||
return /*#__PURE__*/ _jsx("img", {
|
||||
alt: name ?? '',
|
||||
src: url,
|
||||
style: {
|
||||
height: 'auto',
|
||||
maxHeight: 28,
|
||||
maxWidth: 28,
|
||||
width: 'auto'
|
||||
}
|
||||
});
|
||||
}
|
||||
if (name) {
|
||||
return /*#__PURE__*/ _jsx("div", {
|
||||
style: {
|
||||
fontWeight: 700
|
||||
},
|
||||
children: name.slice(0, 2).toUpperCase()
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Discreet vendor credit: "Technology supported by Intecion.com". This is the
|
||||
* PLUGIN VENDOR's credit (Intecion ships ipal-kit, the framework), not client
|
||||
* data — a sensible default here is fine and A0-safe. The client's own brand
|
||||
* still owns the logo/name; this is a small line stating who supports the tech.
|
||||
* Text/URL overridable; turn it off with `whiteLabel: { credit: false }`.
|
||||
*
|
||||
* Wired by ipalKit into admin.components.afterNavLinks (nav) AND afterLogin
|
||||
* (login screen footer). `variant` adjusts placement:
|
||||
* - 'nav' → left-aligned line under the nav links
|
||||
* - 'login' → centered line below the login form
|
||||
*/ export function IntecionCredit(props = {}) {
|
||||
const { text = 'Technology supported by Intecion.com', url = 'https://intecion.com', variant = 'nav' } = props;
|
||||
const style = variant === 'login' ? {
|
||||
color: 'inherit',
|
||||
display: 'block',
|
||||
fontSize: '0.75rem',
|
||||
marginTop: '2rem',
|
||||
opacity: 0.6,
|
||||
padding: '0.5rem',
|
||||
textAlign: 'center',
|
||||
textDecoration: 'none'
|
||||
} : {
|
||||
color: 'inherit',
|
||||
display: 'block',
|
||||
fontSize: '0.75rem',
|
||||
opacity: 0.6,
|
||||
padding: '0.75rem 1rem',
|
||||
textDecoration: 'none'
|
||||
};
|
||||
return /*#__PURE__*/ _jsx("a", {
|
||||
href: url,
|
||||
rel: "noopener noreferrer",
|
||||
style: style,
|
||||
target: "_blank",
|
||||
children: text
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=adminGraphics.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
Vendored
+1
@@ -0,0 +1 @@
|
||||
export { AdminIcon, AdminLogo, IntecionCredit } from './adminGraphics.js';
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
export { AdminIcon, AdminLogo, IntecionCredit } from './adminGraphics.js';
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/branding/index.ts"],"sourcesContent":["export { AdminIcon, AdminLogo, IntecionCredit } from './adminGraphics.js'\n"],"names":["AdminIcon","AdminLogo","IntecionCredit"],"mappings":"AAAA,SAASA,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,qBAAoB"}
|
||||
Vendored
+1
@@ -6,6 +6,7 @@ export { getArchiveEntries } from './getArchiveEntries.js';
|
||||
export type { ArchiveEntries } from './getArchiveEntries.js';
|
||||
export { MARKDOWN_PREFIX, markdownHref, prefersMarkdown } from './markdownNegotiation.js';
|
||||
export { buildArchivePath, buildEntryPath, parsePageParam } from './paths.js';
|
||||
export { resolveNotFoundPage } from './resolveNotFoundPage.js';
|
||||
export { resolveRedirect } from './resolveRedirect.js';
|
||||
export { resolveRoute } from './resolveRoute.js';
|
||||
export type { ResolvedRoute } from './resolveRoute.js';
|
||||
|
||||
Vendored
+1
@@ -5,6 +5,7 @@ export { createSearchRoute } from './createSearchRoute.js';
|
||||
export { getArchiveEntries } from './getArchiveEntries.js';
|
||||
export { MARKDOWN_PREFIX, markdownHref, prefersMarkdown } from './markdownNegotiation.js';
|
||||
export { buildArchivePath, buildEntryPath, parsePageParam } from './paths.js';
|
||||
export { resolveNotFoundPage } from './resolveNotFoundPage.js';
|
||||
export { resolveRedirect } from './resolveRedirect.js';
|
||||
export { resolveRoute } from './resolveRoute.js';
|
||||
export { searchContent } from './searchContent.js';
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/content/index.ts"],"sourcesContent":["export { buildArchiveFields } from './archiveFields.js'\nexport { blocksToMarkdown } from './blocksToMarkdown.js'\nexport { createMarkdownRenderer, markdownResponse } from './createMarkdownRenderer.js'\nexport { createSearchRoute } from './createSearchRoute.js'\nexport { getArchiveEntries } from './getArchiveEntries.js'\nexport type { ArchiveEntries } from './getArchiveEntries.js'\nexport { MARKDOWN_PREFIX, markdownHref, prefersMarkdown } from './markdownNegotiation.js'\nexport { buildArchivePath, buildEntryPath, parsePageParam } from './paths.js'\nexport { resolveRedirect } from './resolveRedirect.js'\nexport { resolveRoute } from './resolveRoute.js'\nexport type { ResolvedRoute } from './resolveRoute.js'\nexport { searchContent } from './searchContent.js'\nexport type { SearchResult } from './searchContent.js'\nexport type { ContentCollectionOption, ContentOption } from './types.js'\nexport { archiveFieldName } from './types.js'\n"],"names":["buildArchiveFields","blocksToMarkdown","createMarkdownRenderer","markdownResponse","createSearchRoute","getArchiveEntries","MARKDOWN_PREFIX","markdownHref","prefersMarkdown","buildArchivePath","buildEntryPath","parsePageParam","resolveRedirect","resolveRoute","searchContent","archiveFieldName"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,gBAAgB,QAAQ,wBAAuB;AACxD,SAASC,sBAAsB,EAAEC,gBAAgB,QAAQ,8BAA6B;AACtF,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,iBAAiB,QAAQ,yBAAwB;AAE1D,SAASC,eAAe,EAAEC,YAAY,EAAEC,eAAe,QAAQ,2BAA0B;AACzF,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,cAAc,QAAQ,aAAY;AAC7E,SAASC,eAAe,QAAQ,uBAAsB;AACtD,SAASC,YAAY,QAAQ,oBAAmB;AAEhD,SAASC,aAAa,QAAQ,qBAAoB;AAGlD,SAASC,gBAAgB,QAAQ,aAAY"}
|
||||
{"version":3,"sources":["../../../src/modules/content/index.ts"],"sourcesContent":["export { buildArchiveFields } from './archiveFields.js'\nexport { blocksToMarkdown } from './blocksToMarkdown.js'\nexport { createMarkdownRenderer, markdownResponse } from './createMarkdownRenderer.js'\nexport { createSearchRoute } from './createSearchRoute.js'\nexport { getArchiveEntries } from './getArchiveEntries.js'\nexport type { ArchiveEntries } from './getArchiveEntries.js'\nexport { MARKDOWN_PREFIX, markdownHref, prefersMarkdown } from './markdownNegotiation.js'\nexport { buildArchivePath, buildEntryPath, parsePageParam } from './paths.js'\nexport { resolveNotFoundPage } from './resolveNotFoundPage.js'\nexport { resolveRedirect } from './resolveRedirect.js'\nexport { resolveRoute } from './resolveRoute.js'\nexport type { ResolvedRoute } from './resolveRoute.js'\nexport { searchContent } from './searchContent.js'\nexport type { SearchResult } from './searchContent.js'\nexport type { ContentCollectionOption, ContentOption } from './types.js'\nexport { archiveFieldName } from './types.js'\n"],"names":["buildArchiveFields","blocksToMarkdown","createMarkdownRenderer","markdownResponse","createSearchRoute","getArchiveEntries","MARKDOWN_PREFIX","markdownHref","prefersMarkdown","buildArchivePath","buildEntryPath","parsePageParam","resolveNotFoundPage","resolveRedirect","resolveRoute","searchContent","archiveFieldName"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,gBAAgB,QAAQ,wBAAuB;AACxD,SAASC,sBAAsB,EAAEC,gBAAgB,QAAQ,8BAA6B;AACtF,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,iBAAiB,QAAQ,yBAAwB;AAE1D,SAASC,eAAe,EAAEC,YAAY,EAAEC,eAAe,QAAQ,2BAA0B;AACzF,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,cAAc,QAAQ,aAAY;AAC7E,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,eAAe,QAAQ,uBAAsB;AACtD,SAASC,YAAY,QAAQ,oBAAmB;AAEhD,SAASC,aAAa,QAAQ,qBAAoB;AAGlD,SAASC,gBAAgB,QAAQ,aAAY"}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
import type { BasePayload } from 'payload';
|
||||
type ResolveNotFoundPageArgs = {
|
||||
locale: string;
|
||||
/** Client's Pages collection slug. Defaults to 'pages'. */
|
||||
pagesSlug?: string;
|
||||
payload: BasePayload;
|
||||
/** SiteSettings global slug. Defaults to 'site-settings'. */
|
||||
settingsSlug?: string;
|
||||
};
|
||||
/**
|
||||
* Returns the page the editor assigned as **404 (Not Found)** in System Pages,
|
||||
* fully populated (depth 2, same shape as resolveRoute's pages), or null when
|
||||
* the role is unassigned.
|
||||
*
|
||||
* Used by the project's `not-found.tsx`. The editor decides what a 404 looks
|
||||
* like: a dedicated "Not found" page, or simply the homepage. Null means
|
||||
* "render the project's built-in fallback view".
|
||||
*
|
||||
* Never throws — a missing DB (container build prerendering not-found) or a
|
||||
* deleted page just yields null, so the 404 view can't crash the build.
|
||||
*/
|
||||
export declare function resolveNotFoundPage({ locale, pagesSlug, payload, settingsSlug, }: ResolveNotFoundPageArgs): Promise<null | Record<string, unknown>>;
|
||||
export {};
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Returns the page the editor assigned as **404 (Not Found)** in System Pages,
|
||||
* fully populated (depth 2, same shape as resolveRoute's pages), or null when
|
||||
* the role is unassigned.
|
||||
*
|
||||
* Used by the project's `not-found.tsx`. The editor decides what a 404 looks
|
||||
* like: a dedicated "Not found" page, or simply the homepage. Null means
|
||||
* "render the project's built-in fallback view".
|
||||
*
|
||||
* Never throws — a missing DB (container build prerendering not-found) or a
|
||||
* deleted page just yields null, so the 404 view can't crash the build.
|
||||
*/ export async function resolveNotFoundPage({ locale, pagesSlug = 'pages', payload, settingsSlug = 'site-settings' }) {
|
||||
try {
|
||||
const settings = await payload.findGlobal({
|
||||
slug: settingsSlug,
|
||||
depth: 0,
|
||||
locale: locale
|
||||
});
|
||||
const rel = settings.notFound;
|
||||
const id = typeof rel === 'string' || typeof rel === 'number' ? rel : rel && typeof rel === 'object' ? rel.id : undefined;
|
||||
if (id === undefined) {
|
||||
return null;
|
||||
}
|
||||
const doc = await payload.findByID({
|
||||
id,
|
||||
collection: pagesSlug,
|
||||
depth: 2,
|
||||
locale: locale
|
||||
});
|
||||
return doc ?? null;
|
||||
} catch (error) {
|
||||
console.warn('[ipal] resolveNotFoundPage: falling back to built-in 404 view:', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=resolveNotFoundPage.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/content/resolveNotFoundPage.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\ntype ResolveNotFoundPageArgs = {\n locale: string\n /** Client's Pages collection slug. Defaults to 'pages'. */\n pagesSlug?: string\n payload: BasePayload\n /** SiteSettings global slug. Defaults to 'site-settings'. */\n settingsSlug?: string\n}\n\n/**\n * Returns the page the editor assigned as **404 (Not Found)** in System Pages,\n * fully populated (depth 2, same shape as resolveRoute's pages), or null when\n * the role is unassigned.\n *\n * Used by the project's `not-found.tsx`. The editor decides what a 404 looks\n * like: a dedicated \"Not found\" page, or simply the homepage. Null means\n * \"render the project's built-in fallback view\".\n *\n * Never throws — a missing DB (container build prerendering not-found) or a\n * deleted page just yields null, so the 404 view can't crash the build.\n */\nexport async function resolveNotFoundPage({\n locale,\n pagesSlug = 'pages',\n payload,\n settingsSlug = 'site-settings',\n}: ResolveNotFoundPageArgs): Promise<null | Record<string, unknown>> {\n try {\n const settings = (await payload.findGlobal({\n slug: settingsSlug as never,\n depth: 0,\n locale: locale as never,\n })) as Record<string, unknown>\n\n const rel = settings.notFound\n const id =\n typeof rel === 'string' || typeof rel === 'number'\n ? rel\n : rel && typeof rel === 'object'\n ? (rel as { id?: number | string }).id\n : undefined\n if (id === undefined) {return null}\n\n const doc = await payload.findByID({\n id,\n collection: pagesSlug as never,\n depth: 2,\n locale: locale as never,\n })\n return (doc as null | Record<string, unknown>) ?? null\n } catch (error) {\n console.warn('[ipal] resolveNotFoundPage: falling back to built-in 404 view:', error)\n return null\n }\n}\n"],"names":["resolveNotFoundPage","locale","pagesSlug","payload","settingsSlug","settings","findGlobal","slug","depth","rel","notFound","id","undefined","doc","findByID","collection","error","console","warn"],"mappings":"AAWA;;;;;;;;;;;CAWC,GACD,OAAO,eAAeA,oBAAoB,EACxCC,MAAM,EACNC,YAAY,OAAO,EACnBC,OAAO,EACPC,eAAe,eAAe,EACN;IACxB,IAAI;QACF,MAAMC,WAAY,MAAMF,QAAQG,UAAU,CAAC;YACzCC,MAAMH;YACNI,OAAO;YACPP,QAAQA;QACV;QAEA,MAAMQ,MAAMJ,SAASK,QAAQ;QAC7B,MAAMC,KACJ,OAAOF,QAAQ,YAAY,OAAOA,QAAQ,WACtCA,MACAA,OAAO,OAAOA,QAAQ,WACpB,AAACA,IAAiCE,EAAE,GACpCC;QACR,IAAID,OAAOC,WAAW;YAAC,OAAO;QAAI;QAElC,MAAMC,MAAM,MAAMV,QAAQW,QAAQ,CAAC;YACjCH;YACAI,YAAYb;YACZM,OAAO;YACPP,QAAQA;QACV;QACA,OAAO,AAACY,OAA0C;IACpD,EAAE,OAAOG,OAAO;QACdC,QAAQC,IAAI,CAAC,kEAAkEF;QAC/E,OAAO;IACT;AACF"}
|
||||
Vendored
+14
@@ -114,6 +114,20 @@ import { archiveFieldName } from './types.js';
|
||||
if (!doc) {
|
||||
return null;
|
||||
}
|
||||
// The page assigned as 404 in System Pages must not be reachable as a normal
|
||||
// 200 URL (/pl/strona-nie-znaleziona) — that's a soft-404 / duplicate. Treat
|
||||
// it as not found, so the route calls notFound() and not-found.tsx renders
|
||||
// that same page with a real 404 status. (If 404 = homepage, the homepage is
|
||||
// served from the root branch above and never reaches here by its own slug
|
||||
// in a way that matters — but guard anyway so we never hide the homepage.)
|
||||
const notFound = settings.notFound;
|
||||
const homepage = settings.homepage;
|
||||
const notFoundId = notFound && typeof notFound === 'object' ? notFound.id : notFound;
|
||||
const homepageId = homepage && typeof homepage === 'object' ? homepage.id : homepage;
|
||||
const docId = doc.id;
|
||||
if (notFoundId != null && notFoundId === docId && notFoundId !== homepageId) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
type: 'page',
|
||||
doc: doc
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -47,7 +47,7 @@ import { buildLocalizedPath, getDefaultLocale, isValidLocale } from '../i18n/ind
|
||||
if (doc._status && doc._status !== 'published') {
|
||||
continue;
|
||||
}
|
||||
if (doc.meta?.noindex) {
|
||||
if (doc.noindex || doc.meta?.noindex) {
|
||||
continue;
|
||||
}
|
||||
const title = typeof doc.title === 'string' ? doc.title : undefined;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+29
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Shape of the per-form analytics config an editor fills in the panel (see
|
||||
* buildFormAnalyticsFields). Loose by design — it comes from Payload.
|
||||
*/
|
||||
export type FormAnalyticsConfig = {
|
||||
event?: null | string;
|
||||
params?: {
|
||||
key?: null | string;
|
||||
value?: null | string;
|
||||
}[] | null;
|
||||
} | null | undefined;
|
||||
/**
|
||||
* Builds an `onSuccess` handler from a form's panel-configured analytics, so the
|
||||
* GTM `dataLayer` event is emitted on submit with ZERO per-form code. Wire it
|
||||
* once in the shared form renderer — every form then gets its tracking from the
|
||||
* panel:
|
||||
*
|
||||
* const f = useContactForm({
|
||||
* submitAction,
|
||||
* onSuccess: formAnalyticsOnSuccess(form.analytics),
|
||||
* })
|
||||
*
|
||||
* A param value starting with `$` is resolved from the submitted values, so an
|
||||
* editor can set `form_name = $topic` and get the chosen topic with no code.
|
||||
* No event name configured → the returned handler is a no-op.
|
||||
*/
|
||||
export declare function formAnalyticsOnSuccess<T extends Record<string, unknown>>(config: FormAnalyticsConfig): (result: {
|
||||
success: boolean;
|
||||
}, values: T) => void;
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
import { pushDataLayer } from '../analytics/pushDataLayer.js';
|
||||
/**
|
||||
* Builds an `onSuccess` handler from a form's panel-configured analytics, so the
|
||||
* GTM `dataLayer` event is emitted on submit with ZERO per-form code. Wire it
|
||||
* once in the shared form renderer — every form then gets its tracking from the
|
||||
* panel:
|
||||
*
|
||||
* const f = useContactForm({
|
||||
* submitAction,
|
||||
* onSuccess: formAnalyticsOnSuccess(form.analytics),
|
||||
* })
|
||||
*
|
||||
* A param value starting with `$` is resolved from the submitted values, so an
|
||||
* editor can set `form_name = $topic` and get the chosen topic with no code.
|
||||
* No event name configured → the returned handler is a no-op.
|
||||
*/ export function formAnalyticsOnSuccess(config) {
|
||||
return (_result, values)=>{
|
||||
const event = config?.event?.trim();
|
||||
if (!event) {
|
||||
return;
|
||||
}
|
||||
const params = {};
|
||||
for (const p of config?.params ?? []){
|
||||
const key = p?.key?.trim();
|
||||
if (!key) {
|
||||
continue;
|
||||
}
|
||||
const raw = typeof p?.value === 'string' ? p.value : '';
|
||||
params[key] = raw.startsWith('$') ? values[raw.slice(1)] ?? '' : raw;
|
||||
}
|
||||
pushDataLayer(event, params);
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=formAnalytics.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/forms/formAnalytics.ts"],"sourcesContent":["import { pushDataLayer } from '../analytics/pushDataLayer.js'\n\n/**\n * Shape of the per-form analytics config an editor fills in the panel (see\n * buildFormAnalyticsFields). Loose by design — it comes from Payload.\n */\nexport type FormAnalyticsConfig =\n | {\n event?: null | string\n params?: { key?: null | string; value?: null | string }[] | null\n }\n | null\n | undefined\n\n/**\n * Builds an `onSuccess` handler from a form's panel-configured analytics, so the\n * GTM `dataLayer` event is emitted on submit with ZERO per-form code. Wire it\n * once in the shared form renderer — every form then gets its tracking from the\n * panel:\n *\n * const f = useContactForm({\n * submitAction,\n * onSuccess: formAnalyticsOnSuccess(form.analytics),\n * })\n *\n * A param value starting with `$` is resolved from the submitted values, so an\n * editor can set `form_name = $topic` and get the chosen topic with no code.\n * No event name configured → the returned handler is a no-op.\n */\nexport function formAnalyticsOnSuccess<T extends Record<string, unknown>>(\n config: FormAnalyticsConfig,\n): (result: { success: boolean }, values: T) => void {\n return (_result, values) => {\n const event = config?.event?.trim()\n if (!event) {return}\n const params: Record<string, unknown> = {}\n for (const p of config?.params ?? []) {\n const key = p?.key?.trim()\n if (!key) {continue}\n const raw = typeof p?.value === 'string' ? p.value : ''\n params[key] = raw.startsWith('$') ? (values[raw.slice(1)] ?? '') : raw\n }\n pushDataLayer(event, params)\n }\n}\n"],"names":["pushDataLayer","formAnalyticsOnSuccess","config","_result","values","event","trim","params","p","key","raw","value","startsWith","slice"],"mappings":"AAAA,SAASA,aAAa,QAAQ,gCAA+B;AAc7D;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,uBACdC,MAA2B;IAE3B,OAAO,CAACC,SAASC;QACf,MAAMC,QAAQH,QAAQG,OAAOC;QAC7B,IAAI,CAACD,OAAO;YAAC;QAAM;QACnB,MAAME,SAAkC,CAAC;QACzC,KAAK,MAAMC,KAAKN,QAAQK,UAAU,EAAE,CAAE;YACpC,MAAME,MAAMD,GAAGC,KAAKH;YACpB,IAAI,CAACG,KAAK;gBAAC;YAAQ;YACnB,MAAMC,MAAM,OAAOF,GAAGG,UAAU,WAAWH,EAAEG,KAAK,GAAG;YACrDJ,MAAM,CAACE,IAAI,GAAGC,IAAIE,UAAU,CAAC,OAAQR,MAAM,CAACM,IAAIG,KAAK,CAAC,GAAG,IAAI,KAAMH;QACrE;QACAV,cAAcK,OAAOE;IACvB;AACF"}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import type { Field } from 'payload';
|
||||
/**
|
||||
* Panel fields that let an EDITOR configure a form's analytics event — the GTM
|
||||
* `dataLayer` push fired on successful submit — without any code change. Add
|
||||
* them to the Forms collection via the plugin's `formOverrides`:
|
||||
*
|
||||
* ipalKit({
|
||||
* forms: {
|
||||
* formOverrides: {
|
||||
* fields: ({ defaultFields }) => [...defaultFields, ...buildFormAnalyticsFields()],
|
||||
* },
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* The front reads this config and emits the event automatically via
|
||||
* `formAnalyticsOnSuccess` (see forms.md) — so adding a tracked form, or
|
||||
* changing its event name/params, is panel-only. The GTM side (the Lead/Pixel
|
||||
* tag, its trigger and consent gate) stays in GTM, which is itself a no-code
|
||||
* panel for tags.
|
||||
*/
|
||||
export declare function buildFormAnalyticsFields(): Field[];
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* Panel fields that let an EDITOR configure a form's analytics event — the GTM
|
||||
* `dataLayer` push fired on successful submit — without any code change. Add
|
||||
* them to the Forms collection via the plugin's `formOverrides`:
|
||||
*
|
||||
* ipalKit({
|
||||
* forms: {
|
||||
* formOverrides: {
|
||||
* fields: ({ defaultFields }) => [...defaultFields, ...buildFormAnalyticsFields()],
|
||||
* },
|
||||
* },
|
||||
* })
|
||||
*
|
||||
* The front reads this config and emits the event automatically via
|
||||
* `formAnalyticsOnSuccess` (see forms.md) — so adding a tracked form, or
|
||||
* changing its event name/params, is panel-only. The GTM side (the Lead/Pixel
|
||||
* tag, its trigger and consent gate) stays in GTM, which is itself a no-code
|
||||
* panel for tags.
|
||||
*/ export function buildFormAnalyticsFields() {
|
||||
return [
|
||||
{
|
||||
name: 'analytics',
|
||||
type: 'group',
|
||||
admin: {
|
||||
description: 'Event pushed to the dataLayer on a successful submit. In GTM, attach a tag (e.g. Lead) with a trigger on this event name.'
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'event',
|
||||
type: 'text',
|
||||
admin: {
|
||||
description: 'Empty = nothing is pushed. Default "form_submit" — attach your GTM trigger to it.'
|
||||
},
|
||||
defaultValue: 'form_submit',
|
||||
label: 'Event name'
|
||||
},
|
||||
{
|
||||
name: 'params',
|
||||
type: 'array',
|
||||
admin: {
|
||||
description: 'Key/value pairs sent with the event. A value starting with "$" is taken from a form field, e.g. $topic → the chosen topic.'
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'key',
|
||||
type: 'text',
|
||||
required: true
|
||||
},
|
||||
{
|
||||
name: 'value',
|
||||
type: 'text',
|
||||
required: true
|
||||
}
|
||||
],
|
||||
label: 'Event parameters'
|
||||
}
|
||||
],
|
||||
label: 'Analytics (GTM / dataLayer)'
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
//# sourceMappingURL=formAnalyticsFields.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/forms/formAnalyticsFields.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Panel fields that let an EDITOR configure a form's analytics event — the GTM\n * `dataLayer` push fired on successful submit — without any code change. Add\n * them to the Forms collection via the plugin's `formOverrides`:\n *\n * ipalKit({\n * forms: {\n * formOverrides: {\n * fields: ({ defaultFields }) => [...defaultFields, ...buildFormAnalyticsFields()],\n * },\n * },\n * })\n *\n * The front reads this config and emits the event automatically via\n * `formAnalyticsOnSuccess` (see forms.md) — so adding a tracked form, or\n * changing its event name/params, is panel-only. The GTM side (the Lead/Pixel\n * tag, its trigger and consent gate) stays in GTM, which is itself a no-code\n * panel for tags.\n */\nexport function buildFormAnalyticsFields(): Field[] {\n return [\n {\n name: 'analytics',\n type: 'group',\n admin: {\n description:\n 'Event pushed to the dataLayer on a successful submit. In GTM, attach a tag (e.g. Lead) with a trigger on this event name.',\n },\n fields: [\n {\n name: 'event',\n type: 'text',\n admin: {\n description:\n 'Empty = nothing is pushed. Default \"form_submit\" — attach your GTM trigger to it.',\n },\n defaultValue: 'form_submit',\n label: 'Event name',\n },\n {\n name: 'params',\n type: 'array',\n admin: {\n description:\n 'Key/value pairs sent with the event. A value starting with \"$\" is taken from a form field, e.g. $topic → the chosen topic.',\n },\n fields: [\n { name: 'key', type: 'text', required: true },\n { name: 'value', type: 'text', required: true },\n ],\n label: 'Event parameters',\n },\n ],\n label: 'Analytics (GTM / dataLayer)',\n },\n ]\n}\n"],"names":["buildFormAnalyticsFields","name","type","admin","description","fields","defaultValue","label","required"],"mappings":"AAEA;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,SAASA;IACd,OAAO;QACL;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,aACE;YACJ;YACAC,QAAQ;gBACN;oBACEJ,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLC,aACE;oBACJ;oBACAE,cAAc;oBACdC,OAAO;gBACT;gBACA;oBACEN,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACLC,aACE;oBACJ;oBACAC,QAAQ;wBACN;4BAAEJ,MAAM;4BAAOC,MAAM;4BAAQM,UAAU;wBAAK;wBAC5C;4BAAEP,MAAM;4BAASC,MAAM;4BAAQM,UAAU;wBAAK;qBAC/C;oBACDD,OAAO;gBACT;aACD;YACDA,OAAO;QACT;KACD;AACH"}
|
||||
Vendored
+3
@@ -1,3 +1,6 @@
|
||||
export { formAnalyticsOnSuccess } from './formAnalytics.js';
|
||||
export type { FormAnalyticsConfig } from './formAnalytics.js';
|
||||
export { buildFormAnalyticsFields } from './formAnalyticsFields.js';
|
||||
export { buildFormsPlugin } from './formsPluginConfig.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './honeypot.js';
|
||||
export { checkRateLimit } from './rateLimit.js';
|
||||
|
||||
Vendored
+3
@@ -1,3 +1,6 @@
|
||||
export { formAnalyticsOnSuccess } from './formAnalytics.js';
|
||||
// Panel-managed form analytics: fields (config-time) + onSuccess helper (client).
|
||||
export { buildFormAnalyticsFields } from './formAnalyticsFields.js';
|
||||
// buildFormsPlugin is config-time (safe anywhere). submitForm is server-only
|
||||
// (Turnstile secret) — never import it from a client component.
|
||||
export { buildFormsPlugin } from './formsPluginConfig.js';
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/forms/index.ts"],"sourcesContent":["// buildFormsPlugin is config-time (safe anywhere). submitForm is server-only\n// (Turnstile secret) — never import it from a client component.\nexport { buildFormsPlugin } from './formsPluginConfig.js'\n// Honeypot anti-spam (pure — client renders the input, server checks it).\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './honeypot.js'\nexport { checkRateLimit } from './rateLimit.js'\nexport type { RateLimitArgs } from './rateLimit.js'\nexport { submitForm } from './submitForm.js'\nexport type { SubmitFormArgs, SubmitFormResult } from './submitForm.js'\nexport type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption } from './types.js'\nexport { useContactForm } from './useContactForm.js'\nexport type { ContactFormErrors, ContactFormValues, SubmitAction } from './useContactForm.js'\n// Generic form engine (any field set) + the standard contact-form preset.\nexport { useForm } from './useForm.js'\nexport type { FormErrors, FormSubmitAction, Validator } from './useForm.js'\nexport { validateSubmission } from './validateSubmission.js'\nexport type { FormValidationResult } from './validateSubmission.js'\n// Composable validation rules (pure — safe on server or client).\nexport {\n buildValidator,\n checked,\n custom,\n email,\n isEmail,\n maxLength,\n minLength,\n pattern,\n required,\n} from './validators.js'\nexport type { Rule } from './validators.js'\n"],"names":["buildFormsPlugin","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","checkRateLimit","submitForm","useContactForm","useForm","validateSubmission","buildValidator","checked","custom","email","isEmail","maxLength","minLength","pattern","required"],"mappings":"AAAA,6EAA6E;AAC7E,gEAAgE;AAChE,SAASA,gBAAgB,QAAQ,yBAAwB;AACzD,0EAA0E;AAC1E,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,gBAAe;AACrF,SAASC,cAAc,QAAQ,iBAAgB;AAE/C,SAASC,UAAU,QAAQ,kBAAiB;AAG5C,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,0EAA0E;AAC1E,SAASC,OAAO,QAAQ,eAAc;AAEtC,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,iEAAiE;AACjE,SACEC,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,kBAAiB"}
|
||||
{"version":3,"sources":["../../../src/modules/forms/index.ts"],"sourcesContent":["export { formAnalyticsOnSuccess } from './formAnalytics.js'\nexport type { FormAnalyticsConfig } from './formAnalytics.js'\n// Panel-managed form analytics: fields (config-time) + onSuccess helper (client).\nexport { buildFormAnalyticsFields } from './formAnalyticsFields.js'\n// buildFormsPlugin is config-time (safe anywhere). submitForm is server-only\n// (Turnstile secret) — never import it from a client component.\nexport { buildFormsPlugin } from './formsPluginConfig.js'\n// Honeypot anti-spam (pure — client renders the input, server checks it).\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './honeypot.js'\nexport { checkRateLimit } from './rateLimit.js'\nexport type { RateLimitArgs } from './rateLimit.js'\nexport { submitForm } from './submitForm.js'\nexport type { SubmitFormArgs, SubmitFormResult } from './submitForm.js'\nexport type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption } from './types.js'\nexport { useContactForm } from './useContactForm.js'\nexport type { ContactFormErrors, ContactFormValues, SubmitAction } from './useContactForm.js'\n// Generic form engine (any field set) + the standard contact-form preset.\nexport { useForm } from './useForm.js'\nexport type { FormErrors, FormSubmitAction, Validator } from './useForm.js'\nexport { validateSubmission } from './validateSubmission.js'\nexport type { FormValidationResult } from './validateSubmission.js'\n// Composable validation rules (pure — safe on server or client).\nexport {\n buildValidator,\n checked,\n custom,\n email,\n isEmail,\n maxLength,\n minLength,\n pattern,\n required,\n} from './validators.js'\nexport type { Rule } from './validators.js'\n"],"names":["formAnalyticsOnSuccess","buildFormAnalyticsFields","buildFormsPlugin","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","checkRateLimit","submitForm","useContactForm","useForm","validateSubmission","buildValidator","checked","custom","email","isEmail","maxLength","minLength","pattern","required"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,qBAAoB;AAE3D,kFAAkF;AAClF,SAASC,wBAAwB,QAAQ,2BAA0B;AACnE,6EAA6E;AAC7E,gEAAgE;AAChE,SAASC,gBAAgB,QAAQ,yBAAwB;AACzD,0EAA0E;AAC1E,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,gBAAe;AACrF,SAASC,cAAc,QAAQ,iBAAgB;AAE/C,SAASC,UAAU,QAAQ,kBAAiB;AAG5C,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,0EAA0E;AAC1E,SAASC,OAAO,QAAQ,eAAc;AAEtC,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,iEAAiE;AACjE,SACEC,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,kBAAiB"}
|
||||
+17
-9
@@ -22,6 +22,14 @@ type UseContactFormOptions = {
|
||||
messages?: Partial<Record<keyof ContactFormValues, string>>;
|
||||
/** Minimum message length. Default 10. */
|
||||
minMessageLength?: number;
|
||||
/**
|
||||
* Called once after a successful submit — e.g. to fire a GTM `form_submit`
|
||||
* event: `onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic })`.
|
||||
*/
|
||||
onSuccess?: (result: {
|
||||
message?: string;
|
||||
success: boolean;
|
||||
}, values: ContactFormValues) => void;
|
||||
/** Whether consent is required (project passes true when consentText shown). */
|
||||
requireConsent?: boolean;
|
||||
/** Whether a topic must be chosen (project passes this when topics exist). */
|
||||
@@ -42,19 +50,19 @@ type UseContactFormOptions = {
|
||||
* Need custom or dynamic fields? Drop the preset and call `useForm` + validators.
|
||||
*/
|
||||
export declare function useContactForm(options: UseContactFormOptions): {
|
||||
values: ContactFormValues;
|
||||
errors: Partial<Record<keyof ContactFormValues, string>>;
|
||||
isSubmitting: boolean;
|
||||
isSuccess: boolean;
|
||||
errorMessage: string | null;
|
||||
turnstileToken: string | null;
|
||||
setField: <K extends keyof ContactFormValues>(key: K, value: ContactFormValues[K]) => void;
|
||||
setValues: import("react").Dispatch<import("react").SetStateAction<ContactFormValues>>;
|
||||
setErrors: import("react").Dispatch<import("react").SetStateAction<Partial<Record<keyof ContactFormValues, string>>>>;
|
||||
setTurnstileToken: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
||||
errors: Partial<Record<keyof ContactFormValues, string>>;
|
||||
handleSubmit: (e?: {
|
||||
preventDefault?: (() => void) | undefined;
|
||||
} | undefined) => Promise<void>;
|
||||
isSubmitting: boolean;
|
||||
isSuccess: boolean;
|
||||
reset: () => void;
|
||||
setErrors: import("react").Dispatch<import("react").SetStateAction<Partial<Record<keyof ContactFormValues, string>>>>;
|
||||
setField: <K extends keyof ContactFormValues>(key: K, value: ContactFormValues[K]) => void;
|
||||
setTurnstileToken: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
||||
setValues: import("react").Dispatch<import("react").SetStateAction<ContactFormValues>>;
|
||||
turnstileToken: string | null;
|
||||
values: ContactFormValues;
|
||||
};
|
||||
export {};
|
||||
|
||||
Vendored
+2
-1
@@ -13,7 +13,7 @@ import { buildValidator, checked, email, minLength, required } from './validator
|
||||
*
|
||||
* Need custom or dynamic fields? Drop the preset and call `useForm` + validators.
|
||||
*/ export function useContactForm(options) {
|
||||
const { errorFallback, initialTopic = '', messages, minMessageLength = 10, requireConsent = false, requireTopic = false, requireTurnstile = false, submitAction } = options;
|
||||
const { errorFallback, initialTopic = '', messages, minMessageLength = 10, onSuccess, requireConsent = false, requireTopic = false, requireTurnstile = false, submitAction } = options;
|
||||
const validate = useMemo(()=>buildValidator({
|
||||
name: [
|
||||
required(messages?.name)
|
||||
@@ -52,6 +52,7 @@ import { buildValidator, checked, email, minLength, required } from './validator
|
||||
phone: '',
|
||||
topic: initialTopic
|
||||
},
|
||||
onSuccess,
|
||||
requireTurnstile,
|
||||
submitAction,
|
||||
validate
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/forms/useContactForm.ts"],"sourcesContent":["'use client'\n\nimport { useMemo } from 'react'\n\nimport { type FormSubmitAction, useForm } from './useForm.js'\nimport { buildValidator, checked, email, minLength, required } from './validators.js'\n\n/**\n * Field values of the STANDARD contact form. This is a preset shape — projects\n * that need a different field set (or dynamic builder fields) should use\n * `useForm` directly instead, where the shape is fully open.\n */\nexport type ContactFormValues = {\n consent: boolean\n email: string\n message: string\n name: string\n phone: string\n topic: string\n}\n\nexport type ContactFormErrors = Partial<Record<keyof ContactFormValues, string>>\nexport type SubmitAction = FormSubmitAction<ContactFormValues>\n\ntype UseContactFormOptions = {\n /** Generic error message shown when the action fails/throws. */\n errorFallback?: string\n initialTopic?: string\n /** Override the per-field error message (shown via `errors.<field>`). */\n messages?: Partial<Record<keyof ContactFormValues, string>>\n /** Minimum message length. Default 10. */\n minMessageLength?: number\n /** Whether consent is required (project passes true when consentText shown). */\n requireConsent?: boolean\n /** Whether a topic must be chosen (project passes this when topics exist). */\n requireTopic?: boolean\n /** Require a Turnstile token before submit (when the widget is shown). */\n requireTurnstile?: boolean\n submitAction: SubmitAction\n}\n\n/**\n * Zero-config preset over `useForm` for the everyday contact form: standard\n * fields (name/email/phone/topic/message/consent) and standard rules, wired\n * for you. Markup and styling stay 100% in the project — this only removes the\n * duplicated logic.\n *\n * const f = useContactForm({ submitAction, requireTurnstile: Boolean(siteKey),\n * requireTopic: topics.length > 0, requireConsent: Boolean(consentText) })\n *\n * Need custom or dynamic fields? Drop the preset and call `useForm` + validators.\n */\nexport function useContactForm(options: UseContactFormOptions) {\n const {\n errorFallback,\n initialTopic = '',\n messages,\n minMessageLength = 10,\n requireConsent = false,\n requireTopic = false,\n requireTurnstile = false,\n submitAction,\n } = options\n\n const validate = useMemo(\n () =>\n buildValidator<ContactFormValues>({\n name: [required(messages?.name)],\n email: [required(messages?.email), email(messages?.email)],\n ...(requireTopic ? { topic: [required(messages?.topic)] } : {}),\n message: [required(messages?.message), minLength(minMessageLength, messages?.message)],\n ...(requireConsent ? { consent: [checked(messages?.consent)] } : {}),\n }),\n [requireTopic, requireConsent, minMessageLength, messages],\n )\n\n return useForm<ContactFormValues>({\n errorFallback,\n initialValues: {\n name: '',\n consent: false,\n email: '',\n message: '',\n phone: '',\n topic: initialTopic,\n },\n requireTurnstile,\n submitAction,\n validate,\n })\n}\n"],"names":["useMemo","useForm","buildValidator","checked","email","minLength","required","useContactForm","options","errorFallback","initialTopic","messages","minMessageLength","requireConsent","requireTopic","requireTurnstile","submitAction","validate","name","topic","message","consent","initialValues","phone"],"mappings":"AAAA;AAEA,SAASA,OAAO,QAAQ,QAAO;AAE/B,SAAgCC,OAAO,QAAQ,eAAc;AAC7D,SAASC,cAAc,EAAEC,OAAO,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,kBAAiB;AAoCrF;;;;;;;;;;CAUC,GACD,OAAO,SAASC,eAAeC,OAA8B;IAC3D,MAAM,EACJC,aAAa,EACbC,eAAe,EAAE,EACjBC,QAAQ,EACRC,mBAAmB,EAAE,EACrBC,iBAAiB,KAAK,EACtBC,eAAe,KAAK,EACpBC,mBAAmB,KAAK,EACxBC,YAAY,EACb,GAAGR;IAEJ,MAAMS,WAAWjB,QACf,IACEE,eAAkC;YAChCgB,MAAM;gBAACZ,SAASK,UAAUO;aAAM;YAChCd,OAAO;gBAACE,SAASK,UAAUP;gBAAQA,MAAMO,UAAUP;aAAO;YAC1D,GAAIU,eAAe;gBAAEK,OAAO;oBAACb,SAASK,UAAUQ;iBAAO;YAAC,IAAI,CAAC,CAAC;YAC9DC,SAAS;gBAACd,SAASK,UAAUS;gBAAUf,UAAUO,kBAAkBD,UAAUS;aAAS;YACtF,GAAIP,iBAAiB;gBAAEQ,SAAS;oBAAClB,QAAQQ,UAAUU;iBAAS;YAAC,IAAI,CAAC,CAAC;QACrE,IACF;QAACP;QAAcD;QAAgBD;QAAkBD;KAAS;IAG5D,OAAOV,QAA2B;QAChCQ;QACAa,eAAe;YACbJ,MAAM;YACNG,SAAS;YACTjB,OAAO;YACPgB,SAAS;YACTG,OAAO;YACPJ,OAAOT;QACT;QACAK;QACAC;QACAC;IACF;AACF"}
|
||||
{"version":3,"sources":["../../../src/modules/forms/useContactForm.ts"],"sourcesContent":["'use client'\n\nimport { useMemo } from 'react'\n\nimport { type FormSubmitAction, useForm } from './useForm.js'\nimport { buildValidator, checked, email, minLength, required } from './validators.js'\n\n/**\n * Field values of the STANDARD contact form. This is a preset shape — projects\n * that need a different field set (or dynamic builder fields) should use\n * `useForm` directly instead, where the shape is fully open.\n */\nexport type ContactFormValues = {\n consent: boolean\n email: string\n message: string\n name: string\n phone: string\n topic: string\n}\n\nexport type ContactFormErrors = Partial<Record<keyof ContactFormValues, string>>\nexport type SubmitAction = FormSubmitAction<ContactFormValues>\n\ntype UseContactFormOptions = {\n /** Generic error message shown when the action fails/throws. */\n errorFallback?: string\n initialTopic?: string\n /** Override the per-field error message (shown via `errors.<field>`). */\n messages?: Partial<Record<keyof ContactFormValues, string>>\n /** Minimum message length. Default 10. */\n minMessageLength?: number\n /**\n * Called once after a successful submit — e.g. to fire a GTM `form_submit`\n * event: `onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic })`.\n */\n onSuccess?: (result: { message?: string; success: boolean }, values: ContactFormValues) => void\n /** Whether consent is required (project passes true when consentText shown). */\n requireConsent?: boolean\n /** Whether a topic must be chosen (project passes this when topics exist). */\n requireTopic?: boolean\n /** Require a Turnstile token before submit (when the widget is shown). */\n requireTurnstile?: boolean\n submitAction: SubmitAction\n}\n\n/**\n * Zero-config preset over `useForm` for the everyday contact form: standard\n * fields (name/email/phone/topic/message/consent) and standard rules, wired\n * for you. Markup and styling stay 100% in the project — this only removes the\n * duplicated logic.\n *\n * const f = useContactForm({ submitAction, requireTurnstile: Boolean(siteKey),\n * requireTopic: topics.length > 0, requireConsent: Boolean(consentText) })\n *\n * Need custom or dynamic fields? Drop the preset and call `useForm` + validators.\n */\nexport function useContactForm(options: UseContactFormOptions) {\n const {\n errorFallback,\n initialTopic = '',\n messages,\n minMessageLength = 10,\n onSuccess,\n requireConsent = false,\n requireTopic = false,\n requireTurnstile = false,\n submitAction,\n } = options\n\n const validate = useMemo(\n () =>\n buildValidator<ContactFormValues>({\n name: [required(messages?.name)],\n email: [required(messages?.email), email(messages?.email)],\n ...(requireTopic ? { topic: [required(messages?.topic)] } : {}),\n message: [required(messages?.message), minLength(minMessageLength, messages?.message)],\n ...(requireConsent ? { consent: [checked(messages?.consent)] } : {}),\n }),\n [requireTopic, requireConsent, minMessageLength, messages],\n )\n\n return useForm<ContactFormValues>({\n errorFallback,\n initialValues: {\n name: '',\n consent: false,\n email: '',\n message: '',\n phone: '',\n topic: initialTopic,\n },\n onSuccess,\n requireTurnstile,\n submitAction,\n validate,\n })\n}\n"],"names":["useMemo","useForm","buildValidator","checked","email","minLength","required","useContactForm","options","errorFallback","initialTopic","messages","minMessageLength","onSuccess","requireConsent","requireTopic","requireTurnstile","submitAction","validate","name","topic","message","consent","initialValues","phone"],"mappings":"AAAA;AAEA,SAASA,OAAO,QAAQ,QAAO;AAE/B,SAAgCC,OAAO,QAAQ,eAAc;AAC7D,SAASC,cAAc,EAAEC,OAAO,EAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,kBAAiB;AAyCrF;;;;;;;;;;CAUC,GACD,OAAO,SAASC,eAAeC,OAA8B;IAC3D,MAAM,EACJC,aAAa,EACbC,eAAe,EAAE,EACjBC,QAAQ,EACRC,mBAAmB,EAAE,EACrBC,SAAS,EACTC,iBAAiB,KAAK,EACtBC,eAAe,KAAK,EACpBC,mBAAmB,KAAK,EACxBC,YAAY,EACb,GAAGT;IAEJ,MAAMU,WAAWlB,QACf,IACEE,eAAkC;YAChCiB,MAAM;gBAACb,SAASK,UAAUQ;aAAM;YAChCf,OAAO;gBAACE,SAASK,UAAUP;gBAAQA,MAAMO,UAAUP;aAAO;YAC1D,GAAIW,eAAe;gBAAEK,OAAO;oBAACd,SAASK,UAAUS;iBAAO;YAAC,IAAI,CAAC,CAAC;YAC9DC,SAAS;gBAACf,SAASK,UAAUU;gBAAUhB,UAAUO,kBAAkBD,UAAUU;aAAS;YACtF,GAAIP,iBAAiB;gBAAEQ,SAAS;oBAACnB,QAAQQ,UAAUW;iBAAS;YAAC,IAAI,CAAC,CAAC;QACrE,IACF;QAACP;QAAcD;QAAgBF;QAAkBD;KAAS;IAG5D,OAAOV,QAA2B;QAChCQ;QACAc,eAAe;YACbJ,MAAM;YACNG,SAAS;YACTlB,OAAO;YACPiB,SAAS;YACTG,OAAO;YACPJ,OAAOV;QACT;QACAG;QACAG;QACAC;QACAC;IACF;AACF"}
|
||||
Vendored
+30
-16
@@ -11,23 +11,37 @@ export type FormErrors<T> = Partial<Record<keyof T, string>>;
|
||||
* plus an optional `message`; richer shapes (SubmitFormResult) satisfy it.
|
||||
*/
|
||||
export type FormSubmitAction<T> = (values: T, turnstileToken?: string) => Promise<{
|
||||
success: boolean;
|
||||
message?: string;
|
||||
success: boolean;
|
||||
}>;
|
||||
/** Turns the current values into an error map. Empty map = valid. */
|
||||
export type Validator<T> = (values: T) => FormErrors<T>;
|
||||
type UseFormOptions<T extends Record<string, unknown>> = {
|
||||
/** Clear a field's error as soon as the user edits it. Default true. */
|
||||
clearErrorOnChange?: boolean;
|
||||
/** Generic error message shown when the action fails/throws with no message. */
|
||||
errorFallback?: string;
|
||||
/** Defines the field set AND the reset state. Any shape you like. */
|
||||
initialValues: T;
|
||||
/**
|
||||
* Called once after a SUCCESSFUL submit, with the submitted values and the
|
||||
* action's result. The place to fire analytics — e.g. a GTM `form_submit`
|
||||
* event so a Meta Pixel / GA "Lead" tag can trigger:
|
||||
*
|
||||
* onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic || 'kontakt' })
|
||||
*
|
||||
* Runs client-side after the server action resolves; errors thrown here are
|
||||
* swallowed so a broken analytics call can't blank out a successful submit.
|
||||
*/
|
||||
onSuccess?: (result: {
|
||||
message?: string;
|
||||
success: boolean;
|
||||
}, values: T) => void;
|
||||
/** Require a Turnstile token before submit (when the widget is shown). */
|
||||
requireTurnstile?: boolean;
|
||||
submitAction: FormSubmitAction<T>;
|
||||
/** Project-owned validation. Compose one with `buildValidator` + rules, or write your own. */
|
||||
validate?: Validator<T>;
|
||||
/** Require a Turnstile token before submit (when the widget is shown). */
|
||||
requireTurnstile?: boolean;
|
||||
/** Generic error message shown when the action fails/throws with no message. */
|
||||
errorFallback?: string;
|
||||
/** Clear a field's error as soon as the user edits it. Default true. */
|
||||
clearErrorOnChange?: boolean;
|
||||
};
|
||||
/**
|
||||
* Fully generic form engine: state, validation, Turnstile token, submit,
|
||||
@@ -52,19 +66,19 @@ type UseFormOptions<T extends Record<string, unknown>> = {
|
||||
* <form onSubmit={f.handleSubmit}>…</form>
|
||||
*/
|
||||
export declare function useForm<T extends Record<string, unknown>>(options: UseFormOptions<T>): {
|
||||
values: T;
|
||||
errors: Partial<Record<keyof T, string>>;
|
||||
isSubmitting: boolean;
|
||||
isSuccess: boolean;
|
||||
errorMessage: string | null;
|
||||
turnstileToken: string | null;
|
||||
setField: <K extends keyof T>(key: K, value: T[K]) => void;
|
||||
setValues: import("react").Dispatch<import("react").SetStateAction<T>>;
|
||||
setErrors: import("react").Dispatch<import("react").SetStateAction<Partial<Record<keyof T, string>>>>;
|
||||
setTurnstileToken: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
||||
errors: Partial<Record<keyof T, string>>;
|
||||
handleSubmit: (e?: {
|
||||
preventDefault?: () => void;
|
||||
}) => Promise<void>;
|
||||
isSubmitting: boolean;
|
||||
isSuccess: boolean;
|
||||
reset: () => void;
|
||||
setErrors: import("react").Dispatch<import("react").SetStateAction<Partial<Record<keyof T, string>>>>;
|
||||
setField: <K extends keyof T>(key: K, value: T[K]) => void;
|
||||
setTurnstileToken: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
||||
setValues: import("react").Dispatch<import("react").SetStateAction<T>>;
|
||||
turnstileToken: string | null;
|
||||
values: T;
|
||||
};
|
||||
export {};
|
||||
|
||||
Vendored
+22
-11
@@ -1,5 +1,5 @@
|
||||
'use client';
|
||||
import { useState, useCallback, useRef, useMemo } from 'react';
|
||||
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||
/**
|
||||
* Fully generic form engine: state, validation, Turnstile token, submit,
|
||||
* success/error — WITHOUT any markup. The project owns 100% of the look AND
|
||||
@@ -22,7 +22,7 @@ import { useState, useCallback, useRef, useMemo } from 'react';
|
||||
* className={f.errors.email ? 'border-red-500' : '…'} />
|
||||
* <form onSubmit={f.handleSubmit}>…</form>
|
||||
*/ export function useForm(options) {
|
||||
const { initialValues, submitAction, validate, requireTurnstile = false, errorFallback = 'Something went wrong. Please try again.', clearErrorOnChange = true } = options;
|
||||
const { clearErrorOnChange = true, errorFallback = 'Something went wrong. Please try again.', initialValues, requireTurnstile = false, submitAction, validate } = options;
|
||||
// Freeze the initial snapshot so `reset` is stable even though callers pass a
|
||||
// fresh object literal every render.
|
||||
const initialRef = useRef(initialValues);
|
||||
@@ -39,7 +39,9 @@ import { useState, useCallback, useRef, useMemo } from 'react';
|
||||
}));
|
||||
if (clearErrorOnChange) {
|
||||
setErrors((prev)=>{
|
||||
if (!prev[key]) return prev;
|
||||
if (!prev[key]) {
|
||||
return prev;
|
||||
}
|
||||
const next = {
|
||||
...prev
|
||||
};
|
||||
@@ -56,12 +58,16 @@ import { useState, useCallback, useRef, useMemo } from 'react';
|
||||
valuesRef.current = values;
|
||||
const validateRef = useRef(validate);
|
||||
validateRef.current = validate;
|
||||
const onSuccessRef = useRef(options.onSuccess);
|
||||
onSuccessRef.current = options.onSuccess;
|
||||
const handleSubmit = useCallback(async (e)=>{
|
||||
e?.preventDefault?.();
|
||||
setErrorMessage(null);
|
||||
const errs = validateRef.current ? validateRef.current(valuesRef.current) : {};
|
||||
setErrors(errs);
|
||||
if (Object.keys(errs).length > 0) return;
|
||||
if (Object.keys(errs).length > 0) {
|
||||
return;
|
||||
}
|
||||
if (requireTurnstile && !turnstileToken) {
|
||||
setErrorMessage(errorFallback);
|
||||
return;
|
||||
@@ -72,6 +78,11 @@ import { useState, useCallback, useRef, useMemo } from 'react';
|
||||
if (result.success) {
|
||||
setIsSuccess(true);
|
||||
setTurnstileToken(null);
|
||||
// Fire analytics (e.g. GTM form_submit) — never let it break the submit.
|
||||
try {
|
||||
onSuccessRef.current?.(result, valuesRef.current);
|
||||
} catch {
|
||||
/* analytics must not affect the form outcome */ }
|
||||
} else {
|
||||
setErrorMessage(result.message || errorFallback);
|
||||
}
|
||||
@@ -94,18 +105,18 @@ import { useState, useCallback, useRef, useMemo } from 'react';
|
||||
setTurnstileToken(null);
|
||||
}, []);
|
||||
return useMemo(()=>({
|
||||
values,
|
||||
errorMessage,
|
||||
errors,
|
||||
handleSubmit,
|
||||
isSubmitting,
|
||||
isSuccess,
|
||||
errorMessage,
|
||||
turnstileToken,
|
||||
setField,
|
||||
setValues,
|
||||
reset,
|
||||
setErrors,
|
||||
setField,
|
||||
setTurnstileToken,
|
||||
handleSubmit,
|
||||
reset
|
||||
setValues,
|
||||
turnstileToken,
|
||||
values
|
||||
}), [
|
||||
values,
|
||||
errors,
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -62,6 +62,7 @@ export declare function createContentHelpers({ baseUrl, config, content, i18n, p
|
||||
getCachedPayload: () => Promise<BasePayload>;
|
||||
getConfiguredLocales: () => Promise<string[]>;
|
||||
getEntries: (collection: string, locale: string, page: number, perPage: number) => Promise<ArchiveEntries>;
|
||||
getNotFoundPage: (locale: string) => Promise<Record<string, unknown> | null>;
|
||||
getSettings: (locale: string) => Promise<import("payload").JsonObject>;
|
||||
resolveRoute: (locale: string, segments: string[] | undefined, page: number) => Promise<null | ResolvedRoute>;
|
||||
robots: () => RobotsRules;
|
||||
|
||||
+25
-1
@@ -1,6 +1,6 @@
|
||||
import { getPayload } from 'payload';
|
||||
import { cache } from 'react';
|
||||
import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js';
|
||||
import { getArchiveEntries, resolveNotFoundPage, resolveRoute as resolveRouteRaw } from '../content/index.js';
|
||||
import { buildRobots, buildSitemapEntries } from '../seo/index.js';
|
||||
/**
|
||||
* Bundles the per-request data helpers a frontend needs — the same cached
|
||||
@@ -56,6 +56,24 @@ import { buildRobots, buildSitemapEntries } from '../seo/index.js';
|
||||
settingsSlug
|
||||
});
|
||||
});
|
||||
/**
|
||||
* The page assigned as 404 in System Pages (or null → built-in fallback).
|
||||
* For app/not-found.tsx; never throws. Locale comes from the x-locale header
|
||||
* set by createProxy (not-found.tsx receives no params).
|
||||
*/ const getNotFoundPage = cache(async (locale)=>{
|
||||
try {
|
||||
const payload = await getCachedPayload();
|
||||
return await resolveNotFoundPage({
|
||||
locale,
|
||||
pagesSlug,
|
||||
payload,
|
||||
settingsSlug
|
||||
});
|
||||
} catch {
|
||||
return null // DB unreachable (container build) — fallback view
|
||||
;
|
||||
}
|
||||
});
|
||||
/** One page of a collection's entries, for an archive listing. */ const getEntries = cache(async (collection, locale, page, perPage)=>{
|
||||
const payload = await getCachedPayload();
|
||||
return getArchiveEntries({
|
||||
@@ -154,6 +172,8 @@ import { buildRobots, buildSitemapEntries } from '../seo/index.js';
|
||||
locale: 'all'
|
||||
}).catch(()=>null);
|
||||
const homeId = settings?.homepage?.id;
|
||||
// The assigned 404 page renders via not-found.tsx, never as its own URL.
|
||||
const notFoundId = settings?.notFound?.id !== undefined && settings.notFound.id !== homeId ? settings.notFound.id : undefined;
|
||||
const EXCLUDED = new Set([
|
||||
'404',
|
||||
'500',
|
||||
@@ -177,6 +197,9 @@ import { buildRobots, buildSitemapEntries } from '../seo/index.js';
|
||||
if (raw._status && raw._status !== 'published') {
|
||||
continue;
|
||||
}
|
||||
if (notFoundId !== undefined && raw.id === notFoundId) {
|
||||
continue;
|
||||
}
|
||||
// NOTE: unlike the sitemap, we do NOT skip meta.noindex here. A noindex
|
||||
// page (privacy, cookies, terms) still needs to render — users reach it
|
||||
// from the footer and crawlers read its <meta robots=noindex>. Pre-render
|
||||
@@ -230,6 +253,7 @@ import { buildRobots, buildSitemapEntries } from '../seo/index.js';
|
||||
getCachedPayload,
|
||||
getConfiguredLocales,
|
||||
getEntries,
|
||||
getNotFoundPage,
|
||||
getSettings,
|
||||
resolveRoute,
|
||||
robots,
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+4
-1
@@ -41,9 +41,12 @@
|
||||
status: 200
|
||||
});
|
||||
} catch (err) {
|
||||
// Log the real error for ops; keep the PUBLIC body generic — a 503 with
|
||||
// `db: 'down'` is all an orchestrator needs, and raw DB error text (host,
|
||||
// credentials-in-URL, driver internals) must not leak on a public route.
|
||||
console.warn('[ipal] createHealthRoute: database unreachable:', err);
|
||||
const body = {
|
||||
db: 'down',
|
||||
error: err instanceof Error ? err.message : 'unknown',
|
||||
status: 'error',
|
||||
timestamp: new Date().toISOString(),
|
||||
tookMs: Date.now() - startedAt
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/health/createHealthRoute.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\ntype CreateHealthRouteArgs = {\n /**\n * Collection to ping for a real DB round-trip. Default 'pages'. Pick any\n * collection that always exists in the project.\n */\n collection?: string\n /**\n * Optional extra checks merged into the body (e.g. a cache or queue ping).\n * Throwing marks the whole healthcheck unhealthy.\n */\n extra?: () => Promise<Record<string, unknown>>\n /** Same cached accessor the rest of the app uses. */\n getCachedPayload: () => Promise<BasePayload>\n}\n\n/**\n * A liveness/readiness route for Coolify/Docker healthchecks and uptime\n * monitors. Does a real DB round-trip (not just \"process is up\") and returns\n * 200 when reachable, 503 when not — so an orchestrator can restart or hold\n * traffic off a container whose database is down.\n *\n * // app/api/health/route.ts\n * import { createHealthRoute } from '@intecion/ipal-kit'\n * import { getCachedPayload } from '@/lib/content'\n * export const dynamic = 'force-dynamic' // never prerender/cache a healthcheck\n * export const GET = createHealthRoute({ getCachedPayload })\n *\n * Point Coolify's healthcheck at /api/health. Uses the global `Response`\n * (standard in Next route handlers) — no next/server import, peer-dep clean.\n */\nexport function createHealthRoute(args: CreateHealthRouteArgs): () => Promise<Response> {\n const { collection = 'pages', extra, getCachedPayload } = args\n\n return async () => {\n const startedAt = Date.now()\n try {\n const payload = await getCachedPayload()\n // Cheapest real round-trip: ask for at most one row, no population.\n await payload.find({\n collection: collection as never,\n depth: 0,\n limit: 1,\n pagination: false,\n })\n\n const extraData = extra ? await extra() : {}\n const body = {\n db: 'up',\n status: 'ok',\n timestamp: new Date().toISOString(),\n tookMs: Date.now() - startedAt,\n ...extraData,\n }\n return new Response(JSON.stringify(body), {\n headers: { 'cache-control': 'no-store', 'content-type': 'application/json' },\n status: 200,\n })\n } catch (err) {\n const body = {\n db: 'down',\n error: err instanceof Error ? err.message : 'unknown',\n status: 'error',\n timestamp: new Date().toISOString(),\n tookMs: Date.now() - startedAt,\n }\n return new Response(JSON.stringify(body), {\n headers: { 'cache-control': 'no-store', 'content-type': 'application/json' },\n status: 503,\n })\n }\n }\n}\n"],"names":["createHealthRoute","args","collection","extra","getCachedPayload","startedAt","Date","now","payload","find","depth","limit","pagination","extraData","body","db","status","timestamp","toISOString","tookMs","Response","JSON","stringify","headers","err","error","Error","message"],"mappings":"AAiBA;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASA,kBAAkBC,IAA2B;IAC3D,MAAM,EAAEC,aAAa,OAAO,EAAEC,KAAK,EAAEC,gBAAgB,EAAE,GAAGH;IAE1D,OAAO;QACL,MAAMI,YAAYC,KAAKC,GAAG;QAC1B,IAAI;YACF,MAAMC,UAAU,MAAMJ;YACtB,oEAAoE;YACpE,MAAMI,QAAQC,IAAI,CAAC;gBACjBP,YAAYA;gBACZQ,OAAO;gBACPC,OAAO;gBACPC,YAAY;YACd;YAEA,MAAMC,YAAYV,QAAQ,MAAMA,UAAU,CAAC;YAC3C,MAAMW,OAAO;gBACXC,IAAI;gBACJC,QAAQ;gBACRC,WAAW,IAAIX,OAAOY,WAAW;gBACjCC,QAAQb,KAAKC,GAAG,KAAKF;gBACrB,GAAGQ,SAAS;YACd;YACA,OAAO,IAAIO,SAASC,KAAKC,SAAS,CAACR,OAAO;gBACxCS,SAAS;oBAAE,iBAAiB;oBAAY,gBAAgB;gBAAmB;gBAC3EP,QAAQ;YACV;QACF,EAAE,OAAOQ,KAAK;YACZ,MAAMV,OAAO;gBACXC,IAAI;gBACJU,OAAOD,eAAeE,QAAQF,IAAIG,OAAO,GAAG;gBAC5CX,QAAQ;gBACRC,WAAW,IAAIX,OAAOY,WAAW;gBACjCC,QAAQb,KAAKC,GAAG,KAAKF;YACvB;YACA,OAAO,IAAIe,SAASC,KAAKC,SAAS,CAACR,OAAO;gBACxCS,SAAS;oBAAE,iBAAiB;oBAAY,gBAAgB;gBAAmB;gBAC3EP,QAAQ;YACV;QACF;IACF;AACF"}
|
||||
{"version":3,"sources":["../../../src/modules/health/createHealthRoute.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\ntype CreateHealthRouteArgs = {\n /**\n * Collection to ping for a real DB round-trip. Default 'pages'. Pick any\n * collection that always exists in the project.\n */\n collection?: string\n /**\n * Optional extra checks merged into the body (e.g. a cache or queue ping).\n * Throwing marks the whole healthcheck unhealthy.\n */\n extra?: () => Promise<Record<string, unknown>>\n /** Same cached accessor the rest of the app uses. */\n getCachedPayload: () => Promise<BasePayload>\n}\n\n/**\n * A liveness/readiness route for Coolify/Docker healthchecks and uptime\n * monitors. Does a real DB round-trip (not just \"process is up\") and returns\n * 200 when reachable, 503 when not — so an orchestrator can restart or hold\n * traffic off a container whose database is down.\n *\n * // app/api/health/route.ts\n * import { createHealthRoute } from '@intecion/ipal-kit'\n * import { getCachedPayload } from '@/lib/content'\n * export const dynamic = 'force-dynamic' // never prerender/cache a healthcheck\n * export const GET = createHealthRoute({ getCachedPayload })\n *\n * Point Coolify's healthcheck at /api/health. Uses the global `Response`\n * (standard in Next route handlers) — no next/server import, peer-dep clean.\n */\nexport function createHealthRoute(args: CreateHealthRouteArgs): () => Promise<Response> {\n const { collection = 'pages', extra, getCachedPayload } = args\n\n return async () => {\n const startedAt = Date.now()\n try {\n const payload = await getCachedPayload()\n // Cheapest real round-trip: ask for at most one row, no population.\n await payload.find({\n collection: collection as never,\n depth: 0,\n limit: 1,\n pagination: false,\n })\n\n const extraData = extra ? await extra() : {}\n const body = {\n db: 'up',\n status: 'ok',\n timestamp: new Date().toISOString(),\n tookMs: Date.now() - startedAt,\n ...extraData,\n }\n return new Response(JSON.stringify(body), {\n headers: { 'cache-control': 'no-store', 'content-type': 'application/json' },\n status: 200,\n })\n } catch (err) {\n // Log the real error for ops; keep the PUBLIC body generic — a 503 with\n // `db: 'down'` is all an orchestrator needs, and raw DB error text (host,\n // credentials-in-URL, driver internals) must not leak on a public route.\n console.warn('[ipal] createHealthRoute: database unreachable:', err)\n const body = {\n db: 'down',\n status: 'error',\n timestamp: new Date().toISOString(),\n tookMs: Date.now() - startedAt,\n }\n return new Response(JSON.stringify(body), {\n headers: { 'cache-control': 'no-store', 'content-type': 'application/json' },\n status: 503,\n })\n }\n }\n}\n"],"names":["createHealthRoute","args","collection","extra","getCachedPayload","startedAt","Date","now","payload","find","depth","limit","pagination","extraData","body","db","status","timestamp","toISOString","tookMs","Response","JSON","stringify","headers","err","console","warn"],"mappings":"AAiBA;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASA,kBAAkBC,IAA2B;IAC3D,MAAM,EAAEC,aAAa,OAAO,EAAEC,KAAK,EAAEC,gBAAgB,EAAE,GAAGH;IAE1D,OAAO;QACL,MAAMI,YAAYC,KAAKC,GAAG;QAC1B,IAAI;YACF,MAAMC,UAAU,MAAMJ;YACtB,oEAAoE;YACpE,MAAMI,QAAQC,IAAI,CAAC;gBACjBP,YAAYA;gBACZQ,OAAO;gBACPC,OAAO;gBACPC,YAAY;YACd;YAEA,MAAMC,YAAYV,QAAQ,MAAMA,UAAU,CAAC;YAC3C,MAAMW,OAAO;gBACXC,IAAI;gBACJC,QAAQ;gBACRC,WAAW,IAAIX,OAAOY,WAAW;gBACjCC,QAAQb,KAAKC,GAAG,KAAKF;gBACrB,GAAGQ,SAAS;YACd;YACA,OAAO,IAAIO,SAASC,KAAKC,SAAS,CAACR,OAAO;gBACxCS,SAAS;oBAAE,iBAAiB;oBAAY,gBAAgB;gBAAmB;gBAC3EP,QAAQ;YACV;QACF,EAAE,OAAOQ,KAAK;YACZ,wEAAwE;YACxE,0EAA0E;YAC1E,yEAAyE;YACzEC,QAAQC,IAAI,CAAC,mDAAmDF;YAChE,MAAMV,OAAO;gBACXC,IAAI;gBACJC,QAAQ;gBACRC,WAAW,IAAIX,OAAOY,WAAW;gBACjCC,QAAQb,KAAKC,GAAG,KAAKF;YACvB;YACA,OAAO,IAAIe,SAASC,KAAKC,SAAS,CAACR,OAAO;gBACxCS,SAAS;oBAAE,iBAAiB;oBAAY,gBAAgB;gBAAmB;gBAC3EP,QAAQ;YACV;QACF;IACF;AACF"}
|
||||
+1
-1
@@ -28,7 +28,7 @@ import { APIError } from 'payload';
|
||||
const assigned = settings[field];
|
||||
const assignedId = assigned && typeof assigned === 'object' ? assigned.id : assigned;
|
||||
if (assignedId != null && String(assignedId) === String(id)) {
|
||||
throw new APIError(`Nie można usunąć strony przypisanej do roli systemowej "${field}". ` + `Najpierw odłącz rolę w Site Settings.`, 400);
|
||||
throw new APIError(`Cannot delete a page assigned to the system role "${field}". ` + `Detach the role in Site Settings first.`, 400);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/hooks/preventDeleteSystemPage.ts"],"sourcesContent":["import type { CollectionBeforeDeleteHook } from 'payload'\n\nimport { APIError } from 'payload'\n\n/**\n * Blocks deletion of a page assigned a System Page role (homepage,\n * privacyPolicy, cookiePolicy, termsOfService). An editor deleting the privacy\n * policy or homepage by accident would break routing and compliance links; this\n * stops it with a clear error. They must unassign the role first (deliberate).\n *\n * Reads the role assignments from SiteSettings (which page holds which role).\n *\n * hooks: { beforeDelete: [buildPreventDeleteSystemPage({ settingsSlug: 'site-settings' })] }\n */\nexport function buildPreventDeleteSystemPage(\n args: { roleFields?: string[]; settingsSlug?: string } = {},\n): CollectionBeforeDeleteHook {\n const settingsSlug = args.settingsSlug ?? 'site-settings'\n const roleFields = args.roleFields ?? [\n 'homepage',\n 'privacyPolicy',\n 'cookiePolicy',\n 'termsOfService',\n ]\n\n return async ({ id, req }) => {\n const settings = (await req.payload\n .findGlobal({ slug: settingsSlug as never, depth: 0 })\n .catch(() => null)) as null | Record<string, unknown>\n if (!settings) {return}\n\n for (const field of roleFields) {\n const assigned = settings[field]\n const assignedId =\n assigned && typeof assigned === 'object' ? (assigned as { id?: unknown }).id : assigned\n if (assignedId != null && String(assignedId) === String(id)) {\n throw new APIError(\n `Nie można usunąć strony przypisanej do roli systemowej \"${field}\". ` +\n `Najpierw odłącz rolę w Site Settings.`,\n 400,\n )\n }\n }\n }\n}\n"],"names":["APIError","buildPreventDeleteSystemPage","args","settingsSlug","roleFields","id","req","settings","payload","findGlobal","slug","depth","catch","field","assigned","assignedId","String"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,UAAS;AAElC;;;;;;;;;CASC,GACD,OAAO,SAASC,6BACdC,OAAyD,CAAC,CAAC;IAE3D,MAAMC,eAAeD,KAAKC,YAAY,IAAI;IAC1C,MAAMC,aAAaF,KAAKE,UAAU,IAAI;QACpC;QACA;QACA;QACA;KACD;IAED,OAAO,OAAO,EAAEC,EAAE,EAAEC,GAAG,EAAE;QACvB,MAAMC,WAAY,MAAMD,IAAIE,OAAO,CAChCC,UAAU,CAAC;YAAEC,MAAMP;YAAuBQ,OAAO;QAAE,GACnDC,KAAK,CAAC,IAAM;QACf,IAAI,CAACL,UAAU;YAAC;QAAM;QAEtB,KAAK,MAAMM,SAAST,WAAY;YAC9B,MAAMU,WAAWP,QAAQ,CAACM,MAAM;YAChC,MAAME,aACJD,YAAY,OAAOA,aAAa,WAAW,AAACA,SAA8BT,EAAE,GAAGS;YACjF,IAAIC,cAAc,QAAQC,OAAOD,gBAAgBC,OAAOX,KAAK;gBAC3D,MAAM,IAAIL,SACR,CAAC,wDAAwD,EAAEa,MAAM,GAAG,CAAC,GACnE,CAAC,qCAAqC,CAAC,EACzC;YAEJ;QACF;IACF;AACF"}
|
||||
{"version":3,"sources":["../../../src/modules/hooks/preventDeleteSystemPage.ts"],"sourcesContent":["import type { CollectionBeforeDeleteHook } from 'payload'\n\nimport { APIError } from 'payload'\n\n/**\n * Blocks deletion of a page assigned a System Page role (homepage,\n * privacyPolicy, cookiePolicy, termsOfService). An editor deleting the privacy\n * policy or homepage by accident would break routing and compliance links; this\n * stops it with a clear error. They must unassign the role first (deliberate).\n *\n * Reads the role assignments from SiteSettings (which page holds which role).\n *\n * hooks: { beforeDelete: [buildPreventDeleteSystemPage({ settingsSlug: 'site-settings' })] }\n */\nexport function buildPreventDeleteSystemPage(\n args: { roleFields?: string[]; settingsSlug?: string } = {},\n): CollectionBeforeDeleteHook {\n const settingsSlug = args.settingsSlug ?? 'site-settings'\n const roleFields = args.roleFields ?? [\n 'homepage',\n 'privacyPolicy',\n 'cookiePolicy',\n 'termsOfService',\n ]\n\n return async ({ id, req }) => {\n const settings = (await req.payload\n .findGlobal({ slug: settingsSlug as never, depth: 0 })\n .catch(() => null)) as null | Record<string, unknown>\n if (!settings) {return}\n\n for (const field of roleFields) {\n const assigned = settings[field]\n const assignedId =\n assigned && typeof assigned === 'object' ? (assigned as { id?: unknown }).id : assigned\n if (assignedId != null && String(assignedId) === String(id)) {\n throw new APIError(\n `Cannot delete a page assigned to the system role \"${field}\". ` +\n `Detach the role in Site Settings first.`,\n 400,\n )\n }\n }\n }\n}\n"],"names":["APIError","buildPreventDeleteSystemPage","args","settingsSlug","roleFields","id","req","settings","payload","findGlobal","slug","depth","catch","field","assigned","assignedId","String"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,UAAS;AAElC;;;;;;;;;CASC,GACD,OAAO,SAASC,6BACdC,OAAyD,CAAC,CAAC;IAE3D,MAAMC,eAAeD,KAAKC,YAAY,IAAI;IAC1C,MAAMC,aAAaF,KAAKE,UAAU,IAAI;QACpC;QACA;QACA;QACA;KACD;IAED,OAAO,OAAO,EAAEC,EAAE,EAAEC,GAAG,EAAE;QACvB,MAAMC,WAAY,MAAMD,IAAIE,OAAO,CAChCC,UAAU,CAAC;YAAEC,MAAMP;YAAuBQ,OAAO;QAAE,GACnDC,KAAK,CAAC,IAAM;QACf,IAAI,CAACL,UAAU;YAAC;QAAM;QAEtB,KAAK,MAAMM,SAAST,WAAY;YAC9B,MAAMU,WAAWP,QAAQ,CAACM,MAAM;YAChC,MAAME,aACJD,YAAY,OAAOA,aAAa,WAAW,AAACA,SAA8BT,EAAE,GAAGS;YACjF,IAAIC,cAAc,QAAQC,OAAOD,gBAAgBC,OAAOX,KAAK;gBAC3D,MAAM,IAAIL,SACR,CAAC,kDAAkD,EAAEa,MAAM,GAAG,CAAC,GAC7D,CAAC,uCAAuC,CAAC,EAC3C;YAEJ;QACF;IACF;AACF"}
|
||||
Vendored
+5
-1
@@ -190,7 +190,11 @@ export function createMcpRoute(args) {
|
||||
}
|
||||
return rpcResult(id, toolText(`Unknown tool: ${p.name}`, true));
|
||||
} catch (err) {
|
||||
return rpcResult(id, toolText(err instanceof Error ? err.message : 'Tool error', true));
|
||||
// Log the real error server-side; return a GENERIC message to the
|
||||
// (anonymous) caller so internal details — DB schema, host, stack —
|
||||
// never leak over a public endpoint.
|
||||
console.warn('[ipal] createMcpRoute: tool execution failed:', err);
|
||||
return rpcResult(id, toolText('Tool execution failed.', true));
|
||||
}
|
||||
}
|
||||
case 'tools/list':
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+2
@@ -2,12 +2,14 @@ import { ALL_SYSTEM_PAGE_ROLES } from './types.js';
|
||||
/** Admin-facing labels per role. */ const ROLE_LABELS = {
|
||||
cookiePolicy: 'Cookie Policy',
|
||||
homepage: 'Homepage',
|
||||
notFound: '404 (Not Found)',
|
||||
privacyPolicy: 'Privacy Policy',
|
||||
termsOfService: 'Terms of Service'
|
||||
};
|
||||
/** Admin descriptions per role. */ const ROLE_DESCRIPTIONS = {
|
||||
cookiePolicy: 'Page linked from the cookie consent banner.',
|
||||
homepage: 'Page served at the locale root (e.g. /pl, /en).',
|
||||
notFound: 'Page shown for unknown URLs (404). Pick a dedicated "Not found" page, or reuse the homepage. If left empty, the project falls back to its built-in not-found view.',
|
||||
privacyPolicy: 'Page linked as the privacy policy.',
|
||||
termsOfService: 'Page linked as the terms of service / site regulations.'
|
||||
};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/pages/systemPagesFields.ts"],"sourcesContent":["import type { Field, RelationshipField } from 'payload'\n\nimport type { PagesOption, SystemPageRole } from './types.js'\n\nimport { ALL_SYSTEM_PAGE_ROLES } from './types.js'\n\n/** Admin-facing labels per role. */\nconst ROLE_LABELS: Record<SystemPageRole, string> = {\n cookiePolicy: 'Cookie Policy',\n homepage: 'Homepage',\n privacyPolicy: 'Privacy Policy',\n termsOfService: 'Terms of Service',\n}\n\n/** Admin descriptions per role. */\nconst ROLE_DESCRIPTIONS: Record<SystemPageRole, string> = {\n cookiePolicy: 'Page linked from the cookie consent banner.',\n homepage: 'Page served at the locale root (e.g. /pl, /en).',\n privacyPolicy: 'Page linked as the privacy policy.',\n termsOfService: 'Page linked as the terms of service / site regulations.',\n}\n\n/**\n * Builds one relationship field per configured system-page role.\n *\n * Each field points at the client's Pages collection (via the provided slug)\n * and holds a single document reference. The referenced document's slug is\n * localized, so the same assignment resolves to /pl/strona-glowna and\n * /en/home at runtime — role assignment is locale-agnostic, path resolution\n * is locale-aware (see getSystemPagePath).\n */\nexport function buildSystemPagesFields(pages: PagesOption): Field[] {\n const roles = pages.roles?.length ? pages.roles : [...ALL_SYSTEM_PAGE_ROLES]\n\n return roles.map((role): RelationshipField => ({\n name: role,\n type: 'relationship',\n admin: {\n description: ROLE_DESCRIPTIONS[role],\n },\n label: ROLE_LABELS[role],\n maxDepth: 1,\n relationTo: pages.slug,\n }))\n}\n"],"names":["ALL_SYSTEM_PAGE_ROLES","ROLE_LABELS","cookiePolicy","homepage","privacyPolicy","termsOfService","ROLE_DESCRIPTIONS","buildSystemPagesFields","pages","roles","length","map","role","name","type","admin","description","label","maxDepth","relationTo","slug"],"mappings":"AAIA,SAASA,qBAAqB,QAAQ,aAAY;AAElD,kCAAkC,GAClC,MAAMC,cAA8C;IAClDC,cAAc;IACdC,UAAU;IACVC,eAAe;IACfC,gBAAgB;AAClB;AAEA,iCAAiC,GACjC,MAAMC,oBAAoD;IACxDJ,cAAc;IACdC,UAAU;IACVC,eAAe;IACfC,gBAAgB;AAClB;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASE,uBAAuBC,KAAkB;IACvD,MAAMC,QAAQD,MAAMC,KAAK,EAAEC,SAASF,MAAMC,KAAK,GAAG;WAAIT;KAAsB;IAE5E,OAAOS,MAAME,GAAG,CAAC,CAACC,OAA6B,CAAA;YAC7CC,MAAMD;YACNE,MAAM;YACNC,OAAO;gBACLC,aAAaV,iBAAiB,CAACM,KAAK;YACtC;YACAK,OAAOhB,WAAW,CAACW,KAAK;YACxBM,UAAU;YACVC,YAAYX,MAAMY,IAAI;QACxB,CAAA;AACF"}
|
||||
{"version":3,"sources":["../../../src/modules/pages/systemPagesFields.ts"],"sourcesContent":["import type { Field, RelationshipField } from 'payload'\n\nimport type { PagesOption, SystemPageRole } from './types.js'\n\nimport { ALL_SYSTEM_PAGE_ROLES } from './types.js'\n\n/** Admin-facing labels per role. */\nconst ROLE_LABELS: Record<SystemPageRole, string> = {\n cookiePolicy: 'Cookie Policy',\n homepage: 'Homepage',\n notFound: '404 (Not Found)',\n privacyPolicy: 'Privacy Policy',\n termsOfService: 'Terms of Service',\n}\n\n/** Admin descriptions per role. */\nconst ROLE_DESCRIPTIONS: Record<SystemPageRole, string> = {\n cookiePolicy: 'Page linked from the cookie consent banner.',\n homepage: 'Page served at the locale root (e.g. /pl, /en).',\n notFound:\n 'Page shown for unknown URLs (404). Pick a dedicated \"Not found\" page, or reuse the homepage. If left empty, the project falls back to its built-in not-found view.',\n privacyPolicy: 'Page linked as the privacy policy.',\n termsOfService: 'Page linked as the terms of service / site regulations.',\n}\n\n/**\n * Builds one relationship field per configured system-page role.\n *\n * Each field points at the client's Pages collection (via the provided slug)\n * and holds a single document reference. The referenced document's slug is\n * localized, so the same assignment resolves to /pl/strona-glowna and\n * /en/home at runtime — role assignment is locale-agnostic, path resolution\n * is locale-aware (see getSystemPagePath).\n */\nexport function buildSystemPagesFields(pages: PagesOption): Field[] {\n const roles = pages.roles?.length ? pages.roles : [...ALL_SYSTEM_PAGE_ROLES]\n\n return roles.map((role): RelationshipField => ({\n name: role,\n type: 'relationship',\n admin: {\n description: ROLE_DESCRIPTIONS[role],\n },\n label: ROLE_LABELS[role],\n maxDepth: 1,\n relationTo: pages.slug,\n }))\n}\n"],"names":["ALL_SYSTEM_PAGE_ROLES","ROLE_LABELS","cookiePolicy","homepage","notFound","privacyPolicy","termsOfService","ROLE_DESCRIPTIONS","buildSystemPagesFields","pages","roles","length","map","role","name","type","admin","description","label","maxDepth","relationTo","slug"],"mappings":"AAIA,SAASA,qBAAqB,QAAQ,aAAY;AAElD,kCAAkC,GAClC,MAAMC,cAA8C;IAClDC,cAAc;IACdC,UAAU;IACVC,UAAU;IACVC,eAAe;IACfC,gBAAgB;AAClB;AAEA,iCAAiC,GACjC,MAAMC,oBAAoD;IACxDL,cAAc;IACdC,UAAU;IACVC,UACE;IACFC,eAAe;IACfC,gBAAgB;AAClB;AAEA;;;;;;;;CAQC,GACD,OAAO,SAASE,uBAAuBC,KAAkB;IACvD,MAAMC,QAAQD,MAAMC,KAAK,EAAEC,SAASF,MAAMC,KAAK,GAAG;WAAIV;KAAsB;IAE5E,OAAOU,MAAME,GAAG,CAAC,CAACC,OAA6B,CAAA;YAC7CC,MAAMD;YACNE,MAAM;YACNC,OAAO;gBACLC,aAAaV,iBAAiB,CAACM,KAAK;YACtC;YACAK,OAAOjB,WAAW,CAACY,KAAK;YACxBM,UAAU;YACVC,YAAYX,MAAMY,IAAI;QACxB,CAAA;AACF"}
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
* Built-in "system page" roles — documents from the client's Pages
|
||||
* collection that the site references by function rather than by slug.
|
||||
*/
|
||||
export type SystemPageRole = 'cookiePolicy' | 'homepage' | 'privacyPolicy' | 'termsOfService';
|
||||
export type SystemPageRole = 'cookiePolicy' | 'homepage' | 'notFound' | 'privacyPolicy' | 'termsOfService';
|
||||
/**
|
||||
* All system roles in a stable order (used when no subset is configured).
|
||||
*/
|
||||
|
||||
Vendored
+1
@@ -5,6 +5,7 @@
|
||||
* All system roles in a stable order (used when no subset is configured).
|
||||
*/ export const ALL_SYSTEM_PAGE_ROLES = [
|
||||
'homepage',
|
||||
'notFound',
|
||||
'privacyPolicy',
|
||||
'cookiePolicy',
|
||||
'termsOfService'
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/pages/types.ts"],"sourcesContent":["/**\n * Built-in \"system page\" roles — documents from the client's Pages\n * collection that the site references by function rather than by slug.\n */\nexport type SystemPageRole = 'cookiePolicy' | 'homepage' | 'privacyPolicy' | 'termsOfService'\n\n/**\n * All system roles in a stable order (used when no subset is configured).\n */\nexport const ALL_SYSTEM_PAGE_ROLES: readonly SystemPageRole[] = [\n 'homepage',\n 'privacyPolicy',\n 'cookiePolicy',\n 'termsOfService',\n]\n\n/**\n * Plugin option enabling system-page assignments in SiteSettings.\n *\n * The plugin doesn't own the Pages collection — the client creates it in\n * their own project. This option hands the plugin the collection's slug so\n * it can build relationship fields pointing at it. No hardcoding: the slug\n * always comes from the client.\n */\nexport type PagesOption = {\n /**\n * Which system roles to expose as assignable fields.\n * Defaults to all roles when omitted.\n */\n roles?: SystemPageRole[]\n /** Slug of the client's Pages collection, e.g. 'pages'. */\n slug: string\n}\n"],"names":["ALL_SYSTEM_PAGE_ROLES"],"mappings":"AAAA;;;CAGC,GAGD;;CAEC,GACD,OAAO,MAAMA,wBAAmD;IAC9D;IACA;IACA;IACA;CACD,CAAA"}
|
||||
{"version":3,"sources":["../../../src/modules/pages/types.ts"],"sourcesContent":["/**\n * Built-in \"system page\" roles — documents from the client's Pages\n * collection that the site references by function rather than by slug.\n */\nexport type SystemPageRole =\n 'cookiePolicy' | 'homepage' | 'notFound' | 'privacyPolicy' | 'termsOfService'\n\n/**\n * All system roles in a stable order (used when no subset is configured).\n */\nexport const ALL_SYSTEM_PAGE_ROLES: readonly SystemPageRole[] = [\n 'homepage',\n 'notFound',\n 'privacyPolicy',\n 'cookiePolicy',\n 'termsOfService',\n]\n\n/**\n * Plugin option enabling system-page assignments in SiteSettings.\n *\n * The plugin doesn't own the Pages collection — the client creates it in\n * their own project. This option hands the plugin the collection's slug so\n * it can build relationship fields pointing at it. No hardcoding: the slug\n * always comes from the client.\n */\nexport type PagesOption = {\n /**\n * Which system roles to expose as assignable fields.\n * Defaults to all roles when omitted.\n */\n roles?: SystemPageRole[]\n /** Slug of the client's Pages collection, e.g. 'pages'. */\n slug: string\n}\n"],"names":["ALL_SYSTEM_PAGE_ROLES"],"mappings":"AAAA;;;CAGC,GAID;;CAEC,GACD,OAAO,MAAMA,wBAAmD;IAC9D;IACA;IACA;IACA;IACA;CACD,CAAA"}
|
||||
Vendored
+2
-2
@@ -70,7 +70,7 @@ import { buildLocalizedPath } from '../i18n/index.js';
|
||||
if (raw._status && raw._status !== 'published') {
|
||||
continue;
|
||||
}
|
||||
if (raw.meta?.noindex) {
|
||||
if (raw.noindex || raw.meta?.noindex) {
|
||||
continue;
|
||||
}
|
||||
const title = typeof raw.title === 'string' ? raw.title : undefined;
|
||||
@@ -111,7 +111,7 @@ import { buildLocalizedPath } from '../i18n/index.js';
|
||||
if (raw._status && raw._status !== 'published') {
|
||||
continue;
|
||||
}
|
||||
if (raw.meta?.noindex) {
|
||||
if (raw.noindex || raw.meta?.noindex) {
|
||||
continue;
|
||||
}
|
||||
const title = typeof raw.title === 'string' ? raw.title : undefined;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+8
-1
@@ -53,6 +53,13 @@ type BuildMetadataArgs = {
|
||||
locale: string;
|
||||
/** SEO meta from the document (plugin-seo group). */
|
||||
meta?: null | SeoMeta;
|
||||
/**
|
||||
* Top-level noindex flag (buildNoindexField). Checked alongside meta.noindex:
|
||||
* plugin-seo's meta group doesn't declare noindex, so a mirror into
|
||||
* meta.noindex is stripped on save — the top-level field is the one that
|
||||
* persists. Either being true emits robots index:false.
|
||||
*/
|
||||
noindex?: boolean | null;
|
||||
/** Page title or site name first. Defaults to 'page-first'. */
|
||||
order?: TitleOrder;
|
||||
/**
|
||||
@@ -98,5 +105,5 @@ type BuildMetadataArgs = {
|
||||
* pieces (meta group, site name, image URL, localized slugs) and passes them
|
||||
* in — the plugin composes, it doesn't fetch.
|
||||
*/
|
||||
export declare function buildMetadata({ baseUrl, config, homeSlug, imageUrl, locale, meta, order, pageTitle, prefix, query, separator, siteDescription, siteName, slugs, }: BuildMetadataArgs): PageMetadata;
|
||||
export declare function buildMetadata({ baseUrl, config, homeSlug, imageUrl, locale, meta, noindex, order, pageTitle, prefix, query, separator, siteDescription, siteName, slugs, }: BuildMetadataArgs): PageMetadata;
|
||||
export {};
|
||||
|
||||
Vendored
+2
-2
@@ -9,7 +9,7 @@ import { buildHreflangAlternates } from './hreflang.js';
|
||||
* Designed for use inside Next.js `generateMetadata`. The caller resolves the
|
||||
* pieces (meta group, site name, image URL, localized slugs) and passes them
|
||||
* in — the plugin composes, it doesn't fetch.
|
||||
*/ export function buildMetadata({ baseUrl, config, homeSlug = 'home', imageUrl, locale, meta, order, pageTitle, prefix, query, separator, siteDescription, siteName, slugs }) {
|
||||
*/ export function buildMetadata({ baseUrl, config, homeSlug = 'home', imageUrl, locale, meta, noindex, order, pageTitle, prefix, query, separator, siteDescription, siteName, slugs }) {
|
||||
// Title source priority: titleOverride (exact, wins outright) > meta.title
|
||||
// (SEO title an editor set) > pageTitle (the document's own name). This means
|
||||
// a page with no SEO title still shows its name (e.g. 'Sprzątanie biur')
|
||||
@@ -83,7 +83,7 @@ import { buildHreflangAlternates } from './hreflang.js';
|
||||
// robots: noindex pages are excluded (follow keeps link authority). Indexed
|
||||
// pages get generous snippet/preview limits so Google can show rich results
|
||||
// (long snippets, large image previews, full video previews).
|
||||
...meta?.noindex ? {
|
||||
...noindex || meta?.noindex ? {
|
||||
robots: {
|
||||
follow: true,
|
||||
index: false
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+12
-15
@@ -2,29 +2,26 @@ import type { CheckboxField, Field } from 'payload';
|
||||
type BuildNoindexFieldArgs = {
|
||||
/** Help text under the checkbox. */
|
||||
description?: string;
|
||||
/** Sidebar label. Default 'Wyklucz z indeksowania (noindex)'. */
|
||||
/** Sidebar label. Default 'Exclude from indexing (noindex)'. */
|
||||
label?: string;
|
||||
/**
|
||||
* Dotted path, inside the document, that the SEO read path (metadata +
|
||||
* sitemap) consumes. Default 'meta.noindex' — the plugin-seo `meta` group.
|
||||
* The checkbox value is mirrored here on every save, so editors toggle one
|
||||
* friendly switch and the machinery reads a stable location.
|
||||
*/
|
||||
metaPath?: string;
|
||||
/** Field name for the editor-facing checkbox. Default 'noindex'. */
|
||||
name?: string;
|
||||
/** Extend/override the generated checkbox (position, access, etc.). */
|
||||
overrides?: Partial<CheckboxField>;
|
||||
};
|
||||
/**
|
||||
* A sidebar `noindex` checkbox that mirrors into `meta.noindex` (what the
|
||||
* sitemap and metadata generators actually read). Replaces the hand-rolled
|
||||
* checkbox + `beforeChange` hook with its `(data as any).meta.noindex = …`
|
||||
* glue copied into every project — no `any`, one source of truth for editors,
|
||||
* one stable read location for the engine.
|
||||
* A top-level sidebar `noindex` checkbox. When ticked, the page is excluded from
|
||||
* `sitemap.xml`, `llms.txt`, site search, and gets `robots: noindex, follow` —
|
||||
* ALL automatically, no per-project filtering.
|
||||
*
|
||||
* Idempotent and order-independent: if either the checkbox OR an existing
|
||||
* `meta.noindex` is set, the page ends up noindex; the two can't drift apart.
|
||||
* Why top-level (not mirrored into `meta.noindex`): plugin-seo's `meta` group
|
||||
* declares only title/description/image, so Payload silently strips any extra
|
||||
* key (`meta.noindex`) during sanitization — an earlier version mirrored there
|
||||
* and the value vanished, leaking noindex pages into the sitemap. The value now
|
||||
* lives on this top-level field, which persists; every reader in the kit
|
||||
* (buildSitemapEntries, buildMetadata/createPageMetadata, buildLlmsTxt,
|
||||
* searchContent) checks `doc.noindex` (and still tolerates a legacy
|
||||
* `meta.noindex`). One field, one source of truth, zero project glue.
|
||||
*
|
||||
* // collections/Pages.ts
|
||||
* import { buildNoindexField } from '@intecion/ipal-kit'
|
||||
|
||||
+13
-47
@@ -1,49 +1,23 @@
|
||||
/** Read a dotted path (e.g. 'meta.noindex') off a loosely-typed object. */ function readPath(obj, path) {
|
||||
let cur = obj;
|
||||
for (const key of path){
|
||||
if (cur == null || typeof cur !== 'object') {
|
||||
return undefined;
|
||||
}
|
||||
cur = cur[key];
|
||||
}
|
||||
return cur;
|
||||
}
|
||||
/** Write a dotted path, creating intermediate objects as needed. */ function writePath(obj, path, value) {
|
||||
let cur = obj;
|
||||
for(let i = 0; i < path.length - 1; i++){
|
||||
const key = path[i];
|
||||
const next = cur[key];
|
||||
if (next == null || typeof next !== 'object') {
|
||||
cur[key] = {};
|
||||
}
|
||||
cur = cur[key];
|
||||
}
|
||||
cur[path[path.length - 1]] = value;
|
||||
}
|
||||
/**
|
||||
* A sidebar `noindex` checkbox that mirrors into `meta.noindex` (what the
|
||||
* sitemap and metadata generators actually read). Replaces the hand-rolled
|
||||
* checkbox + `beforeChange` hook with its `(data as any).meta.noindex = …`
|
||||
* glue copied into every project — no `any`, one source of truth for editors,
|
||||
* one stable read location for the engine.
|
||||
* A top-level sidebar `noindex` checkbox. When ticked, the page is excluded from
|
||||
* `sitemap.xml`, `llms.txt`, site search, and gets `robots: noindex, follow` —
|
||||
* ALL automatically, no per-project filtering.
|
||||
*
|
||||
* Idempotent and order-independent: if either the checkbox OR an existing
|
||||
* `meta.noindex` is set, the page ends up noindex; the two can't drift apart.
|
||||
* Why top-level (not mirrored into `meta.noindex`): plugin-seo's `meta` group
|
||||
* declares only title/description/image, so Payload silently strips any extra
|
||||
* key (`meta.noindex`) during sanitization — an earlier version mirrored there
|
||||
* and the value vanished, leaking noindex pages into the sitemap. The value now
|
||||
* lives on this top-level field, which persists; every reader in the kit
|
||||
* (buildSitemapEntries, buildMetadata/createPageMetadata, buildLlmsTxt,
|
||||
* searchContent) checks `doc.noindex` (and still tolerates a legacy
|
||||
* `meta.noindex`). One field, one source of truth, zero project glue.
|
||||
*
|
||||
* // collections/Pages.ts
|
||||
* import { buildNoindexField } from '@intecion/ipal-kit'
|
||||
* fields: [ /* … *\/ buildNoindexField() ],
|
||||
*/ export function buildNoindexField(args = {}) {
|
||||
const { name = 'noindex', description = 'Zaznacz, aby wykluczyć tę podstronę z indeksowania (robots: noindex, follow) i z sitemap.xml.', label = 'Wyklucz z indeksowania (noindex)', metaPath = 'meta.noindex', overrides = {} } = args;
|
||||
const segments = metaPath.split('.');
|
||||
const mirror = ({ data, value })=>{
|
||||
const shouldNoindex = Boolean(value ?? readPath(data, segments));
|
||||
if (data && typeof data === 'object') {
|
||||
writePath(data, segments, shouldNoindex);
|
||||
}
|
||||
return shouldNoindex;
|
||||
};
|
||||
const { admin: adminOverrides, hooks: hooksOverrides, ...restOverrides } = overrides;
|
||||
const { name = 'noindex', description = 'Check to exclude this page from indexing (robots: noindex, follow), the sitemap, llms.txt and site search.', label = 'Exclude from indexing (noindex)', overrides = {} } = args;
|
||||
const { admin: adminOverrides, ...restOverrides } = overrides;
|
||||
return {
|
||||
name,
|
||||
type: 'checkbox',
|
||||
@@ -53,14 +27,6 @@
|
||||
...adminOverrides
|
||||
},
|
||||
defaultValue: false,
|
||||
hooks: {
|
||||
...hooksOverrides,
|
||||
// mirror runs first, then any project-supplied beforeChange hooks.
|
||||
beforeChange: [
|
||||
mirror,
|
||||
...hooksOverrides?.beforeChange ?? []
|
||||
]
|
||||
},
|
||||
label,
|
||||
...restOverrides
|
||||
};
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+5
-1
@@ -29,7 +29,11 @@ import { buildHreflangAlternates } from './hreflang.js';
|
||||
if (doc._status && doc._status !== 'published') {
|
||||
return false;
|
||||
}
|
||||
if (doc.meta?.noindex) {
|
||||
// Check BOTH the top-level checkbox (buildNoindexField, the field that
|
||||
// persists) AND meta.noindex — plugin-seo's meta group doesn't declare
|
||||
// noindex, so a mirror into meta.noindex is stripped on save. Reading both
|
||||
// makes exclusion automatic regardless of where the flag ended up.
|
||||
if (doc.noindex || doc.meta?.noindex) {
|
||||
return false;
|
||||
}
|
||||
if (hasExcludedSlug(doc.slug)) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -34,7 +34,7 @@ import { blocksToMarkdown } from '../content/blocksToMarkdown.js';
|
||||
* buildLlmsTxt({ …, summaryField: 'aiSummary' })
|
||||
* createSearchRoute({ …, summaryField: 'aiSummary' })
|
||||
*/ export function buildSummaryField(args = {}) {
|
||||
const { name = 'aiSummary', autoFill = true, description = 'Zwięzły opis strony dla agentów AI i llms.txt (bogatszy niż meta description). Puste → generowane automatycznie z treści.', label = 'Streszczenie dla AI', layoutField = 'layout', maxLength = 300, overrides = {} } = args;
|
||||
const { name = 'aiSummary', autoFill = true, description = 'Concise page description for AI agents and llms.txt (richer than the meta description). Leave empty to auto-generate from the content.', label = 'AI summary', layoutField = 'layout', maxLength = 300, overrides = {} } = args;
|
||||
const autofillHook = ({ data, value })=>{
|
||||
if (typeof value === 'string' && value.trim()) {
|
||||
return value;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
@@ -90,6 +90,7 @@ import { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
||||
...base,
|
||||
imageUrl: resolveOgImage(doc),
|
||||
meta: doc.meta,
|
||||
noindex: doc.noindex,
|
||||
pageTitle: doc.title,
|
||||
prefix,
|
||||
query,
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+110
-21
@@ -62,29 +62,118 @@ import { buildSeoPlugin, injectAutoFillMeta, injectSeoTabs } from './modules/seo
|
||||
if (!tf?.issuer) {
|
||||
throw new Error('[ipal] twoFactor.issuer is required (name shown in the authenticator ' + 'app). Pass twoFactor: { issuer: "Your Site" }, or twoFactor: false to ' + 'opt out (discouraged).');
|
||||
}
|
||||
try {
|
||||
// Dynamic specifier via a variable so TS doesn't try to resolve this
|
||||
// optional peer dependency at build time (it isn't in the plugin's own
|
||||
// node_modules). Avoids TS2307 without @ts-expect-error; the module
|
||||
// exists at runtime in projects that installed it.
|
||||
// @ts-ignore
|
||||
const mod = await import('@clocklimited/payload-2fa');
|
||||
// The package exports `payloadTotp`; older/other builds may use
|
||||
// `totpPlugin`. Accept either so a rename doesn't break us.
|
||||
const totp = mod.payloadTotp ?? mod.totpPlugin;
|
||||
if (typeof totp !== 'function') {
|
||||
throw new Error('expected export payloadTotp (or totpPlugin) to be a function — ' + 'check the installed @clocklimited/payload-2fa version');
|
||||
// Prefer the INJECTED plugin factory (recommended): the project imports
|
||||
// payloadTotp from @clocklimited/payload-2fa and passes it in. Then the
|
||||
// plugin never imports the optional peer itself — no dynamic import, so
|
||||
// Next can't fail to bundle it (the cause of "Cannot find module
|
||||
// '@clocklimited/payload-2fa'" crashing even public frontend pages).
|
||||
let totp = tf.plugin;
|
||||
if (!totp) {
|
||||
// Fallback: dynamic import. Variable specifier dodges the plugin's own
|
||||
// TS2307, but Next may NOT trace it into the server bundle — projects
|
||||
// using this path MUST add '@clocklimited/payload-2fa' to
|
||||
// serverExternalPackages in next.config (see docs/security.md).
|
||||
try {
|
||||
const pkg = '@clocklimited/payload-2fa';
|
||||
const mod = await import(pkg);
|
||||
totp = mod.payloadTotp ?? mod.totpPlugin;
|
||||
} catch (err) {
|
||||
throw new Error('[ipal] 2FA is enforced but @clocklimited/payload-2fa could not be loaded. ' + 'Best fix — inject it: `import { payloadTotp } from "@clocklimited/payload-2fa"` ' + 'then `twoFactor: { issuer, plugin: payloadTotp }`. Or install it AND add ' + "'@clocklimited/payload-2fa' to serverExternalPackages in next.config. Or set " + `twoFactor: false to opt out (discouraged). Original error: ${String(err)}`);
|
||||
}
|
||||
config = await totp({
|
||||
collection: tf.collectionSlug ?? 'users',
|
||||
forceSetup: true,
|
||||
totp: {
|
||||
issuer: tf.issuer
|
||||
}
|
||||
})(config);
|
||||
} catch (err) {
|
||||
throw new Error('[ipal] 2FA is enforced but @clocklimited/payload-2fa is not installed. ' + 'Run: pnpm add @clocklimited/payload-2fa — or set twoFactor: false to ' + `opt out (discouraged). Original error: ${String(err)}`);
|
||||
}
|
||||
if (typeof totp !== 'function') {
|
||||
throw new Error('[ipal] 2FA: expected payloadTotp (or totpPlugin) to be a function — check the ' + 'injected `plugin` or the installed @clocklimited/payload-2fa version.');
|
||||
}
|
||||
config = await totp({
|
||||
collection: tf.collectionSlug ?? 'users',
|
||||
forceSetup: true,
|
||||
totp: {
|
||||
issuer: tf.issuer
|
||||
}
|
||||
})(config);
|
||||
}
|
||||
// --- white-label admin branding ---
|
||||
// Inject admin.components.graphics.Logo/Icon pointing at the plugin's
|
||||
// /admin export. The components read SiteSettings at render, so each client
|
||||
// sees their own brand from the panel (no brand in code). Project must run
|
||||
// `pnpm generate:importmap` so Payload resolves the component paths.
|
||||
if (options.whiteLabel) {
|
||||
const wl = options.whiteLabel === true ? {} : options.whiteLabel;
|
||||
const serverProps = {};
|
||||
if (wl.settingsSlug) {
|
||||
serverProps.settingsSlug = wl.settingsSlug;
|
||||
}
|
||||
if (wl.nameField) {
|
||||
serverProps.nameField = wl.nameField;
|
||||
}
|
||||
const logoProps = {
|
||||
...serverProps,
|
||||
...wl.logoField ? {
|
||||
imageField: wl.logoField
|
||||
} : {}
|
||||
};
|
||||
const iconProps = {
|
||||
...serverProps,
|
||||
...wl.iconField ? {
|
||||
imageField: wl.iconField
|
||||
} : {}
|
||||
};
|
||||
// Vendor credit ("Technology by Intecion.com") under the nav — on by
|
||||
// default, hidden with credit:false, text/url overridable.
|
||||
const creditOn = wl.credit !== false;
|
||||
const creditProps = wl.credit && typeof wl.credit === 'object' ? {
|
||||
...wl.credit.text ? {
|
||||
text: wl.credit.text
|
||||
} : {},
|
||||
...wl.credit.url ? {
|
||||
url: wl.credit.url
|
||||
} : {}
|
||||
} : {};
|
||||
config.admin = {
|
||||
...config.admin ?? {},
|
||||
components: {
|
||||
...config.admin?.components ?? {},
|
||||
graphics: {
|
||||
...config.admin?.components?.graphics ?? {},
|
||||
Icon: {
|
||||
path: '@intecion/ipal-kit/admin#AdminIcon',
|
||||
serverProps: iconProps
|
||||
},
|
||||
Logo: {
|
||||
path: '@intecion/ipal-kit/admin#AdminLogo',
|
||||
serverProps: logoProps
|
||||
}
|
||||
},
|
||||
...creditOn ? {
|
||||
afterLogin: [
|
||||
...config.admin?.components?.afterLogin ?? [],
|
||||
{
|
||||
path: '@intecion/ipal-kit/admin#IntecionCredit',
|
||||
serverProps: {
|
||||
...creditProps,
|
||||
variant: 'login'
|
||||
}
|
||||
}
|
||||
],
|
||||
afterNavLinks: [
|
||||
...config.admin?.components?.afterNavLinks ?? [],
|
||||
{
|
||||
path: '@intecion/ipal-kit/admin#IntecionCredit',
|
||||
serverProps: {
|
||||
...creditProps,
|
||||
variant: 'nav'
|
||||
}
|
||||
}
|
||||
]
|
||||
} : {}
|
||||
},
|
||||
...wl.titleSuffix ? {
|
||||
meta: {
|
||||
...config.admin?.meta ?? {},
|
||||
titleSuffix: wl.titleSuffix
|
||||
}
|
||||
} : {}
|
||||
};
|
||||
}
|
||||
// --- i18n ---
|
||||
config.localization = buildLocalizationConfig(options.i18n);
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+55
-1
@@ -1,4 +1,15 @@
|
||||
import type { Field } from 'payload';
|
||||
import type { Field, Plugin } from 'payload';
|
||||
/**
|
||||
* Factory shape of @clocklimited/payload-2fa's `payloadTotp` export — injected
|
||||
* so the plugin never imports the optional peer itself.
|
||||
*/
|
||||
export type TotpPluginFactory = (options: {
|
||||
collection: string;
|
||||
forceSetup: boolean;
|
||||
totp: {
|
||||
issuer: string;
|
||||
};
|
||||
}) => Plugin;
|
||||
import type { AccessOption } from './modules/access/types.js';
|
||||
import type { ContentOption } from './modules/content/types.js';
|
||||
import type { FormsOption } from './modules/forms/types.js';
|
||||
@@ -71,5 +82,48 @@ export type IpalOptions = {
|
||||
collectionSlug?: string;
|
||||
/** Name shown in the authenticator app (e.g. company/site name). */
|
||||
issuer: string;
|
||||
/**
|
||||
* The 2FA plugin factory, INJECTED from the project:
|
||||
* `import { payloadTotp } from '@clocklimited/payload-2fa'`. Strongly
|
||||
* recommended — injecting it (the same pattern as NextResponse /
|
||||
* revalidatePath) means the plugin never dynamically imports the
|
||||
* optional peer, which Next can fail to bundle into the server chunks
|
||||
* ("Cannot find module '@clocklimited/payload-2fa'" at runtime, even on
|
||||
* public frontend pages). If omitted, the plugin falls back to a dynamic
|
||||
* import and you MUST add '@clocklimited/payload-2fa' to
|
||||
* serverExternalPackages in next.config. See docs/security.md.
|
||||
*/
|
||||
plugin?: TotpPluginFactory;
|
||||
} | false;
|
||||
/**
|
||||
* White-label the admin panel: show the CLIENT's brand (logo + name) in the
|
||||
* admin — login screen and nav — pulled from SiteSettings, set by the editor
|
||||
* in the panel (no brand hardcoded in code). `true` wires it with defaults
|
||||
* (SiteSettings `logo`/`favicon`/`siteName`); the object form overrides the
|
||||
* global slug, field names, or the browser-tab title suffix.
|
||||
*
|
||||
* Injects admin.components.graphics.Logo/Icon pointing at
|
||||
* `@intecion/ipal-kit/admin`. After enabling, run `pnpm generate:importmap`
|
||||
* so Payload can resolve the components. See docs/white-label.md.
|
||||
*/
|
||||
whiteLabel?: {
|
||||
/**
|
||||
* Vendor credit ("Technology by Intecion.com") at the bottom of the
|
||||
* admin nav. Default on; `false` hides it, or override text/url.
|
||||
*/
|
||||
credit?: {
|
||||
text?: string;
|
||||
url?: string;
|
||||
} | boolean;
|
||||
/** Upload field for the small nav icon. Default 'favicon'. */
|
||||
iconField?: string;
|
||||
/** Upload field for the login/nav logo. Default 'logo'. */
|
||||
logoField?: string;
|
||||
/** Field with the site name. Default 'siteName'. */
|
||||
nameField?: string;
|
||||
/** SiteSettings global slug. Default 'site-settings'. */
|
||||
settingsSlug?: string;
|
||||
/** Static browser-tab title suffix (e.g. ' · Acme Admin'). */
|
||||
titleSuffix?: string;
|
||||
} | boolean;
|
||||
};
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+3
-1
@@ -125,11 +125,13 @@ export default buildConfig({
|
||||
| turnstile | Cloudflare Turnstile (widget + verify) | [turnstile.md](./turnstile.md) |
|
||||
| email | Wysyłka: SMTP z panelu lub Microsoft Graph (M365) | [email.md](./email.md) |
|
||||
| forms | Form-builder + submitForm + useForm/useContactForm (logika klienta) | [forms.md](./forms.md) |
|
||||
| analytics | GA4 / GTM spięte z Consent Mode | [analytics.md](./analytics.md) |
|
||||
| analytics | GA4 / GTM spięte z Consent Mode, pushDataLayer | [analytics.md](./analytics.md) |
|
||||
| gtm-meta-pixel | Konfiguracja GTM + Meta Pixel krok po kroku (pod ten stack) | [gtm-meta-pixel.md](./gtm-meta-pixel.md) |
|
||||
| slug | Auto-slug z tytułu, per locale | [slug.md](./slug.md) |
|
||||
| notifications | Teksty wyników akcji (formularz) per język | [notifications.md](./notifications.md) |
|
||||
| storage | Media na Cloudflare R2 (offload z .env) | [storage.md](./storage.md) |
|
||||
| security | Nagłówki bezpieczeństwa HTTP (HSTS, X-Frame...) | [security.md](./security.md) |
|
||||
| white-label | Branding panelu admina (logo + nazwa z SiteSettings) | [white-label.md](./white-label.md) |
|
||||
| content | Blog/archiwa: kolekcje pod stroną-archiwum, listing, paginacja, redirecty (resolveRedirect) | [content.md](./content.md) |
|
||||
|
||||
Nowy projekt krok po kroku: [getting-started.md](./getting-started.md)
|
||||
|
||||
+23
-1
@@ -40,7 +40,7 @@ import { AccessibilityProvider, AccessibilityWidget } from '@intecion/ipal-kit/c
|
||||
resetButton: 'a11y-reset',
|
||||
closeButton: 'a11y-close',
|
||||
}}
|
||||
texts={{ title: 'Dostępność', reset: 'Resetuj' }} // opcjonalne, PL domyślnie
|
||||
texts={A11Y[locale]} // etykiety per locale; domyślnie ANGIELSKI
|
||||
/>
|
||||
</body>
|
||||
</AccessibilityProvider>
|
||||
@@ -48,6 +48,28 @@ import { AccessibilityProvider, AccessibilityWidget } from '@intecion/ipal-kit/c
|
||||
|
||||
Widget jest bez stylów (jak CookieBanner) — classNames dopasowujesz do designu.
|
||||
|
||||
## Etykiety — domyślnie angielski, konfiguracja per locale
|
||||
|
||||
Domyślne etykiety są **angielskie** (plugin jest wielojęzyczny, neutralny bazowo).
|
||||
Tłumaczenia trzymasz w projekcie i podajesz zestaw dla aktywnego języka przez
|
||||
`texts` (`A11yTexts`). Plugin pozostaje content-agnostyczny:
|
||||
|
||||
```tsx
|
||||
import type { A11yTexts } from '@intecion/ipal-kit/client'
|
||||
|
||||
const A11Y: Record<string, A11yTexts> = {
|
||||
pl: { title: 'Dostępność', textSize: 'Rozmiar tekstu', reset: 'Resetuj', /* … */ },
|
||||
de: { title: 'Barrierefreiheit', textSize: 'Textgröße', /* … */ },
|
||||
}
|
||||
|
||||
<AccessibilityWidget texts={A11Y[locale]} classNames={{ /* … */ }} />
|
||||
```
|
||||
|
||||
Podajesz tylko te klucze, które chcesz nadpisać — reszta spadnie na angielski
|
||||
default. Możesz też trzymać etykiety w zlokalizowanym globalu i czytać je z panelu
|
||||
(spójne z „zarządzanie z panelu"), ale to już decyzja projektu — plugin wymaga
|
||||
tylko `A11yTexts` dla bieżącego locale.
|
||||
|
||||
---
|
||||
|
||||
## 2. CSS reagujący na atrybuty (OBOWIĄZKOWE — projekt)
|
||||
|
||||
@@ -210,7 +210,7 @@ Wpinaj w kolekcje gdzie dotyczy (patrz `hooks.md`):
|
||||
|
||||
- **buildSecurityHeaders** w next.config — HSTS, COOP, nosniff, Referrer-Policy (z automatu, uniwersalne).
|
||||
- **buildCsp** — generator CSP z twardymi regułami (base-uri, object-src, frame-ancestors). Flagi: turnstile, analytics, youtube, r2Url. Wdrażaj przez `report-only` → sprawdź konsolę → `enforce`.
|
||||
- **2FA WYMUSZONE** — `ipalKit({ twoFactor: { issuer: 'Nazwa Firmy' } })` + `pnpm add @clocklimited/payload-2fa@3.0.0-beta.7`. Wymuszone dla WSZYSTKICH użytkowników (forceSetup), bez opcji wyłączenia per user. NIE ustawiaj `twoFactor: false` (chyba że klient wprost odmawia). Bez zależności = błąd buildu. Patrz security.md.
|
||||
- **2FA WYMUSZONE** — `pnpm add @clocklimited/[email protected]`, potem WSTRZYKNIJ: `import { payloadTotp } from '@clocklimited/payload-2fa'` + `ipalKit({ twoFactor: { issuer: 'Nazwa Firmy', plugin: payloadTotp } })`. Wstrzyknięcie obowiązkowe — bez niego plugin robi dynamiczny import, którego Next nie wbundluje → „Cannot find module" na froncie. (Ewentualnie: `serverExternalPackages: ['@clocklimited/payload-2fa']` w next.config.) Wymuszone dla WSZYSTKICH (forceSetup), bez opcji per user. NIE `twoFactor: false` (chyba że klient wprost odmawia). Patrz security.md.
|
||||
- **Ścieżka panelu** — `ipalKit({ adminRoute: '/its' })` ukrywa panel. WYMAGA przeniesienia folderu `app/(payload)/admin/` → `app/(payload)/its/`. To obscurity, nie security (2FA to prawdziwa ochrona).
|
||||
- CSP zostaje w projekcie (domeny), ale skeleton z pluginu. NIE Trusted Types (psuje Turnstile/GA).
|
||||
|
||||
@@ -252,6 +252,8 @@ Ten plik to skondensowane reguły. Szczegóły w `node_modules/@intecion/ipal-ki
|
||||
| Walidacja ENV na starcie (assertEnv) | `env.md` |
|
||||
| Czytelność dla AI: Markdown per strona, llms-full, boty AI w robots | `content.md`, `seo.md` |
|
||||
| Serwer MCP strony (Claude podłącza się do treści) | `mcp.md` |
|
||||
| GTM + Meta Pixel — konfiguracja krok po kroku | `gtm-meta-pixel.md` |
|
||||
| White-label panelu admina (logo/nazwa z SiteSettings) | `white-label.md` |
|
||||
| Bezpieczeństwo, CSP, COOP | `security.md` |
|
||||
| Formularze, Turnstile, submitForm, useForm/useContactForm | `forms.md`, `turnstile.md` |
|
||||
| i18n, strona jednojęzyczna, ścieżki | `i18n.md` |
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user